You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running the lief/examples/python/pe_from_scratch.py script, the 32-bit (x86) binary that is produced has the wrong size of optional header in the file header. The incorrect value it keeps producing is 0x60 which prevents tools like CFF Explorer or PE Bear from being able to read the PE file correctly saying section misaligned to file alignment. When I examine other x86 Windows binaries, they all have 0xE0 for the size. When I use a hex editor to manually change this optional header size value from 0x60 to 0xE0, the PE reader tools I previously mentioned work again and the binary runs correctly.
The pe_from_scratch.py file is slightly out of date in the fact I had to remove the name string from the call to binary32 = PE.Binary(PE.PE_TYPE.PE32). Also, I have to add the line binary32.header.add_characteristic(lief.PE.Header.CHARACTERISTICS.EXECUTABLE_IMAGE) before the final building steps in the script to actually get generated pe_from_scratch.exe binary to run.
The text was updated successfully, but these errors were encountered:
When running the
lief/examples/python/pe_from_scratch.py
script, the 32-bit (x86) binary that is produced has the wrongsize of optional header
in thefile header
. The incorrect value it keeps producing is 0x60 which prevents tools likeCFF Explorer
orPE Bear
from being able to read the PE file correctly sayingsection misaligned to file alignment
. When I examine other x86 Windows binaries, they all have 0xE0 for the size. When I use a hex editor to manually change this optional header size value from 0x60 to 0xE0, the PE reader tools I previously mentioned work again and the binary runs correctly.The text was updated successfully, but these errors were encountered: