mirror of https://github.com/x64dbg/GleeBug
initial work on memory breakpoints
This commit is contained in:
parent
688fe89439
commit
3d385178da
|
|
@ -49,6 +49,14 @@ namespace GleeBug
|
|||
Execute
|
||||
};
|
||||
|
||||
struct MemoryBreakpointInfo
|
||||
{
|
||||
struct
|
||||
{
|
||||
uint32 offset;
|
||||
} info[PAGE_SIZE];
|
||||
};
|
||||
|
||||
/**
|
||||
\brief Structure describing internal breakpoint info.
|
||||
*/
|
||||
|
|
@ -73,6 +81,7 @@ namespace GleeBug
|
|||
{
|
||||
MemoryType type;
|
||||
ptr size;
|
||||
MemoryBreakpointInfo* info;
|
||||
} memory;
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
//defines
|
||||
#define GLEEBUG_HWBP_COUNT 4
|
||||
#define GLEEBUG_PAGE_SIZE 0x1000
|
||||
|
||||
namespace GleeBug
|
||||
{
|
||||
|
|
@ -18,6 +19,7 @@ namespace GleeBug
|
|||
|
||||
//constants
|
||||
const int HWBP_COUNT = GLEEBUG_HWBP_COUNT;
|
||||
const int PAGE_SIZE = GLEEBUG_PAGE_SIZE;
|
||||
|
||||
//key typedefs
|
||||
typedef std::pair<BreakpointType, ptr> BreakpointKey;
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ protected:
|
|||
{
|
||||
printf("Reached entry breakpoint! GIP: 0x%p\n",
|
||||
mRegisters->Gip());
|
||||
if (mProcess->DeleteBreakpoint(info.address))
|
||||
/*if (mProcess->DeleteBreakpoint(info.address))
|
||||
printf("Entry breakpoint deleted!\n");
|
||||
else
|
||||
printf("Failed to delete entry breakpoint...\n");
|
||||
|
|
@ -20,7 +20,7 @@ protected:
|
|||
{
|
||||
printf("Step after entry breakpoint! GIP: 0x%p\n",
|
||||
mRegisters->Gip());
|
||||
});
|
||||
});*/
|
||||
}
|
||||
|
||||
void cbEntryHardwareBreakpoint(const BreakpointInfo & info)
|
||||
|
|
@ -61,7 +61,7 @@ protected:
|
|||
else
|
||||
printf("No free hardware breakpoint slot...\n");*/
|
||||
|
||||
if(mProcess->SetBreakpoint(entry, this, &MyDebugger::cbEntryBreakpoint))
|
||||
if(mProcess->SetBreakpoint(entry, this, &MyDebugger::cbEntryBreakpoint, true))
|
||||
printf("Breakpoint set at 0x%p!\n", entry);
|
||||
else
|
||||
printf("Failed to set breakpoint at 0x%p...\b", entry);
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
static void testDebugger()
|
||||
{
|
||||
#ifdef _WIN64
|
||||
wchar_t szFilePath[256] = L"c:\\test64.exe";
|
||||
wchar_t szFilePath[256] = L"c:\\MembpTest_x64.exe";
|
||||
#else //x86
|
||||
wchar_t szFilePath[256] = L"c:\\test32.exe";
|
||||
#endif //_WIN64
|
||||
|
|
@ -161,7 +161,7 @@ static void testCorkami()
|
|||
|
||||
int main()
|
||||
{
|
||||
testPeFile(L"C:\\test64.exe");
|
||||
testDebugger();
|
||||
//testCorkami();
|
||||
//testPeFile(L"c:\\!exclude\\pe\\bin\\appendedhdr.exe");
|
||||
puts("");
|
||||
|
|
|
|||
Loading…
Reference in New Issue