summaryrefslogtreecommitdiff
path: root/binaryninjaapi.h
diff options
context:
space:
mode:
authorMason Reed <mason@vector35.com>2025-02-11 13:57:47 -0500
committerMason Reed <mason@vector35.com>2025-02-11 22:13:56 -0500
commitb546d0c8d8957064424f37f1cae7bc5fc3695f4a (patch)
tree809bad573aa08ba6611697cc9c2d4d4464b3c747 /binaryninjaapi.h
parent127ab740841f6938e359650c742314a7f1185904 (diff)
Fix partial initialization of `DisassemblyTextLine`
The usage of `DisassemblyTextLine` in the FFI was unsound, we would forget to initialize some fields causing a myriad of issues where round-tripping through the FFI was losing information.
Diffstat (limited to 'binaryninjaapi.h')
-rw-r--r--binaryninjaapi.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/binaryninjaapi.h b/binaryninjaapi.h
index c80b2510..eac04a53 100644
--- a/binaryninjaapi.h
+++ b/binaryninjaapi.h
@@ -4045,10 +4045,14 @@ namespace BinaryNinja {
struct DisassemblyTextLineTypeInfo
{
bool hasTypeInfo;
- BinaryNinja::Ref<BinaryNinja::Type> parentType;
+ Ref<Type> parentType;
size_t fieldIndex;
uint64_t offset;
+ BNDisassemblyTextLineTypeInfo GetAPIObject() const;
+ static void FreeAPIObject(BNDisassemblyTextLineTypeInfo* value);
+ static DisassemblyTextLineTypeInfo FromAPIObject(const BNDisassemblyTextLineTypeInfo* value);
+
DisassemblyTextLineTypeInfo() : hasTypeInfo(false), parentType(nullptr), fieldIndex(-1), offset(0) {}
};
@@ -4063,6 +4067,10 @@ namespace BinaryNinja {
DisassemblyTextLine();
+ BNDisassemblyTextLine GetAPIObject() const;
+ static void FreeAPIObject(BNDisassemblyTextLine* value);
+ static DisassemblyTextLine FromAPIObject(const BNDisassemblyTextLine* value);
+
size_t GetTotalWidth() const;
size_t GetAddressAndIndentationWidth() const;
std::vector<InstructionTextToken> GetAddressAndIndentationTokens() const;