diff options
| -rw-r--r-- | binaryninjaapi.h | 5 | ||||
| -rw-r--r-- | binaryninjacore.h | 6 | ||||
| -rw-r--r-- | python/settings.py | 3 | ||||
| -rw-r--r-- | settings.cpp | 10 | ||||
| -rw-r--r-- | ui/flowgraphwidget.h | 1 | ||||
| -rw-r--r-- | ui/linearview.h | 1 | ||||
| -rw-r--r-- | ui/tokenizedtextview.h | 1 |
7 files changed, 22 insertions, 5 deletions
diff --git a/binaryninjaapi.h b/binaryninjaapi.h index 6dd1aa3b..898a1711 100644 --- a/binaryninjaapi.h +++ b/binaryninjaapi.h @@ -16271,8 +16271,9 @@ namespace BinaryNinja { Prevent these from having docs autogenerated twice, due to an odd quirk with doxygen */ template <> - std::vector<std::string> Settings::QueryProperty<std::vector<std::string>>( - const std::string& key, const std::string& property); + std::string Settings::QueryProperty<std::string>(const std::string& key, const std::string& property); + template <> + std::vector<std::string> Settings::QueryProperty<std::vector<std::string>>(const std::string& key, const std::string& property); template <> bool Settings::Get<bool>(const std::string& key, Ref<BinaryView> view, BNSettingsScope* scope); template <> diff --git a/binaryninjacore.h b/binaryninjacore.h index faa3ed41..892a9bb5 100644 --- a/binaryninjacore.h +++ b/binaryninjacore.h @@ -37,7 +37,7 @@ // Current ABI version for linking to the core. This is incremented any time // there are changes to the API that affect linking, including new functions, // new types, or modifications to existing functions or types. -#define BN_CURRENT_CORE_ABI_VERSION 76 +#define BN_CURRENT_CORE_ABI_VERSION 77 // Minimum ABI version that is supported for loading of plugins. Plugins that // are linked to an ABI version less than this will not be able to load and @@ -6889,8 +6889,8 @@ extern "C" BINARYNINJACOREAPI bool BNSettingsContains(BNSettings* settings, const char* key); BINARYNINJACOREAPI bool BNSettingsIsEmpty(BNSettings* settings); BINARYNINJACOREAPI const char** BNSettingsKeysList(BNSettings* settings, size_t* inoutSize); - BINARYNINJACOREAPI const char** BNSettingsQueryPropertyStringList( - BNSettings* settings, const char* key, const char* property, size_t* inoutSize); + BINARYNINJACOREAPI char* BNSettingsQueryPropertyString(BNSettings* settings, const char* key, const char* property); + BINARYNINJACOREAPI const char** BNSettingsQueryPropertyStringList(BNSettings* settings, const char* key, const char* property, size_t* inoutSize); BINARYNINJACOREAPI bool BNSettingsUpdateProperty(BNSettings* settings, const char* key, const char* property); BINARYNINJACOREAPI bool BNSettingsUpdateBoolProperty( BNSettings* settings, const char* key, const char* property, bool value); diff --git a/python/settings.py b/python/settings.py index 8737e652..afa9983a 100644 --- a/python/settings.py +++ b/python/settings.py @@ -268,6 +268,9 @@ class Settings: core.BNFreeStringList(result, length) return out_list + def query_property_string(self, key: str, property_name: str) -> str: + return core.BNSettingsQueryPropertyString(self.handle, key, property_name) + def query_property_string_list(self, key: str, property_name: str) -> List[str]: length = ctypes.c_ulonglong() result = core.BNSettingsQueryPropertyStringList(self.handle, key, property_name, ctypes.byref(length)) diff --git a/settings.cpp b/settings.cpp index 549c7b6a..4d3f5acd 100644 --- a/settings.cpp +++ b/settings.cpp @@ -79,6 +79,16 @@ vector<string> Settings::Keys() template <> +string Settings::QueryProperty<string>(const string& key, const string& property) +{ + char* outBuffer = BNSettingsQueryPropertyString(m_object, key.c_str(), property.c_str()); + string result(outBuffer); + BNFreeString(outBuffer); + return result; +} + + +template <> vector<string> Settings::QueryProperty<vector<string>>(const string& key, const string& property) { size_t size = 0; diff --git a/ui/flowgraphwidget.h b/ui/flowgraphwidget.h index ae9a6062..7c6ad26c 100644 --- a/ui/flowgraphwidget.h +++ b/ui/flowgraphwidget.h @@ -180,6 +180,7 @@ class BINARYNINJAUIAPI FlowGraphWidget : virtual void contextMenuEvent(QContextMenuEvent*) override; void bindActions(); + void bindDynamicActions(); void navigateToAddress(uint64_t addr); void navigateToGotoLabel(uint64_t label); diff --git a/ui/linearview.h b/ui/linearview.h index 08a0a01c..29021a7a 100644 --- a/ui/linearview.h +++ b/ui/linearview.h @@ -259,6 +259,7 @@ class BINARYNINJAUIAPI LinearView : public QAbstractScrollArea, public View, pub void scrollLines(int count); void bindActions(); + void bindDynamicActions(); static void addOptionsMenuActions(Menu& menu); void getHexDumpLineBytes( diff --git a/ui/tokenizedtextview.h b/ui/tokenizedtextview.h index 979908f3..cd7469bc 100644 --- a/ui/tokenizedtextview.h +++ b/ui/tokenizedtextview.h @@ -76,6 +76,7 @@ class BINARYNINJAUIAPI TokenizedTextView : void scrollLines(int count); void bindActions(); + void bindDynamicActions(); void getHexDumpLineBytes(const BinaryNinja::LinearDisassemblyLine& line, size_t& skippedBytes, size_t& totalBytes, size_t& totalCols); void setSectionSemantics(const std::string& name, BNSectionSemantics semantics); |
