IDAPython project for Hex-Ray's IDA Pro
Go to file
ero.carrera@gmail.com faf5063818 Fixed a bug in GetIdbPath() when working in an IDA instance that has dealt with more than one IDB.
idaapi.cvar.database_idb seems to point to a realloc'ed buffer. When IDA is working on an IDB stored in a directory with a long path and a second IDB with a shorter path is loaded, the buffer will be overwritten with the new path to the IDB, which will end in "\x00" and the leftovers of the older, longer path will follow.
The problem with GetIdbPath() is that it returns the whole bufer, NULL and "leftovers" included, which leads to trouble in Python. Specifically some functions like os.path.splitext which will look for the extension starting from the end of the buffer and will return an invalid split.
The patch simply post-processes the contents of idaapi.cvar.database_idb returning a Python string with all characters up to the "\x00"
2010-09-23 18:57:37 +00:00
docs Initial SVN commit of version 0.9.54 sources. 2007-10-20 07:03:51 +00:00
examples Minor modifications: 2010-09-17 12:06:30 +00:00
python Fixed a bug in GetIdbPath() when working in an IDA instance that has dealt with more than one IDB. 2010-09-23 18:57:37 +00:00
swig Minor modifications: 2010-09-17 12:06:30 +00:00
tools IDAPython 1.4.0 - IDA Pro 5.7 support 2010-06-28 12:36:40 +00:00
AUTHORS.txt updated AUTHORS files 2010-08-10 11:40:01 +00:00
basetsd.h Initial SVN commit of version 0.9.54 sources. 2007-10-20 07:03:51 +00:00
build.py - IDAPython 1.4.2: should work now with Python 2.7 2010-08-10 11:44:59 +00:00
BUILDING.txt IDAPython 1.4.0 - IDA Pro 5.7 support 2010-06-28 12:36:40 +00:00
CHANGES.txt updated CHANGES.txt 2010-07-16 12:11:19 +00:00
COPYING.txt IDAPython 1.4.0 - IDA Pro 5.7 support 2010-06-28 12:36:40 +00:00
python.cpp bugfix: idaapi.enable_extlang_python() could not be called from init.py 2010-09-11 09:34:14 +00:00
pywraps.hpp added command completion 2010-07-19 13:00:33 +00:00
README.txt IDAPython 1.4.0 - IDA Pro 5.7 support 2010-06-28 12:36:40 +00:00
STATUS.txt IDAPython 1.4.0 - IDA Pro 5.7 support 2010-06-28 12:36:40 +00:00

----------------------------------------------------------
IDAPython - Python plugin for Interactive Disassembler Pro
----------------------------------------------------------

WHAT IS IDAPTYHON?
------------------

IDAPython is an IDA plugin which makes it possible to write scripts
for IDA in the Python programming language. IDAPython provides full
access to both the IDA API and any installed Python module.

Check the scripts in the examples directory to get an quick glimpse.


AVAILABILITY
------------

Latest stable versions of IDAPython are available from
  http://www.d-dome.net/idapython/

Development builds are available from
  http://code.google.com/p/idapython/


RESOURCES
---------

The full function cross-reference is readable online at
  http://www.d-dome.net/idapython/reference/

Bugs and enhancement requests should be submitted to
  http://code.google.com/p/idapython/issues/list

Mailing list for the project is hosted by Google Groups at
  http://groups.google.com/group/idapython


INSTALLATION FROM BINARIES
--------------------------

1, Install Python 2.5 or 2.6 from http://www.python.org/
2, Copy the python and python64 directories to the IDA install directory
3. Copy the plugins to the %IDADIR%\plugins\


USAGE
-----

The plugin has three hotkeys: 

 - Run script (Alt-9)
 - Execute Python statement(s) (Alt-8)
 - Run previously executed script again (Alt-7)

Batch mode execution:

Start IDA with the following command line options:

 -A -OIDAPython:yourscript.py file_to_work_on

If you want fully unattended execution mode, make sure your script
exits with a qexit() call.

By default scripts run after the database is opened. Extended option
format is:

  -OIDAPython:[N;]script.py

Where N can be:
  0: run script after opening database (default)
  1: run script when UI is ready
  2: run script immediately on plugin load (shortly after IDA starts and before processor modules and loaders)

User init file:

You can place your custom settings to a file called 'idapythonrc.py'
that should be placed to 

${HOME}/.idapro/

or 

%AppData%\Hex-Rays\IDA Pro

The user init file is read and executed at the end of the init process.