Python idaapi 模块,processor_t() 实例源码

我们从Python开源项目中,提取了以下2个代码示例,用于说明如何使用idaapi.processor_t()

项目:hexag00n    作者:programa-stic    | 项目源码 | 文件源码
def __init__(self):
        idaapi.processor_t.__init__(self)

        # TODO: logging not working.
        # self.work_folder = ""
        # self.log_fn = self.work_folder + 'work.log'
        # logging.basicConfig(filename=self.log_fn, level=logging.DEBUG, filemode='w')
        # self.logger = open(self.log_fn, 'w')

        self.relocatable_file = re.search(r'\.o$', GetInputFile()) != None

        self.init_instructions()
        self.prev_addr_analyzed = -1
        self.current_hex_packet = None
        self.hd = HexagonDisassembler()
        # TODO: this should be instatiated on demand, because I think the init is called every time IDA starts
        self.disasm_cache = {}
        # TODO: use orderdict to remove old entries

        self.profiler = cProfile.Profile()
        hexagondisasm.profiler = self.profiler
        # TODO: I don't know how to access this class from the IDA Python
        # console to get the profiler, I do it through the module
项目:a29k-ida    作者:arnew    | 项目源码 | 文件源码
def __init__(self):
        idaapi.processor_t.__init__(self)
        self.init_instructions(self.processor)
        self.init_registers()
        self.reorderdelayed = False
        # big endian default
        idaapi.cvar.inf.mf = 1

# ----------------------------------------------------------------------
# Every processor module script must provide this function.
# It should return a new instance of a class derived from idaapi.processor_t