Skip to content

Commit bd6c0a0

Browse files
authored
feat: InstructionTextLine also add address and raw instruction data (#10)
1 parent 1e6a49b commit bd6c0a0

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

Handle/BNBasicBlock.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -751,10 +751,10 @@ ref length
751751
break;
752752
}
753753

754-
yield return new InstructionTextLine(tokens);
754+
yield return new InstructionTextLine(address , data , tokens);
755+
755756
address += length;
756757
}
757-
758758
}
759759
}
760760
}

Struct/BNInstructionTextLine.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,24 @@ internal unsafe struct BNInstructionTextLine
2020
public ulong count;
2121
}
2222

23-
public sealed class InstructionTextLine
23+
public sealed class InstructionTextLine
2424
{
25+
public ulong Address { get; } = 0;
26+
27+
public byte[] Data { get; } = Array.Empty<byte>();
28+
2529
public InstructionTextToken[] Tokens { get; } = Array.Empty<InstructionTextToken>();
2630

2731
public InstructionTextLine()
2832
{
2933

3034
}
3135

32-
public InstructionTextLine(InstructionTextToken[] tokens)
36+
public InstructionTextLine(
37+
ulong address,
38+
byte[] data,
39+
InstructionTextToken[] tokens
40+
)
3341
{
3442
this.Tokens = tokens;
3543
}

0 commit comments

Comments
 (0)