Module ida_idaapi
Global Variables
BADADDR
BADADDR32
BADADDR64
BADSEL
HBF_CALL_WITH_NEW_EXEC
HBF_VOLATILE_METHOD_SET
NW_CLOSEIDB
NW_INITIDA
NW_OPENIDB
NW_REMOVE
NW_TERMIDA
PLUGIN_DBG
PLUGIN_DRAW
PLUGIN_FIX
PLUGIN_HIDE
PLUGIN_KEEP
PLUGIN_MOD
PLUGIN_MULTI
PLUGIN_OK
PLUGIN_PROC
PLUGIN_SEG
PLUGIN_SKIP
PLUGIN_UNL
PY_ICID_BYREF
PY_ICID_INT64
PY_ICID_OPAQUE
SEEK_CUR
SEEK_END
SEEK_SET
SIZE_MAX
ST_OVER_DEBUG_SEG
ST_OVER_LIB_FUNC
Functions
IDAPython_ExecScript(path, g, print_error=True)
Run the specified script.
This function is used by the low-level plugin code.
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(path, g, print_error=True)
Load processor module.
IDAPython_UnLoadProcMod(script, g, print_error=True)
Unload processor module.
TRUNC(ea)
Truncate EA for the current application bitness
as_UTF16(s)
Convenience function to convert a string into appropriate unicode format
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 \x00 and returns the string value up to that point.
as_int32(v)
Returns a number as a signed int32 number
as_signed(v, nbits=32)
Returns a number as signed. The number of bits are specified by the user. The MSB holds the sign.
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 v: the value s: starting bit (0-based) e: ending bit
disable_script_timeout() ‑> void
disable_script_timeout() Disables the script timeout and hides the script wait box. Calling L{set_script_timeout} will not have any effects until the script is compiled and executed again
enable_extlang_python(enable: bool) ‑> void
enable_extlang_python(enable) Enables or disables Python extlang. When enabled, all expressions will be evaluated by Python.
enable_python_cli(enable: bool) ‑> void
enable_python_cli(enable)
format_basestring(_in: PyObject *) ‑> PyObject *
format_basestring(_in) -> str
notify_when(when, callback)
Register a callback that will be called when an event happens. when: one of NW_XXXX constants 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
parse_command_line3(cmdline: char const *) ‑> PyObject *
parse_command_line3(cmdline) -> PyObject *
pycim_get_widget(_self: PyObject *) ‑> TWidget *
pycim_get_widget(_self) -> TWidget *
pycim_view_close(_self: PyObject *) ‑> void
pycim_view_close(_self)
pygc_create_groups(_self: PyObject *, groups_infos: PyObject *) ‑> PyObject *
pygc_create_groups(_self, groups_infos) -> [int, ...] or None
pygc_delete_groups(_self: PyObject *, groups: PyObject *, new_current: PyObject *) ‑> PyObject *
pygc_delete_groups(_self, groups, new_current) -> bool
pygc_refresh(_self: PyObject *) ‑> void
pygc_refresh(_self)
pygc_set_groups_visibility(_self: PyObject *, groups: PyObject *, expand: PyObject *, new_current: PyObject *) ‑> PyObject *
pygc_set_groups_visibility(_self, groups, expand, new_current) -> bool
replfun(func)
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: int) ‑> int
set_script_timeout(timeout) -> int Changes the script timeout value. The script wait box dialog will be hidden and shown again when the timeout elapses. See also L{disable_script_timeout}.
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.
Classes
IDAPython_displayhook()
:
Methods
displayhook(self, item)
format_item(self, num_printer, storage, item)
format_seq(self, num_printer, storage, item, opn, cls)
PyIdc_cvt_int64__(v)
: Helper class for explicitly representing VT_INT64 values
Ancestors (in MRO)
PyIdc_cvt_refclass__(v)
: Helper class for representing references to immutable objects
Ancestors (in MRO)
Methods
cstr(self) Returns the string as a C string (up to the zero termination)
loader_input_t(pycapsule: PyObject * = None)
: A helper class to work with linput_t related functions. This class is also used by file loaders scripts.
Static methods
from_capsule(pycapsule: PyObject *) ‑> loader_input_t * from_capsule(pycapsule) -> loader_input_t
pycapsule: PyObject *
from_fp(fp: FILE *) ‑> loader_input_t from_fp(fp) -> loader_input_t A static method to construct an instance from a FILE
fp: FILE *
from_linput(linput: linput_t *) ‑> loader_input_t * from_linput(linput) -> loader_input_t
linput: linput_t *
Methods
close(self) ‑> void close(self) Closes the file
file2base(self, pos: int64, ea1: ea_t, ea2: ea_t, patchable: int) ‑> int file2base(self, pos, ea1, ea2, patchable) -> int Load portion of file into the database This function will include (ea1..ea2) into the addressing space of the program (make it enabled)
pos: position in the file ea1: ..ea2): range of destination linear addresses ea1: ..ea2): range of destination linear addresses patchable: should the kernel remember correspondance of file offsets to linear addresses. return: 1-ok,0-read error, a warning is displayed
filename(self) ‑> PyObject * filename(self) -> PyObject *
get_byte(self) ‑> PyObject * get_byte(self) -> PyObject * Reads a single byte from the file. Returns None if EOF or the read byte
get_linput(self) ‑> linput_t * get_linput(self) -> linput_t *
gets(self, len: size_t) ‑> PyObject * gets(self, len) -> str Reads a line from the input file. Returns the read line or None
len: size_t
getz(self, sz: size_t, fpos: int64 = -1) ‑> PyObject * getz(self, sz, fpos=-1) -> PyObject Returns a zero terminated string at the given position
sz: maximum size of the string fpos: if != -1 then seek will be performed before reading return: The string or None on failure.
open(self, filename: char const *, remote: bool = False) ‑> bool open(self, filename, remote=False) -> bool Opens a file (or a remote file)
filename: char const * remote: bool return: Boolean
open_memory(self, start: ea_t, size: asize_t = 0) ‑> bool open_memory(self, start, size=0) -> bool Create a linput for process memory (By internally calling idaapi.create_memory_linput()) This linput will use dbg->read_memory() to read data
start: starting address of the input size: size of the memory range to represent as linput if unknown, may be passed as 0
opened(self) ‑> bool opened(self) -> bool Checks if the file is opened or not
read(self, *args) ‑> PyObject * read(self, size=size_t(-1)) -> PyObject Read up to size bytes (all data if size is negative). Return an empty bytes object on EOF.
size: size_t
readbytes(self, size: size_t, big_endian: bool) ‑> PyObject * readbytes(self, size, big_endian) -> PyObject * Similar to read() but it respect the endianness
size: size_t big_endian: bool
seek(self, *args) ‑> int64 seek(self, pos, whence=SEEK_SET) -> int64 Set input source position
pos: int64 whence: int return: the new position (not 0 as fseek!)
set_linput(self, linput: linput_t *) ‑> void set_linput(self, linput) Links the current loader_input_t instance to a linput_t instance
linput: linput_t *
size(self) ‑> int64 size(self) -> int64
tell(self) ‑> int64 tell(self) -> int64 Returns the current position
object_t(**kwds)
: Helper class used to initialize empty objects
plugin_t()
: Base class for all scripted plugins.
Ancestors (in MRO)
Methods
run(self, arg)
term(self)
plugmod_t()
: Base class for all scripted multi-plugins.
Ancestors (in MRO)
py_clinked_object_t(lnk=None)
: This is a utility and base class for C linked objects
Ancestors (in MRO)
Descendants
Instance variables
clink
clink_ptr
Methods
assign(self, other) Overwrite me. This method allows you to assign an instance contents to anothers return: Boolean
copy(self) Returns a new copy of this class
pyidc_cvt_helper__(cvt_id, value)
: 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. This object is characterized by its special attribute and its value
Descendants
Instance variables
value
pyidc_opaque_object_t()
: This is the base class for all Python<->IDC opaque objects
Descendants
Last updated