Advertisement
Guest User

Untitled

a guest
Aug 16th, 2016
2,833
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.30 KB | None | 0 0
  1. My little reverse-engineer: how to reverse NMS templates
  2.  
  3. So you've opened IDA, loaded the game EXE (GoG 1.0) and let the auto-analysis finish, now what?
  4.  
  5. Well hit your G key which should open up the "Jump to address" window, and put in one of these addresses (without the xml_ part)
  6. 1403FCBC0 xml_startTemplate
  7. 140B21130 xml_addBoolProperty
  8. 140B21240 xml_addIntProperty
  9. 140B22820 xml_addFloatProperty
  10. 140B39640 xml_addEnumProperty
  11. 140B22580 xml_addStringPropertyMaybe
  12.  
  13. Once you've jumped to that function, click on the sub_140xxxxx name and press N, which'll open up a rename window, then put in the corresponding xml_* name from next to the offset.
  14. After these functions have all been renamed you can begin!
  15.  
  16. Well actually first here's an example of a reversed template, hit your G key again and jump to 140236EB0
  17. This is the function for the GcUserSettingsData template, which I've already reversed inside MBINEdit, if you've named those xml_* funcs above correctly you should see that this function calls a bunch of them.
  18. Now click on the sub_140236EB0 name and press N, and rename this sub to "template_GcUserSettingsData", and there you go, you've found your first template ^^
  19.  
  20. Now for the reversing part, click on the template_GcUserSettingsData name and press F5, this should open up HexRays decompiler if you have it installed, which makes the reversing much easier for you.
  21. See the code it gives you? Compare this code to the cGcUserSettingsData class inside MBINEdit (https://github.com/emoose/MBINEdit/blob/master/MBINEdit/MBINStructs.cs#L432)
  22. Study the relationship between the code and the MBINEdit class closely, and you will eventually discover the truth of all things MBIN...
  23. or maybe not, but you should be able to work out how the MBINEdit class was made from that code though.
  24.  
  25. Once it's clicked for you, jump to the xml_startTemplate function (press G and type in xml_startTemplate, once you've named the function you won't need the offset anymore)
  26. Now click on the xml_startTemplate name and press X, this brings up a list of all the references in the exe to that function, in this case all the functions that create a template will be shown.
  27. Click on a random one, and enjoy trying to reverse it :3 Remember to press F5 inside a function to get the decompiled output, it'll make it a lot easier for you!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement