From 831045a31f2a95eb31f44cb58aa09b4320952d18 Mon Sep 17 00:00:00 2001
From: David Li
Date: Tue, 12 Jan 2016 09:26:37 -0700
Subject: Add sample bot
---
devkit/test.c | 87 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 87 insertions(+)
create mode 100644 devkit/test.c
diff --git a/devkit/test.c b/devkit/test.c
new file mode 100644
index 0000000..ddf25a4
--- /dev/null
+++ b/devkit/test.c
@@ -0,0 +1,87 @@
+#include "cacheracer.h"
+
+void __start(int core_id, unsigned char payload) {
+ printi(HOME_RW_START - sizeof(struct player_status));
+ /* int test = global + 2; */
+ /* print(hello); */
+ int *ptr = (int*) (HOME_DATA_START + 0x100 * core_id);
+ /* int *ptr = (int*) (0x6000); */
+ int i = 0;
+ if (core_id > 1) {
+ prints("Core ID > 1, sneak attacking");
+ sneak_attack();
+ ptr = (int*) (HOME_DATA_START + 0x2000 + 0x100 * core_id);
+ }
+
+ int int_payload = (int) payload;
+ int p = (int_payload | (int_payload << 8) |
+ (int_payload << 16) | (int_payload << 24));
+
+ while(1) {
+ ptr[i++] = p;
+ ptr[i++] = p;
+ ptr[i++] = p;
+ ptr[i++] = p;
+ ptr[i++] = p;
+ ptr[i++] = p;
+ ptr[i++] = p;
+ ptr[i++] = p;
+ ptr[i++] = p;
+ ptr[i++] = p;
+ ptr[i++] = p;
+ ptr[i++] = p;
+ ptr[i++] = p;
+ ptr[i++] = p;
+ ptr[i++] = p;
+ ptr[i++] = p;
+ ptr[i++] = p;
+ ptr[i++] = p;
+ ptr[i++] = p;
+ ptr[i++] = p;
+ ptr[i++] = p;
+ ptr[i++] = p;
+ ptr[i++] = p;
+ ptr[i++] = p;
+ ptr[i++] = p;
+ ptr[i++] = p;
+ ptr[i++] = p;
+ ptr[i++] = p;
+ ptr[i++] = p;
+ ptr[i++] = p;
+ ptr[i++] = p;
+ ptr[i++] = p;
+ ptr[i++] = p;
+ ptr[i++] = p;
+ ptr[i++] = p;
+ ptr[i++] = p;
+ ptr[i++] = p;
+ ptr[i++] = p;
+ ptr[i++] = p;
+ ptr[i++] = p;
+ ptr[i++] = p;
+ ptr[i++] = p;
+ ptr[i++] = p;
+ ptr[i++] = p;
+ ptr[i++] = p;
+ ptr[i++] = p;
+ ptr[i++] = p;
+ ptr[i++] = p;
+ ptr[i++] = p;
+ ptr[i++] = p;
+ ptr[i++] = p;
+ ptr[i++] = p;
+ ptr[i++] = p;
+ ptr[i++] = p;
+ ptr[i++] = p;
+ ptr[i++] = p;
+ ptr[i++] = p;
+ ptr[i++] = p;
+ ptr[i++] = p;
+ ptr[i++] = p;
+ ptr[i++] = p;
+ ptr[i++] = p;
+ ptr[i++] = p;
+ ptr[i++] = p;
+ ptr += 64;
+ }
+}
--
cgit v1.2.3