From 28807a4641767caae1020f474cccd7485e3ba998 Mon Sep 17 00:00:00 2001 From: emteere <47253321+emteere@users.noreply.github.com> Date: Tue, 7 May 2024 15:03:35 -0400 Subject: [PATCH] GP-4477 Don't allow references from address tables to offcut strings. Revert default number of threads for constant analysis. --- .../plugin/core/analysis/ConstantPropagationAnalyzer.java | 2 +- .../app/plugin/core/disassembler/AddressTableAnalyzer.java | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/ConstantPropagationAnalyzer.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/ConstantPropagationAnalyzer.java index 5a42d85d48..83c1f6dda7 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/ConstantPropagationAnalyzer.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/ConstantPropagationAnalyzer.java @@ -66,7 +66,7 @@ public class ConstantPropagationAnalyzer extends AbstractAnalyzer { protected static final String MAX_THREAD_COUNT_OPTION_NAME = "Max Threads"; protected static final String MAX_THREAD_COUNT_OPTION_DESCRIPTION = "Maximum threads for constant propagation. Too many threads causes thrashing in DB."; - protected static final int MAX_THREAD_COUNT_OPTION_DEFAULT_VALUE = 1; + protected static final int MAX_THREAD_COUNT_OPTION_DEFAULT_VALUE = 2; protected static final String MIN_KNOWN_REFADDRESS_OPTION_NAME = "Min absolute reference"; protected static final String MIN_KNOWN_REFADDRESS_OPTION_DESCRIPTION = diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/disassembler/AddressTableAnalyzer.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/disassembler/AddressTableAnalyzer.java index 48f9863991..c2c947c76c 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/disassembler/AddressTableAnalyzer.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/disassembler/AddressTableAnalyzer.java @@ -419,11 +419,8 @@ public class AddressTableAnalyzer extends AbstractAnalyzer { if (cu == null) { continue; } + boolean atStartOfCU = cu.getMinAddress().equals(targetAddr); - // always allow offcuts to strings - if (cu instanceof Data data && data.getDataType() instanceof AbstractStringDataType) { - continue; - } if (!allowOffcutReferences && !atStartOfCU) { // if the processor uses low bit to reference instructions // allow offcut to an instruction by 1