本文整理汇总了Python中idc.GetInputMD5方法的典型用法代码示例。如果您正苦于以下问题:Python idc.GetInputMD5方法的具体用法?Python idc.GetInputMD5怎么用?Python idc.GetInputMD5使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类idc
的用法示例。
在下文中一共展示了idc.GetInputMD5方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Show
# 需要导入模块: import idc [as 别名]
# 或者: from idc import GetInputMD5 [as 别名]
def Show(self):
"""
Creates the form and brings it to the front.
"""
try:
input_md5 = idc.retrieve_input_file_md5()
except:
input_md5 = idc.GetInputMD5()
if input_md5 is None:
return
else:
name = "{}".format(config['name'])
try:
options = PluginForm.WCLS_CLOSE_LATER |\
PluginForm.WCLS_SAVE |\
PluginForm.WOPN_RESTORE
except:
options = PluginForm.FORM_CLOSE_LATER |\
PluginForm.FORM_SAVE |\
PluginForm.FORM_RESTORE
return PluginForm.Show(self, name, options=options)
示例2: __init__
# 需要导入模块: import idc [as 别名]
# 或者: from idc import GetInputMD5 [as 别名]
def __init__(self):
super(Plugin, self).__init__()
self.tools = hrdev_plugin.include.helper.Tools(self)
self.config_main = ConfigParser.ConfigParser()
self.config_theme = ConfigParser.ConfigParser()
self._bin_md5 = idc.GetInputMD5()
self._bin_name = re.sub(r'\.[^.]*$', '', idc.GetInputFile())
self.imports = self._get_imported_names()
self.tmp_items = []
real_dir = os.path.realpath(__file__).split('\\')
real_dir.pop()
real_dir = os.path.sep.join(real_dir)
self._read_config(real_dir)
self.banned_functions = \
self.config_main.get('etc', 'banned_functions').split(',')
self.gui = None
self.parser = None
示例3: GetInputFileMD5
# 需要导入模块: import idc [as 别名]
# 或者: from idc import GetInputMD5 [as 别名]
def GetInputFileMD5():
"""
Return the MD5 hash of the input binary file
@return: MD5 string or None on error
"""
return idc.GetInputMD5()
示例4: __init__
# 需要导入模块: import idc [as 别名]
# 或者: from idc import GetInputMD5 [as 别名]
def __init__(self, **kwargs):
super(AddFileDialog, self).__init__(title="Add File", **kwargs)
name = idc.GetInputFile()
md5hash = idc.GetInputMD5()
layout = QtWidgets.QGridLayout()
layout.addWidget(QtWidgets.QLabel("Project:"), 0, 0)
layout.addWidget(QtWidgets.QLabel("File name:"), 1, 0)
layout.addWidget(QtWidgets.QLabel("Description:"), 2, 0)
layout.addWidget(QtWidgets.QLabel("MD5 hash:"), 3, 0)
self.project_cbb = widgets.QItemSelect('projects', 'name', 'id',
'description')
layout.addWidget(self.project_cbb, 0, 1)
self.name_txt = QtWidgets.QLineEdit()
self.name_txt.setText(name)
layout.addWidget(self.name_txt, 1, 1)
self.description_txt = QtWidgets.QTextEdit()
layout.addWidget(self.description_txt, 2, 1)
layout.addWidget(QtWidgets.QLabel(md5hash), 3, 1)
self.base_layout.addLayout(layout)
self.shareidbCkb = QtWidgets.QCheckBox("Share IDB (let others without "
"the idb to participate)")
self.base_layout.addWidget(self.shareidbCkb)
self.bottom_layout(ok_text="&Add")
示例5: data
# 需要导入模块: import idc [as 别名]
# 或者: from idc import GetInputMD5 [as 别名]
def data(self):
return {'project': self.project_cbb.currentData(),
'name': self.name_txt.text(),
'md5hash': idc.GetInputMD5(),
'description': self.description_txt.toPlainText(),
'shareidb': self.shareidbCkb.isChecked()}
示例6: upload
# 需要导入模块: import idc [as 别名]
# 或者: from idc import GetInputMD5 [as 别名]
def upload(self,ctx):
start = time.time()
func_count = 0
bb_count = 0
call_count = 0
target = idaapi.get_root_filename()
hash = idc.GetInputMD5()
tx = self.neo.cypher.begin()
insert_binary = "MERGE (n:Binary {name:{N},hash:{H}}) RETURN n"
insert_func = "MERGE (n:Function {name:{N},start:{S},flags:{F}}) RETURN n"
insert_bb = "MERGE (n:BasicBlock {start:{S}, end:{E}}) RETURN n"
create_relationship = "MATCH (u:Function {name:{N}}), (r:Function {start:{S}}) CREATE (u)-[:CALLS]->(r)"
create_contains = "MATCH (u:BasicBlock {start:{S}}), (f:Function {name:{N}}) CREATE (f)-[:CONTAINS]->(u)"
create_inside = "MATCH (u:Function {start:{S}}), (b:Binary {hash:{H}}) CREATE (f)-[:INSIDE]->(b)"
self.neo.cypher.execute(insert_binary, {"N":target, "H":hash})
self.neo.cypher.execute("CREATE INDEX ON :Function(start)")
#self.neo.cypher.execute("CREATE INDEX ON :Function(name)")
self.neo.cypher.execute("CREATE INDEX ON :BasicBlock(start)")
for f in Functions():
tx.append(create_inside, {"S":f, "H":hash})
callee_name = GetFunctionName(f)
flags = get_flags(f)
type = GetType(f)
if type:
return_type = type.split()[0]
print type
end_return = type.find(' ')
start_args = type.find('(')
print type[end_return +1:start_args]
print type[start_args+1:].split(',')
else:
print GuessType(f)
tx.append(insert_func, {"N": callee_name, "S":f, "F":flags})
func_count += 1
fc = idaapi.FlowChart(idaapi.get_func(f))
for block in fc:
tx.append(insert_bb, {"S":block.startEA,"E":block.endEA})
tx.append(create_contains,{"S":block.startEA,"N":f})
bb_count += 1
tx.process()
tx.commit()
tx = self.neo.cypher.begin()
for f in Functions():
for xref in CodeRefsTo(f,0):
caller_name = GetFunctionName(xref)
if caller_name != '':
tx.append(create_relationship,{"N":caller_name,"S":f})
call_count += 1
tx.process()
tx.commit()
print "Upload ran in: " + str(time.time() - start)
print "Uploaded " + str(func_count) + " functions, " + str(call_count) +" function calls and " + str(bb_count) + " basic blocks."