class documentation

class ProjectManager(object):

View In Hierarchy

The project manager class exposes basic methods to manage scenarios, record them, replay them and start a Reven server to analyse them.

Method __init__ Undocumented
Method auto_record_asm_stub Undocumented
Method auto_record_binary Undocumented
Method cancel_task Undocumented
Method close_server Disconnect and stop the remote Reven server.
Method commit_record Undocumented
Method connect Use this method in a `with` pattern to get a `RevenServer` instance connected to the specified scenario name.
Method create_scenario Undocumented
Method delete_file Undocumented
Method delete_qemu_session_record Undocumented
Method delete_scenario Undocumented
Method delete_scenario_record Undocumented
Method delete_scenario_resource Undocumented
Method delete_scenario_resources Undocumented
Method delete_session Undocumented
Method delete_task Undocumented
Method eject_cdrom_qemu_session Undocumented
Method export_scenario Undocumented
Method get_actions_list Undocumented
Method get_active_tasks_list Undocumented
Method get_files_list Undocumented
Method get_resources_list Undocumented
Method get_scenario Undocumented
Method get_scenario_action Undocumented
Method get_scenario_actions_list Undocumented
Method get_scenario_by_name Uses the new scenarios by_name API from Reven 2.12
Method get_scenario_by_uuid Uses the new scenarios by_uuid API from Reven 2.12
Method get_scenario_resource Undocumented
Method get_scenario_resources_list Undocumented
Method get_scenarios_list Undocumented
Method get_server_by Get a connection to the Reven server for the given scenario.
Method get_session Undocumented
Method get_session_log Undocumented
Method get_sessions_list Undocumented
Method get_snapshot Undocumented
Method get_task Undocumented
Method get_task_log Undocumented
Method get_tasks_list Undocumented
Method import_scenario Undocumented
Method insert_cdrom_qemu_session Undocumented
Method load_live_snapshot_qemu_session Undocumented
Method replay_scenario Undocumented
Method save_live_snapshot_qemu_session Undocumented
Method start_qemu_snapshot_session Undocumented
Method start_record Undocumented
Method start_reven_session Undocumented
Method stop_record Undocumented
Method stop_session Undocumented
Method update_qemu_snapshot Undocumented
Method update_scenario Undocumented
Method upload_file Undocumented
Method upload_scenario Upload a scenario archive to the project manager.
Instance Variable client Undocumented
Instance Variable document Undocumented
Property hostname Property: The hostname of this project manager
Property port Property: The port of this project manager
Static Method _init_url Undocumented
Method _do_request Undocumented
Method _request Undocumented
Instance Variable _base_url Undocumented
Instance Variable _url Undocumented
def __init__(self, url):

Undocumented

Parameters
url:strUndocumented
def auto_record_asm_stub(self, qemu_session_id, **kwargs):

Undocumented

def auto_record_binary(self, qemu_session_id, binary_name, **kwargs):

Undocumented

def cancel_task(self, task_id):

Undocumented

def close_server(self, server):

Disconnect and stop the remote Reven server.

Warning

Be careful when using this method, as it could stop servers to which other scripts are currently connected. Any active Axion session would prevent the server to be stoppped.

Parameters
server:reven2.RevenServerRevenServer connected to the target server.
Raises
ResponseErrorIf the server cannot be stopped.
ExceptionIf the given RevenServer is not connected.
def commit_record(self, qemu_session_id, scenario_id, **kwargs):

Undocumented

def connect(self, name, ephemeral=True):

Use this method in a `with` pattern to get a `RevenServer` instance connected to the specified scenario name.

This avoids having to use port numbers to connect to a server.

A new server will be started if there is no server for this scenario. If ephemeral is set to True (the default) and a new server is started by this call, then disposing of the connection will stop the server.

Examples

>>> # Using the 'with' syntax
>>> with pm.connect("ddref") as server:
...     print(server.trace.transition_count)
>>> # From the command line, it can be easier to do:
>>> connection = Connection(pm, "ddref")
>>> server = connection.server
>>> print(server.trace.transition_count)
>>> connection.disconnect() # to stop the server if we started it
>>> # If you want to keep the server
>>> host = None
>>> port = None
>>> with pm.connect("ddref", ephemeral=False) as server:
...     # save the port for later use
...     host = server.host
...     port = server.port
... # The Reven server is still accessible here
... server = reven2.RevenServer(host, port)
... print(server.trace.transition_count)
Parameters
name:strUndocumented
ephemeral:boolUndocumented
Returns
ConnectionUndocumented
def create_scenario(self, name, snapshot_id, **kwargs):

Undocumented

def delete_file(self, file_id):

Undocumented

def delete_qemu_session_record(self, qemu_session_id, **kwargs):

Undocumented

def delete_scenario(self, scenario_id):

Undocumented

def delete_scenario_record(self, scenario_id):

Undocumented

def delete_scenario_resource(self, scenario_id, resource_name):

Undocumented

def delete_scenario_resources(self, scenario_id):

Undocumented

def delete_session(self, session_id):

Undocumented

def delete_task(self, task_id):

Undocumented

def eject_cdrom_qemu_session(self, qemu_session_id):

Undocumented

def export_scenario(self, scenario_id, replay=False, light_ossi=True, light_pdb=False, user_data=True):

Undocumented

def get_actions_list(self):

Undocumented

def get_active_tasks_list(self, limit=5, offset=0, **kwargs):

Undocumented

def get_files_list(self, limit=5, offset=0, **kwargs):

Undocumented

def get_resources_list(self):

Undocumented

def get_scenario(self, scenario_id):

Undocumented

def get_scenario_action(self, scenario_id, action_name):

Undocumented

def get_scenario_actions_list(self, scenario_id):

Undocumented

def get_scenario_by_name(self, scenario_name):

Uses the new scenarios by_name API from Reven 2.12

def get_scenario_by_uuid(self, scenario_uuid):

Uses the new scenarios by_uuid API from Reven 2.12

def get_scenario_resource(self, scenario_id, resource_name):

Undocumented

def get_scenario_resources_list(self, scenario_id):

Undocumented

def get_scenarios_list(self, limit=5, offset=0, **kwargs):

Undocumented

def get_server_by(self, uuid=None, name=None):

Get a connection to the Reven server for the given scenario.

  • The scenario can be defined either by its `uuid` or its `name`.
  • The server is started if not already running.
  • The Trace resource of the scenario must have been replayed to start a Reven server.
Parameters
uuidThe uuid of the scenario.
nameThe name of the scenario.
Returns
reven2.RevenServerA handle to the Reven server.
Raises
ResponseErrorIf the server cannot be started.
ValueErrorIf both parameters are None.
def get_session(self, session_id):

Undocumented

def get_session_log(self, session_id, **kwargs):

Undocumented

def get_sessions_list(self, limit=5, offset=0, **kwargs):

Undocumented

def get_snapshot(self, snapshot_id):

Undocumented

def get_task(self, task_id):

Undocumented

def get_task_log(self, task_id, **kwargs):

Undocumented

def get_tasks_list(self, limit=5, offset=0, **kwargs):

Undocumented

def import_scenario(self, archive_name):

Undocumented

def insert_cdrom_qemu_session(self, qemu_session_id, **kwargs):

Undocumented

def load_live_snapshot_qemu_session(self, qemu_session_id, live_snapshot_name):

Undocumented

def replay_scenario(self, scenario_id, resources=None, actions=None, **kwargs):

Undocumented

def save_live_snapshot_qemu_session(self, qemu_session_id, live_snapshot_name):

Undocumented

def start_qemu_snapshot_session(self, qemu_snapshot_id, live_snapshot=None, **kwargs):

Undocumented

def start_record(self, qemu_session_id):

Undocumented

def start_reven_session(self, scenario_id):

Undocumented

def stop_record(self, qemu_session_id):

Undocumented

def stop_session(self, session_id):

Undocumented

def update_qemu_snapshot(self, qemu_snapshot_id, **kwargs):

Undocumented

def update_scenario(self, scenario_id, **kwargs):

Undocumented

def upload_file(self, filepath):

Undocumented

def upload_scenario(self, archive_path, archive_name=None):

Upload a scenario archive to the project manager.

Parameters
archive_pathpath to the archive file to upload
archive_nameoptional new name for the archive file
Returns
final archive name suitable for import_scenario
Raises
OSErrorif open file fails
RuntimeErroron network and upload error
client =

Undocumented

document =

Undocumented

@property
hostname: str =

Property: The hostname of this project manager

@property
port: int =

Property: The port of this project manager

@staticmethod
def _init_url(url):

Undocumented

def _do_request(self, actions, params=None):

Undocumented

def _request(self, actions, params=None):

Undocumented

_base_url =

Undocumented

_url =

Undocumented