dissect.cstruct_legacy icon indicating copy to clipboard operation
dissect.cstruct_legacy copied to clipboard

A no-nonsense c-like structure parsing library for Python

Results 16 dissect.cstruct_legacy issues
Sort by recently updated
recently updated
newest added

``` struct some_struct { uint8 field_1; char field_2[2][SOME_CONSTANT]; char field_3[field_1 & 1 * 5]; // Some random expression to calculate array length Example field_4[2]; }; ``` char field_2 **[2]**[SOME_CONSTANT]; ![image](https://user-images.githubusercontent.com/58315982/161978272-c1ff4bbc-79f4-4bcc-8a2d-b7424c22634b.png)

When the total size of the bitfields exceeds a type definition (such as the defined uint16 but the actual consecutively defined bitfields exceed 16 bits), or the fields are not...

The offset doesn't seem to change when a child structure is used, e.g. from the sample code in the README this is generated: ``` {'name': 'field_1', 'type': uint8, 'bits': None,...

Here is a simple struct with bitfields: ``` struct relocation_info { uint32 r_address; uint32 r_symbolname:24; uint32 r_pcrel:1; uint32 r_length:2; uint32 r_extern:1; uint32 r_type:4; } ``` After parsing (`result = cparser.relocation_info(data)`),...

Null termination removed. #10

Hi, Thanks for this project. Looks good for our purpose. Would be great to support types from stdint.h like uint8_t, int8_t, ... by default without adding them manually, or support...

When a char is passed a size of 0, the colors in the hex output do not come out correctly. Structure example: typedef struct _Quarantine_File_Info { char Header[7]; byte Data_Type1;...

Now: a = cparse.myEnum.e() will assign value of e into a. reference #14

e.g.: a = cparse.myEnum.e willl assign myEnum.e string into a.