mirror of https://github.com/x64dbg/TitanEngine
- added StepOut function
This commit is contained in:
parent
4230d3c986
commit
fc51e0d144
|
|
@ -706,6 +706,7 @@ __declspec(dllexport) void TITCALL SetCustomHandler(DWORD ExceptionId, LPVOID Ca
|
|||
__declspec(dllexport) void TITCALL ForceClose();
|
||||
__declspec(dllexport) void TITCALL StepInto(LPVOID traceCallBack);
|
||||
__declspec(dllexport) void TITCALL StepOver(LPVOID traceCallBack);
|
||||
__declspec(dllexport) void TITCALL StepOut(LPVOID StepOut, bool StepFinal);
|
||||
__declspec(dllexport) void TITCALL SingleStep(DWORD StepCount, LPVOID StepCallBack);
|
||||
__declspec(dllexport) bool TITCALL GetUnusedHardwareBreakPointRegister(LPDWORD RegisterIndex);
|
||||
__declspec(dllexport) bool TITCALL SetHardwareBreakPointEx(HANDLE hActiveThread, ULONG_PTR bpxAddress, DWORD IndexOfRegister, DWORD bpxType, DWORD bpxSize, LPVOID bpxCallBack, LPDWORD IndexOfSelectedRegister);
|
||||
|
|
|
|||
|
|
@ -705,6 +705,7 @@ __declspec(dllimport) void TITCALL SetCustomHandler(DWORD ExceptionId, LPVOID Ca
|
|||
__declspec(dllimport) void TITCALL ForceClose();
|
||||
__declspec(dllimport) void TITCALL StepInto(LPVOID traceCallBack);
|
||||
__declspec(dllimport) void TITCALL StepOver(LPVOID traceCallBack);
|
||||
__declspec(dllexport) void TITCALL StepOut(LPVOID StepOut, bool StepFinal);
|
||||
__declspec(dllimport) void TITCALL SingleStep(DWORD StepCount, LPVOID StepCallBack);
|
||||
__declspec(dllimport) bool TITCALL GetUnusedHardwareBreakPointRegister(LPDWORD RegisterIndex);
|
||||
__declspec(dllimport) bool TITCALL SetHardwareBreakPointEx(HANDLE hActiveThread, ULONG_PTR bpxAddress, DWORD IndexOfRegister, DWORD bpxType, DWORD bpxSize, LPVOID bpxCallBack, LPDWORD IndexOfSelectedRegister);
|
||||
|
|
|
|||
|
|
@ -1384,6 +1384,10 @@ protected:
|
|||
{
|
||||
UE::StepOver((void*)traceCallBack);
|
||||
}
|
||||
static void StepOut(fBreakPointCallback StepOutCallBack)
|
||||
{
|
||||
UE::StepOut((void*)StepOutCallBack);
|
||||
}
|
||||
static void SingleStep(DWORD StepCount, fBreakPointCallback StepCallBack)
|
||||
{
|
||||
UE::SingleStep(StepCount, (void*)StepCallBack);
|
||||
|
|
@ -1565,6 +1569,7 @@ public:
|
|||
using DebuggerX::ForceClose;
|
||||
using DebuggerX::StepInto;
|
||||
using DebuggerX::StepOver;
|
||||
using DebuggerX::StepOut;
|
||||
using DebuggerX::SingleStep;
|
||||
using DebuggerX::GetUnusedHardwareBreakPointRegister;
|
||||
using DebuggerX::SetHardwareBreakPointEx;
|
||||
|
|
|
|||
|
|
@ -36,6 +36,8 @@ bool engineFileIsBeingDebugged = false;
|
|||
ULONG_PTR engineFakeDLLHandle = NULL;
|
||||
LPVOID engineAttachedProcessDebugInfo = NULL;
|
||||
wchar_t szDebuggerName[512];
|
||||
bool DebugStepFinal = false;
|
||||
LPVOID StepOutCallBack = NULL;
|
||||
|
||||
// Global.Debugger.functions:
|
||||
long DebugLoopInSecondThread(LPVOID InputParameter)
|
||||
|
|
@ -71,3 +73,27 @@ void ClearProcessList()
|
|||
{
|
||||
std::vector<PROCESS_ITEM_DATA>().swap(hListProcess);
|
||||
}
|
||||
|
||||
void StepOutStepCallBack()
|
||||
{
|
||||
BYTE cipch = 0x90;
|
||||
MemoryReadSafe(dbgProcessInformation.hProcess, (void*)GetContextData(UE_CIP), &cipch, sizeof(cipch), 0);
|
||||
if(cipch == 0xC3 || cipch == 0xC2) //ret
|
||||
{
|
||||
if(DebugStepFinal)
|
||||
StepOver(StepOutCallBack);
|
||||
else
|
||||
{
|
||||
typedef void(TITCALL *fCustomBreakPoint)();
|
||||
__try
|
||||
{
|
||||
((fCustomBreakPoint)StepOutCallBack)();
|
||||
}
|
||||
__except(EXCEPTION_EXECUTE_HANDLER)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
StepOver(StepOutStepCallBack);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -79,6 +79,13 @@ __declspec(dllexport) void TITCALL StepOver(LPVOID StepCallBack)
|
|||
StepInto(StepCallBack);
|
||||
}
|
||||
|
||||
__declspec(dllexport) void TITCALL StepOut(LPVOID StepOut, bool StepFinal)
|
||||
{
|
||||
DebugStepFinal = StepFinal;
|
||||
StepOutCallBack = StepOut;
|
||||
StepOver(StepOutStepCallBack);
|
||||
}
|
||||
|
||||
__declspec(dllexport) void TITCALL SingleStep(DWORD StepCount, LPVOID StepCallBack)
|
||||
{
|
||||
|
||||
|
|
|
|||
|
|
@ -211,6 +211,7 @@ __declspec(dllexport) void TITCALL SetCustomHandler(DWORD ExceptionId, LPVOID Ca
|
|||
__declspec(dllexport) void TITCALL ForceClose();
|
||||
__declspec(dllexport) void TITCALL StepInto(LPVOID traceCallBack);
|
||||
__declspec(dllexport) void TITCALL StepOver(LPVOID traceCallBack);
|
||||
__declspec(dllexport) void TITCALL StepOut(LPVOID StepOut, bool StepFinal);
|
||||
__declspec(dllexport) void TITCALL SingleStep(DWORD StepCount, LPVOID StepCallBack);
|
||||
__declspec(dllexport) bool TITCALL GetUnusedHardwareBreakPointRegister(LPDWORD RegisterIndex);
|
||||
__declspec(dllexport) bool TITCALL SetHardwareBreakPointEx(HANDLE hActiveThread, ULONG_PTR bpxAddress, DWORD IndexOfRegister, DWORD bpxType, DWORD bpxSize, LPVOID bpxCallBack, LPDWORD IndexOfSelectedRegister);
|
||||
|
|
|
|||
Loading…
Reference in New Issue