From 795ff164d007f730bae2a0dd261ad6e4bdb20b90 Mon Sep 17 00:00:00 2001 From: Emile Date: Sat, 9 Nov 2024 18:59:34 +0100 Subject: should fix the pc not working fine --- src/battle.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/battle.go') diff --git a/src/battle.go b/src/battle.go index 3f82cf7..af7043b 100644 --- a/src/battle.go +++ b/src/battle.go @@ -1463,8 +1463,6 @@ func battleRunHandler(w http.ResponseWriter, r *http.Request) { // TODO(emile): [L] implement some kind of queue - // TODO(emile): [S] use the information given from the battle, such as the right arch and bits - rawOutput += "[0x00000000]> # initializing the vm and the stack\n" cmd = "aei" output, _ = r2cmd(r2p1, cmd) @@ -1552,6 +1550,9 @@ func battleRunHandler(w http.ResponseWriter, r *http.Request) { rawOutput += fmt.Sprintf("[0x00000000]> ########################################################################\n") + rawOutput += "[0x00000000]> # Loading the registers\n" + r2cmd(r2p1, runtimeBots[currentBotId].Regs) + // this is architecture agnostic and just gets the program counter pc, _ := r2cmd(r2p1, "aer~$(arn PC)~[1]") @@ -1569,8 +1570,6 @@ func battleRunHandler(w http.ResponseWriter, r *http.Request) { rawOutput += fmt.Sprintf("[0x00000000]> %s\n%s", cmd, output) // load registers - rawOutput += "[0x00000000]> # Loading the registers\n" - r2cmd(r2p1, runtimeBots[currentBotId].Regs) // rawOutput += fmt.Sprintf("%+v\n", runtimeBots[currentBotId].Regs) // cmd = "dr" -- cgit 1.4.1