Important information: this site is currently scheduled to go offline indefinitely by end of the year.

Relating source code to binary

Coders and would-be coders alike, this is the place to talk about programming.
Post Reply
Kneesnap
beginner
Posts: 24
Joined: Wed Apr 05, 2017 9:01 pm
Has thanked: 3 times
Been thanked: 2 times

Relating source code to binary

Post by Kneesnap »

Hey, I've acquired the source code to an old PSX/PC game, and I'm currently working a level editor for the game. I'd like to be able to modify the .exe's binary data. (IE: Map registries, modify the information about texture id, theme id, etc). How can I calculate the hex position of values in a .exe if I have the source code? Unfortunately I do not have the exact values, so I cannot do a search in a hex editor. (The exact values were in a dynamically generated header file created upon building the main game archive, as to which I do not have the means of building yet.)
WRS
ultra-veteran
ultra-veteran
Posts: 603
Joined: Fri Nov 06, 2009 12:13 am
Has thanked: 74 times
Been thanked: 137 times

Re: Relating source code to binary

Post by WRS »

Kneesnap wrote:Hey, I've acquired the source code to an old PSX/PC game, and I'm currently working a level editor for the game. I'd like to be able to modify the .exe's binary data. (IE: Map registries, modify the information about texture id, theme id, etc). How can I calculate the hex position of values in a .exe if I have the source code? Unfortunately I do not have the exact values, so I cannot do a search in a hex editor. (The exact values were in a dynamically generated header file created upon building the main game archive, as to which I do not have the means of building yet.)
ooh good question!!

if you have the source code you should be able to compile the code to .exe - why do you need to modify existing binary data?

(and you won't be able to know the actual address of any source code unless you can build (byte for byte) using the same compiler, and build settings)
Useful tool links:
Kneesnap
beginner
Posts: 24
Joined: Wed Apr 05, 2017 9:01 pm
Has thanked: 3 times
Been thanked: 2 times

Re: Relating source code to binary

Post by Kneesnap »

WRS wrote:
Kneesnap wrote:Hey, I've acquired the source code to an old PSX/PC game, and I'm currently working a level editor for the game. I'd like to be able to modify the .exe's binary data. (IE: Map registries, modify the information about texture id, theme id, etc). How can I calculate the hex position of values in a .exe if I have the source code? Unfortunately I do not have the exact values, so I cannot do a search in a hex editor. (The exact values were in a dynamically generated header file created upon building the main game archive, as to which I do not have the means of building yet.)
ooh good question!!

if you have the source code you should be able to compile the code to .exe - why do you need to modify existing binary data?

(and you won't be able to know the actual address of any source code unless you can build (byte for byte) using the same compiler, and build settings)
Oops, I somehow didn't get notified for this topic. I can't compile it right now for several reasons. The source code I have was not the final build of the game, and the PC port is not complete yet. I'm still working on building the PSX version though. I've been slowly learning and been using a disassembler to find most things, but I'm still having trouble finding stuff in some of the more complex parts, like trying to disable culling :D
Post Reply