gazprea-fuzzer-python/fuzzer.py
2023-11-19 11:05:52 -07:00

29 lines
779 B
Python

import yaml
import ast_parser
from ast_generator.ast_generator import *
from ast_parser.gaz_unparser import *
class GazpreaFuzzer:
def __init__(self, config: str):
# parse a yaml config file with path in config
# and set the appropriate parameters
with open(config) as yaml_file:
settings: dict = yaml.safe_load(yaml_file)
self.settings = settings
self.parser = None
self.generator = AstGenerator(settings)
self.ast = None
self.source = None
self.out = None
def fuzz(self):
self.generator.generate_ast()
self.parser = GazUnparser(self.generator.ast, True)
self.parser.unparse()
self.ast = self.generator.ast
self.source = self.parser.source