我们从Python开源项目中,提取了以下3个代码示例,用于说明如何使用idaapi.IDP_Hooks()。
def __init__(self, skel_conn): idaapi.IDP_Hooks.__init__(self) self.skel_conn = skel_conn
def renamed(self, *args): g_logger.debug("[IDB Hook] Something is renamed") ea, new_name, is_local_name = args if ea >= idc.MinEA() and ea <= idc.MaxEA(): if is_local_name: g_logger.warning("Local names are unimplemented") pass else: if not SkelUtils.name_blacklist(new_name): self.skel_conn.push_name(ea, new_name) else: g_logger.warning("ea outside program...") return idaapi.IDP_Hooks.renamed(self, *args)
def __start_ida__(cls): api = [ ('idp', idaapi.IDP_Hooks), ('idb', idaapi.IDB_Hooks), ('ui', idaapi.UI_Hooks), ] priorityhook = internal.interface.priorityhook for attr, hookcls in api: if not hasattr(cls, attr): setattr(cls, attr, priorityhook(hookcls)) continue return