_debugThread_proc proc uses esi edi ebx lpParam
LOCAL @nReaderNumber
invoke RtlZeroMemory,addr @nReaderNumber,sizeof @nReaderNumber
invoke GetStartupInfo,offset stStartUp
invoke CreateProcess,offset szFilePath,NULL,NULL,NULL,NULL,DEBUG_PROCESS or DEBUG_ONLY_THIS_PROCESS,NULL,\
NULL,offset stStartUp,offset stPF
.
while
TRUE
invoke WaitForDebugEvent,offset stDebugEvent,INFINITE
invoke _showerror_proc,stPF.hProcess
invoke _showerror_proc,stPF.hThread
.
break
.
if
stDebugEvent.dwDebugEventCode == EXIT_PROCESS_DEBUG_EVENT
.
if
stDebugEvent.dwDebugEventCode == CREATE_PROCESS_DEBUG_EVENT
invoke ReadProcessMemory,stPF.hProcess,lpEntryPointer,offset Oldcommand,1,@nReaderNumber
invoke WriteProcessMemory,stPF.hProcess,lpEntryPointer,offset dbINT3,1,@nReaderNumber
.endif
invoke ContinueDebugEvent,stPF.hProcess,stPF.hThread,DBG_CONTINUE
.endw
invoke ExitThread,12
ret
_debugThread_proc endp