diff options
author | van Hauser <vh@thc.org> | 2021-08-20 23:54:59 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-20 23:54:59 +0200 |
commit | 2e15661f184c77ac1fbb6f868c894e946cbb7f17 (patch) | |
tree | 665b9368d2c1908cf71dbc4a76517f88c5317d9a /custom_mutators/gramatron/test.h | |
parent | 32a0d6ac31554a47dca591f8978982758fb87677 (diff) | |
parent | ca9c87dd45d8b9a746a212cbc6ce85b78b637d8c (diff) | |
download | afl++-2e15661f184c77ac1fbb6f868c894e946cbb7f17.tar.gz |
Merge pull request #1074 from AFLplusplus/dev
push to stable
Diffstat (limited to 'custom_mutators/gramatron/test.h')
-rw-r--r-- | custom_mutators/gramatron/test.h | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/custom_mutators/gramatron/test.h b/custom_mutators/gramatron/test.h new file mode 100644 index 00000000..857cb5fc --- /dev/null +++ b/custom_mutators/gramatron/test.h @@ -0,0 +1,57 @@ +#include <stdint.h> +#include <stdlib.h> +#include <string.h> +#include <stdio.h> +#include <json-c/json.h> +#include <unistd.h> +#include "hashmap.h" +#include "uthash.h" +#include "utarray.h" + +#define INIT_SIZE 100 // Initial size of the dynamic array holding the input + +typedef struct terminal { + + int state; + int trigger_idx; + size_t symbol_len; + char * symbol; + +} terminal; + +typedef struct trigger { + + char * id; + int dest; + char * term; + size_t term_len; + +} trigger; + +typedef struct state { + + int state_name; // Integer State name + int trigger_len; // Number of triggers associated with this state + trigger *ptr; // Pointer to beginning of the list of triggers + +} state; + +typedef struct { + + size_t used; + size_t size; + size_t inputlen; + terminal *start; + +} Array; + +int init_state; +int curr_state; +int final_state; + +state *create_pda(char *); +Array *gen_input(state *, Array *); +void print_repr(Array *, char *); +void initArray(Array *, size_t); +void insertArray(Array *, int, char *, size_t, int); + |