Module ida_idaapi
[frames] | no frames]

Module ida_idaapi

IDA Plugin SDK API wrapper: idaapi

Classes
  IDAPython_displayhook
  PyIdc_cvt_int64__
Helper class for explicitly representing VT_INT64 values
  PyIdc_cvt_refclass__
Helper class for representing references to immutable objects
  loader_input_t
Proxy of C++ loader_input_t class.
  object_t
Helper class used to initialize empty objects
  plugin_t
Base class for all scripted plugins.
  py_clinked_object_t
This is a utility and base class for C linked objects
  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.
  pyidc_opaque_object_t
This is the base class for all Python<->IDC opaque objects
Functions
 
IDAPython_ExecScript(script, g, print_error=True)
Run the specified script.
 
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_LoadProcMod(script, g, print_error=True)
Load processor module.
 
IDAPython_UnLoadProcMod(script, g, print_error=True)
Unload processor module.
 
as_UTF16(s)
Convenience function to convert a string into appropriate unicode format
 
as_cstr(val)
Returns a C str from the passed value.
 
as_int32(v)
Returns a number as a signed int32 number
 
as_signed(v, nbits=32)
Returns a number as signed.
 
as_uint32(v)
Returns a number as an unsigned int32 number
 
as_unicode(s)
Convenience function to convert a string into appropriate unicode format
 
copy_bits(v, s, e=-1)
Copy bits from a value
 
disable_script_timeout()
Disables the script timeout and hides the script wait box.
 
enable_extlang_python(enable)
Enables or disables Python extlang.
 
enable_python_cli(enable)
PyObject *
format_basestring(_in)
idainfo
get_inf_structure()
Returns the global variable 'inf' (an instance of idainfo structure, see ida.hpp)
loader_input_t
loader_input_t_from_capsule(pycapsule)
loader_input_t
loader_input_t_from_fp(fp)
loader_input_t
loader_input_t_from_linput(linput)
 
notify_when(when, callback)
Register a callback that will be called when an event happens.
PyObject *
parse_command_line3(cmdline)
TWidget *
pycim_get_widget(_self)
 
pycim_view_close(_self)
PyObject *
pygc_create_groups(_self, groups_infos)
PyObject *
pygc_delete_groups(_self, groups, new_current)
 
pygc_refresh(_self)
PyObject *
pygc_set_groups_visibility(_self, groups, expand, new_current)
 
replfun(func)
 
require(modulename, package=None)
Load, or reload a module.
int
set_script_timeout(timeout)
Changes the script timeout value.
 
struct_unpack(buffer, signed=False, offs=0)
Unpack a buffer given its length and offset using struct.unpack_from().
Variables
  BADADDR = 4294967295
  BADSEL = 4294967295
  HBF_CALL_WITH_NEW_EXEC = 1
  HBF_VOLATILE_METHOD_SET = 2
  IDAPython_Completion = <ida_idaapi.__IDAPython_Completion_Util...
  NW_CLOSEIDB = 2
  NW_INITIDA = 4
  NW_OPENIDB = 1
  NW_REMOVE = 16
  NW_TERMIDA = 8
  PLUGIN_DBG = 32
  PLUGIN_DRAW = 2
  PLUGIN_FIX = 128
  PLUGIN_HIDE = 16
  PLUGIN_KEEP = 2
  PLUGIN_MOD = 1
  PLUGIN_OK = 1
  PLUGIN_PROC = 64
  PLUGIN_SEG = 4
  PLUGIN_SKIP = 0
  PLUGIN_UNL = 8
  PY_ICID_BYREF = 1
  PY_ICID_INT64 = 0
  PY_ICID_OPAQUE = 2
  SEEK_CUR = 1
  SEEK_END = 2
  SEEK_SET = 0
  SIZE_MAX = 18446744073709551615
  ST_OVER_DEBUG_SEG = 1
  ST_OVER_LIB_FUNC = 2
  SWIG_PYTHON_LEGACY_BOOL = 1
  __EA64__ = False
  __package__ = None
  has_mbcs = False
  integer_types = (<type 'int'>, <type 'long'>)
  string_types = (<type 'str'>, <type 'unicode'>)
  uses_swig_builtins = False
Function Details

IDAPython_ExecScript(script, g, print_error=True)

 

Run the specified script. It also addresses http://code.google.com/p/idapython/issues/detail?id=42

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

as_cstr(val)

 

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

as_signed(v, nbits=32)

 

Returns a number as signed. The number of bits are specified by the user. The MSB holds the sign.

copy_bits(v, s, e=-1)

 

Copy bits from a value

Parameters:
  • v - the value
  • s - starting bit (0-based)
  • e - ending bit

disable_script_timeout()

 

Disables the script timeout and hides the script wait box. Calling set_script_timeout will not have any effects until the script is compiled and executed again

Returns:
None

enable_extlang_python(enable)

 

Enables or disables Python extlang. When enabled, all expressions will be evaluated by Python.

Parameters:
  • enable - Set to True to enable, False otherwise

notify_when(when, callback)

 
Register a callback that will be called when an event happens.
@param when: one of NW_XXXX constants
@param callback: This 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)
@return: Boolean

require(modulename, package=None)

 

Load, or reload a module.

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(timeout)

 

Changes the script timeout value. The script wait box dialog will be hidden and shown again when the timeout elapses. See also disable_script_timeout.

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

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

 

Unpack a buffer given its length and offset using struct.unpack_from(). 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.


Variables Details

IDAPython_Completion

Value:
<ida_idaapi.__IDAPython_Completion_Util object>