vdui_t Struct Reference

Information about pseudocode window. More...

Public Member Functions

bool visible (void) const
 Is the pseudocode window visible? if not, it might be invisible or destroyed.
 
bool valid (void) const
 Does the pseudocode window contain valid code? It can become invalid if the function type gets changed in IDA. More...
 
bool locked (void) const
 Does the pseudocode window contain valid code? We lock windows before modifying them.
 
void set_visible (bool v)
 
void set_valid (bool v)
 
bool set_locked (bool v)
 
void __fastcall refresh_view (bool redo_mba)
 Refresh pseudocode window. More...
 
void __fastcall refresh_ctext (bool activate=true)
 Refresh pseudocode window. More...
 
void switch_to (cfuncptr_t f, bool activate)
 Display the specified pseudocode. More...
 
bool in_ctree (void) const
 Is the current item a statement? More...
 
cnumber_t *__fastcall get_number (void)
 Get current number. More...
 
int __fastcall get_current_label (void)
 Get current label. More...
 
void __fastcall clear (void)
 Clear the pseudocode window. More...
 
bool __fastcall refresh_cpos (input_device_t idv)
 Refresh the current position. More...
 
bool __fastcall get_current_item (input_device_t idv)
 Get current item. More...
 
bool __fastcall ui_rename_lvar (lvar_t *v)
 Rename local variable. More...
 
bool __fastcall rename_lvar (lvar_t *v, const char *name, bool is_user_name)
 Rename local variable. More...
 
bool __fastcall ui_set_call_type (const cexpr_t *e)
 Set type of a function call This function displays a dialog box and allows the user to change the type of a function call. More...
 
bool __fastcall ui_set_lvar_type (lvar_t *v)
 Set local variable type. More...
 
bool __fastcall set_lvar_type (lvar_t *v, const tinfo_t &type)
 Set local variable type. More...
 
bool __fastcall ui_edit_lvar_cmt (lvar_t *v)
 Set local variable comment. More...
 
bool __fastcall set_lvar_cmt (lvar_t *v, const char *cmt)
 Set local variable comment. More...
 
bool __fastcall ui_map_lvar (lvar_t *v)
 Map a local variable to another. More...
 
bool __fastcall ui_unmap_lvar (lvar_t *v)
 Unmap a local variable. More...
 
bool __fastcall map_lvar (lvar_t *from, lvar_t *to)
 Map a local variable to another. More...
 
bool __fastcall set_strmem_type (struc_t *sptr, member_t *mptr)
 Set structure field type. More...
 
bool __fastcall rename_strmem (struc_t *sptr, member_t *mptr)
 Rename structure field. More...
 
bool __fastcall set_global_type (ea_t ea)
 Set global item type. More...
 
bool __fastcall rename_global (ea_t ea)
 Rename global item. More...
 
bool __fastcall rename_label (int label)
 Rename a label. More...
 
bool __fastcall jump_enter (input_device_t idv, int omflags)
 Process the Enter key. More...
 
bool __fastcall ctree_to_disasm (void)
 Jump to disassembly. More...
 
cmt_type_t __fastcall calc_cmt_type (size_t lnnum, cmt_type_t cmttype) const
 Check if the specified line can have a comment. More...
 
bool __fastcall edit_cmt (const treeloc_t &loc)
 Edit an indented comment. More...
 
bool __fastcall edit_func_cmt (void)
 Edit a function comment. More...
 
bool __fastcall del_orphan_cmts (void)
 Delete all orphan comments. More...
 
bool __fastcall set_num_radix (int base)
 Change number base. More...
 
bool __fastcall set_num_enum (void)
 Convert number to symbolic constant. More...
 
bool __fastcall set_num_stroff (void)
 Convert number to structure field offset. More...
 
bool __fastcall invert_sign (void)
 Negate a number. More...
 
bool __fastcall invert_bits (void)
 Bitwise negate a number. More...
 
bool __fastcall collapse_item (bool hide)
 Collapse/uncollapse item. More...
 
bool __fastcall collapse_lvars (bool hide)
 Collapse/uncollapse local variable declarations. More...
 
bool __fastcall split_item (bool split)
 Split/unsplit item. More...
 

Public Attributes

int flags
 Properties of pseudocode window
 
int view_idx
 pseudocode window index (0..)
 
TWidgetct
 pseudocode view
 
TWidgettoplevel
 
mbl_array_tmba
 pointer to underlying microcode
 
cfuncptr_t cfunc
 pointer to function object
 
merror_t last_code
 result of the last user action. See Microcode error codes
 
ctext_position_t cpos
 Current ctext position.
 
ctree_item_t head
 First ctree item on the current line (for block comments)
 
ctree_item_t item
 Current ctree item.
 
ctree_item_t tail
 Tail ctree item on the current line (for indented comments)
 

Detailed Description

Information about pseudocode window.

Examples:
hexrays_sample3.cpp, and hexrays_sample5.cpp.

Definition at line 5020 of file hexrays.hpp.

Member Function Documentation

◆ calc_cmt_type()

cmt_type_t __fastcall vdui_t::calc_cmt_type ( size_t  lnnum,
cmt_type_t  cmttype 
) const

Check if the specified line can have a comment.

Due to the coordinate system for comments (http://hexblog.com/2007/08/coordinate_system_for_hexrays.html) some function lines can not have comments. This function checks if a comment can be attached to the specified line

Returns
possible comment types
Parameters
lnnumline number (0 based)
cmttypecomment types to check

Definition at line 9183 of file hexrays.hpp.

References hexdsp.

◆ clear()

void __fastcall vdui_t::clear ( void  )

Clear the pseudocode window.

It deletes the current function and microcode.

Definition at line 9063 of file hexrays.hpp.

References hexdsp.

◆ collapse_item()

bool __fastcall vdui_t::collapse_item ( bool  hide)

Collapse/uncollapse item.

This function collapses the current item.

Returns
false if failed.

Definition at line 9237 of file hexrays.hpp.

References hexdsp.

◆ collapse_lvars()

bool __fastcall vdui_t::collapse_lvars ( bool  hide)

Collapse/uncollapse local variable declarations.

Returns
false if failed.

Definition at line 9243 of file hexrays.hpp.

References hexdsp.

◆ ctree_to_disasm()

bool __fastcall vdui_t::ctree_to_disasm ( void  )

Jump to disassembly.

This function jumps to the address in the disassembly window which corresponds to the current item. The current item is determined based on the current keyboard cursor position.

Returns
false if failed

Definition at line 9177 of file hexrays.hpp.

References hexdsp.

◆ del_orphan_cmts()

bool __fastcall vdui_t::del_orphan_cmts ( void  )

Delete all orphan comments.

Delete all orphan comments and refresh the screen.

Returns
true

Definition at line 9201 of file hexrays.hpp.

References hexdsp.

◆ edit_cmt()

bool __fastcall vdui_t::edit_cmt ( const treeloc_t loc)

Edit an indented comment.

This function displays a dialog box and allows the user to edit the comment for the specified ctree location.

Returns
false if failed or cancelled
Parameters
loccomment location

Definition at line 9189 of file hexrays.hpp.

References hexdsp.

◆ edit_func_cmt()

bool __fastcall vdui_t::edit_func_cmt ( void  )

Edit a function comment.

This function displays a dialog box and allows the user to edit the function comment.

Returns
false if failed or cancelled

Definition at line 9195 of file hexrays.hpp.

References hexdsp.

◆ get_current_item()

bool __fastcall vdui_t::get_current_item ( input_device_t  idv)

Get current item.

This function refreshes the cpos, item, tail fields.

Returns
false if failed
Parameters
idvkeyboard or mouse
See also
cfunc_t::get_line_item()
Examples:
hexrays_sample5.cpp.

Definition at line 9075 of file hexrays.hpp.

References hexdsp.

◆ get_current_label()

int __fastcall vdui_t::get_current_label ( void  )

Get current label.

If there is a label under the cursor, return its number.

Returns
-1 if there is no label under the cursor. prereq: get_current_item() has been called

Definition at line 9057 of file hexrays.hpp.

References hexdsp.

◆ get_number()

cnumber_t *__fastcall vdui_t::get_number ( void  )

Get current number.

If the current item is a number, return pointer to it.

Returns
NULL if the current item is not a number

Definition at line 9051 of file hexrays.hpp.

References hexdsp.

◆ in_ctree()

bool vdui_t::in_ctree ( void  ) const

Is the current item a statement?

Returns
false if the cursor is in the local variable/type declaration area
true if the cursor is in the statement area

Definition at line 5086 of file hexrays.hpp.

References cfunc, cpos, and ctext_position_t::in_ctree().

◆ invert_bits()

bool __fastcall vdui_t::invert_bits ( void  )

Bitwise negate a number.

This function inverts all bits of the current number.

Returns
false if failed.

Definition at line 9231 of file hexrays.hpp.

References hexdsp.

◆ invert_sign()

bool __fastcall vdui_t::invert_sign ( void  )

Negate a number.

This function negates the current number.

Returns
false if failed.

Definition at line 9225 of file hexrays.hpp.

References hexdsp.

◆ jump_enter()

bool __fastcall vdui_t::jump_enter ( input_device_t  idv,
int  omflags 
)

Process the Enter key.

This function jumps to the definition of the item under the cursor. If the current item is a function, it will be decompiled. If the current item is a global data, its disassemly text will be displayed.

Returns
false if failed
Parameters
idvwhat cursor must be used, the keyboard or the mouse
omflagsOM_NEWWIN: new pseudocode window will open, 0: reuse the existing window

Definition at line 9171 of file hexrays.hpp.

References hexdsp.

◆ map_lvar()

bool __fastcall vdui_t::map_lvar ( lvar_t from,
lvar_t to 
)

Map a local variable to another.

This function permanently maps one lvar to another. All occurrences of the mapped variable are replaced by the new variable

Returns
false if failed
Parameters
fromthe variable being mapped
tothe variable to map to. if NULL, unmaps the variable

Definition at line 9135 of file hexrays.hpp.

References hexdsp.

◆ refresh_cpos()

bool __fastcall vdui_t::refresh_cpos ( input_device_t  idv)

Refresh the current position.

This function refreshes the cpos field.

Returns
false if failed
Parameters
idvkeyboard or mouse

Definition at line 9069 of file hexrays.hpp.

References hexdsp.

◆ refresh_ctext()

void __fastcall vdui_t::refresh_ctext ( bool  activate = true)

Refresh pseudocode window.

This function refreshes the pseudocode window by regenerating its text from cfunc_t. Use it after modifying cfunc_t from a plugin.

See also
refresh_view()
Examples:
hexrays_sample3.cpp.

Definition at line 9039 of file hexrays.hpp.

References hexdsp.

◆ refresh_view()

void __fastcall vdui_t::refresh_view ( bool  redo_mba)

Refresh pseudocode window.

This is the highest level refresh function. It causes the most profound refresh possible and can lead to redecompilation of the current function. Please consider using refresh_ctext() if you need a more superficial refresh.

Parameters
redo_mbatrue means to redecompile the current function
false means to rebuild ctree without regenerating microcode
See also
refresh_ctext()

Definition at line 9033 of file hexrays.hpp.

References hexdsp.

◆ rename_global()

bool __fastcall vdui_t::rename_global ( ea_t  ea)

Rename global item.

This function displays a dialog box and allows the user to rename a global item (data or function).

Returns
false if failed or cancelled
Parameters
eaaddress of the global item

Definition at line 9159 of file hexrays.hpp.

References hexdsp.

◆ rename_label()

bool __fastcall vdui_t::rename_label ( int  label)

Rename a label.

This function displays a dialog box and allows the user to rename a statement label.

Returns
false if failed or cancelled
Parameters
labellabel number

Definition at line 9165 of file hexrays.hpp.

References hexdsp.

◆ rename_lvar()

bool __fastcall vdui_t::rename_lvar ( lvar_t v,
const char *  name,
bool  is_user_name 
)

Rename local variable.

This function permanently renames a local variable.

Returns
false if failed
Parameters
vpointer to local variable
namenew variable name
is_user_nameuse true to save the new name into the database

Definition at line 9087 of file hexrays.hpp.

References hexdsp.

◆ rename_strmem()

bool __fastcall vdui_t::rename_strmem ( struc_t *  sptr,
member_t *  mptr 
)

Rename structure field.

This function displays a dialog box and allows the user to rename a structure field.

Returns
false if failed or cancelled
Parameters
sptrpointer to structure
mptrpointer to structure member

Definition at line 9147 of file hexrays.hpp.

References hexdsp.

◆ set_global_type()

bool __fastcall vdui_t::set_global_type ( ea_t  ea)

Set global item type.

This function displays a dialog box and allows the user to change the type of a global item (data or function).

Returns
false if failed or cancelled
Parameters
eaaddress of the global item

Definition at line 9153 of file hexrays.hpp.

References hexdsp.

◆ set_lvar_cmt()

bool __fastcall vdui_t::set_lvar_cmt ( lvar_t v,
const char *  cmt 
)

Set local variable comment.

This function permanently sets a variable comment.

Returns
false if failed
Parameters
vpointer to local variable
cmtnew comment

Definition at line 9117 of file hexrays.hpp.

References hexdsp.

◆ set_lvar_type()

bool __fastcall vdui_t::set_lvar_type ( lvar_t v,
const tinfo_t &  type 
)

Set local variable type.

This function permanently sets a local variable type.

Returns
false if failed
Parameters
vpointer to local variable
typenew variable type

Definition at line 9105 of file hexrays.hpp.

References hexdsp.

◆ set_num_enum()

bool __fastcall vdui_t::set_num_enum ( void  )

Convert number to symbolic constant.

This function displays a dialog box and allows the user to select a symbolic constant to represent the number.

Returns
false if failed or cancelled

Definition at line 9213 of file hexrays.hpp.

References hexdsp.

◆ set_num_radix()

bool __fastcall vdui_t::set_num_radix ( int  base)

Change number base.

This function changes the current number representation.

Returns
false if failed
Parameters
basenumber radix (10 or 16)
0 means a character constant

Definition at line 9207 of file hexrays.hpp.

References hexdsp.

◆ set_num_stroff()

bool __fastcall vdui_t::set_num_stroff ( void  )

Convert number to structure field offset.

Currently not implemented.

Returns
false if failed or cancelled

Definition at line 9219 of file hexrays.hpp.

References hexdsp.

◆ set_strmem_type()

bool __fastcall vdui_t::set_strmem_type ( struc_t *  sptr,
member_t *  mptr 
)

Set structure field type.

This function displays a dialog box and allows the user to change the type of a structure field.

Returns
false if failed or cancelled
Parameters
sptrpointer to structure
mptrpointer to structure member

Definition at line 9141 of file hexrays.hpp.

References hexdsp.

◆ split_item()

bool __fastcall vdui_t::split_item ( bool  split)

Split/unsplit item.

This function splits the current assignment expression.

Returns
false if failed.

Definition at line 9249 of file hexrays.hpp.

References hexdsp.

◆ switch_to()

void vdui_t::switch_to ( cfuncptr_t  f,
bool  activate 
)

Display the specified pseudocode.

This function replaces the pseudocode window contents with the specified cfunc_t.

Parameters
fpointer to the function to display.
activateshould the pseudocode window get focus?

Definition at line 9045 of file hexrays.hpp.

References hexdsp.

◆ ui_edit_lvar_cmt()

bool __fastcall vdui_t::ui_edit_lvar_cmt ( lvar_t v)

Set local variable comment.

This function displays a dialog box and allows the user to edit the comment of a local variable.

Returns
false if failed or cancelled
Parameters
vpointer to local variable

Definition at line 9111 of file hexrays.hpp.

References hexdsp.

◆ ui_map_lvar()

bool __fastcall vdui_t::ui_map_lvar ( lvar_t v)

Map a local variable to another.

This function displays a variable list and allows the user to select mapping.

Returns
false if failed or cancelled
Parameters
vpointer to local variable

Definition at line 9123 of file hexrays.hpp.

References hexdsp.

◆ ui_rename_lvar()

bool __fastcall vdui_t::ui_rename_lvar ( lvar_t v)

Rename local variable.

This function displays a dialog box and allows the user to rename a local variable.

Returns
false if failed or cancelled
Parameters
vpointer to local variable

Definition at line 9081 of file hexrays.hpp.

References hexdsp.

◆ ui_set_call_type()

bool __fastcall vdui_t::ui_set_call_type ( const cexpr_t e)

Set type of a function call This function displays a dialog box and allows the user to change the type of a function call.

Returns
false if failed or cancelled
Parameters
epointer to call expression

Definition at line 9093 of file hexrays.hpp.

References hexdsp.

◆ ui_set_lvar_type()

bool __fastcall vdui_t::ui_set_lvar_type ( lvar_t v)

Set local variable type.

This function displays a dialog box and allows the user to change the type of a local variable.

Returns
false if failed or cancelled
Parameters
vpointer to local variable

Definition at line 9099 of file hexrays.hpp.

References hexdsp.

◆ ui_unmap_lvar()

bool __fastcall vdui_t::ui_unmap_lvar ( lvar_t v)

Unmap a local variable.

This function displays list of variables mapped to the specified variable and allows the user to select a variable to unmap.

Returns
false if failed or cancelled
Parameters
vpointer to local variable

Definition at line 9129 of file hexrays.hpp.

References hexdsp.

◆ valid()

bool vdui_t::valid ( void  ) const

Does the pseudocode window contain valid code? It can become invalid if the function type gets changed in IDA.

Definition at line 5036 of file hexrays.hpp.

References flags, and VDUI_VALID.