kongo86 / pefile

Automatically exported from code.google.com/p/pefile
Other
0 stars 0 forks source link

pefile.write() doesn't correctly write out Section Charistic Flags #19

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
When changing the flags in pefile.SectionStructures structure 
(IMAGE_SCN_MEM_WRITE in my case) the information isn't written to the file.

Reproduce:
load exe
change IMAGE_SCN_MEM_WRITE flag in .text section (tho it shouldn't matter)
write file to disk
check flags -> same as before

Original issue reported on code.google.com by MindRio...@gmail.com on 12 Aug 2010 at 9:25

GoogleCodeExporter commented 9 years ago
Beware that the characteristics of the section are stored in the 
"Characteristics" attribute of the section instance. Modifying that attribute 
will lead to successful modification of the value in the saved image.
In the other hand, if you are merely changing "section.IMAGE_SCN_MEM_WRITE" 
from True to False or viceversa, that will have no effect as those attributes 
are there simply to make the flags more easily accessible/readable.

Original comment by ero.carr...@gmail.com on 17 Aug 2010 at 12:05