remove argparsing
This commit is contained in:
@@ -23,8 +23,8 @@ def test_fb_cmd(cmd=b'getvar:version', device="S905X3"):
|
|||||||
res = emulator.run_fastboot_cmd()
|
res = emulator.run_fastboot_cmd()
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def afl_fuzzer():
|
def afl_fuzzer(device="S905X3"):
|
||||||
emulator = Amlogic_Emulator()
|
emulator = Amlogic_Emulator(device=device)
|
||||||
# emulator.debug = True
|
# emulator.debug = True
|
||||||
|
|
||||||
def _place_fb_command(uc, input, persistent_round, data):
|
def _place_fb_command(uc, input, persistent_round, data):
|
||||||
@@ -44,21 +44,23 @@ def afl_fuzzer():
|
|||||||
unicornafl.uc_afl_fuzz_custom(emulator.uc, "input/getvar", _place_fb_command, _run, persistent_iters=1)
|
unicornafl.uc_afl_fuzz_custom(emulator.uc, "input/getvar", _place_fb_command, _run, persistent_iters=1)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
args = argparse.ArgumentParser("Amlogic BootROM Fuzzer")
|
# print(sys.argv)
|
||||||
args.add_argument("--device", "-d", help="Device to test", default="S905X3")
|
# args = argparse.ArgumentParser("Amlogic BootROM Fuzzer")
|
||||||
args.add_argument("--test", "-t", help="Test fastboot command", default=False, action="store_true")
|
# args.add_argument("--device", "-d", help="Device to test", default="S905X3")
|
||||||
args.add_argument("--input", "-i", help="Input file for crash", default=None)
|
# args.add_argument("--test", "-t", help="Test fastboot command", default=False, action="store_true")
|
||||||
|
# args.add_argument("--input", "-i", help="Input file for crash", default=None)
|
||||||
|
|
||||||
args = args.parse_args()
|
# args = args.parse_args()
|
||||||
|
|
||||||
if args.test:
|
# if args.test:
|
||||||
test_fb_cmd(device=args.device)
|
# test_fb_cmd(device=args.device)
|
||||||
print("", flush=True)
|
# print("", flush=True)
|
||||||
exit(0)
|
# exit(0)
|
||||||
|
|
||||||
if args.input:
|
# if args.input:
|
||||||
# Run a single comand
|
# # Run a single comand
|
||||||
test_fb_cmd(open(args.input, 'rb').read())
|
# test_fb_cmd(open(args.input, 'rb').read())
|
||||||
else:
|
# else:
|
||||||
# Run AFL
|
# pass
|
||||||
afl_fuzzer()
|
# Run AFL
|
||||||
|
afl_fuzzer()
|
||||||
|
|||||||
Reference in New Issue
Block a user