Question

I am trying to do a academic experiments and basically what I am trying to do is

insert and remove some garbage instructions like these into the ELF or PE file.

Pop eax
NOP
NOP
NOP
Push eax

So my questions are how to insert certain instructions without change its original functionality.

It seems that I need to update the all the corresponding entries and tables according to the ELF/PE format, but basically how to do this and what should be updated ....?

After a search, I have not find some useful information or code related to this issue, so I wondering if anyone could give some help..? I really appreciate it!

Was it helpful?

Solution

Manual fixup of all branches would be rather tedious. So get a disassembler and an assembler, disassemble the file, insert your dummy command sequences, then reassemble. There's still a chance the code would break. Some executables deliberately check the integrity of their code as a copy protection measure.

If the executable was signed via Authenticode, you won't be able to restore the signature. The whole point of the digital signature is to prevent tampering of this sort.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top