func_chooser

summary: implement an alternative “Functions” window

description:

Partially re-implements the “Functions” widget present in IDA, with a custom widget.

keywords: chooser, functions

see_also: choose, choose_multi

level: intermediate

Classes

my_funcs_t

Chooser wrapper class.

Functions

show_my_funcs_t([modal])

Module Contents

class func_chooser.my_funcs_t(title)

Bases: ida_kernwin.Choose

Chooser wrapper class.

Some constants are defined in this class. Please refer to kernwin.hpp for more information.

items = []
icon
OnInit()

Initialize the chooser and populate it.

This callback is optional

OnGetSize()

Get the number of elements in the chooser.

This callback is mandatory

Returns:

the number of elements

OnGetLine(n)

Get data for an element

This callback is mandatory

Parameters:

n – the index to fetch data for

Returns:

a list of strings

OnDeleteLine(n)

User deleted an element

Parameters:

sel – the current selection

Returns:

a tuple (changed, selection)

OnGetEA(n)

Get the address of an element

When this function returns valid addresses:
  • If any column has the CHCOL_FNAME flag, rows will be colored according to the attributes of the functions who own those addresses (extern, library function, Lumina, … - similar to what the “Functions” widget does)

  • When a selection is present and the user presses <Enter> (<Shift+Enter> if the chooser is modal), IDA will jump to that address (through jumpto())

Parameters:

n – element number (0-based)

Returns:

the effective address, ida_idaapi.BADADDR if the element has no address

OnRefresh(n)

The chooser needs to be refreshed. It returns the new positions of the selected items.

Parameters:

sel – the current selection

Returns:

a tuple (changed, selection)

OnClose()

The chooser window is closed.

func_chooser.show_my_funcs_t(modal=False)