mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-03 09:49:23 +02:00
Merge remote-tracking branch 'origin/GP-5718_LeftShiftSubvar' into patch
This commit is contained in:
commit
9ddc746e6f
1 changed files with 9 additions and 4 deletions
|
@ -731,11 +731,16 @@ bool SubvariableFlow::traceBackward(ReplaceVarnode *rvn)
|
||||||
addNewConstant(rop,0,(uintb)0);
|
addNewConstant(rop,0,(uintb)0);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if ((newmask<<sa) != rvn->mask)
|
if ((newmask<<sa) == rvn->mask) {
|
||||||
break; // subvariable is truncated by shift
|
|
||||||
rop = createOp(CPUI_COPY,1,rvn);
|
rop = createOp(CPUI_COPY,1,rvn);
|
||||||
if (!createLink(rop,newmask,0,op->getIn(0))) return false;
|
if (!createLink(rop,newmask,0,op->getIn(0))) return false;
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
|
if ((rvn->mask & 1)==0) return false; // Can't assume zeroes are shifted into least sig bits
|
||||||
|
rop = createOp(CPUI_INT_LEFT,2,rvn);
|
||||||
|
if (!createLink(rop,rvn->mask,0,op->getIn(0))) return false;
|
||||||
|
addConstant(rop,calc_mask(op->getIn(1)->getSize()),1,op->getIn(1)); // Preserve the shift amount
|
||||||
|
return true;
|
||||||
case CPUI_INT_RIGHT:
|
case CPUI_INT_RIGHT:
|
||||||
if (!op->getIn(1)->isConstant()) break; // Dynamic shift
|
if (!op->getIn(1)->isConstant()) break; // Dynamic shift
|
||||||
sa = (int4)op->getIn(1)->getOffset();
|
sa = (int4)op->getIn(1)->getOffset();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue