mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-05-23 11:20:47 +08:00
GP-5514 fix hard coded struct field ordinal for golang 1.23+
This commit is contained in:
+3
-1
@@ -112,7 +112,9 @@ public class GoInterfaceType extends GoType {
|
||||
StructureDataType itabStruct = new StructureDataType(ifaceCP, ifaceName + "_itab", 0, dtm);
|
||||
itabStruct.replaceWith(genericItabStruct);
|
||||
|
||||
int funDTCOrdinal = 4; // a bit of a hack, could also lookup by name "Fun"
|
||||
FieldMappingInfo<GoItab> funFMI =
|
||||
programContext.getStructureMappingInfo(GoItab.class).getFieldInfo("fun");
|
||||
int funDTCOrdinal = funFMI.getDtc().getOrdinal();
|
||||
//DataTypeComponentImpl funDtc = itabStruct.getComponent(funDTCOrdinal);
|
||||
itabStruct.delete(funDTCOrdinal);
|
||||
|
||||
|
||||
+9
@@ -130,6 +130,15 @@ public class StructureMappingInfo<T> {
|
||||
return fields;
|
||||
}
|
||||
|
||||
public FieldMappingInfo<T> getFieldInfo(String javaFieldName) throws IOException {
|
||||
for (FieldMappingInfo<T> fmi : fields) {
|
||||
if (fmi.getField().getName().equals(javaFieldName)) {
|
||||
return fmi;
|
||||
}
|
||||
}
|
||||
throw new IOException("Java field name not found: " + javaFieldName);
|
||||
}
|
||||
|
||||
public List<Method> getAfterMethods() {
|
||||
return afterMethods;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user