Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fuzz range branch #21

Open
wants to merge 21 commits into
base: master
from
Open
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Update INTERESTING32

  • Loading branch information
yevgenypats committed Nov 21, 2019
commit c05103aaad75efbad0b8e31a81655b0aa51238c4
@@ -119,7 +119,7 @@ This will save the html report to `coverage` directory

## Other languages

Currently this library is also ported to python via [pythonfuzz](https://github.com/fuzzitdev/jsfuzz)
Currently this library is also ported to python via [pythonfuzz](https://github.com/fuzzitdev/pythonfuzz)

## Credits & Acknowledgments

@@ -1,4 +1,4 @@
const xml2js = require('xml2js')
const xml2js = require('xml2js');

async function fuzz (bytes) {
const string = String.fromCodePoint(...bytes)
@@ -5,12 +5,11 @@ var crypto = require('crypto');

const INTERESTING8 = new Uint8Array([-128, -1, 0, 1, 16, 32, 64, 100, 127]);
const INTERESTING16 = new Uint16Array([-32768, -129, 128, 255, 256, 512, 1000, 1024, 4096, 32767, -128, -1, 0, 1, 16, 32, 64, 100, 127]);
const INTERESTING32 = new Uint32Array([-2147483648, -100663046, -32769, 32768, 65535, 65536, 100663045, 2147483647, -32768, -129, 128, 255, 256, 512, 1000, 1024, 4096, 32767]);
const INTERESTING32 = new Uint32Array([-2147483648, -100663046, -32769, 32768, 65535, 65536, 100663045, 2147483647, -32768, -129, 128, 255, 256, 512, 1000, 1024, 4096, 32767, -128, -1, 0, 1, 16, 32, 64, 100, 127]);


export class Corpus {
private inputs: Buffer[];
private seedPath: string | undefined;
private corpusPath: string | undefined;
private maxInputSize: number;
private seedLength: number;
@@ -295,7 +294,7 @@ export class Corpus {
i--;
continue;
}
const other = this.inputs[this.rand(this.inputs.length)]
const other = this.inputs[this.rand(this.inputs.length)];
if (other.length < 4) {
i--;
continue;
@@ -331,7 +330,7 @@ export class Corpus {
const pos0 = this.rand(res.length+1);
const pos1 = this.rand(other.length-2);
const n = this.chooseLen(other.length-pos1-2) + 2;
res = Buffer.concat([res, Buffer.alloc(n, 0)], res.length + n)
res = Buffer.concat([res, Buffer.alloc(n, 0)], res.length + n);
res.copy(res, pos0+n, pos0);
for (let k=0; k<n; k++) {
res[pos0+k] = other[pos1+k]
@@ -119,8 +119,8 @@ export class Fuzzer {
return;
} else if (m.coverage > this.total_coverage) {
this.total_coverage = m.coverage;
this.logStats('NEW');
this.corpus.putBuffer(buf);
this.logStats('NEW');
if (buf.length > 0 && this.versifier) {
this.verse = BuildVerse(this.verse, buf);
}
@@ -162,9 +162,6 @@ export class Fuzzer {
});

this.pulseInterval = setInterval(() => {
// @ts-ignore
const diff = Date.now() - this.startTime;
const execs_per_sec = Math.trunc(executions/diff*1000);
this.logStats("PULSE");
}, 3000);

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.