Illegal instruction (exception 2) int *exit_code = (int*) 0x820000c; *exit_code = 0xdeadbeef; --- Illegal instruction (exception 2) asm("csrw mstatus, %0" ::"r"(0xdeadbeef)); --- Illegal instruction (exception 2) void foo() { printf("hello world"); } asm("jr %0"::"r"(foo+2)); --- explore MISP (gdb) display/t $mip (gdb) b sys_invoke --- linux: malloc too much memory #include #include #include #define M256 1024*1024*256 int main() { unsigned long long counter = 0; while(1) { void *tmp = malloc(M256); counter += 256; memset(tmp, 0, M256); printf("allocated %.2f GB memory\n", counter/1024.0); } }