REVEN-Axion 2017v1.4.0
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 project = reven.Project("localhost", 13370)
6 
7 if not project.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 project.start_execution([reven.InspectorStopExecution(sequence_count=1000000), 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 project.execution_status().is_busy:
20  print "Analyzing %s" % project.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  project.stop_execution()
25  print "Stopping."
26  max -= 1
27 
28 # Here I can check whatever I want...
29 
30 project.resume_execution()
31 
32 # ... and now wait again for the same period of time, for example.