Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure reading binary VDF files #13

Closed
barraponto opened this issue May 5, 2017 · 7 comments
Closed

Failure reading binary VDF files #13

barraponto opened this issue May 5, 2017 · 7 comments

Comments

@barraponto
Copy link

When I try to read binary files such as appcache/appinfo.vdf or appcache/packageinfo.vdf, I always see the same error:

SyntaxError: Unknown data type at index 5: b"'"

I tried using alt_format=True but it just errors too :/

import vdf
with open('~/.steam/root/appcache/appinfo.vdf', 'rb') as appinfo:
    data = vdf.binary_lods(appinfo.read())
@rossengeorgiev
Copy link
Contributor

rossengeorgiev commented May 5, 2017

The extension says vdf, but it is actually a custom format that has vdf sections for each app. Same for packageinfo.

@EhsanKia
Copy link

EhsanKia commented Aug 6, 2017

Any hint on how to parse it then?

@EhsanKia
Copy link

EhsanKia commented Aug 6, 2017

Seems like appinfo has a new format recently (january 2017). Parser for it would be highly appreciated.

@rossengeorgiev
Copy link
Contributor

rossengeorgiev commented Aug 10, 2017

I had a look around and the format is as follows:

appinfo

uint32   - MAGIC: "'DV\x07"
uint32   - UNIVERSE: 1
---- repeated app sections ----
uint32   - AppID
uint32   - size
uint32   - infoState 
uint32   - lastUpdated
uint64   - accessToken
20bytes  - SHA1
uint32   - changeNumber
variable - binary_vdf
---- end of section ---------
uint32   - EOF: 0

packageinfo

uint32   - MAGIC: "'UV\x06"
uint32   - UNIVERSE: 1
---- repeated package sections ----
uint32   - PackageID
20bytes - SHA1
uint32   - changeNumber
variable - binary_vdf
---- end of section ---------
uint32   - EOF: 0xFFFFFFFF

@rossengeorgiev
Copy link
Contributor

Current beta client has updated the format:

packageinfo

uint32   - MAGIC: "'UV\x06"
uint32   - UNIVERSE: 1
---- repeated package sections ----
uint32   - PackageID
20bytes  - SHA1
uint32   - changeNumber
uint64   - token
variable - binary_vdf
---- end of section ---------
uint32   - EOF: 0xFFFFFFFF

@xPaw
Copy link

xPaw commented Apr 16, 2020

I wrote some C# code to fully parse these files if anyone is interested: https://github.com/SteamDatabase/SteamAppInfo

@rossengeorgiev
Copy link
Contributor

steam package now implements methods for parsing these files in steam.utils.appcache.

ValvePython/steam#179

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants