From 8e21d1072d7a5cd15806569747f7779570659f77 Mon Sep 17 00:00:00 2001 From: "Mr. eXoDia" Date: Fri, 18 Jul 2014 16:37:52 +0200 Subject: [PATCH] fixed a bug with attaching (DebugReset would cause the custom callbacks to be reset, which means attaching doesn't work). --- TitanEngine/TitanEngine.Debugger.DebugLoop.cpp | 1 + TitanEngine/TitanEngine.Debugger.cpp | 2 -- TitanEngine/TitanEngine.PE.Data.cpp | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/TitanEngine/TitanEngine.Debugger.DebugLoop.cpp b/TitanEngine/TitanEngine.Debugger.DebugLoop.cpp index d29a2a0..0358d36 100644 --- a/TitanEngine/TitanEngine.Debugger.DebugLoop.cpp +++ b/TitanEngine/TitanEngine.Debugger.DebugLoop.cpp @@ -1406,6 +1406,7 @@ __declspec(dllexport) void TITCALL DebugLoop() { ExtensionManagerPluginDebugCallBack(&DBGEvent, UE_PLUGIN_CALL_REASON_POSTDEBUG); } + DebuggerReset(); } __declspec(dllexport) void TITCALL DebugLoopEx(DWORD TimeOut) diff --git a/TitanEngine/TitanEngine.Debugger.cpp b/TitanEngine/TitanEngine.Debugger.cpp index be832bb..0cfbee5 100644 --- a/TitanEngine/TitanEngine.Debugger.cpp +++ b/TitanEngine/TitanEngine.Debugger.cpp @@ -45,7 +45,6 @@ __declspec(dllexport) void* TITCALL InitDebugW(wchar_t* szFileName, wchar_t* szC { int DebugConsoleFlag = NULL; - DebuggerReset(); if(DebugDebuggingDLL) { DebugConsoleFlag = CREATE_NO_WINDOW|CREATE_SUSPENDED; @@ -226,7 +225,6 @@ __declspec(dllexport) bool TITCALL AttachDebugger(DWORD ProcessId, bool KillOnEx if(ProcessId != NULL && dbgProcessInformation.hProcess == NULL) { - DebuggerReset(); if(engineEnableDebugPrivilege) { EngineSetDebugPrivilege(GetCurrentProcess(), true); diff --git a/TitanEngine/TitanEngine.PE.Data.cpp b/TitanEngine/TitanEngine.PE.Data.cpp index cfb8a26..292cffb 100644 --- a/TitanEngine/TitanEngine.PE.Data.cpp +++ b/TitanEngine/TitanEngine.PE.Data.cpp @@ -194,7 +194,7 @@ __declspec(dllexport) ULONG_PTR TITCALL GetPE32DataFromMappedFile(ULONG_PTR File } else if(WhichData == UE_IMAGEBASE) { - return(PEHeader64->OptionalHeader.ImageBase); + return (ULONG_PTR)(PEHeader64->OptionalHeader.ImageBase); } else if(WhichData == UE_OEP) {