class EXSObjectHeader(Struct): type_signature = integer() size = integer() object_id = integer() unknown = integer() atom = string( size=4, null_terminated=False, validate=lambda v: v in ('TBOS', 'JBOS')) name = string(size=64)
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 ArrayStruct(Struct): array1 = array( integer(signed=False, endianness=Big, validate=lambda x: x < 50))
class ArraySwitchStruct(Struct): array1 = array( one_of( integer(signed=False, endianness=Big, validate=lambda x: x < 0x10), integer(signed=False, endianness=Big, validate=lambda x: x > 0x20)))
class VariableSizeSwitchStruct(Struct): value = one_of(string(size=20), integer(endianness=Big))
class SwitchStruct(Struct): int_a = one_of( integer(signed=False, endianness=Big, validate=lambda x: x < 50), integer(signed=False, endianness=Little, validate=lambda x: x > 100))
class EmbeddedSwitchStruct2(Struct): int1 = integer(signed=False, endianness=Big, default=1) int2 = integer(signed=False, endianness=Big, default=2) int3 = integer(signed=False, endianness=Big, default=3)
class EmbeddedStruct(Struct): int_b = integer(signed=False, endianness=Big) int_c = integer(signed=False, endianness=Big) int_d = integer(signed=False, endianness=Big) int_e = integer(signed=False, endianness=Big)
class StringStruct(Struct): int_a = integer(signed=False, endianness=Big) str_a = string(size=4, null_terminated=False) int_b = integer(signed=False, endianness=Big)
class IntStruct(Struct): int_a = integer(signed=False, endianness=Big)
class EmbedStruct(Struct): struct_a = embed(IntStruct) int_b = integer(signed=False, endianness=Big)
class BasicStruct(Struct): int_a = integer(signed=False, endianness=Big) int_b = integer(signed=False, endianness=Big)
class EmptyStruct(Struct): int_a = integer(signed=False, endianness=Big) empty_space = empty(size=3) int_b = integer(signed=False, endianness=Big)
class IntStruct(Struct): signature = integer(signed=False, endianness=Big, validate=lambda x: x == 1234)
class ValidStruct(Struct): int_a = integer(signed=False, endianness=Big, validate=lambda x: x < 50) int_b = integer(signed=False, endianness=Big, validate=lambda x: x > 50) embedded = embed(IntStruct, default=IntStruct(signature=1234))