Module ida_idp :: Class IDP_Hooks
[frames] | no frames]

Class IDP_Hooks

object --+
         |
        IDP_Hooks
Known Subclasses:

Proxy of C++ IDP_Hooks class.

Instance Methods
 
__disown__(self)
IDP_Hooks
__init__(self, _flags=0)
x.__init__(...) initializes x; see help(type(x)) for signature
 
__repr__(self)
repr(x)
 
__swig_destroy__(self)
int
ev_add_cref(self, _from, to, type)
int
ev_add_dref(self, _from, to, type)
int
ev_adjust_argloc(self, argloc, optional_type, size)
int
ev_adjust_libfunc_ea(self, sig, libfun, ea)
int
ev_adjust_refinfo(self, ri, ea, n, fd)
bool
ev_ana_insn(self, out)
Analyzes and decodes an instruction at insn.ea
int
ev_analyze_prolog(self, ea)
int
ev_arg_addrs_ready(self, caller, n, tif, addrs)
PyObject *
ev_assemble(self, ea, cs, ip, use32, line)
Assembles an instruction
 
ev_auto_queue_empty(self, type)
int
ev_calc_arglocs(self, fti)
int
ev_calc_cdecl_purged_bytes(self, ea)
int
ev_calc_next_eas(self, res, insn, over)
int
ev_calc_purged_bytes(self, p_purged_bytes, fti)
int
ev_calc_retloc(self, retloc, rettype, cc)
int
ev_calc_spdelta(self, spdelta, insn)
int
ev_calc_step_over(self, target, ip)
int
ev_calc_switch_cases(self, casevec, targets, insn_ea, si)
int
ev_calc_varglocs(self, ftd, aux_regs, aux_stkargs, nfixed)
int
ev_calcrel(self)
int
ev_can_have_type(self, op)
int
ev_clean_tbit(self, ea, getreg, regvalues)
int
ev_cmp_operands(self, op1, op2)
int
ev_coagulate(self, start_ea)
int
ev_coagulate_dref(self, _from, to, may_define, code_ea)
int
ev_create_flat_group(self, image_base, bitness, dataseg_sel)
int
ev_create_func_frame(self, pfn)
int
ev_create_switch_xrefs(self, jumpea, si)
int
ev_creating_segm(self, seg)
PyObject *
ev_decorate_name(self, name, mangle, cc, optional_type)
int
ev_del_cref(self, _from, to, expand)
int
ev_del_dref(self, _from, to)
PyObject *
ev_delay_slot_insn(self, ea, bexec, fexec)
PyObject *
ev_demangle_name(self, name, disable_mask, demreq)
bool
ev_emu_insn(self, insn)
Emulate instruction, create cross-references, plan to analyze subsequent instructions, modify flags etc.
int
ev_endbinary(self, ok)
int
ev_ending_undo(self, action_name, is_undo)
int
ev_equal_reglocs(self, a1, a2)
int
ev_extract_address(self, out_ea, screen_ea, string, position)
PyObject *
ev_find_op_value(self, pinsn, opn)
PyObject *
ev_find_reg_value(self, pinsn, reg)
 
ev_func_bounds(self, possible_return_code, pfn, max_func_end_ea)
 
ev_gen_asm_or_lst(self, starting, fp, is_asm, flags, outline)
int
ev_gen_map_file(self, nlines, fp)
int
ev_gen_regvar_def(self, outctx, v)
int
ev_gen_src_file_lnnum(self, outctx, file, lnnum)
int
ev_gen_stkvar_def(self, outctx, mptr, v)
int
ev_get_abi_info(self, abi_names, abi_opts, comp)
PyObject *
ev_get_autocmt(self, insn)
int or None
ev_get_bg_color(self, ea)
int
ev_get_cc_regs(self, regs, cc)
int
ev_get_code16_mode(self, ea)
int
ev_get_dbr_opnum(self, opnum, insn)
int
ev_get_default_enum_size(self, cm)
int
ev_get_frame_retsize(self, frsize, pfn)
int
ev_get_macro_insn_head(self, head, ip)
PyObject *
ev_get_operand_string(self, insn, opnum)
int
ev_get_reg_info(self, main_regname, bitrange, regname)
PyObject *
ev_get_reg_name(self, reg, width, reghi)
int
ev_get_simd_types(self, out, simd_attrs, argloc, create_tifs)
int
ev_get_stkarg_offset(self)
int
ev_get_stkvar_scale_factor(self)
int
ev_getreg(self, regval, regnum)
int
ev_init(self, idp_modname)
int
ev_insn_reads_tbit(self, insn, getreg, regvalues)
int
ev_is_align_insn(self, ea)
int
ev_is_alloca_probe(self, ea)
int
ev_is_basic_block_end(self, insn, call_insn_stops_block)
int
ev_is_call_insn(self, insn)
Is the instruction a "call"?
int
ev_is_cond_insn(self, insn)
int
ev_is_far_jump(self, icode)
int
ev_is_indirect_jump(self, insn)
int
ev_is_insn_table_jump(self, insn)
int
ev_is_jump_func(self, pfn, jump_target, func_pointer)
int
ev_is_ret_insn(self, insn, strict)
Is the instruction a "return"?
int
ev_is_sane_insn(self, insn, no_crefs)
is the instruction sane for the current file type?
int
ev_is_sp_based(self, mode, insn, op)
int
ev_is_switch(self, si, insn)
int
ev_last_cb_before_loader(self)
int
ev_loader(self)
int
ev_lower_func_type(self, argnums, fti)
int
ev_max_ptr_size(self)
int
ev_may_be_func(self, insn, state)
Can a function start here?
int
ev_may_show_sreg(self, current_ea)
int
ev_moving_segm(self, seg, to, flags)
int
ev_newasm(self, asmnum)
int
ev_newbinary(self, filename, fileoff, basepara, binoff, nbytes)
int
ev_newfile(self, fname)
int
ev_newprc(self, pnum, keep_cfg)
int
ev_next_exec_insn(self, target, ea, tid, getreg, regvalues)
int
ev_oldfile(self, fname)
int
ev_out_assumes(self, outctx)
int
ev_out_data(self, outctx, analyze_only)
 
ev_out_footer(self, outctx)
 
ev_out_header(self, outctx)
bool
ev_out_insn(self, outctx)
Outputs the instruction defined in 'ctx.insn'
int
ev_out_label(self, outctx, colored_name)
int
ev_out_mnem(self, outctx)
bool
ev_out_operand(self, outctx, op)
Notification to generate operand text.
int
ev_out_segend(self, outctx, seg)
int
ev_out_segstart(self, outctx, seg)
int
ev_out_special_item(self, outctx, segtype)
int
ev_realcvt(self, m, e, swt)
int
ev_rename(self, ea, new_name)
The kernel is going to rename a byte.
int
ev_replaying_undo(self, action_name, vec, is_undo)
int
ev_set_code16_mode(self, ea, code16)
int
ev_set_idp_options(self, keyword, value_type, value, errbuf, idb_loaded)
int
ev_set_proc_options(self, options, confidence)
 
ev_setup_til(self)
int
ev_shadow_args_size(self, shadow_args_size, pfn)
int
ev_str2reg(self, regname)
int
ev_term(self)
int
ev_treat_hindering_item(self, hindering_item_ea, new_item_flags, new_item_ea, new_item_length)
int
ev_undefine(self, ea)
An item in the database (insn or data) is being deleted
int
ev_use_arg_types(self, ea, fti, rargs)
PyObject *
ev_use_regarg_type(self, ea, rargs)
int
ev_use_stkarg_type(self, ea, arg)
int
ev_validate_flirt_func(self, start_ea, funcname)
int
ev_verify_noreturn(self, pfn)
int
ev_verify_sp(self, pfn)
bool
hook(self)
Creates an IDP hook
bool
unhook(self)
Removes the IDP hook

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties
  thisown
The membership flag

Inherited from object: __class__

Method Details

__init__(self, _flags=0)
(Constructor)

 

x.__init__(...) initializes x; see help(type(x)) for signature

Returns: IDP_Hooks
Overrides: object.__init__

__repr__(self)
(Representation operator)

 

repr(x)

Overrides: object.__repr__
(inherited documentation)

ev_ana_insn(self, out)

 

Analyzes and decodes an instruction at insn.ea

  • insn.itype must be set >= idaapi.CUSTOM_CMD_ITYPE
  • insn.size must be set to the instruction length
Returns: bool
Boolean
  • False if the instruction is not recognized
  • True if the instruction was decoded. 'insn' should be filled in that case.

ev_assemble(self, ea, cs, ip, use32, line)

 

Assembles an instruction

Parameters:
  • ea - linear address of instruction
  • cs - cs of instruction
  • ip - ip of instruction
  • use32 - is 32bit segment?
  • line - line to assemble
Returns: PyObject *
- None to let the underlying processor module assemble the line
  • or a string containing the assembled buffer

ev_emu_insn(self, 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.

Returns: bool
Boolean (whether this instruction has been emulated or not)

ev_is_call_insn(self, insn)

 

Is the instruction a "call"?

Parameters:
  • insn - instruction
Returns: int
0-unknown, 1-yes, -1-no

ev_is_ret_insn(self, insn, strict)

 

Is the instruction a "return"?

Parameters:
  • insn - instruction
  • strict - - True: report only ret instructions False: include instructions like "leave" which begins the function epilog
Returns: int
0-unknown, 1-yes, -1-no

ev_is_sane_insn(self, insn, no_crefs)

 

is the instruction sane for the current file type?

Parameters:
  • insn - the instruction
  • no_crefs -
    • 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.
Returns: int
>=0-ok, <0-no, the instruction isn't likely to appear in the program

ev_may_be_func(self, insn, state)

 

Can a function start here?

Parameters:
  • insn - the instruction
  • state - autoanalysis phase 0: creating functions 1: creating chunks
Returns: int
integer (probability 0..100)

ev_out_insn(self, outctx)

 

Outputs the instruction defined in 'ctx.insn'

Returns: bool
Boolean (whether this instruction can be outputted or not)

ev_out_operand(self, outctx, op)

 

Notification to generate operand text. If False was returned, then the standard operand output function will be called.

this notification may use out_...() functions to form the operand text

Returns: bool
Boolean (whether the operand has been outputted or not)

ev_rename(self, ea, new_name)

 

The kernel is going to rename a byte.

Parameters:
  • ea - Address
  • new_name - The new name
Returns: int
  • If returns value <0, then the kernel should not rename it. See also the 'renamed' event

ev_undefine(self, ea)

 

An item in the database (insn or data) is being deleted

Parameters:
  • ea - Address
Returns: int
  • 1 - do not delete srranges at the item end
  • 0 - srranges can be deleted

hook(self)

 

Creates an IDP hook

Returns: bool
Boolean true on success

unhook(self)

 

Removes the IDP hook

Returns: bool
Boolean true on success

Property Details

thisown

The membership flag

Get Method:
unreachable(x)
Set Method:
unreachable(x, v)