refactor: more consistent log output indent

This commit is contained in:
Dobin Rutishauser
2024-06-22 16:35:20 +02:00
parent bbd3297a95
commit 4e62df29db
6 changed files with 10 additions and 10 deletions
+2 -2
View File
@@ -32,7 +32,7 @@ class FunctionBackdoorer:
def backdoor_function(self, function_addr: int, shellcode_addr: int, shellcode_len: int):
logger.info("Backdooring function at 0x{:X} (jump to shellcode at 0x{:X})".format(function_addr, shellcode_addr))
logger.info("--[ Backdooring exe function at 0x{:X} with jump to carrier at 0x{:X}".format(function_addr, shellcode_addr))
addr = self.find_suitable_instruction_addr(function_addr)
if addr is None:
@@ -64,7 +64,7 @@ class FunctionBackdoorer:
def find_suitable_instruction_addr(self, startOffset, length=256):
"""Find a instruction to backdoor. Recursively."""
logger.info("find suitable instruction to hijack starting from 0x{:X} len:{} depthopt:{}".format(
logger.info("---[ find suitable instruction to hijack starting from 0x{:X} len:{} depthopt:{}".format(
startOffset, length, self.depth_option))
if self.depth_option == DEPTH_OPTIONS.LEVEL1:
+1 -1
View File
@@ -11,7 +11,7 @@ logger = logging.getLogger("Assembler")
def asm_to_shellcode(asm_in: FilePath, build_exe: FilePath) -> bytes:
"""Takes ASM source file asm_in, compiles it into build_exe, extracts its code section and write into shellcode_out"""
logger.info("--[ Assemble to exe: {} -> {}".format(asm_in, build_exe))
logger.info("-[ Assemble to exe: {} -> {}".format(asm_in, build_exe))
run_process_checkret([
config.get("path_ml64"),
asm_in,
+2 -2
View File
@@ -22,7 +22,7 @@ def compile_dev(
asm_out: FilePath,
short_call_patching: bool = False,
):
logger.info("--( Compile C to ASM: {} -> {} ".format(c_in, asm_out))
logger.info("-( Compile C to ASM: {} -> {} ".format(c_in, asm_out))
# Compile C To Assembly (text)
run_process_checkret([
@@ -54,7 +54,7 @@ def compile(
carrier: Carrier,
settings: Settings,
):
logger.info("--[ Compile C to ASM: {} -> {} ".format(c_in, asm_out))
logger.info("-[ Compile C to ASM: {} -> {} ".format(c_in, asm_out))
# Compile C To Assembly (text)
run_process_checkret([
+3 -3
View File
@@ -23,7 +23,7 @@ def inject_exe(carrier_shc: bytes, settings: Settings, carrier: Carrier, payload
exe_out = settings.inject_exe_out
carrier_invoke_style: CarrierInvokeStyle = settings.carrier_invoke_style
logger.info("--[ Injecting: into {} -> {}".format(exe_in, exe_out))
logger.info("-[ Injecting: into {} -> {}".format(exe_in, exe_out))
# CHECK if shellcode fits into the target code section
carrier_shc_len = len(carrier_shc)
@@ -42,7 +42,7 @@ def inject_exe(carrier_shc: bytes, settings: Settings, carrier: Carrier, payload
# skip available
addr = superpe.get_vaddr_of_iatentry(iatRequest.name)
if addr != None:
logger.info(" Request IAT {} is available at 0x{:X}".format(
logger.info("---[ Request IAT {} is available at 0x{:X}".format(
iatRequest.name, addr))
continue
iat_name = superpe.get_replacement_iat_for("KERNEL32.dll", iatRequest.name)
@@ -98,7 +98,7 @@ def inject_exe(carrier_shc: bytes, settings: Settings, carrier: Carrier, payload
shellcode_rva = align_to_page_size(shellcode_rva, carrier_shc_len - len(payload.payload_data))
carrier_shc_offset = superpe.pe.get_offset_from_rva(shellcode_rva)
logger.info("---( Inject: Write Carrier to 0x{:X} (0x{:X})".format(
logger.info("--[ Inject: Write Carrier to 0x{:X} (0x{:X})".format(
shellcode_rva, carrier_shc_offset))
# Copy the shellcode
+1 -1
View File
@@ -23,7 +23,7 @@ def get_template_names() -> List[str]:
def create_c_from_template(settings: Settings, payload_len: int):
logger.info("--( Create C from template: {} -> {}".format(
logger.info("-( Create C from template: {} -> {}".format(
PATH_DECODER, settings.main_c_path))
plugin_decoder = ""
+1 -1
View File
@@ -151,7 +151,7 @@ def start_real(settings: Settings):
project.settings.decoder_style.value,
project.settings.carrier_invoke_style.value))
logger.info("---[ Plugins: AntiEmulation={} Decoy={} Guardrail={}".format(
logger.info("--[ Plugins: AntiEmulation={} Decoy={} Guardrail={}".format(
project.settings.plugin_antiemulation,
project.settings.plugin_decoy,
project.settings.plugin_guardrail)