forked from Battelle/afl-unicorn
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/vanhauser-thc/AFLplusplus
- Loading branch information
Showing
16 changed files
with
244 additions
and
259 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,15 @@ sending a mail to <[email protected]>. | |
|
||
|
||
----------------------------- | ||
Version ++2.52c (2019-05-28): | ||
Version ++2.52d (tbd): | ||
----------------------------- | ||
|
||
- ... your idea or patch? | ||
|
||
|
||
|
||
----------------------------- | ||
Version ++2.52c (2019-06-05): | ||
----------------------------- | ||
|
||
- Applied community patches. See docs/PATCHES for the full list. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,7 +28,7 @@ american fuzzy lop plus plus | |
Released under terms and conditions of Apache License, Version 2.0. | ||
|
||
For new versions and additional information, check out: | ||
http://lcamtuf.coredump.cx/afl/ | ||
https://github.com/vanhauser-thc/AFLplusplus | ||
|
||
To compare notes with other users or get notified about major new features, | ||
send a mail to <[email protected]>. | ||
|
@@ -513,21 +513,11 @@ Thank you! | |
15) Contact | ||
----------- | ||
|
||
Questions? Concerns? Bug reports? The author can be usually reached at | ||
<lcamtuf@google.com>. | ||
Questions? Concerns? Bug reports? The contributors can be reached via | ||
https://github.com/vanhauser-thc/AFLplusplus | ||
|
||
There is also a mailing list for the project; to join, send a mail to | ||
There is also a mailing list for the afl project; to join, send a mail to | ||
<[email protected]>. Or, if you prefer to browse | ||
archives first, try: | ||
|
||
https://groups.google.com/group/afl-users | ||
|
||
PS. If you wish to submit raw code to be incorporated into the project, please | ||
be aware that the copyright on most of AFL is claimed by Google. While you do | ||
retain copyright on your contributions, they do ask people to agree to a simple | ||
CLA first: | ||
|
||
https://cla.developers.google.com/clas | ||
|
||
Sorry about the hassle. Of course, no CLA is required for feature requests or | ||
bug reports. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,8 @@ | |
TCG instrumentation and block chaining support by Andrea Biondo | ||
<[email protected]> | ||
QEMU 3.1.0 port and thread-safety by Andrea Fioraldi | ||
<[email protected]> | ||
Copyright 2015, 2016, 2017 Google Inc. All rights reserved. | ||
|
@@ -19,7 +21,7 @@ | |
http://www.apache.org/licenses/LICENSE-2.0 | ||
This code is a shim patched into the separately-distributed source | ||
code of QEMU 2.10.0. It leverages the built-in QEMU tracing functionality | ||
code of QEMU 3.1.0. It leverages the built-in QEMU tracing functionality | ||
to implement AFL-style instrumentation and to take care of the remaining | ||
parts of the AFL fork server logic. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,165 @@ | ||
/* | ||
american fuzzy lop - high-performance binary-only instrumentation | ||
----------------------------------------------------------------- | ||
Written by Andrew Griffiths <[email protected]> and | ||
Michal Zalewski <[email protected]> | ||
Idea & design very much by Andrew Griffiths. | ||
TCG instrumentation and block chaining support by Andrea Biondo | ||
<[email protected]> | ||
QEMU 3.1.0 port and thread-safety by Andrea Fioraldi | ||
<[email protected]> | ||
Copyright 2015, 2016, 2017 Google Inc. All rights reserved. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at: | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
This code is a shim patched into the separately-distributed source | ||
code of QEMU 3.1.0. It leverages the built-in QEMU tracing functionality | ||
to implement AFL-style instrumentation and to take care of the remaining | ||
parts of the AFL fork server logic. | ||
The resulting QEMU binary is essentially a standalone instrumentation | ||
tool; for an example of how to leverage it for other purposes, you can | ||
have a look at afl-showmap.c. | ||
*/ | ||
|
||
void afl_maybe_log(void* cur_loc); | ||
|
||
/* Note: we convert the 64 bit args to 32 bit and do some alignment | ||
and endian swap. Maybe it would be better to do the alignment | ||
and endian swap in tcg_reg_alloc_call(). */ | ||
void tcg_gen_afl_maybe_log_call(target_ulong cur_loc) | ||
{ | ||
int real_args, pi; | ||
unsigned sizemask, flags; | ||
TCGOp *op; | ||
|
||
TCGTemp *arg = tcgv_ptr_temp( tcg_const_tl(cur_loc) ); | ||
|
||
flags = 0; | ||
sizemask = dh_sizemask(void, 0) | dh_sizemask(ptr, 1); | ||
|
||
#if defined(__sparc__) && !defined(__arch64__) \ | ||
&& !defined(CONFIG_TCG_INTERPRETER) | ||
/* We have 64-bit values in one register, but need to pass as two | ||
separate parameters. Split them. */ | ||
int orig_sizemask = sizemask; | ||
TCGv_i64 retl, reth; | ||
TCGTemp *split_args[MAX_OPC_PARAM]; | ||
|
||
retl = NULL; | ||
reth = NULL; | ||
if (sizemask != 0) { | ||
real_args = 0; | ||
int is_64bit = sizemask & (1 << 2); | ||
if (is_64bit) { | ||
TCGv_i64 orig = temp_tcgv_i64(arg); | ||
TCGv_i32 h = tcg_temp_new_i32(); | ||
TCGv_i32 l = tcg_temp_new_i32(); | ||
tcg_gen_extr_i64_i32(l, h, orig); | ||
split_args[real_args++] = tcgv_i32_temp(h); | ||
split_args[real_args++] = tcgv_i32_temp(l); | ||
} else { | ||
split_args[real_args++] = arg; | ||
} | ||
nargs = real_args; | ||
args = split_args; | ||
sizemask = 0; | ||
} | ||
#elif defined(TCG_TARGET_EXTEND_ARGS) && TCG_TARGET_REG_BITS == 64 | ||
int is_64bit = sizemask & (1 << 2); | ||
int is_signed = sizemask & (2 << 2); | ||
if (!is_64bit) { | ||
TCGv_i64 temp = tcg_temp_new_i64(); | ||
TCGv_i64 orig = temp_tcgv_i64(arg); | ||
if (is_signed) { | ||
tcg_gen_ext32s_i64(temp, orig); | ||
} else { | ||
tcg_gen_ext32u_i64(temp, orig); | ||
} | ||
arg = tcgv_i64_temp(temp); | ||
} | ||
#endif /* TCG_TARGET_EXTEND_ARGS */ | ||
|
||
op = tcg_emit_op(INDEX_op_call); | ||
|
||
pi = 0; | ||
|
||
TCGOP_CALLO(op) = 0; | ||
|
||
real_args = 0; | ||
int is_64bit = sizemask & (1 << 2); | ||
if (TCG_TARGET_REG_BITS < 64 && is_64bit) { | ||
#ifdef TCG_TARGET_CALL_ALIGN_ARGS | ||
/* some targets want aligned 64 bit args */ | ||
if (real_args & 1) { | ||
op->args[pi++] = TCG_CALL_DUMMY_ARG; | ||
real_args++; | ||
} | ||
#endif | ||
/* If stack grows up, then we will be placing successive | ||
arguments at lower addresses, which means we need to | ||
reverse the order compared to how we would normally | ||
treat either big or little-endian. For those arguments | ||
that will wind up in registers, this still works for | ||
HPPA (the only current STACK_GROWSUP target) since the | ||
argument registers are *also* allocated in decreasing | ||
order. If another such target is added, this logic may | ||
have to get more complicated to differentiate between | ||
stack arguments and register arguments. */ | ||
#if defined(HOST_WORDS_BIGENDIAN) != defined(TCG_TARGET_STACK_GROWSUP) | ||
op->args[pi++] = temp_arg(arg + 1); | ||
op->args[pi++] = temp_arg(arg); | ||
#else | ||
op->args[pi++] = temp_arg(arg); | ||
op->args[pi++] = temp_arg(arg + 1); | ||
#endif | ||
real_args += 2; | ||
} | ||
|
||
op->args[pi++] = temp_arg(arg); | ||
real_args++; | ||
|
||
op->args[pi++] = (uintptr_t)&afl_maybe_log; | ||
op->args[pi++] = flags; | ||
TCGOP_CALLI(op) = real_args; | ||
|
||
/* Make sure the fields didn't overflow. */ | ||
tcg_debug_assert(TCGOP_CALLI(op) == real_args); | ||
tcg_debug_assert(pi <= ARRAY_SIZE(op->args)); | ||
|
||
#if defined(__sparc__) && !defined(__arch64__) \ | ||
&& !defined(CONFIG_TCG_INTERPRETER) | ||
/* Free all of the parts we allocated above. */ | ||
real_args = 0; | ||
int is_64bit = orig_sizemask & (1 << 2); | ||
if (is_64bit) { | ||
tcg_temp_free_internal(args[real_args++]); | ||
tcg_temp_free_internal(args[real_args++]); | ||
} else { | ||
real_args++; | ||
} | ||
if (orig_sizemask & 1) { | ||
/* The 32-bit ABI returned two 32-bit pieces. Re-assemble them. | ||
Note that describing these as TCGv_i64 eliminates an unnecessary | ||
zero-extension that tcg_gen_concat_i32_i64 would create. */ | ||
tcg_gen_concat32_i64(temp_tcgv_i64(ret), retl, reth); | ||
tcg_temp_free_i64(retl); | ||
tcg_temp_free_i64(reth); | ||
} | ||
#elif defined(TCG_TARGET_EXTEND_ARGS) && TCG_TARGET_REG_BITS == 64 | ||
int is_64bit = sizemask & (1 << 2); | ||
if (!is_64bit) { | ||
tcg_temp_free_internal(arg); | ||
} | ||
#endif /* TCG_TARGET_EXTEND_ARGS */ | ||
} | ||
|
Oops, something went wrong.