Skip to content

Instantly share code, notes, and snippets.

View csarofeen's full-sized avatar

Christian Sarofeen csarofeen

View GitHub Profile
// Compile with:
// g++ -c -fpic -o hack.o hack.cpp && g++ -shared -o libhack.so hack.o
// Then load with the Python
// import ctypes; ctypes.CDLL('libhack.so')
#include <stdio.h>
#include <dlfcn.h>
#include <stddef.h>
#include <stdint.h>
#include <sys/mman.h>