Commit 49ea349
authored
fix: HLIL member_index masking + operand-count table (root cause) (#24)
Python's _get_member_index masks the sentinel (1<<63) and returns None when
there is no named member; the binding returned the raw ulong and never returned
null. Investigation showed the deeper root cause: the OperationOperands table
undercounted the three field instructions by omitting the member_index slot, so
RawOperands was one short and ANY operand access on them (including the
existing Offset) threw IndexOutOfRangeException. member_index was therefore
never readable at all.
- OperationOperands: HLIL_STRUCT_FIELD 2->3, HLIL_DEREF_FIELD 2->3,
HLIL_DEREF_FIELD_SSA 3->4 (source, offset/srcMem, member_index). Growing the
count only adds the member_index slot; existing operand indices are unchanged.
- HighLevelILInstruction.MemberIndexFromRawOperand: masks the (1<<63) sentinel
to null, mirroring Python _get_member_index.
- HLILStructField.MemberIndex, HLILDerefField.MemberIndex,
HLILDerefFieldSSA.MemberIndex: long? via the helper. The two Deref members
are renamed from MemoryIndex for parity with StructField (no internal callers).1 parent 492c4b4 commit 49ea349
4 files changed
Lines changed: 36 additions & 9 deletions
File tree
- HighLevelIL
- Struct
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
31 | 36 | | |
32 | 37 | | |
33 | 38 | | |
34 | | - | |
| 39 | + | |
35 | 40 | | |
36 | 41 | | |
37 | 42 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
39 | 44 | | |
40 | 45 | | |
41 | 46 | | |
42 | | - | |
| 47 | + | |
43 | 48 | | |
44 | 49 | | |
45 | 50 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
31 | 35 | | |
32 | 36 | | |
33 | 37 | | |
34 | | - | |
| 38 | + | |
35 | 39 | | |
36 | 40 | | |
37 | 41 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
| 97 | + | |
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
| 101 | + | |
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| |||
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
204 | | - | |
| 204 | + | |
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
| |||
986 | 986 | | |
987 | 987 | | |
988 | 988 | | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
989 | 1002 | | |
990 | 1003 | | |
991 | 1004 | | |
| |||
0 commit comments