1
0
Fork 0

DBG: better expression functions

This commit is contained in:
mrexodia 2016-08-31 17:37:19 +02:00
parent 53d3d40837
commit 3e8af43bfe
No known key found for this signature in database
GPG Key ID: FC89E0AAA0C1AAD8
3 changed files with 18 additions and 1 deletions

View File

@ -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);

View File

@ -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)

View File

@ -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);