View Single Post
allnameswereout's Avatar
Posts: 3,397 | Thanked: 1,212 times | Joined on Jul 2008 @ Netherlands
#151
Will this work? Can anyone compile this?

Code:
/*
 *
 * $ gcc -fpic -shared -o libwlancal.so libwlancal.c -ldl
 *
 */

#define _GNU_SOURCE
#include <stdio.h>
#include <dlfcn.h>

FILE* fopen(const char* path, const char* mode) {
	if (path == "/sys/devices/platform/wlan-omap/cal_mac_address") {
		printf("Opening %s\n", path);
		FILE* (*real_fopen)(const char*, const char*) =
			dlsym(RTLD_NEXT, "fopen");
		return real_fopen("/home/user/.oksikokos", mode);
	}
}
__________________
Goosfraba! All text written by allnameswereout is public domain unless stated otherwise. Thank you for sharing your output!
 

The Following 2 Users Say Thank You to allnameswereout For This Useful Post: