IDAPython 9.0
Loading...
Searching...
No Matches
processor_t Class Reference
Inheritance diagram for processor_t:
IDP_Hooks

Public Member Functions

 __init__ (self)
 init(self, _flags=0, _hkcb_flags=0x0001) -> IDP_Hooks
 
 get_idpdesc (self)
 This function must be present and should return the list of short processor names similar to the one in ph.psnames.
 
 get_auxpref (self, insn)
 This function returns insn.auxpref value.
 
 ev_newprc (self, *args)
 ev_newprc(self, pnum, keep_cfg) -> int Before changing processor type.
 
 ev_newfile (self, *args)
 ev_newfile(self, fname) -> int A new file has been loaded.
 
 ev_oldfile (self, *args)
 ev_oldfile(self, fname) -> int An old file has been loaded.
 
 ev_newbinary (self, *args)
 ev_newbinary(self, filename, fileoff, basepara, binoff, nbytes) -> int IDA is about to load a binary file.
 
 ev_endbinary (self, *args)
 ev_endbinary(self, ok) -> int IDA has loaded a binary file.
 
 ev_set_idp_options (self, keyword, value_type, value, idb_loaded)
 ev_set_idp_options(self, keyword, value_type, value, idb_loaded) -> int Set IDP-specific configuration option Also see set_options_t in config.hpp
 
 ev_set_proc_options (self, *args)
 ev_set_proc_options(self, options, confidence) -> int Called if the user specified an option string in the command line: -p<processor name>:<options>.
 
 ev_ana_insn (self, *args)
 ev_ana_insn(self, out) -> bool Analyze one instruction and fill 'out' structure.
 
 ev_emu_insn (self, *args)
 ev_emu_insn(self, insn) -> bool Emulate instruction, create cross-references, plan to analyze subsequent instructions, modify flags etc.
 
 ev_out_header (self, *args)
 ev_out_header(self, outctx) -> int Function to produce start of disassembled text
 
 ev_out_footer (self, *args)
 ev_out_footer(self, outctx) -> int Function to produce end of disassembled text
 
 ev_out_segstart (self, ctx, s)
 ev_out_segstart(self, outctx, seg) -> int Function to produce start of segment
 
 ev_out_segend (self, ctx, s)
 ev_out_segend(self, outctx, seg) -> int Function to produce end of segment
 
 ev_out_assumes (self, *args)
 ev_out_assumes(self, outctx) -> int Function to produce assume directives when segment register value changes.
 
 ev_out_insn (self, *args)
 ev_out_insn(self, outctx) -> bool Generate text representation of an instruction in 'ctx.insn' outctx_t provides functions to output the generated text.
 
 ev_out_mnem (self, *args)
 ev_out_mnem(self, outctx) -> int Generate instruction mnemonics.
 
 ev_out_operand (self, *args)
 ev_out_operand(self, outctx, op) -> bool Generate text representation of an instruction operand outctx_t provides functions to output the generated text.
 
 ev_out_data (self, *args)
 ev_out_data(self, outctx, analyze_only) -> int Generate text representation of data items This function may change the database and create cross-references if analyze_only is set
 
 ev_out_label (self, *args)
 ev_out_label(self, outctx, colored_name) -> int The kernel is going to generate an instruction label line or a function header.
 
 ev_out_special_item (self, *args)
 ev_out_special_item(self, outctx, segtype) -> int Generate text representation of an item in a special segment i.e.
 
 ev_gen_regvar_def (self, ctx, v)
 ev_gen_regvar_def(self, outctx, v) -> int Generate register variable definition line.
 
 ev_gen_src_file_lnnum (self, *args)
 ev_gen_src_file_lnnum(self, outctx, file, lnnum) -> int
 
 ev_creating_segm (self, s)
 ev_creating_segm(self, seg) -> int A new segment is about to be created.
 
 ev_moving_segm (self, s, to_ea, flags)
 ev_moving_segm(self, seg, to, flags) -> int May the kernel move the segment?
 
 ev_coagulate (self, *args)
 ev_coagulate(self, start_ea) -> int Try to define some unexplored bytes.
 
 ev_undefine (self, *args)
 ev_undefine(self, ea) -> int An item in the database (insn or data) is being deleted.
 
 ev_treat_hindering_item (self, *args)
 ev_treat_hindering_item(self, hindering_item_ea, new_item_flags, new_item_ea, new_item_length) -> int An item hinders creation of another item.
 
 ev_rename (self, *args)
 ev_rename(self, ea, new_name) -> int The kernel is going to rename a byte.
 
 ev_is_far_jump (self, *args)
 ev_is_far_jump(self, icode) -> int is indirect far jump or call instruction? meaningful only if the processor has 'near' and 'far' reference types
 
 ev_is_sane_insn (self, *args)
 ev_is_sane_insn(self, insn, no_crefs) -> int Is the instruction sane for the current file type?.
 
 ev_is_call_insn (self, *args)
 ev_is_call_insn(self, insn) -> int Is the instruction a "call"?
 
 ev_is_ret_insn (self, *args)
 ev_is_ret_insn(self, insn, flags) -> int Is the instruction a "return"?
 
 ev_may_be_func (self, *args)
 ev_may_be_func(self, insn, state) -> int Can a function start here?
 
 ev_is_basic_block_end (self, *args)
 ev_is_basic_block_end(self, insn, call_insn_stops_block) -> int Is the current instruction end of a basic block?.
 
 ev_is_indirect_jump (self, *args)
 ev_is_indirect_jump(self, insn) -> int Determine if instruction is an indirect jump.
 
 ev_is_insn_table_jump (self, *args)
 ev_is_insn_table_jump(self) -> int Reserved.
 
 ev_is_switch (self, *args)
 ev_is_switch(self, si, insn) -> int Find 'switch' idiom or override processor module's decision.
 
 ev_create_switch_xrefs (self, *args)
 ev_create_switch_xrefs(self, jumpea, si) -> int Create xrefs for a custom jump table.
 
 ev_is_align_insn (self, *args)
 ev_is_align_insn(self, ea) -> int Is the instruction created only for alignment purposes?.
 
 ev_is_alloca_probe (self, *args)
 ev_is_alloca_probe(self, ea) -> int Does the function at 'ea' behave as __alloca_probe?
 
 ev_is_sp_based (self, mode, insn, op)
 ev_is_sp_based(self, mode, insn, op) -> int Check whether the operand is relative to stack pointer or frame pointer This event is used to determine how to output a stack variable If not implemented, then all operands are sp based by default.
 
 ev_can_have_type (self, *args)
 ev_can_have_type(self, op) -> int Can the operand have a type as offset, segment, decimal, etc? (for example, a register AX can't have a type, meaning that the user can't change its representation.
 
 ev_cmp_operands (self, *args)
 ev_cmp_operands(self, op1, op2) -> int Compare instruction operands
 
 ev_get_operand_string (self, buf, insn, opnum)
 ev_get_operand_string(self, insn, opnum) -> PyObject * Request text string for operand (cli, java, ...).
 
 ev_str2reg (self, *args)
 ev_str2reg(self, regname) -> int Convert a register name to a register number.
 
 ev_get_autocmt (self, *args)
 ev_get_autocmt(self, insn) -> PyObject *
 
 ev_func_bounds (self, _possible_return_code, pfn, max_func_end_ea)
 ev_func_bounds(self, possible_return_code, pfn, max_func_end_ea) -> int find_func_bounds() finished its work.
 
 ev_verify_sp (self, pfn)
 ev_verify_sp(self, pfn) -> int All function instructions have been analyzed.
 
 ev_verify_noreturn (self, pfn)
 ev_verify_noreturn(self, pfn) -> int The kernel wants to set 'noreturn' flags for a function.
 
 ev_create_func_frame (self, pfn)
 ev_create_func_frame(self, pfn) -> int Create a function frame for a newly created function Set up frame size, its attributes etc
 
 ev_get_frame_retsize (self, frsize, pfn)
 ev_get_frame_retsize(self, frsize, pfn) -> int Get size of function return address in bytes If this event is not implemented, the kernel will assume
 
 ev_coagulate_dref (self, from_ea, to_ea, may_define, _code_ea)
 ev_coagulate_dref(self, _from, to, may_define, code_ea) -> int Data reference is being analyzed.
 
 ev_may_show_sreg (self, *args)
 ev_may_show_sreg(self, current_ea) -> int The kernel wants to display the segment registers in the messages window.
 
 ev_auto_queue_empty (self, *args)
 ev_auto_queue_empty(self, type) -> int One analysis queue is empty.
 
 ev_validate_flirt_func (self, *args)
 ev_validate_flirt_func(self, start_ea, funcname) -> int Flirt has recognized a library function.
 
 ev_assemble (self, *args)
 ev_assemble(self, ea, cs, ip, use32, line) -> PyObject * Assemble an instruction.
 
 ev_gen_map_file (self, nlines, fp)
 ev_gen_map_file(self, nlines, fp) -> int Generate map file.
 
 ev_calc_step_over (self, target, ip)
 ev_calc_step_over(self, target, ip) -> int Calculate the address of the instruction which will be executed after "step over".
 
 closebase (self, *args)
 
 savebase (self, *args)
 
 auto_empty (self, *args)
 
 auto_empty_finally (self, *args)
 
 determined_main (self, *args)
 
 idasgn_loaded (self, *args)
 
 kernel_config_loaded (self, *args)
 
 compiler_changed (self, *args)
 
 segm_moved (self, from_ea, to_ea, size, changed_netmap)
 
 func_added (self, pfn)
 
 set_func_start (self, *args)
 
 set_func_end (self, *args)
 
 deleting_func (self, pfn)
 
 sgr_changed (self, *args)
 
 make_code (self, *args)
 
 make_data (self, *args)
 
 renamed (self, *args)
 
- Public Member Functions inherited from IDP_Hooks
"bool" hook (self)
 hook(self) -> bool
 
"bool" unhook (self)
 unhook(self) -> bool
 
"int" ev_init (self, "char const *" idp_modname)
 ev_init(self, idp_modname) -> int The IDP module is just loaded.
 
"int" ev_term (self)
 ev_term(self) -> int The IDP module is being unloaded.
 
"int" ev_newasm (self, "int" asmnum)
 ev_newasm(self, asmnum) -> int Before setting a new assembler.
 
"int" ev_is_cond_insn (self, "insn_t const *" insn)
 ev_is_cond_insn(self, insn) -> int Is conditional instruction?
 
"int" ev_calc_switch_cases (self, "casevec_t *" casevec, "eavec_t *" targets, "ea_t" insn_ea, "switch_info_t" si)
 ev_calc_switch_cases(self, casevec, targets, insn_ea, si) -> int Calculate case values and targets for a custom jump table.
 
"PyObject *" ev_delay_slot_insn (self, "ea_t" ea, "bool" bexec, "bool" fexec)
 ev_delay_slot_insn(self, ea, bexec, fexec) -> PyObject * Get delay slot instruction
 
"int" ev_adjust_refinfo (self, "refinfo_t" ri, "ea_t" ea, "int" n, "fixup_data_t const *" fd)
 ev_adjust_refinfo(self, ri, ea, n, fd) -> int Called from apply_fixup before converting operand to reference.
 
"PyObject *" ev_get_reg_name (self, "int" reg, "size_t" width, "int" reghi)
 ev_get_reg_name(self, reg, width, reghi) -> PyObject * Generate text representation of a register.
 
"int" ev_get_bg_color (self, "bgcolor_t *" color, "ea_t" ea)
 ev_get_bg_color(self, color, ea) -> int Get item background color.
 
"int" ev_is_jump_func (self, "func_t *" pfn, "ea_t *" jump_target, "ea_t *" func_pointer)
 ev_is_jump_func(self, pfn, jump_target, func_pointer) -> int Is the function a trivial "jump" function?.
 
"int" ev_get_stkvar_scale_factor (self)
 ev_get_stkvar_scale_factor(self) -> int Should stack variable references be multiplied by a coefficient before being used in the stack frame?.
 
"PyObject *" ev_demangle_name (self, "char const *" name, "uint32" disable_mask, "int" demreq)
 ev_demangle_name(self, name, disable_mask, demreq) -> PyObject * Demangle a C++ (or another language) name into a user-readable string.
 
"int" ev_add_cref (self, "ea_t" _from, "ea_t" to, "cref_t" type)
 ev_add_cref(self, _from, to, type) -> int A code reference is being created.
 
"int" ev_add_dref (self, "ea_t" _from, "ea_t" to, "dref_t" type)
 ev_add_dref(self, _from, to, type) -> int A data reference is being created.
 
"int" ev_del_cref (self, "ea_t" _from, "ea_t" to, "bool" expand)
 ev_del_cref(self, _from, to, expand) -> int A code reference is being deleted.
 
"int" ev_del_dref (self, "ea_t" _from, "ea_t" to)
 ev_del_dref(self, _from, to) -> int A data reference is being deleted.
 
"int" ev_adjust_libfunc_ea (self, "idasgn_t const *" sig, "libfunc_t const *" libfun, "ea_t *" ea)
 ev_adjust_libfunc_ea(self, sig, libfun, ea) -> int Called when a signature module has been matched against bytes in the database.
 
"int" ev_extract_address (self, "ea_t *" out_ea, "ea_t" screen_ea, "char const *" string, "size_t" position)
 ev_extract_address(self, out_ea, screen_ea, string, position) -> int Extract address from a string.
 
"int" ev_realcvt (self, "void *" m, "fpvalue_t *" e, "uint16" swt)
 ev_realcvt(self, m, e, swt) -> int Floating point -> IEEE conversion
 
"int" ev_gen_asm_or_lst (self, "bool" starting, "FILE *" fp, "bool" is_asm, "int" flags, "html_line_cb_t **" outline)
 ev_gen_asm_or_lst(self, starting, fp, is_asm, flags, outline) -> int
 
"int" ev_create_flat_group (self, "ea_t" image_base, "int" bitness, "sel_t" dataseg_sel)
 ev_create_flat_group(self, image_base, bitness, dataseg_sel) -> int Create special segment representing the flat group.
 
"int" ev_getreg (self, "uval_t *" regval, "int" regnum)
 ev_getreg(self, regval, regnum) -> int IBM PC only internal request, should never be used for other purpose Get register value by internal index
 
"int" ev_analyze_prolog (self, "ea_t" ea)
 ev_analyze_prolog(self, ea) -> int Analyzes function prolog, epilog, and updates purge, and function attributes
 
"int" ev_calc_spdelta (self, "sval_t *" spdelta, "insn_t const *" insn)
 ev_calc_spdelta(self, spdelta, insn) -> int Calculate amount of change to sp for the given insn.
 
"int" ev_calcrel (self)
 ev_calcrel(self) -> int Reserved.
 
"PyObject *" ev_find_reg_value (self, "insn_t const *" pinsn, "int" reg)
 ev_find_reg_value(self, pinsn, reg) -> PyObject * Find register value via a register tracker.
 
"PyObject *" ev_find_op_value (self, "insn_t const *" pinsn, "int" opn)
 ev_find_op_value(self, pinsn, opn) -> PyObject * Find operand value via a register tracker.
 
"int" ev_replaying_undo (self, "char const *" action_name, "undo_records_t const *" vec, "bool" is_undo)
 ev_replaying_undo(self, action_name, vec, is_undo) -> int Replaying an undo/redo buffer
 
"int" ev_ending_undo (self, "char const *" action_name, "bool" is_undo)
 ev_ending_undo(self, action_name, is_undo) -> int Ended undoing/redoing an action
 
"int" ev_set_code16_mode (self, "ea_t" ea, "bool" code16)
 ev_set_code16_mode(self, ea, code16) -> int Some processors have ISA 16-bit mode e.g.
 
"int" ev_get_code16_mode (self, "ea_t" ea)
 ev_get_code16_mode(self, ea) -> int Get ISA 16-bit mode
 
"int" ev_get_procmod (self)
 ev_get_procmod(self) -> int Get pointer to the processor module object.
 
"int" ev_asm_installed (self, "int" asmnum)
 ev_asm_installed(self, asmnum) -> int After setting a new assembler
 
"int" ev_get_reg_accesses (self, "reg_accesses_t" accvec, "insn_t const *" insn, "int" flags)
 ev_get_reg_accesses(self, accvec, insn, flags) -> int Get info about the registers that are used/changed by an instruction.
 
"int" ev_is_control_flow_guard (self, "int *" p_reg, "insn_t const *" insn)
 ev_is_control_flow_guard(self, p_reg, insn) -> int Detect if an instruction is a "thunk call" to a flow guard function (equivalent to call reg/return/nop)
 
"int" ev_create_merge_handlers (self, "merge_data_t *" md)
 ev_create_merge_handlers(self, md) -> int Create merge handlers, if needed
 
"int" ev_privrange_changed (self, "range_t" old_privrange, "adiff_t" delta)
 ev_privrange_changed(self, old_privrange, delta) -> int Privrange interval has been moved to a new location.
 
"int" ev_cvt64_supval (self, "nodeidx_t" node, "uchar" tag, "nodeidx_t" idx, "uchar const *" data)
 ev_cvt64_supval(self, node, tag, idx, data) -> int perform 32-64 conversion for a netnode array element
 
"int" ev_cvt64_hashval (self, "nodeidx_t" node, "uchar" tag, "char const *" name, "uchar const *" data)
 ev_cvt64_hashval(self, node, tag, name, data) -> int perform 32-64 conversion for a hash value
 
"int" ev_gen_stkvar_def (self, "outctx_t *" outctx, "udm_t" stkvar, "sval_t" v, "tid_t" tid)
 ev_gen_stkvar_def(self, outctx, stkvar, v, tid) -> int Generate stack variable definition line Default line is varname = type ptr value, where 'type' is one of byte,word,dword,qword,tbyte
 
"int" ev_next_exec_insn (self, "ea_t *" target, "ea_t" ea, "int" tid, "processor_t::regval_getter_t *" getreg, "regval_t" regvalues)
 ev_next_exec_insn(self, target, ea, tid, getreg, regvalues) -> int Get next address to be executed This function must return the next address to be executed.
 
"int" ev_calc_next_eas (self, "eavec_t *" res, "insn_t const *" insn, "bool" over)
 ev_calc_next_eas(self, res, insn, over) -> int Calculate list of addresses the instruction in 'insn' may pass control to.
 
"int" ev_get_macro_insn_head (self, "ea_t *" head, "ea_t" ip)
 ev_get_macro_insn_head(self, head, ip) -> int Calculate the start of a macro instruction.
 
"int" ev_get_dbr_opnum (self, "int *" opnum, "insn_t const *" insn)
 ev_get_dbr_opnum(self, opnum, insn) -> int Get the number of the operand to be displayed in the debugger reference view (text mode).
 
"int" ev_insn_reads_tbit (self, "insn_t const *" insn, "processor_t::regval_getter_t *" getreg, "regval_t" regvalues)
 ev_insn_reads_tbit(self, insn, getreg, regvalues) -> int Check if insn will read the TF bit.
 
"int" ev_clean_tbit (self, "ea_t" ea, "processor_t::regval_getter_t *" getreg, "regval_t" regvalues)
 ev_clean_tbit(self, ea, getreg, regvalues) -> int Clear the TF bit after an insn like pushf stored it in memory.
 
"int" ev_get_reg_info (self, "char const **" main_regname, "bitrange_t" bitrange, "char const *" regname)
 ev_get_reg_info(self, main_regname, bitrange, regname) -> int Get register information by its name.
 
"int" ev_update_call_stack (self, "call_stack_t" stack, "int" tid, "processor_t::regval_getter_t *" getreg, "regval_t" regvalues)
 ev_update_call_stack(self, stack, tid, getreg, regvalues) -> int Calculate the call stack trace for the given thread.
 
"int" ev_setup_til (self)
 ev_setup_til(self) -> int Setup default type libraries.
 
"int" ev_get_abi_info (self, "comp_t" comp)
 ev_get_abi_info(self, comp) -> int Get all possible ABI names and optional extensions for given compiler abiname/option is a string entirely consisting of letters, digits and underscore
 
"int" ev_max_ptr_size (self)
 ev_max_ptr_size(self) -> int Get maximal size of a pointer in bytes.
 
"int" ev_get_default_enum_size (self)
 ev_get_default_enum_size(self) -> int Get default enum size.
 
"int" ev_get_cc_regs (self, "callregs_t" regs, "cm_t" cc)
 ev_get_cc_regs(self, regs, cc) -> int Get register allocation convention for given calling convention
 
"int" ev_get_simd_types (self, "simd_info_vec_t *" out, "simd_info_t" simd_attrs, "argloc_t" argloc, "bool" create_tifs)
 ev_get_simd_types(self, out, simd_attrs, argloc, create_tifs) -> int Get SIMD-related types according to given attributes ant/or argument location
 
"int" ev_calc_cdecl_purged_bytes (self, "ea_t" ea)
 ev_calc_cdecl_purged_bytes(self, ea) -> int Calculate number of purged bytes after call.
 
"int" ev_calc_purged_bytes (self, "int *" p_purged_bytes, "func_type_data_t" fti)
 ev_calc_purged_bytes(self, p_purged_bytes, fti) -> int Calculate number of purged bytes by the given function type.
 
"int" ev_calc_retloc (self, "argloc_t" retloc, "tinfo_t" rettype, "cm_t" cc)
 ev_calc_retloc(self, retloc, rettype, cc) -> int Calculate return value location.
 
"int" ev_calc_arglocs (self, "func_type_data_t" fti)
 ev_calc_arglocs(self, fti) -> int Calculate function argument locations.
 
"int" ev_calc_varglocs (self, "func_type_data_t" ftd, "regobjs_t" aux_regs, "relobj_t" aux_stkargs, "int" nfixed)
 ev_calc_varglocs(self, ftd, aux_regs, aux_stkargs, nfixed) -> int Calculate locations of the arguments that correspond to '...'.
 
"int" ev_adjust_argloc (self, "argloc_t" argloc, "tinfo_t" optional_type, "int" size)
 ev_adjust_argloc(self, argloc, optional_type, size) -> int Adjust argloc according to its type/size and platform endianess
 
"int" ev_lower_func_type (self, "intvec_t *" argnums, "func_type_data_t" fti)
 ev_lower_func_type(self, argnums, fti) -> int Get function arguments which should be converted to pointers when lowering function prototype.
 
"int" ev_equal_reglocs (self, "argloc_t" a1, "argloc_t" a2)
 ev_equal_reglocs(self, a1, a2) -> int Are 2 register arglocs the same?.
 
"int" ev_use_stkarg_type (self, "ea_t" ea, "funcarg_t" arg)
 ev_use_stkarg_type(self, ea, arg) -> int Use information about a stack argument.
 
"PyObject *" ev_use_regarg_type (self, "ea_t" ea, "funcargvec_t const *" rargs)
 ev_use_regarg_type(self, ea, rargs) -> PyObject * Use information about register argument.
 
"int" ev_use_arg_types (self, "ea_t" ea, "func_type_data_t" fti, "funcargvec_t *" rargs)
 ev_use_arg_types(self, ea, fti, rargs) -> int Use information about callee arguments.
 
"int" ev_arg_addrs_ready (self, "ea_t" caller, "int" n, "tinfo_t" tif, "ea_t *" addrs)
 ev_arg_addrs_ready(self, caller, n, tif, addrs) -> int Argument address info is ready.
 
"PyObject *" ev_decorate_name (self, "char const *" name, "bool" mangle, "int" cc, "tinfo_t" optional_type)
 ev_decorate_name(self, name, mangle, cc, optional_type) -> PyObject * Decorate/undecorate a C symbol name.
 
"int" ev_arch_changed (self)
 ev_arch_changed(self) -> int The loader is done parsing arch-related information, which the processor module might want to use to finish its initialization.
 
"int" ev_get_stkarg_area_info (self, "stkarg_area_info_t" out, "cm_t" cc)
 ev_get_stkarg_area_info(self, out, cc) -> int Get some metrics of the stack argument area.
 
"int" ev_last_cb_before_loader (self)
 ev_last_cb_before_loader(self) -> int
 
"int" ev_loader (self)
 ev_loader(self) -> int This code and higher ones are reserved for the loaders.
 
 __disown__ (self)
 

Public Attributes

 idb_hooks = _processor_t_Trampoline_IDB_Hooks(self)
 
 plnames
 
 psnames
 

Protected Member Functions

 _get_idp_notifier_addr (self)
 
 _get_idp_notifier_ud_addr (self)
 
 _get_idb_notifier_addr (self)
 
 _get_idb_notifier_ud_addr (self)
 
 _make_forced_value_wrapper (self, val, meth=None)
 
 _make_int_returning_wrapper (self, meth, intval=0)
 
 _get_notify (self, what, unimp_val=0, imp_forced_val=None, add_prefix=True, mandatory_impl=None)
 

Additional Inherited Members

- Properties inherited from IDP_Hooks
 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
 

Constructor & Destructor Documentation

◆ __init__()

__init__ ( self)
Parameters
_flagsuint32
_hkcb_flagsuint32

Reimplemented from IDP_Hooks.

Member Function Documentation

◆ _get_idb_notifier_addr()

_get_idb_notifier_addr ( self)
protected

◆ _get_idb_notifier_ud_addr()

_get_idb_notifier_ud_addr ( self)
protected

◆ _get_idp_notifier_addr()

_get_idp_notifier_addr ( self)
protected

◆ _get_idp_notifier_ud_addr()

_get_idp_notifier_ud_addr ( self)
protected

◆ _get_notify()

_get_notify ( self,
what,
unimp_val = 0,
imp_forced_val = None,
add_prefix = True,
mandatory_impl = None )
protected
This helper is used to implement backward-compatibility
of pre IDA 7.3 processor_t interfaces.

◆ _make_forced_value_wrapper()

_make_forced_value_wrapper ( self,
val,
meth = None )
protected

◆ _make_int_returning_wrapper()

_make_int_returning_wrapper ( self,
meth,
intval = 0 )
protected

◆ auto_empty()

auto_empty ( self,
* args )

◆ auto_empty_finally()

auto_empty_finally ( self,
* args )

◆ closebase()

closebase ( self,
* args )

◆ compiler_changed()

compiler_changed ( self,
* args )

◆ deleting_func()

deleting_func ( self,
pfn )

◆ determined_main()

determined_main ( self,
* args )

◆ ev_ana_insn()

ev_ana_insn ( self,
* out )

This function shouldn't change the database, flags or anything else. All these actions should be performed only by emu_insn() function. insn_t::ea contains address of instruction to analyze.

Parameters
out(insn_t *)
Returns
: length of the instruction in bytes, 0 if instruction can't be decoded.
Return values
0if instruction can't be decoded.

Reimplemented from IDP_Hooks.

◆ ev_assemble()

ev_assemble ( self,
* ea )

(display a warning if an error is found).

Parameters
ea(::ea_t) linear address of instruction
cs(::ea_t) cs of instruction
ip(::ea_t) ip of instruction
use32(bool) is 32bit segment?
line(const char *) line to assemble
Returns
: size of the instruction in bytes

Reimplemented from IDP_Hooks.

◆ ev_auto_queue_empty()

ev_auto_queue_empty ( self,
* type )
Parameters
type(atype_t)
Return values
voidsee also idb_event::auto_empty_finally

Reimplemented from IDP_Hooks.

◆ ev_calc_step_over()

ev_calc_step_over ( self,
target,
ip )

The kernel will put a breakpoint there. If the step over is equal to step into or we cannot calculate the address, return BADADDR.

Parameters
target(::ea_t *) pointer to the answer
ip(::ea_t) instruction address
Return values
0unimplemented
1implemented

Reimplemented from IDP_Hooks.

◆ ev_can_have_type()

ev_can_have_type ( self,
* op )

see bytes.hpp for information about types and flags)

Parameters
op(const op_t *)
Return values
0unknown
<0no
1yes

Reimplemented from IDP_Hooks.

◆ ev_cmp_operands()

ev_cmp_operands ( self,
* op1 )
Parameters
op1(const op_t*)
op2(const op_t*)
Return values
1equal
-1not equal
0not implemented

Reimplemented from IDP_Hooks.

◆ ev_coagulate()

ev_coagulate ( self,
* start_ea )

This notification will be called if the kernel tried all possibilities and could not find anything more useful than to convert to array of bytes. The module can help the kernel and convert the bytes into something more useful.

Parameters
start_ea(::ea_t)
Returns
: number of converted bytes

Reimplemented from IDP_Hooks.

◆ ev_coagulate_dref()

ev_coagulate_dref ( self,
_from,
to,
may_define,
code_ea )

plugin may correct 'code_ea' (e.g. for thumb mode refs, we clear the last bit)

Parameters
from(::ea_t)
to(::ea_t)
may_define(bool)
code_ea(::ea_t *)
Return values
<0failed dref analysis, >0 done dref analysis
0not implemented or continue

Reimplemented from IDP_Hooks.

◆ ev_create_func_frame()

ev_create_func_frame ( self,
pfn )
Parameters
pfn(func_t *)
Return values
1ok
0not implemented

Reimplemented from IDP_Hooks.

◆ ev_create_switch_xrefs()

ev_create_switch_xrefs ( self,
* jumpea )
Parameters
jumpea(::ea_t) address of the jump insn
si(const switch_info_t *) switch information
Returns
: must return 1 Must be implemented if module uses custom jump tables, SWI_CUSTOM

Reimplemented from IDP_Hooks.

◆ ev_creating_segm()

ev_creating_segm ( self,
seg )
Parameters
seg(segment_t *)
Return values
1ok
<0segment should not be created

Reimplemented from IDP_Hooks.

◆ ev_emu_insn()

ev_emu_insn ( self,
* insn )

Upon entrance to this function, all information about the instruction is in 'insn' structure.

Parameters
insn(const insn_t *)
Return values
1ok
-1the kernel will delete the instruction

Reimplemented from IDP_Hooks.

◆ ev_endbinary()

ev_endbinary ( self,
* ok )
Parameters
ok(bool) file loaded successfully?

Reimplemented from IDP_Hooks.

◆ ev_func_bounds()

ev_func_bounds ( self,
possible_return_code,
pfn,
max_func_end_ea )

The module may fine tune the function bounds

Parameters
possible_return_code(int *), in/out
pfn(func_t *)
max_func_end_ea(::ea_t) (from the kernel's point of view)
Return values
void

Reimplemented from IDP_Hooks.

◆ ev_gen_map_file()

ev_gen_map_file ( self,
nlines,
fp )

If not implemented the kernel itself will create the map file.

Parameters
nlines(int *) number of lines in map file (-1 means write error)
fp(FILE *) output file
Return values
0not implemented
1ok
-1write error

Reimplemented from IDP_Hooks.

◆ ev_gen_regvar_def()

ev_gen_regvar_def ( self,
outctx,
v )
Parameters
outctx(outctx_t *)
v(regvar_t *)
Return values
>0ok, generated the definition text
0not implemented

Reimplemented from IDP_Hooks.

◆ ev_gen_src_file_lnnum()

ev_gen_src_file_lnnum ( self,
* outctx )
Parameters
outctx(outctx_t *) output context
file(const char *) source file (may be nullptr)
lnnum(size_t) line number
Return values
1directive has been generated
0not implemented

Reimplemented from IDP_Hooks.

◆ ev_get_autocmt()

ev_get_autocmt ( self,
* insn )
Parameters
insn(const insn_t*) the instruction
Return values
1new comment has been generated
0callback has not been handled. the buffer must not be changed in this case

Reimplemented from IDP_Hooks.

◆ ev_get_frame_retsize()

ev_get_frame_retsize ( self,
frsize,
pfn )
  • 8 bytes for 64-bit function
  • 4 bytes for 32-bit function
  • 2 bytes otherwise
Parameters
frsize(int *) frame size (out)
pfn(const func_t *), can't be nullptr
Return values
1ok
0not implemented

Reimplemented from IDP_Hooks.

◆ ev_get_operand_string()

ev_get_operand_string ( self,
insn,
opnum,
opnum )
Parameters
insn(const insn_t*) the instruction
opnum(int) operand number, -1 means any string operand
Return values
0no string (or empty string)
>0original string length without terminating zero

Reimplemented from IDP_Hooks.

◆ ev_is_align_insn()

ev_is_align_insn ( self,
* ea )

Do not directly call this function, use is_align_insn()

Parameters
ea(ea_t) - instruction address
Return values
numberof bytes in the instruction

Reimplemented from IDP_Hooks.

◆ ev_is_alloca_probe()

ev_is_alloca_probe ( self,
* ea )
Parameters
ea(::ea_t)
Return values
1yes
0no

Reimplemented from IDP_Hooks.

◆ ev_is_basic_block_end()

ev_is_basic_block_end ( self,
* insn )

This function should be defined for processors with delayed jump slots.

Parameters
insn(const insn_t*) the instruction
call_insn_stops_block(bool)
Return values
0unknown
<0no
1yes

Reimplemented from IDP_Hooks.

◆ ev_is_call_insn()

ev_is_call_insn ( self,
* insn )
Parameters
insn(const insn_t *) instruction
Return values
0unknown
<0no
1yes

Reimplemented from IDP_Hooks.

◆ ev_is_far_jump()

ev_is_far_jump ( self,
* icode )
Parameters
icode(int)
Return values
0not implemented
1yes
-1no

Reimplemented from IDP_Hooks.

◆ ev_is_indirect_jump()

ev_is_indirect_jump ( self,
* insn )

If CF_JUMP bit cannot describe all jump types jumps, please define this callback.

Parameters
insn(const insn_t*) the instruction
Return values
0use CF_JUMP
1no
2yes

Reimplemented from IDP_Hooks.

◆ ev_is_insn_table_jump()

ev_is_insn_table_jump ( self,
* args )

Reimplemented from IDP_Hooks.

◆ ev_is_ret_insn()

ev_is_ret_insn ( self,
* insn )
Parameters
insn(const insn_t *) instruction
flags(uchar), combination of IRI_... flags (see above)
Return values
0unknown
<0no
1yes

Reimplemented from IDP_Hooks.

◆ ev_is_sane_insn()

ev_is_sane_insn ( self,
* insn )
Parameters
insn(const insn_t*) the instruction
no_crefs(int) 1: the instruction has no code refs to it. ida just tries to convert unexplored bytes to an instruction (but there is no other reason to convert them into an instruction) 0: the instruction is created because of some coderef, user request or another weighty reason.
Return values
>=0ok
<0no, the instruction isn't likely to appear in the program

Reimplemented from IDP_Hooks.

◆ ev_is_sp_based()

ev_is_sp_based ( self,
mode,
insn,
op )

Implement this event only if some stack references use frame pointer instead of stack pointer.

Parameters
mode(int *) out, combination of SP/FP operand flags
insn(const insn_t *)
op(const op_t *)
Return values
0not implemented
1ok

Reimplemented from IDP_Hooks.

◆ ev_is_switch()

ev_is_switch ( self,
* si )

It will be called for instructions marked with CF_JUMP.

Parameters
si(switch_info_t *), out
insn(const insn_t *) instruction possibly belonging to a switch
Return values
1switch is found, 'si' is filled. IDA will create the switch using the filled 'si'
-1no switch found. This value forbids switch creation by the processor module
0not implemented

Reimplemented from IDP_Hooks.

◆ ev_may_be_func()

ev_may_be_func ( self,
* insn )
Parameters
insn(const insn_t*) the instruction
state(int) autoanalysis phase 0: creating functions 1: creating chunks
Returns
: probability 1..100
Note
: Actually IDA uses 3 intervals of a probability: 0..50 not a function, 51..99 a function (IDA needs another proof), 100 a function (no other proofs needed)

Reimplemented from IDP_Hooks.

◆ ev_may_show_sreg()

ev_may_show_sreg ( self,
* current_ea )
Parameters
current_ea(::ea_t)
Return values
<0if the kernel should not show the segment registers. (assuming that the module has done it)
0not implemented

Reimplemented from IDP_Hooks.

◆ ev_moving_segm()

ev_moving_segm ( self,
seg,
to,
flags )
Parameters
seg(segment_t *) segment to move
to(::ea_t) new segment start address
flags(int) combination of Move segment flags
Return values
0yes
<0the kernel should stop

Reimplemented from IDP_Hooks.

◆ ev_newbinary()

ev_newbinary ( self,
* filename )
Parameters
filename(char *) binary file name
fileoff(qoff64_t) offset in the file
basepara(::ea_t) base loading paragraph
binoff(::ea_t) loader offset
nbytes(::uint64) number of bytes to load

Reimplemented from IDP_Hooks.

◆ ev_newfile()

ev_newfile ( self,
* fname )
Parameters
fname(char *) input file name

Reimplemented from IDP_Hooks.

◆ ev_newprc()

ev_newprc ( self,
* pnum )
Parameters
pnum(int) processor number in the array of processor names
keep_cfg(bool) true: do not modify kernel configuration
Return values
1ok
<0prohibit

Reimplemented from IDP_Hooks.

◆ ev_oldfile()

ev_oldfile ( self,
* fname )
Parameters
fname(char *) input file name

Reimplemented from IDP_Hooks.

◆ ev_out_assumes()

ev_out_assumes ( self,
* outctx )
Parameters
outctx(outctx_t *)
Return values
1ok
0not implemented

Reimplemented from IDP_Hooks.

◆ ev_out_data()

ev_out_data ( self,
* outctx )
Parameters
outctx(outctx_t *)
analyze_only(bool)
Return values
1ok
0not implemented

Reimplemented from IDP_Hooks.

◆ ev_out_footer()

ev_out_footer ( self,
* outctx )
Parameters
outctx(outctx_t *)
Return values
void

Reimplemented from IDP_Hooks.

◆ ev_out_header()

ev_out_header ( self,
* outctx )
Parameters
outctx(outctx_t *)
Return values
void

Reimplemented from IDP_Hooks.

◆ ev_out_insn()

ev_out_insn ( self,
* outctx )

This function shouldn't change the database, flags or anything else. All these actions should be performed only by emu_insn() function.

Parameters
outctx(outctx_t *)
Return values
void

Reimplemented from IDP_Hooks.

◆ ev_out_label()

ev_out_label ( self,
* outctx )
Parameters
outctx(outctx_t *)
colored_name(const char *)
Return values
<0if the kernel should not generate the label
0not implemented or continue

Reimplemented from IDP_Hooks.

◆ ev_out_mnem()

ev_out_mnem ( self,
* outctx )

This callback should append the colored mnemonics to ctx.outbuf Optional notification, if absent, out_mnem will be called.

Parameters
outctx(outctx_t *)
Return values
1if appended the mnemonics
0not implemented

Reimplemented from IDP_Hooks.

◆ ev_out_operand()

ev_out_operand ( self,
* outctx )

All these actions should be performed only by emu_insn() function.

Parameters
outctx(outctx_t *)
op(const op_t *)
Return values
1ok
-1operand is hidden

Reimplemented from IDP_Hooks.

◆ ev_out_segend()

ev_out_segend ( self,
outctx,
seg )
Parameters
outctx(outctx_t *)
seg(segment_t *)
Return values
1ok
0not implemented

Reimplemented from IDP_Hooks.

◆ ev_out_segstart()

ev_out_segstart ( self,
outctx,
seg )
Parameters
outctx(outctx_t *)
seg(segment_t *)
Return values
1ok
0not implemented

Reimplemented from IDP_Hooks.

◆ ev_out_special_item()

ev_out_special_item ( self,
* outctx )

absolute symbols, externs, communal definitions etc

Parameters
outctx(outctx_t *)
segtype(uchar)
Return values
1ok
0not implemented
-1overflow

Reimplemented from IDP_Hooks.

◆ ev_rename()

ev_rename ( self,
* ea )
Parameters
ea(::ea_t)
new_name(const char *)
Return values
<0if the kernel should not rename it.
2to inhibit the notification. I.e., the kernel should not rename, but 'set_name()' should return 'true'. also see renamed the return value is ignored when kernel is going to delete name

Reimplemented from IDP_Hooks.

◆ ev_set_idp_options()

ev_set_idp_options ( self,
keyword,
value_type,
value,
idb_loaded )
Parameters
keyword(const char *)
value_type(int)
value(const void *)
idb_loaded(bool) true if the ev_oldfile/ev_newfile events have been generated
Return values
1ok
0not implemented
-1error (and message in errbuf)

Reimplemented from IDP_Hooks.

◆ ev_set_proc_options()

ev_set_proc_options ( self,
* options )

Can be used for setting a processor subtype. Also called if option string is passed to set_processor_type() and IDC's SetProcessorType().

Parameters
options(const char *)
confidence(int) 0: loader's suggestion 1: user's decision
Return values
<0if bad option string

Reimplemented from IDP_Hooks.

◆ ev_str2reg()

ev_str2reg ( self,
* regname )

The register number is the register index in the processor_t::reg_names array Most processor modules do not need to implement this callback It is useful only if processor_t::reg_names[reg] does not provide the correct register names

Parameters
regname(const char *)
Return values
registernumber + 1
0not implemented or could not be decoded

Reimplemented from IDP_Hooks.

◆ ev_treat_hindering_item()

ev_treat_hindering_item ( self,
* hindering_item_ea )
Parameters
hindering_item_ea(::ea_t)
new_item_flags(flags64_t) (0 for code)
new_item_ea(::ea_t)
new_item_length(::asize_t)
Return values
0no reaction
!=0the kernel may delete the hindering item

Reimplemented from IDP_Hooks.

◆ ev_undefine()

ev_undefine ( self,
* ea )
Parameters
ea(ea_t)
Return values
1do not delete srranges at the item end
0srranges can be deleted

Reimplemented from IDP_Hooks.

◆ ev_validate_flirt_func()

ev_validate_flirt_func ( self,
* start_ea )

This callback can be used by a plugin or proc module to intercept it and validate such a function.

Parameters
start_ea(::ea_t)
funcname(const char *)
Return values
-1do not create a function,
0function is validated

Reimplemented from IDP_Hooks.

◆ ev_verify_noreturn()

ev_verify_noreturn ( self,
pfn )
Parameters
pfn(func_t *)
Return values
0ok. any other value: do not set 'noreturn' flag

Reimplemented from IDP_Hooks.

◆ ev_verify_sp()

ev_verify_sp ( self,
pfn )

Now the processor module can analyze the stack pointer for the whole function

Parameters
pfn(func_t *)
Return values
0ok
<0bad stack pointer

Reimplemented from IDP_Hooks.

◆ func_added()

func_added ( self,
pfn )

◆ get_auxpref()

get_auxpref ( self,
insn )

◆ get_idpdesc()

get_idpdesc ( self)

This method can be overridden to return to the kernel a different IDP description.

◆ idasgn_loaded()

idasgn_loaded ( self,
* args )

◆ kernel_config_loaded()

kernel_config_loaded ( self,
* args )

◆ make_code()

make_code ( self,
* args )

◆ make_data()

make_data ( self,
* args )

◆ renamed()

renamed ( self,
* args )

◆ savebase()

savebase ( self,
* args )

◆ segm_moved()

segm_moved ( self,
from_ea,
to_ea,
size,
changed_netmap )

◆ set_func_end()

set_func_end ( self,
* args )

◆ set_func_start()

set_func_start ( self,
* args )

◆ sgr_changed()

sgr_changed ( self,
* args )

Member Data Documentation

◆ idb_hooks

◆ plnames

plnames

◆ psnames

psnames

The documentation for this class was generated from the following file: