mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 02:39:44 +02:00
Merge branch 'GP-2964_ghidra_CorrectProgramUpgradeIssues' into patch
This commit is contained in:
commit
fecaf7b5b1
5 changed files with 17 additions and 10 deletions
|
@ -30,7 +30,7 @@ class RelocationDBAdapterV1 extends RelocationDBAdapter {
|
||||||
private final static int V1_TYPE_COL = 0;
|
private final static int V1_TYPE_COL = 0;
|
||||||
|
|
||||||
// final static Schema SCHEMA = new Schema(
|
// final static Schema SCHEMA = new Schema(
|
||||||
// RelocationDBAdapterV4.VERSION, "Address", new Field[] { IntField.INSTANCE },
|
// RelocationDBAdapterV1.VERSION, "Address", new Field[] { IntField.INSTANCE },
|
||||||
// new String[] { "Type" });
|
// new String[] { "Type" });
|
||||||
|
|
||||||
private Table relocTable;
|
private Table relocTable;
|
||||||
|
|
|
@ -31,8 +31,7 @@ class RelocationDBAdapterV2 extends RelocationDBAdapter {
|
||||||
private final static int V2_VALUE_COL = 1;
|
private final static int V2_VALUE_COL = 1;
|
||||||
|
|
||||||
// final static Schema SCHEMA = new Schema(
|
// final static Schema SCHEMA = new Schema(
|
||||||
// RelocationDBAdapterV4.VERSION, "Address", new Field[] { IntField.INSTANCE,
|
// RelocationDBAdapterV2.VERSION, "Address", new Field[] { IntField.INSTANCE, LongField.INSTANCE },
|
||||||
// LongField.INSTANCE },
|
|
||||||
// new String[] { "Type", "Values" });
|
// new String[] { "Type", "Values" });
|
||||||
|
|
||||||
private Table relocTable;
|
private Table relocTable;
|
||||||
|
|
|
@ -33,9 +33,9 @@ class RelocationDBAdapterV3 extends RelocationDBAdapter {
|
||||||
private final static int V3_BYTES_COL = 2;
|
private final static int V3_BYTES_COL = 2;
|
||||||
|
|
||||||
// final static Schema SCHEMA = new Schema(
|
// final static Schema SCHEMA = new Schema(
|
||||||
// RelocationDBAdapterV4.VERSION, "Address", new Field[] { IntField.INSTANCE,
|
// RelocationDBAdapterV3.VERSION, "Address", new Field[] { IntField.INSTANCE,
|
||||||
// LongField.INSTANCE, BinaryField.INSTANCE },
|
// BinaryField.INSTANCE, BinaryField.INSTANCE },
|
||||||
// new String[] { "Type", "Values", "Bytes" });
|
// new String[] { "Type", "Values", "Bytes" });
|
||||||
|
|
||||||
private Table relocTable;
|
private Table relocTable;
|
||||||
private AddressMap addrMap;
|
private AddressMap addrMap;
|
||||||
|
@ -94,8 +94,7 @@ class RelocationDBAdapterV3 extends RelocationDBAdapter {
|
||||||
DBRecord newRec = SCHEMA.createRecord(rec.getKey());
|
DBRecord newRec = SCHEMA.createRecord(rec.getKey());
|
||||||
newRec.setLongValue(ADDR_COL, rec.getKey()); // key was encoded address
|
newRec.setLongValue(ADDR_COL, rec.getKey()); // key was encoded address
|
||||||
newRec.setIntValue(TYPE_COL, rec.getIntValue(V3_TYPE_COL));
|
newRec.setIntValue(TYPE_COL, rec.getIntValue(V3_TYPE_COL));
|
||||||
long[] values = new long[] { rec.getLongValue(V3_VALUE_COL) };
|
newRec.setBinaryData(VALUE_COL, rec.getBinaryData(V3_VALUE_COL));
|
||||||
newRec.setField(VALUE_COL, new BinaryCodedField(values));
|
|
||||||
newRec.setBinaryData(BYTES_COL, rec.getBinaryData(V3_BYTES_COL));
|
newRec.setBinaryData(BYTES_COL, rec.getBinaryData(V3_BYTES_COL));
|
||||||
return newRec;
|
return newRec;
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,8 +24,8 @@ public abstract class RefType {
|
||||||
|
|
||||||
//
|
//
|
||||||
// NOTE:
|
// NOTE:
|
||||||
// When creating a new flow type, be sure
|
// - When creating a new flow type, be sure to add code to the RefTypeFactory
|
||||||
// to add code to the RefTypeFactory
|
// - Once a RefType value is defined it must be maintained for upgrade use
|
||||||
//
|
//
|
||||||
|
|
||||||
static final byte __INVALID = -2;
|
static final byte __INVALID = -2;
|
||||||
|
@ -68,6 +68,12 @@ public abstract class RefType {
|
||||||
static final byte __WRITE_IND = 105;
|
static final byte __WRITE_IND = 105;
|
||||||
static final byte __READ_WRITE_IND = 106;
|
static final byte __READ_WRITE_IND = 106;
|
||||||
static final byte __UNKNOWNPARAM = 107;
|
static final byte __UNKNOWNPARAM = 107;
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
|
static final byte __STACK_READ = 110; // Use __READ instead - required for upgrade use
|
||||||
|
@Deprecated
|
||||||
|
static final byte __STACK_WRITE = 111; // Use __WRITE instead - required for upgrade use
|
||||||
|
|
||||||
static final byte __EXTERNAL_REF = 113;
|
static final byte __EXTERNAL_REF = 113;
|
||||||
static final byte __UNKNOWNDATA_IND = 114;
|
static final byte __UNKNOWNDATA_IND = 114;
|
||||||
|
|
||||||
|
|
|
@ -31,6 +31,7 @@ import ghidra.util.datastruct.IntObjectHashtable;
|
||||||
/**
|
/**
|
||||||
* Factory class to create RefType objects.
|
* Factory class to create RefType objects.
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public class RefTypeFactory {
|
public class RefTypeFactory {
|
||||||
|
|
||||||
private static final IntObjectHashtable<RefType> REFTYPE_LOOKUP_BY_TYPE_MAP =
|
private static final IntObjectHashtable<RefType> REFTYPE_LOOKUP_BY_TYPE_MAP =
|
||||||
|
@ -73,6 +74,8 @@ public class RefTypeFactory {
|
||||||
REFTYPE_LOOKUP_BY_TYPE_MAP.put(RefType.READ_IND.getValue(), RefType.READ_IND);
|
REFTYPE_LOOKUP_BY_TYPE_MAP.put(RefType.READ_IND.getValue(), RefType.READ_IND);
|
||||||
REFTYPE_LOOKUP_BY_TYPE_MAP.put(RefType.WRITE_IND.getValue(), RefType.WRITE_IND);
|
REFTYPE_LOOKUP_BY_TYPE_MAP.put(RefType.WRITE_IND.getValue(), RefType.WRITE_IND);
|
||||||
REFTYPE_LOOKUP_BY_TYPE_MAP.put(RefType.READ_WRITE_IND.getValue(), RefType.READ_WRITE_IND);
|
REFTYPE_LOOKUP_BY_TYPE_MAP.put(RefType.READ_WRITE_IND.getValue(), RefType.READ_WRITE_IND);
|
||||||
|
REFTYPE_LOOKUP_BY_TYPE_MAP.put(RefType.__STACK_READ, RefType.READ); // re-mapping required for upgrade use
|
||||||
|
REFTYPE_LOOKUP_BY_TYPE_MAP.put(RefType.__STACK_WRITE, RefType.WRITE); // re-mapping required for upgrade use
|
||||||
REFTYPE_LOOKUP_BY_TYPE_MAP.put(RefType.EXTERNAL_REF.getValue(), RefType.EXTERNAL_REF);
|
REFTYPE_LOOKUP_BY_TYPE_MAP.put(RefType.EXTERNAL_REF.getValue(), RefType.EXTERNAL_REF);
|
||||||
REFTYPE_LOOKUP_BY_TYPE_MAP.put(RefType.__CALL_OVERRIDE_UNCONDITIONAL,
|
REFTYPE_LOOKUP_BY_TYPE_MAP.put(RefType.__CALL_OVERRIDE_UNCONDITIONAL,
|
||||||
RefType.CALL_OVERRIDE_UNCONDITIONAL);
|
RefType.CALL_OVERRIDE_UNCONDITIONAL);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue