#include #include #include #include #include #include #include int do_syslog(char *msg) { return klogctl(11, msg, strlen(msg)); } int printf(const char* format, ...) { static int (*orig_printf)(const char*, ...); static void *handle = NULL; va_list opt; void *arg; int ret; char *kmsg; va_start(opt, format); arg = va_arg(opt, void *); va_end(opt); if(handle == NULL) { handle = dlopen("/lib/libc.so.6", RTLD_LAZY); orig_printf = dlsym(handle, "printf"); } //sprintf(kmsg, format, arg); //do_syslog(kmsg); ret = orig_printf(format, arg); return ret; }