fix: masm_shc error because of late include fixes

This commit is contained in:
Dobin
2024-02-17 19:34:22 +00:00
parent 2524547ccf
commit 3bb7562bfa
+6 -5
View File
@@ -72,6 +72,12 @@ def fixup_asm_file(filename: FilePath, payload_len: int):
# if "jmp\tSHORT" in lines[idx]:
# lines[idx] = lines[idx].replace("SHORT", "")
for idx, line in enumerate(lines):
# Remove EXTRN, we dont need it
# Even tho it is part of IAT_REUSE process (see fixup_iat_reuse())
if "EXTRN __imp_" in lines[idx]:
lines[idx] = "; " + lines[idx]
# replace external reference with shellcode reference
for idx, line in enumerate(lines):
if "supermega_payload" in lines[idx]:
@@ -137,11 +143,6 @@ def fixup_iat_reuse(filename: FilePath, exe_info):
# do IAT reuse
for idx, line in enumerate(lines):
# Remove EXTRN, we dont need it
if "EXTRN __imp_" in lines[idx]:
lines[idx] = "; " + lines[idx]
continue
# Fix call
# call QWORD PTR __imp_GetEnvironmentVariableW
if "call" in lines[idx] and "__imp_" in lines[idx]: