diff options
| author | Mark Rowe <mark@vector35.com> | 2026-02-18 22:03:29 -0800 |
|---|---|---|
| committer | Mark Rowe <mark@vector35.com> | 2026-03-23 16:08:45 -0700 |
| commit | 1fb9828d1e12f242fa6a53aa43603ae5e556b69d (patch) | |
| tree | 40fd4fa7ca487ca8cce5a8eca8e18d5e4a15da83 /plugins/workflow_swift/src/lib.rs | |
| parent | 7aa5bd46fc2343458dff6a24ec2c67169fcac34c (diff) | |
[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.
Diffstat (limited to 'plugins/workflow_swift/src/lib.rs')
| -rw-r--r-- | plugins/workflow_swift/src/lib.rs | 14 |
1 files changed, 14 insertions, 0 deletions
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 |
