MCPcopy Index your code
hub / github.com/qilingframework/qiling / BinaryHeader

Class BinaryHeader

qiling/loader/macho_parser/header.py:17–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15
16
17class BinaryHeader(Header):
18
19 def __init__(self, data):
20 super().__init__(data)
21 FR = FileReader(data)
22 self.magic = unpack("<L", FR.read(4))[0]
23 self.cpu_type = unpack("<L", FR.read(4))[0]
24 self.cpu_subtype = unpack("<L", FR.read(4))[0]
25 self.file_type = unpack("<L", FR.read(4))[0]
26 self.lc_num = unpack("<L", FR.read(4))[0]
27 self.lc_size = unpack("<L", FR.read(4))[0]
28 self.flags = unpack("<L", FR.read(4))[0]
29
30 if self.magic in MAGIC_64:
31 self.reserved = unpack("<L", FR.read(4))[0]
32 self.header_size = FR.offset
33
34 #def __str__(self):
35 # return ("magic : 0x%X, cputype: 0x%X, subType: 0x%X, FileType: 0x%X, lc num: 0x%X, lc size: 0x%X, flags: 0x%X" % (self.magic,
36 # self.cpu_type, self.cpu_subtype, self.file_type, self.lc_num, self.lc_size, self.flags))
37
38
39class FatHeader(Header):

Callers 1

parseHeaderMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected