DBG: added various memory related expression functions
This commit is contained in:
parent
94a56fa12b
commit
d163fc4610
|
@ -66,6 +66,10 @@ void ExpressionFunctions::Init()
|
|||
RegisterEasy("ternary\1tern", ternary);
|
||||
|
||||
RegisterEasy("mem.valid", memvalid);
|
||||
RegisterEasy("mem.base", membase);
|
||||
RegisterEasy("mem.size", memsize);
|
||||
RegisterEasy("mem.iscode", memiscode);
|
||||
RegisterEasy("mem.decodepointer", memdecodepointer);
|
||||
|
||||
RegisterEasy("dis.len", dislen);
|
||||
RegisterEasy("dis.iscond", disiscond);
|
||||
|
|
|
@ -85,6 +85,28 @@ namespace Exprfunc
|
|||
return MemIsValidReadPtr(addr, true);
|
||||
}
|
||||
|
||||
duint membase(duint addr)
|
||||
{
|
||||
return MemFindBaseAddr(addr, nullptr);
|
||||
}
|
||||
|
||||
duint memsize(duint addr)
|
||||
{
|
||||
duint size;
|
||||
return MemFindBaseAddr(addr, &size) ? size : 0;
|
||||
}
|
||||
|
||||
duint memiscode(duint addr)
|
||||
{
|
||||
return MemIsCodePage(addr, false);
|
||||
}
|
||||
|
||||
duint memdecodepointer(duint ptr)
|
||||
{
|
||||
auto decoded = ptr;
|
||||
return MemDecodePointer(&decoded, true) ? decoded : ptr;
|
||||
}
|
||||
|
||||
duint dislen(duint addr)
|
||||
{
|
||||
BASIC_INSTRUCTION_INFO info;
|
||||
|
|
|
@ -21,6 +21,10 @@ namespace Exprfunc
|
|||
duint ternary(duint condition, duint value1, duint value2);
|
||||
|
||||
duint memvalid(duint addr);
|
||||
duint membase(duint addr);
|
||||
duint memsize(duint addr);
|
||||
duint memiscode(duint addr);
|
||||
duint memdecodepointer(duint ptr);
|
||||
|
||||
duint dislen(duint addr);
|
||||
duint disiscond(duint addr);
|
||||
|
|
Loading…
Reference in New Issue