mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-04 18:29:37 +02:00
Make sure we propagate to the STORE pointer parameter
This commit is contained in:
parent
2e80935edb
commit
660062691a
2 changed files with 13 additions and 8 deletions
|
@ -934,13 +934,14 @@ int4 ActionShadowVar::apply(Funcdata &data)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// \brief Make a limited search for a LOAD or STORE so we can see the AddrSpace being accessed
|
/// \brief Make a limited search from a constant for a LOAD or STORE so we can see the AddrSpace being accessed
|
||||||
///
|
///
|
||||||
/// We traverse forward through the given PcodeOp, through INT_ADD, INDIRECT, COPY, and MULTIEQUAL
|
/// We traverse forward through the op reading the constant, through INT_ADD, INDIRECT, COPY, and MULTIEQUAL
|
||||||
/// until we hit a LOAD or STORE.
|
/// until we hit a LOAD or STORE.
|
||||||
/// \param op is the given PcodeOp to start the search from
|
/// \param vn is the constant we are searching from
|
||||||
|
/// \param op is the PcodeOp reading the constant
|
||||||
/// \return the discovered AddrSpace or null
|
/// \return the discovered AddrSpace or null
|
||||||
AddrSpace *ActionConstantPtr::searchForLoadStore(PcodeOp *op)
|
AddrSpace *ActionConstantPtr::searchForLoadStore(Varnode *vn,PcodeOp *op)
|
||||||
|
|
||||||
{
|
{
|
||||||
for(int4 i=0;i<3;++i) {
|
for(int4 i=0;i<3;++i) {
|
||||||
|
@ -949,11 +950,15 @@ AddrSpace *ActionConstantPtr::searchForLoadStore(PcodeOp *op)
|
||||||
case CPUI_COPY:
|
case CPUI_COPY:
|
||||||
case CPUI_INDIRECT:
|
case CPUI_INDIRECT:
|
||||||
case CPUI_MULTIEQUAL:
|
case CPUI_MULTIEQUAL:
|
||||||
op = op->getOut()->loneDescend();
|
vn = op->getOut();
|
||||||
|
op = vn->loneDescend();
|
||||||
break;
|
break;
|
||||||
case CPUI_LOAD:
|
case CPUI_LOAD:
|
||||||
case CPUI_STORE:
|
|
||||||
return Address::getSpaceFromConst(op->getIn(0)->getAddr());
|
return Address::getSpaceFromConst(op->getIn(0)->getAddr());
|
||||||
|
case CPUI_STORE:
|
||||||
|
if (op->getIn(1) == vn)
|
||||||
|
return Address::getSpaceFromConst(op->getIn(0)->getAddr());
|
||||||
|
return (AddrSpace *)0;
|
||||||
default:
|
default:
|
||||||
return (AddrSpace *)0;
|
return (AddrSpace *)0;
|
||||||
}
|
}
|
||||||
|
@ -984,7 +989,7 @@ AddrSpace *ActionConstantPtr::selectInferSpace(Varnode *vn,PcodeOp *op,const vec
|
||||||
else if (vn->getSize() < minSize)
|
else if (vn->getSize() < minSize)
|
||||||
continue;
|
continue;
|
||||||
if (resSpace != (AddrSpace *)0) {
|
if (resSpace != (AddrSpace *)0) {
|
||||||
AddrSpace *searchSpc = searchForLoadStore(op);
|
AddrSpace *searchSpc = searchForLoadStore(vn,op);
|
||||||
if (searchSpc != (AddrSpace *)0)
|
if (searchSpc != (AddrSpace *)0)
|
||||||
resSpace = searchSpc;
|
resSpace = searchSpc;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -180,7 +180,7 @@ public:
|
||||||
/// \brief Check for constants, with pointer type, that correspond to global symbols
|
/// \brief Check for constants, with pointer type, that correspond to global symbols
|
||||||
class ActionConstantPtr : public Action {
|
class ActionConstantPtr : public Action {
|
||||||
int4 localcount; ///< Number of passes made for this function
|
int4 localcount; ///< Number of passes made for this function
|
||||||
static AddrSpace *searchForLoadStore(PcodeOp *op);
|
static AddrSpace *searchForLoadStore(Varnode *vn,PcodeOp *op);
|
||||||
static AddrSpace *selectInferSpace(Varnode *vn,PcodeOp *op,const vector<AddrSpace *> &spaceList);
|
static AddrSpace *selectInferSpace(Varnode *vn,PcodeOp *op,const vector<AddrSpace *> &spaceList);
|
||||||
static SymbolEntry *isPointer(AddrSpace *spc,Varnode *vn,PcodeOp *op,int4 slot,
|
static SymbolEntry *isPointer(AddrSpace *spc,Varnode *vn,PcodeOp *op,int4 slot,
|
||||||
Address &rampoint,uintb &fullEncoding,Funcdata &data);
|
Address &rampoint,uintb &fullEncoding,Funcdata &data);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue