ex0dus-0x / fuzzable

Framework for Automating Fuzzable Target Discovery with Static Analysis.
MIT License
511 stars 53 forks source link

Is there a problem with Binaryninja nature_loops function? #81

Open chumen77 opened 11 months ago

chumen77 commented 11 months ago

def natural_loops(target: Function) -> int: return sum([bb in bb.dominance_frontier for bb in target.basic_blocks])

The len() function will then return the length of this list, which is the number of basic blocks in target.basic_blocks, not the number of natural loops.

If you want to count the number of basic blocks that exist within their own dominance bounds (actually the number of natural loops), then you should use sum() instead of len().