SC4 Devotion Forum Archives

SimCity 4 General Discussion and Tutorials => SimCity 4 General Discussion => Topic started by: GoaSkin on November 27, 2007, 09:51:43 AM

Title: extracting object files from a binary
Post by: GoaSkin on November 27, 2007, 09:51:43 AM
After examining the assembler code of some functions in the SC4RH binary, I enhanced some functions for new game features. Because a binary file uses instructions to jump to specific byte positions, there is no way to insert assembler code directly. Is there a solution for that problem?

Is it possible to edit the assembler code with specific programs that automaticly fix the values of jmp/call instructions or a way to extract a specific object file that may be edited and then re-linked (may work to link it into a DLL as DLL plugin)?

I understand a bit of low level programming but do not have much experience with binary cosmetics.
Title: Re: extracting object files from a binary
Post by: wouanagaine on November 27, 2007, 12:03:24 PM
following my pm


original function code (x86):
somefunctionstartingadress : push eax
                                        mov eax,20
                                        ...
                                        pop eax
                                        ret

new code:
somefunctionstartingadress : jmp endofcode
                                        mov eax,20
                                        ...
                                        pop eax
                                        ret
endofcode: your new function code

hope it helps