diff options
author | Emile <git@emile.space> | 2024-08-16 19:50:26 +0200 |
---|---|---|
committer | Emile <git@emile.space> | 2024-08-16 19:50:26 +0200 |
commit | 1a57267a17c2fc17fb6e104846fabc3e363c326c (patch) | |
tree | 1e574e3a80622086dc3c81ff9cba65ef7049b1a9 /src/r2.go |
initial commit
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 +} |