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 refresh_missing_pdbs 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_pdb Upload a scenario archive to the project manager.
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

Parameters
qemu_session_id:intUndocumented
**kwargsUndocumented
Returns
OrderedDictUndocumented
def auto_record_binary(self, qemu_session_id, binary_name, **kwargs):

Undocumented

Parameters
qemu_session_id:intUndocumented
binary_name:strUndocumented
**kwargsUndocumented
Returns
OrderedDictUndocumented
def cancel_task(self, task_id):

Undocumented

Parameters
task_id:intUndocumented
Returns
OrderedDictUndocumented
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

Parameters
qemu_session_id:intUndocumented
scenario_id:intUndocumented
**kwargsUndocumented
Returns
OrderedDictUndocumented
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

Parameters
name:strUndocumented
snapshot_id:intUndocumented
**kwargsUndocumented
Returns
OrderedDictUndocumented
def delete_file(self, file_id):

Undocumented

Parameters
file_id:intUndocumented
Returns
OrderedDictUndocumented
def delete_qemu_session_record(self, qemu_session_id, **kwargs):

Undocumented

Parameters
qemu_session_id:intUndocumented
**kwargsUndocumented
Returns
OrderedDictUndocumented
def delete_scenario(self, scenario_id):

Undocumented

Parameters
scenario_id:intUndocumented
Returns
OrderedDictUndocumented
def delete_scenario_record(self, scenario_id):

Undocumented

Parameters
scenario_id:intUndocumented
Returns
OrderedDictUndocumented
def delete_scenario_resource(self, scenario_id, resource_name):

Undocumented

Parameters
scenario_id:intUndocumented
resource_name:strUndocumented
Returns
OrderedDictUndocumented
def delete_scenario_resources(self, scenario_id):

Undocumented

Parameters
scenario_id:intUndocumented
Returns
OrderedDictUndocumented
def delete_session(self, session_id):

Undocumented

Parameters
session_id:intUndocumented
Returns
OrderedDictUndocumented
def delete_task(self, task_id):

Undocumented

Parameters
task_id:intUndocumented
Returns
OrderedDictUndocumented
def eject_cdrom_qemu_session(self, qemu_session_id):

Undocumented

Parameters
qemu_session_id:intUndocumented
Returns
OrderedDictUndocumented
def export_scenario(self, scenario_id, replay=False, light_ossi=True, light_pdb=False, user_data=True):

Undocumented

Parameters
scenario_id:intUndocumented
replay:boolUndocumented
light_ossi:boolUndocumented
light_pdb:boolUndocumented
user_data:boolUndocumented
Returns
OrderedDictUndocumented
def get_actions_list(self):

Undocumented

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

Undocumented

Parameters
limit:intUndocumented
offset:intUndocumented
**kwargsUndocumented
Returns
OrderedDictUndocumented
def get_files_list(self, limit=5, offset=0, **kwargs):

Undocumented

Parameters
limit:intUndocumented
offset:intUndocumented
**kwargsUndocumented
Returns
OrderedDictUndocumented
def get_resources_list(self):

Undocumented

Returns
OrderedDictUndocumented
def get_scenario(self, scenario_id):

Undocumented

Parameters
scenario_id:intUndocumented
Returns
OrderedDictUndocumented
def get_scenario_action(self, scenario_id, action_name):

Undocumented

Parameters
scenario_id:intUndocumented
action_name:strUndocumented
Returns
OrderedDictUndocumented
def get_scenario_actions_list(self, scenario_id):

Undocumented

Parameters
scenario_id:intUndocumented
Returns
OrderedDictUndocumented
def get_scenario_by_name(self, scenario_name):

Uses the new scenarios by_name API from Reven 2.12

Parameters
scenario_name:strUndocumented
Returns
OrderedDictUndocumented
def get_scenario_by_uuid(self, scenario_uuid):

Uses the new scenarios by_uuid API from Reven 2.12

Parameters
scenario_uuid:strUndocumented
Returns
OrderedDictUndocumented
def get_scenario_resource(self, scenario_id, resource_name):

Undocumented

Parameters
scenario_id:intUndocumented
resource_name:strUndocumented
Returns
OrderedDictUndocumented
def get_scenario_resources_list(self, scenario_id):

Undocumented

Parameters
scenario_id:intUndocumented
Returns
OrderedDictUndocumented
def get_scenarios_list(self, limit=5, offset=0, **kwargs):

Undocumented

Parameters
limit:intUndocumented
offset:intUndocumented
**kwargsUndocumented
Returns
OrderedDictUndocumented
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
uuid:Optional[str]The uuid of the scenario.
name:Optional[str]The 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

Parameters
session_id:intUndocumented
Returns
OrderedDictUndocumented
def get_session_log(self, session_id, **kwargs):

Undocumented

Parameters
session_id:intUndocumented
**kwargsUndocumented
Returns
OrderedDictUndocumented
def get_sessions_list(self, limit=5, offset=0, **kwargs):

Undocumented

Parameters
limit:intUndocumented
offset:intUndocumented
**kwargsUndocumented
Returns
OrderedDictUndocumented
def get_snapshot(self, snapshot_id):

Undocumented

Parameters
snapshot_id:intUndocumented
Returns
OrderedDictUndocumented
def get_task(self, task_id):

Undocumented

Parameters
task_id:intUndocumented
Returns
OrderedDictUndocumented
def get_task_log(self, task_id, **kwargs):

Undocumented

Parameters
task_id:intUndocumented
**kwargsUndocumented
Returns
OrderedDictUndocumented
def get_tasks_list(self, limit=5, offset=0, **kwargs):

Undocumented

Parameters
limit:intUndocumented
offset:intUndocumented
**kwargsUndocumented
Returns
OrderedDictUndocumented
def import_scenario(self, archive_name):

Undocumented

Parameters
archive_name:strUndocumented
Returns
OrderedDictUndocumented
def insert_cdrom_qemu_session(self, qemu_session_id, **kwargs):

Undocumented

Parameters
qemu_session_id:intUndocumented
**kwargsUndocumented
Returns
OrderedDictUndocumented
def load_live_snapshot_qemu_session(self, qemu_session_id, live_snapshot_name):

Undocumented

Parameters
qemu_session_id:intUndocumented
live_snapshot_name:strUndocumented
Returns
OrderedDictUndocumented
def refresh_missing_pdbs(self):

Undocumented

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

Undocumented

Parameters
scenario_id:intUndocumented
resources:Optional[List[str]]Undocumented
actions:Optional[List[str]]Undocumented
**kwargsUndocumented
Returns
OrderedDictUndocumented
def save_live_snapshot_qemu_session(self, qemu_session_id, live_snapshot_name):

Undocumented

Parameters
qemu_session_id:intUndocumented
live_snapshot_name:strUndocumented
Returns
OrderedDictUndocumented
def start_qemu_snapshot_session(self, qemu_snapshot_id, live_snapshot=None, **kwargs):

Undocumented

Parameters
qemu_snapshot_id:intUndocumented
live_snapshotUndocumented
**kwargsUndocumented
Returns
OrderedDictUndocumented
def start_record(self, qemu_session_id):

Undocumented

Parameters
qemu_session_id:intUndocumented
Returns
OrderedDictUndocumented
def start_reven_session(self, scenario_id):

Undocumented

Parameters
scenario_id:intUndocumented
Returns
OrderedDictUndocumented
def stop_record(self, qemu_session_id):

Undocumented

Parameters
qemu_session_id:intUndocumented
Returns
OrderedDictUndocumented
def stop_session(self, session_id):

Undocumented

Parameters
session_id:intUndocumented
Returns
OrderedDictUndocumented
def update_qemu_snapshot(self, qemu_snapshot_id, **kwargs):

Undocumented

Parameters
qemu_snapshot_id:intUndocumented
**kwargsUndocumented
Returns
OrderedDictUndocumented
def update_scenario(self, scenario_id, **kwargs):

Undocumented

Parameters
scenario_id:intUndocumented
**kwargsUndocumented
Returns
OrderedDictUndocumented
def upload_file(self, filepath):

Undocumented

Parameters
filepath:Union[str, Path]Undocumented
Returns
OrderedDictUndocumented
def upload_pdb(self, pdb_path):

Upload a scenario archive to the project manager.

Parameters
pdb_path:Union[str, Path]path to the PDB to upload
Returns
intthe uploaded PDB path on the server
Raises
OSErrorif open file fails
ChunkUploadErroron network and upload error
def upload_scenario(self, archive_path, archive_name=None):

Upload a scenario archive to the project manager.

Parameters
archive_path:Union[str, Path]path to the archive file to upload
archive_name:Optional[str]optional 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