Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- My little reverse-engineer: how to reverse NMS templates
- So you've opened IDA, loaded the game EXE (GoG 1.0) and let the auto-analysis finish, now what?
- 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)
- 1403FCBC0 xml_startTemplate
- 140B21130 xml_addBoolProperty
- 140B21240 xml_addIntProperty
- 140B22820 xml_addFloatProperty
- 140B39640 xml_addEnumProperty
- 140B22580 xml_addStringPropertyMaybe
- 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.
- After these functions have all been renamed you can begin!
- Well actually first here's an example of a reversed template, hit your G key again and jump to 140236EB0
- 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.
- 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 ^^
- 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.
- 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)
- Study the relationship between the code and the MBINEdit class closely, and you will eventually discover the truth of all things MBIN...
- or maybe not, but you should be able to work out how the MBINEdit class was made from that code though.
- 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)
- 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.
- 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