From 150b5dfd2cbf950047f7a0044383834fe3fa16dd Mon Sep 17 00:00:00 2001 From: tinysec Date: Thu, 27 Nov 2025 12:18:18 +0800 Subject: [PATCH] feat: InstructionTextLine also add address and raw instruction data --- Handle/BNBasicBlock.cs | 4 ++-- Struct/BNInstructionTextLine.cs | 12 ++++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Handle/BNBasicBlock.cs b/Handle/BNBasicBlock.cs index 4997197..a2d31b3 100644 --- a/Handle/BNBasicBlock.cs +++ b/Handle/BNBasicBlock.cs @@ -751,10 +751,10 @@ ref length break; } - yield return new InstructionTextLine(tokens); + yield return new InstructionTextLine(address , data , tokens); + address += length; } - } } } \ No newline at end of file diff --git a/Struct/BNInstructionTextLine.cs b/Struct/BNInstructionTextLine.cs index 331e882..8ea90aa 100644 --- a/Struct/BNInstructionTextLine.cs +++ b/Struct/BNInstructionTextLine.cs @@ -20,8 +20,12 @@ internal unsafe struct BNInstructionTextLine public ulong count; } - public sealed class InstructionTextLine + public sealed class InstructionTextLine { + public ulong Address { get; } = 0; + + public byte[] Data { get; } = Array.Empty(); + public InstructionTextToken[] Tokens { get; } = Array.Empty(); public InstructionTextLine() @@ -29,7 +33,11 @@ public InstructionTextLine() } - public InstructionTextLine(InstructionTextToken[] tokens) + public InstructionTextLine( + ulong address, + byte[] data, + InstructionTextToken[] tokens + ) { this.Tokens = tokens; }