After the strings comes the extra data: zero or more blocks, then a terminal block of four bytes with a value below 4. Each block starts with a 32-bit size and a 32-bit signature.
Older shortcuts often have no terminal block. In the 171 distinct real shortcuts checked for this page, 64 end straight after their last block (or have no extra data at all). A reader should accept both.
The blocks
0BlockSize the size of this block, this field included44BlockSignature which block this is48the block’s own fieldsvaries
| Signature | Block | Size | Holds |
|---|---|---|---|
0xA0000001 | EnvironmentVariableDataBlock | 0x314 | A path with environment variables. |
0xA0000002 | ConsoleDataBlock | 0xCC | Console window settings. |
0xA0000003 | TrackerDataBlock | 0x60 | Link tracking identifiers. |
0xA0000004 | ConsoleFEDataBlock | 0x0C | A console code page. |
0xA0000005 | SpecialFolderDataBlock | 0x10 | A special folder. |
0xA0000006 | DarwinDataBlock | 0x314 | A Windows Installer application identifier. |
0xA0000007 | IconEnvironmentDataBlock | 0x314 | An icon path with environment variables. |
0xA0000008 | ShimDataBlock | at least 0x88 | A compatibility shim layer name. |
0xA0000009 | PropertyStoreDataBlock | at least 0x0C | Properties of the target. |
0xA000000B | KnownFolderDataBlock | 0x1C | A known folder. |
0xA000000C | VistaAndAboveIDListDataBlock | at least 0x0A | An alternative IDList. |
ConsoleDataBlock
Display settings for a target that runs in a console window.
| Offset | Size | Name | Description |
|---|---|---|---|
| 8 | 2 | FillAttributes | Text and background colours: bits 0–3 blue, green, red, intensity for the text, bits 4–7 the same for the background. |
| 10 | 2 | PopupFillAttributes | The same, for popups. |
| 12 | 2 | ScreenBufferSizeX | The screen buffer width, in characters. |
| 14 | 2 | ScreenBufferSizeY | The screen buffer height, in characters. |
| 16 | 2 | WindowSizeX | The window width, in characters. |
| 18 | 2 | WindowSizeY | The window height, in characters. |
| 20 | 2 | WindowOriginX | The window’s left position, in pixels. |
| 22 | 2 | WindowOriginY | The window’s top position, in pixels. |
| 24 | 4 | Unused1 | Undefined; ignored. |
| 28 | 4 | Unused2 | Undefined; ignored. |
| 32 | 4 | FontSize | The two high bytes give the font height, the two low bytes the width, in pixels. |
| 36 | 4 | FontFamily | A family (0x10 roman, 0x20 swiss, 0x30 modern, 0x40 script, 0x50 decorative) plus pitch bits (1 fixed, 2 vector, 4 TrueType, 8 device). |
| 40 | 4 | FontWeight | Below 700 is regular, 700 or more is bold. |
| 44 | 64 | Face Name | The font face name, 32 UTF-16 characters. |
| 108 | 4 | CursorSize | 25 or less small, 26 to 50 medium, 51 to 100 large. |
| 112 | 4 | FullScreen | Non-zero opens the console full screen. |
| 116 | 4 | QuickEdit | Non-zero turns QuickEdit on. |
| 120 | 4 | InsertMode | Non-zero turns insert mode on. |
| 124 | 4 | AutoPosition | Non-zero lets the system place the window. |
| 128 | 4 | HistoryBufferSize | The size of each history buffer, in characters. |
| 132 | 4 | NumberOfHistoryBuffers | The number of history buffers. |
| 136 | 4 | HistoryNoDup | Whether duplicates are allowed in the history: zero means not allowed, non-zero allowed (as MS-SHLLINK states). |
| 140 | 64 | ColorTable | Sixteen 32-bit RGB colours, which the fill attributes index. |
ConsoleFEDataBlock
| Offset | Size | Name | Description |
|---|---|---|---|
| 8 | 4 | CodePage | The code page for showing text in a console window. MS-SHLLINK calls it a language code identifier ([MS-LCID]); consoles in practice store a Windows code page number such as 437 or 932. The viewer names about ninety code pages from Microsoft’s code page identifier list (437, 850, 932, 936, 949, 950, 1250–1258, 65001 and so on) and the common language IDs (0x0409 English (United States), 0x0411 Japanese and others), and says when a value is in neither list. |
DarwinDataBlock
An application identifier used instead of the target IDList to install an application when the link is activated.
| Offset | Size | Name | Description |
|---|---|---|---|
| 8 | 260 | DarwinDataAnsi | The identifier in the system code page, zero-terminated. MS-SHLLINK says this should be ignored. |
| 268 | 520 | DarwinDataUnicode | The identifier in UTF-16, zero-terminated. Optional. |
EnvironmentVariableDataBlock
A path containing environment variables. Flag HasExpString says it is present.
| Offset | Size | Name | Description |
|---|---|---|---|
| 8 | 260 | TargetAnsi | The path in the system code page, zero-terminated. |
| 268 | 520 | TargetUnicode | The path in UTF-16, zero-terminated. |
IconEnvironmentDataBlock
The same layout as the environment block, for the icon’s path.
| Offset | Size | Name | Description |
|---|---|---|---|
| 8 | 260 | TargetAnsi | The icon path in the system code page, zero-terminated. |
| 268 | 520 | TargetUnicode | The icon path in UTF-16, zero-terminated. |
KnownFolderDataBlock
| Offset | Size | Name | Description |
|---|---|---|---|
| 8 | 16 | KnownFolderID | The folder’s GUID. The viewer names every GUID on Microsoft’s KNOWNFOLDERID page (92 of them) by its FOLDERID name, for example Desktop {B4BFCC3A-DB2C-424C-B029-7FE99A87C641}, Downloads {374DE290-123F-4565-9164-39C4925E467B} and ProgramFilesX86 {7C5A40EF-A0FB-4BFC-874A-C0F2E0B9FA8E}. |
| 24 | 4 | Offset | Offset into the target IDList of the first item after the folder. |
SpecialFolderDataBlock
| Offset | Size | Name | Description |
|---|---|---|---|
| 8 | 4 | SpecialFolderID | The folder’s integer ID (a CSIDL value, for example 0x26 CSIDL_PROGRAM_FILES, 0x2A CSIDL_PROGRAM_FILESX86, 0x1A CSIDL_APPDATA). The viewer names the CSIDL values that the Windows shell headers define in the range 0x00 to 0x3D (including 0x01 CSIDL_INTERNET); any other value is shown as unknown. |
| 12 | 4 | Offset | Offset into the target IDList of the first item after the folder. |
ShimDataBlock
| Offset | Size | Name | Description |
|---|---|---|---|
| 8 | varies | LayerName | The name of a shim layer to apply when the target is activated, in UTF-16. |
TrackerDataBlock
Data for the Link Tracking service.
| Offset | Size | Name | Description |
|---|---|---|---|
| 8 | 4 | Length | The size of the rest of the block, this field included; must be 0x58. |
| 12 | 4 | Version | Must be zero. |
| 16 | 16 | MachineID | The NetBIOS name of the machine that last held the target, zero-terminated. |
| 32 | 16 | DroidVolumeID | The target’s volume: the object ID kept in the NTFS $Volume file. Usually a random (version 4) GUID. |
| 48 | 16 | DroidFileID | The target’s object ID, from the NTFS $OBJECT_ID attribute of the file. |
| 64 | 16 | BirthDroidVolumeID | The volume when the object ID was first made. |
| 80 | 16 | BirthDroidFileID | The object ID when it was first made; it stays the same when the file is moved to another volume, while the droid pair is updated. |
The file IDs are version 1 UUIDs, and the viewer decodes them. The GUID is stored as a
little-endian time_low (4 bytes), time_mid (2) and
time_hi_and_version (2) followed by the clock sequence (2, big-endian, with the
variant in its top bits) and a 6-byte node. The 60-bit time, made from the three time fields
(time_hi without its version nibble, then time_mid, then
time_low), counts 100-nanosecond steps from 15 October 1582, and the node is
normally the MAC address of the machine that created the object. Example from a real
shortcut (the plaso test file NeroInfoTool.lnk): {958705B5-0D19-11DF-9FE4-705AB616A5F3}
decodes to 29 January 2010 21:02:17 UTC, clock sequence 8164 and node
70:5a:b6:16:a5:f3; the same shortcut’s header records the target as created on 5 June 2009, so the
object ID was made later than the file: the time is when the service first gave the
file an ID, not when the file was created. Volume IDs are random version 4 GUIDs, which carry no time or address.
PropertyStoreDataBlock
After the block size and signature comes a serialized property store, defined in Microsoft’s MS-PROPSTORE: a sequence of property storages.
Each storage:
| Size | Name | Description |
|---|---|---|
| 4 | Storage Size | The size of this storage. Zero in the last, empty storage. |
| 4 | Version | Must be 0x53505331. |
| 16 | Format ID | A GUID for what the properties mean. {D5CDD505-2E9C-101B-9397-08002B2CF9AE} means properties named by strings; otherwise by integers. |
| varies | values | The serialized property values. |
Each value with an integer name:
| Size | Name | Description |
|---|---|---|
| 4 | Value Size | The size of this value. Zero in the last, empty value. |
| 4 | Id | The property’s number. |
| 1 | Reserved | Zero. |
| varies | Value | A typed value: a 16-bit VT type, two padding bytes, then the value. |
In a storage with string names, the Id is replaced by a 32-bit
Name Size, and a UTF-16 zero-terminated Name follows the
reserved byte. Property storages are also used in shell item extension blocks
(0xBEEF0010, 0021 and 0027) and in APPS items.
The type list, the layout of each type, the vector and array headers, DECIMAL, the
indirect property names and the clipboard data were checked against [MS-OLEPS] (sections
2.2, 2.6, 2.10 to 2.15). The viewer decodes these value types ([MS-OLEPS]):VT_EMPTY, VT_NULL,
VT_I2, VT_I4, VT_R4, VT_R8,
VT_CY, VT_DATE, VT_BSTR, VT_ERROR,
VT_BOOL, VT_I1, VT_UI1, VT_UI2,
VT_UI4, VT_I8, VT_UI8, VT_INT,
VT_UINT, VT_LPSTR, VT_LPWSTR, VT_FILETIME,
VT_BLOB (size and bytes) and VT_CLSID, and vectors (type with
0x1000 set: a 32-bit count, then the elements, strings padded to 4 bytes)
of the same. It also decodes the types built from them:
VT_DECIMAL: 16 bytes, a reserved 16-bit value, the scale (one byte), the sign (0x80is negative), then a 32-bit high part and a 64-bit low part; the value is that 96-bit integer divided by ten to the power of the scale.VT_VARIANT: a typed value of its own (type, padding, value), so a vector of variants is a count followed by typed values.VT_STREAM,VT_STORAGE,VT_STREAMED_OBJECT,VT_STORED_OBJECT: a 32-bit size and the name of the stream or storage in the property set;VT_VERSIONED_STREAMadds a GUID before it;VT_BLOB_OBJECTis a size and bytes.VT_CF(clipboard data): a size (of the format and data, padding not counted), an application-specific format identifier, the data and zero padding to a multiple of 4 bytes.- Arrays (type with
0x2000set): the element type again, the number of dimensions, a size and an index offset for each, then the elements in order.
Property names: a property is named by its set GUID and number. The viewer looks them up
in the Windows property keys of propkey.h (1,067 keys, taken from the Wine
project’s copy, kept beside the plugin as propkeys.txt) and in nine more that
Microsoft’s documentation of the properties (the MicrosoftDocs/win32 repository, 1,029 property
pages) lists and Wine lacks: System.ActivityDate, System.ActivityIcon,
System.Devices.AepService.Bluetooth.RfcommService.CacheMode and .Device
and the five System.StorageProvider… keys, kept as propkeys-ms.txt
(the documentation also lists …GattService.CacheMode and .Device, which
reuse the keys of Bluetooth.CacheMode and TargetDevice): the key
PKEY_Link_TargetParsingPath shows as System.Link.TargetParsingPath,
so for example {B9B4B3FC-2B51-4A42-B5D8-324146AFCF25} number 2 is that property,
{9F4C2855-9F79-4B39-A8D0-E1D42DE1D5F3} number 5 is
System.AppUserModel.ID and {B725F130-47EF-101A-A5F1-02608C9EEBAC}
number 10 is System.ItemNameDisplay. A pair that is not in that header is shown
as the GUID and the number. The set {46588AE2-4CBC-4338-BBFC-139326986DCE} with
property 4 holds a string that looks like the Windows security identifier (SID) of the user
who made the shortcut (as in the NeroInfoTool sample); neither propkey.h nor the property
set lists on winsps-kb give it a name.
VistaAndAboveIDListDataBlock
An alternative to the LinkTargetIDList, on platforms that support it.
| Offset | Size | Name | Description |
|---|---|---|---|
| 8 | varies | IDList | The same list as a LinkTargetIDList’s IDList, ended by a TerminalID. |
TerminalBlock
Four bytes, with a value below 4 (in practice, four zero bytes). MS-SHLLINK requires it, though real files from older systems often leave it out.