- changed hardware breakpoint callback

This commit is contained in:
mr.exodia 2013-08-26 03:35:12 +02:00
parent 74b1bb7963
commit f39b2a5d6b
7 changed files with 36 additions and 8 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -17386,10 +17386,17 @@ __declspec(dllexport) void DebugLoop()
myDBGContext.EFlags = myDBGContext.EFlags ^ 0x100;
}
SetThreadContext(hActiveThread, &myDBGContext);
myCustomBreakPoint = (fCustomBreakPoint)(DebugRegister0.DrxCallBack);
myCustomHandler = (fCustomHandler)(DebugRegister0.DrxCallBack);
__try
{
myCustomBreakPoint();
ULONG_PTR addr=(ULONG_PTR)DBGEvent.u.Exception.ExceptionRecord.ExceptionAddress;
if(myDBGContext.Dr6 & 0x1)
#if defined(_WIN64)
addr=(ULONG_PTR)myDBGContext.Rip;
#else
addr=(ULONG_PTR)myDBGContext.Eip;
#endif
myCustomHandler((void*)addr);
}
__except(EXCEPTION_EXECUTE_HANDLER)
{
@ -17417,10 +17424,17 @@ __declspec(dllexport) void DebugLoop()
myDBGContext.EFlags = myDBGContext.EFlags ^ 0x100;
}
SetThreadContext(hActiveThread, &myDBGContext);
myCustomBreakPoint = (fCustomBreakPoint)(DebugRegister1.DrxCallBack);
myCustomHandler = (fCustomHandler)(DebugRegister1.DrxCallBack);
__try
{
myCustomBreakPoint();
ULONG_PTR addr=(ULONG_PTR)DBGEvent.u.Exception.ExceptionRecord.ExceptionAddress;
if(myDBGContext.Dr6 & 0x2)
#if defined(_WIN64)
addr=(ULONG_PTR)myDBGContext.Rip;
#else
addr=(ULONG_PTR)myDBGContext.Eip;
#endif
myCustomHandler((void*)addr);
}
__except(EXCEPTION_EXECUTE_HANDLER)
{
@ -17447,10 +17461,17 @@ __declspec(dllexport) void DebugLoop()
myDBGContext.EFlags = myDBGContext.EFlags ^ 0x100;
}
SetThreadContext(hActiveThread, &myDBGContext);
myCustomBreakPoint = (fCustomBreakPoint)(DebugRegister2.DrxCallBack);
myCustomHandler = (fCustomHandler)(DebugRegister2.DrxCallBack);
__try
{
myCustomBreakPoint();
ULONG_PTR addr=(ULONG_PTR)DBGEvent.u.Exception.ExceptionRecord.ExceptionAddress;
if(myDBGContext.Dr6 & 0x4)
#if defined(_WIN64)
addr=(ULONG_PTR)myDBGContext.Rip;
#else
addr=(ULONG_PTR)myDBGContext.Eip;
#endif
myCustomHandler((void*)addr);
}
__except(EXCEPTION_EXECUTE_HANDLER)
{
@ -17477,10 +17498,17 @@ __declspec(dllexport) void DebugLoop()
myDBGContext.EFlags = myDBGContext.EFlags ^ 0x100;
}
SetThreadContext(hActiveThread, &myDBGContext);
myCustomBreakPoint = (fCustomBreakPoint)(DebugRegister3.DrxCallBack);
myCustomHandler = (fCustomHandler)(DebugRegister3.DrxCallBack);
__try
{
myCustomBreakPoint();
ULONG_PTR addr=(ULONG_PTR)DBGEvent.u.Exception.ExceptionRecord.ExceptionAddress;
if(myDBGContext.Dr6 & 0x8)
#if defined(_WIN64)
addr=(ULONG_PTR)myDBGContext.Rip;
#else
addr=(ULONG_PTR)myDBGContext.Eip;
#endif
myCustomHandler((void*)addr);
}
__except(EXCEPTION_EXECUTE_HANDLER)
{

Binary file not shown.

Binary file not shown.

Binary file not shown.