mirror of
https://github.com/dobin/SuperMega
synced 2026-06-02 17:27:10 +00:00
fix: bad error handling for missing carrier imports
This commit is contained in:
+1
-1
@@ -247,7 +247,7 @@ class SuperPe():
|
|||||||
for entry in iat[dll_name]:
|
for entry in iat[dll_name]:
|
||||||
if entry.func_name == func_name:
|
if entry.func_name == func_name:
|
||||||
return entry.iat_vaddr
|
return entry.iat_vaddr
|
||||||
raise Exception(f"Function {func_name} not found in IAT")
|
return None
|
||||||
|
|
||||||
|
|
||||||
def get_iat_entries(self) -> Dict[str, List[IatEntry]]:
|
def get_iat_entries(self) -> Dict[str, List[IatEntry]]:
|
||||||
|
|||||||
+4
-1
@@ -197,7 +197,10 @@ def start_real(settings: Settings):
|
|||||||
# CHECK if all are available in infectable, or abort (early check)
|
# CHECK if all are available in infectable, or abort (early check)
|
||||||
functions = project.injectable.get_unresolved_iat()
|
functions = project.injectable.get_unresolved_iat()
|
||||||
if len(functions) != 0 and settings.fix_missing_iat == False:
|
if len(functions) != 0 and settings.fix_missing_iat == False:
|
||||||
raise Exception("IAT entry not found: {}".format(", ".join(functions)))
|
logging.error("IAT entries not found in infectable: {}".format(", ".join(functions)))
|
||||||
|
logging.error("The carrier depends on these functions, but they are not available in the infectable exe.")
|
||||||
|
logging.error("Use another infectable exe, or update the carrier to not depend on these functions.")
|
||||||
|
raise Exception("Required carrier import not found in infectable: {}".format(", ".join(functions)))
|
||||||
|
|
||||||
# ASSEMBLE: Assemble .asm to .shc (ASM -> SHC)
|
# ASSEMBLE: Assemble .asm to .shc (ASM -> SHC)
|
||||||
carrier_shellcode: bytes = phases.assembler.asm_to_shellcode(
|
carrier_shellcode: bytes = phases.assembler.asm_to_shellcode(
|
||||||
|
|||||||
Reference in New Issue
Block a user