示例#1
0
class Example:
    magic_str: nommy.string(8)
    some_unsigned_byte: nommy.le_u8
    some_unsigned_16bit: nommy.le_u16
    some_flag: nommy.flag
    next_flag: nommy.flag
    six_bit_unsigned: nommy.le_u(6)
    ...
示例#2
0
class DNSRecord:
    magic: string(None)
    rtype: DNSRType
    foo: string(None)
示例#3
0
class Person:
    first_name: string(None)
    last_name: string(None)
示例#4
0
class Header:
    magic: string(8)
    some_type: Type
    other_type: OtherType
    person_ct: le_u8
示例#5
0
class Body:
    subject: string(None)
    text: string(None)
示例#6
0
class Header:
    id: le_u8
    recipient: string(None)
    sender: string(None)
示例#7
0
class Example:
    header: string(4)
    name: string(5)
    some_byte: le_u8
示例#8
0
class StringTypes:
    static_len: string(4)
    nullterm: string(None)
    pascal: pascal_string
示例#9
0
class PascalString:
    magic: string(2)
    first_name: pascal_string
    last_name: pascal_string
示例#10
0
class NullTermString:
    magic: string(4)
    first_name: string(None)
    last_name: string(None)
示例#11
0
class Flags:
    magic: string(2)
    flag1: flag
    flag2: flag
    flag3: flag
    flag4: flag
示例#12
0
class JustString:
    name: string(12)
示例#13
0
class Message:
    header: Header
    string_ct: le_u8
    strings: repeating(string(None), 'string_ct')
    payloads: repeating(Payload, 'header.payload_ct')
示例#14
0
class Payload:
    name: string(None)
class HasRepeats:
    name_ct: le_u8
    names: repeating(string(None), 'name_ct')
    struct_ct: le_u8
    structs: repeating(SomeStruct, 'struct_ct')
    labels: repeating_until_null(string(4))