|
/*
Sets File Time in Future
(c) 2006-2007 Vladimir Dubrovin, 3APA3A
http://securityvulns.com/
http://securityvulns.ru/
*/
#include <stdio.h>
#include <windows.h>
int main(int argc, char * argv[]){
HANDLE h;
FILETIME ft;
int n;
char buf[10240];
if(argc != 2) {
printf(
"Usage: %s <file_path>\n"
"(c) Vladimir Dubrovin, 3APA3A\n"
" http://securityvulns.com\n"
" http://securityvulns.ru\n",
argv[0]);
return 1;
}
for(;(
h=CreateFile(argv[1],
GENERIC_WRITE,
FILE_SHARE_WRITE|FILE_SHARE_READ|FILE_SHARE_DELETE,
NULL,
OPEN_ALWAYS,
0,
NULL
)
) == INVALID_HANDLE_VALUE;);
ft.dwLowDateTime = 0x3A3A3A3A;
ft.dwHighDateTime = 0x3A3A3A3A;
/* you may also try 0x7FFFFF00 for another fun */
if(!SetFileTime(h,&ft,&ft,&ft)){
fprintf(stderr,"failed: %d\n", GetLastError());
}
return 0;
}
|