refactor: source cleanup, exit codes on verify

This commit is contained in:
Dobin
2024-02-16 10:20:05 +00:00
parent 5eddee39ad
commit 60e5065938
4 changed files with 20 additions and 36 deletions
+2 -2
View File
@@ -32,7 +32,7 @@ def write_code_section(exe_file: FilePath, new_data: bytes):
f.write(new_data)
def get_code_section(pe) -> pefile.SectionStructure:
def get_code_section(pe: pefile.PE) -> pefile.SectionStructure:
entrypoint = pe.OPTIONAL_HEADER.AddressOfEntryPoint
for sect in pe.sections:
if sect.Characteristics & pefile.SECTION_CHARACTERISTICS['IMAGE_SCN_MEM_EXECUTE']:
@@ -106,7 +106,7 @@ def extract_iat(pe: pefile.PE):
return iat
def get_addr_for(iat, func_name):
def get_addr_for(iat, func_name: str) -> int:
for dll_name in iat:
for entry in iat[dll_name]:
if entry["func_name"] == func_name: