about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cmd.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/cmd.go b/src/cmd.go
new file mode 100644
index 0000000..3a488e7
--- /dev/null
+++ b/src/cmd.go
@@ -0,0 +1,22 @@
+package main
+
+import (
+	"log"
+
+	"github.com/radare/r2pipe-go"
+)
+
+func r2cmd(r2p *r2pipe.Pipe, input string) string {
+
+	// print the command for debugging purposes
+	log.Printf("> %s", input)
+
+	// send a command
+	buf1, err := r2p.Cmd(input)
+	if err != nil {
+		panic(err)
+	}
+
+	// return the result of the command as a string
+	return buf1
+}