Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Having some trouble with the compareCFG.py script #15

Open
AnjaliPare opened this issue Feb 18, 2022 · 1 comment
Open

Having some trouble with the compareCFG.py script #15

AnjaliPare opened this issue Feb 18, 2022 · 1 comment

Comments

@AnjaliPare
Copy link

Hi,

I am having some trouble running the compareCFG script. The cfg edges in ground truth vs compared are significantly different and lead to a very low precision and recall. I am not sure what is wrong but just to double check I ran the compare script with the gtBlock_test_switch.pb both as the ground truth (-g file) and the compared (-c file). The cfg edges found in ground truth and compared do not match even if it is the same .pb file. I have noticed a similar behavior with other binaries in the test suite and other disassembler tools such as angr and ghidra. Below you will find the commands that I executed and the corresponding result. Any help would be appreciated. Thank you!

python3 compareCFG.py -b ../gt/test/test_switch -g /tmp/gtBlock_test_switch.pb -c /tmp/angr_blocks.pb2

INFO:root:[CFG Result]: All cfg edges in ground truth is 0
INFO:root:[CFG Result]: All cfg edges in compared is 21
INFO:root:[CFG Result]: False positive number is 21
INFO:root:[CFG Result]: False negative number is 0
INFO:root:[CFG Result]: Precision 0.000000
Traceback (most recent call last):
File "compareCFG_orig.py", line 906, in
compareCFG(edges_truth, edges_comp)
File "compareCFG_orig.py", line 620, in compareCFG
logging.info("[CFG Result]: Recall %f" % (true_pos / len(cfg_ground)))
ZeroDivisionError: division by zero

@bin2415
Copy link
Collaborator

bin2415 commented Feb 18, 2022

Hello, thanks for the reporting! I updated the script of comparing CFG. Note that our CFG do not split basic block at call site.
That means we do not consider call site as the edge of CFG.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants