Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A corpus generation tool

License

NotificationsYou must be signed in to change notification settings

MozillaSecurity/corpus-replicator

Repository files navigation

CIcodecovMatrixPyPI

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.

Requirements

Corpus Replicator relies onFFmpeg.

Installation

pip install corpus-replicator

Example

This 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.mp4

A 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

Stars

Watchers

Forks

Contributors2

  •  
  •  

Languages


[8]ページ先頭

©2009-2025 Movatter.jp