Compare commits

...

2733 Commits
2.53c ... 2.68c

Author SHA1 Message Date
ee206da389 Merge pull request #545 from AFLplusplus/dev
v2.68c
2020-09-04 22:51:43 +02:00
fac108476c v2.68c 2020-09-04 22:50:45 +02:00
4f7a8a4c70 Merge pull request #542 from AFLplusplus/dev
push to stable
2020-09-04 22:48:46 +02:00
976ee9022c fix assignment 2020-09-04 22:47:37 +02:00
0625eb0a05 avoid signed ints for amounts (which are positive) 2020-09-04 22:26:39 +02:00
77b824d101 compile fix 2020-09-04 17:56:17 +02:00
b7b38205d8 fix travis 2020-09-04 17:37:11 +02:00
6c715f1a69 more changes to fuzzer_setup 2020-09-04 17:04:42 +02:00
fc19aa96f7 Merge pull request #544 from ThomasTNO/export_env_vars
Export set afl_environment_variables to stats
2020-09-04 16:30:15 +02:00
50f61b64b1 Make open_file() inline 2020-09-04 16:22:22 +02:00
809a7cffe2 Write set environment variables in an env file style. 2020-09-04 16:02:09 +02:00
6399f84ba2 fix example 2020-09-04 16:02:02 +02:00
8459bcdf85 fix example 2020-09-04 16:01:08 +02:00
6adaacbb3a Seperate fuzzer_setup from fuzzer_stats, only write fuzzer_setup at the start 2020-09-04 15:54:57 +02:00
6c846bcf2c fix driver test 2020-09-04 15:27:02 +02:00
e45ae8e5da Export set afl_environment_variables to stats 2020-09-04 13:48:43 +02:00
cea2fadbf4 fix afl-whatsup time 2020-09-03 10:27:32 +02:00
4c48d3a3ad update xxh3 to 0.8.0, fix is_ascii 2020-09-03 09:59:23 +02:00
020b8a4964 minor FAQ fixes 2020-09-02 20:19:49 +02:00
08f6e1d66a children terminate on sigpipe 2020-09-02 17:54:54 +02:00
28e457e8d8 add temporary travis target 2020-09-02 10:18:10 +02:00
c7255f2e26 bugfix for Ubuntu trusty: avoid unknown compiler option 2020-09-01 18:55:37 +00:00
6340674a23 Merge branch 'dev' of https://github.com/AFLplusplus/AFLplusplus into dev 2020-09-01 19:54:18 +02:00
4538f689ed split-compares-pass: bugfix add missing instrument_file filtering in some places 2020-09-01 19:51:53 +02:00
e4a86b40a5 child cleanup 2020-09-01 13:42:33 +02:00
75c38d6243 Merge branch 'dev' of github.com:vanhauser-thc/AFLplusplus into dev 2020-09-01 12:36:13 +02:00
6f75100602 qemuafl envs 2020-09-01 12:36:04 +02:00
07cee6b750 fix unicorn clean 2020-09-01 11:13:26 +02:00
651ad18e21 added the grammar mutator as a git submodule + documentation 2020-09-01 10:52:39 +02:00
664daa2f3c add qemu driver env var 2020-09-01 01:12:40 +02:00
ed6243df5a Review FAQ.md 2020-09-01 00:49:26 +02:00
bd57784664 code format 2020-08-31 23:59:10 +02:00
7f621509ee Merge pull request #540 from AFLplusplus/dev
Dev
2020-08-31 23:04:09 +02:00
4261e17b3e replace non portable echo -n with printf 2020-08-31 22:08:54 +02:00
8ca4414d70 merge conflicts 2020-08-31 20:34:28 +02:00
6090bb1bca better fix for #539 2020-08-31 20:33:56 +02:00
a552631d3b update changelog 2020-08-31 20:22:20 +02:00
c552229c4d Merge pull request #539 from hazimeh/dev
Fixed stack use-after-return bug in strntoll
2020-08-31 20:20:36 +02:00
2dffed1cff Merge pull request #534 from AFLplusplus/dev
push to stable for GSOC
2020-08-31 19:04:37 +02:00
e93f78eca5 Merge pull request #538 from ploppelop/patch-1
Update parallel_fuzzing.md
2020-08-31 18:44:28 +02:00
9bbbec3fa8 Fixed stack use-after-return bug in strntoll 2020-08-31 18:39:50 +02:00
338638b124 Update parallel_fuzzing.md
fix multisystem example
2020-08-31 18:34:27 +02:00
17e1a72b3b Merge branch 'dev' of github.com:vanhauser-thc/AFLplusplus into dev 2020-08-31 18:32:33 +02:00
3e6471b949 added files to gitignore 2020-08-31 18:32:28 +02:00
e4de4e3500 update gitignore 2020-08-31 18:32:01 +02:00
bea76b346c fixed build error 2020-08-31 18:29:45 +02:00
53e63e9ded added forkserver init timeout 2020-08-31 18:28:36 +02:00
b1b5e21600 removed dummy 2020-08-31 18:20:39 +02:00
d765740707 hopefully finally fix ancient apple gmake 2020-08-31 18:18:40 +02:00
192cadee34 fix docs 2020-08-31 18:10:18 +02:00
d7d8afa512 fix afl-gcc help output 2020-08-31 17:54:21 +02:00
01fcee1190 fixed make install on mac os 2020-08-31 17:36:16 +02:00
0805437222 fix make man 2020-08-31 17:10:13 +02:00
4398b9b517 fix network server 2020-08-31 16:50:26 +02:00
909262f6c5 fix non portable option -T for 'install' 2020-08-31 16:44:18 +02:00
155ef8875a Fix few warnings for FreeBSD case. (#536) 2020-08-31 16:37:46 +02:00
58cf030546 fix for MacOS sudo 2020-08-31 16:34:57 +02:00
18ea9a8447 omit linker option '--dynamic-list' for MacOS 2020-08-31 16:19:09 +02:00
ebd1e6bc4b Merge branch 'dev' of https://github.com/AFLplusplus/AFLplusplus into dev 2020-08-31 15:40:47 +02:00
45d866d548 typo 2020-08-31 15:40:20 +02:00
8087cf7988 Merge branch 'dev' of github.com:vanhauser-thc/AFLplusplus into dev 2020-08-31 15:17:51 +02:00
9e8b3f13e1 fixed warning on mac 2020-08-31 15:17:37 +02:00
ce4700ca6e Merge branch 'dev' of https://github.com/AFLplusplus/AFLplusplus into dev 2020-08-31 15:17:24 +02:00
8253f90134 typos/wording 2020-08-31 15:16:55 +02:00
86421f3469 Merge pull request #535 from rhertzog/manpages
Fix manpages generated by llvm_mode/GNUMakefile
2020-08-31 15:05:54 +02:00
811ef13b20 Fix manpages generated by llvm_mode/GNUMakefile
* Use a build date derived from SOURCE_DATE_EPOCH like in the main
  Makefile
* Fix the path to the binary
2020-08-31 14:56:02 +02:00
7fb72f1038 typos 2020-08-31 14:47:22 +02:00
d2c9e4baa7 fix warnings and weird code insert 2020-08-31 13:12:59 +02:00
81767287c3 improve documentation 2020-08-31 13:02:40 +02:00
6c980e2a02 rewrite documentation 2020-08-31 12:56:14 +02:00
e7db4d4fe0 fix sync script, update remote sync documentation 2020-08-31 12:36:30 +02:00
567042d146 typos fixed. 2020-08-31 12:32:31 +02:00
4697e4a5a5 description for AFL_MAX_DET_EXTRAS added 2020-08-31 12:26:41 +02:00
92b1f9cf36 added SO link about rand for clarification 2020-08-31 12:11:38 +02:00
bbf00204ea Merge pull request #531 from rhertzog/extend-cflags-safe
Add -fdebug-prefix-map to CFLAGS_SAFE
2020-08-31 11:38:09 +02:00
a42b74b624 Merge pull request #530 from rhertzog/add-cppflags
Pass CPPFLAGS to all calls of the C compiler
2020-08-31 11:33:34 +02:00
7ee255cbcf Merge pull request #529 from rhertzog/manpages
Manual pages related changes
2020-08-31 11:21:52 +02:00
961ddfd7f8 Merge pull request #528 from rhertzog/fix-symlinks
Fix the /usr/bin/afl-clang and afl-clang++ symlinks
2020-08-31 11:19:16 +02:00
4566bcf122 code-format 2020-08-31 10:57:01 +02:00
ca0105ddf6 fix make DEBUG=1 (error seen with gcc 10.2.0) 2020-08-29 21:45:23 +02:00
41bb359428 Fix various spelling errors (#532)
All those spelling errors have been caught by lintian's built-in
spellchecker:
https://lintian.debian.org/tags/spelling-error-in-binary.html
2020-08-28 23:04:25 +02:00
146ede0f29 Add -fdebug-prefix-map to CFLAGS_SAFE
In Debian, we override CFLAGS to include -fdebug-prefix-map to avoid
hardcoding the build path in any generated debug information. This is
to help with getting the package to build reproducibly.

However you seem to voluntarily not honor CFLAGS but only CFLAGS_SAFE
for a limited number of source files. This resulted in a lintian warning
on Debian's side (https://lintian.debian.org/tags/file-references-package-build-path.html)
pointing to /usr/lib/afl/afl-llvm-rt-64.o and /usr/lib/afl/afl-llvm-rt.o.

With this commit, I'm manually adding -fdebug-prefix-map as a safe
build flag to CFLAGS_SAFE.
2020-08-28 22:16:08 +02:00
c0fd7ba6d1 Pass CPPFLAGS to all calls of the C compiler
This variable is a standard way to inject options for the C
preprocessor. It's respected by the implicit rules of make
and autoconf/automake.

Debian sets this variable during package build to inject
`-D_FORTIFY_SOURCE=2` and we would like afl++ to respect it.

Note that this commit also adds $(CFLAGS) in the build of
afl-performance.o where it was missing. It might have been
on purpose but we want to keep CFLAGS everywhere as well
since Debian injects various options through that variable
(for hardening and reproducibility).
2020-08-28 21:55:52 +02:00
b0b2a15891 Improve the generated manual page to be compatible with whatis
And generate the manual page for afl-g++ too.
2020-08-28 21:34:36 +02:00
ff3c9cbd73 Fix installation path of manual pages
Manual pages are stored in /usr/share/man/.
2020-08-28 21:34:08 +02:00
6e839f0f6a Fix the /usr/bin/afl-clang and afl-clang++ symlinks
Right now they are created pointing to '../afl-clang-fast' instead
of 'afl-clang-fast. Given that all the binaries are in the same directory,
the symlinks are effectively broken.
2020-08-28 21:26:32 +02:00
a3cd523250 todo update 2020-08-27 15:24:38 +02:00
b44620f0b0 Merge pull request #526 from h1994st/dev
Prevent afl-fuzz from modifying stage_max during fuzzing
2020-08-27 08:56:08 +02:00
9a6a32775f Prevent afl-fuzz from modifying stage_max during fuzzing 2020-08-27 00:32:53 -04:00
3e8beaafc8 fixing wrong fatal ... 2020-08-26 21:22:24 +02:00
33e58c1d4e some warnings fixes 2020-08-26 14:45:59 +02:00
4be0ea596b rand unlikely added 2020-08-26 13:04:03 +02:00
96ef7083c8 using unbiased rand_below 2020-08-26 05:28:33 +02:00
78eaa6b203 lintokencap: fix compiler complains on Solaris 11. (#525) 2020-08-25 17:11:15 +02:00
1efc6e59b7 Added out_file value when using stdio (#524) 2020-08-24 21:18:51 +02:00
19eddbb0c7 make py functions as optional as they are in the doc 2020-08-24 18:12:08 +02:00
6a34c5aa3e fix python implementation for new function 2020-08-24 18:06:07 +02:00
c7f0d30668 added afl_custom_fuzz_count 2020-08-24 17:32:41 +02:00
a7c3f252d5 unicorn build warning for MUSL based linux distros. (#510) 2020-08-24 12:06:04 +02:00
b9b6f06429 Allow Large Extras (#523)
* allow large extras

* skipping large testcases again
2020-08-24 12:04:29 +02:00
a1442bd1ac no longer warns for prob. extras 2020-08-23 11:21:49 +02:00
4d9d52e3d9 code format 2020-08-23 11:00:46 +02:00
6184832ea9 added more env var docs, fsrv fixes for cmin, tmin 2020-08-23 10:59:56 +02:00
e2b54bfa05 code format 2020-08-23 10:40:46 +02:00
425908a00c Option for specifying forkserver initialization timeout via environment variable (#522)
* Addition of AFL_FORKSRV_INIT_TMOUT env var

This commit introduces a new environment variable which allows to
specify the timespan AFL should wait for initial contact with the
forkserver.

This is useful for fuzz-targets requiring a rather long setup time
before the actual fuzzing can be started (e.g., unicorn).

* add .swp files to .gitignore

* Inherit init_tmout in afl_fsrv_init_dup

Without this patch, the forkserver would spawn with a timeout of 0 in
cmplog mode, leading to an immediate crash.

Additionally, this commit removes a spurious whitespace.

* Initialize afl->fsrv.init_tmout in afl_fsrv_init

Not all afl-components will need the new AFL_FORKSRV_INIT_TMOUT
environment variable. Hence, it's initialized to the safe "default"
value from before in afl_fsrv_init now.
2020-08-23 10:39:34 +02:00
1301552101 added AFL_MAX_DET_EXTRAS env var 2020-08-23 01:48:36 +02:00
c4f71ab201 enable autodict for cmplog compile, it is ensure not be used in the forkserver 2020-08-22 10:01:45 +02:00
42ef1968a5 Merge pull request #521 from AFLplusplus/dev
Push to stable to fix wrong free on exit
2020-08-22 01:30:21 +02:00
5ec91fce23 fix for bad free (#520) 2020-08-21 23:03:08 +02:00
47878f6974 add execs_done to plot file 2020-08-21 23:33:35 +02:00
d5c77a9e96 update todo 2020-08-21 15:45:15 +02:00
4d2694c114 fix semicolon 2020-08-21 15:26:43 +02:00
017c8a6940 fix global id documentation for LTO pcguard 2020-08-21 14:39:47 +02:00
b0a783e86f code format 2020-08-21 11:18:18 +02:00
714e4d2b46 fixed for LTO llvm 11 2020-08-21 11:17:03 +02:00
85a4c5e724 only compile SanitizerCoverage for LTO 2020-08-21 10:50:06 +02:00
182b8b3e14 remove doc reference for SKIPSINGLEBLOCK 2020-08-20 19:00:15 +02:00
4ce5ed370a LTO: sancov made default, deprecated SKIPSINGLEBLOCK, deactivate LTO autodict for cmplog binaries 2020-08-20 18:57:05 +02:00
f7bac482e9 Merge pull request #518 from AFLplusplus/ltopcguard
sancov ported to LTO
2020-08-20 18:33:53 +02:00
bd074e9150 add missing features for sancov lto 2020-08-20 18:32:22 +02:00
d52ea44c27 fix wrong var 2020-08-20 18:27:22 +02:00
9c1b6cfb99 Merge pull request #517 from AFLplusplus/custommut-readme
Custom Mutator readme
2020-08-20 14:21:42 +02:00
631d3f274a move afl_loop check 2020-08-20 13:49:11 +02:00
3cdaf4dcf2 sancov enhancement 2020-08-20 13:37:34 +02:00
572944d726 Merge pull request #514 from AFLplusplus/dev
push to stable
2020-08-20 11:00:07 +02:00
779d8f6b7e support current llvm12 changes 2020-08-20 10:56:51 +02:00
322847755a Merge pull request #513 from fouzhe/patch-1
fix typo
2020-08-19 17:58:35 +02:00
f9f28b9c7c fix typo 2020-08-19 23:54:45 +08:00
c3bc0145e7 Merge pull request #512 from AFLplusplus/stable
activate travis for stable
2020-08-19 16:21:03 +02:00
17d403b8f8 activate travis for stable 2020-08-19 16:19:31 +02:00
9faf7b6fc8 v2.67d 2020-08-18 20:08:29 +02:00
5c759953f4 Merge pull request #511 from AFLplusplus/stable
push to dev
2020-08-18 20:05:56 +02:00
1c64048d0f 2.67c 2020-08-18 19:56:47 +02:00
b504b9313a code-format, changelog 2020-08-18 01:36:49 +02:00
1a94cfe2af moved autodict extras away from extras_a 2020-08-18 01:31:40 +02:00
7470b475a9 Reworked maybe_grow to take a single ptr, renamed to afl_realloc (#505)
* maybe_grow takes a single ptr

* fixed use_deflate

* reworked maybe_grow_bufsize

* helper to access underlying buf

* remove redundant realloc_block

* code format

* fixes

* added unit tests

* renamed maybe_grow to afl_realloc

* BUF_PARAMS -> AFL_BUF_PARAM
2020-08-18 00:50:52 +02:00
0a6084f361 Merge pull request #499 from AFLplusplus/dev
important push to stable
2020-08-17 23:42:45 +02:00
f92607cff1 pcguard for lto 2020-08-17 22:56:48 +02:00
9532499ef5 install libafldrivers 2020-08-16 14:14:24 +02:00
1d56de6c1d fix lto autodict for long strings 2020-08-16 13:29:24 +02:00
266b51a842 final afl-llvm-rt.o.c that takes care of all eventualities 2020-08-16 10:53:38 +02:00
cc1fe2f2d2 skip instrumenting blocks following __afl_loop to improve stability in LTO. not in afl-llvm-pass and instrim because they are outdated, sancov cant be fixed 2020-08-15 22:59:49 +02:00
43214d6b46 more likely 2020-08-15 22:10:28 +02:00
2f28ecd3a5 more unlikely 2020-08-15 20:51:57 +02:00
73a629d6f2 important bugfix for large covmaps 2020-08-15 18:14:44 +02:00
0a251f93e0 increase initial memory sized 2020-08-15 13:34:51 +02:00
1cf4738487 more FAQ 2020-08-15 10:27:40 +02:00
af14acf2c1 Revert "Merge branch 'debug' into dev"
This reverts commit a7537b5511, reversing
changes made to 15e799f7ae.
2020-08-14 14:35:05 +02:00
a7537b5511 Merge branch 'debug' into dev 2020-08-14 13:23:14 +02:00
15e799f7ae fix for llvm 11 2020-08-14 12:42:45 +02:00
5f0a9c90c8 fixes lots of llvm warnings 2020-08-14 12:06:00 +02:00
9ff9ff2ad2 more secure way to work with a dynamic map 2020-08-14 11:40:26 +02:00
d86b13384f remove unnecessary code, increase init map size 2020-08-14 11:25:13 +02:00
17a4e9fadf remove debug 2020-08-14 10:11:04 +02:00
ce513c4f3e fix llvm12 -fuseld warning 2020-08-14 10:10:23 +02:00
ce92adcb9b formatting 2020-08-14 08:33:36 +02:00
e94cc1fae0 new faq entries 2020-08-14 07:09:01 +02:00
32fe047894 fix AFL_LLVM_MAP_DYNAMIC 2020-08-14 06:46:22 +02:00
d1bc0207cc no longer using alloc for autodict 2020-08-14 01:33:03 +02:00
69f8c62955 code-format 2020-08-14 00:46:48 +02:00
83df65a66b cleaned up maybe_add_auto calls 2020-08-14 00:46:15 +02:00
c3a6e7e870 testcases indicate count 2020-08-14 00:20:04 +02:00
d0ab83a202 Changelog wording/whitespace 2020-08-13 23:19:05 +02:00
b5d1a021ef fix llvm and afl-showmap 2020-08-13 22:34:11 +02:00
e9fb5f4cbc fix for llvm < 11 2020-08-13 21:46:27 +02:00
212bb990b7 LTO: apply laf-intel+redqueen/cmplog at link time 2020-08-13 21:27:11 +02:00
8e984c2aa0 fix for sancov 2020-08-13 18:24:36 +02:00
7f435ec5f1 refactor get filename 2020-08-13 16:29:00 +02:00
47faf3dd33 code review: fixed some typos 2020-08-13 15:44:03 +02:00
c4e52e20c9 fix warning 2020-08-13 12:58:10 +02:00
2c5e103278 make cmplog deterministic 2020-08-13 12:39:18 +02:00
7a6867e2f8 split up __afl_manual_init, added internal AFL_DISABLE_LLVM_INSTRUMENTATION, skipping ctor+ifunc functions for all llvm, code-format 2020-08-12 16:06:30 +02:00
8044ae28be Merge pull request #496 from AFLplusplus/dev
push to stable
2020-08-12 14:29:34 +02:00
b38837f4ff setting attribute hot intelligently gives 0.5% speed 2020-08-12 14:14:44 +02:00
c25479264d fix LLVM version check 2020-08-12 13:28:31 +02:00
e9b3da5d96 llvm 9 workaround 2020-08-12 11:03:33 +02:00
132b57cf03 nozero for llvm pcguard 2020-08-12 10:41:09 +02:00
ee548df05f improve readme 2020-08-11 22:58:57 +02:00
052d74b16c added new githubsecurity blog entry 2020-08-11 18:44:57 +02:00
83281503b3 Merge pull request #498 from AFLplusplus/taint
dont merge
2020-08-11 18:26:30 +02:00
b604f5eafc finalize first beta! yay! 2020-08-11 18:06:18 +02:00
220dc4a43d review done, pray 2020-08-11 16:25:35 +02:00
457f627101 move taint_mode var 2020-08-11 15:10:18 +02:00
4f695b6f4c fixes 2020-08-11 11:16:48 +02:00
3ec1b23743 cleanup minor issues 2020-08-11 10:36:34 +02:00
0ba09ee85a enhancements 2020-08-11 10:24:45 +02:00
67dac15226 Merge branch 'debug' into taint 2020-08-11 03:40:12 +02:00
9cf8637fab break up llvm rt afl init 2020-08-11 03:37:02 +02:00
50e76fce12 adding ctor function skipping in LTO fixed map mode 2020-08-11 02:05:39 +02:00
432638404f ignoring ifuncs on fixed map LTO 2020-08-11 01:31:44 +02:00
1e38c10efb remove warning, fix text 2020-08-10 23:48:13 +02:00
701fb95d24 LTO: make dynamic map the default 2020-08-10 23:42:33 +02:00
7b5a18428e fixed __func__ 2020-08-10 23:17:39 +02:00
7d7a8c7c39 code-format 2020-08-10 19:05:22 +02:00
a422fcaa40 fixed minor inconsistencies, reenabled warnings 2020-08-10 19:04:51 +02:00
fee58a4d1b segfault info 2020-08-10 14:32:35 +02:00
3ecafde29d increase stack size 2020-08-10 13:59:30 +02:00
8428b18d2a fix another segfault 2020-08-10 13:30:25 +02:00
9c953ab51f memory grab at startup to prevent crashes 2020-08-10 13:03:59 +02:00
f181a8307b put ! in .new map 2020-08-10 12:48:15 +02:00
84b9d551fd disable expand havoc mopt for taint 2020-08-10 12:11:49 +02:00
8f8555dfdf fix segfault 2020-08-10 12:05:30 +02:00
464c27082a fuzzbench integration 2020-08-10 11:45:32 +02:00
3aa7d8081d fuzzbench integration 2020-08-10 11:23:33 +02:00
fb84103ffb please no -Werror in the dev branch 2020-08-10 09:39:43 +02:00
c270646722 fix wrong incomplete 2020-08-10 09:37:32 +02:00
87da1e7af6 fix driver 2020-08-10 09:16:55 +02:00
9b71f7e5e4 debug 2020-08-10 08:47:52 +02:00
9945c1648b fix driver 2020-08-10 01:34:45 +02:00
e5d24827de force llvm map 2020-08-10 01:28:26 +02:00
a6521e89fc different driver 2020-08-10 01:04:50 +02:00
5e36fb32a8 readme 2020-08-10 00:56:08 +02:00
fb0181f5bc readme 2020-08-10 00:53:50 +02:00
6fa2c213ef add driver 2020-08-10 00:24:27 +02:00
9ec223c844 final touches for first testing 2020-08-09 23:47:51 +02:00
558a82891a finalize havoc 2020-08-09 22:02:44 +02:00
4fc16b542e havoc copy 2020-08-09 21:32:15 +02:00
ff40359a60 fixes 2020-08-09 21:09:07 +02:00
e99d7e9730 integration in fuzz_one 2020-08-09 20:24:56 +02:00
b60663c031 taint integration done 2020-08-09 18:48:12 +02:00
32db31b555 fixes 2020-08-09 12:35:52 +02:00
a1129b67c2 changes 2020-08-09 12:15:36 +02:00
8a1cf3f0f9 Merge pull request #497 from murx-/dev
Add support for specific custom mutator name
2020-08-09 01:19:55 +02:00
0bb59ba116 code format 2020-08-09 01:09:26 +02:00
e4a0237cbc step 1 2020-08-09 00:35:12 +02:00
d8f5502d83 initial integration 2020-08-08 20:29:56 +02:00
45d0e4765e fix stderr output 2020-08-08 19:37:15 +02:00
9a1d526ed4 Add support for specific custom mutator name 2020-08-08 18:34:54 +02:00
ebc6f52868 cp inc 2020-08-08 12:55:35 +02:00
a19b31bf82 cp inc 2020-08-08 12:53:39 +02:00
28251a495a reformatted table 2020-08-08 12:41:35 +02:00
f4592a8fb4 merged readme changes 2020-08-08 12:38:10 +02:00
b29d91edf5 add stub directory 2020-08-08 11:17:05 +02:00
986af28df2 README.md: show afl-gcc as intel only 2020-08-07 22:06:36 +02:00
27abecbff5 compile fixes on 32-bit OSs 2020-08-07 21:07:05 +02:00
33141cf8a3 tests: cleanup core files, more time for llvm cmplog 2020-08-07 20:22:13 +02:00
8551d8e48e Merge branch 'dev' of https://github.com/AFLplusplus/AFLplusplus into dev 2020-08-07 19:53:32 +02:00
32558bc807 minor test fixes for Raspberry Pi Linux 64-bit 2020-08-07 19:41:39 +02:00
934cdc32f4 Merge branch 'dev' of https://github.com/vanhauser-thc/AFLplusplus into dev 2020-08-07 17:32:52 +02:00
699ebaa8e2 code format 2020-08-07 17:32:41 +02:00
44ad516edd remove debug 2020-08-07 17:23:11 +02:00
fd9a7e719d fixed wextra 2020-08-07 17:20:24 +02:00
e51f1ea5a5 Merge branch 'dev' of https://github.com/vanhauser-thc/AFLplusplus into dev 2020-08-07 16:56:12 +02:00
22d3a5e90a enabled Wextra, fixed bugs 2020-08-07 16:55:58 +02:00
673ace2a4b test-llvm.sh: clear file errors after test 2020-08-07 16:34:10 +02:00
4a6d66d8c5 fix typos 2020-08-07 14:43:17 +02:00
1978629d87 Custom Mutator readme (#495) 2020-08-07 14:21:12 +02:00
6b1ad311da Custom Mutator readme 2020-08-07 14:20:38 +02:00
5b06166144 reverse cmplog temps 2020-08-07 11:10:17 +02:00
a0fab35bbf temporary fix for cmplog 2020-08-07 10:42:33 +02:00
420b202124 temporary fix for cmplog 2020-08-07 10:37:28 +02:00
fb14e55cc9 fix -N description 2020-08-07 09:05:40 +02:00
e2434cf8c6 remove datalen in havoc 2020-08-06 23:27:50 +02:00
d94681186d Merge branch 'dev' of github.com:vanhauser-thc/AFLplusplus into dev 2020-08-06 20:26:06 +02:00
58a710d192 check cmp map null in sancov trace switch 2020-08-06 20:25:57 +02:00
716eb226b2 enforce __afl_cmp_map points to a dummy by default 2020-08-06 20:06:57 +02:00
cb3631a322 add cmplog map to aflpp driver 2020-08-06 20:02:47 +02:00
bd1d148f83 Merge pull request #494 from AFLplusplus/test
aflpp driver fix for early callers
2020-08-06 19:43:56 +02:00
7e0c9a36ef update persistent doc 2020-08-06 19:42:33 +02:00
bbfff7d472 fix 2020-08-06 19:37:13 +02:00
e048d95660 fix 2020-08-06 19:13:04 +02:00
970d75d681 fix 2020-08-06 19:07:52 +02:00
51f3a81037 fix 2020-08-06 19:05:57 +02:00
8190436f8f fix 2020-08-06 18:51:16 +02:00
08bcaa135f dummy mem test 2020-08-06 18:44:12 +02:00
c4e5f75728 install dynamic list 2020-08-05 15:02:21 +02:00
1064c7114e code format 2020-08-05 13:30:43 +02:00
0281872ddf remove shared_linking check 2020-08-05 13:05:30 +02:00
c6bf23377d update dynamic list 2020-08-05 12:59:48 +02:00
2d650f8c22 merge conflict 2020-08-05 12:54:52 +02:00
19631851f6 dynamic symbols export for dlopen 2020-08-05 12:53:46 +02:00
f30ca1476c fix short write 2020-08-05 11:17:15 +02:00
0712d44cbc minor fixes 2020-08-05 10:42:41 +02:00
15f3210d93 Merge pull request #492 from dozernz/stable
Fix support for mips in qemu mode
2020-08-05 10:36:48 +02:00
9864d9c189 Merge branch 'dev' of github.com:vanhauser-thc/AFLplusplus into dev 2020-08-05 10:28:00 +02:00
bd36aac60a remove shared_linking case 2020-08-05 10:27:48 +02:00
4a859aff70 travis fixes 2020-08-05 10:25:53 +02:00
8fc727e597 port patch from https://github.com/google/AFL/pull/112 2020-08-05 10:01:58 +02:00
585ec04503 silly rand_below_datalen fix 2020-08-05 09:21:39 +02:00
a1c93f24d4 Fix support for mips in qemu mode 2020-08-05 12:19:43 +12:00
f6c89ec3a9 workaround travis 2020-08-05 01:29:05 +02:00
3d8f054580 readme fix 2020-08-05 01:19:31 +02:00
6d364dd2cb add sancov-like allow/denylist instrument feature 2020-08-05 01:13:51 +02:00
8ed6207b5c update honggfuzz custom mutator. make update is all it takes to stay current :) 2020-08-04 23:33:35 +02:00
c8354d7516 new rand mode for data offsets that prefer low offset values 2020-08-04 23:22:42 +02:00
79f873a597 posix compatible sourcing 2020-08-04 21:57:56 +02:00
8850e1a5bf chmod for testcase 2020-08-04 21:47:21 +02:00
194188fe56 split up testcases 2020-08-04 21:33:29 +02:00
cc74efa35e fix test for nixos 2020-08-04 15:10:20 +02:00
e7f2770275 Merge pull request #490 from AFLplusplus/dev
makefile fix?
2020-08-04 14:35:33 +02:00
af277a0b56 makefile fix? 2020-08-04 14:20:38 +02:00
4163f47e09 fix example 2020-08-04 13:54:13 +02:00
b2aa8b03d9 Merge pull request #488 from AFLplusplus/dev
Dev
2020-08-04 13:30:08 +02:00
e1d20706ca fix cmplog with lto 2020-08-04 13:17:53 +02:00
76888fdf59 bugfix libtokencap Makefile 2020-08-03 23:11:58 +02:00
e6e38d1703 give document edge id a unique id per module 2020-08-03 21:25:32 +02:00
44060590b4 Merge branch 'dev' of github.com:vanhauser-thc/AFLplusplus into dev 2020-08-03 20:51:00 +02:00
38bed607d1 code format 2020-08-03 20:50:47 +02:00
ed63364a77 add touch shmem in forkserver, add binary library and patches.txt for easy testing 2020-08-03 18:13:06 +02:00
55bd24b0c7 Merge branch 'dev' of https://github.com/AFLplusplus/AFLplusplus into dev 2020-08-03 15:17:47 +02:00
f18c2eb8ae no support for DragonFlyBSD. 2020-08-03 15:16:46 +02:00
898353c87a enforce no built-ins for lto 2020-08-03 14:17:51 +02:00
d5d8d664d0 Merge pull request #477 from AFLplusplus/dev
Push to stable
2020-08-03 13:39:55 +02:00
409e4ae945 fix expand havoc for ..._only modes 2020-08-03 13:13:32 +02:00
f335c48686 better PS1 in dockerfile 2020-08-03 11:50:10 +02:00
9d82c3cf5e test for llvm cmplog 2020-08-03 11:30:34 +02:00
491cee669f fix #483 2020-08-03 11:15:12 +02:00
e0d1529061 edge id documentation example for sancov 2020-08-03 10:03:45 +02:00
1cddd51662 refactoring debug/be_quiet, fatal on dont_optimize and instrument_file 2020-08-02 22:28:16 +02:00
6041b1c486 fix LTO document id feature, warnings for INSTRUMENT_FILE 2020-08-02 15:00:49 +02:00
349fed3fcd warn on old llvm 2020-08-02 11:08:47 +02:00
b708cf7d45 fix lto single block and no zero 2020-08-01 19:43:29 +02:00
a267ff1ab5 better LTO mode detection warnings 2020-08-01 18:31:11 +02:00
8e0c776137 more flexible use of shmem persistent vars 2020-08-01 17:58:37 +02:00
4512377fa1 compile persistent mode without afl 2020-08-01 17:39:27 +02:00
9439ba1dac document env var 2020-08-01 16:32:01 +02:00
9c9c4a6b2b remove forced -shared for lto, seems unneeded 2020-08-01 14:27:18 +02:00
6efe51a8a7 improve chances to compile with lto 2020-08-01 13:56:10 +02:00
593940c39a refer to llvm 12 for partial instrumentation for PCGUARD 2020-07-31 20:20:30 +02:00
8ea19d4266 easier float test 2020-07-31 19:37:05 +02:00
b7bcc50c61 reenable cpu tests in test.sh 2020-07-31 19:09:04 +02:00
e939677726 fix travis 2020-07-31 18:43:30 +02:00
ca17ec3fe9 Merge pull request #481 from devnexen/haiku_settings
Haiku set explicitly to performance.
2020-07-31 18:42:06 +02:00
54d9668580 Haiku set explicitly to performance.
No command line to set through afl-system-config (the only one is a GUI).
2020-07-31 17:27:01 +00:00
16b674c652 fix find free cpu 2020-07-31 18:35:43 +02:00
25ad992c62 fix travis 2020-07-31 18:26:18 +02:00
37f1b7cddb fix travis 2020-07-31 18:18:05 +02:00
729445b64f Bind cpu (#480)
* silence compiletime warning

* refactored cpu binding

* formatted code
2020-07-31 18:17:03 +02:00
185f443659 add LTO AFL_LLVM_DOCUMENT_IDS feature 2020-07-31 17:53:01 +02:00
c101a3f5ab readme update 2020-07-31 17:23:31 +02:00
cf9cb73afe Review as requested (watch out for XXX) 2020-07-31 16:27:50 +02:00
071fcac430 building docker from cloned repo 2020-07-31 15:55:48 +02:00
a74ec89461 fixed dockerfile 2020-07-31 15:37:50 +02:00
630d2a934b less gotos 2020-07-31 14:36:58 +02:00
d5758c138b update todo 2020-07-31 11:04:22 +02:00
149b0021b7 improve README 2020-07-31 10:49:25 +02:00
68f46f6178 remove travis debug 2020-07-31 10:44:54 +02:00
cd576fa59d fixes 2020-07-31 10:42:43 +02:00
320f26d26f add -b option to afl-fuzz 2020-07-30 19:00:41 +02:00
c661587128 cdecl void 2020-07-30 18:06:25 +02:00
486e5365d9 fix float splitting if not on a tty 2020-07-30 18:01:18 +02:00
8e809d8593 added NULL check 2020-07-30 17:51:32 +02:00
ea9ba53cdb fix oob reads, code-format 2020-07-30 17:09:22 +02:00
1ba48a5ba0 :Merge branch 'dev' of https://github.com/AFLplusplus/AFLplusplus into dev 2020-07-30 17:02:13 +02:00
7cb00b69f0 warnings reenabled 2020-07-30 17:01:57 +02:00
cbe8f0a9d0 cleanup messages in floating point test case 2020-07-30 17:00:10 +02:00
da8b464e67 fix test.sh 2020-07-30 16:07:47 +02:00
13350bf22f Merge branch 'dev' of https://github.com/AFLplusplus/AFLplusplus into dev 2020-07-30 13:48:16 +02:00
5ce55d87ec make travis green again (floating point testcase), but all laf testcases need AFL_DEBUG=1 (that is another bug) 2020-07-30 13:46:52 +02:00
fc401f1acc fix post process check 2020-07-30 11:51:13 +02:00
fe39e4dfdf remove unneeded stuff 2020-07-30 11:30:37 +02:00
49b77207dd aflpp driver cpp -> c 2020-07-30 11:11:30 +02:00
35a448ee92 enhance for custom trim buffer 2020-07-30 09:20:22 +02:00
3f9f00a798 Merge pull request #460 from rish9101/dev
Add post-process functionality in write_with_gap
2020-07-30 09:15:42 +02:00
ffe5619a9d fix snapshot include 2020-07-29 14:30:22 +02:00
3b194e1690 Merge pull request #476 from AFLplusplus/new_lkm
New snapshot lkm support
2020-07-29 14:15:39 +02:00
45b6508339 fix typo 2020-07-29 13:00:55 +02:00
22921c493f improve docs, enable laf compare if float is set 2020-07-29 12:58:02 +02:00
f32811922e minor opt 2020-07-29 11:56:38 +02:00
6cfa27d78a remove dead code, code-format 2020-07-29 11:47:32 +02:00
8e3ca8eaa9 Merge pull request #473 from AFLplusplus/text_inputs
add splice
2020-07-29 11:41:54 +02:00
4550613f58 Merge branch 'dev' into text_inputs 2020-07-29 11:39:00 +02:00
015fde3703 fix ffmpeg lto example 2020-07-28 22:25:48 +02:00
827ecd61f6 add new example/guideline 2020-07-28 22:13:37 +02:00
565da10a8f Minor change to write_with_gap 2020-07-29 01:05:05 +05:30
d64c0e8887 lkm new api 2020-07-28 16:31:07 +02:00
0b8c44cbb1 add FAQ 2020-07-28 16:29:47 +02:00
a22f4dd1ac new snapshot api 2020-07-28 16:13:32 +02:00
952e5b47eb allow custom mut with mopt if -L is -1 2020-07-28 16:02:15 +02:00
b3f5b566b0 update contribute doc 2020-07-28 13:29:50 +02:00
0b3332d579 finalize new readme 2020-07-28 13:27:18 +02:00
a76e375d5c import lost PR when switching to stable, updated todo 2020-07-28 11:05:00 +02:00
8b21c2e472 unnice 2020-07-28 09:55:32 +02:00
23718e5198 forgot getopt 2020-07-28 09:52:28 +02:00
031aa240bc unnice2 2020-07-27 23:09:26 +02:00
7944009a65 unrenice 2020-07-27 13:07:55 +02:00
4eb06bb54b Merge pull request #465 from electricworry/wine-fix
Fixes AFLplusplus/AFLplusplus#464 winepath path translation for .cur_…
2020-07-27 10:41:07 +02:00
bd5308d839 fix readme 2020-07-27 10:27:57 +02:00
b508532c78 format 2020-07-27 10:09:00 +02:00
fb9888a068 Merge pull request #468 from Kirin-say/fix_qemu_mode
Fix bug in qemu mode
2020-07-27 10:07:12 +02:00
11f25747a9 child renice 2020-07-27 09:39:15 +02:00
8ebed3471f fix readme 2020-07-27 09:30:42 +02:00
85684cd8b7 fix readme 2020-07-27 09:25:30 +02:00
2585a33005 fix readme 2020-07-27 09:21:07 +02:00
1bbeef48e1 update readme, renice -20 2020-07-27 09:10:48 +02:00
7f3317110e update new readme 2020-07-27 00:16:09 +02:00
298ff5c7d0 update new readme 2020-07-27 00:14:28 +02:00
c3f65bff5b update new readme 2020-07-27 00:13:03 +02:00
2323c30b5b fix honggfuzz dict 2020-07-26 22:05:14 +02:00
80f4b32f0b new readme --- in progress 2020-07-26 18:41:54 +02:00
16e362d2b9 add last 60s exec/s stat 2020-07-26 15:55:03 +02:00
23da490f26 Merge pull request #469 from devnexen/haiku_gcc_build_fix
gcc plugin forcing USEMMAP on Haiku
2020-07-26 15:30:47 +02:00
ff107714f1 remove test input mutation in havoc 2020-07-26 15:00:44 +02:00
7e4703c328 Fix typo for afl_custom_deinit (#470) 2020-07-26 14:10:24 +02:00
ae41cedafe gcc plugin forcing USEMMAP on Haiku 2020-07-25 16:14:27 +00:00
a879f72131 fix 2020-07-25 17:38:40 +02:00
131df8bec9 try to fix travis 2020-07-25 16:39:36 +02:00
89557d1607 fix bug in qemu mode 2020-07-25 00:36:36 +08:00
7959808384 llvm12 support 2020-07-24 16:39:50 +02:00
ecb0601bc1 massage chances 2020-07-24 13:42:39 +02:00
30c0991543 better text mutation 2020-07-24 13:26:07 +02:00
9cddbc0420 add -F option to sync to foreign fuzzer queues 2020-07-24 12:26:52 +02:00
2fa31dab60 Remove reduntant copying from write_with_gap function 2020-07-23 23:48:26 +05:30
4898db80cb Add post-process functionality in write_with_gap 2020-07-23 23:16:04 +05:30
aa3856261d fix warning 2020-07-23 17:17:44 +02:00
3e04dbd5a1 no cycle on expand 2020-07-23 16:43:25 +02:00
72b46a07d6 added honggfuzz custom mutator :) 2020-07-23 15:58:13 +02:00
2ba88dcd8a skip large files, dont bail 2020-07-23 14:17:29 +02:00
1ddb70e0d9 fix compilation 2020-07-23 05:08:20 +02:00
024a88a6bb Fixes AFLplusplus/AFLplusplus#464 winepath path translation for .cur_input. 2020-07-22 20:19:55 +01:00
af10c05ac3 ascii redqueen 2020-07-22 18:22:31 +02:00
a46a733dbe fix bugs 2020-07-22 17:04:57 +02:00
b015e4f07a epand havoc now env 2020-07-22 16:15:16 +02:00
44928a0265 write expand havoc value to fuzzer_stats 2020-07-22 02:41:19 +02:00
d90328f6be Allow the custom mutator to generate larger trimmed data (#463) 2020-07-22 00:00:21 +02:00
ce9b4698fe added andrea's splicing, added cycle_schedules 2020-07-21 20:53:51 +02:00
9a33a29b4a Merge pull request #462 from AFLplusplus/dev
Dev
2020-07-21 13:17:29 +02:00
b6e65f9882 Merge pull request #461 from AFLplusplus/new_splicing
New splicing
2020-07-21 13:15:59 +02:00
6c163910ee debug test for rng 2020-07-20 12:08:31 +02:00
9151cb9ba2 update link 2020-07-20 11:40:34 +02:00
204ae75d7b add superion custom mutator link 2020-07-20 10:31:07 +02:00
f2d9b0096e Merge pull request #458 from h1994st/dev
Allow the custom trim function to return 0 bytes
2020-07-20 10:19:14 +02:00
67d2e6319b Skip the empty test case generated by the custom trimming 2020-07-18 23:20:32 -04:00
5e10f660e8 Allow the fuzzer to write empty buffer (i.e., len == 0) to the file 2020-07-18 02:16:04 -04:00
0da0b5cba0 Merge pull request #456 from h1994st/dev
Fix typo
2020-07-17 08:41:26 +02:00
67d7c364f6 Fix typo 2020-07-16 21:59:50 -04:00
67d58e2437 doc updates 2020-07-16 20:24:01 +02:00
c2b04bdf6c queue buffer and new splice havoc mutation 2020-07-16 14:32:41 +02:00
6513bca07e Update post_library_gif.so.c (#454) 2020-07-16 11:47:36 +02:00
0b0366d9b4 removed debug print and code format 2020-07-16 02:27:07 +02:00
f465a75b65 added initial defork example 2020-07-16 02:17:05 +02:00
4314e59af9 code format 2020-07-16 02:03:52 +02:00
a84c958647 fixed mem leak in redqueen 2020-07-16 01:00:39 +02:00
1ec2615a3e tiny fixes 2020-07-16 00:53:08 +02:00
2077309c8d fix afl-frida 2020-07-16 00:24:37 +02:00
08d3169df4 fix afl-frida 2020-07-15 16:58:40 +02:00
3cc0445e27 Merge branch 'dev' of github.com:vanhauser-thc/AFLplusplus into dev 2020-07-15 10:35:51 +02:00
ee77fe4094 improve len encoding in redqueen 2020-07-15 10:35:38 +02:00
133dfc8b69 update documentation 2020-07-15 10:32:07 +02:00
a8726b8254 ensure afl-frida uses persistent mode 2020-07-15 00:08:38 +02:00
c5963f707c make fuzzing of test-floatingpoint reproducible 2020-07-14 23:42:47 +02:00
383b280531 added frida gum extension 2020-07-14 23:26:11 +02:00
95276f7da6 test float splitting increase timeout to 30 seconds 2020-07-13 23:17:21 +02:00
e1d4621796 Merge pull request #450 from devnexen/haiku_build_fix
Haiku build fix. librt is necessary for Linux primarly and SunOS
2020-07-13 18:06:38 +02:00
e137b40eb5 Haiku build fix. librt is necessary for Linux primarly and SunOS 2020-07-13 16:22:18 +00:00
4d929f80fb fix for laf intel float split not enabled if not not on a tty 2020-07-13 17:57:02 +02:00
6b79e1f76d test.sh: FP fuzzing: check for crashes 2020-07-13 11:27:08 +02:00
5a26656ea1 add floating point test cases. One for fuzzing (test-floatingpoint.c) and one for testing all cases with the instrumented program (test-fp_cases.c) 2020-07-13 10:35:43 +02:00
abb0d47985 little untracer enhancements 2020-07-12 23:53:29 +02:00
b126a5d5a8 LTO: autodict default, instrim disabled 2020-07-12 13:44:25 +02:00
571031a467 fix several cases in floating point comparison splitting 2020-07-11 00:56:35 +02:00
2981f2025f increase shm for travis 2020-07-09 23:14:33 +02:00
c3a6065a21 shm + mem info in travis 2020-07-09 23:02:04 +02:00
60bb1afc72 code format 2020-07-09 21:32:06 +02:00
84a320f834 skip -fuse-ld parameters when in LTO mode 2020-07-09 21:31:15 +02:00
88bd460100 Merge pull request #449 from devnexen/illumos_typo
illumos littlefixes: little typo for cpu binding and
2020-07-09 19:05:05 +02:00
90adc2cb85 illumos littlefixes: little typo for cpu binding and
even tough gcc plugin less good than LLVM, clang
is more buggy on this os.
2020-07-09 15:43:05 +01:00
7c8d823396 dockerfile updates 2020-07-09 12:07:29 +02:00
83790d65af eliminate race condition for cpu affinity on -M/-S 2020-07-08 11:16:39 +02:00
70bd0f799d fix afl-whatsup if fuzzer_stats is still empty 2020-07-08 09:39:26 +02:00
cbe029664e fix issue #446 2020-07-07 12:59:00 +02:00
cade0214db Merge pull request #445 from toralf/fix-y-axis-of-low_freq.png
afl-plot: scale y-axis of low_freq.png with integers
2020-07-06 22:29:23 +02:00
2f5cdb72c8 afl-plot: set xlabel to show that times are in UTC
Signed-off-by: Toralf Förster <toralf.foerster@gmx.de>
2020-07-06 19:23:13 +02:00
0aed549df1 warn rather than fail if AFL_MAP_SIZE is set and not understood by instrumenter 2020-07-06 14:11:21 +02:00
75fa1ac3b0 warn rather than fail if AFL_MAP_SIZE is set and not understood by instrumenter 2020-07-06 14:10:14 +02:00
b5a00312e0 rtf.dict: make it more complete (and unique) and fix some entries 2020-07-06 10:27:48 +02:00
37697127dc afl-plot: scale y-axis of low_freq.png with integers
Signed-off-by: Toralf Förster <toralf.foerster@gmx.de>
2020-07-05 15:35:24 +02:00
8acc8b5389 Merge pull request #441 from bmwiedemann/man
Fix generation of afl-system-config.8
2020-07-05 13:53:51 +02:00
8644c42482 check for enough plot data 2020-07-05 13:48:14 +02:00
20e63078f0 Fix generation of afl-system-config.8
and afl-whatsup.8

Without this patch, afl-system-config.8 varied between build hosts
because it contained lines such as
 ./afl-system-config: line 30: sysctl: command not found
 ./afl-system-config: line 31: /sys/kernel/mm/transparent_hugepage/enabled: Permission denied
 It is recommended to boot the kernel with lots of security off

See https://reproducible-builds.org/ for why this matters.

afl-system-config.8 is generated by the %.8 target in GNUmakefile
that calls commands with -hh to fill the OPTIONS section of man-pages.

This PR was done while working on reproducible builds for openSUSE.
2020-07-05 13:41:50 +02:00
95fd080ca1 code format 2020-07-05 11:08:22 +02:00
7d0af01d8b fix rtf.dict 2020-07-05 11:05:33 +02:00
0f0230b068 Merge pull request #437 from devnexen/fbsd_build_fix_llvm_mode
llvm mode shared segment fix for FreeBSD.
2020-07-05 11:01:58 +02:00
869c602b99 Merge pull request #438 from EliaGeretto/fix-typo
Fix typo in compiler wrapper for LLVM instrumentation
2020-07-05 11:01:24 +02:00
3144f72e1c Merge pull request #440 from devnexen/libdislocator_solaris_upd
libdislocator: hugepage enabled for illumos too.
2020-07-05 11:00:45 +02:00
147b0a151c fix laf-intel/compare-transform-pass for 32-Bit 2020-07-04 17:34:03 +02:00
29102d6bf1 libdislocator: hugepage enabled for illumos too. 2020-07-04 12:36:53 +01:00
4fd145c52e llvm_mode: Fix typo in compiler wrapper 2020-07-03 18:37:53 +02:00
e6d4d29af5 llvm mode shared segment fix for FreeBSD.
MAP_EXCL|MAP_FIXED is a (genuine) equivalent to Linux's MAP_FIXED_NOREPLACE.
2020-07-03 15:21:33 +01:00
139665c01d ubsan options 2020-07-03 10:20:10 +02:00
509b991607 Merge pull request #435 from devnexen/libtokencap_solaris
libtokencap illumos/solaris support proposal.
2020-07-03 09:45:19 +02:00
c671ecb511 Fix map list iteration. 2020-07-02 10:23:56 +01:00
1aa7c87ea8 libtokencap illumos/solaris support proposal. 2020-07-02 07:10:43 +01:00
00abb999e3 v2.66d init 2020-07-01 18:24:00 +02:00
4a51cb71fb Merge pull request #434 from AFLplusplus/dev
Last Minute Unicornafl Update
2020-07-01 16:52:05 +02:00
f2efea4b46 Revert "Revert "updated unicorn version""
This reverts commit 857046ede5.
2020-07-01 16:05:04 +02:00
e15a013696 Merge pull request #433 from AFLplusplus/dev
final push to stable before release?
2020-07-01 15:58:26 +02:00
857046ede5 Revert "updated unicorn version"
This reverts commit 4515e06ca8.
2020-07-01 15:57:48 +02:00
4515e06ca8 updated unicorn version 2020-07-01 15:50:25 +02:00
97cef46b62 warn on deprecated env vars 2020-07-01 10:03:34 +02:00
4ec29928bf because github errors reput typo fix 2020-07-01 09:30:14 +02:00
ba79777bc5 Merge pull request #432 from AFLplusplus/dev
v2.66c
2020-07-01 09:28:13 +02:00
b67905c40f Merge branch 'stable' into dev 2020-07-01 09:19:32 +02:00
6b98157c1a v2.66c release preparation 2020-07-01 09:15:47 +02:00
4d2ccd18f6 comments fix 2020-07-01 07:55:58 +02:00
52a0410d92 fix text 2020-07-01 07:49:07 +02:00
d898418037 restore credit for afl-tmin fork server patch 2020-07-01 07:43:14 +02:00
2aaa60e4fc comments fix 2020-07-01 07:39:55 +02:00
e9dce31496 comments fixed 2020-07-01 07:35:42 +02:00
b201279ae5 text fix 2020-07-01 07:27:53 +02:00
be83f06b2f renaming remains fixed 2020-07-01 07:25:33 +02:00
9d5007b18e Big renaming (#429)
* first commit, looks good

* fix ascii percentage calc

* fix ascii percentage calc

* modify txt configs for test

* further refinement

* Revert "Merge branch 'text_inputs' into dev"

This reverts commit 6d9b29daca, reversing
changes made to 07648f75ea.

* blacklist -> ignore renaming

* rename whitelist -> instrumentlist

* reduce the time interval in which the secondaries sync

Co-authored-by: root <root@localhost.localdomain>
2020-06-30 23:34:26 +02:00
7527c76c74 reduce the time interval in which the secondaries sync 2020-06-30 17:33:47 +02:00
06264df168 rename whitelist -> instrumentlist 2020-06-30 17:28:21 +02:00
878b27af76 blacklist -> ignore renaming 2020-06-30 16:52:48 +02:00
4b99ebbf22 Revert "Merge branch 'text_inputs' into dev"
This reverts commit 6d9b29daca, reversing
changes made to 07648f75ea.
2020-06-29 18:48:17 +02:00
fc5cfc6cb3 Merge pull request #428 from AFLplusplus/dev
Dev
2020-06-29 18:36:06 +02:00
6d9b29daca Merge branch 'text_inputs' into dev 2020-06-29 18:35:51 +02:00
3f1288e2f9 Merge pull request #427 from AFLplusplus/dev
workaround for recent afl++ versions
2020-06-29 18:32:12 +02:00
8f1b78f49e Merge pull request #426 from AFLplusplus/dev
Dev
2020-06-29 18:19:35 +02:00
07648f75ea workaround for recent afl++ versions 2020-06-29 12:21:14 +02:00
3a0c91b862 fix unittest 2020-06-29 01:23:30 +02:00
e5e485fcdb fix autodict 2020-06-29 00:58:05 +02:00
16f3df7cc6 fix for shmem+autodict 2020-06-29 00:18:29 +02:00
6d0f086d9c less problematic definitions 2020-06-28 23:50:25 +02:00
c25a602a03 less problematic definitions 2020-06-28 23:47:57 +02:00
81974c4d5e debug code 2020-06-28 22:50:18 +02:00
5f3b7e6cdf typo aonce -> once 2020-06-28 21:21:27 +02:00
910b9f3f25 O2 instead of O3 for .o target files 2020-06-28 16:53:31 +02:00
4fd2cb2ce0 update idea list 2020-06-28 14:51:49 +02:00
e234a6ae4e update schedules in readme 2020-06-28 14:46:57 +02:00
ee17782e61 fix output for LTOinstrim 2020-06-28 00:13:31 +02:00
cd6954e3c1 fix make static 2020-06-27 23:11:10 +02:00
29e41a09d5 fix typos 2020-06-27 18:16:27 +02:00
4103687f76 afl-sharedmem.c: fix leaks on error paths (SysV shared memory) 2020-06-27 00:13:24 +02:00
976e99b1d4 original fix for calibration error 2020-06-26 10:17:21 +02:00
da7c548452 afl-plot remove error print 2020-06-26 09:53:54 +02:00
1ecfd78418 implement sharedmem mmap for cmplog 2020-06-26 09:13:07 +02:00
07fead0466 fix shared memory leaks in afl-showmap, initialize cmplog_mode 2020-06-26 01:14:21 +02:00
8bd8442bcc fix for schedules 2020-06-25 22:44:46 +02:00
5904083231 remove debug 2020-06-25 22:28:56 +02:00
171b1923e9 shmem release fix 2020-06-25 22:02:02 +02:00
8d5eb9487d make llvm_mode pcguard instrumentation collision free 2020-06-25 20:09:56 +02:00
633a3feab9 fix makefile 2020-06-25 17:51:48 +02:00
c8f60a7fbf initialized variable 2020-06-25 17:25:16 +02:00
3a62bb68e0 updated unicornafl 2020-06-25 17:13:16 +02:00
8178f4dfdd remove radamsa, add radamsa custom mutator 2020-06-25 16:51:29 +02:00
4a3305c007 Merge pull request #425 from dgmelski/fix-recalibration
Fix saturated maps & stability cliff in recalibration
2020-06-25 15:16:10 +02:00
9858bc81a3 GNUmakefile: warn about '.' being first path in PATH environment variable. This causes recursion in 'as'. (seen in Haiku) 2020-06-25 13:28:34 +02:00
b5573b3adb add seek power schedule, remove update stats in calibration, fix help output 2020-06-25 10:33:59 +02:00
15dd4ad177 fix plot 2020-06-25 08:50:34 +02:00
d540971443 Fix saturated maps & stability cliff in recalibration
I have observed two problems:

  1. A sudden "stability cliff" where stability drops precipitously.

  2. A sudden jump to a 100% saturated "density map".

Both issues are due to attempted "recalibration" of a case at the
beginning of fuzz_one_original() or mopt_common_fuzzing().  See the
comments "CALIBRATION (only if failed earlier on)" in those functions
and the subsequent call to calibrate_case().

At those calls to calibrate_case(), afl->fsrv.trace_bits holds
trace_bits for a run of the SUT on a prior queue entry.  However,
calibrate_case() may use the trace_bits as if they apply to the
current queue entry (afl->queue_cur).

Most often this bug causes the "stability cliff".  Trace bits are
compared for runs on distinct inputs, which can be very different.
The result is a sudden drop in stability.

Sometimes it leads to the "saturated map" problem.  A saturated
density map arises if the trace bits on the previous entry were
"simplified" by simplify_trace().  Simplified traces only contain the
values 1 and 128.  They are meant to be compared against
virgin_crashes and virgin_tmouts.

However, this bug causes the (stale) simplified trace to be compared
against virgin_bits during a call to has_new_bits(), which causes
every byte in vigin_bits to be something other than 255.  The overall
map density is determined by the percentage of bytes not 255, which
will be 100%.  Worse, AFL++ will be unable to detect novel occurrences
of edge counts 1 and 128 going forward.

This patch avoids the above issues by clearing q->exec_cksum when
calibration fails.  Recalibrations are forced to start with a fresh
trace on the queue entry.

Thanks to @andreafioraldi for suggesting the current, improved patch.
2020-06-24 17:59:04 -04:00
1d7c76d141 decrease time to sync for main 2020-06-24 17:37:16 +02:00
224a49341a update .gitignore 2020-06-24 17:04:28 +02:00
fce010f051 add -D option for -S 2020-06-24 11:14:00 +02:00
bdc8e3b79e create .synced/NAMES.last to document last sync attempts 2020-06-24 11:09:33 +02:00
9289af040c gitignore 2020-06-24 08:23:31 +02:00
49a769ac06 lto whitelist in test.sh 2020-06-23 21:23:10 +02:00
2b450aeb20 fix test.sh 2020-06-23 18:21:50 +02:00
5f1c0111a6 fix make files 2020-06-23 18:06:08 +02:00
89f0dc2d14 fix gcc mode for travis 2020-06-23 17:43:04 +02:00
cffb0e9a25 fix gcc makefile 2020-06-23 17:36:05 +02:00
2b26e3867f fix gcc makefile 2020-06-23 17:31:52 +02:00
aad433e11e Merge branch 'dev' of github.com:vanhauser-thc/AFLplusplus into dev 2020-06-23 15:08:49 +02:00
59e1a18197 Merge pull request #422 from devnexen/haiku__build_upd
Haiku  build upd
2020-06-23 11:01:22 +02:00
8f98044d69 Libdislocator Haiku build fix 2020-06-23 09:41:38 +00:00
6c414409d4 libtokencap Haiku support 2020-06-23 09:29:57 +00:00
7119bf5d86 Added rand, hash unittests 2020-06-22 21:58:23 +02:00
ea1222b33f old compiler fix 2020-06-22 21:40:02 +02:00
37edfe2de9 shmem support for afl-tmin and afl-showmap 2020-06-22 19:56:34 +02:00
76a2d9b59b further refinement 2020-06-22 13:48:59 +02:00
87f127722c fix afl-cmin.bash 2020-06-22 08:28:41 +02:00
a49b5ef072 allow /tmp 2020-06-22 07:16:24 +02:00
5cad92e57e fix unicorn mode for CFLAGS 2020-06-21 18:07:30 +02:00
f6ef1fe65e fix libcompcov for CFLAGS 2020-06-21 16:43:55 +02:00
048e429356 remove -Werror and add include for libdislocator 2020-06-21 16:33:55 +02:00
eb3cb4bbf8 fix for s=0 2020-06-21 16:21:59 +02:00
b0866f59cc fix for -s 0 2020-06-21 14:08:41 +02:00
b3b016a4a3 fix libradamsa see issue #419 2020-06-20 22:39:12 +02:00
341e17bf53 Merge pull request #418 from jonasmollerlarsen/dev
Fix when env. PATH contains spaces
2020-06-20 13:37:22 +02:00
eb4561e3a6 afl-plot: fix issue #417, also check relative paths for directories 2020-06-20 13:09:47 +02:00
990b234067 Fix when env. PATH contains spaces 2020-06-20 11:50:53 +02:00
07a4e6370a modify txt configs for test 2020-06-20 10:55:02 +02:00
1381e96d8c fix ascii percentage calc 2020-06-20 09:22:14 +02:00
5ca303393f fix ascii percentage calc 2020-06-20 09:21:02 +02:00
de2c565953 first commit, looks good 2020-06-19 18:05:04 +02:00
2a254fce8f fix afl-clang-fast for default pcguard mode 2020-06-19 14:21:34 +02:00
758f136d3e update todo 2020-06-18 20:39:06 +02:00
5d3d86c680 update todo 2020-06-18 15:33:16 +02:00
d8d5adeb61 Merge pull request #416 from Mem2019/patch-2
`fault == afl->crash_mode` should be likely
2020-06-18 07:08:11 +02:00
003456f770 fault == afl->crash_mode should be likely
Since during normal fuzzing, crash_mode is FSRV_RUN_OK, and fault is also usually FSRV_RUN_OK since most executions are valid executions, thus it should be likely instead of unlikely
2020-06-18 11:23:10 +08:00
25c3a29004 Merge pull request #414 from AFLplusplus/dev
work around for llvm 11 bug
2020-06-17 23:56:17 +02:00
394d8ade15 work around for llvm 11 bug 2020-06-17 22:21:09 +02:00
118cc88429 Merge pull request #412 from AFLplusplus/dev
fix displayed schedule
2020-06-17 16:46:54 +02:00
61107c59cf fix displayed schedule 2020-06-17 16:46:30 +02:00
0dc9967984 Merge pull request #403 from AFLplusplus/dev
push to master
2020-06-17 15:05:14 +02:00
889e54eab8 unit tests: fix stupid compiler warning for gcc 4.8.4 2020-06-16 23:07:33 +02:00
a14f3c90a8 fix unit tests when exit is called at the end 2020-06-16 22:37:56 +02:00
e05ed58bf8 fix test.sh for failing unit tests 2020-06-16 19:44:52 +02:00
d6824d540b Merge pull request #408 from Minilulatsch/dev
Fixed missing cast in afl-clang-fast.c, which results in a compilation error when using __AFL_FUZZ_TESTCASE_BUF in a C++ target
2020-06-16 19:36:11 +02:00
2e35326040 Fixed missing cast in afl-clang-fast.c, which results in a compilation error when using __AFL_FUZZ_TESTCASE_BUF in a C++ target 2020-06-16 18:04:38 +02:00
e5dcaa818e set class afl instrumentation if llvm <= 6 2020-06-16 15:59:09 +02:00
bac2da8669 fix for *BSD: remove all HAVE_ARC4RANDOM dependencies 2020-06-16 01:29:07 +02:00
9c293b5b7b code format 2020-06-15 22:05:37 +02:00
6804065a8d using XX64 for 32 bit hash 2020-06-15 22:03:01 +02:00
246444dd57 tidied hash32, unicorn 2020-06-15 21:40:37 +02:00
6a216b5708 make aflpp driver performant again 2020-06-15 21:39:45 +02:00
f6d2da27e3 switched to new MOpt dictionary support 2020-06-15 21:07:35 +02:00
ada59feda8 improve performance for default power schedule 2020-06-15 20:02:28 +02:00
af8d4d49ed add new dictionary from antonio-morales ftp fuzzing 2020-06-15 16:30:41 +02:00
dc002b4b35 code format 2020-06-15 11:08:24 +02:00
acb0a2f027 fixed potential bugs 2020-06-15 11:07:57 +02:00
43bbbbf4e0 rust unicornafl++ 2020-06-15 00:20:13 +02:00
05da66b5e9 unicornafl update 2020-06-14 23:30:36 +02:00
b8cea84195 disable focal on travis temporarily 2020-06-14 18:48:49 +02:00
741dce3ca6 Merge pull request #404 from devnexen/haiku_porting
Porting to Haiku.
2020-06-14 17:38:17 +02:00
67d87dd2a9 Porting to Haiku.
getrusage does not implement resident memory gathering, no shm api neither.
2020-06-14 15:32:02 +00:00
ab142282a3 kill targets on exit 2020-06-14 16:08:58 +02:00
bfe5b88e78 code format 2020-06-13 14:28:42 +02:00
fc26001b50 fix shmem 2020-06-13 13:47:43 +02:00
1542c7f49c fix typos 2020-06-13 10:58:30 +02:00
615ab1a7b8 fix resize window crash and slightly more performant timed_read 2020-06-13 00:14:14 +02:00
ce1af1bc9c code-format killed the compilation 2020-06-12 16:57:33 +02:00
ab0e3fdd82 code-format killed the compilation 2020-06-12 16:50:36 +02:00
40aca0b6b3 fix for checksums 2020-06-12 16:33:20 +02:00
a632c00b0d switch to faster and better hash + random 2020-06-12 16:08:49 +02:00
db2e04361d shm debug and fixes 2020-06-12 11:57:54 +02:00
7d19b108c4 fix warnings 2020-06-12 09:23:38 +02:00
818afe6232 added MOpt dictionary support from repo 2020-06-12 08:27:03 +02:00
e8da5f9e28 code format and debug 2020-06-11 19:30:28 +02:00
b3fee6cab2 rust bindings for unicornafl 2020-06-11 16:36:45 +02:00
da7a8ce60a issue #401: remove all TAB characters from dictionary files 2020-06-10 21:53:58 +02:00
a6386bd640 Merge pull request #400 from devnexen/gotcpu_illumos
start of illumos cpu binding implementation.
2020-06-10 20:29:55 +02:00
b3feda052d start of illumos cpu binding implementation.
The current user needs the proc_owner permission, not something doable
 via the settings script.
2020-06-10 16:16:47 +01:00
c1eb2bccaa more output in uc-tests 2020-06-10 12:09:45 +02:00
5cb6dc7795 Merge pull request #398 from devnexen/array_subscript_warn_fix
Disable array subscript warning
2020-06-10 09:25:31 +02:00
af66d8027b Merge pull request #399 from devnexen/non_aff_build_fix
systems w/o affinity support build fix
2020-06-10 09:25:06 +02:00
4ee4495120 Disable array subscript warning 2020-06-09 22:43:31 +01:00
c02721775a updated unicorn 2020-06-09 23:15:24 +02:00
cbdcd32959 systems w/o affinity support build fix 2020-06-09 22:14:13 +01:00
12bdefe00e Merge pull request #392 from AFLplusplus/dev
Push to master
2020-06-09 19:25:09 +02:00
81829d132b always set status 2020-06-09 17:09:34 +02:00
5fa0f8f55b fix debug output in stats 2020-06-09 17:01:41 +02:00
7e818e877a fixing travis 2020-06-09 15:45:50 +02:00
32a40ab5c5 add cpu affinity to fuzzer_stats 2020-06-09 11:22:27 +02:00
c2087b7c13 more unicornafl fixes 2020-06-09 04:18:02 +02:00
feffae60dd code format 2020-06-09 03:48:50 +02:00
8e3f6fe2dc added persistent mode testcase 2020-06-09 03:46:17 +02:00
92b8c5bb60 fixed shmap fuzzing 2020-06-09 03:03:21 +02:00
646237e234 fix x86 notzero 2020-06-08 11:52:49 +02:00
b4f71c7cc7 Merge pull request #396 from Kyle-Kyle/master
fix a fundamental bug: favor random branches
2020-06-08 08:57:25 +02:00
73334207ce fix a fundamental bug: favor random branch randomly 2020-06-07 15:14:25 -07:00
e8a6b1cfb5 updated unicorn 2020-06-07 16:22:39 +02:00
748238d6ab Revert "updated unicorn"
This reverts commit 5fcd4bb082.
2020-06-07 16:19:51 +02:00
5fcd4bb082 updated unicorn 2020-06-07 00:41:46 +02:00
a1aef91e39 Merge pull request #395 from toralf/dev
unicorn_mode/samples/persistent/harness.c: fix comment
2020-06-06 16:53:43 +02:00
c2c128dd67 unicorn_mode/samples/persistent/harness.c: fix comment
Signed-off-by: Toralf Förster <toralf.foerster@gmx.de>
2020-06-06 16:41:40 +02:00
372206e159 aflpp_debug 2020-06-06 11:45:08 +02:00
c036108b59 Merge pull request #394 from devnexen/libtoken_api_nbsd_upd
libdislocator, adding subset of specific NetBSD api.
2020-06-05 17:50:52 +02:00
b5c77cf4f6 libdislocator, adding subset of specific NetBSD api. 2020-06-05 15:32:27 +01:00
2b33be939a fix qemu mode 2020-06-05 09:55:22 +02:00
e01cad2f7d qemu debug 2020-06-05 09:42:17 +02:00
a1beb72cad qemu_mode: fix error handling of mmap 2020-06-04 22:27:46 +02:00
a9348e0acc fix cmplog for shmem persistent mode 2020-06-04 16:31:53 +02:00
9a1e22afab typo 2020-06-04 15:31:27 +02:00
855ee06247 add afl-ld-lto for LTO 2020-06-04 13:57:16 +02:00
f1ad9bdaea fix 2020-06-04 09:10:58 +02:00
2f73215d4f update libfuzzer driver 2020-06-04 08:53:05 +02:00
155405e0d0 Merge branch 'master' into dev 2020-06-04 03:18:41 +02:00
88e83c7322 code format 2020-06-04 02:53:24 +02:00
35ddec7aeb fix shmem persistent mode 2020-06-04 02:37:05 +02:00
e11922e5cc adapted unicornafl to new shmap 2020-06-03 19:27:59 +02:00
a79c002145 Merge pull request #390 from devnexen/obsd_no_retpoline
OpenBSD build update and llvm mode fix
2020-06-03 18:32:44 +02:00
ea91cfdf9a fix shmem 2020-06-03 18:09:06 +02:00
031e4300a5 switch order of shmem fuzz 2020-06-03 16:19:09 +02:00
dd0ca7335f switch shmem_len to the map 2020-06-03 15:49:23 +02:00
686d8823eb OpenBSD: add missing limits.h header for PATH_MAX 2020-06-03 17:43:33 +02:00
a5d554c3ef improved unicornafl speed 2020-06-03 15:18:07 +02:00
177db9cf79 no inline in qemu driver 2020-06-03 11:51:35 +02:00
2d8c3d2934 fix conflicts 2020-06-03 11:41:30 +02:00
f1192b2d16 AFL_QEMU_DRIVER_NO_HOOK 2020-06-03 11:38:44 +02:00
fc164e4709 code format 2020-06-03 10:50:49 +02:00
1c95e2e8e0 aflpp libfuzzer driver for qemu mode 2020-06-03 10:34:29 +02:00
9962de1a4c shared mem input for qemu persistent hook 2020-06-03 09:57:44 +02:00
304a72c1ff added shmem support to unicornafl 2020-06-03 02:00:58 +02:00
83112ed5e0 got rid of questionable phrasing 2020-06-02 14:54:24 +02:00
fbd781fc83 Merge branch 'dev' of github.com:aflplusplus/aflplusplus into dev 2020-06-02 14:10:44 +02:00
62306f5ce8 minor fixes 2020-06-02 14:10:40 +02:00
1d15048f2f hopeful finally change for libfuzzer driver 2020-06-01 15:30:44 +02:00
adcffce0a0 fix libfuzzer driver 2020-06-01 14:57:05 +02:00
9a65fe904d small changes to libfuzzer driver 2020-06-01 13:37:50 +02:00
ac998e9222 minimal changes to a test 2020-06-01 13:15:34 +02:00
15c0ad60c5 minimal changes to a test 2020-06-01 13:15:16 +02:00
0de25f08ba code format 2020-06-01 12:30:55 +02:00
bca7ce8043 fixed persistent mode shared mem fuzzing 2020-06-01 12:30:20 +02:00
ee14785f68 starting shmap support for unicorn 2020-05-31 04:13:41 +02:00
c0ed118ba5 comment 2020-05-30 20:38:01 +02:00
0adb664a31 OpenBSD build update and llvm mode fix
Unlike upstream version, LLVM in OpenBSD enable by default anti ROP gadget
 leading to bigger binaries and lower performances.
On OpenBSD, it needs to link to c++ abi for th unwind symbols.
2020-05-30 19:28:47 +01:00
4a54328901 rename var time->time_ms 2020-05-30 17:11:45 +02:00
24508194c2 removed read_timed 2020-05-30 14:03:52 +02:00
95b46b4278 reverted extendended read_timed 2020-05-30 13:53:00 +02:00
b16ccb4811 Revert "code format"
This reverts commit 8f19becb62.
2020-05-30 13:51:29 +02:00
4119752f83 fix forkserver change 2020-05-30 13:37:27 +02:00
b7b5fdf42a fix vor afl-clang 2020-05-30 13:31:10 +02:00
dbd9423fc0 PowerPc support 2020-05-30 11:32:11 +02:00
8f19becb62 code format 2020-05-30 11:05:53 +02:00
38e5c32a55 corrected read_timed for values > 4 2020-05-30 11:02:34 +02:00
0c50945303 update readme 2020-05-30 07:22:51 +02:00
8726d7b0a3 simplified read_timed 2020-05-30 06:51:51 +02:00
408ef5298b Merge pull request #383 from dgmelski/fix-read-timed
Fix read_timed when accumulating short reads
2020-05-29 18:58:25 +02:00
2ce243bc6e whitelist wildcard for LTO 2020-05-29 16:27:01 +02:00
255594ba3a Merge pull request #385 from sirmc/dev
Support UNIX-style wildcards in AFL_LLVM_WHITELIST file
2020-05-29 16:21:54 +02:00
8bb0232ace Remove AFL_LLVM_WHITELIST_FNMATCH env variable 2020-05-29 15:47:34 +02:00
e3efacaae6 Merge pull request #386 from AFLplusplus/dev
code format
2020-05-29 14:44:04 +02:00
a550df4301 code format 2020-05-29 14:43:03 +02:00
710dda5221 Merge pull request #374 from AFLplusplus/dev
Dev
2020-05-29 14:35:05 +02:00
c3b864d8d4 add Perl dictionaries from RootUp 2020-05-29 12:55:46 +02:00
6892018142 Revert "perl.dict"
This reverts commit 4ad3144f50.
2020-05-29 12:48:06 +02:00
84df805ed3 Do clang-format 2020-05-29 12:11:19 +02:00
9c286da29b gcc_plugin: better error message when compiler and plugin versions do not match 2020-05-29 12:10:45 +02:00
92b7974f44 .gitignore: add *.pyc 2020-05-29 12:07:09 +02:00
38860323de Fix typos in LLVM whitelist README 2020-05-29 12:01:06 +02:00
8316425375 Add AFL_LLVM_WHITELIST_FNMATCH env var
Only enable UNIX pattern matching on the whitelist when
AFL_LLVM_WHITELIST_FNMATCH is set. The reason being that we keep
backwards compatibility with old whitelists.
2020-05-29 11:55:02 +02:00
0cedc8014b Support filename pattern matching in whitelist
Allow the whitelist specified by AFL_LLVM_WHITELIST contain entries with
UNIX shell-style wildcard pattern matching.
2020-05-29 10:51:34 +02:00
8aae1fc5d7 Merge pull request #384 from RootUp/patch-4
Grammar for fuzzing Perl
2020-05-29 10:14:33 +02:00
4ad3144f50 perl.dict 2020-05-29 10:55:35 +04:00
4b01d594c4 Fix read_timed when accumulating short reads
The existing code appears to use 'len_read' in several places where
'total_read' was intended.  The function may work if the first 1 or 2
iterations of the loop read the requested 'len' bytes.

If the first two reads are "short" and a third read is done, the bytes
will be placed over previously read bytes in buf and more than 'len'
bytes may be read in total, though buf is never overrun.

This commit changes read_timed to

  (1) correctly append short reads in buf
  (2) correctly terminate when the sum of the short reads
      equals the requested 'len' bytes
  (3) return an error when read() returns -1 or 0

The function also depends on select() decrementing the timeout
structure, as it does on Linux.  On other platforms, the exec_ms
returned is likely incorrect.  This patch does not attempt to address
this issue.
2020-05-28 20:25:30 -04:00
5e4cd05e04 Merge pull request #382 from ivachyou/master
change qemu-mode AFL_REGS_NUM to 16 for TARGET_ARM
2020-05-28 23:35:55 +02:00
7cf01b10b7 Delete action.yml 2020-05-29 04:28:32 +07:00
eb7d1e22e5 simplify u64 2020-05-28 22:56:15 +02:00
0555b26161 Merge pull request #375 from risicle/ris-llvm-compare-transform-var-sized-dev
llvm_mode compare-transform-pass: add handling of sized comparisons with non-const size
2020-05-28 22:47:13 +02:00
bb0a31158a test.sh OpenBSD6.7, 32bit: add 'i386' to known intel strings 2020-05-28 22:24:06 +02:00
bfd2b6298e OpenBSD6.7, 32bit fix add linker option -z notext 2020-05-28 22:23:30 +02:00
b87d97aa2b make dockerfile better 2020-05-28 14:34:50 +02:00
48b2028af8 remove actions, we do this via docker hub 2020-05-28 12:22:28 +02:00
92be4ea871 change qemu-mode AFL_REGS_NUM to 16 for TARGET_ARM 2020-05-28 16:42:38 +07:00
8a2656681f GNUmakefile: make binary-only: make qemu build optional, so unicornafl can be build 2020-05-28 08:27:21 +02:00
5671cae225 actions 2020-05-28 02:41:27 +02:00
ef8d252843 fix Dockerfile 2020-05-28 01:29:57 +02:00
af670ca138 enable snapshot lkm for llvm_mode persistent mode 2020-05-27 17:17:33 +02:00
aace0d1192 code format 2020-05-27 11:28:29 +02:00
cee4b4593b Merge pull request #379 from arnow117/master
Fix MOpt implementation flaws
2020-05-27 11:27:11 +02:00
434ccf3df4 allow for copy paste from documentation 2020-05-27 11:24:09 +02:00
b81df11d8a fix 64bit support for powerpc, risc, etc. 2020-05-27 11:07:54 +02:00
dab498c3b7 fix MOPT implementation flaws in core fuzzing 2020-05-27 16:01:44 +08:00
d5bb9731fe Revert "libfuzzer driver, better rt compilation"
This reverts commit 46a0f812b1.
2020-05-26 17:41:24 +02:00
9dd0b7c6de make examples better 2020-05-26 15:57:15 +02:00
1cae68dde3 persistent mode shared memory fuzzing - done 2020-05-26 15:20:42 +02:00
996e1515b3 better performance compilation options for afl++ and targets 2020-05-26 13:19:57 +02:00
f6808158c5 llvm_mode compare-transform-pass: add handling of sized comparisons with non-const size
this involved insertion of an extra length-checking bb for each character
to see if we've hit the sized limit.
2020-05-25 23:38:45 +01:00
7e4c5b3636 tests: add test of compiled compcov binary's functionality 2020-05-25 23:38:45 +01:00
0994972c07 more performance testing 2020-05-25 22:19:50 +02:00
a0da531170 libfuzzer driver + llvm_mode compilation optimization 2020-05-25 22:09:00 +02:00
46a0f812b1 libfuzzer driver, better rt compilation 2020-05-25 21:58:00 +02:00
de78f867a4 Changelog: typos 2020-05-25 18:16:37 +02:00
707145c491 persistent mode: shared memory test case transfer 2020-05-25 16:40:55 +02:00
1e597a64dc llvm_mode compare-transform-pass: refactor comparison length determination
make this clearer and handle case with embedded null characters in
const string properly
2020-05-25 13:53:17 +01:00
4c394a9d7b new todo 2020-05-25 10:57:15 +02:00
3eef1560a2 remove not needed error description 2020-05-25 09:14:30 +02:00
fc574086ec fix cmplog 2020-05-24 15:15:17 +02:00
68e66fa920 fix compare-transform for strn?casecmp 2020-05-24 01:59:08 +02:00
38df6eb3a9 LTO whitelist functionality rewritten, now anything can be skipped 2020-05-23 17:00:02 +02:00
0245f8438d forkserver: missing space in message 2020-05-23 08:15:20 +02:00
d7ea8356a7 installing llvm 11 2020-05-23 01:53:42 +02:00
c64ea49432 AFL_LLVM_LAF_ALL 2020-05-23 01:37:21 +02:00
38fe1c6066 more help for LTO issues 2020-05-22 20:59:32 +02:00
74f01881e3 small enhancements for llvm11 2020-05-22 16:56:05 +02:00
0f8da71588 more test.sh fixes 2020-05-22 13:50:39 +02:00
7d3cfcfd0b more test.sh fixes 2020-05-22 13:49:50 +02:00
536397b22f travis debug 2020-05-22 13:31:16 +02:00
6253bea73c fix test.sh 2020-05-22 12:51:21 +02:00
a5ef93c83a fix cmplog for llvm 11-dev 2020-05-22 11:42:04 +02:00
5b9dfa0600 fix llvm_mode selection 2020-05-22 11:22:30 +02:00
5d0bcf8152 switching llvm_mode default to pcguard 2020-05-22 10:24:00 +02:00
83007f77f5 update docs 2020-05-21 10:31:37 +02:00
c456e20750 better sync - lesser and better imports 2020-05-20 23:12:33 +02:00
982017a2ab remove master file on exit 2020-05-20 22:52:33 +02:00
3b4cd98498 add local include paths for DronFlyBSD 2020-05-19 17:57:56 +02:00
0ed767fac5 forgot the unlink ... 2020-05-19 19:54:10 +02:00
25fbec6638 if no master is present a slave becomes a temporary master 2020-05-19 19:51:54 +02:00
ae6c30a711 upgrade Dockerfile to Ubunutu 20.04 with llvm 11 and gcc 10 for afl-clang-lto 2020-05-19 19:22:11 +02:00
c7b1ed2395 Merge pull request #367 from devnexen/example_network_build_fix
Build fix proposal mainly for Android which did not bother
2020-05-18 22:51:15 +02:00
5d0f020648 Build fix proposal mainly for Android which did not bother
implementing this dinosaur.
2020-05-18 21:44:27 +01:00
74e6fbab82 update changelog 2020-05-18 12:26:40 +02:00
30824bc58e afl-as fast system fix 2020-05-18 10:48:39 +02:00
d146965025 Update Changelog.md 2020-05-17 21:43:33 +02:00
e1e155022f adjust documentation for new minimum llvm version 3.4 2020-05-17 21:35:10 +02:00
d37a8f72d6 fix master creation file 2020-05-17 01:36:03 +02:00
9dd3e3e38a fix -M check 2020-05-17 00:13:55 +02:00
b927b80e10 GNUmakefile: add paths for FreeBSD 3rd party packages 2020-05-16 20:30:07 +02:00
af6736c356 dictionary files: fix missing newlines 2020-05-16 13:16:37 +02:00
6e98b3ebb2 non GNU Makefiles: message when gmake is not found, gcc_plugin portability 2020-05-16 12:15:03 +02:00
afb81b8005 added lots of dictionaries 2020-05-16 11:17:36 +02:00
2b922e9e68 fix possible null ptr deref in afl-prealloc.h 2020-05-15 17:07:30 +02:00
57637ba0b0 removed overlooked post_lib references, added post_lib examples to examples/custom_mutators 2020-05-15 13:39:42 +02:00
d536ddc240 change: slaves only sync from masters 2020-05-15 09:27:15 +02:00
564399bd75 v2.65d init 2020-05-15 09:04:55 +02:00
87a693d1a9 Merge pull request #360 from AFLplusplus/dev
new code formatting + applied
2020-05-15 08:36:51 +02:00
49bd24144a v2.65c 2020-05-15 08:35:46 +02:00
182b8a4582 llvm_mode: lower llvm version reqs to 3.4 (LLInsTrim will not be
available)
2020-05-15 01:55:33 +02:00
97bddc8cfa added critical whitespace 2020-05-15 01:52:56 +02:00
a55e26959b fixed recursive clean 2020-05-15 01:31:02 +02:00
63e2222af1 code format 2020-05-15 01:24:27 +02:00
9637fe8a74 travis for focal 2020-05-15 00:58:17 +02:00
c084458294 updated 20.04 Dockerfile 2020-05-15 00:51:57 +02:00
498e9f4298 adding 20.04 test 2020-05-14 23:54:07 +02:00
13033034db nuicornafl build script fix setuptools check 2020-05-14 23:23:55 +02:00
749c63d3b3 removed accidental shell injection 2020-05-14 22:39:11 +02:00
73c2619c33 .gitignore: better be explicit 2020-05-14 22:30:44 +02:00
65f9553365 unicorn mode may run scripts 2020-05-14 22:25:50 +02:00
3f621c8ed4 update .gitignore 2020-05-14 21:57:32 +02:00
11f3b487ee corrected info about python 2020-05-14 21:51:51 +02:00
4c253aedae use --python flag to point to python executable for qemu build 2020-05-14 21:49:36 +02:00
efdad526ee darn IDE 2020-05-14 21:49:36 +02:00
4081a8f7b6 should install python3 setuptools here too 2020-05-14 21:49:36 +02:00
867f948bb2 create temp symlink to python3 for qemu mode if python isn't found 2020-05-14 21:49:36 +02:00
767ed8c5da add python setuptools to travis builds 2020-05-14 21:49:36 +02:00
f0aadc3d0b qemu build expects python on PATH 2020-05-14 21:49:36 +02:00
d95c4483fd correct binary already chosen before 2020-05-14 21:49:36 +02:00
00a147b244 info about py3 setuptools 2020-05-14 21:49:26 +02:00
74eae83b54 use only python3 in new builds 2020-05-14 21:47:04 +02:00
324b44872c unicornafl: python/module check with faster method 2020-05-14 21:13:36 +02:00
94a1d4d3ac test unicornafl: copy from build script 2020-05-14 20:32:04 +02:00
a3392007cd next try 2020-05-14 20:30:00 +02:00
4ac06a4eef and more 2020-05-14 20:10:10 +02:00
0495ded87d unicornafl build script more debug 2020-05-14 19:58:32 +02:00
64b80b3201 unicornafl build script: debugging version for travis 2020-05-14 19:23:07 +02:00
fa20eb1de7 GNUmakefile: add standard path for NetBSD, test for git and svn before use 2020-05-14 18:47:44 +02:00
ae15803bf1 Merge branch 'dev' of https://github.com/AFLplusplus/AFLplusplus into dev 2020-05-14 18:41:44 +02:00
9e375179d8 test.sh: make sure the right python version (with setuptools available) is being used 2020-05-14 18:40:26 +02:00
460760d7b6 unicornafl build script: find matching python and setuptools 2020-05-14 18:00:48 +02:00
682b620922 fix afl-clang-fast help output 2020-05-14 16:25:07 +02:00
6b69cd2e57 Makefile: for convenience forward targets to GNUmake 2020-05-14 09:00:17 +00:00
56a86bb9e2 added unicornafl fix info 2020-05-14 01:35:35 +02:00
00ad2ffc61 unicornafl version 2020-05-14 01:33:03 +02:00
a16e92800d prefer python3 2020-05-14 01:20:33 +02:00
7c9ff4bfe7 if target crashes add LTO fixed map as a possible reason 2020-05-14 01:12:00 +02:00
d334093606 deprecated AFL_POST_LIBRARY 2020-05-14 01:00:11 +02:00
044bd3cb41 init/deinit need to be optional for post lib 2020-05-13 18:58:32 +02:00
4e192db13c better clean 2020-05-13 18:24:01 +02:00
8cc5442401 fix GNUmakefile 2020-05-13 18:20:06 +02:00
bd94d5fce7 unicornafl build script: python version is critical 2020-05-13 17:39:00 +02:00
b6be906082 GNUmakefile: avoid tabs 2020-05-13 17:03:59 +02:00
60a5df5262 code-format and slight -S/-M modifications 2020-05-13 16:49:00 +02:00
c384a17b41 GNUmakefile: add paths /usr/local/... for OpenBSD, add check for ASAN 2020-05-13 16:42:20 +00:00
6fdd6004f2 unicornafl build script: fix sed call for OpenBSD, use present python
bug fixes:
2020-05-13 16:39:25 +00:00
c4fe6f5277 Merge pull request #361 from rish9101/pre_save_format
Add post library API as custom mutator and rename pre_save
2020-05-13 16:39:23 +02:00
645e331559 Fix previous commit bugs 2020-05-13 19:46:30 +05:30
45bddcd808 Fix bugs, remove intial post library test 2020-05-13 19:25:23 +05:30
9627458ecc Add post library API as custom mutator and rename pre_save 2020-05-13 18:59:12 +05:30
f8b3d34225 move has_new_bits for better performance 2020-05-13 00:41:24 +02:00
5273c61cd8 Darwin tests: grep --binary-files=text for laf-intel and skipping of unittests 2020-05-12 23:19:51 +02:00
0c1c947aaf updated uc ref 2020-05-12 22:42:41 +02:00
6224ae1c60 test/test.sh: prefer python3 over python for unicornafl, avoid realpath and readlink dependencies 2020-05-12 20:59:48 +02:00
72f4a9f678 missing env var 2020-05-12 19:40:04 +02:00
060f4ea320 enforce mandatary custom functions 2020-05-12 17:05:12 +02:00
6177954773 fix custom mutators and add real test cases 2020-05-12 16:32:40 +02:00
7b40d7b942 new code formatting + applied 2020-05-12 11:12:25 +02:00
1317433a51 Merge pull request #359 from AFLplusplus/dev
push to master
2020-05-12 11:04:18 +02:00
a578d719e1 llvm_mode: more support for Darwin/MacOSX (WIP) 2020-05-12 10:34:52 +02:00
8bb10c3bf1 fix issue in describe_op showing time inside src 2020-05-12 09:20:02 +02:00
b920cd2f23 blacklist llvmfuzzer functions 2020-05-11 23:30:28 +02:00
38dac93f63 fix typos 2020-05-11 22:44:44 +02:00
6f66be12f6 merge makefile 2020-05-11 15:30:00 +02:00
4ee93331dc updated unicornafl 2020-05-11 15:11:11 +02:00
30a675ab87 silened warnings 2020-05-11 14:40:42 +02:00
845522f59b remove warnings 2020-05-11 13:34:57 +02:00
f37be09a92 fixed unicornafl bug 2020-05-11 13:18:06 +02:00
ed877f5e3e add missing include 2020-05-11 12:46:27 +02:00
d916403927 document workaround for targets with _init for LTO 2020-05-11 11:33:33 +02:00
41f6aa7940 bigger initial map when LTO 2020-05-11 10:45:20 +02:00
50a63777ec python formatter: enhance detection of #define, needed for multi line macros
@andreafioraldi : please have a look at it. Goal is to detect forms of ' # define' also.
2020-05-11 10:12:32 +02:00
26fe7a9d66 final code-format fixes, remove test-multiple-mutators when done 2020-05-10 15:53:47 +02:00
07a0e2caf7 hopefully final fixes from code-format disaster :-( 2020-05-10 15:36:46 +02:00
30bfd44dfd indenting preprocessor directives breaks compilation and cant be fixed, reverting ... :-( 2020-05-10 12:09:37 +02:00
26f8708fed fix warning, code format 2020-05-10 11:35:31 +02:00
3beec8d4fa clang-format: indent preprocessor directives, so nesting levels can be better seen 2020-05-10 11:11:40 +02:00
2e553bcd69 code-format 2020-05-10 10:24:24 +02:00
0e5a5f1805 Merge pull request #358 from rish9101/update_docs
Specify usage of multiple custom mutators
2020-05-10 08:59:36 +02:00
d02cfc54b6 LTO fixes for fuzzbench 2020-05-10 08:51:40 +02:00
7b9ac9d414 Specify usage of multiple custom mutators 2020-05-10 12:21:19 +05:30
515de0d68d Illumos biuld fix (#357) 2020-05-10 00:21:26 +02:00
1eeb6785ad Merge pull request #356 from devnexen/netbsd_build_fix_tokencap
NetBSD build fix
2020-05-09 20:39:18 +02:00
20392878f1 qemu_mode: make building warning free 2020-05-09 20:02:32 +02:00
102067d43d LLVMInsTrim.so.cc: fix for LLVM 3.8.0 2020-05-09 19:08:54 +02:00
6c88e21459 NetBSD build fix 2020-05-09 18:02:53 +01:00
041f19494e minor fixes 2020-05-09 18:51:33 +02:00
8e9f507bbc unicorn_mode/samples/persistent/Makefile: fix non-Linux support 2020-05-09 18:49:32 +02:00
c380819e02 remove debug output 2020-05-09 11:58:47 +02:00
fa84e52af0 custom mutator code enhancements and code-format 2020-05-09 11:35:54 +02:00
cf9238e09d Update docs and Changelog for custom_mutators (#355) 2020-05-09 00:01:11 +02:00
190f3024da Support multiple custom mutators (#282)
* Make a list of custom mutators using env variable

* Set up multiple custom mutators

* Add destroy custom mutator and changes to load_custom_mutator

* Use array instead of list, make changes to afl-fuzz-one for multiple mutators

* Make change to fuzz-one custom_queue_get to support multiple mutators

* Modify custom python mutator support

* Fix bug

* Fix missing afl->mutator->data

* Revert to list with max count

* Change custom_pre_save hook and code format

* Free custom_mutator struct in the list

* Add testcase for multiple custom mutators

* Resolve merge conflict
2020-05-08 20:08:27 +02:00
768053b6f2 add AFL_DEBUG check to all isatty checks 2020-05-08 16:28:39 +02:00
bdd2a412c4 change docs/README.md to symlink to toplevel README.md 2020-05-07 18:47:23 +02:00
d217c7df05 Merge branch 'dev' of https://github.com/AFLplusplus/AFLplusplus into dev 2020-05-07 18:33:38 +02:00
9484da57ed convert docs/README.md into a symlink to toplevel README.md (helps website content) 2020-05-07 18:32:36 +02:00
ef2ccc8117 added AFL_LLVM_SKIPSINGLEBLOCK and changed default behaviour to instrument single block functions 2020-05-07 14:59:12 +02:00
02887dc164 fix static and profiling compilation and add profiling calculation 2020-05-07 14:09:58 +02:00
d048af11cd calculate correct collisions for classic in InsTrimLTO 2020-05-07 11:57:12 +02:00
0559d1d171 fix typos 2020-05-07 10:27:24 +02:00
37b681ac11 untracer README: one typo fixed 2020-05-07 10:09:08 +02:00
f065ddbdb2 Merge pull request #354 from jtpereyda/readme-apt-flex
add flex to apt install list
2020-05-07 09:31:00 +02:00
140053502b import transform fix into autodict, code-format 2020-05-07 08:08:20 +02:00
58fad91b0b add flex to apt install list 2020-05-06 16:00:23 -07:00
01b5aa123d better README for untracer 2020-05-06 17:20:42 +02:00
8cdf767bf5 doc update 2020-05-06 15:57:38 +02:00
e910882e32 fix untracer 2020-05-06 15:43:39 +02:00
a1c9c497d5 aarch64 support for afl-untracer 2020-05-06 15:37:49 +02:00
a63c838b10 make build options for qemu more visible 2020-05-06 14:16:19 +02:00
b7e574607c rename pass 2020-05-06 13:27:12 +02:00
10e6b4e454 fix STATIC compilation 2020-05-06 13:24:18 +02:00
ec5b1924c4 CTX+NGRAM != LTO 2020-05-06 11:55:50 +02:00
80ddb484de added InsTrimLTO :-) 2020-05-06 11:51:28 +02:00
cafb2e540e Merge pull request #353 from AFLplusplus/dev
update llvm version in README
2020-05-06 01:04:37 +02:00
b4e3f22259 update llvm version in README 2020-05-06 01:04:13 +02:00
df52157834 Merge pull request #352 from AFLplusplus/dev
Pull to master because of crash in string compare transform
2020-05-06 00:58:13 +02:00
a13958b32b updated unicornafl 2020-05-05 23:44:02 +02:00
a31b58eeea add one more alternative to python requirements: python-dev 2020-05-05 22:59:26 +02:00
e31b816aa0 fix unit tests when printf is a macro 2020-05-05 22:46:48 +02:00
0e5027d8d8 maybe_grow->ck_maybe_grow 2020-05-05 21:46:31 +02:00
dc79533191 more typos fixed 2020-05-05 20:29:40 +02:00
128e4d5565 more typos fixed 2020-05-05 20:23:16 +02:00
ad3960580d fixed typos 2020-05-05 20:19:04 +02:00
00683d06c2 fix LTO mode 2020-05-05 20:10:54 +02:00
a38980c80b unsized string compare fix 2020-05-05 17:57:56 +02:00
664a180d72 cleanup todo list 2020-05-05 15:39:15 +02:00
d6346561db ctx+ngram for instrim 2020-05-05 15:37:02 +02:00
d82ada89fe support older llvm versions 2020-05-05 14:08:24 +02:00
9d384b4e38 ctx and ngram fix 2020-05-05 12:46:49 +02:00
6e45e55d82 fix crash in AFL_LLVM_LAF_TRANSFORM_COMPARES 2020-05-05 10:38:44 +02:00
ecaccd9739 Merge pull request #351 from dpmdpm2/master
Fix typo in README.lto.md
2020-05-04 21:02:49 +02:00
95a2d49232 Fix typo in README.lto.md 2020-05-04 11:34:07 -07:00
16c16b3e6e ctx and ngram can be used together now 2020-05-04 18:01:47 +02:00
945e00b73f final touches for afl_network_proxy 2020-05-04 12:51:38 +02:00
e592b4bcf0 nw fixes 2020-05-04 10:37:45 +02:00
96ef2d3821 makefile fix 2020-05-04 10:24:29 +02:00
2d126dc750 Fix Unicorn support build script (#349)
* Fix Unicorn support build script for WSL.

Co-authored-by: Dominik Maier <domenukk@gmail.com>
2020-05-04 10:14:49 +02:00
13a32e9595 fix makefile 2020-05-04 10:08:29 +02:00
73f7164048 add GNUmakefile 2020-05-04 09:53:59 +02:00
5b1b986c89 fix for afl-tmin -f 2020-05-03 14:19:03 +02:00
1c53bbea52 doubled the speed of afl_network_proxy 2020-05-03 14:09:32 +02:00
0c5c172a30 makefile fix 2020-05-02 12:57:33 +02:00
ff1643d81f todo update 2020-05-02 00:43:33 +02:00
378573ab8b AFL_LLVM_SKIP_NEVERZERO added 2020-05-02 00:39:13 +02:00
33ddf6ea0e add ghidra script and workaround ghidra/linux/ida weirdness 2020-05-01 17:07:44 +02:00
a2bc3538f7 python no longer needed for build 2020-05-01 12:03:41 +02:00
636e98d151 Merge remote-tracking branch 'origin/master' into dev 2020-05-01 02:13:24 +02:00
9f01737fa7 updated unicorn 2020-05-01 02:08:04 +02:00
be4e5d2617 minor sample things 2020-05-01 02:07:35 +02:00
cc78fb721b code format 2020-05-01 01:11:54 +02:00
bb7d2a7347 Merge pull request #345 from devnexen/afl_untracer_libs_display
afl-untracer little change to display libraries mapping on FreeBSD.
2020-05-01 01:03:53 +02:00
9d03763d94 at some point we have to do a rewrite of llvm_mode/GNUmakefile 2020-05-01 00:57:20 +02:00
3cf4529f3c afl-untracer little change to display libraries mapping on FreeBSD. 2020-04-30 23:01:46 +01:00
477fb58311 Merge pull request #344 from devnexen/afl_untracer_fbsd
afl-untracer raw freebsd support.
2020-04-30 23:38:01 +02:00
59043b24cc afl-untracer raw freebsd support. 2020-04-30 21:31:37 +01:00
15547eb654 fix send child status 2020-04-30 21:17:13 +02:00
16f9cc7369 afl-network-client fix 2020-04-30 21:13:45 +02:00
efa9df24c2 afl-untracer completed 2020-04-30 17:59:59 +02:00
a37eca9df5 afl-untracer - next step 2020-04-30 16:27:31 +02:00
e68d2345d5 test.sh: continue after failed test case qemu persistent mode 2020-04-29 22:25:10 +02:00
fced3e00ce wip: afl-untracer 2020-04-29 20:44:30 +02:00
c53663c7ac afl-proxy -> afl_proxy 2020-04-29 15:21:51 +02:00
bc2e65e482 added afl_network_proxy 2020-04-29 15:18:03 +02:00
ce2814967d add readme for afl-proxy 2020-04-29 02:56:51 +02:00
781725aeaf added afl-proxy to examples 2020-04-29 02:54:57 +02:00
9276dc9e6c fix #329 2020-04-28 10:55:22 +02:00
c7de368dc2 Merge pull request #342 from AFLplusplus/dev
fix for afl-showmap with -Q
2020-04-27 22:12:56 +02:00
fbd9994f6f better fix for showmap 2020-04-27 22:11:58 +02:00
087c368242 better fix for showmap 2020-04-27 22:10:08 +02:00
a56354a893 fix for afl-showmap with -Q 2020-04-27 19:30:32 +02:00
a5d4c8d532 Merge pull request #340 from AFLplusplus/dev
dev -> master
2020-04-27 12:12:43 +02:00
a46fe3ad43 fix for older llvm versions 2020-04-27 06:51:45 +02:00
4ffa5b0636 fix negative stability bug (hopefully) 2020-04-26 18:42:42 +02:00
62ec52dd95 Merge pull request #336 from AFLplusplus/dev
pull again ...
2020-04-26 16:51:21 +02:00
ea876e59a8 moved defines to type 2020-04-26 14:45:00 +02:00
66eee34709 refactored global lists 2020-04-26 02:32:09 +02:00
85627516a4 map_size one liner 2020-04-26 02:05:17 +02:00
b26ee09f71 minor fixes 2020-04-26 01:59:38 +02:00
fb89b042f8 Merge pull request #337 from devnexen/android_support_arc4_api
Android supports arc4 api.
2020-04-26 01:25:39 +02:00
646aeb2b18 try unicorn build without -j 2020-04-26 00:54:02 +02:00
2a60ceb694 fix issue #333 2020-04-25 21:29:19 +02:00
80916a3613 Android supports arc4 api. 2020-04-25 20:17:10 +01:00
0c3d06c41e refactored whitelist and blacklist in llvm_mode 2020-04-25 17:53:38 +02:00
07db922024 add to changelog 2020-04-25 13:09:27 +02:00
fa610270ab remove empty line 2020-04-25 13:08:42 +02:00
cefefba244 Merge branch 'master' into dev 2020-04-25 13:05:25 +02:00
42017bbeda fix python detection for Ubuntu and others 2020-04-25 12:57:45 +02:00
a3ee281e2b fix python detection for Ubuntu and others 2020-04-25 12:55:01 +02:00
232290108e only build afl-gcc-fast if afl-gcc-pass could be build 2020-04-25 12:51:14 +02:00
5c017d7071 travis Dockerfiles for testing and debugging 2020-04-25 12:48:48 +02:00
62aacf88ab fix simple names 2020-04-24 23:26:38 +02:00
b3e77d3d50 update documentation 2020-04-24 13:56:04 +02:00
766085293d variable map size fix, error reporting through forkserver, code format 2020-04-24 12:09:25 +02:00
4a593d0405 Merge pull request #331 from Mindavi/feature/fail-on-invalid-binary-name
afl-gcc and afl-clang: fail when binary name can't be used to determine build mode
2020-04-24 10:32:00 +02:00
82b6b8c87e afl-gcc and afl-clang: fail when binary name can't be used to determine build mode
This is a continuation of PR #318.
The goal is to prevent issues where binaries with the wrong name will
silently pass control to the C compiler instead of failing.
This makes it more explicit that aflplusplus relies on the name of the
binary for correct compiler execution.
2020-04-23 23:21:38 +02:00
b6f9f4c436 minor changes 2020-04-23 16:08:36 +02:00
b120ca27f8 add documentation for LTO fixed map address feature 2020-04-23 12:20:58 +02:00
5eb1f3a4c6 use mmap in llvm_mode if LTO is enabled 2020-04-23 12:02:15 +02:00
8ada9d06e8 fix make clean error 2020-04-23 11:51:32 +02:00
cce8c4dbae fixed map location support for LTO 2020-04-23 08:56:06 +02:00
3502db1ac5 more sanitizer functions for blacklist 2020-04-23 07:28:25 +02:00
df8a0e8418 Merge branch 'dev' of github.com:vanhauser-thc/AFLplusplus into dev 2020-04-22 13:51:40 +02:00
b8a25063f6 fix sed errors in afl_shm_init when using mmap 2020-04-22 13:51:36 +02:00
6df21f3489 GNUmakefile/unit tests: suppress compilation commandline output 2020-04-22 08:40:04 +02:00
dcba2c3642 test.sh: custom mutator test; make it compilable with available instrumenting
compiler
2020-04-22 08:02:46 +02:00
059c963467 unicornafl build script: fix prerequisite search for setuptools 2020-04-21 23:15:25 +02:00
ce9c6df456 libdislocator android build fix. (#327)
Fix function signature for bionic libc
2020-04-21 13:14:34 +02:00
0aef3b4040 add NULL check to malloc_usable_size 2020-04-21 13:14:34 +02:00
4cc0589440 unicornafl updated 2020-04-21 13:14:34 +02:00
96722083d8 add line 2020-04-21 13:14:34 +02:00
ee238eb00d Move comment about adding 8 bytes to buffer length to the line where we
actually add 8 bytes
Remove defunct TODO for posix_memalign as the function now exists
Add wrapper for malloc_usable_size
2020-04-21 13:14:34 +02:00
45ccc7d475 script to update uc refs; new unicornafl version 2020-04-21 13:14:34 +02:00
a32d2ad193 removed done todo 2020-04-21 13:14:34 +02:00
f25919ad56 dont error on git reset 2020-04-21 13:14:34 +02:00
ae524d856d clang warning fixed 2020-04-21 13:14:34 +02:00
9be4f9c055 code format 2020-04-21 13:14:34 +02:00
40e5b285f2 updated unicorn 2020-04-21 13:14:34 +02:00
3ca787ba76 wording 2020-04-21 13:14:34 +02:00
137b9ecf5e double include removed 2020-04-21 13:14:34 +02:00
2509624add android ashmem fix 2020-04-21 13:14:34 +02:00
8c6fcd98be reset git on deepclean 2020-04-21 13:14:34 +02:00
7dc825dbe9 typo 2020-04-21 13:14:34 +02:00
6b3336d107 switched to clang-format-10 2020-04-21 13:14:34 +02:00
ceeb266273 clean and deepclean Makefile updates 2020-04-21 13:14:34 +02:00
9bb0733eb5 clang-tidy readability-braces (#323) 2020-04-21 13:14:34 +02:00
22cdad2d20 make clean removes unicornafl dir if not in git 2020-04-21 13:14:34 +02:00
8b3befea6d update documentation 2020-04-21 13:14:34 +02:00
5b9928f1a9 fix some gcc dependencies and build problems on debian 32-Bit,
adapted qemu_mode AFL_ENTRYPOINT test case for 32 bit
2020-04-21 13:14:34 +02:00
856a59901e no need to rm folder 2020-04-21 13:14:34 +02:00
19d0961020 clean doesn't fail without unicornafl 2020-04-21 13:14:34 +02:00
3bd5e65edc clean no longer deletes unicornafl folder 2020-04-21 13:14:34 +02:00
b520046ab6 fix submodule 2020-04-21 13:14:34 +02:00
d22550a520 git for travis? 2020-04-21 13:14:34 +02:00
6f994ec56b fix compilation on Debian 32-bit (thanks to Marc) 2020-04-21 13:14:34 +02:00
09c8e40363 better detection of intel cpu on 32-bit Linux 2020-04-21 13:14:34 +02:00
8e44c06a13 fix docs typos 2020-04-21 13:14:34 +02:00
358f17f615 small portability fix (32-bit) for warning (size_t %lu -> %zu) 2020-04-21 13:14:34 +02:00
b109e31722 submodule path changed 2020-04-21 13:14:34 +02:00
b77458ae81 unicornafl updaetd 2020-04-21 13:14:34 +02:00
cfeb8e83f7 latest unicornafl 2020-04-21 13:14:34 +02:00
0fa9ad46ae added version 2020-04-21 13:14:34 +02:00
cfb11177cd submodule 2020-04-21 13:14:34 +02:00
0a1979fd20 examples Makefiles: silence errors when there is no 32-bit support installed 2020-04-21 13:14:34 +02:00
0dc64b93d8 v2.64d init 2020-04-21 13:14:34 +02:00
f6c9acd518 libdislocator android build fix. (#327)
Fix function signature for bionic libc
2020-04-21 10:17:11 +02:00
68218dd31c Merge pull request #326 from dpmdpm2/master
Add malloc_usable_size to libdislocator.so
2020-04-21 00:07:33 +02:00
441b64b467 add NULL check to malloc_usable_size 2020-04-20 15:00:48 -07:00
8b319969f3 unicornafl updated 2020-04-20 23:49:12 +02:00
41b1787565 add line 2020-04-20 23:27:09 +02:00
e6fccdd9c1 Move comment about adding 8 bytes to buffer length to the line where we
actually add 8 bytes
Remove defunct TODO for posix_memalign as the function now exists
Add wrapper for malloc_usable_size
2020-04-20 14:24:47 -07:00
0ffef8c79d script to update uc refs; new unicornafl version 2020-04-20 23:11:11 +02:00
3d52079a7c removed done todo 2020-04-20 22:18:39 +02:00
e47c29e728 dont error on git reset 2020-04-20 22:14:41 +02:00
280374f739 clang warning fixed 2020-04-20 22:07:47 +02:00
ce15937717 code format 2020-04-20 21:54:55 +02:00
c8f2ba5b49 updated unicorn 2020-04-20 21:40:34 +02:00
3dbfd18f36 wording 2020-04-20 21:18:32 +02:00
4be0ae2008 double include removed 2020-04-20 21:06:16 +02:00
67b39050df android ashmem fix 2020-04-20 21:05:02 +02:00
4ccd8c1400 reset git on deepclean 2020-04-20 21:03:06 +02:00
4f997665f1 typo 2020-04-20 16:10:06 +02:00
b6a15d9719 switched to clang-format-10 2020-04-20 11:32:44 +02:00
e90194093e Revert "fix compilation use CFLAGS_FLTO for afl-gotcpu also (thanks Marc)"
This reverts commit b408fdffcc.
2020-04-20 07:58:48 +02:00
4c90293e44 clean and deepclean Makefile updates 2020-04-19 16:48:42 +02:00
8197e9b2e4 clang-tidy readability-braces (#323) 2020-04-19 16:42:40 +02:00
baec99079f make clean removes unicornafl dir if not in git 2020-04-19 12:30:58 +02:00
16a5e6bf16 update documentation 2020-04-19 10:15:28 +02:00
39f715982d Merge branch 'dev' of https://github.com/AFLplusplus/AFLplusplus into dev 2020-04-19 00:38:57 +02:00
724d4ec3de fix some gcc dependencies and build problems on debian 32-Bit,
adapted qemu_mode AFL_ENTRYPOINT test case for 32 bit
2020-04-19 00:37:23 +02:00
e4670d3abc no need to rm folder 2020-04-18 23:16:00 +02:00
8aa86d063a clean doesn't fail without unicornafl 2020-04-18 22:33:56 +02:00
c1d9e00044 clean no longer deletes unicornafl folder 2020-04-18 22:31:21 +02:00
0827a447d3 fix submodule 2020-04-18 22:10:30 +02:00
2874565b36 git for travis? 2020-04-18 21:28:35 +02:00
8ed3126f28 fix compilation on Debian 32-bit (thanks to Marc) 2020-04-18 20:07:12 +02:00
b408fdffcc fix compilation use CFLAGS_FLTO for afl-gotcpu also (thanks Marc) 2020-04-18 19:54:54 +02:00
d9cd600c1b better detection of intel cpu on 32-bit Linux 2020-04-18 18:39:03 +02:00
68f18923ab fix docs typos 2020-04-18 11:32:06 +02:00
9e74a7dfe1 small portability fix (32-bit) for warning (size_t %lu -> %zu) 2020-04-18 10:48:24 +02:00
0b5b888f82 submodule path changed 2020-04-17 21:52:57 +02:00
46854b439a unicornafl updaetd 2020-04-17 21:44:33 +02:00
8ffed4b859 latest unicornafl 2020-04-17 21:43:55 +02:00
3b8cd9652a added version 2020-04-17 21:43:55 +02:00
269050aee3 submodule 2020-04-17 21:43:55 +02:00
6e753f8f0f examples Makefiles: silence errors when there is no 32-bit support installed 2020-04-17 19:42:03 +02:00
9adcc73d61 v2.64d init 2020-04-17 19:39:32 +02:00
ddea300822 Merge pull request #321 from AFLplusplus/dev
Push for next release
2020-04-17 19:25:34 +02:00
9900c92ebc locked to unicornafl version 2020-04-17 16:28:22 +02:00
0bd1264faf headers for clang-tidy 2020-04-17 14:30:36 +02:00
49753eb2d0 unused var 2020-04-17 14:27:28 +02:00
c9605f2251 ++2.64c 2020-04-17 14:10:18 +02:00
6ee11c2a6f little more speed for queue analysis 2020-04-17 14:08:40 +02:00
ef1d384184 add missing limits.h include for PATH_MAX (OpenBSD) 2020-04-17 13:45:22 +02:00
a6d4f04019 Merge branch 'dev' of https://github.com/AFLplusplus/AFLplusplus into dev 2020-04-17 13:30:12 +02:00
87d27b8616 add AFL_NO_PYTHON to list of env variables 2020-04-17 13:29:32 +02:00
f22d8120ef fix afl-showmap for PATH_MAX on *BSD 2020-04-17 13:22:39 +02:00
8ecfbcdf34 removed tmp alloc in queue 2020-04-17 13:15:24 +02:00
263daaacaf remove static from tmp var in qemu 2020-04-17 12:04:16 +02:00
d3254d8066 llvm fix 2020-04-17 12:00:28 +02:00
76e15a0695 refactoring getting the map size 2020-04-17 11:56:08 +02:00
1931838a11 remove unnecessary map_size variables 2020-04-17 11:39:38 +02:00
6bd49b1d5c final fix for map_size 2020-04-17 11:24:40 +02:00
2d4d16755c merged upstream 2020-04-17 11:20:09 +02:00
bfcf6db17a fixes 2020-04-17 11:18:04 +02:00
bda4d8812e forgot MAP_SIZE for afl struct maps 2020-04-17 11:15:04 +02:00
f70d4a6fd4 added bugfix infos 2020-04-17 11:07:03 +02:00
90ff345d73 Merge branch 'dev' of github.com:aflplusplus/aflplusplus into dev 2020-04-17 11:01:20 +02:00
8fa5d4c313 clearer code 2020-04-17 11:01:14 +02:00
2162fd8e1a preliminary stuff for AFL_MAP_SIZE and afl-llvm-pass 2020-04-17 10:46:35 +02:00
248a2f2f0b added AFL_MAP_SIZE to env help output 2020-04-17 10:21:41 +02:00
ef311ec70c done implementing AFL_MAP_SIZE 2020-04-17 10:08:56 +02:00
5b70d23211 added AFL_MAP_SIZE (wip) 2020-04-17 09:10:49 +02:00
16ce555845 fixed 2 unimportant leaks 2020-04-17 07:52:21 +02:00
c961925356 fix plot_data output and code-format 2020-04-17 07:10:42 +02:00
23ea727915 Merge branch 'dev' of github.com:vanhauser-thc/AFLplusplus into dev 2020-04-16 19:53:51 +02:00
f157bca548 fix missing out_fd for cmplog forkserver 2020-04-16 19:53:42 +02:00
35937e6263 leak? 2020-04-16 19:33:40 +02:00
69bd7c16eb silence some clang warnings 2020-04-16 19:15:14 +02:00
6940e13629 removed redundent funcs 2020-04-16 17:50:08 +02:00
380ff114e9 the least radamsa 2020-04-16 16:51:23 +02:00
5e53002303 less radamsa 2020-04-16 16:48:40 +02:00
872d1c1d98 less radamsa 2020-04-16 16:47:53 +02:00
94187837c7 removed unused functions 2020-04-16 16:37:33 +02:00
ede3545d8b missing-decls reremoved 2020-04-16 16:25:02 +02:00
cdac882834 untitest decl 2020-04-16 16:09:52 +02:00
1ee224652c libradamsa fix 2020-04-16 16:05:39 +02:00
8511638afb hunting non-static functions 2020-04-16 15:38:43 +02:00
b10007a7b5 renamed duplicated func names 2020-04-16 15:32:04 +02:00
19ce862810 decoupled run and classify 2020-04-16 15:21:34 +02:00
124665b392 code-format 2020-04-16 14:47:08 +02:00
b420ccdbf8 fixed timeout flag to u32 2020-04-16 14:42:38 +02:00
5e8f385705 revert test.sh changes 2020-04-16 13:24:16 +02:00
dcc889a264 fix travis for cmpcov 2020-04-16 13:11:44 +02:00
f3789801f2 little has_new_bits improvement 2020-04-16 12:09:33 +02:00
0f08b13fa0 somewhat unified write_to_testcase 2020-04-15 23:22:23 +02:00
2ce6e7a7fb fix laf-intel transform disable 2020-04-15 23:01:33 +02:00
83d5864203 Merge branch 'dev' of https://github.com/AFLplusplus/AFLplusplus into dev 2020-04-15 22:29:54 +02:00
7e2c52f2b9 disable compare-transform-pass when lto_mode and autodictionary is used. 2020-04-15 22:27:32 +02:00
e88f364282 add new github security writeup 2020-04-15 22:27:20 +02:00
21f696f02e fix document mode 2020-04-15 22:26:30 +02:00
ef1ea07e68 wrong bytes set 2020-04-15 20:22:32 +02:00
0c02a8f4d3 changed run_target 2020-04-15 19:23:26 +02:00
48f7f7a17b afl-clang-fast: fail when binary name can't be used to determine build mode (#318) 2020-04-15 12:08:33 +02:00
115ee8bad5 fix Makefile for examples/argv_fuzzing and socket_fuzzing 2020-04-14 21:19:03 +02:00
c009896c34 code format 2020-04-14 19:29:18 +02:00
6dc36f1e6e unified forkservered run_target, fixes #308 2020-04-14 19:27:25 +02:00
f4436f118c fixed #317 2020-04-14 17:21:15 +02:00
8440aaea5a Merge branch 'dev' of github.com:vanhauser-thc/AFLplusplus into dev 2020-04-14 13:02:53 +02:00
0d0338012b one byte cmp in cmplog 2020-04-14 13:02:49 +02:00
5ac1b6e940 status 0 initialized 2020-04-14 13:01:54 +02:00
92aaaef381 code format 2020-04-14 12:42:38 +02:00
2c87e68ad6 Merge branch 'dev' of github.com:vanhauser-thc/AFLplusplus into dev 2020-04-14 12:40:03 +02:00
26e690c220 cmplog loop detection 2020-04-14 12:39:29 +02:00
b63dd7a464 NO_PYTHON documented 2020-04-14 12:07:46 +02:00
d2a7628748 fix travis fails 2020-04-14 11:26:07 +02:00
b1e7b834ac add missing default names for AFL_LLVM_INSTRUMENT 2020-04-14 11:24:53 +02:00
9eb47a924a UR -> rand_below 2020-04-14 10:42:29 +02:00
1d62bf1c37 solve conflicts 2020-04-14 10:12:41 +02:00
982d46e7cb solve conflicts 2020-04-14 10:11:22 +02:00
1fbface656 cmplog is now better 2020-04-14 10:09:03 +02:00
1374e65401 no more waitpid warning 2020-04-13 20:39:52 +02:00
0fab4e1955 c files static 2020-04-13 20:23:24 +02:00
a2574169e2 added NO_PYTHON support 2020-04-13 17:44:48 +02:00
4b88e059ef more robust search for clang for afl-clang-fast 2020-04-13 17:05:43 +02:00
12a7059ae8 added ignore info 2020-04-13 16:58:35 +02:00
a897f355a9 code format 2020-04-13 16:57:41 +02:00
326ab632c3 fixed uaf and warnings 2020-04-13 16:57:19 +02:00
dda096da03 allow -L -1 to enable mopt in parallel to classic mutation 2020-04-13 12:12:27 +02:00
5daec436f9 fix bug forksever fail not detected when using read_timed 2020-04-13 11:43:34 +02:00
033c743a41 fix all cmplog errors 2020-04-13 11:37:48 +02:00
459d8f9ba2 qemu cmplog test.sh 2020-04-13 10:53:37 +02:00
0022cc4782 fix some cmplog refactoring bugs 2020-04-13 10:40:24 +02:00
995e556065 cmplog forkserver tidying 2020-04-13 08:54:59 +02:00
a93268acec update todo 2020-04-12 22:45:54 +02:00
e70c54547e remove warnings with llvm11 2020-04-12 17:23:41 +02:00
7919545499 Better solution for ARM64 build fix (#315) 2020-04-12 16:55:52 +02:00
5a8db5954c update test.sh to new compcov features 2020-04-12 14:38:47 +02:00
ee4e1936d0 build on arm64 fix. tested on Android. (#313) 2020-04-12 14:20:10 +02:00
ec67780854 fix 32/64 bit LTO 2020-04-12 14:04:17 +02:00
aaf8835cdb updated changelog 2020-04-12 12:18:06 +02:00
0a525f768b local/global var for compare-transform-pass and code-format 2020-04-12 12:13:01 +02:00
4ed43b7632 m32/m64 support for LTO and code-format for test/ 2020-04-12 11:00:01 +02:00
5e09e13ece m32/m64 support for LTO and code-format for test/ 2020-04-12 10:58:58 +02:00
eec725a345 add global and local var support to autodictionary 2020-04-12 10:34:03 +02:00
fd63344ffc Fixed qbdi_mode/build.sh script (#311)
Co-authored-by: pyno <pyno@fearless>
2020-04-11 20:04:22 +02:00
90a9f22c3d fix #312 2020-04-11 18:31:46 +02:00
cc3ac932d9 fix -E/-V 2020-04-11 09:16:30 +02:00
d8947d1fa4 add extended forkserver feature to gcc_plugin and qemu_mode 2020-04-11 08:15:42 +02:00
32ba60185e more refactoring and update changelog 2020-04-11 08:02:54 +02:00
8bcfba8231 add missing file 2020-04-11 07:35:54 +02:00
68f269437d Autodictionary (#309)
* lto module clean-up

* step 1/3

* step 1/3 completed

* if tmp is ever made non-static

* parts 2 and 3 - autodictionary is complete

* variable map_size support

* variable map size: changed overlooked functions

* remove debug for autodict

* 64 bit alignment of map size

* fix review comments

* force 64 bit alignment on both sides

* typo

* better map transfer, display snapshot in UI

* update readme
2020-04-11 07:32:42 +02:00
29ee3a1ffc refactored cmplog 2020-04-11 01:09:07 +02:00
39e8b91806 code format 2020-04-10 22:54:31 +02:00
3ab7fcf5dd fixed fauxserver msg 2020-04-10 22:53:59 +02:00
3a509c6168 LTO optimization, variable map size, autodictionary (#307)
* lto module clean-up

* step 1/3

* step 1/3 completed

* if tmp is ever made non-static

* parts 2 and 3 - autodictionary is complete

* variable map_size support

* variable map size: changed overlooked functions

* remove debug for autodict

* 64 bit alignment of map size

* fix review comments

* force 64 bit alignment on both sides

* typo
2020-04-10 22:33:11 +02:00
6dcbc4dff4 void * types in allocs 2020-04-10 21:03:48 +02:00
d928b148d8 tackeled some warnings 2020-04-10 20:57:46 +02:00
3209a9d4e8 removed vla for tmpfile 2020-04-10 20:35:16 +02:00
f0f83bab52 resize fix + code format 2020-04-10 17:47:22 +02:00
6aa6af04ac files opened with fdopen should be closed with fclose 2020-04-10 16:45:45 +02:00
5b977453cb another mem leak fix for master/slave usage 2020-04-10 15:06:31 +02:00
a60e425d39 fix small memory leak for in_place_resume 2020-04-10 14:52:59 +02:00
4e3739cdf2 Merge branch 'dev' of https://github.com/AFLplusplus/AFLplusplus into dev 2020-04-10 14:50:05 +02:00
e51b4700e2 Merge branch 'dev' of github.com:aflplusplus/aflplusplus into dev 2020-04-10 14:34:24 +02:00
0b9f7c4c89 added back afl_state_deinit 2020-04-10 14:34:17 +02:00
9dcdbbb649 README: minor additions and typo fixes 2020-04-10 12:07:21 +02:00
ac2f0c9896 remove GNU makefile variants 2020-04-10 11:44:43 +02:00
fbf5e08425 merge PR#306 from neoni (thanks), silence test when bash is not found 2020-04-09 18:11:39 +00:00
df5c264754 Merge branch 'dev' of github.com:aflplusplus/aflplusplus into dev 2020-04-09 16:27:07 +02:00
66f535ad61 check for empty AFL env vars 2020-04-09 16:27:00 +02:00
b8d84ababb lto module clean-up (#303) 2020-04-09 16:27:00 +02:00
b485b7a252 fix compilers for empty AFL_CC/AFL_CXX env 2020-04-09 16:27:00 +02:00
c1395bb543 LTO llvm11 (#302)
* new LTO mode for llvm 11

* remove unneeded afl-ld and env vars
2020-04-09 16:27:00 +02:00
0c2e998f69 2.63d init 2020-04-09 16:27:00 +02:00
504529c3aa fix crash triage example (#304) 2020-04-09 13:46:21 +02:00
1fab45024b check for empty AFL env vars 2020-04-09 13:17:56 +02:00
e354235ebb lto module clean-up (#303) 2020-04-09 13:13:07 +02:00
d55196352c fix compilers for empty AFL_CC/AFL_CXX env 2020-04-09 11:49:40 +02:00
45e569845e LTO llvm11 (#302)
* new LTO mode for llvm 11

* remove unneeded afl-ld and env vars
2020-04-09 10:36:28 +02:00
b55421d4a1 2.63d init 2020-04-09 10:30:24 +02:00
fb8da3e4b1 push new version 2020-04-09 10:23:37 +02:00
a9c0f9a165 fix indention 2020-04-09 10:23:37 +02:00
4b5c4d58dc Update README.snapshot.md 2020-04-09 10:23:37 +02:00
b0e58b5b14 fixed critical whitespace 2020-04-09 10:23:37 +02:00
858c81a19b fix compile for MacOSX -DFORTIFY_SOURCE=2 is problematic 2020-04-09 10:23:37 +02:00
04360a35ed fix review comments by Heiko 2020-04-09 10:23:37 +02:00
c8ca944fac fix review comments by Heiko 2020-04-09 10:23:37 +02:00
b5e4d1a491 fix gcc_plugin Makefile (VPATH) 2020-04-09 10:23:37 +02:00
20cb846c95 Makefile cleanup 2020-04-09 10:23:37 +02:00
a1e531589e unicorn_mode/samples/persistent Makefile portable version 2020-04-09 10:23:37 +02:00
d6b680de48 remove todo 2020-04-09 10:23:37 +02:00
28314632bd fix travis - heiko test your changes on linux pls ;) 2020-04-09 10:23:37 +02:00
09ab904354 one more include move 2020-04-09 10:23:37 +02:00
5c0cf60ec1 fix damage in test.sh 2020-04-09 10:23:37 +02:00
698caed9c0 llvm_mode ctx: move function terminator instrumentation before skipping blocks 2020-04-09 10:23:37 +02:00
ae05f5c4b0 afl-fuzz: add usage info when no python support is there, use it in test.sh 2020-04-09 10:23:37 +02:00
d397bba6b2 llvm_mode android fix 2020-04-09 10:23:37 +02:00
7a6b66e684 fix limits.h include 2020-04-09 10:23:37 +02:00
e6daeef55c fix compilation in OpenBSD 2020-04-09 10:23:37 +02:00
c36c1b8992 update todo 2020-04-09 10:23:37 +02:00
1d1f575b5c add missing piece for CTX coverage 2020-04-09 10:23:37 +02:00
ecdffa03f8 added snapshot feature to documentation 2020-04-09 10:23:37 +02:00
6688184bfd argv_fuzzing Makefile: portable version 2020-04-09 10:23:37 +02:00
84a4fd40a0 fix travis 2020-04-09 10:23:37 +02:00
d37a195392 socket_fuzzing Makefile: make it portable 2020-04-09 10:23:37 +02:00
11e76af819 libdislocator: make Makefile portable 2020-04-09 10:23:37 +02:00
ed8c0d173e gcc_plugin: portable Makefile 2020-04-09 10:23:37 +02:00
c57fdbedaf gcc_plugin fix compile for USEMMAP 2020-04-09 10:23:37 +02:00
bd9676aa04 Android build fix proposal.
LTO flag is recognised but however broken on Android (tested with armv7 arch).
Thus giving the choice not to enable it.
In fortify mode, open required O_CREAT or O_TMPFILE when mode is set.
2020-04-09 10:23:37 +02:00
e5d0a9ecdf update readme 2020-04-09 10:23:37 +02:00
314debb799 ctx done 2020-04-09 10:23:37 +02:00
24ad714d0d update env with AFL_NO_SNAPSHOT 2020-04-09 10:23:37 +02:00
41225b53fa small fixes 2020-04-09 10:23:37 +02:00
5efd306f7b snapshot() in llvm mode 2020-04-09 10:23:37 +02:00
ccbcb5c8d3 added AFL_LLVM_INSTRUMENT, made USE_TRACE_PC obselete and llvm_mode Makefile fix, fixed for FUSELD (for LTO) 2020-04-09 10:23:37 +02:00
2f172d6c5a GNUmakefile: python config add --ldflags, silence tests 2020-04-09 10:23:37 +02:00
1eb81fdf36 unicorn_mode build script: find setuptools more reliably 2020-04-09 10:23:37 +02:00
62b6af693d Makefile bugfix macros are generally not expanded in shell calls 2020-04-09 10:23:37 +02:00
a49988afbf fix silly error with uname -s 2020-04-09 10:23:37 +02:00
03495beadb libtokencap, portable Makefile (for GNUmake and BSDmake) 2020-04-09 10:23:37 +02:00
079fdbf9bc portable version of Makefile (tested with bsdmake and GNUmake) 2020-04-09 10:23:37 +02:00
002e3840e6 update todo 2020-04-09 10:23:37 +02:00
96c558bec4 update todo 2020-04-09 10:23:37 +02:00
a267263420 unit tests cleaning 2020-04-09 10:23:37 +02:00
c14fd1ad18 code format, small improvements 2020-04-09 10:23:37 +02:00
88782ae43c custom mutator readme 2020-04-09 10:23:37 +02:00
70e777d031 no random timing for -s fixed_seed 2020-04-09 10:23:37 +02:00
9e1482ad04 fix make install regarding MANPAGES target 2020-04-09 10:23:37 +02:00
fef08192ad restore portable Makefiles 2020-04-09 10:23:37 +02:00
5488422471 fix UI bug for bit flip yields 2020-04-09 10:23:37 +02:00
e8e6dbf839 small enhancements and code-format 2020-04-09 10:23:37 +02:00
5602a09cc6 remove MaybeAlign 2020-04-09 10:23:37 +02:00
164a01e723 fix make install 2020-04-09 10:23:37 +02:00
f7f106c42a remove maybe_linking artifacts 2020-04-09 10:23:37 +02:00
7f817fe583 rename all 'Makefile' to 'GNUmakefile', use -Werror for -flto checks 2020-04-09 10:23:37 +02:00
5e66d95fbd better asan 2020-04-09 10:23:37 +02:00
d064b2e4af el no longer has to be used in loop 2020-04-09 10:23:37 +02:00
9d067d26da fix unit test case for long list 2020-04-09 10:23:37 +02:00
8e417ecb5c makefile asan fix 2020-04-09 10:23:37 +02:00
a9d072ad02 O3 again 2020-04-09 10:23:37 +02:00
5630c2e72c list testcase added 2020-04-09 10:23:37 +02:00
29ff59cc8a fixing unit tests (again) remove CFLAGS_FLTO, put LDFLAGS near the end 2020-04-09 10:23:37 +02:00
dab429521b added (broken) list test 2020-04-09 10:23:37 +02:00
48fc106905 added prealloc testcase 2020-04-09 10:23:37 +02:00
ee72d5d01d add Make rule for new unit test 2020-04-09 10:23:37 +02:00
378f4dd46d fix make target unit test (tested on Ubuntu 16.04) 2020-04-09 10:23:37 +02:00
2455f081fc llvm_mode: using MaybeAlign wrapper over the deprecated setter.
seems to be available even on LLVM 3.7
2020-04-09 10:23:37 +02:00
f06acc4e27 push new version 2020-04-09 09:14:12 +02:00
3c546341e3 fix indention 2020-04-09 09:08:04 +02:00
650bd1c179 Update README.snapshot.md 2020-04-09 08:58:35 +02:00
9efa96fe0c fixed critical whitespace 2020-04-09 01:40:03 +02:00
361c2ac576 fix compile for MacOSX -DFORTIFY_SOURCE=2 is problematic 2020-04-08 23:45:28 +02:00
54359be31a fix review comments by Heiko 2020-04-08 23:16:49 +02:00
77949acaee fix review comments by Heiko 2020-04-08 23:15:42 +02:00
88a852ef0f fix gcc_plugin Makefile (VPATH) 2020-04-08 22:21:32 +00:00
cb52b1757d Makefile cleanup 2020-04-08 21:39:11 +02:00
b4869d0663 unicorn_mode/samples/persistent Makefile portable version 2020-04-08 21:23:18 +02:00
30fa7b8006 remove todo 2020-04-08 19:17:21 +02:00
7793ca4055 fix travis - heiko test your changes on linux pls ;) 2020-04-08 18:28:35 +02:00
3353a23fcb one more include move 2020-04-08 18:19:38 +02:00
b32b9bd1d5 fix damage in test.sh 2020-04-08 18:16:08 +02:00
133a8cea1c llvm_mode ctx: move function terminator instrumentation before skipping blocks 2020-04-08 17:57:11 +02:00
729dbf7dda afl-fuzz: add usage info when no python support is there, use it in test.sh 2020-04-08 17:53:25 +00:00
67e9ef43a7 llvm_mode android fix 2020-04-08 17:22:31 +02:00
1b5b54fe94 fix limits.h include 2020-04-08 15:49:34 +02:00
9b3e6112ff Merge branch 'dev' of https://github.com/vanhauser-thc/AFLplusplus into dev 2020-04-08 17:39:19 +02:00
7663e7dd05 fix compilation in OpenBSD 2020-04-08 17:38:45 +02:00
2e29e64a3f Merge pull request #295 from devnexen/android_build_fix
Android build fix proposal.
2020-04-08 15:25:29 +02:00
15e0319c98 update todo 2020-04-08 13:12:14 +02:00
055ca98fb2 add missing piece for CTX coverage 2020-04-08 12:52:14 +02:00
968295ed81 added snapshot feature to documentation 2020-04-08 12:34:01 +02:00
48e366d7a8 argv_fuzzing Makefile: portable version 2020-04-08 10:44:42 +02:00
9aa10ef7ca fix travis 2020-04-08 10:39:32 +02:00
a85b8d69ef Merge branch 'dev' of https://github.com/AFLplusplus/AFLplusplus into dev 2020-04-08 10:21:46 +02:00
2900d51e5d socket_fuzzing Makefile: make it portable 2020-04-08 10:20:53 +02:00
63cc113f12 Merge pull request #298 from AFLplusplus/snapshot
Snapshot for LLVM mode in dev
2020-04-08 09:36:04 +02:00
3bf88da091 libdislocator: make Makefile portable 2020-04-08 08:50:30 +02:00
11e3122843 gcc_plugin: portable Makefile 2020-04-08 08:16:55 +02:00
dbe6b1da44 gcc_plugin fix compile for USEMMAP 2020-04-08 08:14:42 +02:00
91dc7776ec Android build fix proposal.
LTO flag is recognised but however broken on Android (tested with armv7 arch).
Thus giving the choice not to enable it.
In fortify mode, open required O_CREAT or O_TMPFILE when mode is set.
2020-04-08 04:57:01 +01:00
a5036499d2 update readme 2020-04-08 04:28:13 +02:00
9ef4b45609 ctx done 2020-04-08 03:56:12 +02:00
5b160f187d update env with AFL_NO_SNAPSHOT 2020-04-07 11:26:18 +02:00
604f17b897 small fixes 2020-04-07 10:56:31 +02:00
da1f3bf41e snapshot() in llvm mode 2020-04-07 10:50:21 +02:00
452acf3a75 added AFL_LLVM_INSTRUMENT, made USE_TRACE_PC obselete and llvm_mode Makefile fix, fixed for FUSELD (for LTO) 2020-04-06 13:33:49 +02:00
5ad50adaa8 GNUmakefile: python config add --ldflags, silence tests 2020-04-04 18:42:51 +02:00
c165165b58 unicorn_mode build script: find setuptools more reliably 2020-04-04 18:38:38 +02:00
0303d315fc Makefile bugfix macros are generally not expanded in shell calls 2020-04-04 16:45:59 +02:00
2129257454 fix silly error with uname -s 2020-04-04 16:16:13 +02:00
a7e9ce2e33 libtokencap, portable Makefile (for GNUmake and BSDmake) 2020-04-04 01:39:01 +02:00
b9851cdabe Merge branch 'dev' of https://github.com/vanhauser-thc/AFLplusplus into dev 2020-04-04 00:17:31 +02:00
a9261c6d64 portable version of Makefile (tested with bsdmake and GNUmake) 2020-04-04 00:15:08 +02:00
064131887b update todo 2020-04-03 14:17:31 +02:00
6b5d5b11b0 update todo 2020-04-03 14:00:29 +02:00
3f2859ec16 unit tests cleaning 2020-04-03 10:43:52 +02:00
5340f2f2eb code format, small improvements 2020-04-03 10:31:37 +02:00
8610b0e406 Merge branch 'dev' of github.com:vanhauser-thc/AFLplusplus into dev 2020-04-03 09:39:12 +02:00
ffb4767fc1 custom mutator readme 2020-04-03 09:39:09 +02:00
97cae2df99 no random timing for -s fixed_seed 2020-04-02 23:33:55 +02:00
dc0369eb10 fix make install regarding MANPAGES target 2020-04-02 22:14:39 +02:00
71f0bd003f Merge branch 'dev' of https://github.com/vanhauser-thc/AFLplusplus into dev 2020-04-02 17:00:58 +02:00
cc65e91eeb restore portable Makefiles 2020-04-02 17:00:35 +02:00
2ae0208d3b fix UI bug for bit flip yields 2020-04-02 16:46:31 +02:00
7114663f52 small enhancements and code-format 2020-04-02 16:41:33 +02:00
26e45e41ed remove MaybeAlign 2020-04-02 15:38:32 +02:00
38b14c5c44 fix make install 2020-04-02 15:18:05 +02:00
0c76d7e621 remove maybe_linking artifacts 2020-04-02 14:37:28 +02:00
c69c84da09 Merge pull request #288 from devnexen/llvm_mode_little_upd
llvm_mode: using MaybeAlign wrapper over the deprecated setter.
2020-04-02 10:55:58 +02:00
0565fe4213 rename all 'Makefile' to 'GNUmakefile', use -Werror for -flto checks 2020-04-02 12:24:39 +02:00
cb0bc98576 better asan 2020-04-02 02:44:49 +02:00
ef4eeede86 el no longer has to be used in loop 2020-04-01 20:42:50 +02:00
1cce581ffe fix unit test case for long list 2020-04-01 20:37:13 +02:00
989a85bb05 makefile asan fix 2020-04-01 18:56:59 +02:00
db3645c76b O3 again 2020-04-01 18:22:02 +02:00
b5c5496b2f list testcase added 2020-04-01 18:19:43 +02:00
4aec6dabde fixing unit tests (again) remove CFLAGS_FLTO, put LDFLAGS near the end 2020-04-01 16:18:44 +02:00
0fac7bd373 added (broken) list test 2020-04-01 15:56:27 +02:00
9c1c1062be added prealloc testcase 2020-04-01 15:56:27 +02:00
36a03e3bc8 add Make rule for new unit test 2020-04-01 15:51:34 +02:00
dfb0a65e07 fix make target unit test (tested on Ubuntu 16.04) 2020-04-01 15:39:36 +02:00
d40866add2 unittest for prealloc added 2020-04-01 14:39:03 +02:00
9ca8ff77f3 Merge branch 'master' of github.com:aflplusplus/aflplusplus into dev 2020-04-01 13:10:14 +02:00
e95ac10ff7 fix ASAN check 2020-04-01 13:10:07 +02:00
c7cf2c17a2 fix ASAN bulid for old gcc versions 2020-04-01 13:10:07 +02:00
29b1e30126 fixed asan mem limit 2020-04-01 13:10:07 +02:00
24b9eddc7e disable memory limits for ASAN build 2020-04-01 13:10:07 +02:00
effa766d4a fix cmocka fixup 2020-04-01 13:10:07 +02:00
b9783e44a3 cmocka mocks 2020-04-01 13:10:07 +02:00
35c817ccd0 mocking cmocka 1 for cmocka 0.x 2020-04-01 13:10:07 +02:00
77d68bc7bd old cmocka is old 2020-04-01 13:10:07 +02:00
6392a349ce add assert_ptr_equal fallback 2020-04-01 13:10:07 +02:00
4489dd24a8 typo fix 2020-04-01 13:10:07 +02:00
d374648ce3 docs 2020-04-01 13:10:07 +02:00
d611e7d50e next_p2 replaced by next_pow2 2020-04-01 13:10:07 +02:00
25d6d21617 code format 2020-04-01 13:10:07 +02:00
74b4096570 one less alloc 2020-04-01 13:10:07 +02:00
eca55be4fb minor changes 2020-04-01 13:10:07 +02:00
71372c4d2f fixed docu 2020-04-01 13:10:07 +02:00
a0693d466c try to fix forkserver 2020-04-01 13:10:07 +02:00
14d2456c35 fix gcc 2020-04-01 13:10:07 +02:00
c8bdf0790f reenabled custom mutator report 2020-04-01 13:10:07 +02:00
0b8a5cb4bb travis: dont fail on custom mutator - currently 2020-04-01 13:10:07 +02:00
8f98d5a8f8 fix unit test compilation 2020-04-01 13:10:07 +02:00
b83a2c1a00 make travis happy 2020-04-01 13:10:07 +02:00
5a4d4ad736 fixed bug in cmplog 2020-04-01 13:10:07 +02:00
5bc6dccbbd src doku is now markdown 2020-04-01 13:10:07 +02:00
42ee300e92 dropped make switches 2020-04-01 13:10:07 +02:00
582f5103d9 enabled fortify source 2020-04-01 13:10:07 +02:00
abef859925 Update regexp.dict 2020-04-01 13:10:07 +02:00
6eb79c28d1 Update regexp.dict 2020-04-01 13:10:07 +02:00
84a096561a tiny fixes 2020-04-01 13:10:07 +02:00
9a1f105869 fix ubuntu cmocka pkgname 2020-04-01 13:10:07 +02:00
677f2c6ca9 mutator docs 2020-04-01 13:10:07 +02:00
508230e91b code format 2020-04-01 13:10:07 +02:00
9cab515e58 added unittests to test.sh 2020-04-01 13:10:07 +02:00
514036898f added unit target to make help and README 2020-04-01 13:10:07 +02:00
19415f2554 Add test cases for the custom mutator (#276)
* Minor update

* Fix the soft link of `afl-clang-fast++`

* Add a test case for the custom mutator

- Update the Makefile in examples/custom_mutators
- Add a test program for testing the custom mutator
- Update test.sh for testing the custom mutator
- [TODO] Update the result checking criterias of the custom mutator in
test.sh

* Fix nullptr in the custom mutator

* Fix typo

* Fix invalid memory access bug in `afl_custom_pre_save` of example.c

* example.py: add deinit()

* python mutator: fix nullptr for python mutator data

* test.sh: "trusty-amd64" does not work well with "realpath". Use
"readlink -f" for Ubuntu instead.

* Fix heap allocation bug

- Reason: `afl->out_size` is not consistent with the actual allocation
of `afl->out_buf`. The deleted line in `src/afl-fuzz-one.c` may change
`afl->out_size`, but `afl->out_buf` is not changed

* test.sh: redirect command line output

* afl-fuzz-one.c: minor update

Co-authored-by: Dominik Maier <domenukk@gmail.com>
2020-04-01 13:10:07 +02:00
710a29a1e0 fixed testcase 2020-04-01 13:10:07 +02:00
c36c34cf9e fixed example 2020-04-01 13:10:07 +02:00
e910c224da afl-fuzz-one.c: minor update 2020-04-01 13:10:07 +02:00
ea95453975 test.sh: redirect command line output 2020-04-01 13:10:07 +02:00
61ea398612 Fix heap allocation bug
- Reason: `afl->out_size` is not consistent with the actual allocation
of `afl->out_buf`. The deleted line in `src/afl-fuzz-one.c` may change
`afl->out_size`, but `afl->out_buf` is not changed
2020-04-01 13:10:07 +02:00
64e1d3a975 test.sh: "trusty-amd64" does not work well with "realpath". Use
"readlink -f" for Ubuntu instead.
2020-04-01 13:10:07 +02:00
50fc7327f2 python mutator: fix nullptr for python mutator data 2020-04-01 13:10:07 +02:00
71edae4a0f example.py: add deinit() 2020-04-01 13:10:07 +02:00
0dd8ed9171 Fix invalid memory access bug in afl_custom_pre_save of example.c 2020-04-01 13:10:07 +02:00
d568559f01 Fix typo 2020-04-01 13:10:06 +02:00
1e290542bb rebase 2020-04-01 13:10:06 +02:00
245304f593 Add a test case for the custom mutator
- Update the Makefile in examples/custom_mutators
- Add a test program for testing the custom mutator
- Update test.sh for testing the custom mutator
- [TODO] Update the result checking criterias of the custom mutator in
test.sh
2020-04-01 13:10:06 +02:00
be441dc176 upstream changes 2020-04-01 13:10:06 +02:00
da1a0249d7 merged dev 2020-04-01 13:10:06 +02:00
d07587885c added untitest to gitignore 2020-04-01 13:10:06 +02:00
376b45c199 code format 2020-04-01 13:10:06 +02:00
b247366c4e regec dict additions 2020-04-01 13:10:06 +02:00
7c383094d9 added unittest for unit_maybe_alloc 2020-04-01 13:10:06 +02:00
9721990507 code cleanup 2020-04-01 13:10:06 +02:00
452067ffca added read_timed 2020-04-01 13:10:06 +02:00
3ce5efc44b llvm_mode/Makefile: replace lexical version comparison with a numerical one 2020-04-01 13:10:06 +02:00
1e8c1a4c46 review adaptions for afl-llvm-pass 2020-04-01 13:10:06 +02:00
b53ec1b247 afl-llvm-pass.so.cc: fix compile for llvm 3.8.0 @Marc: please review 2020-04-01 13:10:06 +02:00
4ccfbe4e5a .gitignore: add afl-ld and ld 2020-04-01 13:10:06 +02:00
7698c051aa qemu_mode: compiler warnings, strncpy() leave one byte for terminator 2020-04-01 13:10:06 +02:00
1950f09bde qemu_mode: fix more compiler warnings 2020-04-01 13:10:06 +02:00
e41b03eb30 qemu_mode: silence two compiler warnings 2020-04-01 13:10:06 +02:00
98545f30aa code format 2020-04-01 13:10:06 +02:00
81873d97f8 error handling for custom mutators 2020-04-01 13:10:06 +02:00
cda56ca129 types.h: silence some compiler warnings regarding redeclaration of
likely/unlikely
2020-04-01 13:10:06 +02:00
ab5e0703da tiny changes in custom mut api 2020-04-01 13:10:06 +02:00
f370ef38c4 alloc-inl.h/ck_maybe_grow(): restore original exponential allocs 2020-04-01 13:10:06 +02:00
1119a2e185 alloc-inl.h/ck_maybe_grow() back to size_t, reimplement overflow check 2020-04-01 13:10:06 +02:00
9d7ac3d99f alloc_inl.h/ck_maybe_grow(): fix compiler warning 2020-04-01 13:10:06 +02:00
0732e66da9 gcc_plugin: fix compiler warnings regarding -O and FORTIFY_SOURCE 2020-04-01 13:10:06 +02:00
e56e2f4c18 llvm_mode: fix compiler warnings FORTIFY_SOURCE needs -O 2020-04-01 13:10:06 +02:00
23d9649aec making 'CFLAGS="-m32" make source-only tests' work 2020-04-01 13:10:06 +02:00
738a245c3e fix warning in afl-fuzz-run, tested with '-m32' also 2020-04-01 13:10:06 +02:00
78d73720a2 fix detection compiles (e.g. python) when using CFLAGS="-m32" 2020-04-01 13:10:05 +02:00
e59282fe20 if exponential growth is too much, don't doo it 2020-04-01 13:10:05 +02:00
9785b15ed2 more custom mutator remodelling 2020-04-01 13:10:05 +02:00
8c94a3d177 added nullptr fix by h1994st 2020-04-01 13:10:05 +02:00
5bd8aa489b fixed leak 2020-04-01 13:10:05 +02:00
e71c2937de code format 2020-04-01 13:10:05 +02:00
3d6c58df53 part1 make it compilable for llvm 3.8.0 (ubuntu 16.04) 2020-04-01 13:10:05 +02:00
34c090a31d add CFI sanitizer 2020-04-01 13:10:05 +02:00
762421b355 less allocs 2020-04-01 13:10:05 +02:00
b7f3d180aa not allocating paths anymore 2020-04-01 13:10:05 +02:00
71f8cc9dd2 almost 2020-04-01 13:10:05 +02:00
3c7bc6fd42 Merge branch 'dev' of github.com:aflplusplus/aflplusplus into dev 2020-04-01 12:53:10 +02:00
af60844aea fix ASAN bulid for old gcc versions 2020-04-01 12:53:03 +02:00
c4c13dd235 fix ASAN check 2020-04-01 12:52:54 +02:00
ba4f0186dd fixed asan mem limit 2020-04-01 12:43:26 +02:00
a5c09e4c11 disable memory limits for ASAN build 2020-04-01 12:19:54 +02:00
c7818714ac fix cmocka fixup 2020-04-01 09:42:40 +02:00
cec3d74497 cmocka mocks 2020-04-01 03:39:36 +02:00
10b226418c mocking cmocka 1 for cmocka 0.x 2020-04-01 03:20:22 +02:00
c843085a28 old cmocka is old 2020-04-01 02:59:19 +02:00
101c5a275f add assert_ptr_equal fallback 2020-04-01 02:28:54 +02:00
acf4b0981e typo fix 2020-04-01 02:09:33 +02:00
98c0908185 docs 2020-04-01 02:07:52 +02:00
ead3701f5b next_p2 replaced by next_pow2 2020-04-01 02:03:46 +02:00
0349b0a735 code format 2020-04-01 02:00:03 +02:00
11cad9fb20 one less alloc 2020-04-01 01:58:34 +02:00
7f44fec0a5 minor changes 2020-04-01 01:55:13 +02:00
d4c8a2058d fixed docu 2020-04-01 01:38:45 +02:00
d73e63bd70 try to fix forkserver 2020-04-01 01:24:44 +02:00
48655c2e12 llvm_mode: using MaybeAlign wrapper over the deprecated setter.
seems to be available even on LLVM 3.7
2020-03-31 19:25:24 +01:00
d0d5518ea8 fix gcc 2020-03-31 18:06:14 +02:00
822e75f7c2 reenabled custom mutator report 2020-03-31 14:01:22 +02:00
08b6b4ec4e travis: dont fail on custom mutator - currently 2020-03-31 07:37:30 +02:00
3253e3f315 fix unit test compilation 2020-03-31 07:14:25 +02:00
e58e54c2db make travis happy 2020-03-31 04:51:38 +02:00
0a7dc10dd3 fixed bug in cmplog 2020-03-31 04:22:22 +02:00
3914aec72f src doku is now markdown 2020-03-31 03:41:51 +02:00
9b63fc758e dropped make switches 2020-03-31 03:22:46 +02:00
d3130ace30 enabled fortify source 2020-03-31 02:41:11 +02:00
daa09a5fbb Update regexp.dict 2020-03-31 01:41:16 +02:00
a249dadfb0 Update regexp.dict 2020-03-31 01:41:16 +02:00
64e9f1f3a2 tiny fixes 2020-03-30 23:53:10 +02:00
9110097e11 fix ubuntu cmocka pkgname 2020-03-30 18:55:54 +02:00
ac48b58184 mutator docs 2020-03-30 18:46:12 +02:00
8f5fb47082 code format 2020-03-30 18:38:39 +02:00
a58382d3ff added unittests to test.sh 2020-03-30 18:37:16 +02:00
5ef8e3cf29 Merge branch 'dev' of github.com:aflplusplus/aflplusplus into dev 2020-03-30 18:22:43 +02:00
6544014ced Add test cases for the custom mutator (#276)
* Minor update

* Fix the soft link of `afl-clang-fast++`

* Add a test case for the custom mutator

- Update the Makefile in examples/custom_mutators
- Add a test program for testing the custom mutator
- Update test.sh for testing the custom mutator
- [TODO] Update the result checking criterias of the custom mutator in
test.sh

* Fix nullptr in the custom mutator

* Fix typo

* Fix invalid memory access bug in `afl_custom_pre_save` of example.c

* example.py: add deinit()

* python mutator: fix nullptr for python mutator data

* test.sh: "trusty-amd64" does not work well with "realpath". Use
"readlink -f" for Ubuntu instead.

* Fix heap allocation bug

- Reason: `afl->out_size` is not consistent with the actual allocation
of `afl->out_buf`. The deleted line in `src/afl-fuzz-one.c` may change
`afl->out_size`, but `afl->out_buf` is not changed

* test.sh: redirect command line output

* afl-fuzz-one.c: minor update

Co-authored-by: Dominik Maier <domenukk@gmail.com>
2020-03-30 18:21:03 +02:00
3fcb3e2ed3 fixed testcase 2020-03-30 18:20:20 +02:00
caebc9347f added unit target to make help and README 2020-03-30 17:45:17 +02:00
1f257c5875 fixed example 2020-03-30 16:46:54 +02:00
e2a3de71ca afl-fuzz-one.c: minor update 2020-03-30 16:46:54 +02:00
57a0134b0c test.sh: redirect command line output 2020-03-30 16:46:54 +02:00
d9b18ec853 Fix heap allocation bug
- Reason: `afl->out_size` is not consistent with the actual allocation
of `afl->out_buf`. The deleted line in `src/afl-fuzz-one.c` may change
`afl->out_size`, but `afl->out_buf` is not changed
2020-03-30 16:46:54 +02:00
6c14415664 test.sh: "trusty-amd64" does not work well with "realpath". Use
"readlink -f" for Ubuntu instead.
2020-03-30 16:46:54 +02:00
567b3985ab python mutator: fix nullptr for python mutator data 2020-03-30 16:46:54 +02:00
45561d552e example.py: add deinit() 2020-03-30 16:46:54 +02:00
fbd5bd8f37 Fix invalid memory access bug in afl_custom_pre_save of example.c 2020-03-30 16:46:54 +02:00
048beb752d Fix typo 2020-03-30 16:46:53 +02:00
87621b6345 rebase 2020-03-30 16:46:50 +02:00
ff14dfc0fc Add a test case for the custom mutator
- Update the Makefile in examples/custom_mutators
- Add a test program for testing the custom mutator
- Update test.sh for testing the custom mutator
- [TODO] Update the result checking criterias of the custom mutator in
test.sh
2020-03-30 16:46:11 +02:00
c624831717 upstream changes 2020-03-30 16:46:05 +02:00
c697a003d1 merged dev 2020-03-30 16:45:13 +02:00
6bdd7a1609 added untitest to gitignore 2020-03-30 16:08:07 +02:00
50a195fe59 code format 2020-03-30 16:07:25 +02:00
738016952f Merge branch 'dev' of github.com:aflplusplus/aflplusplus into dev 2020-03-30 16:01:33 +02:00
209aa25d27 added unittest for unit_maybe_alloc 2020-03-30 16:01:29 +02:00
1279c935e2 regec dict additions 2020-03-30 11:33:42 +02:00
28e5a8031c code cleanup 2020-03-30 00:50:32 +02:00
f4844e2c0c added read_timed 2020-03-30 00:50:14 +02:00
ef3a13fa63 llvm_mode/Makefile: replace lexical version comparison with a numerical one 2020-03-29 09:48:01 +02:00
699f769385 review adaptions for afl-llvm-pass 2020-03-28 23:01:12 +01:00
2548b657d8 afl-llvm-pass.so.cc: fix compile for llvm 3.8.0 @Marc: please review 2020-03-28 20:25:00 +01:00
02d19dafb2 .gitignore: add afl-ld and ld 2020-03-28 14:23:54 +01:00
78009d9d07 qemu_mode: compiler warnings, strncpy() leave one byte for terminator 2020-03-28 14:15:04 +01:00
2aa7ddf1a8 qemu_mode: fix more compiler warnings 2020-03-28 13:51:35 +01:00
3c142efecf qemu_mode: silence two compiler warnings 2020-03-28 13:38:49 +01:00
23b3e3c84d Merge branch 'dev' of https://github.com/AFLplusplus/AFLplusplus into dev 2020-03-28 13:06:05 +01:00
8b8600fdab types.h: silence some compiler warnings regarding redeclaration of
likely/unlikely
2020-03-28 13:05:26 +01:00
1938a12222 code format 2020-03-28 12:59:41 +01:00
4c11ef5d20 error handling for custom mutators 2020-03-28 12:58:56 +01:00
6ac40e2cc5 Merge branch 'dev' of https://github.com/vanhauser-thc/AFLplusplus into dev 2020-03-28 12:16:01 +01:00
5625e059e1 alloc-inl.h/ck_maybe_grow(): restore original exponential allocs 2020-03-28 12:15:01 +01:00
11767bec0e tiny changes in custom mut api 2020-03-28 11:55:10 +01:00
7a92bf974d alloc-inl.h/ck_maybe_grow() back to size_t, reimplement overflow check 2020-03-28 11:01:29 +01:00
fc46e9c9a0 alloc_inl.h/ck_maybe_grow(): fix compiler warning 2020-03-28 10:23:11 +01:00
7a752d0795 gcc_plugin: fix compiler warnings regarding -O and FORTIFY_SOURCE 2020-03-28 10:00:23 +01:00
0cff53785b llvm_mode: fix compiler warnings FORTIFY_SOURCE needs -O 2020-03-28 09:54:40 +01:00
4ad885001a making 'CFLAGS="-m32" make source-only tests' work 2020-03-28 09:31:30 +01:00
a0dec909e7 fix warning in afl-fuzz-run, tested with '-m32' also 2020-03-28 08:38:50 +01:00
2a660b19a7 fix detection compiles (e.g. python) when using CFLAGS="-m32" 2020-03-28 08:32:54 +01:00
8992c44c41 if exponential growth is too much, don't doo it 2020-03-28 05:01:01 +01:00
53fd8fe6ea more custom mutator remodelling 2020-03-28 04:57:44 +01:00
0059d16731 added nullptr fix by h1994st 2020-03-28 01:14:24 +01:00
18bc344cf5 fixed leak 2020-03-28 00:44:52 +01:00
e04f4b3f20 code format 2020-03-27 23:30:15 +01:00
5e389a0970 Less allocs 2020-03-27 23:24:42 +01:00
1141459607 less allocs 2020-03-27 23:23:11 +01:00
02659df6ba not allocating paths anymore 2020-03-27 23:06:57 +01:00
14bd424d2a almost 2020-03-27 21:59:08 +01:00
7c76b7db04 part1 make it compilable for llvm 3.8.0 (ubuntu 16.04) 2020-03-27 21:03:28 +01:00
a7553eae28 add CFI sanitizer 2020-03-27 12:09:06 +01:00
5cc50bb979 important llvm_mode Makefile fix 2020-03-27 11:06:06 +01:00
932eae7343 example fixed 2020-03-27 11:06:06 +01:00
604f122819 docu 2020-03-27 11:06:06 +01:00
d6a7630fe2 more api 2020-03-27 11:06:06 +01:00
fc4b03ee74 Code Format (#275) 2020-03-27 11:06:06 +01:00
e9c7610cb7 edited custom mutator pre_save api 2020-03-27 11:06:06 +01:00
3c3a5aa503 updated with required changes 2020-03-27 11:06:06 +01:00
6d3dc83c5d code format 2020-03-27 11:06:06 +01:00
89512d4e05 fixed call of custom mutators 2020-03-27 11:06:06 +01:00
b1d71136b0 fixed typos in README.md 2020-03-27 11:06:06 +01:00
8cf47f2425 add "time without finds" to afl-whatsup 2020-03-27 11:06:06 +01:00
c75b403bb7 fix doc link 2020-03-27 11:06:06 +01:00
ae284610cf important llvm_mode Makefile fix 2020-03-27 10:08:09 +01:00
5a7d33330a example fixed 2020-03-26 19:48:26 +01:00
12a9a1001e docu 2020-03-26 19:47:16 +01:00
97a1af39f7 more api 2020-03-26 19:44:44 +01:00
6832435326 Code Format (#275) 2020-03-26 18:47:48 +01:00
62bb94c50b Merge branch 'dev' of github.com:aflplusplus/aflplusplus into dev 2020-03-25 21:54:59 +01:00
eeb7e12b9f edited custom mutator pre_save api 2020-03-25 21:54:52 +01:00
f796537712 Merge pull request #272 from ashiscs/master
fixed typos in README.md
2020-03-25 17:32:32 +01:00
469446a02b updated with required changes 2020-03-25 19:35:38 +05:30
b24ef50f7b Merge pull request #271 from fuzzah/aflpp_time_without_finds
add "time without finds" to afl-whatsup
2020-03-25 12:50:42 +01:00
f6466214c6 code format 2020-03-25 11:31:01 +01:00
9c4d32b5b8 fixed call of custom mutators 2020-03-24 22:40:14 +01:00
50be709e91 fixed typos in README.md 2020-03-25 01:21:02 +05:30
2e060f856d Merge branch 'dev' of github.com:aflplusplus/aflplusplus into dev 2020-03-24 18:46:43 +01:00
c9a2401983 fix doc link 2020-03-24 18:46:25 +01:00
ce58790fc0 add "time without finds" to afl-whatsup 2020-03-24 15:12:08 +03:00
7f3e04cbc4 fix doc link 2020-03-24 08:44:18 +01:00
3fb346fe29 Merge pull request #269 from AFLplusplus/dev
Dev
2020-03-23 20:42:10 +01:00
36213dba7d Merge branch 'dev' of github.com:vanhauser-thc/AFLplusplus into dev 2020-03-23 20:19:20 +01:00
65817144ac include afl-llvm-rt.o not only when linking 2020-03-23 20:19:07 +01:00
82432195a8 Merge pull request #266 from AFLplusplus/dev 2020-03-23 18:19:20 +01:00
77b81e7361 custom mutators might work again like this 2020-03-23 18:18:54 +01:00
83f925ccc9 unsafer 2020-03-23 15:02:26 +01:00
39208eeb9a typo 2020-03-23 12:06:43 +01:00
f32d1022bd surgical_havoc_mutate() in custom mutator helpers 2020-03-23 10:47:17 +01:00
ee9447de01 libasan.so is not a thing. libclang-rt.asan-ARCH.so is the asan DSO and it is not linked by default. Search for __asan_init instead. 2020-03-23 10:09:55 +01:00
dcfc24501b update readme 2020-03-23 10:05:08 +01:00
e65e723e03 update readme 2020-03-23 09:50:12 +01:00
94e30002e7 better man page for afl-clang-* 2020-03-23 09:25:05 +01:00
37603272be more fixes and code-format 2020-03-23 08:58:17 +01:00
4263519479 more fixes 2020-03-23 08:48:57 +01:00
db302ff18b minor fixes 2020-03-23 08:44:27 +01:00
cbde30e9d4 less branches, cleanup 2020-03-23 00:14:03 +01:00
c0fd8f4e15 Merge pull request #265 from devnexen/unicorn_python3_4_mac
Enforcing python3 for Mac too.
2020-03-22 19:09:43 +01:00
d39e9ea11c little performance enhancements 2020-03-22 19:06:39 +01:00
5b64681867 a little bit more performance 2020-03-22 18:27:04 +01:00
0132657432 Enforcing python3 for Mac too. 2020-03-22 12:31:58 +00:00
aac7c7d75d detect arm in build_qemu_support.sh 2020-03-22 12:09:52 +01:00
bd239d7e3d nice -n -20 to commit test script 2020-03-22 11:28:09 +01:00
da1f2f3c17 fix travis 2020-03-22 10:24:29 +01:00
7374af51d1 silly, silly typo 2020-03-22 10:07:59 +01:00
38fa2fe0b1 add commit test script test/checkcommit.sh 2020-03-22 09:32:13 +01:00
5a0cc43ee1 all afl msgs to stdout and only read AFL_BENCH_JUST_ONE once 2020-03-22 09:26:46 +01:00
f08a3fedf6 renamed UB to rand_below 2020-03-21 22:26:13 +01:00
5cf3426834 remove debug code 2020-03-21 22:17:57 +01:00
96736309a7 support for arm platform when building qemu 2020-03-21 22:11:07 +01:00
42ece199c8 revert test.sh patch 2020-03-21 22:04:52 +01:00
54d01fec43 moved string formatting to header 2020-03-21 21:48:52 +01:00
f8d717d195 test.sh fix 2020-03-21 21:42:32 +01:00
c6db05c5ae test.sh with -no-pie 2020-03-21 21:10:38 +01:00
6f78b67f03 adjusted int_bufs 2020-03-21 20:28:01 +01:00
a5af81506f qemu_mode/unicorn_mode scripts: fix '==' in '[' 2020-03-21 19:31:15 +01:00
087bc6daeb qemu_mode and unicorn_mode build scripts: replace type with command -v 2020-03-21 19:22:55 +01:00
f18dbb0b40 afl-gotcpu.c: compielr warning fixed: initialize variable v2 2020-03-21 19:13:39 +01:00
6cbd0f1faf avoid calling awk for 'which' replacement, use POSIX 'command -v' instead 2020-03-21 18:51:43 +01:00
dcd9cd638b fix stat display 2020-03-21 17:42:00 +01:00
350530f664 unicorn build script: list all missing prereqs in one invocation,
replace which with type
2020-03-21 10:59:58 +01:00
dabce05ec6 qemu_mode/build script: add more missing prereqs 2020-03-21 10:46:23 +01:00
993bf03af9 Merge branch 'dev' of https://github.com/AFLplusplus/AFLplusplus into dev 2020-03-21 10:36:18 +01:00
2508008b53 qemu_mode, build script: avoid which, add patch to prereqs, list all
missing prereqs in one invocation
2020-03-21 10:31:39 +01:00
a0012c9e82 forgot readme for ngram 2020-03-20 17:56:24 +01:00
c63956b8ec Merge branch 'dev' of https://github.com/vanhauser-thc/AFLplusplus into dev 2020-03-20 17:32:42 +01:00
6965797286 unicorn: increase timeout for unicorn test in build script 2020-03-20 17:31:48 +01:00
5a74cffa0f added llvm_mode ngram coverage 2020-03-20 17:10:44 +01:00
f21ff8bac8 show cycles_without_finds in afl-whatsup 2020-03-20 12:19:22 +01:00
5d932398df expose cycles_wo_finds in fuzzer_stats 2020-03-20 09:44:51 +01:00
5532fc1102 added missing descriptions of entries in fuzzer_stats 2020-03-20 09:28:43 +01:00
60d66ebc0d clean was missing ld symlink 2020-03-20 09:06:54 +01:00
29853549c3 add RARE schedule. also fixes doc_path 2020-03-20 08:54:09 +01:00
d0b5cd64c3 install llvm_mode READMEs 2020-03-19 23:55:28 +01:00
cd4243b6ad update doc 2020-03-19 23:40:45 +01:00
cd2be88707 travis for dev branch 2020-03-19 23:29:33 +01:00
5b9d306cdf no more (?) statics 2020-03-19 22:54:09 +01:00
0fa47bb867 removed unneeded func 2020-03-19 21:33:17 +01:00
b22e890ec2 fixed resize; removed more statics 2020-03-19 21:32:08 +01:00
b6fa63abdf code format 2020-03-19 19:23:58 +01:00
51a346bcbe 50% less globals 2020-03-19 19:22:57 +01:00
fd9587d26e Merge pull request #262 from rish9101/remove_alarm
Port the fauxserver changes to afl-cmplog and code format
2020-03-19 17:01:57 +01:00
0e1d82dd9f describe branches setup in README 2020-03-19 15:27:12 +01:00
be261b3e69 moved repository to https://github.com/AFLplusplus/AFLplusplus and updated links 2020-03-19 15:20:39 +01:00
f6847b0314 test.sh: replace 'which' with 'type' 2020-03-19 00:19:25 +01:00
eca6bdb85d afl-cmin: replace 'which' with 'type' 2020-03-19 00:15:48 +01:00
a3bd1c71ca Makefiles: replace 'which' with 'type' 2020-03-18 23:51:54 +01:00
b19039ba8b Merge branch 'master' of https://github.com/vanhauser-thc/AFLplusplus 2020-03-18 22:56:19 +01:00
94a4cc8415 Makefiles: prefer POSIX 'type' over 'which' for checking 2020-03-18 22:55:14 +01:00
2e4fda6d4c fix #261 2020-03-18 21:18:55 +01:00
cd7e234445 try to fix regression due to rtn cmplog 2020-03-18 21:07:31 +01:00
a5e747af14 rework docs installation 2020-03-18 17:26:21 +01:00
5060861545 qemu_mode/libcompcov/Makefile install: fix installation of README 2020-03-18 16:26:54 +01:00
992cf3dd25 libtokencap Makefile install: forgot -T for README 2020-03-18 16:23:54 +01:00
1dee73cdde libtokencap: install correct README without name collision 2020-03-18 16:19:14 +01:00
3aa7242925 added mmopt power schedule 2020-03-17 21:42:36 +01:00
4009f3a987 fix reading env vars in afl-fuzz 2020-03-17 21:02:06 +01:00
cfd451c6f3 cmplog was neither quiet nor where its llvm passes installed 2020-03-17 16:26:51 +01:00
8e07fbf636 cmplog was neither quiet nor where its llvm passes installed 2020-03-17 16:26:36 +01:00
dae249dc71 minor fix to qemu_persistent_hook example 2020-03-17 16:10:34 +01:00
e194acdd79 PR #257 from chibinz, enhance afl-whatsup, (adapted for portability) 2020-03-17 14:26:08 +01:00
287d430fcf better explain AFL_QEMU_DEBUG_MAPS 2020-03-17 12:37:20 +01:00
d1d2fceed8 Port the fauxserver changes to afl-cmplog and code format 2020-03-17 15:19:24 +05:30
8cc39a3590 fix link in readme 2020-03-17 09:01:55 +01:00
a57896a7ce fixed segfault on early bailout 2020-03-17 00:00:36 +01:00
35720304be not all opt are compiled with polly support 2020-03-16 20:10:42 +01:00
09b2565b1b fix broken MOpt mode that was broken by Dominiks no-global patch :p 2020-03-16 20:09:46 +01:00
5b9335be10 fix compilation for Darwin/MacOSX 2020-03-16 14:04:21 +01:00
9ce0617cda fix for instrim with and without AFL_LLVM_INSTRIM_SKIPSINGLEBLOCK 2020-03-16 07:28:31 +01:00
61ba214f19 print a completed UI screen on exit without bugs :) 2020-03-15 22:51:22 +01:00
bfe076748b fix test failure with qemu compcov 2020-03-15 21:42:04 +01:00
070412b9c1 Merge pull request #259 from devnexen/afl_globals_little_tweaks
Just compute the current len on env comparison once.
2020-03-15 20:03:27 +01:00
ccb21a745d Just compute the current len once.
Fix env var types assignments.
2020-03-15 18:57:18 +00:00
87599de782 fix errors in last commit (u8)afl_get_env 2020-03-15 19:39:03 +01:00
126d1f1cd1 Move afl-fuzz related env variables into afl_state_t (#252)
* Move afl-fuzz related env variables into afl_state_t

* Move the env variables assignment from fuzz_init and code Format

* Fix typo

* Remove redundant env variables from afl_env struct

* Rename function to read_afl_environment
2020-03-15 18:29:23 +01:00
7685893cdb fix afl-fuzz-document 2020-03-15 17:09:52 +01:00
f9f163e48f fix afl-fuzz-document 2020-03-15 17:07:06 +01:00
15ba6249fc fauxserver 2020-03-15 17:02:48 +01:00
f3799f94bf fix compiler warning on MacOS 2020-03-14 16:40:05 +01:00
e77c431582 fix compilation under FreeBSD: ugly name clash of LIST_FOREACH (FreeBSDs fault) 2020-03-14 13:21:39 +01:00
338daa1282 Merge branch 'master' of https://github.com/vanhauser-thc/AFLplusplus 2020-03-14 11:45:25 +01:00
c616fcafe8 fix some compiler warnings from Open/FreeBSD 2020-03-14 11:44:21 +01:00
08fe1e2cd7 afl-common.c: fix my error: argv is a copy (ck_alloc based)
Now unicorn_mode works with ASAN_BUILD and _WANT_ORIGINAL_AFL_ALLOC
and DEBUG_BUILD also.
2020-03-13 20:37:39 +01:00
746a2a0ed0 afl-fuzz-init.c, afl-fuzz.c: fix more wrong free() calls (found with
ASAN_BUILD=1 CFLAGS="-D_WANT_ORIGINAL_AFL_ALLOC -DDEBUG_BUILD")
2020-03-13 17:23:23 +01:00
d2787519e3 afl-common.c: ... but that breaks unicorn_mode, which it should not. 2020-03-13 10:06:02 +01:00
23d0cea3c9 afl-common.c: avoid AFL++'s allocation API for libc's argv[] and reduce
complexity for cwd
2020-03-13 01:21:07 +01:00
530bd2b341 test.sh: make afl-cmin.bash test dependent on bash 2020-03-12 22:52:20 +01:00
8adc2648f8 fix afl-common.c for *BSD 2020-03-12 21:43:53 +01:00
0c45918d54 Fixed typo (#253) 2020-03-11 22:53:50 +01:00
288432843b updated README, ideas and a missing clean in Makefile 2020-03-11 12:03:44 +01:00
684f4dd1c4 honor afl_quiet on env var checks + code-format 2020-03-11 11:42:57 +01:00
d8d89507b5 afl-cmin delete output directory when aborted 2020-03-11 11:25:58 +01:00
f1ef398909 remove wrong call to write_to_file when aborted by user 2020-03-11 11:11:22 +01:00
66e8faaaa9 Fix typo (#247) 2020-03-11 00:48:52 +01:00
f17a3dde1a Replace timer with select in forkserver, where possible (#246) 2020-03-11 00:34:51 +01:00
88ced831c1 forkserver defaults 2020-03-10 22:56:26 +01:00
cc1d6b33b1 unified pointer placement 2020-03-10 22:04:05 +01:00
2832cb643d removed debug output 2020-03-10 16:27:28 +01:00
cd377f3d99 Replace alarms with select and threads (#243)
* Use select to monitor forkserver for timeouts instead of alarm

* Remove redundent conditons in select monitoring of fdsin forkserver and cmplog

* Replace SIGALARM with POSIX timers in afl-fuzz-run

* Make changes to Makefile to use POSIX timers

* Resolve Merge Conflicts and rename variables accordingly

* Change forkserver and cmplog to handle exec_tmout = 0

* Handle timeout function bug rectify

* Add error handling to afl-fuzz run timers

* Add timer_delete to afl-fuzz-run

* Remove memory leaks
2020-03-10 13:07:29 +01:00
0def6e3471 this should fix travis 2020-03-10 07:18:23 +01:00
1148a2d0d1 document new environment variables and code format 2020-03-10 07:14:42 +01:00
38d9aedb26 code-format - and afl-cmin/afl-showmap was fixed in the bugfix for afl-tmin 2020-03-10 06:54:31 +01:00
1467776a3f imported InsTrim algo fix 2020-03-10 06:47:11 +01:00
f678731234 afl-tmin is fixed via default initialization in forkserver 2020-03-10 06:44:24 +01:00
e04d2a6efa removed unused vars 2020-03-09 21:58:39 +01:00
1136e887bd now wiht 90% less leaks 2020-03-09 21:34:11 +01:00
416020daef quickfix for first big bug that use_stdin was not correctly initialized and could not be set 2020-03-09 19:42:23 +01:00
73a1b39446 quickfix for first big bug that use_stdin was not correctly initialized and could not be set 2020-03-09 19:40:59 +01:00
253bbf3a5c replaced free with ck_free 2020-03-09 19:36:02 +01:00
782cffb130 fixed numerous leaks 2020-03-09 19:30:26 +01:00
a24352ddfd fix leaks 2020-03-09 15:52:14 +01:00
2f41663673 copyleft note 2020-03-09 14:43:40 +01:00
cdd1dd3d20 changelog 2020-03-09 14:37:34 +01:00
dea1dbfba4 updated changelog and todo 2020-03-09 12:33:06 +01:00
988a32ced5 code-format 2020-03-09 12:21:54 +01:00
188a6f5ec5 disable leaksanitizer when "make" ... more 2020-03-09 12:17:59 +01:00
aa4050d406 disable leaksanitizer when "make" 2020-03-09 12:04:35 +01:00
581097d58d expanded test-instr to also work with input files via "-f @@" and changed the test.sh values 2020-03-09 11:39:12 +01:00
dba3595c0a AFL without globals (#220)
* moved globals to afl, shm and fsrv 

* moved argv to afl state, less bugs

* fixed unicorn docu

* lists everywhere

* merged custom mutators

* fixed leaks in afl-fuzz
2020-03-09 11:24:10 +01:00
c159b872ef removed warning in afl-gcc-pass.so.cc 2020-03-09 11:23:29 +01:00
df74edeb45 more honoring be_quiet 2020-03-09 11:08:50 +01:00
dcf7d85cba honor no_quiet for missing llvm_mode output, also print to stderr with afl-*-rt.o.c instead of stdout for errors plus two potential bad free() fixes 2020-03-09 10:56:53 +01:00
8e953d9931 Merge pull request #240 from rish9101/refactor
Remove get_cut_time function from multiple places and refactor code
2020-03-09 09:30:25 +01:00
9f89bbd5ec reactivated LTO persistent mode to test.sh 2020-03-09 08:51:37 +01:00
6a6dd84b39 more detail to the fact that LTO mode can fail easily 2020-03-09 08:33:08 +01:00
36ce9c1fb9 more code format 2020-03-09 08:30:28 +01:00
0581f6ec00 bug fixes to afl-ld and intensive README.lto.md update on errors and how to do the steps by hand, plus global code format 2020-03-09 08:27:23 +01:00
1a582d54e5 Remove get_cut_time function from multiple places and refactor code 2020-03-09 10:04:32 +05:30
a3161b902e fix null ptr deferef in pre_save python mutator call 2020-03-08 22:02:57 +01:00
783f3b0957 afl-ld fixes for -L/-l .a libary loads 2020-03-08 19:12:04 +01:00
8ff0161d58 "fixed" symbol multiply defined problems with LTO 2020-03-08 18:20:28 +01:00
9f7bcca91e mark AFL_PYTHON_ONLY deprecated 2020-03-08 16:56:44 +01:00
891f6985ed Merge pull request #238 from h1994st/master
Two new hooks for the custom mutator
2020-03-08 12:38:01 +01:00
98ffef26dc Merge pull request #239 from 0x1eadbead/fix-qemu-32-on-64
fix qemu persistent mode for 32-bit target on 64-bit host
2020-03-08 11:50:44 +01:00
81179b4829 fix qemu persistent mode for 32-bit target on 64-bit host 2020-03-08 13:39:06 +03:00
e7bc3e09a3 Update .gitignore 2020-03-07 16:30:31 -05:00
8f93cf5c55 Add two new hooks for the custom mutator
- `afl_custom_queue_get` and `afl_custom_queue_new_entry`
- Update the corresponding document and examples
2020-03-07 16:28:48 -05:00
dc0b2dda5e Merge branch 'master' of https://github.com/vanhauser-thc/AFLplusplus 2020-03-07 10:29:14 -05:00
ed5d65b54f solve linking error when python is not available 2020-03-07 14:26:33 +01:00
172d384bf2 custom havoc mutation 2020-03-07 12:11:06 +01:00
1e30c3a941 afl-tmin hang mode added 2020-03-07 03:40:42 +01:00
a10a3f2fa7 Merge branch 'master' of https://github.com/vanhauser-thc/AFLplusplus 2020-03-06 16:28:26 -05:00
2287534ec6 Merge branch 'master' of github.com:vanhauser-thc/AFLplusplus 2020-03-06 21:23:54 +01:00
27d6d35893 small fix to run cmplog binaries outside afl-fuzz 2020-03-06 21:23:47 +01:00
13429d204d adapt child handling to nawk from *BSD 2020-03-06 20:57:28 +01:00
0d4f2da8db terminate afl-cmin early when signalled SIGINT 2020-03-06 19:33:02 +01:00
47fdbf3817 Merge pull request #235 from antonio-morales/patch-1
Fixing 2 little mistakes
2020-03-06 16:53:10 +01:00
1d4a3c87f5 cmplog routines instrumentation for qemu mode on x86 2020-03-06 16:43:18 +01:00
c18f6c2618 Fixing 2 little mistakes
This example doesn't compile due to two little errors:
- There is a missing semicolon
- "data" array doesn't exist. I think "buf" should be used instead.
2020-03-06 16:09:43 +01:00
6e8f249b20 fix #227 2020-03-05 20:43:28 +01:00
3ac568c40c Fix leaks when stopping afl (#228) 2020-03-05 20:23:04 +01:00
90409f383a added AFL_QUIET - be_quiet to afl-showmap and small changes to test.sh 2020-03-05 11:36:37 +01:00
cc72f5dfd0 clarify -N option 2020-03-05 11:04:55 +01:00
6d620f5e0c fix travis 2020-03-05 11:03:36 +01:00
9d686ba523 Add LTO collision free llvm_mode (#223)
* first new implementation, only works with AFL_DONT_OPTIMIZE

* bug hunting

* interim commit

* finalized LTO non-collision solution

* update documentation

* merge resulted in some problems, fixing these

* added lto env to env check

* fixed llvm weirdness to messes up our instrumentation due CFG rewrite optimizations

* all llvm instrumentation issues have been resolved! :-)

* llvm 9 is required (so far)

* update lto readme
2020-03-05 10:52:26 +01:00
9e5c4973eb Fix variable name 2020-03-04 14:58:29 -05:00
70a67ca67d fix null ptr deref before trim_case_custom call 2020-03-04 19:28:29 +01:00
e43473faef Merge pull request #221 from h1994st/master
Uniform Python and custom mutator API
2020-03-04 18:38:03 +01:00
38e7dd2b9e Update examples of the custom mutator
- Merge `examples/python_mutators` into `examples/custom_mutators`
- Remove `examples/python_mutators`
- Update existing examples to demonstrate new APIs
2020-03-04 01:09:37 -05:00
42ce48db39 Fix typo 2020-03-03 23:18:47 -05:00
445d4b7e59 Update the documents of the custom mutator
- Merge python_mutators.md into custom_mutator.md
- Remove python_mutators.md
2020-03-03 23:17:24 -05:00
05a3418f86 added __afl_final_loc to all compile RTs 2020-03-04 01:51:41 +01:00
df46521658 Finish refactoring APIs for the custom mutator and Python module
- Remove AFL_PYTHON_ONLY (env) and python_only (variable)
- Unify fuzz API of the custom mutator and Python module
- Merge the custom mutator into the old python_stage, which is now renamed to custom_mutator_stage
2020-03-03 19:48:13 -05:00
d559d5a374 fix prev commit 2020-03-03 11:15:07 +01:00
469b8ee022 Merge branch 'master' of github.com:vanhauser-thc/AFLplusplus 2020-03-03 11:07:49 +01:00
385f7da77f allow custom cflags on llvm makefile 2020-03-03 11:07:41 +01:00
90506479e7 Refactoring fuzz_py API 2020-03-02 21:30:10 -05:00
b2a2b0fc21 Add initialization funcation wrapper for Python mutator 2020-03-02 19:30:05 -05:00
7862416844 Uniform API for both Python and custom mutator 2020-03-02 19:29:41 -05:00
031946136b Merge branch 'master' of https://github.com/vanhauser-thc/AFLplusplus 2020-03-02 15:27:31 -05:00
7b59e05600 Add new APIs for the custom mutator 2020-03-02 15:27:29 -05:00
f6050ab804 Silenced output of if python not found 2020-03-02 16:12:12 +01:00
43e97a5aa2 Autoresume added to help 2020-03-02 16:10:08 +01:00
f0cf9c2cdf make afl-showmap quiet when called from afl-cmin* 2020-03-01 22:30:38 +01:00
3e0a3ec45f migrated autoresume to use get_afl_env 2020-03-01 14:09:21 +01:00
6865cd8d69 Added AFL_AUTORESUME option 2020-03-01 13:47:33 +01:00
59b80cb01e fix #218 for GCC plugin 2020-03-01 11:51:15 +01:00
d946be29b9 fix #218 2020-03-01 11:16:43 +01:00
95322c11d9 print OKF if an environment variable is successfully loaded - feebdack to this please ... 2020-02-29 20:49:16 +01:00
76ca6adbc5 afl-clang-fast: only show the official env vars 2020-02-29 15:12:27 +01:00
45aa579f68 Added missing dependency to the docu (#216)
* Added missing dependency to the documentation. Tested on Debian 10

* Added documentation for Debian users

Co-authored-by: adamgrimm99 <55899195+adamgrimm99@users.noreply.github.com>
2020-02-29 14:42:19 +01:00
9ddd7e0e3f wget is no longer necessary for unicornafl which is cloned now. (#217) 2020-02-29 14:39:29 +01:00
6730b6a15a code-format, env.md fixes and adding -hh for env usage display into afl-fuzz and Makefile 2020-02-29 14:23:44 +01:00
6e08be1d0b add env info to afl-fuzz (please review!), small clarifications in docs/env_variables.md 2020-02-28 22:02:55 +01:00
0b21441590 add env info to afl-gcc-fast 2020-02-28 19:50:07 +01:00
449a14d1d0 more examples for README and custom_mutator README 2020-02-28 14:07:38 +01:00
57495a794d updated contribution info 2020-02-28 10:23:23 +01:00
7d0ae2939d update todo 2020-02-28 07:07:27 +01:00
7fa289316a fix for qemu_mode where capstone 4.0+ is installed 2020-02-28 06:50:15 +01:00
0e8388d3ea add env info to afl-clang-fast, small Android change 2020-02-28 05:00:22 +01:00
caa8fea8e2 add env info to afl-showmap, in qemu_mode add forgotten MacOSX env var to afl-analyze, afl-fuzz, afl-tmin 2020-02-28 03:31:50 +01:00
212e5d1a72 v2.62d 2020-02-28 01:16:36 +01:00
713952b9c7 v2.62c 2020-02-28 01:13:28 +01:00
20b8fc075b v2.62c 2020-02-28 01:12:44 +01:00
fc77f0bb96 i am too tired :-( 2020-02-28 01:02:21 +01:00
2eb7d0d88c update ideas 2020-02-28 00:55:44 +01:00
41493b1e3f cmplog_shm shmat was missing result check 2020-02-28 00:41:56 +01:00
f526bb2ecb better alloc-inl.h 2020-02-28 00:35:59 +01:00
4e37e12c06 code-format 2020-02-28 00:19:36 +01:00
d83ab141f6 cpyright 2020-02-27 23:22:29 +01:00
11236dd545 restore alloc-inl from AFL 2020-02-27 21:11:45 +01:00
bf8a154bec perf-fuzz idea 2020-02-27 20:58:30 +01:00
2b9ecd6eec Merge branch 'master' of github.com:vanhauser-thc/AFLplusplus 2020-02-27 16:04:20 +01:00
3712a70115 bye bye SanCov for CmpLog 2020-02-27 16:04:07 +01:00
e4f01a6825 Merge pull request #213 from Kusoku/master
Fix hanging fork and child with -V -E
2020-02-27 10:52:57 +01:00
3549cbb3a2 Fix hanging fork and child with -V -E
If we let multiple fuzzers end with -V or -E option, it will cause it to think we are still occupying the cores, even if they are free, once we try to run another job it would return an error that no free nodes are available.

This change fixes that problem.
2020-02-27 00:09:26 +01:00
7c17697cae catch if shmat fails 2020-02-26 22:35:09 +01:00
0e1d306b2e beautifying man pages 2020-02-25 21:58:17 +01:00
70c208ead7 Merge branch 'master' of https://github.com/vanhauser-thc/AFLplusplus 2020-02-25 21:42:30 +01:00
2d25662b81 man page tuning 2020-02-25 21:41:31 +01:00
e12edca29a Merge branch 'master' of github.com:vanhauser-thc/AFLplusplus 2020-02-25 21:24:43 +01:00
7e0663e4e0 fix #212 2020-02-25 21:24:31 +01:00
4bd736e1a7 more env info for afl-plot and afl-analyze 2020-02-25 20:54:08 +01:00
d39830a4dc portability: replace GNU extension of date (-I) with posix "+%y-%m-%d" 2020-02-25 20:31:08 +01:00
d7c9f947ed disable arm64 travis because they are buggy 2020-02-25 17:49:39 +01:00
84426631b4 update docker info 2020-02-25 16:30:22 +01:00
2c9c2e139e afl-gcc change -> test.sh 2020-02-25 14:01:55 +01:00
a540bae7a9 left over README reference fix 2020-02-25 08:43:49 +01:00
891b568678 fix references to README docs 2020-02-25 08:34:44 +01:00
901360b902 sync afl-as setup with afl-llvm-rt (add __afl_area_ptr[0] = 1) 2020-02-24 23:19:56 +01:00
c8295e1485 add env info to afl-tmin 2020-02-24 22:23:51 +01:00
9cc8ebd351 2.61d init 2020-02-24 17:26:02 +01:00
3f6bfbd981 v2.61c 2020-02-24 17:24:06 +01:00
6fece5525e workaround for travis bug 2020-02-24 13:27:13 +01:00
28b43ab137 important InsTrim bugfix! 2020-02-24 03:03:53 +01:00
f807d7cefb important InsTrim fixes! 2020-02-24 02:45:17 +01:00
f240c5381a fix -m32 on arm (-> -m32be), make 64 bit version explicit (do not assume 64 bit as default) 2020-02-23 22:03:51 +01:00
32281ddcb0 fix -m32 on arm 32 bit (is -m32be). make 32 and 64 bit varaints optional 2020-02-23 12:40:05 +01:00
d23d44a3d5 fix stupid gcc compiler warnings on arm32 (specified size 4294967284 exceeds maximum object size 2147483647) 2020-02-23 09:54:07 +01:00
dd4c260488 packages at readme (#209)
* packages at readme
2020-02-22 22:01:50 +01:00
524d792308 fix travis weirdness - hopefully 2020-02-22 20:48:36 +01:00
649a0124d6 readme update 2020-02-22 19:43:41 +01:00
de4f88b4cb improve redqueen not looking in orig buf 2020-02-21 20:05:43 +01:00
00c1c26bf8 Merge branch 'master' of github.com:vanhauser-thc/AFLplusplus 2020-02-21 19:52:11 +01:00
f4e09634cc test compcov and persistent also on arm 2020-02-21 19:52:03 +01:00
eb05cb4d11 ooops, I forgot to merge thsi part :( 2020-02-21 19:51:19 +01:00
ec8e8cb51c no unnecessary warnings in test.sh 2020-02-21 18:10:50 +01:00
249cd2c766 fix oob flip_bit in mopt code 2020-02-21 17:51:38 +01:00
7323833888 block the usage of mopt with optionals mutators (redqueen/radamsa/etc...) 2020-02-21 16:50:06 +01:00
8904200d48 this should fix arm64 travis 2020-02-21 15:34:32 +01:00
7c6a8dc5fc more arm64 travis debug 2020-02-21 13:56:15 +01:00
8bf3093a52 travis arm64 debug for heiko 2020-02-21 13:15:49 +01:00
b2373220e5 libradamsa-test fix 2020-02-21 13:03:41 +01:00
ad79688c5f add env var descriptions for afl-cmin and afl-cmin.bash 2020-02-21 01:07:23 +01:00
50c28dbf92 Merge pull request #203 from RootUp/patch-2
Regular expression dictonary
2020-02-20 19:46:59 +01:00
7c8cb33848 GSOC <3 2020-02-20 19:40:39 +01:00
e5eb06c78b Update regexp.dict 2020-02-21 00:08:10 +05:30
d6623d4b65 gsoc2020 2020-02-20 18:32:29 +01:00
04e93d9e3b add AFL_DEBUG to docs/env 2020-02-20 12:54:24 +01:00
76e0381db8 remove AFL_QUIET from call to afl-showmap 2020-02-19 23:43:25 +01:00
d375b0e0a3 fix forkserver output (support AFL_QUIET) 2020-02-19 23:14:06 +01:00
97d34b52d7 Merge pull request #202 from vanhauser-thc/cmplog_routines
Cmplog routines for LLVM mode
2020-02-19 20:48:26 +01:00
0fce34ec16 merge afl-llvm-cmplog-rt into afl-llvm-rt 2020-02-19 20:45:45 +01:00
42af8ee059 afl-cmin bugfix if -o exists 2020-02-19 16:52:40 +01:00
ed4a70c618 fixed -A in afl-showmap 2020-02-19 16:02:54 +01:00
d49c4d641a fix test.sh 2020-02-19 12:34:50 +01:00
8263f3b171 debug travis 2020-02-19 12:23:59 +01:00
0b692faddd gcc-10 support 2020-02-19 12:20:09 +01:00
62b17844b9 test.sh AFL_ENTRYPOINT testcase 2020-02-19 11:57:29 +01:00
8a6544f7f9 document build options 2020-02-19 11:04:48 +01:00
9c1bef49e6 and make make work again 2020-02-19 10:53:38 +01:00
f9d7ad8e43 forgot cleanup 2020-02-19 10:52:44 +01:00
69898722cb fix travis and fix logic 2020-02-19 10:46:10 +01:00
687b357b2d isatty for all compilers + AFL_DEBUG 2020-02-19 09:53:46 +01:00
3beee6da77 Merge branch 'master' of https://github.com/vanhauser-thc/AFLplusplus 2020-02-19 02:13:50 +01:00
16a7e4ae68 fix deviations between afl-cmin.bash and afl-cmin (issue #168) 2020-02-19 02:09:24 +01:00
def4ad645c fix travis for asan 2020-02-18 23:22:36 +01:00
ecce840eca moved AFL_TMPDIR check further down and better error message 2020-02-18 21:41:28 +01:00
273e3aed10 allow -i - resume with AFL_TMPDIR 2020-02-18 21:09:44 +01:00
2a549d548a fuzzer wotking with rtn cmplog 2020-02-18 17:45:57 +01:00
a83691d662 fix insertion of __cmplog_rtn_hook 2020-02-18 15:27:35 +01:00
13296af491 skeleton for rtn cmplog 2020-02-18 15:05:17 +01:00
706718ca2e cmplog routines llvm pass 2020-02-18 14:52:28 +01:00
a971fc8f36 qemu: move compcov/cmplog helpers in tcg-runtime-inl 2020-02-18 11:38:16 +01:00
0a5929cc85 better -h for cmplog 2020-02-18 11:30:15 +01:00
2c24cb63a6 Merge branch 'master' of github.com:vanhauser-thc/AFLplusplus 2020-02-18 11:00:59 +01:00
9bdfb04691 asan options in test.sh 2020-02-18 11:00:51 +01:00
f4dc71bd85 make travis builds with ASAN enabled. 100% sure it will break. I know what you are doing travis!! 2020-02-18 10:58:28 +01:00
cdbb35d87e ASAN_BUILD makefile define 2020-02-18 10:53:37 +01:00
a32c671ac9 Merge branch 'master' of github.com:vanhauser-thc/AFLplusplus 2020-02-18 10:42:27 +01:00
528193e925 remove heap checks in alloc-inl.h 2020-02-18 10:42:19 +01:00
ac08a38db9 showmap: delete tmpfile on exit 2020-02-18 10:35:27 +01:00
3e20edf10e rearrange environment info for afl-gcc and -h 2020-02-17 23:51:01 +01:00
be5032f49e unset AFL_TMPDIR, since afl-fuzz does not cleanup the input file 2020-02-17 22:32:12 +01:00
8330e0e8ba fix issue #198 AFL_TMPDIR is ignored for file .cur_input 2020-02-17 22:29:17 +01:00
df55fb1f14 add descriptions of env variables to afl-gcc 2020-02-17 21:24:32 +01:00
d606018ddb qemu bsd elfload patch 2020-02-17 14:21:31 +01:00
20bcd4009b that env is not for the users, it is an internal env used to tell qemu that we want the cmplog shmem 2020-02-17 14:14:58 +01:00
d6d2a53087 little help on persistent mode crashes 2020-02-17 09:11:56 +01:00
55e90c0c36 code format 2020-02-17 08:26:26 +01:00
220804714b unsafe memory speed toggle 2020-02-17 08:25:27 +01:00
d41f413016 add description of environment variables used 2020-02-16 22:34:51 +01:00
0ad698ffbf add option -h and man page for afl-as 2020-02-16 21:56:40 +01:00
b670ba182e update TODO 2020-02-16 20:40:53 +01:00
e40415cf16 fix 2020-02-16 19:22:12 +01:00
204059c61a check for mistyped env vars 2020-02-16 18:16:10 +01:00
4cccdb89c0 fix for instrim (not the important one) 2020-02-16 16:45:30 +01:00
b98a5de39b new todo as requested by Marc 2020-02-16 14:35:51 +01:00
ef00ed6090 code format 2020-02-16 13:21:39 +01:00
8acd503526 Merge branch 'master' of github.com:vanhauser-thc/AFLplusplus 2020-02-16 13:19:36 +01:00
4bca8af499 make qemu patches more simple using helpers 2020-02-16 13:19:20 +01:00
4d7f39f819 Updates for UBSAN 2020-02-16 10:57:02 +01:00
37f865ab24 fix UBSAN handling, update docs 2020-02-16 10:44:53 +01:00
b133fa3b6e Merge pull request #196 from devnexen/colorization_stage_mem_leak
colorization stage mem leak fix proposal.
2020-02-15 17:23:25 +01:00
1e679e3cbd colorization stage mem leak fix proposal. 2020-02-15 16:18:49 +00:00
bd1acfd868 Merge branch 'master' of https://github.com/vanhauser-thc/AFLplusplus 2020-02-13 21:16:00 +01:00
24dcc5eb37 fix issue #194 more seriously 2020-02-13 21:06:09 +01:00
99b2adcbe2 solve #194 2020-02-13 20:37:00 +01:00
12df4c4af7 fix strncmp in tokencap 2020-02-13 20:07:48 +01:00
ed5a3e92ff Merge branch 'master' of github.com:vanhauser-thc/AFLplusplus 2020-02-13 20:04:59 +01:00
5c35f3dbd1 fix strncasecmp in tokencap 2020-02-13 20:04:50 +01:00
afb23f09cf argv fuzzing afl-fuzz-inl.h: apply patch from issue#195
@dpmdpm2: Thanks
2020-02-13 19:58:08 +01:00
5a114fd840 Merge branch 'master' of github.com:vanhauser-thc/AFLplusplus 2020-02-12 12:00:38 +01:00
9db58da8b7 fixed cmin 2020-02-12 11:59:10 +01:00
54bbddec60 just because I want to make the 1000th commit ;) 2020-02-11 21:40:05 +01:00
a1c54425f7 Merge branch 'master' of github.com:vanhauser-thc/AFLplusplus 2020-02-11 21:31:05 +01:00
e22ba031f5 AFL_ENTRYPOINT instruction granularity 2020-02-11 21:29:36 +01:00
08ad02d2b0 forgot to reenable the 2>/dev/null 2020-02-11 20:23:03 +01:00
1b758e4d6b compatibility for GNU make 4.3, which behaves different for
lines with '#' like in
 ifeq "$(shell echo '\#include <sys/ipc.h> ...
Now make v 4.3  wants
 ifeq "$(shell echo '#include <sys/ipc.h> ...
In order to get it working with all GNU makes, we use a make
variable for '#' called HASH
2020-02-11 20:15:01 +01:00
5571142e25 dictionary insert stage count bugfix 2020-02-11 11:32:20 +01:00
3b9ac30efa test.sh: make grep option '-a' optional. Use when supported 2020-02-10 21:52:17 +01:00
39be4cd80b fix pwndbg dumper for py2 2020-02-10 14:10:12 +01:00
16286e3e2f minor fixes to c examples 2020-02-10 14:07:12 +01:00
bf18987369 Merge branch 'master' of github.com:vanhauser-thc/AFLplusplus into unicorn 2020-02-10 00:19:25 +01:00
e19e06aba7 removed unused diffs 2020-02-10 00:19:12 +01:00
33c18c36db add 'e' code for version 2020-02-09 23:31:19 +01:00
1a589e2313 update docs 2020-02-09 23:29:15 +01:00
f64f226127 readme 2020-02-09 23:11:50 +01:00
f47d905225 more unset for test.sh 2020-02-09 13:03:55 +01:00
34a9419b89 readme fixes 2020-02-09 12:22:39 +01:00
1bb6e1911b readme 2020-02-09 11:46:43 +01:00
1dcc6b2e10 readme 2020-02-09 11:45:00 +01:00
a86f740995 typo 2020-02-09 11:31:34 +01:00
d84cd978d4 persistent readme 2020-02-09 11:27:49 +01:00
e2ef242898 fuzzer_stat eps is now overall not current, clang-format fixed to v8 2020-02-09 09:43:33 +01:00
49acc388dd update documentation 2020-02-09 09:29:56 +01:00
4e8941950c Merge pull request #192 from devnexen/libdislocator_fbsd_build_fix
libdislocator FreeBSD build fix. max_align_t had been define from the…
2020-02-08 18:14:32 +01:00
312732bdbe more portability for (solaris-based OpenIndiana) 2020-02-08 18:11:57 +01:00
e6685436d8 Merge branch 'master' of github.com:vanhauser-thc/AFLplusplus 2020-02-08 18:07:39 +01:00
5fa4f47bae persistent qemu mode arm/arm64 && compcov arm64 2020-02-08 18:07:31 +01:00
4dbb47feb1 libdislocator FreeBSD build fix. max_align_t had been define from the 12th release. 2020-02-08 16:05:35 +00:00
a93e11b797 first work for OpenIndiana (solaris flavor) 2020-02-08 16:50:37 +01:00
0aad26d85e add libpthread on NetBSD 2020-02-08 16:38:24 +01:00
585c3015a5 Merge branch 'master' of https://github.com/vanhauser-thc/AFLplusplus 2020-02-08 17:24:04 +01:00
b6209b3732 build fixes for FreeBSD 11 2020-02-08 17:23:45 +01:00
079f177cda persistent mode doc 2020-02-08 15:41:17 +01:00
ce49ba428b changes update 2020-02-08 13:45:25 +01:00
b5dae8e4f1 fix for md changes 2020-02-08 13:43:26 +01:00
0403f008e3 solve small error on building new qemu patches for not x86 targets 2020-02-08 12:14:00 +01:00
96b378d5ba markdown todo & changelog 2020-02-08 11:28:59 +01:00
ff0617f41e changelog & TODO 2020-02-08 11:19:03 +01:00
9ea498585c travis timeout reattempts :) 2020-02-08 10:14:48 +01:00
aa2cb66ea2 code format 2020-02-07 20:44:36 +01:00
420b1aa859 Merge branch 'master' of github.com:vanhauser-thc/AFLplusplus 2020-02-07 20:43:32 +01:00
f2f6be5e99 afl qemu persistent hook 2020-02-07 20:43:17 +01:00
e360726730 todo update 2020-02-07 19:41:48 +01:00
fd8fe4dd08 Merge branch 'master' of github.com:vanhauser-thc/AFLplusplus 2020-02-07 17:01:17 +01:00
1e10e452aa fix empty range bug in colorization 2020-02-07 17:00:11 +01:00
ea37d8cef9 redqueen auto extras 2020-02-07 16:04:43 +01:00
7734a9229e track afl-cmin test changes 2020-02-07 13:04:49 +01:00
ca35e57eac Merge pull request #188 from devnexen/unicord_mode_fbsd_build_fix
unicorn mode build fix for FreeBSD.
2020-02-07 11:02:49 +01:00
369b6d2f67 docker fix 2020-02-07 09:52:30 +01:00
0d8f70423a save input with high entropy after colorization 2020-02-06 22:35:14 +01:00
e5972efa41 cmplog for qemu mode 2020-02-06 21:43:50 +01:00
2c7fba0a9c unicorn mode build fix for FreeBSD. 2020-02-06 19:37:23 +00:00
1ece4bb7df unicorn readme enhancements 2020-02-06 17:12:59 +01:00
b219198576 made cmin testcase more complex and added cmin.bash 2020-02-06 15:50:01 +01:00
ff210e824b typos 2020-02-05 22:31:40 +01:00
95558a2965 small typo fixes 2020-02-05 22:28:52 +01:00
4bcea7b31f adapt to afl-cmin with forkserver_mode (and stdin) 2020-02-05 22:08:57 +01:00
1edc392194 afl-showmap fix 2020-02-05 17:33:02 +01:00
599f78a4bd afl-showmap -i with stdin 2020-02-04 20:14:36 +01:00
f772d49faf Back to single harness 2020-02-04 18:31:55 +01:00
5fa62e40b1 256 logo 2020-02-04 15:41:14 +01:00
ffdbe17037 256 logo 2020-02-04 15:40:07 +01:00
fb22ea6a66 added smaller image 2020-02-04 15:31:52 +01:00
c27ee355e4 crediting bunny author 2020-02-04 15:22:56 +01:00
035833cb39 added afl++ bunny 2020-02-04 15:21:41 +01:00
aa020d70c2 Ideas. 2020-02-04 14:19:42 +01:00
43b26ca188 remove duplicate check 2020-02-03 23:37:20 +01:00
7c506d2e9e python fix 2020-02-03 23:32:06 +01:00
b66543bb29 Merge branch 'master' of https://github.com/vanhauser-thc/AFLplusplus 2020-02-03 22:32:01 +01:00
0f25a2b434 small checks for -A and -i options 2020-02-03 22:31:36 +01:00
026b68c47b -A/-i not together 2020-02-03 21:29:38 +01:00
1775c8a6ff refixed python 3.8 2020-02-03 20:05:40 +01:00
3c8cf0c53f Revert "fixed build on python 3.8"
This reverts commit 9861213ad6.
2020-02-03 19:35:14 +01:00
acaf99cd05 Revert "Revert "adapt to new afl-ahowmap with forkserver mode""
This reverts commit e2f6114839.
2020-02-03 19:35:02 +01:00
e2f6114839 Revert "adapt to new afl-ahowmap with forkserver mode"
This reverts commit f676e5528a.
2020-02-03 19:34:01 +01:00
9861213ad6 fixed build on python 3.8 2020-02-03 19:29:53 +01:00
f676e5528a adapt to new afl-ahowmap with forkserver mode 2020-02-03 19:20:16 +01:00
118a81a5fe Merge pull request #186 from vanhauser-thc/ubsan
add AFL_USE_UBSAN
2020-02-03 17:30:44 +01:00
56bc55428f make travis happy 2020-02-03 17:26:54 +01:00
ef56122888 prefer python 3m 2020-02-03 16:32:26 +01:00
542bea37fb fix MDs 2020-02-03 16:10:16 +01:00
1d8e772f6c afl-showmap -i option added 2020-02-03 15:39:25 +01:00
0339e737f0 afl-showmap -i option added 2020-02-03 15:38:55 +01:00
a1e56fdbed merged mds 2020-02-03 15:13:57 +01:00
8908803532 moved txt to md (fleissarbeit) 2020-02-03 15:09:10 +01:00
13ac2cb125 s/experimental\//examples\/g 2020-02-03 14:13:09 +01:00
2fe7889912 move custom and pythoon mutators examples into examples/ 2020-02-03 13:11:10 +01:00
e2eedefc65 docs to md 2020-02-03 13:02:16 +01:00
fd03c64346 moar docs to markdown 2020-02-03 12:56:05 +01:00
fa877b573a add AFL_USE_UBSAN 2020-02-03 12:48:10 +01:00
63fe2977da Merge branch 'master' of github.com:vanhauser-thc/AFLplusplus 2020-02-03 12:46:01 +01:00
de2771d126 update a bit the doc 2020-02-03 12:45:53 +01:00
37bdda0464 Merge pull request #183 from domenukk/python3
Broader Python Support
2020-02-03 11:49:42 +01:00
b4d9d56af4 broader python support 2020-02-03 10:55:15 +01:00
9e4ebfd4f6 ideas 2020-02-03 09:18:41 +01:00
c7167190a6 debug 2020-02-01 23:27:15 +01:00
9e53ae7035 debug 2020-02-01 23:12:29 +01:00
3b8fe02080 debug 2020-02-01 23:03:14 +01:00
437efe795a adjust a bit readmes 2020-02-01 20:20:41 +01:00
2d7e3da2cd aligned libdislocator in readme 2020-02-01 20:16:33 +01:00
d2c4e60115 align to max_align_t 2020-02-01 20:11:32 +01:00
2b50f6e0f8 dislocator readme 2020-02-01 19:18:20 +01:00
214868777f changelog 2020-02-01 19:13:43 +01:00
4384008f81 AFL_ALIGNED_ALLOC in libdislocator 2020-02-01 19:12:26 +01:00
86a25e64cd skip persistent qemu test when SYS is not intel 2020-02-01 16:36:42 +01:00
677581bb0f hotfix 2020-01-31 19:07:13 +01:00
f2511a39ae Merge branch 'master' of github.com:vanhauser-thc/AFLplusplus 2020-01-31 18:49:26 +01:00
f5d4618702 stop the fuzzer if AFL_QEMU_PERSISTENT_ADDR is wrong 2020-01-31 18:49:22 +01:00
4094dcdf88 fixed qemu persistent mode test case :-) 2020-01-31 18:40:38 +01:00
3386ea2345 privilege escalation 2020-01-31 12:09:51 +01:00
e2618ab7c1 Merge pull request #179 from devnexen/cpu_binding_bsd_upd_proposal
fuzz init same fails and tries approach as Linux/Android.
2020-01-31 10:31:21 +01:00
9f584e8cd9 fuzz init same fails and tries approach as Linux/Android. 2020-01-31 08:40:07 +00:00
3b4920011b small fixes 2020-01-31 00:18:27 +01:00
e5f081586d changelog 2020-01-30 23:11:03 +01:00
0498d6fa89 fix links in readme 2020-01-30 23:00:54 +01:00
1e8ea984d7 moar llvm readme 2020-01-30 22:58:45 +01:00
19ebdf31b9 Merge pull request #178 from vanhauser-thc/CmpLog
Cmp log
2020-01-30 22:54:23 +01:00
6e9fce1c2d Merge branch 'master' into CmpLog 2020-01-30 22:52:27 +01:00
f07fc52cd0 stats screen for cmplog only 2020-01-30 22:49:31 +01:00
c8581050ff status custom/rq 2020-01-30 22:46:56 +01:00
b15cd4a82a cmplog check_binary 2020-01-30 22:43:04 +01:00
95a98fb3e8 cmplog runtime for LLVM 2020-01-30 22:40:09 +01:00
b050c11583 for partial functionality ignore the LLVMInsTrim build result 2020-01-30 21:50:57 +01:00
ceed66930e lower requirements for lower llvm/clang versions
3.7.1 works with the exception of InsTrim, 3.8.1 and above is ok
2020-01-30 21:32:08 +01:00
b13bb64c3b replace -maxdepth with posix -prune (portability) 2020-01-28 23:15:06 +01:00
bb88d98ff8 android: prefer bigcores 2020-01-28 19:23:04 +01:00
465033b04a bump llvm version 2020-01-28 11:00:51 +01:00
04d17ad56e Merge pull request #177 from devnexen/llvm_mode_req_upd
First tests with LLVM 11
2020-01-28 10:32:31 +01:00
d3dcc352da First tests with LLVM 11 2020-01-28 09:17:55 +00:00
83481f9460 update binary_fuzzing doc 2020-01-27 13:34:59 +01:00
9bf8f79496 Merge branch 'master' of github.com:vanhauser-thc/AFLplusplus 2020-01-27 13:30:11 +01:00
3823297958 Added persistent mode sample 2020-01-27 13:29:22 +01:00
17f0aad0f0 updated binary_fuzzing document 2020-01-27 13:06:00 +01:00
3374ada561 nearing afl-cmin perfection :-) 2020-01-27 11:48:49 +01:00
482697039b nearing afl-cmin perfection :-) 2020-01-27 11:47:39 +01:00
fa64c0d4a5 important fixes for afl-cmin 2020-01-27 10:40:13 +01:00
3561a1b775 dockerfile update 2020-01-27 00:19:59 +01:00
2c6847bfa0 added whitelist+blacklist to all llvm_mode passes 2020-01-25 16:11:42 +01:00
5d2330f04e nicer output for afl-system-config 2020-01-25 05:27:10 +01:00
6abe330303 afl-cmin more awk portability (mawk), add afl-cmin/afl-tmin tests
for non-x86 platforms
2020-01-24 20:58:15 +01:00
436873a19a show stderr on afl-cmin test.sh 2020-01-23 11:55:53 +01:00
e7c95ebf5a afl-cmin final touches 2020-01-23 10:15:33 +01:00
a58800b901 typo 2020-01-23 09:46:59 +01:00
8b17cac71c add socket_fuzz description 2020-01-23 09:46:07 +01:00
c490b9aa36 afl-cmin debugging is done now, so suppress stdout messages again (but not stderr) 2020-01-23 09:11:35 +01:00
7e7ab8f541 Update binaryonly_fuzzing.txt 2020-01-22 22:24:00 +01:00
c51f89b58e rectification of vanhauser's fix, made it a bit more robust,
enabled error output for travis debugging
2020-01-22 21:50:35 +01:00
9da167dffd fix for modern linux 2020-01-22 21:08:47 +01:00
ce0b9dae59 final step: rename afl-cmin to afl-cmin.bash and add a wrapper afl-cmin for afl-cmin.awk 2020-01-22 19:07:02 +01:00
7ce627c92e Oops, only this version works with FreeBSD, OpenBSD, NetBSD, MacOS, raspbian 2020-01-22 18:38:41 +01:00
44bf5bf262 Merge branch 'master' of https://github.com/vanhauser-thc/AFLplusplus 2020-01-22 09:28:28 +01:00
4fbcc37f84 awk version for portability, tested on linux and FreeBSD so far 2020-01-22 09:26:54 +01:00
fb221db8ae clarify gcc plugin test case result 2020-01-22 08:35:41 +01:00
8b92a40e19 c example now uses persistent mode 2020-01-22 02:08:30 +01:00
00d086f816 USE_TRACE_PC unnecessary, set env AFL_LLVM_USE_TRACE_PC instead 2020-01-21 12:53:36 +01:00
0d5a8f69e9 fixed Heiko's global search-replace :) 2020-01-20 19:21:44 +01:00
72058fdcbc another freebsd fix in test.sh 2020-01-20 12:56:55 +01:00
b8bad5a227 fix for getopt 2020-01-19 22:29:40 +01:00
274c8d7d3c add missing test program (oops) 2020-01-19 21:22:41 +01:00
f706e210ec add missing test cases for qemu_mode unsigaction library 2020-01-19 21:20:51 +01:00
e7770a7002 make exporting AFL_CC FreeBSD specific, since it seems to harm
the libradamsa test on travis/arm64
2020-01-19 12:25:32 +01:00
99fe0becd4 Merge pull request #174 from devnexen/reallocarray_API_bsd
libdislocator: reallocarray API introduction
2020-01-18 17:50:56 +01:00
0eec622155 Intel test taken from lto branch, extended (as in test.sh), and tested on RaspberryPi 2020-01-18 16:35:21 +01:00
08691fcc97 add forgotten stderr redirect 2020-01-18 16:58:20 +01:00
db5d501715 set AFL_CC for libradamsa test (needed on FreeBSD) 2020-01-18 16:46:14 +01:00
00b1d16ac6 more fixes for python checks 2020-01-18 16:28:13 +01:00
6b0950b03d fix some syntax errors regarding $(filter ...) 2020-01-18 16:13:57 +01:00
858b5da24e libdislocator: reallocarray API introduction 2020-01-18 14:47:22 +00:00
1ac31361ca as suggested, added a comment, why NetBSD needs a higher memory limit 2020-01-17 20:41:30 +01:00
b6c5974b37 format 2020-01-17 16:41:30 +01:00
f24135f1ed Merge branch 'master' of github.com:vanhauser-thc/AFLplusplus 2020-01-17 16:39:53 +01:00
55e9297202 first experiment cmplog 2020-01-17 16:39:05 +01:00
800d43b846 small change for march=native 2020-01-17 16:17:08 +01:00
cb23fe2aba increased default memory limit (200megs) on NetBSD (due to kernel bug), fixes the afl-tmin test 2020-01-17 16:06:43 +01:00
7c0704b30c use default memory limit for afl-tmin (again) in test.sh, fix it in afl-tmin 2020-01-17 16:01:44 +01:00
3671d7eb8a fixes for gcc 5.5 (does not understand -march=native) on NetBSD 2020-01-17 16:00:11 +01:00
bd58094dbc fix libradamsa Makefile typo 2020-01-16 13:38:04 +01:00
b5c19a58f6 fix for cc=clang and libradamsa optimization 2020-01-15 15:54:54 +01:00
d5dff8960c O3 is faster than Ofast ... duh ... 2020-01-15 12:00:25 +01:00
e673dc6dbe stronger afl-fuzz performance compilation 2020-01-15 10:23:28 +01:00
d1d5e7c02a blacklist function support for llvm_mode 2020-01-15 10:10:25 +01:00
a0e6b98ce8 persistent mode harness 2020-01-15 02:38:45 +01:00
d0ea8f8433 todo update 2020-01-14 14:45:55 +01:00
b0492ba642 Fixed description of unicorn harness.c 2020-01-14 13:58:36 +01:00
4b83b2696e fixed c harness 2020-01-13 23:56:36 +01:00
88d9fba4c7 C example added 2020-01-13 23:52:48 +01:00
7b02847cd6 renamed to unicornafl 2020-01-12 03:02:56 +01:00
f369bf6b80 Merge pull request #171 from devnexen/obsd_build_fix
experimental OpenBSD build fix
2020-01-11 16:13:36 +01:00
a6d6ac2413 experimental OpenBSD build fix 2020-01-11 14:00:48 +00:00
8a44b572fc try travis as root 2020-01-10 11:33:13 +01:00
781123a906 NetBSDs wc -l prints spaces before the number, so string test
failed -> use pattern matching with "case" instead.
2020-01-09 09:50:51 +01:00
553d9f5cfc Merge pull request #166 from devnexen/llvm_mode_avoid_instrinsics
llvm_mode little update proposal (avoid instrumenting llvm intrinsic functions).
2020-01-08 10:19:08 +01:00
1b1e630461 Merge pull request #167 from korniltsev/korniltsev/typo
fix typo in uncorn_mode/readme
2020-01-08 01:21:21 +01:00
9a9e92724f fix typo in uncorn_mode/readme 2020-01-08 02:35:36 +03:00
57204c7917 increase memory for afl-tmin test
needed by NetBSD
2020-01-07 23:19:55 +01:00
578b1f4b94 llvm ver display in afl-clang-fast 2020-01-07 21:44:55 +01:00
c7b4a729a9 llvm_mode little update proposal.
avoiding intrinsics generated by LLVM for the isntrumentation.
2020-01-07 16:30:45 +00:00
48171dc4ad update todo 2020-01-07 14:29:31 +01:00
da42afe32f undo bash -> sh change, remove some bash specific constructs.
(WIP: does not yet work with bourne shell)
2020-01-07 08:39:24 +01:00
f88910755b Merge branch 'master' of https://github.com/vanhauser-thc/AFLplusplus 2020-01-07 07:12:05 +01:00
d176c59ea2 remove bash dependency (not generally present on *BSD) 2020-01-07 07:11:05 +01:00
b2bee5c32a moar moar copyrights 2020-01-06 16:17:23 +01:00
2692ef788b moar copyright notes 2020-01-06 16:06:35 +01:00
69b4977036 2020 copyright note 2020-01-06 16:04:35 +01:00
b95cd8968d Merge branch 'master' of github.com:vanhauser-thc/AFLplusplus 2020-01-06 11:46:23 +01:00
67cbeeb395 added ++ to copyright notes 2020-01-06 11:46:14 +01:00
e7fc1ef49e minor fix for man page install 2020-01-06 10:05:33 +01:00
5fda7861fa test.sh honors LLVM_CONFIG 2020-01-05 16:22:50 +01:00
80705aca61 Typo in name 2020-01-03 07:46:21 +01:00
db2eb75205 Typos fixed 2020-01-02 17:41:18 +01:00
710566be93 remove unnecessary conditions 2020-01-02 10:51:14 +01:00
3827b912c7 compile fixes 2020-01-02 08:39:29 +01:00
345c1deb58 Merge pull request #161 from devnexen/libtokencap_mac_fix
libtokencap, fix mac os process map lookup.
2020-01-01 13:07:25 +01:00
3f2f232fc5 libtokencap, fix mac os process map lookup.
Incrementing base address for next iteration.
2020-01-01 10:59:57 +00:00
49c6f7245e typo 2019-12-31 13:23:15 +01:00
bfc33150f4 show correct python version and readme name 2019-12-31 13:21:13 +01:00
6dea693441 show correct python version and readme name 2019-12-31 13:19:47 +01:00
3b9517ae73 v2.60d and year 2020 init 2019-12-31 13:01:08 +01:00
842cd9dec3 final touches before 2.60 2019-12-31 12:52:10 +01:00
4b4effe343 Update README.md 2019-12-30 23:38:50 +01:00
c3bb0a3421 added testcases for afl-tmin and afl-cmin 2019-12-30 22:21:51 +01:00
878a80de7f critical bugfix for afl-tmin 2019-12-30 22:01:36 +01:00
f7e1397d98 Merge pull request #160 from devnexen/timingsafe_flavors_libtoken
libtokencap adding timingsafe* string comparators
2019-12-30 20:09:57 +01:00
e90fa623d9 libtokencap adding timingsafe* string comparators 2019-12-30 17:23:23 +00:00
9829c5eb95 really ensure that all .test files are removed after they are not needed anymore 2019-12-30 15:14:00 +01:00
3f23f40a56 makefile clean fix 2019-12-30 13:26:39 +01:00
cd2cae720b added AFL_AS_FORCE_INSTRUMENT env 2019-12-29 19:38:45 +01:00
65b4141cd3 make clean beautification 2019-12-28 19:04:05 +01:00
58c7a0f8fe Merge branch 'master' of github.com:vanhauser-thc/AFLplusplus 2019-12-28 18:22:15 +01:00
9a2f2f1ee9 remove docs when building qemu static 2019-12-28 15:56:29 +01:00
c983e2c5b1 code format 2019-12-28 11:42:06 +01:00
2eb88d31a4 Update README.md
fix some typos
2019-12-28 09:56:39 +01:00
0fb68cbbfa Merge pull request #156 from n0pFlux/master
Fixed memory leak in afl-fuzz-python.c - trim_case_python.
2019-12-27 20:50:04 +01:00
064cd3315c fix issue #155 AFL_LLVM_LAF_SPLIT_FLOATS breaks bogofilter
added some forgotten floating point comparison types
2019-12-27 20:13:00 +01:00
n0p
cc3bf762ec Fixed memory leak in afl-fuzz-python.c - trim_case_python. 2019-12-27 18:50:14 +01:00
29bbe0aebe Merge pull request #154 from devnexen/setsockopt_socket_fuzzing
socket fuzzing build warning fixes proposal / setsockopt no-op
2019-12-26 14:56:38 +01:00
33ce5829c3 socket fuzzing build warning fixes proposal / setsockopt no-op 2019-12-26 13:50:50 +01:00
a05bd3e477 code format 2019-12-25 10:42:23 +01:00
9ed4bfbca8 AFL_PRELOAD -> QEMU_SET_ENV for afl-fuzz,afl-showmap,afl-analyze,afl-tmin 2019-12-25 10:35:49 +01:00
67b6298895 qemu ld_preload support and added socket_fuzzing ld_preload library 2019-12-24 20:56:10 +01:00
3122790295 Merge pull request #152 from afflux/argvfuzz
argvfuzz preload for fuzzing binaries' argv
2019-12-24 20:16:39 +01:00
5aa089d1b2 argv_fuzzing: should also compile with AFL_NO_X86 2019-12-24 16:09:48 +01:00
b0a2160c3a be sure to have directories for install targets 2019-12-24 10:45:39 +01:00
4f343e791a restore llvm DebugInfo 2019-12-21 22:02:50 +01:00
7db87ec74b argvfuzz preload for fuzzing binaries' argv 2019-12-21 21:42:35 +01:00
8679f3d757 try to work with llvm < 3.7 2019-12-21 21:14:01 +01:00
65bafe7192 Merge pull request #150 from afflux/master
minor fix for llvm_mode build with non-standard paths
2019-12-21 21:09:19 +01:00
49b3c9e0a0 remove remainder of git submodule
commit 7028c9b59d only removed the
.gitmodules entry. this commit removes the corresponding directory, so
`git submodule status` won't fail anymore.
2019-12-21 17:49:39 +01:00
e244f85c0b use llvm-config from env for version check 2019-12-21 17:46:29 +01:00
cc151388a1 Merge pull request #148 from devnexen/make_distrib_non_linux_fix_proposal
On non Linux systems, (g)make distrib stops halfway
2019-12-20 18:15:07 +01:00
5f0a252fae On non Linux systems, (g)make distrib stops halfway
because of QEMU not supported.
Symplifying cores counting data gathering.
2019-12-20 16:37:48 +00:00
d8fb4a8e19 Merge branch 'master' of github.com:vanhauser-thc/AFLplusplus 2019-12-19 14:35:37 +01:00
5e53d337db split havoc/custom line in status screen 2019-12-19 14:35:26 +01:00
b91000fc9e llvm_mode for Android 2019-12-19 01:53:32 +01:00
ce3cd71dc0 Merge pull request #146 from domenukk/unmapping
Tidied up python examles and fixed bug in uc_afl_fuzz
2019-12-18 15:33:25 +01:00
c283487d94 removed debug print 2019-12-18 13:49:36 +01:00
fe74c68c42 afl_fuzz unmapping 2019-12-18 12:23:35 +01:00
a521bfdfd8 fix travis bug? 2019-12-18 11:58:25 +01:00
d7b6b810d1 fix potential make clean error 2019-12-18 11:50:59 +01:00
7028c9b59d remove git submodule 2019-12-18 11:23:04 +01:00
891f067051 v2.59d init 2019-12-18 11:22:18 +01:00
939721e2cb v2.59c release 2019-12-18 11:14:12 +01:00
6226e38451 beautified error log when -m32 is not available on unsigaction 2019-12-18 11:05:52 +01:00
64435284ce added Android PR from afl, left some ifdefs commented out though 2019-12-18 09:17:49 +01:00
cf70fe0c9e updated docs 2019-12-17 12:10:45 +01:00
7218afdd8e typo 2019-12-16 14:31:16 +01:00
0627336466 unicornafl readme & changelog 2019-12-16 11:18:59 +01:00
2b9ad9acb6 Merge pull request #138 from domenukk/unicornafl
Moved unicorn_mode to unicornafl
2019-12-16 10:47:50 +01:00
17d364c8a0 fix alloc_canary should not be on TLS. thread #0 malloc=a -> thread #1 free(a) results in a wringly detected canary mistmatch 2019-12-16 10:42:34 +01:00
6ccfc2df56 update unicorn submodule 2019-12-16 10:11:29 +01:00
26d27d9121 skip unicorn tests if cannot import unicornafl 2019-12-16 09:44:17 +01:00
7832daf969 update unicorn submodule 2019-12-16 09:05:46 +01:00
860bce8a80 Merge branch 'unicornafl' of https://github.com/domenukk/AFLplusplus into unicornafl 2019-12-16 09:05:08 +01:00
eb61134bed fixed unicorn deps for python2 2019-12-16 01:36:37 +01:00
c5d4e8d0c7 more prints, ignoring crashdumps 2019-12-16 00:32:33 +01:00
201287f60f Merge branch 'unicornafl' of https://github.com/domenukk/AFLplusplus into unicornafl 2019-12-15 22:47:09 +01:00
d0d0405676 latest unicornafl version 2019-12-15 22:46:57 +01:00
42f992303e re-update submodule 2019-12-15 22:43:14 +01:00
e79a4faf10 Revert "make travis happy"
This reverts commit fc1a52b1c6.
2019-12-15 22:25:06 +01:00
2863d6205b fix travis build errors (hopefully) 2019-12-15 22:04:00 +01:00
624f0da6c0 slight fix for llvm_mode Makefile 2019-12-15 21:42:30 +01:00
c3423d81d0 Merge pull request #140 from devnexen/llvm_mode_no_apple_build_fix
Concealing the no build test to apple devices.
2019-12-15 21:39:55 +01:00
fc1a52b1c6 make travis happy 2019-12-15 21:39:38 +01:00
05825a888e Fixes for unicorn testscases 2019-12-15 18:48:57 +01:00
bc6c5d6be2 QEMU_LD_PREFIX in readme for clarity 2019-12-15 15:06:44 +01:00
6bf9855342 solve typing error on QEMU with host arch i386 2019-12-15 14:17:54 +01:00
0db7b39e62 Updating llvm_unsupported policy 2019-12-15 12:44:21 +00:00
49c9b68e4e Moved unicorn_mode to unicornafl 2019-12-15 05:03:32 +01:00
d40b670388 solve #134 2019-12-12 22:18:52 +01:00
01f0af64da malloc_context_size=0 as default options for sanitizers to have faster malloc/free 2019-12-12 14:00:22 +01:00
31f7404272 fixes for FreeBSD: libtokencap, free cpu detection threshold 2019-12-10 11:00:39 +01:00
cb4a20ba6d fix libtokencap for OpenBSD 2019-12-10 09:12:20 +01:00
8c841a068a fix machine description for NetBSD 'amd64' 2019-12-10 07:43:19 +01:00
f3fb1d3411 avoid rebuilding libdislocator on every make 2019-12-10 07:33:53 +01:00
22452da2a7 fix libtokencap Makefile for NetBSD, add VPATH to avoid rebuilding
the lib on every make.
2019-12-10 07:23:58 +01:00
cd165b18f0 fix warn -> warning, no targets when prerequisites are not met 2019-12-10 06:50:02 +01:00
7515e1edb5 Merge branch 'master' of https://github.com/vanhauser-thc/AFLplusplus 2019-12-10 06:44:20 +01:00
a49384f23c undo ignoring errors for optional components 2019-12-10 06:41:05 +01:00
9b39900c30 Merge pull request #133 from RootUp/patch-1
Updating regexp.dict
2019-12-09 23:34:15 +01:00
8817c66e98 Update regexp.dict 2019-12-09 22:57:35 +05:30
2038f86016 documented llvm 10 support 2019-12-09 15:16:10 +01:00
b8b0ba004b fix tests on MacOS, radamsa test could not find an instrumented
binary.
2019-12-09 13:15:31 +01:00
41165c0e68 continue make targets 'distrib'i, 'binary-only' and 'clean', even
there was an error for optional actions like qemu_mode and
unicorn_mode
2019-12-09 12:25:40 +01:00
30e4e7340e on MacOS llvm is not installed by default, add a test for that. Before this fix
the make run proceeded, producing meaningless error messages.
2019-12-09 12:19:57 +01:00
aa95728c35 Merge pull request #131 from devnexen/ios_build_fix
IOS build fix.
2019-12-09 10:59:42 +01:00
b262c5478c support universal mach-o binaries 2019-12-07 11:42:26 +01:00
ef43a4f82e IOS build fix.
system call is disabled on this platform.
2019-12-06 18:43:15 +00:00
8bc0b646f0 more travis 2019-12-05 16:10:39 +01:00
65bee44d6d non-intel test.sh support 2019-12-05 15:59:01 +01:00
7d585059e7 test script changes for arm64 2019-12-05 15:41:25 +01:00
d08504a667 travis enhancement 2019-12-05 15:12:28 +01:00
08f2a35b9b Merge pull request #130 from devnexen/last_nit_before_rel
Suppress noisy little build compiler plugins warning on platforms != …
2019-12-05 15:00:33 +01:00
8e64b13bc0 travis changes ... travis you suck 2019-12-05 15:00:00 +01:00
983abf359c Suppress noisy little build compiler plugins warning on platforms != Linux 2019-12-05 13:05:17 +00:00
233112c9b6 Changelog beautification 2019-12-05 11:24:41 +01:00
37dbccb674 changelog 2019-12-05 10:38:56 +01:00
c8524ad363 show travis state in readme.md 2019-12-03 15:02:23 +01:00
30435ee1f5 python3 support - even better :) 2019-12-03 14:51:41 +01:00
ac322253ca shut up travis. seriously. 2019-12-03 14:39:59 +01:00
05bb4252bf travis, finally? please? 2019-12-03 14:25:39 +01:00
e5326e797e travis oh my travis ... sigh 2019-12-03 10:31:14 +01:00
ca203d413f code format 2019-12-03 10:21:35 +01:00
a1e5a2e607 Merge pull request #129 from devnexen/libdislocator_typo
libdislocator, typo fix.
2019-12-03 10:19:50 +01:00
674fbc39f8 python3.7 support for afl-fuzz py mutator 2019-12-03 10:11:39 +01:00
948a83ef9f libdislocator, typo fix. 2019-12-03 09:01:23 +00:00
2b0cfe1ab5 final touches 2019-12-03 01:45:01 +01:00
6b6aa23645 Merge pull request #127 from devnexen/llvm_mode_build_fix
LLVM 10 build fix proposal
2019-12-03 01:41:31 +01:00
4231c49839 Merge branch 'master' into llvm_mode_build_fix 2019-12-03 01:40:41 +01:00
ef2dc98773 maybe we can work with xcode? 2019-12-03 00:30:35 +01:00
984faca4e8 Merge pull request #128 from devnexen/libtokencap_dflybsd
Enable libtokencap on DragonFlyBSD
2019-12-02 22:02:53 +01:00
70ad97d739 Enable libtokencap on DragonFlyBSD 2019-12-02 21:00:37 +00:00
1ab2a0cce9 getting very close with travis 2019-12-02 17:48:17 +01:00
c19b6fb260 getting very close with travis 2019-12-02 17:33:09 +01:00
dbdd9dbbde getting very close with travis 2019-12-02 17:32:31 +01:00
a3416b1571 nearing final travis config 2019-12-02 17:07:34 +01:00
e12b71773d nearing final travis config 2019-12-02 17:05:40 +01:00
f576c87e3a further travis tweaking 2019-12-02 16:38:20 +01:00
c5e231a711 support gcc-4.x 2019-12-02 16:36:18 +01:00
57334a44c1 further travis tweaking 2019-12-02 16:31:04 +01:00
523859f37c further travis tweaking 2019-12-02 16:27:03 +01:00
0894f8cf7a further travis tweaking 2019-12-02 16:07:35 +01:00
d8234e58a4 further travis tweaking 2019-12-02 16:00:47 +01:00
f6a6df7279 new travis 2019-12-02 15:44:14 +01:00
b0d590fef4 LLVM 10 build fix proposal
c++14 is the minimum for this version, thus the hardcoded gnu++11
standard flag makes the build fails.
Missing header only for this version seemingly for the option.
2019-12-02 14:26:29 +00:00
f8bc9b54da added -N no_unlink option 2019-12-02 15:25:17 +01:00
60c8121c1d add code-format target to make help 2019-12-02 14:50:00 +01:00
124ec8d297 code format (contributors, do it!) 2019-12-02 14:34:21 +01:00
e9ed056913 libcompcov common cmp funcs from honggfuzz 2019-12-02 14:30:23 +01:00
99b0860835 tokencap now wraps common routines and uses RTLD_NEXT 2019-12-02 14:22:42 +01:00
25b435060c Merge pull request #125 from devnexen/libtokencap_memmem
libtokencap, simple optimised memmem implementation enough for this l…
2019-12-02 13:55:51 +01:00
ba1b04be1e fix of fix of fix in libdislocator 2019-12-02 13:34:32 +01:00
2ccf5323c2 increase time for radamsa test 2019-12-02 11:05:09 +01:00
891aadaaca Merge pull request #126 from devnexen/libdislocator_build_fix_andrea
fix old linux kernel/Andrea approach
2019-12-02 10:23:38 +01:00
2e07261f57 fix old linux kernel/Andrea approach 2019-12-02 07:29:35 +00:00
5178a0cbba libtokencap, simple optimised memmem implementation enough for this lib proposal 2019-12-01 16:00:44 +00:00
8d5fded4d8 Merge pull request #124 from devnexen/old_linux_libdislocator_build_fix
getrandom available only from GLIBC 2.25
2019-12-01 15:26:22 +01:00
8e85b9cbf3 getrandom available only from GLIBC 2.25 2019-12-01 06:16:24 +00:00
d4da9b805a Merge pull request #121 from devnexen/libdislocator_little_upd
libdislocator updates improvements proposal.
2019-11-30 14:48:16 +01:00
ae4f770dad Merge pull request #112 from devnexen/unicorn_mode_obsd
unicorn mode, parallel job cmd fix for openbsd
2019-11-30 14:37:56 +01:00
cbe38ff905 Merge pull request #120 from devnexen/py2_mod_build_fix
Python module build fix in exotic oses
2019-11-30 14:30:53 +01:00
9c2e27a026 Merge pull request #122 from bmwiedemann/date
Allow to override build date with SOURCE_DATE_EPOCH
2019-11-30 14:21:14 +01:00
644bdd220e Allow to override build date with SOURCE_DATE_EPOCH
in order to make builds reproducible.
See https://reproducible-builds.org/ for why this is good
and https://reproducible-builds.org/specs/source-date-epoch/
for the definition of this variable.

Note: This date call is designed to work with different flavors
of date (GNU, BSD and others).
2019-11-28 20:01:50 +01:00
93a9e2daf3 libdislocator updates improvements proposal.
- optional tls alloc_canary value.
- slight change of memory limit value checking.
2019-11-28 08:33:36 +00:00
b2896c79c6 env var to disable qemu caching 2019-11-27 17:02:43 +01:00
8c0d247126 qemu readme reserved va trick 2019-11-27 16:16:17 +01:00
39dc0cca37 Python module build fix in exotic oses 2019-11-26 09:10:39 +00:00
7f0fe3b7d2 Merge pull request #116 from geeksonsecurity/unicorn-build-error
Fix unicorn build error on macOS
2019-11-24 23:02:06 +01:00
2f209414ef Fix build error on macOS 2019-11-24 22:12:15 +01:00
ccb156c704 Merge pull request #114 from devnexen/cmp_plugin_create_constants_once
compiler plugins, just create const constants once.
2019-11-22 13:30:47 +01:00
8a2f2e1792 compiler plugins, just create const constants once. 2019-11-22 11:03:45 +00:00
79490e75be Merge pull request #113 from devnexen/empty_plot_values_when_exec_stop
the plot data does not generate proper gnuplot data
2019-11-20 15:04:44 +01:00
e8b576fb9f the plot data does not generate proper gnuplot data
when killed or for a defined amount of time.
2019-11-20 13:36:07 +00:00
d96b27b603 update documentation 2019-11-17 12:01:37 +01:00
c8d94e88a7 Merge pull request #109 from hac425xxx/qbdi_mode
Qbdi mode
2019-11-17 11:49:07 +01:00
f3a23e51fa . 2019-11-17 11:41:44 +01:00
7e022a09cc adjust qbdi mode 2019-11-17 11:39:21 +01:00
b6e51a5cd6 unicorn mode, parallel job cmd fix for openbsd 2019-11-17 10:12:15 +00:00
a8f6ce5475 fix wrong commit 2019-11-17 10:54:16 +01:00
c96efdcb36 not all CPUs understand ondemand 2019-11-17 10:51:56 +01:00
55ef73ed57 not all CPUs understand ondemand 2019-11-17 10:51:15 +01:00
4b3deaf28b not all CPUs know ondemand 2019-11-15 14:46:01 +01:00
d8264390d2 typos 2019-11-15 11:26:10 +01:00
0071e537f3 format code for demo-so.c and template.cpp 2019-11-14 14:38:04 +00:00
5efd936e1e add image 2019-11-14 14:32:36 +00:00
c8c004d568 modify build.sh and add document 2019-11-14 14:30:29 +00:00
a9972fe559 add notes about code style in contributing 2019-11-14 10:46:38 +01:00
1f7f9fa9ec Merge pull request #110 from k0ss/patch-1
Fix docker build
2019-11-14 09:11:59 +01:00
a9d0cad485 old gcc produces not so good code ... 2019-11-13 16:02:36 +01:00
f85b0d421a added instrumentation count test cases 2019-11-13 15:19:31 +01:00
88384c89f3 Added workdir
Last addition I swear.  Now you can just run, for example: `docker run --rm -v $PWD:/work -it aflplusplus:latest ./build_script_in_working_dir.sh'.  Had forgotten this but figured this would make things easier for folks.
2019-11-13 05:33:20 +00:00
22cfd595ef Shaved 600mB off resulting Docker image
By removing the build files after the build is complete, we save 600mB of unnecessary bulk.  The total image size will now be 1gB.
2019-11-13 03:42:39 +00:00
e235c02e1e Fix docker build
The docker build has never worked for me.  I fixed all the build errors, mostly due to missing dependencies.  I also fixed silent errors that would allow for the build to finish but wouldn't contain features such as python mutators or QEMU's unsigaction module.
2019-11-13 02:56:14 +00:00
02548197e8 radamsa bsd fix 2019-11-12 23:41:14 +01:00
c2ba6e4503 fix linking error with tls storage, WIP for inline (not working yet) 2019-11-12 23:16:00 +01:00
7f017aa724 enabled neverZero feature again 2019-11-12 23:12:14 +01:00
d51719fbd9 better do not rely on config info from gcc 2019-11-12 23:02:56 +01:00
1392a6dba7 install afl-fuzz-document if present 2019-11-12 11:30:36 +01:00
7413ca9589 finding libradamsa fix 2019-11-12 11:28:49 +01:00
2b1e56331d finding libradamsa fix 2019-11-12 11:24:58 +01:00
cc5e69816f upgraded radamsa to newest version 2019-11-12 11:17:31 +01:00
c59e07581d Merge pull request #107 from devnexen/gcc_plugin_pass_real_cmp_naming
gcc plugin little update proposal.
2019-11-12 10:31:49 +01:00
c15053d1f8 Merge pull request #108 from devnexen/radamsa_mutator_upd
libradamsa forgotten possible undefined symbol.
2019-11-12 10:27:41 +01:00
5939727b66 A bit of user awareness 2019-11-12 09:26:59 +00:00
3ceb679465 libradamsa forgotten possible undefined symbol.
Note: do not know if it should be upstreamed first or not though...
2019-11-12 09:24:16 +00:00
8f188194c1 gcc plugin little update proposal.
like its llvm counterpart, passing the compiler chain used
to avoid using necessarily AFL_CC/AFL_CXX.
2019-11-12 09:13:13 +00:00
760d4991f3 Android PR integration 2019-11-11 23:50:31 +01:00
613ab3ba2a changelog 2019-11-11 18:12:06 +01:00
9477967c54 link radasma doc 2019-11-11 16:55:41 +01:00
388f4ae302 Merge pull request #106 from vanhauser-thc/radamsa
Radamsa
2019-11-11 15:53:24 +01:00
f1fbea96f6 radamsa in readme 2019-11-11 15:51:21 +01:00
f0aaee2044 add test case 2019-11-11 15:23:14 +01:00
ac7d210b6b Makefile - add radamsa to targets 2019-11-11 15:06:48 +01:00
659db7e421 Merge branch 'master' into radamsa 2019-11-11 14:36:06 +01:00
cd84339bcc libradamsa dlopen 2019-11-11 14:32:50 +01:00
01d5537244 /sbin in path 2019-11-09 16:48:01 +01:00
ab8fb271f7 add support for android x86, x86-64 in qbdi mode 2019-11-09 15:18:24 +00:00
58a18ea50b not all sysctl are in /sbin, e.g. with busybox 2019-11-09 15:23:16 +01:00
574de9ff4c add basic supprt for qbdi_mode, test x86_64 Linux 2019-11-09 14:21:39 +00:00
9d8458bb6d Merge pull request #105 from devnexen/gcc_plugin_upd
gcc plugin llittle update proposal to match better LLVM's
2019-11-09 12:20:46 +01:00
b22145d0c4 gcc plugin llittle update proposal to match better LLVM's 2019-11-09 10:37:44 +00:00
99e623ef0b Merge pull request #104 from devnexen/test_linux_chg
test, /sbin not necessarily in the path os casual users.
2019-11-08 19:49:57 +01:00
7a20cc2f58 additional test, if afl-as is called by afl-gcc/afl-clang (seen in OpenIndiana) 2019-11-08 19:27:25 +01:00
8290bb3374 test, /sbin not necessarily in the path os casual users. 2019-11-08 13:46:08 +00:00
a3932d7f00 raise limit for free core detection on FreeBSD and dragonFlyBSD 2019-11-08 04:39:22 +01:00
8082dd43bc Merge pull request #103 from devnexen/libdislocator_sp
libdislocator, optional huge pages support.
2019-11-07 19:50:02 +01:00
642a756b66 Merge pull request #99 from devnexen/unicorn_mode_bsd
Unicorn mode for BSD proposal.
2019-11-07 19:48:14 +01:00
f6c44a83bc typo for the checksum 2019-11-07 15:06:48 +00:00
b92da08ae8 Taking in account last changes 2019-11-07 11:52:04 +00:00
499f078c37 f*ckin travis 2019-11-07 11:48:39 +01:00
92669e65ee we only do one vm for the testing. having 3 just gives headache 2019-11-07 10:38:16 +01:00
7b82ef22be Little tweks for BSD 2019-11-07 05:05:55 +00:00
3ce808688f Little additions from feedback 2019-11-07 04:58:18 +00:00
cc301c18d5 libdislocator, optional huge pages support. 2019-11-06 22:33:39 +00:00
db7c990346 even easier test case solving :) 2019-11-06 13:41:23 +01:00
7c99027c31 unicorn libcompcov testcase made easier 2019-11-06 13:31:58 +01:00
5cb0012c83 test travis 2019-11-06 13:08:07 +01:00
a09cfd57a4 Unicorn mode for BSD proposal.
Darwin fix
2019-11-06 04:46:49 +00:00
62d9729629 travis is drunk 2019-11-05 20:06:11 +01:00
ed16281737 mmmm travis doh 2019-11-05 19:48:17 +01:00
4d9a463297 Merge branch 'master' of github.com:vanhauser-thc/AFLplusplus 2019-11-05 18:41:35 +01:00
e13fdfb2ce reduce time for unicorn compcov test 2019-11-05 18:41:23 +01:00
73cb587266 test unicorn && AFL_DISABLE_TRIM env var 2019-11-05 18:39:16 +01:00
48388b9eaa Merge pull request #101 from devnexen/libtoken_catch_pid_before_all
catching current pid before library usage in case implementations rel…
2019-11-05 12:09:44 +01:00
61e46a636c catching current pid before library usage in case implementations rely on those string calls 2019-11-05 10:59:22 +00:00
dede2e9764 dockerfile additions 2019-11-05 09:16:04 +01:00
c9c7e4777e Merge pull request #100 from devnexen/docker
Basic docker build proposal.
2019-11-05 09:01:37 +01:00
67ae54c957 Using LLVM/GCC 9 tooling 2019-11-04 17:15:56 +00:00
14c359700b Basic docker build proposal. 2019-11-04 15:37:56 +00:00
c11b8883e0 Merge branch 'master' of github.com:vanhauser-thc/AFLplusplus 2019-11-04 15:46:59 +01:00
adae07d013 restored big-endian compcov in unicorn 2019-11-04 15:46:49 +01:00
1c7b6a5e05 travis 2019-11-04 13:10:52 +01:00
fbeba570e6 Merge branch 'master' of github.com:vanhauser-thc/AFLplusplus 2019-11-03 13:02:41 +01:00
c3b2fee074 Unicorn mode for BSD proposal.
Darwin fix
2019-11-01 14:45:03 +00:00
e2442f7471 Merge pull request #98 from devnexen/sub_readme_renaming
libtokencap/libdislocator README rename proposals
2019-10-31 17:15:56 +01:00
b33bb0943a libtokencap/libdislocator README rename proposals
and fixing the install tasks in the process.
2019-10-31 15:50:58 +00:00
58fe2f2c76 Merge branch 'master' of github.com:vanhauser-thc/AFLplusplus 2019-10-31 16:19:26 +01:00
664f603a31 better wine trace with winepath on .cur_input 2019-10-31 16:19:12 +01:00
b17afc10a2 travis update 2019-10-31 13:27:48 +01:00
74f7576313 travis update 2019-10-31 13:24:15 +01:00
e8d0ffa8b4 travis update 2019-10-31 12:56:59 +01:00
ceb2d99732 Merge pull request #97 from devnexen/llvm_mode_build_silent_warn
Fix some silent warnings and put some var to some usage...
2019-10-31 12:53:47 +01:00
822a3e505a travis update 2019-10-31 12:49:33 +01:00
7b0ab778e3 travis update 2019-10-31 12:46:55 +01:00
744910ad1b travis update 2019-10-31 12:43:51 +01:00
7fdc7e01a5 Fix some silent warnings and put some var to some usage... 2019-10-31 11:41:50 +00:00
c7c622377a travis debug 2019-10-31 12:25:20 +01:00
ae990ce8dc travis updates 2019-10-31 11:38:01 +01:00
7ab2e1d184 travis update 2019-10-31 11:29:22 +01:00
c21b78b297 travis updates 2019-10-31 11:24:47 +01:00
94a7102d3a travis updates 2019-10-31 11:21:41 +01:00
fce7a0c78c update travis 2019-10-31 11:17:18 +01:00
98b27d0c64 travis: added make tests 2019-10-31 11:01:00 +01:00
2d0b90b423 Merge pull request #96 from devnexen/llvm_mode_other_oses_llvm_cfg
LLVM mode passing the full path of the LLVM config bindir.
2019-10-31 10:53:05 +01:00
070ccae4dd Little tweaks 2019-10-31 09:25:43 +00:00
4620d31e2a travis 2019-10-31 10:10:15 +01:00
16953b5cfa LLVM mode passing the full path of the LLVM config bindir.
On FreeBSD the system compiler does not have llvm-config
however system packages provides several version of the
LLVM toolchain thus forcing to pass AFL_CC/AFL_CXX to make
it work fully.
2019-10-30 17:09:01 +00:00
cfccadcdc4 Merge pull request #95 from devnexen/gcc_plugin_tokencap
copying LLVM mode no builtins.
2019-10-29 16:44:35 +01:00
67533cf7c3 copying LLVM mode no builtins. 2019-10-29 15:35:54 +00:00
8a10f3f22f Merge pull request #94 from devnexen/libtokencap_upd
libtokencap update proposal
2019-10-29 16:16:54 +01:00
c87210820c libtokencap update proposal
- bcmp interception.
- FreeBSD using default argument to get current pid for the mapping
data gathering, getpid seems to cause some issues under certain
conditions (getenv call).
2019-10-29 15:06:20 +00:00
66791a5dad more radamsa optimization 2019-10-29 14:22:13 +01:00
ee9b2522a3 Merge pull request #93 from devnexen/few_warnings_fix_proposal_libtokencap
libtokencap, respect constness also considering pointer arithmetic
2019-10-29 12:04:50 +01:00
df5c7eef39 libtokencap, respect constness also considering pointer arithmetic
is non C standard, some compilers might not have GNU extensions.
2019-10-29 10:49:16 +00:00
ccbb0d37b3 removed warning 2019-10-29 10:44:57 +01:00
66f123fb66 Merge pull request #92 from devnexen/alloc_aligned_c11_libdislocator
adding aligned_alloc + little changes proposal for posix_memalign
2019-10-29 10:41:55 +01:00
87b599f4a8 adding aligned_alloc + little changes proposal for posix_memalign 2019-10-29 08:09:43 +00:00
6238df88a2 fixed warning and return 2019-10-28 22:36:29 +01:00
38d74f0ad5 second forgotten place, we need to filter out float vector types 2019-10-28 20:48:45 +01:00
25443918c4 silence some compiler warnings 2019-10-28 16:45:30 +01:00
8035968516 silence some compiler warnings 2019-10-28 16:32:26 +01:00
f9bf0bd90e Merge pull request #90 from devnexen/libtokencap_netbsd_fix
Fix proposal for libtokencap
2019-10-28 16:16:54 +01:00
0df37d0fa1 Merge pull request #91 from devnexen/posix_memalign_prop
memalign/posix_memalign proposal for libdislocator
2019-10-28 15:49:43 +01:00
fbb131da73 memalign/posix_memalign proposal for libdislocator 2019-10-28 14:44:28 +00:00
942f8d0ec9 Fix proposal for libtokencap
Avoiding fopen API seems buggy on NetBSD.
2019-10-28 11:01:37 +00:00
64fa11d204 updated changelog, afl-analyze AFL_SKIP_BIN_CHECK support 2019-10-28 11:52:31 +01:00
3ad5316dd1 fix issue #86, we exclude floating point vectors from splitting 2019-10-27 23:54:44 +01:00
f8e0e9ab1f updated todos 2019-10-27 11:35:40 +01:00
10af76a50c added a TODO item for posix_memalign wrapper 2019-10-27 08:12:01 +01:00
2fafb9f2fb Merge branch 'master' of https://github.com/vanhauser-thc/AFLplusplus 2019-10-27 07:29:07 +01:00
4de38fe40a docs update 2019-10-27 09:04:40 +01:00
74df3e2491 WIP for NetBSD port, iteration has an unknown problem causing a seg fault 2019-10-27 07:27:48 +01:00
8e41a59e2e Merge pull request #87 from devnexen/gcc_llvm_plugins_little_cjg
Little compiler plugins rework regarding block location picked up.
2019-10-26 17:31:01 +02:00
17729ce856 Merge pull request #89 from devnexen/dfbsd_porting
Porting cpu affinity to DragonFly.
2019-10-26 10:45:20 +02:00
cfd7b906cb Porting cpu affinity to DragonFly.
Thanks their API is very similar in this area.
2019-10-26 08:39:13 +01:00
a1f7de2bc3 Merge pull request #88 from domenukk/unicorn_nowarn
No Longer Warns for Absolute Binaries for Unicorn
2019-10-26 09:25:52 +02:00
f2b3f01759 make initial inputs names consistent with others using time:0 2019-10-26 09:24:09 +02:00
3eaf5560be AFL_LLVM_LAF_SPLIT_FLOATS 2019-10-26 09:03:46 +02:00
c66633ccc5 no longer warns on python as path for unicorn 2019-10-26 01:43:25 +02:00
a2f911dbb1 typo 2019-10-26 01:14:39 +02:00
060579b73a Merge branch 'master' of github.com:vanhauser-thc/AFLplusplus 2019-10-26 01:12:36 +02:00
09c26fed20 Merge branch 'master' of https://github.com/vanhauser-thc/AFLplusplus 2019-10-26 00:18:56 +02:00
3e9e7e1750 libtokencap ported to OpenBSD 2019-10-26 00:17:51 +02:00
94548d2284 float compcov readme 2019-10-25 20:12:24 +02:00
4ec4e5b394 floating point compcov 2019-10-25 20:04:16 +02:00
15c920a612 Little compiler plugins rework regarding block location picked up. 2019-10-25 14:40:04 +01:00
e7871b2c76 Merge branch 'master' of github.com:vanhauser-thc/AFLplusplus 2019-10-25 14:02:38 +02:00
644efa2905 remove redundand setenv of SHM_ENV_VAR 2019-10-25 14:02:30 +02:00
7e9b6fe0aa Update sister_projects.txt
status updates for python mutators and whitelist selective instrumentation feature.
2019-10-25 10:44:34 +02:00
b8abf27b86 Update README.md
remove Linux-only :-), list supported OSes
2019-10-25 09:36:17 +02:00
e0ff20dd37 cosmetics 2019-10-25 01:51:53 +02:00
0af42727f5 Merge pull request #84 from devnexen/libtokencap_darwin
Porting libtokencap to Darwin.
2019-10-24 23:32:03 +02:00
b0036759fa portability fix: use cc instead of gcc for test-compcov 2019-10-25 01:22:20 +02:00
b4b26d4207 FreeBSD implementation 2019-10-24 22:26:18 +01:00
cb7ada2e78 fix libtokencap test for Darwin 2019-10-24 22:32:37 +02:00
6e5143681c enhanced radamsa integration 2019-10-24 16:53:30 +02:00
8142422257 Porting libtokencap to Darwin.
Reading only main addresses and read only's.
2019-10-23 20:07:16 +01:00
0f03226656 Merge branch 'master' of github.com:vanhauser-thc/AFLplusplus 2019-10-23 19:48:26 +02:00
297e9e3cf5 move is_valid_addr in afl-qemu-common.h 2019-10-23 19:48:18 +02:00
39b7f48870 performance doc enhancements 2019-10-23 17:01:05 +02:00
b9bc81544a debugged and fixed libdislocator malfunction on MacOSX 2019-10-23 14:53:05 +02:00
7d9eed0ed5 no functional change, avoid conditional jump 2019-10-23 11:33:20 +02:00
1398d8d5a6 gcc sucks 2019-10-23 03:23:14 +02:00
6bc874088f readme update 2019-10-23 02:58:16 +02:00
3ec1baee65 gcc_plugin adaptions Makefile help, man page SYNOPSIS 2019-10-22 20:21:04 +02:00
374f661027 help output adjustment 2019-10-22 13:23:00 +02:00
7ab11c3da9 compile fix 2019-10-22 13:19:08 +02:00
cc2f3afdf8 sync llvm_mode/Makefile to gcc_plugin/Makefile 2019-10-21 23:53:56 +02:00
9a5882a290 sync afl-gcc-rt.o.c from its more current llvm cousin 2019-10-21 23:35:09 +02:00
a033364d55 implement neverZero counter for __afl_trace() 2019-10-21 23:07:05 +02:00
bc3ce26e0e -V/-E not precise 2019-10-21 17:18:41 +02:00
ebea44029e 2.58d 2019-10-21 11:30:28 +02:00
be6bc155eb v2.58c 2019-10-21 11:28:32 +02:00
d0bbef74ef loading dynamical libraries on Darwin/MacOSX is done with DYLD_INSERT_LIBRARIES 2019-10-20 02:35:06 +02:00
a282ae22af In OpenBSD initial thread local storage is allocated with calloc(),
which leads to locked mutexes and a stall. So no thread support
(and no tls) here.
2019-10-20 03:34:46 +02:00
c83e8e1e62 Remove lcamtuf's old email from Google (not valid anymore), also remove maintainance from him. 2019-10-19 18:23:01 +02:00
452ec28761 Merge pull request #82 from devnexen/darwin_gotcpu_portage
afl-gotcpu: porting to Darwin using mach API.
Thanks! Looks good!
2019-10-19 17:37:40 +02:00
8a78637719 add gcc_plugin to code formatter and run it 2019-10-19 16:19:46 +02:00
1fdb75068d afl-gotcpu: porting to Darwin using mach API. 2019-10-19 11:44:09 +01:00
230c135d4e typo in names 2019-10-18 22:43:30 +02:00
bf544af690 new entries for gcc_plugin 2019-10-18 21:21:17 +02:00
e7ab8be0cd sync afl-fast-gcc with afl-clang-fast, add tests for gcc_plugin 2019-10-18 19:53:10 +02:00
b1822f2602 reintegrate gcc_plugin 2019-10-18 18:01:33 +02:00
f4a74a3405 added test/test-performance.sh 2019-10-18 10:10:47 +02:00
73da639654 revert patch 2019-10-18 08:25:43 +02:00
f2a1456e94 needed increased unicorn test time 2019-10-17 11:31:12 +02:00
c75abda571 return instead of exit in test-instr 2019-10-17 09:30:50 +02:00
1aec670c43 add forgotten floating point comparisons in laf-intel/llvm_mode 2019-10-16 20:37:58 +02:00
77695d75bb test.sh check to see if qemu persistent mode is faster 2019-10-15 17:14:59 +02:00
3dec452a8a v2.57d 2019-10-15 16:50:48 +02:00
97f5ce52d1 v2.57c release 2019-10-15 16:48:05 +02:00
540de896e3 more time for test case 2019-10-14 11:08:25 +02:00
dcfccb2a0d reverse bytes compcov in unicorn 2019-10-13 13:03:06 +02:00
ac5b0a3b34 moar doc 2019-10-13 10:38:13 +02:00
8f854ee83a test for persistent qemu 2019-10-13 10:34:51 +02:00
bd312607a3 add afl-fuzz error capturing for qemu_mode and unicorn_mode 2019-10-12 00:39:59 +02:00
99f2abfd71 fine tuning cpu percentage limit to be detected as bound cpu on FreeBSD 2019-10-12 01:58:45 +02:00
132ecc0580 catch afl-fuzz's output and print it in case of errors 2019-10-12 01:49:23 +02:00
5157a56803 Merge pull request #80 from devnexen/fbsd_binding_fix
FreeBSD making more tolerant the cpu binding at init time
2019-10-11 23:22:31 +02:00
33281b04e7 FreeBSD making more tolerant the cpu binding at init time 2019-10-11 22:21:25 +01:00
a9404fe33f fix output from echo on NetBSD, now enables users to set cpu 2019-10-11 23:20:32 +02:00
95bdb47f01 Merge pull request #78 from devnexen/netbsd_bind_cpu_fix
Systen config typo for NetBSD
2019-10-11 23:05:15 +02:00
ebf624772a Merge pull request #79 from devnexen/netbsd_binding_to_free_cpu
NetBSD binding to cpu, ignore sleeping processes.
2019-10-11 22:54:36 +02:00
b33a6addcc NetBSD binding to cpu, ignore sleeping processes. 2019-10-11 21:09:24 +01:00
1e4fb1f6fe Systen config typo for NetBSD 2019-10-11 20:07:45 +01:00
287828fe0b if afl-clang has to be used, extend the hardening test as from llvm_mode 2019-10-11 03:24:50 +02:00
dc311b978e fix FreeBSD compile error 'NBBY' is not defined 2019-10-11 02:55:48 +02:00
bccaf93f8b Update README.md
typos in names
2019-10-10 23:21:52 +02:00
61a84e15ea Update README.md 2019-10-10 21:46:15 +02:00
f7bdb6555d Update README.md
Found Apple's statement on not supporting statically linked binaries and mentioned it.
2019-10-10 21:38:12 +02:00
4183bc35b2 doh 2019-10-10 19:50:16 +02:00
4700800770 upload libradamsa 2019-10-10 19:49:38 +02:00
9de74cce92 radamsa mutator as havoc cycle replacement with probability 1/24 2019-10-10 19:46:46 +02:00
125a59df91 Merge branch 'master' of github.com:vanhauser-thc/AFLplusplus 2019-10-08 12:40:05 +02:00
eae4a9e1f8 persistent qemu should now works as expected 2019-10-08 12:39:11 +02:00
20f009e927 added afl-fuzz -I cmdline option 2019-10-08 11:53:31 +02:00
78d9fa280c qemu maps debug print 2019-10-08 09:43:38 +02:00
45bb85cd8f tighter format to avoid overwriting right border 2019-10-07 22:41:01 +02:00
16551643b3 Merge pull request #76 from devnexen/bind_to_cpu_nbsd
bind_to_free_cpu NetBSD's turn
2019-10-05 16:21:06 +02:00
5245ed2262 suppress errors while trying to run llvm-config, it might not be
installed.
2019-10-05 15:19:32 +02:00
9e91b15b74 On Mac OS X clean up dSYM directories created by the compiler 2019-10-05 15:12:35 +02:00
b5c2646360 fix mantissa mask bug (for types double and long double) 2019-10-05 13:55:25 +02:00
8cd7f3438f bind_to_free_cpu NetBSD's turn 2019-10-05 12:21:56 +01:00
e0ff431169 replace op0_size and op1_size with op_size. 2019-10-05 12:35:06 +02:00
a8ff64f704 Merge pull request #74 from vanhauser-thc/multiarch_compcov
Multiarch CompCov
2019-10-05 00:01:16 +02:00
9c105098dd general maintance 2019-10-04 10:33:28 +02:00
9af6395e92 Merge pull request #75 from devnexen/fbsd_binding_to_cpu_x
Binding to the first free cpu, porting to FreeBSD
2019-10-04 10:24:41 +02:00
670316f997 Binding to the first free cpu, porting to FreeBSD 2019-10-04 03:52:39 +01:00
4cf02a32a7 unicorn arm compcov 2019-10-03 15:35:02 +02:00
6b3a9b9dc0 arm compcov draft 2019-10-02 21:20:41 +02:00
d544a5a947 grrrr a random guy broke my QEMU nuild script :( 2019-10-02 21:04:10 +02:00
973b0ac488 qemu compcov revert cmp order to match >/< comparisons 2019-10-02 20:28:28 +02:00
baff2ce80f Merge branch 'master' of github.com:vanhauser-thc/AFLplusplus 2019-10-02 20:15:23 +02:00
8a7fed5dfb fix missing __compcov_ro_cnt increment in libcompcov 2019-10-02 20:15:11 +02:00
a962359993 imported fix from google afl 2019-10-02 16:32:15 +02:00
5b45fc5921 Merge pull request #73 from mattz0rt/static_compilation
Build statically-linked binaries
2019-10-02 01:48:51 +02:00
c8d3d813ff Formatting and documentation improvements 2019-10-01 16:33:46 -04:00
8eafa90105 Improved error messaging when unable to communicate with the fork server 2019-10-01 16:00:40 -04:00
8e2ee30c47 Static compilation support 2019-10-01 16:00:19 -04:00
19afe50efa readme update 2019-09-30 08:09:57 +02:00
8f519e7959 Merge pull request #67 from aoh/master
use the original data as input to custom fuzzer modules
2019-09-29 18:59:15 +02:00
293ff9d586 Merge pull request #71 from devnexen/netbsd_support_upd
NetBSD various support improvements
2019-09-29 18:58:28 +02:00
2109d37298 NetBSD various support improvements 2019-09-29 12:30:10 +01:00
fb31a3bf2e copy-and-paste-typo fixed 2019-09-28 21:43:56 +02:00
68fa95beb3 On OpenBSD prefer /usr/local/bin for llvm and clang 2019-09-28 21:29:33 +02:00
942245b985 included #68 cpu binding for FreeBSD, thanks to devnexen 2019-09-28 20:50:13 +02:00
6e25fde883 FreeBSD: switch to clang by default, and set AFL_CC to fix tests 2019-09-28 20:32:21 +02:00
46955be305 add man target for man pages (along with an entry in help) 2019-09-28 18:14:17 +02:00
b89d10025d Merge branch 'master' of https://github.com/vanhauser-thc/AFLplusplus 2019-09-28 18:03:42 +02:00
edb33cba0c portability: FreeBSD does not know 'date -I', fix paths for man page
generation
2019-09-28 18:00:43 +02:00
783e5fa42f As usual I forgot the second usage test for afl-fuzz 2019-09-28 16:39:46 +02:00
9c31196610 check requirements before testing afl-fuzz (Linux and Mac OS X) 2019-09-28 16:33:53 +02:00
ca765b5ebb Oops, forgot to set AFL_GCC on other systems beside Mac OS X 2019-09-28 15:39:13 +02:00
3f65f534aa On Mac OS X afl-fuzz wants the crash reporter to be disabled.
Add the corresponding commands to the script.
The test, if they need to be run, is not tested yet (just copied).
2019-09-28 13:19:27 +02:00
1fc328b2ea portability: MacOS X has clang, so we need to use afl-clang instead
of afl-gcc. Replaced afl-gcc with variable AFL_GCC, which is set
accordingly.
2019-09-28 13:16:12 +02:00
1e93146b49 ignore error code on 'make llvm_mode', it might not be installed 2019-09-28 12:38:22 +02:00
36fea4ba7b typo corrected 2019-09-28 11:57:29 +02:00
18a1a19deb Merge pull request #65 from XairGit/master
Update .gitignore
2019-09-28 10:54:40 +02:00
1d52e1f41b OpenBSD has no timeout command, so replace it with afl-fuzz's -V option 2019-09-27 00:17:41 +02:00
f0ec7635ab replace forgotten KILLs for timeout 2019-09-26 21:09:49 +02:00
158d8a181e more portability fixes for test script (now also runs on NetBSD) 2019-09-26 21:00:14 +02:00
f66c0a5d98 Merge branch 'master' of https://github.com/vanhauser-thc/AFLplusplus 2019-09-26 00:28:25 +02:00
a609b08c0a portability fixes: avoid bash, avoid echo -e under NetBSD 2019-09-26 00:25:35 +02:00
e63c9ec05e build linux-specific libtokencap only when compiling in Linux 2019-09-26 00:21:50 +02:00
4936322dbc persistent qemu test (commented) 2019-09-25 22:36:54 +02:00
9baee07c94 unicorn mode test 2019-09-25 22:18:16 +02:00
03ecf6e695 typo 2019-09-25 21:42:32 +02:00
2b1b9f816c use the original data as input to custom fuzzer modules 2019-09-25 16:11:27 +03:00
1b55df5848 Update .gitignore
These appear to be compilation artifacts, and can probably be safely ignored.
2019-09-25 21:43:31 +10:00
7bec9e3804 Merge pull request #64 from XairGit/master
Fix CCS'16 link in README.md
2019-09-25 12:31:08 +02:00
06cb695cd7 Fix CCS'16 link in README.md 2019-09-25 19:04:46 +10:00
c08f4f5845 fix issue#63 compilation problem with a workaround
for llvm 6.0 and Ubuntu 18.04
2019-09-25 07:10:38 +02:00
c71fc74248 fix two more bad links in README 2019-09-25 06:13:04 +02:00
0b52d342f6 add forgotten README 2019-09-25 06:07:03 +02:00
a5acd32f56 fix links in docs, change dictionaries/README to markdown 2019-09-25 06:04:45 +02:00
a7e45319c3 small docs updates typos, grammar, clarifications 2019-09-25 05:41:03 +02:00
e18caef4f6 doc update 2019-09-24 13:08:31 +02:00
149b7d9ee8 bugfix for optimization 2019-09-23 22:25:44 +02:00
d13592aea0 Merge branch 'master' of https://github.com/vanhauser-thc/AFLplusplus 2019-09-23 21:59:27 +02:00
59d4b0aadb avoid floatSemantics, not available in LLVM 3.8.0 2019-09-23 21:57:38 +02:00
96c9fa0ccc doc update 2019-09-23 11:07:28 +02:00
7cdd0abfd5 doc update 2019-09-23 11:06:41 +02:00
74ef58e310 readme binary only 2019-09-22 21:51:11 +02:00
897fb9c2e4 binary readme 2019-09-22 20:24:13 +02:00
ff1f6af7e9 wine mode && fix llvm makefile 2019-09-22 20:01:44 +02:00
9aefe7a040 Merge branch 'master' of github.com:vanhauser-thc/AFLplusplus 2019-09-22 19:38:57 +02:00
17bb51756f persistent qemu retaddr offset 2019-09-22 19:38:53 +02:00
5044bb0332 move .o to src/ 2019-09-22 13:39:49 +02:00
b4ca95a9fa afl-fuzz mutation documentation feature 2019-09-22 13:21:15 +02:00
f097f780af final tests 2019-09-22 11:42:39 +02:00
99be294726 fix 2019-09-22 10:44:02 +02:00
7adb7cf7f6 more tests 2019-09-22 10:42:48 +02:00
e36e5f4fc9 Merge branch 'master' of https://github.com/vanhauser-thc/AFLplusplus 2019-09-22 08:08:47 +02:00
1e503a586d first realisation of splitting floating point compares
activated with AFL_LLVM_LAF_SPLIT_COMPARES=1
needs testing on big endian machines
A compare is split into
 sign integer comparison
 exponent integer comparison
 mantissa/fraction integer comparison
These integer comparisons are further splitted if they are
bigger than a byte.
2019-09-22 08:02:56 +02:00
6488400fbf more test cases 2019-09-21 23:38:46 +02:00
e423e0a0f1 make tests 2019-09-21 19:00:43 +02:00
ad1750b53d oops, typo corrected 2019-09-21 10:13:11 +02:00
e909d5f5c2 fix macos commit to make it portable again. Would not compile on OpenBSD. 2019-09-21 12:07:29 +02:00
6e6480c952 install libtokencap and libdislocator if present 2019-09-20 19:39:19 +02:00
ff5c7b155c custom mutator fuzzing yields UI 2019-09-20 19:20:15 +02:00
123d97bfb8 LLVM_CONFIG llvm_mode fix 2019-09-20 18:37:16 +02:00
dd0a8c200c Makefile fix 2019-09-20 18:22:01 +02:00
272a43be11 fix persistent demo 2019-09-20 12:51:26 +02:00
63677bb1f9 Merge branch 'master' of github.com:vanhauser-thc/AFLplusplus 2019-09-19 17:56:01 +02:00
780a78c825 restore qemu_mode/patches/afl-qemu-cpu-inl.h 2019-09-19 17:55:48 +02:00
c29af4aeba Merge pull request #61 from devnexen/mac_os_cpu_scaling
Checking CPU scaling on MacOS
2019-09-19 09:02:01 +02:00
48e6e3ac45 Checking CPU scaling on MacOS
Checking optimal cpu performance or ignore if the AFL_SKIP_CPUFREQ
env is set.
2019-09-18 22:04:16 +01:00
74a984d75f code format 2019-09-18 10:23:36 +02:00
b55ea6409d Merge pull request #60 from vanhauser-thc/wine_mode
Wine mode
2019-09-18 10:22:55 +02:00
68b3849d51 Merge branch 'master' of github.com:vanhauser-thc/AFLplusplus 2019-09-18 10:15:38 +02:00
ed7917e619 qemu persistent GPR 2019-09-18 10:15:34 +02:00
5e56d3bf36 bit of doc 2019-09-17 16:17:39 +02:00
e2dfac08c0 wine mode first commit 2019-09-17 16:13:41 +02:00
c8173eb9ec make help 2019-09-17 07:33:48 +02:00
832c784a70 typo 2019-09-17 02:13:13 +02:00
61b0a3775b code start and end in qemu env vars 2019-09-17 02:11:34 +02:00
5f50964176 fix man page generation, prerequisite is located in main directory 2019-09-17 00:44:46 +02:00
428b88a82a added afl_custom_mutator_only 2019-09-16 16:17:16 +02:00
46ac559003 man page for afl-clang-fast 2019-09-16 15:17:14 +02:00
caba176c87 more help in the readme 2019-09-16 14:49:05 +02:00
f37e7c5240 Merge branch 'master' of github.com:vanhauser-thc/AFLplusplus 2019-09-14 14:40:14 +02:00
252742ce20 afl-qemu-trace wit CPU_TARGET=i386 build fail fix 2019-09-14 14:40:05 +02:00
3f3f03f715 todo update 2019-09-14 14:18:18 +02:00
4df1ad35b3 Merge pull request #59 from vanhauser-thc/qemu_3.1.1
Qemu 3.1.1
2019-09-14 13:02:19 +02:00
4e87c6af02 for hexcoder 2019-09-13 17:05:20 +02:00
fc277b736a qemu version update in headers 2019-09-13 15:44:50 +02:00
278f4fd08e make source-only and binary-only 2019-09-13 15:37:17 +02:00
df86816e7d distrib makefile option 2019-09-13 15:12:28 +02:00
d8059cab6b fix #58 with qemu 4 fix backport 2019-09-13 14:58:37 +02:00
d1a2a3eee5 qemu 3.1.1 2019-09-13 14:46:38 +02:00
7856f09799 updated todo 2019-09-13 14:28:47 +02:00
461e717157 doc update 2019-09-13 14:22:31 +02:00
8ee11fecc4 Merge pull request #57 from vanhauser-thc/persistent_qemu
Persistent mode in QEMU
2019-09-13 11:37:26 +02:00
36020c41df Merge branch 'master' into persistent_qemu 2019-09-13 11:34:50 +02:00
6444bc6a71 update readme and todo 2019-09-13 11:02:50 +02:00
a67d86c6e2 Second part of refactoring afl-fuzz-one.c. Now more back to sane functions. 2019-09-12 22:56:38 +02:00
924f3025f9 typo 2019-09-12 20:01:45 +02:00
9690bb4b9c qemu mode readme update 2019-09-12 20:00:47 +02:00
5d5ee85928 qemu mode readme update 2019-09-12 19:56:12 +02:00
820621baa2 qemu mode readme update 2019-09-12 19:54:35 +02:00
75d2881302 ret addr patching 2019-09-12 16:57:17 +02:00
95b641198e remove debug print 2019-09-12 13:02:21 +02:00
6b40189045 first version of persistent QEMU 2019-09-12 12:34:53 +02:00
df379dfcf4 no more unlink 2019-09-10 21:01:33 +02:00
4721617fd6 refactoring for unification of pilot_fuzzing() and core_fuzzing()
fast method with macro template, review required
2019-09-08 00:17:28 +02:00
b82ff2d7e7 prefer preincrement over postincrement 2019-09-07 11:20:36 +02:00
efa2052896 fix BSD patch 2019-09-05 11:23:10 +02:00
52cbd650b7 Merge pull request #55 from t6/patch-freebsd
Unbreak build on FreeBSD
2019-09-05 11:19:38 +02:00
4cb1d756f7 Add missing DESTDIR
Man pages are not properly staged.

Signed-off-by: Tobias Kortkamp <t@tobik.me>
2019-09-05 11:03:53 +02:00
84161d7c9d Use date -I instead of date --iso-8601
FreeBSD's date(1) does not support the long argument form.

Signed-off-by: Tobias Kortkamp <t@tobik.me>
2019-09-05 11:00:37 +02:00
c8c5ec254a Unbreak build of afl-forkserver.c on *BSD
Signed-off-by: Tobias Kortkamp <t@tobik.me>
2019-09-05 10:49:47 +02:00
1a0b491ed6 2.54d init 2019-09-05 10:14:42 +02:00
3a4226a28b 2.54c release 2019-09-05 10:12:22 +02:00
1a47a5a739 small adjustments for custom mutator 2019-09-05 10:10:42 +02:00
760416c1a0 small adjustments for custom mutator 2019-09-05 10:10:25 +02:00
5955dd4e25 Merge pull request #54 from code-intelligence-gmbh/custom_mutator_docs
Custom mutator docs
2019-09-05 10:06:02 +02:00
e0f9aa3508 Added docstring to the custom mutator hooks 2019-09-04 23:22:22 +02:00
b31dff6bee Merge branch 'master-upstream' into custom_mutator_docs
# Conflicts:
#	afl-fuzz.c
2019-09-04 23:20:18 +02:00
1b3f971330 Added documentation and a simple example for the custom mutator functionality 2019-09-04 22:57:52 +02:00
abf61ecc8f add to docs 2019-09-04 16:15:42 +02:00
71bf2d8826 README update 2019-09-04 13:15:44 +02:00
52bfd1fc3d added man pages 2019-09-04 12:14:35 +02:00
a8d96967c4 fixed maxrss stat 2019-09-04 10:32:32 +02:00
f7a400878a fix typo in custom format 2019-09-04 10:04:35 +02:00
e1f18f6212 fix typo in custom format 2019-09-04 10:03:51 +02:00
9705ccee67 credits and license header for src/* and include/* 2019-09-04 09:43:09 +02:00
7151651ea9 remove macro indentation from code-format 2019-09-03 20:43:11 +02:00
0d7ecd4327 updated TODO 2019-09-03 12:03:12 +02:00
50530c144e updated TODO 2019-09-03 11:42:22 +02:00
45f00e45be error to warn change 2019-09-03 11:38:44 +02:00
e969afc627 update todo 2019-09-03 11:24:45 +02:00
f094908f54 contributing file 2019-09-03 11:19:27 +02:00
f3617bd83b Merge pull request #53 from vanhauser-thc/code-cleanup
Code cleanup
2019-09-03 11:12:49 +02:00
3bfd88aabb better support for OpenBSD thanks to CaBeckmann (issue #9).
On OpenBSD there is a restricted system LLVM, but a full LLVM
package can be installed (typically in /usr/local/bin).
Added a check if the full package is installed. If so, use it,
otherwise bail out early with a hint to install it.
2019-09-03 04:28:24 +02:00
d47ef88fcd minor fixes 2019-09-02 18:53:43 +02:00
b24639d011 run code formatter 2019-09-02 18:49:43 +02:00
2ae4ca91b4 merge from master 2019-09-02 18:47:07 +02:00
e9d968e060 afl-fuzz.c completely splitted 2019-09-02 18:41:27 +02:00
1652831f1d afl-fuzz-src/* -> src/afl-fuzz* rename 2019-09-02 17:40:23 +02:00
39c4bb7a49 added peak_rss_mb and slowest_exec_ms in fuzzer_stats report 2019-09-02 10:29:54 +02:00
6cb07a9131 previous merge lost the symlink, restoring 2019-09-02 09:43:05 +02:00
e76ad2980f added force-ui env 2019-09-02 09:41:52 +02:00
af5fd8c819 split afl-fuzz: extras 2019-09-02 00:15:12 +02:00
3b3df4e3cb afl-fuzz-src bitmap and queue C files 2019-09-01 20:34:20 +02:00
c124576a4d change text color in FATAL, ABORT and PFATAL macros for the actual
message to avoid white text on white background (as is standard in
plain X11 xterm). Now the text will be printed in default text
color (which should be always readable)
2019-09-01 17:55:47 +02:00
659037eef5 modernize llvm_mode readmes 2019-08-31 11:31:51 +02:00
500a378fdf modernize some readmes 2019-08-31 11:23:48 +02:00
4f3c417753 remave the afl-fuzz folder to afl-fuzz-src due to gitignore 2019-08-30 13:10:04 +02:00
113fc168ab split afl-fuzz #1 (globls and python are now separate) 2019-08-30 13:00:45 +02:00
0ba49eacc9 move android-ashmem.h to include/ 2019-08-30 12:20:33 +02:00
bbd9441fc6 code-format in Makefile 2019-08-30 12:17:34 +02:00
22454ce60b fix issue with static variables needed by forkserver in afl-fuzz 2019-08-30 12:15:56 +02:00
5036cb54cc update with changes from master 2019-08-30 12:13:51 +02:00
2eeb07d164 format like AFL style (dotfiles) 2019-08-30 12:03:11 +02:00
ca6ac09dcc format like AFL style 2019-08-30 12:02:19 +02:00
eadd378f6c update changelog 2019-08-30 11:42:30 +02:00
7b36afd5f1 modernize docs and readme for qemu and unicorn 2019-08-30 11:38:33 +02:00
f677427f68 Merge pull request #50 from vanhauser-thc/uc_compcov
Unicorn CompareCoverage + Neverzero counters
2019-08-30 01:27:08 +02:00
132ad08885 common header for qemu and unicorn 2019-08-29 15:28:42 +02:00
d3e173b6e6 Merge pull request #51 from domenukk/uc_compcov
Fixed SIGSEV due to wrong pointer size
2019-08-29 12:04:28 +02:00
3f2a317af0 Fixed SIGSEV due to wrong pointer size 2019-08-29 03:06:24 +02:00
892513708b solved MAP_SIZE overflow 2019-08-28 19:07:19 +02:00
733c8e4c34 better neverzero with adc + neverzero for compcov 2019-08-28 18:42:21 +02:00
80f175daac unicorn compcov for x86 2019-08-28 13:45:37 +02:00
c5e0b29a22 neverzero for unicorn_mode 2019-08-27 21:10:51 +02:00
bec9b307db neverzero qemu for x86/x86_64 2019-08-27 20:57:52 +02:00
aca63d4986 custom format now search for the best clang-format version 2019-08-27 19:35:44 +02:00
bae398a9a4 -I include in makefiles 2019-08-27 19:22:53 +02:00
0d001c09c3 fix to compile llvm_mode 2019-08-27 18:49:58 +02:00
cd259fe118 add custom format wrapping clang-format 2019-08-27 17:26:04 +02:00
d7b707a71c symlink include/debug.h to root 2019-08-27 17:04:23 +02:00
17228d27e5 config.h and types.h symlink in root 2019-08-27 17:02:26 +02:00
10df5ad0ac docu update 2019-08-27 16:22:25 +02:00
7338568125 removed sepration lines from README 2019-08-27 15:17:43 +02:00
4adca18337 afl-as is now alive 2019-08-27 15:04:27 +02:00
b6f5e1635c added afl++ patches authors to special thanks 2019-08-27 14:02:48 +02:00
0e59a59169 include and src folders 2019-08-27 13:31:35 +02:00
6b45deaf97 Merge pull request #48 from domenukk/unicorn_exec
Make AFL-Unicorn install script executable
2019-08-26 07:37:16 +02:00
e72d4a96bf Make install script executable 2019-08-26 02:51:14 +02:00
b79adc01fa Merge pull request #28 from JoeyJiao/mine_android
Port for Android
2019-08-23 12:42:11 +02:00
790d717543 update README.qemu with compcov levels 2019-08-21 10:09:46 +02:00
b1ebd62c78 update env_variables.txt with compcov levels 2019-08-21 09:57:26 +02:00
fcc349467f Merge pull request #47 from vanhauser-thc/immediates-compcov
compcov levels to enable the instrumentation of only comparisons with immediates
2019-08-21 00:40:12 -07:00
cc55e5c6d8 remove compcov immediates only instrumentation from TODO 2019-08-21 09:36:31 +02:00
a51d4227b6 Symlink Makefile to Android.mk 2019-08-19 19:44:04 +08:00
742aed4f2e Add support for Android 2019-08-19 19:43:58 +08:00
d3d0682310 seperated the forkserver from afl-fuzz and afl-tmin 2019-08-19 12:54:55 +02:00
53012ff41c Merge pull request #46 from devnexen/bsd_config
system-config: making it more compatible with BSD systems.
2019-08-18 13:45:51 +02:00
dd734a01dc system-config: making it more compatible with BSD systems.
The following knobs are Linux specifics but have few counterparts
in those systems.
2019-08-18 09:40:33 +01:00
2053731ebc update readme and todo 2019-08-17 12:07:22 +02:00
a3b863d312 Merge pull request #41 from t6/patch-arc4random
Use arc4random(3) on *BSD/macOS
2019-08-17 07:55:00 +02:00
7cb0658b00 more sed compatibility for Freebsd, avoid grouping 2019-08-14 22:48:06 +02:00
96c76a8333 more sed compatibility for Freebsd, avoid grouping 2019-08-14 22:41:39 +02:00
925cfba424 signedness in print formats corrected 2019-08-12 10:52:45 +02:00
f63318a20f several code cleanups: avoid #if in macro parameters
avoid arithmetic with void pointers (undefined behaviour)
avoid some shadowed variables
2019-08-11 15:40:53 +02:00
f5d4912ca8 performance optimization predecrement instead of postdecrement 2019-08-11 11:56:28 +02:00
642cf8b5ff performance tuning prefer preincrement over postincrement 2019-08-10 19:58:18 +02:00
0612aa2b65 optimized version extraction for clang (restricted to first line) 2019-08-10 17:10:18 +02:00
3937764ac5 Merge pull request #44 from GoodDayGeorge/zhuxing/master
llvm-mode: Get the clang version correctly
2019-08-10 14:59:18 +02:00
ed603dcba2 llvm-mode: Get the clang version correctly
When using clang-8.0, The previous command in the
Makefile will get two 8.0.0, thus a warning message print.
2019-08-10 08:22:38 +00:00
41d2e7d6b6 minor corrections 2019-08-09 00:34:26 +02:00
73d02f3a80 fix some compiler warnings 2019-08-08 23:09:58 +02:00
e1183be22e documentation update 2019-08-08 10:43:27 +02:00
2971b5b315 documentation update 2019-08-08 10:36:43 +02:00
65a3a9773d Merge pull request #39 from floyd-fuh/master
Workaround patch for QEMU
2019-08-08 09:08:51 +02:00
8b6a4e5759 For BSD/APPLE platform use native random calls
Solution not involving file descriptors, seeded upon fork and on
a regular basis.

Signed-off-by: Tobias Kortkamp <t@tobik.me>
2019-08-08 08:29:25 +02:00
07df1e3034 bugfix 'echo -n' is not POSIX, use input redirection from /dev/null 2019-08-07 20:34:57 +02:00
09c95b7ea7 reviewed neverZero for llvm 9.0 2019-08-07 20:26:41 +02:00
a6fe8ae0af fix compilation error with llvm 9.0 2019-08-07 20:25:22 +02:00
dc2c46e23c change instrumentation test to trigger different bitmap entries with clang 9.0 2019-08-07 20:22:47 +02:00
0f476a289f Ugly patch for this issue https://lists.sr.ht/~philmd/qemu/patches/6224#%3C20190617114005.24603-1-berrange@redhat.com%3E+linux-user/syscall.c in QEMU with ubuntu 19.10 2019-08-06 17:00:14 +02:00
ae3f058ff0 Merge pull request #38 from floyd-fuh/master
Unset AFL_CC
2019-08-06 16:56:24 +02:00
1315021388 unset AFL_CC correctly, if set to afl-clang but TEST_CC is afl-gcc, this will fail (eg. when later installing QEMU but AFL_CC was already set) 2019-08-06 16:49:55 +02:00
ccb231e4f4 set AFL_CC correctly, if set to afl-clang but TEST_CC is afl-gcc, this will fail 2019-08-06 16:39:42 +02:00
aad485128e fix 2019-08-01 15:55:10 +02:00
54bb9f4b55 Merge pull request #36 from vanhauser-thc/map_1mb
map size fixes
2019-08-01 15:44:56 +02:00
af823d6486 map size fixes 2019-08-01 15:44:10 +02:00
487a87df02 adding blame 2019-08-01 15:32:55 +02:00
b14fead592 Merge pull request #35 from code-intelligence-gmbh/custom_mutator
Custom mutator
2019-08-01 15:29:30 +02:00
ebf2c8caa5 Merge remote-tracking branch 'github/master' into custom_mutator
# Conflicts:
#	Makefile
#	afl-fuzz.c
2019-08-01 14:22:48 +02:00
84855737b3 little fix 2019-08-01 13:38:49 +02:00
7a608d1346 add -r option to showmap to enable raw output 2019-08-01 13:19:25 +02:00
3e418ecb6e showmap shows tuple content summary now 2019-08-01 12:01:04 +02:00
89769c836f showmap fix 2019-08-01 11:49:01 +02:00
7c8470b1dc document python2 requirements for unicorn_mode 2019-07-31 11:05:47 +02:00
81bab528b2 name typos 2019-07-31 01:56:54 +02:00
d6beac5235 compcov levels to enable the instrumentation of only immediates 2019-07-29 16:09:28 +02:00
a949b40d11 Only execute the mutated input when it is not empty 2019-07-27 01:18:30 +02:00
7ca22cd552 Merge pull request #33 from t6/patch-freebsd
Unbreak build on FreeBSD
2019-07-26 16:02:54 +02:00
30586e634d Unbreak build on FreeBSD
afl-fuzz.c:4341:62: error: use of undeclared identifier 'cpu_aff'
          cYEL "american fuzzy lop", use_banner, power_name, cpu_aff);
                                                             ^
afl-fuzz.c:11537:7: error: use of undeclared identifier 'cpu_aff'
  if (cpu_aff > 0)
      ^
afl-fuzz.c:11538:73: error: use of undeclared identifier 'cpu_aff'
    snprintf(tmp, sizeof(tmp), "%s%d%s", "/sys/devices/system/cpu/cpu", cpu_aff, "/cpuf...
                                                                        ^
afl-fuzz.c:11543:9: error: use of undeclared identifier 'cpu_aff'
    if (cpu_aff > 0)
        ^
afl-fuzz.c:11544:86: error: use of undeclared identifier 'cpu_aff'
      snprintf(tmp, sizeof(tmp), "%s%d%s", "/sys/devices/system/cpu/cpufreq/policy", cpu_aff...
                                                                                     ^
5 errors generated.
2019-07-26 15:24:50 +02:00
2b6fe347ae 2.53d init 2019-07-26 14:41:48 +02:00
b2f0b6f2b4 Update the interface of the custom_mutator to handle cases where the mutation returns a larger buffer than the original buffer 2019-07-06 11:03:00 +02:00
14aa5fe521 Added two hooks that are necessary for the grammar fuzzer 2019-07-04 14:25:19 +02:00
c2edb3e22f build afl with clang's compiler-rt 2019-07-01 17:56:39 +02:00
fedbd54325 Define AFLCustomMutator hook that can be implemented by implemented by external libraries and provided to AFL 2019-07-01 17:53:41 +02:00
446 changed files with 140620 additions and 24443 deletions

148
.clang-format Normal file
View File

@ -0,0 +1,148 @@
---
Language: Cpp
# BasedOnStyle: Google
AccessModifierOffset: -1
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: true
AlignEscapedNewlines: Left
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: true
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: false
AllowShortIfStatementsOnASingleLine: true
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: Yes
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Attach
BreakBeforeInheritanceComma: false
BreakInheritanceList: BeforeColon
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeColon
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 80
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IncludeBlocks: Preserve
IncludeCategories:
- Regex: '^<ext/.*\.h>'
Priority: 2
- Regex: '^<.*\.h>'
Priority: 1
- Regex: '^<.*'
Priority: 2
- Regex: '.*'
Priority: 3
IncludeIsMainRegex: '([-_](test|unittest))?$'
IndentCaseLabels: true
IndentPPDirectives: BeforeHash
IndentWidth: 2
IndentWrappedFunctionNames: false
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBinPackProtocolList: Never
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 1
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 200
PointerAlignment: Right
RawStringFormats:
- Language: Cpp
Delimiters:
- cc
- CC
- cpp
- Cpp
- CPP
- 'c++'
- 'C++'
CanonicalDelimiter: ''
BasedOnStyle: google
- Language: TextProto
Delimiters:
- pb
- PB
- proto
- PROTO
EnclosingFunctions:
- EqualsProto
- EquivToProto
- PARSE_PARTIAL_TEXT_PROTO
- PARSE_TEST_PROTO
- PARSE_TEXT_PROTO
- ParseTextOrDie
- ParseTextProtoOrDie
CanonicalDelimiter: ''
BasedOnStyle: google
ReflowComments: true
SortIncludes: false
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 2
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Auto
TabWidth: 8
UseTab: Never
...

123
.custom-format.py Executable file
View File

@ -0,0 +1,123 @@
#!/usr/bin/env python3
#
# american fuzzy lop++ - custom code formatter
# --------------------------------------------
#
# Written and maintaned by Andrea Fioraldi <andreafioraldi@gmail.com>
#
# Copyright 2015, 2016, 2017 Google Inc. All rights reserved.
# Copyright 2019-2020 AFLplusplus Project. 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
#
import subprocess
import sys
import os
import re
# string_re = re.compile('(\\"(\\\\.|[^"\\\\])*\\")') # future use
with open(".clang-format") as f:
fmt = f.read()
CLANG_FORMAT_BIN = os.getenv("CLANG_FORMAT_BIN")
if CLANG_FORMAT_BIN is None:
o = 0
try:
p = subprocess.Popen(["clang-format-10", "--version"], stdout=subprocess.PIPE)
o, _ = p.communicate()
o = str(o, "utf-8")
o = re.sub(r".*ersion ", "", o)
#o = o[len("clang-format version "):].strip()
o = o[:o.find(".")]
o = int(o)
except:
print ("clang-format-10 is needed. Aborted.")
exit(1)
#if o < 7:
# if subprocess.call(['which', 'clang-format-7'], stdout=subprocess.PIPE) == 0:
# CLANG_FORMAT_BIN = 'clang-format-7'
# elif subprocess.call(['which', 'clang-format-8'], stdout=subprocess.PIPE) == 0:
# CLANG_FORMAT_BIN = 'clang-format-8'
# elif subprocess.call(['which', 'clang-format-9'], stdout=subprocess.PIPE) == 0:
# CLANG_FORMAT_BIN = 'clang-format-9'
# elif subprocess.call(['which', 'clang-format-10'], stdout=subprocess.PIPE) == 0:
# CLANG_FORMAT_BIN = 'clang-format-10'
# else:
# print ("clang-format 7 or above is needed. Aborted.")
# exit(1)
else:
CLANG_FORMAT_BIN = 'clang-format-10'
COLUMN_LIMIT = 80
for line in fmt.split("\n"):
line = line.split(":")
if line[0].strip() == "ColumnLimit":
COLUMN_LIMIT = int(line[1].strip())
def custom_format(filename):
p = subprocess.Popen([CLANG_FORMAT_BIN, filename], stdout=subprocess.PIPE)
src, _ = p.communicate()
src = str(src, "utf-8")
in_define = False
last_line = None
out = ""
for line in src.split("\n"):
if line.lstrip().startswith("#"):
if line[line.find("#")+1:].lstrip().startswith("define"):
in_define = True
if "/*" in line and not line.strip().startswith("/*") and line.endswith("*/") and len(line) < (COLUMN_LIMIT-2):
cmt_start = line.rfind("/*")
line = line[:cmt_start] + " " * (COLUMN_LIMIT-2 - len(line)) + line[cmt_start:]
define_padding = 0
if last_line is not None and in_define and last_line.endswith("\\"):
last_line = last_line[:-1]
define_padding = max(0, len(last_line[last_line.rfind("\n")+1:]))
if last_line is not None and last_line.strip().endswith("{") and line.strip() != "":
line = (" " * define_padding + "\\" if in_define else "") + "\n" + line
elif last_line is not None and last_line.strip().startswith("}") and line.strip() != "":
line = (" " * define_padding + "\\" if in_define else "") + "\n" + line
elif line.strip().startswith("}") and last_line is not None and last_line.strip() != "":
line = (" " * define_padding + "\\" if in_define else "") + "\n" + line
if not line.endswith("\\"):
in_define = False
out += line + "\n"
last_line = line
return (out)
args = sys.argv[1:]
if len(args) == 0:
print ("Usage: ./format.py [-i] <filename>")
print ()
print (" The -i option, if specified, let the script to modify in-place")
print (" the source files. By default the results are written to stdout.")
print()
exit(1)
in_place = False
if args[0] == "-i":
in_place = True
args = args[1:]
for filename in args:
code = custom_format(filename)
if in_place:
with open(filename, "w") as f:
f.write(code)
else:
print(code)

65
.dockerignore Normal file
View File

@ -0,0 +1,65 @@
.test
.test2
.sync_tmp
*.o
*.so
*.pyc
*.dSYM
as
ld
in
out
core*
afl-analyze
afl-as
afl-clang
afl-clang\+\+
afl-clang-fast
afl-clang-fast\+\+
afl-clang-lto
afl-clang-lto\+\+
afl-fuzz
afl-g\+\+
afl-gcc
afl-gcc-fast
afl-g\+\+-fast
afl-gotcpu
afl-ld
afl-ld-lto
afl-qemu-trace
afl-showmap
afl-tmin
afl-analyze.8
afl-as.8
afl-clang-fast\+\+.8
afl-clang-fast.8
afl-clang-lto.8
afl-clang-lto\+\+.8
afl-cmin.8
afl-cmin.bash.8
afl-fuzz.8
afl-gcc.8
afl-gcc-fast.8
afl-g\+\+-fast.8
afl-gotcpu.8
afl-plot.8
afl-showmap.8
afl-system-config.8
afl-tmin.8
afl-whatsup.8
qemu_mode/libcompcov/compcovtest
qemu_mode/qemu-*
unicorn_mode/samples/*/\.test-*
unicorn_mode/samples/*/output
unicorn_mode/unicornafl
test/unittests/unit_maybe_alloc
test/unittests/unit_preallocable
test/unittests/unit_list
test/unittests/unit_rand
test/unittests/unit_hash
examples/afl_network_proxy/afl-network-server
examples/afl_network_proxy/afl-network-client
examples/afl_frida/afl-frida
examples/afl_frida/libtestinstr.so
examples/afl_frida/frida-gum-example.c
examples/afl_frida/frida-gum.h

58
.gitignore vendored
View File

@ -1,23 +1,69 @@
.test
.test2
.sync_tmp
.vscode
*.o
*.so
.gitignore
*.swp
*.pyc
*.dSYM
as
ld
in
out
core*
compile_commands.json
afl-analyze
afl-as
afl-clang
afl-clang++
afl-clang-fast
afl-clang-fast++
afl-clang-lto
afl-clang-lto++
afl-fuzz
afl-g++
afl-gcc
afl-gcc-fast
afl-g++-fast
afl-gotcpu
afl-ld
afl-ld-lto
afl-qemu-trace
afl-showmap
afl-tmin
as
qemu_mode/qemu-3.1.0
qemu_mode/qemu-3.1.0.tar.xz
unicorn_mode/unicorn
unicorn_mode/unicorn-*
afl-analyze.8
afl-as.8
afl-clang-fast++.8
afl-clang-fast.8
afl-clang-lto.8
afl-clang-lto++.8
afl-cmin.8
afl-cmin.bash.8
afl-fuzz.8
afl-gcc.8
afl-g++.8
afl-gcc-fast.8
afl-g++-fast.8
afl-gotcpu.8
afl-plot.8
afl-showmap.8
afl-system-config.8
afl-tmin.8
afl-whatsup.8
qemu_mode/libcompcov/compcovtest
qemu_mode/qemu-*
unicorn_mode/samples/*/\.test-*
unicorn_mode/samples/*/output/
unicorn_mode/unicornafl
test/unittests/unit_maybe_alloc
test/unittests/unit_preallocable
test/unittests/unit_list
test/unittests/unit_rand
test/unittests/unit_hash
examples/afl_network_proxy/afl-network-server
examples/afl_network_proxy/afl-network-client
examples/afl_frida/afl-frida
examples/afl_frida/libtestinstr.so
examples/afl_frida/frida-gum-example.c
examples/afl_frida/frida-gum.h

7
.gitmodules vendored Normal file
View File

@ -0,0 +1,7 @@
[submodule "unicorn_mode/unicornafl"]
path = unicorn_mode/unicornafl
url = https://github.com/AFLplusplus/unicornafl
[submodule "custom_mutators/Grammar-Mutator"]
path = custom_mutators/Grammar-Mutator
url = https://github.com/AFLplusplus/Grammar-Mutator

View File

@ -1,11 +1,60 @@
language: c
sudo: required
branches:
only:
- stable
- dev
- llvm_merge
matrix:
include:
# - os: linux # focal errors every run with a timeout while installing packages
# dist: focal
# env: NAME="focal-amd64" MODERN="yes" GCC="9"
- os: linux
dist: bionic
env: NAME="bionic-amd64" MODERN="yes" GCC="7"
- os: linux
dist: xenial
env: NAME="xenial-amd64" MODERN="no" GCC="5" EXTRA="libtool-bin clang-6.0"
- os: linux
dist: trusty
env: NAME="trusty-amd64" MODERN="no" GCC="4.8"
# - os: linux # until travis can fix this!
# dist: xenial
# arch: arm64
# env: NAME="xenial-arm64" MODERN="no" GCC="5" EXTRA="libtool-bin clang-6.0" AFL_NO_X86="1" CPU_TARGET="aarch64"
# - os: osx
# osx_image: xcode11.2
# env: NAME="osx" HOMEBREW_NO_ANALYTICS="1" LINK="http://releases.llvm.org/9.0.0/" NAME="clang+llvm-9.0.0-x86_64-darwin-apple"
jobs:
allow_failures:
- os: osx
- arch: arm64
env:
- AFL_I_DONT_CARE_ABOUT_MISSING_CRASHES=1 AFL_NO_UI=1
# - AFL_I_DONT_CARE_ABOUT_MISSING_CRASHES=1 AFL_NO_UI=1 AFL_EXIT_WHEN_DONE=1
# TODO: test AFL_BENCH_UNTIL_CRASH once we have a target that crashes
# - AFL_I_DONT_CARE_ABOUT_MISSING_CRASHES=1 AFL_NO_UI=1 AFL_BENCH_JUST_ONE=1
before_install:
# export LLVM_DIR=${TRAVIS_BUILD_DIR}/${LLVM_PACKAGE}
- echo Testing on $NAME
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then wget "$LINK""$NAME".tar.xz ; export LLVM_CONFIG=`pwd`/"$NAME" ; tar xJf "$NAME".tar.xz ; fi
- if [ "$MODERN" = "yes" ]; then sudo apt update ; sudo apt upgrade ; sudo apt install -y git libtool libtool-bin automake bison libglib2.0-0 build-essential clang gcc-"$GCC" gcc-"$GCC"-plugin-dev libc++-"$GCC"-dev findutils libcmocka-dev python3-setuptools ; fi
- if [ "$MODERN" = "no" ]; then sudo apt update ; sudo apt install -y git libtool $EXTRA libpixman-1-dev automake bison libglib2.0 build-essential gcc-"$GCC" gcc-"$GCC"-plugin-dev libc++-dev findutils libcmocka-dev python3-setuptools ; fi
script:
- make
- ./afl-gcc ./test-instr.c -o test-instr
- mkdir seeds; mkdir out
- echo "" > seeds/nil_seed
- timeout --preserve-status 5s ./afl-fuzz -i seeds -o out/ -- ./test-instr
- gcc -v
- clang -v
- sudo -E ./afl-system-config
- sudo sysctl -w kernel.shmmax=10000000000
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then export LLVM_CONFIG=`pwd`/"$NAME" ; make source-only ASAN_BUILD=1 ; fi
- if [ "$TRAVIS_OS_NAME" = "linux" -a "$TRAVIS_CPU_ARCH" = "amd64" ]; then make distrib ASAN_BUILD=1 ; fi
- if [ "$TRAVIS_CPU_ARCH" = "arm64" ] ; then export LLVM_CONFIG=llvm-config-6.0 ; make ASAN_BUILD=1 ; cd qemu_mode && sh ./build_qemu_support.sh ; cd .. ; fi
- make tests
# - travis_terminate 0

141
Android.bp Normal file
View File

@ -0,0 +1,141 @@
cc_defaults {
name: "afl-defaults",
cflags: [
"-funroll-loops",
"-Wno-pointer-sign",
"-Wno-pointer-arith",
"-Wno-sign-compare",
"-Wno-unused-parameter",
"-Wno-unused-function",
"-Wno-format",
"-Wno-user-defined-warnings",
"-DUSE_TRACE_PC=1",
"-DBIN_PATH=\"out/host/linux-x86/bin\"",
"-DDOC_PATH=\"out/host/linux-x86/shared/doc/afl\"",
"-D__USE_GNU",
],
}
cc_binary {
name: "afl-fuzz",
static_executable: true,
host_supported: true,
defaults: [
"afl-defaults",
],
srcs: [
"afl-fuzz.c",
],
}
cc_binary {
name: "afl-showmap",
static_executable: true,
host_supported: true,
defaults: [
"afl-defaults",
],
srcs: [
"afl-showmap.c",
],
}
cc_binary {
name: "afl-tmin",
static_executable: true,
host_supported: true,
defaults: [
"afl-defaults",
],
srcs: [
"afl-tmin.c",
],
}
cc_binary {
name: "afl-analyze",
static_executable: true,
host_supported: true,
defaults: [
"afl-defaults",
],
srcs: [
"afl-analyze.c",
],
}
cc_binary {
name: "afl-gotcpu",
static_executable: true,
host_supported: true,
defaults: [
"afl-defaults",
],
srcs: [
"afl-gotcpu.c",
],
}
cc_binary_host {
name: "afl-clang-fast",
static_executable: true,
defaults: [
"afl-defaults",
],
cflags: [
"-D__ANDROID__",
"-DAFL_PATH=\"out/host/linux-x86/lib64\"",
],
srcs: [
"llvm_mode/afl-clang-fast.c",
],
}
cc_binary_host {
name: "afl-clang-fast++",
static_executable: true,
defaults: [
"afl-defaults",
],
cflags: [
"-D__ANDROID__",
"-DAFL_PATH=\"out/host/linux-x86/lib64\"",
],
srcs: [
"llvm_mode/afl-clang-fast.c",
],
}
cc_library_static {
name: "afl-llvm-rt",
compile_multilib: "both",
vendor_available: true,
host_supported: true,
recovery_available: true,
sdk_version: "9",
defaults: [
"afl-defaults",
],
srcs: [
"llvm_mode/afl-llvm-rt.o.c",
],
}

1
Android.mk Symbolic link
View File

@ -0,0 +1 @@
Makefile

24
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,24 @@
# How to submit a Pull Request to AFLplusplus
All contributions (pull requests) must be made against our `dev` branch.
Each modified source file, before merging, must be formatted.
```
make code-format
```
This should be fine if you modified one of the files already present in the
project, or added a file in a directory we already format, otherwise run:
```
./.custom-format.py -i file-that-you-have-created.c
```
Regarding the coding style, please follow the AFL style.
No camel case at all and use the AFL's macros wherever possible
(e.g. WARNF, FATAL, MAP_SIZE, ...).
Remember that AFLplusplus has to build and run on many platforms, so
generalize your Makefiles/GNUmakefile (or your patches to our pre-existing
Makefiles) to be as much generic as possible.

View File

@ -1 +0,0 @@
docs/ChangeLog

1
Changelog.md Symbolic link
View File

@ -0,0 +1 @@
docs/Changelog.md

64
Dockerfile Normal file
View File

@ -0,0 +1,64 @@
#
# This Dockerfile for AFLplusplus uses Ubuntu 20.04 focal and
# installs LLVM 11 from llvm.org for afl-clang-lto support :-)
# It also installs gcc/g++ 10 from the Ubuntu development platform
# has focal has gcc-10 but not g++-10 ...
#
FROM ubuntu:20.04 AS aflplusplus
MAINTAINER afl++ team <afl@aflplus.plus>
LABEL "about"="AFLplusplus docker image"
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get upgrade -y && \
apt-get -y install --no-install-suggests --no-install-recommends \
automake \
bison flex \
build-essential \
git \
python3 python3-dev python3-setuptools python-is-python3 \
libtool libtool-bin \
libglib2.0-dev \
wget vim jupp nano bash-completion \
apt-utils apt-transport-https ca-certificates gnupg dialog \
libpixman-1-dev
RUN echo deb http://apt.llvm.org/focal/ llvm-toolchain-focal-11 main >> /etc/apt/sources.list && \
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
RUN echo deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu focal main >> /etc/apt/sources.list && \
apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 1E9377A2BA9EF27F
RUN apt-get update && apt-get upgrade -y
RUN apt-get install -y gcc-10 g++-10 gcc-10-plugin-dev gcc-10-multilib \
libc++-10-dev gdb lcov
RUN apt-get install -y clang-11 clang-tools-11 libc++1-11 libc++-11-dev \
libc++abi1-11 libc++abi-11-dev libclang1-11 libclang-11-dev \
libclang-common-11-dev libclang-cpp11 libclang-cpp11-dev liblld-11 \
liblld-11-dev liblldb-11 liblldb-11-dev libllvm11 libomp-11-dev \
libomp5-11 lld-11 lldb-11 llvm-11 llvm-11-dev llvm-11-runtime llvm-11-tools
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 0
RUN update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 0
RUN rm -rf /var/cache/apt/archives/*
ENV LLVM_CONFIG=llvm-config-11
ENV AFL_SKIP_CPUFREQ=1
RUN git clone https://github.com/vanhauser-thc/afl-cov /afl-cov
RUN cd /afl-cov && make install && cd ..
COPY . /AFLplusplus
WORKDIR /AFLplusplus
RUN export REAL_CXX=g++-10 && export CC=gcc-10 && \
export CXX=g++-10 && make clean && \
make distrib && make install && make clean
RUN echo 'alias joe="jupp --wordwrap"' >> ~/.bashrc
RUN echo 'export PS1="[afl++]$PS1"' >> ~/.bashrc
ENV IS_DOCKER="1"

621
GNUmakefile Normal file
View File

@ -0,0 +1,621 @@
#
# american fuzzy lop++ - makefile
# -----------------------------
#
# Originally written by Michal Zalewski
#
# Copyright 2013, 2014, 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
#
# For Heiko:
#TEST_MMAP=1
# the hash character is treated differently in different make versions
# so use a variable for '#'
HASH=\#
PREFIX ?= /usr/local
BIN_PATH = $(PREFIX)/bin
HELPER_PATH = $(PREFIX)/lib/afl
DOC_PATH = $(PREFIX)/share/doc/afl
MISC_PATH = $(PREFIX)/share/afl
MAN_PATH = $(PREFIX)/share/man/man8
PROGNAME = afl
VERSION = $(shell grep '^$(HASH)define VERSION ' ../config.h | cut -d '"' -f2)
# PROGS intentionally omit afl-as, which gets installed elsewhere.
PROGS = afl-gcc afl-g++ afl-fuzz afl-showmap afl-tmin afl-gotcpu afl-analyze
SH_PROGS = afl-plot afl-cmin afl-cmin.bash afl-whatsup afl-system-config
MANPAGES=$(foreach p, $(PROGS) $(SH_PROGS), $(p).8) afl-as.8
ifeq "$(findstring android, $(shell $(CC) --version 2>/dev/null))" ""
ifeq "$(shell echo 'int main() {return 0; }' | $(CC) $(CFLAGS) -Werror -x c - -flto=full -o .test 2>/dev/null && echo 1 || echo 0 ; rm -f .test )" "1"
CFLAGS_FLTO ?= -flto=full
else
ifeq "$(shell echo 'int main() {return 0; }' | $(CC) $(CFLAGS) -Werror -x c - -flto=thin -o .test 2>/dev/null && echo 1 || echo 0 ; rm -f .test )" "1"
CFLAGS_FLTO ?= -flto=thin
else
ifeq "$(shell echo 'int main() {return 0; }' | $(CC) $(CFLAGS) -Werror -x c - -flto -o .test 2>/dev/null && echo 1 || echo 0 ; rm -f .test )" "1"
CFLAGS_FLTO ?= -flto
endif
endif
endif
endif
ifeq "$(shell echo 'int main() {return 0; }' | $(CC) -fno-move-loop-invariants -fdisable-tree-cunrolli -x c - -o .test 2>/dev/null && echo 1 || echo 0 ; rm -f .test )" "1"
SPECIAL_PERFORMANCE += -fno-move-loop-invariants -fdisable-tree-cunrolli
endif
ifneq "$(shell uname)" "Darwin"
ifeq "$(shell echo 'int main() {return 0; }' | $(CC) $(CFLAGS) -Werror -x c - -march=native -o .test 2>/dev/null && echo 1 || echo 0 ; rm -f .test )" "1"
ifndef SOURCE_DATE_EPOCH
#CFLAGS_OPT += -march=native
SPECIAL_PERFORMANCE += -march=native
endif
endif
# OS X does not like _FORTIFY_SOURCE=2
# _FORTIFY_SOURCE=2 does not like -O0
ifndef DEBUG
CFLAGS_OPT += -D_FORTIFY_SOURCE=2
endif
endif
ifeq "$(shell uname)" "SunOS"
CFLAGS_OPT += -Wno-format-truncation
LDFLAGS=-lkstat -lrt
endif
ifdef STATIC
$(info Compiling static version of binaries, disabling python though)
# Disable python for static compilation to simplify things
PYTHON_OK=0
PYFLAGS=
PYTHON_INCLUDE=/
CFLAGS_OPT += -static
LDFLAGS += -lm -lpthread -lz -lutil
endif
ifdef PROFILING
$(info Compiling with profiling information, for analysis: gprof ./afl-fuzz gmon.out > prof.txt)
CFLAGS_OPT += -pg -DPROFILING=1
LDFLAGS += -pg
endif
ifneq "$(shell uname -m)" "x86_64"
ifneq "$(patsubst i%86,i386,$(shell uname -m))" "i386"
ifneq "$(shell uname -m)" "amd64"
ifneq "$(shell uname -m)" "i86pc"
AFL_NO_X86=1
endif
endif
endif
endif
ifdef DEBUG
$(info Compiling DEBUG version of binaries)
CFLAGS += -ggdb3 -O0 -Wall -Wextra -Werror
else
CFLAGS ?= -O3 -funroll-loops $(CFLAGS_OPT)
endif
override CFLAGS += -g -Wno-pointer-sign -Wno-variadic-macros -Wall -Wextra -Wpointer-arith \
-I include/ -DAFL_PATH=\"$(HELPER_PATH)\" \
-DBIN_PATH=\"$(BIN_PATH)\" -DDOC_PATH=\"$(DOC_PATH)\"
ifeq "$(shell uname -s)" "FreeBSD"
override CFLAGS += -I /usr/local/include/
LDFLAGS += -L /usr/local/lib/
endif
ifeq "$(shell uname -s)" "DragonFly"
override CFLAGS += -I /usr/local/include/
LDFLAGS += -L /usr/local/lib/
endif
ifeq "$(shell uname -s)" "OpenBSD"
override CFLAGS += -I /usr/local/include/ -mno-retpoline
LDFLAGS += -Wl,-z,notext -L /usr/local/lib/
endif
ifeq "$(shell uname -s)" "NetBSD"
override CFLAGS += -I /usr/pkg/include/
LDFLAGS += -L /usr/pkg/lib/
endif
ifeq "$(shell uname -s)" "Haiku"
SHMAT_OK=0
override CFLAGS += -DUSEMMAP=1 -Wno-error=format -fPIC
LDFLAGS += -Wno-deprecated-declarations -lgnu
SPECIAL_PERFORMANCE += -DUSEMMAP=1
endif
AFL_FUZZ_FILES = $(wildcard src/afl-fuzz*.c)
ifneq "$(shell command -v python3m 2>/dev/null)" ""
ifneq "$(shell command -v python3m-config 2>/dev/null)" ""
PYTHON_INCLUDE ?= $(shell python3m-config --includes)
PYTHON_VERSION ?= $(strip $(shell python3m --version 2>&1))
# Starting with python3.8, we need to pass the `embed` flag. Earlier versions didn't know this flag.
ifeq "$(shell python3m-config --embed --libs 2>/dev/null | grep -q lpython && echo 1 )" "1"
PYTHON_LIB ?= $(shell python3m-config --libs --embed --ldflags)
else
PYTHON_LIB ?= $(shell python3m-config --ldflags)
endif
endif
endif
ifeq "$(PYTHON_INCLUDE)" ""
ifneq "$(shell command -v python3 2>/dev/null)" ""
ifneq "$(shell command -v python3-config 2>/dev/null)" ""
PYTHON_INCLUDE ?= $(shell python3-config --includes)
PYTHON_VERSION ?= $(strip $(shell python3 --version 2>&1))
# Starting with python3.8, we need to pass the `embed` flag. Earier versions didn't know this flag.
ifeq "$(shell python3-config --embed --libs 2>/dev/null | grep -q lpython && echo 1 )" "1"
PYTHON_LIB ?= $(shell python3-config --libs --embed --ldflags)
else
PYTHON_LIB ?= $(shell python3-config --ldflags)
endif
endif
endif
endif
ifeq "$(PYTHON_INCLUDE)" ""
ifneq "$(shell command -v python 2>/dev/null)" ""
ifneq "$(shell command -v python-config 2>/dev/null)" ""
PYTHON_INCLUDE ?= $(shell python-config --includes)
PYTHON_LIB ?= $(shell python-config --ldflags)
PYTHON_VERSION ?= $(strip $(shell python --version 2>&1))
endif
endif
endif
# Old Ubuntu and others dont have python/python3-config so we hardcode 3.7
ifeq "$(PYTHON_INCLUDE)" ""
ifneq "$(shell command -v python3.7 2>/dev/null)" ""
ifneq "$(shell command -v python3.7-config 2>/dev/null)" ""
PYTHON_INCLUDE ?= $(shell python3.7-config --includes)
PYTHON_LIB ?= $(shell python3.7-config --ldflags)
PYTHON_VERSION ?= $(strip $(shell python3.7 --version 2>&1))
endif
endif
endif
# Old Ubuntu and others dont have python/python2-config so we hardcode 2.7
ifeq "$(PYTHON_INCLUDE)" ""
ifneq "$(shell command -v python2.7 2>/dev/null)" ""
ifneq "$(shell command -v python2.7-config 2>/dev/null)" ""
PYTHON_INCLUDE ?= $(shell python2.7-config --includes)
PYTHON_LIB ?= $(shell python2.7-config --ldflags)
PYTHON_VERSION ?= $(strip $(shell python2.7 --version 2>&1))
endif
endif
endif
ifdef SOURCE_DATE_EPOCH
BUILD_DATE ?= $(shell date -u -d "@$(SOURCE_DATE_EPOCH)" "+%Y-%m-%d" 2>/dev/null || date -u -r "$(SOURCE_DATE_EPOCH)" "+%Y-%m-%d" 2>/dev/null || date -u "+%Y-%m-%d")
else
BUILD_DATE ?= $(shell date "+%Y-%m-%d")
endif
ifneq "$(filter Linux GNU%,$(shell uname))" ""
# _FORTIFY_SOURCE=2 does not like -O0
ifndef DEBUG
override CFLAGS += -D_FORTIFY_SOURCE=2
endif
LDFLAGS += -ldl -lrt
endif
ifneq "$(findstring FreeBSD, $(shell uname))" ""
override CFLAGS += -pthread
LDFLAGS += -lpthread
endif
ifneq "$(findstring NetBSD, $(shell uname))" ""
override CFLAGS += -pthread
LDFLAGS += -lpthread
endif
ifeq "$(findstring clang, $(shell $(CC) --version 2>/dev/null))" ""
TEST_CC = afl-gcc
else
TEST_CC = afl-clang
endif
COMM_HDR = include/alloc-inl.h include/config.h include/debug.h include/types.h
ifeq "$(shell echo '$(HASH)include <Python.h>@int main() {return 0; }' | tr @ '\n' | $(CC) $(CFLAGS) -x c - -o .test $(PYTHON_INCLUDE) $(LDFLAGS) $(PYTHON_LIB) 2>/dev/null && echo 1 || echo 0 ; rm -f .test )" "1"
PYTHON_OK=1
PYFLAGS=-DUSE_PYTHON $(PYTHON_INCLUDE) $(LDFLAGS) $(PYTHON_LIB) -DPYTHON_VERSION="\"$(PYTHON_VERSION)\""
else
PYTHON_OK=0
PYFLAGS=
endif
ifdef NO_PYTHON
PYTHON_OK=0
PYFLAGS=
endif
IN_REPO=0
ifeq "$(shell command -v git >/dev/null && git status >/dev/null 2>&1 && echo 1 || echo 0)" "1"
IN_REPO=1
endif
ifeq "$(shell command -v svn >/dev/null && svn proplist . 2>/dev/null && echo 1 || echo 0)" "1"
IN_REPO=1
endif
ifeq "$(shell echo 'int main() { return 0;}' | $(CC) $(CFLAGS) -fsanitize=address -x c - -o .test2 2>/dev/null && echo 1 || echo 0 ; rm -f .test2 )" "1"
ASAN_CFLAGS=-fsanitize=address -fstack-protector-all -fno-omit-frame-pointer
ASAN_LDFLAGS=-fsanitize=address -fstack-protector-all -fno-omit-frame-pointer
endif
ifdef ASAN_BUILD
$(info Compiling ASAN version of binaries)
override CFLAGS+=$(ASAN_CFLAGS)
LDFLAGS+=$(ASAN_LDFLAGS)
endif
ifeq "$(shell echo '$(HASH)include <sys/ipc.h>@$(HASH)include <sys/shm.h>@int main() { int _id = shmget(IPC_PRIVATE, 65536, IPC_CREAT | IPC_EXCL | 0600); shmctl(_id, IPC_RMID, 0); return 0;}' | tr @ '\n' | $(CC) $(CFLAGS) -x c - -o .test2 2>/dev/null && echo 1 || echo 0 ; rm -f .test2 )" "1"
SHMAT_OK=1
else
SHMAT_OK=0
override CFLAGS+=-DUSEMMAP=1
LDFLAGS += -Wno-deprecated-declarations
endif
ifdef TEST_MMAP
SHMAT_OK=0
override CFLAGS += -DUSEMMAP=1
LDFLAGS += -Wno-deprecated-declarations
endif
all: test_x86 test_shm test_python ready $(PROGS) afl-as test_build all_done
man: afl-gcc all $(MANPAGES)
tests: source-only
@cd test ; ./test-all.sh
@rm -f test/errors
performance-tests: performance-test
test-performance: performance-test
performance-test: source-only
@cd test ; ./test-performance.sh
# hint: make targets are also listed in the top level README.md
help:
@echo "HELP --- the following make targets exist:"
@echo "=========================================="
@echo "all: just the main afl++ binaries"
@echo "binary-only: everything for binary-only fuzzing: qemu_mode, unicorn_mode, libdislocator, libtokencap"
@echo "source-only: everything for source code fuzzing: llvm_mode, gcc_plugin, libdislocator, libtokencap"
@echo "distrib: everything (for both binary-only and source code fuzzing)"
@echo "man: creates simple man pages from the help option of the programs"
@echo "install: installs everything you have compiled with the build option above"
@echo "clean: cleans everything compiled (not downloads when on a checkout)"
@echo "deepclean: cleans everything including downloads"
@echo "code-format: format the code, do this before you commit and send a PR please!"
@echo "tests: this runs the test framework. It is more catered for the developers, but if you run into problems this helps pinpointing the problem"
@echo "unit: perform unit tests (based on cmocka and GNU linker)"
@echo "document: creates afl-fuzz-document which will only do one run and save all manipulated inputs into out/queue/mutations"
@echo "help: shows these build options :-)"
@echo "=========================================="
@echo "Recommended: \"distrib\" or \"source-only\", then \"install\""
@echo
@echo Known build environment options:
@echo "=========================================="
@echo STATIC - compile AFL++ static
@echo ASAN_BUILD - compiles with memory sanitizer for debug purposes
@echo DEBUG - no optimization, -ggdb3, all warnings and -Werror
@echo PROFILING - compile afl-fuzz with profiling information
@echo AFL_NO_X86 - if compiling on non-intel/amd platforms
@echo "=========================================="
@echo e.g.: make ASAN_BUILD=1
ifndef AFL_NO_X86
test_x86:
@echo "[*] Checking for the default compiler cc..."
@type $(CC) >/dev/null || ( echo; echo "Oops, looks like there is no compiler '"$(CC)"' in your path."; echo; echo "Don't panic! You can restart with '"$(_)" CC=<yourCcompiler>'."; echo; exit 1 )
@echo "[*] Testing the PATH environment variable..."
@test "$${PATH}" != "$${PATH#.:}" && { echo "Please remove current directory '.' from PATH to avoid recursion of 'as', thanks!"; echo; exit 1; } || :
@echo "[*] Checking for the ability to compile x86 code..."
@echo 'main() { __asm__("xorb %al, %al"); }' | $(CC) $(CFLAGS) -w -x c - -o .test1 || ( echo; echo "Oops, looks like your compiler can't generate x86 code."; echo; echo "Don't panic! You can use the LLVM or QEMU mode, but see docs/INSTALL first."; echo "(To ignore this error, set AFL_NO_X86=1 and try again.)"; echo; exit 1 )
@rm -f .test1
else
test_x86:
@echo "[!] Note: skipping x86 compilation checks (AFL_NO_X86 set)."
endif
ifeq "$(SHMAT_OK)" "1"
test_shm:
@echo "[+] shmat seems to be working."
@rm -f .test2
else
test_shm:
@echo "[-] shmat seems not to be working, switching to mmap implementation"
endif
ifeq "$(PYTHON_OK)" "1"
test_python:
@rm -f .test 2> /dev/null
@echo "[+] $(PYTHON_VERSION) support seems to be working."
else
test_python:
@echo "[-] You seem to need to install the package python3-dev, python2-dev or python-dev (and perhaps python[23]-apt), but it is optional so we continue"
endif
ready:
@echo "[+] Everything seems to be working, ready to compile."
afl-g++: afl-gcc
afl-gcc: src/afl-gcc.c $(COMM_HDR) | test_x86
$(CC) $(CFLAGS) $(CPPFLAGS) src/$@.c -o $@ $(LDFLAGS)
set -e; for i in afl-g++ afl-clang afl-clang++; do ln -sf afl-gcc $$i; done
afl-as: src/afl-as.c include/afl-as.h $(COMM_HDR) | test_x86
$(CC) $(CFLAGS) $(CPPFLAGS) src/$@.c -o $@ $(LDFLAGS)
ln -sf afl-as as
src/afl-performance.o : $(COMM_HDR) src/afl-performance.c include/hash.h
$(CC) $(CFLAGS) $(CPPFLAGS) -Iinclude $(SPECIAL_PERFORMANCE) -O3 -fno-unroll-loops -c src/afl-performance.c -o src/afl-performance.o
src/afl-common.o : $(COMM_HDR) src/afl-common.c include/common.h
$(CC) $(CFLAGS) $(CFLAGS_FLTO) $(CPPFLAGS) -c src/afl-common.c -o src/afl-common.o
src/afl-forkserver.o : $(COMM_HDR) src/afl-forkserver.c include/forkserver.h
$(CC) $(CFLAGS) $(CFLAGS_FLTO) $(CPPFLAGS) -c src/afl-forkserver.c -o src/afl-forkserver.o
src/afl-sharedmem.o : $(COMM_HDR) src/afl-sharedmem.c include/sharedmem.h
$(CC) $(CFLAGS) $(CFLAGS_FLTO) $(CPPFLAGS) -c src/afl-sharedmem.c -o src/afl-sharedmem.o
afl-fuzz: $(COMM_HDR) include/afl-fuzz.h $(AFL_FUZZ_FILES) src/afl-common.o src/afl-sharedmem.o src/afl-forkserver.o src/afl-performance.o | test_x86
$(CC) $(CFLAGS) $(COMPILE_STATIC) $(CFLAGS_FLTO) $(AFL_FUZZ_FILES) $(CPPFLAGS) src/afl-common.o src/afl-sharedmem.o src/afl-forkserver.o src/afl-performance.o -o $@ $(PYFLAGS) $(LDFLAGS)
afl-showmap: src/afl-showmap.c src/afl-common.o src/afl-sharedmem.o src/afl-forkserver.o $(COMM_HDR) | test_x86
$(CC) $(CFLAGS) $(COMPILE_STATIC) $(CFLAGS_FLTO) $(CPPFLAGS) src/$@.c src/afl-common.o src/afl-sharedmem.o src/afl-forkserver.o -o $@ $(LDFLAGS)
afl-tmin: src/afl-tmin.c src/afl-common.o src/afl-sharedmem.o src/afl-forkserver.o src/afl-performance.o $(COMM_HDR) | test_x86
$(CC) $(CFLAGS) $(COMPILE_STATIC) $(CFLAGS_FLTO) $(CPPFLAGS) src/$@.c src/afl-common.o src/afl-sharedmem.o src/afl-forkserver.o src/afl-performance.o -o $@ $(LDFLAGS)
afl-analyze: src/afl-analyze.c src/afl-common.o src/afl-sharedmem.o src/afl-performance.o $(COMM_HDR) | test_x86
$(CC) $(CFLAGS) $(COMPILE_STATIC) $(CFLAGS_FLTO) $(CPPFLAGS) src/$@.c src/afl-common.o src/afl-sharedmem.o src/afl-performance.o -o $@ $(LDFLAGS)
afl-gotcpu: src/afl-gotcpu.c src/afl-common.o $(COMM_HDR) | test_x86
$(CC) $(CFLAGS) $(COMPILE_STATIC) $(CFLAGS_FLTO) $(CPPFLAGS) src/$@.c src/afl-common.o -o $@ $(LDFLAGS)
# document all mutations and only do one run (use with only one input file!)
document: $(COMM_HDR) include/afl-fuzz.h $(AFL_FUZZ_FILES) src/afl-common.o src/afl-sharedmem.o src/afl-performance.o | test_x86
$(CC) -D_DEBUG=\"1\" -D_AFL_DOCUMENT_MUTATIONS $(CFLAGS) $(CFLAGS_FLTO) $(AFL_FUZZ_FILES) $(CPPFLAGS) src/afl-common.o src/afl-sharedmem.o src/afl-forkserver.c src/afl-performance.o -o afl-fuzz-document $(PYFLAGS) $(LDFLAGS)
test/unittests/unit_maybe_alloc.o : $(COMM_HDR) include/alloc-inl.h test/unittests/unit_maybe_alloc.c $(AFL_FUZZ_FILES)
@$(CC) $(CFLAGS) $(ASAN_CFLAGS) $(CPPFLAGS) -c test/unittests/unit_maybe_alloc.c -o test/unittests/unit_maybe_alloc.o
unit_maybe_alloc: test/unittests/unit_maybe_alloc.o
@$(CC) $(CFLAGS) $(CPPFLAGS) -Wl,--wrap=exit -Wl,--wrap=printf test/unittests/unit_maybe_alloc.o -o test/unittests/unit_maybe_alloc $(LDFLAGS) $(ASAN_LDFLAGS) -lcmocka
./test/unittests/unit_maybe_alloc
test/unittests/unit_hash.o : $(COMM_HDR) include/alloc-inl.h test/unittests/unit_hash.c $(AFL_FUZZ_FILES) src/afl-performance.o
@$(CC) $(CFLAGS) $(ASAN_CFLAGS) $(CPPFLAGS) -c test/unittests/unit_hash.c -o test/unittests/unit_hash.o
unit_hash: test/unittests/unit_hash.o src/afl-performance.o
@$(CC) $(CFLAGS) $(CPPFLAGS) -Wl,--wrap=exit -Wl,--wrap=printf $^ -o test/unittests/unit_hash $(LDFLAGS) $(ASAN_LDFLAGS) -lcmocka
./test/unittests/unit_hash
test/unittests/unit_rand.o : $(COMM_HDR) include/alloc-inl.h test/unittests/unit_rand.c $(AFL_FUZZ_FILES) src/afl-performance.o
@$(CC) $(CFLAGS) $(ASAN_CFLAGS) $(CPPFLAGS) -c test/unittests/unit_rand.c -o test/unittests/unit_rand.o
unit_rand: test/unittests/unit_rand.o src/afl-common.o src/afl-performance.o
@$(CC) $(CFLAGS) $(ASAN_CFLAGS) $(CPPFLAGS) -Wl,--wrap=exit -Wl,--wrap=printf $^ -o test/unittests/unit_rand $(LDFLAGS) $(ASAN_LDFLAGS) -lcmocka
./test/unittests/unit_rand
test/unittests/unit_list.o : $(COMM_HDR) include/list.h test/unittests/unit_list.c $(AFL_FUZZ_FILES)
@$(CC) $(CFLAGS) $(ASAN_CFLAGS) $(CPPFLAGS) -c test/unittests/unit_list.c -o test/unittests/unit_list.o
unit_list: test/unittests/unit_list.o
@$(CC) $(CFLAGS) $(ASAN_CFLAGS) $(CPPFLAGS) -Wl,--wrap=exit -Wl,--wrap=printf test/unittests/unit_list.o -o test/unittests/unit_list $(LDFLAGS) $(ASAN_LDFLAGS) -lcmocka
./test/unittests/unit_list
test/unittests/unit_preallocable.o : $(COMM_HDR) include/alloc-inl.h test/unittests/unit_preallocable.c $(AFL_FUZZ_FILES)
@$(CC) $(CFLAGS) $(ASAN_CFLAGS) $(CPPFLAGS) -c test/unittests/unit_preallocable.c -o test/unittests/unit_preallocable.o
unit_preallocable: test/unittests/unit_preallocable.o
@$(CC) $(CFLAGS) $(ASAN_CFLAGS) $(CPPFLAGS) -Wl,--wrap=exit -Wl,--wrap=printf test/unittests/unit_preallocable.o -o test/unittests/unit_preallocable $(LDFLAGS) $(ASAN_LDFLAGS) -lcmocka
./test/unittests/unit_preallocable
unit_clean:
@rm -f ./test/unittests/unit_preallocable ./test/unittests/unit_list ./test/unittests/unit_maybe_alloc test/unittests/*.o
ifneq "$(shell uname)" "Darwin"
unit: unit_maybe_alloc unit_preallocable unit_list unit_clean unit_rand unit_hash
else
unit:
@echo [-] unit tests are skipped on Darwin \(lacks GNU linker feature --wrap\)
endif
code-format:
./.custom-format.py -i src/*.c
./.custom-format.py -i include/*.h
./.custom-format.py -i libdislocator/*.c
./.custom-format.py -i libtokencap/*.c
./.custom-format.py -i llvm_mode/*.c
./.custom-format.py -i llvm_mode/*.h
./.custom-format.py -i llvm_mode/*.cc
./.custom-format.py -i gcc_plugin/*.c
@#./.custom-format.py -i gcc_plugin/*.h
./.custom-format.py -i gcc_plugin/*.cc
./.custom-format.py -i custom_mutators/*/*.c
@#./.custom-format.py -i custom_mutators/*/*.h # destroys input.h :-(
./.custom-format.py -i examples/*/*.c
./.custom-format.py -i examples/*/*.h
./.custom-format.py -i test/*.c
./.custom-format.py -i qemu_mode/patches/*.h
./.custom-format.py -i qemu_mode/libcompcov/*.c
./.custom-format.py -i qemu_mode/libcompcov/*.cc
./.custom-format.py -i qemu_mode/libcompcov/*.h
./.custom-format.py -i qbdi_mode/*.c
./.custom-format.py -i qbdi_mode/*.cpp
./.custom-format.py -i *.h
./.custom-format.py -i *.c
ifndef AFL_NO_X86
test_build: afl-gcc afl-as afl-showmap
@echo "[*] Testing the CC wrapper and instrumentation output..."
@unset AFL_USE_ASAN AFL_USE_MSAN AFL_CC; AFL_DEBUG=1 AFL_INST_RATIO=100 AFL_AS_FORCE_INSTRUMENT=1 AFL_PATH=. ./$(TEST_CC) $(CFLAGS) test-instr.c -o test-instr $(LDFLAGS) 2>&1 | grep 'afl-as' >/dev/null || (echo "Oops, afl-as did not get called from "$(TEST_CC)". This is normally achieved by "$(CC)" honoring the -B option."; exit 1 )
ASAN_OPTIONS=detect_leaks=0 ./afl-showmap -m none -q -o .test-instr0 ./test-instr < /dev/null
echo 1 | ASAN_OPTIONS=detect_leaks=0 ./afl-showmap -m none -q -o .test-instr1 ./test-instr
@rm -f test-instr
@cmp -s .test-instr0 .test-instr1; DR="$$?"; rm -f .test-instr0 .test-instr1; if [ "$$DR" = "0" ]; then echo; echo "Oops, the instrumentation does not seem to be behaving correctly!"; echo; echo "Please post to https://github.com/AFLplusplus/AFLplusplus/issues to troubleshoot the issue."; echo; exit 1; fi
@echo "[+] All right, the instrumentation seems to be working!"
else
test_build: afl-gcc afl-as afl-showmap
@echo "[!] Note: skipping build tests (you may need to use LLVM or QEMU mode)."
endif
all_done: test_build
@if [ ! "`type clang 2>/dev/null`" = "" ]; then echo "[+] LLVM users: see llvm_mode/README.md for a faster alternative to afl-gcc."; fi
@echo "[+] All done! Be sure to review the README.md - it's pretty short and useful."
@if [ "`uname`" = "Darwin" ]; then printf "\nWARNING: Fuzzing on MacOS X is slow because of the unusually high overhead of\nfork() on this OS. Consider using Linux or *BSD. You can also use VirtualBox\n(virtualbox.org) to put AFL inside a Linux or *BSD VM.\n\n"; fi
@! tty <&1 >/dev/null || printf "\033[0;30mNOTE: If you can read this, your terminal probably uses white background.\nThis will make the UI hard to read. See docs/status_screen.md for advice.\033[0m\n" 2>/dev/null
.NOTPARALLEL: clean all
clean:
rm -f $(PROGS) libradamsa.so afl-fuzz-document afl-as as afl-g++ afl-clang afl-clang++ *.o src/*.o *~ a.out core core.[1-9][0-9]* *.stackdump .test .test1 .test2 test-instr .test-instr0 .test-instr1 afl-qemu-trace afl-gcc-fast afl-gcc-pass.so afl-gcc-rt.o afl-g++-fast ld *.so *.8 test/unittests/*.o test/unittests/unit_maybe_alloc test/unittests/preallocable .afl-*
rm -rf out_dir qemu_mode/qemu-3.1.1 *.dSYM */*.dSYM
-$(MAKE) -C llvm_mode clean
-$(MAKE) -C gcc_plugin clean
$(MAKE) -C libdislocator clean
$(MAKE) -C libtokencap clean
$(MAKE) -C examples/afl_network_proxy clean
$(MAKE) -C examples/socket_fuzzing clean
$(MAKE) -C examples/argv_fuzzing clean
$(MAKE) -C qemu_mode/unsigaction clean
$(MAKE) -C qemu_mode/libcompcov clean
rm -rf qemu_mode/qemu-3.1.1
ifeq "$(IN_REPO)" "1"
test -e unicorn_mode/unicornafl/Makefile && $(MAKE) -C unicorn_mode/unicornafl clean || true
else
rm -rf qemu_mode/qemu-3.1.1.tar.xz
rm -rf unicorn_mode/unicornafl
endif
deepclean: clean
rm -rf qemu_mode/qemu-3.1.1.tar.xz
rm -rf unicorn_mode/unicornafl
git reset --hard >/dev/null 2>&1 || true
distrib: all
-$(MAKE) -C llvm_mode
-$(MAKE) -C gcc_plugin
$(MAKE) -C libdislocator
$(MAKE) -C libtokencap
$(MAKE) -C examples/afl_network_proxy
$(MAKE) -C examples/socket_fuzzing
$(MAKE) -C examples/argv_fuzzing
-cd qemu_mode && sh ./build_qemu_support.sh
cd unicorn_mode && unset CFLAGS && sh ./build_unicorn_support.sh
binary-only: all
$(MAKE) -C libdislocator
$(MAKE) -C libtokencap
$(MAKE) -C examples/afl_network_proxy
$(MAKE) -C examples/socket_fuzzing
$(MAKE) -C examples/argv_fuzzing
-cd qemu_mode && sh ./build_qemu_support.sh
cd unicorn_mode && unset CFLAGS && sh ./build_unicorn_support.sh
source-only: all
-$(MAKE) -C llvm_mode
-$(MAKE) -C gcc_plugin
$(MAKE) -C libdislocator
$(MAKE) -C libtokencap
@#$(MAKE) -C examples/afl_network_proxy
@#$(MAKE) -C examples/socket_fuzzing
@#$(MAKE) -C examples/argv_fuzzing
%.8: %
@echo .TH $* 8 $(BUILD_DATE) "afl++" > $@
@echo .SH NAME >> $@
@printf "%s" ".B $* \- " >> $@
@./$* -h 2>&1 | head -n 1 | sed -e "s/$$(printf '\e')[^m]*m//g" >> $@
@echo >> $@
@echo .SH SYNOPSIS >> $@
@./$* -h 2>&1 | head -n 3 | tail -n 1 | sed 's/^\.\///' >> $@
@echo >> $@
@echo .SH OPTIONS >> $@
@echo .nf >> $@
@./$* -hh 2>&1 | tail -n +4 >> $@
@echo >> $@
@echo .SH AUTHOR >> $@
@echo "afl++ was written by Michal \"lcamtuf\" Zalewski and is maintained by Marc \"van Hauser\" Heuse <mh@mh-sec.de>, Heiko \"hexcoder-\" Eissfeldt <heiko.eissfeldt@hexco.de>, Andrea Fioraldi <andreafioraldi@gmail.com> and Dominik Maier <domenukk@gmail.com>" >> $@
@echo The homepage of afl++ is: https://github.com/AFLplusplus/AFLplusplus >> $@
@echo >> $@
@echo .SH LICENSE >> $@
@echo Apache License Version 2.0, January 2004 >> $@
install: all $(MANPAGES)
install -d -m 755 $${DESTDIR}$(BIN_PATH) $${DESTDIR}$(HELPER_PATH) $${DESTDIR}$(DOC_PATH) $${DESTDIR}$(MISC_PATH)
rm -f $${DESTDIR}$(BIN_PATH)/afl-plot.sh
install -m 755 $(PROGS) $(SH_PROGS) $${DESTDIR}$(BIN_PATH)
rm -f $${DESTDIR}$(BIN_PATH)/afl-as
if [ -f afl-qemu-trace ]; then install -m 755 afl-qemu-trace $${DESTDIR}$(BIN_PATH); fi
if [ -f afl-gcc-fast ]; then set e; install -m 755 afl-gcc-fast $${DESTDIR}$(BIN_PATH); ln -sf afl-gcc-fast $${DESTDIR}$(BIN_PATH)/afl-g++-fast; install -m 755 afl-gcc-pass.so afl-gcc-rt.o $${DESTDIR}$(HELPER_PATH); fi
if [ -f afl-clang-fast ]; then $(MAKE) -C llvm_mode install; fi
if [ -f libdislocator.so ]; then set -e; install -m 755 libdislocator.so $${DESTDIR}$(HELPER_PATH); fi
if [ -f libtokencap.so ]; then set -e; install -m 755 libtokencap.so $${DESTDIR}$(HELPER_PATH); fi
if [ -f libcompcov.so ]; then set -e; install -m 755 libcompcov.so $${DESTDIR}$(HELPER_PATH); fi
if [ -f afl-fuzz-document ]; then set -e; install -m 755 afl-fuzz-document $${DESTDIR}$(BIN_PATH); fi
if [ -f socketfuzz32.so -o -f socketfuzz64.so ]; then $(MAKE) -C examples/socket_fuzzing install; fi
if [ -f argvfuzz32.so -o -f argvfuzz64.so ]; then $(MAKE) -C examples/argv_fuzzing install; fi
if [ -f examples/afl_network_proxy/afl-network-server ]; then $(MAKE) -C examples/afl_network_proxy install; fi
if [ -f libAFLDriver.a ]; then install -m 644 libAFLDriver.a $${DESTDIR}$(HELPER_PATH); fi
if [ -f libAFLQemuDriver.a ]; then install -m 644 libAFLQemuDriver.a $${DESTDIR}$(HELPER_PATH); fi
set -e; ln -sf afl-gcc $${DESTDIR}$(BIN_PATH)/afl-g++
set -e; if [ -f afl-clang-fast ] ; then ln -sf afl-clang-fast $${DESTDIR}$(BIN_PATH)/afl-clang ; ln -sf afl-clang-fast $${DESTDIR}$(BIN_PATH)/afl-clang++ ; else ln -sf afl-gcc $${DESTDIR}$(BIN_PATH)/afl-clang ; ln -sf afl-gcc $${DESTDIR}$(BIN_PATH)/afl-clang++; fi
mkdir -m 0755 -p ${DESTDIR}$(MAN_PATH)
install -m0644 *.8 ${DESTDIR}$(MAN_PATH)
install -m 755 afl-as $${DESTDIR}$(HELPER_PATH)
ln -sf afl-as $${DESTDIR}$(HELPER_PATH)/as
install -m 644 docs/*.md $${DESTDIR}$(DOC_PATH)
cp -r testcases/ $${DESTDIR}$(MISC_PATH)
cp -r dictionaries/ $${DESTDIR}$(MISC_PATH)

244
Makefile
View File

@ -1,230 +1,42 @@
#
# american fuzzy lop - makefile
# -----------------------------
#
# Written and maintained by Michal Zalewski <lcamtuf@google.com>
#
# Copyright 2013, 2014, 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
#
all:
@echo trying to use GNU make...
@gmake all || echo please install GNUmake
# For Heiko:
#TEST_MMAP=1
source-only:
@gmake source-only
PROGNAME = afl
VERSION = $(shell grep '^\#define VERSION ' config.h | cut -d '"' -f2)
binary-only:
@gmake binary-only
PREFIX ?= /usr/local
BIN_PATH = $(PREFIX)/bin
HELPER_PATH = $(PREFIX)/lib/afl
DOC_PATH = $(PREFIX)/share/doc/afl
MISC_PATH = $(PREFIX)/share/afl
distrib:
@gmake distrib
# PROGS intentionally omit afl-as, which gets installed elsewhere.
man:
@gmake man
PROGS = afl-gcc afl-fuzz afl-showmap afl-tmin afl-gotcpu afl-analyze
SH_PROGS = afl-plot afl-cmin afl-whatsup afl-system-config
install:
@gmake install
CFLAGS ?= -O3 -funroll-loops
CFLAGS += -Wall -D_FORTIFY_SOURCE=2 -g -Wno-pointer-sign \
-DAFL_PATH=\"$(HELPER_PATH)\" -DDOC_PATH=\"$(DOC_PATH)\" \
-DBIN_PATH=\"$(BIN_PATH)\"
document:
@gmake document
PYTHON_INCLUDE ?= /usr/include/python2.7
deepclean:
@gmake deepclean
ifneq "$(filter Linux GNU%,$(shell uname))" ""
LDFLAGS += -ldl
endif
code-format:
@gmake code-format
ifeq "$(findstring clang, $(shell $(CC) --version 2>/dev/null))" ""
TEST_CC = afl-gcc
else
TEST_CC = afl-clang
endif
help:
@gmake help
COMM_HDR = alloc-inl.h config.h debug.h types.h
tests:
@gmake tests
unit:
@gmake unit
ifeq "$(shell echo '\#include <Python.h>@int main() {return 0; }' | tr @ '\n' | $(CC) -x c - -o .test -I$(PYTHON_INCLUDE) -lpython2.7 2>/dev/null && echo 1 || echo 0 )" "1"
PYTHON_OK=1
PYFLAGS=-DUSE_PYTHON -I$(PYTHON_INCLUDE) -lpython2.7
else
PYTHON_OK=0
PYFLAGS=
endif
ifeq "$(shell echo '\#include <sys/ipc.h>@\#include <sys/shm.h>@int main() { int _id = shmget(IPC_PRIVATE, 65536, IPC_CREAT | IPC_EXCL | 0600); shmctl(_id, IPC_RMID, 0); return 0;}' | tr @ '\n' | $(CC) -x c - -o .test2 2>/dev/null && echo 1 || echo 0 )" "1"
SHMAT_OK=1
else
SHMAT_OK=0
CFLAGS+=-DUSEMMAP=1
LDFLAGS+=-Wno-deprecated-declarations -lrt
endif
ifeq "$(TEST_MMAP)" "1"
SHMAT_OK=0
CFLAGS+=-DUSEMMAP=1
LDFLAGS+=-Wno-deprecated-declarations -lrt
endif
all: test_x86 test_shm test_python27 ready $(PROGS) afl-as test_build all_done
ifndef AFL_NO_X86
test_x86:
@echo "[*] Checking for the ability to compile x86 code..."
@echo 'main() { __asm__("xorb %al, %al"); }' | $(CC) -w -x c - -o .test1 || ( echo; echo "Oops, looks like your compiler can't generate x86 code."; echo; echo "Don't panic! You can use the LLVM or QEMU mode, but see docs/INSTALL first."; echo "(To ignore this error, set AFL_NO_X86=1 and try again.)"; echo; exit 1 )
@rm -f .test1
else
test_x86:
@echo "[!] Note: skipping x86 compilation checks (AFL_NO_X86 set)."
endif
ifeq "$(SHMAT_OK)" "1"
test_shm:
@echo "[+] shmat seems to be working."
@rm -f .test2
else
test_shm:
@echo "[-] shmat seems not to be working, switching to mmap implementation"
endif
ifeq "$(PYTHON_OK)" "1"
test_python27:
@rm -f .test 2> /dev/null
@echo "[+] Python 2.7 support seems to be working."
else
test_python27:
@echo "[-] You seem to need to install the package python2.7-dev, but it is optional so we continue"
endif
ready:
@echo "[+] Everything seems to be working, ready to compile."
afl-gcc: afl-gcc.c $(COMM_HDR) | test_x86
$(CC) $(CFLAGS) $@.c -o $@ $(LDFLAGS)
set -e; for i in afl-g++ afl-clang afl-clang++; do ln -sf afl-gcc $$i; done
afl-as: afl-as.c afl-as.h $(COMM_HDR) | test_x86
$(CC) $(CFLAGS) $@.c -o $@ $(LDFLAGS)
ln -sf afl-as as
afl-common.o : afl-common.c
$(CC) $(CFLAGS) -c afl-common.c
sharedmem.o : sharedmem.c
$(CC) $(CFLAGS) -c sharedmem.c
afl-fuzz: afl-fuzz.c afl-common.o sharedmem.o $(COMM_HDR) | test_x86
$(CC) $(CFLAGS) $@.c afl-common.o sharedmem.o -o $@ $(LDFLAGS) $(PYFLAGS)
afl-showmap: afl-showmap.c afl-common.o sharedmem.o $(COMM_HDR) | test_x86
$(CC) $(CFLAGS) $@.c afl-common.o sharedmem.o -o $@ $(LDFLAGS)
afl-tmin: afl-tmin.c afl-common.o sharedmem.o $(COMM_HDR) | test_x86
$(CC) $(CFLAGS) $@.c afl-common.o sharedmem.o -o $@ $(LDFLAGS)
afl-analyze: afl-analyze.c afl-common.o sharedmem.o $(COMM_HDR) | test_x86
$(CC) $(CFLAGS) $@.c afl-common.o sharedmem.o -o $@ $(LDFLAGS)
afl-gotcpu: afl-gotcpu.c $(COMM_HDR) | test_x86
$(CC) $(CFLAGS) $@.c -o $@ $(LDFLAGS)
ifndef AFL_NO_X86
test_build: afl-gcc afl-as afl-showmap
@echo "[*] Testing the CC wrapper and instrumentation output..."
unset AFL_USE_ASAN AFL_USE_MSAN; AFL_QUIET=1 AFL_INST_RATIO=100 AFL_PATH=. ./$(TEST_CC) $(CFLAGS) test-instr.c -o test-instr $(LDFLAGS)
echo 0 | ./afl-showmap -m none -q -o .test-instr0 ./test-instr
echo 1 | ./afl-showmap -m none -q -o .test-instr1 ./test-instr
@rm -f test-instr
@cmp -s .test-instr0 .test-instr1; DR="$$?"; rm -f .test-instr0 .test-instr1; if [ "$$DR" = "0" ]; then echo; echo "Oops, the instrumentation does not seem to be behaving correctly!"; echo; echo "Please ping <lcamtuf@google.com> to troubleshoot the issue."; echo; exit 1; fi
@echo "[+] All right, the instrumentation seems to be working!"
else
test_build: afl-gcc afl-as afl-showmap
@echo "[!] Note: skipping build tests (you may need to use LLVM or QEMU mode)."
endif
all_done: test_build
@if [ ! "`which clang 2>/dev/null`" = "" ]; then echo "[+] LLVM users: see llvm_mode/README.llvm for a faster alternative to afl-gcc."; fi
@echo "[+] All done! Be sure to review the README.md - it's pretty short and useful."
@if [ "`uname`" = "Darwin" ]; then printf "\nWARNING: Fuzzing on MacOS X is slow because of the unusually high overhead of\nfork() on this OS. Consider using Linux or *BSD. You can also use VirtualBox\n(virtualbox.org) to put AFL inside a Linux or *BSD VM.\n\n"; fi
@! tty <&1 >/dev/null || printf "\033[0;30mNOTE: If you can read this, your terminal probably uses white background.\nThis will make the UI hard to read. See docs/status_screen.txt for advice.\033[0m\n" 2>/dev/null
.NOTPARALLEL: clean
unit_clean:
@gmake unit_clean
clean:
rm -f $(PROGS) afl-as as afl-g++ afl-clang afl-clang++ *.o *~ a.out core core.[1-9][0-9]* *.stackdump test .test .test1 .test2 test-instr .test-instr0 .test-instr1 qemu_mode/qemu-3.1.0.tar.xz afl-qemu-trace afl-gcc-fast afl-gcc-pass.so afl-gcc-rt.o afl-g++-fast
rm -rf out_dir qemu_mode/qemu-3.1.0
$(MAKE) -C llvm_mode clean
$(MAKE) -C libdislocator clean
$(MAKE) -C libtokencap clean
install: all
mkdir -p -m 755 $${DESTDIR}$(BIN_PATH) $${DESTDIR}$(HELPER_PATH) $${DESTDIR}$(DOC_PATH) $${DESTDIR}$(MISC_PATH)
rm -f $${DESTDIR}$(BIN_PATH)/afl-plot.sh
install -m 755 $(PROGS) $(SH_PROGS) $${DESTDIR}$(BIN_PATH)
rm -f $${DESTDIR}$(BIN_PATH)/afl-as
if [ -f afl-qemu-trace ]; then install -m 755 afl-qemu-trace $${DESTDIR}$(BIN_PATH); fi
#if [ -f afl-gcc-fast ]; then set e; install -m 755 afl-gcc-fast $${DESTDIR}$(BIN_PATH); ln -sf afl-gcc-fast $${DESTDIR}$(BIN_PATH)/afl-g++-fast; install -m 755 afl-gcc-pass.so afl-gcc-rt.o $${DESTDIR}$(HELPER_PATH); fi
ifndef AFL_TRACE_PC
if [ -f afl-clang-fast -a -f libLLVMInsTrim.so -a -f afl-llvm-rt.o ]; then set -e; install -m 755 afl-clang-fast $${DESTDIR}$(BIN_PATH); ln -sf afl-clang-fast $${DESTDIR}$(BIN_PATH)/afl-clang-fast++; install -m 755 libLLVMInsTrim.so afl-llvm-pass.so afl-llvm-rt.o $${DESTDIR}$(HELPER_PATH); fi
else
if [ -f afl-clang-fast -a -f afl-llvm-rt.o ]; then set -e; install -m 755 afl-clang-fast $${DESTDIR}$(BIN_PATH); ln -sf afl-clang-fast $${DESTDIR}$(BIN_PATH)/afl-clang-fast++; install -m 755 afl-llvm-rt.o $${DESTDIR}$(HELPER_PATH); fi
endif
if [ -f afl-llvm-rt-32.o ]; then set -e; install -m 755 afl-llvm-rt-32.o $${DESTDIR}$(HELPER_PATH); fi
if [ -f afl-llvm-rt-64.o ]; then set -e; install -m 755 afl-llvm-rt-64.o $${DESTDIR}$(HELPER_PATH); fi
if [ -f compare-transform-pass.so ]; then set -e; install -m 755 compare-transform-pass.so $${DESTDIR}$(HELPER_PATH); fi
if [ -f split-compares-pass.so ]; then set -e; install -m 755 split-compares-pass.so $${DESTDIR}$(HELPER_PATH); fi
if [ -f split-switches-pass.so ]; then set -e; install -m 755 split-switches-pass.so $${DESTDIR}$(HELPER_PATH); fi
set -e; ln -sf afl-gcc $${DESTDIR}$(BIN_PATH)/afl-g++
set -e; if [ -f afl-clang-fast ] ; then ln -sf afl-clang-fast $${DESTDIR}$(BIN_PATH)/afl-clang ; ln -sf afl-clang-fast $${DESTDIR}$(BIN_PATH)/afl-clang++ ; else ln -sf afl-gcc $${DESTDIR}$(BIN_PATH)/afl-clang ; ln -sf afl-gcc $${DESTDIR}$(BIN_PATH)/afl-clang++; fi
install -m 755 afl-as $${DESTDIR}$(HELPER_PATH)
ln -sf afl-as $${DESTDIR}$(HELPER_PATH)/as
install -m 644 docs/README.md docs/ChangeLog docs/*.txt $${DESTDIR}$(DOC_PATH)
cp -r testcases/ $${DESTDIR}$(MISC_PATH)
cp -r dictionaries/ $${DESTDIR}$(MISC_PATH)
publish: clean
# test "`basename $$PWD`" = "afl" || exit 1
# test -f ~/www/afl/releases/$(PROGNAME)-$(VERSION).tgz; if [ "$$?" = "0" ]; then echo; echo "Change program version in config.h, mmkay?"; echo; exit 1; fi
# cd ..; rm -rf $(PROGNAME)-$(VERSION); cp -pr $(PROGNAME) $(PROGNAME)-$(VERSION); \
# tar -cvz -f ~/www/afl/releases/$(PROGNAME)-$(VERSION).tgz $(PROGNAME)-$(VERSION)
# chmod 644 ~/www/afl/releases/$(PROGNAME)-$(VERSION).tgz
# ( cd ~/www/afl/releases/; ln -s -f $(PROGNAME)-$(VERSION).tgz $(PROGNAME)-latest.tgz )
# cat docs/README.md >~/www/afl/README.txt
# cat docs/status_screen.txt >~/www/afl/status_screen.txt
# cat docs/historical_notes.txt >~/www/afl/historical_notes.txt
# cat docs/technical_details.txt >~/www/afl/technical_details.txt
# cat docs/ChangeLog >~/www/afl/ChangeLog.txt
# cat docs/QuickStartGuide.txt >~/www/afl/QuickStartGuide.txt
# echo -n "$(VERSION)" >~/www/afl/version.txt
@gmake clean

View File

@ -1 +0,0 @@
docs/PATCHES

1
QuickStartGuide.md Symbolic link
View File

@ -0,0 +1 @@
docs/QuickStartGuide.md

View File

@ -1 +0,0 @@
docs/QuickStartGuide.txt

1027
README.md

File diff suppressed because it is too large Load Diff

34
TODO
View File

@ -1,34 +0,0 @@
Roadmap 2.53d:
==============
- indent all the code: clang-format -style=Google
- update docs/sister_projects.txt
afl-fuzz:
- put mutator, scheduler, forkserver and input channels in individual files
- reuse forkserver for showmap, afl-cmin, etc.
gcc_plugin:
- needs to be rewritten
- fix crashes when compiling :(
- whitelist support
- skip over uninteresting blocks
- laf-intel
- neverZero
qemu_mode:
- deferred mode with AFL_DEFERRED_QEMU=0xaddress
unit testing / or large testcase campaign
Roadmap 2.54d:
==============
- expand MAP size to 256k (current L2 cache size on processors)
-> 18 bit map
- llvm_mode: dynamic map size and collission free basic block IDs
qemu_mode:
- persistent mode patching the return address (WinAFL style)
- instrument only comparison with immediate values by default when using compcov

42
TODO.md Normal file
View File

@ -0,0 +1,42 @@
# TODO list for AFL++
## Roadmap 2.68+
- AFL_MAP_SIZE for qemu_mode and unicorn_mode
- CPU affinity for many cores? There seems to be an issue > 96 cores
- afl-plot to support multiple plot_data
- afl_custom_fuzz_splice_optin()
- intel-pt tracer
## Further down the road
afl-fuzz:
- setting min_len/max_len/start_offset/end_offset limits for mutation output
- add __sanitizer_cov_trace_cmp* support via shmem
llvm_mode:
- add __sanitizer_cov_trace_cmp* support
gcc_plugin:
- (wait for submission then decide)
qemu_mode:
- non colliding instrumentation
- rename qemu specific envs to AFL_QEMU (AFL_ENTRYPOINT, AFL_CODE_START/END,
AFL_COMPCOV_LEVEL?)
- add AFL_QEMU_EXITPOINT (maybe multiple?), maybe pointless as we have
persistent mode
- add/implement AFL_QEMU_INST_LIBLIST and AFL_QEMU_NOINST_PROGRAM
- add/implement AFL_QEMU_INST_REGIONS as a list of _START/_END addresses
## Ideas
- LTO/sancov: write current edge to prev_loc and use that information when
using cmplog or __sanitizer_cov_trace_cmp*. maybe we can deduct by follow
up edge numbers that both following cmp paths have been found and then
disable working on this edge id -> cmplog_intelligence branch
- new tancov: use some lightweight taint analysis to see which parts of a
new queue entry is accessed and only fuzz these bytes - or better, only
fuzz those bytes that are newly in coverage compared to the queue entry
the new one is based on -> taint branch, not useful :-(

File diff suppressed because it is too large Load Diff

911
afl-cmin
View File

@ -1,467 +1,510 @@
#!/usr/bin/env bash
#!/usr/bin/env sh
export AFL_QUIET=1
export ASAN_OPTIONS=detect_leaks=0
THISPATH=`dirname ${0}`
export PATH="${THISPATH}:$PATH"
awk -f - -- ${@+"$@"} <<'EOF'
#!/usr/bin/awk -f
# awk script to minimize a test corpus of input files
#
# american fuzzy lop - corpus minimization tool
# ---------------------------------------------
# based on afl-cmin bash script written by Michal Zalewski
# rewritten by Heiko Eißfeldt (hexcoder-)
# tested with:
# gnu awk (x86 Linux)
# bsd awk (x86 *BSD)
# mawk (arm32 raspbian)
#
# Written and maintained by Michal Zalewski <lcamtuf@google.com>
#
# Copyright 2014, 2015 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 tool tries to find the smallest subset of files in the input directory
# that still trigger the full range of instrumentation data points seen in
# the starting corpus. This has two uses:
#
# - Screening large corpora of input files before using them as a seed for
# afl-fuzz. The tool will remove functionally redundant files and likely
# leave you with a much smaller set.
#
# (In this case, you probably also want to consider running afl-tmin on
# the individual files later on to reduce their size.)
#
# - Minimizing the corpus generated organically by afl-fuzz, perhaps when
# planning to feed it to more resource-intensive tools. The tool achieves
# this by removing all entries that used to trigger unique behaviors in the
# past, but have been made obsolete by later finds.
#
# Note that the tool doesn't modify the files themselves. For that, you want
# afl-tmin.
#
# This script must use bash because other shells may have hardcoded limits on
# array sizes.
# uses getopt.awk package from Arnold Robbins
#
# external tools used by this script:
# test
# grep
# rm
# mkdir
# ln
# cp
# pwd
# type
# cd
# find
# stat
# sort
# cut
# and afl-showmap from this project :-)
echo "corpus minimization tool for afl-fuzz by <lcamtuf@google.com>"
echo
# getopt.awk --- Do C library getopt(3) function in awk
#########
# SETUP #
#########
# External variables:
# Optind -- index in ARGV of first nonoption argument
# Optarg -- string value of argument to current option
# Opterr -- if nonzero, print our own diagnostic
# Optopt -- current option letter
# Process command-line options...
# Returns:
# -1 at end of options
# "?" for unrecognized option
# <c> a character representing the current option
MEM_LIMIT=100
TIMEOUT=none
# Private Data:
# _opti -- index in multiflag option, e.g., -abc
unset IN_DIR OUT_DIR STDIN_FILE EXTRA_PAR MEM_LIMIT_GIVEN \
AFL_CMIN_CRASHES_ONLY AFL_CMIN_ALLOW_ANY QEMU_MODE UNICORN_MODE
function getopt(argc, argv, options, thisopt, i)
{
if (length(options) == 0) # no options given
return -1
while getopts "+i:o:f:m:t:eQUC" opt; do
if (argv[Optind] == "--") { # all done
Optind++
_opti = 0
return -1
} else if (argv[Optind] !~ /^-[^:\t ]/) {
_opti = 0
return -1
}
if (_opti == 0)
_opti = 2
thisopt = substr(argv[Optind], _opti, 1)
Optopt = thisopt
i = index(options, thisopt)
if (i == 0) {
if (Opterr)
printf("%c -- invalid option\n", thisopt) > "/dev/stderr"
if (_opti >= length(argv[Optind])) {
Optind++
_opti = 0
} else
_opti++
return "?"
}
if (substr(options, i + 1, 1) == ":") {
# get option argument
if (length(substr(argv[Optind], _opti + 1)) > 0)
Optarg = substr(argv[Optind], _opti + 1)
else
Optarg = argv[++Optind]
_opti = 0
} else
Optarg = ""
if (_opti == 0 || _opti >= length(argv[Optind])) {
Optind++
_opti = 0
} else
_opti++
return thisopt
}
case "$opt" in
function usage() {
print \
"afl-cmin [ options ] -- /path/to/target_app [ ... ]\n" \
"\n" \
"Required parameters:\n" \
" -i dir - input directory with starting corpus\n" \
" -o dir - output directory for minimized files\n" \
"\n" \
"Execution control settings:\n" \
" -f file - location read by the fuzzed program (stdin)\n" \
" -m megs - memory limit for child process ("mem_limit" MB)\n" \
" -t msec - run time limit for child process (none)\n" \
" -Q - use binary-only instrumentation (QEMU mode)\n" \
" -U - use unicorn-based instrumentation (unicorn mode)\n" \
"\n" \
"Minimization settings:\n" \
" -C - keep crashing inputs, reject everything else\n" \
" -e - solve for edge coverage only, ignore hit counts\n" \
"\n" \
"For additional tips, please consult docs/README.md\n" \
"\n" \
"Environment variables used:\n" \
"AFL_KEEP_TRACES: leave the temporary <out_dir>/.traces directory\n" \
"AFL_PATH: path for the afl-showmap binary\n" \
"AFL_SKIP_BIN_CHECK: skip check for target binary\n" \
"AFL_ALLOW_TMP: allow unsafe use of input/output directories under {/var}/tmp\n"
"AFL_FORKSRV_INIT_TMOUT: time the fuzzer waits for the target to come up, initially\n"
exit 1
}
"i")
IN_DIR="$OPTARG"
;;
function exists_and_is_executable(binarypath) {
return 0 == system("test -f "binarypath" -a -x "binarypath)
}
"o")
OUT_DIR="$OPTARG"
;;
"f")
STDIN_FILE="$OPTARG"
;;
"m")
MEM_LIMIT="$OPTARG"
MEM_LIMIT_GIVEN=1
;;
"t")
TIMEOUT="$OPTARG"
;;
"e")
EXTRA_PAR="$EXTRA_PAR -e"
;;
"C")
export AFL_CMIN_CRASHES_ONLY=1
;;
"Q")
EXTRA_PAR="$EXTRA_PAR -Q"
test "$MEM_LIMIT_GIVEN" = "" && MEM_LIMIT=250
QEMU_MODE=1
;;
"U")
EXTRA_PAR="$EXTRA_PAR -U"
test "$MEM_LIMIT_GIVEN" = "" && MEM_LIMIT=250
UNICORN_MODE=1
;;
"?")
exit 1
;;
BEGIN {
print "corpus minimization tool for afl++ (awk version)\n"
esac
# defaults
extra_par = ""
# process options
Opterr = 1 # default is to diagnose
Optind = 1 # skip ARGV[0]
while ((_go_c = getopt(ARGC, ARGV, "hi:o:f:m:t:eCQU?")) != -1) {
if (_go_c == "i") {
if (!Optarg) usage()
if (in_dir) { print "Option "_go_c" is only allowed once" > "/dev/stderr"}
in_dir = Optarg
continue
} else
if (_go_c == "o") {
if (!Optarg) usage()
if (out_dir) { print "Option "_go_c" is only allowed once" > "/dev/stderr"}
out_dir = Optarg
continue
} else
if (_go_c == "f") {
if (!Optarg) usage()
if (stdin_file) { print "Option "_go_c" is only allowed once" > "/dev/stderr"}
stdin_file = Optarg
continue
} else
if (_go_c == "m") {
if (!Optarg) usage()
if (mem_limit) { print "Option "_go_c" is only allowed once" > "/dev/stderr"}
mem_limit = Optarg
mem_limit_given = 1
continue
} else
if (_go_c == "t") {
if (!Optarg) usage()
if (timeout) { print "Option "_go_c" is only allowed once" > "/dev/stderr"}
timeout = Optarg
continue
} else
if (_go_c == "C") {
ENVIRON["AFL_CMIN_CRASHES_ONLY"] = 1
continue
} else
if (_go_c == "e") {
extra_par = extra_par " -e"
continue
} else
if (_go_c == "Q") {
if (qemu_mode) { print "Option "_go_c" is only allowed once" > "/dev/stderr"}
extra_par = extra_par " -Q"
if ( !mem_limit_given ) mem_limit = "250"
qemu_mode = 1
continue
} else
if (_go_c == "U") {
if (unicorn_mode) { print "Option "_go_c" is only allowed once" > "/dev/stderr"}
extra_par = extra_par " -U"
if ( !mem_limit_given ) mem_limit = "250"
unicorn_mode = 1
continue
} else
if (_go_c == "?") {
exit 1
} else
usage()
} # while options
done
if (!mem_limit) mem_limit = 200
if (!timeout) timeout = "none"
shift $((OPTIND-1))
# get program args
i = 0
prog_args_string = ""
for (; Optind < ARGC; Optind++) {
prog_args[i++] = ARGV[Optind]
if (i > 1)
prog_args_string = prog_args_string" "ARGV[Optind]
}
TARGET_BIN="$1"
# sanity checks
if (!prog_args[0] || !in_dir || !out_dir) usage()
if [ "$TARGET_BIN" = "" -o "$IN_DIR" = "" -o "$OUT_DIR" = "" ]; then
target_bin = prog_args[0]
cat 1>&2 <<_EOF_
Usage: $0 [ options ] -- /path/to/target_app [ ... ]
# Do a sanity check to discourage the use of /tmp, since we can't really
# handle this safely from an awk script.
Required parameters:
if (!ENVIRON["AFL_ALLOW_TMP"]) {
dirlist[0] = in_dir
dirlist[1] = target_bin
dirlist[2] = out_dir
dirlist[3] = stdin_file
"pwd" | getline dirlist[4] # current directory
for (dirind in dirlist) {
dir = dirlist[dirind]
-i dir - input directory with the starting corpus
-o dir - output directory for minimized files
if (dir ~ /^(\/var)?\/tmp/) {
print "[-] Error: do not use this script in /tmp or /var/tmp." > "/dev/stderr"
exit 1
}
}
delete dirlist
}
Execution control settings:
# If @@ is specified, but there's no -f, let's come up with a temporary input
# file name.
-f file - location read by the fuzzed program (stdin)
-m megs - memory limit for child process ($MEM_LIMIT MB)
-t msec - run time limit for child process (none)
-Q - use binary-only instrumentation (QEMU mode)
-U - use unicorn-based instrumentation (Unicorn mode)
trace_dir = out_dir "/.traces"
if (!stdin_file) {
found_atat = 0
for (prog_args_ind in prog_args) {
if ("@@" == prog_args[prog_args_ind]) {
found_atat = 1
break
}
}
if (found_atat) {
stdin_file = trace_dir "/.cur_input"
}
}
# Check for obvious errors.
if (mem_limit && mem_limit != "none" && mem_limit < 5) {
print "[-] Error: dangerously low memory limit." > "/dev/stderr"
exit 1
}
if (timeout && timeout != "none" && timeout < 10) {
print "[-] Error: dangerously low timeout." > "/dev/stderr"
exit 1
}
if (target_bin && !exists_and_is_executable(target_bin)) {
"command -v "target_bin" 2>/dev/null" | getline tnew
if (!tnew || !exists_and_is_executable(tnew)) {
print "[-] Error: binary '"target_bin"' not found or not executable." > "/dev/stderr"
exit 1
}
target_bin = tnew
}
if (!ENVIRON["AFL_SKIP_BIN_CHECK"] && !qemu_mode && !unicorn_mode) {
if (0 != system( "grep -q __AFL_SHM_ID "target_bin )) {
print "[-] Error: binary '"target_bin"' doesn't appear to be instrumented." > "/dev/stderr"
exit 1
}
}
if (0 != system( "test -d "in_dir )) {
print "[-] Error: directory '"in_dir"' not found." > "/dev/stderr"
exit 1
}
if (0 == system( "test -d "in_dir"/queue" )) {
in_dir = in_dir "/queue"
}
system("rm -rf "trace_dir" 2>/dev/null");
system("rm "out_dir"/id[:_]* 2>/dev/null")
"ls "out_dir"/* 2>/dev/null | wc -l" | getline noofentries
if (0 == system( "test -d "out_dir" -a "noofentries" -gt 0" )) {
print "[-] Error: directory '"out_dir"' exists and is not empty - delete it first." > "/dev/stderr"
exit 1
}
# Check for the more efficient way to copy files...
if (0 != system("mkdir -p -m 0700 "trace_dir)) {
print "[-] Error: Cannot create directory "trace_dir > "/dev/stderr"
exit 1
}
if (stdin_file) {
# truncate input file
printf "" > stdin_file
close( stdin_file )
}
if (!ENVIRON["AFL_PATH"]) {
if (0 == system("test -f afl-cmin")) {
showmap = "./afl-showmap"
} else {
"command -v afl-showmap 2>/dev/null" | getline showmap
}
} else {
showmap = ENVIRON["AFL_PATH"] "/afl-showmap"
}
if (!showmap || 0 != system("test -x "showmap )) {
print "[-] Error: can't find 'afl-showmap' - please set AFL_PATH." > "/dev/stderr"
exit 1
}
# get list of input filenames sorted by size
i = 0
# yuck, gnu stat is option incompatible to bsd stat
# we use a heuristic to differentiate between
# GNU stat and other stats
"stat --version 2>/dev/null" | getline statversion
if (statversion ~ /GNU coreutils/) {
stat_format = "-c '%s %n'" # GNU
} else {
stat_format = "-f '%z %N'" # *BSD, MacOS
}
cmdline = "cd "in_dir" && find . \\( ! -name . -a -type d -prune \\) -o -type f -exec stat "stat_format" \\{\\} \\; | sort -k1n -k2r"
cmdline = "ls "in_dir" | (cd "in_dir" && xargs stat "stat_format") | sort -k1n -k2r"
while (cmdline | getline) {
sub(/^[0-9]+ (\.\/)?/,"",$0)
infilesSmallToBig[i++] = $0
}
in_count = i
first_file = infilesSmallToBig[0]
Minimization settings:
# Make sure that we're not dealing with a directory.
-C - keep crashing inputs, reject everything else
-e - solve for edge coverage only, ignore hit counts
For additional tips, please consult docs/README.
_EOF_
exit 1
fi
# Do a sanity check to discourage the use of /tmp, since we can't really
# handle this safely from a shell script.
if [ "$AFL_ALLOW_TMP" = "" ]; then
echo "$IN_DIR" | grep -qE '^(/var)?/tmp/'
T1="$?"
echo "$TARGET_BIN" | grep -qE '^(/var)?/tmp/'
T2="$?"
echo "$OUT_DIR" | grep -qE '^(/var)?/tmp/'
T3="$?"
echo "$STDIN_FILE" | grep -qE '^(/var)?/tmp/'
T4="$?"
echo "$PWD" | grep -qE '^(/var)?/tmp/'
T5="$?"
if [ "$T1" = "0" -o "$T2" = "0" -o "$T3" = "0" -o "$T4" = "0" -o "$T5" = "0" ]; then
echo "[-] Error: do not use this script in /tmp or /var/tmp." 1>&2
if (0 == system("test -d "in_dir"/"first_file)) {
print "[-] Error: The input directory contains subdirectories - please fix." > "/dev/stderr"
exit 1
fi
}
fi
if (0 == system("ln "in_dir"/"first_file" "trace_dir"/.link_test")) {
cp_tool = "ln"
} else {
cp_tool = "cp"
}
# If @@ is specified, but there's no -f, let's come up with a temporary input
# file name.
# Make sure that we can actually get anything out of afl-showmap before we
# waste too much time.
TRACE_DIR="$OUT_DIR/.traces"
print "[*] Testing the target binary..."
if [ "$STDIN_FILE" = "" ]; then
if (!stdin_file) {
system( "AFL_CMIN_ALLOW_ANY=1 \""showmap"\" -m "mem_limit" -t "timeout" -o \""trace_dir"/.run_test\" -Z "extra_par" -- \""target_bin"\" "prog_args_string" <\""in_dir"/"first_file"\"")
} else {
system("cp "in_dir"/"first_file" "stdin_file)
system( "AFL_CMIN_ALLOW_ANY=1 \""showmap"\" -m "mem_limit" -t "timeout" -o \""trace_dir"/.run_test\" -Z "extra_par" -A \""stdin_file"\" -- \""target_bin"\" "prog_args_string" </dev/null")
}
if echo "$*" | grep -qF '@@'; then
STDIN_FILE="$TRACE_DIR/.cur_input"
fi
first_count = 0
fi
runtest = trace_dir"/.run_test"
while ((getline < runtest) > 0) {
++first_count
}
# Check for obvious errors.
if [ ! "$MEM_LIMIT" = "none" ]; then
if [ "$MEM_LIMIT" -lt "5" ]; then
echo "[-] Error: dangerously low memory limit." 1>&2
if (first_count) {
print "[+] OK, "first_count" tuples recorded."
} else {
print "[-] Error: no instrumentation output detected (perhaps crash or timeout)." > "/dev/stderr"
if (!ENVIRON["AFL_KEEP_TRACES"]) {
system("rm -rf "trace_dir" 2>/dev/null")
}
exit 1
fi
fi
if [ ! "$TIMEOUT" = "none" ]; then
if [ "$TIMEOUT" -lt "10" ]; then
echo "[-] Error: dangerously low timeout." 1>&2
exit 1
fi
fi
if [ ! -f "$TARGET_BIN" -o ! -x "$TARGET_BIN" ]; then
TNEW="`which "$TARGET_BIN" 2>/dev/null`"
if [ ! -f "$TNEW" -o ! -x "$TNEW" ]; then
echo "[-] Error: binary '$TARGET_BIN' not found or not executable." 1>&2
exit 1
fi
TARGET_BIN="$TNEW"
fi
if [ "$AFL_SKIP_BIN_CHECK" = "" -a "$QEMU_MODE" = "" -a "$UNICORN_MODE" = "" ]; then
if ! grep -qF "__AFL_SHM_ID" "$TARGET_BIN"; then
echo "[-] Error: binary '$TARGET_BIN' doesn't appear to be instrumented." 1>&2
exit 1
fi
fi
if [ ! -d "$IN_DIR" ]; then
echo "[-] Error: directory '$IN_DIR' not found." 1>&2
exit 1
fi
test -d "$IN_DIR/queue" && IN_DIR="$IN_DIR/queue"
find "$OUT_DIR" -name 'id[:_]*' -maxdepth 1 -exec rm -- {} \; 2>/dev/null
rm -rf "$TRACE_DIR" 2>/dev/null
rmdir "$OUT_DIR" 2>/dev/null
if [ -d "$OUT_DIR" ]; then
echo "[-] Error: directory '$OUT_DIR' exists and is not empty - delete it first." 1>&2
exit 1
fi
mkdir -m 700 -p "$TRACE_DIR" || exit 1
if [ ! "$STDIN_FILE" = "" ]; then
rm -f "$STDIN_FILE" || exit 1
touch "$STDIN_FILE" || exit 1
fi
if [ "$AFL_PATH" = "" ]; then
SHOWMAP="${0%/afl-cmin}/afl-showmap"
else
SHOWMAP="$AFL_PATH/afl-showmap"
fi
if [ ! -x "$SHOWMAP" ]; then
echo "[-] Error: can't find 'afl-showmap' - please set AFL_PATH." 1>&2
rm -rf "$TRACE_DIR"
exit 1
fi
IN_COUNT=$((`ls -- "$IN_DIR" 2>/dev/null | wc -l`))
if [ "$IN_COUNT" = "0" ]; then
echo "[+] Hmm, no inputs in the target directory. Nothing to be done."
rm -rf "$TRACE_DIR"
exit 1
fi
FIRST_FILE=`ls "$IN_DIR" | head -1`
# Make sure that we're not dealing with a directory.
if [ -d "$IN_DIR/$FIRST_FILE" ]; then
echo "[-] Error: The target directory contains subdirectories - please fix." 1>&2
rm -rf "$TRACE_DIR"
exit 1
fi
# Check for the more efficient way to copy files...
if ln "$IN_DIR/$FIRST_FILE" "$TRACE_DIR/.link_test" 2>/dev/null; then
CP_TOOL=ln
else
CP_TOOL=cp
fi
# Make sure that we can actually get anything out of afl-showmap before we
# waste too much time.
echo "[*] Testing the target binary..."
if [ "$STDIN_FILE" = "" ]; then
AFL_CMIN_ALLOW_ANY=1 "$SHOWMAP" -m "$MEM_LIMIT" -t "$TIMEOUT" -o "$TRACE_DIR/.run_test" -Z $EXTRA_PAR -- "$@" <"$IN_DIR/$FIRST_FILE"
else
cp "$IN_DIR/$FIRST_FILE" "$STDIN_FILE"
AFL_CMIN_ALLOW_ANY=1 "$SHOWMAP" -m "$MEM_LIMIT" -t "$TIMEOUT" -o "$TRACE_DIR/.run_test" -Z $EXTRA_PAR -A "$STDIN_FILE" -- "$@" </dev/null
fi
FIRST_COUNT=$((`grep -c . "$TRACE_DIR/.run_test"`))
if [ "$FIRST_COUNT" -gt "0" ]; then
echo "[+] OK, $FIRST_COUNT tuples recorded."
else
echo "[-] Error: no instrumentation output detected (perhaps crash or timeout)." 1>&2
test "$AFL_KEEP_TRACES" = "" && rm -rf "$TRACE_DIR"
exit 1
fi
# Let's roll!
#############################
# STEP 1: COLLECTING TRACES #
#############################
echo "[*] Obtaining traces for input files in '$IN_DIR'..."
(
CUR=0
if [ "$STDIN_FILE" = "" ]; then
while read -r fn; do
CUR=$((CUR+1))
printf "\\r Processing file $CUR/$IN_COUNT... "
"$SHOWMAP" -m "$MEM_LIMIT" -t "$TIMEOUT" -o "$TRACE_DIR/$fn" -Z $EXTRA_PAR -- "$@" <"$IN_DIR/$fn"
done < <(ls "$IN_DIR")
else
while read -r fn; do
CUR=$((CUR+1))
printf "\\r Processing file $CUR/$IN_COUNT... "
cp "$IN_DIR/$fn" "$STDIN_FILE"
"$SHOWMAP" -m "$MEM_LIMIT" -t "$TIMEOUT" -o "$TRACE_DIR/$fn" -Z $EXTRA_PAR -A "$STDIN_FILE" -- "$@" </dev/null
done < <(ls "$IN_DIR")
fi
)
echo
##########################
# STEP 2: SORTING TUPLES #
##########################
# With this out of the way, we sort all tuples by popularity across all
# datasets. The reasoning here is that we won't be able to avoid the files
# that trigger unique tuples anyway, so we will want to start with them and
# see what's left.
echo "[*] Sorting trace sets (this may take a while)..."
ls "$IN_DIR" | sed "s#^#$TRACE_DIR/#" | tr '\n' '\0' | xargs -0 -n 1 cat | \
sort | uniq -c | sort -k 1,1 -n >"$TRACE_DIR/.all_uniq"
TUPLE_COUNT=$((`grep -c . "$TRACE_DIR/.all_uniq"`))
echo "[+] Found $TUPLE_COUNT unique tuples across $IN_COUNT files."
#####################################
# STEP 3: SELECTING CANDIDATE FILES #
#####################################
# The next step is to find the best candidate for each tuple. The "best"
# part is understood simply as the smallest input that includes a particular
# tuple in its trace. Empirical evidence suggests that this produces smaller
# datasets than more involved algorithms that could be still pulled off in
# a shell script.
echo "[*] Finding best candidates for each tuple..."
CUR=0
while read -r fn; do
CUR=$((CUR+1))
printf "\\r Processing file $CUR/$IN_COUNT... "
sed "s#\$# $fn#" "$TRACE_DIR/$fn" >>"$TRACE_DIR/.candidate_list"
done < <(ls -rS "$IN_DIR")
echo
##############################
# STEP 4: LOADING CANDIDATES #
##############################
# At this point, we have a file of tuple-file pairs, sorted by file size
# in ascending order (as a consequence of ls -rS). By doing sort keyed
# only by tuple (-k 1,1) and configured to output only the first line for
# every key (-s -u), we end up with the smallest file for each tuple.
echo "[*] Sorting candidate list (be patient)..."
sort -k1,1 -s -u "$TRACE_DIR/.candidate_list" | \
sed 's/^/BEST_FILE[/;s/ /]="/;s/$/"/' >"$TRACE_DIR/.candidate_script"
if [ ! -s "$TRACE_DIR/.candidate_script" ]; then
echo "[-] Error: no traces obtained from test cases, check syntax!" 1>&2
test "$AFL_KEEP_TRACES" = "" && rm -rf "$TRACE_DIR"
exit 1
fi
# The sed command converted the sorted list to a shell script that populates
# BEST_FILE[tuple]="fname". Let's load that!
. "$TRACE_DIR/.candidate_script"
##########################
# STEP 5: WRITING OUTPUT #
##########################
# The final trick is to grab the top pick for each tuple, unless said tuple is
# already set due to the inclusion of an earlier candidate; and then put all
# tuples associated with the newly-added file to the "already have" list. The
# loop works from least popular tuples and toward the most common ones.
echo "[*] Processing candidates and writing output files..."
CUR=0
touch "$TRACE_DIR/.already_have"
while read -r cnt tuple; do
CUR=$((CUR+1))
printf "\\r Processing tuple $CUR/$TUPLE_COUNT... "
# If we already have this tuple, skip it.
grep -q "^$tuple\$" "$TRACE_DIR/.already_have" && continue
FN=${BEST_FILE[tuple]}
$CP_TOOL "$IN_DIR/$FN" "$OUT_DIR/$FN"
if [ "$((CUR % 5))" = "0" ]; then
sort -u "$TRACE_DIR/$FN" "$TRACE_DIR/.already_have" >"$TRACE_DIR/.tmp"
mv -f "$TRACE_DIR/.tmp" "$TRACE_DIR/.already_have"
else
cat "$TRACE_DIR/$FN" >>"$TRACE_DIR/.already_have"
fi
done <"$TRACE_DIR/.all_uniq"
echo
OUT_COUNT=`ls -- "$OUT_DIR" | wc -l`
if [ "$OUT_COUNT" = "1" ]; then
echo "[!] WARNING: All test cases had the same traces, check syntax!"
fi
echo "[+] Narrowed down to $OUT_COUNT files, saved in '$OUT_DIR'."
echo
test "$AFL_KEEP_TRACES" = "" && rm -rf "$TRACE_DIR"
exit 0
}
# Let's roll!
#############################
# STEP 1: Collecting traces #
#############################
print "[*] Obtaining traces for "in_count" input files in '"in_dir"'."
cur = 0;
if (!stdin_file) {
print " Processing "in_count" files (forkserver mode)..."
retval = system( "AFL_CMIN_ALLOW_ANY=1 \""showmap"\" -m "mem_limit" -t "timeout" -o \""trace_dir"\" -Z "extra_par" -i \""in_dir"\" -- \""target_bin"\" "prog_args_string)
} else {
print " Processing "in_count" files (forkserver mode)..."
retval = system( "AFL_CMIN_ALLOW_ANY=1 \""showmap"\" -m "mem_limit" -t "timeout" -o \""trace_dir"\" -Z "extra_par" -i \""in_dir"\" -- \""target_bin"\" "prog_args_string" </dev/null")
}
if (retval) {
print "[!]Exit code != 0 received from afl-showmap, terminating..."
if (!ENVIRON["AFL_KEEP_TRACES"]) {
system("rm -rf "trace_dir" 2>/dev/null")
system("rmdir "out_dir)
}
exit retval
}
#######################################################
# STEP 2: register smallest input file for each tuple #
# STEP 3: copy that file (at most once) #
#######################################################
print "[*] Processing traces for input files in '"in_dir"'."
cur = 0
out_count = 0
tuple_count = 0
# from rare to frequent new tuples
# get the best (smallest) file for it
# and copy it
while (cur < in_count) {
fn = infilesSmallToBig[cur]
++cur
printf "\r Processing file "cur"/"in_count
# create path for the trace file from afl-showmap
tracefile_path = trace_dir"/"fn
# gather all keys, and count them
while ((getline line < tracefile_path) > 0) {
key = line
if (!(key in key_count)) {
++tuple_count
}
++key_count[key]
if (! (key in best_file)) {
# this is the best file for this key
best_file[key] = fn
#printf "BEST_FILE[%d]=\"%s\"\n",key,fn | "sort -t'[' -k2 > "trace_dir"/.candidate_script"
}
#printf "%d %s\n",key,fn > trace_dir"/.candidate_list"
}
close(tracefile_path)
}
print ""
# sort keys
sortedKeys = trace_dir"/.all_uniq"
sortKeysCmd = "sort -k1n > "sortedKeys
for (key in key_count) {
printf "%7d %s\n",key_count[key],key | sortKeysCmd
}
close(sortKeysCmd)
# iterate over keys from rare to frequent and
# copy best file
while ((getline < sortedKeys) > 0) {
# split
nrFields = split($0, field, / +/)
#print nrFields" Felder: '"field[0]"', '"field[1]"', '"field[2]"', '"field[3]"'"
key = field[nrFields]
++tcnt;
printf "\r Processing tuple "tcnt"/"tuple_count" with count "key_count[key]"..."
if (key in keyAlreadyKnown) {
continue
}
fn = best_file[key]
# gather all tuples from the best file for this key
tracedfn = trace_dir"/"fn
while ((getline < tracedfn) > 0) {
keyAlreadyKnown[$0] = ""
}
close(tracedfn)
# copy file unless already done
if (! (fn in file_already_copied)) {
system(cp_tool" "in_dir"/"fn" "out_dir"/"fn)
file_already_copied[fn] = ""
++out_count
#printf "tuple nr %d (%d cnt=%d) -> %s\n",tcnt,key,key_count[key],fn > trace_dir"/.log"
}
}
close(sortedKeys)
print ""
print "[+] Found "tuple_count" unique tuples across "in_count" files."
if (out_count == 1) {
print "[!] WARNING: All test cases had the same traces, check syntax!"
}
print "[+] Narrowed down to "out_count" files, saved in '"out_dir"'."
if (!ENVIRON["AFL_KEEP_TRACES"]) {
system("rm -rf "trace_dir" 2>/dev/null")
}
exit 0
}
EOF

477
afl-cmin.bash Executable file
View File

@ -0,0 +1,477 @@
#!/usr/bin/env bash
#
# american fuzzy lop++ - corpus minimization tool
# ---------------------------------------------
#
# Originally written by Michal Zalewski
#
# Copyright 2014, 2015 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 tool tries to find the smallest subset of files in the input directory
# that still trigger the full range of instrumentation data points seen in
# the starting corpus. This has two uses:
#
# - Screening large corpora of input files before using them as a seed for
# afl-fuzz. The tool will remove functionally redundant files and likely
# leave you with a much smaller set.
#
# (In this case, you probably also want to consider running afl-tmin on
# the individual files later on to reduce their size.)
#
# - Minimizing the corpus generated organically by afl-fuzz, perhaps when
# planning to feed it to more resource-intensive tools. The tool achieves
# this by removing all entries that used to trigger unique behaviors in the
# past, but have been made obsolete by later finds.
#
# Note that the tool doesn't modify the files themselves. For that, you want
# afl-tmin.
#
# This script must use bash because other shells may have hardcoded limits on
# array sizes.
#
echo "corpus minimization tool for afl-fuzz by Michal Zalewski"
echo
#########
# SETUP #
#########
# Process command-line options...
MEM_LIMIT=200
TIMEOUT=none
unset IN_DIR OUT_DIR STDIN_FILE EXTRA_PAR MEM_LIMIT_GIVEN \
AFL_CMIN_CRASHES_ONLY AFL_CMIN_ALLOW_ANY QEMU_MODE UNICORN_MODE
export AFL_QUIET=1
while getopts "+i:o:f:m:t:eQUCh" opt; do
case "$opt" in
"h")
;;
"i")
IN_DIR="$OPTARG"
;;
"o")
OUT_DIR="$OPTARG"
;;
"f")
STDIN_FILE="$OPTARG"
;;
"m")
MEM_LIMIT="$OPTARG"
MEM_LIMIT_GIVEN=1
;;
"t")
TIMEOUT="$OPTARG"
;;
"e")
EXTRA_PAR="$EXTRA_PAR -e"
;;
"C")
export AFL_CMIN_CRASHES_ONLY=1
;;
"Q")
EXTRA_PAR="$EXTRA_PAR -Q"
test "$MEM_LIMIT_GIVEN" = "" && MEM_LIMIT=250
QEMU_MODE=1
;;
"U")
EXTRA_PAR="$EXTRA_PAR -U"
test "$MEM_LIMIT_GIVEN" = "" && MEM_LIMIT=250
UNICORN_MODE=1
;;
"?")
exit 1
;;
esac
done
shift $((OPTIND-1))
TARGET_BIN="$1"
if [ "$TARGET_BIN" = "" -o "$IN_DIR" = "" -o "$OUT_DIR" = "" ]; then
cat 1>&2 <<_EOF_
Usage: $0 [ options ] -- /path/to/target_app [ ... ]
Required parameters:
-i dir - input directory with the starting corpus
-o dir - output directory for minimized files
Execution control settings:
-f file - location read by the fuzzed program (stdin)
-m megs - memory limit for child process ($MEM_LIMIT MB)
-t msec - run time limit for child process (none)
-Q - use binary-only instrumentation (QEMU mode)
-U - use unicorn-based instrumentation (Unicorn mode)
Minimization settings:
-C - keep crashing inputs, reject everything else
-e - solve for edge coverage only, ignore hit counts
For additional tips, please consult docs/README.md.
Environment variables used:
AFL_KEEP_TRACES: leave the temporary <out_dir>\.traces directory
AFL_PATH: path for the afl-showmap binary
AFL_SKIP_BIN_CHECK: skip check for target binary
_EOF_
exit 1
fi
# Do a sanity check to discourage the use of /tmp, since we can't really
# handle this safely from a shell script.
#if [ "$AFL_ALLOW_TMP" = "" ]; then
#
# echo "$IN_DIR" | grep -qE '^(/var)?/tmp/'
# T1="$?"
#
# echo "$TARGET_BIN" | grep -qE '^(/var)?/tmp/'
# T2="$?"
#
# echo "$OUT_DIR" | grep -qE '^(/var)?/tmp/'
# T3="$?"
#
# echo "$STDIN_FILE" | grep -qE '^(/var)?/tmp/'
# T4="$?"
#
# echo "$PWD" | grep -qE '^(/var)?/tmp/'
# T5="$?"
#
# if [ "$T1" = "0" -o "$T2" = "0" -o "$T3" = "0" -o "$T4" = "0" -o "$T5" = "0" ]; then
# echo "[-] Error: do not use this script in /tmp or /var/tmp." 1>&2
# exit 1
# fi
#
#fi
# If @@ is specified, but there's no -f, let's come up with a temporary input
# file name.
TRACE_DIR="$OUT_DIR/.traces"
if [ "$STDIN_FILE" = "" ]; then
if echo "$*" | grep -qF '@@'; then
STDIN_FILE="$TRACE_DIR/.cur_input"
fi
fi
# Check for obvious errors.
if [ ! "$MEM_LIMIT" = "none" ]; then
if [ "$MEM_LIMIT" -lt "5" ]; then
echo "[-] Error: dangerously low memory limit." 1>&2
exit 1
fi
fi
if [ ! "$TIMEOUT" = "none" ]; then
if [ "$TIMEOUT" -lt "10" ]; then
echo "[-] Error: dangerously low timeout." 1>&2
exit 1
fi
fi
if [ ! -f "$TARGET_BIN" -o ! -x "$TARGET_BIN" ]; then
TNEW="`which "$TARGET_BIN" 2>/dev/null`"
if [ ! -f "$TNEW" -o ! -x "$TNEW" ]; then
echo "[-] Error: binary '$TARGET_BIN' not found or not executable." 1>&2
exit 1
fi
TARGET_BIN="$TNEW"
fi
if [ "$AFL_SKIP_BIN_CHECK" = "" -a "$QEMU_MODE" = "" -a "$UNICORN_MODE" = "" ]; then
if ! grep -qF "__AFL_SHM_ID" "$TARGET_BIN"; then
echo "[-] Error: binary '$TARGET_BIN' doesn't appear to be instrumented." 1>&2
exit 1
fi
fi
if [ ! -d "$IN_DIR" ]; then
echo "[-] Error: directory '$IN_DIR' not found." 1>&2
exit 1
fi
test -d "$IN_DIR/queue" && IN_DIR="$IN_DIR/queue"
find "$OUT_DIR" -name 'id[:_]*' -maxdepth 1 -exec rm -- {} \; 2>/dev/null
rm -rf "$TRACE_DIR" 2>/dev/null
rmdir "$OUT_DIR" 2>/dev/null
if [ -d "$OUT_DIR" ]; then
echo "[-] Error: directory '$OUT_DIR' exists and is not empty - delete it first." 1>&2
exit 1
fi
mkdir -m 700 -p "$TRACE_DIR" || exit 1
if [ ! "$STDIN_FILE" = "" ]; then
rm -f "$STDIN_FILE" || exit 1
touch "$STDIN_FILE" || exit 1
fi
if [ "$AFL_PATH" = "" ]; then
SHOWMAP="${0%/afl-cmin.bash}/afl-showmap"
else
SHOWMAP="$AFL_PATH/afl-showmap"
fi
if [ ! -x "$SHOWMAP" ]; then
echo "[-] Error: can't find 'afl-showmap' - please set AFL_PATH." 1>&2
rm -rf "$TRACE_DIR"
exit 1
fi
IN_COUNT=$((`ls -- "$IN_DIR" 2>/dev/null | wc -l`))
if [ "$IN_COUNT" = "0" ]; then
echo "[+] Hmm, no inputs in the target directory. Nothing to be done."
rm -rf "$TRACE_DIR"
exit 1
fi
FIRST_FILE=`ls "$IN_DIR" | head -1`
# Make sure that we're not dealing with a directory.
if [ -d "$IN_DIR/$FIRST_FILE" ]; then
echo "[-] Error: The target directory contains subdirectories - please fix." 1>&2
rm -rf "$TRACE_DIR"
exit 1
fi
# Check for the more efficient way to copy files...
if ln "$IN_DIR/$FIRST_FILE" "$TRACE_DIR/.link_test" 2>/dev/null; then
CP_TOOL=ln
else
CP_TOOL=cp
fi
# Make sure that we can actually get anything out of afl-showmap before we
# waste too much time.
echo "[*] Testing the target binary..."
if [ "$STDIN_FILE" = "" ]; then
AFL_CMIN_ALLOW_ANY=1 "$SHOWMAP" -m "$MEM_LIMIT" -t "$TIMEOUT" -o "$TRACE_DIR/.run_test" -Z $EXTRA_PAR -- "$@" <"$IN_DIR/$FIRST_FILE"
else
cp "$IN_DIR/$FIRST_FILE" "$STDIN_FILE"
AFL_CMIN_ALLOW_ANY=1 "$SHOWMAP" -m "$MEM_LIMIT" -t "$TIMEOUT" -o "$TRACE_DIR/.run_test" -Z $EXTRA_PAR -A "$STDIN_FILE" -- "$@" </dev/null
fi
FIRST_COUNT=$((`grep -c . "$TRACE_DIR/.run_test"`))
if [ "$FIRST_COUNT" -gt "0" ]; then
echo "[+] OK, $FIRST_COUNT tuples recorded."
else
echo "[-] Error: no instrumentation output detected (perhaps crash or timeout)." 1>&2
test "$AFL_KEEP_TRACES" = "" && rm -rf "$TRACE_DIR"
exit 1
fi
# Let's roll!
#############################
# STEP 1: COLLECTING TRACES #
#############################
echo "[*] Obtaining traces for input files in '$IN_DIR'..."
(
CUR=0
if [ "$STDIN_FILE" = "" ]; then
ls "$IN_DIR" | while read -r fn; do
CUR=$((CUR+1))
printf "\\r Processing file $CUR/$IN_COUNT... "
"$SHOWMAP" -m "$MEM_LIMIT" -t "$TIMEOUT" -o "$TRACE_DIR/$fn" -Z $EXTRA_PAR -- "$@" <"$IN_DIR/$fn"
done
else
ls "$IN_DIR" | while read -r fn; do
CUR=$((CUR+1))
printf "\\r Processing file $CUR/$IN_COUNT... "
cp "$IN_DIR/$fn" "$STDIN_FILE"
"$SHOWMAP" -m "$MEM_LIMIT" -t "$TIMEOUT" -o "$TRACE_DIR/$fn" -Z $EXTRA_PAR -A "$STDIN_FILE" -- "$@" </dev/null
done
fi
)
echo
##########################
# STEP 2: SORTING TUPLES #
##########################
# With this out of the way, we sort all tuples by popularity across all
# datasets. The reasoning here is that we won't be able to avoid the files
# that trigger unique tuples anyway, so we will want to start with them and
# see what's left.
echo "[*] Sorting trace sets (this may take a while)..."
ls "$IN_DIR" | sed "s#^#$TRACE_DIR/#" | tr '\n' '\0' | xargs -0 -n 1 cat | \
sort | uniq -c | sort -k 1,1 -n >"$TRACE_DIR/.all_uniq"
TUPLE_COUNT=$((`grep -c . "$TRACE_DIR/.all_uniq"`))
echo "[+] Found $TUPLE_COUNT unique tuples across $IN_COUNT files."
#####################################
# STEP 3: SELECTING CANDIDATE FILES #
#####################################
# The next step is to find the best candidate for each tuple. The "best"
# part is understood simply as the smallest input that includes a particular
# tuple in its trace. Empirical evidence suggests that this produces smaller
# datasets than more involved algorithms that could be still pulled off in
# a shell script.
echo "[*] Finding best candidates for each tuple..."
CUR=0
ls -rS "$IN_DIR" | while read -r fn; do
CUR=$((CUR+1))
printf "\\r Processing file $CUR/$IN_COUNT... "
sed "s#\$# $fn#" "$TRACE_DIR/$fn" >>"$TRACE_DIR/.candidate_list"
done
echo
##############################
# STEP 4: LOADING CANDIDATES #
##############################
# At this point, we have a file of tuple-file pairs, sorted by file size
# in ascending order (as a consequence of ls -rS). By doing sort keyed
# only by tuple (-k 1,1) and configured to output only the first line for
# every key (-s -u), we end up with the smallest file for each tuple.
echo "[*] Sorting candidate list (be patient)..."
sort -k1,1 -s -u "$TRACE_DIR/.candidate_list" | \
sed 's/^/BEST_FILE[/;s/ /]="/;s/$/"/' >"$TRACE_DIR/.candidate_script"
if [ ! -s "$TRACE_DIR/.candidate_script" ]; then
echo "[-] Error: no traces obtained from test cases, check syntax!" 1>&2
test "$AFL_KEEP_TRACES" = "" && rm -rf "$TRACE_DIR"
exit 1
fi
# The sed command converted the sorted list to a shell script that populates
# BEST_FILE[tuple]="fname". Let's load that!
. "$TRACE_DIR/.candidate_script"
##########################
# STEP 5: WRITING OUTPUT #
##########################
# The final trick is to grab the top pick for each tuple, unless said tuple is
# already set due to the inclusion of an earlier candidate; and then put all
# tuples associated with the newly-added file to the "already have" list. The
# loop works from least popular tuples and toward the most common ones.
echo "[*] Processing candidates and writing output files..."
CUR=0
touch "$TRACE_DIR/.already_have"
while read -r cnt tuple; do
CUR=$((CUR+1))
printf "\\r Processing tuple $CUR/$TUPLE_COUNT with count $cnt... "
# If we already have this tuple, skip it.
grep -q "^$tuple\$" "$TRACE_DIR/.already_have" && continue
FN=${BEST_FILE[tuple]}
# echo "tuple nr $CUR ($tuple cnt=$cnt) -> $FN" >> "$TRACE_DIR/.log"
$CP_TOOL "$IN_DIR/$FN" "$OUT_DIR/$FN"
if [ "$((CUR % 5))" = "0" ]; then
sort -u "$TRACE_DIR/$FN" "$TRACE_DIR/.already_have" >"$TRACE_DIR/.tmp"
mv -f "$TRACE_DIR/.tmp" "$TRACE_DIR/.already_have"
else
cat "$TRACE_DIR/$FN" >>"$TRACE_DIR/.already_have"
fi
done <"$TRACE_DIR/.all_uniq"
echo
OUT_COUNT=`ls -- "$OUT_DIR" | wc -l`
if [ "$OUT_COUNT" = "1" ]; then
echo "[!] WARNING: All test cases had the same traces, check syntax!"
fi
echo "[+] Narrowed down to $OUT_COUNT files, saved in '$OUT_DIR'."
echo
test "$AFL_KEEP_TRACES" = "" && rm -rf "$TRACE_DIR"
exit 0

View File

@ -1,69 +0,0 @@
/*
gather some functions common to multiple executables
detect_file_args
*/
#include <stdlib.h>
#include <stdio.h>
#include <strings.h>
#include "debug.h"
#include "alloc-inl.h"
/* Detect @@ in args. */
#ifndef __glibc__
#include <unistd.h>
#endif
void detect_file_args(char** argv, u8* prog_in) {
u32 i = 0;
#ifdef __GLIBC__
u8* cwd = getcwd(NULL, 0); /* non portable glibc extension */
#else
u8* cwd;
char *buf;
long size = pathconf(".", _PC_PATH_MAX);
if ((buf = (char *)malloc((size_t)size)) != NULL) {
cwd = getcwd(buf, (size_t)size); /* portable version */
} else {
PFATAL("getcwd() failed");
}
#endif
if (!cwd) PFATAL("getcwd() failed");
while (argv[i]) {
u8* aa_loc = strstr(argv[i], "@@");
if (aa_loc) {
u8 *aa_subst, *n_arg;
if (!prog_in) FATAL("@@ syntax is not supported by this tool.");
/* Be sure that we're always using fully-qualified paths. */
if (prog_in[0] == '/') aa_subst = prog_in;
else aa_subst = alloc_printf("%s/%s", cwd, prog_in);
/* Construct a replacement argv value. */
*aa_loc = 0;
n_arg = alloc_printf("%s%s%s", argv[i], aa_subst, aa_loc + 2);
argv[i] = n_arg;
*aa_loc = '@';
if (prog_in[0] != '/') ck_free(aa_subst);
}
i++;
}
free(cwd); /* not tracked */
}

View File

@ -1,5 +0,0 @@
#ifndef __AFLCOMMON_H
#define __AFLCOMMON_H
void detect_file_args(char **argv, u8 *prog_in);
#endif

12566
afl-fuzz.c

File diff suppressed because it is too large Load Diff

343
afl-gcc.c
View File

@ -1,343 +0,0 @@
/*
american fuzzy lop - wrapper for GCC and clang
----------------------------------------------
Written and maintained by Michal Zalewski <lcamtuf@google.com>
Copyright 2013, 2014, 2015 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 program is a drop-in replacement for GCC or clang. The most common way
of using it is to pass the path to afl-gcc or afl-clang via CC when invoking
./configure.
(Of course, use CXX and point it to afl-g++ / afl-clang++ for C++ code.)
The wrapper needs to know the path to afl-as (renamed to 'as'). The default
is /usr/local/lib/afl/. A convenient way to specify alternative directories
would be to set AFL_PATH.
If AFL_HARDEN is set, the wrapper will compile the target app with various
hardening options that may help detect memory management issues more
reliably. You can also specify AFL_USE_ASAN to enable ASAN.
If you want to call a non-default compiler as a next step of the chain,
specify its location via AFL_CC or AFL_CXX.
*/
#define AFL_MAIN
#include "config.h"
#include "types.h"
#include "debug.h"
#include "alloc-inl.h"
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
static u8* as_path; /* Path to the AFL 'as' wrapper */
static u8** cc_params; /* Parameters passed to the real CC */
static u32 cc_par_cnt = 1; /* Param count, including argv0 */
static u8 be_quiet, /* Quiet mode */
clang_mode; /* Invoked as afl-clang*? */
/* Try to find our "fake" GNU assembler in AFL_PATH or at the location derived
from argv[0]. If that fails, abort. */
static void find_as(u8* argv0) {
u8 *afl_path = getenv("AFL_PATH");
u8 *slash, *tmp;
if (afl_path) {
tmp = alloc_printf("%s/as", afl_path);
if (!access(tmp, X_OK)) {
as_path = afl_path;
ck_free(tmp);
return;
}
ck_free(tmp);
}
slash = strrchr(argv0, '/');
if (slash) {
u8 *dir;
*slash = 0;
dir = ck_strdup(argv0);
*slash = '/';
tmp = alloc_printf("%s/afl-as", dir);
if (!access(tmp, X_OK)) {
as_path = dir;
ck_free(tmp);
return;
}
ck_free(tmp);
ck_free(dir);
}
if (!access(AFL_PATH "/as", X_OK)) {
as_path = AFL_PATH;
return;
}
FATAL("Unable to find AFL wrapper binary for 'as'. Please set AFL_PATH");
}
/* Copy argv to cc_params, making the necessary edits. */
static void edit_params(u32 argc, char** argv) {
u8 fortify_set = 0, asan_set = 0;
u8 *name;
#if defined(__FreeBSD__) && defined(__x86_64__)
u8 m32_set = 0;
#endif
cc_params = ck_alloc((argc + 128) * sizeof(u8*));
name = strrchr(argv[0], '/');
if (!name) name = argv[0]; else name++;
if (!strncmp(name, "afl-clang", 9)) {
clang_mode = 1;
setenv(CLANG_ENV_VAR, "1", 1);
if (!strcmp(name, "afl-clang++")) {
u8* alt_cxx = getenv("AFL_CXX");
cc_params[0] = alt_cxx ? alt_cxx : (u8*)"clang++";
} else {
u8* alt_cc = getenv("AFL_CC");
cc_params[0] = alt_cc ? alt_cc : (u8*)"clang";
}
} else {
/* With GCJ and Eclipse installed, you can actually compile Java! The
instrumentation will work (amazingly). Alas, unhandled exceptions do
not call abort(), so afl-fuzz would need to be modified to equate
non-zero exit codes with crash conditions when working with Java
binaries. Meh. */
#ifdef __APPLE__
if (!strcmp(name, "afl-g++")) cc_params[0] = getenv("AFL_CXX");
else if (!strcmp(name, "afl-gcj")) cc_params[0] = getenv("AFL_GCJ");
else cc_params[0] = getenv("AFL_CC");
if (!cc_params[0]) {
SAYF("\n" cLRD "[-] " cRST
"On Apple systems, 'gcc' is usually just a wrapper for clang. Please use the\n"
" 'afl-clang' utility instead of 'afl-gcc'. If you really have GCC installed,\n"
" set AFL_CC or AFL_CXX to specify the correct path to that compiler.\n");
FATAL("AFL_CC or AFL_CXX required on MacOS X");
}
#else
if (!strcmp(name, "afl-g++")) {
u8* alt_cxx = getenv("AFL_CXX");
cc_params[0] = alt_cxx ? alt_cxx : (u8*)"g++";
} else if (!strcmp(name, "afl-gcj")) {
u8* alt_cc = getenv("AFL_GCJ");
cc_params[0] = alt_cc ? alt_cc : (u8*)"gcj";
} else {
u8* alt_cc = getenv("AFL_CC");
cc_params[0] = alt_cc ? alt_cc : (u8*)"gcc";
}
#endif /* __APPLE__ */
}
while (--argc) {
u8* cur = *(++argv);
if (!strncmp(cur, "-B", 2)) {
if (!be_quiet) WARNF("-B is already set, overriding");
if (!cur[2] && argc > 1) { argc--; argv++; }
continue;
}
if (!strcmp(cur, "-integrated-as")) continue;
if (!strcmp(cur, "-pipe")) continue;
#if defined(__FreeBSD__) && defined(__x86_64__)
if (!strcmp(cur, "-m32")) m32_set = 1;
#endif
if (!strcmp(cur, "-fsanitize=address") ||
!strcmp(cur, "-fsanitize=memory")) asan_set = 1;
if (strstr(cur, "FORTIFY_SOURCE")) fortify_set = 1;
cc_params[cc_par_cnt++] = cur;
}
cc_params[cc_par_cnt++] = "-B";
cc_params[cc_par_cnt++] = as_path;
if (clang_mode)
cc_params[cc_par_cnt++] = "-no-integrated-as";
if (getenv("AFL_HARDEN")) {
cc_params[cc_par_cnt++] = "-fstack-protector-all";
if (!fortify_set)
cc_params[cc_par_cnt++] = "-D_FORTIFY_SOURCE=2";
}
if (asan_set) {
/* Pass this on to afl-as to adjust map density. */
setenv("AFL_USE_ASAN", "1", 1);
} else if (getenv("AFL_USE_ASAN")) {
if (getenv("AFL_USE_MSAN"))
FATAL("ASAN and MSAN are mutually exclusive");
if (getenv("AFL_HARDEN"))
FATAL("ASAN and AFL_HARDEN are mutually exclusive");
cc_params[cc_par_cnt++] = "-U_FORTIFY_SOURCE";
cc_params[cc_par_cnt++] = "-fsanitize=address";
} else if (getenv("AFL_USE_MSAN")) {
if (getenv("AFL_USE_ASAN"))
FATAL("ASAN and MSAN are mutually exclusive");
if (getenv("AFL_HARDEN"))
FATAL("MSAN and AFL_HARDEN are mutually exclusive");
cc_params[cc_par_cnt++] = "-U_FORTIFY_SOURCE";
cc_params[cc_par_cnt++] = "-fsanitize=memory";
}
#ifdef USEMMAP
cc_params[cc_par_cnt++] = "-lrt";
#endif
if (!getenv("AFL_DONT_OPTIMIZE")) {
#if defined(__FreeBSD__) && defined(__x86_64__)
/* On 64-bit FreeBSD systems, clang -g -m32 is broken, but -m32 itself
works OK. This has nothing to do with us, but let's avoid triggering
that bug. */
if (!clang_mode || !m32_set)
cc_params[cc_par_cnt++] = "-g";
#else
cc_params[cc_par_cnt++] = "-g";
#endif
cc_params[cc_par_cnt++] = "-O3";
cc_params[cc_par_cnt++] = "-funroll-loops";
/* Two indicators that you're building for fuzzing; one of them is
AFL-specific, the other is shared with libfuzzer. */
cc_params[cc_par_cnt++] = "-D__AFL_COMPILER=1";
cc_params[cc_par_cnt++] = "-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION=1";
}
if (getenv("AFL_NO_BUILTIN")) {
cc_params[cc_par_cnt++] = "-fno-builtin-strcmp";
cc_params[cc_par_cnt++] = "-fno-builtin-strncmp";
cc_params[cc_par_cnt++] = "-fno-builtin-strcasecmp";
cc_params[cc_par_cnt++] = "-fno-builtin-strncasecmp";
cc_params[cc_par_cnt++] = "-fno-builtin-memcmp";
cc_params[cc_par_cnt++] = "-fno-builtin-strstr";
cc_params[cc_par_cnt++] = "-fno-builtin-strcasestr";
}
cc_params[cc_par_cnt] = NULL;
}
/* Main entry point */
int main(int argc, char** argv) {
if (isatty(2) && !getenv("AFL_QUIET")) {
SAYF(cCYA "afl-cc" VERSION cRST " by <lcamtuf@google.com>\n");
SAYF(cYEL "[!] " cBRI "NOTE: " cRST "afl-gcc is deprecated, llvm_mode is much faster and has more options\n");
} else be_quiet = 1;
if (argc < 2) {
SAYF("\n"
"This is a helper application for afl-fuzz. It serves as a drop-in replacement\n"
"for gcc or clang, letting you recompile third-party code with the required\n"
"runtime instrumentation. A common use pattern would be one of the following:\n\n"
" CC=%s/afl-gcc ./configure\n"
" CXX=%s/afl-g++ ./configure\n\n"
"You can specify custom next-stage toolchain via AFL_CC, AFL_CXX, and AFL_AS.\n"
"Setting AFL_HARDEN enables hardening optimizations in the compiled code.\n\n",
BIN_PATH, BIN_PATH);
exit(1);
}
find_as(argv[0]);
edit_params(argc, argv);
execvp(cc_params[0], (char**)cc_params);
FATAL("Oops, failed to execute '%s' - check your PATH", cc_params[0]);
return 0;
}

100
afl-plot
View File

@ -1,9 +1,9 @@
#!/bin/sh
#
# american fuzzy lop - Advanced Persistent Graphing
# american fuzzy lop++ - Advanced Persistent Graphing
# -------------------------------------------------
#
# Written and maintained by Michal Zalewski <lcamtuf@google.com>
# Originally written by Michal Zalewski
# Based on a design & prototype by Michael Rash.
#
# Copyright 2014, 2015 Google Inc. All rights reserved.
@ -15,58 +15,73 @@
# http://www.apache.org/licenses/LICENSE-2.0
#
echo "progress plotting utility for afl-fuzz by <lcamtuf@google.com>"
get_abs_path() {
echo $(cd "`dirname "$1"`" && pwd)/"`basename "$1"`"
}
echo "progress plotting utility for afl-fuzz by Michal Zalewski"
echo
if [ ! "$#" = "2" ]; then
cat 1>&2 <<_EOF_
This program generates gnuplot images from afl-fuzz output data. Usage:
$0 afl_state_dir graph_output_dir
This program generates gnuplot images from afl-fuzz output data. Usage:
The afl_state_dir parameter should point to an existing state directory for any
active or stopped instance of afl-fuzz; while graph_output_dir should point to
an empty directory where this tool can write the resulting plots to.
The program will put index.html and three PNG images in the output directory;
you should be able to view it with any web browser of your choice.
_EOF_
exit 1
fi
if [ "$AFL_ALLOW_TMP" = "" ]; then
inputdir=`get_abs_path "$1"`
outputdir=`get_abs_path "$2"`
echo "$1" | grep -qE '^(/var)?/tmp/'
T1="$?"
#if [ "$AFL_ALLOW_TMP" = "" ]; then
#
# echo "$inputdir" | grep -qE '^(/var)?/tmp/'
# T1="$?"
#
# echo "$outputdir" | grep -qE '^(/var)?/tmp/'
# T2="$?"
#
# if [ "$T1" = "0" -o "$T2" = "0" ]; then
#
# echo "[-] Error: this script shouldn't be used with shared /tmp directories." 1>&2
# exit 1
#
# fi
#
#fi
echo "$2" | grep -qE '^(/var)?/tmp/'
T2="$?"
if [ "$T1" = "0" -o "$T2" = "0" ]; then
echo "[-] Error: this script shouldn't be used with shared /tmp directories." 1>&2
exit 1
fi
fi
if [ ! -f "$1/plot_data" ]; then
if [ ! -f "$inputdir/plot_data" ]; then
echo "[-] Error: input directory is not valid (missing 'plot_data')." 1>&2
exit 1
fi
BANNER="`cat "$1/fuzzer_stats" | grep '^afl_banner ' | cut -d: -f2- | cut -b2-`"
LINES=`cat "$inputdir/plot_data" | wc -l`
if [ "$LINES" -lt 3 ]; then
echo "[-] Error: plot_data carries too little data, let it run longer." 1>&2
exit 1
fi
BANNER="`cat "$inputdir/fuzzer_stats" 2> /dev/null | grep '^afl_banner ' | cut -d: -f2- | cut -b2-`"
test "$BANNER" = "" && BANNER="(none)"
GNUPLOT=`which gnuplot 2>/dev/null`
GNUPLOT=`command -v gnuplot 2>/dev/null`
if [ "$GNUPLOT" = "" ]; then
@ -75,17 +90,17 @@ if [ "$GNUPLOT" = "" ]; then
fi
mkdir "$2" 2>/dev/null
mkdir "$outputdir" 2>/dev/null
if [ ! -d "$2" ]; then
if [ ! -d "$outputdir" ]; then
echo "[-] Error: unable to create the output directory - pick another location." 1>&2
exit 1
fi
rm -f "$2/high_freq.png" "$2/low_freq.png" "$2/exec_speed.png"
mv -f "$2/index.html" "$2/index.html.orig" 2>/dev/null
rm -f "$outputdir/high_freq.png" "$outputdir/low_freq.png" "$outputdir/exec_speed.png"
mv -f "$outputdir/index.html" "$outputdir/index.html.orig" 2>/dev/null
echo "[*] Generating plots..."
@ -94,7 +109,7 @@ echo "[*] Generating plots..."
cat <<_EOF_
set terminal png truecolor enhanced size 1000,300 butt
set output '$2/high_freq.png'
set output '$outputdir/high_freq.png'
set xdata time
set timefmt '%s'
@ -112,31 +127,36 @@ set key outside
set autoscale xfixmin
set autoscale xfixmax
plot '$1/plot_data' using 1:4 with filledcurve x1 title 'total paths' linecolor rgb '#000000' fillstyle transparent solid 0.2 noborder, \\
set xlabel "all times in UTC" font "small"
set ytics auto
plot '$inputdir/plot_data' using 1:4 with filledcurve x1 title 'total paths' linecolor rgb '#000000' fillstyle transparent solid 0.2 noborder, \\
'' using 1:3 with filledcurve x1 title 'current path' linecolor rgb '#f0f0f0' fillstyle transparent solid 0.5 noborder, \\
'' using 1:5 with lines title 'pending paths' linecolor rgb '#0090ff' linewidth 3, \\
'' using 1:6 with lines title 'pending favs' linecolor rgb '#c00080' linewidth 3, \\
'' using 1:2 with lines title 'cycles done' linecolor rgb '#c000f0' linewidth 3
set terminal png truecolor enhanced size 1000,200 butt
set output '$2/low_freq.png'
set output '$outputdir/low_freq.png'
plot '$1/plot_data' using 1:8 with filledcurve x1 title '' linecolor rgb '#c00080' fillstyle transparent solid 0.2 noborder, \\
set ytics 1
plot '$inputdir/plot_data' using 1:8 with filledcurve x1 title '' linecolor rgb '#c00080' fillstyle transparent solid 0.2 noborder, \\
'' using 1:8 with lines title ' uniq crashes' linecolor rgb '#c00080' linewidth 3, \\
'' using 1:9 with lines title 'uniq hangs' linecolor rgb '#c000f0' linewidth 3, \\
'' using 1:10 with lines title 'levels' linecolor rgb '#0090ff' linewidth 3
set terminal png truecolor enhanced size 1000,200 butt
set output '$2/exec_speed.png'
set output '$outputdir/exec_speed.png'
plot '$1/plot_data' using 1:11 with filledcurve x1 title '' linecolor rgb '#0090ff' fillstyle transparent solid 0.2 noborder, \\
'$1/plot_data' using 1:11 with lines title ' execs/sec' linecolor rgb '#0090ff' linewidth 3 smooth bezier;
set ytics auto
plot '$inputdir/plot_data' using 1:11 with filledcurve x1 title '' linecolor rgb '#0090ff' fillstyle transparent solid 0.2 noborder, \\
'$inputdir/plot_data' using 1:11 with lines title ' execs/sec' linecolor rgb '#0090ff' linewidth 3 smooth bezier;
_EOF_
) | gnuplot
if [ ! -s "$2/exec_speed.png" ]; then
if [ ! -s "$outputdir/exec_speed.png" ]; then
echo "[-] Error: something went wrong! Perhaps you have an ancient version of gnuplot?" 1>&2
exit 1
@ -145,10 +165,10 @@ fi
echo "[*] Generating index.html..."
cat >"$2/index.html" <<_EOF_
cat >"$outputdir/index.html" <<_EOF_
<table style="font-family: 'Trebuchet MS', 'Tahoma', 'Arial', 'Helvetica'">
<tr><td style="width: 18ex"><b>Banner:</b></td><td>$BANNER</td></tr>
<tr><td><b>Directory:</b></td><td>$1</td></tr>
<tr><td><b>Directory:</b></td><td>$inputdir</td></tr>
<tr><td><b>Generated on:</b></td><td>`date`</td></tr>
</table>
<p>
@ -162,8 +182,8 @@ _EOF_
# served by Apache or other HTTP daemon. Since the plots aren't horribly
# sensitive, this seems like a reasonable trade-off.
chmod 755 "$2"
chmod 644 "$2/high_freq.png" "$2/low_freq.png" "$2/exec_speed.png" "$2/index.html"
chmod 755 "$outputdir"
chmod 644 "$outputdir/high_freq.png" "$outputdir/low_freq.png" "$outputdir/exec_speed.png" "$outputdir/index.html"
echo "[+] All done - enjoy your charts!"

View File

@ -1,709 +0,0 @@
/*
american fuzzy lop - map display utility
----------------------------------------
Written and maintained by Michal Zalewski <lcamtuf@google.com>
Copyright 2013, 2014, 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
A very simple tool that runs the targeted binary and displays
the contents of the trace bitmap in a human-readable form. Useful in
scripts to eliminate redundant inputs and perform other checks.
Exit code is 2 if the target program crashes; 1 if it times out or
there is a problem executing it; or 0 if execution is successful.
*/
#define AFL_MAIN
#include "config.h"
#include "types.h"
#include "debug.h"
#include "alloc-inl.h"
#include "hash.h"
#include "sharedmem.h"
#include "afl-common.h"
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <errno.h>
#include <signal.h>
#include <dirent.h>
#include <fcntl.h>
#include <sys/wait.h>
#include <sys/time.h>
#include <sys/shm.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/resource.h>
static s32 child_pid; /* PID of the tested program */
u8* trace_bits; /* SHM with instrumentation bitmap */
static u8 *out_file, /* Trace output file */
*doc_path, /* Path to docs */
*target_path, /* Path to target binary */
*at_file; /* Substitution string for @@ */
static u32 exec_tmout; /* Exec timeout (ms) */
static u64 mem_limit = MEM_LIMIT; /* Memory limit (MB) */
static u8 quiet_mode, /* Hide non-essential messages? */
edges_only, /* Ignore hit counts? */
cmin_mode, /* Generate output in afl-cmin mode? */
binary_mode, /* Write output as a binary map */
keep_cores; /* Allow coredumps? */
static volatile u8
stop_soon, /* Ctrl-C pressed? */
child_timed_out, /* Child timed out? */
child_crashed; /* Child crashed? */
/* Classify tuple counts. Instead of mapping to individual bits, as in
afl-fuzz.c, we map to more user-friendly numbers between 1 and 8. */
static const u8 count_class_human[256] = {
[0] = 0,
[1] = 1,
[2] = 2,
[3] = 3,
[4 ... 7] = 4,
[8 ... 15] = 5,
[16 ... 31] = 6,
[32 ... 127] = 7,
[128 ... 255] = 8
};
static const u8 count_class_binary[256] = {
[0] = 0,
[1] = 1,
[2] = 2,
[3] = 4,
[4 ... 7] = 8,
[8 ... 15] = 16,
[16 ... 31] = 32,
[32 ... 127] = 64,
[128 ... 255] = 128
};
static void classify_counts(u8* mem, const u8* map) {
u32 i = MAP_SIZE;
if (edges_only) {
while (i--) {
if (*mem) *mem = 1;
mem++;
}
} else {
while (i--) {
*mem = map[*mem];
mem++;
}
}
}
/* Write results. */
static u32 write_results(void) {
s32 fd;
u32 i, ret = 0;
u8 cco = !!getenv("AFL_CMIN_CRASHES_ONLY"),
caa = !!getenv("AFL_CMIN_ALLOW_ANY");
if (!strncmp(out_file, "/dev/", 5)) {
fd = open(out_file, O_WRONLY, 0600);
if (fd < 0) PFATAL("Unable to open '%s'", out_file);
} else if (!strcmp(out_file, "-")) {
fd = dup(1);
if (fd < 0) PFATAL("Unable to open stdout");
} else {
unlink(out_file); /* Ignore errors */
fd = open(out_file, O_WRONLY | O_CREAT | O_EXCL, 0600);
if (fd < 0) PFATAL("Unable to create '%s'", out_file);
}
if (binary_mode) {
for (i = 0; i < MAP_SIZE; i++)
if (trace_bits[i]) ret++;
ck_write(fd, trace_bits, MAP_SIZE, out_file);
close(fd);
} else {
FILE* f = fdopen(fd, "w");
if (!f) PFATAL("fdopen() failed");
for (i = 0; i < MAP_SIZE; i++) {
if (!trace_bits[i]) continue;
ret++;
if (cmin_mode) {
if (child_timed_out) break;
if (!caa && child_crashed != cco) break;
fprintf(f, "%u%u\n", trace_bits[i], i);
} else fprintf(f, "%06u:%u\n", i, trace_bits[i]);
}
fclose(f);
}
return ret;
}
/* Handle timeout signal. */
static void handle_timeout(int sig) {
child_timed_out = 1;
if (child_pid > 0) kill(child_pid, SIGKILL);
}
/* Execute target application. */
static void run_target(char** argv) {
static struct itimerval it;
int status = 0;
if (!quiet_mode)
SAYF("-- Program output begins --\n" cRST);
MEM_BARRIER();
child_pid = fork();
if (child_pid < 0) PFATAL("fork() failed");
if (!child_pid) {
struct rlimit r;
if (quiet_mode) {
s32 fd = open("/dev/null", O_RDWR);
if (fd < 0 || dup2(fd, 1) < 0 || dup2(fd, 2) < 0) {
*(u32*)trace_bits = EXEC_FAIL_SIG;
PFATAL("Descriptor initialization failed");
}
close(fd);
}
if (mem_limit) {
r.rlim_max = r.rlim_cur = ((rlim_t)mem_limit) << 20;
#ifdef RLIMIT_AS
setrlimit(RLIMIT_AS, &r); /* Ignore errors */
#else
setrlimit(RLIMIT_DATA, &r); /* Ignore errors */
#endif /* ^RLIMIT_AS */
}
if (!keep_cores) r.rlim_max = r.rlim_cur = 0;
else r.rlim_max = r.rlim_cur = RLIM_INFINITY;
setrlimit(RLIMIT_CORE, &r); /* Ignore errors */
if (!getenv("LD_BIND_LAZY")) setenv("LD_BIND_NOW", "1", 0);
setsid();
execv(target_path, argv);
*(u32*)trace_bits = EXEC_FAIL_SIG;
exit(0);
}
/* Configure timeout, wait for child, cancel timeout. */
if (exec_tmout) {
child_timed_out = 0;
it.it_value.tv_sec = (exec_tmout / 1000);
it.it_value.tv_usec = (exec_tmout % 1000) * 1000;
}
setitimer(ITIMER_REAL, &it, NULL);
if (waitpid(child_pid, &status, 0) <= 0) FATAL("waitpid() failed");
child_pid = 0;
it.it_value.tv_sec = 0;
it.it_value.tv_usec = 0;
setitimer(ITIMER_REAL, &it, NULL);
MEM_BARRIER();
/* Clean up bitmap, analyze exit condition, etc. */
if (*(u32*)trace_bits == EXEC_FAIL_SIG)
FATAL("Unable to execute '%s'", argv[0]);
classify_counts(trace_bits, binary_mode ?
count_class_binary : count_class_human);
if (!quiet_mode)
SAYF(cRST "-- Program output ends --\n");
if (!child_timed_out && !stop_soon && WIFSIGNALED(status))
child_crashed = 1;
if (!quiet_mode) {
if (child_timed_out)
SAYF(cLRD "\n+++ Program timed off +++\n" cRST);
else if (stop_soon)
SAYF(cLRD "\n+++ Program aborted by user +++\n" cRST);
else if (child_crashed)
SAYF(cLRD "\n+++ Program killed by signal %u +++\n" cRST, WTERMSIG(status));
}
}
/* Handle Ctrl-C and the like. */
static void handle_stop_sig(int sig) {
stop_soon = 1;
if (child_pid > 0) kill(child_pid, SIGKILL);
}
/* Do basic preparations - persistent fds, filenames, etc. */
static void set_up_environment(void) {
setenv("ASAN_OPTIONS", "abort_on_error=1:"
"detect_leaks=0:"
"symbolize=0:"
"allocator_may_return_null=1", 0);
setenv("MSAN_OPTIONS", "exit_code=" STRINGIFY(MSAN_ERROR) ":"
"symbolize=0:"
"abort_on_error=1:"
"allocator_may_return_null=1:"
"msan_track_origins=0", 0);
if (getenv("AFL_PRELOAD")) {
setenv("LD_PRELOAD", getenv("AFL_PRELOAD"), 1);
setenv("DYLD_INSERT_LIBRARIES", getenv("AFL_PRELOAD"), 1);
}
}
/* Setup signal handlers, duh. */
static void setup_signal_handlers(void) {
struct sigaction sa;
sa.sa_handler = NULL;
sa.sa_flags = SA_RESTART;
sa.sa_sigaction = NULL;
sigemptyset(&sa.sa_mask);
/* Various ways of saying "stop". */
sa.sa_handler = handle_stop_sig;
sigaction(SIGHUP, &sa, NULL);
sigaction(SIGINT, &sa, NULL);
sigaction(SIGTERM, &sa, NULL);
/* Exec timeout notifications. */
sa.sa_handler = handle_timeout;
sigaction(SIGALRM, &sa, NULL);
}
/* Show banner. */
static void show_banner(void) {
SAYF(cCYA "afl-showmap" VERSION cRST " by <lcamtuf@google.com>\n");
}
/* Display usage hints. */
static void usage(u8* argv0) {
show_banner();
SAYF("\n%s [ options ] -- /path/to/target_app [ ... ]\n\n"
"Required parameters:\n\n"
" -o file - file to write the trace data to\n\n"
"Execution control settings:\n\n"
" -t msec - timeout for each run (none)\n"
" -m megs - memory limit for child process (%u MB)\n"
" -Q - use binary-only instrumentation (QEMU mode)\n"
" -U - use Unicorn-based instrumentation (Unicorn mode)\n"
" (Not necessary, here for consistency with other afl-* tools)\n\n"
"Other settings:\n\n"
" -q - sink program's output and don't show messages\n"
" -e - show edge coverage only, ignore hit counts\n"
" -c - allow core dumps\n\n"
"This tool displays raw tuple data captured by AFL instrumentation.\n"
"For additional help, consult %s/README.\n\n" cRST,
argv0, MEM_LIMIT, doc_path);
exit(1);
}
/* Find binary. */
static void find_binary(u8* fname) {
u8* env_path = 0;
struct stat st;
if (strchr(fname, '/') || !(env_path = getenv("PATH"))) {
target_path = ck_strdup(fname);
if (stat(target_path, &st) || !S_ISREG(st.st_mode) ||
!(st.st_mode & 0111) || st.st_size < 4)
FATAL("Program '%s' not found or not executable", fname);
} else {
while (env_path) {
u8 *cur_elem, *delim = strchr(env_path, ':');
if (delim) {
cur_elem = ck_alloc(delim - env_path + 1);
memcpy(cur_elem, env_path, delim - env_path);
delim++;
} else cur_elem = ck_strdup(env_path);
env_path = delim;
if (cur_elem[0])
target_path = alloc_printf("%s/%s", cur_elem, fname);
else
target_path = ck_strdup(fname);
ck_free(cur_elem);
if (!stat(target_path, &st) && S_ISREG(st.st_mode) &&
(st.st_mode & 0111) && st.st_size >= 4) break;
ck_free(target_path);
target_path = 0;
}
if (!target_path) FATAL("Program '%s' not found or not executable", fname);
}
}
/* Fix up argv for QEMU. */
static char** get_qemu_argv(u8* own_loc, char** argv, int argc) {
char** new_argv = ck_alloc(sizeof(char*) * (argc + 4));
u8 *tmp, *cp, *rsl, *own_copy;
memcpy(new_argv + 3, argv + 1, sizeof(char*) * argc);
new_argv[2] = target_path;
new_argv[1] = "--";
/* Now we need to actually find qemu for argv[0]. */
tmp = getenv("AFL_PATH");
if (tmp) {
cp = alloc_printf("%s/afl-qemu-trace", tmp);
if (access(cp, X_OK))
FATAL("Unable to find '%s'", tmp);
target_path = new_argv[0] = cp;
return new_argv;
}
own_copy = ck_strdup(own_loc);
rsl = strrchr(own_copy, '/');
if (rsl) {
*rsl = 0;
cp = alloc_printf("%s/afl-qemu-trace", own_copy);
ck_free(own_copy);
if (!access(cp, X_OK)) {
target_path = new_argv[0] = cp;
return new_argv;
}
} else ck_free(own_copy);
if (!access(BIN_PATH "/afl-qemu-trace", X_OK)) {
target_path = new_argv[0] = BIN_PATH "/afl-qemu-trace";
return new_argv;
}
FATAL("Unable to find 'afl-qemu-trace'.");
}
/* Main entry point */
int main(int argc, char** argv) {
s32 opt;
u8 mem_limit_given = 0, timeout_given = 0, qemu_mode = 0, unicorn_mode = 0;
u32 tcnt;
char** use_argv;
doc_path = access(DOC_PATH, F_OK) ? "docs" : DOC_PATH;
while ((opt = getopt(argc,argv,"+o:m:t:A:eqZQUbc")) > 0)
switch (opt) {
case 'o':
if (out_file) FATAL("Multiple -o options not supported");
out_file = optarg;
break;
case 'm': {
u8 suffix = 'M';
if (mem_limit_given) FATAL("Multiple -m options not supported");
mem_limit_given = 1;
if (!strcmp(optarg, "none")) {
mem_limit = 0;
break;
}
if (sscanf(optarg, "%llu%c", &mem_limit, &suffix) < 1 ||
optarg[0] == '-') FATAL("Bad syntax used for -m");
switch (suffix) {
case 'T': mem_limit *= 1024 * 1024; break;
case 'G': mem_limit *= 1024; break;
case 'k': mem_limit /= 1024; break;
case 'M': break;
default: FATAL("Unsupported suffix or bad syntax for -m");
}
if (mem_limit < 5) FATAL("Dangerously low value of -m");
if (sizeof(rlim_t) == 4 && mem_limit > 2000)
FATAL("Value of -m out of range on 32-bit systems");
}
break;
case 't':
if (timeout_given) FATAL("Multiple -t options not supported");
timeout_given = 1;
if (strcmp(optarg, "none")) {
exec_tmout = atoi(optarg);
if (exec_tmout < 20 || optarg[0] == '-')
FATAL("Dangerously low value of -t");
}
break;
case 'e':
if (edges_only) FATAL("Multiple -e options not supported");
edges_only = 1;
break;
case 'q':
if (quiet_mode) FATAL("Multiple -q options not supported");
quiet_mode = 1;
break;
case 'Z':
/* This is an undocumented option to write data in the syntax expected
by afl-cmin. Nobody else should have any use for this. */
cmin_mode = 1;
quiet_mode = 1;
break;
case 'A':
/* Another afl-cmin specific feature. */
at_file = optarg;
break;
case 'Q':
if (qemu_mode) FATAL("Multiple -Q options not supported");
if (!mem_limit_given) mem_limit = MEM_LIMIT_QEMU;
qemu_mode = 1;
break;
case 'U':
if (unicorn_mode) FATAL("Multiple -U options not supported");
if (!mem_limit_given) mem_limit = MEM_LIMIT_UNICORN;
unicorn_mode = 1;
break;
case 'b':
/* Secret undocumented mode. Writes output in raw binary format
similar to that dumped by afl-fuzz in <out_dir/queue/fuzz_bitmap. */
binary_mode = 1;
break;
case 'c':
if (keep_cores) FATAL("Multiple -c options not supported");
keep_cores = 1;
break;
default:
usage(argv[0]);
}
if (optind == argc || !out_file) usage(argv[0]);
setup_shm(0);
setup_signal_handlers();
set_up_environment();
find_binary(argv[optind]);
if (!quiet_mode) {
show_banner();
ACTF("Executing '%s'...\n", target_path);
}
detect_file_args(argv + optind, at_file);
if (qemu_mode)
use_argv = get_qemu_argv(argv[0], argv + optind, argc - optind);
else
use_argv = argv + optind;
run_target(use_argv);
tcnt = write_results();
if (!quiet_mode) {
if (!tcnt) FATAL("No instrumentation detected" cRST);
OKF("Captured %u tuples in '%s'." cRST, tcnt, out_file);
}
exit(child_crashed * 2 + child_timed_out);
}

View File

@ -1,23 +1,83 @@
#!/bin/sh
echo This reconfigures the system to have a better fuzzing performance
test "$1" = "-h" -o "$1" = "-hh" && {
echo 'afl-system-config by Marc Heuse <mh@mh-sec.de>'
echo
echo $0
echo
echo afl-system-config has no command line options
echo
echo afl-system reconfigures the system to a high performance fuzzing state
echo WARNING: this reduces the security of the system
echo
exit 1
}
DONE=
PLATFORM=`uname -s`
echo This reconfigures the system to have a better fuzzing performance.
if [ '!' "$EUID" = 0 ] && [ '!' `id -u` = 0 ] ; then
echo Error you need to be root to run this
exit 1
echo "Warning: you need to be root to run this!"
# we do not exit as other mechanisms exist that allows to do this than
# being root. let the errors speak for themselves.
fi
sysctl -w kernel.core_pattern=core
sysctl -w kernel.randomize_va_space=0
sysctl -w kernel.sched_child_runs_first=1
sysctl -w kernel.sched_autogroup_enabled=1
sysctl -w kernel.sched_migration_cost_ns=50000000
sysctl -w kernel.sched_latency_ns=250000000
echo never > /sys/kernel/mm/transparent_hugepage/enabled
test -e /sys/devices/system/cpu/cpufreq/scaling_governor && echo performance | tee /sys/devices/system/cpu/cpufreq/scaling_governor
test -e /sys/devices/system/cpu/cpufreq/policy0/scaling_governor && echo performance | tee /sys/devices/system/cpu/cpufreq/policy*/scaling_governor
test -e /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor && echo performance | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
test -e /sys/devices/system/cpu/intel_pstate/no_turbo && echo 0 > /sys/devices/system/cpu/intel_pstate/no_turbo
test -e /sys/devices/system/cpu/cpufreq/boost && echo 1 > /sys/devices/system/cpu/cpufreq/boost
echo
echo It is recommended to boot the kernel with lots of security off - if you are running a machine that is in a secured network - so set this:
echo '/etc/default/grub:GRUB_CMDLINE_LINUX_DEFAULT="ibpb=off ibrs=off kpti=off l1tf=off mds=off mitigations=off no_stf_barrier noibpb noibrs nopcid nopti nospec_store_bypass_disable nospectre_v1 nospectre_v2 pcid=off pti=off spec_store_bypass_disable=off spectre_v2=off stf_barrier=off"'
echo
echo Also use AFL_TMPDIR to use a tmpfs for the input file
if [ "$PLATFORM" = "Linux" ] ; then
{
sysctl -w kernel.core_pattern=core
sysctl -w kernel.randomize_va_space=0
sysctl -w kernel.sched_child_runs_first=1
sysctl -w kernel.sched_autogroup_enabled=1
sysctl -w kernel.sched_migration_cost_ns=50000000
sysctl -w kernel.sched_latency_ns=250000000
echo never > /sys/kernel/mm/transparent_hugepage/enabled
test -e /sys/devices/system/cpu/cpufreq/scaling_governor && echo performance | tee /sys/devices/system/cpu/cpufreq/scaling_governor
test -e /sys/devices/system/cpu/cpufreq/policy0/scaling_governor && echo performance | tee /sys/devices/system/cpu/cpufreq/policy*/scaling_governor
test -e /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor && echo performance | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
test -e /sys/devices/system/cpu/intel_pstate/no_turbo && echo 0 > /sys/devices/system/cpu/intel_pstate/no_turbo
test -e /sys/devices/system/cpu/cpufreq/boost && echo 1 > /sys/devices/system/cpu/cpufreq/boost
} > /dev/null
echo Settings applied.
dmesg | egrep -q 'nospectre_v2|spectre_v2=off' || {
echo It is recommended to boot the kernel with lots of security off - if you are running a machine that is in a secured network - so set this:
echo ' /etc/default/grub:GRUB_CMDLINE_LINUX_DEFAULT="ibpb=off ibrs=off kpti=off l1tf=off mds=off mitigations=off no_stf_barrier noibpb noibrs nopcid nopti nospec_store_bypass_disable nospectre_v1 nospectre_v2 pcid=off pti=off spec_store_bypass_disable=off spectre_v2=off stf_barrier=off"'
}
DONE=1
fi
if [ "$PLATFORM" = "FreeBSD" ] ; then
{
sysctl kern.elf32.aslr.enable=0
sysctl kern.elf64.aslr.enable=0
} > /dev/null
echo Settings applied.
echo It is recommended to boot the kernel with lots of security off - if you are running a machine that is in a secured network - so set this:
echo ' sysctl hw.ibrs_disable=1'
echo 'Setting kern.pmap.pg_ps_enabled=0 into /boot/loader.conf might be helpful too.'
DONE=1
fi
if [ "$PLATFORM" = "OpenBSD" ] ; then
echo
echo 'System security features cannot be disabled on OpenBSD.'
DONE=1
fi
if [ "$PLATFORM" = "NetBSD" ] ; then
{
#echo It is recommended to enable unprivileged users to set cpu affinity
#echo to be able to use afl-gotcpu meaningfully.
/sbin/sysctl -w security.models.extensions.user_set_cpu_affinity=1
} > /dev/null
echo Settings applied.
DONE=1
fi
if [ "$PLATFORM" = "Darwin" ] ; then
if [ $(launchctl list 2>/dev/null | grep -q '\.ReportCrash$') ] ; then
echo We unload the default crash reporter here
SL=/System/Library; PL=com.apple.ReportCrash
launchctl unload -w ${SL}/LaunchAgents/${PL}.plist
sudo launchctl unload -w ${SL}/LaunchDaemons/${PL}.Root.plist
echo Settings applied.
else
echo Nothing to do.
fi
DONE=1
fi
test -z "$DONE" && echo Error: Unknown platform: $PLATFORM
test -z "$AFL_TMPDIR" && echo Also use AFL_TMPDIR and point it to a tmpfs for the input file caching

1244
afl-tmin.c

File diff suppressed because it is too large Load Diff

View File

@ -1,11 +1,12 @@
#!/bin/sh
#
# american fuzzy lop - status check tool
# --------------------------------------
# american fuzzy lop++ - status check tool
# ----------------------------------------
#
# Written and maintained by Michal Zalewski <lcamtuf@google.com>
# Originally written by Michal Zalewski
#
# Copyright 2015 Google Inc. All rights reserved.
# Copyright 2019-2020 AFLplusplus Project. 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.
@ -17,8 +18,16 @@
# instances of afl-fuzz.
#
echo "status check tool for afl-fuzz by <lcamtuf@google.com>"
echo "$0 status check tool for afl-fuzz by Michal Zalewski"
echo
test "$1" = "-h" -o "$1" = "-hh" && {
echo $0 [-s] output_directory
echo
echo Options:
echo -s - skip details and output summary results only
echo
exit 1
}
if [ "$1" = "-s" ]; then
@ -37,7 +46,7 @@ if [ "$DIR" = "" ]; then
echo "Usage: $0 [ -s ] afl_sync_dir" 1>&2
echo 1>&2
echo "The -s option causes the tool to skip all the per-fuzzer trivia and show" 1>&2
echo "just the summary results. See docs/parallel_fuzzing.txt for additional tips." 1>&2
echo "just the summary results. See docs/parallel_fuzzing.md for additional tips." 1>&2
echo 1>&2
exit 1
@ -52,9 +61,16 @@ if [ -d queue ]; then
fi
RED=`tput setaf 9 1 1`
GREEN=`tput setaf 2 1 1`
BLUE=`tput setaf 4 1 1`
YELLOW=`tput setaf 11 1 1`
NC=`tput sgr0`
RESET="$NC"
CUR_TIME=`date +%s`
TMP=`mktemp -t .afl-whatsup-XXXXXXXX` || exit 1
TMP=`mktemp -t .afl-whatsup-XXXXXXXX` || TMP=`mktemp -p /data/local/tmp .afl-whatsup-XXXXXXXX` || TMP=`mktemp -p /data/local/tmp .afl-whatsup-XXXXXXXX` || exit 1
ALIVE_CNT=0
DEAD_CNT=0
@ -66,6 +82,12 @@ TOTAL_CRASHES=0
TOTAL_PFAV=0
TOTAL_PENDING=0
# Time since last path / crash / hang, formatted as string
FMT_TIME="0 days 0 hours"
FMT_PATH="${RED}none seen yet${NC}"
FMT_CRASH="none seen yet"
FMT_HANG="none seen yet"
if [ "$SUMMARY_ONLY" = "" ]; then
echo "Individual fuzzers"
@ -74,6 +96,38 @@ if [ "$SUMMARY_ONLY" = "" ]; then
fi
fmt_duration()
{
DUR_STRING=
if [ $1 -le 0 ]; then
return 1
fi
local duration=$((CUR_TIME - $1))
local days=$((duration / 60 / 60 / 24))
local hours=$(((duration / 60 / 60) % 24))
local minutes=$(((duration / 60) % 60))
local seconds=$((duration % 60))
if [ $duration -le 0 ]; then
DUR_STRING="0 seconds"
elif [ $duration -eq 1 ]; then
DUR_STRING="1 second"
elif [ $days -gt 0 ]; then
DUR_STRING="$days days, $hours hours"
elif [ $hours -gt 0 ]; then
DUR_STRING="$hours hours, $minutes minutes"
elif [ $minutes -gt 0 ]; then
DUR_STRING="$minutes minutes, $seconds seconds"
else
DUR_STRING="$seconds seconds"
fi
}
FIRST=true
TOTAL_WCOP=
TOTAL_LAST_PATH=0
for i in `find . -maxdepth 2 -iname fuzzer_stats | sort`; do
sed 's/^command_line.*$/_skip:1/;s/[ ]*:[ ]*/="/;s/$/"/' "$i" >"$TMP"
@ -83,9 +137,15 @@ for i in `find . -maxdepth 2 -iname fuzzer_stats | sort`; do
RUN_DAYS=$((RUN_UNIX / 60 / 60 / 24))
RUN_HRS=$(((RUN_UNIX / 60 / 60) % 24))
test -n "$cycles_wo_finds" && {
test -z "$FIRST" && TOTAL_WCOP="${TOTAL_WCOP}/"
TOTAL_WCOP="${TOTAL_WCOP}${cycles_wo_finds}"
FIRST=
}
if [ "$SUMMARY_ONLY" = "" ]; then
echo ">>> $afl_banner ($RUN_DAYS days, $RUN_HRS hrs) <<<"
echo ">>> $afl_banner ($RUN_DAYS days, $RUN_HRS hrs) fuzzer PID: $fuzzer_pid <<<"
echo
fi
@ -106,7 +166,8 @@ for i in `find . -maxdepth 2 -iname fuzzer_stats | sort`; do
ALIVE_CNT=$((ALIVE_CNT + 1))
EXEC_SEC=$((execs_done / RUN_UNIX))
EXEC_SEC=0
test -z "$RUN_UNIX" -o "$RUN_UNIX" = 0 || EXEC_SEC=$((execs_done / RUN_UNIX))
PATH_PERC=$((cur_path * 100 / paths_total))
TOTAL_TIME=$((TOTAL_TIME + RUN_UNIX))
@ -116,8 +177,43 @@ for i in `find . -maxdepth 2 -iname fuzzer_stats | sort`; do
TOTAL_PENDING=$((TOTAL_PENDING + pending_total))
TOTAL_PFAV=$((TOTAL_PFAV + pending_favs))
if [ "$last_path" -gt "$TOTAL_LAST_PATH" ]; then
TOTAL_LAST_PATH=$last_path
fi
if [ "$SUMMARY_ONLY" = "" ]; then
# Warnings in red
TIMEOUT_PERC=$((exec_timeout * 100 / execs_done))
if [ $TIMEOUT_PERC -ge 10 ]; then
echo " ${RED}timeout_ratio $TIMEOUT_PERC%${NC}"
fi
if [ $EXEC_SEC -eq 0 ]; then
echo " ${YELLOW}no data yet, 0 execs/sec${NC}"
elif [ $EXEC_SEC -lt 100 ]; then
echo " ${RED}slow execution, $EXEC_SEC execs/sec${NC}"
fi
fmt_duration $last_path && FMT_PATH=$DUR_STRING
fmt_duration $last_crash && FMT_CRASH=$DUR_STRING
fmt_duration $last_hang && FMT_HANG=$DUR_STRING
FMT_CWOP="not available"
test -n "$cycles_wo_finds" && {
test "$cycles_wo_finds" = 0 && FMT_CWOP="$cycles_wo_finds"
test "$cycles_wo_finds" -gt 10 && FMT_CWOP="${YELLOW}$cycles_wo_finds${NC}"
test "$cycles_wo_finds" -gt 50 && FMT_CWOP="${RED}$cycles_wo_finds${NC}"
}
echo " last_path : $FMT_PATH"
echo " last_crash : $FMT_CRASH"
echo " last_hang : $FMT_HANG"
echo " cycles_wo_finds : $FMT_CWOP"
CPU_USAGE=$(ps aux | grep $fuzzer_pid | grep -v grep | awk '{print $3}')
MEM_USAGE=$(ps aux | grep $fuzzer_pid | grep -v grep | awk '{print $4}')
echo " cpu usage $CPU_USAGE%, memory usage $MEM_USAGE%"
echo " cycle $((cycles_done + 1)), lifetime speed $EXEC_SEC execs/sec, path $cur_path/$paths_total (${PATH_PERC}%)"
if [ "$unique_crashes" = "0" ]; then
@ -132,11 +228,28 @@ for i in `find . -maxdepth 2 -iname fuzzer_stats | sort`; do
done
# Formatting for total time, time since last path, crash, and hang
fmt_duration $((CUR_TIME - TOTAL_TIME)) && FMT_TIME=$DUR_STRING
# Formatting for total execution
FMT_EXECS="0 millions"
EXECS_MILLION=$((TOTAL_EXECS / 1000 / 1000))
EXECS_THOUSAND=$((TOTAL_EXECS / 1000 % 1000))
if [ $EXECS_MILLION -gt 9 ]; then
FMT_EXECS="$EXECS_MILLION millions"
elif [ $EXECS_MILLION -gt 0 ]; then
FMT_EXECS="$EXECS_MILLION millions, $EXECS_THOUSAND thousands"
else
FMT_EXECS="$EXECS_THOUSAND thousands"
fi
rm -f "$TMP"
TOTAL_DAYS=$((TOTAL_TIME / 60 / 60 / 24))
TOTAL_HRS=$(((TOTAL_TIME / 60 / 60) % 24))
test -z "$TOTAL_WCOP" && TOTAL_WCOP="not available"
fmt_duration $TOTAL_LAST_PATH && TOTAL_LAST_PATH=$DUR_STRING
test "$TOTAL_TIME" = "0" && TOTAL_TIME=1
echo "Summary stats"
@ -148,9 +261,12 @@ if [ ! "$DEAD_CNT" = "0" ]; then
echo " Dead or remote : $DEAD_CNT (excluded from stats)"
fi
echo " Total run time : $TOTAL_DAYS days, $TOTAL_HRS hours"
echo " Total execs : $((TOTAL_EXECS / 1000 / 1000)) million"
echo " Total run time : $FMT_TIME"
echo " Total execs : $FMT_EXECS"
echo " Cumulative speed : $TOTAL_EPS execs/sec"
if [ "$ALIVE_CNT" -gt "0" ]; then
echo " Average speed : $((TOTAL_EPS / ALIVE_CNT)) execs/sec"
fi
echo " Pending paths : $TOTAL_PFAV faves, $TOTAL_PENDING total"
if [ "$ALIVE_CNT" -gt "1" ]; then
@ -158,6 +274,8 @@ if [ "$ALIVE_CNT" -gt "1" ]; then
fi
echo " Crashes found : $TOTAL_CRASHES locally unique"
echo "Cycles without finds : $TOTAL_WCOP"
echo " Time without finds : $TOTAL_LAST_PATH"
echo
exit 0

80
afl-wine-trace Executable file
View File

@ -0,0 +1,80 @@
#!/usr/bin/env python3
import os
import sys
import pefile
import shutil
import subprocess
if len(sys.argv) < 2:
print("[afl-wine-trace] usage: ./afl-wine-trace binary [args...]\n")
exit(1)
if os.getenv("AFL_PATH"):
my_dir = os.getenv("AFL_PATH")
else:
my_dir = os.path.dirname(os.path.abspath(__file__))
os.environ["WINELOADERNOEXEC"] = "1"
pe = pefile.PE(sys.argv[1])
if "AFL_ENTRYPOINT" not in os.environ:
os.environ["AFL_ENTRYPOINT"] = "0x%x" % (pe.OPTIONAL_HEADER.ImageBase + pe.OPTIONAL_HEADER.AddressOfEntryPoint)
if not os.getenv("AFL_INST_LIBS"):
if "AFL_CODE_START" not in os.environ:
os.environ["AFL_CODE_START"] = "0x%x" % (pe.OPTIONAL_HEADER.ImageBase + pe.OPTIONAL_HEADER.BaseOfCode)
if "AFL_CODE_END" not in os.environ:
os.environ["AFL_CODE_END"] = "0x%x" % (pe.OPTIONAL_HEADER.ImageBase + pe.OPTIONAL_HEADER.BaseOfCode + pe.OPTIONAL_HEADER.SizeOfCode)
if pe.FILE_HEADER.Machine == pefile.MACHINE_TYPE["IMAGE_FILE_MACHINE_AMD64"] or pe.FILE_HEADER.Machine == pefile.MACHINE_TYPE["IMAGE_FILE_MACHINE_IA64"]:
os.environ["LD_PRELOAD"] = os.path.join(my_dir, "qemu_mode/unsigaction/unsigaction64.so")
else:
os.environ["LD_PRELOAD"] = os.path.join(my_dir, "qemu_mode/unsigaction/unsigaction32.so")
if os.getenv("WINECOV_QEMU_PATH"):
qemu_path = os.getenv("WINECOV_QEMU_PATH")
elif os.path.exists(os.path.join(my_dir, "afl-qemu-trace")):
qemu_path = os.path.join(my_dir, "afl-qemu-trace")
else:
qemu_path = "qemu-"
if pe.FILE_HEADER.Machine == pefile.MACHINE_TYPE["IMAGE_FILE_MACHINE_AMD64"] or pe.FILE_HEADER.Machine == pefile.MACHINE_TYPE["IMAGE_FILE_MACHINE_IA64"]:
qemu_path += "x86_64"
elif pe.FILE_HEADER.Machine == pefile.MACHINE_TYPE["IMAGE_FILE_MACHINE_I386"]:
qemu_path += "i386"
else:
print ("[afl-wine-trace] unsuppoted architecture\n")
exit(1)
qemu_path = shutil.which(qemu_path)
wine_path = None
if os.getenv("AFL_WINE_PATH"):
wine_path = os.getenv("AFL_WINE_PATH")
else:
if not wine_path and shutil.which("wine"):
wine_path = shutil.which("wine")
if not wine_path and os.path.exists("/usr/bin/wine"):
wine_path = "/usr/bin/wine"
if not wine_path and os.path.exists("/usr/lib/wine/wine"):
wine_path = "/usr/lib/wine/wine"
if pe.FILE_HEADER.Machine == pefile.MACHINE_TYPE["IMAGE_FILE_MACHINE_AMD64"] or pe.FILE_HEADER.Machine == pefile.MACHINE_TYPE["IMAGE_FILE_MACHINE_IA64"]:
wine_path += "64"
elif pe.FILE_HEADER.Machine == pefile.MACHINE_TYPE["IMAGE_FILE_MACHINE_I386"]:
pass
else:
print ("[afl-wine-trace] unsopported architecture\n")
exit(1)
argv = sys.argv[1:]
for i in range(len(argv)):
if ".cur_input" in argv[i]:
# Get the Wine translated path using the winepath tool
arg_translated = subprocess.run([os.path.join(os.path.dirname(wine_path), "winepath"), "--windows", argv[i]], universal_newlines=True, stdout=subprocess.PIPE).stdout
# Remove the spurious LF at the end of the path
if len(arg_translated) > 0 and arg_translated[-1] == '\n':
arg_translated = arg_translated[:-1]
argv[i] = arg_translated
break
print("[afl-wine-trace] exec:", " ".join([qemu_path, wine_path] + argv))
os.execve(qemu_path, [qemu_path, wine_path] + argv, os.environ)

View File

@ -1,582 +0,0 @@
/*
american fuzzy lop - error-checking, memory-zeroing alloc routines
------------------------------------------------------------------
Written and maintained by Michal Zalewski <lcamtuf@google.com>
Copyright 2013, 2014, 2015 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 allocator is not designed to resist malicious attackers (the canaries
are small and predictable), but provides a robust and portable way to detect
use-after-free, off-by-one writes, stale pointers, and so on.
*/
#ifndef _HAVE_ALLOC_INL_H
#define _HAVE_ALLOC_INL_H
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "config.h"
#include "types.h"
#include "debug.h"
/* User-facing macro to sprintf() to a dynamically allocated buffer. */
#define alloc_printf(_str...) ({ \
u8* _tmp; \
s32 _len = snprintf(NULL, 0, _str); \
if (_len < 0) FATAL("Whoa, snprintf() fails?!"); \
_tmp = ck_alloc(_len + 1); \
snprintf((char*)_tmp, _len + 1, _str); \
_tmp; \
})
/* Macro to enforce allocation limits as a last-resort defense against
integer overflows. */
#define ALLOC_CHECK_SIZE(_s) do { \
if ((_s) > MAX_ALLOC) \
ABORT("Bad alloc request: %u bytes", (_s)); \
} while (0)
/* Macro to check malloc() failures and the like. */
#define ALLOC_CHECK_RESULT(_r, _s) do { \
if (!(_r)) \
ABORT("Out of memory: can't allocate %u bytes", (_s)); \
} while (0)
/* Magic tokens used to mark used / freed chunks. */
#define ALLOC_MAGIC_C1 0xFF00FF00 /* Used head (dword) */
#define ALLOC_MAGIC_F 0xFE00FE00 /* Freed head (dword) */
#define ALLOC_MAGIC_C2 0xF0 /* Used tail (byte) */
/* Positions of guard tokens in relation to the user-visible pointer. */
#define ALLOC_C1(_ptr) (((u32*)(_ptr))[-2])
#define ALLOC_S(_ptr) (((u32*)(_ptr))[-1])
#define ALLOC_C2(_ptr) (((u8*)(_ptr))[ALLOC_S(_ptr)])
#define ALLOC_OFF_HEAD 8
#define ALLOC_OFF_TOTAL (ALLOC_OFF_HEAD + 1)
/* Allocator increments for ck_realloc_block(). */
#define ALLOC_BLK_INC 256
/* Sanity-checking macros for pointers. */
#define CHECK_PTR(_p) do { \
if (_p) { \
if (ALLOC_C1(_p) ^ ALLOC_MAGIC_C1) {\
if (ALLOC_C1(_p) == ALLOC_MAGIC_F) \
ABORT("Use after free."); \
else ABORT("Corrupted head alloc canary."); \
} \
} \
} while (0)
/*
#define CHECK_PTR(_p) do { \
if (_p) { \
if (ALLOC_C1(_p) ^ ALLOC_MAGIC_C1) {\
if (ALLOC_C1(_p) == ALLOC_MAGIC_F) \
ABORT("Use after free."); \
else ABORT("Corrupted head alloc canary."); \
} \
if (ALLOC_C2(_p) ^ ALLOC_MAGIC_C2) \
ABORT("Corrupted tail alloc canary."); \
} \
} while (0)
*/
#define CHECK_PTR_EXPR(_p) ({ \
typeof (_p) _tmp = (_p); \
CHECK_PTR(_tmp); \
_tmp; \
})
/* Allocate a buffer, explicitly not zeroing it. Returns NULL for zero-sized
requests. */
static inline void* DFL_ck_alloc_nozero(u32 size) {
void* ret;
if (!size) return NULL;
ALLOC_CHECK_SIZE(size);
ret = malloc(size + ALLOC_OFF_TOTAL);
ALLOC_CHECK_RESULT(ret, size);
ret += ALLOC_OFF_HEAD;
ALLOC_C1(ret) = ALLOC_MAGIC_C1;
ALLOC_S(ret) = size;
ALLOC_C2(ret) = ALLOC_MAGIC_C2;
return ret;
}
/* Allocate a buffer, returning zeroed memory. */
static inline void* DFL_ck_alloc(u32 size) {
void* mem;
if (!size) return NULL;
mem = DFL_ck_alloc_nozero(size);
return memset(mem, 0, size);
}
/* Free memory, checking for double free and corrupted heap. When DEBUG_BUILD
is set, the old memory will be also clobbered with 0xFF. */
static inline void DFL_ck_free(void* mem) {
if (!mem) return;
CHECK_PTR(mem);
#ifdef DEBUG_BUILD
/* Catch pointer issues sooner. */
memset(mem, 0xFF, ALLOC_S(mem));
#endif /* DEBUG_BUILD */
ALLOC_C1(mem) = ALLOC_MAGIC_F;
free(mem - ALLOC_OFF_HEAD);
}
/* Re-allocate a buffer, checking for issues and zeroing any newly-added tail.
With DEBUG_BUILD, the buffer is always reallocated to a new addresses and the
old memory is clobbered with 0xFF. */
static inline void* DFL_ck_realloc(void* orig, u32 size) {
void* ret;
u32 old_size = 0;
if (!size) {
DFL_ck_free(orig);
return NULL;
}
if (orig) {
CHECK_PTR(orig);
#ifndef DEBUG_BUILD
ALLOC_C1(orig) = ALLOC_MAGIC_F;
#endif /* !DEBUG_BUILD */
old_size = ALLOC_S(orig);
orig -= ALLOC_OFF_HEAD;
ALLOC_CHECK_SIZE(old_size);
}
ALLOC_CHECK_SIZE(size);
#ifndef DEBUG_BUILD
ret = realloc(orig, size + ALLOC_OFF_TOTAL);
ALLOC_CHECK_RESULT(ret, size);
#else
/* Catch pointer issues sooner: force relocation and make sure that the
original buffer is wiped. */
ret = malloc(size + ALLOC_OFF_TOTAL);
ALLOC_CHECK_RESULT(ret, size);
if (orig) {
memcpy(ret + ALLOC_OFF_HEAD, orig + ALLOC_OFF_HEAD, MIN(size, old_size));
memset(orig + ALLOC_OFF_HEAD, 0xFF, old_size);
ALLOC_C1(orig + ALLOC_OFF_HEAD) = ALLOC_MAGIC_F;
free(orig);
}
#endif /* ^!DEBUG_BUILD */
ret += ALLOC_OFF_HEAD;
ALLOC_C1(ret) = ALLOC_MAGIC_C1;
ALLOC_S(ret) = size;
ALLOC_C2(ret) = ALLOC_MAGIC_C2;
if (size > old_size)
memset(ret + old_size, 0, size - old_size);
return ret;
}
/* Re-allocate a buffer with ALLOC_BLK_INC increments (used to speed up
repeated small reallocs without complicating the user code). */
static inline void* DFL_ck_realloc_block(void* orig, u32 size) {
#ifndef DEBUG_BUILD
if (orig) {
CHECK_PTR(orig);
if (ALLOC_S(orig) >= size) return orig;
size += ALLOC_BLK_INC;
}
#endif /* !DEBUG_BUILD */
return DFL_ck_realloc(orig, size);
}
/* Create a buffer with a copy of a string. Returns NULL for NULL inputs. */
static inline u8* DFL_ck_strdup(u8* str) {
void* ret;
u32 size;
if (!str) return NULL;
size = strlen((char*)str) + 1;
ALLOC_CHECK_SIZE(size);
ret = malloc(size + ALLOC_OFF_TOTAL);
ALLOC_CHECK_RESULT(ret, size);
ret += ALLOC_OFF_HEAD;
ALLOC_C1(ret) = ALLOC_MAGIC_C1;
ALLOC_S(ret) = size;
ALLOC_C2(ret) = ALLOC_MAGIC_C2;
return memcpy(ret, str, size);
}
/* Create a buffer with a copy of a memory block. Returns NULL for zero-sized
or NULL inputs. */
static inline void* DFL_ck_memdup(void* mem, u32 size) {
void* ret;
if (!mem || !size) return NULL;
ALLOC_CHECK_SIZE(size);
ret = malloc(size + ALLOC_OFF_TOTAL);
ALLOC_CHECK_RESULT(ret, size);
ret += ALLOC_OFF_HEAD;
ALLOC_C1(ret) = ALLOC_MAGIC_C1;
ALLOC_S(ret) = size;
ALLOC_C2(ret) = ALLOC_MAGIC_C2;
return memcpy(ret, mem, size);
}
/* Create a buffer with a block of text, appending a NUL terminator at the end.
Returns NULL for zero-sized or NULL inputs. */
static inline u8* DFL_ck_memdup_str(u8* mem, u32 size) {
u8* ret;
if (!mem || !size) return NULL;
ALLOC_CHECK_SIZE(size);
ret = malloc(size + ALLOC_OFF_TOTAL + 1);
ALLOC_CHECK_RESULT(ret, size);
ret += ALLOC_OFF_HEAD;
ALLOC_C1(ret) = ALLOC_MAGIC_C1;
ALLOC_S(ret) = size;
ALLOC_C2(ret) = ALLOC_MAGIC_C2;
memcpy(ret, mem, size);
ret[size] = 0;
return ret;
}
#ifndef DEBUG_BUILD
/* In non-debug mode, we just do straightforward aliasing of the above functions
to user-visible names such as ck_alloc(). */
#define ck_alloc DFL_ck_alloc
#define ck_alloc_nozero DFL_ck_alloc_nozero
#define ck_realloc DFL_ck_realloc
#define ck_realloc_block DFL_ck_realloc_block
#define ck_strdup DFL_ck_strdup
#define ck_memdup DFL_ck_memdup
#define ck_memdup_str DFL_ck_memdup_str
#define ck_free DFL_ck_free
#define alloc_report()
#else
/* In debugging mode, we also track allocations to detect memory leaks, and the
flow goes through one more layer of indirection. */
/* Alloc tracking data structures: */
#define ALLOC_BUCKETS 4096
struct TRK_obj {
void *ptr;
char *file, *func;
u32 line;
};
#ifdef AFL_MAIN
struct TRK_obj* TRK[ALLOC_BUCKETS];
u32 TRK_cnt[ALLOC_BUCKETS];
# define alloc_report() TRK_report()
#else
extern struct TRK_obj* TRK[ALLOC_BUCKETS];
extern u32 TRK_cnt[ALLOC_BUCKETS];
# define alloc_report()
#endif /* ^AFL_MAIN */
/* Bucket-assigning function for a given pointer: */
#define TRKH(_ptr) (((((u32)(_ptr)) >> 16) ^ ((u32)(_ptr))) % ALLOC_BUCKETS)
/* Add a new entry to the list of allocated objects. */
static inline void TRK_alloc_buf(void* ptr, const char* file, const char* func,
u32 line) {
u32 i, bucket;
if (!ptr) return;
bucket = TRKH(ptr);
/* Find a free slot in the list of entries for that bucket. */
for (i = 0; i < TRK_cnt[bucket]; i++)
if (!TRK[bucket][i].ptr) {
TRK[bucket][i].ptr = ptr;
TRK[bucket][i].file = (char*)file;
TRK[bucket][i].func = (char*)func;
TRK[bucket][i].line = line;
return;
}
/* No space available - allocate more. */
TRK[bucket] = DFL_ck_realloc_block(TRK[bucket],
(TRK_cnt[bucket] + 1) * sizeof(struct TRK_obj));
TRK[bucket][i].ptr = ptr;
TRK[bucket][i].file = (char*)file;
TRK[bucket][i].func = (char*)func;
TRK[bucket][i].line = line;
TRK_cnt[bucket]++;
}
/* Remove entry from the list of allocated objects. */
static inline void TRK_free_buf(void* ptr, const char* file, const char* func,
u32 line) {
u32 i, bucket;
if (!ptr) return;
bucket = TRKH(ptr);
/* Find the element on the list... */
for (i = 0; i < TRK_cnt[bucket]; i++)
if (TRK[bucket][i].ptr == ptr) {
TRK[bucket][i].ptr = 0;
return;
}
WARNF("ALLOC: Attempt to free non-allocated memory in %s (%s:%u)",
func, file, line);
}
/* Do a final report on all non-deallocated objects. */
static inline void TRK_report(void) {
u32 i, bucket;
fflush(0);
for (bucket = 0; bucket < ALLOC_BUCKETS; bucket++)
for (i = 0; i < TRK_cnt[bucket]; i++)
if (TRK[bucket][i].ptr)
WARNF("ALLOC: Memory never freed, created in %s (%s:%u)",
TRK[bucket][i].func, TRK[bucket][i].file, TRK[bucket][i].line);
}
/* Simple wrappers for non-debugging functions: */
static inline void* TRK_ck_alloc(u32 size, const char* file, const char* func,
u32 line) {
void* ret = DFL_ck_alloc(size);
TRK_alloc_buf(ret, file, func, line);
return ret;
}
static inline void* TRK_ck_realloc(void* orig, u32 size, const char* file,
const char* func, u32 line) {
void* ret = DFL_ck_realloc(orig, size);
TRK_free_buf(orig, file, func, line);
TRK_alloc_buf(ret, file, func, line);
return ret;
}
static inline void* TRK_ck_realloc_block(void* orig, u32 size, const char* file,
const char* func, u32 line) {
void* ret = DFL_ck_realloc_block(orig, size);
TRK_free_buf(orig, file, func, line);
TRK_alloc_buf(ret, file, func, line);
return ret;
}
static inline void* TRK_ck_strdup(u8* str, const char* file, const char* func,
u32 line) {
void* ret = DFL_ck_strdup(str);
TRK_alloc_buf(ret, file, func, line);
return ret;
}
static inline void* TRK_ck_memdup(void* mem, u32 size, const char* file,
const char* func, u32 line) {
void* ret = DFL_ck_memdup(mem, size);
TRK_alloc_buf(ret, file, func, line);
return ret;
}
static inline void* TRK_ck_memdup_str(void* mem, u32 size, const char* file,
const char* func, u32 line) {
void* ret = DFL_ck_memdup_str(mem, size);
TRK_alloc_buf(ret, file, func, line);
return ret;
}
static inline void TRK_ck_free(void* ptr, const char* file,
const char* func, u32 line) {
TRK_free_buf(ptr, file, func, line);
DFL_ck_free(ptr);
}
/* Aliasing user-facing names to tracking functions: */
#define ck_alloc(_p1) \
TRK_ck_alloc(_p1, __FILE__, __FUNCTION__, __LINE__)
#define ck_alloc_nozero(_p1) \
TRK_ck_alloc(_p1, __FILE__, __FUNCTION__, __LINE__)
#define ck_realloc(_p1, _p2) \
TRK_ck_realloc(_p1, _p2, __FILE__, __FUNCTION__, __LINE__)
#define ck_realloc_block(_p1, _p2) \
TRK_ck_realloc_block(_p1, _p2, __FILE__, __FUNCTION__, __LINE__)
#define ck_strdup(_p1) \
TRK_ck_strdup(_p1, __FILE__, __FUNCTION__, __LINE__)
#define ck_memdup(_p1, _p2) \
TRK_ck_memdup(_p1, _p2, __FILE__, __FUNCTION__, __LINE__)
#define ck_memdup_str(_p1, _p2) \
TRK_ck_memdup_str(_p1, _p2, __FILE__, __FUNCTION__, __LINE__)
#define ck_free(_p1) \
TRK_ck_free(_p1, __FILE__, __FUNCTION__, __LINE__)
#endif /* ^!DEBUG_BUILD */
#endif /* ! _HAVE_ALLOC_INL_H */

359
config.h
View File

@ -1,359 +0,0 @@
/*
american fuzzy lop plus plus - vaguely configurable bits
----------------------------------------------
Written and maintained by Michal Zalewski <lcamtuf@google.com>
Copyright 2013, 2014, 2015, 2016 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
*/
#ifndef _HAVE_CONFIG_H
#define _HAVE_CONFIG_H
#include "types.h"
/* Version string: */
#define VERSION "++2.53c"
/******************************************************
* *
* Settings that may be of interest to power users: *
* *
******************************************************/
/* Comment out to disable terminal colors (note that this makes afl-analyze
a lot less nice): */
#define USE_COLOR
/* Comment out to disable fancy ANSI boxes and use poor man's 7-bit UI: */
#define FANCY_BOXES
/* Default timeout for fuzzed code (milliseconds). This is the upper bound,
also used for detecting hangs; the actual value is auto-scaled: */
#define EXEC_TIMEOUT 1000
/* Timeout rounding factor when auto-scaling (milliseconds): */
#define EXEC_TM_ROUND 20
/* Default memory limit for child process (MB): */
#ifndef __x86_64__
# define MEM_LIMIT 25
#else
# define MEM_LIMIT 50
#endif /* ^!__x86_64__ */
/* Default memory limit when running in QEMU mode (MB): */
#define MEM_LIMIT_QEMU 200
/* Default memory limit when running in Unicorn mode (MB): */
#define MEM_LIMIT_UNICORN 200
/* Number of calibration cycles per every new test case (and for test
cases that show variable behavior): */
#define CAL_CYCLES 8
#define CAL_CYCLES_LONG 40
/* Number of subsequent timeouts before abandoning an input file: */
#define TMOUT_LIMIT 250
/* Maximum number of unique hangs or crashes to record: */
#define KEEP_UNIQUE_HANG 500
#define KEEP_UNIQUE_CRASH 5000
/* Baseline number of random tweaks during a single 'havoc' stage: */
#define HAVOC_CYCLES 256
#define HAVOC_CYCLES_INIT 1024
/* Maximum multiplier for the above (should be a power of two, beware
of 32-bit int overflows): */
#define HAVOC_MAX_MULT 16
#define HAVOC_MAX_MULT_MOPT 32
/* Absolute minimum number of havoc cycles (after all adjustments): */
#define HAVOC_MIN 16
/* Power Schedule Divisor */
#define POWER_BETA 1
#define MAX_FACTOR (POWER_BETA * 32)
/* Maximum stacking for havoc-stage tweaks. The actual value is calculated
like this:
n = random between 1 and HAVOC_STACK_POW2
stacking = 2^n
In other words, the default (n = 7) produces 2, 4, 8, 16, 32, 64, or
128 stacked tweaks: */
#define HAVOC_STACK_POW2 7
/* Caps on block sizes for cloning and deletion operations. Each of these
ranges has a 33% probability of getting picked, except for the first
two cycles where smaller blocks are favored: */
#define HAVOC_BLK_SMALL 32
#define HAVOC_BLK_MEDIUM 128
#define HAVOC_BLK_LARGE 1500
/* Extra-large blocks, selected very rarely (<5% of the time): */
#define HAVOC_BLK_XL 32768
/* Probabilities of skipping non-favored entries in the queue, expressed as
percentages: */
#define SKIP_TO_NEW_PROB 99 /* ...when there are new, pending favorites */
#define SKIP_NFAV_OLD_PROB 95 /* ...no new favs, cur entry already fuzzed */
#define SKIP_NFAV_NEW_PROB 75 /* ...no new favs, cur entry not fuzzed yet */
/* Splicing cycle count: */
#define SPLICE_CYCLES 15
/* Nominal per-splice havoc cycle length: */
#define SPLICE_HAVOC 32
/* Maximum offset for integer addition / subtraction stages: */
#define ARITH_MAX 35
/* Limits for the test case trimmer. The absolute minimum chunk size; and
the starting and ending divisors for chopping up the input file: */
#define TRIM_MIN_BYTES 4
#define TRIM_START_STEPS 16
#define TRIM_END_STEPS 1024
/* Maximum size of input file, in bytes (keep under 100MB): */
#define MAX_FILE (1 * 1024 * 1024)
/* The same, for the test case minimizer: */
#define TMIN_MAX_FILE (10 * 1024 * 1024)
/* Block normalization steps for afl-tmin: */
#define TMIN_SET_MIN_SIZE 4
#define TMIN_SET_STEPS 128
/* Maximum dictionary token size (-x), in bytes: */
#define MAX_DICT_FILE 128
/* Length limits for auto-detected dictionary tokens: */
#define MIN_AUTO_EXTRA 3
#define MAX_AUTO_EXTRA 32
/* Maximum number of user-specified dictionary tokens to use in deterministic
steps; past this point, the "extras/user" step will be still carried out,
but with proportionally lower odds: */
#define MAX_DET_EXTRAS 200
/* Maximum number of auto-extracted dictionary tokens to actually use in fuzzing
(first value), and to keep in memory as candidates. The latter should be much
higher than the former. */
#define USE_AUTO_EXTRAS 50
#define MAX_AUTO_EXTRAS (USE_AUTO_EXTRAS * 10)
/* Scaling factor for the effector map used to skip some of the more
expensive deterministic steps. The actual divisor is set to
2^EFF_MAP_SCALE2 bytes: */
#define EFF_MAP_SCALE2 3
/* Minimum input file length at which the effector logic kicks in: */
#define EFF_MIN_LEN 128
/* Maximum effector density past which everything is just fuzzed
unconditionally (%): */
#define EFF_MAX_PERC 90
/* UI refresh frequency (Hz): */
#define UI_TARGET_HZ 5
/* Fuzzer stats file and plot update intervals (sec): */
#define STATS_UPDATE_SEC 60
#define PLOT_UPDATE_SEC 5
/* Smoothing divisor for CPU load and exec speed stats (1 - no smoothing). */
#define AVG_SMOOTHING 16
/* Sync interval (every n havoc cycles): */
#define SYNC_INTERVAL 5
/* Output directory reuse grace period (minutes): */
#define OUTPUT_GRACE 25
/* Uncomment to use simple file names (id_NNNNNN): */
// #define SIMPLE_FILES
/* List of interesting values to use in fuzzing. */
#define INTERESTING_8 \
-128, /* Overflow signed 8-bit when decremented */ \
-1, /* */ \
0, /* */ \
1, /* */ \
16, /* One-off with common buffer size */ \
32, /* One-off with common buffer size */ \
64, /* One-off with common buffer size */ \
100, /* One-off with common buffer size */ \
127 /* Overflow signed 8-bit when incremented */
#define INTERESTING_16 \
-32768, /* Overflow signed 16-bit when decremented */ \
-129, /* Overflow signed 8-bit */ \
128, /* Overflow signed 8-bit */ \
255, /* Overflow unsig 8-bit when incremented */ \
256, /* Overflow unsig 8-bit */ \
512, /* One-off with common buffer size */ \
1000, /* One-off with common buffer size */ \
1024, /* One-off with common buffer size */ \
4096, /* One-off with common buffer size */ \
32767 /* Overflow signed 16-bit when incremented */
#define INTERESTING_32 \
-2147483648LL, /* Overflow signed 32-bit when decremented */ \
-100663046, /* Large negative number (endian-agnostic) */ \
-32769, /* Overflow signed 16-bit */ \
32768, /* Overflow signed 16-bit */ \
65535, /* Overflow unsig 16-bit when incremented */ \
65536, /* Overflow unsig 16 bit */ \
100663045, /* Large positive number (endian-agnostic) */ \
2147483647 /* Overflow signed 32-bit when incremented */
/***********************************************************
* *
* Really exotic stuff you probably don't want to touch: *
* *
***********************************************************/
/* Call count interval between reseeding the libc PRNG from /dev/urandom: */
#define RESEED_RNG 10000
/* Maximum line length passed from GCC to 'as' and used for parsing
configuration files: */
#define MAX_LINE 8192
/* Environment variable used to pass SHM ID to the called program. */
#define SHM_ENV_VAR "__AFL_SHM_ID"
/* Other less interesting, internal-only variables. */
#define CLANG_ENV_VAR "__AFL_CLANG_MODE"
#define AS_LOOP_ENV_VAR "__AFL_AS_LOOPCHECK"
#define PERSIST_ENV_VAR "__AFL_PERSISTENT"
#define DEFER_ENV_VAR "__AFL_DEFER_FORKSRV"
/* In-code signatures for deferred and persistent mode. */
#define PERSIST_SIG "##SIG_AFL_PERSISTENT##"
#define DEFER_SIG "##SIG_AFL_DEFER_FORKSRV##"
/* Distinctive bitmap signature used to indicate failed execution: */
#define EXEC_FAIL_SIG 0xfee1dead
/* Distinctive exit code used to indicate MSAN trip condition: */
#define MSAN_ERROR 86
/* Designated file descriptors for forkserver commands (the application will
use FORKSRV_FD and FORKSRV_FD + 1): */
#define FORKSRV_FD 198
/* Fork server init timeout multiplier: we'll wait the user-selected
timeout plus this much for the fork server to spin up. */
#define FORK_WAIT_MULT 10
/* Calibration timeout adjustments, to be a bit more generous when resuming
fuzzing sessions or trying to calibrate already-added internal finds.
The first value is a percentage, the other is in milliseconds: */
#define CAL_TMOUT_PERC 125
#define CAL_TMOUT_ADD 50
/* Number of chances to calibrate a case before giving up: */
#define CAL_CHANCES 3
/* Map size for the traced binary (2^MAP_SIZE_POW2). Must be greater than
2; you probably want to keep it under 18 or so for performance reasons
(adjusting AFL_INST_RATIO when compiling is probably a better way to solve
problems with complex programs). You need to recompile the target binary
after changing this - otherwise, SEGVs may ensue. */
#define MAP_SIZE_POW2 16
#define MAP_SIZE (1 << MAP_SIZE_POW2)
/* Maximum allocator request size (keep well under INT_MAX): */
#define MAX_ALLOC 0x40000000
/* A made-up hashing seed: */
#define HASH_CONST 0xa5b35705
/* Constants for afl-gotcpu to control busy loop timing: */
#define CTEST_TARGET_MS 5000
#define CTEST_CORE_TRG_MS 1000
#define CTEST_BUSY_CYCLES (10 * 1000 * 1000)
/* Uncomment this to use inferior block-coverage-based instrumentation. Note
that you need to recompile the target binary for this to have any effect: */
// #define COVERAGE_ONLY
/* Uncomment this to ignore hit counts and output just one bit per tuple.
As with the previous setting, you will need to recompile the target
binary: */
// #define SKIP_COUNTS
/* Uncomment this to use instrumentation data to record newly discovered paths,
but do not use them as seeds for fuzzing. This is useful for conveniently
measuring coverage that could be attained by a "dumb" fuzzing algorithm: */
// #define IGNORE_FINDS
#endif /* ! _HAVE_CONFIG_H */

1
config.h Symbolic link
View File

@ -0,0 +1 @@
include/config.h

52
custom_mutators/README.md Normal file
View File

@ -0,0 +1,52 @@
# Custom Mutators
Custom mutators enhance and alter the mutation strategies of afl++.
For further information and documentation on how to write your own, read [the docs](../docs/custom_mutators.md).
## The afl++ Grammar Mutator
If you use git to clone afl++, then the following will incorporate our
excellent grammar custom mutator:
```
git submodule init
git submodule update
```
otherwise just checkout the repository here with either
`git clone https://github.com/AFLplusplus/Grammar-Mutator` or
`svn co https://github.com/AFLplusplus/Grammar-Mutator`.
Read the [Grammar-Mutator/README.md](Grammar-Mutator/README.md) on how to use
it.
## Production-Ready Custom Mutators
This directory holds ready to use custom mutators.
Just type "make" in the individual subdirectories.
Use with e.g.
`AFL_CUSTOM_MUTATOR_LIBRARY=custom_mutators/radamsa/radamsa-mutator.so afl-fuzz ....`
and add `AFL_CUSTOM_MUTATOR_ONLY=1` if you only want to use the custom mutator.
Multiple custom mutators can be used by separating their paths with `:` in the environment variable.
## 3rd Party Custom Mutators
### Superion Mutators
Adrian Tiron ported the Superion grammar fuzzer to afl++, it is WIP and
requires cmake (among other things):
[https://github.com/adrian-rt/superion-mutator](https://github.com/adrian-rt/superion-mutator)
### libprotobuf Mutators
There are two WIP protobuf projects, that require work to be working though:
transforms protobuf raw:
https://github.com/bruce30262/libprotobuf-mutator_fuzzing_learning/tree/master/4_libprotobuf_aflpp_custom_mutator
has a transform function you need to fill for your protobuf format, however
needs to be ported to the updated afl++ custom mutator API (not much work):
https://github.com/thebabush/afl-libprotobuf-mutator

View File

@ -0,0 +1,17 @@
CFLAGS = -O3 -funroll-loops -fPIC -Wl,-Bsymbolic
all: honggfuzz.so
honggfuzz.so: honggfuzz.c input.h mangle.c ../../src/afl-performance.c
$(CC) $(CFLAGS) -I../../include -I. -shared -o honggfuzz.so honggfuzz.c mangle.c ../../src/afl-performance.c
update:
@# seriously? --unlink is a dud option? sigh ...
rm -f mangle.c mangle.h honggfuzz.h
wget --unlink https://github.com/google/honggfuzz/raw/master/mangle.c
wget --unlink https://github.com/google/honggfuzz/raw/master/mangle.h
wget --unlink https://github.com/google/honggfuzz/raw/master/honggfuzz.h
clean:
rm -f *.o *~ *.so core

View File

@ -0,0 +1,12 @@
# custum mutator: honggfuzz mangle
this is the very good honggfuzz mutator in mangle.c as a custom mutator
module for afl++. It is the original mangle.c, mangle.h and honggfuzz.h
with a lot of mocking around it :-)
just type `make` to build
```AFL_CUSTOM_MUTATOR_LIBRARY=custom_mutators/honggfuzz/honggfuzz.so afl-fuzz ...```
> Original repository: https://github.com/google/honggfuzz
> Source commit: d0fbcb0373c32436b8fb922e6937da93b17291f5

View File

View File

@ -0,0 +1,22 @@
#ifndef CUSTOM_MUTATOR_HELPERS
#define CUSTOM_MUTATOR_HELPERS
#include "config.h"
#include "types.h"
#include "afl-fuzz.h"
#include <stdlib.h>
#define INITIAL_GROWTH_SIZE (64)
/* Use in a struct: creates a name_buf and a name_size variable. */
#define BUF_VAR(type, name) \
type * name##_buf; \
size_t name##_size;
/* this filles in `&structptr->something_buf, &structptr->something_size`. */
#define BUF_PARAMS(struct, name) \
(void **)&struct->name##_buf, &struct->name##_size
#undef INITIAL_GROWTH_SIZE
#endif

View File

@ -0,0 +1,143 @@
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include "custom_mutator_helpers.h"
#include "mangle.h"
#define NUMBER_OF_MUTATIONS 5
uint8_t * queue_input;
size_t queue_input_size;
afl_state_t * afl_struct;
run_t run;
honggfuzz_t global;
struct _dynfile_t dynfile;
typedef struct my_mutator {
afl_state_t *afl;
run_t * run;
u8 * mutator_buf;
unsigned int seed;
unsigned int extras_cnt, a_extras_cnt;
} my_mutator_t;
my_mutator_t *afl_custom_init(afl_state_t *afl, unsigned int seed) {
my_mutator_t *data = calloc(1, sizeof(my_mutator_t));
if (!data) {
perror("afl_custom_init alloc");
return NULL;
}
if ((data->mutator_buf = malloc(MAX_FILE)) == NULL) {
perror("mutator_buf alloc");
return NULL;
}
run.dynfile = &dynfile;
run.global = &global;
data->afl = afl;
data->seed = seed;
data->run = &run;
afl_struct = afl;
run.global->mutate.maxInputSz = MAX_FILE;
run.global->mutate.mutationsPerRun = NUMBER_OF_MUTATIONS;
run.mutationsPerRun = NUMBER_OF_MUTATIONS;
run.global->timing.lastCovUpdate = 6;
// global->feedback.cmpFeedback
// global->feedback.cmpFeedbackMap
return data;
}
/* When a new queue entry is added we check if there are new dictionary
entries to add to honggfuzz structure */
void afl_custom_queue_new_entry(my_mutator_t * data,
const uint8_t *filename_new_queue,
const uint8_t *filename_orig_queue) {
if (run.global->mutate.dictionaryCnt >= 1024) return;
while (data->extras_cnt < data->afl->extras_cnt &&
run.global->mutate.dictionaryCnt < 1024) {
memcpy(run.global->mutate.dictionary[run.global->mutate.dictionaryCnt].val,
data->afl->extras[data->extras_cnt].data,
data->afl->extras[data->extras_cnt].len);
run.global->mutate.dictionary[run.global->mutate.dictionaryCnt].len =
data->afl->extras[data->extras_cnt].len;
run.global->mutate.dictionaryCnt++;
data->extras_cnt++;
}
while (data->a_extras_cnt < data->afl->a_extras_cnt &&
run.global->mutate.dictionaryCnt < 1024) {
memcpy(run.global->mutate.dictionary[run.global->mutate.dictionaryCnt].val,
data->afl->a_extras[data->a_extras_cnt].data,
data->afl->a_extras[data->a_extras_cnt].len);
run.global->mutate.dictionary[run.global->mutate.dictionaryCnt].len =
data->afl->a_extras[data->a_extras_cnt].len;
run.global->mutate.dictionaryCnt++;
data->a_extras_cnt++;
}
}
/* we could set only_printable if is_ascii is set ... let's see
uint8_t afl_custom_queue_get(void *data, const uint8_t *filename) {
//run.global->cfg.only_printable = ...
}
*/
/* here we run the honggfuzz mutator, which is really good */
size_t afl_custom_fuzz(my_mutator_t *data, uint8_t *buf, size_t buf_size,
u8 **out_buf, uint8_t *add_buf, size_t add_buf_size,
size_t max_size) {
/* set everything up, costly ... :( */
memcpy(data->mutator_buf, buf, buf_size);
queue_input = data->mutator_buf;
run.dynfile->data = data->mutator_buf;
queue_input_size = buf_size;
run.dynfile->size = buf_size;
*out_buf = data->mutator_buf;
/* the mutation */
mangle_mangleContent(&run, NUMBER_OF_MUTATIONS);
/* return size of mutated data */
return run.dynfile->size;
}
/**
* Deinitialize everything
*
* @param data The data ptr from afl_custom_init
*/
void afl_custom_deinit(my_mutator_t *data) {
free(data->mutator_buf);
free(data);
}

View File

@ -0,0 +1,385 @@
/*
*
* honggfuzz - core structures and macros
* -----------------------------------------
*
* Author: Robert Swiecki <swiecki@google.com>
*
* Copyright 2010-2018 by 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
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
* implied. See the License for the specific language governing
* permissions and limitations under the License.
*
*/
#ifndef _HF_HONGGFUZZ_H_
#define _HF_HONGGFUZZ_H_
#include <dirent.h>
#include <inttypes.h>
#include <limits.h>
#include <pthread.h>
#include <signal.h>
#include <stdbool.h>
#include <stdint.h>
#include <sys/param.h>
#include <sys/queue.h>
#include <sys/types.h>
#include <time.h>
#include "libhfcommon/util.h"
#define PROG_NAME "honggfuzz"
#define PROG_VERSION "2.3"
/* Name of the template which will be replaced with the proper name of the file */
#define _HF_FILE_PLACEHOLDER "___FILE___"
/* Default name of the report created with some architectures */
#define _HF_REPORT_FILE "HONGGFUZZ.REPORT.TXT"
/* Default stack-size of created threads. */
#define _HF_PTHREAD_STACKSIZE (1024ULL * 1024ULL * 2ULL) /* 2MB */
/* Name of envvar which indicates sequential number of fuzzer */
#define _HF_THREAD_NO_ENV "HFUZZ_THREAD_NO"
/* Name of envvar which indicates that the netDriver should be used */
#define _HF_THREAD_NETDRIVER_ENV "HFUZZ_USE_NETDRIVER"
/* Name of envvar which indicates honggfuzz's log level in use */
#define _HF_LOG_LEVEL_ENV "HFUZZ_LOG_LEVEL"
/* Number of crash verifier iterations before tag crash as stable */
#define _HF_VERIFIER_ITER 5
/* Size (in bytes) for report data to be stored in stack before written to file */
#define _HF_REPORT_SIZE 32768
/* Perf bitmap size */
#define _HF_PERF_BITMAP_SIZE_16M (1024U * 1024U * 16U)
#define _HF_PERF_BITMAP_BITSZ_MASK 0x7FFFFFFULL
/* Maximum number of PC guards (=trace-pc-guard) we support */
#define _HF_PC_GUARD_MAX (1024ULL * 1024ULL * 64ULL)
/* Maximum size of the input file in bytes (1 MiB) */
#define _HF_INPUT_MAX_SIZE (1024ULL * 1024ULL)
/* Default maximum size of produced inputs */
#define _HF_INPUT_DEFAULT_SIZE (1024ULL * 8)
/* Per-thread bitmap */
#define _HF_PERTHREAD_BITMAP_FD 1018
/* FD used to report back used int/str constants from the fuzzed process */
#define _HF_CMP_BITMAP_FD 1019
/* FD used to log inside the child process */
#define _HF_LOG_FD 1020
/* FD used to represent the input file */
#define _HF_INPUT_FD 1021
/* FD used to pass coverage feedback from the fuzzed process */
#define _HF_COV_BITMAP_FD 1022
#define _HF_BITMAP_FD _HF_COV_BITMAP_FD /* Old name for _HF_COV_BITMAP_FD */
/* FD used to pass data to a persistent process */
#define _HF_PERSISTENT_FD 1023
/* Input file as a string */
#define _HF_INPUT_FILE_PATH "/dev/fd/" HF_XSTR(_HF_INPUT_FD)
/* Maximum number of supported execve() args */
#define _HF_ARGS_MAX 2048
/* Message indicating that the fuzzed process is ready for new data */
static const uint8_t HFReadyTag = 'R';
/* Maximum number of active fuzzing threads */
#define _HF_THREAD_MAX 1024U
/* Persistent-binary signature - if found within file, it means it's a persistent mode binary */
#define _HF_PERSISTENT_SIG "\x01_LIBHFUZZ_PERSISTENT_BINARY_SIGNATURE_\x02\xFF"
/* HF NetDriver signature - if found within file, it means it's a NetDriver-based binary */
#define _HF_NETDRIVER_SIG "\x01_LIBHFUZZ_NETDRIVER_BINARY_SIGNATURE_\x02\xFF"
/* printf() nonmonetary separator. According to MacOSX's man it's supported there as well */
#define _HF_NONMON_SEP "'"
typedef enum {
_HF_DYNFILE_NONE = 0x0,
_HF_DYNFILE_INSTR_COUNT = 0x1,
_HF_DYNFILE_BRANCH_COUNT = 0x2,
_HF_DYNFILE_BTS_EDGE = 0x10,
_HF_DYNFILE_IPT_BLOCK = 0x20,
_HF_DYNFILE_SOFT = 0x40,
} dynFileMethod_t;
typedef struct {
uint64_t cpuInstrCnt;
uint64_t cpuBranchCnt;
uint64_t bbCnt;
uint64_t newBBCnt;
uint64_t softCntPc;
uint64_t softCntEdge;
uint64_t softCntCmp;
} hwcnt_t;
typedef enum {
_HF_STATE_UNSET = 0,
_HF_STATE_STATIC,
_HF_STATE_DYNAMIC_DRY_RUN,
_HF_STATE_DYNAMIC_MAIN,
_HF_STATE_DYNAMIC_MINIMIZE,
} fuzzState_t;
typedef enum {
HF_MAYBE = -1,
HF_NO = 0,
HF_YES = 1,
} tristate_t;
struct _dynfile_t {
size_t size;
uint64_t cov[4];
size_t idx;
int fd;
uint64_t timeExecUSecs;
char path[PATH_MAX];
struct _dynfile_t* src;
uint32_t refs;
uint8_t* data;
TAILQ_ENTRY(_dynfile_t) pointers;
};
typedef struct _dynfile_t dynfile_t;
struct strings_t {
size_t len;
TAILQ_ENTRY(strings_t) pointers;
char s[];
};
typedef struct {
uint8_t pcGuardMap[_HF_PC_GUARD_MAX];
uint8_t bbMapPc[_HF_PERF_BITMAP_SIZE_16M];
uint32_t bbMapCmp[_HF_PERF_BITMAP_SIZE_16M];
uint64_t pidNewPC[_HF_THREAD_MAX];
uint64_t pidNewEdge[_HF_THREAD_MAX];
uint64_t pidNewCmp[_HF_THREAD_MAX];
uint64_t guardNb;
uint64_t pidTotalPC[_HF_THREAD_MAX];
uint64_t pidTotalEdge[_HF_THREAD_MAX];
uint64_t pidTotalCmp[_HF_THREAD_MAX];
} feedback_t;
typedef struct {
uint32_t cnt;
struct {
uint8_t val[32];
uint32_t len;
} valArr[1024 * 16];
} cmpfeedback_t;
typedef struct {
struct {
size_t threadsMax;
size_t threadsFinished;
uint32_t threadsActiveCnt;
pthread_t mainThread;
pid_t mainPid;
pthread_t threads[_HF_THREAD_MAX];
} threads;
struct {
const char* inputDir;
const char* outputDir;
DIR* inputDirPtr;
size_t fileCnt;
size_t testedFileCnt;
const char* fileExtn;
size_t maxFileSz;
size_t newUnitsAdded;
char workDir[PATH_MAX];
const char* crashDir;
const char* covDirNew;
bool saveUnique;
size_t dynfileqMaxSz;
size_t dynfileqCnt;
dynfile_t* dynfileqCurrent;
dynfile_t* dynfileq2Current;
TAILQ_HEAD(dyns_t, _dynfile_t) dynfileq;
bool exportFeedback;
} io;
struct {
int argc;
const char* const* cmdline;
bool nullifyStdio;
bool fuzzStdin;
const char* externalCommand;
const char* postExternalCommand;
const char* feedbackMutateCommand;
bool netDriver;
bool persistent;
uint64_t asLimit;
uint64_t rssLimit;
uint64_t dataLimit;
uint64_t coreLimit;
uint64_t stackLimit;
bool clearEnv;
char* env_ptrs[128];
char env_vals[128][4096];
sigset_t waitSigSet;
} exe;
struct {
time_t timeStart;
time_t runEndTime;
time_t tmOut;
time_t lastCovUpdate;
int64_t timeOfLongestUnitUSecs;
bool tmoutVTALRM;
} timing;
struct {
struct {
uint8_t val[256];
size_t len;
} dictionary[1024];
size_t dictionaryCnt;
const char* dictionaryFile;
size_t mutationsMax;
unsigned mutationsPerRun;
size_t maxInputSz;
} mutate;
struct {
bool useScreen;
char cmdline_txt[65];
int64_t lastDisplayUSecs;
} display;
struct {
bool useVerifier;
bool exitUponCrash;
const char* reportFile;
size_t dynFileIterExpire;
bool only_printable;
bool minimize;
bool switchingToFDM;
} cfg;
struct {
bool enable;
bool del_report;
} sanitizer;
struct {
fuzzState_t state;
feedback_t* covFeedbackMap;
int covFeedbackFd;
cmpfeedback_t* cmpFeedbackMap;
int cmpFeedbackFd;
bool cmpFeedback;
const char* blacklistFile;
uint64_t* blacklist;
size_t blacklistCnt;
bool skipFeedbackOnTimeout;
uint64_t maxCov[4];
dynFileMethod_t dynFileMethod;
hwcnt_t hwCnts;
} feedback;
struct {
size_t mutationsCnt;
size_t crashesCnt;
size_t uniqueCrashesCnt;
size_t verifiedCrashesCnt;
size_t blCrashesCnt;
size_t timeoutedCnt;
} cnts;
struct {
bool enabled;
int serverSocket;
int clientSocket;
} socketFuzzer;
struct {
pthread_rwlock_t dynfileq;
pthread_mutex_t feedback;
pthread_mutex_t report;
pthread_mutex_t state;
pthread_mutex_t input;
pthread_mutex_t timing;
} mutex;
/* For the Linux code */
struct {
int exeFd;
uint64_t dynamicCutOffAddr;
bool disableRandomization;
void* ignoreAddr;
const char* symsBlFile;
char** symsBl;
size_t symsBlCnt;
const char* symsWlFile;
char** symsWl;
size_t symsWlCnt;
uintptr_t cloneFlags;
tristate_t useNetNs;
bool kernelOnly;
bool useClone;
} arch_linux;
/* For the NetBSD code */
struct {
void* ignoreAddr;
const char* symsBlFile;
char** symsBl;
size_t symsBlCnt;
const char* symsWlFile;
char** symsWl;
size_t symsWlCnt;
} arch_netbsd;
} honggfuzz_t;
typedef enum {
_HF_RS_UNKNOWN = 0,
_HF_RS_WAITING_FOR_INITIAL_READY = 1,
_HF_RS_WAITING_FOR_READY = 2,
_HF_RS_SEND_DATA = 3,
} runState_t;
typedef struct {
honggfuzz_t* global;
pid_t pid;
int64_t timeStartedUSecs;
char crashFileName[PATH_MAX];
uint64_t pc;
uint64_t backtrace;
uint64_t access;
int exception;
char report[_HF_REPORT_SIZE];
bool mainWorker;
unsigned mutationsPerRun;
dynfile_t* dynfile;
bool staticFileTryMore;
uint32_t fuzzNo;
int persistentSock;
runState_t runState;
bool tmOutSignaled;
char* args[_HF_ARGS_MAX + 1];
int perThreadCovFeedbackFd;
unsigned triesLeft;
dynfile_t* current;
#if !defined(_HF_ARCH_DARWIN)
timer_t timerId;
#endif // !defined(_HF_ARCH_DARWIN)
hwcnt_t hwCnts;
struct {
/* For Linux code */
uint8_t* perfMmapBuf;
uint8_t* perfMmapAux;
int cpuInstrFd;
int cpuBranchFd;
int cpuIptBtsFd;
} arch_linux;
} run_t;
#endif

View File

@ -0,0 +1,106 @@
#ifndef _HG_INPUT_
#define _HG_INPUT_
#include <stdarg.h>
#ifdef __clang__
#include <stdatomic.h>
#endif
#include <stdbool.h>
#include <stdint.h>
#include <time.h>
#include "honggfuzz.h"
#include "afl-fuzz.h"
/*
* Go-style defer scoped implementation
*
* If compiled with clang, use: -fblocks -lBlocksRuntime
*
* Example of use:
*
* {
* int fd = open(fname, O_RDONLY);
* if (fd == -1) {
* error(....);
* return;
* }
* defer { close(fd); };
* ssize_t sz = read(fd, buf, sizeof(buf));
* ...
* ...
* }
*
*/
#define __STRMERGE(a, b) a##b
#define _STRMERGE(a, b) __STRMERGE(a, b)
#ifdef __clang__
#if __has_extension(blocks)
static void __attribute__((unused)) __clang_cleanup_func(void (^*dfunc)(void)) {
(*dfunc)();
}
#define defer \
void (^_STRMERGE(__defer_f_, __COUNTER__))(void) \
__attribute__((cleanup(__clang_cleanup_func))) __attribute__((unused)) = ^
#else /* __has_extension(blocks) */
#define defer UNIMPLEMENTED - NO - SUPPORT - FOR - BLOCKS - IN - YOUR - CLANG - ENABLED
#endif /* __has_extension(blocks) */
#else /* !__clang__, e.g.: gcc */
#define __block
#define _DEFER(a, count) \
auto void _STRMERGE(__defer_f_, count)(void* _defer_arg __attribute__((unused))); \
int _STRMERGE(__defer_var_, count) __attribute__((cleanup(_STRMERGE(__defer_f_, count)))) \
__attribute__((unused)); \
void _STRMERGE(__defer_f_, count)(void* _defer_arg __attribute__((unused)))
#define defer _DEFER(a, __COUNTER__)
#endif /* ifdef __clang__ */
#define HF_MIN(x, y) (x <= y ? x : y)
#define HF_MAX(x, y) (x >= y ? x : y)
#define ATOMIC_GET
#define ARRAYSIZE(x) (sizeof(x) / sizeof(*x))
#define HF_ATTR_UNUSED __attribute__((unused))
#define util_Malloc(x) malloc(x)
extern uint8_t * queue_input;
extern size_t queue_input_size;
extern afl_state_t * afl_struct;
inline void wmb() { }
inline void LOG_F(const char *format, ...) { }
static inline uint64_t util_rndGet(uint64_t min, uint64_t max) {
return min + rand_below(afl_struct, max - min + 1);
}
static inline uint64_t util_rnd64() { return rand_below(afl_struct, 1 << 30); }
static inline size_t input_getRandomInputAsBuf(run_t *run, const uint8_t **buf) {
*buf = queue_input;
run->dynfile->data = queue_input;
run->dynfile->size = queue_input_size;
return queue_input_size;
}
static inline void input_setSize(run_t* run, size_t sz) {
run->dynfile->size = sz;
}
static inline void util_turnToPrintable(uint8_t* buf, size_t sz) {
for (size_t i = 0; i < sz; i++)
buf[i] = buf[i] % 95 + 32;
}
static inline void util_rndBuf(uint8_t* buf, size_t sz) {
if (sz == 0) return;
for (size_t i = 0; i < sz; i++)
buf[i] = (uint8_t)rand_below(afl_struct, 256);
}
static inline uint8_t util_rndPrintable() {
return 32 + rand_below(afl_struct, 127 - 32);
}
static inline void util_rndBufPrintable(uint8_t* buf, size_t sz) {
for (size_t i = 0; i < sz; i++)
buf[i] = util_rndPrintable();
}
#endif

View File

@ -0,0 +1 @@
.

View File

@ -0,0 +1 @@
common.h

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,31 @@
/*
*
* honggfuzz - buffer mangling routines
* -----------------------------------------
*
* Author: Robert Swiecki <swiecki@google.com>
*
* Copyright 2010-2018 by 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
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
* implied. See the License for the specific language governing
* permissions and limitations under the License.
*
*/
#ifndef _HF_MANGLE_H_
#define _HF_MANGLE_H_
#include "honggfuzz.h"
extern void mangle_mangleContent(run_t* run, int speed_factor);
#endif

View File

@ -0,0 +1 @@
common.h

View File

@ -0,0 +1,30 @@
CUR_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
all: radamsa-mutator.so
# These can be overriden:
CFLAGS ?= $(CFLAGS_FLTO)
# These are required: (otherwise radamsa gets very very slooooow)
CFLAGS += -O3 -funroll-loops
#libradamsa.so: libradamsa.a
# $(CC) $(CFLAGS) -shared libradamsa.a -o libradamsa.so
libradamsa.a: libradamsa.c radamsa.h
@echo " ***************************************************************"
@echo " * Compiling libradamsa, wait some minutes (~3 on modern CPUs) *"
@echo " ***************************************************************"
$(CC) -fPIC $(CFLAGS) $(CPPFLAGS) -I $(CUR_DIR) -o libradamsa.a -c libradamsa.c
radamsa-mutator.so: radamsa-mutator.c libradamsa.a
$(CC) $(CFLAGS) $(CPPFLAGS) -g -I. -I../../include -shared -fPIC -c radamsa-mutator.c
$(CC) $(CFLAGS) $(CPPFLAGS) -shared -fPIC -o radamsa-mutator.so radamsa-mutator.o libradamsa.a
test: libradamsa.a libradamsa-test.c
$(CC) $(CFLAGS) $(CPPFLAGS) -I $(CUR_DIR) -o libradamsa-test libradamsa-test.c libradamsa.a
./libradamsa-test libradamsa-test.c | grep "library test passed"
rm /tmp/libradamsa-*.fuzz
clean:
rm -f radamsa-mutator.so libradamsa.a libradamsa-test *.o *~ core

View File

@ -0,0 +1,19 @@
Copyright (c) 2013 Aki Helin
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

View File

@ -0,0 +1,9 @@
# custum mutator: libradamsa
Pretranslated radamsa library. This code belongs to the radamsa author.
> Original repository: https://gitlab.com/akihe/radamsa
> Source commit: 7b2cc2d0
> The code here is adapted for AFL++ with minor changes respect the original version

View File

@ -0,0 +1,342 @@
#ifndef CUSTOM_MUTATOR_HELPERS
#define CUSTOM_MUTATOR_HELPERS
#include "config.h"
#include "types.h"
#include <stdlib.h>
#define INITIAL_GROWTH_SIZE (64)
#define RAND_BELOW(limit) (rand() % (limit))
/* Use in a struct: creates a name_buf and a name_size variable. */
#define BUF_VAR(type, name) \
type * name##_buf; \
size_t name##_size;
/* this filles in `&structptr->something_buf, &structptr->something_size`. */
#define BUF_PARAMS(struct, name) \
(void **)&struct->name##_buf, &struct->name##_size
typedef struct {
} afl_t;
static void surgical_havoc_mutate(u8 *out_buf, s32 begin, s32 end) {
static s8 interesting_8[] = {INTERESTING_8};
static s16 interesting_16[] = {INTERESTING_8, INTERESTING_16};
static s32 interesting_32[] = {INTERESTING_8, INTERESTING_16, INTERESTING_32};
switch (RAND_BELOW(12)) {
case 0: {
/* Flip a single bit somewhere. Spooky! */
s32 bit_idx = ((RAND_BELOW(end - begin) + begin) << 3) + RAND_BELOW(8);
out_buf[bit_idx >> 3] ^= 128 >> (bit_idx & 7);
break;
}
case 1: {
/* Set byte to interesting value. */
u8 val = interesting_8[RAND_BELOW(sizeof(interesting_8))];
out_buf[(RAND_BELOW(end - begin) + begin)] = val;
break;
}
case 2: {
/* Set word to interesting value, randomly choosing endian. */
if (end - begin < 2) break;
s32 byte_idx = (RAND_BELOW(end - begin) + begin);
if (byte_idx >= end - 1) break;
switch (RAND_BELOW(2)) {
case 0:
*(u16 *)(out_buf + byte_idx) =
interesting_16[RAND_BELOW(sizeof(interesting_16) >> 1)];
break;
case 1:
*(u16 *)(out_buf + byte_idx) =
SWAP16(interesting_16[RAND_BELOW(sizeof(interesting_16) >> 1)]);
break;
}
break;
}
case 3: {
/* Set dword to interesting value, randomly choosing endian. */
if (end - begin < 4) break;
s32 byte_idx = (RAND_BELOW(end - begin) + begin);
if (byte_idx >= end - 3) break;
switch (RAND_BELOW(2)) {
case 0:
*(u32 *)(out_buf + byte_idx) =
interesting_32[RAND_BELOW(sizeof(interesting_32) >> 2)];
break;
case 1:
*(u32 *)(out_buf + byte_idx) =
SWAP32(interesting_32[RAND_BELOW(sizeof(interesting_32) >> 2)]);
break;
}
break;
}
case 4: {
/* Set qword to interesting value, randomly choosing endian. */
if (end - begin < 8) break;
s32 byte_idx = (RAND_BELOW(end - begin) + begin);
if (byte_idx >= end - 7) break;
switch (RAND_BELOW(2)) {
case 0:
*(u64 *)(out_buf + byte_idx) =
(s64)interesting_32[RAND_BELOW(sizeof(interesting_32) >> 2)];
break;
case 1:
*(u64 *)(out_buf + byte_idx) = SWAP64(
(s64)interesting_32[RAND_BELOW(sizeof(interesting_32) >> 2)]);
break;
}
break;
}
case 5: {
/* Randomly subtract from byte. */
out_buf[(RAND_BELOW(end - begin) + begin)] -= 1 + RAND_BELOW(ARITH_MAX);
break;
}
case 6: {
/* Randomly add to byte. */
out_buf[(RAND_BELOW(end - begin) + begin)] += 1 + RAND_BELOW(ARITH_MAX);
break;
}
case 7: {
/* Randomly subtract from word, random endian. */
if (end - begin < 2) break;
s32 byte_idx = (RAND_BELOW(end - begin) + begin);
if (byte_idx >= end - 1) break;
if (RAND_BELOW(2)) {
*(u16 *)(out_buf + byte_idx) -= 1 + RAND_BELOW(ARITH_MAX);
} else {
u16 num = 1 + RAND_BELOW(ARITH_MAX);
*(u16 *)(out_buf + byte_idx) =
SWAP16(SWAP16(*(u16 *)(out_buf + byte_idx)) - num);
}
break;
}
case 8: {
/* Randomly add to word, random endian. */
if (end - begin < 2) break;
s32 byte_idx = (RAND_BELOW(end - begin) + begin);
if (byte_idx >= end - 1) break;
if (RAND_BELOW(2)) {
*(u16 *)(out_buf + byte_idx) += 1 + RAND_BELOW(ARITH_MAX);
} else {
u16 num = 1 + RAND_BELOW(ARITH_MAX);
*(u16 *)(out_buf + byte_idx) =
SWAP16(SWAP16(*(u16 *)(out_buf + byte_idx)) + num);
}
break;
}
case 9: {
/* Randomly subtract from dword, random endian. */
if (end - begin < 4) break;
s32 byte_idx = (RAND_BELOW(end - begin) + begin);
if (byte_idx >= end - 3) break;
if (RAND_BELOW(2)) {
*(u32 *)(out_buf + byte_idx) -= 1 + RAND_BELOW(ARITH_MAX);
} else {
u32 num = 1 + RAND_BELOW(ARITH_MAX);
*(u32 *)(out_buf + byte_idx) =
SWAP32(SWAP32(*(u32 *)(out_buf + byte_idx)) - num);
}
break;
}
case 10: {
/* Randomly add to dword, random endian. */
if (end - begin < 4) break;
s32 byte_idx = (RAND_BELOW(end - begin) + begin);
if (byte_idx >= end - 3) break;
if (RAND_BELOW(2)) {
*(u32 *)(out_buf + byte_idx) += 1 + RAND_BELOW(ARITH_MAX);
} else {
u32 num = 1 + RAND_BELOW(ARITH_MAX);
*(u32 *)(out_buf + byte_idx) =
SWAP32(SWAP32(*(u32 *)(out_buf + byte_idx)) + num);
}
break;
}
case 11: {
/* Just set a random byte to a random value. Because,
why not. We use XOR with 1-255 to eliminate the
possibility of a no-op. */
out_buf[(RAND_BELOW(end - begin) + begin)] ^= 1 + RAND_BELOW(255);
break;
}
}
}
/* This function calculates the next power of 2 greater or equal its argument.
@return The rounded up power of 2 (if no overflow) or 0 on overflow.
*/
static inline size_t next_pow2(size_t in) {
if (in == 0 || in > (size_t)-1)
return 0; /* avoid undefined behaviour under-/overflow */
size_t out = in - 1;
out |= out >> 1;
out |= out >> 2;
out |= out >> 4;
out |= out >> 8;
out |= out >> 16;
return out + 1;
}
/* This function makes sure *size is > size_needed after call.
It will realloc *buf otherwise.
*size will grow exponentially as per:
https://blog.mozilla.org/nnethercote/2014/11/04/please-grow-your-buffers-exponentially/
Will return NULL and free *buf if size_needed is <1 or realloc failed.
@return For convenience, this function returns *buf.
*/
static inline void *maybe_grow(void **buf, size_t *size, size_t size_needed) {
/* No need to realloc */
if (likely(size_needed && *size >= size_needed)) return *buf;
/* No initial size was set */
if (size_needed < INITIAL_GROWTH_SIZE) size_needed = INITIAL_GROWTH_SIZE;
/* grow exponentially */
size_t next_size = next_pow2(size_needed);
/* handle overflow */
if (!next_size) { next_size = size_needed; }
/* alloc */
*buf = realloc(*buf, next_size);
*size = *buf ? next_size : 0;
return *buf;
}
/* Swaps buf1 ptr and buf2 ptr, as well as their sizes */
static inline void afl_swap_bufs(void **buf1, size_t *size1, void **buf2,
size_t *size2) {
void * scratch_buf = *buf1;
size_t scratch_size = *size1;
*buf1 = *buf2;
*size1 = *size2;
*buf2 = scratch_buf;
*size2 = scratch_size;
}
#undef INITIAL_GROWTH_SIZE
#endif

View File

@ -0,0 +1,81 @@
#include <radamsa.h>
#include <stdio.h>
#include <inttypes.h>
#include <string.h>
#include <stdlib.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/stat.h>
size_t filesize(char *filename) {
struct stat st;
stat(filename, &st);
return st.st_size;
}
#define BUFSIZE 1024 * 1024
void fail(char *why) {
printf("fail: %s\n", why);
exit(1);
}
void write_output(char *data, size_t len, int num) {
char path[32];
int fd;
int wrote;
sprintf(path, "/tmp/libradamsa-%d.fuzz", num);
fd = open(path, O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR);
printf("Opened %s -> %d\n", path, fd);
if (fd < 0) { fail("failed to open output file"); }
wrote = write(fd, data, len);
printf("wrote %d of %zu bytes\n", wrote, len);
if (wrote != len) { fail("failed to write all of output at once"); }
close(fd);
printf("Wrote %zu bytes to %s\n", len, path);
}
int main(int nargs, char **argv) {
char * spath = argv[1];
int fd = open(spath, O_RDONLY, 0);
size_t len;
char * input;
char * output;
int seed = 0;
if (fd < 0) { fail("cannot open input file"); }
len = filesize(spath);
input = malloc(len);
output = malloc(BUFSIZE);
if (!input || !output) { fail("failed to allocate buffers\n"); }
radamsa_init();
if (len != read(fd, input, len)) {
fail("failed to read the entire sample at once");
}
while (seed++ < 100) {
size_t n;
n = radamsa((uint8_t *)input, len, (uint8_t *)output, BUFSIZE, seed);
write_output(output, n, seed);
printf("Fuzzed %zu -> %zu bytes\n", len, n);
}
printf("library test passed\n");
free(output);
free(input);
return 0;
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,70 @@
// This simple example just creates random buffer <= 100 filled with 'A'
// needs -I /path/to/AFLplusplus/include
//#include "custom_mutator_helpers.h"
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "radamsa.h"
#include "custom_mutator_helpers.h"
typedef struct my_mutator {
afl_t *afl;
u8 *mutator_buf;
unsigned int seed;
} my_mutator_t;
my_mutator_t *afl_custom_init(afl_t *afl, unsigned int seed) {
srand(seed);
my_mutator_t *data = calloc(1, sizeof(my_mutator_t));
if (!data) {
perror("afl_custom_init alloc");
return NULL;
}
if ((data->mutator_buf = malloc(MAX_FILE)) == NULL) {
perror("mutator_buf alloc");
return NULL;
}
data->afl = afl;
data->seed = seed;
radamsa_init();
return data;
}
size_t afl_custom_fuzz(my_mutator_t *data, uint8_t *buf, size_t buf_size,
u8 **out_buf, uint8_t *add_buf, size_t add_buf_size,
size_t max_size) {
*out_buf = data->mutator_buf;
return radamsa(buf, buf_size, data->mutator_buf, max_size, data->seed++);
}
/**
* Deinitialize everything
*
* @param data The data ptr from afl_custom_init
*/
void afl_custom_deinit(my_mutator_t *data) {
free(data->mutator_buf);
free(data);
}

View File

@ -0,0 +1,10 @@
#include <inttypes.h>
#include <stddef.h>
void radamsa_init(void);
size_t radamsa(uint8_t *ptr, size_t len, uint8_t *target, size_t max,
unsigned int seed);
size_t radamsa_inplace(uint8_t *ptr, size_t len, size_t max, unsigned int seed);

251
debug.h
View File

@ -1,251 +0,0 @@
/*
american fuzzy lop - debug / error handling macros
--------------------------------------------------
Written and maintained by Michal Zalewski <lcamtuf@google.com>
Copyright 2013, 2014, 2015, 2016 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
*/
#ifndef _HAVE_DEBUG_H
#define _HAVE_DEBUG_H
#include <errno.h>
#include "types.h"
#include "config.h"
/*******************
* Terminal colors *
*******************/
#ifdef USE_COLOR
# define cBLK "\x1b[0;30m"
# define cRED "\x1b[0;31m"
# define cGRN "\x1b[0;32m"
# define cBRN "\x1b[0;33m"
# define cBLU "\x1b[0;34m"
# define cMGN "\x1b[0;35m"
# define cCYA "\x1b[0;36m"
# define cLGR "\x1b[0;37m"
# define cGRA "\x1b[1;90m"
# define cLRD "\x1b[1;91m"
# define cLGN "\x1b[1;92m"
# define cYEL "\x1b[1;93m"
# define cLBL "\x1b[1;94m"
# define cPIN "\x1b[1;95m"
# define cLCY "\x1b[1;96m"
# define cBRI "\x1b[1;97m"
# define cRST "\x1b[0m"
# define bgBLK "\x1b[40m"
# define bgRED "\x1b[41m"
# define bgGRN "\x1b[42m"
# define bgBRN "\x1b[43m"
# define bgBLU "\x1b[44m"
# define bgMGN "\x1b[45m"
# define bgCYA "\x1b[46m"
# define bgLGR "\x1b[47m"
# define bgGRA "\x1b[100m"
# define bgLRD "\x1b[101m"
# define bgLGN "\x1b[102m"
# define bgYEL "\x1b[103m"
# define bgLBL "\x1b[104m"
# define bgPIN "\x1b[105m"
# define bgLCY "\x1b[106m"
# define bgBRI "\x1b[107m"
#else
# define cBLK ""
# define cRED ""
# define cGRN ""
# define cBRN ""
# define cBLU ""
# define cMGN ""
# define cCYA ""
# define cLGR ""
# define cGRA ""
# define cLRD ""
# define cLGN ""
# define cYEL ""
# define cLBL ""
# define cPIN ""
# define cLCY ""
# define cBRI ""
# define cRST ""
# define bgBLK ""
# define bgRED ""
# define bgGRN ""
# define bgBRN ""
# define bgBLU ""
# define bgMGN ""
# define bgCYA ""
# define bgLGR ""
# define bgGRA ""
# define bgLRD ""
# define bgLGN ""
# define bgYEL ""
# define bgLBL ""
# define bgPIN ""
# define bgLCY ""
# define bgBRI ""
#endif /* ^USE_COLOR */
/*************************
* Box drawing sequences *
*************************/
#ifdef FANCY_BOXES
# define SET_G1 "\x1b)0" /* Set G1 for box drawing */
# define RESET_G1 "\x1b)B" /* Reset G1 to ASCII */
# define bSTART "\x0e" /* Enter G1 drawing mode */
# define bSTOP "\x0f" /* Leave G1 drawing mode */
# define bH "q" /* Horizontal line */
# define bV "x" /* Vertical line */
# define bLT "l" /* Left top corner */
# define bRT "k" /* Right top corner */
# define bLB "m" /* Left bottom corner */
# define bRB "j" /* Right bottom corner */
# define bX "n" /* Cross */
# define bVR "t" /* Vertical, branch right */
# define bVL "u" /* Vertical, branch left */
# define bHT "v" /* Horizontal, branch top */
# define bHB "w" /* Horizontal, branch bottom */
#else
# define SET_G1 ""
# define RESET_G1 ""
# define bSTART ""
# define bSTOP ""
# define bH "-"
# define bV "|"
# define bLT "+"
# define bRT "+"
# define bLB "+"
# define bRB "+"
# define bX "+"
# define bVR "+"
# define bVL "+"
# define bHT "+"
# define bHB "+"
#endif /* ^FANCY_BOXES */
/***********************
* Misc terminal codes *
***********************/
#define TERM_HOME "\x1b[H"
#define TERM_CLEAR TERM_HOME "\x1b[2J"
#define cEOL "\x1b[0K"
#define CURSOR_HIDE "\x1b[?25l"
#define CURSOR_SHOW "\x1b[?25h"
/************************
* Debug & error macros *
************************/
/* Just print stuff to the appropriate stream. */
#ifdef MESSAGES_TO_STDOUT
# define SAYF(x...) printf(x)
#else
# define SAYF(x...) fprintf(stderr, x)
#endif /* ^MESSAGES_TO_STDOUT */
/* Show a prefixed warning. */
#define WARNF(x...) do { \
SAYF(cYEL "[!] " cBRI "WARNING: " cRST x); \
SAYF(cRST "\n"); \
} while (0)
/* Show a prefixed "doing something" message. */
#define ACTF(x...) do { \
SAYF(cLBL "[*] " cRST x); \
SAYF(cRST "\n"); \
} while (0)
/* Show a prefixed "success" message. */
#define OKF(x...) do { \
SAYF(cLGN "[+] " cRST x); \
SAYF(cRST "\n"); \
} while (0)
/* Show a prefixed fatal error message (not used in afl). */
#define BADF(x...) do { \
SAYF(cLRD "\n[-] " cRST x); \
SAYF(cRST "\n"); \
} while (0)
/* Die with a verbose non-OS fatal error message. */
#define FATAL(x...) do { \
SAYF(bSTOP RESET_G1 CURSOR_SHOW cRST cLRD "\n[-] PROGRAM ABORT : " \
cBRI x); \
SAYF(cLRD "\n Location : " cRST "%s(), %s:%u\n\n", \
__FUNCTION__, __FILE__, __LINE__); \
exit(1); \
} while (0)
/* Die by calling abort() to provide a core dump. */
#define ABORT(x...) do { \
SAYF(bSTOP RESET_G1 CURSOR_SHOW cRST cLRD "\n[-] PROGRAM ABORT : " \
cBRI x); \
SAYF(cLRD "\n Stop location : " cRST "%s(), %s:%u\n\n", \
__FUNCTION__, __FILE__, __LINE__); \
abort(); \
} while (0)
/* Die while also including the output of perror(). */
#define PFATAL(x...) do { \
fflush(stdout); \
SAYF(bSTOP RESET_G1 CURSOR_SHOW cRST cLRD "\n[-] SYSTEM ERROR : " \
cBRI x); \
SAYF(cLRD "\n Stop location : " cRST "%s(), %s:%u\n", \
__FUNCTION__, __FILE__, __LINE__); \
SAYF(cLRD " OS message : " cRST "%s\n", strerror(errno)); \
exit(1); \
} while (0)
/* Die with FAULT() or PFAULT() depending on the value of res (used to
interpret different failure modes for read(), write(), etc). */
#define RPFATAL(res, x...) do { \
if (res < 0) PFATAL(x); else FATAL(x); \
} while (0)
/* Error-checking versions of read() and write() that call RPFATAL() as
appropriate. */
#define ck_write(fd, buf, len, fn) do { \
u32 _len = (len); \
s32 _res = write(fd, buf, _len); \
if (_res != _len) RPFATAL(_res, "Short write to %s", fn); \
} while (0)
#define ck_read(fd, buf, len, fn) do { \
u32 _len = (len); \
s32 _res = read(fd, buf, _len); \
if (_res != _len) RPFATAL(_res, "Short read from %s", fn); \
} while (0)
#endif /* ! _HAVE_DEBUG_H */

View File

@ -1,19 +1,20 @@
================
AFL dictionaries
================
# AFL dictionaries
(See ../docs/README for the general instruction manual.)
(See [../docs/README.md](../docs/README.md) for the general instruction manual.)
This subdirectory contains a set of dictionaries that can be used in
conjunction with the -x option to allow the fuzzer to effortlessly explore the
grammar of some of the more verbose data formats or languages. The basic
principle behind the operation of fuzzer dictionaries is outlined in section 9
of the "main" README for the project.
principle behind the operation of fuzzer dictionaries is outlined in section 10
of the "main" README.md for the project.
These sets were done by Michal Zalewski, various contributors, and imported
from oss-fuzz, go-fuzz and libfuzzer.
Custom dictionaries can be added at will. They should consist of a
reasonably-sized set of rudimentary syntax units that the fuzzer will then try
to clobber together in various ways. Snippets between 2 and 16 bytes are usually
the sweet spot.
to clobber together in various ways. Snippets between 2 and 16 bytes are
usually the sweet spot.
Custom dictionaries can be created in two ways:
@ -32,12 +33,12 @@ parameter is a file or a directory.
In the file mode, every name field can be optionally followed by @<num>, e.g.:
keyword_foo@1 = "foo"
`keyword_foo@1 = "foo"`
Such entries will be loaded only if the requested dictionary level is equal or
higher than this number. The default level is zero; a higher value can be set
by appending @<num> to the dictionary file name, like so:
-x path/to/dictionary.dct@2
`-x path/to/dictionary.dct@2`
Good examples of dictionaries can be found in xml.dict and png.dict.

73
dictionaries/aff.dict Normal file
View File

@ -0,0 +1,73 @@
# https://www.systutorials.com/docs/linux/man/4-hunspell/
# Affix keywords
"AF"
"AM"
"BREAK"
"CHECKCOMPOUNDCASE"
"CHECKCOMPOUNDDUP"
"CHECKCOMPOUNDPATTERN"
"CHECKCOMPOUNDREP"
"CHECKCOMPOUNDTRIPLE"
"COMPLEXPREFIXES"
"COMPOUNDBEGIN"
"COMPOUNDFLAG"
"COMPOUNDFORBIDFLAG"
"COMPOUNDLAST"
"COMPOUNDMIDDLE"
"COMPOUNDMIN"
"COMPOUNDPERMITFLAG"
"COMPOUNDROOT"
"COMPOUNDRULE"
"COMPOUNDSYLLABLE"
"COMPOUNDWORDMAX"
"FLAG"
"FORBIDWARN"
"FORCEUCASE"
"IGNORE"
"KEY"
"LANG"
"MAP"
"MAXCODSUGS"
"MAXDIFF"
"MAXNGRAMSUGS"
"NOSPLITSUGS"
"NOSUGGEST"
"ONLYINCOMPOUND"
"ONLYMAXDIFF"
"PFX"
"PHONE"
"REP"
"SET"
"SFX"
"SIMPLIFIEDTRIPLE"
"SUGWITHDOTS"
"SYLLABLENUM"
"TRY"
"WARN"
"CIRCUMFIX"
"FORBIDDENWORD"
"FULLSTRIP"
"KEEPCASE"
"ICONV"
"OCONV"
"LEMMA_PRESENT"
"NEEDAFFIX"
"PSEUDOROOT"
"SUBSTANDARD"
"WORDCHARS"
"CHECKSHARPS"
# Optional data fields
"ph:"
"st:"
"al:"
"po:"
"ds:"
"is:"
"ts:"
"sp:"
"pa:"
"dp:"
"ip:"
"tp:"

112
dictionaries/ass.dict Normal file
View File

@ -0,0 +1,112 @@
"0x"
"\\1a"
"\\2a"
"\\2c"
"\\3a"
"\\3c"
"\\4a"
"\\4c"
"\\a"
"\\alpha"
"\\an"
"Arial"
"\\b"
"Banner;"
"\\be"
"\\blur"
"\\bord"
"\\c"
"CFF"
"CID Type 1"
"\\clip"
"clip"
"Courier"
"Courier New"
"Default"
"Dialogue:"
"[Events]"
"\\fade"
"\\fax"
"\\fay"
"\\fe"
"\\fn"
"fontname:"
"[Fonts]"
"Format:"
"\\frx"
"\\fry"
"\\frz"
"\\fs"
"\\fsc"
"\\fscx"
"\\fscy"
"\\fsp"
"&h"
"Helvetica"
"\\i"
"\\iclip"
"iclip"
"\\k"
"Kerning:"
"Kerning"
"\\kf"
"\\ko"
"Language:"
"monospace"
"\\move"
"move"
"none"
"\\org"
"org"
"OverrideStyle"
"\\p"
"p"
"\\pbo"
"pbo"
"pc.240m"
"pc.601"
"pc.709"
"pc.fcc"
"PlayResX:"
"PlayResX"
"PlayResY:"
"PlayResY"
"\\pos"
"pos"
"\\q"
"\\r"
"\\s"
"sans-serif"
"ScaledBorderAndShadow:"
"ScaledBorderAndShadow"
"[Script Info]"
"Scroll down;"
"Scroll up;"
"serif"
"\\shad"
"Style:"
"\\t"
"Text"
"Timer:"
"Timer"
"Times"
"Times New Roman"
"tv.240m"
"tv.601"
"tv.709"
"tv.fcc"
"Type 1"
"Type 42"
"\\u"
"UTF-8"
"[V4 Styles]"
"[V4+ Styles]"
"WrapStyle:"
"WrapStyle"
"\\xbord"
"\\xshad"
"\\ybord"
"YCbCr Matrix:"
"YCbCr Matrix"
"yes"
"\\yshad"

33
dictionaries/atom.dict Normal file
View File

@ -0,0 +1,33 @@
# https://validator.w3.org/feed/docs/atom.html
# https://tools.ietf.org/html/rfc4287
"<?xml version='1.0' encoding='utf-8'?>"
"<feed xmlns='http://www.w3.org/2005/Atom'>"
"<alternate>"
"<author>"
"<category>"
"<content>"
"<contributor>"
"<email>"
"<entry>"
"<feed>"
"<first>"
"<generator>"
"<icon>"
"<id>"
"<last>"
"<link>"
"<logo>"
"<modified/>
"<name>"
"<next>"
"<previous>"
"<published>"
"<rights>"
"<source>"
"<subtitle>"
"<summary>"
"<title>"
"<updated>"
"<uri>"

5
dictionaries/av1_dc.dict Normal file
View File

@ -0,0 +1,5 @@
# IVF Signature + version (bytes 0-5)
kw1="DKIF\x00\x00"
# AV1 codec fourCC (bytes 8-11)
kw2="AV01"

152
dictionaries/bash.dict Normal file
View File

@ -0,0 +1,152 @@
# Keywords taken from
# - https://www.gnu.org/software/bash/manual/html_node/Bash-Variables.html
# - https://www.gnu.org/software/bash/manual/html_node/Bourne-Shell-Builtins.html
# - https://www.gnu.org/software/bash/manual/html_node/Bourne-Shell-Variables.html
# - https://www.gnu.org/software/bash/manual/html_node/Reserved-Word-Index.html
"!"
"."
":"
"["
"[["
"]]"
"{"
"}"
"BASH"
"BASH_ALIASES"
"BASH_ARGC"
"BASH_ARGV"
"BASH_ARGV0"
"BASH_CMDS"
"BASH_COMMAND"
"BASH_COMPAT"
"BASH_ENV"
"BASH_EXECUTION_STRING"
"BASH_LINENO"
"BASH_LOADABLES_PATH"
"BASHOPTS"
"BASHPID"
"BASH_REMATCH"
"BASH_SOURCE"
"BASH_SUBSHELL"
"BASH_VERSINFO"
"BASH_VERSION"
"BASH_XTRACEFD"
"break"
"case"
"cd"
"CDPATH"
"CHILD_MAX"
"COLUMNS"
"COMP_CWORD"
"COMP_KEY"
"COMP_LINE"
"COMP_POINT"
"COMPREPLY"
"COMP_TYPE"
"COMP_WORDBREAKS"
"COMP_WORDS"
"continue"
"COPROC"
"DIRSTACK"
"do"
"done"
"elif"
"else"
"EMACS"
"ENV"
"EPOCHREALTIME"
"EPOCHSECONDS"
"esac"
"EUID"
"eval"
"exec"
"EXECIGNORE"
"exit"
"export"
"FCEDIT"
"fi"
"FIGNORE"
"for"
"FUNCNAME"
"FUNCNEST"
"function"
"getopts"
"GLOBIGNORE"
"GROUPS"
"hash"
"histchars"
"HISTCMD"
"HISTCONTROL"
"HISTFILE"
"HISTFILESIZE"
"HISTIGNORE"
"HISTSIZE"
"HISTTIMEFORMAT"
"HOME"
"HOSTFILE"
"HOSTNAME"
"HOSTTYPE"
"if"
"IFS"
"IGNOREEOF"
"in"
"INPUTRC"
"INSIDE_EMACS"
"LANG"
"LC_ALL"
"LC_COLLATE"
"LC_CTYPE"
"LC_MESSAGES"
"LC_NUMERIC"
"LC_TIME"
"LINENO"
"LINES"
"MACHTYPE"
"MAIL"
"MAILCHECK"
"MAILPATH"
"MAPFILE"
"OLDPWD"
"OPTARG"
"OPTERR"
"OPTIND"
"OSTYPE"
"PATH"
"PIPESTATUS"
"POSIXLY_CORRECT"
"PPID"
"PROMPT_COMMAND"
"PROMPT_DIRTRIM"
"PS0"
"PS1"
"PS2"
"PS3"
"PS4"
"pwd"
"PWD"
"RANDOM"
"READLINE_LINE"
"READLINE_POINT"
"readonly"
"REPLY"
"return"
"SECONDS"
"select"
"SHELL"
"SHELLOPTS"
"shift"
"SHLVL"
"test"
"then"
"time"
"TIMEFORMAT"
"times"
"TMOUT"
"TMPDIR"
"trap"
"UID"
"umask"
"unset"
"until"
"while"

30
dictionaries/bdf.dict Normal file
View File

@ -0,0 +1,30 @@
# https://en.wikipedia.org/wiki/Glyph_Bitmap_Distribution_Format
# https://www.adobe.com/content/dam/acom/en/devnet/font/pdfs/5005.BDF_Spec.pdf
"STARTFONT"
"COMMENT"
"CONTENTVERSION"
"FONT"
"SIZE"
"FONTBOUNDINGBOX"
"METRICSSET"
"SWIDTH"
"DWIDTH"
"SWIDTH1"
"DWIDTH1"
"VVECTOR"
"STARTPROPERTIES"
"ENDPROPERTIES"
"CHARS"
"STARTCHAR"
"ENCODING"
"BBX"
"BITMAP"
"ENDCHAR"
"ENDFONT"
# misc
"255"
"-1"
"0"
"2.1"

10
dictionaries/bmp.dict Normal file
View File

@ -0,0 +1,10 @@
windows="BM"
os2_bitmap="BA"
os2_icon="CI"
os2_pointer="CP"
os2_struct="IC"
os2_ptr="PT"
windows_color_space="Win "
srgb="sRGB"
link="LINK"
mbed="MBED"

3
dictionaries/bz2.dict Normal file
View File

@ -0,0 +1,3 @@
magic="BZ"
compress_magic="\x31\x41\x59\x26\x53\x59"
eos_magic="\x17\x72\x45\x38\x50\x90"

14
dictionaries/creole.dict Normal file
View File

@ -0,0 +1,14 @@
# http://www.wikicreole.org/wiki/Creole1.0
bold="**"
italic="//"
heading="=="
link1="[[a|b]]"
link2="[[a:b]]"
hr="----"
img=" {{a|b}}"
table_heading="|=a |=b |"
raw="{{{a}}}"
escape="~"
placeholder="<<<x>>>"
line_break="\\\\"

354
dictionaries/css.dict Normal file
View File

@ -0,0 +1,354 @@
# https://en.wikipedia.org/wiki/Cascading_Style_Sheets
# selectors
"::after"
"::before"
"::first-letter"
"::first-line"
"::placeholder"
"::selection"
":active"
":checked"
":default"
":disabled"
":empty"
":enabled"
":first-child"
":first-of-type"
":focus"
":hover"
":in-range"
":indeterminate"
":invalid"
":lang("
":last-child"
":last-of-type"
":link"
":not("
":nth-child("
":nth-last-child("
":nth-last-of-type("
":nth-of-type("
":only-child"
":only-of-type"
":optional"
":out-of-range"
":read-only"
":read-write"
":required"
":root"
":target"
":valid"
":visited"
# units
"ch"
"cm"
"em"
"ex"
"in"
"mm"
"pc"
"pt"
"px"
"rem"
"vh"
"vmax"
"vmin"
"vw"
# functions
"attr("
"calc("
"cubic-bezier("
"hsl("
"hsls("
"linear-gradient("
"radial-gradient("
"repeating-linear-gradient("
"repeating-radial-gradient("
"rgb("
"rgba("
"var("
# prefixes
"-moz"
"-webkit"
# properties
"@charset"
"@font-face"
"@font-feature-values"
"@import"
"@keyframes"
"@media"
"align-items"
"align-self"
"all"
"animation"
"animation-delay"
"animation-direction"
"animation-duration"
"animation-fill-mode"
"animation-iteration-count"
"animation-name"
"animation-play-state"
"animation-timing-function"
"backface-visibility"
"background"
"background-attachment"
"background-blend-mode"
"background-clip"
"background-color"
"background-image"
"background-origin"
"background-position"
"background-repeat"
"background-size"
"border"
"border-bottom"
"border-bottom-color"
"border-bottom-left-radius"
"border-bottom-right-radius"
"border-bottom-style"
"border-bottom-width"
"border-collapse"
"border-color"
"border-image"
"border-image-outset"
"border-image-repeat"
"border-image-slice"
"border-image-source"
"border-image-width"
"border-left"
"border-left-color"
"border-left-style"
"border-left-width"
"border-radius"
"border-right"
"border-right-color"
"border-right-style"
"border-right-width"
"border-spacing"
"border-style"
"border-top"
"border-top-color"
"border-top-left-radius"
"border-top-right-radius"
"border-top-style"
"border-top-width"
"border-width"
"bottom"
"box-decoration-break"
"box-shadow"
"box-sizing"
"break-after"
"break-before"
"break-inside"
"caption-side"
"caret-color"
"clear"
"clip"
"color"
"column-count"
"column-fill"
"column-gap"
"column-rule"
"column-rule-color"
"column-rule-style"
"column-rule-width"
"column-span"
"column-width"
"columns"
"content"
"counter-increment"
"counter-reset"
"cursor"
"direction"
"display"
"empty-cells"
"filter"
"flex"
"flex-basis"
"flex-direction"
"flex-flow"
"flex-grow"
"flex-shrink"
"flex-wrap"
"float"
"font"
"font-family"
"font-feature-settings"
"font-kerning"
"font-language-override"
"font-size"
"font-size-adjust"
"font-stretch"
"font-style"
"font-synthesis"
"font-variant"
"font-variant-alternates"
"font-variant-caps"
"font-variant-east-asian"
"font-variant-ligatures"
"font-variant-numeric"
"font-variant-position"
"font-weight"
"from"
"grid"
"grid-area"
"grid-auto-columns"
"grid-auto-flow"
"grid-auto-rows"
"grid-column"
"grid-column-end"
"grid-column-gap"
"grid-column-start"
"grid-gap"
"grid-row"
"grid-row-end"
"grid-row-gap"
"grid-row-start"
"grid-template"
"grid-template-areas"
"grid-template-columns"
"grid-template-rows"
"hanging-punctuation"
"height"
"hyphens"
"image-rendering"
"isolation"
"justify-content"
"left"
"letter-spacing"
"line-break"
"line-height"
"list-style"
"list-style-image"
"list-style-position"
"list-style-type"
"margin"
"margin-bottom"
"margin-left"
"margin-right"
"margin-top"
"max-height"
"max-width"
"min-height"
"min-width"
"mix-blend-mode"
"object-fit"
"object-position"
"opacity"
"order"
"orphans"
"outline"
"outline-color"
"outline-offset"
"outline-style"
"outline-width"
"overflow"
"overflow-wrap"
"overflow-x"
"overflow-y"
"padding"
"padding-bottom"
"padding-left"
"padding-right"
"padding-top"
"page-break-after"
"page-break-before"
"page-break-inside"
"perspective"
"perspective-origin"
"pointer-events"
"position"
"quotes"
"resize"
"right"
"scroll-behavior"
"tab-size"
"table-layout"
"text-align"
"text-align-last"
"text-combine-upright"
"text-decoration"
"text-decoration-color"
"text-decoration-line"
"text-decoration-style"
"text-indent"
"text-justify"
"text-orientation"
"text-overflow"
"text-shadow"
"text-transform"
"text-underline-position"
"to"
"top"
"transform"
"transform-origin"
"transform-style"
"transition"
"transition-delay"
"transition-duration"
"transition-property"
"transition-timing-function"
"unicode-bidi"
"user-select"
"vertical-align"
"visibility"
"white-space"
"widows"
"width"
"word-break"
"word-spacing"
"word-wrap"
"writing-mode"
"z-index"
# aural - https://www.w3schools.com/cssref/css_ref_aural.asp
"above"
"azimuth"
"below"
"center"
"code"
"continuous"
"cue"
"cue-after"
"cue-before"
"elevation"
"generic-voice"
"left"
"left-side"
"leftwards"
"lower"
"medium"
"mix"
"none"
"once"
"pause"
"pause-after"
"pause-before"
"pitch"
"pitch-range"
"play-during"
"richness"
"right"
"right-side"
"slower"
"speak"
"speak-header"
"speak-numeral"
"speak-punctuation"
"speech-rate"
"stress"
"url"
"voice-family"
"volume"
"x-fast"
"x-high"
"x-loud"
"x-low"
"x-slow"
"x-soft"

6
dictionaries/csv.dict Normal file
View File

@ -0,0 +1,6 @@
"\x00"
"\r\n"
";;"
",,"
"\t;"
"\n;"

35
dictionaries/dds.dict Normal file
View File

@ -0,0 +1,35 @@
# See http://www.mindcontrol.org/~hplus/graphics/dds-info/
magic="\x20\x53\x44\x44"
# Headers
"\x00\x00\x00\x01"
"\x00\x00\x00\x02"
"\x00\x00\x00\x04"
"\x00\x00\x00\x08"
"\x00\x00\x10\x00"
"\x00\x02\x00\x00"
"\x00\x08\x00\x00"
"\x00\x80\x00\x00"
"\x00\x00\x00\x01"
"\x00\x00\x00\x04"
"\x00\x00\x00\x20"
"\x00\x00\x00\x40"
"\x00\x00\x00\x08"
"\x00\x00\x10\x00"
"\x00\x40\x00\x00"
"\x00\x00\x02\x00"
"\x00\x00\x04\x00"
"\x00\x00\x08\x00"
"\x00\x00\x10\x00"
"\x00\x00\x20\x00"
"\x00\x00\x40\x00"
"\x00\x00\x80\x00"
"\x00\x20\x00\x00"
#formats
"1TXD"
"2TXD"
"3TXD"
"4TXD"
"5TXD"

34
dictionaries/djvu.dict Normal file
View File

@ -0,0 +1,34 @@
"ANTa"
"ANTz"
"BG2k"
"BG44"
"BGjp"
"BM44"
"CELX"
"DIRM"
"DJVI"
"DJVM"
"DJVU"
"Djbz"
"FAKE"
"FG2k"
"FG44"
"FGbz"
"FGjp"
"FORM"
"INCL"
"INFO"
"LINK"
"METa"
"METz"
"NAVM"
"NDIR"
"PM44"
"SINF"
"Sjbz"
"Smmr"
"TH44"
"THUM"
"TXTa"
"TXTz"
"WMRM"

688
dictionaries/docommand.dict Normal file
View File

@ -0,0 +1,688 @@
#SELECT WORD FROM INFORMATION_SCHEMA.KEYWORDS;
ACCESSIBLE="ACCESSIBLE"
ACCOUNT="ACCOUNT"
ACTION="ACTION"
ACTIVE="ACTIVE"
ADD="ADD"
ADMIN="ADMIN"
AFTER="AFTER"
AGAINST="AGAINST"
AGGREGATE="AGGREGATE"
ALGORITHM="ALGORITHM"
ALL="ALL"
ALTER="ALTER"
ALWAYS="ALWAYS"
ANALYZE="ANALYZE"
AND="AND"
ANY="ANY"
AS="AS"
ASC="ASC"
ASCII="ASCII"
ASENSITIVE="ASENSITIVE"
AT="AT"
AUTOEXTEND_SIZE="AUTOEXTEND_SIZE"
AUTO_INCREMENT="AUTO_INCREMENT"
AVG="AVG"
AVG_ROW_LENGTH="AVG_ROW_LENGTH"
BACKUP="BACKUP"
BEFORE="BEFORE"
BEGIN="BEGIN"
BETWEEN="BETWEEN"
BIGINT="BIGINT"
BINARY="BINARY"
BINLOG="BINLOG"
BIT="BIT"
BLOB="BLOB"
BLOCK="BLOCK"
BOOL="BOOL"
BOOLEAN="BOOLEAN"
BOTH="BOTH"
BTREE="BTREE"
BUCKETS="BUCKETS"
BY="BY"
BYTE="BYTE"
CACHE="CACHE"
CALL="CALL"
CASCADE="CASCADE"
CASCADED="CASCADED"
CASE="CASE"
CATALOG_NAME="CATALOG_NAME"
CHAIN="CHAIN"
CHANGE="CHANGE"
CHANGED="CHANGED"
CHANNEL="CHANNEL"
CHAR="CHAR"
CHARACTER="CHARACTER"
CHARSET="CHARSET"
CHECK="CHECK"
CHECKSUM="CHECKSUM"
CIPHER="CIPHER"
CLASS_ORIGIN="CLASS_ORIGIN"
CLIENT="CLIENT"
CLONE="CLONE"
CLOSE="CLOSE"
COALESCE="COALESCE"
CODE="CODE"
COLLATE="COLLATE"
COLLATION="COLLATION"
COLUMN="COLUMN"
COLUMNS="COLUMNS"
COLUMN_FORMAT="COLUMN_FORMAT"
COLUMN_NAME="COLUMN_NAME"
COMMENT="COMMENT"
COMMIT="COMMIT"
COMMITTED="COMMITTED"
COMPACT="COMPACT"
COMPLETION="COMPLETION"
COMPONENT="COMPONENT"
COMPRESSED="COMPRESSED"
COMPRESSION="COMPRESSION"
CONCURRENT="CONCURRENT"
CONDITION="CONDITION"
CONNECTION="CONNECTION"
CONSISTENT="CONSISTENT"
CONSTRAINT="CONSTRAINT"
CONSTRAINT_CATALOG="CONSTRAINT_CATALOG"
CONSTRAINT_NAME="CONSTRAINT_NAME"
CONSTRAINT_SCHEMA="CONSTRAINT_SCHEMA"
CONTAINS="CONTAINS"
CONTEXT="CONTEXT"
CONTINUE="CONTINUE"
CONVERT="CONVERT"
CPU="CPU"
CREATE="CREATE"
CROSS="CROSS"
CUBE="CUBE"
CUME_DIST="CUME_DIST"
CURRENT="CURRENT"
CURRENT_DATE="CURRENT_DATE"
CURRENT_TIME="CURRENT_TIME"
CURRENT_TIMESTAMP="CURRENT_TIMESTAMP"
CURRENT_USER="CURRENT_USER"
CURSOR="CURSOR"
CURSOR_NAME="CURSOR_NAME"
DATA="DATA"
DATABASE="DATABASE"
DATABASES="DATABASES"
DATAFILE="DATAFILE"
DATE="DATE"
DATETIME="DATETIME"
DAY="DAY"
DAY_HOUR="DAY_HOUR"
DAY_MICROSECOND="DAY_MICROSECOND"
DAY_MINUTE="DAY_MINUTE"
DAY_SECOND="DAY_SECOND"
DEALLOCATE="DEALLOCATE"
DEC="DEC"
DECIMAL="DECIMAL"
DECLARE="DECLARE"
DEFAULT="DEFAULT"
DEFAULT_AUTH="DEFAULT_AUTH"
DEFINER="DEFINER"
DEFINITION="DEFINITION"
DELAYED="DELAYED"
DELAY_KEY_WRITE="DELAY_KEY_WRITE"
DELETE="DELETE"
DENSE_RANK="DENSE_RANK"
DESC="DESC"
DESCRIBE="DESCRIBE"
DESCRIPTION="DESCRIPTION"
DETERMINISTIC="DETERMINISTIC"
DIAGNOSTICS="DIAGNOSTICS"
DIRECTORY="DIRECTORY"
DISABLE="DISABLE"
DISCARD="DISCARD"
DISK="DISK"
DISTINCT="DISTINCT"
DISTINCTROW="DISTINCTROW"
DIV="DIV"
DO="DO"
DOUBLE="DOUBLE"
DROP="DROP"
DUAL="DUAL"
DUMPFILE="DUMPFILE"
DUPLICATE="DUPLICATE"
DYNAMIC="DYNAMIC"
EACH="EACH"
ELSE="ELSE"
ELSEIF="ELSEIF"
EMPTY="EMPTY"
ENABLE="ENABLE"
ENCLOSED="ENCLOSED"
ENCRYPTION="ENCRYPTION"
END="END"
ENDS="ENDS"
ENFORCED="ENFORCED"
ENGINE="ENGINE"
ENGINES="ENGINES"
ENUM="ENUM"
ERROR="ERROR"
ERRORS="ERRORS"
ESCAPE="ESCAPE"
ESCAPED="ESCAPED"
EVENT="EVENT"
EVENTS="EVENTS"
EVERY="EVERY"
EXCEPT="EXCEPT"
EXCHANGE="EXCHANGE"
EXCLUDE="EXCLUDE"
EXECUTE="EXECUTE"
EXISTS="EXISTS"
EXIT="EXIT"
EXPANSION="EXPANSION"
EXPIRE="EXPIRE"
EXPLAIN="EXPLAIN"
EXPORT="EXPORT"
EXTENDED="EXTENDED"
EXTENT_SIZE="EXTENT_SIZE"
FALSE="FALSE"
FAST="FAST"
FAULTS="FAULTS"
FETCH="FETCH"
FIELDS="FIELDS"
FILE="FILE"
FILE_BLOCK_SIZE="FILE_BLOCK_SIZE"
FILTER="FILTER"
FIRST="FIRST"
FIRST_VALUE="FIRST_VALUE"
FIXED="FIXED"
FLOAT="FLOAT"
FLOAT4="FLOAT4"
FLOAT8="FLOAT8"
FLUSH="FLUSH"
FOLLOWING="FOLLOWING"
FOLLOWS="FOLLOWS"
FOR="FOR"
FORCE="FORCE"
FOREIGN="FOREIGN"
FORMAT="FORMAT"
FOUND="FOUND"
FROM="FROM"
FULL="FULL"
FULLTEXT="FULLTEXT"
FUNCTION="FUNCTION"
GENERAL="GENERAL"
GENERATED="GENERATED"
GEOMCOLLECTION="GEOMCOLLECTION"
GEOMETRY="GEOMETRY"
GEOMETRYCOLLECTION="GEOMETRYCOLLECTION"
GET="GET"
GET_FORMAT="GET_FORMAT"
GET_MASTER_PUBLIC_KEY="GET_MASTER_PUBLIC_KEY"
GLOBAL="GLOBAL"
GRANT="GRANT"
GRANTS="GRANTS"
GROUP="GROUP"
GROUPING="GROUPING"
GROUPS="GROUPS"
GROUP_REPLICATION="GROUP_REPLICATION"
HANDLER="HANDLER"
HASH="HASH"
HAVING="HAVING"
HELP="HELP"
HIGH_PRIORITY="HIGH_PRIORITY"
HISTOGRAM="HISTOGRAM"
HISTORY="HISTORY"
HOST="HOST"
HOSTS="HOSTS"
HOUR="HOUR"
HOUR_MICROSECOND="HOUR_MICROSECOND"
HOUR_MINUTE="HOUR_MINUTE"
HOUR_SECOND="HOUR_SECOND"
IDENTIFIED="IDENTIFIED"
IF="IF"
IGNORE="IGNORE"
IGNORE_SERVER_IDS="IGNORE_SERVER_IDS"
IMPORT="IMPORT"
IN="IN"
INACTIVE="INACTIVE"
INDEX="INDEX"
INDEXES="INDEXES"
INFILE="INFILE"
INITIAL_SIZE="INITIAL_SIZE"
INNER="INNER"
INOUT="INOUT"
INSENSITIVE="INSENSITIVE"
INSERT="INSERT"
INSERT_METHOD="INSERT_METHOD"
INSTALL="INSTALL"
INSTANCE="INSTANCE"
INT="INT"
INT1="INT1"
INT2="INT2"
INT3="INT3"
INT4="INT4"
INT8="INT8"
INTEGER="INTEGER"
INTERVAL="INTERVAL"
INTO="INTO"
INVISIBLE="INVISIBLE"
INVOKER="INVOKER"
IO="IO"
IO_AFTER_GTIDS="IO_AFTER_GTIDS"
IO_BEFORE_GTIDS="IO_BEFORE_GTIDS"
IO_THREAD="IO_THREAD"
IPC="IPC"
IS="IS"
ISOLATION="ISOLATION"
ISSUER="ISSUER"
ITERATE="ITERATE"
JOIN="JOIN"
JSON="JSON"
JSON_TABLE="JSON_TABLE"
KEY="KEY"
KEYS="KEYS"
KEY_BLOCK_SIZE="KEY_BLOCK_SIZE"
KILL="KILL"
LAG="LAG"
LANGUAGE="LANGUAGE"
LAST="LAST"
LAST_VALUE="LAST_VALUE"
LATERAL="LATERAL"
LEAD="LEAD"
LEADING="LEADING"
LEAVE="LEAVE"
LEAVES="LEAVES"
LEFT="LEFT"
LESS="LESS"
LEVEL="LEVEL"
LIKE="LIKE"
LIMIT="LIMIT"
LINEAR="LINEAR"
LINES="LINES"
LINESTRING="LINESTRING"
LIST="LIST"
LOAD="LOAD"
LOCAL="LOCAL"
LOCALTIME="LOCALTIME"
LOCALTIMESTAMP="LOCALTIMESTAMP"
LOCK="LOCK"
LOCKED="LOCKED"
LOCKS="LOCKS"
LOGFILE="LOGFILE"
LOGS="LOGS"
LONG="LONG"
LONGBLOB="LONGBLOB"
LONGTEXT="LONGTEXT"
LOOP="LOOP"
LOW_PRIORITY="LOW_PRIORITY"
MASTER="MASTER"
MASTER_AUTO_POSITION="MASTER_AUTO_POSITION"
MASTER_BIND="MASTER_BIND"
MASTER_CONNECT_RETRY="MASTER_CONNECT_RETRY"
MASTER_DELAY="MASTER_DELAY"
MASTER_HEARTBEAT_PERIOD="MASTER_HEARTBEAT_PERIOD"
MASTER_HOST="MASTER_HOST"
MASTER_LOG_FILE="MASTER_LOG_FILE"
MASTER_LOG_POS="MASTER_LOG_POS"
MASTER_PASSWORD="MASTER_PASSWORD"
MASTER_PORT="MASTER_PORT"
MASTER_PUBLIC_KEY_PATH="MASTER_PUBLIC_KEY_PATH"
MASTER_RETRY_COUNT="MASTER_RETRY_COUNT"
MASTER_SERVER_ID="MASTER_SERVER_ID"
MASTER_SSL="MASTER_SSL"
MASTER_SSL_CA="MASTER_SSL_CA"
MASTER_SSL_CAPATH="MASTER_SSL_CAPATH"
MASTER_SSL_CERT="MASTER_SSL_CERT"
MASTER_SSL_CIPHER="MASTER_SSL_CIPHER"
MASTER_SSL_CRL="MASTER_SSL_CRL"
MASTER_SSL_CRLPATH="MASTER_SSL_CRLPATH"
MASTER_SSL_KEY="MASTER_SSL_KEY"
MASTER_SSL_VERIFY_SERVER_CERT="MASTER_SSL_VERIFY_SERVER_CERT"
MASTER_TLS_VERSION="MASTER_TLS_VERSION"
MASTER_USER="MASTER_USER"
MATCH="MATCH"
MAXVALUE="MAXVALUE"
MAX_CONNECTIONS_PER_HOUR="MAX_CONNECTIONS_PER_HOUR"
MAX_QUERIES_PER_HOUR="MAX_QUERIES_PER_HOUR"
MAX_ROWS="MAX_ROWS"
MAX_SIZE="MAX_SIZE"
MAX_UPDATES_PER_HOUR="MAX_UPDATES_PER_HOUR"
MAX_USER_CONNECTIONS="MAX_USER_CONNECTIONS"
MEDIUM="MEDIUM"
MEDIUMBLOB="MEDIUMBLOB"
MEDIUMINT="MEDIUMINT"
MEDIUMTEXT="MEDIUMTEXT"
MEMORY="MEMORY"
MERGE="MERGE"
MESSAGE_TEXT="MESSAGE_TEXT"
MICROSECOND="MICROSECOND"
MIDDLEINT="MIDDLEINT"
MIGRATE="MIGRATE"
MINUTE="MINUTE"
MINUTE_MICROSECOND="MINUTE_MICROSECOND"
MINUTE_SECOND="MINUTE_SECOND"
MIN_ROWS="MIN_ROWS"
MOD="MOD"
MODE="MODE"
MODIFIES="MODIFIES"
MODIFY="MODIFY"
MONTH="MONTH"
MULTILINESTRING="MULTILINESTRING"
MULTIPOINT="MULTIPOINT"
MULTIPOLYGON="MULTIPOLYGON"
MUTEX="MUTEX"
MYSQL_ERRNO="MYSQL_ERRNO"
NAME="NAME"
NAMES="NAMES"
NATIONAL="NATIONAL"
NATURAL="NATURAL"
NCHAR="NCHAR"
NDB="NDB"
NDBCLUSTER="NDBCLUSTER"
NESTED="NESTED"
NETWORK_NAMESPACE="NETWORK_NAMESPACE"
NEVER="NEVER"
NEW="NEW"
NEXT="NEXT"
NO="NO"
NODEGROUP="NODEGROUP"
NONE="NONE"
NOT="NOT"
NOWAIT="NOWAIT"
NO_WAIT="NO_WAIT"
NO_WRITE_TO_BINLOG="NO_WRITE_TO_BINLOG"
NTH_VALUE="NTH_VALUE"
NTILE="NTILE"
NULL="NULL"
NULLS="NULLS"
NUMBER="NUMBER"
NUMERIC="NUMERIC"
NVARCHAR="NVARCHAR"
OF="OF"
OFFSET="OFFSET"
OJ="OJ"
OLD="OLD"
ON="ON"
ONE="ONE"
ONLY="ONLY"
OPEN="OPEN"
OPTIMIZE="OPTIMIZE"
OPTIMIZER_COSTS="OPTIMIZER_COSTS"
OPTION="OPTION"
OPTIONAL="OPTIONAL"
OPTIONALLY="OPTIONALLY"
OPTIONS="OPTIONS"
OR="OR"
ORDER="ORDER"
ORDINALITY="ORDINALITY"
ORGANIZATION="ORGANIZATION"
OTHERS="OTHERS"
OUT="OUT"
OUTER="OUTER"
OUTFILE="OUTFILE"
OVER="OVER"
OWNER="OWNER"
PACK_KEYS="PACK_KEYS"
PAGE="PAGE"
PARSER="PARSER"
PARTIAL="PARTIAL"
PARTITION="PARTITION"
PARTITIONING="PARTITIONING"
PARTITIONS="PARTITIONS"
PASSWORD="PASSWORD"
PATH="PATH"
PERCENT_RANK="PERCENT_RANK"
PERSIST="PERSIST"
PERSIST_ONLY="PERSIST_ONLY"
PHASE="PHASE"
PLUGIN="PLUGIN"
PLUGINS="PLUGINS"
PLUGIN_DIR="PLUGIN_DIR"
POINT="POINT"
POLYGON="POLYGON"
PORT="PORT"
PRECEDES="PRECEDES"
PRECEDING="PRECEDING"
PRECISION="PRECISION"
PREPARE="PREPARE"
PRESERVE="PRESERVE"
PREV="PREV"
PRIMARY="PRIMARY"
PRIVILEGES="PRIVILEGES"
PROCEDURE="PROCEDURE"
PROCESS="PROCESS"
PROCESSLIST="PROCESSLIST"
PROFILE="PROFILE"
PROFILES="PROFILES"
PROXY="PROXY"
PURGE="PURGE"
QUARTER="QUARTER"
QUERY="QUERY"
QUICK="QUICK"
RANGE="RANGE"
RANK="RANK"
READ="READ"
READS="READS"
READ_ONLY="READ_ONLY"
READ_WRITE="READ_WRITE"
REAL="REAL"
REBUILD="REBUILD"
RECOVER="RECOVER"
RECURSIVE="RECURSIVE"
REDO_BUFFER_SIZE="REDO_BUFFER_SIZE"
REDUNDANT="REDUNDANT"
REFERENCE="REFERENCE"
REFERENCES="REFERENCES"
REGEXP="REGEXP"
RELAY="RELAY"
RELAYLOG="RELAYLOG"
RELAY_LOG_FILE="RELAY_LOG_FILE"
RELAY_LOG_POS="RELAY_LOG_POS"
RELAY_THREAD="RELAY_THREAD"
RELEASE="RELEASE"
RELOAD="RELOAD"
REMOVE="REMOVE"
RENAME="RENAME"
REORGANIZE="REORGANIZE"
REPAIR="REPAIR"
REPEAT="REPEAT"
REPEATABLE="REPEATABLE"
REPLACE="REPLACE"
REPLICATE_DO_DB="REPLICATE_DO_DB"
REPLICATE_DO_TABLE="REPLICATE_DO_TABLE"
REPLICATE_IGNORE_DB="REPLICATE_IGNORE_DB"
REPLICATE_IGNORE_TABLE="REPLICATE_IGNORE_TABLE"
REPLICATE_REWRITE_DB="REPLICATE_REWRITE_DB"
REPLICATE_WILD_DO_TABLE="REPLICATE_WILD_DO_TABLE"
REPLICATE_WILD_IGNORE_TABLE="REPLICATE_WILD_IGNORE_TABLE"
REPLICATION="REPLICATION"
REQUIRE="REQUIRE"
RESET="RESET"
RESIGNAL="RESIGNAL"
RESOURCE="RESOURCE"
RESPECT="RESPECT"
RESTART="RESTART"
RESTORE="RESTORE"
RESTRICT="RESTRICT"
RESUME="RESUME"
RETAIN="RETAIN"
RETURN="RETURN"
RETURNED_SQLSTATE="RETURNED_SQLSTATE"
RETURNS="RETURNS"
REUSE="REUSE"
REVERSE="REVERSE"
REVOKE="REVOKE"
RIGHT="RIGHT"
RLIKE="RLIKE"
ROLE="ROLE"
ROLLBACK="ROLLBACK"
ROLLUP="ROLLUP"
ROTATE="ROTATE"
ROUTINE="ROUTINE"
ROW="ROW"
ROWS="ROWS"
ROW_COUNT="ROW_COUNT"
ROW_FORMAT="ROW_FORMAT"
ROW_NUMBER="ROW_NUMBER"
RTREE="RTREE"
SAVEPOINT="SAVEPOINT"
SCHEDULE="SCHEDULE"
SCHEMA="SCHEMA"
SCHEMAS="SCHEMAS"
SCHEMA_NAME="SCHEMA_NAME"
SECOND="SECOND"
SECONDARY="SECONDARY"
SECONDARY_ENGINE="SECONDARY_ENGINE"
SECONDARY_LOAD="SECONDARY_LOAD"
SECONDARY_UNLOAD="SECONDARY_UNLOAD"
SECOND_MICROSECOND="SECOND_MICROSECOND"
SECURITY="SECURITY"
SELECT="SELECT"
SENSITIVE="SENSITIVE"
SEPARATOR="SEPARATOR"
SERIAL="SERIAL"
SERIALIZABLE="SERIALIZABLE"
SERVER="SERVER"
SESSION="SESSION"
SET="SET"
SHARE="SHARE"
SHOW="SHOW"
SHUTDOWN="SHUTDOWN"
SIGNAL="SIGNAL"
SIGNED="SIGNED"
SIMPLE="SIMPLE"
SKIP="SKIP"
SLAVE="SLAVE"
SLOW="SLOW"
SMALLINT="SMALLINT"
SNAPSHOT="SNAPSHOT"
SOCKET="SOCKET"
SOME="SOME"
SONAME="SONAME"
SOUNDS="SOUNDS"
SOURCE="SOURCE"
SPATIAL="SPATIAL"
SPECIFIC="SPECIFIC"
SQL="SQL"
SQLEXCEPTION="SQLEXCEPTION"
SQLSTATE="SQLSTATE"
SQLWARNING="SQLWARNING"
SQL_AFTER_GTIDS="SQL_AFTER_GTIDS"
SQL_AFTER_MTS_GAPS="SQL_AFTER_MTS_GAPS"
SQL_BEFORE_GTIDS="SQL_BEFORE_GTIDS"
SQL_BIG_RESULT="SQL_BIG_RESULT"
SQL_BUFFER_RESULT="SQL_BUFFER_RESULT"
SQL_CALC_FOUND_ROWS="SQL_CALC_FOUND_ROWS"
SQL_NO_CACHE="SQL_NO_CACHE"
SQL_SMALL_RESULT="SQL_SMALL_RESULT"
SQL_THREAD="SQL_THREAD"
SQL_TSI_DAY="SQL_TSI_DAY"
SQL_TSI_HOUR="SQL_TSI_HOUR"
SQL_TSI_MINUTE="SQL_TSI_MINUTE"
SQL_TSI_MONTH="SQL_TSI_MONTH"
SQL_TSI_QUARTER="SQL_TSI_QUARTER"
SQL_TSI_SECOND="SQL_TSI_SECOND"
SQL_TSI_WEEK="SQL_TSI_WEEK"
SQL_TSI_YEAR="SQL_TSI_YEAR"
SRID="SRID"
SSL="SSL"
STACKED="STACKED"
START="START"
STARTING="STARTING"
STARTS="STARTS"
STATS_AUTO_RECALC="STATS_AUTO_RECALC"
STATS_PERSISTENT="STATS_PERSISTENT"
STATS_SAMPLE_PAGES="STATS_SAMPLE_PAGES"
STATUS="STATUS"
STOP="STOP"
STORAGE="STORAGE"
STORED="STORED"
STRAIGHT_JOIN="STRAIGHT_JOIN"
STRING="STRING"
SUBCLASS_ORIGIN="SUBCLASS_ORIGIN"
SUBJECT="SUBJECT"
SUBPARTITION="SUBPARTITION"
SUBPARTITIONS="SUBPARTITIONS"
SUPER="SUPER"
SUSPEND="SUSPEND"
SWAPS="SWAPS"
SWITCHES="SWITCHES"
SYSTEM="SYSTEM"
TABLE="TABLE"
TABLES="TABLES"
TABLESPACE="TABLESPACE"
TABLE_CHECKSUM="TABLE_CHECKSUM"
TABLE_NAME="TABLE_NAME"
TEMPORARY="TEMPORARY"
TEMPTABLE="TEMPTABLE"
TERMINATED="TERMINATED"
TEXT="TEXT"
THAN="THAN"
THEN="THEN"
THREAD_PRIORITY="THREAD_PRIORITY"
TIES="TIES"
TIME="TIME"
TIMESTAMP="TIMESTAMP"
TIMESTAMPADD="TIMESTAMPADD"
TIMESTAMPDIFF="TIMESTAMPDIFF"
TINYBLOB="TINYBLOB"
TINYINT="TINYINT"
TINYTEXT="TINYTEXT"
TO="TO"
TRAILING="TRAILING"
TRANSACTION="TRANSACTION"
TRIGGER="TRIGGER"
TRIGGERS="TRIGGERS"
TRUE="TRUE"
TRUNCATE="TRUNCATE"
TYPE="TYPE"
TYPES="TYPES"
UNBOUNDED="UNBOUNDED"
UNCOMMITTED="UNCOMMITTED"
UNDEFINED="UNDEFINED"
UNDO="UNDO"
UNDOFILE="UNDOFILE"
UNDO_BUFFER_SIZE="UNDO_BUFFER_SIZE"
UNICODE="UNICODE"
UNINSTALL="UNINSTALL"
UNION="UNION"
UNIQUE="UNIQUE"
UNKNOWN="UNKNOWN"
UNLOCK="UNLOCK"
UNSIGNED="UNSIGNED"
UNTIL="UNTIL"
UPDATE="UPDATE"
UPGRADE="UPGRADE"
USAGE="USAGE"
USE="USE"
USER="USER"
USER_RESOURCES="USER_RESOURCES"
USE_FRM="USE_FRM"
USING="USING"
UTC_DATE="UTC_DATE"
UTC_TIME="UTC_TIME"
UTC_TIMESTAMP="UTC_TIMESTAMP"
VALIDATION="VALIDATION"
VALUE="VALUE"
VALUES="VALUES"
VARBINARY="VARBINARY"
VARCHAR="VARCHAR"
VARCHARACTER="VARCHARACTER"
VARIABLES="VARIABLES"
VARYING="VARYING"
VCPU="VCPU"
VIEW="VIEW"
VIRTUAL="VIRTUAL"
VISIBLE="VISIBLE"
WAIT="WAIT"
WARNINGS="WARNINGS"
WEEK="WEEK"
WEIGHT_STRING="WEIGHT_STRING"
WHEN="WHEN"
WHERE="WHERE"
WHILE="WHILE"
WINDOW="WINDOW"
WITH="WITH"
WITHOUT="WITHOUT"
WORK="WORK"
WRAPPER="WRAPPER"
WRITE="WRITE"
X509="X509"
XA="XA"
XID="XID"
XML="XML"
XOR="XOR"
YEAR="YEAR"
YEAR_MONTH="YEAR_MONTH"
ZEROFILL="ZEROFILL"

222
dictionaries/exif.dict Normal file
View File

@ -0,0 +1,222 @@
"\x00\x01"
"\x00\x02"
"\x00\x10"
"\x00\x90"
"\x00\xa0"
"\x00\xa3"
"\x00\xa5"
"\x00\xfe"
"\x01\x00"
"\x01\x01"
"\x01\x02"
"\x01\x03"
"\x01\x06"
"\x01\x0a"
"\x01\x0d"
"\x01\x0e"
"\x01\x0f"
"\x01\x10"
"\x01\x11"
"\x01\x12"
"\x01\x15"
"\x01\x16"
"\x01\x17"
"\x01\x1a"
"\x01\x1b"
"\x01\x1c"
"\x01\x28"
"\x01\x2d"
"\x01\x31"
"\x01\x32"
"\x01\x3b"
"\x01\x3e"
"\x01\x3f"
"\x01\x4a"
"\x01\x56"
"\x01\x91"
"\x01\x92"
"\x01\xa0"
"\x01\xa3"
"\x01\xa4"
"\x02\x00"
"\x02\x01"
"\x02\x02"
"\x02\x10"
"\x02\x11"
"\x02\x12"
"\x02\x13"
"\x02\x14"
"\x02\x91"
"\x02\x92"
"\x02\xa0"
"\x02\xa3"
"\x02\xa4"
"\x02\xbc"
"\x03\x01"
"\x03\x90"
"\x03\x92"
"\x03\xa0"
"\x03\xa4"
"\x04\x90"
"\x04\x92"
"\x04\xa0"
"\x04\xa4"
"\x05\x92"
"\x05\xa0"
"\x05\xa4"
"\x06\x01"
"\x06\x92"
"\x06\xa4"
"\x07\x92"
"\x07\xa4"
"\x08\x92"
"\x08\xa4"
"\x09\x92"
"\x09\xa4"
"\x0a\x01"
"\x0a\x92"
"\x0a\xa4"
"\x0b\xa2"
"\x0b\xa4"
"\x0c\xa2"
"\x0c\xa4"
"\x0d\x01"
"\x0e\x01"
"\x0e\xa2"
"\x0f\x01"
"\x0f\xa2"
"\x10\x00"
"\x10\x01"
"\x10\x02"
"\x10\xa2"
"\x11\x01"
"\x11\x02"
"\x12\x01"
"\x12\x02"
"\x13\x02"
"\x14\x02"
"\x14\x92"
"\x14\xa2"
"\x15\x01"
"\x15\xa2"
"\x16\x01"
"\x16\x92"
"\x17\x01"
"\x17\xa2"
"\x1a\x01"
"\x1b\x01"
"\x1c\x01"
"\x1c\xea"
"\x20\xa4"
"\x22\x88"
"\x24\x88"
"\x25\x88"
"\x27\x88"
"\x28\x01"
"\x28\x88"
"\x2a\x88"
"\x2d\x01"
"\x31\x01"
"\x32\x01"
"\x3b\x01"
"\x3e\x01"
"\x3f\x01"
"\x49\x86"
"\x4a\x01"
"\x56\x01"
"\x69\x87"
"\x73\x87"
"\x7c\x92"
"\x82\x8d"
"\x82\x8e"
"\x82\x8f"
"\x82\x98"
"\x82\x9a"
"\x82\x9d"
"\x83\xbb"
"\x86\x49"
"\x86\x92"
"\x87\x69"
"\x87\x73"
"\x88\x22"
"\x88\x24"
"\x88\x25"
"\x88\x27"
"\x88\x28"
"\x88\x2a"
"\x8d\x82"
"\x8e\x82"
"\x8f\x82"
"\x90\x00"
"\x90\x03"
"\x90\x04"
"\x90\x92"
"\x91\x01"
"\x91\x02"
"\x91\x92"
"\x92\x01"
"\x92\x02"
"\x92\x03"
"\x92\x04"
"\x92\x05"
"\x92\x06"
"\x92\x07"
"\x92\x08"
"\x92\x09"
"\x92\x0a"
"\x92\x14"
"\x92\x16"
"\x92\x7c"
"\x92\x86"
"\x92\x90"
"\x92\x91"
"\x92\x92"
"\x98\x82"
"\x9a\x82"
"\x9b\x9c"
"\x9c\x9b"
"\x9c\x9c"
"\x9c\x9d"
"\x9c\x9e"
"\x9c\x9f"
"\x9d\x82"
"\x9d\x9c"
"\x9e\x9c"
"\x9f\x9c"
"\xa0\x00"
"\xa0\x01"
"\xa0\x02"
"\xa0\x03"
"\xa0\x04"
"\xa0\x05"
"\xa2\x0b"
"\xa2\x0c"
"\xa2\x0e"
"\xa2\x0f"
"\xa2\x10"
"\xa2\x14"
"\xa2\x15"
"\xa2\x17"
"\xa3\x00"
"\xa3\x01"
"\xa3\x02"
"\xa4\x01"
"\xa4\x02"
"\xa4\x03"
"\xa4\x04"
"\xa4\x05"
"\xa4\x06"
"\xa4\x07"
"\xa4\x08"
"\xa4\x09"
"\xa4\x0a"
"\xa4\x0b"
"\xa4\x0c"
"\xa4\x20"
"\xa5\x00"
"\xa5\xc4"
"\xbb\x83"
"\xbc\x02"
"\xc4\xa5"
"\xea\x1c"
"\xfe\x00"

42
dictionaries/fbs.dict Normal file
View File

@ -0,0 +1,42 @@
# spec: https://google.github.io/flatbuffers/flatbuffers_grammar.html
attribute="attribute"
bool="bool"
byte="byte"
double="double"
enum="enum"
false="false"
file_extension="file_extension"
float32="float32"
float64="float64"
float="float"
include="include"
inf="inf"
infinity="infinity"
int16="int16"
int32="int32"
int64="int64"
int8="int8"
int="int"
long="long"
namespace="namespace"
nan="nan"
root_type="root_type"
root_type="root_type"
rpc_service="rpc_service"
short="short"
string="string"
struct="struct"
table="table"
true="true"
ubyte="ubyte"
uint16="uint16"
uint32="uint32"
uint64="uint64"
uint="uint"
ulong="ulong"
union="union"
ushort="ushort"
separator=":"
eol=";"

124
dictionaries/ftp.dict Normal file
View File

@ -0,0 +1,124 @@
# from https://github.com/antonio-morales/Fuzzing/Dictionaries/FTP/Example.dict.txt
#Parameters
#tls = {0,1,2,3}
#Input1
"user"
"pass"
"syst"
"acct"
"feat"
"noop"
"help"
"stat"
"stru"
"adat"
"site"
#Input2
"mkd"
"cwd"
"pwd"
"cdup"
#Input3
"port"
"list"
"mlst"
"nlst"
"mlsd"
#Input4
"rmd"
#Input5
"stor"
#Input6
"retr"
#Input7
"dele"
#Input8
"pasv"
#Input9
"epsv"
#Input10
"type"
"size"
#Input11
"mode"
#Input12
"rnfr"
"rnto"
#Input13
"appe"
#Input14
"allo"
"quit"
#Input15
"connect"
#Input16
"esta"
"estp"
#Input17
"mdtm"
"opts"
"eprt"
#Input18
"mfmt"
"pret"
"stou"
"rest"
#-------------------------------------
"\x00"
"\x0d\x0a"
"\x0d"
"\x0a"
"-"
"-a "
"-C "
"-d "
"-F "
"-l "
"-r "
"-R "
"-S "
"-t"
" "
"fuzzing"
"test"
"teste"
".txt"
"test.txt"
" UTC"
"C"
"E"
"P"
"S"
"abor"
#ifdef WITH_TLS
"pbsz"
"auth"
"prot"
"ccc"
#ifdef DEBUG
"xdbg"
# ifdef WITH_DIRALIASES
"alias"

View File

@ -2,7 +2,7 @@
# AFL dictionary for GIF images
# -----------------------------
#
# Created by Michal Zalewski <lcamtuf@google.com>
# Created by Michal Zalewski
#
header_87a="87a"

373
dictionaries/graphviz.dict Normal file
View File

@ -0,0 +1,373 @@
# Semi-manually curated list of interesting words within a graphviz input file.
# TODO(robhart): Consider expanding from:
# - htmllex.c
# - ?
# Not included exhaustive list of colortables, fontnames, etc. that are unlikely
# to influence core graphviz behaviour.
# Attributes (from http://www.graphviz.org/doc/info/attrs.html)
"Damping"
"K"
"URL"
"_background"
"area"
"arrowhead"
"arrowsize"
"arrowtail"
"bb"
"bgcolor"
"colorList"
"center"
"charset"
"clusterrank"
"color"
"colorList"
"colorscheme"
"comment"
"compound"
"concentrate"
"constraint"
"decorate"
"defaultdist"
"dim"
"dimen"
"dir"
"diredgeconstraints"
"distortion"
"dpi"
"edgeURL"
"edgehref"
"edgetarget"
"edgetooltip"
"epsilon"
"esep"
"fillcolor"
"fixedsize"
"fontcolor"
"fontname"
"fontnames"
"fontpath"
"fontsize"
"forcelabels"
"gradientangle"
"group"
"headURL"
"head_lp"
"headclip"
"headhref"
"headlabel"
"headport"
"headtarget"
"headtooltip"
"height"
"href"
"id"
"image"
"imagepath"
"imagescale"
"inputscale"
"label"
"labelURL"
"label_scheme"
"labelangle"
"labeldistance"
"labelfloat"
"labelfontcolor"
"labelfontname"
"labelfontsize"
"labelhref"
"labeljust"
"labelloc"
"labeltarget"
"labeltooltip"
"landscape"
"layer"
"layerlistsep"
"layers"
"layerselect"
"layersep"
"layout"
"len"
"levels"
"levelsgap"
"lhead"
"lheight"
"lp"
"ltail"
"lwidth"
"margin"
"maxiter"
"mclimit"
"mindist"
"minlen"
"mode"
"model"
"mosek"
"newrank"
"nodesep"
"nojustify"
"normalize"
"notranslate"
"nslimit "
"nslimit1"
"ordering"
"orientation"
"OrientationGraph"
"outputorder"
"overlap"
"overlap_scaling"
"overlap_shrink"
"pack"
"packmode"
"pad"
"point"
"page"
"point"
"pagedir"
"pencolor"
"penwidth"
"peripheries"
"pin"
"pos"
"splineType"
"quadtree"
"quantum"
"rank"
"rankdir"
"ranksep"
"ratio"
"string"
"rects"
"regular"
"remincross"
"RemoveOverlaps"
"repulsiveforce"
"resolution"
"root"
"rotate"
"rotation"
"samehead"
"sametail"
"samplepoints"
"scale"
"searchsize"
"sep"
"setlinewidth"
"shape"
"shapefile"
"showboxes"
"sides"
"size"
"skew"
"smoothing"
"sortv"
"splines"
"string"
"start"
"style"
"stylesheet"
"tailURL"
"tail_lp"
"tailclip"
"tailhref"
"taillabel"
"tailport"
"tailtarget"
"tailtooltip"
"target"
"tooltip"
"truecolor"
"vertices"
"viewport"
"voro_margin"
"weight"
"width"
"xdotversion"
"xlabel"
"xlp"
"z"
# Shapes (from shapes.c)
"box"
"polygon"
"ellipse"
"oval"
"circle"
"point"
"egg"
"triangle"
"none"
"plaintext"
"plain"
"diamond"
"trapezium"
"parallelogram"
"house"
"pentagon"
"hexagon"
"septagon"
"octagon"
"note"
"tab"
"folder"
"box3d"
"component"
"cylinder"
"rect"
"rectangle"
"square"
"doublecircle"
"doubleoctagon"
"tripleoctagon"
"invtriangle"
"invtrapezium"
"invhouse"
"underline"
"Mdiamond"
"Msquare"
"Mcircle"
"DotGraphs"
"promoter"
"cds"
"terminator"
"utr"
"insulator"
"ribosite"
"rnastab"
"proteasesite"
"proteinstab"
"primersite"
"restrictionsite"
"fivepoverhang"
"threepoverhang"
"noverhang"
"assembly"
"signature"
"rpromoter"
"larrow"
"rarrow"
"lpromoter"
"record"
"Mrecord"
"epsf"
"star"
# styles
"bold"
"dashed"
"diagonals"
"dotted"
"filled"
"invis"
"radial"
"rounded"
"solid"
"striped"
"tapered"
"wedged"
# misc -- https://graphviz.gitlab.io/_pages/doc/info/lang.html
"node"
"edge"
"digraph"
"subgraph"
"strict"
"same"
"->"
"--"
" {A B} "
" a -- b "
# Special value for the "shape" attribute
"epsf"
# html
"=\""
"<table"
"<tr"
"<td"
"<font"
"<br"
"<img"
"<i"
"<b"
"<u"
"<o"
"<sub"
"<sup"
"<s"
"<hr"
"<vr"
# html attributes
"align"
"balign"
"bgcolor"
"border"
"cellborder"
"cellpadding"
"cellspacing"
"color"
"colspan"
"columns"
"face"
"fixedsize"
"gradientangle"
"height"
"href"
"id"
"point-size"
"port"
"rows"
"rowspan"
"scale"
"sides"
"src"
"style"
"target"
"title"
"tooltip"
"valign"
"width"
# arrow spaces
"box"
"crow"
"curve"
"icurve"
"diamond"
"dot"
"inv"
"none"
"normal"
"tee"
"vee"
# Examples of parameters
"%f"
"50,50,.5,'2.8 BSD'"
"100,100,2,450,-1"
"none"
"avg_dist"
"graph_dist"
"power_dist"
"rng"
"spring"
"triangle"
"same"
"min"
"source"
"max"
"sink"
"node"
"clust"
"graph"
"array_flags"
"%2x"
"%s"
"%99$p"
"%n"

76
dictionaries/heif.dict Normal file
View File

@ -0,0 +1,76 @@
# https://standards.iso.org/ittf/PubliclyAvailableStandards/c066067_ISO_IEC_23008-12_2017.zip
"altr"
"auxC"
"auxc"
"auxi"
"auxv"
"avcC"
"avci"
"avcs"
"ccst"
"cdsc"
"clap"
"colr"
"dimg"
"dinf"
"dref"
"elst"
"equi"
"free"
"frma"
"ftyp"
"grid"
"grp1"
"hdlr"
"heic"
"heim"
"heis"
"heix"
"hevc"
"hevx"
"hvc1"
"hvc2"
"hvcC"
"idat"
"iden"
"iinf"
"iloc"
"imir"
"infe"
"iovl"
"ipro"
"iprp"
"iref"
"irot"
"ispe"
"jpeg"
"jpgC"
"jpgs"
"lhv1"
"lhvC"
"lsel"
"mdat"
"meta"
"mif1"
"mime"
"mjpg"
"msf1"
"oinf"
"pasp"
"pict"
"pitm"
"pixi"
"refs"
"rloc"
"schi"
"schm"
"sgpd"
"sinf"
"skip"
"stsz"
"subs"
"thmb"
"tkhd"
"tols"
"trak"

View File

@ -0,0 +1,49 @@
asterisk="*"
attr_generic=" a=\"1\""
attr_href=" href=\"1\""
attr_xml_lang=" xml:lang=\"1\""
attr_xmlns=" xmlns=\"1\""
backslash="\\"
backtick="`"
colon=":"
dashes="---"
double_quote="\""
entity_builtin="&lt;"
entity_decimal="&#1;"
entity_external="&a;"
entity_hex="&#x1;"
equals="==="
exclamation="!"
greater_than=">"
hash="#"
hyphen="-"
indent=" "
left_bracket="["
left_paren="("
less_than="<"
plus="+"
right_bracket="]"
right_paren=")"
single_quote="'"
string_any="ANY"
string_brackets="[]"
string_cdata="CDATA"
string_dashes="--"
string_empty_dblquotes="\"\""
string_empty_quotes="''"
string_idrefs="IDREFS"
string_parentheses="()"
string_pcdata="#PCDATA"
tag_cdata="<![CDATA["
tag_close="</a>"
tag_doctype="<!DOCTYPE"
tag_element="<!ELEMENT"
tag_entity="<!ENTITY"
tag_notation="<!NOTATION"
tag_open="<a>"
tag_open_close="<a />"
tag_open_exclamation="<!"
tag_open_q="<?"
tag_sq2_close="]]>"
tag_xml_q="<?xml?>"
underscore="_"

View File

@ -5,7 +5,7 @@
# A basic collection of HTML tags likely to matter to HTML parsers. Does *not*
# include any attributes or attribute values.
#
# Created by Michal Zalewski <lcamtuf@google.com>
# Created by Michal Zalewski
#
tag_a="<a>"

119
dictionaries/http.dict Normal file
View File

@ -0,0 +1,119 @@
# Sources: https://en.wikipedia.org/wiki/List_of_HTTP_header_fields
# misc
"HTTP/1.1"
# verbs
"CONNECT"
"DELETE"
"GET"
"HEAD"
"OPTIONS"
"PATCH"
"POST"
"PUT"
"TRACE"
# Fields
"A-IM"
"Accept"
"Accept-Charset"
"Accept-Datetime"
"Accept-Encoding"
"Accept-Language"
"Accept-Patch"
"Accept-Ranges"
"Access-Control-Allow-Credentials"
"Access-Control-Allow-Headers"
"Access-Control-Allow-Methods"
"Access-Control-Allow-Origin"
"Access-Control-Expose-Headers"
"Access-Control-Max-Age"
"Access-Control-Request-Headers"
"Access-Control-Request-Method"
"Age"
"Allow"
"Alt-Svc"
"Authorization"
"Cache-Control"
"Connection"
"Connection:"
"Content-Disposition"
"Content-Encoding"
"Content-Language"
"Content-Length"
"Content-Location"
"Content-MD5"
"Content-Range"
"Content-Security-Policy"
"Content-Type"
"Cookie"
"DNT"
"Date"
"Delta-Base"
"ETag"
"Expect"
"Expires"
"Forwarded"
"From"
"Front-End-Https"
"HTTP2-Settings"
"Host"
"IM"
"If-Match"
"If-Modified-Since"
"If-None-Match"
"If-Range"
"If-Unmodified-Since"
"Last-Modified"
"Link"
"Location"
"Max-Forwards"
"Origin"
"P3P"
"Pragma"
"Proxy-Authenticate"
"Proxy-Authorization"
"Proxy-Connection"
"Public-Key-Pins"
"Range"
"Referer"
"Refresh"
"Retry-After"
"Save-Data"
"Server"
"Set-Cookie"
"Status"
"Strict-Transport-Security"
"TE"
"Timing-Allow-Origin"
"Tk"
"Trailer"
"Transfer-Encoding"
"Upgrade"
"Upgrade-Insecure-Requests"
"User-Agent"
"Vary"
"Via"
"WWW-Authenticate"
"Warning"
"X-ATT-DeviceId"
"X-Content-Duration"
"X-Content-Security-Policy"
"X-Content-Type-Options"
"X-Correlation-ID"
"X-Csrf-Token"
"X-Forwarded-For"
"X-Forwarded-Host"
"X-Forwarded-Proto"
"X-Frame-Options"
"X-Http-Method-Override"
"X-Powered-By"
"X-Request-ID"
"X-Requested-With"
"X-UA-Compatible"
"X-UIDH"
"X-Wap-Profile"
"X-WebKit-CSP"
"X-XSS-Protection"

591
dictionaries/icc.dict Normal file
View File

@ -0,0 +1,591 @@
# See http://www.color.org/specification/ICC.2-2019.pdf
magic="acsp"
# spectral encoding
"rs"
"ts"
"es"
"bs"
"sm"
"mc"
# Profile classes
"scnr"
"mntr"
"prtr"
"link"
"spac"
"abst"
"nmcl"
"cenc"
"mod "
"mlnk"
"mvis"
# Data colour space field
"XYZ "
"Lab "
"Luv "
"YVbr"
"Yxy "
"LMS "
"RGB "
"GRAY"
"HSV "
"HLS "
"CMYK"
"CMY "
"2CLR"
"3CLR"
"4CLR"
"5CLR"
"6CLR"
"7CLR"
"8CLR"
"9CLR"
"ACLR"
"BCLR"
"CCLR"
"DCLR"
"ECLR"
"FCLR"
"nc"
"YCC"
# primary platforms
"APPL"
"MSFT"
"SGI "
"SUNW"
# Tags
"A2B0"
"A2B1"
"A2B2"
"A2B3"
"A2M0"
"bcp0"
"bcp1"
"bcp2"
"bcp3"
"bsp0"
"bsp1"
"bsp2"
"bsp3"
"bAB0"
"bAB1"
"bAB2"
"bAB3"
"bBA0"
"bBA1"
"bBA2"
"bBA3"
"bBD0"
"bBD1"
"bBD2"
"bBD3"
"bDB0"
"bDB1"
"bDB2"
"bDB3"
"bMB0"
"bMB1"
"bMB2"
"bMB3"
"bMS0"
"bMS1"
"bMS2"
"bMS3"
"B2A0"
"B2A1"
"B2A2"
"B2A3"
"B2D0"
"B2D1"
"B2D2"
"B2D3"
"calt"
"targ"
"cept"
"csnm"
"clro"
"cloo"
"clin"
"clio"
"ciis"
"cprt"
"c2sp"
"cxF "
"dmnd"
"dmdd"
"dAB0"
"dAB2"
"dAB3"
"dAB4"
"dBA0"
"dBA1"
"dBA2"
"dBA3"
"dBD0"
"dBD1"
"dBD2"
"dBD3"
"dDB0"
"dDB1"
"dDB2"
"dDB3"
"d2B0"
"d2B1"
"d2B2"
"d2B3"
"gbd0"
"gbd1"
"gbd2"
"gbd3"
"mdv "
"mcta"
"minf"
"miin"
"wtpt"
"meta"
"M2A0"
"M2B0"
"M2B1"
"M2B2"
"M2B3"
"M2S0"
"M2S1"
"M2S2"
"M2S3"
"nmcl"
"rig0"
"desc"
"psin"
"rfnm"
"rig2"
"svcn"
"swpt"
"s2cp"
"smap"
"tech"
# tag types
"clro"
"curv"
"data"
"dtim"
"dict"
"ehim"
"enim"
"fl16"
"fl32"
"fl64"
"gbd "
"mAB "
"mBA "
"meas"
"mluc"
"mpet"
"para"
"sf32"
"sig "
"smat"
"tary"
"tstr"
"ui32"
"ui64"
"ui08"
"ut16"
"utf8"
"zut8"
"zxml"
# Function operands
"calc"
"func"
"true"
"ndef"
"env "
"in "
"out "
"tget"
"tput"
"tsav"
"curv"
"mtx "
"clut"
"tint"
"elem"
"copy"
"rotl"
"rotr"
"posd"
"flip"
"pop "
"solv"
"tran"
"sum "
"prod"
"min "
"max "
"and "
"or "
"pi "
"+INF"
"-INF"
"NaN "
"add "
"sub "
"mul "
"dic "
"mod "
"pow "
"gama"
"sadd"
"ssub"
"sdiv"
"smul"
"sq "
"sqrt"
"cb "
"cbrt"
"abs "
"neg "
"rond"
"flor"
"ceil"
"trnc"
"sign"
"exp "
"log "
"ln "
"sin "
"cos "
"tan "
"asin"
"acos"
"atan"
"atn2"
"ctop"
"ptoc"
"rnum"
"lt "
"le "
"eq"
"near"
"ge "
"gt "
"vmin"
"vmax"
"vand"
"vor "
"tLab"
"tXYZ"
"if "
"else"
"sel "
"case"
"dflt"
"cvst"
"sngf"
"curf"
"parf"
"smaf"
"clut"
"eclt"
"emtx"
"eobs"
"xclt"
"iemx"
"JtoX"
"matf"
"smet"
"rclt"
"robs"
"tint"
"XtoJ"
"bACS"
"eACS"
"brdf"
"type"
"func"
"nump"
"xfrm"
"BPh0"
"BPh1"
"CT10"
"CT20"
"CT30"
"CT11"
"CT21"
"CT31"
"War0"
"War1"
"La10"
"La20"
"La30"
"La11"
"La21"
"La31"
"name"
"lcnm"
"pcs "
"spec"
"spcb"
"spcg"
"ncol"
"pinf"
# from oss-fuzz, some duplicates
# Fuzzing dictionary for icc
# Extracted from lcms2.h of Little-CMS project 2.8.
magic="acsp"
sig="lcms"
# Base ICC type definitions
"chrm"
"clro"
"clrt"
"crdi"
"curv"
"data"
"dict"
"dtim"
"devs"
"mft2"
"mft1"
"mAB "
"mBA "
"meas"
"mluc"
"mpet"
"ncol"
"ncl2"
"para"
"pseq"
"psid"
"rcs2"
"sf32"
"scrn"
"sig "
"text"
"desc"
"uf32"
"bfd "
"ui16"
"ui32"
"ui64"
"ui08"
"vcgt"
"view"
"XYZ "
# Base ICC tag definitions
"A2B0"
"A2B1"
"A2B2"
"bXYZ"
"bXYZ"
"bTRC"
"B2A0"
"B2A1"
"B2A2"
"calt"
"targ"
"chad"
"chrm"
"clro"
"clrt"
"clot"
"ciis"
"cprt"
"crdi"
"data"
"dtim"
"dmnd"
"dmdd"
"devs"
"D2B0"
"D2B1"
"D2B2"
"D2B3"
"B2D0"
"B2D1"
"B2D2"
"B2D3"
"gamt"
"kTRC"
"gXYZ"
"gXYZ"
"gTRC"
"lumi"
"meas"
"bkpt"
"wtpt"
"ncol"
"ncl2"
"resp"
"rig0"
"pre0"
"pre1"
"pre2"
"desc"
"dscm"
"pseq"
"psid"
"psd0"
"psd1"
"psd2"
"psd3"
"ps2s"
"ps2i"
"rXYZ"
"rXYZ"
"rTRC"
"rig2"
"scrd"
"scrn"
"tech"
"bfd "
"vued"
"view"
"vcgt"
"meta"
"arts"
# ICC Technology tag
"dcam"
"fscn"
"rscn"
"ijet"
"twax"
"epho"
"esta"
"dsub"
"rpho"
"fprn"
"vidm"
"vidc"
"pjtv"
"CRT "
"PMD "
"AMD "
"KPCD"
"imgs"
"grav"
"offs"
"silk"
"flex"
"mpfs"
"mpfr"
"dmpc"
"dcpj"
# ICC Color spaces
"XYZ "
"Lab "
"Luv "
"YCbr"
"Yxy "
"RGB "
"GRAY"
"HSV "
"HLS "
"CMYK"
"CMY "
"MCH1"
"MCH2"
"MCH3"
"MCH4"
"MCH5"
"MCH6"
"MCH7"
"MCH8"
"MCH9"
"MCHA"
"MCHB"
"MCHC"
"MCHD"
"MCHE"
"MCHF"
"nmcl"
"1CLR"
"2CLR"
"3CLR"
"4CLR"
"5CLR"
"6CLR"
"7CLR"
"8CLR"
"9CLR"
"ACLR"
"BCLR"
"CCLR"
"DCLR"
"ECLR"
"FCLR"
"LuvK"
# ICC Profile Class
"scnr"
"mntr"
"prtr"
"link"
"abst"
"spac"
"nmcl"
# ICC Platforms
"APPL"
"MSFT"
"SUNW"
"SGI "
"TGNT"
"*nix"
# Reference gamut
"prmg"
# For cmsSigColorimetricIntentImageStateTag
"scoe"
"sape"
"fpce"
"rhoc"
"rpoc"
# Multi process elements types
"cvst"
"matf"
"clut"
"bACS"
"eACS"
"l2x "
"x2l "
"ncl "
"2 4 "
"4 2 "
"idn "
"d2l "
"l2d "
"d2x "
"x2d "
"clp "
# Types of CurveElements
"parf"
"samf"
"curf"
# Used in ResponseCurveType
"StaA"
"StaE"
"StaI"
"StaT"
"StaM"
"DN "
"DN P"
"DNN "
"DNNP"

View File

@ -0,0 +1,25 @@
# Dict for ICC profiles parsed by skcms.
"mft1"
"mft2"
"mAB "
"rXYZ"
"gXYZ"
"bXYZ"
"rTRC"
"gTRC"
"bTRC"
"kTRC"
"A2B0"
"curv"
"para"
"mluc"
"XYZ "
"Lab "
"RGB "
"CMYK"
"GRAY"
"mntr"
"scnr"
"prtr"
"spac"

43
dictionaries/icns.dict Normal file
View File

@ -0,0 +1,43 @@
# https://en.wikipedia.org/wiki/Apple_Icon_Image_format
"ICN#"
"ICON"
"TOC "
"h8mk"
"ic04"
"ic05"
"ic07"
"ic08"
"ic09"
"ic10"
"ic11"
"ic12"
"ic13"
"ic14"
"ich#"
"ich4"
"ich8"
"icl4"
"icl8"
"icm#"
"icm4"
"icm8"
"icnV"
"icns"
"icp4"
"icp5"
"icp6"
"ics#"
"ics4"
"ics8"
"icsB"
"icsb"
"ih32"
"il32"
"info"
"is32"
"it32"
"l8mk"
"name"
"s8mk"
"t8mk"

688
dictionaries/initfile.dict Normal file
View File

@ -0,0 +1,688 @@
#SELECT WORD FROM INFORMATION_SCHEMA.KEYWORDS;
ACCESSIBLE="ACCESSIBLE"
ACCOUNT="ACCOUNT"
ACTION="ACTION"
ACTIVE="ACTIVE"
ADD="ADD"
ADMIN="ADMIN"
AFTER="AFTER"
AGAINST="AGAINST"
AGGREGATE="AGGREGATE"
ALGORITHM="ALGORITHM"
ALL="ALL"
ALTER="ALTER"
ALWAYS="ALWAYS"
ANALYZE="ANALYZE"
AND="AND"
ANY="ANY"
AS="AS"
ASC="ASC"
ASCII="ASCII"
ASENSITIVE="ASENSITIVE"
AT="AT"
AUTOEXTEND_SIZE="AUTOEXTEND_SIZE"
AUTO_INCREMENT="AUTO_INCREMENT"
AVG="AVG"
AVG_ROW_LENGTH="AVG_ROW_LENGTH"
BACKUP="BACKUP"
BEFORE="BEFORE"
BEGIN="BEGIN"
BETWEEN="BETWEEN"
BIGINT="BIGINT"
BINARY="BINARY"
BINLOG="BINLOG"
BIT="BIT"
BLOB="BLOB"
BLOCK="BLOCK"
BOOL="BOOL"
BOOLEAN="BOOLEAN"
BOTH="BOTH"
BTREE="BTREE"
BUCKETS="BUCKETS"
BY="BY"
BYTE="BYTE"
CACHE="CACHE"
CALL="CALL"
CASCADE="CASCADE"
CASCADED="CASCADED"
CASE="CASE"
CATALOG_NAME="CATALOG_NAME"
CHAIN="CHAIN"
CHANGE="CHANGE"
CHANGED="CHANGED"
CHANNEL="CHANNEL"
CHAR="CHAR"
CHARACTER="CHARACTER"
CHARSET="CHARSET"
CHECK="CHECK"
CHECKSUM="CHECKSUM"
CIPHER="CIPHER"
CLASS_ORIGIN="CLASS_ORIGIN"
CLIENT="CLIENT"
CLONE="CLONE"
CLOSE="CLOSE"
COALESCE="COALESCE"
CODE="CODE"
COLLATE="COLLATE"
COLLATION="COLLATION"
COLUMN="COLUMN"
COLUMNS="COLUMNS"
COLUMN_FORMAT="COLUMN_FORMAT"
COLUMN_NAME="COLUMN_NAME"
COMMENT="COMMENT"
COMMIT="COMMIT"
COMMITTED="COMMITTED"
COMPACT="COMPACT"
COMPLETION="COMPLETION"
COMPONENT="COMPONENT"
COMPRESSED="COMPRESSED"
COMPRESSION="COMPRESSION"
CONCURRENT="CONCURRENT"
CONDITION="CONDITION"
CONNECTION="CONNECTION"
CONSISTENT="CONSISTENT"
CONSTRAINT="CONSTRAINT"
CONSTRAINT_CATALOG="CONSTRAINT_CATALOG"
CONSTRAINT_NAME="CONSTRAINT_NAME"
CONSTRAINT_SCHEMA="CONSTRAINT_SCHEMA"
CONTAINS="CONTAINS"
CONTEXT="CONTEXT"
CONTINUE="CONTINUE"
CONVERT="CONVERT"
CPU="CPU"
CREATE="CREATE"
CROSS="CROSS"
CUBE="CUBE"
CUME_DIST="CUME_DIST"
CURRENT="CURRENT"
CURRENT_DATE="CURRENT_DATE"
CURRENT_TIME="CURRENT_TIME"
CURRENT_TIMESTAMP="CURRENT_TIMESTAMP"
CURRENT_USER="CURRENT_USER"
CURSOR="CURSOR"
CURSOR_NAME="CURSOR_NAME"
DATA="DATA"
DATABASE="DATABASE"
DATABASES="DATABASES"
DATAFILE="DATAFILE"
DATE="DATE"
DATETIME="DATETIME"
DAY="DAY"
DAY_HOUR="DAY_HOUR"
DAY_MICROSECOND="DAY_MICROSECOND"
DAY_MINUTE="DAY_MINUTE"
DAY_SECOND="DAY_SECOND"
DEALLOCATE="DEALLOCATE"
DEC="DEC"
DECIMAL="DECIMAL"
DECLARE="DECLARE"
DEFAULT="DEFAULT"
DEFAULT_AUTH="DEFAULT_AUTH"
DEFINER="DEFINER"
DEFINITION="DEFINITION"
DELAYED="DELAYED"
DELAY_KEY_WRITE="DELAY_KEY_WRITE"
DELETE="DELETE"
DENSE_RANK="DENSE_RANK"
DESC="DESC"
DESCRIBE="DESCRIBE"
DESCRIPTION="DESCRIPTION"
DETERMINISTIC="DETERMINISTIC"
DIAGNOSTICS="DIAGNOSTICS"
DIRECTORY="DIRECTORY"
DISABLE="DISABLE"
DISCARD="DISCARD"
DISK="DISK"
DISTINCT="DISTINCT"
DISTINCTROW="DISTINCTROW"
DIV="DIV"
DO="DO"
DOUBLE="DOUBLE"
DROP="DROP"
DUAL="DUAL"
DUMPFILE="DUMPFILE"
DUPLICATE="DUPLICATE"
DYNAMIC="DYNAMIC"
EACH="EACH"
ELSE="ELSE"
ELSEIF="ELSEIF"
EMPTY="EMPTY"
ENABLE="ENABLE"
ENCLOSED="ENCLOSED"
ENCRYPTION="ENCRYPTION"
END="END"
ENDS="ENDS"
ENFORCED="ENFORCED"
ENGINE="ENGINE"
ENGINES="ENGINES"
ENUM="ENUM"
ERROR="ERROR"
ERRORS="ERRORS"
ESCAPE="ESCAPE"
ESCAPED="ESCAPED"
EVENT="EVENT"
EVENTS="EVENTS"
EVERY="EVERY"
EXCEPT="EXCEPT"
EXCHANGE="EXCHANGE"
EXCLUDE="EXCLUDE"
EXECUTE="EXECUTE"
EXISTS="EXISTS"
EXIT="EXIT"
EXPANSION="EXPANSION"
EXPIRE="EXPIRE"
EXPLAIN="EXPLAIN"
EXPORT="EXPORT"
EXTENDED="EXTENDED"
EXTENT_SIZE="EXTENT_SIZE"
FALSE="FALSE"
FAST="FAST"
FAULTS="FAULTS"
FETCH="FETCH"
FIELDS="FIELDS"
FILE="FILE"
FILE_BLOCK_SIZE="FILE_BLOCK_SIZE"
FILTER="FILTER"
FIRST="FIRST"
FIRST_VALUE="FIRST_VALUE"
FIXED="FIXED"
FLOAT="FLOAT"
FLOAT4="FLOAT4"
FLOAT8="FLOAT8"
FLUSH="FLUSH"
FOLLOWING="FOLLOWING"
FOLLOWS="FOLLOWS"
FOR="FOR"
FORCE="FORCE"
FOREIGN="FOREIGN"
FORMAT="FORMAT"
FOUND="FOUND"
FROM="FROM"
FULL="FULL"
FULLTEXT="FULLTEXT"
FUNCTION="FUNCTION"
GENERAL="GENERAL"
GENERATED="GENERATED"
GEOMCOLLECTION="GEOMCOLLECTION"
GEOMETRY="GEOMETRY"
GEOMETRYCOLLECTION="GEOMETRYCOLLECTION"
GET="GET"
GET_FORMAT="GET_FORMAT"
GET_MASTER_PUBLIC_KEY="GET_MASTER_PUBLIC_KEY"
GLOBAL="GLOBAL"
GRANT="GRANT"
GRANTS="GRANTS"
GROUP="GROUP"
GROUPING="GROUPING"
GROUPS="GROUPS"
GROUP_REPLICATION="GROUP_REPLICATION"
HANDLER="HANDLER"
HASH="HASH"
HAVING="HAVING"
HELP="HELP"
HIGH_PRIORITY="HIGH_PRIORITY"
HISTOGRAM="HISTOGRAM"
HISTORY="HISTORY"
HOST="HOST"
HOSTS="HOSTS"
HOUR="HOUR"
HOUR_MICROSECOND="HOUR_MICROSECOND"
HOUR_MINUTE="HOUR_MINUTE"
HOUR_SECOND="HOUR_SECOND"
IDENTIFIED="IDENTIFIED"
IF="IF"
IGNORE="IGNORE"
IGNORE_SERVER_IDS="IGNORE_SERVER_IDS"
IMPORT="IMPORT"
IN="IN"
INACTIVE="INACTIVE"
INDEX="INDEX"
INDEXES="INDEXES"
INFILE="INFILE"
INITIAL_SIZE="INITIAL_SIZE"
INNER="INNER"
INOUT="INOUT"
INSENSITIVE="INSENSITIVE"
INSERT="INSERT"
INSERT_METHOD="INSERT_METHOD"
INSTALL="INSTALL"
INSTANCE="INSTANCE"
INT="INT"
INT1="INT1"
INT2="INT2"
INT3="INT3"
INT4="INT4"
INT8="INT8"
INTEGER="INTEGER"
INTERVAL="INTERVAL"
INTO="INTO"
INVISIBLE="INVISIBLE"
INVOKER="INVOKER"
IO="IO"
IO_AFTER_GTIDS="IO_AFTER_GTIDS"
IO_BEFORE_GTIDS="IO_BEFORE_GTIDS"
IO_THREAD="IO_THREAD"
IPC="IPC"
IS="IS"
ISOLATION="ISOLATION"
ISSUER="ISSUER"
ITERATE="ITERATE"
JOIN="JOIN"
JSON="JSON"
JSON_TABLE="JSON_TABLE"
KEY="KEY"
KEYS="KEYS"
KEY_BLOCK_SIZE="KEY_BLOCK_SIZE"
KILL="KILL"
LAG="LAG"
LANGUAGE="LANGUAGE"
LAST="LAST"
LAST_VALUE="LAST_VALUE"
LATERAL="LATERAL"
LEAD="LEAD"
LEADING="LEADING"
LEAVE="LEAVE"
LEAVES="LEAVES"
LEFT="LEFT"
LESS="LESS"
LEVEL="LEVEL"
LIKE="LIKE"
LIMIT="LIMIT"
LINEAR="LINEAR"
LINES="LINES"
LINESTRING="LINESTRING"
LIST="LIST"
LOAD="LOAD"
LOCAL="LOCAL"
LOCALTIME="LOCALTIME"
LOCALTIMESTAMP="LOCALTIMESTAMP"
LOCK="LOCK"
LOCKED="LOCKED"
LOCKS="LOCKS"
LOGFILE="LOGFILE"
LOGS="LOGS"
LONG="LONG"
LONGBLOB="LONGBLOB"
LONGTEXT="LONGTEXT"
LOOP="LOOP"
LOW_PRIORITY="LOW_PRIORITY"
MASTER="MASTER"
MASTER_AUTO_POSITION="MASTER_AUTO_POSITION"
MASTER_BIND="MASTER_BIND"
MASTER_CONNECT_RETRY="MASTER_CONNECT_RETRY"
MASTER_DELAY="MASTER_DELAY"
MASTER_HEARTBEAT_PERIOD="MASTER_HEARTBEAT_PERIOD"
MASTER_HOST="MASTER_HOST"
MASTER_LOG_FILE="MASTER_LOG_FILE"
MASTER_LOG_POS="MASTER_LOG_POS"
MASTER_PASSWORD="MASTER_PASSWORD"
MASTER_PORT="MASTER_PORT"
MASTER_PUBLIC_KEY_PATH="MASTER_PUBLIC_KEY_PATH"
MASTER_RETRY_COUNT="MASTER_RETRY_COUNT"
MASTER_SERVER_ID="MASTER_SERVER_ID"
MASTER_SSL="MASTER_SSL"
MASTER_SSL_CA="MASTER_SSL_CA"
MASTER_SSL_CAPATH="MASTER_SSL_CAPATH"
MASTER_SSL_CERT="MASTER_SSL_CERT"
MASTER_SSL_CIPHER="MASTER_SSL_CIPHER"
MASTER_SSL_CRL="MASTER_SSL_CRL"
MASTER_SSL_CRLPATH="MASTER_SSL_CRLPATH"
MASTER_SSL_KEY="MASTER_SSL_KEY"
MASTER_SSL_VERIFY_SERVER_CERT="MASTER_SSL_VERIFY_SERVER_CERT"
MASTER_TLS_VERSION="MASTER_TLS_VERSION"
MASTER_USER="MASTER_USER"
MATCH="MATCH"
MAXVALUE="MAXVALUE"
MAX_CONNECTIONS_PER_HOUR="MAX_CONNECTIONS_PER_HOUR"
MAX_QUERIES_PER_HOUR="MAX_QUERIES_PER_HOUR"
MAX_ROWS="MAX_ROWS"
MAX_SIZE="MAX_SIZE"
MAX_UPDATES_PER_HOUR="MAX_UPDATES_PER_HOUR"
MAX_USER_CONNECTIONS="MAX_USER_CONNECTIONS"
MEDIUM="MEDIUM"
MEDIUMBLOB="MEDIUMBLOB"
MEDIUMINT="MEDIUMINT"
MEDIUMTEXT="MEDIUMTEXT"
MEMORY="MEMORY"
MERGE="MERGE"
MESSAGE_TEXT="MESSAGE_TEXT"
MICROSECOND="MICROSECOND"
MIDDLEINT="MIDDLEINT"
MIGRATE="MIGRATE"
MINUTE="MINUTE"
MINUTE_MICROSECOND="MINUTE_MICROSECOND"
MINUTE_SECOND="MINUTE_SECOND"
MIN_ROWS="MIN_ROWS"
MOD="MOD"
MODE="MODE"
MODIFIES="MODIFIES"
MODIFY="MODIFY"
MONTH="MONTH"
MULTILINESTRING="MULTILINESTRING"
MULTIPOINT="MULTIPOINT"
MULTIPOLYGON="MULTIPOLYGON"
MUTEX="MUTEX"
MYSQL_ERRNO="MYSQL_ERRNO"
NAME="NAME"
NAMES="NAMES"
NATIONAL="NATIONAL"
NATURAL="NATURAL"
NCHAR="NCHAR"
NDB="NDB"
NDBCLUSTER="NDBCLUSTER"
NESTED="NESTED"
NETWORK_NAMESPACE="NETWORK_NAMESPACE"
NEVER="NEVER"
NEW="NEW"
NEXT="NEXT"
NO="NO"
NODEGROUP="NODEGROUP"
NONE="NONE"
NOT="NOT"
NOWAIT="NOWAIT"
NO_WAIT="NO_WAIT"
NO_WRITE_TO_BINLOG="NO_WRITE_TO_BINLOG"
NTH_VALUE="NTH_VALUE"
NTILE="NTILE"
NULL="NULL"
NULLS="NULLS"
NUMBER="NUMBER"
NUMERIC="NUMERIC"
NVARCHAR="NVARCHAR"
OF="OF"
OFFSET="OFFSET"
OJ="OJ"
OLD="OLD"
ON="ON"
ONE="ONE"
ONLY="ONLY"
OPEN="OPEN"
OPTIMIZE="OPTIMIZE"
OPTIMIZER_COSTS="OPTIMIZER_COSTS"
OPTION="OPTION"
OPTIONAL="OPTIONAL"
OPTIONALLY="OPTIONALLY"
OPTIONS="OPTIONS"
OR="OR"
ORDER="ORDER"
ORDINALITY="ORDINALITY"
ORGANIZATION="ORGANIZATION"
OTHERS="OTHERS"
OUT="OUT"
OUTER="OUTER"
OUTFILE="OUTFILE"
OVER="OVER"
OWNER="OWNER"
PACK_KEYS="PACK_KEYS"
PAGE="PAGE"
PARSER="PARSER"
PARTIAL="PARTIAL"
PARTITION="PARTITION"
PARTITIONING="PARTITIONING"
PARTITIONS="PARTITIONS"
PASSWORD="PASSWORD"
PATH="PATH"
PERCENT_RANK="PERCENT_RANK"
PERSIST="PERSIST"
PERSIST_ONLY="PERSIST_ONLY"
PHASE="PHASE"
PLUGIN="PLUGIN"
PLUGINS="PLUGINS"
PLUGIN_DIR="PLUGIN_DIR"
POINT="POINT"
POLYGON="POLYGON"
PORT="PORT"
PRECEDES="PRECEDES"
PRECEDING="PRECEDING"
PRECISION="PRECISION"
PREPARE="PREPARE"
PRESERVE="PRESERVE"
PREV="PREV"
PRIMARY="PRIMARY"
PRIVILEGES="PRIVILEGES"
PROCEDURE="PROCEDURE"
PROCESS="PROCESS"
PROCESSLIST="PROCESSLIST"
PROFILE="PROFILE"
PROFILES="PROFILES"
PROXY="PROXY"
PURGE="PURGE"
QUARTER="QUARTER"
QUERY="QUERY"
QUICK="QUICK"
RANGE="RANGE"
RANK="RANK"
READ="READ"
READS="READS"
READ_ONLY="READ_ONLY"
READ_WRITE="READ_WRITE"
REAL="REAL"
REBUILD="REBUILD"
RECOVER="RECOVER"
RECURSIVE="RECURSIVE"
REDO_BUFFER_SIZE="REDO_BUFFER_SIZE"
REDUNDANT="REDUNDANT"
REFERENCE="REFERENCE"
REFERENCES="REFERENCES"
REGEXP="REGEXP"
RELAY="RELAY"
RELAYLOG="RELAYLOG"
RELAY_LOG_FILE="RELAY_LOG_FILE"
RELAY_LOG_POS="RELAY_LOG_POS"
RELAY_THREAD="RELAY_THREAD"
RELEASE="RELEASE"
RELOAD="RELOAD"
REMOVE="REMOVE"
RENAME="RENAME"
REORGANIZE="REORGANIZE"
REPAIR="REPAIR"
REPEAT="REPEAT"
REPEATABLE="REPEATABLE"
REPLACE="REPLACE"
REPLICATE_DO_DB="REPLICATE_DO_DB"
REPLICATE_DO_TABLE="REPLICATE_DO_TABLE"
REPLICATE_IGNORE_DB="REPLICATE_IGNORE_DB"
REPLICATE_IGNORE_TABLE="REPLICATE_IGNORE_TABLE"
REPLICATE_REWRITE_DB="REPLICATE_REWRITE_DB"
REPLICATE_WILD_DO_TABLE="REPLICATE_WILD_DO_TABLE"
REPLICATE_WILD_IGNORE_TABLE="REPLICATE_WILD_IGNORE_TABLE"
REPLICATION="REPLICATION"
REQUIRE="REQUIRE"
RESET="RESET"
RESIGNAL="RESIGNAL"
RESOURCE="RESOURCE"
RESPECT="RESPECT"
RESTART="RESTART"
RESTORE="RESTORE"
RESTRICT="RESTRICT"
RESUME="RESUME"
RETAIN="RETAIN"
RETURN="RETURN"
RETURNED_SQLSTATE="RETURNED_SQLSTATE"
RETURNS="RETURNS"
REUSE="REUSE"
REVERSE="REVERSE"
REVOKE="REVOKE"
RIGHT="RIGHT"
RLIKE="RLIKE"
ROLE="ROLE"
ROLLBACK="ROLLBACK"
ROLLUP="ROLLUP"
ROTATE="ROTATE"
ROUTINE="ROUTINE"
ROW="ROW"
ROWS="ROWS"
ROW_COUNT="ROW_COUNT"
ROW_FORMAT="ROW_FORMAT"
ROW_NUMBER="ROW_NUMBER"
RTREE="RTREE"
SAVEPOINT="SAVEPOINT"
SCHEDULE="SCHEDULE"
SCHEMA="SCHEMA"
SCHEMAS="SCHEMAS"
SCHEMA_NAME="SCHEMA_NAME"
SECOND="SECOND"
SECONDARY="SECONDARY"
SECONDARY_ENGINE="SECONDARY_ENGINE"
SECONDARY_LOAD="SECONDARY_LOAD"
SECONDARY_UNLOAD="SECONDARY_UNLOAD"
SECOND_MICROSECOND="SECOND_MICROSECOND"
SECURITY="SECURITY"
SELECT="SELECT"
SENSITIVE="SENSITIVE"
SEPARATOR="SEPARATOR"
SERIAL="SERIAL"
SERIALIZABLE="SERIALIZABLE"
SERVER="SERVER"
SESSION="SESSION"
SET="SET"
SHARE="SHARE"
SHOW="SHOW"
SHUTDOWN="SHUTDOWN"
SIGNAL="SIGNAL"
SIGNED="SIGNED"
SIMPLE="SIMPLE"
SKIP="SKIP"
SLAVE="SLAVE"
SLOW="SLOW"
SMALLINT="SMALLINT"
SNAPSHOT="SNAPSHOT"
SOCKET="SOCKET"
SOME="SOME"
SONAME="SONAME"
SOUNDS="SOUNDS"
SOURCE="SOURCE"
SPATIAL="SPATIAL"
SPECIFIC="SPECIFIC"
SQL="SQL"
SQLEXCEPTION="SQLEXCEPTION"
SQLSTATE="SQLSTATE"
SQLWARNING="SQLWARNING"
SQL_AFTER_GTIDS="SQL_AFTER_GTIDS"
SQL_AFTER_MTS_GAPS="SQL_AFTER_MTS_GAPS"
SQL_BEFORE_GTIDS="SQL_BEFORE_GTIDS"
SQL_BIG_RESULT="SQL_BIG_RESULT"
SQL_BUFFER_RESULT="SQL_BUFFER_RESULT"
SQL_CALC_FOUND_ROWS="SQL_CALC_FOUND_ROWS"
SQL_NO_CACHE="SQL_NO_CACHE"
SQL_SMALL_RESULT="SQL_SMALL_RESULT"
SQL_THREAD="SQL_THREAD"
SQL_TSI_DAY="SQL_TSI_DAY"
SQL_TSI_HOUR="SQL_TSI_HOUR"
SQL_TSI_MINUTE="SQL_TSI_MINUTE"
SQL_TSI_MONTH="SQL_TSI_MONTH"
SQL_TSI_QUARTER="SQL_TSI_QUARTER"
SQL_TSI_SECOND="SQL_TSI_SECOND"
SQL_TSI_WEEK="SQL_TSI_WEEK"
SQL_TSI_YEAR="SQL_TSI_YEAR"
SRID="SRID"
SSL="SSL"
STACKED="STACKED"
START="START"
STARTING="STARTING"
STARTS="STARTS"
STATS_AUTO_RECALC="STATS_AUTO_RECALC"
STATS_PERSISTENT="STATS_PERSISTENT"
STATS_SAMPLE_PAGES="STATS_SAMPLE_PAGES"
STATUS="STATUS"
STOP="STOP"
STORAGE="STORAGE"
STORED="STORED"
STRAIGHT_JOIN="STRAIGHT_JOIN"
STRING="STRING"
SUBCLASS_ORIGIN="SUBCLASS_ORIGIN"
SUBJECT="SUBJECT"
SUBPARTITION="SUBPARTITION"
SUBPARTITIONS="SUBPARTITIONS"
SUPER="SUPER"
SUSPEND="SUSPEND"
SWAPS="SWAPS"
SWITCHES="SWITCHES"
SYSTEM="SYSTEM"
TABLE="TABLE"
TABLES="TABLES"
TABLESPACE="TABLESPACE"
TABLE_CHECKSUM="TABLE_CHECKSUM"
TABLE_NAME="TABLE_NAME"
TEMPORARY="TEMPORARY"
TEMPTABLE="TEMPTABLE"
TERMINATED="TERMINATED"
TEXT="TEXT"
THAN="THAN"
THEN="THEN"
THREAD_PRIORITY="THREAD_PRIORITY"
TIES="TIES"
TIME="TIME"
TIMESTAMP="TIMESTAMP"
TIMESTAMPADD="TIMESTAMPADD"
TIMESTAMPDIFF="TIMESTAMPDIFF"
TINYBLOB="TINYBLOB"
TINYINT="TINYINT"
TINYTEXT="TINYTEXT"
TO="TO"
TRAILING="TRAILING"
TRANSACTION="TRANSACTION"
TRIGGER="TRIGGER"
TRIGGERS="TRIGGERS"
TRUE="TRUE"
TRUNCATE="TRUNCATE"
TYPE="TYPE"
TYPES="TYPES"
UNBOUNDED="UNBOUNDED"
UNCOMMITTED="UNCOMMITTED"
UNDEFINED="UNDEFINED"
UNDO="UNDO"
UNDOFILE="UNDOFILE"
UNDO_BUFFER_SIZE="UNDO_BUFFER_SIZE"
UNICODE="UNICODE"
UNINSTALL="UNINSTALL"
UNION="UNION"
UNIQUE="UNIQUE"
UNKNOWN="UNKNOWN"
UNLOCK="UNLOCK"
UNSIGNED="UNSIGNED"
UNTIL="UNTIL"
UPDATE="UPDATE"
UPGRADE="UPGRADE"
USAGE="USAGE"
USE="USE"
USER="USER"
USER_RESOURCES="USER_RESOURCES"
USE_FRM="USE_FRM"
USING="USING"
UTC_DATE="UTC_DATE"
UTC_TIME="UTC_TIME"
UTC_TIMESTAMP="UTC_TIMESTAMP"
VALIDATION="VALIDATION"
VALUE="VALUE"
VALUES="VALUES"
VARBINARY="VARBINARY"
VARCHAR="VARCHAR"
VARCHARACTER="VARCHARACTER"
VARIABLES="VARIABLES"
VARYING="VARYING"
VCPU="VCPU"
VIEW="VIEW"
VIRTUAL="VIRTUAL"
VISIBLE="VISIBLE"
WAIT="WAIT"
WARNINGS="WARNINGS"
WEEK="WEEK"
WEIGHT_STRING="WEIGHT_STRING"
WHEN="WHEN"
WHERE="WHERE"
WHILE="WHILE"
WINDOW="WINDOW"
WITH="WITH"
WITHOUT="WITHOUT"
WORK="WORK"
WRAPPER="WRAPPER"
WRITE="WRITE"
X509="X509"
XA="XA"
XID="XID"
XML="XML"
XOR="XOR"
YEAR="YEAR"
YEAR_MONTH="YEAR_MONTH"
ZEROFILL="ZEROFILL"

98
dictionaries/jbig2.dict Normal file
View File

@ -0,0 +1,98 @@
# AFL dictionary for jbig2 images
# by Sebastian Rasmussen <sebras@gmail.com>
id_string="\x97\x4a\x42\x32\x0d\x0a\x1a\x0a"
# segments
noretain_allpages_symbol_dictionary="\x00"
noretain_allpages_intermediate_text_region="\x04"
noretain_allpages_immediate_text_region="\x06"
noretain_allpages_immediate_lossless_text_region="\x07"
noretain_allpages_pattern_dictionary="\x10"
noretain_allpages_intermediate_halftone_region="\x14"
noretain_allpages_immediate_halftone_region="\x16"
noretain_allpages_immediate_lossless_halftone_region="\x17"
noretain_allpages_intermediate_generic_region="\x24"
noretain_allpages_immediate_generic_region="\x26"
noretain_allpages_immediate_lossless_generic_region="\x27"
noretain_allpages_intermediate_generic_refinement_region="\x28"
noretain_allpages_immediate_generic_refinement_region="\x2a"
noretain_allpages_immediate_lossless_generic_refinement_region="\x2b"
noretain_allpages_page_information="\x30"
noretain_allpages_end_of_page="\x31"
noretain_allpages_end_of_stripe="\x32"
noretain_allpages_end_of_file="\x33"
noretain_allpages_profiles="\x34"
noretain_allpages_tables="\x35"
noretain_allpages_color_palette="\x36"
noretain_allpages_extension="\x3e"
noretain_specificpage_symbol_dictionary="\x40"
noretain_specificpage_intermediate_text_region="\x44"
noretain_specificpage_immediate_text_region="\x46"
noretain_specificpage_immediate_lossless_text_region="\x47"
noretain_specificpage_pattern_dictionary="\x50"
noretain_specificpage_intermediate_halftone_region="\x54"
noretain_specificpage_immediate_halftone_region="\x56"
noretain_specificpage_immediate_lossless_halftone_region="\x57"
noretain_specificpage_intermediate_generic_region="\x64"
noretain_specificpage_immediate_generic_region="\x66"
noretain_specificpage_immediate_lossless_generic_region="\x67"
noretain_specificpage_intermediate_generic_refinement_region="\x68"
noretain_specificpage_immediate_generic_refinement_region="\x6a"
noretain_specificpage_immediate_lossless_generic_refinement_regio6="\x6b"
noretain_specificpage_page_information="\x70"
noretain_specificpage_end_of_page="\x71"
noretain_specificpage_end_of_stripe="\x72"
noretain_specificpage_end_of_file="\x73"
noretain_specificpage_profiles="\x74"
noretain_specificpage_tables="\x75"
noretain_specificpage_color_palette="\x76"
noretain_specificpage_extension="\x7e"
retain_allpages_symbol_dictionary="\x80"
retain_allpages_intermediate_text_region="\x84"
retain_allpages_immediate_text_region="\x86"
retain_allpages_immediate_lossless_text_region="\x87"
retain_allpages_pattern_dictionary="\x90"
retain_allpages_intermediate_halftone_region="\x94"
retain_allpages_immediate_halftone_region="\x96"
retain_allpages_immediate_lossless_halftone_region="\x97"
retain_allpages_intermediate_generic_region="\xa4"
retain_allpages_immediate_generic_region="\xa6"
retain_allpages_immediate_lossless_generic_region="\xa7"
retain_allpages_intermediate_generic_refinement_region="\xa8"
retain_allpages_immediate_generic_refinement_region="\xaa"
retain_allpages_immediate_lossless_generic_refinement_regio6="\xab"
retain_allpages_page_information="\xb0"
retain_allpages_end_of_page="\xb1"
retain_allpages_end_of_stripe="\xb2"
retain_allpages_end_of_file="\xb3"
retain_allpages_profiles="\xb4"
retain_allpages_tables="\xb5"
retain_allpages_color_palette="\xb6"
retain_allpages_extension="\xbe"
retain_specificpage_symbol_dictionary="\xc0"
retain_specificpage_intermediate_text_region="\xc4"
retain_specificpage_immediate_text_region="\xc6"
retain_specificpage_immediate_lossless_text_region="\xc7"
retain_specificpage_pattern_dictionary="\xd0"
retain_specificpage_intermediate_halftone_region="\xd4"
retain_specificpage_immediate_halftone_region="\xd6"
retain_specificpage_immediate_lossless_halftone_region="\xd7"
retain_specificpage_intermediate_generic_region="\xe4"
retain_specificpage_immediate_generic_region="\xe6"
retain_specificpage_immediate_lossless_generic_region="\xe7"
retain_specificpage_intermediate_generic_refinement_region="\xe8"
retain_specificpage_immediate_generic_refinement_region="\xea"
retain_specificpage_immediate_lossless_generic_refinement_regio6="\xeb"
retain_specificpage_page_information="\xf0"
retain_specificpage_end_of_page="\xf1"
retain_specificpage_end_of_stripe="\xf2"
retain_specificpage_end_of_file="\xf3"
retain_specificpage_profiles="\xf4"
retain_specificpage_tables="\xf5"
retain_specificpage_color_palette="\xf6"
retain_specificpage_extension="\xfe"

View File

@ -2,7 +2,7 @@
# AFL dictionary for JPEG images
# ------------------------------
#
# Created by Michal Zalewski <lcamtuf@google.com>
# Created by Michal Zalewski
#
header_jfif="JFIF\x00"

View File

@ -0,0 +1,22 @@
type="jP "
ftyp="ftyp"
subtype1="jp2 "
subtype2="jp20"
subtype3="jpm "
subtype4="jpx "
subtype5="jp2h"
subtype6="jpxb"
subtype7="mjp2"
subtype8="mj2s"
subtype9="jp2c"
subtype10="jpch"
subtype11="jplh"
codestream="\xFF\x4F\xFF\x51"
signature="\x0d\x0a\x87\x0a"
tag1="hdr"
tag2="colr"
tag3="url"
tag4="req"
tag5="res"
tag6="page"
tag7="obj"

View File

@ -4,7 +4,7 @@
#
# Contains basic reserved keywords and syntax building blocks.
#
# Created by Michal Zalewski <lcamtuf@google.com>
# Created by Michal Zalewski
#
keyword_arguments="arguments"

View File

@ -50,3 +50,12 @@
"\"\":0"
"//"
"/**/"
"$ref"
"type"
"coordinates"
"@context"
"@id"
","
":"

60
dictionaries/jsonnet.dict Normal file
View File

@ -0,0 +1,60 @@
# https://jsonnet.org/ref/spec.html
# Keywords
"assert"
"else"
"error"
"false"
"for"
"function"
"if"
"import"
"importstr"
"in"
"local"
"null"
"self"
"super"
"tailstrict"
"then"
"true"
"super"
"local"
# operators
"|||"
"@\""
"@'"
"!="
"=="
"[::]"
"+:::"
# functions
"std.acos("
"std.asin("
"std.atan("
"std.ceil("
"std.char("
"std.codepoint("
"std.cos("
"std.equals("
"std.exp("
"std.exponent("
"std.floor("
"std.join("
"std.length("
"std.log("
"std.makeArray("
"std.mantissa("
"std.mod"
"std.modulo("
"std.objectFiledsEx("
"std.objectsHasEx("
"std.pow("
"std.primitiveEquals("
"std.sin("
"std.slice("
"std.sqrt("
"std.tan("
"std.type("

View File

@ -0,0 +1,28 @@
strike="~~"
list="2."
link="[a]("
link_without_ref="[a]["
image="![b]("
bold="**"
separator="---"
title="# "
fence="```"
link_bottom="[a]:"
link_inline="<http://"
link_bottom_title="[1]: http://a.com"
checklist="- [x"
toc="[TOC]"
highlight_rst=":::python"
# GFM - https://github.github.com/gfm/
"| ---"
leaf1="***"
leaf2="___"
code_hl="```html"
task="- [ ]"
# Extended syntax: https://www.markdownguide.org/extended-syntax/
footnote="[^a]"
title_id="#a {#b}"

20
dictionaries/math.dict Normal file
View File

@ -0,0 +1,20 @@
"{"
"}"
","
"["
"]"
","
":"
"e"
"e+"
"e-"
"E"
"E+"
"E-"
"\""
"\\"
" "
"null"
"1"
"1.234"
"3e4"

279
dictionaries/mathml.dict Normal file
View File

@ -0,0 +1,279 @@
#https://developer.mozilla.org/en-US/docs/Web/MathML/Element
# https://www.w3.org/TR/MathML3/chapter4.html
header="<math xmlns='http://www.w3.org/1998/Math/MathML'>"
# presentation mathml
"<annotation-xml>"
"<annotation>"
"<apply>"
"<maction>"
"<maligngroup>"
"<malignmark>"
"<math>"
"<menclose>"
"<merror>"
"<mfenced> "
"<mfrac>"
"<mglyph>"
"<mi>"
"<mlabeledtr>"
"<mlongdiv>"
"<mmultiscripts>"
"<mn>"
"<mo>"
"<mover>"
"<mpadded>"
"<mphantom>"
"<mprescripts>"
"<mroot>"
"<mrow>"
"<ms>"
"<mscarries>"
"<mscarry>"
"<msgroup>"
"<msline>"
"<mspace>"
"<msqrt>"
"<msrow>"
"<mstack>"
"<mstyle>"
"<msub>"
"<msubsup>"
"<msup>"
"<mtable>"
"<mtd>"
"<mtext>"
"<mtr>"
"<munder>"
"<munderover>"
"<none>"
"<semantics>"
# attributes
"accent"
"accentunder"
"actiontype"
"align"
"alignmentscope"
"altimg"
"altimg-height"
"alttext"
"bevelled"
"charalign"
"close"
"columnalign"
"columnlines"
"columnspacing"
"columnspan"
"columnwidth"
"crossout"
"decimalpoint"
"denomalign"
"depth"
"dir"
"display"
"displaystyle"
"edge"
"equalcolumns"
"equalrows"
"fence"
"form"
"frame"
"framespacing"
"groupalign"
"height"
"href"
"id"
"indentalign"
"indentalignfirst"
"indentalignlast"
"indentshift"
"indentshiftfirst"
"indentshiftlast"
"indenttarget"
"infixlinebreakstyle"
"largeop"
"length"
"linebreak"
"linebreakmultchar"
"linebreakstyle"
"lineleading"
"linethickness"
"location"
"longdivstyle"
"lquote"
"lspace"
"mathbackground"
"mathcolor"
"mathsize"
"mathvariant"
"maxsize"
"minlabelspacing"
"minsize"
"movablelimits"
"notation"
"numalign"
"open"
"overflow"
"position"
"rowalign"
"rowlines"
"rowspacing"
"rowspan"
"rquote"
"rspace"
"scriptlevel"
"scriptminsize"
"scriptsizemultiplier"
"selection"
"separator"
"separators"
"shift"
"side"
"src"
"stackalign"
"stretchy"
"subscriptshift"
"supscriptshift"
"symmetric"
"voffset"
"width"
"xlink:href"
"xmlns"
# content mathml
"<interval>"
"<inverse>"
"<lambda>"
"<compose/>"
"<ident/>"
"<domain/>"
"<codomain/>"
"<image/>"
"<piecewise>"
"<piece>"
"<otherwise>"
"<quotient/>"
"<factorial/>"
"<divide/>"
"<max/>"
"<min/>"
"<minus/>"
"<plus/>"
"<power/>"
"<rem/>"
"<times/>"
"<root/>"
"<gcd/>"
"<and/>"
"<or/>"
"<xor/>"
"<not/>"
"<implies/>"
"<forall/>"
"<exists/>"
"<abs/>"
"<conjugate/>"
"<arg/>"
"<real/>"
"<imaginary/>"
"<lcm/>"
"<floor/>"
"<ceiling/>"
"Relations"
"<eq/>"
"<neq/>"
"<gt/>"
"<lt/>"
"<geq/>"
"<leq/>"
"<equivalent/>"
"<approx/>"
"<factorof/>"
"<int/>"
"<diff/>"
"<partialdiff/>"
"<divergence/>"
"<grad/>"
"<curl/>"
"<laplacian/>"
"<set>"
"<list>"
"<union/>"
"<intersect/>"
"<in/>"
"<notin/>"
"<subset/>"
"<prsubset/>"
"<notsubset/>"
"<notprsubset/>"
"<setdiff/>"
"<card/>"
"<cartesianproduct/>"
"<sum/>"
"<product/>"
"<limit/>"
"<tendsto/>"
"<sin/>"
"<cos/>"
"<tan/>"
"<sec/>"
"<csc/>"
"<cot/>"
"<arcsin/>"
"<arccos/>"
"<arctan/>"
"<arcsec/>"
"<arccsc/>"
"<arccot/>"
"<sinh/>"
"<cosh/>"
"<tanh/>"
"<sech/>"
"<csch/>"
"<coth/>"
"<arcsinh/>"
"<arccosh/>"
"<arctanh/>"
"<arcsech/>"
"<arccsch/>"
"<arccoth/>"
"<exp/>"
"<ln/>"
"<log/>"
"<logbase>"
"<mean/>"
"<sdev/>"
"<variance/>"
"<median/>"
"<mode/>"
"<moment/>"
"<momentabout>"
"<vector>"
"<matrix>"
"<matrixrow>"
"<determinant/>"
"<transpose/>"
"<selector/>"
"<vectorproduct/>"
"<scalarproduct/>"
"<outerproduct/>"
"<integers/>"
"<reals/>"
"<rationals/>"
"<naturalnumbers/>"
"<complexes/>"
"<primes/>"
"<exponentiale/>"
"<imaginaryi/>"
"<notanumber/>"
"<true/>"
"<false/>"
"<emptyset/>"
"<pi/>"
"<eulergamma/>"
"<infinity/>"
"<declare>"
"<reln>"
"<fn>"

82
dictionaries/mp4.dict Normal file
View File

@ -0,0 +1,82 @@
# Taken from https://chromium.googlesource.com/chromium/src/+/master/media/test/mp4.dict
FOURCC_NULL="\x00\x00\x00\x00"
FOURCC_AC3 ="\x61\x63\x2d\x33"
FOURCC_EAC3="\x65\x63\x2d\x33"
FOURCC_AVC1="\x61\x76\x63\x31"
FOURCC_AVC3="\x61\x76\x63\x33"
FOURCC_AVCC="\x61\x76\x63\x43"
FOURCC_BLOC="\x62\x6C\x6F\x63"
FOURCC_CENC="\x63\x65\x6e\x63"
FOURCC_CO64="\x63\x6f\x36\x34"
FOURCC_CTTS="\x63\x74\x74\x73"
FOURCC_DINF="\x64\x69\x6e\x66"
FOURCC_EDTS="\x65\x64\x74\x73"
FOURCC_EMSG="\x65\x6d\x73\x67"
FOURCC_ELST="\x65\x6c\x73\x74"
FOURCC_ENCA="\x65\x6e\x63\x61"
FOURCC_ENCV="\x65\x6e\x63\x76"
FOURCC_ESDS="\x65\x73\x64\x73"
FOURCC_FREE="\x66\x72\x65\x65"
FOURCC_FRMA="\x66\x72\x6d\x61"
FOURCC_FTYP="\x66\x74\x79\x70"
FOURCC_HDLR="\x68\x64\x6c\x72"
FOURCC_HINT="\x68\x69\x6e\x74"
FOURCC_HVC1="\x68\x76\x63\x31"
FOURCC_HVCC="\x68\x76\x63\x43"
FOURCC_IODS="\x69\x6f\x64\x73"
FOURCC_MDAT="\x6d\x64\x61\x74"
FOURCC_MDHD="\x6d\x64\x68\x64"
FOURCC_MDIA="\x6d\x64\x69\x61"
FOURCC_MECO="\x6d\x65\x63\x6f"
FOURCC_MEHD="\x6d\x65\x68\x64"
FOURCC_META="\x6d\x65\x74\x61"
FOURCC_MFHD="\x6d\x66\x68\x64"
FOURCC_MFRA="\x6d\x66\x72\x61"
FOURCC_MINF="\x6d\x69\x6e\x66"
FOURCC_MOOF="\x6d\x6f\x6f\x66"
FOURCC_MOOV="\x6d\x6f\x6f\x76"
FOURCC_MP4A="\x6d\x70\x34\x61"
FOURCC_MP4V="\x6d\x70\x34\x76"
FOURCC_MVEX="\x6d\x76\x65\x78"
FOURCC_MVHD="\x6d\x76\x68\x64"
FOURCC_PASP="\x70\x61\x73\x70"
FOURCC_PDIN="\x70\x64\x69\x6e"
FOURCC_PRFT="\x70\x72\x66\x74"
FOURCC_PSSH="\x70\x73\x73\x68"
FOURCC_SAIO="\x73\x61\x69\x6f"
FOURCC_SAIZ="\x73\x61\x69\x7a"
FOURCC_SBGP="\x73\x62\x67\x70"
FOURCC_SCHI="\x73\x63\x68\x69"
FOURCC_SCHM="\x73\x63\x68\x6d"
FOURCC_SDTP="\x73\x64\x74\x70"
FOURCC_SEIG="\x73\x65\x69\x67"
FOURCC_SENC="\x73\x65\x6e\x63"
FOURCC_SGPD="\x73\x67\x70\x64"
FOURCC_SIDX="\x73\x69\x64\x78"
FOURCC_SINF="\x73\x69\x6e\x66"
FOURCC_SKIP="\x73\x6b\x69\x70"
FOURCC_SMHD="\x73\x6d\x68\x64"
FOURCC_SOUN="\x73\x6f\x75\x6e"
FOURCC_SSIX="\x73\x73\x69\x78"
FOURCC_STBL="\x73\x74\x62\x6c"
FOURCC_STCO="\x73\x74\x63\x6f"
FOURCC_STSC="\x73\x74\x73\x63"
FOURCC_STSD="\x73\x74\x73\x64"
FOURCC_STSS="\x73\x74\x73\x73"
FOURCC_STSZ="\x73\x74\x73\x7a"
FOURCC_STTS="\x73\x74\x74\x73"
FOURCC_STYP="\x73\x74\x79\x70"
FOURCC_TENC="\x74\x65\x6e\x63"
FOURCC_TFDT="\x74\x66\x64\x74"
FOURCC_TFHD="\x74\x66\x68\x64"
FOURCC_TKHD="\x74\x6b\x68\x64"
FOURCC_TRAF="\x74\x72\x61\x66"
FOURCC_TRAK="\x74\x72\x61\x6b"
FOURCC_TREX="\x74\x72\x65\x78"
FOURCC_TRUN="\x74\x72\x75\x6e"
FOURCC_UDTA="\x75\x64\x74\x61"
FOURCC_UUID="\x75\x75\x69\x64"
FOURCC_VIDE="\x76\x69\x64\x65"
FOURCC_VMHD="\x76\x6d\x68\x64"
FOURCC_WIDE="\x77\x69\x64\x65"

1
dictionaries/mysqld.dict Normal file
View File

@ -0,0 +1 @@
user="root"

36
dictionaries/ogg.dict Normal file
View File

@ -0,0 +1,36 @@
# https://xiph.org/vorbis/doc/Vorbis_I_spec.html
header="OggS"
# Codecs
"BBCD\x00"
"\x7fFLAC"
"\x80theora"
"\x01vorbis"
"CELT "
"CMML\x00\x00\x00\x00"
"\x8bJNG\x0d\x0a\x1a\x0a"
"\x80kate\x00\x00\x00"
"OggMIDI\x00"
"\x8aMNG\x0d\x0a\x1a\x0a"
"PCM "
"\x89PNG\x0d\x0a\x1a\x0a"
"Speex "
"YUV4MPEG"
# Metadata
"TITLE="
"VERSION="
"ALBUM="
"TRACKNUMBER="
"ARTIST="
"PERFORMER="
"COPYRIGHT="
"LICENSE="
"ORGANIZATION="
"DESCRIPTION="
"GENRE="
"DATE="
"LOCATION="
"CONTACT="
"ISRC="

57
dictionaries/openexr.dict Normal file
View File

@ -0,0 +1,57 @@
# specs:
# - https://www.openexr.com/documentation/openexrfilelayout.pdf
# - https://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/OpenEXR.html
lay="_lay"
ver="_ver"
adoptNeutral="AdoptNeutral"
altitude="altitude"
aperture="aperture"
box2f="box2f"
box2i="box2i"
capdate="capDate"
channels="channels"
chlist="chlist"
chromaticities="chromaticities"
comments="comments"
compression="compression"
dataWindow="dataWindow"
displayWindow="displayWindow"
double="double"
envmap="envmap"
expTime="expTime"
focus="focus"
framesPerSecond="framesPerSecond"
float="float"
header="\x76\x2F\x31\x01"
int="int"
isoSpeed="isoSpeed"
keycode="keyCode"
latitude="latitude"
lineOrder="lineOrder"
longitude="longitude"
lookModTransform="lookModTransform"
m33f="m33f"
m44f="m44f"
owner="owner"
pixelAspectRatio="pixelAspectRatio"
preview="preview"
renderingTransform="renderingTransform"
rational="rational"
screenWindowCenter="screenWindowCenter"
screenWindowWidth="screenWindowWidth"
string="string"
stringvector="stringvector"
tiles="tiles"
tiledesc="tileDesc"
timecode="timeCode"
utcOffset="itcOffset"
whiteLuminance="whiteLuminance"
worldToCamera="worldToCamera"
worldToNDC="worldToNDC"
v2f="v2f"
v2i="v2i"
v3f="v3f"
v3i="v3i"
wrapmodes="wrapmodes"
xDensity="xDensity"

963
dictionaries/otf.dict Normal file
View File

@ -0,0 +1,963 @@
# https://docs.microsoft.com/en-us/typography/opentype/spec/
# magic
"ttcf"
# feature tags
"aalt"
"abvf"
"abvm"
"abvs"
"afrc"
"akhn"
"blwf"
"blwm"
"blws"
"calt"
"case"
"ccmp"
"cfar"
"cjct"
"clig"
"cpct"
"cpsp"
"cswh"
"curs"
"cv01"
"c2pc"
"c2sc"
"dist"
"dlig"
"dnom"
"dtls"
"expt"
"falt"
"fin2"
"fin3"
"fina"
"flac"
"frac"
"fwid"
"half"
"haln"
"halt"
"hist"
"hkna"
"hlig"
"hngl"
"hojo"
"hwid"
"init"
"isol"
"ital"
"jalt"
"jp78"
"jp83"
"jp90"
"jp04"
"kern"
"lfbd"
"liga"
"ljmo"
"lnum"
"locl"
"ltra"
"ltrm"
"mark"
"med2"
"medi"
"mgrk"
"mkmk"
"mset"
"nalt"
"nlck"
"nukt"
"numr"
"onum"
"opbd"
"ordn"
"ornm"
"palt"
"pcap"
"pkna"
"pnum"
"pref"
"pres"
"pstf"
"psts"
"pwid"
"qwid"
"rand"
"rclt"
"rlig"
"rkrf"
"rphf"
"rtbd"
"rtla"
"rtlm"
"ruby"
"rvrn"
"salt"
"sinf"
"size"
"smcp"
"smpl"
"ss01"
"ssty"
"stch"
"subs"
"sups"
"swsh"
"titl"
"tjmo"
"tnam"
"tnum"
"trad"
"twid"
"unic"
"valt"
"vatu"
"vert"
"vhal"
"vjmo"
"vkna"
"vkrn"
"vpal"
"vrt2"
"vrtr"
"zero"
# baseline tags
"hang"
"icfb"
"ictf"
"ideo"
"idtp"
"math"
"romn"
# axis tags
"ital"
"opsz"
"slnt"
"wdth"
"wght"
# tables
"BASE"
"CBDT"
"CBLC"
"CFF"
"CFF2"
"COLR"
"CPAL"
"DSIG"
"EBDT"
"EBLC"
"EBSC"
"GDEF"
"GPOS"
"GSUB"
"HVAR"
"JSTF"
"LTSH"
"MATH"
"MERG"
"MVAR"
"OTTO"
"PCLT"
"STAT"
"SVG"
"VDMX"
"VORG"
"VVAR"
"avar"
"cmap"
"cmat"
"cvar"
"cvt"
"fpgm"
"fvar"
"gasp"
"glyf"
"gvar"
"hdmx"
"head"
"hhea"
"hmtx"
"kern"
"loca"
"maxp"
"meta"
"name"
"post"
"prep"
"sbix"
"vhea"
"vmtx"
# script tags
"adlm"
"ahom"
"hluw"
"arab"
"armn"
"avst"
"bali"
"bamu"
"bass"
"batk"
"beng"
"bng2"
"bhks"
"bopo"
"brah"
"brai"
"bugi"
"buhd"
"byzm"
"cans"
"cari"
"aghb"
"cakm"
"cham"
"cher"
"hani"
"copt"
"cprt"
"cyrl"
"dsrt"
"deva"
"dev2"
"dogr"
"dupl"
"egyp"
"elba"
"ethi"
"geor"
"glag"
"goth"
"gran"
"grek"
"gujr"
"gjr2"
"gong"
"guru"
"gur2"
"hang"
"jamo"
"rohg"
"hano"
"hatr"
"hebr"
"kana"
"armi"
"phli"
"prti"
"java"
"kthi"
"knda"
"knd2"
"kana"
"kali"
"khar"
"khmr"
"khoj"
"sind"
"lao "
"latn"
"lepc"
"limb"
"lina"
"linb"
"lisu"
"lyci"
"lydi"
"mahj"
"maka"
"mlym"
"mlm2"
"mand"
"mani"
"marc"
"gonm"
"math"
"medf"
"mtei"
"mend"
"merc"
"mero"
"plrd"
"modi"
"mong"
"mroo"
"mult"
"musc"
"mymr"
"mym2"
"nbat"
"newa"
"talu"
"nko "
"nshu"
"orya"
"ory2"
"ogam"
"olck"
"ital"
"hung"
"narb"
"perm"
"xpeo"
"sogo"
"sarb"
"orkh"
"osge"
"osma"
"hmng"
"palm"
"pauc"
"phag"
"phnx"
"phlp"
"rjng"
"runr"
"samr"
"saur"
"shrd"
"shaw"
"sidd"
"sgnw"
"sinh"
"sogd"
"sora"
"soyo"
"xsux"
"sund"
"sylo"
"syrc"
"tglg"
"tagb"
"tale"
"lana"
"tavt"
"takr"
"taml"
"tml2"
"tang"
"telu"
"tel2"
"thaa"
"thai"
"tibt"
"tfng"
"tirh"
"ugar"
"vai "
"wara"
"yi "
"zanb"
# language tags
"ABA "
"ABK "
"ACH "
"ACR "
"ADY "
"AFK "
"AFR "
"AGW "
"AIO "
"AKA "
"ALS "
"ALT "
"AMH "
"ANG "
"APPH"
"ARA "
"ARG "
"ARI "
"ARK "
"ASM "
"AST "
"ATH "
"AVR "
"AWA "
"AYM "
"AZB "
"AZE "
"BAD "
"BAD0"
"BAG "
"BAL "
"BAN "
"BAR "
"BAU "
"BBC "
"BBR "
"BCH "
"BCR "
"BDY "
"BEL "
"BEM "
"BEN "
"BGC "
"BGQ "
"BGR "
"BHI "
"BHO "
"BIK "
"BIL "
"BIS "
"BJJ "
"BKF "
"BLI "
"BLK "
"BLN "
"BLT "
"BMB "
"BML "
"BOS "
"BPY "
"BRE "
"BRH "
"BRI "
"BRM "
"BRX "
"BSH "
"BSK "
"BTI "
"BTS "
"BUG "
"BYV "
"CAK "
"CAT "
"CBK "
"CCHN"
"CEB "
"CHE "
"CHG "
"CHH "
"CHI "
"CHK "
"CHK0"
"CHO "
"CHP "
"CHR "
"CHA "
"CHU "
"CHY "
"CGG "
"CJA "
"CJM "
"CMR "
"COP "
"COR "
"COS "
"CPP "
"CRE "
"CRR "
"CRT "
"CSB "
"CSL "
"CSY "
"CTG "
"CUK "
"DAN "
"DAR "
"DAX "
"DCR "
"DEU "
"DGO "
"DGR "
"DHG "
"DHV "
"DIQ "
"DIV "
"DJR "
"DJR0"
"DNG "
"DNJ "
"DNK "
"DRI "
"DUJ "
"DUN "
"DZN "
"EBI "
"ECR "
"EDO "
"EFI "
"ELL "
"EMK "
"ENG "
"ERZ "
"ESP "
"ESU "
"ETI "
"EUQ "
"EVK "
"EVN "
"EWE "
"FAN "
"FAN0"
"FAR "
"FAT "
"FIN "
"FJI "
"FLE "
"FMP "
"FNE "
"FON "
"FOS "
"FRA "
"FRC "
"FRI "
"FRL "
"FRP "
"FTA "
"FUL "
"FUV "
"GAD "
"GAE "
"GAG "
"GAL "
"GAR "
"GAW "
"GEZ "
"GIH "
"GIL "
"GIL0"
"GKP "
"GLK "
"GMZ "
"GNN "
"GOG "
"GON "
"GRN "
"GRO "
"GUA "
"GUC "
"GUF "
"GUJ "
"GUZ "
"HAI "
"HAL "
"HAR "
"HAU "
"HAW "
"HAY "
"HAZ "
"HBN "
"HER "
"HIL "
"HIN "
"HMA "
"HMN "
"HMO "
"HND "
"HO "
"HRI "
"HRV "
"HUN "
"HYE "
"HYE0"
"IBA "
"IBB "
"IBO "
"IJO "
"IDO "
"ILE "
"ILO "
"INA "
"IND "
"ING "
"INU "
"IPK "
"IPPH"
"IRT "
"ISL "
"ISM "
"ITA "
"IWR "
"JAM "
"JAN "
"JAV "
"JBO "
"JCT "
"JII "
"JUD "
"JUL "
"KAB "
"KAB0"
"KAC "
"KAL "
"KAN "
"KAR "
"KAT "
"KAZ "
"KDE "
"KEA "
"KEB "
"KEK "
"KGE "
"KHA "
"KHK "
"KHM "
"KHS "
"KHT "
"KHV "
"KHW "
"KIK "
"KIR "
"KIS "
"KIU "
"KJD "
"KJP "
"KJZ "
"KKN "
"KLM "
"KMB "
"KMN "
"KMO "
"KMS "
"KMZ "
"KNR "
"KOD "
"KOH "
"KOK "
"KON "
"KOM "
"KON0"
"KOP "
"KOR "
"KOS "
"KOZ "
"KPL "
"KRI "
"KRK "
"KRL "
"KRM "
"KRN "
"KRT "
"KSH "
"KSH0"
"KSI "
"KSM "
"KSW "
"KUA "
"KUI "
"KUL "
"KUM "
"KUR "
"KUU "
"KUY "
"KYK "
"KYU "
"LAD "
"LAH "
"LAK "
"LAM "
"LAO "
"LAT "
"LAZ "
"LCR "
"LDK "
"LEZ "
"LIJ "
"LIM "
"LIN "
"LIS "
"LJP "
"LKI "
"LMA "
"LMB "
"LMO "
"LMW "
"LOM "
"LRC "
"LSB "
"LSM "
"LTH "
"LTZ "
"LUA "
"LUB "
"LUG "
"LUH "
"LUO "
"LVI "
"MAD "
"MAG "
"MAH "
"MAJ "
"MAK "
"MAL "
"MAM "
"MAN "
"MAP "
"MAR "
"MAW "
"MBN "
"MBO "
"MCH "
"MCR "
"MDE "
"MDR "
"MEN "
"MER "
"MFA "
"MFE "
"MIN "
"MIZ "
"MKD "
"MKR "
"MKW "
"MLE "
"MLG "
"MLN "
"MLR "
"MLY "
"MND "
"MNG "
"MNI "
"MNK "
"MNX "
"MOH "
"MOK "
"MOL "
"MON "
"MOR "
"MOS "
"MRI "
"MTH "
"MTS "
"MUN "
"MUS "
"MWL "
"MWW "
"MYN "
"MZN "
"NAG "
"NAH "
"NAN "
"NAP "
"NAS "
"NAU "
"NAV "
"NCR "
"NDB "
"NDC "
"NDG "
"NDS "
"NEP "
"NEW "
"NGA "
"NGR "
"NHC "
"NIS "
"NIU "
"NKL "
"NKO "
"NLD "
"NOE "
"NOG "
"NOR "
"NOV "
"NSM "
"NSO "
"NTA "
"NTO "
"NYM "
"NYN "
"NZA "
"OCI "
"OCR "
"OJB "
"ORI "
"ORO "
"OSS "
"PAA "
"PAG "
"PAL "
"PAM "
"PAN "
"PAP "
"PAP0"
"PAS "
"PAU "
"PCC "
"PCD "
"PDC "
"PGR "
"PHK "
"PIH "
"PIL "
"PLG "
"PLK "
"PMS "
"PNB "
"POH "
"PON "
"PRO "
"PTG "
"PWO "
"QIN "
"QUC "
"QUH "
"QUZ "
"QVI "
"QWH "
"RAJ "
"RAR "
"RBU "
"RCR "
"REJ "
"RIA "
"RIF "
"RIT "
"RKW "
"RMS "
"RMY "
"ROM "
"ROY "
"RSY "
"RTM "
"RUA "
"RUN "
"RUP "
"RUS "
"SAD "
"SAN "
"SAS "
"SAT "
"SAY "
"SCN "
"SCO "
"SEK "
"SEL "
"SGA "
"SGO "
"SGS "
"SHI "
"SHN "
"SIB "
"SID "
"SIG "
"SKS "
"SKY "
"SCS "
"SLA "
"SLV "
"SML "
"SMO "
"SNA "
"SNA0"
"SND "
"SNH "
"SNK "
"SOG "
"SOP "
"SOT "
"SQI "
"SRB "
"SRD "
"SRK "
"SRR "
"SSL "
"SSM "
"STQ "
"SUK "
"SUN "
"SUR "
"SVA "
"SVE "
"SWA "
"SWK "
"SWZ "
"SXT "
"SXU "
"SYL "
"SYR "
"SYRE"
"SYRJ"
"SYRN"
"SZL "
"TAB "
"TAJ "
"TAM "
"TAT "
"TCR "
"TDD "
"TEL "
"TET "
"TGL "
"TGN "
"TGR "
"TGY "
"THA "
"THT "
"TIB "
"TIV "
"TKM "
"TMH "
"TMN "
"TNA "
"TNE "
"TNG "
"TOD "
"TOD0"
"TPI "
"TRK "
"TSG "
"TSJ "
"TUA "
"TUM "
"TUL "
"TUV "
"TVL "
"TWI "
"TYZ "
"TZM "
"TZO "
"UDM "
"UKR "
"UMB "
"URD "
"USB "
"UYG "
"UZB "
"VEC "
"VEN "
"VIT "
"VOL "
"VRO "
"WA "
"WAG "
"WAR "
"WCR "
"WEL "
"WLN "
"WLF "
"WTM "
"XBD "
"XKF "
"XHS "
"XJB "
"XOG "
"XPE "
"YAK "
"YAO "
"YAP "
"YBA "
"YCR "
"YIC "
"YIM "
"ZEA "
"ZGH "
"ZHA "
"ZHH "
"ZHP "
"ZHS "
"ZHT "
"ZND "
"ZUL "
"ZZA "

Some files were not shown because too many files have changed in this diff Show More