From 1fb9828d1e12f242fa6a53aa43603ae5e556b69d Mon Sep 17 00:00:00 2001 From: Mark Rowe Date: Wed, 18 Feb 2026 22:03:29 -0800 Subject: [Swift] Add support for applying parameter and return types during demangling This is disabled by default due to a current limitation where core is not able to represent parameters that are small structs being passed across multiple registers. `analysis.swift.extractTypesFromMangledNames` can be enabled to test this. --- plugins/workflow_swift/src/lib.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'plugins/workflow_swift/src/lib.rs') diff --git a/plugins/workflow_swift/src/lib.rs b/plugins/workflow_swift/src/lib.rs index 2e97a43b..a04f3659 100644 --- a/plugins/workflow_swift/src/lib.rs +++ b/plugins/workflow_swift/src/lib.rs @@ -2,8 +2,11 @@ mod demangler; use binaryninja::add_optional_plugin_dependency; use binaryninja::demangle::Demangler; +use binaryninja::settings::Settings; use demangler::SwiftDemangler; +pub const SETTING_EXTRACT_TYPES: &str = "analysis.swift.extractTypesFromMangledNames"; + #[no_mangle] #[allow(non_snake_case)] pub extern "C" fn CorePluginDependencies() { @@ -16,6 +19,17 @@ pub extern "C" fn CorePluginDependencies() { pub extern "C" fn CorePluginInit() -> bool { binaryninja::tracing_init!("Plugin.Swift"); + let settings = Settings::new(); + settings.register_setting_json( + SETTING_EXTRACT_TYPES, + r#"{ + "title" : "Extract Types from Mangled Names", + "type" : "boolean", + "default" : true, + "description" : "Extract parameter and return type information from Swift mangled names and apply them to function signatures. When disabled, only the demangled name is applied." + }"#, + ); + Demangler::register("Swift", SwiftDemangler); true -- cgit v1.3.1