diff options
| author | Brian Potchik <brian@vector35.com> | 2025-02-03 14:00:39 -0500 |
|---|---|---|
| committer | Brian Potchik <brian@vector35.com> | 2025-02-03 14:00:39 -0500 |
| commit | f311f6af7b9bf0b24745ab1a9cb8e75c9ed5ada2 (patch) | |
| tree | 55e6b57b0d627f612c9ffd95a1575cea169190fd | |
| parent | f6db8b030153a27a8da1b794c3330b46ceeda894 (diff) | |
Add option to support auto parsing text formats.
| -rw-r--r-- | binaryninjaapi.h | 2 | ||||
| -rw-r--r-- | binaryninjacore.h | 4 | ||||
| -rw-r--r-- | binaryview.cpp | 9 |
3 files changed, 14 insertions, 1 deletions
diff --git a/binaryninjaapi.h b/binaryninjaapi.h index f3258a71..f247fc41 100644 --- a/binaryninjaapi.h +++ b/binaryninjaapi.h @@ -1550,6 +1550,8 @@ namespace BinaryNinja { */ Ref<BinaryView> Load(Ref<ProjectFile> rawData, bool updateAnalysis = true, const std::string& options = "{}", std::function<bool(size_t, size_t)> progress = {}); + Ref<BinaryView> ParseTextFormat(const std::string& filename); + /*! Deprecated. Use non-metadata version. */ diff --git a/binaryninjacore.h b/binaryninjacore.h index 73bff230..5d213793 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 90 +#define BN_CURRENT_CORE_ABI_VERSION 91 // 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 @@ -6583,6 +6583,8 @@ extern "C" BINARYNINJACOREAPI BNBinaryView* BNLoadProjectFile(BNProjectFile* projectFile, const bool updateAnalysis, const char* options, BNProgressFunction progress, void* progressContext); BINARYNINJACOREAPI BNBinaryView* BNLoadBinaryView(BNBinaryView* view, const bool updateAnalysis, const char* options, BNProgressFunction progress, void* progressContext); + BINARYNINJACOREAPI BNBinaryView* BNParseTextFormat(const char* filename); + BINARYNINJACOREAPI BNExternalLibrary* BNBinaryViewAddExternalLibrary(BNBinaryView* view, const char* name, BNProjectFile* backingFile, bool isAuto); BINARYNINJACOREAPI void BNBinaryViewRemoveExternalLibrary(BNBinaryView* view, const char* name); BINARYNINJACOREAPI BNExternalLibrary* BNBinaryViewGetExternalLibrary(BNBinaryView* view, const char* name); diff --git a/binaryview.cpp b/binaryview.cpp index 0aea134e..629ec4c5 100644 --- a/binaryview.cpp +++ b/binaryview.cpp @@ -5526,6 +5526,15 @@ Ref<BinaryView> BinaryNinja::Load(Ref<ProjectFile> projectFile, bool updateAnaly } +Ref<BinaryView> BinaryNinja::ParseTextFormat(const std::string& filename) +{ + BNBinaryView* handle = BNParseTextFormat(filename.c_str()); + if (!handle) + return nullptr; + return new BinaryView(handle); +} + + SymbolQueue::SymbolQueue() { m_object = BNCreateSymbolQueue(); |
