REVEN-Axion User Documentation 2015-v1
incremental_search.py

This shows how to use the search incrementally. This can allow you to have a progress bar, or do some background work while searching.

This will demonstrate the use of the following services:

import reven
rvn = reven.reven_connection("localhost", 13370)
count = rvn.run_get_sequence_count("Execution run") - 1
range = reven.execution_range(0, count)
# Create any search object
search = reven.search_request(reven.filter_criterion_address(0x400000))
# Stop after one result only
search.max_results = 1
# The service returns each time we process 1% of the sequences (to print a progress bar)
search.max_sequences = count / 100
while range.begin() < range.end():
# Progress bar display
print 'Searching... %d%% done.' % ((range.sequence_identifier * 100) / count)
result = rvn.run_search_sequences(range, search)
if len(result.content) > 0:
print 'Found result at %d' % result.content[0].sequence.index
break
# After each step, we request only the remaining range
range = result.remaining_range