Some assembly patches require adding more code which in terms require more space in the executable. One way to do it is to strip executable relocation table which is used for debugging purposes and not necessary for the game to run.
Requirements[]
- Download STUD_PE [1]
- Get a copy of H5_game.exe
Strip relocation[]
- Open STUD_PE application and drag H5_game.exe into it.
- Go to "Sections" tab
- Right click in the "Sections" area and select "Strip Relocation".
Relocation table is no longer present. Now add a new section with name "test1" where the code will reside.
- Right click in the "Sections" area and select "New Section".
- Window will open where the following details should be filled.
- Name: "test1"
- RawSize: 20000
- Virtual Size: 20000
- fill section with NULL bytes: checked
- Select Add
- Right click on the .test1 section -> "Edit Header"
- Make sure the following character flags are checked
- CODE
- INITIALIZED_DATA
- MEM_EXECUTE
- MEM_READ
- MEM_WRITE
- All other flags should be empty
It is now possible to add new code in the empty area through hex editing or applying patches.