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
This repository was archived by the owner on Aug 14, 2021. It is now read-only.
/dharmaPublic archive

Generation-based, context-free grammar fuzzer. Refer tohttps://github.com/posidron/dharma for a maintained version.

License

NotificationsYou must be signed in to change notification settings

MozillaSecurity/dharma

Repository files navigation

Archived — please seehttps://github.com/posidron/dharma for maintained version.

Logo

Generation-based, context-free grammar fuzzer.

Build StatusIRC

Table of Contents

Run

All roads lead to Rome but Python 3.x is the prefered vehicle.

pip

pip install dharmadharma --help

pipenv

pipenv install --devpipenv run dharma --help

package

python -m dharma --help

Docker

docker build -t dharma.docker run --rm -it dharma -grammars dharma/grammars/canvas2d.dg

Examples

Generate a single test-case and print it tostdout. Multiple grammars can be appended to the-grammars argument.

dharma -grammars dharma/grammars/canvas2d.dg

Generating multiple test-cases and save the result to disk.

dharma -grammars dharma/grammars/canvas2d.dg -storage. -count 5

Generate test-cases and serve them in a template via WebSocket.Launchdharma/grammars/var/index.html in the browser after Dharma launched.

dharma -grammars dharma/grammars/canvas2d.dg -server -template dharma/grammars/var/templates/html5/default.html

Benchmark the generator.

time dharma -grammars dharma/grammars/canvas2d.dg -count 10000> /dev/null

Development

PyLint

In case you run PyLint 1.9.2 and Python 3.7 you need to upgrade PyLint.

pip3 install pylint astroid --pre -U

Dharma Grammar Cheatsheet

Comments

%%% comment

Controls

%const% name := value

Sections

%section% := value%section% := variable%section% := variance

Extension Methods

Refer toextensions.py indharma/core/ and to thexref_registry in theDharmaMachine class to add further extensions.

%range%(0-9)%range%(0.0-9.0)%range%(a-z)%range%(!-~)%range%(0x100-0x200)%repeat%(+variable+)%repeat%(+variable+, ", ")%uri%(path)%uri%(lookup_key)%block%(path)%choice%(foo, "bar", 1)

Assigning Values

digit :=    %range%(0-9)sign :=    +    -value :=    +sign+%repeat%(+digit+)

Using Values

+value+

Assigning Variables

variable :=    @variable@ = new Foo();

Using Variables

value :=    !variable!.bar();

Referencing values fromcommon.dg

value :=    attribute=+common:number+

Calling JavaScript library methods

foo :=    Random.pick([0,1]);

API Documentation

Dharma in the Public

Dharma mentionings in the news.

About

Generation-based, context-free grammar fuzzer. Refer tohttps://github.com/posidron/dharma for a maintained version.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp