Module ida_kernwin
[frames] | no frames]

Module ida_kernwin

IDA Plugin SDK API wrapper: kernwin

Classes
  jobj_wrapper_t
Proxy of C++ jobj_wrapper_t class
  UI_Hooks
Proxy of C++ UI_Hooks class
  disasm_line_t
Proxy of C++ disasm_line_t class
  place_t
Proxy of C++ place_t class
  simpleline_t
Proxy of C++ simpleline_t class
  simpleline_place_t
Proxy of C++ simpleline_place_t class
  idaplace_t
Proxy of C++ idaplace_t class
  enumplace_t
Proxy of C++ enumplace_t class
  structplace_t
Proxy of C++ structplace_t class
  sync_source_t
Proxy of C++ sync_source_t class
  twinpos_t
Proxy of C++ twinpos_t class
  chooser_item_attrs_t
Proxy of C++ chooser_item_attrs_t class
  renderer_pos_info_t
Proxy of C++ renderer_pos_info_t class
  view_mouse_event_location_t
Proxy of C++ view_mouse_event_location_t class
  view_mouse_event_t
Proxy of C++ view_mouse_event_t class
  ui_requests_t
Proxy of C++ ui_requests_t class
  action_ctx_base_t
Proxy of C++ action_ctx_base_t class
  action_desc_t
Proxy of C++ action_desc_t class
  addon_info_t
Proxy of C++ addon_info_t class
  strarray_t
Proxy of C++ strarray_t class
  disasm_text_t
Proxy of C++ qvector<(disasm_line_t)> class
  action_handler_t
  Choose
Chooser wrapper class.
  textctrl_info_t
Class representing textctrl_info_t
  Form
  cli_t
cli_t wrapper class.
  View_Hooks
Proxy of C++ View_Hooks class
  CustomIDAMemo
  IDAViewWrapper
Deprecated.
  simplecustviewer_t
The base class for implementing simple custom viewers
  PluginForm
PluginForm class.
Functions
 
refresh_choosers()
PyObject *
textctrl_info_t_create()
bool
textctrl_info_t_destroy(py_obj)
textctrl_info_t *
textctrl_info_t_get_clink(self)
PyObject *
textctrl_info_t_get_clink_ptr(self)
PyObject *
register_timer(interval, py_callback)
Register a timer
PyObject *
unregister_timer(py_timerctx)
Unregister a timer
PyObject *
choose_idasgn()
Opens the signature chooser
PyObject *
get_highlight(v)
Returns the currently highlighted identifier and flags
int
py_load_custom_icon_fn(filename)
int
py_load_custom_icon_data(data, format)
PyObject *
msg(o)
Display an UTF-8 string in the message window
PyObject *
ask_text(max_size, defval, prompt)
Asks for a long text
PyObject *
ask_str(defval, hist, prompt)
Asks for a long text
ea_t
str2ea(str, screenEA=BADADDR)
Converts a string express to EA.
bool
process_ui_action(name, flags=0)
Invokes an IDA UI action by name
bool
del_hotkey(pyctx)
Deletes a previously registered function hotkey
PyObject *
add_hotkey(hotkey, pyfunc)
Associates a function call with a hotkey.
PyObject *
take_database_snapshot(ss)
Take a database snapshot ( 'ui_take_database_snapshot' ).
 
py_ss_restore_callback(err_msg, userdata)
PyObject *
restore_database_snapshot(ss, pyfunc_or_none, pytuple_or_none)
Restore a database snapshot.
int
execute_sync(py_callable, reqf)
Executes a function in the context of the main thread.
bool
execute_ui_requests(py_list)
Inserts a list of callables into the UI message processing queue.
bool
register_action(desc)
Create a new action ( 'ui_register_action' ).
PyObject *
get_registered_actions()
Get a list of all currently-registered actions
bool
attach_dynamic_action_to_popup(widget, popup_handle, desc, popuppath=None, flags=0)
Create & insert an action into the widget's popup menu ( 'ui_attach_dynamic_action_to_popup' ).
 
gen_disasm_text(text, ea1, ea2, truncate_lines)
Generate disassembly text for a range.
PyObject *
set_nav_colorizer(new_py_colorizer)
Set a new colorizer for the navigation band.
uint32
call_nav_colorizer(dict, ea, nbytes)
To be used with the IDA-provided colorizer, that is returned as result of the first call to set_nav_colorizer().
PyObject *
msg_get_lines(count=-1)
Retrieve the last 'count' lines from the output window, in reverse order (from most recent, to least recent)
TWidget *
TWidget__from_ptrval__(ptrval)
PyObject *
add_spaces(s, len)
Add space characters to the colored string so that its length will be at least 'len' characters.
ssize_t
get_kernel_version()
Get IDA kernel version (in a string like "5.1").
idaplace_t
place_t_as_idaplace_t(p)
enumplace_t
place_t_as_enumplace_t(p)
structplace_t
place_t_as_structplace_t(p)
simpleline_place_t
place_t_as_simpleline_place_t(p)
int
internal_register_place_class(tmplate, flags, owner, sdk_version)
place_t
get_place_class(out_flags, out_sdk_version, id)
Get information about a previously-registered 'place_t' class.
place_t
get_place_class_template(id)
See 'get_place_class()'
bool
is_place_class_ea_capable(id)
See 'get_place_class()'
int
get_place_class_id(name)
Get the place class ID for the place that has been registered as 'name'.
 
request_refresh(mask, cnd=True)
Request a refresh of a builtin window.
 
clear_refresh_request(mask)
bool
is_refresh_requested(mask)
Get a refresh request state
bool
is_chooser_widget(t)
Does the given widget type specify a chooser widget?
bool
is_action_enabled(s)
Check if the given action state is one of AST_ENABLE*.
bool
cancel_exec_request(req_id)
Try to cancel an asynchronous exec request ( 'ui_cancel_exec_request' ).
bool
banner(wait)
Show a banner dialog box ( 'ui_banner' ).
bool
is_msg_inited()
Can we use msg() functions?
 
refresh_idaview()
Refresh marked windows ( 'ui_refreshmarked' )
 
refresh_idaview_anyway()
Refresh all disassembly views ( 'ui_refresh' ), forces an immediate refresh.
 
analyzer_options()
Allow the user to set analyzer options.
ea_t
get_screen_ea()
Get the address at the screen cursor ( 'ui_screenea' )
int
get_opnum()
Get current operand number, -1 means no operand ( 'ui_get_opnum' )
bool
get_cursor()
Get the cursor position on the screen ( 'ui_get_cursor' ).coordinates are 0-based
bool
get_output_cursor()
Get coordinates of the output window's cursor ( 'ui_get_output_cursor' ).coordinates are 0-basedthis function will succeed even if the output window is not visible
char const *
get_curline()
Get current line from the disassemble window ( 'ui_get_curline' ).
 
open_url(url)
Open the given url ( 'ui_open_url' )
ea_t
get_hexdump_ea(hexdump_num)
Get the current address in a hex view.
ushort
get_key_code(keyname)
Get keyboard key code by its name ( 'ui_get_key_code' )
ushort
lookup_key_code(key, shift, is_qt)
Get shortcut code previously created by 'ui_get_key_code' .
 
refresh_navband(force)
Refresh navigation band if changed ( 'ui_refresh_navband' ).
bool
refresh_chooser(title)
Mark a non-modal custom chooser for a refresh ( 'ui_refresh_chooser' ).
bool
close_chooser(title)
Close a non-modal chooser ( 'ui_close_chooser' ).
bool
set_dock_pos(src_ctrl, dest_ctrl, orient, left=0, top=0, right=0, bottom=0)
Sets the dock orientation of a window relatively to another window.
 
free_custom_icon(icon_id)
Frees an icon loaded with load_custom_icon()
bool
unregister_action(name)
Delete a previously-registered action ( 'ui_unregister_action' ).
bool
create_toolbar(name, label, before=None, flags=0)
Create a toolbar with the given name, label and optional position
bool
delete_toolbar(name)
Delete an existing toolbar
bool
create_menu(name, label, menupath=None)
Create a menu with the given name, label and optional position, either in the menubar, or as a submenu.
bool
delete_menu(name)
Delete an existing menu
bool
attach_action_to_menu(menupath, name, flags)
Attach a previously-registered action to the menu ( 'ui_attach_action_to_menu' ).You should not change top level menu, or the Edit,Plugins submenus If you want to modify the debugger menu, do it at the ui_debugger_menu_change event (ida might destroy your menu item if you do it elsewhere).
bool
detach_action_from_menu(menupath, name)
Detach an action from the menu ( 'ui_detach_action_from_menu' ).
bool
attach_action_to_toolbar(toolbar_name, name)
Attach an action to an existing toolbar ( 'ui_attach_action_to_toolbar' ).
bool
detach_action_from_toolbar(toolbar_name, name)
Detach an action from the toolbar ( 'ui_detach_action_from_toolbar' ).
bool
register_and_attach_to_menu(menupath, name, label, shortcut, flags, handler, owner)
Helper.You are not encouraged to use this, as it mixes flags for both 'register_action()' , and 'attach_action_to_menu()' .The only reason for its existence is to make it simpler to port existing plugins to the new actions API.
 
display_widget(widget, options, dest_ctrl=None)
Display a widget, dock it if not done before
 
close_widget(widget, options)
Close widget ( 'ui_close_widget' , only gui version).
 
activate_widget(widget, take_focus)
Activate widget (only gui version) ( 'ui_activate_widget' ).
TWidget *
find_widget(caption)
Find widget with the specified caption (only gui version) ( 'ui_find_widget' ).
TWidget *
get_current_widget()
Get a pointer to the current widget ( 'ui_get_current_widget' ).
twidget_type_t
get_widget_type(widget)
Get the type of the TWidget * ( 'ui_get_widget_type' ).
bool
get_widget_title(widget)
Get the TWidget's title ( 'ui_get_widget_title' ).
bool
custom_viewer_jump(v, loc, flags)
Append 'loc' to the viewer's history, and cause the viewer to display it.
bool
ea_viewer_history_push_and_jump(v, ea, x, y, lnnum)
Push current location in the history and jump to the given location ( 'ui_ea_viewer_history_push_and_jump' ).
bool
get_ea_viewer_history_info(nback, nfwd, v)
Get information about what's in the history ( 'ui_ea_viewer_history_info' ).
 
repaint_custom_viewer(custom_viewer)
Repaint the given widget immediately ( 'ui_repaint_qwidget' )
bool
jumpto(ea, opnum=-1, uijmp_flags=0x0001)
jumpto(custom_viewer, place, x, y) -> bool
place_t
get_custom_viewer_place(custom_viewer, mouse)
Get current place in a custom viewer ( 'ui_get_curplace' ).
bool
is_idaq()
Returns True or False depending if IDAPython is hosted by IDAQ
bool
attach_action_to_popup(widget, popup_handle, name, popuppath=None, flags=0)
Insert a previously-registered action into the widget's popup menu ( 'ui_attach_action_to_popup' ).
bool
detach_action_from_popup(widget, name)
Remove a previously-registered action, from the list of 'permanent' context menu actions for this widget ( 'ui_detach_action_from_popup' ).
bool
update_action_label(name, label)
Update an action's label ( 'ui_update_action_attr' ).
bool
update_action_shortcut(name, shortcut)
Update an action's shortcut ( 'ui_update_action_attr' ).
bool
update_action_tooltip(name, tooltip)
Update an action's tooltip ( 'ui_update_action_attr' ).
bool
update_action_icon(name, icon)
Update an action's icon ( 'ui_update_action_attr' ).
bool
update_action_state(name, state)
Update an action's state ( 'ui_update_action_attr' ).
bool
update_action_checkable(name, checkable)
Update an action's checkability ( 'ui_update_action_attr' ).
bool
update_action_checked(name, checked)
Update an action's checked state ( 'ui_update_action_attr' ).
bool
update_action_visibility(name, visible)
Update an action's visibility ( 'ui_update_action_attr' ).
bool
get_action_label(name)
Get an action's label ( 'ui_get_action_attr' ).
bool
get_action_shortcut(name)
Get an action's shortcut ( 'ui_get_action_attr' ).
bool
get_action_tooltip(name)
Get an action's tooltip ( 'ui_get_action_attr' ).
bool
get_action_icon(name)
Get an action's icon ( 'ui_get_action_attr' ).
bool
get_action_state(name)
Get an action's state ( 'ui_get_action_attr' ).
bool
get_action_checkable(name)
Get an action's checkability ( 'ui_get_action_attr' ).
bool
get_action_checked(name)
Get an action's checked state ( 'ui_get_action_attr' ).
bool
get_action_visibility(name)
Get an action's visibility ( 'ui_get_action_attr' ).
bool
set_custom_viewer_qt_aware(custom_viewer)
Allow the given viewer to interpret Qt events ( 'ui_set_custom_viewer_handler' )
char const *
get_custom_viewer_curline(custom_viewer, mouse)
Get current line of custom viewer ( 'ui_get_custom_viewer_curline' ).
bool
get_output_curline(mouse)
Get current line of output window ( 'ui_get_output_curline' ).
bool
get_output_selected_text()
Returns selected text from output window ( 'ui_get_output_selected_text' ).
TWidget *
get_current_viewer()
Get current ida viewer (idaview or custom viewer) ( 'ui_get_current_viewer' )
tcc_renderer_type_t
get_view_renderer_type(v)
Get the type of renderer currently in use in the given view ( 'ui_get_renderer_type' )
 
set_view_renderer_type(v, rt)
Set the type of renderer to use in a view ( 'ui_set_renderer_type' )
TWidget *
create_empty_widget(title, icon=-1)
Create an empty widget, serving as a container for custom user widgets
 
msg_clear()
Clear the "Output window".
bool
msg_save(path)
Save the "Output window" contents into a file
TWidget *
get_active_modal_widget()
Get the current, active modal TWidget instance.
int
get_navband_pixel(ea)
Maps an address, onto a pixel coordinate within the navband
ea_t
get_navband_ea(pixel)
Translate the pixel position on the navigation band, into an address.
void *
get_window_id(name=None)
Get the system-specific window ID (GUI version only)
bool
read_selection(v, p1, p2)
Read the user selection, and store its information in p0 (from) and p1 (to).
bool
read_range_selection(v)
Get the address range for the selected range boundaries, this is the convenient function for 'read_selection()'
 
unmark_selection()
Unmark selection ( 'ui_unmarksel' )
TWidget *
create_code_viewer(custview, flags=0, parent=None)
Create a code viewer ( 'ui_create_code_viewer' ).
void *
set_code_viewer_handler(code_viewer, handler_id, handler_or_data)
Set a handler for a code viewer event ( 'ui_set_custom_viewer_handler' ).
bool
set_code_viewer_user_data(code_viewer, ud)
Set the user data on a code viewer ( 'ui_set_custom_viewer_handler' ).
void *
get_viewer_user_data(viewer)
Get the user data from a custom viewer ( 'ui_get_viewer_user_data' )
tcc_place_type_t
get_viewer_place_type(viewer)
Get the type of 'place_t' instances a viewer uses & creates ( 'ui_get_viewer_place_type' ).
 
set_code_viewer_line_handlers(code_viewer, click_handler, popup_handler, dblclick_handler, drawicon_handler, linenum_handler)
Set handlers for code viewer line events.
bool
set_code_viewer_lines_icon_margin(code_viewer, margin)
Set space allowed for icons in the margin of a code viewer ( 'ui_set_custom_viewer_handler' ).
bool
set_code_viewer_lines_alignment(code_viewer, align)
Set alignment for lines in a code viewer ( 'ui_set_custom_viewer_handler' ).
bool
set_code_viewer_lines_radix(code_viewer, radix)
Set radix for values displayed in a code viewer ( 'ui_set_custom_viewer_handler' ).
bool
set_code_viewer_is_source(code_viewer)
Specify that the given code viewer is used to display source code ( 'ui_set_custom_viewer_handler' ).
int
get_tab_size(path)
Get the size of a tab in spaces ( 'ui_get_tab_size' ).
 
clr_cancelled()
Clear "Cancelled" flag ( 'ui_clr_cancelled' )
 
set_cancelled()
Set "Cancelled" flag ( 'ui_set_cancelled' )
bool
user_cancelled()
Test the ctrl-break flag ( 'ui_test_cancelled' ).
bool
ui_load_new_file(temp_file, filename, pli, neflags, ploaders)
Display a load file dialog and load file ( 'ui_load_file' ).
bool
ui_run_debugger(dbgopts, exename, argc, argv)
Load a debugger plugin and run the specified program ( 'ui_run_dbg' ).
bool
load_dbg_dbginfo(path, li=None, base=BADADDR, verbose=False)
Load debugging information from a file.
int
add_idc_hotkey(hotkey, idcfunc)
Add hotkey for IDC function ( 'ui_add_idckey' ).
bool
del_idc_hotkey(hotkey)
Delete IDC function hotkey ( 'ui_del_idckey' ).
 
get_user_strlist_options(out)
bool
set_highlight(viewer, str, flags)
Set the highlighted identifier in the viewer ( 'ui_set_highlight' ).
TWidget *
open_exports_window(ea)
Open the exports window ( 'ui_open_builtin' ).
TWidget *
open_imports_window(ea)
Open the exports window ( 'ui_open_builtin' ).
TWidget *
open_names_window(ea)
Open the names window ( 'ui_open_builtin' ).
TWidget *
open_funcs_window(ea)
Open the functions window ( 'ui_open_builtin' ).
TWidget *
open_strings_window(ea, selstart=BADADDR, selend=BADADDR)
Open the strings window ( 'ui_open_builtin' ).
TWidget *
open_segments_window(ea)
Open the segments window ( 'ui_open_builtin' ).
TWidget *
open_segregs_window(ea)
Open the segment registers window ( 'ui_open_builtin' ).
TWidget *
open_selectors_window()
Open the selectors window ( 'ui_open_builtin' ).
TWidget *
open_signatures_window()
Open the signatures window ( 'ui_open_builtin' ).
TWidget *
open_tils_window()
Open the type libraries window ( 'ui_open_builtin' ).
TWidget *
open_loctypes_window(ordinal)
Open the local types window ( 'ui_open_builtin' ).
TWidget *
open_calls_window(ea)
Open the function calls window ( 'ui_open_builtin' ).
TWidget *
open_problems_window(ea)
Open the problems window ( 'ui_open_builtin' ).
TWidget *
open_bpts_window(ea)
Open the breakpoints window ( 'ui_open_builtin' ).
TWidget *
open_threads_window()
Open the threads window ( 'ui_open_builtin' ).
TWidget *
open_modules_window()
Open the modules window ( 'ui_open_builtin' ).
TWidget *
open_trace_window()
Open the trace window ( 'ui_open_builtin' ).
TWidget *
open_stack_window()
Open the call stack window ( 'ui_open_builtin' ).
TWidget *
open_xrefs_window(ea)
Open the cross references window ( 'ui_open_builtin' ).
TWidget *
open_frame_window(pfn, offset)
Open the frame window for the given function ( 'ui_open_builtin' ).
TWidget *
open_navband_window(ea, zoom)
Open the navigation band window ( 'ui_open_builtin' ).
TWidget *
open_enums_window(const_id=BADADDR)
Open the enums window ( 'ui_open_builtin' ).
TWidget *
open_structs_window(id=BADADDR, offset=0)
Open the structs window ( 'ui_open_builtin' ).
TWidget *
open_disasm_window(window_title, ranges=None)
Open a disassembly view ( 'ui_open_builtin' ).
TWidget *
open_hexdump_window(window_title)
Open a hexdump view ( 'ui_open_builtin' ).
TWidget *
open_notepad_window()
Open the notepad window ( 'ui_open_builtin' ).
bool
sync_sources(what, with, sync)
[Un]synchronize sources
bool
choose_til()
Choose a type library ( 'ui_choose' , 'chtype_idatil' ).
ea_t
choose_entry(title)
Choose an entry point ( 'ui_choose' , 'chtype_entry' ).
ea_t
choose_name(title)
Choose a name ( 'ui_choose' , 'chtype_name' ).
ea_t
choose_stkvar_xref(pfn, mptr)
Choose an xref to a stack variable ( 'ui_choose' , 'chtype_name' ).
ea_t
choose_xref(to)
Choose an xref to an address ( 'ui_choose' , 'chtype_xref' ).
enum_t
choose_enum(title, default_id)
Choose an enum ( 'ui_choose' , 'chtype_enum' ).
enum_t
choose_enum_by_value(title, default_id, value, nbytes)
Choose an enum, restricted by value & size ( 'ui_choose' , 'chtype_enum_by_value_and_size' ).
func_t *
choose_func(title, default_ea)
Choose a function ( 'ui_choose' , 'chtype_func' ).
segment_t *
choose_segm(title, default_ea)
Choose a segment ( 'ui_choose' , 'chtype_segm' ).
struc_t *
choose_struc(title)
Choose a structure ( 'ui_choose' , 'chtype_segm' ).
sreg_range_t *
choose_srcp(title)
Choose a segment register change point ( 'ui_choose' , 'chtype_srcp' ).
void *
get_chooser_obj(chooser_caption)
Get the underlying object of the specified chooser ( 'ui_get_chooser_obj' ).This is object is chooser-specific.
bool
enable_chooser_item_attrs(chooser_caption, enable)
Enable item-specific attributes for chooser items ( 'ui_enable_chooser_item_attrs' ).
 
show_wait_box(format)
Display a dialog box with "Please wait...".
 
hide_wait_box()
Hide the "Please wait dialog box".
 
replace_wait_box(format)
Replace the label of "Please wait dialog box".
 
beep(beep_type=beep_default)
Issue a beeping sound ( 'ui_beep' ).
bool
display_copyright_warning()
Display copyright warning ( 'ui_copywarn' ).
 
ask_for_feedback(format)
Show a message box asking to send the input file [email protected] rays.com.
 
error(format)
Display a fatal message in a message box and quit IDA
 
warning(format)
Display a message in a message box
 
info(format)
 
nomem(format)
int
ask_yn(deflt, format)
Display a dialog box and get choice from "Yes", "No", "Cancel".
int
ask_buttons(Yes, No, Cancel, deflt, format)
Display a dialog box and get choice from maximum three possibilities ( 'ui_ask_buttons' ).for all buttons:use "" or NULL to take the default name for the button.use 'format' to hide the cancel button
char *
ask_file(for_saving, defval, format)
int
register_addon(info)
Register an add-on.
int
addon_count()
Get number of installed addons.
bool
get_addon_info(id, info)
Get info about a registered addon with a given product code.
bool
get_addon_info_idx(index, info)
Get info about a registered addon with specific index.
ssize_t
qcleanline(cmt_char='', flags=((1 << 0)|(1 << 1))|(1 << 2))
Performs some cleanup operations to a line.
char const *
strarray(array, array_size, code)
Find a line with the specified code in the 'strarray_t' array.
size_t
ea2str(ea)
Convert linear address to UTF-8 string.
 
load_custom_icon(file_name=None, data=None, format=None)
Loads a custom icon and returns an identifier that can be used with other APIs
 
ask_long(defval, format)
 
ask_addr(defval, format)
 
ask_seg(defval, format)
 
ask_ident(defval, format)
PyObject *
choose_find(title)
 
choose_refresh(self)
 
choose_close(self)
TWidget *
choose_get_widget(self)
int
choose_choose(self)
 
choose_activate(self)
uint64
choose_create_embedded_chobj(self)
PyObject *
get_chooser_data(chooser_caption, n)
Get the text corresponding to the index N in the chooser data.
bool
textctrl_info_t_assign(self, other)
bool
textctrl_info_t_set_text(self, s)
char const *
textctrl_info_t_get_text(self)
bool
textctrl_info_t_set_flags(self, flags)
unsigned int
textctrl_info_t_get_flags(self)
bool
textctrl_info_t_set_tabsize(self, tabsize)
unsigned int
textctrl_info_t_get_tabsize(self)
bool
formchgcbfa_enable_field(p_fa, fid, enable)
bool
formchgcbfa_show_field(p_fa, fid, show)
bool
formchgcbfa_move_field(p_fa, fid, x, y, w, h)
int
formchgcbfa_get_focused_field(p_fa)
bool
formchgcbfa_set_focused_field(p_fa, fid)
 
formchgcbfa_refresh_field(p_fa, fid)
 
formchgcbfa_close(p_fa, close_normally)
PyObject *
formchgcbfa_get_field_value(p_fa, fid, ft, sz)
bool
formchgcbfa_set_field_value(p_fa, fid, ft, py_val)
size_t
py_get_ask_form()
size_t
py_get_open_form()
 
py_register_compiled_form(py_form)
 
py_unregister_compiled_form(py_form)
int
install_command_interpreter(py_obj)
Install command line interpreter ( 'ui_install_cli' )
 
remove_command_interpreter(cli_idx)
Remove command line interpreter ( 'ui_install_cli' )
bool
pyidag_bind(self)
bool
pyidag_unbind(self)
PyObject *
pyscv_init(py_link, title)
bool
pyscv_refresh(py_this)
PyObject *
pyscv_get_current_line(py_this, mouse, notags)
bool
pyscv_is_focused(py_this)
size_t
pyscv_count(py_this)
bool
pyscv_show(py_this)
 
pyscv_close(py_this)
bool
pyscv_jumpto(py_this, ln, x, y)
PyObject *
pyscv_get_line(py_this, nline)
PyObject *
pyscv_get_pos(py_this, mouse)
PyObject *
pyscv_clear_lines(py_this)
bool
pyscv_add_line(py_this, py_sl)
bool
pyscv_insert_line(py_this, nline, py_sl)
bool
pyscv_patch_line(py_this, nline, offs, value)
bool
pyscv_del_line(py_this, nline)
PyObject *
pyscv_get_selection(py_this)
PyObject *
pyscv_get_current_word(py_this, mouse)
bool
pyscv_edit_line(py_this, nline, py_sl)
TWidget *
pyscv_get_widget(py_this)
PyObject *
plgform_new()
bool
plgform_show(py_link, py_obj, caption, options=WOPN_DP_TAB|WOPN_RESTORE)
 
plgform_close(py_link, options)
TWidget *
plgform_get_widget(py_link)
Variables
  mbox_internal = 0
  mbox_info = 1
  mbox_warning = 2
  mbox_error = 3
  mbox_nomem = 4
  mbox_feedback = 5
  mbox_readerror = 6
  mbox_writeerror = 7
  mbox_filestruct = 8
  mbox_wait = 9
  mbox_hide = 10
  mbox_replace = 11
  chtype_generic = 0
  chtype_idasgn = 1
  chtype_entry = 2
  chtype_name = 3
  chtype_stkvar_xref = 4
  chtype_xref = 5
  chtype_enum = 6
  chtype_enum_by_value = 7
  chtype_func = 8
  chtype_segm = 9
  chtype_struc = 10
  chtype_strpath = 11
  chtype_idatil = 12
  chtype_enum_by_value_and_size = 13
  chtype_srcp = 14
  beep_default = 0
  TCCRT_INVALID = 0
  TCCRT_FLAT = 1
  TCCRT_GRAPH = 2
  TCCRT_PROXIMITY = 3
  TCCPT_INVALID = 0
  TCCPT_PLACE = 1
  TCCPT_SIMPLELINE_PLACE = 2
  TCCPT_IDAPLACE = 3
  TCCPT_ENUMPLACE = 4
  TCCPT_STRUCTPLACE = 5
  VME_UNKNOWN = 0
  VME_LEFT_BUTTON = 1
  VME_RIGHT_BUTTON = 2
  VME_MID_BUTTON = 3
  SETMENU_POSMASK = 3
  SETMENU_INS = 0
add menu item before the specified path (default)
  SETMENU_APP = 1
add menu item after the specified path
  SETMENU_FIRST = 2
add item to the beginning of menu
  CREATETB_ADV = 1
toolbar is for 'advanced mode' only
  HIF_IDENTIFIER = 1
text is an identifier (i.e., when searching for the current highlight, SEARCH_IDENT will be used)
  HIF_REGISTER = 2
text represents a register (aliases/subregisters will be highlit as well)
  HIF_LOCKED = 4
locked; clicking/moving the cursor around doesn't change the highlight
  REG_HINTS_MARKER = '\x01\xff'
  REG_HINTS_MARKER_LEN = 2
  SRCDBG_HINTS_MARKER = '\x01\xfe'
  SRCDBG_HINTS_MARKER_LEN = 2
  DEFAULT_PLACE_LNNUM = -1
  PCF_EA_CAPABLE = 1
  BWN_UNKNOWN = -1
unknown window
  BWN_EXPORTS = 0
exports
  BWN_IMPORTS = 1
imports
  BWN_NAMES = 2
names
  BWN_FUNCS = 3
functions
  BWN_STRINGS = 4
strings
  BWN_SEGS = 5
segments
  BWN_SEGREGS = 6
segment registers
  BWN_SELS = 7
selectors
  BWN_SIGNS = 8
signatures
  BWN_TILS = 9
type libraries
  BWN_LOCTYPS = 10
local types
  BWN_CALLS = 11
function calls
  BWN_PROBS = 12
problems
  BWN_BPTS = 13
breakpoints
  BWN_THREADS = 14
threads
  BWN_MODULES = 15
modules
  BWN_TRACE = 16
trace view
  BWN_CALL_STACK = 17
call stack
  BWN_XREFS = 18
xrefs
  BWN_SEARCH = 19
search results
  BWN_FRAME = 25
function frame
  BWN_NAVBAND = 26
navigation band
  BWN_ENUMS = 27
enumerations
  BWN_STRUCTS = 28
structures
  BWN_DISASM = 29
disassembly views
  BWN_DUMP = 30
hex dumps
  BWN_NOTEPAD = 31
notepad
  BWN_OUTPUT = 32
the text area, in the output window
  BWN_CLI = 33
the command-line, in the output window
  BWN_WATCH = 34
the 'watches' debugger window
  BWN_LOCALS = 35
the 'locals' debugger window
  BWN_STKVIEW = 36
the 'Stack view' debugger window
  BWN_CHOOSER = 37
a non-builtin chooser
  BWN_SHORTCUTCSR = 38
the shortcuts chooser (Qt version only)
  BWN_SHORTCUTWIN = 39
the shortcuts window (Qt version only)
  BWN_CPUREGS = 40
one of the 'General registers', 'FPU register', ...
  BWN_SO_STRUCTS = 41
the 'Structure offsets' dialog's 'Structures and Unions' panel
  BWN_SO_OFFSETS = 42
the 'Structure offsets' dialog's offset panel
  BWN_CMDPALCSR = 43
the command palette chooser (Qt version only)
  BWN_CMDPALWIN = 44
the command palette window (Qt version only)
  BWN_SNIPPETS = 45
the 'Execute script' window
  BWN_CUSTVIEW = 46
custom viewers
  BWN_ADDRWATCH = 47
the 'Watch List' window
  BWN_PSEUDOCODE = 48
hexrays decompiler views
  BWN_CALLS_CALLERS = 49
function calls, callers
  BWN_CALLS_CALLEES = 50
function calls, callees
  BWN_MDVIEWCSR = 51
lumina metadata view chooser
  BWN_DISASM_ARROWS = 52
disassembly arrows widget
  BWN_CV_LINE_INFOS = 53
custom viewers' lineinfo widget
  BWN_SRCPTHMAP_CSR = 54
"Source paths..."'s path mappings chooser
  BWN_SRCPTHUND_CSR = 55
"Source paths..."'s undesired paths chooser
  BWN_UNDOHIST = 56
Undo history.
  BWN_STACK = 17
Alias.
  BWN_DISASMS = 29
Alias.
  BWN_DUMPS = 30
Alias.
  BWN_SEARCHS = 19
Alias.
  IWID_EXPORTS = 1
exports (0)
  IWID_IMPORTS = 2
imports (1)
  IWID_NAMES = 4
names (2)
  IWID_FUNCS = 8
functions (3)
  IWID_STRINGS = 16
strings (4)
  IWID_SEGS = 32
segments (5)
  IWID_SEGREGS = 64
segment registers (6)
  IWID_SELS = 128
selectors (7)
  IWID_SIGNS = 256
signatures (8)
  IWID_TILS = 512
type libraries (9)
  IWID_LOCTYPS = 1024
local types (10)
  IWID_CALLS = 2048
function calls (11)
  IWID_PROBS = 4096
problems (12)
  IWID_BPTS = 8192
breakpoints (13)
  IWID_THREADS = 16384
threads (14)
  IWID_MODULES = 32768
modules (15)
  IWID_TRACE = 65536
trace view (16)
  IWID_CALL_STACK = 131072
call stack (17)
  IWID_XREFS = 262144
xrefs (18)
  IWID_SEARCH = 524288
search results (19)
  IWID_FRAME = 33554432
function frame (25)
  IWID_NAVBAND = 67108864
navigation band (26)
  IWID_ENUMS = 134217728
enumerations (27)
  IWID_STRUCTS = 268435456
structures (28)
  IWID_DISASM = 536870912
disassembly views (29)
  IWID_DUMP = 1073741824
hex dumps (30)
  IWID_NOTEPAD = 2147483648
notepad (31)
  IWID_OUTPUT = 4294967296
output (32)
  IWID_CLI = 8589934592
input line (33)
  IWID_WATCH = 17179869184
watches (34)
  IWID_LOCALS = 34359738368
locals (35)
  IWID_STKVIEW = 68719476736
stack view (36)
  IWID_CHOOSER = 137438953472
chooser (37)
  IWID_SHORTCUTCSR = 274877906944
shortcuts chooser (38)
  IWID_SHORTCUTWIN = 549755813888
shortcuts window (39)
  IWID_CPUREGS = 1099511627776
registers (40)
  IWID_SO_STRUCTS = 2199023255552
stroff (41)
  IWID_SO_OFFSETS = 4398046511104
stroff (42)
  IWID_CMDPALCSR = 8796093022208
command palette (43)
  IWID_CMDPALWIN = 17592186044416
command palette (44)
  IWID_SNIPPETS = 35184372088832
snippets (45)
  IWID_CUSTVIEW = 70368744177664
custom viewers (46)
  IWID_ADDRWATCH = 140737488355328
address watches (47)
  IWID_PSEUDOCODE = 281474976710656
decompiler (48)
  IWID_CALLS_CALLERS = 562949953421312
funcalls, callers (49)
  IWID_CALLS_CALLEES = 1125899906842624
funcalls, callees (50)
  IWID_MDVIEWCSR = 2251799813685248
lumina md view (51)
  IWID_DISASM_ARROWS = 4503599627370496
arrows widget (52)
  IWID_CV_LINE_INFOS = 9007199254740992
lineinfo widget (53)
  IWID_SRCPTHMAP_CSR = 18014398509481984
mappings chooser (54)
  IWID_SRCPTHUND_CSR = 36028797018963968
undesired chooser (55)
  IWID_UNDOHIST = 72057594037927936
Undo history (56)
  IWID_ALL = 18446744073709551615
mask
  IWID_STACK = 131072
Alias.
  IWID_DISASMS = 536870912
  IWID_DUMPS = 1073741824
  IWID_SEARCHS = 524288
  CH_MODAL = 1
Modal chooser.
  CH_KEEP = 2
The chooser instance's lifecycle is not tied to the lifecycle of the widget showing its contents.
  CH_MULTI = 4
Obsolete.
  CH_MULTI_EDIT = 8
  CH_NOBTNS = 16
do not display ok/cancel/help/search buttons.
  CH_ATTRS = 32
generate ui_get_chooser_item_attrs (gui only)
  CH_NOIDB = 64
use the chooser before opening the database
  CH_FORCE_DEFAULT = 128
if a non-modal chooser was already open, change selection to the default one
  CH_CAN_INS = 256
allow to insert new items
  CH_CAN_DEL = 512
allow to delete existing item(s)
  CH_CAN_EDIT = 1024
allow to edit existing item(s)
  CH_CAN_REFRESH = 2048
allow to refresh chooser
  CH_QFLT = 4096
open with quick filter enabled and focused
  CH_QFTYP_SHIFT = 13
  CH_QFTYP_DEFAULT = 0
set quick filtering type to the possible existing default for this chooser
  CH_QFTYP_NORMAL = 8192
normal (i.e., lexicographical) quick filter type
  CH_QFTYP_WHOLE_WORDS = 16384
whole words quick filter type
  CH_QFTYP_REGEX = 24576
regex quick filter type
  CH_QFTYP_FUZZY = 32768
fuzzy search quick filter type
  CH_QFTYP_MASK = 57344
  CH_NO_STATUS_BAR = 65536
don't show a status bar
  CH_RESTORE = 131072
restore floating position if present (equivalent of WOPN_RESTORE) (GUI version only)
  CH_BUILTIN_SHIFT = 19
  CH_BUILTIN_MASK = 33030144
Mask for builtin chooser numbers.
  CHCOL_PLAIN = 0
plain string
  CHCOL_PATH = 65536
file path
  CHCOL_HEX = 131072
hexadecimal number
  CHCOL_DEC = 196608
decimal number
  CHCOL_EA = 262144
address
  CHCOL_FNAME = 327680
function name
  CHCOL_FORMAT = 458752
column format mask
  CHCOL_DEFHIDDEN = 1048576
column should be hidden by default
  CHITEM_BOLD = 1
display the item in bold
  CHITEM_ITALIC = 2
display the item in italic
  CHITEM_UNDER = 4
underline the item
  CHITEM_STRIKE = 8
strikeout the item
  CHITEM_GRAY = 16
gray out the item
  CHOOSER_NOMAINMENU = 'NOMAINMENU\n'
  CHOOSER_NOSTATUSBAR = 'NOSTATUSBAR\n'
  CHOOSER_NO_SELECTION = 1
Flags.
  CHOOSER_MULTI_SELECTION = 2
enable for multiple selections.
  CHOOSER_POPUP_MENU = 4
Add command to the popup menu.
  CHOOSER_MENU_EDIT = 0
Values of the 'menu_index' parameter.
  CHOOSER_MENU_JUMP = 1
Obsolete.
  CHOOSER_MENU_SEARCH = 2
Obsolete.
  nat_lib = 0
  nat_fun = 1
  nat_cod = 2
  nat_dat = 3
  nat_und = 4
  nat_ext = 5
  nat_err = 6
  nat_gap = 7
  nat_cur = 8
  nat_auto = 9
  nat_lum = 10
  nat_last = 11
  CVH_USERDATA = 0
  CVH_KEYDOWN = 1
  CVH_POPUP = 2
  CVH_DBLCLICK = 3
  CVH_CURPOS = 4
  CVH_CLOSE = 5
  CVH_CLICK = 6
  CVH_QT_AWARE = 7
  CVH_HELP = 8
  CVH_MOUSEMOVE = 9
  CDVH_USERDATA = 1000
  CDVH_SRCVIEW = 1001
  CDVH_LINES_CLICK = 1002
  CDVH_LINES_DBLCLICK = 1003
  CDVH_LINES_POPUP = 1004
  CDVH_LINES_DRAWICON = 1005
  CDVH_LINES_LINENUM = 1006
  CDVH_LINES_ICONMARGIN = 1007
  CDVH_LINES_RADIX = 1008
  CDVH_LINES_ALIGNMENT = 1009
  VES_SHIFT = 1
state & 1 => Shift is pressedstate & 2 => Alt is pressedstate & 4 => Ctrl is pressedstate & 8 => Mouse left button is pressedstate & 16 => Mouse right button is pressedstate & 32 => Mouse middle button is pressedstate & 128 => Meta is pressed (OSX only)
  VES_ALT = 2
  VES_CTRL = 4
  VES_MOUSE_LEFT = 8
  VES_MOUSE_RIGHT = 16
  VES_MOUSE_MIDDLE = 32
  VES_META = 128
  msg_activated = 0
  msg_deactivated = 1
  msg_click = 2
  msg_dblclick = 3
  msg_closed = 4
  msg_keydown = 5
  view_activated = 0
  view_deactivated = 1
  view_keydown = 2
  view_click = 3
  view_dblclick = 4
  view_curpos = 5
  view_created = 6
  view_close = 7
  view_switched = 8
  view_mouse_over = 9
  view_loc_changed = 10
  view_mouse_moved = 11
  MFF_FAST = 0
Execute code as soon as possible.
  MFF_READ = 1
Execute code only when ida is idle and it is safe to query the database.
  MFF_WRITE = 2
Execute code only when ida is idle and it is safe to modify the database.
  MFF_NOWAIT = 4
Do not wait for the request to be executed.
  UIJMP_ACTIVATE = 1
activate the new window
  UIJMP_DONTPUSH = 2
in the navigation history
  UIJMP_IDAVIEW = 4
jump in idaview (by default any eaview is good)
  ACF_HAS_SELECTION = 1
there is currently a valid selection
  ACF_XTRN_EA = 2
cur_ea is in 'externs' segment
  AHF_VERSION = 1
action handler version (used by 'action_handler_t::flags' )
  AHF_VERSION_MASK = 255
mask for 'action_handler_t::flags'
  AST_ENABLE_ALWAYS = 0
  AST_ENABLE_FOR_IDB = 1
  AST_ENABLE_FOR_WIDGET = 2
  AST_ENABLE = 3
  AST_DISABLE_ALWAYS = 4
  AST_DISABLE_FOR_IDB = 5
  AST_DISABLE_FOR_WIDGET = 6
  AST_DISABLE = 7
  ADF_OWN_HANDLER = 1
handler is owned by the action; it'll be destroyed when the action is unregistered.
  ADF_NO_UNDO = 2
useful for actions that do not modify the database.
  AA_NONE = 0
  AA_LABEL = 1
  AA_SHORTCUT = 2
  AA_TOOLTIP = 3
  AA_ICON = 4
  AA_STATE = 5
  AA_CHECKABLE = 6
  AA_CHECKED = 7
  AA_VISIBILITY = 8
  ASKBTN_YES = 1
Yes button.
  ASKBTN_NO = 0
No button.
  ASKBTN_CANCEL = -1
Cancel button.
  ASKBTN_BTN1 = 1
First (Yes) button.
  ASKBTN_BTN2 = 0
Second (No) button.
  ASKBTN_BTN3 = -1
Third (Cancel) button.
  HIST_SEG = 1
segment names
  HIST_CMT = 2
comments
  HIST_SRCH = 3
search substrings
  HIST_IDENT = 4
names
  HIST_FILE = 5
file names
  HIST_TYPE = 6
type declarations
  HIST_CMD = 7
commands
  HIST_DIR = 8
directory names (text version only)
  cvar = _ida_kernwin.cvar
  CLNL_RTRIM = 1
Remove trailing space characters.
  CLNL_LTRIM = 2
Remove leading space characters.
  CLNL_FINDCMT = 4
Search for the comment symbol everywhere in the line, not only at the beginning.
  CLNL_TRIM = 3
  IK_CANCEL = 3
  IK_BACK = 8
  IK_TAB = 9
  IK_CLEAR = 12
  IK_RETURN = 13
  IK_SHIFT = 16
  IK_CONTROL = 17
  IK_MENU = 18
  IK_PAUSE = 19
  IK_CAPITAL = 20
  IK_KANA = 21
  IK_ESCAPE = 27
  IK_MODECHANGE = 31
  IK_SPACE = 32
  IK_PRIOR = 33
  IK_NEXT = 34
  IK_END = 35
  IK_HOME = 36
  IK_LEFT = 37
  IK_UP = 38
  IK_RIGHT = 39
  IK_DOWN = 40
  IK_SELECT = 41
  IK_PRINT = 42
  IK_EXECUTE = 43
  IK_SNAPSHOT = 44
  IK_INSERT = 45
  IK_DELETE = 46
  IK_HELP = 47
  IK_LWIN = 91
  IK_RWIN = 92
  IK_APPS = 93
  IK_SLEEP = 95
  IK_NUMPAD0 = 96
  IK_NUMPAD1 = 97
  IK_NUMPAD2 = 98
  IK_NUMPAD3 = 99
  IK_NUMPAD4 = 100
  IK_NUMPAD5 = 101
  IK_NUMPAD6 = 102
  IK_NUMPAD7 = 103
  IK_NUMPAD8 = 104
  IK_NUMPAD9 = 105
  IK_MULTIPLY = 106
  IK_ADD = 107
  IK_SEPARATOR = 108
  IK_SUBTRACT = 109
  IK_DECIMAL = 110
  IK_DIVIDE = 111
  IK_F1 = 112
  IK_F2 = 113
  IK_F3 = 114
  IK_F4 = 115
  IK_F5 = 116
  IK_F6 = 117
  IK_F7 = 118
  IK_F8 = 119
  IK_F9 = 120
  IK_F10 = 121
  IK_F11 = 122
  IK_F12 = 123
  IK_F13 = 124
  IK_F14 = 125
  IK_F15 = 126
  IK_F16 = 127
  IK_F17 = 128
  IK_F18 = 129
  IK_F19 = 130
  IK_F20 = 131
  IK_F21 = 132
  IK_F22 = 133
  IK_F23 = 134
  IK_F24 = 135
  IK_NUMLOCK = 144
  IK_SCROLL = 145
  IK_OEM_FJ_MASSHOU = 147
  IK_OEM_FJ_TOUROKU = 148
  IK_LSHIFT = 160
  IK_RSHIFT = 161
  IK_LCONTROL = 162
  IK_RCONTROL = 163
  IK_LMENU = 164
  IK_RMENU = 165
  IK_BROWSER_BACK = 166
  IK_BROWSER_FORWARD = 167
  IK_BROWSER_REFRESH = 168
  IK_BROWSER_STOP = 169
  IK_BROWSER_SEARCH = 170
  IK_BROWSER_FAVORITES = 171
  IK_BROWSER_HOME = 172
  IK_VOLUME_MUTE = 173
  IK_VOLUME_DOWN = 174
  IK_VOLUME_UP = 175
  IK_MEDIA_NEXT_TRACK = 176
  IK_MEDIA_PREV_TRACK = 177
  IK_MEDIA_STOP = 178
  IK_MEDIA_PLAY_PAUSE = 179
  IK_LAUNCH_MAIL = 180
  IK_LAUNCH_MEDIA_SELECT = 181
  IK_LAUNCH_APP1 = 182
  IK_LAUNCH_APP2 = 183
  IK_OEM_1 = 186
  IK_OEM_PLUS = 187
  IK_OEM_COMMA = 188
  IK_OEM_MINUS = 189
  IK_OEM_PERIOD = 190
  IK_OEM_2 = 191
  IK_OEM_3 = 192
  IK_OEM_4 = 219
  IK_OEM_5 = 220
  IK_OEM_6 = 221
  IK_OEM_7 = 222
  IK_OEM_102 = 226
  IK_PLAY = 250
  IK_ZOOM = 251
  IK_OEM_CLEAR = 254
  CB_INIT = -1
  CB_YES = -2
  CB_CLOSE = -3
  CB_INVISIBLE = -4
  CB_DESTROYING = -5
  DP_LEFT = 1
Dock src_form to the left of dest_form.
  DP_TOP = 2
Dock src_form above dest_form.
  DP_RIGHT = 4
Dock src_form to the right of dest_form.
  DP_BOTTOM = 8
Dock src_form below dest_form.
  DP_INSIDE = 16
Create a new tab bar with both src_form and dest_form.
  DP_BEFORE = 32
used with 'DP_INSIDE' .
  DP_TAB = 64
Place src_form into a tab next to dest_form, if dest_form is in a tab bar (otherwise the same as 'DP_INSIDE' )
  DP_FLOATING = 128
Make src_form floating.
  __package__ = None
Function Details

register_timer(interval, py_callback)

 

Register a timer

Parameters:
  • interval - Interval in milliseconds
  • callback - A Python callable that takes no parameters and returns an integer. The callback may return: -1 : to unregister the timer >= 0 : the new or same timer interval
Returns: PyObject *
None or a timer object

unregister_timer(py_timerctx)

 

Unregister a timer

Parameters:
  • timer_obj - a timer object previously returned by a register_timer()
Returns: PyObject *
Boolean

Note: After the timer has been deleted, the timer_obj will become invalid.

choose_idasgn()

 

Opens the signature chooser

Returns: PyObject *
None or the selected signature name

get_highlight(v)

 

Returns the currently highlighted identifier and flags

Returns: PyObject *
a tuple (text, flags), or None if nothing is highlighted or in case of error.

msg(o)

 

Display an UTF-8 string in the message window

The result of the stringification of the arguments will be treated as an UTF-8 string.

Parameters:
  • message - message to print (formatting is done in Python)

    This function can be used to debug IDAPython scripts

Returns: PyObject *

ask_text(max_size, defval, prompt)

 

Asks for a long text

Parameters:
  • max_size - Maximum text length, 0 for unlimited
  • defval - The default value
  • prompt - The prompt value
Returns: PyObject *
None or the entered string

ask_str(defval, hist, prompt)

 

Asks for a long text

Parameters:
  • hist - history id
  • defval - The default value
  • prompt - The prompt value
Returns: PyObject *
None or the entered string

str2ea(str, screenEA=BADADDR)

 

Converts a string express to EA. The expression evaluator may be called as well.

Returns: ea_t
BADADDR or address value

process_ui_action(name, flags=0)

 

Invokes an IDA UI action by name

Parameters:
  • name - action name
Returns: bool
Boolean

del_hotkey(pyctx)

 

Deletes a previously registered function hotkey

Parameters:
  • ctx - Hotkey context previously returned by add_hotkey()
Returns: bool
Boolean.

add_hotkey(hotkey, pyfunc)

 

Associates a function call with a hotkey. Callable pyfunc will be called each time the hotkey is pressed

Parameters:
  • hotkey - The hotkey
  • pyfunc - Callable
Returns: PyObject *
Context object on success or None on failure.

take_database_snapshot(ss)

 

Take a database snapshot ( 'ui_take_database_snapshot' ).

Parameters:
  • ss - in/out parameter. in: description, flags out: filename, id (C++: snapshot_t *)
Returns: PyObject *
success

restore_database_snapshot(ss, pyfunc_or_none, pytuple_or_none)

 

Restore a database snapshot. Note: This call is asynchronous. When it is completed, the callback will be triggered.

Parameters:
  • ss - snapshot instance (see build_snapshot_tree() ) (C++: const snapshot_t *)
Returns: PyObject *
false if restoration could not be started (snapshot file was not found). If the returned value is True then check if the operation succeeded from the callback.

execute_sync(py_callable, reqf)

 

Executes a function in the context of the main thread. If the current thread not the main thread, then the call is queued and executed afterwards.

Parameters:
  • callable - A python callable object, must return an integer value
  • reqf - one of MFF_ flags
Returns: int
-1 or the return value of the callable

execute_ui_requests(py_list)

 

Inserts a list of callables into the UI message processing queue. When the UI is ready it will call one callable. A callable can request to be called more than once if it returns True.

Parameters:
  • callable_list - A list of python callable objects.
Returns: bool
Boolean. False if the list contains a non callabale item

Note: A callable should return True if it wants to be called more than once.

register_action(desc)

 

Create a new action ( 'ui_register_action' ). After an action has been created, it is possible to attach it to menu items ( 'attach_action_to_menu()' ), or to popup menus ( 'attach_action_to_popup()' ).Because the actions will need to call the handler's activate() and update() methods at any time, you shouldn't build your action handler on the stack.Please see the SDK's "ht_view" plugin for an example how to register actions.

Parameters:
  • desc - action to register (C++: const action_desc_t &)
Returns: bool
success

attach_dynamic_action_to_popup(widget, popup_handle, desc, popuppath=None, flags=0)

 

Create & insert an action into the widget's popup menu ( 'ui_attach_dynamic_action_to_popup' ). 'action_desc_t::handler' for 'desc' must be instantiated using 'new', as it will be 'delete'd when the action is unregistered.

Parameters:
  • widget - target widget (C++: TWidget *)
  • popup_handle - target popup (C++: TPopupMenu *)
  • desc - created with DYNACTION_DESC_LITERAL (C++: const action_desc_t &)
  • popuppath - can be NULL (C++: const char *)
  • flags - a combination of SETMENU_ constants (see Set menu flags ) (C++: int)
Returns: bool
success

gen_disasm_text(text, ea1, ea2, truncate_lines)

 

Generate disassembly text for a range.

Parameters:
  • text - result (C++: text_t &)
  • ea1 - start address (C++: ea_t)
  • ea2 - end address (C++: ea_t)
  • truncate_lines - (on idainfo::margin ) (C++: bool)

set_nav_colorizer(new_py_colorizer)

 
Set a new colorizer for the navigation band.

The 'callback' is a function of 2 arguments:
   - ea (the EA to colorize for)
   - nbytes (the number of bytes at that EA)
and must return a 'long' value.

The previous colorizer is returned, allowing
the new 'callback' to use 'call_nav_colorizer'
with it.

Note that the previous colorizer is returned
only the first time set_nav_colorizer() is called:
due to the way the colorizers API is defined in C,
it is impossible to chain more than 2 colorizers
in IDAPython: the original, IDA-provided colorizer,
and a user-provided one.

Example: colorizer inverting the color provided by the IDA colorizer:
    def my_colorizer(ea, nbytes):
        global ida_colorizer
        orig = idaapi.call_nav_colorizer(ida_colorizer, ea, nbytes)
        return long(~orig)

    ida_colorizer = idaapi.set_nav_colorizer(my_colorizer)

Returns: PyObject *

msg_get_lines(count=-1)

 

Retrieve the last 'count' lines from the output window, in reverse order (from most recent, to least recent)

Parameters:
  • count - The number of lines to retrieve. -1 means: all (C++: int)
Returns: PyObject *

add_spaces(s, len)

 

Add space characters to the colored string so that its length will be at least 'len' characters. Don't trim the string if it is longer than 'len'.

Parameters:
  • len - the desired length of the string (C++: ssize_t)
Returns: PyObject *
pointer to the end of input string

get_place_class(out_flags, out_sdk_version, id)

 

Get information about a previously-registered 'place_t' class. See also 'register_place_class()' .

Parameters:
  • out_flags - output flags (can be NULL) (C++: int *)
  • out_sdk_version - sdk version the place was created with (can be NULL) (C++: int *)
  • id - place class ID (C++: int)
Returns: place_t
the place_t template, or NULL if not found

get_place_class_template(id)

 

See 'get_place_class()'

Parameters:
  • id, (C++ - int)
Returns: place_t

is_place_class_ea_capable(id)

 

See 'get_place_class()'

Parameters:
  • id, (C++ - int)
Returns: bool

get_place_class_id(name)

 

Get the place class ID for the place that has been registered as 'name'.

Parameters:
  • name - the class name (C++: const char *)
Returns: int
the place class ID, or -1 if not found

request_refresh(mask, cnd=True)

 

Request a refresh of a builtin window.

Parameters:
  • mask - Window refresh flags (C++: uint64)
  • cnd - set if true or clear flag otherwise (C++: bool)

is_refresh_requested(mask)

 

Get a refresh request state

Parameters:
  • mask - Window refresh flags (C++: uint64)
Returns: bool
the state (set or cleared)

is_chooser_widget(t)

 

Does the given widget type specify a chooser widget?

Parameters:
  • t, (C++ - twidget_type_t)
Returns: bool

is_action_enabled(s)

 

Check if the given action state is one of AST_ENABLE*.

Parameters:
  • s, (C++ - action_state_t)
Returns: bool

cancel_exec_request(req_id)

 

Try to cancel an asynchronous exec request ( 'ui_cancel_exec_request' ).

Parameters:
  • req_id - request id (C++: int)
Returns: bool

banner(wait)

 

Show a banner dialog box ( 'ui_banner' ).

Parameters:
  • wait - time to wait before closing (C++: int)
Returns: bool

refresh_idaview_anyway()

 

Refresh all disassembly views ( 'ui_refresh' ), forces an immediate refresh. Please consider 'request_refresh()' instead

analyzer_options()

 

Allow the user to set analyzer options. (show a dialog box) ( 'ui_analyzer_options' )

get_curline()

 

Get current line from the disassemble window ( 'ui_get_curline' ).

Returns: char const *
cptr current line with the color codes (use tag_remove() to remove the color codes)

open_url(url)

 

Open the given url ( 'ui_open_url' )

Parameters:
  • url, (C++ - const char *)

get_hexdump_ea(hexdump_num)

 

Get the current address in a hex view.

Parameters:
  • hexdump_num - number of hexview window (C++: int)
Returns: ea_t

get_key_code(keyname)

 

Get keyboard key code by its name ( 'ui_get_key_code' )

Parameters:
  • keyname, (C++ - const char *)
Returns: ushort

lookup_key_code(key, shift, is_qt)

 

Get shortcut code previously created by 'ui_get_key_code' .

Parameters:
  • key - key constant (C++: int)
  • shift - modifiers (C++: int)
  • is_qt - are we using gui version? (C++: bool)
Returns: ushort

refresh_navband(force)

 

Refresh navigation band if changed ( 'ui_refresh_navband' ).

Parameters:
  • force - refresh regardless (C++: bool)

refresh_chooser(title)

 

Mark a non-modal custom chooser for a refresh ( 'ui_refresh_chooser' ).

Parameters:
  • title - title of chooser (C++: const char *)
Returns: bool
success

close_chooser(title)

 

Close a non-modal chooser ( 'ui_close_chooser' ).

Parameters:
  • title - window title of chooser to close (C++: const char *)
Returns: bool
success

set_dock_pos(src_ctrl, dest_ctrl, orient, left=0, top=0, right=0, bottom=0)

 
Sets the dock orientation of a window relatively to another window.

@param src: Source docking control
@param dest: Destination docking control
@param orient: One of DOR_XXXX constants
@param left, top, right, bottom: These parameter if DOR_FLOATING is used, or if you want to specify the width of docked windows
@return: Boolean

Example:
    set_dock_pos('Structures', 'Enums', DOR_RIGHT) <- docks the Structures window to the right of Enums window

Returns: bool

unregister_action(name)

 

Delete a previously-registered action ( 'ui_unregister_action' ).

Parameters:
  • name - name of action (C++: const char *)
Returns: bool
success

create_toolbar(name, label, before=None, flags=0)

 

Create a toolbar with the given name, label and optional position

Parameters:
  • name - name of toolbar (must be unique) (C++: const char *)
  • label - label of toolbar (C++: const char *)
  • before - if non-NULL, the toolbar before which the new toolbar will be inserted (C++: const char *)
  • flags - a combination of create toolbar flags , to determine toolbar position (C++: int)
Returns: bool
success

delete_toolbar(name)

 

Delete an existing toolbar

Parameters:
  • name - name of toolbar (C++: const char *)
Returns: bool
success

create_menu(name, label, menupath=None)

 

Create a menu with the given name, label and optional position, either in the menubar, or as a submenu. If 'menupath' is non-NULL, it provides information about where the menu should be positioned. First, IDA will try and resolve the corresponding menu by its name. If such an existing menu is found and is present in the menubar, then the new menu will be inserted in the menubar before it. Otherwise, IDA will try to resolve 'menupath' as it would for 'attach_action_to_menu()' and, if found, add the new menu like so:

// The new 'My menu' submenu will appear in the 'Comments' submenu // before the 'Enter comment..." command create_menu("(...)", "My menu", "Edit/Comments/Enter comment...");

or

// The new 'My menu' submenu will appear at the end of the // 'Comments' submenu. create_menu("(...)", "My menu", "Edit/Comments/");

If the above fails, the new menu will be appended to the menubar.

Parameters:
  • name - name of menu (must be unique) (C++: const char *)
  • label - label of menu (C++: const char *)
  • menupath - where should the menu be inserted (C++: const char *)
Returns: bool
success

delete_menu(name)

 

Delete an existing menu

Parameters:
  • name - name of menu (C++: const char *)
Returns: bool
success

attach_action_to_menu(menupath, name, flags)

 
Attach a previously-registered action to the menu (
'ui_attach_action_to_menu' ).You should not change top level menu, or
the Edit,Plugins submenus If you want to modify the debugger menu, do
it at the ui_debugger_menu_change event (ida might destroy your menu
item if you do it elsewhere).

@param menupath: path to the menu item after or before which the
                 insertion will take place.      Example:
                 Debug/StartProcess   Whitespace, punctuation are
                 ignored.   It is allowed to specify only the prefix
                 of the menu item.   Comparison is case insensitive.
                 menupath may start with the following prefixes:   [S]
                 - modify the main menu of the structure window   [E]
                 - modify the main menu of the enum window (C++: const
                 char *)
@param name: the action name (C++: const char *)
@param flags: a combination of  Set menu flags , to determine menu
              item position (C++: int)
@return: success

Returns: bool

detach_action_from_menu(menupath, name)

 

Detach an action from the menu ( 'ui_detach_action_from_menu' ).

Parameters:
  • menupath - path to the menu item (C++: const char *)
  • name - the action name (C++: const char *)
Returns: bool
success

attach_action_to_toolbar(toolbar_name, name)

 

Attach an action to an existing toolbar ( 'ui_attach_action_to_toolbar' ).

Parameters:
  • toolbar_name - the name of the toolbar (C++: const char *)
  • name - the action name (C++: const char *)
Returns: bool
success

detach_action_from_toolbar(toolbar_name, name)

 

Detach an action from the toolbar ( 'ui_detach_action_from_toolbar' ).

Parameters:
  • toolbar_name - the name of the toolbar (C++: const char *)
  • name - the action name (C++: const char *)
Returns: bool
success

register_and_attach_to_menu(menupath, name, label, shortcut, flags, handler, owner)

 

Helper.You are not encouraged to use this, as it mixes flags for both 'register_action()' , and 'attach_action_to_menu()' .The only reason for its existence is to make it simpler to port existing plugins to the new actions API.

Parameters:
  • menupath, (C++ - const char *)
  • name, (C++ - const char *)
  • label, (C++ - const char *)
  • shortcut, (C++ - const char *)
  • flags, (C++ - int)
  • handler, (C++ - action_handler_t *)
  • owner, (C++ - const plugin_t *)
Returns: bool

display_widget(widget, options, dest_ctrl=None)

 

Display a widget, dock it if not done before

Parameters:
  • widget - widget to display (C++: TWidget *)
  • options - Widget open flags (C++: uint32)
  • dest_ctrl - where to dock: if NULL or invalid then use the active docker if there is not create a new tab relative to current active tab (C++: const char *)

close_widget(widget, options)

 

Close widget ( 'ui_close_widget' , only gui version).

Parameters:
  • widget - pointer to the widget to close (C++: TWidget *)
  • options - Form close flags (C++: int)

activate_widget(widget, take_focus)

 

Activate widget (only gui version) ( 'ui_activate_widget' ).

Parameters:
  • widget - existing widget to display (C++: TWidget *)
  • take_focus - give focus to given widget (C++: bool)

find_widget(caption)

 

Find widget with the specified caption (only gui version) ( 'ui_find_widget' ). NB: this callback works only with the tabbed widgets!

Parameters:
  • caption - title of tab, or window title if widget is not tabbed (C++: const char *)
Returns: TWidget *
pointer to the TWidget, NULL if none is found

get_widget_type(widget)

 

Get the type of the TWidget * ( 'ui_get_widget_type' ).

Parameters:
  • widget, (C++ - TWidget *)
Returns: twidget_type_t

get_widget_title(widget)

 

Get the TWidget's title ( 'ui_get_widget_title' ).

Parameters:
  • widget, (C++ - TWidget *)
Returns: bool

custom_viewer_jump(v, loc, flags)

 

Append 'loc' to the viewer's history, and cause the viewer to display it.

Parameters:
  • v - (TWidget *) (C++: TWidget *)
  • loc - (const lochist_entry_t &) (C++: const lochist_entry_t &)
  • flags - (uint32) or'ed combination of CVNF_* values (C++: uint32)
Returns: bool
success

ea_viewer_history_push_and_jump(v, ea, x, y, lnnum)

 

Push current location in the history and jump to the given location ( 'ui_ea_viewer_history_push_and_jump' ). This will jump in the given ea viewer and also in other synchronized views.

Parameters:
  • v - ea viewer (C++: TWidget *)
  • ea - jump destination (C++: ea_t)
  • x - coords on screen (C++: int)
  • y - coords on screen (C++: int)
  • lnnum - desired line number of given address (C++: int)
Returns: bool

get_ea_viewer_history_info(nback, nfwd, v)

 

Get information about what's in the history ( 'ui_ea_viewer_history_info' ).

Parameters:
  • nback - number of available back steps (C++: int *)
  • nfwd - number of available forward steps (C++: int *)
  • v - ea viewer (C++: TWidget *)
Returns: bool

repaint_custom_viewer(custom_viewer)

 

Repaint the given widget immediately ( 'ui_repaint_qwidget' )

Parameters:
  • custom_viewer, (C++ - TWidget *)

jumpto(ea, opnum=-1, uijmp_flags=0x0001)

 
  jumpto(custom_viewer, place, x, y) -> bool


Jump to the specified address ( 'ui_jumpto' ).

@param ea: destination (C++: ea_t)
@param opnum: -1: don't change x coord (C++: int)
@param uijmp_flags: Jump flags (C++: int)
@return: success
  

Returns: bool

get_custom_viewer_place(custom_viewer, mouse)

 

Get current place in a custom viewer ( 'ui_get_curplace' ).

Parameters:
  • custom_viewer - view (C++: TWidget *)
  • mouse - mouse position (otherwise cursor position) (C++: bool)
Returns: place_t

attach_action_to_popup(widget, popup_handle, name, popuppath=None, flags=0)

 

Insert a previously-registered action into the widget's popup menu ( 'ui_attach_action_to_popup' ). This function has two "modes": 'single- shot', and 'permanent'.

Parameters:
  • widget - target widget (C++: TWidget *)
  • popup_handle - target popup menu if non-NULL, the action is added to this popup menu invocation (i.e., 'single-shot') if NULL, the action is added to a list of actions that should always be present in context menus for this widget (i.e., 'permanent'.) (C++: TPopupMenu *)
  • name - action name (C++: const char *)
  • popuppath - can be NULL (C++: const char *)
  • flags - a combination of SETMENU_ flags (see Set menu flags ) (C++: int)
Returns: bool
success

detach_action_from_popup(widget, name)

 

Remove a previously-registered action, from the list of 'permanent' context menu actions for this widget ( 'ui_detach_action_from_popup' ). This only makes sense if the action has been added to 'widget's list of permanent popup actions by calling attach_action_to_popup in 'permanent' mode.

Parameters:
  • widget - target widget (C++: TWidget *)
  • name - action name (C++: const char *)
Returns: bool

update_action_label(name, label)

 

Update an action's label ( 'ui_update_action_attr' ).

Parameters:
  • name - action name (C++: const char *)
  • label - new label (C++: const char *)
Returns: bool
success

update_action_shortcut(name, shortcut)

 

Update an action's shortcut ( 'ui_update_action_attr' ).

Parameters:
  • name - action name (C++: const char *)
  • shortcut - new shortcut (C++: const char *)
Returns: bool
success

update_action_tooltip(name, tooltip)

 

Update an action's tooltip ( 'ui_update_action_attr' ).

Parameters:
  • name - action name (C++: const char *)
  • tooltip - new tooltip (C++: const char *)
Returns: bool
success

update_action_icon(name, icon)

 

Update an action's icon ( 'ui_update_action_attr' ).

Parameters:
  • name - action name (C++: const char *)
  • icon - new icon id (C++: int)
Returns: bool
success

update_action_state(name, state)

 

Update an action's state ( 'ui_update_action_attr' ).

Parameters:
  • name - action name (C++: const char *)
  • state - new state (C++: action_state_t)
Returns: bool
success

update_action_checkable(name, checkable)

 

Update an action's checkability ( 'ui_update_action_attr' ).

Parameters:
  • name - action name (C++: const char *)
  • checkable - new checkability (C++: bool)
Returns: bool
success

update_action_checked(name, checked)

 

Update an action's checked state ( 'ui_update_action_attr' ).

Parameters:
  • name - action name (C++: const char *)
  • checked - new checked state (C++: bool)
Returns: bool
success

update_action_visibility(name, visible)

 

Update an action's visibility ( 'ui_update_action_attr' ).

Parameters:
  • name - action name (C++: const char *)
  • visible - new visibility (C++: bool)
Returns: bool
success

get_action_label(name)

 

Get an action's label ( 'ui_get_action_attr' ).

Parameters:
  • name - the action name (C++: const char *)
Returns: bool
success

get_action_shortcut(name)

 

Get an action's shortcut ( 'ui_get_action_attr' ).

Parameters:
  • name - the action name (C++: const char *)
Returns: bool
success

get_action_tooltip(name)

 

Get an action's tooltip ( 'ui_get_action_attr' ).

Parameters:
  • name - the action name (C++: const char *)
Returns: bool
success

get_action_icon(name)

 

Get an action's icon ( 'ui_get_action_attr' ).

Parameters:
  • name - the action name (C++: const char *)
Returns: bool
success

get_action_state(name)

 

Get an action's state ( 'ui_get_action_attr' ).

Parameters:
  • name - the action name (C++: const char *)
Returns: bool
success

get_action_checkable(name)

 

Get an action's checkability ( 'ui_get_action_attr' ).

Parameters:
  • name - the action name (C++: const char *)
Returns: bool
success

get_action_checked(name)

 

Get an action's checked state ( 'ui_get_action_attr' ).

Parameters:
  • name - the action name (C++: const char *)
Returns: bool
success

get_action_visibility(name)

 

Get an action's visibility ( 'ui_get_action_attr' ).

Parameters:
  • name - the action name (C++: const char *)
Returns: bool
success

set_custom_viewer_qt_aware(custom_viewer)

 

Allow the given viewer to interpret Qt events ( 'ui_set_custom_viewer_handler' )

Parameters:
  • custom_viewer, (C++ - TWidget *)
Returns: bool

get_custom_viewer_curline(custom_viewer, mouse)

 

Get current line of custom viewer ( 'ui_get_custom_viewer_curline' ). The returned line contains color codes

Parameters:
  • custom_viewer - view (C++: TWidget *)
  • mouse - mouse position (otherwise cursor position) (C++: bool)
Returns: char const *
pointer to contents of current line

get_output_curline(mouse)

 

Get current line of output window ( 'ui_get_output_curline' ).

Parameters:
  • mouse - current for mouse pointer? (C++: bool)
Returns: bool
false if output contains no text

get_output_selected_text()

 

Returns selected text from output window ( 'ui_get_output_selected_text' ).

Returns: bool
true if there is a selection

get_view_renderer_type(v)

 

Get the type of renderer currently in use in the given view ( 'ui_get_renderer_type' )

Parameters:
  • v, (C++ - TWidget *)
Returns: tcc_renderer_type_t

set_view_renderer_type(v, rt)

 

Set the type of renderer to use in a view ( 'ui_set_renderer_type' )

Parameters:
  • v, (C++ - TWidget *)
  • rt, (C++ - tcc_renderer_type_t)

create_empty_widget(title, icon=-1)

 

Create an empty widget, serving as a container for custom user widgets

Parameters:
  • title, (C++ - const char *)
  • icon, (C++ - int)
Returns: TWidget *

msg_save(path)

 

Save the "Output window" contents into a file

Parameters:
  • path - The path of the file to save the contents into. An empty path means that the user will be prompted for the destination and, if the file already exists, the user will be asked to confirm before overriding its contents. Upon return, 'path' will contain the path that the user chose. (C++: qstring &)
Returns: bool
success

get_active_modal_widget()

 

Get the current, active modal TWidget instance. Note that in this context, the "wait dialog" is not considered: this function will return NULL even if it is currently shown.

Returns: TWidget *
TWidget * the active modal widget, or NULL

get_navband_pixel(ea)

 

Maps an address, onto a pixel coordinate within the navband

Parameters:
  • ea - The address to map
Returns: int
a list [pixel, is_vertical]

get_navband_ea(pixel)

 

Translate the pixel position on the navigation band, into an address.

Parameters:
  • pixel, (C++ - int)
Returns: ea_t

get_window_id(name=None)

 

Get the system-specific window ID (GUI version only)

Parameters:
  • name, (C++ - const char *)
Returns: void *
the low-level window ID

read_selection(v, p1, p2)

 

Read the user selection, and store its information in p0 (from) and p1 (to).

This can be used as follows:

>>> p0 = idaapi.twinpos_t()
p1 = idaapi.twinpos_t()
view = idaapi.get_current_viewer()
idaapi.read_selection(view, p0, p1)

At that point, p0 and p1 hold information for the selection. But, the 'at' property of p0 and p1 is not properly typed. To specialize it, call #place() on it, passing it the view they were retrieved from. Like so:

>>> place0 = p0.place(view)
place1 = p1.place(view)

This will effectively "cast" the place into a specialized type, holding proper information, depending on the view type (e.g., disassembly, structures, enums, ...)

Parameters:
  • view - The view to retrieve the selection for.
  • p0 - Storage for the "from" part of the selection.
  • p1 - Storage for the "to" part of the selection.
Returns: bool
a bool value indicating success.

read_range_selection(v)

 

Get the address range for the selected range boundaries, this is the convenient function for 'read_selection()'

Parameters:
  • v - view, NULL means the last active window containing addresses (C++: TWidget *)
Returns: bool

create_code_viewer(custview, flags=0, parent=None)

 

Create a code viewer ( 'ui_create_code_viewer' ). A code viewer contains on the left side a widget representing the line numbers, and on the right side, the child widget passed as parameter. It will inherit its title from the child widget.

Parameters:
  • custview - the custom view to be added (C++: TWidget *)
  • flags - Code viewer flags (C++: int)
  • parent - widget to contain the new code viewer (C++: TWidget *)
Returns: TWidget *

set_code_viewer_handler(code_viewer, handler_id, handler_or_data)

 

Set a handler for a code viewer event ( 'ui_set_custom_viewer_handler' ).

Parameters:
  • code_viewer - the code viewer (C++: TWidget *)
  • handler_id - one of CDVH_ in custom_viewer_handler_id_t (C++: custom_viewer_handler_id_t)
  • handler_or_data - can be a handler or data. see examples in Functions: custom viewer handlers (C++: void *)
Returns: void *
old value of the handler or data

set_code_viewer_user_data(code_viewer, ud)

 

Set the user data on a code viewer ( 'ui_set_custom_viewer_handler' ).

Parameters:
  • code_viewer, (C++ - TWidget *)
  • ud, (C++ - void *)
Returns: bool

get_viewer_user_data(viewer)

 

Get the user data from a custom viewer ( 'ui_get_viewer_user_data' )

Parameters:
  • viewer, (C++ - TWidget *)
Returns: void *

get_viewer_place_type(viewer)

 

Get the type of 'place_t' instances a viewer uses & creates ( 'ui_get_viewer_place_type' ).

Parameters:
  • viewer, (C++ - TWidget *)
Returns: tcc_place_type_t

set_code_viewer_line_handlers(code_viewer, click_handler, popup_handler, dblclick_handler, drawicon_handler, linenum_handler)

 

Set handlers for code viewer line events. Any of these handlers may be NULL

Parameters:
  • code_viewer, (C++ - TWidget *)
  • click_handler, (C++ - code_viewer_lines_click_t *)
  • popup_handler, (C++ - code_viewer_lines_click_t *)
  • dblclick_handler, (C++ - code_viewer_lines_click_t *)
  • drawicon_handler, (C++ - code_viewer_lines_icon_t *)
  • linenum_handler, (C++ - code_viewer_lines_linenum_t *)

set_code_viewer_lines_icon_margin(code_viewer, margin)

 

Set space allowed for icons in the margin of a code viewer ( 'ui_set_custom_viewer_handler' ).

Parameters:
  • code_viewer, (C++ - TWidget *)
  • margin, (C++ - int)
Returns: bool

set_code_viewer_lines_alignment(code_viewer, align)

 

Set alignment for lines in a code viewer ( 'ui_set_custom_viewer_handler' ).

Parameters:
  • code_viewer, (C++ - TWidget *)
  • align, (C++ - int)
Returns: bool

set_code_viewer_lines_radix(code_viewer, radix)

 

Set radix for values displayed in a code viewer ( 'ui_set_custom_viewer_handler' ).

Parameters:
  • code_viewer, (C++ - TWidget *)
  • radix, (C++ - int)
Returns: bool

set_code_viewer_is_source(code_viewer)

 

Specify that the given code viewer is used to display source code ( 'ui_set_custom_viewer_handler' ).

Parameters:
  • code_viewer, (C++ - TWidget *)
Returns: bool

get_tab_size(path)

 

Get the size of a tab in spaces ( 'ui_get_tab_size' ).

Parameters:
  • path - the path of the source view for which the tab size is requested. if NULL, the default size is returned. (C++: const char *)
Returns: int

ui_load_new_file(temp_file, filename, pli, neflags, ploaders)

 

Display a load file dialog and load file ( 'ui_load_file' ).

Parameters:
  • temp_file - name of the file with the extracted archive member. (C++: qstring *)
  • filename - the name of input file as is, library or archive name (C++: qstring *)
  • pli - loader input source, may be changed to point to temp_file (C++: linput_t **)
  • neflags - combination of NEF_... bits (see Load file flags ) (C++: ushort)
  • ploaders - list of loaders which accept file, may be changed for loaders of temp_file (C++: load_info_t **)
Returns: bool

ui_run_debugger(dbgopts, exename, argc, argv)

 

Load a debugger plugin and run the specified program ( 'ui_run_dbg' ).

Parameters:
  • dbgopts - value of the -r command line switch (C++: const char *)
  • exename - name of the file to run (C++: const char *)
  • argc - number of arguments for the executable (C++: int)
  • argv - argument vector (C++: const char *const *)
Returns: bool
success

load_dbg_dbginfo(path, li=None, base=BADADDR, verbose=False)

 

Load debugging information from a file.

Parameters:
  • path - path to file (C++: const char *)
  • li - loader input. if NULL, check DBG_NAME_KEY (C++: linput_t *)
  • base - loading address (C++: ea_t)
  • verbose - dump status to message window (C++: bool)
Returns: bool

add_idc_hotkey(hotkey, idcfunc)

 

Add hotkey for IDC function ( 'ui_add_idckey' ).

Parameters:
  • hotkey - hotkey name (C++: const char *)
  • idcfunc - IDC function name (C++: const char *)
Returns: int
IDC hotkey error codes

del_idc_hotkey(hotkey)

 

Delete IDC function hotkey ( 'ui_del_idckey' ).

Parameters:
  • hotkey - hotkey name (C++: const char *)
Returns: bool

set_highlight(viewer, str, flags)

 

Set the highlighted identifier in the viewer ( 'ui_set_highlight' ).

Parameters:
  • viewer - the viewer (C++: TWidget *)
  • str - the text to match, or NULL to remove current (C++: const char *)
  • flags - combination of HIF_... bits (see set_highlightr flags ) (C++: int)
Returns: bool
false if an error occurred

open_exports_window(ea)

 

Open the exports window ( 'ui_open_builtin' ).

Parameters:
  • ea - index of entry to select by default (C++: ea_t)
Returns: TWidget *
pointer to resulting window

open_imports_window(ea)

 

Open the exports window ( 'ui_open_builtin' ).

Parameters:
  • ea - index of entry to select by default (C++: ea_t)
Returns: TWidget *
pointer to resulting window

open_names_window(ea)

 

Open the names window ( 'ui_open_builtin' ).

Parameters:
  • ea - index of entry to select by default (C++: ea_t)
Returns: TWidget *
pointer to resulting window

open_funcs_window(ea)

 

Open the functions window ( 'ui_open_builtin' ).

Parameters:
  • ea - index of entry to select by default (C++: ea_t)
Returns: TWidget *
pointer to resulting window

open_strings_window(ea, selstart=BADADDR, selend=BADADDR)

 

Open the strings window ( 'ui_open_builtin' ).

Parameters:
  • ea - index of entry to select by default (C++: ea_t)
  • selstart - only display strings that occur within this range (C++: ea_t)
  • selend - only display strings that occur within this range (C++: ea_t)
Returns: TWidget *
pointer to resulting window

open_segments_window(ea)

 

Open the segments window ( 'ui_open_builtin' ).

Parameters:
  • ea - index of entry to select by default (C++: ea_t)
Returns: TWidget *
pointer to resulting window

open_segregs_window(ea)

 

Open the segment registers window ( 'ui_open_builtin' ).

Parameters:
  • ea - index of entry to select by default (C++: ea_t)
Returns: TWidget *
pointer to resulting window

open_selectors_window()

 

Open the selectors window ( 'ui_open_builtin' ).

Returns: TWidget *
pointer to resulting window

open_signatures_window()

 

Open the signatures window ( 'ui_open_builtin' ).

Returns: TWidget *
pointer to resulting window

open_tils_window()

 

Open the type libraries window ( 'ui_open_builtin' ).

Returns: TWidget *
pointer to resulting window

open_loctypes_window(ordinal)

 

Open the local types window ( 'ui_open_builtin' ).

Parameters:
  • ordinal - ordinal of type to select by default (C++: int)
Returns: TWidget *
pointer to resulting window

open_calls_window(ea)

 

Open the function calls window ( 'ui_open_builtin' ).

Parameters:
  • ea, (C++ - ea_t)
Returns: TWidget *
pointer to resulting window

open_problems_window(ea)

 

Open the problems window ( 'ui_open_builtin' ).

Parameters:
  • ea - index of entry to select by default (C++: ea_t)
Returns: TWidget *
pointer to resulting window

open_bpts_window(ea)

 

Open the breakpoints window ( 'ui_open_builtin' ).

Parameters:
  • ea - index of entry to select by default (C++: ea_t)
Returns: TWidget *
pointer to resulting window

open_threads_window()

 

Open the threads window ( 'ui_open_builtin' ).

Returns: TWidget *
pointer to resulting window

open_modules_window()

 

Open the modules window ( 'ui_open_builtin' ).

Returns: TWidget *
pointer to resulting window

open_trace_window()

 

Open the trace window ( 'ui_open_builtin' ).

Returns: TWidget *
pointer to resulting window

open_stack_window()

 

Open the call stack window ( 'ui_open_builtin' ).

Returns: TWidget *
pointer to resulting window

open_xrefs_window(ea)

 

Open the cross references window ( 'ui_open_builtin' ).

Parameters:
  • ea - index of entry to select by default (C++: ea_t)
Returns: TWidget *
pointer to resulting window

open_frame_window(pfn, offset)

 

Open the frame window for the given function ( 'ui_open_builtin' ).

Parameters:
  • pfn - function to analyze (C++: func_t *)
  • offset - offset where the cursor is placed (C++: uval_t)
Returns: TWidget *
pointer to resulting window if 'pfn' is a valid function and the window was displayed, NULL otherwise

open_navband_window(ea, zoom)

 

Open the navigation band window ( 'ui_open_builtin' ).

Parameters:
  • ea - sets the address of the navband arrow (C++: ea_t)
  • zoom - sets the navband zoom level (C++: int)
Returns: TWidget *
pointer to resulting window

open_enums_window(const_id=BADADDR)

 

Open the enums window ( 'ui_open_builtin' ).

Parameters:
  • const_id - index of entry to select by default (C++: tid_t)
Returns: TWidget *
pointer to resulting window

open_structs_window(id=BADADDR, offset=0)

 

Open the structs window ( 'ui_open_builtin' ).

Parameters:
  • id - index of entry to select by default (C++: tid_t)
  • offset - offset where the cursor is placed (C++: uval_t)
Returns: TWidget *
pointer to resulting window

open_disasm_window(window_title, ranges=None)

 

Open a disassembly view ( 'ui_open_builtin' ).

Parameters:
  • window_title - title of view to open (C++: const char *)
  • ranges - if != NULL, then display a flow chart with the specified ranges (C++: const rangevec_t *)
Returns: TWidget *
pointer to resulting window

open_hexdump_window(window_title)

 

Open a hexdump view ( 'ui_open_builtin' ).

Parameters:
  • window_title - title of view to open (C++: const char *)
Returns: TWidget *
pointer to resulting window

open_notepad_window()

 

Open the notepad window ( 'ui_open_builtin' ).

Returns: TWidget *
pointer to resulting window

sync_sources(what, with, sync)

 

[Un]synchronize sources

Parameters:
  • what, (C++ - const sync_source_t &)
  • with, (C++ - const sync_source_t &)
  • sync, (C++ - bool)
Returns: bool
success

choose_entry(title)

 

Choose an entry point ( 'ui_choose' , 'chtype_entry' ).

Parameters:
  • title - chooser title (C++: const char *)
Returns: ea_t
ea of selected entry point, BADADDR if none selected

choose_name(title)

 

Choose a name ( 'ui_choose' , 'chtype_name' ).

Parameters:
  • title - chooser title (C++: const char *)
Returns: ea_t
ea of selected name, BADADDR if none selected

choose_stkvar_xref(pfn, mptr)

 

Choose an xref to a stack variable ( 'ui_choose' , 'chtype_name' ).

Parameters:
  • pfn - function (C++: func_t *)
  • mptr - variable (C++: member_t *)
Returns: ea_t
ea of the selected xref, BADADDR if none selected

choose_xref(to)

 

Choose an xref to an address ( 'ui_choose' , 'chtype_xref' ).

Parameters:
  • to - referenced address (C++: ea_t)
Returns: ea_t
ea of selected xref, BADADDR if none selected

choose_enum(title, default_id)

 

Choose an enum ( 'ui_choose' , 'chtype_enum' ).

Parameters:
  • title - chooser title (C++: const char *)
  • default_id - id of enum to select by default (C++: enum_t)
Returns: enum_t
enum id of selected enum, BADNODE if none selected

choose_enum_by_value(title, default_id, value, nbytes)

 

Choose an enum, restricted by value & size ( 'ui_choose' , 'chtype_enum_by_value_and_size' ). If the given value cannot be found initially, this function will ask if the user would like to import a standard enum.

Parameters:
  • title - chooser title (C++: const char *)
  • default_id - id of enum to select by default (C++: enum_t)
  • value - value to search for (C++: uval_t)
  • nbytes - size of value (C++: int)
Returns: enum_t
enum id of selected (or imported) enum, BADNODE if none was found

choose_func(title, default_ea)

 

Choose a function ( 'ui_choose' , 'chtype_func' ).

Parameters:
  • title - chooser title (C++: const char *)
  • default_ea - ea of function to select by default (C++: ea_t)
Returns: func_t *
pointer to function that was selected, NULL if none selected

choose_segm(title, default_ea)

 

Choose a segment ( 'ui_choose' , 'chtype_segm' ).

Parameters:
  • title - chooser title (C++: const char *)
  • default_ea - ea of segment to select by default (C++: ea_t)
Returns: segment_t *
pointer to segment that was selected, NULL if none selected

choose_struc(title)

 

Choose a structure ( 'ui_choose' , 'chtype_segm' ).

Parameters:
  • title - chooser title; (C++: const char *)
Returns: struc_t *
pointer to structure that was selected, NULL if none selected

choose_srcp(title)

 

Choose a segment register change point ( 'ui_choose' , 'chtype_srcp' ).

Parameters:
  • title - chooser title (C++: const char *)
Returns: sreg_range_t *
pointer to segment register range of selected change point, NULL if none selected

get_chooser_obj(chooser_caption)

 

Get the underlying object of the specified chooser ( 'ui_get_chooser_obj' ).This is object is chooser-specific.

Parameters:
  • chooser_caption, (C++ - const char *)
Returns: void *
the object that was used to create the chooser

enable_chooser_item_attrs(chooser_caption, enable)

 

Enable item-specific attributes for chooser items ( 'ui_enable_chooser_item_attrs' ). For example: color list items differently depending on a criterium.If enabled, the chooser will generate ui_get_chooser_item_attrsevents that can be intercepted by a plugin to modify the item attributes.This event is generated only in the GUI version of IDA.Specifying 'CH_ATTRS' bit at the chooser creation time has the same effect.

Parameters:
  • chooser_caption, (C++ - const char *)
  • enable, (C++ - bool)
Returns: bool
success

show_wait_box(format)

 
  Display a dialog box with "Please wait...". If the text message starts
  with "HIDECANCEL
", the cancel buttonwon't be displayed in the dialog
  box and you don't need to checkfor cancellations with
  'user_cancelled()' . Plugins must call 'hide_wait_box()' to close the
  dialog box, otherwise the user interface will be disabled.Note that,
  if the wait dialog is already visible, 'show_wait_box()' will1) push
  the currently-displayed text on a stack2) display the new textThen,
  when 'hide_wait_box()' is called, if that stack isn't empty its
  toplabel will be popped and restored in the wait dialog.This implies
  that a plugin should call 'hide_wait_box()' exactly as manytimes as it
  called 'show_wait_box()' , or the wait dialog might remainvisible and
  block the UI.Also, in case the plugin knows the wait dialog is
  currently displayed,alternatively it can call 'replace_wait_box()' ,
  to replace the text of thedialog without pushing the currently-
  displayed text on the stack.
  
  @param format (C++: const char *)
  

replace_wait_box(format)

 

Replace the label of "Please wait dialog box".

Parameters:
  • format, (C++ - const char *)

beep(beep_type=beep_default)

 

Issue a beeping sound ( 'ui_beep' ).

Parameters:
  • beep_type - beep_t (C++: beep_t)

display_copyright_warning()

 

Display copyright warning ( 'ui_copywarn' ).

Returns: bool
yes/no

ask_for_feedback(format)

 

Show a message box asking to send the input file [email protected] rays.com.

Parameters:
  • format - the reason why the input file is bad (C++: const char *)

error(format)

 

Display a fatal message in a message box and quit IDA

Parameters:
  • format - message to print

warning(format)

 

Display a message in a message box

Parameters:
  • message - message to print (formatting is done in Python)

    This function can be used to debug IDAPython scripts The user will be able to hide messages if they appear twice in a row on the screen

ask_yn(deflt, format)

 

Display a dialog box and get choice from "Yes", "No", "Cancel".

Parameters:
  • deflt - default choice: one of Button IDs (C++: int)
  • format - The question in printf() style format (C++: const char *)
Returns: int
the selected button (one of Button IDs ). Esc key returns ASKBTN_CANCEL .

ask_buttons(Yes, No, Cancel, deflt, format)

 

Display a dialog box and get choice from maximum three possibilities ( 'ui_ask_buttons' ).for all buttons:use "" or NULL to take the default name for the button.use 'format' to hide the cancel button

Parameters:
  • Yes - text for the first button (C++: const char *)
  • No - text for the second button (C++: const char *)
  • Cancel - text for the third button (C++: const char *)
  • deflt - default choice: one of Button IDs (C++: int)
  • format - printf-style format string for question. It may have some prefixes, see below. (C++: const char *)
Returns: int
one of Button IDs specifying the selected button (Esc key returns Cancel/3rd button value)

register_addon(info)

 

Register an add-on. Show its info in the About box. For plugins, should be called from init() function (repeated calls with the same product code overwrite previous entries) returns: index of the add-on in the list, or -1 on error

Parameters:
  • info, (C++ - const addon_info_t *)
Returns: int

get_addon_info(id, info)

 

Get info about a registered addon with a given product code. info->cb must be valid! NB: all pointers are invalidated by next call to register_addon or get_addon_info

Parameters:
  • id, (C++ - const char *)
  • info, (C++ - addon_info_t *)
Returns: bool
false if not found

get_addon_info_idx(index, info)

 

Get info about a registered addon with specific index. info->cb must be valid! NB: all pointers are invalidated by next call to register_addon or get_addon_info

Parameters:
  • index, (C++ - int)
  • info, (C++ - addon_info_t *)
Returns: bool
false if index is out of range

qcleanline(cmt_char='', flags=((1 << 0)|(1 << 1))|(1 << 2))

 

Performs some cleanup operations to a line.

Parameters:
  • cmt_char - character that denotes the start of a comment: the entire text is removed if the line begins with this character (ignoring leading spaces) all text after (and including) this character is removed if flag CLNL_FINDCMT is set (C++: char)
  • flags - a combination of line cleanup flags . defaults to CLNL_TRIM (C++: uint32)
Returns: ssize_t
length of line

strarray(array, array_size, code)

 

Find a line with the specified code in the 'strarray_t' array. If the last element of the array has code==0 then it is considered as the default entry.If no default entry exists and the code is not found, 'strarray()' returns "".

Parameters:
  • array, (C++ - const strarray_t *)
  • array_size, (C++ - size_t)
  • code, (C++ - int)
Returns: char const *

ea2str(ea)

 

Convert linear address to UTF-8 string.

Parameters:
  • ea, (C++ - ea_t)
Returns: size_t

load_custom_icon(file_name=None, data=None, format=None)

 
Loads a custom icon and returns an identifier that can be used with other APIs

If file_name is passed then the other two arguments are ignored.

@param file_name: The icon file name
@param data: The icon data
@param format: The icon data format

@return: Icon id or 0 on failure.
         Use free_custom_icon() to free it


Load an icon from a file ( 'ui_load_custom_icon_file' ). Also see
'load_custom_icon(const void *, unsigned int, const char *)'

@return: icon id

get_chooser_data(chooser_caption, n)

 

Get the text corresponding to the index N in the chooser data. Use -1 to get the header.

Parameters:
  • chooser_caption, (C++ - const char *)
  • n, (C++ - int)
Returns: PyObject *

Variables Details

BWN_CPUREGS

one of the 'General registers', 'FPU register', ... debugger windows

Value:
40

BWN_STACK

Alias. Some BWN_* were confusing, and thus have been renamed. This is to ensure bw-compat.

Value:
17

BWN_DISASMS

Alias. Some BWN_* were confusing, and thus have been renamed. This is to ensure bw-compat.

Value:
29

BWN_DUMPS

Alias. Some BWN_* were confusing, and thus have been renamed. This is to ensure bw-compat.

Value:
30

BWN_SEARCHS

Alias. Some BWN_* were confusing, and thus have been renamed. This is to ensure bw-compat.

Value:
19

IWID_STACK

Alias. Some IWID_* were confusing, and thus have been renamed. This is to ensure bw-compat.

Value:
131072

CH_KEEP

The chooser instance's lifecycle is not tied to the lifecycle of the widget showing its contents. Closing the widget will not destroy the chooser structure. This allows for, e.g., static global chooser instances that don't need to be allocated on the heap. Also stack- allocated chooser instances must set this bit.

Value:
2

CH_MULTI

Obsolete.

The chooser will allow multi-selection (only for GUI choosers). This bit is set when using the 'chooser_multi_t' structure.

Value:
4

CH_NOBTNS

do not display ok/cancel/help/search buttons. Meaningful only for gui modal windows because non-modal windows do not have any buttons anyway. Text mode does not have them neither.

Value:
16

CH_BUILTIN_MASK

Mask for builtin chooser numbers. Plugins should not use them.

Value:
33030144

CHOOSER_NO_SELECTION

Flags.

enable even if there's no selected item. 'n' will be NO_SELECTION for a callback.

Value:
1

CHOOSER_MULTI_SELECTION

enable for multiple selections. A callback of type 'chooser_multi_cb_t' will be called for all selected items.

Value:
2

CHOOSER_MENU_EDIT

Values of the 'menu_index' parameter.

Obsolete. Please don't use

Value:
0

CHOOSER_MENU_JUMP

Obsolete. Please don't use.

Value:
1

CHOOSER_MENU_SEARCH

Obsolete. Please don't use.

Value:
2

MFF_FAST

Execute code as soon as possible. this mode is ok for calling ui related functions that do not query the database.

Value:
0

MFF_READ

Execute code only when ida is idle and it is safe to query the database. this mode is recommended only for code that does not modify the database. (nb: ida may be in the middle of executing another user request, for example it may be waiting for him to enter values into a modal dialog box)

Value:
1

MFF_WRITE

Execute code only when ida is idle and it is safe to modify the database. in particular, this flag will suspend execution if there is a modal dialog box on the screen this mode can be used to call any ida api function 'MFF_WRITE' implies 'MFF_READ'

Value:
2

MFF_NOWAIT

Do not wait for the request to be executed. the caller should ensure that the request is not destroyed until the execution completes. if not, the request will be ignored. 'execute_sync()' returns the request id in this case. it can be used in 'cancel_exec_request()' . This flag can be used to delay the code execution until the next UI loop run even from the main thread.

Value:
4

UIJMP_DONTPUSH

in the navigation history

do not remember the current address

Value:
2

ADF_OWN_HANDLER

handler is owned by the action; it'll be destroyed when the action is unregistered. You shouldn't have to use this.

Value:
1

ADF_NO_UNDO

useful for actions that do not modify the database.

the action does not create an undo point.

Value:
2

DP_BEFORE

used with 'DP_INSIDE' .

place src_form before dst_form in the tab bar instead of after

Value:
32