MCPcopy Create free account
hub / github.com/qilingframework/qiling / FatHeader

Class FatHeader

qiling/loader/macho_parser/header.py:39–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37
38
39class FatHeader(Header):
40
41 def __init__(self, data):
42 super().__init__(data)
43 FR = FileReader(data)
44 FR.setOffset(4)
45 self.binarys = []
46 self.arch_num = unpack(">L", FR.read(4))[0]
47 for i in range(self.arch_num):
48 FI = FatInfo(FR.read(4 * 5))
49 self.binarys.append(FI)
50
51 def getBinary(self, arch):
52
53 for item in self.binarys:
54 if item.cpu_type == CPU_TYPE_X8664:
55 return item
56 elif item.cpu_type == CPU_TYPE_ARM64:
57 return item
58 return None
59
60class FatInfo:
61 def __init__(self, data):

Callers 1

parseHeaderMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected