1

I am trying to add new functionality to a hard-coded exe of a game like adding new creatures and new spells and adding spells to creatures that did not have them before. For that I need to significantly modify the exe.

It should be theoretically possible to expand an exe file somehow by increasing its binary size. Browsing on the internet I have stumbled upon this tool:http://www.cgsoftlabs.ro/studpe.html

Since I am a RE and assembly newbie I do not get at all how this operates and how I could expand an exe using this.

I have heard about some tools that make this possible on Linux. Are there Windows equivalents?

Alternatively, maybe I could use some sort of dll injection to expand the .exe? Or maybe add functionality through some hooking?

closed as off-topic by perror, peter ferrie, jvoisin, Dominik Antal, ixje Nov 30 '15 at 11:04

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions asking for help reverse-engineering a specific system are off-topic unless they demonstrate an understanding of the concepts involved and clearly identify a specific problem." – perror, peter ferrie, jvoisin, Dominik Antal, ixje
If this question can be reworded to fit the rules in the help center, please edit the question.

2

Sure its possible to increase exe size (that's the trivial part) you just need to add new section to section table. I recommend CFF explorer IMHO the best PE view/edit tool. Invoke context menu from section headers (on the right side) to add new section then fill it with the code, data you want. Next you need to reverse the game and see how its structured and where to patch the code so it will jump to your code. For dll injection you could use Cheat engine they have a very nice tutorial but you still need to reverse the game and write injection code.dll.

  • I tested it on a test.exe file that was written in c++. After realigning the file, it lost its libraries and was reduced to base PE size. How do I avoid losing libs when realigning? – Stanislaw T Nov 26 '15 at 13:10
  • I dont understand, why do you realign. Do you use CFF explorer ? it will do everything for you – krusty Nov 26 '15 at 13:37
  • Because I was trying to add a big chunk (8000h). I am using CFF explorer. – Stanislaw T Nov 26 '15 at 15:27

Not the answer you're looking for? Browse other questions tagged or ask your own question.