Skip to content

Commit f311f6a

Browse files
committed
Add option to support auto parsing text formats.
1 parent f6db8b0 commit f311f6a

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

binaryninjaapi.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1550,6 +1550,8 @@ namespace BinaryNinja {
15501550
*/
15511551
Ref<BinaryView> Load(Ref<ProjectFile> rawData, bool updateAnalysis = true, const std::string& options = "{}", std::function<bool(size_t, size_t)> progress = {});
15521552

1553+
Ref<BinaryView> ParseTextFormat(const std::string& filename);
1554+
15531555
/*!
15541556
Deprecated. Use non-metadata version.
15551557
*/

binaryninjacore.h

Lines changed: 3 additions & 1 deletion
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 90
40+
#define BN_CURRENT_CORE_ABI_VERSION 91
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
@@ -6583,6 +6583,8 @@ extern "C"
65836583
BINARYNINJACOREAPI BNBinaryView* BNLoadProjectFile(BNProjectFile* projectFile, const bool updateAnalysis, const char* options, BNProgressFunction progress, void* progressContext);
65846584
BINARYNINJACOREAPI BNBinaryView* BNLoadBinaryView(BNBinaryView* view, const bool updateAnalysis, const char* options, BNProgressFunction progress, void* progressContext);
65856585

6586+
BINARYNINJACOREAPI BNBinaryView* BNParseTextFormat(const char* filename);
6587+
65866588
BINARYNINJACOREAPI BNExternalLibrary* BNBinaryViewAddExternalLibrary(BNBinaryView* view, const char* name, BNProjectFile* backingFile, bool isAuto);
65876589
BINARYNINJACOREAPI void BNBinaryViewRemoveExternalLibrary(BNBinaryView* view, const char* name);
65886590
BINARYNINJACOREAPI BNExternalLibrary* BNBinaryViewGetExternalLibrary(BNBinaryView* view, const char* name);

binaryview.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5526,6 +5526,15 @@ Ref<BinaryView> BinaryNinja::Load(Ref<ProjectFile> projectFile, bool updateAnaly
55265526
}
55275527

55285528

5529+
Ref<BinaryView> BinaryNinja::ParseTextFormat(const std::string& filename)
5530+
{
5531+
BNBinaryView* handle = BNParseTextFormat(filename.c_str());
5532+
if (!handle)
5533+
return nullptr;
5534+
return new BinaryView(handle);
5535+
}
5536+
5537+
55295538
SymbolQueue::SymbolQueue()
55305539
{
55315540
m_object = BNCreateSymbolQueue();

0 commit comments

Comments
 (0)