class BitStruct(Struct): int_a = integer(signed=False, endianness=Big) empty_space = empty(size=3) bits = bitfield( empty(), bit(), empty(size=5), bit(), ) bit_a, bit_b = bits.expand() int_b = integer(signed=False, endianness=Big)
class MyStruct(Struct): int_a = integer(signed=False, endianness=Big) empty_space = empty(size=3) bits = bitfield( empty(), bit(), empty(size=5), bit(), ) bit_a, bit_b = bits.expand() embedded = embed(EmbeddedStruct, default=EmbeddedStruct(2, 3, 4, 5))
class EmptyStruct(Struct): int_a = integer(signed=False, endianness=Big) empty_space = empty(size=3) int_b = integer(signed=False, endianness=Big)
class EXSParam(Struct): object_header = embed( EXSObjectHeader, validate=lambda header: header.type_signature in (0x04000101,)) unknown = empty(472 - EXSObjectHeader.min_size())
class EXSSample(Struct): object_header = embed( EXSObjectHeader, validate=lambda header: header.type_signature in (0x03000101,)) unknown = empty(676 - EXSObjectHeader.min_size())
class EXSGroup(Struct): object_header = embed( EXSObjectHeader, validate=lambda header: header.type_signature in (0x02000101,)) unknown = empty(216 - EXSObjectHeader.min_size())