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 ->
def version = b.getApplication().getName()
println "have binary: " + b
if (version.equals(v33_1)) {
if (toolChain in Gcc) {

View File

@ -170,20 +170,23 @@ public class UndefinedFunction implements Function {
while (iterator.hasNext() && !monitor.isCancelled()) {
CodeBlockReference blockReference = iterator.next();
FlowType flowType = blockReference.getFlowType();
if (flowType.isCall())
continue; // Don't follow call edges for within-function analysis
if (flowType.isIndirect() || flowType.isData()) {
continue;
if (flowType.isCall()) {
continue; // Don't follow call edges for within-function analysis
}
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();
if (visitedAddresses.contains(sourceAddr))
continue; // Already visited this block
if (visitedAddresses.contains(sourceAddr)) {
continue; // Already visited this block
}
visitedAddresses.addRange(sourceAddr, sourceAddr);
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 null;
}
@ -472,8 +475,9 @@ public class UndefinedFunction implements Function {
@Override
public void setReturnType(DataType type, SourceType source) {
if (type == DataType.DEFAULT)
if (type == DataType.DEFAULT) {
return;
}
throw new UnsupportedOperationException();
}