minor cleanup

This commit is contained in:
ghidra1 2020-10-30 14:12:59 -04:00
parent 939e000113
commit eae51274e8
2 changed files with 13 additions and 10 deletions

View File

@ -142,7 +142,6 @@ model {
all{ b -> all{ b ->
def version = b.getApplication().getName() def version = b.getApplication().getName()
println "have binary: " + b
if (version.equals(v33_1)) { if (version.equals(v33_1)) {
if (toolChain in Gcc) { if (toolChain in Gcc) {

View File

@ -170,20 +170,23 @@ public class UndefinedFunction implements Function {
while (iterator.hasNext() && !monitor.isCancelled()) { while (iterator.hasNext() && !monitor.isCancelled()) {
CodeBlockReference blockReference = iterator.next(); CodeBlockReference blockReference = iterator.next();
FlowType flowType = blockReference.getFlowType(); FlowType flowType = blockReference.getFlowType();
if (flowType.isCall()) if (flowType.isCall()) {
continue; // Don't follow call edges for within-function analysis continue; // Don't follow call edges for within-function analysis
if (flowType.isIndirect() || flowType.isData()) {
continue;
} }
count += 1; // Count the existence of source that is NOT a call if (flowType.isIndirect()) {
continue; // Don't follow improper use of Indirect reference
}
count += 1; // Count the existence of source that is NOT a call
Address sourceAddr = blockReference.getSourceAddress(); Address sourceAddr = blockReference.getSourceAddress();
if (visitedAddresses.contains(sourceAddr)) if (visitedAddresses.contains(sourceAddr)) {
continue; // Already visited this block continue; // Already visited this block
}
visitedAddresses.addRange(sourceAddr, sourceAddr); visitedAddresses.addRange(sourceAddr, sourceAddr);
worklist.add(blockReference.getSourceBlock()); worklist.add(blockReference.getSourceBlock());
} }
if (count == 0) // We found a block with no incoming edges, a likely function start if (count == 0) {
return curblock; return curblock;
}
} }
return null; return null;
} }
@ -472,8 +475,9 @@ public class UndefinedFunction implements Function {
@Override @Override
public void setReturnType(DataType type, SourceType source) { public void setReturnType(DataType type, SourceType source) {
if (type == DataType.DEFAULT) if (type == DataType.DEFAULT) {
return; return;
}
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }