aboutsummaryrefslogtreecommitdiff
path: root/devkit
diff options
context:
space:
mode:
authorDavid Li <li.davidm96@gmail.com>2016-01-12 09:26:37 -0700
committerDavid Li <li.davidm96@gmail.com>2016-01-12 09:26:37 -0700
commit831045a31f2a95eb31f44cb58aa09b4320952d18 (patch)
tree72a0c74285d1eed37c64b7e04ff58208ce1ca692 /devkit
parentf4ecb2e56397365d8ea809b169df0734a1a6524c (diff)
Add sample bot
Diffstat (limited to 'devkit')
-rw-r--r--devkit/test.c87
1 files changed, 87 insertions, 0 deletions
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;
+ }
+}