mirror of
https://github.com/geohot/qira
synced 2025-03-12 18:13:15 +03:00
add doubleshell test, for some reason it works
This commit is contained in:
parent
4838fb98c3
commit
858a828154
BIN
tests_manual/doubleshell
Executable file
BIN
tests_manual/doubleshell
Executable file
Binary file not shown.
20
tests_manual/doubleshell.c
Normal file
20
tests_manual/doubleshell.c
Normal 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());
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user