mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 02:39:44 +02:00
GP-1954 Refactor characterizeAsParam, AncestorRealistic adjustments
This commit is contained in:
parent
91eb96f109
commit
b7955f2a79
15 changed files with 711 additions and 191 deletions
|
@ -9357,20 +9357,22 @@ int4 RulePiecePathology::applyOp(PcodeOp *op,Funcdata &data)
|
|||
if (!isPathology(subOp->getIn(0),data)) return 0;
|
||||
}
|
||||
else if (opc == CPUI_INDIRECT) {
|
||||
if (!subOp->isIndirectCreation()) return 0;
|
||||
Varnode *retVn = op->getIn(1);
|
||||
if (!retVn->isWritten()) return 0;
|
||||
PcodeOp *callOp = retVn->getDef();
|
||||
if (!callOp->isCall()) return 0;
|
||||
FuncCallSpecs *fc = data.getCallSpecs(callOp);
|
||||
if (fc == (FuncCallSpecs *)0) return 0;
|
||||
if (!fc->isOutputLocked()) return 0;
|
||||
Address addr = retVn->getAddr();
|
||||
if (!subOp->isIndirectCreation()) return 0; // Indirect concatenation
|
||||
Varnode *lsbVn = op->getIn(1);
|
||||
if (!lsbVn->isWritten()) return 0;
|
||||
PcodeOp *lsbOp = lsbVn->getDef();
|
||||
if ((lsbOp->getEvalType() & (PcodeOp::binary | PcodeOp::unary)) == 0) { // from either a unary/binary operation
|
||||
if (!lsbOp->isCall()) return 0; // or a CALL
|
||||
FuncCallSpecs *fc = data.getCallSpecs(lsbOp);
|
||||
if (fc == (FuncCallSpecs *)0) return 0;
|
||||
if (!fc->isOutputLocked()) return 0; // with a locked output
|
||||
}
|
||||
Address addr = lsbVn->getAddr();
|
||||
if (addr.getSpace()->isBigEndian())
|
||||
addr = addr - vn->getSize();
|
||||
else
|
||||
addr = addr + retVn->getSize();
|
||||
if (addr != vn->getAddr()) return 0;
|
||||
addr = addr + lsbVn->getSize();
|
||||
if (addr != vn->getAddr()) return 0; // into a contiguous register
|
||||
}
|
||||
else
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue