about summary refs log tree commit diff
path: root/src/bot.go
diff options
context:
space:
mode:
authorEmile <git@emile.space>2024-11-06 19:02:30 +0100
committerEmile <git@emile.space>2024-11-06 19:02:30 +0100
commit7898c82413fe3d8e0f554ae682c6598ec1c28a93 (patch)
tree49277fb53fd390f4cc645dfdc9c26a36e5676713 /src/bot.go
parentfbfee6c9d2d7bb6b40ed0defbc5a94d15182171f (diff)
bot updates
Diffstat (limited to 'src/bot.go')
-rw-r--r--src/bot.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/bot.go b/src/bot.go
index a2e8c99..4708fee 100644
--- a/src/bot.go
+++ b/src/bot.go
@@ -430,6 +430,7 @@ func botSingleHandler(w http.ResponseWriter, r *http.Request) {
 			data["res"] = queryres
 		}
 
+		// fetch the session and get the user that made the request
 		session, _ := globalState.sessions.Get(r, "session")
 		username := session.Values["username"].(string)
 
@@ -438,6 +439,7 @@ func botSingleHandler(w http.ResponseWriter, r *http.Request) {
 			data["err"] = "Could not get the id four your username... Please contact an admin"
 		}
 
+		// get the bot that was requested
 		bot, err := BotGetById(int(botid))
 		data["bot"] = bot
 		data["user"] = viewer
@@ -449,6 +451,9 @@ func botSingleHandler(w http.ResponseWriter, r *http.Request) {
 		}
 		defer r2p1.Close()
 
+		// TODO(emile): improve the archs and bit handling here. I'll use the first one for now,
+		// but it would be nice to loop over all of them (would be a matrix with archs and bits
+		// on the axes)
 		src := strings.ReplaceAll(bot.Source, "\r\n", "; ")
 		radareCommand := fmt.Sprintf("rasm2 -a %s -b %s \"%+v\"", bot.Archs[0].Name, bot.Bits[0].Name, src)
 		bytecode, err := r2cmd(r2p1, radareCommand)