Skip to content

Commit ab91d0a

Browse files
committed
add fspath support to importer
1 parent 9cc5f19 commit ab91d0a

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

ghidra/import_df_structures.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@
1717

1818
import ghidra.app.cmd.function.CreateFunctionCmd;
1919
import ghidra.app.cmd.label.DemanglerCmd;
20-
import ghidra.app.plugin.core.analysis.AutoAnalysisManager;
2120
import ghidra.app.script.GhidraScript;
22-
import ghidra.app.services.AnalysisPriority;
2321
import ghidra.app.util.demangler.Demangled;
2422
import ghidra.framework.model.DomainFolder;
2523
import ghidra.program.database.data.DataTypeUtilities;
@@ -54,7 +52,7 @@ public AnalysisMode getScriptAnalysisMode() {
5452
private DataType dtUint8, dtUint16, dtUint32, dtUint64;
5553
private DataType dtInt8, dtInt16, dtInt32, dtInt64;
5654
private DataType dtInt, dtLong, dtULong, dtSizeT;
57-
private DataType dtString, dtFStream, dtMutex, dtConditionVariable, dtFuture, dtVectorBool, dtDeque;
55+
private DataType dtString, dtFStream, dtMutex, dtConditionVariable, dtFuture, dtFsPath, dtVectorBool, dtDeque;
5856
private Structure classTypeInfo, subClassTypeInfo, vmiClassTypeInfo;
5957
private Address classVTable, subClassVTable, vmiClassVTable;
6058
private int baseClassPadding;
@@ -430,6 +428,7 @@ private void createStdDataTypes() throws Exception {
430428
var mutexDataType = new StructureDataType("mutex", 0);
431429
var conditionVariableDataType = new StructureDataType("conditionVariable", 0);
432430
var futureDataType = new StructureDataType("future", 0);
431+
var fsPathDataType = new StructureDataType("fsPath", 0);
433432
var dequeDataType = new StructureDataType("deque", 0);
434433
stringDataType.setToDefaultAligned();
435434
stringDataType.setPackingEnabled(true);
@@ -563,6 +562,10 @@ private void createStdDataTypes() throws Exception {
563562
stringDataType.add(dtSizeT, "_Mysize", null);
564563
stringDataType.add(dtSizeT, "_Myres", null);
565564

565+
fsPathDataType.add(createDataType(dtcStd, stringVal), "_Bx", null);
566+
fsPathDataType.add(dtSizeT, "_Mysize", null);
567+
fsPathDataType.add(dtSizeT, "_Myres", null);
568+
566569
bitVecDataType.setExplicitMinimumAlignment(currentProgram.getDefaultPointerSize());
567570
bitVecDataType.add(Undefined.getUndefinedDataType(4 * currentProgram.getDefaultPointerSize()));
568571

@@ -592,6 +595,7 @@ private void createStdDataTypes() throws Exception {
592595
this.dtMutex = createDataType(dtcStd, mutexDataType);
593596
this.dtConditionVariable = createDataType(dtcStd, conditionVariableDataType);
594597
this.dtFuture = createDataType(dtcStd, futureDataType);
598+
this.dtFsPath = createDataType(dtcStd, fsPathDataType);
595599
this.dtString = createDataType(dtcStd, stringDataType);
596600
this.dtVectorBool = createDataType(dtcStd, bitVecDataType);
597601
this.dtDeque = createDataType(dtcStd, dequeDataType);
@@ -1491,6 +1495,8 @@ private DataType getDataType(TypeDef.Field f) throws Exception {
14911495
return dtConditionVariable;
14921496
case "stl-future":
14931497
return dtFuture;
1498+
case "stl-fs-path":
1499+
return dtFsPath;
14941500
}
14951501
break;
14961502
case "container":

0 commit comments

Comments
 (0)