about summary refs log tree commit diff
path: root/main.go
diff options
context:
space:
mode:
authorSven M. Hallberg <pesco@khjk.org>2023-04-10 18:28:28 +0200
committerSven M. Hallberg <pesco@khjk.org>2023-04-10 18:28:28 +0200
commit7cc6f9372271cd6c19af5d8d3c8a459495f3e196 (patch)
tree38f5b6452818948ebd5d4f1798c734b229a2ad37 /main.go
parent437cf40e403f37f803e5292bc9224b47918c3726 (diff)
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
Diffstat (limited to 'main.go')
-rw-r--r--main.go10
1 files 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) {