diff options
author | van Hauser <vh@thc.org> | 2021-03-24 18:19:45 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-24 18:19:45 +0100 |
commit | c2b58cff6fa7d6af766cc6f686046d7e043a3977 (patch) | |
tree | 0c04cd932d129b45e31fd17c328844295677ca5f /utils/custom_mutators/example.py | |
parent | 958436be4ba057e8409787e7ff4ddcfa095c46da (diff) | |
parent | 6e2a0ef233fc09e8751e2d4cba3298610d8bed2c (diff) | |
download | afl++-c2b58cff6fa7d6af766cc6f686046d7e043a3977.tar.gz |
Merge pull request #843 from AFLplusplus/tmp
Tmp
Diffstat (limited to 'utils/custom_mutators/example.py')
-rw-r--r-- | utils/custom_mutators/example.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/utils/custom_mutators/example.py b/utils/custom_mutators/example.py index cf659e5a..3a6d22e4 100644 --- a/utils/custom_mutators/example.py +++ b/utils/custom_mutators/example.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # encoding: utf-8 -''' +""" Example Python Module for AFLFuzz @author: Christian Holler (:decoder) @@ -12,7 +12,7 @@ License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. @contact: choller@mozilla.com -''' +""" import random @@ -26,12 +26,12 @@ COMMANDS = [ def init(seed): - ''' + """ Called once when AFLFuzz starts up. Used to seed our RNG. @type seed: int @param seed: A 32-bit random value - ''' + """ random.seed(seed) @@ -40,7 +40,7 @@ def deinit(): def fuzz(buf, add_buf, max_size): - ''' + """ Called per fuzzing iteration. @type buf: bytearray @@ -55,13 +55,14 @@ def fuzz(buf, add_buf, max_size): @rtype: bytearray @return: A new bytearray containing the mutated data - ''' + """ ret = bytearray(100) ret[:3] = random.choice(COMMANDS) return ret + # Uncomment and implement the following methods if you want to use a custom # trimming algorithm. See also the documentation for a better API description. |