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

Fix for false positives with r2pipe #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions 0x07_0x08_uncrackable_crackme/fuzz.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import random
import os
import r2pipe

os.system("cp license_2 license_2_fuzz")

Expand All @@ -20,19 +21,20 @@ def check_output():
os.system("(./license_2_fuzz ; ./license_2_fuzz AAAA-Z10N-42-OK) > fuzz_output")
return compare("orig_output", "fuzz_output")


def check_gdb():
os.system("echo disassemble main | gdb license_2_fuzz > fuzz_gdb")
os.system("gdb ./license_2_fuzz -batch -ex 'disassemble main' > fuzz_gdb")
return compare("orig_gdb", "fuzz_gdb")

def check_radare():
os.system('echo -e "aaa\ns sym.main\npdf" | radare2 license_2_fuzz > fuzz_radare')
r = r2pipe.open('license_2_fuzz')
with open("fuzz_radare", "w") as fr:
fr.write(r.cmd('aaa;s sym.main;pdf'))
return compare("orig_radare", "fuzz_radare")

while True:
copy_binary()
if check_output() and not check_gdb() and not check_radare():
print "FOUND POSSIBLE FAIL\n\n\n"
os.system("tail fuzz_gdb")
os.system("tail fuzz_radare")
os.system("tail fuzz_gdb fuzz_radare")
raw_input()