# cat blog >> /dev/brain 2> /proc/mind
cat blog >> /dev/brain 2> /proc/mind
# grep -m 1 localtime /usr/include/time.h extern struct tm *localtime (__const time_t *__timer) __THROW; # cat newdate.c #define _GNU_SOURCE #include <stdio.h> #include <time.h> #include <dlfcn.h> struct tm *(*orig_localtime)(const time_t *timep); struct tm *localtime(const time_t *timep){ time_t t=946684860; return orig_localtime(&t); } void _init(void){ orig_localtime=dlsym(RTLD_NEXT,"localtime"); } # gcc -Wall -fPIC -o newdate.o -c newdate.c # ld -shared -o newdate.so newdate.o -ldl # date Thu Jan 10 13:35:30 CET 2013 # LD_PRELOAD=./newdate.so date Sat Jan 1 01:01:00 CET 2000
grep -m 1 localtime /usr/include/time.h
cat newdate.c
gcc -Wall -fPIC -o newdate.o -c newdate.c
ld -shared -o newdate.so newdate.o -ldl
date
LD_PRELOAD=./newdate.so date
Post a Comment
No comments:
Post a Comment