mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 02:39:44 +02:00
Merge remote-tracking branch 'origin/GP-119_FillOutStructureRedux'
This commit is contained in:
commit
17d5a14d42
3 changed files with 85 additions and 1 deletions
|
@ -91,10 +91,22 @@ public enum MetaDataType {
|
|||
return aCopy;
|
||||
}
|
||||
if (aMeta == MetaDataType.PTR) {
|
||||
if (a instanceof TypeDef) {
|
||||
a = ((TypeDef) a).getBaseDataType();
|
||||
}
|
||||
if (b instanceof TypeDef) {
|
||||
b = ((TypeDef) b).getBaseDataType();
|
||||
}
|
||||
a = ((Pointer) a).getDataType();
|
||||
b = ((Pointer) b).getDataType();
|
||||
}
|
||||
else if (aMeta == MetaDataType.ARRAY) {
|
||||
if (a instanceof TypeDef) {
|
||||
a = ((TypeDef) a).getBaseDataType();
|
||||
}
|
||||
if (b instanceof TypeDef) {
|
||||
b = ((TypeDef) b).getBaseDataType();
|
||||
}
|
||||
if (!(a instanceof Array) || !(b instanceof Array)) {
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -79,10 +79,16 @@ public class NoisyStructureBuilder {
|
|||
* @param dt is the data-type of field if known (null otherwise)
|
||||
*/
|
||||
public void addDataType(long offset, DataType dt) {
|
||||
if (dt == null) {
|
||||
if (dt == null || dt instanceof VoidDataType) {
|
||||
computeMax(offset, 1);
|
||||
return;
|
||||
}
|
||||
if (dt instanceof Pointer && ((Pointer) dt).getDataType().equals(structDT)) {
|
||||
// Be careful of taking a pointer to the structure when the structure
|
||||
// is not fully defined
|
||||
DataTypeManager manager = dt.getDataTypeManager();
|
||||
dt = manager.getPointer(DataType.DEFAULT, dt.getLength());
|
||||
}
|
||||
computeMax(offset, dt.getLength());
|
||||
Entry<Long, DataType> firstEntry = checkForOverlap(offset, dt.getLength());
|
||||
if (firstEntry != null) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue