Philipp15b / go-steam

Steam's protocol in Go to allow automation of different actions on the Steam network without running an actual Steam client. Includes APIs for friends, chatting, trading, trade offers and TF2 crafting.
https://pkg.go.dev/github.com/Philipp15b/go-steam/v3
Other
387 stars 131 forks source link

Retrieving package VDF data returns binary VDF #100

Closed Jleagle closed 4 years ago

Jleagle commented 5 years ago

Hi, I am trying to get the VDF data on apps and packages. The app proto CMsgClientPICSProductInfoResponse_AppInfo seems to always return okay but trying to get the VDF data from a package CMsgClientPICSProductInfoResponse_PackageInfo always returns binary VDF. Is there a helper somewhere to convert to text? Thanks.

Philipp15b commented 5 years ago

go-steam does not yet contain a VDF parser. Some years ago, @marshauf wrote a VDF parser: see #21.

SteamKit also has an implementation: https://github.com/SteamRE/SteamKit/blob/aa3e7f1750644286a8f4ee144992f80d157b1f71/SteamKit2/SteamKit2/Types/KeyValue.cs#L218.

I would be very happy to accept a keyvalue/vdf related pull request!

Jleagle commented 4 years ago

Thanks for the heads up on marshauf/keyvalues, the only other package I came across was BenLubar/vdf. Both have tests that pass, but the key value structs they created were not actually correct. I ended up porting the binary VDF reader in SteamKit over to a new repo at Jleagle/valve-data-format-go.

One thing I didn't work out was, package vdf has a leading uint32 that needs to be trimmed off, but I didn't see any mention of this in SteamKit.

mjsir911 commented 4 years ago

I'm a bit confused, looking at these repositories they all seem to be parsing the same kind of data, but is there any difference between valve's acf (how the appmanifests are stored on my machine) and the discussed vdf data?

I don't see any "binary" values anywhere that are spoken of.

Jleagle commented 4 years ago

I'm a bit confused, looking at these repositories they all seem to be parsing the same kind of data, but is there any difference between valve's acf (how the appmanifests are stored on my machine) and the discussed vdf data?

I don't see any "binary" values anywhere that are spoken of.

From my limited experience, app data is sent to the steam client as text and package data is sent over as binary.