DBG: better expression functions
This commit is contained in:
parent
53d3d40837
commit
3e8af43bfe
|
@ -69,7 +69,9 @@ void ExpressionFunctions::Init()
|
|||
RegisterEasy("dis.len", dislen);
|
||||
RegisterEasy("dis.iscond", disiscond);
|
||||
RegisterEasy("dis.isbranch", disisbranch);
|
||||
RegisterEasy("dis.isret", disisret);
|
||||
RegisterEasy("dis.branchdest", disbranchdest);
|
||||
RegisterEasy("dis.branchexec", disbranchexec);
|
||||
RegisterEasy("dis.imm", disimm);
|
||||
RegisterEasy("dis.brtrue", disbrtrue);
|
||||
RegisterEasy("dis.brfalse", disbrfalse);
|
||||
|
|
|
@ -107,9 +107,22 @@ namespace Exprfunc
|
|||
return info.branch;
|
||||
}
|
||||
|
||||
duint disisret(duint addr)
|
||||
{
|
||||
BASIC_INSTRUCTION_INFO info;
|
||||
if(!disasmfast(addr, &info, true))
|
||||
return 0;
|
||||
return strstr(info.instruction, "ret") != nullptr;
|
||||
}
|
||||
|
||||
duint disbranchdest(duint addr)
|
||||
{
|
||||
return DbgIsJumpGoingToExecute(addr) ? DbgGetBranchDestination(addr) : disbrfalse(addr);
|
||||
return DbgGetBranchDestination(addr);
|
||||
}
|
||||
|
||||
duint disbranchexec(duint addr)
|
||||
{
|
||||
return DbgIsJumpGoingToExecute(addr);
|
||||
}
|
||||
|
||||
duint disimm(duint addr)
|
||||
|
|
|
@ -25,7 +25,9 @@ namespace Exprfunc
|
|||
duint dislen(duint addr);
|
||||
duint disiscond(duint addr);
|
||||
duint disisbranch(duint addr);
|
||||
duint disisret(duint addr);
|
||||
duint disbranchdest(duint addr);
|
||||
duint disbranchexec(duint addr);
|
||||
duint disimm(duint addr);
|
||||
duint disbrtrue(duint addr);
|
||||
duint disbrfalse(duint addr);
|
||||
|
|
Loading…
Reference in New Issue