Romhacking.net

Romhacking => Programming => Topic started by: TBartoli on December 12, 2013, 07:09:00 am

Title: Source files of an EXE
Post by: TBartoli on December 12, 2013, 07:09:00 am
Hello,

When i opened the exe file of a game with IDA Pro or Hex Workshop, in the text area (right sidebar) i can see the "C Language" source files.
For exemple:

C:\game\source\LibDG\dgd.c
C:\game\source\Thing\door.c
C:\game\source\Bullet\rmissile.c
C:\game\source\Bullet\blast.c
C:\game\source\Thing\sight.c

Etc...

My question is, can i extract these C files by anyway ?


And i have a problem with IDA Pro, when i want repack an EXE file like that : File/Produce File/Create EXE File, i have this error:
(http://img11.hostingpics.net/pics/3580375301.png)

How can i repack it ?

Thanks for your help  :angel:
Title: Re: Source files of an EXE
Post by: henke37 on December 12, 2013, 10:10:01 am
You need to actually get the source files and compile them, just like the original developer did.
Title: Re: Source files of an EXE
Post by: Zoinkity on December 12, 2013, 12:20:23 pm
The reason you can see the filenames at all is because they were compiled into the executable.  If the programmers had opted to strip the executable you would probably see a numerical placeholder or something along those lines.

It's fairly rare to be able to decompile a compiled program into its source.  Even then, you'd have to know the compiler and have a set of the exact libraries used, but it wouldn't exactly be automatic.  The best analogy would be comparing output from tools like that to machine translators.  It's almost, but not quite, completely unusable ;*)
Title: Re: Source files of an EXE
Post by: TBartoli on December 12, 2013, 01:26:45 pm
Ok,

Thanks for these informations.  :thumbsup: