refactor: log msgs, and var renaming

This commit is contained in:
Dobin
2024-02-26 20:18:15 +00:00
parent 16438e799b
commit a13d86d9cd
6 changed files with 28 additions and 36 deletions
+9 -2
View File
@@ -103,8 +103,15 @@ class ExeHost():
'type': reloc_type,
})
# rwx
self.rwx_section = pehelper.get_rwx_section(pe)
# rwx section
entrypoint = pe.OPTIONAL_HEADER.AddressOfEntryPoint
for section in pe.sections:
if (section.Characteristics & pefile.SECTION_CHARACTERISTICS['IMAGE_SCN_MEM_READ'] and
section.Characteristics & pefile.SECTION_CHARACTERISTICS['IMAGE_SCN_MEM_WRITE'] and
section.Characteristics & pefile.SECTION_CHARACTERISTICS['IMAGE_SCN_MEM_EXECUTE']
):
if entrypoint > section.VirtualAddress and entrypoint < section.VirtualAddress + section.Misc_VirtualSize:
self.rwx_section = section
# If the PE file was loaded using the fast_load=True argument, we will need to parse the data directories:
#pe.parse_data_directories()