refactor: better DLL support

This commit is contained in:
Dobin
2024-04-12 22:01:10 +01:00
parent c6a0cf14b0
commit a95203e2b5
6 changed files with 124 additions and 164 deletions
+4 -1
View File
@@ -54,7 +54,8 @@ def run_exe(exefile, dllfunc="", check=True):
if exefile.endswith(".dll"):
if dllfunc == "":
raise Exception("---[ No DLL function specified")
dllfunc = "dllMain"
#raise Exception("---[ No DLL function specified")
args = [ "rundll32.exe", "{},{}".format(exefile, dllfunc) ]
elif exefile.endswith(".exe"):
args = [ exefile ]
@@ -65,6 +66,8 @@ def run_exe(exefile, dllfunc="", check=True):
def run_process_checkret(args, check=True):
logger.info("--[ Run process: {}".format(" ".join(args)))
ret = subprocess.CompletedProcess("", 666)
try:
ret = subprocess.run(args, capture_output=True)