Skip to content

Commit 685fb68

Browse files
committed
add ext attribute parsing for fixed len structs
1 parent 378f0a8 commit 685fb68

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/til/struct.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ impl StructRaw {
126126
let mut is_unaligned = false;
127127
let mut is_cppobj = false;
128128
let mut is_vft = false;
129+
let mut is_fixed = false;
129130
let mut is_method = false;
130131
let mut is_bitset2 = false;
131132
// InnerRef 66961e377716596c17e2330a28c01eb3600be518 0x30379a
@@ -149,8 +150,7 @@ impl StructRaw {
149150
is_unaligned = tattr & TAUDT_UNALIGNED != 0;
150151
is_cppobj = tattr & TAUDT_CPPOBJ != 0;
151152
is_vft = tattr & TAUDT_VFTABLE != 0;
152-
// TODO handle this flag
153-
let _is_fixed = tattr & TAUDT_FIXED != 0;
153+
is_fixed = tattr & TAUDT_FIXED != 0;
154154
// InnerRef fb47f2c2-3c08-4d40-b7ab-3c7736dce31d 0x478203
155155
// TODO using a field flag on the struct seems out-of-place
156156
is_method = tattr & TAFLD_METHOD != 0;
@@ -183,6 +183,7 @@ impl StructRaw {
183183
&mut *input,
184184
header,
185185
is_method,
186+
is_fixed,
186187
is_bitset2,
187188
)
188189
.with_context(|| format!("Member {i}"))
@@ -192,6 +193,7 @@ impl StructRaw {
192193
// InnerRef 66961e377716596c17e2330a28c01eb3600be518 0x3269ca
193194
let extra_padding =
194195
is_fixed.then(|| input.read_ext_att()).transpose()?;
196+
dbg!(extra_padding);
195197

196198
Ok(TypeVariantRaw::Struct(Self {
197199
effective_alignment,
@@ -272,6 +274,7 @@ impl StructMemberRaw {
272274
input: &mut impl IdaGenericBufUnpack,
273275
header: &TILSectionHeader,
274276
is_method: bool,
277+
is_fixed: bool,
275278
is_bit_set2: bool,
276279
) -> Result<Self> {
277280
// InnerRef 66961e377716596c17e2330a28c01eb3600be518 0x326610
@@ -343,6 +346,12 @@ impl StructMemberRaw {
343346
);
344347
}
345348

349+
if is_fixed && !is_method {
350+
// InnerRef 66961e377716596c17e2330a28c01eb3600be518 0x326820
351+
let _value = input.read_ext_att()?;
352+
dbg!(_value);
353+
}
354+
346355
// InnerRef fb47f2c2-3c08-4d40-b7ab-3c7736dce31d 0x47822d
347356
if is_bit_set2 && !is_method {
348357
// TODO there is more to this impl?

0 commit comments

Comments
 (0)