Quote:
nofun (07-07-2001 12:41):
BTW, does anyone know of a good tool for adding space to a specific offset of an existing section instead of creating a new section in a PE file? |
Hiya,
Most, if not all, PE utilites add an extra section or append space to the last section rather than allowing you to add to an existing section. Till I found the following essay by c0v3rt+ I too wondered why this is so.
As it ends up, adding to an existing section is a formidable (if not impossible) task without relinking the file.
Here's a small excerpt in explanation from c0v3rt+ 's essay:
**************************************
If there is not sufficient space at the end of the text section you will need to extend it. This poses a number of problems.
1. If the section is followed by other sections then you will need to move the following sections up to make room
2. There are various references within the file headers that will need to be adjusted if you change the file size.
3. References between various sections (such as references to data values from the code section) will all need to be adjusted. This is practically impossible to do without re-compiling and re-linking the original file.
Most of these problems can be avoided by appending to the last section in the exe file. This however poses a number of further problems, none of which are insurmountable.
**************************************
For additional info, check out entire essay at the following link:
http://208.50.16.104/fravia/covert1.htm
Does creating a new section pose a problem for you with the app you're working on ?
Regards,
Clandestiny