-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.py
More file actions
32 lines (26 loc) · 827 Bytes
/
example.py
File metadata and controls
32 lines (26 loc) · 827 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
"""
Demonstrate that the program does not work.
"""
from collections import Counter, defaultdict
from pprint import pprint
from address import FunctionBoundaries
from cfg import BOUNDARIES, FILTERED
results = defaultdict(Counter)
mapper = FunctionBoundaries.load(BOUNDARIES)
for name, addr_map in mapper.items():
file = FILTERED / name
size = file.stat().st_size
for virt_addr, (lower, upper) in addr_map.items():
if lower < 0:
results[name].update([1])
if upper < 0:
results[name].update([2])
if upper <= lower:
results[name].update([3])
if lower > size:
results[name].update([4])
if upper > size:
results[name].update([5])
if not results[name]:
results[name].update([0])
pprint(results)