Created
April 30, 2018 19:36
-
-
Save Leandros/9bcda9358b0d3b8ae9d36277bb411115 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <sys/mman.h> | |
#include <stdio.h> | |
int main(void) | |
{ | |
int *map = mmap( | |
0, | |
4096, | |
PROT_READ|PROT_WRITE|PROT_EXEC, | |
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, | |
-1, | |
0); | |
*map = 42; | |
printf("%p %d %d\n", map, *map, *(int *)0); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment