Module ida_kernwin
[frames] | no frames]

Module ida_kernwin

IDA Plugin SDK API wrapper: kernwin

Classes
  Choose
Chooser wrapper class.
  CustomIDAMemo
  Form
  IDAViewWrapper
Deprecated.
  PluginForm
PluginForm class.
  UI_Hooks
Proxy of C++ UI_Hooks class.
  View_Hooks
Proxy of C++ View_Hooks class.
  action_ctx_base_t
Proxy of C++ action_ctx_base_t class.
  action_desc_t
Proxy of C++ action_desc_t class.
  action_handler_t
  addon_info_t
Proxy of C++ addon_info_t class.
  chooser_item_attrs_t
Proxy of C++ chooser_item_attrs_t class.
  cli_t
cli_t wrapper class.
  disasm_line_t
Proxy of C++ disasm_line_t class.
  disasm_text_t
Proxy of C++ qvector< disasm_line_t > class.
  enumplace_t
Proxy of C++ enumplace_t class.
  idaplace_t
Proxy of C++ idaplace_t class.
  jobj_wrapper_t
Proxy of C++ jobj_wrapper_t class.
  place_t
Proxy of C++ place_t class.
  quick_widget_commands_t
  renderer_pos_info_t
Proxy of C++ renderer_pos_info_t class.
  simplecustviewer_t
The base class for implementing simple custom viewers
  simpleline_place_t
Proxy of C++ simpleline_place_t class.
  simpleline_t
Proxy of C++ simpleline_t class.
  strarray_t
Proxy of C++ strarray_t class.
  structplace_t
Proxy of C++ structplace_t class.
  sync_source_t
Proxy of C++ sync_source_t class.
  textctrl_info_t
Class representing textctrl_info_t
  twinpos_t
Proxy of C++ twinpos_t class.
  ui_requests_t
Proxy of C++ ui_requests_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.
Functions
TWidget *
TWidget__from_ptrval__(ptrval)
 
activate_widget(widget, take_focus)
Activate widget (only gui version) ( 'ui_activate_widget' ).
PyObject *
add_hotkey(hotkey, pyfunc)
Associates a function call with a hotkey.
int
add_idc_hotkey(hotkey, idcfunc)
Add hotkey for IDC function ( 'ui_add_idckey' ).
PyObject *
add_spaces(s, len)
Add space characters to the colored string so that its length will be at least 'len' characters.
int
addon_count()
Get number of installed addons.
 
analyzer_options()
Allow the user to set analyzer options.
 
ask_addr(defval, format)
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)
 
ask_for_feedback(format)
Show a message box asking to send the input file [email protected] rays.com.
 
ask_ident(defval, format)
 
ask_long(defval, format)
 
ask_seg(defval, format)
PyObject *
ask_str(defval, hist, prompt)
Asks for a long text
PyObject *
ask_text(max_size, defval, prompt)
Asks for a long text
int
ask_yn(deflt, format)
Display a dialog box and get choice from "Yes", "No", "Cancel".
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
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
attach_action_to_toolbar(toolbar_name, name)
Attach an action to an existing toolbar ( 'ui_attach_action_to_toolbar' ).
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' ).
bool
banner(wait)
Show a banner dialog box ( 'ui_banner' ).
 
beep(beep_type=beep_default)
Issue a beeping sound ( 'ui_beep' ).
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().
bool
cancel_exec_request(req_id)
Try to cancel an asynchronous exec request ( 'ui_cancel_exec_request' ).
 
choose_activate(_self)
PyObject *
choose_choose(_self)
 
choose_close(_self)
PyObject *
choose_create_embedded_chobj(_self)
ea_t
choose_entry(title)
Choose an entry point ( 'ui_choose' , 'chtype_entry' ).
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' ).
PyObject *
choose_find(title)
func_t *
choose_func(title, default_ea)
Choose a function ( 'ui_choose' , 'chtype_func' ).
TWidget *
choose_get_widget(_self)
PyObject *
choose_idasgn()
Opens the signature chooser
ea_t
choose_name(title)
Choose a name ( 'ui_choose' , 'chtype_name' ).
 
choose_refresh(_self)
segment_t *
choose_segm(title, default_ea)
Choose a segment ( 'ui_choose' , 'chtype_segm' ).
sreg_range_t *
choose_srcp(title)
Choose a segment register change point ( 'ui_choose' , 'chtype_srcp' ).
ea_t
choose_stkvar_xref(pfn, mptr)
Choose an xref to a stack variable ( 'ui_choose' , 'chtype_name' ).
struc_t *
choose_struc(title)
Choose a structure ( 'ui_choose' , 'chtype_segm' ).
str
choose_til()
Choose a type library ( 'ui_choose' , 'chtype_idatil' ).
ea_t
choose_xref(to)
Choose an xref to an address ( 'ui_choose' , 'chtype_xref' ).
 
clear_refresh_request(mask)
bool
close_chooser(title)
Close a non-modal chooser ( 'ui_close_chooser' ).
 
close_widget(widget, options)
Close widget ( 'ui_close_widget' , only gui version).
 
clr_cancelled()
Clear "Cancelled" flag ( 'ui_clr_cancelled' )
TWidget *
create_code_viewer(custview, flags=0, parent=None)
Create a code viewer ( 'ui_create_code_viewer' ).
TWidget *
create_empty_widget(title, icon=-1)
Create an empty widget, serving as a container for custom user widgets
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
create_toolbar(name, label, before=None, flags=0)
Create a toolbar with the given name, label and optional position
bool
custom_viewer_jump(v, loc, flags=0)
Append 'loc' to the viewer's history, and cause the viewer to display it.
bool
del_hotkey(pyctx)
Deletes a previously registered function hotkey
bool
del_idc_hotkey(hotkey)
Delete IDC function hotkey ( 'ui_del_idckey' ).
bool
delete_menu(name)
Delete an existing menu
bool
delete_toolbar(name)
Delete an existing toolbar
bool
detach_action_from_menu(menupath, name)
Detach an action from the menu ( 'ui_detach_action_from_menu' ).
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
detach_action_from_toolbar(toolbar_name, name)
Detach an action from the toolbar ( 'ui_detach_action_from_toolbar' ).
bool
display_copyright_warning()
Display copyright warning ( 'ui_copywarn' ).
 
display_widget(widget, options, dest_ctrl=None)
Display a widget, dock it if not done before
str
ea2str(ea)
Convert linear address to UTF-8 string.
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
enable_chooser_item_attrs(chooser_caption, enable)
Enable item-specific attributes for chooser items ( 'ui_enable_chooser_item_attrs' ).
 
error(format)
Display a fatal message in a message box and quit IDA
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.
TWidget *
find_widget(caption)
Find widget with the specified caption (only gui version) ( 'ui_find_widget' ).
 
formchgcbfa_close(p_fa, close_normally)
bool
formchgcbfa_enable_field(p_fa, fid, enable)
PyObject *
formchgcbfa_get_field_value(p_fa, fid, ft, sz)
int
formchgcbfa_get_focused_field(p_fa)
bool
formchgcbfa_move_field(p_fa, fid, x, y, w, h)
 
formchgcbfa_refresh_field(p_fa, fid)
bool
formchgcbfa_set_field_value(p_fa, fid, ft, py_val)
bool
formchgcbfa_set_focused_field(p_fa, fid)
bool
formchgcbfa_show_field(p_fa, fid, show)
 
free_custom_icon(icon_id)
Frees an icon loaded with load_custom_icon()
 
gen_disasm_text(text, ea1, ea2, truncate_lines)
Generate disassembly text for a range.
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_icon(name)
Get an action's icon ( 'ui_get_action_attr' ).
str
get_action_label(name)
Get an action's label ( 'ui_get_action_attr' ).
str
get_action_shortcut(name)
Get an action's shortcut ( 'ui_get_action_attr' ).
bool
get_action_state(name)
Get an action's state ( 'ui_get_action_attr' ).
str
get_action_tooltip(name)
Get an action's tooltip ( 'ui_get_action_attr' ).
bool
get_action_visibility(name)
Get an action's visibility ( 'ui_get_action_attr' ).
TWidget *
get_active_modal_widget()
Get the current, active modal TWidget instance.
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.
PyObject *
get_chooser_data(chooser_caption, n)
Get the text corresponding to the index N in the chooser data.
void *
get_chooser_obj(chooser_caption)
Get the underlying object of the specified chooser ( 'ui_get_chooser_obj' ).This is object is chooser-specific.
char const *
get_curline()
Get current line from the disassemble window ( 'ui_get_curline' ).
TWidget *
get_current_viewer()
Get current ida viewer (idaview or custom viewer) ( 'ui_get_current_viewer' )
TWidget *
get_current_widget()
Get a pointer to the current widget ( 'ui_get_current_widget' ).
bool
get_cursor()
Get the cursor position on the screen ( 'ui_get_cursor' ).coordinates are 0-based
char const *
get_custom_viewer_curline(custom_viewer, mouse)
Get current line of custom viewer ( 'ui_get_custom_viewer_curline' ).
bool
get_custom_viewer_location(out, custom_viewer, mouse=False)
Get the current location in a custom viewer ( 'ui_get_custom_viewer_location' ).
place_t
get_custom_viewer_place(custom_viewer, mouse)
Get current place in a custom viewer ( 'ui_get_curplace' ).See also the more complete 'get_custom_viewer_location()'
bool
get_ea_viewer_history_info(nback, nfwd, v)
Get information about what's in the history ( 'ui_ea_viewer_history_info' ).
ea_t
get_hexdump_ea(hexdump_num)
Get the current address in a hex view.
PyObject *
get_highlight(v)
Returns the currently highlighted identifier and flags
str
get_kernel_version()
Get IDA kernel version (in a string like "5.1").
ushort
get_key_code(keyname)
Get keyboard key code by its name ( 'ui_get_key_code' )
ea_t
get_navband_ea(pixel)
Translate the pixel position on the navigation band, into an address.
int
get_navband_pixel(ea)
Maps an address, onto a pixel coordinate within the navband
int
get_opnum()
Get current operand number, -1 means no operand ( 'ui_get_opnum' )
str
get_output_curline(mouse)
Get current line of output window ( 'ui_get_output_curline' ).
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
str
get_output_selected_text()
Returns selected text from output window ( 'ui_get_output_selected_text' ).
place_t
get_place_class(out_flags, out_sdk_version, id)
Get information about a previously-registered 'place_t' class.
int
get_place_class_id(name)
Get the place class ID for the place that has been registered as 'name'.
place_t
get_place_class_template(id)
See 'get_place_class()'
PyObject *
get_registered_actions()
Get a list of all currently-registered actions
ea_t
get_screen_ea()
Get the address at the screen cursor ( 'ui_screenea' )
int
get_tab_size(path)
Get the size of a tab in spaces ( 'ui_get_tab_size' ).
 
get_user_strlist_options(out)
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' )
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' ).
void *
get_viewer_user_data(viewer)
Get the user data from a custom viewer ( 'ui_get_viewer_user_data' )
str
get_widget_title(widget)
Get the TWidget's title ( 'ui_get_widget_title' ).
twidget_type_t
get_widget_type(widget)
Get the type of the TWidget * ( 'ui_get_widget_type' ).
void *
get_window_id(name=None)
Get the system-specific window ID (GUI version only)
 
hide_wait_box()
Hide the "Please wait dialog box".
 
info(format)
int
install_command_interpreter(py_obj)
Install command line interpreter ( 'ui_install_cli' )
int
internal_register_place_class(tmplate, flags, owner, sdk_version)
bool
is_action_enabled(s)
Check if the given action state is one of AST_ENABLE*.
bool
is_chooser_widget(t)
Does the given widget type specify a chooser widget?
bool
is_idaq()
Returns True or False depending if IDAPython is hosted by IDAQ
bool
is_msg_inited()
Can we use msg() functions?
bool
is_place_class_ea_capable(id)
See 'get_place_class()'
bool
is_refresh_requested(mask)
Get a refresh request state
bool
jumpto(ea, opnum=-1, uijmp_flags=0x0001)
jumpto(custom_viewer, place, x, y) -> bool
 
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
bool
load_dbg_dbginfo(path, li=None, base=BADADDR, verbose=False)
Load debugging information from a file.
ushort
lookup_key_code(key, shift, is_qt)
Get shortcut code previously created by 'ui_get_key_code' .
PyObject *
msg(o)
Display an UTF-8 string in the message window
 
msg_clear()
Clear the "Output window".
PyObject *
msg_get_lines(count=-1)
Retrieve the last 'count' lines from the output window, in reverse order (from most recent, to least recent)
bool
msg_save(path)
Save the "Output window" contents into a file
 
nomem(format)
TWidget *
open_bpts_window(ea)
Open the breakpoints window ( 'ui_open_builtin' ).
TWidget *
open_calls_window(ea)
Open the function calls window ( 'ui_open_builtin' ).
TWidget *
open_disasm_window(window_title, ranges=None)
Open a disassembly view ( 'ui_open_builtin' ).
TWidget *
open_enums_window(const_id=BADADDR)
Open the enums window ( 'ui_open_builtin' ).
TWidget *
open_exports_window(ea)
Open the exports window ( 'ui_open_builtin' ).
TWidget *
open_frame_window(pfn, offset)
Open the frame window for the given function ( 'ui_open_builtin' ).
TWidget *
open_funcs_window(ea)
Open the functions window ( 'ui_open_builtin' ).
TWidget *
open_hexdump_window(window_title)
Open a hexdump view ( 'ui_open_builtin' ).
TWidget *
open_imports_window(ea)
Open the exports window ( 'ui_open_builtin' ).
TWidget *
open_loctypes_window(ordinal)
Open the local types window ( 'ui_open_builtin' ).
TWidget *
open_modules_window()
Open the modules window ( 'ui_open_builtin' ).
TWidget *
open_names_window(ea)
Open the names window ( 'ui_open_builtin' ).
TWidget *
open_navband_window(ea, zoom)
Open the navigation band window ( 'ui_open_builtin' ).
TWidget *
open_notepad_window()
Open the notepad window ( 'ui_open_builtin' ).
TWidget *
open_problems_window(ea)
Open the problems 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_stack_window()
Open the call stack window ( 'ui_open_builtin' ).
TWidget *
open_strings_window(ea, selstart=BADADDR, selend=BADADDR)
Open the strings window ( 'ui_open_builtin' ).
TWidget *
open_structs_window(id=BADADDR, offset=0)
Open the structs window ( 'ui_open_builtin' ).
TWidget *
open_threads_window()
Open the threads window ( 'ui_open_builtin' ).
TWidget *
open_tils_window()
Open the type libraries window ( 'ui_open_builtin' ).
TWidget *
open_trace_window()
Open the trace window ( 'ui_open_builtin' ).
 
open_url(url)
Open the given url ( 'ui_open_url' )
TWidget *
open_xrefs_window(ea)
Open the cross references window ( 'ui_open_builtin' ).
enumplace_t
place_t_as_enumplace_t(p)
idaplace_t
place_t_as_idaplace_t(p)
simpleline_place_t
place_t_as_simpleline_place_t(p)
structplace_t
place_t_as_structplace_t(p)
 
plgform_close(py_link, options)
TWidget *
plgform_get_widget(py_link)
PyObject *
plgform_new()
bool
plgform_show(py_link, py_obj, caption, options=WOPN_DP_TAB|WOPN_RESTORE)
bool
process_ui_action(name, flags=0)
Invokes an IDA UI action by name
size_t
py_get_ask_form()
size_t
py_get_open_form()
int
py_load_custom_icon_data(data, format)
int
py_load_custom_icon_fn(filename)
 
py_register_compiled_form(py_form)
 
py_ss_restore_callback(err_msg, userdata)
 
py_unregister_compiled_form(py_form)
bool
pyidag_bind(_self)
bool
pyidag_unbind(_self)
bool
pyscv_add_line(py_this, py_sl)
PyObject *
pyscv_clear_lines(py_this)
 
pyscv_close(py_this)
size_t
pyscv_count(py_this)
bool
pyscv_del_line(py_this, nline)
bool
pyscv_edit_line(py_this, nline, py_sl)
PyObject *
pyscv_get_current_line(py_this, mouse, notags)
PyObject *
pyscv_get_current_word(py_this, mouse)
PyObject *
pyscv_get_line(py_this, nline)
PyObject *
pyscv_get_pos(py_this, mouse)
PyObject *
pyscv_get_selection(py_this)
TWidget *
pyscv_get_widget(py_this)
PyObject *
pyscv_init(py_link, title)
bool
pyscv_insert_line(py_this, nline, py_sl)
bool
pyscv_is_focused(py_this)
bool
pyscv_jumpto(py_this, ln, x, y)
bool
pyscv_patch_line(py_this, nline, offs, value)
bool
pyscv_refresh(py_this)
bool
pyscv_show(py_this)
str
qcleanline(cmt_char='\0', flags=((1 << 0)|(1 << 1))|(1 << 2))
Performs some cleanup operations to a line.
bool
read_range_selection(v)
Get the address range for the selected range boundaries, this is the convenient function for 'read_selection()'
bool
read_selection(v, p1, p2)
Read the user selection, and store its information in p0 (from) and p1 (to).
bool
refresh_chooser(title)
Mark a non-modal custom chooser for a refresh ( 'ui_refresh_chooser' ).
 
refresh_choosers()
 
refresh_idaview()
Refresh marked windows ( 'ui_refreshmarked' )
 
refresh_idaview_anyway()
Refresh all disassembly views ( 'ui_refresh' ), forces an immediate refresh.
 
refresh_navband(force)
Refresh navigation band if changed ( 'ui_refresh_navband' ).
bool
register_action(desc)
Create a new action ( 'ui_register_action' ).
int
register_addon(info)
Register an add-on.
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.
PyObject *
register_timer(interval, py_callback)
Register a timer
 
remove_command_interpreter(cli_idx)
Remove command line interpreter ( 'ui_install_cli' )
 
repaint_custom_viewer(custom_viewer)
Repaint the given widget immediately ( 'ui_repaint_qwidget' )
 
replace_wait_box(format)
Replace the label of "Please wait dialog box".
 
request_refresh(mask, cnd=True)
Request a refresh of a builtin window.
PyObject *
restore_database_snapshot(ss, pyfunc_or_none, pytuple_or_none)
Restore a database snapshot.
 
set_cancelled()
Set "Cancelled" flag ( 'ui_set_cancelled' )
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_is_source(code_viewer)
Specify that the given code viewer is used to display source code ( 'ui_set_custom_viewer_handler' ).
 
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_alignment(code_viewer, align)
Set alignment for lines in a code viewer ( 'ui_set_custom_viewer_handler' ).
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_radix(code_viewer, radix)
Set radix for values displayed in a code viewer ( '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' ).
bool
set_custom_viewer_qt_aware(custom_viewer)
Allow the given viewer to interpret Qt events ( 'ui_set_custom_viewer_handler' )
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.
bool
set_highlight(viewer, str, flags)
Set the highlighted identifier in the viewer ( 'ui_set_highlight' ).
PyObject *
set_nav_colorizer(new_py_colorizer)
Set a new colorizer for the navigation band.
 
set_view_renderer_type(v, rt)
Set the type of renderer to use in a view ( 'ui_set_renderer_type' )
 
show_wait_box(message)
Display a dialog box with "Please wait...".
ea_t
str2ea(str, screenEA=BADADDR)
Converts a string express to EA.
char const *
strarray(array, array_size, code)
Find a line with the specified code in the 'strarray_t' array.
bool
sync_sources(what, _with, sync)
[Un]synchronize sources
PyObject *
take_database_snapshot(ss)
Take a database snapshot ( 'ui_take_database_snapshot' ).
bool
textctrl_info_t_assign(_self, other)
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)
unsigned int
textctrl_info_t_get_flags(_self)
unsigned int
textctrl_info_t_get_tabsize(_self)
char const *
textctrl_info_t_get_text(_self)
bool
textctrl_info_t_set_flags(_self, flags)
bool
textctrl_info_t_set_tabsize(_self, tabsize)
bool
textctrl_info_t_set_text(_self, s)
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' ).
 
unmark_selection()
Unmark selection ( 'ui_unmarksel' )
bool
unregister_action(name)
Delete a previously-registered action ( 'ui_unregister_action' ).
bool
unregister_timer(py_timerctx)
Unregister a timer
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_icon(name, icon)
Update an action's icon ( 'ui_update_action_attr' ).
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_state(name, state)
Update an action's state ( 'ui_update_action_attr' ).
bool
update_action_tooltip(name, tooltip)
Update an action's tooltip ( 'ui_update_action_attr' ).
bool
update_action_visibility(name, visible)
Update an action's visibility ( 'ui_update_action_attr' ).
bool
user_cancelled()
Test the ctrl-break flag ( 'ui_test_cancelled' ).
 
warning(format)
Display a message in a message box
Variables
  AA_CHECKABLE = 6
  AA_CHECKED = 7
  AA_ICON = 4
  AA_LABEL = 1
  AA_NONE = 0
  AA_SHORTCUT = 2
  AA_STATE = 5
  AA_TOOLTIP = 3
  AA_VISIBILITY = 8
  ACF_HAS_SELECTION = 1
  ACF_XTRN_EA = 2
  ADF_NO_UNDO = 2
  ADF_OWN_HANDLER = 1
  AHF_VERSION = 1
  AHF_VERSION_MASK = 255
  ASKBTN_BTN1 = 1
  ASKBTN_BTN2 = 0
  ASKBTN_BTN3 = -1
  ASKBTN_CANCEL = -1
  ASKBTN_NO = 0
  ASKBTN_YES = 1
  AST_DISABLE = 7
  AST_DISABLE_ALWAYS = 4
  AST_DISABLE_FOR_IDB = 5
  AST_DISABLE_FOR_WIDGET = 6
  AST_ENABLE = 3
  AST_ENABLE_ALWAYS = 0
  AST_ENABLE_FOR_IDB = 1
  AST_ENABLE_FOR_WIDGET = 2
  BWN_ADDRWATCH = 47
  BWN_BPTS = 13
  BWN_CALLS = 11
  BWN_CALLS_CALLEES = 50
  BWN_CALLS_CALLERS = 49
  BWN_CALL_STACK = 17
  BWN_CHOOSER = 37
  BWN_CLI = 33
  BWN_CMDPALCSR = 43
  BWN_CMDPALWIN = 44
  BWN_CPUREGS = 40
  BWN_CUSTVIEW = 46
  BWN_CV_LINE_INFOS = 53
  BWN_DISASM = 29
  BWN_DISASMS = 29
  BWN_DISASM_ARROWS = 52
  BWN_DUMP = 30
  BWN_DUMPS = 30
  BWN_ENUMS = 27
  BWN_EXPORTS = 0
  BWN_FRAME = 25
  BWN_FUNCS = 3
  BWN_IMPORTS = 1
  BWN_LOCALS = 35
  BWN_LOCTYPS = 10
  BWN_MDVIEWCSR = 51
  BWN_MODULES = 15
  BWN_NAMES = 2
  BWN_NAVBAND = 26
  BWN_NOTEPAD = 31
  BWN_OUTPUT = 32
  BWN_PROBS = 12
  BWN_PSEUDOCODE = 48
  BWN_SCRIPTS_CSR = 58
  BWN_SEARCH = 19
  BWN_SEARCHS = 19
  BWN_SEGREGS = 6
  BWN_SEGS = 5
  BWN_SELS = 7
  BWN_SHORTCUTCSR = 38
  BWN_SHORTCUTWIN = 39
  BWN_SIGNS = 8
  BWN_SNIPPETS = 45
  BWN_SNIPPETS_CSR = 57
  BWN_SO_OFFSETS = 42
  BWN_SO_STRUCTS = 41
  BWN_SRCPTHMAP_CSR = 54
  BWN_SRCPTHUND_CSR = 55
  BWN_STACK = 17
  BWN_STKVIEW = 36
  BWN_STRINGS = 4
  BWN_STRUCTS = 28
  BWN_THREADS = 14
  BWN_TILS = 9
  BWN_TRACE = 16
  BWN_UNDOHIST = 56
  BWN_UNKNOWN = -1
  BWN_WATCH = 34
  BWN_XREFS = 18
  CB_CLOSE = -3
  CB_DESTROYING = -5
  CB_INIT = -1
  CB_INVISIBLE = -4
  CB_YES = -2
  CDVH_LINES_ALIGNMENT = 1009
  CDVH_LINES_CLICK = 1002
  CDVH_LINES_DBLCLICK = 1003
  CDVH_LINES_DRAWICON = 1005
  CDVH_LINES_ICONMARGIN = 1007
  CDVH_LINES_LINENUM = 1006
  CDVH_LINES_POPUP = 1004
  CDVH_LINES_RADIX = 1008
  CDVH_SRCVIEW = 1001
  CDVH_USERDATA = 1000
  CHCOL_DEC = 196608
  CHCOL_DEFHIDDEN = 1048576
  CHCOL_EA = 262144
  CHCOL_FNAME = 327680
  CHCOL_FORMAT = 458752
  CHCOL_HEX = 131072
  CHCOL_PATH = 65536
  CHCOL_PLAIN = 0
  CHITEM_BOLD = 1
  CHITEM_GRAY = 16
  CHITEM_ITALIC = 2
  CHITEM_STRIKE = 8
  CHITEM_UNDER = 4
  CHOOSER_MENU_EDIT = 0
  CHOOSER_MENU_JUMP = 1
  CHOOSER_MENU_SEARCH = 2
  CHOOSER_MULTI_SELECTION = 2
  CHOOSER_NOMAINMENU = 'NOMAINMENU\n'
  CHOOSER_NOSTATUSBAR = 'NOSTATUSBAR\n'
  CHOOSER_NO_SELECTION = 1
  CHOOSER_POPUP_MENU = 4
  CH_ATTRS = 32
  CH_BUILTIN_MASK = 33030144
  CH_BUILTIN_SHIFT = 19
  CH_CAN_DEL = 512
  CH_CAN_EDIT = 1024
  CH_CAN_INS = 256
  CH_CAN_REFRESH = 2048
  CH_FORCE_DEFAULT = 128
  CH_KEEP = 2
  CH_MODAL = 1
  CH_MULTI = 4
  CH_MULTI_EDIT = 8
  CH_NOBTNS = 16
  CH_NOIDB = 64
  CH_NO_STATUS_BAR = 65536
  CH_QFLT = 4096
  CH_QFTYP_DEFAULT = 0
  CH_QFTYP_FUZZY = 32768
  CH_QFTYP_MASK = 57344
  CH_QFTYP_NORMAL = 8192
  CH_QFTYP_REGEX = 24576
  CH_QFTYP_SHIFT = 13
  CH_QFTYP_WHOLE_WORDS = 16384
  CH_RESTORE = 131072
  CLNL_FINDCMT = 4
  CLNL_LTRIM = 2
  CLNL_RTRIM = 1
  CLNL_TRIM = 3
  CREATETB_ADV = 1
  CVH_CLICK = 6
  CVH_CLOSE = 5
  CVH_CURPOS = 4
  CVH_DBLCLICK = 3
  CVH_HELP = 8
  CVH_KEYDOWN = 1
  CVH_MOUSEMOVE = 9
  CVH_POPUP = 2
  CVH_QT_AWARE = 7
  CVH_USERDATA = 0
  DEFAULT_PLACE_LNNUM = -1
  DP_BEFORE = 32
  DP_BOTTOM = 8
  DP_FLOATING = 128
  DP_INSIDE = 16
  DP_LEFT = 1
  DP_RIGHT = 4
  DP_TAB = 64
  DP_TOP = 2
  HIF_IDENTIFIER = 1
  HIF_LOCKED = 4
  HIF_NOCASE = 8
  HIF_REGISTER = 2
  HIST_CMD = 7
  HIST_CMT = 2
  HIST_DIR = 8
  HIST_FILE = 5
  HIST_IDENT = 4
  HIST_SEG = 1
  HIST_SRCH = 3
  HIST_TYPE = 6
  IK_ADD = 107
  IK_APPS = 93
  IK_BACK = 8
  IK_BROWSER_BACK = 166
  IK_BROWSER_FAVORITES = 171
  IK_BROWSER_FORWARD = 167
  IK_BROWSER_HOME = 172
  IK_BROWSER_REFRESH = 168
  IK_BROWSER_SEARCH = 170
  IK_BROWSER_STOP = 169
  IK_CANCEL = 3
  IK_CAPITAL = 20
  IK_CLEAR = 12
  IK_CONTROL = 17
  IK_DECIMAL = 110
  IK_DELETE = 46
  IK_DIVIDE = 111
  IK_DOWN = 40
  IK_END = 35
  IK_ESCAPE = 27
  IK_EXECUTE = 43
  IK_F1 = 112
  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_F2 = 113
  IK_F20 = 131
  IK_F21 = 132
  IK_F22 = 133
  IK_F23 = 134
  IK_F24 = 135
  IK_F3 = 114
  IK_F4 = 115
  IK_F5 = 116
  IK_F6 = 117
  IK_F7 = 118
  IK_F8 = 119
  IK_F9 = 120
  IK_HELP = 47
  IK_HOME = 36
  IK_INSERT = 45
  IK_KANA = 21
  IK_LAUNCH_APP1 = 182
  IK_LAUNCH_APP2 = 183
  IK_LAUNCH_MAIL = 180
  IK_LAUNCH_MEDIA_SELECT = 181
  IK_LCONTROL = 162
  IK_LEFT = 37
  IK_LMENU = 164
  IK_LSHIFT = 160
  IK_LWIN = 91
  IK_MEDIA_NEXT_TRACK = 176
  IK_MEDIA_PLAY_PAUSE = 179
  IK_MEDIA_PREV_TRACK = 177
  IK_MEDIA_STOP = 178
  IK_MENU = 18
  IK_MODECHANGE = 31
  IK_MULTIPLY = 106
  IK_NEXT = 34
  IK_NUMLOCK = 144
  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_OEM_1 = 186
  IK_OEM_102 = 226
  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_CLEAR = 254
  IK_OEM_COMMA = 188
  IK_OEM_FJ_MASSHOU = 147
  IK_OEM_FJ_TOUROKU = 148
  IK_OEM_MINUS = 189
  IK_OEM_PERIOD = 190
  IK_OEM_PLUS = 187
  IK_PAUSE = 19
  IK_PLAY = 250
  IK_PRINT = 42
  IK_PRIOR = 33
  IK_RCONTROL = 163
  IK_RETURN = 13
  IK_RIGHT = 39
  IK_RMENU = 165
  IK_RSHIFT = 161
  IK_RWIN = 92
  IK_SCROLL = 145
  IK_SELECT = 41
  IK_SEPARATOR = 108
  IK_SHIFT = 16
  IK_SLEEP = 95
  IK_SNAPSHOT = 44
  IK_SPACE = 32
  IK_SUBTRACT = 109
  IK_TAB = 9
  IK_UP = 38
  IK_VOLUME_DOWN = 174
  IK_VOLUME_MUTE = 173
  IK_VOLUME_UP = 175
  IK_ZOOM = 251
  IWID_ADDRWATCH = 140737488355328
  IWID_ALL = 18446744073709551615
  IWID_BPTS = 8192
  IWID_CALLS = 2048
  IWID_CALLS_CALLEES = 1125899906842624
  IWID_CALLS_CALLERS = 562949953421312
  IWID_CALL_STACK = 131072
  IWID_CHOOSER = 137438953472
  IWID_CLI = 8589934592
  IWID_CMDPALCSR = 8796093022208
  IWID_CMDPALWIN = 17592186044416
  IWID_CPUREGS = 1099511627776
  IWID_CUSTVIEW = 70368744177664
  IWID_CV_LINE_INFOS = 9007199254740992
  IWID_DISASM = 536870912
  IWID_DISASMS = 536870912
  IWID_DISASM_ARROWS = 4503599627370496
  IWID_DUMP = 1073741824
  IWID_DUMPS = 1073741824
  IWID_ENUMS = 134217728
  IWID_EXPORTS = 1
  IWID_FRAME = 33554432
  IWID_FUNCS = 8
  IWID_IMPORTS = 2
  IWID_LOCALS = 34359738368
  IWID_LOCTYPS = 1024
  IWID_MDVIEWCSR = 2251799813685248
  IWID_MODULES = 32768
  IWID_NAMES = 4
  IWID_NAVBAND = 67108864
  IWID_NOTEPAD = 2147483648
  IWID_OUTPUT = 4294967296
  IWID_PROBS = 4096
  IWID_PSEUDOCODE = 281474976710656
  IWID_SCRIPTS_CSR = 288230376151711744
  IWID_SEARCH = 524288
  IWID_SEARCHS = 524288
  IWID_SEGREGS = 64
  IWID_SEGS = 32
  IWID_SELS = 128
  IWID_SHORTCUTCSR = 274877906944
  IWID_SHORTCUTWIN = 549755813888
  IWID_SIGNS = 256
  IWID_SNIPPETS = 35184372088832
  IWID_SNIPPETS_CSR = 144115188075855872
  IWID_SO_OFFSETS = 4398046511104
  IWID_SO_STRUCTS = 2199023255552
  IWID_SRCPTHMAP_CSR = 18014398509481984
  IWID_SRCPTHUND_CSR = 36028797018963968
  IWID_STACK = 131072
  IWID_STKVIEW = 68719476736
  IWID_STRINGS = 16
  IWID_STRUCTS = 268435456
  IWID_THREADS = 16384
  IWID_TILS = 512
  IWID_TRACE = 65536
  IWID_UNDOHIST = 72057594037927936
  IWID_WATCH = 17179869184
  IWID_XREFS = 262144
  MFF_FAST = 0
  MFF_NOWAIT = 4
  MFF_READ = 1
  MFF_WRITE = 2
  PCF_EA_CAPABLE = 1
  REG_HINTS_MARKER = '\x01\x7f'
  REG_HINTS_MARKER_LEN = 2
  SETMENU_APP = 1
  SETMENU_FIRST = 2
  SETMENU_INS = 0
  SETMENU_POSMASK = 3
  SRCDBG_HINTS_MARKER = '\x01~'
  SRCDBG_HINTS_MARKER_LEN = 2
  SWIG_PYTHON_LEGACY_BOOL = 1
  TCCPT_ENUMPLACE = 4
  TCCPT_IDAPLACE = 3
  TCCPT_INVALID = 0
  TCCPT_PLACE = 1
  TCCPT_SIMPLELINE_PLACE = 2
  TCCPT_STRUCTPLACE = 5
  TCCRT_FLAT = 1
  TCCRT_GRAPH = 2
  TCCRT_INVALID = 0
  TCCRT_PROXIMITY = 3
  UIJMP_ACTIVATE = 1
  UIJMP_ANYVIEW = 0
  UIJMP_DONTPUSH = 2
  UIJMP_IDAVIEW = 4
  UIJMP_IDAVIEW_NEW = 8
  UIJMP_VIEWMASK = 12
  VES_ALT = 2
  VES_CTRL = 4
  VES_META = 128
  VES_MOUSE_LEFT = 8
  VES_MOUSE_MIDDLE = 32
  VES_MOUSE_RIGHT = 16
  VES_SHIFT = 1
  VME_LEFT_BUTTON = 1
  VME_MID_BUTTON = 3
  VME_RIGHT_BUTTON = 2
  VME_UNKNOWN = 0
  __package__ = None
  beep_default = 0
  chtype_entry = 2
  chtype_enum = 6
  chtype_enum_by_value = 7
  chtype_enum_by_value_and_size = 13
  chtype_func = 8
  chtype_generic = 0
  chtype_idasgn = 1
  chtype_idatil = 12
  chtype_name = 3
  chtype_segm = 9
  chtype_srcp = 14
  chtype_stkvar_xref = 4
  chtype_strpath = 11
  chtype_struc = 10
  chtype_xref = 5
  cvar = ??
  mbox_error = 3
  mbox_feedback = 5
  mbox_filestruct = 8
  mbox_hide = 10
  mbox_info = 1
  mbox_internal = 0
  mbox_nomem = 4
  mbox_readerror = 6
  mbox_replace = 11
  mbox_wait = 9
  mbox_warning = 2
  mbox_writeerror = 7
  msg_activated = 0
  msg_click = 2
  msg_closed = 4
  msg_dblclick = 3
  msg_deactivated = 1
  msg_keydown = 5
  nat_auto = 9
  nat_cod = 2
  nat_cur = 8
  nat_dat = 3
  nat_err = 6
  nat_ext = 5
  nat_fun = 1
  nat_gap = 7
  nat_last = 11
  nat_lib = 0
  nat_lum = 10
  nat_und = 4
  view_activated = 0
  view_click = 3
  view_close = 7
  view_created = 6
  view_curpos = 5
  view_dblclick = 4
  view_deactivated = 1
  view_keydown = 2
  view_loc_changed = 10
  view_mouse_moved = 11
  view_mouse_over = 9
  view_switched = 8
Function Details

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)

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.

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

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

analyzer_options()

 

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

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)

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 *)

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

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_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 .

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

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

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

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

banner(wait)

 

Show a banner dialog box ( 'ui_banner' ).

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

beep(beep_type=beep_default)

 

Issue a beeping sound ( 'ui_beep' ).

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

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

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_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_idasgn()

 

Opens the signature chooser

Returns: PyObject *
None or the selected signature name

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_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_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

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_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_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

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

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)

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 *

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 *

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

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

custom_viewer_jump(v, loc, flags=0)

 

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

del_hotkey(pyctx)

 

Deletes a previously registered function hotkey

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

del_idc_hotkey(hotkey)

 

Delete IDC function hotkey ( 'ui_del_idckey' ).

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

delete_menu(name)

 

Delete an existing menu

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

delete_toolbar(name)

 

Delete an existing toolbar

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

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

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

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

display_copyright_warning()

 

Display copyright warning ( 'ui_copywarn' ).

Returns: bool
yes/no

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 *)

ea2str(ea)

 

Convert linear address to UTF-8 string.

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

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

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

error(format)

 

Display a fatal message in a message box and quit IDA

Parameters:
  • format - message to print

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.

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

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)

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_icon(name)

 

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

Parameters:
  • name - the action name (C++: const char *)
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: str
success

get_action_shortcut(name)

 

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

Parameters:
  • name - the action name (C++: const char *)
Returns: str
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_tooltip(name)

 

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

Parameters:
  • name - the action name (C++: const char *)
Returns: str
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

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_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

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 *

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

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)

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_custom_viewer_location(out, custom_viewer, mouse=False)

 

Get the current location in a custom viewer ( 'ui_get_custom_viewer_location' ).

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

get_custom_viewer_place(custom_viewer, mouse)

 

Get current place in a custom viewer ( 'ui_get_curplace' ).See also the more complete 'get_custom_viewer_location()'

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

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

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_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.

get_key_code(keyname)

 

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

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

get_navband_ea(pixel)

 

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

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

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_output_curline(mouse)

 

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

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

get_output_selected_text()

 

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

Returns: str
true if there is a selection

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_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

get_place_class_template(id)

 

See 'get_place_class()'

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

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

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

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

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_widget_title(widget)

 

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

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

get_widget_type(widget)

 

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

Parameters:
  • widget, (C++ - TWidget *)
Returns: twidget_type_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

is_action_enabled(s)

 

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

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

is_chooser_widget(t)

 

Does the given widget type specify a chooser widget?

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

is_place_class_ea_capable(id)

 

See 'get_place_class()'

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

is_refresh_requested(mask)

 

Get a refresh request state

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

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

 

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

Jump to the specified address ( 'ui_jumpto' ).

Parameters:
  • ea - destination (C++: ea_t)
  • opnum - -1: don't change x coord (C++: int)
  • uijmp_flags - Jump flags (C++: int)
Returns: bool
success

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

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

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

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 *

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 *

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

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_calls_window(ea)

 

Open the function calls window ( 'ui_open_builtin' ).

Parameters:
  • ea, (C++ - ea_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_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_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_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_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_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_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_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_modules_window()

 

Open the modules window ( 'ui_open_builtin' ).

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_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_notepad_window()

 

Open the notepad window ( 'ui_open_builtin' ).

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_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_stack_window()

 

Open the call stack window ( 'ui_open_builtin' ).

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_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_threads_window()

 

Open the threads 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_trace_window()

 

Open the trace window ( 'ui_open_builtin' ).

Returns: TWidget *
pointer to resulting window

open_url(url)

 

Open the given url ( 'ui_open_url' )

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

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

process_ui_action(name, flags=0)

 

Invokes an IDA UI action by name

Parameters:
  • name - action name
Returns: bool
Boolean

qcleanline(cmt_char='\0', 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: str
length of line

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

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.

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

refresh_idaview_anyway()

 

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

refresh_navband(force)

 

Refresh navigation band if changed ( 'ui_refresh_navband' ).

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

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

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

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

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

repaint_custom_viewer(custom_viewer)

 

Repaint the given widget immediately ( 'ui_repaint_qwidget' )

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

replace_wait_box(format)

 

Replace the label of "Please wait dialog box".

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

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)

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.

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_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

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_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_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_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_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

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

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

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

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 *

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)

show_wait_box(message)

 

Display a dialog box with "Please wait...". If the text message starts with "HIDECANCEL\n", 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.

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

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 *

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

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

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

unregister_action(name)

 

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

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

unregister_timer(py_timerctx)

 

Unregister a timer

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

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

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_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_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_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_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_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

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