All pastes #916231 Raw Edit

Mine

public text v1 · immutable
#916231 ·published 2008-02-24 13:34 UTC
rendered paste body
#define _GNU_SOURCE
#include <stdio.h>
#include <dlfcn.h>
#include <sys/types.h>
#include <sys/stat.h>


int (*ropen)(const char *pathname, int flags, mode_t mode);

int open_shlib(void){
	ropen = dlsym(RTLD_NEXT,"open");
	return 0;
}

int open(const char *pathname, int flags, mode_t mode){
	printf("%s\n",pathname);
	return ropen(pathname, flags, mode);
}