Skip to content

Commit efb7b79

Browse files
committed
Add TransformSession constructor that adopts an existing TransformContext.
1 parent cbc66f9 commit efb7b79

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

binaryninjaapi.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9454,6 +9454,7 @@ namespace BinaryNinja {
94549454
TransformSession(const std::string& filename, BNTransformSessionMode mode, const std::string& options = "{}");
94559455
TransformSession(Ref<BinaryView> initialView, const std::string& options = "{}");
94569456
TransformSession(Ref<BinaryView> initialView, BNTransformSessionMode mode, const std::string& options = "{}");
9457+
TransformSession(Ref<TransformContext> context, BNTransformSessionMode mode, const std::string& options = "{}");
94579458
TransformSession(BNTransformSession* session);
94589459
virtual ~TransformSession();
94599460

binaryninjacore.h

Lines changed: 2 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 161
40+
#define BN_CURRENT_CORE_ABI_VERSION 162
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
@@ -4938,6 +4938,7 @@ extern "C"
49384938
BINARYNINJACOREAPI BNTransformSession* BNCreateTransformSessionWithMode(const char* filename, BNTransformSessionMode mode, const char* options);
49394939
BINARYNINJACOREAPI BNTransformSession* BNCreateTransformSessionFromBinaryView(BNBinaryView* initialView, const char* options);
49404940
BINARYNINJACOREAPI BNTransformSession* BNCreateTransformSessionFromBinaryViewWithMode(BNBinaryView* initialView, BNTransformSessionMode mode, const char* options);
4941+
BINARYNINJACOREAPI BNTransformSession* BNCreateTransformSessionFromTransformContextWithMode(BNTransformContext* context, BNTransformSessionMode mode, const char* options);
49414942
BINARYNINJACOREAPI BNTransformSession* BNNewTransformSessionReference(BNTransformSession* session);
49424943
BINARYNINJACOREAPI void BNFreeTransformSession(BNTransformSession* session);
49434944
BINARYNINJACOREAPI void BNTransformSessionSetInteractive(BNTransformSession* session, bool interactive);

transformsession.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ TransformSession::TransformSession(Ref<BinaryView> initialView, BNTransformSessi
2828
}
2929

3030

31+
TransformSession::TransformSession(Ref<TransformContext> context, BNTransformSessionMode mode, const string& options)
32+
{
33+
m_object = BNCreateTransformSessionFromTransformContextWithMode(context->GetObject(), mode, options.c_str());
34+
}
35+
36+
3137
TransformSession::TransformSession(BNTransformSession* session)
3238
{
3339
m_object = session;

0 commit comments

Comments
 (0)