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

Method parseLoadCommand

qiling/loader/macho_parser/parser.py:82–112  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

80 return True
81
82 def parseLoadCommand(self):
83 self.ql.log.debug("Parse LoadCommand")
84 if not self.header.lc_num or not self.header.lc_size or not self.header.header_size:
85 return False
86
87 FR = FileReader(self.binary_file)
88 FR.setOffset(self.header.header_size)
89 self.lc_raw = FR.read(self.header.lc_size)
90 self.commands = []
91 offset = 0
92
93 for i in range(self.header.lc_num):
94
95 if self.header.lc_size >= 8:
96 lc = LoadCommand(self.lc_raw[offset:])
97 else:
98 self.ql.log.info("cmd size overflow")
99 return False
100
101 if self.header.lc_size >= offset + lc.cmd_size:
102 complete_cmd = lc.get_complete()
103 pass
104 else:
105 self.ql.log.info("cmd size overflow")
106 return False
107
108 self.commands.append(complete_cmd)
109
110 offset += lc.cmd_size
111
112 return True
113
114
115 def parseData(self):

Callers 1

parseFileMethod · 0.95

Calls 6

setOffsetMethod · 0.95
readMethod · 0.95
get_completeMethod · 0.95
FileReaderClass · 0.85
LoadCommandClass · 0.85
appendMethod · 0.45

Tested by

no test coverage detected