From a3939bdec15f9299ae9a681255fa93c47113870a Mon Sep 17 00:00:00 2001 From: Rusty Wagner Date: Tue, 24 Jan 2023 18:38:13 -0700 Subject: Fix UAF on C++ BinaryView plugin init, improve demangler and BinaryView APIs --- rust/src/lib.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'rust/src/lib.rs') diff --git a/rust/src/lib.rs b/rust/src/lib.rs index 5fbb8239..57b71cba 100644 --- a/rust/src/lib.rs +++ b/rust/src/lib.rs @@ -528,6 +528,22 @@ pub fn plugin_ui_abi_minimum_version() -> u32 { binaryninjacore_sys::BN_MINIMUM_UI_ABI_VERSION } +pub fn add_required_plugin_dependency(name: S) { + unsafe { + binaryninjacore_sys::BNAddRequiredPluginDependency( + name.into_bytes_with_nul().as_ref().as_ptr() as *const std::os::raw::c_char, + ) + }; +} + +pub fn add_optional_plugin_dependency(name: S) { + unsafe { + binaryninjacore_sys::BNAddOptionalPluginDependency( + name.into_bytes_with_nul().as_ref().as_ptr() as *const std::os::raw::c_char, + ) + }; +} + // Provide ABI version automatically so that the core can verify binary compatibility #[no_mangle] #[allow(non_snake_case)] -- cgit v1.3.1