Jump to content

windows times

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
3 replies to this topic

#1
tootypegs

tootypegs

    Newbie

  • Members
  • Pip
  • 4 posts
hi everyone. I would like to examine windows shortcut files (.lnk). I know they contain 3 64 bit windows times and dates for there last accessed, modified and created dates. I would like to be able to extract these from the files if I can but so far i am struggling a lot. I thought about stripping each 8 bit timestamp from the file and converting it but its there a way to get the tim es from the file by using 'getfiletime'? I am struggleing a lot

#2
Xav

Xav

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 13,118 posts
Hmm... if you're using managed C++ with .NET, there are various APIs to use.
Jordan said:

Good members, like yourself, stick around and post for ages to come!
Mr. Xav | Blog | Forums

#3
dargueta

dargueta

    Writes binary right handed and hex left handed

  • Moderators
  • 4,720 posts
Wotsit.org has a ton of information on various file formats. You could read the file and process the parts you want yourself. That way you don't have to deal with cumbersome API that you might not know how to use...or might not be available. Just type "lnk" (no quotes) in the search box in the upper right-hand corner and click "Go!". I can't do it because my web browser is being retarded right now.

#4
dargueta

dargueta

    Writes binary right handed and hex left handed

  • Moderators
  • 4,720 posts
LNK File Format search on Wotsit.org

Okay, I did a bit of searching on the Internet. A 64-bit timestamp is the count of 100-nanosecond intervals since January 1st, 1601. (Don't ask me why, I don't know.) There is an API function to convert called FileTimeToSystemTime(). What you need to do is:

[HIGHLIGHT="C"]
#include <windows.h>
...

FILETIME ftime;
SYSTEMTIME systime;

//open file
FILE *lnk = fopen("file_path","rb");
//set file pointer to proper location for read
fseek(lnk,offset_of_time_stamp,SEEK_SET);
//read date stamp
fread(&ftime,sizeof(FILETIME),1,lnk);
//convert
FileTimeToSystemTime(&ftime,&systime);
//do your thing here
[/HIGHLIGHT]

Here is the data you'll need to utilize the output:
SYSTEMTIME structure