Beispiel #1
0
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)
Beispiel #2
0
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))
Beispiel #3
0
class EmptyStruct(Struct):
    int_a = integer(signed=False, endianness=Big)
    empty_space = empty(size=3)
    int_b = integer(signed=False, endianness=Big)
Beispiel #4
0
class EXSParam(Struct):
    object_header = embed(
        EXSObjectHeader,
        validate=lambda header: header.type_signature in (0x04000101,))
    unknown = empty(472 - EXSObjectHeader.min_size())
Beispiel #5
0
class EXSSample(Struct):
    object_header = embed(
        EXSObjectHeader,
        validate=lambda header: header.type_signature in (0x03000101,))
    unknown = empty(676 - EXSObjectHeader.min_size())
Beispiel #6
0
class EXSGroup(Struct):
    object_header = embed(
        EXSObjectHeader,
        validate=lambda header: header.type_signature in (0x02000101,))
    unknown = empty(216 - EXSObjectHeader.min_size())