本文整理汇总了Python中Analysis.analyze方法的典型用法代码示例。如果您正苦于以下问题:Python Analysis.analyze方法的具体用法?Python Analysis.analyze怎么用?Python Analysis.analyze使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Analysis
的用法示例。
在下文中一共展示了Analysis.analyze方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: DisassemblerView
# 需要导入模块: import Analysis [as 别名]
# 或者: from Analysis import analyze [as 别名]
#.........这里部分代码省略.........
def resizeEvent(self, event):
# Window was resized, adjust scroll bar
self.adjustSize(event.size().width(), event.size().height())
def get_cursor_pos(self):
if self.cur_instr is None:
return self.function
return self.cur_instr
def set_cursor_pos(self, addr):
if not self.view.navigate("disassembler", addr):
self.view_in_hex_editor(addr)
def get_selection_range(self):
return (self.get_cursor_pos(), self.get_cursor_pos())
def set_selection_range(self, begin, end):
self.set_cursor_pos(begin)
def write(self, data):
pos = self.get_cursor_pos()
if pos is None:
return False
return self.data.write(pos, data) == len(data)
def copy_address(self):
clipboard = QApplication.clipboard()
clipboard.clear()
mime = QMimeData()
mime.setText("0x%x" % self.get_cursor_pos())
clipboard.setMimeData(mime)
def analysis_thread_proc(self):
self.analysis.analyze()
def closeRequest(self):
# Stop analysis when closing tab
self.analysis.stop()
return True
def paintEvent(self, event):
# Initialize painter
p = QPainter(self.viewport())
p.setFont(self.font)
xofs = self.horizontalScrollBar().value()
yofs = self.verticalScrollBar().value()
if not self.ready:
# Analysis for the current function is not yet complete, paint loading screen
gradient = QLinearGradient(QPointF(0, 0), QPointF(self.viewport().size().width(), self.viewport().size().height()))
gradient.setColorAt(0, QColor(232, 232, 232))
gradient.setColorAt(1, QColor(192, 192, 192))
p.setPen(QColor(0, 0, 0, 0))
p.setBrush(QBrush(gradient))
p.drawRect(0, 0, self.viewport().size().width(), self.viewport().size().height())
if self.function is None:
text = "No function selected"
else:
text = "Loading..."
p.setPen(Qt.black)
p.drawText((self.viewport().size().width() / 2) - ((len(text) * self.charWidth) / 2),
(self.viewport().size().height() / 2) + self.charOffset + self.baseline - (self.charHeight / 2), text)
return