Hi, I feel there is a significant bug in exporting (to c) “fixed-size” structures:
- The size itself isn’t exported
- The alignment isn’t exported
- “padding bytes” inside aren’t exported
Experiment 1
created fixed-size struct “struct_test” in size 0x2a:
00000000 struct __fixed struct_test // sizeof=0x2A
00000000 {
00000000 __int16 field_0;
00000002 __int16 field_2;
00000004 char field_4;
00000005 char field_5;
00000006 char field_6;
00000007 int field_7;
0000000B __int16 field_B;
0000000D char field_D;
0000000E char field_E;
0000000F char field_F;
00000010 char field_10;
00000011 char field_11;
00000012 char field_12;
00000013 char field_13;
00000014 // padding byte
00000015 // padding byte
00000016 char field_16;
00000017 char field_17;
00000018 char field_18;
00000019 int field_19;
0000001D // padding byte
0000001E __int64 field_1E;
00000026 __int16 field_26;
00000028 char field_28;
00000029 // padding byte
0000002A };
When I export it to .h it looks:
struct __fixed struct_test
{
__int16 field_0;
__int16 field_2;
char field_4;
char field_5;
char field_6;
int field_7;
__int16 field_B;
char field_D;
char field_E;
char field_F;
char field_10;
char field_11;
char field_12;
char field_13;
char field_16;
char field_17;
char field_18;
int field_19;
__int64 field_1E;
__int16 field_26;
char field_28;
};
And When I actually import it to IDA it looks:
00000000 struct struct_test // sizeof=0x30
00000000 {
00000000 __int16 field_0;
00000002 __int16 field_2;
00000004 char field_4;
00000005 char field_5;
00000006 char field_6;
00000007 // padding byte
00000008 int field_7;
0000000C __int16 field_B;
0000000E char field_D;
0000000F char field_E;
00000010 char field_F;
00000011 char field_10;
00000012 char field_11;
00000013 char field_12;
00000014 char field_13;
00000015 char field_16;
00000016 char field_17;
00000017 char field_18;
00000018 int field_19;
0000001C // padding byte
0000001D // padding byte
0000001E // padding byte
0000001F // padding byte
00000020 __int64 field_1E;
00000028 __int16 field_26;
0000002A char field_28;
0000002B // padding byte
0000002C // padding byte
0000002D // padding byte
0000002E // padding byte
0000002F // padding byte
00000030 };
I work a lot with those fixed-size structure and now when I tried to share with colleagues some header files the IDBs getting messed up ![]()
Would be glad if you could fix it soon, Please.
Regards, Uriel