IDAPython 8.4
Loading...
Searching...
No Matches
ida_idaapi Namespace Reference

Classes

class  IDAPython_displayhook
 
class  loader_input_t
 A helper class to work with linput_t related functions. More...
 
class  object_t
 Helper class used to initialize empty objects. More...
 
class  plugin_t
 Base class for all scripted plugins. More...
 
class  plugmod_t
 Base class for all scripted multi-plugins. More...
 
class  py_clinked_object_t
 This is a utility and base class for C linked objects. More...
 
class  pyidc_cvt_helper__
 This is a special helper object that helps detect which kind of object is this python object wrapping and how to convert it back and from IDC. More...
 
class  PyIdc_cvt_int64__
 Helper class for explicitly representing VT_INT64 values. More...
 
class  PyIdc_cvt_refclass__
 Helper class for representing references to immutable objects. More...
 
class  pyidc_opaque_object_t
 This is the base class for all Python<->IDC opaque objects. More...
 

Functions

 require (modulename, package=None)
 Load, or reload a module.
 
 _replace_module_function (replacement)
 
 replfun (func)
 
 _qvector_front (self)
 
 _qvector_back (self)
 
 _bounded_getitem_iterator (self)
 
 as_cstr (val)
 Returns a C str from the passed value.
 
 as_UTF16 (s)
 Convenience function to convert a string into appropriate unicode format.
 
 as_uint32 (v)
 Returns a number as an unsigned int32 number.
 
 as_int32 (v)
 Returns a number as a signed int32 number.
 
 as_signed (v, nbits=32)
 Returns a number as signed.
 
 TRUNC (ea)
 Truncate EA for the current application bitness.
 
 copy_bits (v, s, e=-1)
 Copy bits from a value.
 
 struct_unpack (buffer, signed=False, offs=0)
 Unpack a buffer given its length and offset using struct.unpack_from().
 
 IDAPython_ExecSystem (cmd)
 Executes a command with popen().
 
 IDAPython_FormatExc (etype, value=None, tb=None, limit=None)
 This function is used to format an exception given the values returned by a PyErr_Fetch()
 
 IDAPython_ExecScript (path, g, print_error=True)
 Run the specified script.
 
 IDAPython_LoadProcMod (path, g, print_error=True)
 Load processor module.
 
 IDAPython_UnLoadProcMod (script, g, print_error=True)
 Unload processor module.
 
 _listify_types (*classes)
 
 notify_when (when, callback)
 Register a callback that will be called when an event happens.
 
 _make_one_time_warning_message (bad_attr, new_attr)
 
 _make_missed_695bwcompat_property (bad_attr, new_attr, has_setter)
 
"PyObject *" parse_command_line3 (*args)
 parse_command_line3(cmdline) -> PyObject *
 
"idainfo *" get_inf_structure (*args)
 get_inf_structure() -> idainfo Returns the global variable 'inf' (an instance of idainfo structure, see ida.hpp)
 
"int" set_script_timeout (*args)
 set_script_timeout(timeout) -> int Changes the script timeout value.
 
"void" disable_script_timeout (*args)
 disable_script_timeout() Disables the script timeout and hides the script wait box.
 
"void" enable_extlang_python (*args)
 enable_extlang_python(enable) Enables or disables Python extlang.
 
"void" enable_python_cli (*args)
 enable_python_cli(enable)
 
"PyObject *" format_basestring (*args)
 format_basestring(_in) -> str
 
"void" pygc_refresh (*args)
 pygc_refresh(_self)
 
"PyObject *" pygc_create_groups (*args)
 pygc_create_groups(_self, groups_infos) -> [int, ...] or None
 
"PyObject *" pygc_delete_groups (*args)
 pygc_delete_groups(_self, groups, new_current) -> bool
 
"PyObject *" pygc_set_groups_visibility (*args)
 pygc_set_groups_visibility(_self, groups, expand, new_current) -> bool
 
"TWidget *" pycim_get_widget (*args)
 pycim_get_widget(_self) -> TWidget *
 
"void" pycim_view_close (*args)
 pycim_view_close(_self)
 
"loader_input_t *" loader_input_t_from_linput (*args)
 loader_input_t_from_linput(linput) -> loader_input_t
 
"loader_input_t *" loader_input_t_from_capsule (*args)
 loader_input_t_from_capsule(pycapsule) -> loader_input_t
 
"loader_input_t *" loader_input_t_from_fp (*args)
 loader_input_t_from_fp(fp) -> loader_input_t
 

Variables

 BADADDR = _ida_idaapi.BADADDR
 
 BADADDR32 = _ida_idaapi.BADADDR32
 
 BADADDR64 = _ida_idaapi.BADADDR64
 
 BADSEL = _ida_idaapi.BADSEL
 
 SIZE_MAX = _ida_idaapi.SIZE_MAX
 
tuple integer_types = (int, long)
 
tuple string_types = (str, unicode)
 
 long_type = long
 
int SEEK_SET = 0
 
int SEEK_CUR = 1
 
int SEEK_END = 2
 
int PLUGIN_MOD = 0x0001
 
int PLUGIN_DRAW = 0x0002
 
int PLUGIN_SEG = 0x0004
 
int PLUGIN_UNL = 0x0008
 
int PLUGIN_HIDE = 0x0010
 
int PLUGIN_DBG = 0x0020
 
int PLUGIN_PROC = 0x0040
 
int PLUGIN_FIX = 0x0080
 
int PLUGIN_MULTI = 0x0100
 
int PLUGIN_SKIP = 0
 
int PLUGIN_OK = 1
 
int PLUGIN_KEEP = 2
 
int PY_ICID_INT64 = 0
 
int PY_ICID_BYREF = 1
 
int PY_ICID_OPAQUE = 2
 
int ST_OVER_DEBUG_SEG = 0x01
 
int ST_OVER_LIB_FUNC = 0x02
 
 as_unicode = as_UTF16
 
 IDAPython_Completion = __IDAPython_Completion_Util()
 
int NW_OPENIDB = 0x0001
 
int NW_CLOSEIDB = 0x0002
 
int NW_INITIDA = 0x0004
 
int NW_TERMIDA = 0x0008
 
int NW_REMOVE = 0x0010
 
 _notify_when_dispatcher = None
 
 _IDAPython_displayhook = IDAPython_displayhook()
 
 displayhook
 
 HBF_CALL_WITH_NEW_EXEC = _ida_idaapi.HBF_CALL_WITH_NEW_EXEC
 
 HBF_VOLATILE_METHOD_SET = _ida_idaapi.HBF_VOLATILE_METHOD_SET
 
 at = cls.__getitem__
 
 append = cls.push_back
 

Function Documentation

◆ _bounded_getitem_iterator()

_bounded_getitem_iterator ( self)
protected
Helper function, to be set as __iter__ method for qvector-, or array-based classes.

◆ _listify_types()

_listify_types ( * classes)
protected

◆ _make_missed_695bwcompat_property()

_make_missed_695bwcompat_property ( bad_attr,
new_attr,
has_setter )
protected

◆ _make_one_time_warning_message()

_make_one_time_warning_message ( bad_attr,
new_attr )
protected

◆ _qvector_back()

_qvector_back ( self)
protected

◆ _qvector_front()

_qvector_front ( self)
protected

◆ _replace_module_function()

_replace_module_function ( replacement)
protected

◆ as_cstr()

as_cstr ( val)

The passed value can be of type refclass (returned by a call to buffer() or byref()) It scans for the first \x00 and returns the string value up to that point.

◆ as_int32()

as_int32 ( v)

◆ as_signed()

as_signed ( v,
nbits = 32 )

The number of bits are specified by the user. The MSB holds the sign.

◆ as_uint32()

as_uint32 ( v)

◆ as_UTF16()

as_UTF16 ( s)

◆ copy_bits()

copy_bits ( v,
s,
e = -1 )
Parameters
vthe value
sstarting bit (0-based)
eending bit

◆ disable_script_timeout()

"void" disable_script_timeout ( * args)

Calling L{set_script_timeout} will not have any effects until the script is compiled and executed again

Returns
: None

◆ enable_extlang_python()

"void" enable_extlang_python ( * args)

When enabled, all expressions will be evaluated by Python.

Parameters
enableSet to True to enable, False otherwise

◆ enable_python_cli()

"void" enable_python_cli ( * args)
Parameters
enablebool

◆ format_basestring()

"PyObject *" format_basestring ( * args)
Parameters
_inPyObject *

◆ get_inf_structure()

"idainfo *" get_inf_structure ( * args)

◆ IDAPython_ExecScript()

IDAPython_ExecScript ( path,
g,
print_error = True )

This function is used by the low-level plugin code.

◆ IDAPython_ExecSystem()

IDAPython_ExecSystem ( cmd)

◆ IDAPython_FormatExc()

IDAPython_FormatExc ( etype,
value = None,
tb = None,
limit = None )

◆ IDAPython_LoadProcMod()

IDAPython_LoadProcMod ( path,
g,
print_error = True )

◆ IDAPython_UnLoadProcMod()

IDAPython_UnLoadProcMod ( script,
g,
print_error = True )

◆ loader_input_t_from_capsule()

"loader_input_t *" loader_input_t_from_capsule ( * args)
Parameters
pycapsulePyObject *

◆ loader_input_t_from_fp()

"loader_input_t *" loader_input_t_from_fp ( * args)
Parameters
fpFILE *

◆ loader_input_t_from_linput()

"loader_input_t *" loader_input_t_from_linput ( * args)
Parameters
linputlinput_t *

◆ notify_when()

notify_when ( when,
callback )
Parameters
whenone of NW_XXXX constants
callbackThis callback prototype varies depending on the 'when' parameter: The general callback format: def notify_when_callback(nw_code) In the case of NW_OPENIDB: def notify_when_callback(nw_code, is_old_database)
Returns
: Boolean

◆ parse_command_line3()

"PyObject *" parse_command_line3 ( * args)
Parameters
cmdlinechar const *

◆ pycim_get_widget()

"TWidget *" pycim_get_widget ( * args)
Parameters
selfPyObject *

◆ pycim_view_close()

"void" pycim_view_close ( * args)
Parameters
selfPyObject *

◆ pygc_create_groups()

"PyObject *" pygc_create_groups ( * args)
Parameters
selfPyObject *
groups_infosPyObject *

◆ pygc_delete_groups()

"PyObject *" pygc_delete_groups ( * args)
Parameters
selfPyObject *
groupsPyObject *
new_currentPyObject *

◆ pygc_refresh()

"void" pygc_refresh ( * args)
Parameters
selfPyObject *

◆ pygc_set_groups_visibility()

"PyObject *" pygc_set_groups_visibility ( * args)
Parameters
selfPyObject *
groupsPyObject *
expandPyObject *
new_currentPyObject *

◆ replfun()

replfun ( func)

◆ require()

require ( modulename,
package = None )

When under heavy development, a user's tool might consist of multiple modules. If those are imported using the standard 'import' mechanism, there is no guarantee that the Python implementation will re-read and re-evaluate the module's Python code. In fact, it usually doesn't. What should be done instead is 'reload()'-ing that module.

This is a simple helper function that will do just that: In case the module doesn't exist, it 'import's it, and if it does exist, 'reload()'s it.

The importing module (i.e., the module calling require()) will have the loaded module bound to its globals(), under the name 'modulename'. (If require() is called from the command line, the importing module will be 'main'.)

For more information, see: http://www.hexblog.com/?p=749.

◆ set_script_timeout()

"int" set_script_timeout ( * args)

The script wait box dialog will be hidden and shown again when the timeout elapses. See also L{disable_script_timeout}.

Parameters
timeoutThis value is in seconds. If this value is set to zero then the script will never timeout.
Returns
: Returns the old timeout value

◆ struct_unpack()

struct_unpack ( buffer,
signed = False,
offs = 0 )

This function will know how to unpack the given buffer by using the lookup table '__struct_unpack_table' If the buffer is of unknown length then None is returned. Otherwise the unpacked value is returned.

◆ TRUNC()

TRUNC ( ea)

Variable Documentation

◆ _IDAPython_displayhook

_IDAPython_displayhook = IDAPython_displayhook()
protected

◆ _notify_when_dispatcher

_notify_when_dispatcher = None
protected

◆ append

append = cls.push_back

◆ as_unicode

as_unicode = as_UTF16

◆ at

at = cls.__getitem__

◆ BADADDR

BADADDR = _ida_idaapi.BADADDR

◆ BADADDR32

BADADDR32 = _ida_idaapi.BADADDR32

◆ BADADDR64

BADADDR64 = _ida_idaapi.BADADDR64

◆ BADSEL

BADSEL = _ida_idaapi.BADSEL

◆ displayhook

displayhook

◆ HBF_CALL_WITH_NEW_EXEC

HBF_CALL_WITH_NEW_EXEC = _ida_idaapi.HBF_CALL_WITH_NEW_EXEC

◆ HBF_VOLATILE_METHOD_SET

HBF_VOLATILE_METHOD_SET = _ida_idaapi.HBF_VOLATILE_METHOD_SET

◆ IDAPython_Completion

IDAPython_Completion = __IDAPython_Completion_Util()

◆ integer_types

tuple integer_types = (int, long)

◆ long_type

long_type = long

◆ NW_CLOSEIDB

int NW_CLOSEIDB = 0x0002

◆ NW_INITIDA

int NW_INITIDA = 0x0004

◆ NW_OPENIDB

int NW_OPENIDB = 0x0001

◆ NW_REMOVE

int NW_REMOVE = 0x0010

◆ NW_TERMIDA

int NW_TERMIDA = 0x0008

◆ PLUGIN_DBG

int PLUGIN_DBG = 0x0020

◆ PLUGIN_DRAW

int PLUGIN_DRAW = 0x0002

◆ PLUGIN_FIX

int PLUGIN_FIX = 0x0080

◆ PLUGIN_HIDE

int PLUGIN_HIDE = 0x0010

◆ PLUGIN_KEEP

int PLUGIN_KEEP = 2

◆ PLUGIN_MOD

int PLUGIN_MOD = 0x0001

◆ PLUGIN_MULTI

int PLUGIN_MULTI = 0x0100

◆ PLUGIN_OK

int PLUGIN_OK = 1

◆ PLUGIN_PROC

int PLUGIN_PROC = 0x0040

◆ PLUGIN_SEG

int PLUGIN_SEG = 0x0004

◆ PLUGIN_SKIP

int PLUGIN_SKIP = 0

◆ PLUGIN_UNL

int PLUGIN_UNL = 0x0008

◆ PY_ICID_BYREF

int PY_ICID_BYREF = 1

◆ PY_ICID_INT64

int PY_ICID_INT64 = 0

◆ PY_ICID_OPAQUE

int PY_ICID_OPAQUE = 2

◆ SEEK_CUR

int SEEK_CUR = 1

◆ SEEK_END

int SEEK_END = 2

◆ SEEK_SET

int SEEK_SET = 0

◆ SIZE_MAX

SIZE_MAX = _ida_idaapi.SIZE_MAX

◆ ST_OVER_DEBUG_SEG

int ST_OVER_DEBUG_SEG = 0x01

◆ ST_OVER_LIB_FUNC

int ST_OVER_LIB_FUNC = 0x02

◆ string_types

tuple string_types = (str, unicode)