Skip to content

Instantly share code, notes, and snippets.

@theKidOfArcrania
Created May 13, 2019 15:28
Show Gist options
  • Save theKidOfArcrania/701834f04b48fc3753e54b31d1b9b797 to your computer and use it in GitHub Desktop.
Save theKidOfArcrania/701834f04b48fc3753e54b31d1b9b797 to your computer and use it in GitHub Desktop.
#include <sys/mman.h>
#include <fcntl.h>
#include <unistd.h>
int main() {
int fd = open("crux.patched", 0);
off_t size = lseek(fd, 0, SEEK_END);
lseek(fd, 0, SEEK_SET);
void (*ret)() = mmap(0, 0x6000, 7, MAP_ANONYMOUS | MAP_PRIVATE | MAP_FIXED, -1, 0);
read(fd, (void*)ret, size);
// asm volatile ("int3");
ret();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment