mirror of
https://github.com/dobin/SuperMega
synced 2026-06-03 01:27:11 +00:00
debug: config.debug feature for more logs/
This commit is contained in:
@@ -8,6 +8,7 @@ class Config(object):
|
|||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.data = {}
|
self.data = {}
|
||||||
self.ShowCommandOutput: bool = False
|
self.ShowCommandOutput: bool = False
|
||||||
|
self.debug: bool = False
|
||||||
|
|
||||||
def getConfigPath(self):
|
def getConfigPath(self):
|
||||||
return CONFIG_FILE
|
return CONFIG_FILE
|
||||||
|
|||||||
+8
-3
@@ -37,7 +37,9 @@ def compile(
|
|||||||
logger.info("---[ ASM Fixup : {} ".format(asm_out))
|
logger.info("---[ ASM Fixup : {} ".format(asm_out))
|
||||||
if not fixup_asm_file(asm_out, payload_len, short_call_patching=short_call_patching):
|
if not fixup_asm_file(asm_out, payload_len, short_call_patching=short_call_patching):
|
||||||
raise Exception("Error: Fixup failed")
|
raise Exception("Error: Fixup failed")
|
||||||
#observer.add_text("carrier_asm_fixup", file_readall_text(asm_out))
|
|
||||||
|
if config.debug:
|
||||||
|
observer.add_text("carrier_asm_fixup", file_readall_text(asm_out))
|
||||||
|
|
||||||
# Assembly cleanup (masm_shc)
|
# Assembly cleanup (masm_shc)
|
||||||
asm_clean_file = asm_out + ".clean"
|
asm_clean_file = asm_out + ".clean"
|
||||||
@@ -52,7 +54,8 @@ def compile(
|
|||||||
|
|
||||||
# Move to destination we expect
|
# Move to destination we expect
|
||||||
shutil.move(asm_clean_file, asm_out)
|
shutil.move(asm_clean_file, asm_out)
|
||||||
#observer.add_text("carrier_asm_cleanup", file_readall_text(asm_out))
|
if config.debug:
|
||||||
|
observer.add_text("carrier_asm_cleanup", file_readall_text(asm_out))
|
||||||
|
|
||||||
|
|
||||||
def bytes_to_asm_db(byte_data: bytes) -> bytes:
|
def bytes_to_asm_db(byte_data: bytes) -> bytes:
|
||||||
@@ -151,4 +154,6 @@ def fixup_iat_reuse(filename: FilePath, exe_info):
|
|||||||
|
|
||||||
with open(filename, 'w') as asmfile:
|
with open(filename, 'w') as asmfile:
|
||||||
asmfile.writelines(lines)
|
asmfile.writelines(lines)
|
||||||
#observer.add_text("carrier_asm_iat_patch", file_readall_text(filename))
|
|
||||||
|
if config.debug:
|
||||||
|
observer.add_text("carrier_asm_iat_patch", file_readall_text(filename))
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ def inject_exe(
|
|||||||
code = extract_code_from_exe(exe_out)
|
code = extract_code_from_exe(exe_out)
|
||||||
in_code = code[peinj.shellcodeOffsetRel:peinj.shellcodeOffsetRel+shellcode_len]
|
in_code = code[peinj.shellcodeOffsetRel:peinj.shellcodeOffsetRel+shellcode_len]
|
||||||
jmp_code = code[peinj.backdoorOffsetRel:peinj.backdoorOffsetRel+12]
|
jmp_code = code[peinj.backdoorOffsetRel:peinj.backdoorOffsetRel+12]
|
||||||
|
if config.debug:
|
||||||
observer.add_code("exe_extracted_loader", in_code)
|
observer.add_code("exe_extracted_loader", in_code)
|
||||||
observer.add_code("exe_extracted_jmp", jmp_code)
|
observer.add_code("exe_extracted_jmp", jmp_code)
|
||||||
if in_code != shellcode:
|
if in_code != shellcode:
|
||||||
|
|||||||
Reference in New Issue
Block a user