refactor: :x -> :X

This commit is contained in:
Dobin
2024-03-04 18:32:41 +00:00
parent 9a9297e150
commit dacef30bb0
6 changed files with 23 additions and 18 deletions
+1 -1
View File
@@ -45,7 +45,7 @@ def merge_loader_payload(
pass
elif decoder_style == DecoderStyle.XOR_1:
xor_key = config.xor_key
logger.info("---[ XOR payload with key 0x{:x}".format(xor_key))
logger.info("---[ XOR payload with key 0x{:X}".format(xor_key))
payload_data = bytes([byte ^ xor_key for byte in payload_data])
logger.info("---[ Size: Stager: {} and Payload: {} Sum: {} ".format(
+3 -3
View File
@@ -58,7 +58,7 @@ def inject_exe(
if True:
injected_fix_data(superpe, project.carrier, project.exe_host)
superpe.write(exe_out)
superpe.write_pe_to_file(exe_out)
# verify and log
shellcode = file_readall_binary(shellcode_in)
@@ -86,7 +86,7 @@ def injected_fix_iat(superpe: SuperPe, carrier: Carrier, exe_host: ExeHost):
offset_from_code = code.index(iatRequest.placeholder)
instruction_virtual_address = offset_from_code + exe_host.image_base + exe_host.code_virtaddr
logger.info(" Replace {} at VA 0x{:x} with call to IAT at VA 0x{:x}".format(
logger.info(" Replace {} at VA 0x{:X} with call to IAT at VA 0x{:X}".format(
iatRequest.placeholder.hex(), instruction_virtual_address, destination_virtual_address
))
jmp = assemble_and_disassemble_jump(
@@ -147,7 +147,7 @@ def injected_fix_data(superpe: SuperPe, carrier: Carrier, exe_host: ExeHost):
offset_from_datasection = code.index(datareuse_fixup.randbytes)
instruction_virtual_address = offset_from_datasection + exe_host.image_base + exe_host.code_virtaddr
destination_virtual_address = datareuse_fixup.addr
logger.info(" Replace {} at VA 0x{:x} with .rdata LEA at VA 0x{:x}".format(
logger.info(" Replace {} at VA 0x{:X} with .rdata LEA at VA 0x{:X}".format(
datareuse_fixup.randbytes.hex(), instruction_virtual_address, destination_virtual_address
))
lea = assemble_lea(