Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
// 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.