So the pastebin has swablu right, as 0x1a7? Well it turns out that if you shove 01a7 in the game usually freezes or gives you some random pokemon you don't want. I found out that 0x1a7 should actually be A701Sorry what do you mean by reverse the ids in a specifc way?
So your salamence is 0x1d8. It should probably be D801. I think