1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
#include <stdio.h> #include <string.h> int main(int argc, char **argv) { int a; char cmd[128]; memcpy(&a, (int []) { 4 }, sizeof(int)); sprintf(cmd, "cat /proc/%d/maps", getpid()); system(cmd); printf("Hello %d\n", a); return 0; }