Import ia_fuzz from radare2-fuzz

This commit is contained in:
pancake 2022-08-24 15:39:44 +02:00 committed by pancake
parent b4ed2e26f0
commit 91738310b6
2 changed files with 22 additions and 0 deletions

20
test/fuzz/fuzz_ia.c Normal file
View File

@ -0,0 +1,20 @@
#include <stdio.h>
#include <r_core.h>
int LLVMFuzzerInitialize(int *lf_argc, char ***lf_argv) {
r_log_set_quiet (true);
return 0;
}
int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
RCore *r = r_core_new();
r_core_cmdf(r, "o malloc://%zu", Size);
r_io_write_at(r->io, 0, Data, Size);
r_core_cmd0(r, "oba 0");
r_core_cmd0(r, "ia");
r_core_free(r);
return 0;
}

View File

@ -2,6 +2,7 @@ if get_option('enable_libfuzzer')
targets = [
'bin',
'bin_demangle',
'ia',
'pdb_parse',
'pkcs7_parse',
'protobuf_decode',
@ -15,6 +16,7 @@ if get_option('enable_libfuzzer')
include_directories: [platform_inc],
dependencies: [
r_bin_dep,
r_core_dep,
r_util_dep,
r_socket_dep,
],