Skip to content

Ghidra is a software reverse engineering (SRE) framework

GP-4584 Corrected FID and ConstantPropogator errors (Closes #6453)

ghidra1b8b0bee4a476
diff --git a/Ghidra/Features/Base/src/main/java/ghidra/program/util/SymbolicPropogator.java b/Ghidra/Features/Base/src/main/java/ghidra/program/util/SymbolicPropogator.java
index 3d2c17248a..cdb61dbb3c 100644
--- a/Ghidra/Features/Base/src/main/java/ghidra/program/util/SymbolicPropogator.java
+++ b/Ghidra/Features/Base/src/main/java/ghidra/program/util/SymbolicPropogator.java
@@ -1744,7 +1744,9 @@ public class SymbolicPropogator {
con.refAddr = con.callAddr;
con.inputlist = inputs;
con.output = new ArrayList<Varnode>();
- con.output.add(out);
+ if (out != null) {
+ con.output.add(out);
+ }
try {
return payload.getPcode(prog, con);
}
diff --git a/Ghidra/Features/FunctionID/src/main/java/ghidra/feature/fid/service/FidServiceLibraryIngest.java b/Ghidra/Features/FunctionID/src/main/java/ghidra/feature/fid/service/FidServiceLibraryIngest.java
index e63742020d..fa8e7eb605 100644
--- a/Ghidra/Features/FunctionID/src/main/java/ghidra/feature/fid/service/FidServiceLibraryIngest.java
+++ b/Ghidra/Features/FunctionID/src/main/java/ghidra/feature/fid/service/FidServiceLibraryIngest.java
@@ -30,8 +30,7 @@ import ghidra.framework.model.DomainFile;
import ghidra.program.model.address.*;
import ghidra.program.model.lang.*;
import ghidra.program.model.listing.*;
-import ghidra.program.model.mem.MemoryAccessException;
-import ghidra.program.model.mem.MemoryBlock;
+import ghidra.program.model.mem.*;
import ghidra.program.model.symbol.*;
import ghidra.util.Msg;
import ghidra.util.exception.CancelledException;
@@ -619,15 +618,13 @@ class FidServiceLibraryIngest {
* @return whether the function is external
*/
private static boolean functionIsExternal(Function function) {
- if (function.isExternal()) {
- return true;
- }
+ Memory mem = function.getProgram().getMemory();
Address entryPoint = function.getEntryPoint();
- MemoryBlock block = function.getProgram().getMemory().getBlock(entryPoint);
- if (!block.isInitialized()) {
+ if (function.isExternal() || !mem.contains(entryPoint)) {
return true;
}
- return false;
+ MemoryBlock block = function.getProgram().getMemory().getBlock(entryPoint);
+ return block == null || !block.isInitialized() || block.isExternalBlock();
}
private void exclude(DomainFile domainFile, Function function,