mirror of https://github.com/x64dbg/GleeBug
added MemoryType::Read
This commit is contained in:
parent
aecc172ecb
commit
94060f3d99
|
|
@ -45,8 +45,9 @@ namespace GleeBug
|
|||
enum class MemoryType
|
||||
{
|
||||
Access = 1,
|
||||
Write = 2,
|
||||
Execute = 4
|
||||
Read = 2,
|
||||
Write = 4,
|
||||
Execute = 8
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -238,6 +238,7 @@ namespace GleeBug
|
|||
switch (type)
|
||||
{
|
||||
case MemoryType::Access:
|
||||
case MemoryType::Read:
|
||||
data.NewProtect = data.OldProtect | PAGE_GUARD;
|
||||
break;
|
||||
case MemoryType::Write:
|
||||
|
|
@ -254,7 +255,7 @@ namespace GleeBug
|
|||
data.Type = oldData.Type | uint32(type);
|
||||
data.OldProtect = oldData.OldProtect;
|
||||
data.Refcount = oldData.Refcount + 1;
|
||||
if (data.Type & uint32(MemoryType::Access)) //Access always becomes PAGE_GUARD
|
||||
if (data.Type & uint32(MemoryType::Access) || data.Type & uint32(MemoryType::Read)) //Access/Read always becomes PAGE_GUARD
|
||||
data.NewProtect = data.OldProtect | PAGE_GUARD;
|
||||
else if (data.Type & (uint32(MemoryType::Write) | uint32(MemoryType::Execute))) //Write + Execute becomes either PAGE_GUARD or both write and execute flags removed
|
||||
data.NewProtect = permanentDep ? RemoveExecuteAccess(RemoveWriteAccess(data.OldProtect)) : data.OldProtect | PAGE_GUARD;
|
||||
|
|
|
|||
|
|
@ -320,7 +320,7 @@ namespace GleeBug
|
|||
\param singleshoot (Optional) True to remove the breakpoint after the first hit.
|
||||
\return true if the memory breakpoint was set, false otherwise.
|
||||
*/
|
||||
bool SetMemoryBreakpoint(ptr address, ptr size, MemoryType type = MemoryType::Access, bool singleshoot = false);
|
||||
bool SetMemoryBreakpoint(ptr address, ptr size, MemoryType type = MemoryType::Access, bool singleshoot = true);
|
||||
|
||||
/**
|
||||
\brief Sets a memory breakpoint.
|
||||
|
|
@ -331,7 +331,7 @@ namespace GleeBug
|
|||
\param singleshoot (Optional) True to remove the breakpoint after the first hit.
|
||||
\return true if the memory breakpoint was set, false otherwise.
|
||||
*/
|
||||
bool SetMemoryBreakpoint(ptr address, ptr size, const BreakpointCallback & cbBreakpoint, MemoryType type = MemoryType::Access, bool singleshoot = false);
|
||||
bool SetMemoryBreakpoint(ptr address, ptr size, const BreakpointCallback & cbBreakpoint, MemoryType type = MemoryType::Access, bool singleshoot = true);
|
||||
|
||||
/**
|
||||
\brief Sets a hardware breakpoint.
|
||||
|
|
@ -345,7 +345,7 @@ namespace GleeBug
|
|||
\return true if the memory breakpoint was set, false otherwise.
|
||||
*/
|
||||
template <typename T>
|
||||
bool SetMemoryBreakpoint(ptr address, ptr size, T* debugger, void(T::*callback)(const BreakpointInfo & info), MemoryType type = MemoryType::Access, bool singleshoot = false)
|
||||
bool SetMemoryBreakpoint(ptr address, ptr size, T* debugger, void(T::*callback)(const BreakpointInfo & info), MemoryType type = MemoryType::Access, bool singleshoot = true)
|
||||
{
|
||||
static_cast<void>(static_cast<Debugger*>(debugger));
|
||||
return SetMemoryBreakpoint(address, size, std::bind(callback, debugger, std::placeholders::_1), type, singleshoot);
|
||||
|
|
|
|||
Loading…
Reference in New Issue