mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 10:49:34 +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,7 +1280,10 @@ def put_modules(modules: Optional[Dict[str, util.Module]] = None,
|
||||||
base_base, base_addr = mapper.map(inf, m.base)
|
base_base, base_addr = mapper.map(inf, m.base)
|
||||||
if base_base != base_addr.space:
|
if base_base != base_addr.space:
|
||||||
trace.create_overlay_space(base_base, base_addr.space)
|
trace.create_overlay_space(base_base, base_addr.space)
|
||||||
modobj.set_value('Range', base_addr.extend(m.max - m.base))
|
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:
|
if sections:
|
||||||
sec_keys = []
|
sec_keys = []
|
||||||
for sk, s in m.sections.items():
|
for sk, s in m.sections.items():
|
||||||
|
|
|
@ -4332,8 +4332,20 @@ void ActionConditionalConst::propagateConstant(Varnode *varVn,Varnode *constVn,F
|
||||||
// ...unless COPY is into something more interesting
|
// ...unless COPY is into something more interesting
|
||||||
}
|
}
|
||||||
if (constBlock->dominates(op->getParent())) {
|
if (constBlock->dominates(op->getParent())) {
|
||||||
int4 slot = op->getSlot(varVn);
|
if (opc == CPUI_RETURN){
|
||||||
data.opSetInput(op,constVn,slot); // Replace ref with constant!
|
// 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
|
count += 1; // We made a change
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue