A templated class containing most of the fuzzing logic for a generic Arithmetic class.
More...
#include <fuzzer.hpp>
|
static std::vector< typename T::Instruction > | crossoverInstructionVector (const std::vector< typename T::Instruction > &vecA, const std::vector< typename T::Instruction > &vecB, FastRandom &rng) |
| Splice two instruction vectors into one randomly.
|
|
static std::vector< typename T::Instruction > | parseDataIntoInstructions (const uint8_t *Data, size_t Size) |
| Parses a given data buffer into a vector of instructions for testing the arithmetic.
|
|
static size_t | writeInstructionsToBuffer (std::vector< typename T::Instruction > &instructions, uint8_t *Data, size_t MaxSize) |
| Write instructions into the buffer until there are no instructions left or there is no more space.
|
|
template<typename Composer >
requires CheckableComposer<Composer> |
static void | executeInstructions (std::vector< typename T::Instruction > &instructions) |
| Execute instructions in a loop.
|
|
static size_t | MutateInstructionBuffer (uint8_t *Data, size_t Size, size_t MaxSize, FastRandom &rng) |
| Interpret the data buffer as a series of arithmetic instructions and mutate it accordingly.
|
|
|
static void | swapTwoInstructions (std::vector< typename T::Instruction > &instructions, FastRandom &rng) |
| Mutator swapping two instructions together.
|
|
static void | deleteInstructions (std::vector< typename T::Instruction > &instructions, FastRandom &rng, HavocSettings &havoc_settings) |
| Mutator, deleting a sequence of instructions.
|
|
static void | duplicateInstruction (std::vector< typename T::Instruction > &instructions, FastRandom &rng, HavocSettings &havoc_settings) |
| Mutator duplicating an instruction.
|
|
static void | insertRandomInstruction (std::vector< typename T::Instruction > &instructions, FastRandom &rng, HavocSettings &havoc_settings) |
|
static void | mutateInstructionStructure (std::vector< typename T::Instruction > &instructions, FastRandom &rng, HavocSettings &havoc_settings) |
| Mutator for instruction structure.
|
|
static void | mutateInstructionValue (std::vector< typename T::Instruction > &instructions, FastRandom &rng, HavocSettings &havoc_settings) |
| Choose a random instruction from the vector and mutate it.
|
|
static void | mutateInstructionVector (std::vector< typename T::Instruction > &instructions, FastRandom &rng) |
|
A templated class containing most of the fuzzing logic for a generic Arithmetic class.
- Template Parameters
-
Definition at line 321 of file fuzzer.hpp.
◆ crossoverInstructionVector()
template<typename T >
static std::vector< typename T::Instruction > ArithmeticFuzzHelper< T >::crossoverInstructionVector |
( |
const std::vector< typename T::Instruction > & |
vecA, |
|
|
const std::vector< typename T::Instruction > & |
vecB, |
|
|
FastRandom & |
rng |
|
) |
| |
|
inlinestatic |
Splice two instruction vectors into one randomly.
- Parameters
-
vecA | First instruction vector |
vecB | Second instruction vector |
rng | PRNG |
- Returns
- Resulting vector of instructions
Definition at line 486 of file fuzzer.hpp.
◆ deleteInstructions()
Mutator, deleting a sequence of instructions.
- Parameters
-
instructions | |
rng | |
havoc_settings | |
Definition at line 351 of file fuzzer.hpp.
◆ duplicateInstruction()
Mutator duplicating an instruction.
- Parameters
-
instructions | |
rng | |
havoc_settings | |
Definition at line 384 of file fuzzer.hpp.
◆ executeInstructions()
template<typename T >
static void ArithmeticFuzzHelper< T >::executeInstructions |
( |
std::vector< typename T::Instruction > & |
instructions | ) |
|
|
inlinestatic |
Execute instructions in a loop.
- Template Parameters
-
- Parameters
-
Definition at line 628 of file fuzzer.hpp.
◆ insertRandomInstruction()
◆ MutateInstructionBuffer()
Interpret the data buffer as a series of arithmetic instructions and mutate it accordingly.
- Parameters
-
Data | Pointer to the buffer |
Size | The initial filled size |
MaxSize | The size of the buffer |
- Returns
- size_t The new length of data in the buffer
Definition at line 705 of file fuzzer.hpp.
◆ mutateInstructionStructure()
Mutator for instruction structure.
- Parameters
-
instructions | |
rng | |
havoc_settings | |
Definition at line 412 of file fuzzer.hpp.
◆ mutateInstructionValue()
Choose a random instruction from the vector and mutate it.
- Parameters
-
instructions | Vector of instructions |
rng | Pseudorandom number generator |
havoc_settings | Mutation settings |
Definition at line 438 of file fuzzer.hpp.
◆ mutateInstructionVector()
◆ parseDataIntoInstructions()
template<typename T >
static std::vector< typename T::Instruction > ArithmeticFuzzHelper< T >::parseDataIntoInstructions |
( |
const uint8_t * |
Data, |
|
|
size_t |
Size |
|
) |
| |
|
inlinestatic |
Parses a given data buffer into a vector of instructions for testing the arithmetic.
- Parameters
-
Data | Pointer to the data buffer |
Size | Data buffer size |
- Returns
- A vector of instructions
Definition at line 548 of file fuzzer.hpp.
◆ swapTwoInstructions()
Mutator swapping two instructions together.
- Parameters
-
Definition at line 329 of file fuzzer.hpp.
◆ writeInstructionsToBuffer()
template<typename T >
static size_t ArithmeticFuzzHelper< T >::writeInstructionsToBuffer |
( |
std::vector< typename T::Instruction > & |
instructions, |
|
|
uint8_t * |
Data, |
|
|
size_t |
MaxSize |
|
) |
| |
|
inlinestatic |
Write instructions into the buffer until there are no instructions left or there is no more space.
- Parameters
-
instructions | Vector of fuzzing instructions |
Data | Pointer to data buffer |
MaxSize | Size of buffer |
- Returns
- How much of the buffer was filled with instructions
Definition at line 589 of file fuzzer.hpp.
The documentation for this class was generated from the following file: