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.
|
| |
A templated class containing most of the fuzzing logic for a generic Arithmetic class.
- Template Parameters
-
◆ 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
◆ executeInstructions()
template<typename T >
| static void ArithmeticFuzzHelper< T >::executeInstructions |
( |
std::vector< typename T::Instruction > & |
instructions | ) |
|
|
inlinestatic |
Execute instructions in a loop.
- Template Parameters
-
- Parameters
-
◆ 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
◆ 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
◆ 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
The documentation for this class was generated from the following file: