Add info to PE image

  • Thread starter Thread starter Z. V
  • Start date Start date
Z

Z. V

Guest
Hello,

I want to add information at the end of an exe file.

So I incremented NumberOfSections in IMAGE_FILE_HEADER

Right after last section header (9 in my file) I added a new header (IMAGE_SECTION_HEADER)

In this header I set all fields to 0x0 but:

PointerToRawData = 0x8C00 (this is the size of the original file)

SizeOfRawData = 0x200

Characteristics = IMAGE_SCN_LNK_REMOVE

Name = ".commit"

At the end of the file I added 0x200 bytes of some data.

1597903.png

But when I tried to run this file I got: Access is denied

Can you please tell what is wrong in my new exe file ?

In the original file, Checksum in IMAGE_OPTIONAL_HEADER is 0x0.

Should I recalculate it ?

Thank you,

Zvika

Continue reading...
 
Back
Top