mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 02:39:44 +02:00
Merge remote-tracking branch
'origin/GP-3236_ghidra1_PeMingwRelocs--SQUASHED' (Closes #5155)
This commit is contained in:
commit
9dcc504965
7 changed files with 752 additions and 18 deletions
|
@ -31,6 +31,7 @@ import ghidra.program.model.mem.Memory;
|
|||
import ghidra.program.model.reloc.Relocation;
|
||||
import ghidra.program.model.reloc.Relocation.Status;
|
||||
import ghidra.program.model.reloc.RelocationTable;
|
||||
import ghidra.program.util.ChangeManager;
|
||||
import ghidra.util.Lock;
|
||||
import ghidra.util.exception.CancelledException;
|
||||
import ghidra.util.exception.VersionException;
|
||||
|
@ -147,9 +148,15 @@ public class RelocationManager implements RelocationTable, ManagerDB {
|
|||
try {
|
||||
byte flags = RelocationDBAdapter.getFlags(status, 0);
|
||||
adapter.add(addr, flags, type, values, bytes, symbolName);
|
||||
return new Relocation(addr, status, type, values,
|
||||
Relocation reloc = new Relocation(addr, status, type, values,
|
||||
getOriginalBytes(addr, status, bytes, 0),
|
||||
symbolName);
|
||||
|
||||
// fire event
|
||||
// TODO: full change support is missing
|
||||
program.setChanged(ChangeManager.DOCR_RELOCATION_ADDED, null, reloc);
|
||||
|
||||
return reloc;
|
||||
}
|
||||
catch (IOException e) {
|
||||
program.dbError(e);
|
||||
|
@ -167,9 +174,15 @@ public class RelocationManager implements RelocationTable, ManagerDB {
|
|||
try {
|
||||
byte flags = RelocationDBAdapter.getFlags(status, byteLength);
|
||||
adapter.add(addr, flags, type, values, null, symbolName);
|
||||
return new Relocation(addr, status, type, values,
|
||||
Relocation reloc = new Relocation(addr, status, type, values,
|
||||
getOriginalBytes(addr, status, null, byteLength),
|
||||
symbolName);
|
||||
|
||||
// fire event
|
||||
// TODO: full change support is missing
|
||||
program.setChanged(ChangeManager.DOCR_RELOCATION_ADDED, null, reloc);
|
||||
|
||||
return reloc;
|
||||
}
|
||||
catch (IOException e) {
|
||||
program.dbError(e);
|
||||
|
|
|
@ -179,16 +179,25 @@ public abstract class AbstractPointerTypedefBuiltIn extends BuiltIn implements T
|
|||
|
||||
@Override
|
||||
public Class<?> getValueClass(Settings settings) {
|
||||
if (settings == null) {
|
||||
settings = getDefaultSettings();
|
||||
}
|
||||
return modelTypedef.getValueClass(settings);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getValue(MemBuffer buf, Settings settings, int length) {
|
||||
if (settings == null) {
|
||||
settings = getDefaultSettings();
|
||||
}
|
||||
return modelTypedef.getValue(buf, settings, length);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRepresentation(MemBuffer buf, Settings settings, int length) {
|
||||
if (settings == null) {
|
||||
settings = getDefaultSettings();
|
||||
}
|
||||
return modelTypedef.getRepresentation(buf, settings, length);
|
||||
}
|
||||
|
||||
|
|
|
@ -724,6 +724,17 @@ public interface ChangeManager {
|
|||
*/
|
||||
public static final int DOCR_USER_DATA_CHANGED = 201;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// RELOCATIONS
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
* A relocation entry was added
|
||||
*/
|
||||
public static final int DOCR_RELOCATION_ADDED = 210;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
* Mark the state of a Program as having changed and generate
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue