本文整理匯總了Python中idc.Warning方法的典型用法代碼示例。如果您正苦於以下問題:Python idc.Warning方法的具體用法?Python idc.Warning怎麽用?Python idc.Warning使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類idc
的用法示例。
在下文中一共展示了idc.Warning方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: __call__
# 需要導入模塊: import idc [as 別名]
# 或者: from idc import Warning [as 別名]
def __call__(self, f):
def wrapped_export_f(*args):
if not globals().has_key("IDP_Hooks") or globals()["IDP_Hooks"] is None:
from idaapi import IDP_Hooks, UI_Hooks
from idc import Name, GetFunctionName, GetStrucIdByName, GetConstName, Warning, SetStrucName, GetStrucName
globals()["IDP_Hooks"] = locals()["IDP_Hooks"]
globals()["UI_Hooks"] = locals()["UI_Hooks"]
globals()["Name"] = locals()["Name"]
globals()["GetFunctionName"] = locals()["GetFunctionName"]
globals()["GetStrucIdByName"] = locals()["GetStrucIdByName"]
globals()["GetConstName"] = locals()["GetConstName"]
globals()["Warning"] = locals()["Warning"]
globals()["SetStrucName"] = locals()["SetStrucName"]
globals()["GetStrucName"] = locals()["GetStrucName"]
return f(*args)
return wrapped_export_f
示例2: main
# 需要導入模塊: import idc [as 別名]
# 或者: from idc import Warning [as 別名]
def main():
if not idaapi.is_debugger_on():
idc.Warning("Please run the process first!")
return
if idaapi.get_process_state() != -1:
idc.Warning("Please suspend the debugger first!")
return
# only avail from IdaPython r232
if hasattr(idaapi, "NearestName"):
# get all debug names
dn = idaapi.get_debug_names(idaapi.cvar.inf.minEA, idaapi.cvar.inf.maxEA)
# initiate a nearest name search (using debug names)
nn = idaapi.NearestName(dn)
else:
nn = None
ret, callstack = CallStackWalk(nn)
if ret:
title = "Call stack walker (thread %X)" % (GetCurrentThreadId())
idaapi.close_chooser(title)
c = CallStackWalkChoose(callstack, title)
c.choose()
else:
idc.Warning("Failed to walk the stack:" + callstack)
# -----------------------------------------------------------------------
示例3: renamed
# 需要導入模塊: import idc [as 別名]
# 或者: from idc import Warning [as 別名]
def renamed(self, ea, new_name, local_name):
struct_id = GetStrucIdByName(GetConstName(ea))
is_struct = struct_id != 0xffffffffffffffff and struct_id != 0xffffffff
if is_struct:
Warning("IDASynergy still does not support renaming of structs.\nBy renaming it, other collaborators will get this struct deleted and a new one added\nIf you want to avoid this, please rename it to its old name.")
return IDP_Hooks.renamed(self, ea, new_name, local_name)
if Name(ea) != "" and GetFunctionName(ea) != "": # If renaming a function...
self.data_io.apply_modification("functions", (ea, new_name))
return IDP_Hooks.renamed(self, ea, new_name, local_name)
示例4: init
# 需要導入模塊: import idc [as 別名]
# 或者: from idc import Warning [as 別名]
def init(self):
"""
Ensure plugin's line modification function is called whenever needed.
If Hex-Rays is not installed, or is not initialized yet, then plugin
will not load. To ensure that the plugin loads after Hex-Rays, please
name your plugin's .py file with a name that starts lexicographically
after "hexx86f"
"""
try:
if idaapi.init_hexrays_plugin():
def hexrays_event_callback(event, *args):
if event == idaapi.hxe_refresh_pseudocode:
# We use this event instead of hxe_text_ready because
# MacOSX doesn't seem to work well with it
# TODO: Look into this
vu, = args
self.visit_func(vu.cfunc)
return 0
idaapi.install_hexrays_callback(hexrays_event_callback)
else:
return idaapi.PLUGIN_SKIP
except AttributeError:
idc.Warning('''init_hexrays_plugin() not found.
Skipping Hex-Rays plugin.''')
return idaapi.PLUGIN_KEEP
示例5: main
# 需要導入模塊: import idc [as 別名]
# 或者: from idc import Warning [as 別名]
def main():
message = "First of all you need to specify folder with test cases."
idc.Warning(message)
fname = idc.AskFile(0, "*.*", "Please specify first trace file in test cases folder \
to start prioritization")
if fname == None:
print "You need to specify any file in test cases folder to start prioritization"
return 0
fname = os.path.dirname(fname)
if fname == None:
return 0
print "Starting prioritization of " + fname
start_prior(fname)
print "Done"
示例6: warning_msgbox
# 需要導入模塊: import idc [as 別名]
# 或者: from idc import Warning [as 別名]
def warning_msgbox(warning_str):
def fun(warning_str):
idc.Warning(warning_str)
idaapi.execute_sync(partial(fun, warning_str), idaapi.MFF_FAST)
# TODO: not sure if this should always work (race condition? or not with GIL?)