From 1a57267a17c2fc17fb6e104846fabc3e363c326c Mon Sep 17 00:00:00 2001 From: Emile Date: Fri, 16 Aug 2024 19:50:26 +0200 Subject: initial commit --- src/r2.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 src/r2.go (limited to 'src/r2.go') 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 +} -- cgit 1.4.1