News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Lnk format ?

Started by skywalker, January 07, 2007, 04:31:02 AM

Previous topic - Next topic

skywalker

Is this still the format for .lnk files under XP ? Is the format different under other Win OSes?
Looks like quite a project for a program to make such a file. :-)

Thanks.

.LNK File Format
1. Header
2. Shell Item Id List
3. File Location Info
4. Description
5. Relative Path
6. Working Directory
7. Command Line Arguments
8. Icon Filename
9. Additonal Info

1. Header
Size   Contents   Description
4 bytes    Always 4C 00 00 00    This is how windows knows it is a shortcut file
16 bytes    GUID for shortcut files    The current GUID for shortcuts. It may change in the future. 01 14 02 00 00 00 00 00 C0 00 00 00 00 00 46
1 dword    Shortcut flags    Shortcut flags are explained below
1 dword    Target file flags    Flags are explained below
1 qword    Creation time    
1 qword    Last access time    
1 qword    Modification time    
1 dword    File length    The length of the target file. 0 if the target is not a file. This value is used to find the target when the link is broken.
1 dword    Icon number    If the file has a custom icon (set by the flags bit 6), then this long integer indicates the index of the icon to use. Otherwise it is zero.
1 dword    Show Window    the ShowWnd value to pass to the target application when starting it. 1:Normal Window 2:Minimized 3:Maximized
1 dword    Hot Key    The hot key assigned for this shortcut
1 dword    Reserved    Always 0
1 dword    Reserved    Always 0

TNick

This is a hex dump of a .lnk to Outlook Express from my desktop. (XP SP2) Hope it helps...

Quote



4C 20 20 20 01 14 02 20 20 20 20 20 C0 20 20 20 20 20 20 46 9B 20 20 20 20 20 20
20 D8 4C 75 50 B5 A1 C6 01 8C DE C1 51 63 B5 C6 01 20 E0 60 91 1A 7A C4 01 20 EC
20 20 20 20 20 20 01 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 09 01 14 20 1F
50 E0 4F D0 20 EA 3A 69 10 A2 D8 08 20 2B 30 30 9D 19 20 2F 43 3A 5C 20 20 20 20
20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 4A 20 31 20 20 20 20 20 01 35 74 3C
11 20 50 52 4F 47 52 41 7E 31 20 20 32 20 03 20 04 20 EF BE E7 34 C2 6E 01 35 64
5A 14 20 20 20 50 20 72 20 6F 20 67 20 72 20 61 20 6D 20 20 20 46 20 69 20 6C 20
65 20 73 20 20 20 18 20 4E 20 31 20 20 20 20 20 E9 34 39 A7 10 20 4F 55 54 4C 4F
4F 7E 31 20 20 36 20 03 20 04 20 EF BE E7 34 BA 58 01 35 73 3C 14 20 20 20 4F 20
75 20 74 20 6C 20 6F 20 6F 20 6B 20 20 20 45 20 78 20 70 20 72 20 65 20 73 20 73
20 20 20 18 20 42 20 32 20 20 EC 20 20 04 31 20 60 20 20 6D 73 69 6D 6E 2E 65 78
65 20 2A 20 03 20 04 20 EF BE E7 34 BB 58 FE 34 B4 63 14 20 20 20 6D 20 73 20 69
20 6D 20 6E 20 2E 20 65 20 78 20 65 20 20 20 18 20 20 20 59 20 20 20 1C 20 20 20
01 20 20 20 1C 20 20 20 2D 20 20 20 20 20 20 20 58 20 20 20 11 20 20 20 03 20 20
20 D8 FB 26 74 10 20 20 20 20 43 3A 5C 50 72 6F 67 72 61 6D 20 46 69 6C 65 73 5C
4F 75 74 6C 6F 6F 6B 20 45 78 70 72 65 73 73 5C 6D 73 69 6D 6E 2E 65 78 65 20 20
30 20 2E 20 2E 20 5C 20 2E 20 2E 20 5C 20 2E 20 2E 20 5C 20 50 20 72 20 6F 20 67
20 72 20 61 20 6D 20 20 20 46 20 69 20 6C 20 65 20 73 20 5C 20 4F 20 75 20 74 20
6C 20 6F 20 6F 20 6B 20 20 20 45 20 78 20 70 20 72 20 65 20 73 20 73 20 5C 20 6D
20 73 20 69 20 6D 20 6E 20 2E 20 65 20 78 20 65 20 20 20 43 20 3A 20 5C 20 50 20
72 20 6F 20 67 20 72 20 61 20 6D 20 20 20 46 20 69 20 6C 20 65 20 73 20 5C 20 4F
20 75 20 74 20 6C 20 6F 20 6F 20 6B 20 20 20 45 20 78 20 70 20 72 20 65 20 73 20
73 20 10 20 20 20 05 20 20 A0 26 20 20 20 77 20 20 20 60 20 20 20 03 20 20 A0 58
20 20 20 20 20 20 20 76 69 64 65 6F 6D 61 78 32 20 20 20 20 20 20 20 88 CF 82 61
72 F0 E9 4E A7 25 F1 FA F3 15 56 82 0D 8B A3 D3 A9 0D DB 11 AB B5 EA 21 BF 51 CB
D0 88 CF 82 61 72 F0 E9 4E A7 25 F1 FA F3 15 56 82 0D 8B A3 D3 A9 0D DB 11 AB B5
EA 21 BF 51 CB D0 20 20 20 20



L   ...     .      F›     
.LuP.¡..Œ..Qc... à`'.z.. ì
      .               ... .
PàO. ê:i.¢.. +00?. /C:\   
               J 1     .5t<
. PROGRA~1  2 . . ï.ç4.n.5d
Z.   P r o g r a m   F i l
e s   . N 1     é49§. OUTLO
O~1  6 . . ï.ç4.X.5s<.   O
u t l o o k   E x p r e s s
   . B 2  ì  .1 `  msimn.ex
e * . . ï.ç4.Xþ4.c.   m s i
m n . e x e   .   Y   .   
.   .   -       X   .   . 
.û&t.    C:\Program Files\
Outlook Express\msimn.exe 
0 . . \ . . \ . . \ P r o g
r a m   F i l e s \ O u t
l o o k   E x p r e s s \ m
s i m n . e x e   C : \ P
r o g r a m   F i l e s \ O
u t l o o k   E x p r e s
s .   .   &   w   `   .   X
       videomax2       ˆ.,a
rðéN§%ñúó.V,.‹£.©...«.ê!.Q.
.ˆ.,arðéN§%ñúó.V,.‹£.©...«.
ê!.Q..



Regards,
Nick

mnemonic

Hi skywalker,

I don't know what you are trying to achieve, but in case you didn't know: Have a look inside "\masm32\com\examples\shortcut" which is an example on how to make a shortcut (lnk-file).

Regards
Be kind. Everyone you meet is fighting a hard battle.--Plato
-------
How To Ask Questions The Smart Way

skywalker

Thanks for the help.

Andy