IDAPython 9.0
Loading...
Searching...
No Matches
Hexrays_Hooks Class Reference

Proxy of C++ Hexrays_Hooks class.

Inheritance diagram for Hexrays_Hooks:

Public Member Functions

 __init__ (self, "uint32" _flags=0, "uint32" _hkcb_flags=0x0001)
 init(self, _flags=0, _hkcb_flags=0x0001) -> Hexrays_Hooks
 
"bool" hook (self)
 hook(self) -> bool
 
"bool" unhook (self)
 unhook(self) -> bool
 
"int" flowchart (self, "qflow_chart_t" fc, "mba_t" mba)
 flowchart(self, fc, mba) -> int Flowchart has been generated.
 
"int" stkpnts (self, "mba_t" mba, "stkpnts_t *" _sps)
 stkpnts(self, mba, _sps) -> int SP change points have been calculated.
 
"int" prolog (self, "mba_t" mba, "qflow_chart_t" fc, "bitset_t" reachable_blocks, "int" decomp_flags)
 prolog(self, mba, fc, reachable_blocks, decomp_flags) -> int Prolog analysis has been finished.
 
"int" microcode (self, "mba_t" mba)
 microcode(self, mba) -> int Microcode has been generated.
 
"int" preoptimized (self, "mba_t" mba)
 preoptimized(self, mba) -> int Microcode has been preoptimized.
 
"int" locopt (self, "mba_t" mba)
 locopt(self, mba) -> int Basic block level optimization has been finished.
 
"int" prealloc (self, "mba_t" mba)
 prealloc(self, mba) -> int Local variables: preallocation step begins.
 
"int" glbopt (self, "mba_t" mba)
 glbopt(self, mba) -> int Global optimization has been finished.
 
"int" pre_structural (self, "control_graph_t *" ct, "cfunc_t" cfunc, "simple_graph_t" g)
 pre_structural(self, ct, cfunc, g) -> int Structure analysis is starting.
 
"int" structural (self, "control_graph_t *" ct)
 structural(self, ct) -> int Structural analysis has been finished.
 
"int" maturity (self, "cfunc_t" cfunc, "ctree_maturity_t" new_maturity)
 maturity(self, cfunc, new_maturity) -> int Ctree maturity level is being changed.
 
"int" interr (self, "int" errcode)
 interr(self, errcode) -> int Internal error has occurred.
 
"int" combine (self, "mblock_t" blk, "minsn_t" insn)
 combine(self, blk, insn) -> int Trying to combine instructions of basic block.
 
"int" print_func (self, "cfunc_t" cfunc, "vc_printer_t" vp)
 print_func(self, cfunc, vp) -> int Printing ctree and generating text.
 
"int" func_printed (self, "cfunc_t" cfunc)
 func_printed(self, cfunc) -> int Function text has been generated.
 
"int" resolve_stkaddrs (self, "mba_t" mba)
 resolve_stkaddrs(self, mba) -> int The optimizer is about to resolve stack addresses.
 
"PyObject *" build_callinfo (self, "mblock_t" blk, "tinfo_t" type)
 build_callinfo(self, blk, type) -> PyObject * Analyzing a call instruction.
 
"int" callinfo_built (self, "mblock_t" blk)
 callinfo_built(self, blk) -> int A call instruction has been anallyzed.
 
"int" calls_done (self, "mba_t" mba)
 calls_done(self, mba) -> int All calls have been analyzed.
 
"int" begin_inlining (self, "codegen_t" cdg, "int" decomp_flags)
 begin_inlining(self, cdg, decomp_flags) -> int Starting to inline outlined functions.
 
"int" inlining_func (self, "codegen_t" cdg, "int" blk, "mba_ranges_t" mbr)
 inlining_func(self, cdg, blk, mbr) -> int A set of ranges is going to be inlined.
 
"int" inlined_func (self, "codegen_t" cdg, "int" blk, "mba_ranges_t" mbr, "int" i1, "int" i2)
 inlined_func(self, cdg, blk, mbr, i1, i2) -> int A set of ranges got inlined.
 
"int" collect_warnings (self, "cfunc_t" cfunc)
 collect_warnings(self, cfunc) -> int Collect warning messages from plugins.
 
"int" open_pseudocode (self, "vdui_t" vu)
 open_pseudocode(self, vu) -> int New pseudocode view has been opened.
 
"int" switch_pseudocode (self, "vdui_t" vu)
 switch_pseudocode(self, vu) -> int Existing pseudocode view has been reloaded with a new function.
 
"int" refresh_pseudocode (self, "vdui_t" vu)
 refresh_pseudocode(self, vu) -> int Existing pseudocode text has been refreshed.
 
"int" close_pseudocode (self, "vdui_t" vu)
 close_pseudocode(self, vu) -> int Pseudocode view is being closed.
 
"int" keyboard (self, "vdui_t" vu, "int" key_code, "int" shift_state)
 keyboard(self, vu, key_code, shift_state) -> int Keyboard has been hit.
 
"int" right_click (self, "vdui_t" vu)
 right_click(self, vu) -> int Mouse right click.
 
"int" double_click (self, "vdui_t" vu, "int" shift_state)
 double_click(self, vu, shift_state) -> int Mouse double click.
 
"int" curpos (self, "vdui_t" vu)
 curpos(self, vu) -> int Current cursor position has been changed.
 
"PyObject *" create_hint (self, "vdui_t" vu)
 create_hint(self, vu) -> PyObject * Create a hint for the current item.
 
"int" text_ready (self, "vdui_t" vu)
 text_ready(self, vu) -> int Decompiled text is ready.
 
"int" populating_popup (self, "TWidget *" widget, "TPopupMenu *" popup_handle, "vdui_t" vu)
 populating_popup(self, widget, popup_handle, vu) -> int Populating popup menu.
 
"int" lvar_name_changed (self, "vdui_t" vu, "lvar_t" v, "char const *" name, "bool" is_user_name)
 lvar_name_changed(self, vu, v, name, is_user_name) -> int Local variable got renamed.
 
"int" lvar_type_changed (self, "vdui_t" vu, "lvar_t" v, "tinfo_t" tinfo)
 lvar_type_changed(self, vu, v, tinfo) -> int Local variable type got changed.
 
"int" lvar_cmt_changed (self, "vdui_t" vu, "lvar_t" v, "char const *" cmt)
 lvar_cmt_changed(self, vu, v, cmt) -> int Local variable comment got changed.
 
"int" lvar_mapping_changed (self, "vdui_t" vu, "lvar_t" frm, "lvar_t" to)
 lvar_mapping_changed(self, vu, frm, to) -> int Local variable mapping got changed.
 
"int" cmt_changed (self, "cfunc_t" cfunc, "treeloc_t" loc, "char const *" cmt)
 cmt_changed(self, cfunc, loc, cmt) -> int Comment got changed.
 
 __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,
"uint32" _flags = 0,
"uint32" _hkcb_flags = 0x0001 )
Parameters
_flagsuint32
_hkcb_flagsuint32

Member Function Documentation

◆ __disown__()

__disown__ ( self)

◆ begin_inlining()

"int" begin_inlining ( self,
"codegen_t" cdg,
"int" decomp_flags )
Parameters
cdg(codegen_t *)
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 )
Parameters
blk(mblock_t *) blk->tail is the call.
type(tinfo_t *) buffer for the output type.

◆ callinfo_built()

"int" callinfo_built ( self,
"mblock_t" blk )
Parameters
blk(mblock_t *) blk->tail is the call.

◆ calls_done()

"int" calls_done ( self,
"mba_t" mba )
Parameters
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 )
Parameters
vu(vdui_t *)

◆ cmt_changed()

"int" cmt_changed ( self,
"cfunc_t" cfunc,
"treeloc_t" loc,
"char const *" cmt )
Parameters
cfunc(cfunc_t *)
loc(const treeloc_t *)
cmt(const char *)

◆ collect_warnings()

"int" collect_warnings ( self,
"cfunc_t" cfunc )

These warnings will be displayed at the function header, after the user-defined comments.

Parameters
cfunc(cfunc_t *)

◆ combine()

"int" combine ( self,
"mblock_t" blk,
"minsn_t" insn )
Parameters
blk(mblock_t *)
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 )
See also
: ui_get_custom_viewer_hint
Parameters
vu(vdui_t *)
Return values
0continue collecting hints with other subscribers
1stop collecting hints

◆ curpos()

"int" curpos ( self,
"vdui_t" vu )

(for example, by left-clicking or using keyboard)

Parameters
vu(vdui_t *)

◆ double_click()

"int" double_click ( self,
"vdui_t" vu,
"int" shift_state )
Parameters
vu(vdui_t *)
shift_state(int) Should return: 1 if the event has been handled

◆ flowchart()

"int" flowchart ( self,
"qflow_chart_t" fc,
"mba_t" mba )
Parameters
fc(qflow_chart_t *)
mba(mba_t *)

◆ func_printed()

"int" func_printed ( self,
"cfunc_t" cfunc )

Plugins may modify the text in cfunc_t::sv. The text uses regular color codes (see lines.hpp) COLOR_ADDR is used to store pointers to ctree items.

Parameters
cfunc(cfunc_t *)

◆ glbopt()

"int" glbopt ( self,
"mba_t" mba )

If microcode is modified, MERR_LOOP must be returned. It will cause a complete restart of the optimization.

Parameters
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 )
Parameters
cdg(codegen_t *)
blk(int) the block containing call/jump to inline
mbr(mba_ranges_t *) the range to inline
i1(int) blknum of the first inlined block
i2(int) blknum of the last inlined block (excluded)

◆ inlining_func()

"int" inlining_func ( self,
"codegen_t" cdg,
"int" blk,
"mba_ranges_t" mbr )
Parameters
cdg(codegen_t *)
blk(int) the block containing call/jump to inline
mbr(mba_ranges_t *) the range to inline

◆ interr()

"int" interr ( self,
"int" errcode )
Parameters
errcode(int )

◆ keyboard()

"int" keyboard ( self,
"vdui_t" vu,
"int" key_code,
"int" shift_state )
Parameters
vu(vdui_t *)
key_code(int) VK_...
shift_state(int) Should return: 1 if the event has been handled

◆ locopt()

"int" locopt ( self,
"mba_t" mba )
Parameters
mba(mba_t *)
Returns
: Microcode error codes code

◆ lvar_cmt_changed()

"int" lvar_cmt_changed ( self,
"vdui_t" vu,
"lvar_t" v,
"char const *" cmt )
Parameters
vu(vdui_t *)
v(lvar_t *)
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 )
Parameters
vu(vdui_t *)
fromlvar_t *
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,
"char const *" name,
"bool" is_user_name )
Parameters
vu(vdui_t *)
v(lvar_t *)
name(const char *)
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 )
Parameters
vu(vdui_t *)
v(lvar_t *)
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 )
Parameters
cfunc(cfunc_t *)
new_maturity(ctree_maturity_t)

◆ microcode()

"int" microcode ( self,
"mba_t" mba )
Parameters
mba(mba_t *)
Returns
: Microcode error codes code

◆ open_pseudocode()

"int" open_pseudocode ( self,
"vdui_t" vu )
Parameters
vu(vdui_t *)

◆ populating_popup()

"int" populating_popup ( self,
"TWidget *" widget,
"TPopupMenu *" popup_handle,
"vdui_t" vu )

We can add menu items now.

Parameters
widget(TWidget *)
popup_handle(TPopupMenu *)
vu(vdui_t *)

◆ pre_structural()

"int" pre_structural ( self,
"control_graph_t *" ct,
"cfunc_t" cfunc,
"simple_graph_t" g )
Parameters
ct(control_graph_t *) in/out: control graph
cfunc(cfunc_t *) in: the current function
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 )
Parameters
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 )
Parameters
mba(mba_t *)
Returns
: Microcode error codes code

◆ print_func()

"int" print_func ( self,
"cfunc_t" cfunc,
"vc_printer_t" vp )
Parameters
cfunc(cfunc_t *)
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 )
Parameters
mba(mba_t *)
fc(qflow_chart_t *)
reachable_blocks(bitset_t *)
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 )

Adding/removing pseudocode lines is forbidden in this event.

Parameters
vu(vdui_t *) See also hxe_text_ready, which happens earlier

◆ resolve_stkaddrs()

"int" resolve_stkaddrs ( self,
"mba_t" mba )
Parameters
mba(mba_t *)

◆ right_click()

"int" right_click ( self,
"vdui_t" vu )

Use hxe_populating_popup instead, in case you want to add items in the popup menu.

Parameters
vu(vdui_t *)

◆ stkpnts()

"int" stkpnts ( self,
"mba_t" mba,
"stkpnts_t *" _sps )
Parameters
mba(mba_t *)
_spsstkpnts_t *
Returns
: Microcode error codes code This event is generated for each inlined range as well.

◆ structural()

"int" structural ( self,
"control_graph_t *" ct )
Parameters
ct(control_graph_t *)

◆ switch_pseudocode()

"int" switch_pseudocode ( self,
"vdui_t" vu )

Its text has not been refreshed yet, only cfunc and mba pointers are ready.

Parameters
vu(vdui_t *)

◆ text_ready()

"int" text_ready ( self,
"vdui_t" vu )
Parameters
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 = 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: