summaryrefslogtreecommitdiff
path: root/plugins/workflow_swift/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/workflow_swift/src/lib.rs')
-rw-r--r--plugins/workflow_swift/src/lib.rs14
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