fix(example): mistake in fuzz_x8664_linux binary

- Using the result of an assignment as a condition without parentheses
- Replace printf with puts
This commit is contained in:
chinggg
2022-03-30 08:53:44 +08:00
parent 63fc06261c
commit 26fe48dd4c
3 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -10,13 +10,13 @@ int fun(int i)
char *buf = malloc(SIZE);
char buf2[SIZE];
while (*buf = getc(stdin) == 'A')
while ((*buf = getc(stdin)) == 'A')
{
buf[i++] = *buf;
}
strncpy(buf2, buf, i);
printf(buf2);
puts(buf2);
return 0;
}
@@ -61,10 +61,10 @@ def main(input_file: str):
# make the process crash whenever __stack_chk_fail@plt is about to be called.
# this way afl will count stack protection violations as crashes
ql.hook_address(callback=lambda x: os.abort(), address=ba + 0x1225)
ql.hook_address(callback=lambda x: os.abort(), address=ba + 0x126e)
# set afl instrumentation [re]starting point. we set it to 'main'
ql.hook_address(callback=start_afl, address=ba + 0x122c)
ql.hook_address(callback=start_afl, address=ba + 0x1275)
# okay, ready to roll
ql.run()
Binary file not shown.