diaphora
diaphora copied to clipboard
Probably a typo in CBinDiff.check_ratio()
If I understand correctly, CBinDiff.check_ratio()
compares different features of two functions, including basic blocks SPP, which is a number, a product of multiple small primes.
At first, two SPPs are compared using ast_ratio() method(), which determines how similar two products are:
https://github.com/joxeankoret/diaphora/blob/be4deb38304f25c42b583fecc2369a2aa84728e6/diaphora.py#L1177
But later same SPPs are compared using quick_ratio() or real_quick_ratio():
https://github.com/joxeankoret/diaphora/blob/be4deb38304f25c42b583fecc2369a2aa84728e6/diaphora.py#L1212
Both of these methods are used to compare text lines, and it doesn't make any sense to compare small prime products like this. Is it a typo, or have I misunderstood some logic behind this?
It looks to me like a typo, thanks for pointing it out! I will have to seriously take a look to check_ratio() because it seems to me there can be various (old) bugs inside.
This is fixed in Diaphora 3.0, to be released soon. If you want to try to beta, tell me and I will send you it.