summaryrefslogtreecommitdiff
path: root/view/macho
diff options
context:
space:
mode:
authorBrian Potchik <brian@vector35.com>2026-03-30 08:50:13 -0400
committerBrian Potchik <brian@vector35.com>2026-03-30 08:51:28 -0400
commit5a99579b1a903d3738bb82450ec40c52f1ea5594 (patch)
treed8fa40427b662ea8d04d101180b82681b231347e /view/macho
parente5c73ffdf3d1914596f0ffd1c989330657934627 (diff)
This reverts commit 7228ba0b889765bc3474fbd5475870e24efc79ca.
Diffstat (limited to 'view/macho')
-rw-r--r--view/macho/universaltransform.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/view/macho/universaltransform.cpp b/view/macho/universaltransform.cpp
index 3309d853..33164215 100644
--- a/view/macho/universaltransform.cpp
+++ b/view/macho/universaltransform.cpp
@@ -266,19 +266,20 @@ bool UniversalTransform::DecodeWithContext(Ref<TransformContext> context, const
architectures.push_back(archName);
}
- if (!context->IsInteractive())
+ // TODO: It is surprising that this is UniversalTransform's responsibility.
+ if (!BinaryNinja::IsUIEnabled())
{
+ // When headless, filter to the preferred architecture if one is configured.
vector<string> archPref = context->GetSettings()->Get<vector<string>>("files.universal.architecturePreference");
if (auto result = find_first_of(archPref.begin(), archPref.end(), architectures.begin(), architectures.end()); result != archPref.end())
{
- // Filter to preferred architecture to support container auto-open policy
size_t archIndex = find(architectures.begin(), architectures.end(), *result) - architectures.begin();
context->SetAvailableFiles({architectures[archIndex]});
return false;
}
- // Preserve original headless load behavior when no architecturePreference is specified
- if (!BinaryNinja::IsUIEnabled() && archPref.empty() && architectures.size())
+ // Load the first architecture if no preference is found.
+ if (archPref.empty() && architectures.size())
{
context->SetAvailableFiles({architectures[0]});
return false;