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

Public Member Functions

 __init__ (self, int _flags=0, int _hkcb_flags=1)
 
bool hook (self)
 
bool unhook (self)
 
int flowchart (self, 'qflow_chart_t' fc, 'mba_t' mba, 'bitset_t' reachable_blocks, int decomp_flags)
 
int stkpnts (self, 'mba_t' mba, 'stkpnts_t *' _sps)
 
int prolog (self, 'mba_t' mba, 'qflow_chart_t' fc, 'bitset_t' reachable_blocks, int decomp_flags)
 
int microcode (self, 'mba_t' mba)
 
int preoptimized (self, 'mba_t' mba)
 
int locopt (self, 'mba_t' mba)
 
int prealloc (self, 'mba_t' mba)
 
int glbopt (self, 'mba_t' mba)
 
int pre_structural (self, 'control_graph_t *' ct, 'cfunc_t' cfunc, 'simple_graph_t' g)
 
int structural (self, 'control_graph_t *' ct)
 
int maturity (self, 'cfunc_t' cfunc, 'ctree_maturity_t' new_maturity)
 
int interr (self, int errcode)
 
int combine (self, 'mblock_t' blk, 'minsn_t' insn)
 
int print_func (self, 'cfunc_t' cfunc, 'vc_printer_t' vp)
 
int func_printed (self, 'cfunc_t' cfunc)
 
int resolve_stkaddrs (self, 'mba_t' mba)
 
'PyObject *' build_callinfo (self, 'mblock_t' blk, 'tinfo_t' type)
 
int callinfo_built (self, 'mblock_t' blk)
 
int calls_done (self, 'mba_t' mba)
 
int begin_inlining (self, 'codegen_t' cdg, int decomp_flags)
 
int inlining_func (self, 'codegen_t' cdg, int blk, 'mba_ranges_t' mbr)
 
int inlined_func (self, 'codegen_t' cdg, int blk, 'mba_ranges_t' mbr, int i1, int i2)
 
int collect_warnings (self, 'cfunc_t' cfunc)
 
int open_pseudocode (self, 'vdui_t' vu)
 
int switch_pseudocode (self, 'vdui_t' vu)
 
int refresh_pseudocode (self, 'vdui_t' vu)
 
int close_pseudocode (self, 'vdui_t' vu)
 
int keyboard (self, 'vdui_t' vu, int key_code, int shift_state)
 
int right_click (self, 'vdui_t' vu)
 
int double_click (self, 'vdui_t' vu, int shift_state)
 
int curpos (self, 'vdui_t' vu)
 
'PyObject *' create_hint (self, 'vdui_t' vu)
 
int text_ready (self, 'vdui_t' vu)
 
int populating_popup (self, 'TWidget *' widget, 'TPopupMenu *' popup_handle, 'vdui_t' vu)
 
int lvar_name_changed (self, 'vdui_t' vu, 'lvar_t' v, str name, bool is_user_name)
 
int lvar_type_changed (self, 'vdui_t' vu, 'lvar_t' v, 'tinfo_t' tinfo)
 
int lvar_cmt_changed (self, 'vdui_t' vu, 'lvar_t' v, str cmt)
 
int lvar_mapping_changed (self, 'vdui_t' vu, 'lvar_t' frm, 'lvar_t' to)
 
int cmt_changed (self, 'cfunc_t' cfunc, 'treeloc_t' loc, str cmt)
 
 __disown__ (self)
 

Properties

 thisown
 

Constructor & Destructor Documentation

◆ __init__()

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

Member Function Documentation

◆ __disown__()

__disown__ ( self)

◆ begin_inlining()

int begin_inlining ( self,
'codegen_t' cdg,
int decomp_flags )
Starting to inline outlined functions. 
  
@param cdg: (codegen_t *)
@param decomp_flags: (int)
@returns Microcode error codes code This is an opportunity to inline other ranges.

◆ build_callinfo()

'PyObject *' build_callinfo ( self,
'mblock_t' blk,
'tinfo_t' type )
Analyzing a call instruction. 
  
@param blk: (mblock_t *) blk->tail is the call.
@param type: (tinfo_t *) buffer for the output type.

◆ callinfo_built()

int callinfo_built ( self,
'mblock_t' blk )
A call instruction has been anallyzed. 
  
@param blk: (mblock_t *) blk->tail is the call.

◆ calls_done()

int calls_done ( self,
'mba_t' mba )
All calls have been analyzed. 
  
@param mba: (mba_t *) This event is generated immediately after analyzing all calls, before any optimizitions, call unmerging and block merging.

◆ close_pseudocode()

int close_pseudocode ( self,
'vdui_t' vu )
Pseudocode view is being closed. 
  
@param vu: (vdui_t *)

◆ cmt_changed()

int cmt_changed ( self,
'cfunc_t' cfunc,
'treeloc_t' loc,
str cmt )
Comment got changed. 
  
@param cfunc: (cfunc_t *)
@param loc: (const treeloc_t *)
@param cmt: (const char *)

◆ collect_warnings()

int collect_warnings ( self,
'cfunc_t' cfunc )
Collect warning messages from plugins. These warnings will be displayed at the function header, after the user-defined comments. 
  
@param cfunc: (cfunc_t *)

◆ combine()

int combine ( self,
'mblock_t' blk,
'minsn_t' insn )
Trying to combine instructions of basic block. 
  
@param blk: (mblock_t *)
@param insn: (minsn_t *) Should return: 1 if combined the current instruction with a preceding one -1 if the instruction should not be combined 0 else

◆ create_hint()

'PyObject *' create_hint ( self,
'vdui_t' vu )
Create a hint for the current item. 
  
@param vu: (vdui_t *)
@retval 0: continue collecting hints with other subscribers
@retval 1: stop collecting hints

◆ curpos()

int curpos ( self,
'vdui_t' vu )
Current cursor position has been changed. (for example, by left-clicking or using keyboard)

  
@param vu: (vdui_t *)

◆ double_click()

int double_click ( self,
'vdui_t' vu,
int shift_state )
Mouse double click. 
  
@param vu: (vdui_t *)
@param shift_state: (int) Should return: 1 if the event has been handled

◆ flowchart()

int flowchart ( self,
'qflow_chart_t' fc,
'mba_t' mba,
'bitset_t' reachable_blocks,
int decomp_flags )
Flowchart has been generated. 
  
@param fc: (qflow_chart_t *)
@param mba: (mba_t *)
@param reachable_blocks: (bitset_t *)
@param decomp_flags: (int)
@returns Microcode error codes code

◆ func_printed()

int func_printed ( self,
'cfunc_t' cfunc )
Function text has been generated. Plugins may modify the text in cfunc_t::sv. However, it is too late to modify the ctree or microcode. The text uses regular color codes (see lines.hpp) COLOR_ADDR is used to store pointers to ctree items. 
  
@param cfunc: (cfunc_t *)

◆ glbopt()

int glbopt ( self,
'mba_t' mba )
Global optimization has been finished. If microcode is modified, MERR_LOOP must be returned. It will cause a complete restart of the optimization. 
  
@param mba: (mba_t *)
@returns Microcode error codes code

◆ hook()

bool hook ( self)

◆ inlined_func()

int inlined_func ( self,
'codegen_t' cdg,
int blk,
'mba_ranges_t' mbr,
int i1,
int i2 )
A set of ranges got inlined. 
  
@param cdg: (codegen_t *)
@param blk: (int) the block containing call/jump to inline
@param mbr: (mba_ranges_t *) the range to inline
@param i1: (int) blknum of the first inlined block
@param i2: (int) blknum of the last inlined block (excluded)

◆ inlining_func()

int inlining_func ( self,
'codegen_t' cdg,
int blk,
'mba_ranges_t' mbr )
A set of ranges is going to be inlined. 
  
@param cdg: (codegen_t *)
@param blk: (int) the block containing call/jump to inline
@param mbr: (mba_ranges_t *) the range to inline

◆ interr()

int interr ( self,
int errcode )
Internal error has occurred. 
  
@param errcode: (int )

◆ keyboard()

int keyboard ( self,
'vdui_t' vu,
int key_code,
int shift_state )
Keyboard has been hit. 
  
@param vu: (vdui_t *)
@param key_code: (int) VK_...
@param shift_state: (int) Should return: 1 if the event has been handled

◆ locopt()

int locopt ( self,
'mba_t' mba )
Basic block level optimization has been finished. 
  
@param mba: (mba_t *)
@returns Microcode error codes code

◆ lvar_cmt_changed()

int lvar_cmt_changed ( self,
'vdui_t' vu,
'lvar_t' v,
str cmt )
Local variable comment got changed. 
  
@param vu: (vdui_t *)
@param v: (lvar_t *)
@param cmt: (const char *) Please note that it is possible to read/write user settings for lvars directly from the idb.

◆ lvar_mapping_changed()

int lvar_mapping_changed ( self,
'vdui_t' vu,
'lvar_t' frm,
'lvar_t' to )
Local variable mapping got changed. 
  
@param vu: (vdui_t *)
@param to: (lvar_t *) Please note that it is possible to read/write user settings for lvars directly from the idb.

◆ lvar_name_changed()

int lvar_name_changed ( self,
'vdui_t' vu,
'lvar_t' v,
str name,
bool is_user_name )
Local variable got renamed. 
  
@param vu: (vdui_t *)
@param v: (lvar_t *)
@param name: (const char *)
@param is_user_name: (bool) Please note that it is possible to read/write user settings for lvars directly from the idb.

◆ lvar_type_changed()

int lvar_type_changed ( self,
'vdui_t' vu,
'lvar_t' v,
'tinfo_t' tinfo )
Local variable type got changed. 
  
@param vu: (vdui_t *)
@param v: (lvar_t *)
@param tinfo: (const tinfo_t *) Please note that it is possible to read/write user settings for lvars directly from the idb.

◆ maturity()

int maturity ( self,
'cfunc_t' cfunc,
'ctree_maturity_t' new_maturity )
Ctree maturity level is being changed. 
  
@param cfunc: (cfunc_t *)
@param new_maturity: (ctree_maturity_t)

◆ microcode()

int microcode ( self,
'mba_t' mba )
Microcode has been generated. 
  
@param mba: (mba_t *)
@returns Microcode error codes code

◆ open_pseudocode()

int open_pseudocode ( self,
'vdui_t' vu )
New pseudocode view has been opened. 
  
@param vu: (vdui_t *)

◆ populating_popup()

int populating_popup ( self,
'TWidget *' widget,
'TPopupMenu *' popup_handle,
'vdui_t' vu )
Populating popup menu. We can add menu items now. 
  
@param widget: (TWidget *)
@param popup_handle: (TPopupMenu *)
@param vu: (vdui_t *)

◆ pre_structural()

int pre_structural ( self,
'control_graph_t *' ct,
'cfunc_t' cfunc,
'simple_graph_t' g )
Structure analysis is starting. 
  
@param ct: (control_graph_t *) in/out: control graph
@param cfunc: (cfunc_t *) in: the current function
@param g: (const simple_graph_t *) in: control flow graph
@returns Microcode error codes code; MERR_BLOCK means that the analysis has been performed by a plugin

◆ prealloc()

int prealloc ( self,
'mba_t' mba )
Local variables: preallocation step begins. 
  
@param mba: (mba_t *) This event may occur several times. Should return: 1 if modified microcode Negative values are Microcode error codes error codes

◆ preoptimized()

int preoptimized ( self,
'mba_t' mba )
Microcode has been preoptimized. 
  
@param mba: (mba_t *)
@returns Microcode error codes code

◆ print_func()

int print_func ( self,
'cfunc_t' cfunc,
'vc_printer_t' vp )
Printing ctree and generating text. 
  
@param cfunc: (cfunc_t *)
@param vp: (vc_printer_t *) Returns: 1 if text has been generated by the plugin It is forbidden to modify ctree at this event.

◆ prolog()

int prolog ( self,
'mba_t' mba,
'qflow_chart_t' fc,
'bitset_t' reachable_blocks,
int decomp_flags )
Prolog analysis has been finished. 
  
@param mba: (mba_t *)
@param fc: (qflow_chart_t *)
@param reachable_blocks: (const bitset_t *)
@param decomp_flags: (int)
@returns Microcode error codes code This event is generated for each inlined range as well.

◆ refresh_pseudocode()

int refresh_pseudocode ( self,
'vdui_t' vu )
Existing pseudocode text has been refreshed. Adding/removing pseudocode lines is forbidden in this event. 
  
@param vu: (vdui_t *) See also hxe_text_ready, which happens earlier

◆ resolve_stkaddrs()

int resolve_stkaddrs ( self,
'mba_t' mba )
The optimizer is about to resolve stack addresses. 
  
@param mba: (mba_t *)

◆ right_click()

int right_click ( self,
'vdui_t' vu )
Mouse right click. Use hxe_populating_popup instead, in case you want to add items in the popup menu. 
  
@param vu: (vdui_t *)

◆ stkpnts()

int stkpnts ( self,
'mba_t' mba,
'stkpnts_t *' _sps )
SP change points have been calculated. 
  
@param mba: (mba_t *)
@returns Microcode error codes code This event is generated for each inlined range as well.

◆ structural()

int structural ( self,
'control_graph_t *' ct )
Structural analysis has been finished. 
  
@param ct: (control_graph_t *)

◆ switch_pseudocode()

int switch_pseudocode ( self,
'vdui_t' vu )
Existing pseudocode view has been reloaded with a new function. Its text has not been refreshed yet, only cfunc and mba pointers are ready. 
  
@param vu: (vdui_t *)

◆ text_ready()

int text_ready ( self,
'vdui_t' vu )
Decompiled text is ready. 
  
@param vu: (vdui_t *) This event can be used to modify the output text (sv). Obsolete. Please use hxe_func_printed instead.

◆ 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: