Page 1 of 1

Executable file modification.

Posted: Mon Jun 05, 2017 8:22 am
by Kneesnap
I'm working on making an editor for an old PC game. I have a import / exporter working, so I can create / modify the custom files to my liking, but I am now realizing a hole in my plan. The executable has a file inside of it with information on each file in the game. I figured since I could open the executable in 7zip I could just edit the file and drop the new file in there. Turns out, when I try to do that I get an "Unsupported Operation" error. I figure I can just have my editor modify the executable itself and replace the old data.

I have a few questions:
a) What potential problems could I come into doing this? I don't have any experience meddling with executables before.
b) Are there any better ways / tools of doing this?

Re: Executable file modification.

Posted: Mon Jun 05, 2017 5:36 pm
by Gh0stBlade
You have to be more clear.

The data that is contained within the exe contains what exactly? Offsets into the main archive file hardcoded? checksums?

Re: Executable file modification.

Posted: Mon Jun 05, 2017 7:07 pm
by Kneesnap
Gh0stBlade wrote:You have to be more clear.

The data that is contained within the exe contains what exactly? Offsets into the main archive file hardcoded? checksums?
The file "104" in the exe (file in question) is structured like this:

For each file in the game archive,

int - nameOffset (Points below, to the name of this file.)
int - fileCategory (Unsure what the purpose of this is, but it appears to categorize file types.)
int - fileType (Determines what type of file this is)
int - offset (The offset in the main game archive where the file is found.)
int - zero
int - zero
int - Raw Size
int - Uncompressed Size (If applicable)

Then after all of this it has the filename of each file in the archive.