mirror of
https://github.com/dobin/SuperMega
synced 2026-06-02 17:27:10 +00:00
refactor: better logs/ output to parse
This commit is contained in:
+2
-2
@@ -22,7 +22,7 @@ def asm_to_shellcode(asm_in: FilePath, build_exe: FilePath, shellcode_out: FileP
|
||||
if not os.path.isfile(build_exe):
|
||||
raise Exception("Compiling failed")
|
||||
code = extract_code_from_exe(build_exe)
|
||||
observer.add_code("generate_shc_from_asm", code)
|
||||
observer.add_code("carrier_shc", code)
|
||||
with open(shellcode_out, 'wb') as f:
|
||||
f.write(code)
|
||||
|
||||
@@ -54,4 +54,4 @@ def merge_loader_payload(
|
||||
# append them
|
||||
data = data_stager + payload_data
|
||||
output.write(data)
|
||||
observer.add_code("final_shellcode", data)
|
||||
observer.add_code("loader_shc", data)
|
||||
|
||||
+3
-3
@@ -31,13 +31,13 @@ def compile(
|
||||
])
|
||||
if not os.path.isfile(asm_out):
|
||||
raise Exception("Error: Compiling failed")
|
||||
observer.add_text("payload_asm_orig", file_readall_text(asm_out))
|
||||
observer.add_text("carrier_asm_orig", file_readall_text(asm_out))
|
||||
|
||||
# Assembly text fixup (SuperMega)
|
||||
logger.info("---[ Fixup : {} ".format(asm_out))
|
||||
if not fixup_asm_file(asm_out, payload_len):
|
||||
raise Exception("Error: Fixup failed")
|
||||
observer.add_text("payload_asm_fixup", file_readall_text(asm_out))
|
||||
observer.add_text("carrier_asm_fixup", file_readall_text(asm_out))
|
||||
|
||||
# Assembly cleanup (masm_shc)
|
||||
asm_clean_file = asm_out + ".clean"
|
||||
@@ -52,7 +52,7 @@ def compile(
|
||||
|
||||
# Move to destination we expect
|
||||
shutil.move(asm_clean_file, asm_out)
|
||||
observer.add_text("payload_asm_cleanup", file_readall_text(asm_out))
|
||||
observer.add_text("carrier_asm_cleanup", file_readall_text(asm_out))
|
||||
|
||||
|
||||
def bytes_to_asm_db(byte_data: bytes) -> bytes:
|
||||
|
||||
Reference in New Issue
Block a user