From 1a57267a17c2fc17fb6e104846fabc3e363c326c Mon Sep 17 00:00:00 2001 From: Emile Date: Fri, 16 Aug 2024 19:50:26 +0200 Subject: initial commit --- templates/battleNew.html | 79 ++++++++++++++++ templates/battleSingle.html | 226 ++++++++++++++++++++++++++++++++++++++++++++ templates/battles.html | 27 ++++++ templates/botNew.html | 69 ++++++++++++++ templates/botSingle.html | 102 ++++++++++++++++++++ templates/bots.html | 24 +++++ templates/footer.html | 6 ++ templates/head.html | 127 +++++++++++++++++++++++++ templates/index.html | 68 +++++++++++++ templates/login.html | 41 ++++++++ templates/nav.html | 74 +++++++++++++++ templates/register.html | 40 ++++++++ templates/user.html | 19 ++++ templates/userProfile.html | 46 +++++++++ templates/users.html | 17 ++++ 15 files changed, 965 insertions(+) create mode 100644 templates/battleNew.html create mode 100644 templates/battleSingle.html create mode 100644 templates/battles.html create mode 100644 templates/botNew.html create mode 100644 templates/botSingle.html create mode 100644 templates/bots.html create mode 100644 templates/footer.html create mode 100644 templates/head.html create mode 100644 templates/index.html create mode 100644 templates/login.html create mode 100644 templates/nav.html create mode 100644 templates/register.html create mode 100644 templates/user.html create mode 100644 templates/userProfile.html create mode 100644 templates/users.html (limited to 'templates') diff --git a/templates/battleNew.html b/templates/battleNew.html new file mode 100644 index 0000000..0460dc7 --- /dev/null +++ b/templates/battleNew.html @@ -0,0 +1,79 @@ +{{ define "battleNew" }} + +{{ template "head" . }} + + {{ template "nav" . }} + + +

New battle

+ +

This is the page on which you can create a battle. Select the values you find appropriate. + Bots can be added to the battle later.

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ if .res }} + + + + + {{ end }} + +
Archs:{{ range $idx, $arch := .archs }}{{ if $idx }},{{ end }} + + + {{- end }} +
Bits: + {{ range $idx, $bit := .bits}}{{if $idx}},{{end}} + + + {{- end }} +
Public: + +
{{ .res }}
+ +{{ template "footer" . }} +{{ end }} diff --git a/templates/battleSingle.html b/templates/battleSingle.html new file mode 100644 index 0000000..fb53fc2 --- /dev/null +++ b/templates/battleSingle.html @@ -0,0 +1,226 @@ +{{ define "battleSingle" }} + +{{ template "head" . }} + + {{ template "nav" . }} + + +

{{ .battle.Name }}

+ +
+Settings
+Elimination Ladder
+  Round 1
+  Round 2
+  Round 3
+Current Standings
+  
+ + +

Settings

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ if .res }} + + + + + {{ end }} + + + + + + + {{ if .myBots }} + + + + + + + + + + + + + + {{ else }} + + + + + + + {{ end }} +
Archs + {{ range $idx, $arch := .archs }}{{if $idx}},{{end}} + + + {{- end }} +
Bits{{ range $idx, $bit := .bits }}{{if $idx}},{{end}} + + + {{- end }} +
+ + + + + + +
+ +
+
{{ .res }}






+ + {{ range $bot := .myBots }} + + + + + {{ end }} +
+ + + +
+
Upload a bot to get started!
+ + +

Elimination Ladder

+ + +

Round 1

+ +
Round 1.1: bot1 vs bot2 +
Round 1.2: bot3 vs bot4 +
+
Round 1.3: bot1 vs bot2 +
Round 1.4: bot3 vs bot4 + + +

Round 2

+ +
Round 2.1: winner of round 1.1 vs winner of round 1.2 +
Round 2.2: winner of round 1.3 vs winner of round 1.4 + + +

Round 3

+ +
Round 3.1: winner of round 2.1 vs winner of round 2.2 + + +

Current Standings

+ +

There are {{ .botAmount }} Bots in this battle, as we're executing each battle two times with all permutations, we're executing {{ .battleCount }} battles.

+ +
What is Lorem Ipsum? +
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. + +
Why do we use it? +
It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like). + + +
Where does it come from? +
Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32. + +
The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham. + +
Where can I get some? +
There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle of text. All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic words etc. +
Where can I get some? +
There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle of text. All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic words etc. +
Where can I get some? +
There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle of text. All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic words etc. +
Where can I get some? +
There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle of text. All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic words etc. + +{{ template "footer" . }} +{{ end }} diff --git a/templates/battles.html b/templates/battles.html new file mode 100644 index 0000000..bdc4d4b --- /dev/null +++ b/templates/battles.html @@ -0,0 +1,27 @@ +{{ define "battles" }} + +{{ template "head" . }} + + {{ template "nav" . }} + + +

All Battles

+ +

A battle is a collection of matches. It plays through all matches in the elimination ladder in order to determine an overall winner.

+
+ +
+ {{ range $battle := .battles }} + + + + + {{ end }} +
+ - {{ $battle.Name }} + + {{ range $idx, $bot := $battle.Bots }}{{if $idx}},{{end}}{{ $bot.Name }}{{ end }} +
+ +{{ template "footer" . }} +{{ end }} diff --git a/templates/botNew.html b/templates/botNew.html new file mode 100644 index 0000000..1d6e8a3 --- /dev/null +++ b/templates/botNew.html @@ -0,0 +1,69 @@ +{{ define "botNew" }} + +{{ template "head" . }} + + {{ template "nav" . }} + + +

New Bot

+ + This is the page on which you can submit your bots + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Archs + {{ range $idx, $arch := .archs }}{{if $idx}},{{end}} + + + {{- end }} +
Bits{{ range $idx, $bit := .bits }}{{if $idx}},{{end}} + + + {{- end }} +
{{ .res }}
+
+ +{{ template "footer" . }} +{{ end }} diff --git a/templates/botSingle.html b/templates/botSingle.html new file mode 100644 index 0000000..dcb874f --- /dev/null +++ b/templates/botSingle.html @@ -0,0 +1,102 @@ +{{ define "botSingle" }} + +{{ template "head" . }} + + {{ template "nav" . }} + + +

{{ .bot.Name }}

+ +
+ + {{ if .editable }} + + + + + {{ else }} + {{ end }} + + + + + + + + + + + + + + + + + {{ if .editable }} + + + + + {{ else }} + {{ end }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Archs + {{ range $idx, $arch := .archs }}{{if $idx}},{{end}} + + + {{- end }} +
Bits{{ range $idx, $bit := .bits }}{{if $idx}},{{end}} + + + {{- end }} +
{{ .res }}


CMD{{ .bytecode_r2cmd }}
Bytecode{{ .bytecode }}


CMD{{ .disasm_r2cmd }}
Disasm
{{ .disasm }}
+ + + +{{ template "footer" . }} +{{ end }} diff --git a/templates/bots.html b/templates/bots.html new file mode 100644 index 0000000..34fa0c2 --- /dev/null +++ b/templates/bots.html @@ -0,0 +1,24 @@ +{{ define "bots" }} + +{{ template "head" . }} + + {{ template "nav" . }} + + +

All Bots

+ +
+ {{ range $bot := .bots }} + + + + + {{ end }} +
+ {{ $bot.Name }} + + {{ range $idx, $usr := $bot.Users }}{{if $idx}},{{end}}{{ $usr.Name }}{{ end }} +
+ +{{ template "footer" . }} +{{ end }} diff --git a/templates/footer.html b/templates/footer.html new file mode 100644 index 0000000..cb7b0c9 --- /dev/null +++ b/templates/footer.html @@ -0,0 +1,6 @@ +{{ define "footer" }} +{{ if .asd }} +



+{{ . }} +{{ end }} +{{ end }} diff --git a/templates/head.html b/templates/head.html new file mode 100644 index 0000000..3bec2a9 --- /dev/null +++ b/templates/head.html @@ -0,0 +1,127 @@ +{{ define "head" }} + + + + + + + r2wa.rs + + + +{{ end }} diff --git a/templates/index.html b/templates/index.html new file mode 100644 index 0000000..9184a9c --- /dev/null +++ b/templates/index.html @@ -0,0 +1,68 @@ +{{ define "index" }} + +{{ template "head" . }} + + {{ template "nav" . }} + {{ if .logged_in }}{{ else }} + {{ end }} + + +

r2wa.rs

+ + {{ if .err }} +
{{ .err }}
+ {{ end }} + + + This is the r2wars web platform. Here, you can manage your bots and let them + "fight" (be executed) in the same memory space as others. + + Under the hood, the radare2 ESIL Emulation is used to allow all fun combinations! + + +

What is it and how does it work?

+ + Essentially +

+ +
+  ; r2 malloc://1024                           # allocate 1KB of memory
+  [0x00000000]> e asm.arch = x86               # define the arch to use
+  [0x00000000]> e asm.bits = 32                # define the bits to use
+  [0x00000000]> aei                            # init vm
+  [0x00000000]> aeim                           # init staack
+  [0x00000000]> waf bot.asm                    # write bot to memory
+  [0x00000000]> aer PC = 0x100                 # set program counter
+  [0x00000000]> aer SP = SP + 0x100            # set stack pointer
+  [0x00000000]> e cmd.esil.todo=f theend=1     # define end condition
+  [0x00000000]> e cmd.esil.trap=f theend=1     # define end condition
+  [0x00000000]> e cmd.esil.intr=f theend=1     # define end condition
+  [0x00000000]> e cmd.esil.ioer=f theend=1     # define end condition
+  [0x00000000]> f theend=0                     # set the end flag to 0
+  [0x00000000]> aes                            # step
+  [0x00000000]> ?v 1+theend                    # check if the end cond. is met
+  ..                                           # in a loop
+  [0x00000000]> aes                            # step
+  [0x00000000]> ?v 1+theend                    # check if the end cond. is met
+  
+ +
+ More info in the following blogpost: https://emile.space/blog/2020/r2wars/ +
+
+ +
+╭──╮    ╭──────────────────────╮
+│ _│_   │                      │
+│ O O  <  LET THE GAMES BEGIN! │
+│  │╷   │                      │
+│  ││   ╰──────────────────────╯
+│ ─╯│
+╰───╯
+  
+ + + + +{{ template "footer" . }} +{{ end }} diff --git a/templates/login.html b/templates/login.html new file mode 100644 index 0000000..a4fc358 --- /dev/null +++ b/templates/login.html @@ -0,0 +1,41 @@ +{{ define "login" }} + +{{ template "head" . }} + + {{ template "nav" . }} + + +

Login

+ + {{ if .err }}{{ .err }}{{ end }} + {{ if .logged_in }} + Already logged in! Return home + {{ else }} +
+ + + + + + + + + + + + + + + + + + +
{{ .res }}
+
+ Not registered yet? Register Now! + {{ end }} + + + +{{ template "footer" . }} +{{ end }} diff --git a/templates/nav.html b/templates/nav.html new file mode 100644 index 0000000..b28bf38 --- /dev/null +++ b/templates/nav.html @@ -0,0 +1,74 @@ +{{ define "nav" }} +
+

+ EARLY BETA - Data can be deleted at random! +

+ + r2wa.rs + emile.space +
+ + +
+{{ end }} + diff --git a/templates/register.html b/templates/register.html new file mode 100644 index 0000000..ea5094f --- /dev/null +++ b/templates/register.html @@ -0,0 +1,40 @@ +{{ define "register" }} + +{{ template "head" . }} + + {{ template "nav" . }} + + +

Register

+ + {{ if .logged_in }} + Already logged in! Return home + {{ else }} +
+ + + + + + + + + + + + + + + + + + + + +
+
+ Already registerd? Login! + {{ end }} + +{{ template "footer" . }} +{{ end }} diff --git a/templates/user.html b/templates/user.html new file mode 100644 index 0000000..c2e827a --- /dev/null +++ b/templates/user.html @@ -0,0 +1,19 @@ +{{ define "user" }} + +{{ template "head" . }} + + {{ template "nav" . }} + + +

{{ .targetUser.Name }}'s Bots

+ + This is just a list of all bots belonging to the given user + + + +{{ template "footer" . }} +{{ end }} diff --git a/templates/userProfile.html b/templates/userProfile.html new file mode 100644 index 0000000..05aa01d --- /dev/null +++ b/templates/userProfile.html @@ -0,0 +1,46 @@ +{{ define "profile" }} + +{{ template "head" . }} + + {{ template "nav" . }} + + +

Profile

+ + {{ if .err }} + ERROR: {{ .err }}! + Edit your userpage here + or + Visit the userpage of that user + {{ else }} + You can edit your profile below: +

+
+ + + + + + + + + + + + + + + + + + + + + + +





+
+ {{ end }} + +{{ template "footer" . }} +{{ end }} diff --git a/templates/users.html b/templates/users.html new file mode 100644 index 0000000..8002d2f --- /dev/null +++ b/templates/users.html @@ -0,0 +1,17 @@ +{{ define "users" }} + +{{ template "head" . }} + + {{ template "nav" . }} + + +

All users

+ + + +{{ template "footer" . }} +{{ end }} -- cgit 1.4.1