summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--binaryninjaapi.h1
-rw-r--r--binaryninjacore.h1
-rw-r--r--pluginmanager.cpp5
-rw-r--r--python/pluginmanager.py2
-rw-r--r--rust/src/repository/plugin.rs7
-rw-r--r--rust/tests/repository.rs1
6 files changed, 16 insertions, 1 deletions
diff --git a/binaryninjaapi.h b/binaryninjaapi.h
index 1c482b66..af9992fd 100644
--- a/binaryninjaapi.h
+++ b/binaryninjaapi.h
@@ -19201,6 +19201,7 @@ namespace BinaryNinja {
std::string GetPluginDirectory() const;
std::string GetAuthor() const;
std::string GetDescription() const;
+ std::string GetLicenseText() const;
std::string GetName() const;
std::vector<PluginType> GetPluginTypes() const;
std::string GetPackageUrl() const;
diff --git a/binaryninjacore.h b/binaryninjacore.h
index 446391e1..cec95ec9 100644
--- a/binaryninjacore.h
+++ b/binaryninjacore.h
@@ -7970,6 +7970,7 @@ extern "C"
BINARYNINJACOREAPI char** BNPluginGetApis(BNPlugin* p, size_t* count);
BINARYNINJACOREAPI const char* BNPluginGetAuthor(BNPlugin* p);
BINARYNINJACOREAPI const char* BNPluginGetDescription(BNPlugin* p);
+ BINARYNINJACOREAPI const char* BNPluginGetLicenseText(BNPlugin* p);
BINARYNINJACOREAPI BNVersionInfo BNPluginGetMinimumVersionInfo(BNPlugin* p);
BINARYNINJACOREAPI BNVersionInfo BNPluginGetMaximumVersionInfo(BNPlugin* p);
BINARYNINJACOREAPI BNVersionInfo BNParseVersionString(const char* v);
diff --git a/pluginmanager.cpp b/pluginmanager.cpp
index 9b24a464..bfa0dfb9 100644
--- a/pluginmanager.cpp
+++ b/pluginmanager.cpp
@@ -70,6 +70,11 @@ string Extension::GetDescription() const
RETURN_STRING(BNPluginGetDescription(m_object));
}
+string Extension::GetLicenseText() const
+{
+ RETURN_STRING(BNPluginGetLicenseText(m_object));
+}
+
static VersionInfo ConvertVersionInfo(const BNVersionInfo& coreInfo)
{
VersionInfo result;
diff --git a/python/pluginmanager.py b/python/pluginmanager.py
index 55315d12..32d410ea 100644
--- a/python/pluginmanager.py
+++ b/python/pluginmanager.py
@@ -154,7 +154,7 @@ class Extension:
@deprecation.deprecated(deprecated_in="5.3", details='This field will be removed.')
def license_text(self) -> Optional[str]:
"""String complete license text for the given plugin"""
- return ''
+ return core.BNPluginGetLicenseText(self.handle)
@property
def long_description(self) -> Optional[str]:
diff --git a/rust/src/repository/plugin.rs b/rust/src/repository/plugin.rs
index ac7c9d20..1abee1e8 100644
--- a/rust/src/repository/plugin.rs
+++ b/rust/src/repository/plugin.rs
@@ -103,6 +103,13 @@ impl Extension {
unsafe { BnString::into_string(result as *mut c_char) }
}
+ /// String complete license text for the given plugin
+ pub fn license_text(&self) -> String {
+ let result = unsafe { BNPluginGetLicenseText(self.handle.as_ptr()) };
+ assert!(!result.is_null());
+ unsafe { BnString::into_string(result as *mut c_char) }
+ }
+
/// Minimum version info the plugin was tested on
pub fn minimum_version_info(&self) -> VersionInfo {
let result = unsafe { BNPluginGetMinimumVersionInfo(self.handle.as_ptr()) };
diff --git a/rust/tests/repository.rs b/rust/tests/repository.rs
index ac861b2c..d22f900d 100644
--- a/rust/tests/repository.rs
+++ b/rust/tests/repository.rs
@@ -20,6 +20,7 @@ fn test_list() {
for plugin in &plugins {
let plugin_path = plugin.path();
let plugin_by_path = repository.plugin_by_path(&plugin_path).unwrap();
+ let _license_text = plugin.license_text();
assert_eq!(plugin.package_url(), plugin_by_path.package_url());
}
}