Reset emu state after a failing DllMain

call_dll_entrypoint() caught the DllMain UcError and restored registers but
left ql._state at STARTED, since emu_start() only clears it on success. The
'emu_state is not STARTED' gate then silently skipped DllMain for every DLL
loaded afterward. Reset the state to STOPPED on the exception path.
This commit is contained in:
H1ghC0ntr4sT
2026-07-02 23:21:17 +07:00
parent 499218bd1a
commit ce6f08d71f
+4
View File
@@ -462,6 +462,10 @@ class Process:
self.ql.log.error(f'Error encountered while running {dll_name} DllMain, bailing')
self.ql.arch.regs.restore(regs_state)
# emu_start leaves the state at STARTED when it raises; reset it so a single
# failing DllMain does not gate every subsequently loaded DLL's entry point.
self.ql._state = QL_STATE.STOPPED
else:
fcall.cc.unwind(len(args))