ex0dus-0x / ex0dus-0x/fuzzable

Repeated calculation of angr CFGFasr leads to low running efficiency and high memory consumption when there are too many function

Open
#74 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
549
Forks
58
PR merge metrics
No merged PRs in 30d

Description

in AngrAnalysis.__init__()
self.cfg = self.target.analyses.CFG(
resolve_indirect_jumps=True,
cross_references=True,
force_complete_scan=False,
normalize=True,
symbols=True,
)

the edges of functions is already in self.cfg
the way to get edges of function are followings

for func in self.cfg.functions.values():
print(func.addr, len(func.transition_graph.edges))

so I think the code of function get_cyclomatic_complexity(),

cfg = self.target.analyses.CFGFast(
force_complete_scan=False, start_at_entry=hex(func.addr)
)

This code uses CFGFast to recalculate edges for each function.
Leading to low running efficiency and high memory consumption when there are too many function.

Can we optimize this :)

Best regards
XZJ

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in AngrAnalysis.__init__() and get_cyclomatic_complexity(), focusing on how self.cfg and each function's transition_graph.edges are used. Compare that with the per-function CFGFast call and identify a way to avoid repeated CFG construction while preserving cyclomatic-complexity results. Done means the repeated calculation is removed and behavior remains correct for functions with many edges.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
performance, reverse-engineering
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.