REVEN-Axion 2016v1.3.1
start_execution.py

Here is a small example demonstrating how to plug an inspector, start an execution, pause, and test the current progress.

1 import reven
2 import time
3 import sys
4 
5 client = reven.Project("localhost", 13370)
6 
7 if not client.execution_status().is_awaiting_configuration:
8  sys.stderr.write("[!] An analysis has already been done. Let's not start a new one.\n")
9  sys.exit(1)
10 
11 # Launch the execution from the scenario start
12 # We want to stop on the first instance of malloc
13 client.start_execution([reven.InspectorStopExecution(symbol="malloc"), reven.InspectorMemoryHistory()])
14 
15 # At this point, the execution is running in background
16 
17 # Let's wait up to 10 seconds, or until we reach malloc.
18 max = 10
19 while client.execution_status().is_busy:
20  print "Analyzing %s" % client.execution_status().status
21  time.sleep(1)
22  if max == 0:
23  # Note that, after a stop execution, the execution will take some time to stop
24  client.stop_execution()
25  print "Stopping."
26  max -= 1
27 
28 # Here I can check whatever I want...
29 
30 client.resume_execution()
31 
32 # ... and now wait again for the same period of time, for example.