pebutcher, Portable Executable reader and alteration module
This project is a fork from the awesome pefile project : https://github.com/erocarrera/pefile
from pebutcher import PE
pe = PE("/tmp/test.exe")
section_data = b"sectionData"
pe.add_section(".sect", 0x60000020, data=section_data)
for pebutcher import PE
pe = PE("/tmp/test.exe")
section_data = b"sectionData"
section = pe.sections[-1]
section.set_data(section_data)
for pebutcher import PE
pe = PE("/tmp/test.exe")
pe.add_new_imports({"USER32.dll": ["MessageBoxA"]})