This commit is contained in:
Miloš 2025-05-24 19:01:37 +02:00 committed by GitHub
commit 8ab19939cc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 7 additions and 7 deletions

View File

@ -31,7 +31,7 @@ std::vector<ULONG_PTR> tlsCallBackList;
std::vector<PROCESS_ITEM_DATA> hListProcess;
DWORD engineStepCount = 0;
LPVOID engineStepCallBack = NULL;
bool engineStepActive = false;
DWORD engineStepTID = 0;
bool engineProcessIsNowDetached = false;
DWORD DBGCode = DBG_CONTINUE;
bool engineFileIsBeingDebugged = false;

View File

@ -31,7 +31,7 @@ extern std::vector<ULONG_PTR> tlsCallBackList;
extern std::vector<PROCESS_ITEM_DATA> hListProcess;
extern DWORD engineStepCount;
extern LPVOID engineStepCallBack;
extern bool engineStepActive;
extern DWORD engineStepTID;
extern bool engineProcessIsNowDetached;
extern DWORD DBGCode;
extern bool engineFileIsBeingDebugged;

View File

@ -38,7 +38,7 @@ __declspec(dllexport) void TITCALL ForceClose()
__declspec(dllexport) void TITCALL StepInto(LPVOID StepCallBack)
{
EnterCriticalSection(&engineStepActiveCr);
if (!engineStepActive)
if (engineStepTID == 0)
{
ULONG_PTR ueCurrentPosition = GetContextData(UE_CIP);
unsigned char instr[16];
@ -60,7 +60,7 @@ __declspec(dllexport) void TITCALL StepInto(LPVOID StepCallBack)
myDBGContext.EFlags |= UE_TRAP_FLAG;
SetThreadContext(hActiveThread, &myDBGContext);
EngineCloseHandle(hActiveThread);
engineStepActive = true;
engineStepTID = DBGEvent.dwThreadId;
engineStepCallBack = StepCallBack;
engineStepCount = 0;
}

View File

@ -16,14 +16,14 @@
static void engineStep()
{
EnterCriticalSection(&engineStepActiveCr);
if (engineStepActive)
if (engineStepTID == DBGEvent.dwThreadId)
{
DBGCode = DBG_CONTINUE;
if (engineStepCount == 0)
{
typedef void(TITCALL* fCustomBreakPoint)(void);
auto cbStep = fCustomBreakPoint(engineStepCallBack);
engineStepActive = false;
engineStepTID = 0;
engineStepCallBack = NULL;
LeaveCriticalSection(&engineStepActiveCr);
cbStep();
@ -1237,7 +1237,7 @@ __declspec(dllexport) void TITCALL DebugLoop()
//general unhandled exception callback
if(DBGCode == DBG_EXCEPTION_NOT_HANDLED)
{
engineStepActive = false;
engineStepTID = 0;
if(DBGCustomHandler->chUnhandledException != NULL)
{