diff --git a/GleeBug/Debugger.Loop.Exception.cpp b/GleeBug/Debugger.Loop.Exception.cpp index a3adfc8..4d5263d 100644 --- a/GleeBug/Debugger.Loop.Exception.cpp +++ b/GleeBug/Debugger.Loop.Exception.cpp @@ -239,10 +239,13 @@ namespace GleeBug */ //Read but our bpx page is not bp on Read //We shouldn't care about other stuff such as Write or Execute since these breakpoints are implemented with Access Violation. - if ((exceptionRecord.ExceptionInformation[0]==0) && (!(bpxPage->second.Type & 0x2))) + if (!(bpxPage->second.Type & 0x1)) { - //perhaps the program generated such exception - return; + if ((exceptionRecord.ExceptionInformation[0] == 0) && (!(bpxPage->second.Type & 0x2))) + { + //perhaps the program generated such exception + return; + } } //generic breakpoint callback function. diff --git a/MyDebugger/MyDebugger.h b/MyDebugger/MyDebugger.h index 53994a3..5f54f60 100644 --- a/MyDebugger/MyDebugger.h +++ b/MyDebugger/MyDebugger.h @@ -32,7 +32,7 @@ protected: auto addr = mRegisters->Esi(); #endif //_WIN64 printf("Addr: 0x%p\n", addr); - if (mProcess->SetMemoryBreakpoint(addr, 0x1000, this, &MyDebugger::cbMemoryBreakpoint, MemoryType::Execute)) + if (mProcess->SetMemoryBreakpoint(addr, 0x1000, this, &MyDebugger::cbMemoryBreakpoint, MemoryType::Access, false)) puts("Memory breakpoint set!"); else puts("Failed to set memory breakpoint...");