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

Public Member Functions

 __init__ (self, int _flags=0, int _hkcb_flags=1)
 
bool hook (self)
 
bool unhook (self)
 
int ev_init (self, str idp_modname)
 
int ev_term (self)
 
int ev_newprc (self, int pnum, bool keep_cfg)
 
int ev_newasm (self, int asmnum)
 
int ev_newfile (self, 'char *' fname)
 
int ev_oldfile (self, 'char *' fname)
 
int ev_newbinary (self, 'char *' filename, 'qoff64_t' fileoff, ida_idaapi.ea_t basepara, ida_idaapi.ea_t binoff, 'uint64' nbytes)
 
int ev_endbinary (self, bool ok)
 
int ev_set_idp_options (self, str keyword, int value_type, 'void const *' value, bool idb_loaded)
 
int ev_set_proc_options (self, str options, int confidence)
 
bool ev_ana_insn (self, 'insn_t *' out)
 
bool ev_emu_insn (self, 'insn_t const *' insn)
 
int ev_out_header (self, 'outctx_t *' outctx)
 
int ev_out_footer (self, 'outctx_t *' outctx)
 
int ev_out_segstart (self, 'outctx_t *' outctx, 'segment_t *' seg)
 
int ev_out_segend (self, 'outctx_t *' outctx, 'segment_t *' seg)
 
int ev_out_assumes (self, 'outctx_t *' outctx)
 
bool ev_out_insn (self, 'outctx_t *' outctx)
 
int ev_out_mnem (self, 'outctx_t *' outctx)
 
bool ev_out_operand (self, 'outctx_t *' outctx, 'op_t const *' op)
 
int ev_out_data (self, 'outctx_t *' outctx, bool analyze_only)
 
int ev_out_label (self, 'outctx_t *' outctx, str colored_name)
 
int ev_out_special_item (self, 'outctx_t *' outctx, 'uchar' segtype)
 
int ev_gen_regvar_def (self, 'outctx_t *' outctx, 'regvar_t *' v)
 
int ev_gen_src_file_lnnum (self, 'outctx_t *' outctx, str file, 'size_t' lnnum)
 
int ev_creating_segm (self, 'segment_t *' seg)
 
int ev_moving_segm (self, 'segment_t *' seg, ida_idaapi.ea_t to, int flags)
 
int ev_coagulate (self, ida_idaapi.ea_t start_ea)
 
int ev_undefine (self, ida_idaapi.ea_t ea)
 
int ev_treat_hindering_item (self, ida_idaapi.ea_t hindering_item_ea, 'flags64_t' new_item_flags, ida_idaapi.ea_t new_item_ea, 'asize_t' new_item_length)
 
int ev_rename (self, ida_idaapi.ea_t ea, str new_name)
 
int ev_is_far_jump (self, int icode)
 
int ev_is_sane_insn (self, 'insn_t const *' insn, int no_crefs)
 
int ev_is_cond_insn (self, 'insn_t const *' insn)
 
int ev_is_call_insn (self, 'insn_t const *' insn)
 
int ev_is_ret_insn (self, 'insn_t const *' insn, 'uchar' flags)
 
int ev_may_be_func (self, 'insn_t const *' insn, int state)
 
int ev_is_basic_block_end (self, 'insn_t const *' insn, bool call_insn_stops_block)
 
int ev_is_indirect_jump (self, 'insn_t const *' insn)
 
int ev_is_insn_table_jump (self)
 
int ev_is_switch (self, 'switch_info_t' si, 'insn_t const *' insn)
 
int ev_calc_switch_cases (self, 'casevec_t *' casevec, 'eavec_t *' targets, ida_idaapi.ea_t insn_ea, 'switch_info_t' si)
 
int ev_create_switch_xrefs (self, ida_idaapi.ea_t jumpea, 'switch_info_t' si)
 
int ev_is_align_insn (self, ida_idaapi.ea_t ea)
 
int ev_is_alloca_probe (self, ida_idaapi.ea_t ea)
 
'PyObject *' ev_delay_slot_insn (self, ida_idaapi.ea_t ea, bool bexec, bool fexec)
 
int ev_is_sp_based (self, 'int *' mode, 'insn_t const *' insn, 'op_t const *' op)
 
int ev_can_have_type (self, 'op_t const *' op)
 
int ev_cmp_operands (self, 'op_t const *' op1, 'op_t const *' op2)
 
int ev_adjust_refinfo (self, 'refinfo_t' ri, ida_idaapi.ea_t ea, int n, 'fixup_data_t const *' fd)
 
'PyObject *' ev_get_operand_string (self, 'insn_t const *' insn, int opnum)
 
'PyObject *' ev_get_reg_name (self, int reg, 'size_t' width, int reghi)
 
int ev_str2reg (self, str regname)
 
'PyObject *' ev_get_autocmt (self, 'insn_t const *' insn)
 
int ev_get_bg_color (self, 'bgcolor_t *' color, ida_idaapi.ea_t ea)
 
int ev_is_jump_func (self, 'func_t *' pfn, 'ea_t *' jump_target, 'ea_t *' func_pointer)
 
int ev_func_bounds (self, 'int *' possible_return_code, 'func_t *' pfn, ida_idaapi.ea_t max_func_end_ea)
 
int ev_verify_sp (self, 'func_t *' pfn)
 
int ev_verify_noreturn (self, 'func_t *' pfn)
 
int ev_create_func_frame (self, 'func_t *' pfn)
 
int ev_get_frame_retsize (self, 'int *' frsize, 'func_t const *' pfn)
 
int ev_get_stkvar_scale_factor (self)
 
'PyObject *' ev_demangle_name (self, str name, int disable_mask, int demreq)
 
int ev_add_cref (self, ida_idaapi.ea_t _from, ida_idaapi.ea_t to, 'cref_t' type)
 
int ev_add_dref (self, ida_idaapi.ea_t _from, ida_idaapi.ea_t to, 'dref_t' type)
 
int ev_del_cref (self, ida_idaapi.ea_t _from, ida_idaapi.ea_t to, bool expand)
 
int ev_del_dref (self, ida_idaapi.ea_t _from, ida_idaapi.ea_t to)
 
int ev_coagulate_dref (self, ida_idaapi.ea_t _from, ida_idaapi.ea_t to, bool may_define, 'ea_t *' code_ea)
 
int ev_may_show_sreg (self, ida_idaapi.ea_t current_ea)
 
int ev_auto_queue_empty (self, 'atype_t' type)
 
int ev_validate_flirt_func (self, ida_idaapi.ea_t start_ea, str funcname)
 
int ev_adjust_libfunc_ea (self, 'idasgn_t const *' sig, 'libfunc_t const *' libfun, 'ea_t *' ea)
 
'PyObject *' ev_assemble (self, ida_idaapi.ea_t ea, ida_idaapi.ea_t cs, ida_idaapi.ea_t ip, bool use32, str line)
 
int ev_extract_address (self, 'ea_t *' out_ea, ida_idaapi.ea_t screen_ea, str string, 'size_t' position)
 
int ev_realcvt (self, 'void *' m, 'fpvalue_t *' e, 'uint16' swt)
 
int ev_gen_asm_or_lst (self, bool starting, 'FILE *' fp, bool is_asm, int flags, 'html_line_cb_t **' outline)
 
int ev_gen_map_file (self, 'int *' nlines, 'FILE *' fp)
 
int ev_create_flat_group (self, ida_idaapi.ea_t image_base, int bitness, 'sel_t' dataseg_sel)
 
int ev_getreg (self, 'uval_t *' regval, int regnum)
 
int ev_analyze_prolog (self, ida_idaapi.ea_t ea)
 
int ev_calc_spdelta (self, 'sval_t *' spdelta, 'insn_t const *' insn)
 
int ev_calcrel (self)
 
'PyObject *' ev_find_reg_value (self, 'insn_t const *' pinsn, int reg)
 
'PyObject *' ev_find_op_value (self, 'insn_t const *' pinsn, int opn)
 
int ev_replaying_undo (self, str action_name, 'undo_records_t const *' vec, bool is_undo)
 
int ev_ending_undo (self, str action_name, bool is_undo)
 
int ev_set_code16_mode (self, ida_idaapi.ea_t ea, bool code16)
 
int ev_get_code16_mode (self, ida_idaapi.ea_t ea)
 
int ev_get_procmod (self)
 
int ev_asm_installed (self, int asmnum)
 
int ev_get_reg_accesses (self, 'reg_accesses_t' accvec, 'insn_t const *' insn, int flags)
 
int ev_is_control_flow_guard (self, 'int *' p_reg, 'insn_t const *' insn)
 
int ev_create_merge_handlers (self, 'merge_data_t *' md)
 
int ev_privrange_changed (self, 'range_t' old_privrange, 'adiff_t' delta)
 
int ev_cvt64_supval (self, 'nodeidx_t' node, 'uchar' tag, 'nodeidx_t' idx, 'uchar const *' data)
 
int ev_cvt64_hashval (self, 'nodeidx_t' node, 'uchar' tag, str name, 'uchar const *' data)
 
int ev_gen_stkvar_def (self, 'outctx_t *' outctx, 'udm_t' stkvar, int v, 'tid_t' tid)
 
int ev_next_exec_insn (self, 'ea_t *' target, ida_idaapi.ea_t ea, int tid, 'processor_t::regval_getter_t *' getreg, 'regval_t' regvalues)
 
int ev_calc_step_over (self, 'ea_t *' target, ida_idaapi.ea_t ip)
 
int ev_calc_next_eas (self, 'eavec_t *' res, 'insn_t const *' insn, bool over)
 
int ev_get_macro_insn_head (self, 'ea_t *' head, ida_idaapi.ea_t ip)
 
int ev_get_dbr_opnum (self, 'int *' opnum, 'insn_t const *' insn)
 
int ev_insn_reads_tbit (self, 'insn_t const *' insn, 'processor_t::regval_getter_t *' getreg, 'regval_t' regvalues)
 
int ev_clean_tbit (self, ida_idaapi.ea_t ea, 'processor_t::regval_getter_t *' getreg, 'regval_t' regvalues)
 
int ev_get_reg_info (self, 'char const **' main_regname, 'bitrange_t' bitrange, str regname)
 
int ev_update_call_stack (self, 'call_stack_t' stack, int tid, 'processor_t::regval_getter_t *' getreg, 'regval_t' regvalues)
 
int ev_setup_til (self)
 
int ev_get_abi_info (self, 'comp_t' comp)
 
int ev_max_ptr_size (self)
 
int ev_get_default_enum_size (self)
 
int ev_get_cc_regs (self, 'callregs_t' regs, 'cm_t' cc)
 
int ev_get_simd_types (self, 'simd_info_vec_t *' out, 'simd_info_t' simd_attrs, 'argloc_t' argloc, bool create_tifs)
 
int ev_calc_cdecl_purged_bytes (self, ida_idaapi.ea_t ea)
 
int ev_calc_purged_bytes (self, 'int *' p_purged_bytes, 'func_type_data_t' fti)
 
int ev_calc_retloc (self, 'argloc_t' retloc, 'tinfo_t' rettype, 'cm_t' cc)
 
int ev_calc_arglocs (self, 'func_type_data_t' fti)
 
int ev_calc_varglocs (self, 'func_type_data_t' ftd, 'regobjs_t' aux_regs, 'relobj_t' aux_stkargs, int nfixed)
 
int ev_adjust_argloc (self, 'argloc_t' argloc, 'tinfo_t' optional_type, int size)
 
int ev_lower_func_type (self, 'intvec_t *' argnums, 'func_type_data_t' fti)
 
int ev_equal_reglocs (self, 'argloc_t' a1, 'argloc_t' a2)
 
int ev_use_stkarg_type (self, ida_idaapi.ea_t ea, 'funcarg_t' arg)
 
'PyObject *' ev_use_regarg_type (self, ida_idaapi.ea_t ea, 'funcargvec_t const *' rargs)
 
int ev_use_arg_types (self, ida_idaapi.ea_t ea, 'func_type_data_t' fti, 'funcargvec_t *' rargs)
 
int ev_arg_addrs_ready (self, ida_idaapi.ea_t caller, int n, 'tinfo_t' tif, 'ea_t *' addrs)
 
'PyObject *' ev_decorate_name (self, str name, bool mangle, int cc, 'tinfo_t' optional_type)
 
int ev_arch_changed (self)
 
int ev_get_stkarg_area_info (self, 'stkarg_area_info_t' out, 'cm_t' cc)
 
int ev_last_cb_before_loader (self)
 
int ev_loader (self)
 
 __disown__ (self)
 

Properties

 thisown
 

Constructor & Destructor Documentation

◆ __init__()

__init__ ( self,
int _flags = 0,
int _hkcb_flags = 1 )

Member Function Documentation

◆ __disown__()

__disown__ ( self)

◆ ev_add_cref()

int ev_add_cref ( self,
ida_idaapi.ea_t _from,
ida_idaapi.ea_t to,
'cref_t' type )
A code reference is being created. 
  
@param to: (::ea_t)
@param type: (cref_t)
@retval <0: cancel cref creation
@retval 0: not implemented or continue

◆ ev_add_dref()

int ev_add_dref ( self,
ida_idaapi.ea_t _from,
ida_idaapi.ea_t to,
'dref_t' type )
A data reference is being created. 
  
@param to: (::ea_t)
@param type: (dref_t)
@retval <0: cancel dref creation
@retval 0: not implemented or continue

◆ ev_adjust_argloc()

int ev_adjust_argloc ( self,
'argloc_t' argloc,
'tinfo_t' optional_type,
int size )
Adjust argloc according to its type/size and platform endianess 
  
@param argloc: (argloc_t *), inout
@param size: (int) 'size' makes no sense if type != nullptr (type->get_size() should be used instead)
@retval 0: not implemented
@retval 1: ok
@retval -1: error

◆ ev_adjust_libfunc_ea()

int ev_adjust_libfunc_ea ( self,
'idasgn_t const *' sig,
'libfunc_t const *' libfun,
'ea_t *' ea )
Called when a signature module has been matched against bytes in the database. This is used to compute the offset at which a particular module's libfunc should be applied. 
  
@param sig: (const idasgn_t *)
@param libfun: (const libfunc_t *)
@param ea: (::ea_t *)
@retval 1: the ea_t pointed to by the third argument was modified.
@retval <=0: not modified. use default algorithm.

◆ ev_adjust_refinfo()

int ev_adjust_refinfo ( self,
'refinfo_t' ri,
ida_idaapi.ea_t ea,
int n,
'fixup_data_t const *' fd )
Called from apply_fixup before converting operand to reference. Can be used for changing the reference info. (e.g. the PPC module adds REFINFO_NOBASE for some references) 
  
@param ri: (refinfo_t *)
@param ea: (::ea_t) instruction address
@param n: (int) operand number
@param fd: (const fixup_data_t *)
@retval <0: do not create an offset
@retval 0: not implemented or refinfo adjusted

◆ ev_ana_insn()

bool ev_ana_insn ( self,
'insn_t *' out )
Analyze one instruction and fill 'out' structure. 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. 
  
@param out: (insn_t *)
@returns length of the instruction in bytes, 0 if instruction can't be decoded.
@retval 0: if instruction can't be decoded.

Reimplemented in processor_t.

◆ ev_analyze_prolog()

int ev_analyze_prolog ( self,
ida_idaapi.ea_t ea )
Analyzes function prolog, epilog, and updates purge, and function attributes 
  
@param ea: (::ea_t) start of function
@retval 1: ok
@retval 0: not implemented

◆ ev_arch_changed()

int ev_arch_changed ( self)
The loader is done parsing arch-related information, which the processor module might want to use to finish its initialization. 
  
@retval 1: if success
@retval 0: not implemented or failed

◆ ev_arg_addrs_ready()

int ev_arg_addrs_ready ( self,
ida_idaapi.ea_t caller,
int n,
'tinfo_t' tif,
'ea_t *' addrs )
Argument address info is ready. 
  
@param caller: (::ea_t)
@param n: (int) number of formal arguments
@param tif: (tinfo_t *) call prototype
@param addrs: (::ea_t *) argument intilization addresses
@retval <0: do not save into idb; other values mean "ok to save\"

◆ ev_asm_installed()

int ev_asm_installed ( self,
int asmnum )
After setting a new assembler 
  
@param asmnum: (int) See also ev_newasm

◆ ev_assemble()

'PyObject *' ev_assemble ( self,
ida_idaapi.ea_t ea,
ida_idaapi.ea_t cs,
ida_idaapi.ea_t ip,
bool use32,
str line )
Assemble an instruction. (display a warning if an error is found). 
  
@param ea: (::ea_t) linear address of instruction
@param cs: (::ea_t) cs of instruction
@param ip: (::ea_t) ip of instruction
@param use32: (bool) is 32bit segment?
@param line: (const char *) line to assemble
@returns size of the instruction in bytes

Reimplemented in processor_t.

◆ ev_auto_queue_empty()

int ev_auto_queue_empty ( self,
'atype_t' type )
One analysis queue is empty. 
  
@param type: (atype_t)
@retval void: see also idb_event::auto_empty_finally

Reimplemented in processor_t.

◆ ev_calc_arglocs()

int ev_calc_arglocs ( self,
'func_type_data_t' fti )
Calculate function argument locations. This callback should fill retloc, all arglocs, and stkargs. This callback is never called for CM_CC_SPECIAL functions. 
  
@param fti: (func_type_data_t *) points to the func type info
@retval 0: not implemented
@retval 1: ok
@retval -1: error

◆ ev_calc_cdecl_purged_bytes()

int ev_calc_cdecl_purged_bytes ( self,
ida_idaapi.ea_t ea )
Calculate number of purged bytes after call. 
  
@param ea: (::ea_t) address of the call instruction
@returns number of purged bytes (usually add sp, N)

◆ ev_calc_next_eas()

int ev_calc_next_eas ( self,
'eavec_t *' res,
'insn_t const *' insn,
bool over )
Calculate list of addresses the instruction in 'insn' may pass control to. This callback is required for source level debugging. 
  
@param res: (eavec_t *), out: array for the results.
@param insn: (const insn_t*) the instruction
@param over: (bool) calculate for step over (ignore call targets)
@retval <0: incalculable (indirect jumps, for example)
@retval >=0: number of addresses of called functions in the array. They must be put at the beginning of the array (0 if over=true)

◆ ev_calc_purged_bytes()

int ev_calc_purged_bytes ( self,
'int *' p_purged_bytes,
'func_type_data_t' fti )
Calculate number of purged bytes by the given function type. 
  
@param p_purged_bytes: (int *) ptr to output
@param fti: (const func_type_data_t *) func type details
@retval 1: 
@retval 0: not implemented

◆ ev_calc_retloc()

int ev_calc_retloc ( self,
'argloc_t' retloc,
'tinfo_t' rettype,
'cm_t' cc )
Calculate return value location. 
  
@param retloc: (argloc_t *)
@param rettype: (const tinfo_t *)
@param cc: (cm_t)
@retval 0: not implemented
@retval 1: ok,
@retval -1: error

◆ ev_calc_spdelta()

int ev_calc_spdelta ( self,
'sval_t *' spdelta,
'insn_t const *' insn )
Calculate amount of change to sp for the given insn. This event is required to decompile code snippets. 
  
@param spdelta: (sval_t *)
@param insn: (const insn_t *)
@retval 1: ok
@retval 0: not implemented

◆ ev_calc_step_over()

int ev_calc_step_over ( self,
'ea_t *' target,
ida_idaapi.ea_t ip )
Calculate the address of the instruction which will be executed after "step over". The kernel will put a breakpoint there. If the step over is equal to step into or we cannot calculate the address, return BADADDR. 
  
@param target: (::ea_t *) pointer to the answer
@param ip: (::ea_t) instruction address
@retval 0: unimplemented
@retval 1: implemented

Reimplemented in processor_t.

◆ ev_calc_switch_cases()

int ev_calc_switch_cases ( self,
'casevec_t *' casevec,
'eavec_t *' targets,
ida_idaapi.ea_t insn_ea,
'switch_info_t' si )
Calculate case values and targets for a custom jump table. 
  
@param casevec: (::casevec_t *) vector of case values (may be nullptr)
@param targets: (eavec_t *) corresponding target addresses (my be nullptr)
@param insn_ea: (::ea_t) address of the 'indirect jump' instruction
@param si: (switch_info_t *) switch information
@retval 1: ok
@retval <=0: failed

◆ ev_calc_varglocs()

int ev_calc_varglocs ( self,
'func_type_data_t' ftd,
'regobjs_t' aux_regs,
'relobj_t' aux_stkargs,
int nfixed )
Calculate locations of the arguments that correspond to '...'. 
  
@param ftd: (func_type_data_t *), inout: info about all arguments (including varargs)
@param aux_regs: (regobjs_t *) buffer for hidden register arguments, may be nullptr
@param aux_stkargs: (relobj_t *) buffer for hidden stack arguments, may be nullptr
@param nfixed: (int) number of fixed arguments
@retval 0: not implemented
@retval 1: ok
@retval -1: error On some platforms variadic calls require passing additional information: for example, number of floating variadic arguments must be passed in rax on gcc-x64. The locations and values that constitute this additional information are returned in the buffers pointed by aux_regs and aux_stkargs

◆ ev_calcrel()

int ev_calcrel ( self)
Reserved.

◆ ev_can_have_type()

int ev_can_have_type ( self,
'op_t const *' op )
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. see bytes.hpp for information about types and flags) 
  
@param op: (const op_t *)
@retval 0: unknown
@retval <0: no
@retval 1: yes

Reimplemented in processor_t.

◆ ev_clean_tbit()

int ev_clean_tbit ( self,
ida_idaapi.ea_t ea,
'processor_t.regval_getter_t *' getreg,
'regval_t' regvalues )
Clear the TF bit after an insn like pushf stored it in memory. 
  
@param ea: (::ea_t) instruction address
@param getreg: (::processor_t::regval_getter_t *) function to get register values
@param regvalues: (const regval_t *) register values array
@retval 1: ok
@retval 0: failed

◆ ev_cmp_operands()

int ev_cmp_operands ( self,
'op_t const *' op1,
'op_t const *' op2 )
Compare instruction operands 
  
@param op1: (const op_t*)
@param op2: (const op_t*)
@retval 1: equal
@retval -1: not equal
@retval 0: not implemented

Reimplemented in processor_t.

◆ ev_coagulate()

int ev_coagulate ( self,
ida_idaapi.ea_t start_ea )
Try to define some unexplored bytes. 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. 
  
@param start_ea: (::ea_t)
@returns number of converted bytes

Reimplemented in processor_t.

◆ ev_coagulate_dref()

int ev_coagulate_dref ( self,
ida_idaapi.ea_t _from,
ida_idaapi.ea_t to,
bool may_define,
'ea_t *' code_ea )
Data reference is being analyzed. plugin may correct 'code_ea' (e.g. for thumb mode refs, we clear the last bit) 
  
@param to: (::ea_t)
@param may_define: (bool)
@param code_ea: (::ea_t *)
@retval <0: failed dref analysis, >0 done dref analysis
@retval 0: not implemented or continue

Reimplemented in processor_t.

◆ ev_create_flat_group()

int ev_create_flat_group ( self,
ida_idaapi.ea_t image_base,
int bitness,
'sel_t' dataseg_sel )
Create special segment representing the flat group. 
  
@param image_base: (::ea_t)
@param bitness: (int)
@param dataseg_sel: (::sel_t) return value is ignored

◆ ev_create_func_frame()

int ev_create_func_frame ( self,
'func_t *' pfn )
Create a function frame for a newly created function Set up frame size, its attributes etc 
  
@param pfn: (func_t *)
@retval 1: ok
@retval 0: not implemented

Reimplemented in processor_t.

◆ ev_create_merge_handlers()

int ev_create_merge_handlers ( self,
'merge_data_t *' md )
Create merge handlers, if needed 
  
@param md: (merge_data_t *) This event is generated immediately after opening idbs.
@returns must be 0

◆ ev_create_switch_xrefs()

int ev_create_switch_xrefs ( self,
ida_idaapi.ea_t jumpea,
'switch_info_t' si )
Create xrefs for a custom jump table. 
  
@param jumpea: (::ea_t) address of the jump insn
@param si: (const switch_info_t *) switch information
@returns must return 1 Must be implemented if module uses custom jump tables, SWI_CUSTOM

Reimplemented in processor_t.

◆ ev_creating_segm()

int ev_creating_segm ( self,
'segment_t *' seg )
A new segment is about to be created. 
  
@param seg: (segment_t *)
@retval 1: ok
@retval <0: segment should not be created

Reimplemented in processor_t.

◆ ev_cvt64_hashval()

int ev_cvt64_hashval ( self,
'nodeidx_t' node,
'uchar' tag,
str name,
'uchar const *' data )
perform 32-64 conversion for a hash value 
  
@param node: (::nodeidx_t)
@param tag: (uchar)
@param name: (const ::char *)
@param data: (const uchar *)
@retval 0: nothing was done
@retval 1: converted successfully
@retval -1: error (and message in errbuf)

◆ ev_cvt64_supval()

int ev_cvt64_supval ( self,
'nodeidx_t' node,
'uchar' tag,
'nodeidx_t' idx,
'uchar const *' data )
perform 32-64 conversion for a netnode array element 
  
@param node: (::nodeidx_t)
@param tag: (uchar)
@param idx: (::nodeidx_t)
@param data: (const uchar *)
@retval 0: nothing was done
@retval 1: converted successfully
@retval -1: error (and message in errbuf)

◆ ev_decorate_name()

'PyObject *' ev_decorate_name ( self,
str name,
bool mangle,
int cc,
'tinfo_t' optional_type )
Decorate/undecorate a C symbol name. 
  
@param name: (const char *) name of symbol
@param mangle: (bool) true-mangle, false-unmangle
@param cc: (cm_t) calling convention
@retval 1: if success
@retval 0: not implemented or failed

◆ ev_del_cref()

int ev_del_cref ( self,
ida_idaapi.ea_t _from,
ida_idaapi.ea_t to,
bool expand )
A code reference is being deleted. 
  
@param to: (::ea_t)
@param expand: (bool)
@retval <0: cancel cref deletion
@retval 0: not implemented or continue

◆ ev_del_dref()

int ev_del_dref ( self,
ida_idaapi.ea_t _from,
ida_idaapi.ea_t to )
A data reference is being deleted. 
  
@param to: (::ea_t)
@retval <0: cancel dref deletion
@retval 0: not implemented or continue

◆ ev_delay_slot_insn()

'PyObject *' ev_delay_slot_insn ( self,
ida_idaapi.ea_t ea,
bool bexec,
bool fexec )
Get delay slot instruction 
  
@param ea: (::ea_t *) in: instruction address in question, out: (if the answer is positive) if the delay slot contains valid insn: the address of the delay slot insn else: BADADDR (invalid insn, e.g. a branch)
@param bexec: (bool *) execute slot if jumping, initially set to 'true'
@param fexec: (bool *) execute slot if not jumping, initally set to 'true'
@retval 1: positive answer
@retval <=0: ordinary insn

◆ ev_demangle_name()

'PyObject *' ev_demangle_name ( self,
str name,
int disable_mask,
int demreq )
Demangle a C++ (or another language) name into a user-readable string. This event is called by demangle_name() 
  
@param name: (const char *) mangled name
@param disable_mask: (uint32) flags to inhibit parts of output or compiler info/other (see MNG_)
@param demreq: (demreq_type_t) operation to perform
@retval 1: if success
@retval 0: not implemented

◆ ev_emu_insn()

bool ev_emu_insn ( self,
'insn_t const *' insn )
Emulate instruction, create cross-references, plan to analyze subsequent instructions, modify flags etc. Upon entrance to this function, all information about the instruction is in 'insn' structure. 
  
@param insn: (const insn_t *)
@retval 1: ok
@retval -1: the kernel will delete the instruction

Reimplemented in processor_t.

◆ ev_endbinary()

int ev_endbinary ( self,
bool ok )
IDA has loaded a binary file. 
  
@param ok: (bool) file loaded successfully?

Reimplemented in processor_t.

◆ ev_ending_undo()

int ev_ending_undo ( self,
str action_name,
bool is_undo )
Ended undoing/redoing an action 
  
@param action_name: (const char *) action that we finished undoing/redoing. is not nullptr.
@param is_undo: (bool) true if performing undo, false if performing redo

◆ ev_equal_reglocs()

int ev_equal_reglocs ( self,
'argloc_t' a1,
'argloc_t' a2 )
Are 2 register arglocs the same?. We need this callback for the pc module. 
  
@param a1: (argloc_t *)
@param a2: (argloc_t *)
@retval 1: yes
@retval -1: no
@retval 0: not implemented

◆ ev_extract_address()

int ev_extract_address ( self,
'ea_t *' out_ea,
ida_idaapi.ea_t screen_ea,
str string,
'size_t' position )
Extract address from a string. 
  
@param out_ea: (ea_t *), out
@param screen_ea: (ea_t)
@param string: (const char *)
@param position: (size_t)
@retval 1: ok
@retval 0: kernel should use the standard algorithm
@retval -1: error

◆ ev_find_op_value()

'PyObject *' ev_find_op_value ( self,
'insn_t const *' pinsn,
int opn )
Find operand value via a register tracker. The returned value in 'out' is valid before executing the instruction. 
  
@param pinsn: (const insn_t *) instruction
@param opn: (int) operand index
@retval 1: if implemented, and value was found
@retval 0: not implemented, -1 decoding failed, or no value found

◆ ev_find_reg_value()

'PyObject *' ev_find_reg_value ( self,
'insn_t const *' pinsn,
int reg )
Find register value via a register tracker. The returned value in 'out' is valid before executing the instruction. 
  
@param pinsn: (const insn_t *) instruction
@param reg: (int) register index
@retval 1: if implemented, and value was found
@retval 0: not implemented, -1 decoding failed, or no value found

◆ ev_func_bounds()

int ev_func_bounds ( self,
'int *' possible_return_code,
'func_t *' pfn,
ida_idaapi.ea_t max_func_end_ea )
find_func_bounds() finished its work. The module may fine tune the function bounds 
  
@param possible_return_code: (int *), in/out
@param pfn: (func_t *)
@param max_func_end_ea: (::ea_t) (from the kernel's point of view)
@retval void: 

Reimplemented in processor_t.

◆ ev_gen_asm_or_lst()

int ev_gen_asm_or_lst ( self,
bool starting,
'FILE *' fp,
bool is_asm,
int flags,
'html_line_cb_t **' outline )
Callback: generating asm or lst file. The kernel calls this callback twice, at the beginning and at the end of listing generation. The processor module can intercept this event and adjust its output 
  
@param starting: (bool) beginning listing generation
@param fp: (FILE *) output file
@param is_asm: (bool) true:assembler, false:listing
@param flags: (int) flags passed to gen_file()
@param outline: (html_line_cb_t **) ptr to ptr to outline callback. if this callback is defined for this code, it will be used by the kernel to output the generated lines
@retval void: 

◆ ev_gen_map_file()

int ev_gen_map_file ( self,
'int *' nlines,
'FILE *' fp )
Generate map file. If not implemented the kernel itself will create the map file. 
  
@param nlines: (int *) number of lines in map file (-1 means write error)
@param fp: (FILE *) output file
@retval 0: not implemented
@retval 1: ok
@retval -1: write error

Reimplemented in processor_t.

◆ ev_gen_regvar_def()

int ev_gen_regvar_def ( self,
'outctx_t *' outctx,
'regvar_t *' v )
Generate register variable definition line. 
  
@param outctx: (outctx_t *)
@param v: (regvar_t *)
@retval >0: ok, generated the definition text
@retval 0: not implemented

Reimplemented in processor_t.

◆ ev_gen_src_file_lnnum()

int ev_gen_src_file_lnnum ( self,
'outctx_t *' outctx,
str file,
'size_t' lnnum )
Callback: generate analog of: 
#line  123



  
@param outctx: (outctx_t *) output context
@param file: (const char *) source file (may be nullptr)
@param lnnum: (size_t) line number
@retval 1: directive has been generated
@retval 0: not implemented

Reimplemented in processor_t.

◆ ev_gen_stkvar_def()

int ev_gen_stkvar_def ( self,
'outctx_t *' outctx,
'udm_t' stkvar,
int v,
'tid_t' tid )
Generate stack variable definition line Default line is varname = type ptr value, where 'type' is one of byte,word,dword,qword,tbyte 
  
@param outctx: (outctx_t *)
@param stkvar: (const udm_t *)
@param v: (sval_t)
@param tid: (tid_t) stkvar TID
@retval 1: ok
@retval 0: not implemented

◆ ev_get_abi_info()

int ev_get_abi_info ( self,
'comp_t' comp )
Get all possible ABI names and optional extensions for given compiler abiname/option is a string entirely consisting of letters, digits and underscore 
  
@param comp: (comp_t) - compiler ID
@retval 0: not implemented
@retval 1: ok

◆ ev_get_autocmt()

'PyObject *' ev_get_autocmt ( self,
'insn_t const *' insn )
Callback: get dynamic auto comment. Will be called if the autocomments are enabled and the comment retrieved from ida.int starts with '$!'. 'insn' contains valid info. 
  
@param insn: (const insn_t*) the instruction
@retval 1: new comment has been generated
@retval 0: callback has not been handled. the buffer must not be changed in this case

Reimplemented in processor_t.

◆ ev_get_bg_color()

int ev_get_bg_color ( self,
'bgcolor_t *' color,
ida_idaapi.ea_t ea )
Get item background color. Plugins can hook this callback to color disassembly lines dynamically 
  
@param color: (bgcolor_t *), out
@param ea: (::ea_t)
@retval 0: not implemented
@retval 1: color set

◆ ev_get_cc_regs()

int ev_get_cc_regs ( self,
'callregs_t' regs,
'cm_t' cc )
Get register allocation convention for given calling convention 
  
@param regs: (callregs_t *), out
@param cc: (cm_t)
@retval 1: 
@retval 0: not implemented

◆ ev_get_code16_mode()

int ev_get_code16_mode ( self,
ida_idaapi.ea_t ea )
Get ISA 16-bit mode 
  
@param ea: (ea_t) address to get the ISA mode
@retval 1: 16-bit mode
@retval 0: not implemented or 32-bit mode

◆ ev_get_dbr_opnum()

int ev_get_dbr_opnum ( self,
'int *' opnum,
'insn_t const *' insn )
Get the number of the operand to be displayed in the debugger reference view (text mode). 
  
@param opnum: (int *) operand number (out, -1 means no such operand)
@param insn: (const insn_t*) the instruction
@retval 0: unimplemented
@retval 1: implemented

◆ ev_get_default_enum_size()

int ev_get_default_enum_size ( self)
Get default enum size. Not generated anymore. inf_get_cc_size_e() is used instead 

◆ ev_get_frame_retsize()

int ev_get_frame_retsize ( self,
'int *' frsize,
'func_t const *' pfn )
Get size of function return address in bytes If this event is not implemented, the kernel will assume
* 8 bytes for 64-bit function
* 4 bytes for 32-bit function
* 2 bytes otherwise



@param frsize: (int *) frame size (out)
@param pfn: (const func_t *), can't be nullptr
@retval 1: ok
@retval 0: not implemented

Reimplemented in processor_t.

◆ ev_get_macro_insn_head()

int ev_get_macro_insn_head ( self,
'ea_t *' head,
ida_idaapi.ea_t ip )
Calculate the start of a macro instruction. This notification is called if IP points to the middle of an instruction 
  
@param head: (::ea_t *), out: answer, BADADDR means normal instruction
@param ip: (::ea_t) instruction address
@retval 0: unimplemented
@retval 1: implemented

◆ ev_get_operand_string()

'PyObject *' ev_get_operand_string ( self,
'insn_t const *' insn,
int opnum )
Request text string for operand (cli, java, ...). 
  
@param insn: (const insn_t*) the instruction
@param opnum: (int) operand number, -1 means any string operand
@retval 0: no string (or empty string)
@retval >0: original string length without terminating zero

Reimplemented in processor_t.

◆ ev_get_procmod()

int ev_get_procmod ( self)
Get pointer to the processor module object. All processor modules must implement this. The pointer is returned as size_t. 

◆ ev_get_reg_accesses()

int ev_get_reg_accesses ( self,
'reg_accesses_t' accvec,
'insn_t const *' insn,
int flags )
Get info about the registers that are used/changed by an instruction. 
  
@param accvec: (reg_accesses_t*) out: info about accessed registers
@param insn: (const insn_t *) instruction in question
@param flags: (int) reserved, must be 0
@retval -1: if accvec is nullptr
@retval 1: found the requested access (and filled accvec)
@retval 0: not implemented

◆ ev_get_reg_info()

int ev_get_reg_info ( self,
'char const **' main_regname,
'bitrange_t' bitrange,
str regname )
Get register information by its name. example: "ah" returns:
* main_regname="eax"
* bitrange_t = { offset==8, nbits==8 }


This callback may be unimplemented if the register names are all present in processor_t::reg_names and they all have the same size 
  
@param main_regname: (const char **), out
@param bitrange: (bitrange_t *), out: position and size of the value within 'main_regname' (empty bitrange == whole register)
@param regname: (const char *)
@retval 1: ok
@retval -1: failed (not found)
@retval 0: unimplemented

◆ ev_get_reg_name()

'PyObject *' ev_get_reg_name ( self,
int reg,
'size_t' width,
int reghi )
Generate text representation of a register. 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 name. 
  
@param reg: (int) internal register number as defined in the processor module
@param width: (size_t) register width in bytes
@param reghi: (int) if not -1 then this function will return the register pair
@retval -1: if error
@retval strlen(buf): if success

◆ ev_get_simd_types()

int ev_get_simd_types ( self,
'simd_info_vec_t *' out,
'simd_info_t' simd_attrs,
'argloc_t' argloc,
bool create_tifs )
Get SIMD-related types according to given attributes ant/or argument location 
  
@param out: (::simd_info_vec_t *)
@param simd_attrs: (const simd_info_t *), may be nullptr
@param argloc: (const argloc_t *), may be nullptr
@param create_tifs: (bool) return valid tinfo_t objects, create if neccessary
@retval number: of found types
@retval -1: error If name==nullptr, initialize all SIMD types

◆ ev_get_stkarg_area_info()

int ev_get_stkarg_area_info ( self,
'stkarg_area_info_t' out,
'cm_t' cc )
Get some metrics of the stack argument area. 
  
@param out: (stkarg_area_info_t *) ptr to stkarg_area_info_t
@param cc: (cm_t) calling convention
@retval 1: if success
@retval 0: not implemented

◆ ev_get_stkvar_scale_factor()

int ev_get_stkvar_scale_factor ( self)
Should stack variable references be multiplied by a coefficient before being used in the stack frame?. Currently used by TMS320C55 because the references into the stack should be multiplied by 2 
  
@returns scaling factor
@retval 0: not implemented

◆ ev_getreg()

int ev_getreg ( self,
'uval_t *' regval,
int regnum )
IBM PC only internal request, should never be used for other purpose Get register value by internal index 
  
@param regval: (uval_t *), out
@param regnum: (int)
@retval 1: ok
@retval 0: not implemented
@retval -1: failed (undefined value or bad regnum)

◆ ev_init()

int ev_init ( self,
str idp_modname )
The IDP module is just loaded. 
  
@param idp_modname: (const char *) processor module name
@retval <0: on failure

◆ ev_insn_reads_tbit()

int ev_insn_reads_tbit ( self,
'insn_t const *' insn,
'processor_t.regval_getter_t *' getreg,
'regval_t' regvalues )
Check if insn will read the TF bit. 
  
@param insn: (const insn_t*) the instruction
@param getreg: (::processor_t::regval_getter_t *) function to get register values
@param regvalues: (const regval_t *) register values array
@retval 2: yes, will generate 'step' exception
@retval 1: yes, will store the TF bit in memory
@retval 0: no

◆ ev_is_align_insn()

int ev_is_align_insn ( self,
ida_idaapi.ea_t ea )
Is the instruction created only for alignment purposes?. Do not directly call this function, use is_align_insn() 
  
@param ea: (ea_t) - instruction address
@retval number: of bytes in the instruction

Reimplemented in processor_t.

◆ ev_is_alloca_probe()

int ev_is_alloca_probe ( self,
ida_idaapi.ea_t ea )
Does the function at 'ea' behave as __alloca_probe? 
  
@param ea: (::ea_t)
@retval 1: yes
@retval 0: no

Reimplemented in processor_t.

◆ ev_is_basic_block_end()

int ev_is_basic_block_end ( self,
'insn_t const *' insn,
bool call_insn_stops_block )
Is the current instruction end of a basic block?. This function should be defined for processors with delayed jump slots. 
  
@param insn: (const insn_t*) the instruction
@param call_insn_stops_block: (bool)
@retval 0: unknown
@retval <0: no
@retval 1: yes

Reimplemented in processor_t.

◆ ev_is_call_insn()

int ev_is_call_insn ( self,
'insn_t const *' insn )
Is the instruction a "call"? 
  
@param insn: (const insn_t *) instruction
@retval 0: unknown
@retval <0: no
@retval 1: yes

Reimplemented in processor_t.

◆ ev_is_cond_insn()

int ev_is_cond_insn ( self,
'insn_t const *' insn )
Is conditional instruction? 
  
@param insn: (const insn_t *) instruction address
@retval 1: yes
@retval -1: no
@retval 0: not implemented or not instruction

◆ ev_is_control_flow_guard()

int ev_is_control_flow_guard ( self,
'int *' p_reg,
'insn_t const *' insn )
Detect if an instruction is a "thunk call" to a flow guard function (equivalent to call reg/return/nop) 
  
@param p_reg: (int *) indirect register number, may be -1
@param insn: (const insn_t *) call/jump instruction
@retval -1: no thunk detected
@retval 1: indirect call
@retval 2: security check routine call (NOP)
@retval 3: return thunk
@retval 0: not implemented

◆ ev_is_far_jump()

int ev_is_far_jump ( self,
int icode )
is indirect far jump or call instruction? meaningful only if the processor has 'near' and 'far' reference types 
  
@param icode: (int)
@retval 0: not implemented
@retval 1: yes
@retval -1: no

Reimplemented in processor_t.

◆ ev_is_indirect_jump()

int ev_is_indirect_jump ( self,
'insn_t const *' insn )
Determine if instruction is an indirect jump. If CF_JUMP bit cannot describe all jump types jumps, please define this callback. 
  
@param insn: (const insn_t*) the instruction
@retval 0: use CF_JUMP
@retval 1: no
@retval 2: yes

Reimplemented in processor_t.

◆ ev_is_insn_table_jump()

int ev_is_insn_table_jump ( self)
Reserved.

Reimplemented in processor_t.

◆ ev_is_jump_func()

int ev_is_jump_func ( self,
'func_t *' pfn,
'ea_t *' jump_target,
'ea_t *' func_pointer )
Is the function a trivial "jump" function?. 
  
@param pfn: (func_t *)
@param jump_target: (::ea_t *)
@param func_pointer: (::ea_t *)
@retval <0: no
@retval 0: don't know
@retval 1: yes, see 'jump_target' and 'func_pointer'

◆ ev_is_ret_insn()

int ev_is_ret_insn ( self,
'insn_t const *' insn,
'uchar' flags )
Is the instruction a "return"? 
  
@param insn: (const insn_t *) instruction
@param flags: (uchar), combination of IRI_... flags (see above)
@retval 0: unknown
@retval <0: no
@retval 1: yes

Reimplemented in processor_t.

◆ ev_is_sane_insn()

int ev_is_sane_insn ( self,
'insn_t const *' insn,
int no_crefs )
Is the instruction sane for the current file type?. 
  
@param insn: (const insn_t*) the instruction
@param 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.
@retval >=0: ok
@retval <0: no, the instruction isn't likely to appear in the program

Reimplemented in processor_t.

◆ ev_is_sp_based()

int ev_is_sp_based ( self,
'int *' mode,
'insn_t const *' insn,
'op_t const *' op )
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. Implement this event only if some stack references use frame pointer instead of stack pointer. 
  
@param mode: (int *) out, combination of SP/FP operand flags
@param insn: (const insn_t *)
@param op: (const op_t *)
@retval 0: not implemented
@retval 1: ok

Reimplemented in processor_t.

◆ ev_is_switch()

int ev_is_switch ( self,
'switch_info_t' si,
'insn_t const *' insn )
Find 'switch' idiom or override processor module's decision. It will be called for instructions marked with CF_JUMP. 
  
@param si: (switch_info_t *), out
@param insn: (const insn_t *) instruction possibly belonging to a switch
@retval 1: switch is found, 'si' is filled. IDA will create the switch using the filled 'si'
@retval -1: no switch found. This value forbids switch creation by the processor module
@retval 0: not implemented

Reimplemented in processor_t.

◆ ev_last_cb_before_loader()

int ev_last_cb_before_loader ( self)

◆ ev_loader()

int ev_loader ( self)
This code and higher ones are reserved for the loaders. The arguments and the return values are defined by the loaders 

◆ ev_lower_func_type()

int ev_lower_func_type ( self,
'intvec_t *' argnums,
'func_type_data_t' fti )
Get function arguments which should be converted to pointers when lowering function prototype. The processor module can also modify 'fti' in order to make non-standard conversion of some arguments. 
  
@param argnums: (intvec_t *), out - numbers of arguments to be converted to pointers in acsending order
@param fti: (func_type_data_t *), inout func type details
@retval 0: not implemented
@retval 1: argnums was filled
@retval 2: argnums was filled and made substantial changes to fti argnums[0] can contain a special negative value indicating that the return value should be passed as a hidden 'retstr' argument: -1 this argument is passed as the first one and the function returns a pointer to the argument, -2 this argument is passed as the last one and the function returns a pointer to the argument, -3 this argument is passed as the first one and the function returns 'void'.

◆ ev_max_ptr_size()

int ev_max_ptr_size ( self)
Get maximal size of a pointer in bytes. 
  
@returns max possible size of a pointer

◆ ev_may_be_func()

int ev_may_be_func ( self,
'insn_t const *' insn,
int state )
Can a function start here? 
  
@param insn: (const insn_t*) the instruction
@param state: (int) autoanalysis phase 0: creating functions 1: creating chunks
@returns probability 1..100

Reimplemented in processor_t.

◆ ev_may_show_sreg()

int ev_may_show_sreg ( self,
ida_idaapi.ea_t current_ea )
The kernel wants to display the segment registers in the messages window. 
  
@param current_ea: (::ea_t)
@retval <0: if the kernel should not show the segment registers. (assuming that the module has done it)
@retval 0: not implemented

Reimplemented in processor_t.

◆ ev_moving_segm()

int ev_moving_segm ( self,
'segment_t *' seg,
ida_idaapi.ea_t to,
int flags )
May the kernel move the segment? 
  
@param seg: (segment_t *) segment to move
@param to: (::ea_t) new segment start address
@param flags: (int) combination of Move segment flags
@retval 0: yes
@retval <0: the kernel should stop

Reimplemented in processor_t.

◆ ev_newasm()

int ev_newasm ( self,
int asmnum )
Before setting a new assembler. 
  
@param asmnum: (int) See also ev_asm_installed

◆ ev_newbinary()

int ev_newbinary ( self,
'char *' filename,
'qoff64_t' fileoff,
ida_idaapi.ea_t basepara,
ida_idaapi.ea_t binoff,
'uint64' nbytes )
IDA is about to load a binary file. 
  
@param filename: (char *) binary file name
@param fileoff: (qoff64_t) offset in the file
@param basepara: (::ea_t) base loading paragraph
@param binoff: (::ea_t) loader offset
@param nbytes: (::uint64) number of bytes to load

Reimplemented in processor_t.

◆ ev_newfile()

int ev_newfile ( self,
'char *' fname )
A new file has been loaded. 
  
@param fname: (char *) input file name

Reimplemented in _notify_when_dispatcher_t._IDP_Hooks, and processor_t.

◆ ev_newprc()

int ev_newprc ( self,
int pnum,
bool keep_cfg )
Before changing processor type. 
  
@param pnum: (int) processor number in the array of processor names
@param keep_cfg: (bool) true: do not modify kernel configuration
@retval 1: ok
@retval <0: prohibit

Reimplemented in processor_t.

◆ ev_next_exec_insn()

int ev_next_exec_insn ( self,
'ea_t *' target,
ida_idaapi.ea_t ea,
int tid,
'processor_t.regval_getter_t *' getreg,
'regval_t' regvalues )
Get next address to be executed This function must return the next address to be executed. If the instruction following the current one is executed, then it must return BADADDR Usually the instructions to consider are: jumps, branches, calls, returns. This function is essential if the 'single step' is not supported in hardware. 
  
@param target: (::ea_t *), out: pointer to the answer
@param ea: (::ea_t) instruction address
@param tid: (int) current therad id
@param getreg: (::processor_t::regval_getter_t *) function to get register values
@param regvalues: (const regval_t *) register values array
@retval 0: unimplemented
@retval 1: implemented

◆ ev_oldfile()

int ev_oldfile ( self,
'char *' fname )
An old file has been loaded. 
  
@param fname: (char *) input file name

Reimplemented in _notify_when_dispatcher_t._IDP_Hooks, and processor_t.

◆ ev_out_assumes()

int ev_out_assumes ( self,
'outctx_t *' outctx )
Function to produce assume directives when segment register value changes. 
  
@param outctx: (outctx_t *)
@retval 1: ok
@retval 0: not implemented

Reimplemented in processor_t.

◆ ev_out_data()

int ev_out_data ( self,
'outctx_t *' outctx,
bool analyze_only )
Generate text representation of data items This function may change the database and create cross-references if analyze_only is set 
  
@param outctx: (outctx_t *)
@param analyze_only: (bool)
@retval 1: ok
@retval 0: not implemented

Reimplemented in processor_t.

◆ ev_out_footer()

int ev_out_footer ( self,
'outctx_t *' outctx )
Function to produce end of disassembled text 
  
@param outctx: (outctx_t *)
@retval void: 

Reimplemented in processor_t.

◆ ev_out_header()

int ev_out_header ( self,
'outctx_t *' outctx )
Function to produce start of disassembled text 
  
@param outctx: (outctx_t *)
@retval void: 

Reimplemented in processor_t.

◆ ev_out_insn()

bool ev_out_insn ( self,
'outctx_t *' outctx )
Generate text representation of an instruction in 'ctx.insn' outctx_t provides functions to output the generated text. This function shouldn't change the database, flags or anything else. All these actions should be performed only by emu_insn() function. 
  
@param outctx: (outctx_t *)
@retval void: 

Reimplemented in processor_t.

◆ ev_out_label()

int ev_out_label ( self,
'outctx_t *' outctx,
str colored_name )
The kernel is going to generate an instruction label line or a function header. 
  
@param outctx: (outctx_t *)
@param colored_name: (const char *)
@retval <0: if the kernel should not generate the label
@retval 0: not implemented or continue

Reimplemented in processor_t.

◆ ev_out_mnem()

int ev_out_mnem ( self,
'outctx_t *' outctx )
Generate instruction mnemonics. This callback should append the colored mnemonics to ctx.outbuf Optional notification, if absent, out_mnem will be called. 
  
@param outctx: (outctx_t *)
@retval 1: if appended the mnemonics
@retval 0: not implemented

Reimplemented in processor_t.

◆ ev_out_operand()

bool ev_out_operand ( self,
'outctx_t *' outctx,
'op_t const *' op )
Generate text representation of an instruction operand outctx_t provides functions to output the generated text. All these actions should be performed only by emu_insn() function. 
  
@param outctx: (outctx_t *)
@param op: (const op_t *)
@retval 1: ok
@retval -1: operand is hidden

Reimplemented in processor_t.

◆ ev_out_segend()

int ev_out_segend ( self,
'outctx_t *' outctx,
'segment_t *' seg )
Function to produce end of segment 
  
@param outctx: (outctx_t *)
@param seg: (segment_t *)
@retval 1: ok
@retval 0: not implemented

Reimplemented in processor_t.

◆ ev_out_segstart()

int ev_out_segstart ( self,
'outctx_t *' outctx,
'segment_t *' seg )
Function to produce start of segment 
  
@param outctx: (outctx_t *)
@param seg: (segment_t *)
@retval 1: ok
@retval 0: not implemented

Reimplemented in processor_t.

◆ ev_out_special_item()

int ev_out_special_item ( self,
'outctx_t *' outctx,
'uchar' segtype )
Generate text representation of an item in a special segment i.e. absolute symbols, externs, communal definitions etc 
  
@param outctx: (outctx_t *)
@param segtype: (uchar)
@retval 1: ok
@retval 0: not implemented
@retval -1: overflow

Reimplemented in processor_t.

◆ ev_privrange_changed()

int ev_privrange_changed ( self,
'range_t' old_privrange,
'adiff_t' delta )
Privrange interval has been moved to a new location. Most common actions to be done by module in this case: fix indices of netnodes used by module 
  
@param old_privrange: (const range_t *) - old privrange interval
@param delta: (::adiff_t)
@retval 0: Ok
@retval -1: error (and message in errbuf)

◆ ev_realcvt()

int ev_realcvt ( self,
'void *' m,
'fpvalue_t *' e,
'uint16' swt )
Floating point -> IEEE conversion 
  
@param m: (void *) ptr to processor-specific floating point value
@param e: (fpvalue_t *) IDA representation of a floating point value
@param swt: (uint16) operation (see realcvt() in ieee.h)
@retval 0: not implemented

◆ ev_rename()

int ev_rename ( self,
ida_idaapi.ea_t ea,
str new_name )
The kernel is going to rename a byte. 
  
@param ea: (::ea_t)
@param new_name: (const char *)
@retval <0: if the kernel should not rename it.
@retval 2: to 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 in processor_t.

◆ ev_replaying_undo()

int ev_replaying_undo ( self,
str action_name,
'undo_records_t const *' vec,
bool is_undo )
Replaying an undo/redo buffer 
  
@param action_name: (const char *) action that we perform undo/redo for. may be nullptr for intermediary buffers.
@param vec: (const undo_records_t *)
@param is_undo: (bool) true if performing undo, false if performing redo This event may be generated multiple times per undo/redo

◆ ev_set_code16_mode()

int ev_set_code16_mode ( self,
ida_idaapi.ea_t ea,
bool code16 )
Some processors have ISA 16-bit mode e.g. ARM Thumb mode, PPC VLE, MIPS16 Set ISA 16-bit mode 
  
@param ea: (ea_t) address to set new ISA mode
@param code16: (bool) true for 16-bit mode, false for 32-bit mode

◆ ev_set_idp_options()

int ev_set_idp_options ( self,
str keyword,
int value_type,
'void const *' value,
bool idb_loaded )
Set IDP-specific configuration option Also see set_options_t in config.hpp 
  
@param keyword: (const char *)
@param value_type: (int)
@param value: (const void *)
@param idb_loaded: (bool) true if the ev_oldfile/ev_newfile events have been generated
@retval 1: ok
@retval 0: not implemented
@retval -1: error (and message in errbuf)

Reimplemented in processor_t.

◆ ev_set_proc_options()

int ev_set_proc_options ( self,
str options,
int confidence )
Called if the user specified an option string in the command line: -p<processor name>:<options>. Can be used for setting a processor subtype. Also called if option string is passed to set_processor_type() and IDC's SetProcessorType(). 
  
@param options: (const char *)
@param confidence: (int) 0: loader's suggestion 1: user's decision
@retval <0: if bad option string

Reimplemented in processor_t.

◆ ev_setup_til()

int ev_setup_til ( self)
Setup default type libraries. (called after loading a new file into the database). The processor module may load tils, setup memory model and perform other actions required to set up the type system. This is an optional callback. 
  
@retval void: 

◆ ev_str2reg()

int ev_str2reg ( self,
str regname )
Convert a register name to a register number. 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 
  
@param regname: (const char *)
@retval register: number + 1
@retval 0: not implemented or could not be decoded

Reimplemented in processor_t.

◆ ev_term()

int ev_term ( self)
The IDP module is being unloaded.

◆ ev_treat_hindering_item()

int ev_treat_hindering_item ( self,
ida_idaapi.ea_t hindering_item_ea,
'flags64_t' new_item_flags,
ida_idaapi.ea_t new_item_ea,
'asize_t' new_item_length )
An item hinders creation of another item. 
  
@param hindering_item_ea: (::ea_t)
@param new_item_flags: (flags64_t) (0 for code)
@param new_item_ea: (::ea_t)
@param new_item_length: (::asize_t)
@retval 0: no reaction
@retval !=0: the kernel may delete the hindering item

Reimplemented in processor_t.

◆ ev_undefine()

int ev_undefine ( self,
ida_idaapi.ea_t ea )
An item in the database (insn or data) is being deleted. 
  
@param ea: (ea_t)
@retval 1: do not delete srranges at the item end
@retval 0: srranges can be deleted

Reimplemented in processor_t.

◆ ev_update_call_stack()

int ev_update_call_stack ( self,
'call_stack_t' stack,
int tid,
'processor_t.regval_getter_t *' getreg,
'regval_t' regvalues )
Calculate the call stack trace for the given thread. This callback is invoked when the process is suspended and should fill the 'trace' object with the information about the current call stack. Note that this callback is NOT invoked if the current debugger backend implements stack tracing via debugger_t::event_t::ev_update_call_stack. The debugger-specific algorithm takes priority. Implementing this callback in the processor module is useful when multiple debugging platforms follow similar patterns, and thus the same processor-specific algorithm can be used for different platforms. 
  
@param stack: (call_stack_t *) result
@param tid: (int) thread id
@param getreg: (::processor_t::regval_getter_t *) function to get register values
@param regvalues: (const regval_t *) register values array
@retval 1: ok
@retval -1: failed
@retval 0: unimplemented

◆ ev_use_arg_types()

int ev_use_arg_types ( self,
ida_idaapi.ea_t ea,
'func_type_data_t' fti,
'funcargvec_t *' rargs )
Use information about callee arguments. 
  
@param ea: (::ea_t) address of the call instruction
@param fti: (func_type_data_t *) info about function type
@param rargs: (funcargvec_t *) array of register arguments
@retval 1: (and removes handled arguments from fti and rargs)
@retval 0: not implemented

◆ ev_use_regarg_type()

'PyObject *' ev_use_regarg_type ( self,
ida_idaapi.ea_t ea,
'funcargvec_t const *' rargs )
Use information about register argument. 
  
@param ea: (::ea_t) address of the instruction
@param rargs: (const funcargvec_t *) vector of register arguments (including regs extracted from scattered arguments)
@retval 1: 
@retval 0: not implemented

◆ ev_use_stkarg_type()

int ev_use_stkarg_type ( self,
ida_idaapi.ea_t ea,
'funcarg_t' arg )
Use information about a stack argument. 
  
@param ea: (::ea_t) address of the push instruction which pushes the function argument into the stack
@param arg: (const funcarg_t *) argument info
@retval 1: ok
@retval <=0: failed, the kernel will create a comment with the argument name or type for the instruction

◆ ev_validate_flirt_func()

int ev_validate_flirt_func ( self,
ida_idaapi.ea_t start_ea,
str funcname )
Flirt has recognized a library function. This callback can be used by a plugin or proc module to intercept it and validate such a function. 
  
@param start_ea: (::ea_t)
@param funcname: (const char *)
@retval -1: do not create a function,
@retval 0: function is validated

Reimplemented in processor_t.

◆ ev_verify_noreturn()

int ev_verify_noreturn ( self,
'func_t *' pfn )
The kernel wants to set 'noreturn' flags for a function. 
  
@param pfn: (func_t *)
@retval 0: ok. any other value: do not set 'noreturn' flag

Reimplemented in processor_t.

◆ ev_verify_sp()

int ev_verify_sp ( self,
'func_t *' pfn )
All function instructions have been analyzed. Now the processor module can analyze the stack pointer for the whole function 
  
@param pfn: (func_t *)
@retval 0: ok
@retval <0: bad stack pointer

Reimplemented in processor_t.

◆ hook()

bool hook ( self)

◆ unhook()

bool unhook ( self)

Property Documentation

◆ thisown

thisown
static
Initial value:
= property(lambda x: x.this.own(), lambda x, v: x.this.own(v),
doc='The membership flag')

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