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

modified: types/stats.go #4

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export AFL ?= $(HOME)/.afls/afl-1.83b
#export AFL ?= $(HOME)/.afls/afl-1.83b

all: server/server client/client

Expand Down
14 changes: 9 additions & 5 deletions client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"syscall"
"time"

"github.com/richo/roving/types"
"../types"
)

type Server struct {
Expand Down Expand Up @@ -64,7 +64,7 @@ type WatchDog struct {
Server *Server
}

func (f *Fuzzer) run() error {
func (f *Fuzzer) run(mode string) error {
dir, err := os.Getwd()
if err != nil {
log.Fatalf("Couldn't get current directory")
Expand All @@ -82,6 +82,10 @@ func (f *Fuzzer) run() error {
f.cmd.Args = append(f.cmd.Args, "--")
f.cmd.Args = append(f.cmd.Args, "./target")

if mode == "1" {
f.cmd.Args = append(f.cmd.Args, "@@")
}

stdout, err := f.cmd.StdoutPipe()
if err != nil {
log.Fatalf("Couldn't get stdout handle", err)
Expand Down Expand Up @@ -326,8 +330,8 @@ func setupWorkDir() {

func main() {
args := os.Args
if len(args) != 2 {
log.Printf("Usage: ./client server:port")
if len(args) != 3{
log.Printf("Usage: ./client server:port mode\nmode\n\t0 - stdin\n\t1 - file")
return
}

Expand Down Expand Up @@ -359,7 +363,7 @@ func main() {

go watchdog.run()

err := fuzzer.run()
err := fuzzer.run(args[2])

watchdog.uploadState()

Expand Down
2 changes: 1 addition & 1 deletion server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"github.com/zenazn/goji"
"github.com/zenazn/goji/web"

"github.com/richo/roving/types"
"../types"
)

// For now, the server stores a great deal of state in memory, although it will
Expand Down
6 changes: 4 additions & 2 deletions types/stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,10 @@ func ParseStats(stats string) (*FuzzerStats, error) {
case "command_line":
command_line = value
fields_covered |= 1 << 24
default:
return nil, fmt.Errorf("Unexpected key: %s", key)
// since latest version of afl add some new keywords such as 'stability'.
// patch out this two line can keep roving compatibled the latest vesion of afl.
// default:
// return nil, fmt.Errorf("Unexpected key: %s", key)
}
if err != nil {
return nil, fmt.Errorf("Invalid value for %s: %s", key, value)
Expand Down