- Notifications
You must be signed in to change notification settings - Fork3
MozillaSecurity/corpus-replicator
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Corpus Replicator is a corpus generation tool that enables the creation of multipleunique output files based on templates. The primary intended use case is thecreation of a seed corpus that can be used by fuzzers. Support for additional outputformats can be added via the creation ofRecipes. If a desired format is unsupported,support can be added via the creation of aCorpusGenerator.
The goal is to create an efficient corpus that maximizes code coverage and minimizesfile size. Small unique files that execute quickly are preferred.
Currently four media types can be generatedanimation,audio,image andvideo.
Corpus Replicator relies onFFmpeg.
pip install corpus-replicatorThis is an examplerecipe file.
# "base" contains required entries and default flagsbase:codec:"h264"# name of the codeccontainer:"mp4"# container/file extensionlibrary:"libx264"# name of librarymedium:"video"# supported mediumtool:"ffmpeg"# name of supported tooldefault_flags:encoder:# "encoder" flag group["-c:v", "libx264"]resolution:# "resolution" flag group["-s", "320x240"]# variations allow flags to be added and overwritten# one file will be generated for each entry in a flag groupvariation:resolution:# flag group - overwrites default flag group in "base" -["-s", "640x480"] -["-s", "32x18"] -["-s", "64x64"]monochrome:# flag group - adds new flag group -["-vf", "hue=s=0"]
Running the recipe will generate a corpus:
$ corpus-replicator example.yml video -t testGenerating templates...1 recipe(s) will be used with 1 template(s) to create 4 file(s).Generating 4 'video/libx264/h264/mp4' file(s) using template 'test'...Optimizing corpus, checking for duplicates...Done.Resulting corpus:
$ ls generated-corpus/video-h264-libx264-test-monochrome-00.mp4video-h264-libx264-test-resolution-01.mp4video-h264-libx264-test-resolution-00.mp4video-h264-libx264-test-resolution-02.mp4A more complex corpus can be generated by using multipleRecipes andTemplates atonce.
Recipes are stored insrc/corpus_replicator/recipes.
About
A corpus generation tool
Topics
Resources
License
Code of conduct
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Uh oh!
There was an error while loading.Please reload this page.
Contributors2
Uh oh!
There was an error while loading.Please reload this page.