IDAPython 8.4
Loading...
Searching...
No Matches
IDP_Hooks Class Reference

Proxy of C++ IDP_Hooks class.

Inheritance diagram for IDP_Hooks:
_notify_when_dispatcher_t._IDP_Hooks processor_t

Public Member Functions

 __init__ (self, *args)
 init(self, _flags=0, _hkcb_flags=0x0001) -> IDP_Hooks
 
"bool" hook (self, *args)
 hook(self) -> bool
 
"bool" unhook (self, *args)
 unhook(self) -> bool
 
"int" ev_init (self, *args)
 ev_init(self, idp_modname) -> int The IDP module is just loaded.
 
"int" ev_term (self, *args)
 ev_term(self) -> int The IDP module is being unloaded.
 
"int" ev_newprc (self, *args)
 ev_newprc(self, pnum, keep_cfg) -> int Before changing processor type.
 
"int" ev_newasm (self, *args)
 ev_newasm(self, asmnum) -> int Before setting a new assembler.
 
"int" ev_newfile (self, *args)
 ev_newfile(self, fname) -> int A new file has been loaded.
 
"int" ev_oldfile (self, *args)
 ev_oldfile(self, fname) -> int An old file has been loaded.
 
"int" ev_newbinary (self, *args)
 ev_newbinary(self, filename, fileoff, basepara, binoff, nbytes) -> int IDA is about to load a binary file.
 
"int" ev_endbinary (self, *args)
 ev_endbinary(self, ok) -> int IDA has loaded a binary file.
 
"int" ev_set_idp_options (self, *args)
 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
 
"int" 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>.
 
"bool" ev_ana_insn (self, *args)
 ev_ana_insn(self, out) -> bool Analyze one instruction and fill 'out' structure.
 
"bool" ev_emu_insn (self, *args)
 ev_emu_insn(self, insn) -> bool Emulate instruction, create cross-references, plan to analyze subsequent instructions, modify flags etc.
 
"int" ev_out_header (self, *args)
 ev_out_header(self, outctx) -> int Function to produce start of disassembled text
 
"int" ev_out_footer (self, *args)
 ev_out_footer(self, outctx) -> int Function to produce end of disassembled text
 
"int" ev_out_segstart (self, *args)
 ev_out_segstart(self, outctx, seg) -> int Function to produce start of segment
 
"int" ev_out_segend (self, *args)
 ev_out_segend(self, outctx, seg) -> int Function to produce end of segment
 
"int" ev_out_assumes (self, *args)
 ev_out_assumes(self, outctx) -> int Function to produce assume directives when segment register value changes.
 
"bool" 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.
 
"int" ev_out_mnem (self, *args)
 ev_out_mnem(self, outctx) -> int Generate instruction mnemonics.
 
"bool" 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.
 
"int" 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
 
"int" 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.
 
"int" 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.
 
"int" ev_gen_stkvar_def (self, *args)
 ev_gen_stkvar_def(self, outctx, mptr, v) -> 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_gen_regvar_def (self, *args)
 ev_gen_regvar_def(self, outctx, v) -> int Generate register variable definition line.
 
"int" ev_gen_src_file_lnnum (self, *args)
 ev_gen_src_file_lnnum(self, outctx, file, lnnum) -> int
 
"int" ev_creating_segm (self, *args)
 ev_creating_segm(self, seg) -> int A new segment is about to be created.
 
"int" ev_moving_segm (self, *args)
 ev_moving_segm(self, seg, to, flags) -> int May the kernel move the segment?
 
"int" ev_coagulate (self, *args)
 ev_coagulate(self, start_ea) -> int Try to define some unexplored bytes.
 
"int" ev_undefine (self, *args)
 ev_undefine(self, ea) -> int An item in the database (insn or data) is being deleted.
 
"int" 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.
 
"int" ev_rename (self, *args)
 ev_rename(self, ea, new_name) -> int The kernel is going to rename a byte.
 
"int" 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
 
"int" ev_is_sane_insn (self, *args)
 ev_is_sane_insn(self, insn, no_crefs) -> int Is the instruction sane for the current file type?.
 
"int" ev_is_cond_insn (self, *args)
 ev_is_cond_insn(self, insn) -> int Is conditional instruction?
 
"int" ev_is_call_insn (self, *args)
 ev_is_call_insn(self, insn) -> int Is the instruction a "call"?
 
"int" ev_is_ret_insn (self, *args)
 ev_is_ret_insn(self, insn, strict) -> int Is the instruction a "return"?
 
"int" ev_may_be_func (self, *args)
 ev_may_be_func(self, insn, state) -> int Can a function start here?
 
"int" 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?.
 
"int" ev_is_indirect_jump (self, *args)
 ev_is_indirect_jump(self, insn) -> int Determine if instruction is an indirect jump.
 
"int" ev_is_insn_table_jump (self, *args)
 ev_is_insn_table_jump(self) -> int Reserved.
 
"int" ev_is_switch (self, *args)
 ev_is_switch(self, si, insn) -> int Find 'switch' idiom or override processor module's decision.
 
"int" ev_calc_switch_cases (self, *args)
 ev_calc_switch_cases(self, casevec, targets, insn_ea, si) -> int Calculate case values and targets for a custom jump table.
 
"int" ev_create_switch_xrefs (self, *args)
 ev_create_switch_xrefs(self, jumpea, si) -> int Create xrefs for a custom jump table.
 
"int" ev_is_align_insn (self, *args)
 ev_is_align_insn(self, ea) -> int Is the instruction created only for alignment purposes?.
 
"int" ev_is_alloca_probe (self, *args)
 ev_is_alloca_probe(self, ea) -> int Does the function at 'ea' behave as __alloca_probe?
 
"PyObject *" ev_delay_slot_insn (self, *args)
 ev_delay_slot_insn(self, ea, bexec, fexec) -> PyObject * Get delay slot instruction
 
"int" ev_is_sp_based (self, *args)
 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.
 
"int" 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.
 
"int" ev_cmp_operands (self, *args)
 ev_cmp_operands(self, op1, op2) -> int Compare instruction operands
 
"int" ev_adjust_refinfo (self, *args)
 ev_adjust_refinfo(self, ri, ea, n, fd) -> int Called from apply_fixup before converting operand to reference.
 
"PyObject *" ev_get_operand_string (self, *args)
 ev_get_operand_string(self, insn, opnum) -> PyObject * Request text string for operand (cli, java, ...).
 
"PyObject *" ev_get_reg_name (self, *args)
 ev_get_reg_name(self, reg, width, reghi) -> PyObject * Generate text representation of a register.
 
"int" ev_str2reg (self, *args)
 ev_str2reg(self, regname) -> int Convert a register name to a register number.
 
"PyObject *" ev_get_autocmt (self, *args)
 ev_get_autocmt(self, insn) -> PyObject *
 
"int" ev_get_bg_color (self, *args)
 ev_get_bg_color(self, color, ea) -> int Get item background color.
 
"int" ev_is_jump_func (self, *args)
 ev_is_jump_func(self, pfn, jump_target, func_pointer) -> int Is the function a trivial "jump" function?.
 
"int" ev_func_bounds (self, *args)
 ev_func_bounds(self, possible_return_code, pfn, max_func_end_ea) -> int find_func_bounds() finished its work.
 
"int" ev_verify_sp (self, *args)
 ev_verify_sp(self, pfn) -> int All function instructions have been analyzed.
 
"int" ev_verify_noreturn (self, *args)
 ev_verify_noreturn(self, pfn) -> int The kernel wants to set 'noreturn' flags for a function.
 
"int" ev_create_func_frame (self, *args)
 ev_create_func_frame(self, pfn) -> int Create a function frame for a newly created function Set up frame size, its attributes etc
 
"int" ev_get_frame_retsize (self, *args)
 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
 
"int" ev_get_stkvar_scale_factor (self, *args)
 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, *args)
 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, *args)
 ev_add_cref(self, _from, to, type) -> int A code reference is being created.
 
"int" ev_add_dref (self, *args)
 ev_add_dref(self, _from, to, type) -> int A data reference is being created.
 
"int" ev_del_cref (self, *args)
 ev_del_cref(self, _from, to, expand) -> int A code reference is being deleted.
 
"int" ev_del_dref (self, *args)
 ev_del_dref(self, _from, to) -> int A data reference is being deleted.
 
"int" ev_coagulate_dref (self, *args)
 ev_coagulate_dref(self, _from, to, may_define, code_ea) -> int Data reference is being analyzed.
 
"int" 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.
 
"int" ev_auto_queue_empty (self, *args)
 ev_auto_queue_empty(self, type) -> int One analysis queue is empty.
 
"int" ev_validate_flirt_func (self, *args)
 ev_validate_flirt_func(self, start_ea, funcname) -> int Flirt has recognized a library function.
 
"int" ev_adjust_libfunc_ea (self, *args)
 ev_adjust_libfunc_ea(self, sig, libfun, ea) -> int Called when a signature module has been matched against bytes in the database.
 
"PyObject *" ev_assemble (self, *args)
 ev_assemble(self, ea, cs, ip, use32, line) -> PyObject * Assemble an instruction.
 
"int" ev_extract_address (self, *args)
 ev_extract_address(self, out_ea, screen_ea, string, position) -> int Extract address from a string.
 
"int" ev_realcvt (self, *args)
 ev_realcvt(self, m, e, swt) -> int Floating point -> IEEE conversion
 
"int" ev_gen_asm_or_lst (self, *args)
 ev_gen_asm_or_lst(self, starting, fp, is_asm, flags, outline) -> int
 
"int" ev_gen_map_file (self, *args)
 ev_gen_map_file(self, nlines, fp) -> int Generate map file.
 
"int" ev_create_flat_group (self, *args)
 ev_create_flat_group(self, image_base, bitness, dataseg_sel) -> int Create special segment representing the flat group.
 
"int" ev_getreg (self, *args)
 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, *args)
 ev_analyze_prolog(self, ea) -> int Analyzes function prolog, epilog, and updates purge, and function attributes
 
"int" ev_calc_spdelta (self, *args)
 ev_calc_spdelta(self, spdelta, insn) -> int Calculate amount of change to sp for the given insn.
 
"int" ev_calcrel (self, *args)
 ev_calcrel(self) -> int Reserved.
 
"PyObject *" ev_find_reg_value (self, *args)
 ev_find_reg_value(self, pinsn, reg) -> PyObject * Find register value via a register tracker.
 
"PyObject *" ev_find_op_value (self, *args)
 ev_find_op_value(self, pinsn, opn) -> PyObject * Find operand value via a register tracker.
 
"int" ev_replaying_undo (self, *args)
 ev_replaying_undo(self, action_name, vec, is_undo) -> int Replaying an undo/redo buffer
 
"int" ev_ending_undo (self, *args)
 ev_ending_undo(self, action_name, is_undo) -> int Ended undoing/redoing an action
 
"int" ev_set_code16_mode (self, *args)
 ev_set_code16_mode(self, ea, code16) -> int Some processors have ISA 16-bit mode e.g.
 
"int" ev_get_code16_mode (self, *args)
 ev_get_code16_mode(self, ea) -> int Get ISA 16-bit mode
 
"int" ev_get_procmod (self, *args)
 ev_get_procmod(self) -> int Get pointer to the processor module object.
 
"int" ev_asm_installed (self, *args)
 ev_asm_installed(self, asmnum) -> int After setting a new assembler
 
"int" ev_get_reg_accesses (self, *args)
 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, *args)
 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, *args)
 ev_create_merge_handlers(self, md) -> int Create merge handlers, if needed
 
"int" ev_privrange_changed (self, *args)
 ev_privrange_changed(self, old_privrange, delta) -> int Privrange interval has been moved to a new location.
 
"int" ev_cvt64_supval (self, *args)
 ev_cvt64_supval(self, node, tag, idx, data) -> int perform 32-64 conversion for a netnode array element
 
"int" ev_cvt64_hashval (self, *args)
 ev_cvt64_hashval(self, node, tag, name, data) -> int perform 32-64 conversion for a hash value
 
"int" ev_next_exec_insn (self, *args)
 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_step_over (self, *args)
 ev_calc_step_over(self, target, ip) -> int Calculate the address of the instruction which will be executed after "step over".
 
"int" ev_calc_next_eas (self, *args)
 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, *args)
 ev_get_macro_insn_head(self, head, ip) -> int Calculate the start of a macro instruction.
 
"int" ev_get_dbr_opnum (self, *args)
 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, *args)
 ev_insn_reads_tbit(self, insn, getreg, regvalues) -> int Check if insn will read the TF bit.
 
"int" ev_clean_tbit (self, *args)
 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, *args)
 ev_get_reg_info(self, main_regname, bitrange, regname) -> int Get register information by its name.
 
"int" ev_update_call_stack (self, *args)
 ev_update_call_stack(self, stack, tid, getreg, regvalues) -> int Calculate the call stack trace for the given thread.
 
"int" ev_setup_til (self, *args)
 ev_setup_til(self) -> int Setup default type libraries.
 
"int" ev_get_abi_info (self, *args)
 ev_get_abi_info(self, abi_names, abi_opts, 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, *args)
 ev_max_ptr_size(self) -> int Get maximal size of a pointer in bytes.
 
"int" ev_get_default_enum_size (self, *args)
 ev_get_default_enum_size(self) -> int Get default enum size.
 
"int" ev_get_cc_regs (self, *args)
 ev_get_cc_regs(self, regs, cc) -> int Get register allocation convention for given calling convention
 
"int" ev_get_simd_types (self, *args)
 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, *args)
 ev_calc_cdecl_purged_bytes(self, ea) -> int Calculate number of purged bytes after call.
 
"int" ev_calc_purged_bytes (self, *args)
 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, *args)
 ev_calc_retloc(self, retloc, rettype, cc) -> int Calculate return value location.
 
"int" ev_calc_arglocs (self, *args)
 ev_calc_arglocs(self, fti) -> int Calculate function argument locations.
 
"int" ev_calc_varglocs (self, *args)
 ev_calc_varglocs(self, ftd, aux_regs, aux_stkargs, nfixed) -> int Calculate locations of the arguments that correspond to '...'.
 
"int" ev_adjust_argloc (self, *args)
 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, *args)
 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, *args)
 ev_equal_reglocs(self, a1, a2) -> int Are 2 register arglocs the same?.
 
"int" ev_use_stkarg_type (self, *args)
 ev_use_stkarg_type(self, ea, arg) -> int Use information about a stack argument.
 
"PyObject *" ev_use_regarg_type (self, *args)
 ev_use_regarg_type(self, ea, rargs) -> PyObject * Use information about register argument.
 
"int" ev_use_arg_types (self, *args)
 ev_use_arg_types(self, ea, fti, rargs) -> int Use information about callee arguments.
 
"int" ev_arg_addrs_ready (self, *args)
 ev_arg_addrs_ready(self, caller, n, tif, addrs) -> int Argument address info is ready.
 
"PyObject *" ev_decorate_name (self, *args)
 ev_decorate_name(self, name, mangle, cc, optional_type) -> PyObject * Decorate/undecorate a C symbol name.
 
"int" ev_arch_changed (self, *args)
 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, *args)
 ev_get_stkarg_area_info(self, out, cc) -> int Get some metrics of the stack argument area.
 
"int" ev_last_cb_before_loader (self, *args)
 ev_last_cb_before_loader(self) -> int
 
"int" ev_loader (self, *args)
 ev_loader(self) -> int This code and higher ones are reserved for the loaders.
 
 __disown__ (self)
 

Properties

 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
 

Constructor & Destructor Documentation

◆ __init__()

__init__ ( self,
* args )
Parameters
_flagsuint32
_hkcb_flagsuint32

Reimplemented in _notify_when_dispatcher_t._IDP_Hooks, and processor_t.

Member Function Documentation

◆ __disown__()

__disown__ ( self)

◆ ev_add_cref()

"int" ev_add_cref ( self,
* args )
Parameters
from(::ea_t)
to(::ea_t)
type(cref_t)
Return values
<0cancel cref creation
0not implemented or continue

◆ ev_add_dref()

"int" ev_add_dref ( self,
* args )
Parameters
from(::ea_t)
to(::ea_t)
type(dref_t)
Return values
<0cancel dref creation
0not implemented or continue

◆ ev_adjust_argloc()

"int" ev_adjust_argloc ( self,
* args )
Parameters
argloc(argloc_t *), inout
type(const tinfo_t *), may be nullptr nullptr means primitive type of given size
size(int) 'size' makes no sense if type != nullptr (type->get_size() should be used instead)
Return values
0not implemented
1ok
-1error

◆ ev_adjust_libfunc_ea()

"int" ev_adjust_libfunc_ea ( self,
* args )

This is used to compute the offset at which a particular module's libfunc should be applied.

Parameters
sig(const idasgn_t *)
libfun(const libfunc_t *)
ea(::ea_t *)
Note
: 'ea' initially contains the ea_t of the start of the pattern match
Return values
1the ea_t pointed to by the third argument was modified.
<=0not modified. use default algorithm.

◆ ev_adjust_refinfo()

"int" ev_adjust_refinfo ( self,
* args )

Can be used for changing the reference info. (e.g. the PPC module adds REFINFO_NOBASE for some references)

Parameters
ri(refinfo_t *)
ea(::ea_t) instruction address
n(int) operand number
fd(const fixup_data_t *)
Return values
<0do not create an offset
0not implemented or refinfo adjusted

◆ ev_ana_insn()

"bool" ev_ana_insn ( self,
* args )

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 in processor_t.

◆ ev_analyze_prolog()

"int" ev_analyze_prolog ( self,
* args )
Parameters
ea(::ea_t) start of function
Return values
1ok
0not implemented

◆ ev_arch_changed()

"int" ev_arch_changed ( self,
* args )
Return values
1if success
0not implemented or failed

◆ ev_arg_addrs_ready()

"int" ev_arg_addrs_ready ( self,
* args )
Parameters
caller(::ea_t)
n(int) number of formal arguments
tif(tinfo_t *) call prototype
addrs(::ea_t *) argument intilization addresses
Return values
<0do not save into idb; other values mean "ok to save"

◆ ev_asm_installed()

"int" ev_asm_installed ( self,
* args )
Parameters
asmnum(int) See also ev_newasm

◆ ev_assemble()

"PyObject *" ev_assemble ( self,
* args )

(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 in processor_t.

◆ ev_auto_queue_empty()

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

Reimplemented in processor_t.

◆ ev_calc_arglocs()

"int" ev_calc_arglocs ( self,
* args )

This callback should fill retloc, all arglocs, and stkargs. This callback is never called for CM_CC_SPECIAL functions.

Parameters
fti(func_type_data_t *) points to the func type info
Return values
0not implemented
1ok
-1error

◆ ev_calc_cdecl_purged_bytes()

"int" ev_calc_cdecl_purged_bytes ( self,
* args )
Parameters
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,
* args )

This callback is required for source level debugging.

Parameters
res(eavec_t *), out: array for the results.
insn(const insn_t*) the instruction
over(bool) calculate for step over (ignore call targets)
Return values
<0incalculable (indirect jumps, for example)
>=0number 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,
* args )
Parameters
p_purged_bytes(int *) ptr to output
fti(const func_type_data_t *) func type details
Return values
1
0not implemented

◆ ev_calc_retloc()

"int" ev_calc_retloc ( self,
* args )
Parameters
retloc(argloc_t *)
rettype(const tinfo_t *)
cc(cm_t)
Return values
0not implemented
1ok,
-1error

◆ ev_calc_spdelta()

"int" ev_calc_spdelta ( self,
* args )

This event is required to decompile code snippets.

Parameters
spdelta(sval_t *)
insn(const insn_t *)
Return values
1ok
0not implemented

◆ ev_calc_step_over()

"int" ev_calc_step_over ( self,
* args )

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 in processor_t.

◆ ev_calc_switch_cases()

"int" ev_calc_switch_cases ( self,
* args )
Parameters
casevec(::casevec_t *) vector of case values (may be nullptr)
targets(eavec_t *) corresponding target addresses (my be nullptr)
insn_ea(::ea_t) address of the 'indirect jump' instruction
si(switch_info_t *) switch information
Return values
1ok
<=0failed

◆ ev_calc_varglocs()

"int" ev_calc_varglocs ( self,
* args )
Parameters
ftd(func_type_data_t *), inout: info about all arguments (including varargs)
aux_regs(regobjs_t *) buffer for hidden register arguments, may be nullptr
aux_stkargs(relobj_t *) buffer for hidden stack arguments, may be nullptr
nfixed(int) number of fixed arguments
Return values
0not implemented
1ok
-1error 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,
* args )

◆ ev_can_have_type()

"int" ev_can_have_type ( self,
* args )

see bytes.hpp for information about types and flags)

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

Reimplemented in processor_t.

◆ ev_clean_tbit()

"int" ev_clean_tbit ( self,
* args )
Parameters
ea(::ea_t) instruction address
getreg(::processor_t::regval_getter_t *) function to get register values
regvalues(const regval_t *) register values array
Return values
1ok
0failed

◆ ev_cmp_operands()

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

Reimplemented in processor_t.

◆ ev_coagulate()

"int" ev_coagulate ( self,
* args )

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 in processor_t.

◆ ev_coagulate_dref()

"int" ev_coagulate_dref ( self,
* args )

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 in processor_t.

◆ ev_create_flat_group()

"int" ev_create_flat_group ( self,
* args )
Parameters
image_base(::ea_t)
bitness(int)
dataseg_sel(::sel_t) return value is ignored

◆ ev_create_func_frame()

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

Reimplemented in processor_t.

◆ ev_create_merge_handlers()

"int" ev_create_merge_handlers ( self,
* args )
Parameters
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,
* args )
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 in processor_t.

◆ ev_creating_segm()

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

Reimplemented in processor_t.

◆ ev_cvt64_hashval()

"int" ev_cvt64_hashval ( self,
* args )
Parameters
node(::nodeidx_t)
tag(uchar)
name(const ::char *)
data(const uchar *)
Returns
: 0 nothing was done 1 converted successfully -1 error (and message in errbuf)

◆ ev_cvt64_supval()

"int" ev_cvt64_supval ( self,
* args )
Parameters
node(::nodeidx_t)
tag(uchar)
idx(::nodeidx_t)
data(const uchar *)
Returns
: 0 nothing was done 1 converted successfully -1 error (and message in errbuf)

◆ ev_decorate_name()

"PyObject *" ev_decorate_name ( self,
* args )
Parameters
name(const char *) name of symbol
mangle(bool) true-mangle, false-unmangle
cc(cm_t) calling convention
optional_typetinfo_t const *
Return values
1if success
0not implemented or failed

◆ ev_del_cref()

"int" ev_del_cref ( self,
* args )
Parameters
from(::ea_t)
to(::ea_t)
expand(bool)
Return values
<0cancel cref deletion
0not implemented or continue

◆ ev_del_dref()

"int" ev_del_dref ( self,
* args )
Parameters
from(::ea_t)
to(::ea_t)
Return values
<0cancel dref deletion
0not implemented or continue

◆ ev_delay_slot_insn()

"PyObject *" ev_delay_slot_insn ( self,
* args )
Parameters
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)
bexec(bool *) execute slot if jumping, initially set to 'true'
fexec(bool *) execute slot if not jumping, initally set to 'true'
Return values
1positive answer
<=0ordinary insn
Note
: Input EA may point to the instruction with a delay slot or to the delay slot instruction itself.

◆ ev_demangle_name()

"PyObject *" ev_demangle_name ( self,
* args )

This event is called by demangle_name()

Parameters
name(const char *) mangled name
disable_mask(uint32) flags to inhibit parts of output or compiler info/other (see MNG_)
demreq(demreq_type_t) operation to perform
Return values
1if success
0not implemented
Note
: if you call demangle_name() from the handler, protect against recursion!

◆ ev_emu_insn()

"bool" ev_emu_insn ( self,
* args )

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 in processor_t.

◆ ev_endbinary()

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

Reimplemented in processor_t.

◆ ev_ending_undo()

"int" ev_ending_undo ( self,
* args )
Parameters
action_name(const char *) action that we finished undoing/redoing. is not nullptr.
is_undo(bool) true if performing undo, false if performing redo

◆ ev_equal_reglocs()

"int" ev_equal_reglocs ( self,
* args )

We need this callback for the pc module.

Parameters
a1(argloc_t *)
a2(argloc_t *)
Return values
1yes
-1no
0not implemented

◆ ev_extract_address()

"int" ev_extract_address ( self,
* args )
Parameters
out_ea(ea_t *), out
screen_ea(ea_t)
string(const char *)
position(size_t)
Return values
1ok
0kernel should use the standard algorithm
-1error

◆ ev_find_op_value()

"PyObject *" ev_find_op_value ( self,
* args )

The returned value in 'out' is valid before executing the instruction.

Parameters
pinsn(const insn_t *) instruction
opn(int) operand index
Return values
1if implemented, and value was found
0not implemented, -1 decoding failed, or no value found

◆ ev_find_reg_value()

"PyObject *" ev_find_reg_value ( self,
* args )

The returned value in 'out' is valid before executing the instruction.

Parameters
pinsn(const insn_t *) instruction
reg(int) register index
Return values
1if implemented, and value was found
0not implemented, -1 decoding failed, or no value found

◆ ev_func_bounds()

"int" ev_func_bounds ( self,
* args )

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 in processor_t.

◆ ev_gen_asm_or_lst()

"int" ev_gen_asm_or_lst ( self,
* args )
Parameters
starting(bool) beginning listing generation
fp(FILE *) output file
is_asm(bool) true:assembler, false:listing
flags(int) flags passed to gen_file()
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
Return values
void

◆ ev_gen_map_file()

"int" ev_gen_map_file ( self,
* args )

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 in processor_t.

◆ ev_gen_regvar_def()

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

Reimplemented in processor_t.

◆ ev_gen_src_file_lnnum()

"int" ev_gen_src_file_lnnum ( self,
* args )
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 in processor_t.

◆ ev_gen_stkvar_def()

"int" ev_gen_stkvar_def ( self,
* args )
Parameters
outctx(outctx_t *)
mptr(const member_t *)
v(sval_t)
Return values
1ok
0not implemented

◆ ev_get_abi_info()

"int" ev_get_abi_info ( self,
* args )
Parameters
abi_names(qstrvec_t *) - all possible ABis each in form abiname- opt1-opt2-...
abi_opts(qstrvec_t *) - array of all possible options in form "opt:description" or opt:hint-line#description
comp(comp_t) - compiler ID
Return values
0not implemented
1ok

◆ ev_get_autocmt()

"PyObject *" ev_get_autocmt ( self,
* args )
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 in processor_t.

◆ ev_get_bg_color()

"int" ev_get_bg_color ( self,
* args )

Plugins can hook this callback to color disassembly lines dynamically

Parameters
color(bgcolor_t *), out
ea(::ea_t)
Return values
0not implemented
1color set

◆ ev_get_cc_regs()

"int" ev_get_cc_regs ( self,
* args )
Parameters
regs(callregs_t *), out
cc(cm_t)
Return values
1
0not implemented

◆ ev_get_code16_mode()

"int" ev_get_code16_mode ( self,
* args )
Parameters
ea(ea_t) address to get the ISA mode
Return values
116-bit mode
0not implemented or 32-bit mode

◆ ev_get_dbr_opnum()

"int" ev_get_dbr_opnum ( self,
* args )
Parameters
opnum(int *) operand number (out, -1 means no such operand)
insn(const insn_t*) the instruction
Return values
0unimplemented
1implemented

◆ ev_get_default_enum_size()

"int" ev_get_default_enum_size ( self,
* args )

Not generated anymore. inf_get_cc_size_e() is used instead

◆ ev_get_frame_retsize()

"int" ev_get_frame_retsize ( self,
* args )
  • 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 in processor_t.

◆ ev_get_macro_insn_head()

"int" ev_get_macro_insn_head ( self,
* args )

This notification is called if IP points to the middle of an instruction

Parameters
head(::ea_t *), out: answer, BADADDR means normal instruction
ip(::ea_t) instruction address
Return values
0unimplemented
1implemented

◆ ev_get_operand_string()

"PyObject *" ev_get_operand_string ( self,
* args )
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 in processor_t.

◆ ev_get_procmod()

"int" ev_get_procmod ( self,
* args )

All processor modules must implement this. The pointer is returned as size_t.

◆ ev_get_reg_accesses()

"int" ev_get_reg_accesses ( self,
* args )
Parameters
accvec(reg_accesses_t*) out: info about accessed registers
insn(const insn_t *) instruction in question
flags(int) reserved, must be 0
Return values
-1if accvec is nullptr
1found the requested access (and filled accvec)
0not implemented

◆ ev_get_reg_info()

"int" ev_get_reg_info ( self,
* args )

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

Parameters
main_regname(const char **), out
bitrange(bitrange_t *), out: position and size of the value within 'main_regname' (empty bitrange == whole register)
regname(const char *)
Return values
1ok
-1failed (not found)
0unimplemented

◆ ev_get_reg_name()

"PyObject *" ev_get_reg_name ( self,
* args )

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.

Parameters
reg(int) internal register number as defined in the processor module
width(size_t) register width in bytes
reghi(int) if not -1 then this function will return the register pair
Return values
-1if error
strlen(buf)if success

◆ ev_get_simd_types()

"int" ev_get_simd_types ( self,
* args )
Parameters
out(::simd_info_vec_t *)
simd_attrs(const simd_info_t *), may be nullptr
argloc(const argloc_t *), may be nullptr
create_tifs(bool) return valid tinfo_t objects, create if neccessary
Return values
numberof found types
-1error If name==nullptr, initialize all SIMD types

◆ ev_get_stkarg_area_info()

"int" ev_get_stkarg_area_info ( self,
* args )
Parameters
out(stkarg_area_info_t *) ptr to stkarg_area_info_t
cc(cm_t) calling convention
Return values
1if success
0not implemented

◆ ev_get_stkvar_scale_factor()

"int" ev_get_stkvar_scale_factor ( self,
* args )

Currently used by TMS320C55 because the references into the stack should be multiplied by 2

Returns
: scaling factor
Return values
0not implemented
Note
: PR_SCALE_STKVARS should be set to use this callback

◆ ev_getreg()

"int" ev_getreg ( self,
* args )
Parameters
regval(uval_t *), out
regnum(int)
Return values
1ok
0not implemented
-1failed (undefined value or bad regnum)

◆ ev_init()

"int" ev_init ( self,
* args )
Parameters
idp_modname(const char *) processor module name
Return values
<0on failure

◆ ev_insn_reads_tbit()

"int" ev_insn_reads_tbit ( self,
* args )
Parameters
insn(const insn_t*) the instruction
getreg(::processor_t::regval_getter_t *) function to get register values
regvalues(const regval_t *) register values array
Return values
2yes, will generate 'step' exception
1yes, will store the TF bit in memory
0no

◆ ev_is_align_insn()

"int" ev_is_align_insn ( self,
* args )

Do not directly call this function, use is_align_insn()

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

Reimplemented in processor_t.

◆ ev_is_alloca_probe()

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

Reimplemented in processor_t.

◆ ev_is_basic_block_end()

"int" ev_is_basic_block_end ( self,
* args )

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 in processor_t.

◆ ev_is_call_insn()

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

Reimplemented in processor_t.

◆ ev_is_cond_insn()

"int" ev_is_cond_insn ( self,
* args )
Parameters
insn(const insn_t *) instruction address
Return values
1yes
-1no
0not implemented or not instruction

◆ ev_is_control_flow_guard()

"int" ev_is_control_flow_guard ( self,
* args )
Parameters
p_reg(int *) indirect register number, may be -1
insn(const insn_t *) call/jump instruction
Return values
-1no thunk detected
1indirect call
2security check routine call (NOP)
3return thunk
0not implemented

◆ ev_is_far_jump()

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

Reimplemented in processor_t.

◆ ev_is_indirect_jump()

"int" ev_is_indirect_jump ( self,
* args )

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 in processor_t.

◆ ev_is_insn_table_jump()

"int" ev_is_insn_table_jump ( self,
* args )

Reimplemented in processor_t.

◆ ev_is_jump_func()

"int" ev_is_jump_func ( self,
* args )
Parameters
pfn(func_t *)
jump_target(::ea_t *)
func_pointer(::ea_t *)
Return values
<0no
0don't know
1yes, see 'jump_target' and 'func_pointer'

◆ ev_is_ret_insn()

"int" ev_is_ret_insn ( self,
* args )
Parameters
insn(const insn_t *) instruction
strict(bool) 1: report only ret instructions 0: include instructions like "leave" which begins the function epilog
Return values
0unknown
<0no
1yes

Reimplemented in processor_t.

◆ ev_is_sane_insn()

"int" ev_is_sane_insn ( self,
* args )
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 in processor_t.

◆ ev_is_sp_based()

"int" ev_is_sp_based ( self,
* args )

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 in processor_t.

◆ ev_is_switch()

"int" ev_is_switch ( self,
* args )

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 in processor_t.

◆ ev_last_cb_before_loader()

"int" ev_last_cb_before_loader ( self,
* args )

◆ ev_loader()

"int" ev_loader ( self,
* args )

The arguments and the return values are defined by the loaders

◆ ev_lower_func_type()

"int" ev_lower_func_type ( self,
* args )

The processor module can also modify 'fti' in order to make non-standard conversion of some arguments.

Parameters
argnums(intvec_t *), out - numbers of arguments to be converted to pointers in acsending order
fti(func_type_data_t *), inout func type details (special values -1/-2 for return value - position of hidden 'retstr' argument: -1 - at the beginning, -2 - at the end)
Return values
0not implemented
1argnums was filled
2argnums was filled and made substantial changes to fti

◆ ev_max_ptr_size()

"int" ev_max_ptr_size ( self,
* args )
Returns
: max possible size of a pointer

◆ ev_may_be_func()

"int" ev_may_be_func ( self,
* args )
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 in processor_t.

◆ ev_may_show_sreg()

"int" ev_may_show_sreg ( self,
* args )
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 in processor_t.

◆ ev_moving_segm()

"int" ev_moving_segm ( self,
* args )
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 in processor_t.

◆ ev_newasm()

"int" ev_newasm ( self,
* args )
Parameters
asmnum(int) See also ev_asm_installed

◆ ev_newbinary()

"int" ev_newbinary ( self,
* args )
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 in processor_t.

◆ ev_newfile()

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

Reimplemented in _notify_when_dispatcher_t._IDP_Hooks, and processor_t.

◆ ev_newprc()

"int" ev_newprc ( self,
* args )
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 in processor_t.

◆ ev_next_exec_insn()

"int" ev_next_exec_insn ( self,
* args )

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.

Parameters
target(::ea_t *), out: pointer to the answer
ea(::ea_t) instruction address
tid(int) current therad id
getreg(::processor_t::regval_getter_t *) function to get register values
regvalues(const regval_t *) register values array
Return values
0unimplemented
1implemented

◆ ev_oldfile()

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

Reimplemented in _notify_when_dispatcher_t._IDP_Hooks, and processor_t.

◆ ev_out_assumes()

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

Reimplemented in processor_t.

◆ ev_out_data()

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

Reimplemented in processor_t.

◆ ev_out_footer()

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

Reimplemented in processor_t.

◆ ev_out_header()

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

Reimplemented in processor_t.

◆ ev_out_insn()

"bool" ev_out_insn ( self,
* args )

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 in processor_t.

◆ ev_out_label()

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

Reimplemented in processor_t.

◆ ev_out_mnem()

"int" ev_out_mnem ( self,
* args )

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 in processor_t.

◆ ev_out_operand()

"bool" ev_out_operand ( self,
* args )

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 in processor_t.

◆ ev_out_segend()

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

Reimplemented in processor_t.

◆ ev_out_segstart()

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

Reimplemented in processor_t.

◆ ev_out_special_item()

"int" ev_out_special_item ( self,
* args )

absolute symbols, externs, communal definitions etc

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

Reimplemented in processor_t.

◆ ev_privrange_changed()

"int" ev_privrange_changed ( self,
* args )

Most common actions to be done by module in this case: fix indices of netnodes used by module

Parameters
old_privrange(const range_t *) - old privrange interval
delta(::adiff_t)
Returns
: 0 Ok -1 error (and message in errbuf)

◆ ev_realcvt()

"int" ev_realcvt ( self,
* args )
Parameters
m(void *) ptr to processor-specific floating point value
e(fpvalue_t *) IDA representation of a floating point value
swt(uint16) operation (see realcvt() in ieee.h)
Return values
0not implemented
1ok
unknown

◆ ev_rename()

"int" ev_rename ( self,
* args )
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 in processor_t.

◆ ev_replaying_undo()

"int" ev_replaying_undo ( self,
* args )
Parameters
action_name(const char *) action that we perform undo/redo for. may be nullptr for intermediary buffers.
vec(const undo_records_t *)
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,
* args )

ARM Thumb mode, PPC VLE, MIPS16 Set ISA 16-bit mode

Parameters
ea(ea_t) address to set new ISA mode
code16(bool) true for 16-bit mode, false for 32-bit mode

◆ ev_set_idp_options()

"int" ev_set_idp_options ( self,
* args )
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 in processor_t.

◆ ev_set_proc_options()

"int" ev_set_proc_options ( self,
* args )

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 in processor_t.

◆ ev_setup_til()

"int" ev_setup_til ( self,
* args )

(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.

Return values
void

◆ ev_str2reg()

"int" ev_str2reg ( self,
* args )

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 in processor_t.

◆ ev_term()

"int" ev_term ( self,
* args )

◆ ev_treat_hindering_item()

"int" ev_treat_hindering_item ( self,
* args )
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 in processor_t.

◆ ev_undefine()

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

Reimplemented in processor_t.

◆ ev_update_call_stack()

"int" ev_update_call_stack ( self,
* args )

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.

Parameters
stack(call_stack_t *) result
tid(int) thread id
getreg(::processor_t::regval_getter_t *) function to get register values
regvalues(const regval_t *) register values array
Return values
1ok
-1failed
0unimplemented

◆ ev_use_arg_types()

"int" ev_use_arg_types ( self,
* args )
Parameters
ea(::ea_t) address of the call instruction
fti(func_type_data_t *) info about function type
rargs(funcargvec_t *) array of register arguments
Return values
1(and removes handled arguments from fti and rargs)
0not implemented

◆ ev_use_regarg_type()

"PyObject *" ev_use_regarg_type ( self,
* args )
Parameters
ea(::ea_t) address of the instruction
rargs(const funcargvec_t *) vector of register arguments (including regs extracted from scattered arguments)
Return values
1
0not implemented

◆ ev_use_stkarg_type()

"int" ev_use_stkarg_type ( self,
* args )
Parameters
ea(::ea_t) address of the push instruction which pushes the function argument into the stack
arg(const funcarg_t *) argument info
Return values
1ok
<=0failed, 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,
* args )

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 in processor_t.

◆ ev_verify_noreturn()

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

Reimplemented in processor_t.

◆ ev_verify_sp()

"int" ev_verify_sp ( self,
* args )

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

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

Reimplemented in processor_t.

◆ hook()

"bool" hook ( self,
* args )

◆ unhook()

"bool" unhook ( self,
* args )

Property Documentation

◆ thisown

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

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