Mike LS
Mike LS

Reputation: 1

Changing obj code section

I am trying to change the code section after compiling but before linking (after obj is created but before it is linked to an exe).

I am able to locate the code section and add any number of NOPs to its end and the exe works fine; however, if I add a NOP to the beginning or middle of the section, the exe crashes.

I did update all the sections headers (pointer to data & pointer to relocations) according to the change size (delta), but I'm probably missing something else I need to fix. Since it works when I append to the end, it feels like an in-section-offset problem.

Upvotes: 0

Views: 32

Answers (0)

Related Questions