mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-03 17:59:46 +02:00
GP-5501 improved rtti script gcc typeinfo creation
This commit is contained in:
parent
227497e0fa
commit
e9e127da89
1 changed files with 18 additions and 6 deletions
|
@ -2285,7 +2285,13 @@ public class RTTIGccClassRecoverer extends RTTIClassRecoverer {
|
||||||
monitor.checkCancelled();
|
monitor.checkCancelled();
|
||||||
|
|
||||||
if (specialTypeinfo.isInProgramMemory()) {
|
if (specialTypeinfo.isInProgramMemory()) {
|
||||||
|
Data struct =
|
||||||
applyTypeinfoStructure(siClassTypeInfoStructure, specialTypeinfo.getAddress());
|
applyTypeinfoStructure(siClassTypeInfoStructure, specialTypeinfo.getAddress());
|
||||||
|
if (struct == null) {
|
||||||
|
Msg.error(this,
|
||||||
|
specialTypeinfo.getNamespace().getName() + ": cannot apply structure");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
typeinfoToStructuretypeMap.put(specialTypeinfo.getAddress(),
|
typeinfoToStructuretypeMap.put(specialTypeinfo.getAddress(),
|
||||||
SI_CLASS_TYPE_INFO_STRUCTURE);
|
SI_CLASS_TYPE_INFO_STRUCTURE);
|
||||||
}
|
}
|
||||||
|
@ -2725,14 +2731,20 @@ public class RTTIGccClassRecoverer extends RTTIClassRecoverer {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private Data applyTypeinfoStructure(Structure typeInfoStructure, Address typeinfoAddress)
|
private Data applyTypeinfoStructure(Structure typeInfoStructure, Address typeinfoAddress) {
|
||||||
throws CancelledException, AddressOutOfBoundsException, Exception {
|
|
||||||
|
|
||||||
api.clearListing(typeinfoAddress, typeinfoAddress.add(typeInfoStructure.getLength() - 1));
|
try {
|
||||||
|
api.clearListing(typeinfoAddress,
|
||||||
|
typeinfoAddress.add(typeInfoStructure.getLength() - 1));
|
||||||
Data newStructure = api.createData(typeinfoAddress, typeInfoStructure);
|
Data newStructure = api.createData(typeinfoAddress, typeInfoStructure);
|
||||||
|
|
||||||
return newStructure;
|
return newStructure;
|
||||||
}
|
}
|
||||||
|
catch (CodeUnitInsertionException | CancelledException e) {
|
||||||
|
Msg.warn(this, "Could not apply typeinfo struct at " + typeinfoAddress.toString());
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
private Structure getOrCreateVmiTypeinfoStructure(Address typeinfoAddress,
|
private Structure getOrCreateVmiTypeinfoStructure(Address typeinfoAddress,
|
||||||
StructureDataType baseClassTypeInfoStructure) throws CancelledException {
|
StructureDataType baseClassTypeInfoStructure) throws CancelledException {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue