github.com/phillinzzz/newBsc@v1.1.6/tests/fuzzers/difficulty/debug/main.go (about)

     1  package main
     2  
     3  import (
     4  	"fmt"
     5  	"io/ioutil"
     6  	"os"
     7  
     8  	"github.com/phillinzzz/newBsc/tests/fuzzers/difficulty"
     9  )
    10  
    11  func main() {
    12  	if len(os.Args) != 2 {
    13  		fmt.Fprintf(os.Stderr, "Usage: debug <file>")
    14  		os.Exit(1)
    15  	}
    16  	crasher := os.Args[1]
    17  	data, err := ioutil.ReadFile(crasher)
    18  	if err != nil {
    19  		fmt.Fprintf(os.Stderr, "error loading crasher %v: %v", crasher, err)
    20  		os.Exit(1)
    21  	}
    22  	difficulty.Fuzz(data)
    23  }