ghidra: add special case for vector<bool> that is not a bit vector

develop
Ben Lubar 2020-03-16 15:10:03 -05:00
parent 71c17a14ff
commit ee0cb94312
No known key found for this signature in database
GPG Key ID: 92939677AB59EDA4
1 changed files with 13 additions and 3 deletions

@ -76,6 +76,8 @@ public class import_df_structures extends GhidraScript
{ {
if (target == null) if (target == null)
target = DataType.DEFAULT; target = DataType.DEFAULT;
if (BooleanDataType.dataType.isEquivalent(target))
target = dtInt8;
var ptr = dtm.getPointer(target, currentProgram.getDefaultPointerSize()); var ptr = dtm.getPointer(target, currentProgram.getDefaultPointerSize());
var name = "vector<" + target.getName() + ">"; var name = "vector<" + target.getName() + ">";
@ -1192,9 +1194,13 @@ public class import_df_structures extends GhidraScript
private void labelVTables() throws Exception private void labelVTables() throws Exception
{ {
updateProgressMajor("Labelling vtables..."); updateProgressMajor("Labelling vtables...");
monitor.initialize(symbolTable.vtables.size());
int i = 0;
for (var vt : symbolTable.vtables) for (var vt : symbolTable.vtables)
{ {
monitor.setProgress(i++);
if (!vt.hasName) if (!vt.hasName)
continue; continue;
@ -1224,6 +1230,7 @@ public class import_df_structures extends GhidraScript
private void labelGlobals() throws Exception private void labelGlobals() throws Exception
{ {
updateProgressMajor("Labelling globals..."); updateProgressMajor("Labelling globals...");
monitor.initialize(codegen.globals.size());
var addrs = new HashMap<String, Address>(); var addrs = new HashMap<String, Address>();
@ -1237,8 +1244,11 @@ public class import_df_structures extends GhidraScript
addrs.put(g.name, toAddr(g.value)); addrs.put(g.name, toAddr(g.value));
} }
int i = 0;
for (var gobj : codegen.globals) for (var gobj : codegen.globals)
{ {
monitor.setProgress(i++);
if (!gobj.hasName) if (!gobj.hasName)
continue; continue;
if (!addrs.containsKey(gobj.name)) if (!addrs.containsKey(gobj.name))