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

Method __init__

qiling/loader/macho_parser/loadcommand.py:90–103  ·  view source on GitHub ↗
(self, data)

Source from the content-addressed store, hash-verified

88 # FIXME: segmengs should not be fixed size of 0x1000, should be calculated
89 # header mark as 0x1000 but it seems we need count it to matched IDApro
90 def __init__(self, data):
91 super().__init__(data)
92 self.vm_address = unpack("<Q", self.FR.read(8))[0]
93 self.vm_size = unpack("<Q", self.FR.read(8))[0]
94 self.file_offset = unpack("<Q", self.FR.read(8))[0]
95 self.file_size = unpack("<Q", self.FR.read(8))[0]
96 self.maximum_vm_protection = unpack("<L", self.FR.read(4))[0]
97 self.initial_vm_protection = unpack("<L", self.FR.read(4))[0]
98 self.number_of_sections = unpack("<L", self.FR.read(4))[0]
99 self.flags = unpack("<L", self.FR.read(4))[0]
100 self.sections = []
101 if self.number_of_sections:
102 for i in range(self.number_of_sections):
103 self.sections.append(LoadSection64(self.FR.read(0x50)))
104
105 # def __str__(self):
106 # return (" SEG64:Seg Name %s, vmaddr 0x%X, vm size 0x%X, file offset 0x%X, file size 0x%X, max vp 0x%X, init vp 0x%X, section num %d, flags 0x%X" % (

Callers

nothing calls this directly

Calls 4

LoadSection64Class · 0.85
__init__Method · 0.45
readMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected