Reven can be extended by using Python® scripts. To do so, you can use the reven python API.
The API is accessible as the reven
module, from everywhere on the system through a standard Python CLI or REVEN Axion's python console.
The first step is to connect to an existing Reven instance, for example on port 13370
of the host localhost
:
You can then start an execution, if none has been done or loaded before:
From there, you can communicate with the Reven instance through member functions of the Project class. For example, you can get information about every trace using traces()
:
Inside a Trace (which is the same as a run
in REVEN Axion), the most interesting object is the Point: it represents a single execution point.
As you can see, with these two objects you can query pretty much everything.
For more detailed information about the python API, please refer to the Python API Reference.
In your python interactive shell, you can also use the help
built-in function to directly access the documentation while coding (see the official python documentation for more details on this function).
Note that connecting to a project may interact with the licensing system. Please refer to this page for more information about this interaction.
For examples of how to use the python API from IDA, see IDA support on windows.
reven
module.While the python API provided by the reven
module should offer most of the required functionality to use and extend REVEN, some features are not yet available through it.
To create, start & stop projects, as well as to record scenarios, you can use the low-level python API, which is accessible trough the reven_api
module. It exposes the project and scenario management features through its launcher_connection
object (see Launcher services).
This API is subject to changes: you can check its changelog for per-version modifications.
NOTE: The functionality of the python API is actually provided by the low-level python API, so it would be possible to use the low-level instead of the former. However, this is discouraged. Prefer using the python API from the reven
module.
NOTE: From REVEN Axion's python console, a low-level reven_connection
instance is already created and accessible under the name rvn_client
.
NOTE: See here for documentation about existing plugins.
To extend REVEN Axion through plugins, you can use the Axion API.
The Axion API is provided by the axion_api
module.
It is accessible in the context of REVEN Axion only, either by loading a plugin or through the REVEN Axion's python console.
From there you can, for example, get the selected instruction:
A plugin can use the Axion API to interact with REVEN Axion.
To make and use a plugin through REVEN Axion, proceed as follows:
my_plugin.py
in your autoload directory and use the hello world plugin as a template.Load your plugin in REVEN Axion by using the REVEN Axion's python console as follows:
Remark: 'name'
will be the name of the plugin in REVEN Axion and can be different from the name of the plugin file.
If you need to reload the plugin, use:
Action > Edit shortcut
menu or F11 by default). You can then call your plugin by using the defined shorcut.NOTE: You can use the REVEN Axion's python console's autocompletion feature on the axion
object to browse the Axion API.
"Python" and the Python logos are trademarks or registered trademarks of the Python Software Foundation, used by Tetrane with permission from the Foundation.