diff options
| author | Alexander Taylor <alex@vector35.com> | 2023-07-19 12:42:55 -0400 |
|---|---|---|
| committer | Alexander Taylor <alex@vector35.com> | 2023-07-20 15:02:24 -0400 |
| commit | eb36e3217dfce3d8738a135093110e7406c88449 (patch) | |
| tree | 000f9ecbb8e8d6307690eb582e07d95d7919f862 | |
| parent | 7dcbf23a4d4da3ac9163ea3738ab2246c4450401 (diff) | |
Add BNGetDefaultTypeParser API.
| -rw-r--r-- | binaryninjacore.h | 3 | ||||
| -rw-r--r-- | python/typeparser.py | 3 | ||||
| -rw-r--r-- | typeparser.cpp | 3 |
3 files changed, 4 insertions, 5 deletions
diff --git a/binaryninjacore.h b/binaryninjacore.h index db9f9473..cb4c3e9b 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 36 +#define BN_CURRENT_CORE_ABI_VERSION 37 // 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 @@ -5628,6 +5628,7 @@ extern "C" BINARYNINJACOREAPI BNTypeParser** BNGetTypeParserList(size_t* count); BINARYNINJACOREAPI void BNFreeTypeParserList(BNTypeParser** parsers); BINARYNINJACOREAPI BNTypeParser* BNGetTypeParserByName(const char* name); + BINARYNINJACOREAPI BNTypeParser* BNGetDefaultTypeParser(void); BINARYNINJACOREAPI char* BNGetTypeParserName(BNTypeParser* parser); diff --git a/python/typeparser.py b/python/typeparser.py index 09447987..9bbe2045 100644 --- a/python/typeparser.py +++ b/python/typeparser.py @@ -204,8 +204,7 @@ class _TypeParserMetaclass(type): Get the default parser as specified by the user's settings :return: Default parser """ - name = binaryninja.Settings().get_string("analysis.types.parserName") - return CoreTypeParser[name] + return CoreTypeParser(core.BNGetDefaultTypeParser()) class TypeParser(metaclass=_TypeParserMetaclass): diff --git a/typeparser.cpp b/typeparser.cpp index 6124004c..bb076507 100644 --- a/typeparser.cpp +++ b/typeparser.cpp @@ -38,8 +38,7 @@ Ref<TypeParser> TypeParser::GetByName(const string& name) Ref<TypeParser> TypeParser::GetDefault() { - string name = Settings::Instance()->Get<string>("analysis.types.parserName"); - return GetByName(name); + return new CoreTypeParser(BNGetDefaultTypeParser()); } |
