summaryrefslogtreecommitdiff
path: root/rust/src
diff options
context:
space:
mode:
authorMarkus PiƩton <marpie@a12d404.net>2021-04-20 14:46:40 +0200
committerKyle Martin <krm504@nyu.edu>2021-04-28 14:18:34 -0400
commit2aa0e42e93a685e12f0416555da876cf11cb0e34 (patch)
treeeb937255148076ea837dc75a03c54cb977eca2c0 /rust/src
parentb01f92a7efe481e67d1eb96c98078cbd793b67d9 (diff)
Slightly better work-around for ABI version retrieval
Diffstat (limited to 'rust/src')
-rw-r--r--rust/src/lib.rs25
1 files changed, 20 insertions, 5 deletions
diff --git a/rust/src/lib.rs b/rust/src/lib.rs
index b822523a..94e6b966 100644
--- a/rust/src/lib.rs
+++ b/rust/src/lib.rs
@@ -217,13 +217,23 @@ pub fn version() -> string::BnString {
unsafe { string::BnString::from_raw(binaryninjacore_sys::BNGetVersionString()) }
}
-// TODO : We need to get this from uitypes.h::BN_CURRENT_UI_ABI_VERSION
pub fn plugin_abi_version() -> u32 {
+ binaryninjacore_sys::BN_CURRENT_CORE_ABI_VERSION
+}
+
+pub fn plugin_abi_minimum_version() -> u32 {
+ binaryninjacore_sys::BN_MINIMUM_CORE_ABI_VERSION
+}
+
+// TODO : We need to get this from uitypes.h::BN_CURRENT_UI_ABI_VERSION
+pub fn plugin_ui_abi_version() -> u32 {
+ //xxxx::BN_CURRENT_UI_ABI_VERSION
2
}
// TODO : We need to get this from uitypes.h::BN_MINIMUM_UI_ABI_VERSION
-pub fn plugin_abi_minimum_version() -> u32 {
+pub fn plugin_ui_abi_minimum_version() -> u32 {
+ //xxxx::BN_MINIMUM_UI_ABI_VERSION
2
}
@@ -235,17 +245,22 @@ pub fn core_abi_minimum_version() -> u32 {
unsafe { binaryninjacore_sys::BNGetMinimumCoreABIVersion() }
}
+// TODO : We need to get this from uitypes.h::UIPluginABIVersion()
+pub fn ui_plugin_abi_version() -> u32 {
+ //unsafe { xxxx::UIPluginABIVersion() }
+ 2
+}
+
// Provide ABI version automatically so that the core can verify binary compatibility
#[cfg(any(windows, not(feature = "headless")))]
#[no_mangle]
#[allow(non_snake_case)]
pub extern "C" fn CorePluginABIVersion() -> u32 {
- core_abi_version()
+ plugin_abi_version()
}
-// TODO : We need to get this from uitypes.h
#[cfg(any(windows, not(feature = "headless")))]
#[no_mangle]
pub extern "C" fn UIPluginABIVersion() -> u32 {
- plugin_abi_version()
+ plugin_ui_abi_version()
}