当前位置: 首页>>代码示例>>Python>>正文


Python Analysis.undefine_symbol方法代码示例

本文整理汇总了Python中Analysis.undefine_symbol方法的典型用法代码示例。如果您正苦于以下问题:Python Analysis.undefine_symbol方法的具体用法?Python Analysis.undefine_symbol怎么用?Python Analysis.undefine_symbol使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Analysis的用法示例。


在下文中一共展示了Analysis.undefine_symbol方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: DisassemblerView

# 需要导入模块: import Analysis [as 别名]
# 或者: from Analysis import undefine_symbol [as 别名]

#.........这里部分代码省略.........
				else:
					QMessageBox.critical(self, "Error", "Invalid address or symbol")
					return

			# Try navigating within disassembly, if it isn't within a function then
			# navigate to the hex editor
			if not self.view.navigate("disassembler", addr):
				self.view_in_hex_editor(addr)

	def enter_name(self):
		# A symbol must be selected
		if (self.highlight_token == None) or (self.highlight_token[0] != "ptr"):
			QMessageBox.critical(self, "Error", "No symbol selected.")
			return

		addr = self.highlight_token[1]
		name = self.highlight_token[2]

		# Ask for new name
		new_name, ok = QInputDialog.getText(self, "Rename Symbol", "Symbol name:", QLineEdit.Normal, name)
		if ok:
			self.analysis.create_symbol(addr, new_name)

	def undefine_name(self):
		# A symbol must be selected
		if (self.highlight_token == None) or (self.highlight_token[0] != "ptr"):
			QMessageBox.critical(self, "Error", "No symbol selected.")
			return

		addr = self.highlight_token[1]
		name = self.highlight_token[2]

		# Ask for new name
		self.analysis.undefine_symbol(addr, name)

	def navigate_for_find(self, addr):
		func, instr = self.analysis.find_instr(addr, True)
		if func != None:
			self.navigate(addr)
		else:
			self.make_proc(addr)
			self.cur_instr = addr
			self.desired_pos = None

	def perform_find(self, dlg):
		self.search_regex = dlg.search_regex()
		if self.cur_instr != None:
			self.search_start = self.cur_instr
		else:
			if self.function is None:
				return
			self.search_start = self.function

		found_loc = self.data.find(self.search_regex, self.search_start)
		if found_loc != -1:
			self.view.add_history_entry()
			self.navigate_for_find(found_loc)
			self.search_pos = found_loc + 1
			return

		found_loc = self.data.find(self.search_regex, self.data.start())
		if (found_loc != -1) and (found_loc < self.search_start):
			self.view.add_history_entry()
			self.navigate_for_find(found_loc)
			self.search_pos = found_loc + 1
			return
开发者ID:0x31323334,项目名称:deprecated-binaryninja-python,代码行数:70,代码来源:DisassemblerView.py


注:本文中的Analysis.undefine_symbol方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。