Bug in CFGFast
See original GitHub issueI compiled coreutils 8.27. In the cp program, function 0x402FB0 (target_directory_operand), CFGFast doesn’t recover the CFG correctly. Below is the binary: cp.zip
The error is a very simple one. Here is the CFG recovered by angr:
Here is the CFG recovered by IDA, which is the correct one:
As you can see, there is an edge missing in the angr’s CFG, from node 0x402FEA
to node 0x402FF1
. Angr’s analysis basically put a duplicated node 0x402FF1
inside the node 0x402FFA
(since the first one contains return statement). The node 0x402FEA
suppose to be 7 byte instead of 18.
Issue Analytics
- State:
- Created 6 years ago
- Comments:11 (6 by maintainers)
Top Results From Across the Web
CFGFast: fix the bug that CFG recovery starts at `start-1` when `start ...
CFGFast : fix the bug that CFG recovery starts at `start-1` when `start` is specified. This commit fixes the issue introduced by another...
Read more >更新履歴 · GitBook
Lots of improvements and bug fixes to CFGFast. Rumors are angr's CFG was only "optimized" for x86-64 binaries (which is really because most...
Read more >[angr] How to visualize CFG graphs
... Next message: [angr] Reporting for PyVEX bugs ... use a parameter that works only on > CFGAccurate, but you're constructing a CFGFast....
Read more >Using Symbolic Execution for IoT Bug Hunting - Hardwear.io
for IoT Bug Hunting. Presenters: Grzegorz Wypych, X-Force Red ... CFGFast(regions=[(self.func_start_addr, self.func_end_addr)]). Hooking.
Read more >offseconf19-reverse-101-angr.pdf
bug () else: print "You lose!" else: print "You lose!" 1 ⇒ "You lose!" 593 ⇒ "You lose!" 183 ⇒ "You ... CFGFast/CFGAccurate...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Because they are different.
The normalization of a CFG is the process of breaking bigger basic blocks in case there are overlapping basic blocks. A basic block
A
overlaps with a another basic blockB
ifA
starts in the middle ofB
, and during normalization, the blockB
will be split into two blocks:B0
andA
. However, you do not know whether you should breakB
or not until blockA
is recovered during CFG recovery. Therefore, without a full CFG of that function recovered, you cannot normalize the CFG of that function.I agree that a normalized CFG looks more natural to human analysts, but most automated analyses do not care whether the CFG is normalized or not. CFGs in angr are intended to be used by both analysis routines and human users. Therefore, we do not normalize CFGs by default, and you can always normalize it if you need to.
PS: In the graph view of angr management, we only display normalized CFGs, which is because that view is solely intended to be read and analyzed by human analysts.
You are welcome 😃