Windows Executable Header and Data Handler

[1]:
from byteclasses.handlers.executables.pe import DOSHdr, NTHdr32
from byteclasses.print import byteclass_info, byteclass_inspect
[2]:
with open("../../../tests/data/hello_world.pe", "rb") as file:
    data = file.read()
dos_hdr = DOSHdr()
dos_hdr.attach(memoryview(data))
[3]:
byteclass_info(dos_hdr)
                                                  Byteclass Info                                                   
┏━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Property                  Value                                                                                ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ type()                    DOSHdr                                                                               │
│ is_byteclass()            True                                                                                 │
│ is_collection_instance()  True                                                                                 │
│ is_primitive_instance()   False                                                                                │
│ mro                       DOSHdr -> object                                                                     │
│ len()                     64                                                                                   │
│ str()                     DOSHdr(e_magic=Word(data=b'MZ', byte_order=b'@'), e_cblp=UInt16(144),                │
│                           e_cp=UInt16(3), e_crlc=UInt16(0), e_cparhdr=UInt16(4), e_minalloc=UInt16(0),         │
│                           e_maxalloc=UInt16(65535), e_ss=UInt16(0), e_sp=UInt16(184), e_csum=UInt16(0),        │
│                           e_ip=UInt16(0), e_cs=UInt16(0), e_lfarlc=UInt16(64), e_ovno=UInt16(0),               │
│                           e_res=ByteArray(4, UInt16), e_oemid=UInt16(0), e_oeminfo=UInt16(0),                  │
│                           e_res2=ByteArray(10, UInt16), e_lfanew=Ptr32(0xe8))                                  │
│ repr()                    DOSHdr(byte_order=b'@',data=bytearray(b'MZ\x90\x00\x03\x00\x00\x00\x04\x00\x00\x00\… │
│ .data                     bytearray(b'MZ\x90\x00\x03\x00\x00\x00\x04\x00\x00\x00\xff\xff\x00\x00\xb8\x00\x00\… │
└──────────────────────────┴──────────────────────────────────────────────────────────────────────────────────────┘
[4]:
byteclass_inspect(dos_hdr)
╭────────────────── Byteclass Inspect ──────────────────╮
│       00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f │
│ ----------------------------------------------------- │
│ 0x0  |4d 5a|90 00|03 00|00 00|04 00|00 00|ff ff|00 00 │
│ 0x10 |b8 00|00 00|00 00|00 00|40 00|00 00|00 00 00 00 │
│ 0x20 00 00 00 00|00 00|00 00|00 00 00 00 00 00 00 00  │
│ 0x30 00 00 00 00 00 00 00 00 00 00 00 00|e8 00 00 00  │
│ 0x40                                                  │
╰───────────────────────────────────────────────────────╯
                                                      Legend                                                       
┏━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Member      Value                                                                                              ┃
┡━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ e_magic     b'MZ'                                                                                              │
│ e_cblp      144                                                                                                │
│ e_cp        3                                                                                                  │
│ e_crlc      0                                                                                                  │
│ e_cparhdr   4                                                                                                  │
│ e_minalloc  0                                                                                                  │
│ e_maxalloc  65535                                                                                              │
│ e_ss        0                                                                                                  │
│ e_sp        184                                                                                                │
│ e_csum      0                                                                                                  │
│ e_ip        0                                                                                                  │
│ e_cs        0                                                                                                  │
│ e_lfarlc    64                                                                                                 │
│ e_ovno      0                                                                                                  │
│ e_res       (UInt16(0), UInt16(0), UInt16(0), UInt16(0))                                                       │
│ e_oemid     0                                                                                                  │
│ e_oeminfo   0                                                                                                  │
│ e_res2      (UInt16(0), UInt16(0), UInt16(0), UInt16(0), UInt16(0), UInt16(0), UInt16(0), UInt16(0),           │
│             UInt16(0), UInt16(0))                                                                              │
│ e_lfanew    0x000000e8                                                                                         │
└────────────┴────────────────────────────────────────────────────────────────────────────────────────────────────┘
[5]:
nt32_hdr = NTHdr32()
nt32_hdr.attach(data[dos_hdr.e_lfanew.value :])
[6]:
byteclass_info(nt32_hdr)
                                                  Byteclass Info                                                   
┏━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Property                  Value                                                                                ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ type()                    NTHdr32                                                                              │
│ is_byteclass()            True                                                                                 │
│ is_collection_instance()  True                                                                                 │
│ is_primitive_instance()   False                                                                                │
│ mro                       NTHdr32 -> object                                                                    │
│ len()                     248                                                                                  │
│ str()                     NTHdr32(signature=DWord(data=b'PE\x00\x00', byte_order=b'@'),                        │
│                           file_hdr=FileHdr(byte_order=b'@',data=bytearray(b'L\x01\t\x00\xb3\xed\x15c\x00\x00\… │
│                           opt_hdr=OptHdr32(byte_order=b'@',data=bytearray(b'\x0b\x01\x0e\x1d\x00V\x00\x00\x00… │
│ repr()                    NTHdr32(byte_order=b'@',data=bytearray(b'PE\x00\x00L\x01\t\x00\xb3\xed\x15c\x00\x00… │
│ .data                     bytearray(b'PE\x00\x00L\x01\t\x00\xb3\xed\x15c\x00\x00\x00\x00\x00\x00\x00\x00\xe0\… │
└──────────────────────────┴──────────────────────────────────────────────────────────────────────────────────────┘
[7]:
byteclass_inspect(nt32_hdr)
╭────────────────── Byteclass Inspect ──────────────────╮
│       00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f │
│ ----------------------------------------------------- │
│ 0x0  |50 45 00 00|4c 01 09 00 b3 ed 15 63 00 00 00 00 │
│ 0x10 00 00 00 00 e0 00 02 01|0b 01 0e 1d 00 56 00 00  │
│ 0xf0 00 46 00 00 00 00 00 00 23 10 01 00 00 10 00 00  │
│ 00 10 00 00 00 00 40 00 00 10 00 00 00 02 00 00 06 00 │
│ 00 00 00 00 00 00 06 00 00 00 00 00 00 00 00 00 02 00 │
│ 00 04 00 00 00 00 00 00 03 00 40 81 00 00 10 00 00 10 │
│ 00 00 00 00 10 00 00 10 00 00 00 00 00 00 10 00 00 00 │
│ 00 00 00 00 00 00 00 00 c4 b1 01 00 50 00 00 00 00 e0 │
│ 01 00 3c 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 │
│ 00 00 00 00 00 f0 01 00 9c 03 00 00 f8 84 01 00 38 00 │
│ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 │
│ 00 00 00 00 00 00 00 00 30 85 01 00 40 00 00 00 00 00 │
│ 00 00 00 00 00 00 00 b0 01 00 c4 01 00 00 00 00 00 00 │
│ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 │
│ 00 00                                                 │
╰───────────────────────────────────────────────────────╯
                                                      Legend                                                       
┏━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Member     Value                                                                                               ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ signature  b'PE\x00\x00'                                                                                       │
│ file_hdr   FileHdr(machine=UInt16(332), number_of_sections=UInt16(9), time_datestamp=UInt32(1662381491),       │
│            ptr_to_sym_tbl=Ptr32(0x0), num_of_sym=UInt32(0), size_of_opt_hdr=UInt16(224),                       │
│            characteristics=UInt16(258))                                                                        │
│ opt_hdr    OptHdr32(magic=Word(data=b'\x0b\x01', byte_order=b'@'), major_linker_ver=UInt8(14),                 │
│            minor_linker_ver=UInt8(29), size_of_code=UInt32(22016), size_of_init_data=UInt32(17920),            │
│            size_of_uninit_data=UInt32(0), addr_of_entrypoint=Ptr32(0x11023), base_of_code=Ptr32(0x1000),       │
│            base_of_data=Ptr32(0x1000), image_base=Ptr32(0x400000), section_alignment=UInt32(4096),             │
│            file_alignment=UInt32(512), major_os_ver=UInt16(6), minor_os_ver=UInt16(0),                         │
│            major_img_ver=UInt16(0), minor_img_ver=UInt16(0), major_subsys_ver=UInt16(6),                       │
│            minor_subsys_ver=UInt16(0), win32_ver_val=UInt32(0), size_of_img=UInt32(131072),                    │
│            size_of_hdrs=UInt32(1024), checksum=UInt32(0), subsystem=UInt16(3),                                 │
│            dll_characteristics=BitField16(data=b'@\x81'), size_of_stack_reserve=UInt32(1048576),               │
│            size_of_stack_commit=UInt32(4096), size_of_heap_reserve=UInt32(1048576),                            │
│            size_of_heap_commit=UInt32(4096), loader_flags=BitField32(data=b'\x00\x00\x00\x00'),                │
│            num_of_rva_and_sizes=UInt32(16), data_directory=ByteArray(16, DataDir))                             │
└───────────┴─────────────────────────────────────────────────────────────────────────────────────────────────────┘
[8]:
byteclass_info(nt32_hdr.file_hdr)
                                                  Byteclass Info                                                   
┏━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Property                  Value                                                                                ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ type()                    FileHdr                                                                              │
│ is_byteclass()            True                                                                                 │
│ is_collection_instance()  True                                                                                 │
│ is_primitive_instance()   False                                                                                │
│ mro                       FileHdr -> object                                                                    │
│ len()                     20                                                                                   │
│ str()                     FileHdr(machine=UInt16(332), number_of_sections=UInt16(9),                           │
│                           time_datestamp=UInt32(1662381491), ptr_to_sym_tbl=Ptr32(0x0), num_of_sym=UInt32(0),  │
│                           size_of_opt_hdr=UInt16(224), characteristics=UInt16(258))                            │
│ repr()                    FileHdr(byte_order=b'@',data=bytearray(b'L\x01\t\x00\xb3\xed\x15c\x00\x00\x00\x00\x… │
│ .data                     bytearray(b'L\x01\t\x00\xb3\xed\x15c\x00\x00\x00\x00\x00\x00\x00\x00\xe0\x00\x02\x0… │
└──────────────────────────┴──────────────────────────────────────────────────────────────────────────────────────┘
[9]:
byteclass_inspect(nt32_hdr.file_hdr)
╭────────────────── Byteclass Inspect ──────────────────╮
│       00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f │
│ ----------------------------------------------------- │
│ 0x0  |4c 01|09 00|b3 ed 15 63|00 00 00 00|00 00 00 00 │
│ 0x10 |e0 00|02 01                                     │
╰───────────────────────────────────────────────────────╯
              Legend               
┏━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ Member              Value      ┃
┡━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ machine             332        │
│ number_of_sections  9          │
│ time_datestamp      1662381491 │
│ ptr_to_sym_tbl      0x00000000 │
│ num_of_sym          0          │
│ size_of_opt_hdr     224        │
│ characteristics     258        │
└────────────────────┴────────────┘
[10]:
byteclass_info(nt32_hdr.opt_hdr)
                                                  Byteclass Info                                                   
┏━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Property                  Value                                                                                ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ type()                    OptHdr32                                                                             │
│ is_byteclass()            True                                                                                 │
│ is_collection_instance()  True                                                                                 │
│ is_primitive_instance()   False                                                                                │
│ mro                       OptHdr32 -> object                                                                   │
│ len()                     224                                                                                  │
│ str()                     OptHdr32(magic=Word(data=b'\x0b\x01', byte_order=b'@'), major_linker_ver=UInt8(14),  │
│                           minor_linker_ver=UInt8(29), size_of_code=UInt32(22016),                              │
│                           size_of_init_data=UInt32(17920), size_of_uninit_data=UInt32(0),                      │
│                           addr_of_entrypoint=Ptr32(0x11023), base_of_code=Ptr32(0x1000),                       │
│                           base_of_data=Ptr32(0x1000), image_base=Ptr32(0x400000),                              │
│                           section_alignment=UInt32(4096), file_alignment=UInt32(512), major_os_ver=UInt16(6),  │
│                           minor_os_ver=UInt16(0), major_img_ver=UInt16(0), minor_img_ver=UInt16(0),            │
│                           major_subsys_ver=UInt16(6), minor_subsys_ver=UInt16(0), win32_ver_val=UInt32(0),     │
│                           size_of_img=UInt32(131072), size_of_hdrs=UInt32(1024), checksum=UInt32(0),           │
│                           subsystem=UInt16(3), dll_characteristics=BitField16(data=b'@\x81'),                  │
│                           size_of_stack_reserve=UInt32(1048576), size_of_stack_commit=UInt32(4096),            │
│                           size_of_heap_reserve=UInt32(1048576), size_of_heap_commit=UInt32(4096),              │
│                           loader_flags=BitField32(data=b'\x00\x00\x00\x00'), num_of_rva_and_sizes=UInt32(16),  │
│                           data_directory=ByteArray(16, DataDir))                                               │
│ repr()                    OptHdr32(byte_order=b'@',data=bytearray(b'\x0b\x01\x0e\x1d\x00V\x00\x00\x00F\x00\x0… │
│ .data                     bytearray(b'\x0b\x01\x0e\x1d\x00V\x00\x00\x00F\x00\x00\x00\x00\x00\x00#\x10\x01\x00… │
└──────────────────────────┴──────────────────────────────────────────────────────────────────────────────────────┘
[11]:
byteclass_inspect(nt32_hdr.opt_hdr)
╭────────────────── Byteclass Inspect ──────────────────╮
│       00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f │
│ ----------------------------------------------------- │
│ 0x0  |0b 01|0e|1d|00 56 00 00|00 46 00 00|00 00 00 00 │
│ 0x10 |23 10 01 00|00 10 00 00|00 10 00 00|00 00 40 00 │
│ 0x20 |00 10 00 00|00 02 00 00|06 00|00 00|00 00|00 00 │
│ 0x30 |06 00|00 00|00 00 00 00|00 00 02 00|00 04 00 00 │
│ 0x40 |00 00 00 00|03 00|40 81|00 00 10 00|00 10 00 00 │
│ 0x50 |00 00 10 00|00 10 00 00|00 00 00 00|10 00 00 00 │
│ 0x60 |00 00 00 00 00 00 00 00 c4 b1 01 00 50 00 00 00 │
│ 0xe0 00 e0 01 00 3c 04 00 00 00 00 00 00 00 00 00 00  │
│ 00 00 00 00 00 00 00 00 00 f0 01 00 9c 03 00 00 f8 84 │
│ 01 00 38 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 │
│ 00 00 00 00 00 00 00 00 00 00 00 00 30 85 01 00 40 00 │
│ 00 00 00 00 00 00 00 00 00 00 00 b0 01 00 c4 01 00 00 │
│ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 │
│ 00 00 00 00 00 00                                     │
╰───────────────────────────────────────────────────────╯
                                                      Legend                                                       
┏━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Member                 Value                                                                                   ┃
┡━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ magic                  b'\x0b\x01'                                                                             │
│ major_linker_ver       14                                                                                      │
│ minor_linker_ver       29                                                                                      │
│ size_of_code           22016                                                                                   │
│ size_of_init_data      17920                                                                                   │
│ size_of_uninit_data    0                                                                                       │
│ addr_of_entrypoint     0x00011023                                                                              │
│ base_of_code           0x00001000                                                                              │
│ base_of_data           0x00001000                                                                              │
│ image_base             0x00400000                                                                              │
│ section_alignment      4096                                                                                    │
│ file_alignment         512                                                                                     │
│ major_os_ver           6                                                                                       │
│ minor_os_ver           0                                                                                       │
│ major_img_ver          0                                                                                       │
│ minor_img_ver          0                                                                                       │
│ major_subsys_ver       6                                                                                       │
│ minor_subsys_ver       0                                                                                       │
│ win32_ver_val          0                                                                                       │
│ size_of_img            131072                                                                                  │
│ size_of_hdrs           1024                                                                                    │
│ checksum               0                                                                                       │
│ subsystem              3                                                                                       │
│ dll_characteristics    BitField16(0000001010000001, flags={})                                                  │
│ size_of_stack_reserve  1048576                                                                                 │
│ size_of_stack_commit   4096                                                                                    │
│ size_of_heap_reserve   1048576                                                                                 │
│ size_of_heap_commit    4096                                                                                    │
│ loader_flags           BitField32(00000000000000000000000000000000, flags={})                                  │
│ num_of_rva_and_sizes   16                                                                                      │
│ data_directory         (DataDir(byte_order=b'@',data=bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')),          │
│                        DataDir(byte_order=b'@',data=bytearray(b'\xc4\xb1\x01\x00P\x00\x00\x00')),              │
│                        DataDir(byte_order=b'@',data=bytearray(b'\x00\xe0\x01\x00<\x04\x00\x00')),              │
│                        DataDir(byte_order=b'@',data=bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')),           │
│                        DataDir(byte_order=b'@',data=bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')),           │
│                        DataDir(byte_order=b'@',data=bytearray(b'\x00\xf0\x01\x00\x9c\x03\x00\x00')),           │
│                        DataDir(byte_order=b'@',data=bytearray(b'\xf8\x84\x01\x008\x00\x00\x00')),              │
│                        DataDir(byte_order=b'@',data=bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')),           │
│                        DataDir(byte_order=b'@',data=bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')),           │
│                        DataDir(byte_order=b'@',data=bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')),           │
│                        DataDir(byte_order=b'@',data=bytearray(b'0\x85\x01\x00@\x00\x00\x00')),                 │
│                        DataDir(byte_order=b'@',data=bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')),           │
│                        DataDir(byte_order=b'@',data=bytearray(b'\x00\xb0\x01\x00\xc4\x01\x00\x00')),           │
│                        DataDir(byte_order=b'@',data=bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')),           │
│                        DataDir(byte_order=b'@',data=bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')),           │
│                        DataDir(byte_order=b'@',data=bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')))           │
└───────────────────────┴─────────────────────────────────────────────────────────────────────────────────────────┘
[12]:
byteclass_info(nt32_hdr.opt_hdr.data_directory)
                                                  Byteclass Info                                                   
┏━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Property                  Value                                                                                ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ type()                    ByteArray                                                                            │
│ is_byteclass()            True                                                                                 │
│ is_collection_instance()  True                                                                                 │
│ is_primitive_instance()   False                                                                                │
│ mro                       ByteArray -> object                                                                  │
│ len()                     128                                                                                  │
│ str()                     (DataDir(byte_order=b'@',data=bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')),       │
│                           DataDir(byte_order=b'@',data=bytearray(b'\xc4\xb1\x01\x00P\x00\x00\x00')),           │
│                           DataDir(byte_order=b'@',data=bytearray(b'\x00\xe0\x01\x00<\x04\x00\x00')),           │
│                           DataDir(byte_order=b'@',data=bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')),        │
│                           DataDir(byte_order=b'@',data=bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')),        │
│                           DataDir(byte_order=b'@',data=bytearray(b'\x00\xf0\x01\x00\x9c\x03\x00\x00')),        │
│                           DataDir(byte_order=b'@',data=bytearray(b'\xf8\x84\x01\x008\x00\x00\x00')),           │
│                           DataDir(byte_order=b'@',data=bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')),        │
│                           DataDir(byte_order=b'@',data=bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')),        │
│                           DataDir(byte_order=b'@',data=bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')),        │
│                           DataDir(byte_order=b'@',data=bytearray(b'0\x85\x01\x00@\x00\x00\x00')),              │
│                           DataDir(byte_order=b'@',data=bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')),        │
│                           DataDir(byte_order=b'@',data=bytearray(b'\x00\xb0\x01\x00\xc4\x01\x00\x00')),        │
│                           DataDir(byte_order=b'@',data=bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')),        │
│                           DataDir(byte_order=b'@',data=bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')),        │
│                           DataDir(byte_order=b'@',data=bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')))        │
│ repr()                    ByteArray(16, DataDir)                                                               │
│ .data                     b'\x00\x00\x00\x00\x00\x00\x00\x00\xc4\xb1\x01\x00P\x00\x00\x00\x00\xe0\x01\x00<\x0… │
└──────────────────────────┴──────────────────────────────────────────────────────────────────────────────────────┘
[13]:
byteclass_inspect(nt32_hdr.opt_hdr.data_directory)
╭────────────────── Byteclass Inspect ──────────────────╮
│       00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f │
│ ----------------------------------------------------- │
│ 0x0  |00 00 00 00 00 00 00 00|c4 b1 01 00 50 00 00 00 │
│ 0x10 |00 e0 01 00 3c 04 00 00|00 00 00 00 00 00 00 00 │
│ 0x20 |00 00 00 00 00 00 00 00|00 f0 01 00 9c 03 00 00 │
│ 0x30 |f8 84 01 00 38 00 00 00|00 00 00 00 00 00 00 00 │
│ 0x40 |00 00 00 00 00 00 00 00|00 00 00 00 00 00 00 00 │
│ 0x50 |30 85 01 00 40 00 00 00|00 00 00 00 00 00 00 00 │
│ 0x60 |00 b0 01 00 c4 01 00 00|00 00 00 00 00 00 00 00 │
│ 0x70 |00 00 00 00 00 00 00 00|00 00 00 00 00 00 00 00 │
│ 0x80                                                  │
╰───────────────────────────────────────────────────────╯
                           Legend                            
┏━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Member  Value                                            ┃
┡━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ 0       DataDir(vaddr=Ptr32(0x0), size=UInt32(0))        │
│ 1       DataDir(vaddr=Ptr32(0x1b1c4), size=UInt32(80))   │
│ 2       DataDir(vaddr=Ptr32(0x1e000), size=UInt32(1084)) │
│ 3       DataDir(vaddr=Ptr32(0x0), size=UInt32(0))        │
│ 4       DataDir(vaddr=Ptr32(0x0), size=UInt32(0))        │
│ 5       DataDir(vaddr=Ptr32(0x1f000), size=UInt32(924))  │
│ 6       DataDir(vaddr=Ptr32(0x184f8), size=UInt32(56))   │
│ 7       DataDir(vaddr=Ptr32(0x0), size=UInt32(0))        │
│ 8       DataDir(vaddr=Ptr32(0x0), size=UInt32(0))        │
│ 9       DataDir(vaddr=Ptr32(0x0), size=UInt32(0))        │
│ 10      DataDir(vaddr=Ptr32(0x18530), size=UInt32(64))   │
│ 11      DataDir(vaddr=Ptr32(0x0), size=UInt32(0))        │
│ 12      DataDir(vaddr=Ptr32(0x1b000), size=UInt32(452))  │
│ 13      DataDir(vaddr=Ptr32(0x0), size=UInt32(0))        │
│ 14      DataDir(vaddr=Ptr32(0x0), size=UInt32(0))        │
│ 15      DataDir(vaddr=Ptr32(0x0), size=UInt32(0))        │
└────────┴──────────────────────────────────────────────────┘