Skip to content

Ghidra is a software reverse engineering (SRE) framework

GP-5545_5600: ProgramLoader.Builder can now take a string-based source

Ryan Kurtz66f48fe95b84
diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/util/importer/ProgramLoader.java b/Ghidra/Features/Base/src/main/java/ghidra/app/util/importer/ProgramLoader.java
index 37ffb164d3..9506bf5a8f 100644
--- a/Ghidra/Features/Base/src/main/java/ghidra/app/util/importer/ProgramLoader.java
+++ b/Ghidra/Features/Base/src/main/java/ghidra/app/util/importer/ProgramLoader.java
@@ -146,6 +146,18 @@ public class ProgramLoader {
return this;
}
+ /**
+ * Sets the required import source to the given filesystem path
+ * <p>
+ * NOTE: Any previously defined sources will be overwritten
+ *
+ * @param path The filesystem path to import. A {@code null} value will unset the source.
+ * @return This {@link Builder}
+ */
+ public Builder source(String path) {
+ return source(new File(path));
+ }
+
/**
* Sets the {@link Project}. Loaders can use this to take advantage of existing
* {@link DomainFolder}s and {@link DomainFile}s to do custom behaviors such as loading