READ THE RULES: Click here

Follow us on Facebook: https://www.facebook.com/xentax/ :)

Relating source code to binary

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

Relating source code to binary

Post by Kneesnap » Thu Oct 12, 2017 1:05 am

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: 601
Joined: Fri Nov 06, 2009 12:13 am
Has thanked: 74 times
Been thanked: 132 times

Re: Relating source code to binary

Post by WRS » Thu Oct 12, 2017 10:36 pm

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
n00b
Posts: 16
Joined: Wed Apr 05, 2017 9:01 pm
Has thanked: 1 time
Been thanked: 2 times

Re: Relating source code to binary

Post by Kneesnap » Wed Dec 06, 2017 7:52 pm

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