mirror of
https://github.com/dobin/SuperMega
synced 2026-06-02 17:27:10 +00:00
fix: iat compiler bug with newlines again
This commit is contained in:
@@ -20,7 +20,9 @@ def clean_files():
|
|||||||
"main-clean.obj",
|
"main-clean.obj",
|
||||||
"main.obj",
|
"main.obj",
|
||||||
"mllink$.lnk",
|
"mllink$.lnk",
|
||||||
|
#"out/7z-verify.exe",
|
||||||
|
#"out/wifiinfoview-verify.exe",
|
||||||
|
#"out/procexp64-verify.exe",
|
||||||
# out/ stuff
|
# out/ stuff
|
||||||
os.path.join(build_dir, "main.asm"),
|
os.path.join(build_dir, "main.asm"),
|
||||||
os.path.join(build_dir, "main.bin"),
|
os.path.join(build_dir, "main.bin"),
|
||||||
|
|||||||
+14
-6
@@ -7,6 +7,7 @@ from helper import *
|
|||||||
from config import config
|
from config import config
|
||||||
from observer import observer
|
from observer import observer
|
||||||
from model import *
|
from model import *
|
||||||
|
from phases.masmshc import process_file, Params
|
||||||
|
|
||||||
logger = logging.getLogger("Compiler")
|
logger = logging.getLogger("Compiler")
|
||||||
use_templates = True
|
use_templates = True
|
||||||
@@ -44,13 +45,19 @@ def compile(
|
|||||||
# Assembly cleanup (masm_shc)
|
# Assembly cleanup (masm_shc)
|
||||||
asm_clean_file = asm_out + ".clean"
|
asm_clean_file = asm_out + ".clean"
|
||||||
logger.info("---[ ASM masm_shc: {} ".format(asm_out))
|
logger.info("---[ ASM masm_shc: {} ".format(asm_out))
|
||||||
run_process_checkret([
|
if False:
|
||||||
config.get("path_masmshc"),
|
params = Params(asm_out, asm_clean_file, True, True, True)
|
||||||
asm_out,
|
process_file(params)
|
||||||
asm_clean_file,
|
else:
|
||||||
])
|
run_process_checkret([
|
||||||
|
config.get("path_masmshc"),
|
||||||
|
asm_out,
|
||||||
|
asm_clean_file,
|
||||||
|
])
|
||||||
if not os.path.isfile(asm_clean_file):
|
if not os.path.isfile(asm_clean_file):
|
||||||
raise Exception("Error: Cleanup filed")
|
raise Exception("Error: Cleaned up ASM file {} was not created".format(
|
||||||
|
asm_clean_file
|
||||||
|
))
|
||||||
|
|
||||||
# Move to destination we expect
|
# Move to destination we expect
|
||||||
shutil.move(asm_clean_file, asm_out)
|
shutil.move(asm_clean_file, asm_out)
|
||||||
@@ -147,6 +154,7 @@ def fixup_iat_reuse(filename: FilePath, exe_info):
|
|||||||
|
|
||||||
randbytes: bytes = os.urandom(6)
|
randbytes: bytes = os.urandom(6)
|
||||||
lines[idx] = bytes_to_asm_db(randbytes) + " ; IAT Reuse for {}".format(func_name)
|
lines[idx] = bytes_to_asm_db(randbytes) + " ; IAT Reuse for {}".format(func_name)
|
||||||
|
lines[idx] += "\r\n" # FIX FUCK
|
||||||
exe_info.add_iat_resolve(func_name, randbytes)
|
exe_info.add_iat_resolve(func_name, randbytes)
|
||||||
|
|
||||||
logger.info(" > Replace func name: {} with {}".format(
|
logger.info(" > Replace func name: {} with {}".format(
|
||||||
|
|||||||
Reference in New Issue
Block a user