mirror of
https://github.com/dobin/SuperMega
synced 2026-06-02 17:27:10 +00:00
refactor: wrong logging. -> logger.
This commit is contained in:
+1
-1
@@ -23,7 +23,7 @@ def asm_to_shellcode(asm_in: FilePath, build_exe: FilePath) -> bytes:
|
||||
if not os.path.isfile(build_exe):
|
||||
raise Exception("Compiling failed")
|
||||
code = extract_code_from_exe_file(build_exe)
|
||||
logging.info(" Carrier Size: {}".format(
|
||||
logger.info(" Carrier Size: {}".format(
|
||||
len(code)
|
||||
))
|
||||
return code
|
||||
|
||||
+2
-2
@@ -284,7 +284,7 @@ class Injector():
|
||||
if payload_rva == None:
|
||||
raise Exception("DataReuseFixup: payload_rva is None")
|
||||
datareuse_fixup.addr = payload_rva + self.injectable.superpe.get_image_base()
|
||||
logging.debug(" Add to .text at 0x{:X} ({}): {} with size {}".format(
|
||||
logger.debug(" Add to .text at 0x{:X} ({}): {} with size {}".format(
|
||||
datareuse_fixup.addr, payload_rva, datareuse_fixup.string_ref, len(datareuse_fixup.data)))
|
||||
|
||||
else: # .rdata
|
||||
@@ -301,7 +301,7 @@ class Injector():
|
||||
self.superpe.pe.set_bytes_at_rva(data_rva, var_data)
|
||||
datareuse_fixup.addr = data_rva + self.injectable.superpe.get_image_base()
|
||||
##
|
||||
logging.debug(" Add to .rdata at 0x{:X} ({}): {}: {}".format(
|
||||
logger.debug(" Add to .rdata at 0x{:X} ({}): {}: {}".format(
|
||||
datareuse_fixup.addr, data_rva, datareuse_fixup.string_ref, ui_string_decode(var_data)))
|
||||
|
||||
# replace the placeholder in .text with a LEA instruction to the data we written above
|
||||
|
||||
+2
-2
@@ -104,11 +104,11 @@ def create_c_from_template(settings: Settings, payload_len: int):
|
||||
max_alloc_count = 256
|
||||
if sir_alloc_count > max_alloc_count:
|
||||
# if too large, compiler will add a __checkstk dependency
|
||||
logging.warning("Too large sir allocation count {}, setting to max {}".format(
|
||||
logger.warning("Too large sir allocation count {}, setting to max {}".format(
|
||||
sir_alloc_count, max_alloc_count
|
||||
))
|
||||
sir_alloc_count = max_alloc_count
|
||||
logging.debug("-( AntiEmulation settings: iterations: {} allocs: {}".format(
|
||||
logger.debug("-( AntiEmulation settings: iterations: {} allocs: {}".format(
|
||||
sir_iteration_count, sir_alloc_count)
|
||||
)
|
||||
plugin_antiemualation = file.read()
|
||||
|
||||
Reference in New Issue
Block a user