extending the .text section

greenspun.com : LUSENET : reverse engineering : One Thread

Ugh! Why does this seem to fail for me.. I've appended 1K bytes (just zero's) to the .text section and modified all the sections' offsets_in_file and "virtual" offsets. When ran it, the extra bytes weren't mapped to memory - aha, I thought - I had forgot to change the virtual size of the .text section, but as soon as I did that, it crashed on load (SoftIce reports page fault). Any ideas?

What exactly do I need to change?

-Henrik

-- Henrik Gram (hawk@helios.ikasths.dk), May 03, 1998

Answers

What you're trying to do is very difficult. You need to redo the relocation table for everything after the text section, and, even harder, everywhere there's a reference in the text section to an address in a later section, you've got to adjust that. I would give up. Also, it's going to be next to impossible if the reloc section is missing. Try adding a whole new section.

Quine

-- Quine (wvo_quine@hotmail.com), May 03, 1998.


Moderation questions? read the FAQ