Micrsoft PE format

Anyone know much about this?
I was just a bit bored and was thinking about how you could patch an executable (that you had written), replacing the contents of a static array with new values, and (where it probably gets messy) even chaning the size of the array (which would obviously require changing whatever limits the size of the array if you iterate through it).

I beleive that you can slap stuff at the end of an executable, which would allow you to check for and read any patches, But I would rather simply change the array.

Anyone know about this? Would I have to start patching addresses of things if the size of the array changes. Are there checksums on the data sections of an exe?

CC
 
Are you interested in obtaining the minimal change set required to change file A into file B? If so, look into one of the many utilities out there to do diff-style binary patches, such as PPF or Patch Factory...
 
No what I am interested in, is basically having like a template app, which you can then embed its data in at a later date without having to recomile it. So an example (not the particular one i have in mind) is to have an app to display a n image, but instead of pointing the app at a file you embed the image into the application. Obiously if you were trying to distribute lots of images then this would be inefficient, but if you want to ensure that someone has the required app to display your file.

CC
 
IIRC correctly you can edit a file's resources using visual studio. You can, for example, change the layout of the calc.exe dialog. I don't recall if it allows you to add binary data though, but it is possible to do that. Maybe other resource editors??
 
The PE format is fairly well documented, but the things that you are suggesting will not be the simplest things to do. Especially resizing an array. Sure, it's possible to do it (if the exe file still has all the relocation info) but would be messy.
 
Back
Top