From 7cc6f9372271cd6c19af5d8d3c8a459495f3e196 Mon Sep 17 00:00:00 2001 From: "Sven M. Hallberg" Date: Mon, 10 Apr 2023 18:28:28 +0200 Subject: rename Source to Code Source is what goes into the assembler, not what comes out of it. Resisted the temptation to call it "text". ;P --- main.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/main.go b/main.go index bccb022..2a742f7 100644 --- a/main.go +++ b/main.go @@ -46,8 +46,8 @@ type Bot struct { // Path defines the path to the source of the bot Path string - // Source defines the source of the bot after being compiled with rasm2 - Source string + // Code holds the assembled code of the bot as generated by rasm2 + Code string // Addr defines the initial address the bot is placed at Addr int @@ -164,9 +164,9 @@ func buildBot(i int, config *Config) { // rasm2 to compile the bot botPath := config.Bots[i].Path radareCommand := fmt.Sprintf("rasm2 -a %s -b %d -f %s", config.Arch, config.Bits, botPath) - botSource := r2cmd(r2p1, radareCommand) + botCode := r2cmd(r2p1, radareCommand) - config.Bots[i].Source = botSource + config.Bots[i].Code = botCode } // init initializes the arena @@ -312,7 +312,7 @@ func genRandomOffsets(config *Config) { // place the bot in the arena at the given address func placeBot(r2p *r2pipe.Pipe, bot Bot, address int) { - _ = r2cmd(r2p, fmt.Sprintf("wx %s @ %d", bot.Source, address)) + _ = r2cmd(r2p, fmt.Sprintf("wx %s @ %d", bot.Code, address)) } func placeBots(r2p *r2pipe.Pipe, config *Config) { -- cgit 1.4.1