diff options
Diffstat (limited to 'src/r2.go')
-rw-r--r-- | src/r2.go | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/r2.go b/src/r2.go new file mode 100644 index 0000000..6ecd24b --- /dev/null +++ b/src/r2.go @@ -0,0 +1,24 @@ +package main + +import ( + "log" + + "github.com/radareorg/r2pipe-go" +) + +func r2cmd(r2p *r2pipe.Pipe, input string) (string, error) { + + log.Println("---") + log.Printf("> %s\n", input) + log.Println("---") + + // send a command + buf1, err := r2p.Cmd(input) + if err != nil { + log.Println(err) + return "", err + } + + // return the result of the command as a string + return buf1, nil +} |