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

Class IDP_Hooks

object --+
         |
        IDP_Hooks

Proxy of C++ IDP_Hooks class

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

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

__repr__(self)
(Representation operator)

 

repr(x)

Overrides: object.__repr__
(inherited documentation)

hook(self)

 

Creates an IDP hook

Returns: bool
Boolean true on success

unhook(self)

 

Removes the IDP hook

Returns: bool
Boolean true on success

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_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_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_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

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_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_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_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_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

__init__(self)
(Constructor)

 

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

Returns: IDP_Hooks
Overrides: object.__init__

Property Details

thisown

The membership flag

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