IDA C++ SDK 9.2
|
Information about the pseudocode window. More...
#include <hexrays.hpp>
Public Member Functions | |
bool | visible () const |
Is the pseudocode window visible? | |
bool | valid () const |
Does the pseudocode window contain valid code? | |
bool | locked () const |
Does the pseudocode window contain valid code? | |
void | set_visible (bool v) |
void | set_valid (bool v) |
bool hexapi | set_locked (bool v) |
vdui_t () | |
void hexapi | refresh_view (bool redo_mba) |
Refresh pseudocode window. | |
void hexapi | refresh_ctext (bool activate=true) |
Refresh pseudocode window. | |
void hexapi | switch_to (cfuncptr_t f, bool activate) |
Display the specified pseudocode. | |
bool | in_ctree () const |
Is the current item a statement? | |
cnumber_t *hexapi | get_number () |
Get current number. | |
int hexapi | get_current_label () |
Get current label. | |
void hexapi | clear () |
Clear the pseudocode window. | |
bool hexapi | refresh_cpos (input_device_t idv) |
Refresh the current position. | |
bool hexapi | get_current_item (input_device_t idv) |
Get current item. | |
bool hexapi | ui_rename_lvar (lvar_t *v) |
Rename local variable. | |
bool hexapi | rename_lvar (lvar_t *v, const char *name, bool is_user_name) |
Rename local variable. | |
bool hexapi | 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. | |
bool hexapi | ui_set_lvar_type (lvar_t *v) |
Set local variable type. | |
bool hexapi | set_lvar_type (lvar_t *v, const tinfo_t &type) |
Set local variable type. | |
bool hexapi | set_noptr_lvar (lvar_t *v) |
Inform that local variable should have a non-pointer type This function permanently sets a corresponding variable flag (NOPTR) and removes type if it was set before by function 'set_lvar_type'. | |
bool hexapi | ui_edit_lvar_cmt (lvar_t *v) |
Set local variable comment. | |
bool hexapi | set_lvar_cmt (lvar_t *v, const char *cmt) |
Set local variable comment. | |
bool hexapi | ui_map_lvar (lvar_t *v) |
Map a local variable to another. | |
bool hexapi | ui_unmap_lvar (lvar_t *v) |
Unmap a local variable. | |
bool hexapi | map_lvar (lvar_t *from, lvar_t *to) |
Map a local variable to another. | |
bool hexapi | set_udm_type (tinfo_t &udt_type, int udm_idx) |
Set structure field type. | |
bool hexapi | rename_udm (tinfo_t &udt_type, int udm_idx) |
Rename structure field. | |
bool hexapi | set_global_type (ea_t ea) |
Set global item type. | |
bool hexapi | rename_global (ea_t ea) |
Rename global item. | |
bool hexapi | rename_label (int label) |
Rename a label. | |
bool hexapi | jump_enter (input_device_t idv, int omflags) |
Process the Enter key. | |
bool hexapi | ctree_to_disasm () |
Jump to disassembly. | |
cmt_type_t hexapi | calc_cmt_type (size_t lnnum, cmt_type_t cmttype) const |
Check if the specified line can have a comment. | |
bool hexapi | edit_cmt (const treeloc_t &loc) |
Edit an indented comment. | |
bool hexapi | edit_func_cmt () |
Edit a function comment. | |
bool hexapi | del_orphan_cmts () |
Delete all orphan comments. | |
bool hexapi | set_num_radix (int base) |
Change number base. | |
bool hexapi | set_num_enum () |
Convert number to symbolic constant. | |
bool hexapi | set_num_stroff () |
Convert number to structure field offset. | |
bool hexapi | invert_sign () |
Negate a number. | |
bool hexapi | invert_bits () |
Bitwise negate a number. | |
bool hexapi | collapse_item (bool hide) |
Collapse/uncollapse item. | |
bool hexapi | collapse_lvars (bool hide) |
Collapse/uncollapse local variable declarations. | |
bool hexapi | split_item (bool split) |
Split/unsplit item. |
Public Attributes | |
int | flags = 0 |
Properties of pseudocode window | |
int | view_idx |
pseudocode window index (0..) | |
TWidget * | ct = nullptr |
pseudocode view | |
TWidget * | toplevel = nullptr |
mba_t * | mba |
pointer to underlying microcode | |
cfuncptr_t | cfunc |
pointer to function object | |
merror_t | last_code |
result of the last user action. See Microcode error code | |
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) |
Information about the pseudocode window.
vdui_t::vdui_t | ( | ) |
|
inline |
Is the pseudocode window visible?
if not, it might be invisible or destroyed
|
inline |
Does the pseudocode window contain valid code?
It can become invalid if the function type gets changed in IDA.
|
inline |
Does the pseudocode window contain valid code?
We lock windows before modifying them, to avoid recursion due to the events generated by the IDA kernel.
true | The window is locked and may have stale info |
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.
redo_mba | true means to redecompile the current function false means to rebuild ctree without regenerating microcode |
Refresh pseudocode window.
This function refreshes the pseudocode window by regenerating its text from cfunc_t. Instead of this function use refresh_func_ctext(), which refreshes all pseudocode windows for the function.
|
inline |
Display the specified pseudocode.
This function replaces the pseudocode window contents with the specified cfunc_t.
f | pointer to the function to display. |
activate | should the pseudocode window get focus? |
|
inline |
Is the current item a statement?
|
inline |
Get current number.
If the current item is a number, return pointer to it.
|
inline |
Get current label.
If there is a label under the cursor, return its number.
|
inline |
Clear the pseudocode window.
It deletes the current function and microcode.
|
inline |
Refresh the current position.
This function refreshes the cpos field.
idv | keyboard or mouse |
|
inline |
Get current item.
This function refreshes the cpos, item, tail fields.
idv | keyboard or mouse |
Rename local variable.
This function displays a dialog box and allows the user to rename a local variable.
v | pointer to local variable |
Rename local variable.
This function permanently renames a local variable.
v | pointer to local variable |
name | new variable name |
is_user_name | use true to save the new name into the database. use false to delete the saved name. |
Set type of a function call This function displays a dialog box and allows the user to change the type of a function call.
e | pointer to call expression |
Set local variable type.
This function displays a dialog box and allows the user to change the type of a local variable.
v | pointer to local variable |
Set local variable type.
This function permanently sets a local variable type and clears NOPTR flag if it was set before by function 'set_noptr_lvar'
v | pointer to local variable |
type | new variable type |
Inform that local variable should have a non-pointer type This function permanently sets a corresponding variable flag (NOPTR) and removes type if it was set before by function 'set_lvar_type'.
v | pointer to local variable |
Set local variable comment.
This function displays a dialog box and allows the user to edit the comment of a local variable.
v | pointer to local variable |
Set local variable comment.
This function permanently sets a variable comment.
v | pointer to local variable |
cmt | new comment |
Map a local variable to another.
This function displays a variable list and allows the user to select mapping.
v | pointer to local variable |
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.
v | pointer to local variable |
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
from | the variable being mapped |
to | the variable to map to. if nullptr, unmaps the variable |
Set structure field type.
This function displays a dialog box and allows the user to change the type of a structure field.
udt_type | structure/union type |
udm_idx | index of the structure/union member |
Rename structure field.
This function displays a dialog box and allows the user to rename a structure field.
udt_type | structure/union type |
udm_idx | index of the structure/union member |
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).
ea | address of the global item |
Rename global item.
This function displays a dialog box and allows the user to rename a global item (data or function).
ea | address of the global item |
|
inline |
Rename a label.
This function displays a dialog box and allows the user to rename a statement label.
label | label number |
|
inline |
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.
idv | what cursor must be used, the keyboard or the mouse |
omflags | OM_NEWWIN: new pseudocode window will open, 0: reuse the existing window |
|
inline |
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.
|
inline |
Check if the specified line can have a comment.
Due to the coordinate system for comments: (https://hex-rays.com/blog/coordinate-system-for-hex-rays) some function lines cannot have comments. This function checks if a comment can be attached to the specified line.
lnnum | line number (0 based) |
cmttype | comment types to check |
Edit an indented comment.
This function displays a dialog box and allows the user to edit the comment for the specified ctree location.
loc | comment location |
|
inline |
Edit a function comment.
This function displays a dialog box and allows the user to edit the function comment.
|
inline |
Delete all orphan comments.
Delete all orphan comments and refresh the screen.
|
inline |
Change number base.
This function changes the current number representation.
base | number radix (10 or 16) 0 means a character constant |
|
inline |
Convert number to symbolic constant.
This function displays a dialog box and allows the user to select a symbolic constant to represent the number.
|
inline |
Convert number to structure field offset.
Currently not implemented.
|
inline |
Negate a number.
This function negates the current number.
|
inline |
Bitwise negate a number.
This function inverts all bits of the current number.
Collapse/uncollapse item.
This function collapses the current item.
Collapse/uncollapse local variable declarations.
Split/unsplit item.
This function splits the current assignment expression.
int vdui_t::flags = 0 |
int vdui_t::view_idx |
pseudocode window index (0..)
TWidget* vdui_t::ct = nullptr |
pseudocode view
TWidget* vdui_t::toplevel = nullptr |
mba_t* vdui_t::mba |
pointer to underlying microcode
cfuncptr_t vdui_t::cfunc |
pointer to function object
merror_t vdui_t::last_code |
result of the last user action. See Microcode error code
ctext_position_t vdui_t::cpos |
Current ctext position.
ctree_item_t vdui_t::head |
First ctree item on the current line (for block comments)
ctree_item_t vdui_t::item |
Current ctree item.
ctree_item_t vdui_t::tail |
Tail ctree item on the current line (for indented comments)