Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist
View gist:1492306
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
// Prerequisite: python2.7-dev
// Compile with: gcc -shared -fPIC -o liboverride.so override_pydict.c -ldl
// Run as: LD_PRELOAD=./liboverride.so python
 
#define _GNU_SOURCE 1
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <dlfcn.h>
#include "python2.7/Python.h"
 
PyObject* PyDict_New(void)
{
PyObject* (*orig_PyDict_New)(void) = dlsym(RTLD_NEXT, "PyDict_New");
printf("Calling PyDict_New\n");
 
return orig_PyDict_New();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.