Skip to content
Snippets Groups Projects
Commit bd9ace9f authored by clc5q's avatar clc5q
Browse files

Detect recursive fixed calls.

Former-commit-id: 94666d2282500664bbac52cdbfbd616c2ab4eb5b
parent d3380e26
No related branches found
No related tags found
No related merge requests found
......@@ -255,8 +255,10 @@ void STARS_IRDB_Function_t::FindFixedCalls(SMPFunction *CurrFunc) {
if (success && (!TargetIDSet.empty())) {
assert(1 == TargetIDSet.size());
STARS_ea_t JumpTargetID = TargetIDSet.begin()->GetIDWithinFile();
if ((STARS_BADADDR != JumpTargetID) && (!this->IsInstIDInFunc(JumpTargetID))) {
// Valid jump target outside of current function.
bool ValidJumpTarget = (STARS_BADADDR != JumpTargetID);
bool RecursiveFixedCall = (JumpTargetID == CurrFunc->GetFirstFuncAddr());
if (ValidJumpTarget && ((!this->IsInstIDInFunc(JumpTargetID)) || RecursiveFixedCall)) {
// Valid jump target outside of current function, or recursive call to start of function.
CurrInst->SetFixedCallJump();
cout << "Found fixed call jump to ID " << JumpTargetID << " from ID " << CurrInst->GetAddr() << endl;
FixedCallPushSeen = false; // reset for detection of next occurrence
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment