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

Class Segment

qiling/loader/macho_parser/data.py:8–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6from struct import unpack
7
8class Segment:
9
10 def __init__(self, lc, data):
11 self.name = lc.segment_name
12 self.section_num = lc.number_of_sections
13 self.vm_address = lc.vm_address
14 self.vm_size = lc.vm_size
15 self.file_offset = lc.file_offset
16 self.file_size = lc.file_size
17 self.max_vm_protection = lc.maximum_vm_protection
18 self.init_vm_protection = lc.initial_vm_protection
19 self.flags = lc.flags
20 self.content = data[self.file_offset : self.file_offset + self.file_size]
21 self.sections = []
22 self.sections_index = []
23 for i in range(self.section_num):
24 self.sections.append(Section(lc.sections[i], data))
25
26 # def __str__(self):
27 # return (" Segment {}: content {}".format(self.name, self.content))
28
29
30class Section:

Callers 1

parseDataMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected