forked from pfalcon/ScratchABlock
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript_callgraph.py
More file actions
Latest commit
23 lines (19 loc) · 679 Bytes
/
Copy pathscript_callgraph.py
File metadata and controls
23 lines (19 loc) · 679 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Minimal processing required to collect calls addresses for
# call graph generation.
fromxformimport*
defapply(cfg):
# Various algos below don't work with no explicit entry in CFG
cfg_single_entry(cfg)
# Also don't work with >1 entries
remove_unreachable_entries(cfg)
# Also don't work unless there's a single exit
# cfg_single_exit(cfg)
analyze_reach_defs(cfg)
const_propagation(cfg)
#copy_propagation(cfg)
#mem_propagation(cfg)
#expr_propagation(cfg)
collect_calls(cfg)
# Won't work here, because we might not have all funcs in funcdb,
# need 2nd pass in script_callgraph_func_refs.py
#collect_func_refs(cfg)