diff --git a/Ghidra/Features/Decompiler/src/main/java/ghidra/app/plugin/core/analysis/DecompilerSwitchAnalyzer.java b/Ghidra/Features/Decompiler/src/main/java/ghidra/app/plugin/core/analysis/DecompilerSwitchAnalyzer.java index af699b90ab..d632172e4c 100644 --- a/Ghidra/Features/Decompiler/src/main/java/ghidra/app/plugin/core/analysis/DecompilerSwitchAnalyzer.java +++ b/Ghidra/Features/Decompiler/src/main/java/ghidra/app/plugin/core/analysis/DecompilerSwitchAnalyzer.java @@ -478,7 +478,8 @@ public class DecompilerSwitchAnalyzer extends AbstractAnalyzer { // then it isn't a switch statment // // NOTE: Assumption, we have found all flows leading to the switch that might split the basic block - + // NOTE: This assumption is a problem for internal pcode branching. Need to check for that. + final AtomicInteger foundCount = new AtomicInteger(0); SymbolicPropogator prop = new SymbolicPropogator(program,false); prop.flowConstants(jumpBlockAt.getFirstStartAddress(), jumpBlockAt, @@ -493,6 +494,27 @@ public class DecompilerSwitchAnalyzer extends AbstractAnalyzer { } return false; } + + @Override + public boolean evaluateContextBefore(VarnodeContext context, Instruction instr) { + // There shouldn't be any branching because a branch would split a block + // but there could be internal branches, as the basic block algorithm can't + // detect these cases correctly. + PcodeOp[] pcode = instr.getPcode(); + for (PcodeOp pcodeOp : pcode) { + if (pcodeOp.getOpcode() == PcodeOp.CBRANCH) { + return true; + } + } + return false; + } + + @Override + public boolean followFalseConditionalBranches() { + // There shouldn't be any because a branch would split a block + // but there could be internal branches. + return false; + } }, false, monitor); // only found one reference diff --git a/Ghidra/Framework/Generic/Module.manifest b/Ghidra/Framework/Generic/Module.manifest index 37630b5f05..af96a293f1 100644 --- a/Ghidra/Framework/Generic/Module.manifest +++ b/Ghidra/Framework/Generic/Module.manifest @@ -3,8 +3,8 @@ MODULE FILE LICENSE: lib/commons-codec-1.18.0.jar Apache License 2.0 MODULE FILE LICENSE: lib/guava-32.1.3-jre.jar Apache License 2.0 MODULE FILE LICENSE: lib/failureaccess-1.0.1.jar Apache License 2.0 MODULE FILE LICENSE: lib/jdom2-2.0.6.1.jar JDOM License -MODULE FILE LICENSE: lib/log4j-api-2.25.4.jar Apache License 2.0 -MODULE FILE LICENSE: lib/log4j-core-2.25.4.jar Apache License 2.0 +MODULE FILE LICENSE: lib/log4j-api-2.26.1.jar Apache License 2.0 +MODULE FILE LICENSE: lib/log4j-core-2.26.1.jar Apache License 2.0 MODULE FILE LICENSE: lib/commons-collections4-4.1.jar Apache License 2.0 MODULE FILE LICENSE: lib/commons-lang3-3.20.0.jar Apache License 2.0 MODULE FILE LICENSE: lib/commons-io-2.19.0.jar Apache License 2.0 diff --git a/Ghidra/Framework/Generic/build.gradle b/Ghidra/Framework/Generic/build.gradle index ef03caa056..4fa145d166 100644 --- a/Ghidra/Framework/Generic/build.gradle +++ b/Ghidra/Framework/Generic/build.gradle @@ -34,8 +34,8 @@ dependencies { } api "com.google.guava:failureaccess:1.0.1" api "org.jdom:jdom2:2.0.6.1" - api "org.apache.logging.log4j:log4j-api:2.25.4" - api "org.apache.logging.log4j:log4j-core:2.25.4" + api "org.apache.logging.log4j:log4j-api:2.26.1" + api "org.apache.logging.log4j:log4j-core:2.26.1" api "org.apache.commons:commons-collections4:4.1" api "org.apache.commons:commons-compress:1.27.1" // requires commons-codec api "commons-codec:commons-codec:1.18.0"