Skip to content

Commit c8bef72

Browse files
committed
Use title for generation of function analysis actions.
1 parent 2e272f7 commit c8bef72

7 files changed

+22
-5
lines changed

binaryninjaapi.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -16271,8 +16271,9 @@ namespace BinaryNinja {
1627116271
Prevent these from having docs autogenerated twice, due to an odd quirk with doxygen
1627216272
*/
1627316273
template <>
16274-
std::vector<std::string> Settings::QueryProperty<std::vector<std::string>>(
16275-
const std::string& key, const std::string& property);
16274+
std::string Settings::QueryProperty<std::string>(const std::string& key, const std::string& property);
16275+
template <>
16276+
std::vector<std::string> Settings::QueryProperty<std::vector<std::string>>(const std::string& key, const std::string& property);
1627616277
template <>
1627716278
bool Settings::Get<bool>(const std::string& key, Ref<BinaryView> view, BNSettingsScope* scope);
1627816279
template <>

binaryninjacore.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
// Current ABI version for linking to the core. This is incremented any time
3838
// there are changes to the API that affect linking, including new functions,
3939
// new types, or modifications to existing functions or types.
40-
#define BN_CURRENT_CORE_ABI_VERSION 76
40+
#define BN_CURRENT_CORE_ABI_VERSION 77
4141

4242
// Minimum ABI version that is supported for loading of plugins. Plugins that
4343
// are linked to an ABI version less than this will not be able to load and
@@ -6889,8 +6889,8 @@ extern "C"
68896889
BINARYNINJACOREAPI bool BNSettingsContains(BNSettings* settings, const char* key);
68906890
BINARYNINJACOREAPI bool BNSettingsIsEmpty(BNSettings* settings);
68916891
BINARYNINJACOREAPI const char** BNSettingsKeysList(BNSettings* settings, size_t* inoutSize);
6892-
BINARYNINJACOREAPI const char** BNSettingsQueryPropertyStringList(
6893-
BNSettings* settings, const char* key, const char* property, size_t* inoutSize);
6892+
BINARYNINJACOREAPI char* BNSettingsQueryPropertyString(BNSettings* settings, const char* key, const char* property);
6893+
BINARYNINJACOREAPI const char** BNSettingsQueryPropertyStringList(BNSettings* settings, const char* key, const char* property, size_t* inoutSize);
68946894
BINARYNINJACOREAPI bool BNSettingsUpdateProperty(BNSettings* settings, const char* key, const char* property);
68956895
BINARYNINJACOREAPI bool BNSettingsUpdateBoolProperty(
68966896
BNSettings* settings, const char* key, const char* property, bool value);

python/settings.py

+3
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,9 @@ def keys(self) -> List[str]:
268268
core.BNFreeStringList(result, length)
269269
return out_list
270270

271+
def query_property_string(self, key: str, property_name: str) -> str:
272+
return core.BNSettingsQueryPropertyString(self.handle, key, property_name)
273+
271274
def query_property_string_list(self, key: str, property_name: str) -> List[str]:
272275
length = ctypes.c_ulonglong()
273276
result = core.BNSettingsQueryPropertyStringList(self.handle, key, property_name, ctypes.byref(length))

settings.cpp

+10
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,16 @@ vector<string> Settings::Keys()
7878
}
7979

8080

81+
template <>
82+
string Settings::QueryProperty<string>(const string& key, const string& property)
83+
{
84+
char* outBuffer = BNSettingsQueryPropertyString(m_object, key.c_str(), property.c_str());
85+
string result(outBuffer);
86+
BNFreeString(outBuffer);
87+
return result;
88+
}
89+
90+
8191
template <>
8292
vector<string> Settings::QueryProperty<vector<string>>(const string& key, const string& property)
8393
{

ui/flowgraphwidget.h

+1
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ class BINARYNINJAUIAPI FlowGraphWidget :
180180

181181
virtual void contextMenuEvent(QContextMenuEvent*) override;
182182
void bindActions();
183+
void bindDynamicActions();
183184

184185
void navigateToAddress(uint64_t addr);
185186
void navigateToGotoLabel(uint64_t label);

ui/linearview.h

+1
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@ class BINARYNINJAUIAPI LinearView : public QAbstractScrollArea, public View, pub
259259
void scrollLines(int count);
260260

261261
void bindActions();
262+
void bindDynamicActions();
262263
static void addOptionsMenuActions(Menu& menu);
263264

264265
void getHexDumpLineBytes(

ui/tokenizedtextview.h

+1
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ class BINARYNINJAUIAPI TokenizedTextView :
7676
void scrollLines(int count);
7777

7878
void bindActions();
79+
void bindDynamicActions();
7980
void getHexDumpLineBytes(const BinaryNinja::LinearDisassemblyLine& line, size_t& skippedBytes, size_t& totalBytes, size_t& totalCols);
8081

8182
void setSectionSemantics(const std::string& name, BNSectionSemantics semantics);

0 commit comments

Comments
 (0)