Apply caller-selected analyzer opt-outs before Ghidra analysis, reject unknown or ineffective names, and commit raw/header imports to the same analyzer profile. Use supported x86 raw compiler specs and cover the real analyzer/readback and raw workflows. Adopts the original implementation from #1800 with validated corrections. Refs #1783, #1836. Co-authored-by: akushonkamen <74654766+akushonkamen@users.noreply.github.com> Co-authored-by: N0zoM1z0 <161784452+N0zoM1z0@users.noreply.github.com> Co-authored-by: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com>
20 lines
827 B
Java
20 lines
827 B
Java
import ghidra.app.util.headless.HeadlessScript;
|
|
|
|
/** Independent readback oracle for the production analyzer-options pre-script. */
|
|
public final class ReaAnalyzerOptionsRegressionProbe extends HeadlessScript {
|
|
@Override
|
|
public void run() throws Exception {
|
|
String[] arguments = getScriptArgs();
|
|
if (arguments.length != 1 || arguments[0].isBlank()) {
|
|
throw new IllegalArgumentException("Expected one analyzer name");
|
|
}
|
|
monitor.checkCancelled();
|
|
String name = arguments[0];
|
|
String enabled = getCurrentAnalysisOptionsAndValues(currentProgram).get(name);
|
|
if (!"false".equals(enabled)) {
|
|
throw new IllegalStateException("Analyzer option is not disabled: " + name);
|
|
}
|
|
println("REA_ANALYZER_OPTIONS_DISABLED_OK " + name);
|
|
}
|
|
}
|