Skip to content

About

Parser for appinfo.vdf and packageinfo.vdf files used by the Steam client

Topics

Resources

Security policy

Stars

146 stars

Watchers

4 watching

Forks

Latest commit

 

History

30 Commits

Folders and files

Repository files navigation

This is a simple program that finds the Steam installation on disk, reads appinfo.vdf (or its shard files) and packageinfo.vdf files and dumps appid/subid and their tokens.

This is mostly intended as an example on how to read these files.

appinfo.vdf

File Header

Type Size Version Field Name Description
uint32 4 Magic Version identifier (see Version History)
uint32 4 Universe Steam universe (always 1)
int64 8 41 String Table Offset Offset to string table from file start

App Entry (Repeated)

Type Size Version Field Name Description
uint32 4 App ID Steam application ID
uint32 4 36+ Size Size of data until end of binary VDF
uint32 4 Info State State flags (2 = normal, 1 = prerelease/no info)
uint32 4 Last Updated Unix timestamp of last update
uint64 8 38+ PICS Token Product Info Change Set token
bytes 20 38+ SHA-1 Hash Hash of text appinfo VDF
uint32 4 36+ Change Number Steam change number
uint8 1 <38 Section Type Section identifier (repeated until 0x08)
bytes 20 40+ Binary SHA-1 Hash of binary VDF data
bytes variable Binary VDF VDF data in binary format

Repeated read until the first uint32 (App ID) is zero (which is the file footer).

String Table (Version 41)

Located at the offset specified in the file header:

Type Size Version Field Name Description
uint32 4 41 String Count Number of strings in table
null-terminated variable 41 Strings Array of null-terminated strings

This string table is used to deduplicate strings in all the binary vdf blobs, so it is required to parse this string table first, and then parse the binary keyvalues with this string table.

Shard Files (Version 42+)

appinfo.vdf is replaced by 256 files named appcache/appinfo/appinfo_XX.vdf, where XX is the shard index in hex. If appinfo.vdf still exists, Steam reads it, writes the shard files and deletes it.

The shard index of an app is the low byte of the MurmurHash3 finalizer of its App ID:

h = appid;
h ^= h >> 16;
h *= 0x85EBCA6B;
h ^= h >> 13;
h *= 0xC2B2AE35;
h ^= h >> 16;
shard = h & 0xFF;

Each file is a header followed by the index, the string table and the data, in that order.

Shard Header

Type Size Field Name Description
uint32 4 Magic Version identifier (see Version History)
uint32 4 Universe Steam universe (always 1)
uint32 4 Shard Index Same as in the file name
uint32 4 Shard Count Number of shard files
uint32 4 App Count Number of index entries
uint32 4 Index Size Size of the index in bytes
uint32 4 String Count Number of strings in the string table
uint32 4 String Table Size Size of the string table in bytes
uint32 4 Data Size Size of the data in bytes
uint32 4 Index CRC CRC-32 of the index and the string table
uint32 4 Header CRC CRC-32 of the header fields before this one

Index Entry (Repeated)

Type Size Field Name Description
uint32 4 App ID Steam application ID
uint32 4 Data Offset Offset to the data entry from the start of the data
uint32 4 Data Size Size of the data entry
uint32 4 Summary Size Size of the remaining fields of this entry
uint32 4 Change Number Steam change number
uint32 4 Last Updated Unix timestamp of last update
uint64 8 PICS Token Product Info Change Set token
uint8 1 Prerelease 1 when the info state is prerelease/no info
bytes 20 SHA-1 Hash Hash of text appinfo VDF
uint32 4 Type common/type as a flag (1 = game, 2 = application, 4 = tool, 8 = demo, 32 = dlc, ...)
uint32 4 Parent common/parent
uint8 1 exfgls 1 when common/exfgls is not zero
uint32 4 Additional Content Count Number of app ids that follow
uint32 4 each Additional Content Keys of extended/additionalcontentforapps, except the app's own id
int32 4 Release State common/ReleaseState as a number
int32 4 Release State Override common/ReleaseStateOverride as a number
int32 4 Release State Steam China common/releasestatesteamchina as a number
uint8 1 Release State Override Inverse common/ReleaseStateOverrideInverse
null-terminated variable Release State Override Countries common/ReleaseStateOverrideCountries

Repeated App Count times. The fields after SHA-1 Hash are derived from values in the binary VDF.

String Table

Null-terminated strings without a count, used by the binary VDF of every app in the same file.

Data Entry

Type Size Field Name Description
bytes 20 Binary SHA-1 Hash of binary VDF data
bytes variable Binary VDF VDF data in binary format

Version History

Version Magic Number Start Date Description
36 0x06564424 circa 2011 Added size field
37 0x07564425 circa 2012 Same structure as v36
38 0x07564426 circa 2013 Added PICS token and SHA hash
39 0x07564427 circa 2017 Same as v38 but unified VDF structure
40 0x07564428 Dec 2022 Added binary VDF SHA1 hash validation
41 0x07564429 June 2024 Added string table with offset pointer
42 0x0756442A Nov 2026 Split into shard files

For parsing older formats not implemented here, see this repo.

SHA-1 Hash Fields

The appinfo format includes two different hash fields that serve different purposes:

SHA-1 Hash

This field contains the SHA-1 hash of the raw CMsgClientPICSProductInfoResponse.AppInfo.buffer from Steam's internal protobuf protocol, excluding the last byte (which is always \x00). This hash is used by Steam for downloading appinfo from CDN via HTTP and corresponds to the hash provided when the Steam client requests appinfo from the server.

This hash cannot be easily recalculated from the VDF data alone, as it represents the hash of the original protobuf buffer that Steam received from the server, not a hash of the local VDF representation.

Binary SHA-1 Hash (20 bytes, version 40+)

This field contains the SHA-1 hash of the binary VDF data that follows immediately after this field. This hash can be calculated directly from the VDF data and is used to verify the integrity of the local binary VDF content.

packageinfo.vdf

File Header

Type Size Version Field Name Description
uint32 4 Magic Version identifier (see Version History)
uint32 4 Universe Steam universe (always 1)

Package Entry (Repeated)

Type Size Version Field Name Description
uint32 4 Package ID Steam package/subscription ID
bytes 20 SHA-1 Hash Hash of package data
uint32 4 Change Number Steam change number
uint64 8 40+ PICS Token Product Info Change Set token
bytes variable Binary VDF VDF data in binary format

Repeated read until the first uint32 (Package ID) is 0xFFFFFFFF (which is the file footer).

Version History

Version Magic Number Start Date Description
39 0x06565527 Before Apr 2020 Basic format
40 0x06565528 Apr 2020 Added PICS Token field

About

Parser for appinfo.vdf and packageinfo.vdf files used by the Steam client

Topics

Resources

Security policy

Stars

146 stars

Watchers

4 watching

Forks

Sponsor this project

Used by

Contributors

Languages