add doubleshell test, for some reason it works

This commit is contained in:
George Hotz 2015-08-21 01:32:33 -07:00
parent 4838fb98c3
commit 858a828154
2 changed files with 20 additions and 0 deletions

BIN
tests_manual/doubleshell Executable file

Binary file not shown.

View File

@ -0,0 +1,20 @@
#include <sys/mman.h>
#include <stdio.h>
int main() {
int (*sc)();
char *ptr = mmap(0, 0x1000, PROT_EXEC | PROT_WRITE | PROT_READ, MAP_ANON | MAP_PRIVATE, -1, 0);
sc = ptr;
ptr[0] = 0x31;
ptr[1] = 0xc0;
ptr[2] = 0x40;
ptr[3] = 0xc3;
printf("%d\n", sc());
ptr[2] = 0xc3;
printf("%d\n", sc());
}