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
757534705d
1 changed files with 16 additions and 0 deletions
|
@ -606,6 +606,7 @@ public class SleighInstructionPrototype implements InstructionPrototype {
|
|||
VarnodeTpl vn = rec.op.getInput()[0];
|
||||
AddressSpace spc = vn.getSpace().fixSpace(walker);
|
||||
Address addr = spc.getTruncatedAddress(vn.getOffset().fix(walker), false);
|
||||
addr = handleOverlayAddress(context, addr);
|
||||
SleighParserContext crosscontext =
|
||||
(SleighParserContext) context.getParserContext(addr);
|
||||
int newsecnum = (int) rec.op.getInput()[1].getOffset().getReal();
|
||||
|
@ -620,6 +621,15 @@ public class SleighInstructionPrototype implements InstructionPrototype {
|
|||
return curflags;
|
||||
}
|
||||
|
||||
private Address handleOverlayAddress(InstructionContext context, Address addr) {
|
||||
AddressSpace addressSpace = context.getAddress().getAddressSpace();
|
||||
if (addressSpace.isOverlaySpace()) {
|
||||
OverlayAddressSpace ospace = (OverlayAddressSpace) addressSpace;
|
||||
addr = ospace.getOverlayAddress(addr);
|
||||
}
|
||||
return addr;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gather all the flow records (perhaps across multiple InstructionPrototypes via crossbuilds)
|
||||
* and convert to Addresses
|
||||
|
@ -653,6 +663,7 @@ public class SleighInstructionPrototype implements InstructionPrototype {
|
|||
VarnodeTpl vn = rec.op.getInput()[0];
|
||||
AddressSpace spc = vn.getSpace().fixSpace(walker);
|
||||
Address addr = spc.getTruncatedAddress(vn.getOffset().fix(walker), false);
|
||||
addr = handleOverlayAddress(context, addr);
|
||||
SleighParserContext crosscontext =
|
||||
(SleighParserContext) context.getParserContext(addr);
|
||||
int newsecnum = (int) rec.op.getInput()[1].getOffset().getReal();
|
||||
|
@ -1544,6 +1555,11 @@ public class SleighInstructionPrototype implements InstructionPrototype {
|
|||
return null;
|
||||
}
|
||||
Address newaddr = hand.space.getTruncatedAddress(hand.offset_offset, false);
|
||||
|
||||
// if we are in an address space, translate it
|
||||
if (curSpace.isOverlaySpace()) {
|
||||
newaddr = curSpace.getOverlayAddress(newaddr);
|
||||
}
|
||||
return newaddr;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue