mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 02:39:44 +02:00
Merge remote-tracking branch 'origin/patch'
This commit is contained in:
commit
67943324c3
2 changed files with 18 additions and 3 deletions
|
@ -1280,6 +1280,9 @@ def put_modules(modules: Optional[Dict[str, util.Module]] = None,
|
|||
base_base, base_addr = mapper.map(inf, m.base)
|
||||
if base_base != base_addr.space:
|
||||
trace.create_overlay_space(base_base, base_addr.space)
|
||||
if m.max == m.base:
|
||||
modobj.set_value('Base', m.base)
|
||||
else:
|
||||
modobj.set_value('Range', base_addr.extend(m.max - m.base))
|
||||
if sections:
|
||||
sec_keys = []
|
||||
|
|
|
@ -4332,8 +4332,20 @@ void ActionConditionalConst::propagateConstant(Varnode *varVn,Varnode *constVn,F
|
|||
// ...unless COPY is into something more interesting
|
||||
}
|
||||
if (constBlock->dominates(op->getParent())) {
|
||||
if (opc == CPUI_RETURN){
|
||||
// CPUI_RETURN ops can't directly take constants
|
||||
// as inputs
|
||||
PcodeOp *copyBeforeRet = data.newOp(1, op->getAddr());
|
||||
data.opSetOpcode(copyBeforeRet,CPUI_COPY);
|
||||
data.opSetInput(copyBeforeRet,constVn,0);
|
||||
data.newVarnodeOut(varVn->getSize(),varVn->getAddr(),copyBeforeRet);
|
||||
data.opSetInput(op,copyBeforeRet->getOut(),1);
|
||||
data.opInsertBefore(copyBeforeRet,op);
|
||||
}
|
||||
else {
|
||||
int4 slot = op->getSlot(varVn);
|
||||
data.opSetInput(op,constVn,slot); // Replace ref with constant!
|
||||
}
|
||||
count += 1; // We made a change
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue