Compare commits

...

318 Commits

Author SHA1 Message Date
Yaakov 54b0af377b
Merge pull request #645 from SteamRE/dependabot/github_actions/actions/checkout-5 2 weeks ago
dependabot[bot] 5164a9f963
Bump actions/checkout from 4 to 5
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2 weeks ago
dependabot[bot] 2d2113a8e9
Bump actions/setup-dotnet from 4 to 5 (#650)
Bumps [actions/setup-dotnet](https://github.com/actions/setup-dotnet) from 4 to 5.
- [Release notes](https://github.com/actions/setup-dotnet/releases)
- [Commits](https://github.com/actions/setup-dotnet/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/setup-dotnet
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2 weeks ago
Pavel Djundik 5d6950afd9
Merge pull request #635 from SteamRE/dependabot/nuget/DepotDownloader/SteamKit2-3.3.0
Bump SteamKit2 from 3.2.0 to 3.3.0
4 months ago
Yaakov b042b055c4
Adapt to SteamRE/SteamKit#1544 so that we can build again 4 months ago
dependabot[bot] 02a525acdb
Bump SteamKit2 from 3.2.0 to 3.3.0
---
updated-dependencies:
- dependency-name: SteamKit2
  dependency-version: 3.3.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
4 months ago
Pavel Djundik c553ef4d60 Update steamkit, bump version 5 months ago
Pavel Djundik 9e203e0d7c Bump version to 3.3.0 5 months ago
Pavel Djundik 76038d83e8 Add a message about missing `-remember-password` 5 months ago
Pavel Djundik c21489d304 Remove asking for beta password interactively because it messes with beta branches
For example steamvr has a public beta branch, and it also includes shared redist depots which obviously have no beta branch.
5 months ago
Pavel Djundik 0d37091adf Do not attempt to get free license from anonymous account
Fixes #624
5 months ago
Pavel Djundik 0d66cf09ac Add -no-mobile 5 months ago
Pavel Djundik 8d875579c5 Print that -qr can be replaced with -username when password is remembered 5 months ago
Pavel Djundik ff9c709787 -qr should not be used with -account 5 months ago
Pavel Djundik bce88e4d32 Fix printing qr code 5 months ago
Pavel Djundik 08542bd09f Suggest logging in if no manifest code is returned 5 months ago
Pavel Djundik 665f83983b Implement private branches
Fixes #514
Fixes #620
5 months ago
Pavel Djundik 272f5b646a Ignore launch settings from git 5 months ago
Pavel Djundik f078581947 Print arguments that were not consumed
Fixes #88
5 months ago
Pavel Djundik 4896ac0788
Add token in winget action 6 months ago
Pavel Djundik 401d086191 Make stored credentials dictionaries case insensitive
Fixes #539
6 months ago
Pavel Djundik 8d8c6fc59a
Merge pull request #610 from SteamRE/609-freetodownload-depotfromapp
Fix getting manifest code for freetodownload apps that use depotfromapp
6 months ago
Nicholas Hastings 19df5910c3 Fix getting manifest code for freetodownload apps that use depotfromapp 6 months ago
Pavel Djundik 1e72a47846 Add -debug to help 7 months ago
Pavel Djundik 2c07abb015 Exactly 64 is fine 7 months ago
Pavel Djundik 2682d44684 Add password length and non-ascii character warning
Fixes #601
7 months ago
Pavel Djundik be3682cd4b Remove -max-servers from help 7 months ago
Pavel Djundik 644e3f1ebc Add faq about -max-downloads 7 months ago
Pavel Djundik 56822a831f Return server when timing out as broken connection 7 months ago
Pavel Djundik 001f5303a7 Replace InvokeAsync with Parallel.ForEachAsync 7 months ago
Pavel Djundik 0150b7eff4 Vastly simplify CDNClientPool 7 months ago
Pavel Djundik 14c6a6dafa Remove -max-servers since it is unused 7 months ago
Yaakov 0617974ac0
Merge pull request #600 from SteamRE/dependabot/nuget/Microsoft.Windows.CsWin32-0.3.183
Bump Microsoft.Windows.CsWin32 from 0.3.162 to 0.3.183
7 months ago
dependabot[bot] 3249d284ba
Bump Microsoft.Windows.CsWin32 from 0.3.162 to 0.3.183
Bumps [Microsoft.Windows.CsWin32](https://github.com/microsoft/CsWin32) from 0.3.162 to 0.3.183.
- [Release notes](https://github.com/microsoft/CsWin32/releases)
- [Commits](https://github.com/microsoft/CsWin32/compare/v0.3.162...v0.3.183)

---
updated-dependencies:
- dependency-name: Microsoft.Windows.CsWin32
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
7 months ago
Pavel Djundik 7b3cf4c6c7
Merge pull request #595 from SteamRE/dependabot/nuget/multi-acf9728d79
Bump protobuf-net and SteamKit2
8 months ago
dependabot[bot] b6fc6d5c6f
Bump protobuf-net and SteamKit2
Bumps [protobuf-net](https://github.com/protobuf-net/protobuf-net) and [SteamKit2](https://github.com/SteamRE/SteamKit). These dependencies needed to be updated together.

Updates `protobuf-net` from 3.2.46 to 3.2.46
- [Release notes](https://github.com/protobuf-net/protobuf-net/releases)
- [Changelog](https://github.com/protobuf-net/protobuf-net/blob/main/docs/releasenotes.md)
- [Commits](https://github.com/protobuf-net/protobuf-net/commits)

Updates `SteamKit2` from 3.0.1 to 3.0.2
- [Release notes](https://github.com/SteamRE/SteamKit/releases)
- [Commits](https://github.com/SteamRE/SteamKit/compare/3.0.1...3.0.2)

---
updated-dependencies:
- dependency-name: protobuf-net
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: SteamKit2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
8 months ago
Pavel Djundik 4dbe7ede14
Merge pull request #592 from SteamRE/dependabot/nuget/protobuf-net-3.2.46
Bump protobuf-net from 3.2.45 to 3.2.46
8 months ago
dependabot[bot] 24d7f0b02a
Bump protobuf-net from 3.2.45 to 3.2.46
Bumps [protobuf-net](https://github.com/protobuf-net/protobuf-net) from 3.2.45 to 3.2.46.
- [Release notes](https://github.com/protobuf-net/protobuf-net/releases)
- [Changelog](https://github.com/protobuf-net/protobuf-net/blob/main/docs/releasenotes.md)
- [Commits](https://github.com/protobuf-net/protobuf-net/commits)

---
updated-dependencies:
- dependency-name: protobuf-net
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
8 months ago
Yaakov 3bd2cf52ba
Merge pull request #584 from SteamRE/dependabot/nuget/Microsoft.Windows.CsWin32-0.3.162
Bump Microsoft.Windows.CsWin32 from 0.3.106 to 0.3.162
8 months ago
dependabot[bot] f660b95d3f
Bump Microsoft.Windows.CsWin32 from 0.3.106 to 0.3.162
Bumps [Microsoft.Windows.CsWin32](https://github.com/microsoft/CsWin32) from 0.3.106 to 0.3.162.
- [Release notes](https://github.com/microsoft/CsWin32/releases)
- [Commits](https://github.com/microsoft/CsWin32/compare/v0.3.106...v0.3.162)

---
updated-dependencies:
- dependency-name: Microsoft.Windows.CsWin32
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
8 months ago
Pavel Djundik 17d3996588 Add `-branchpassword`, change `-beta` to `-branch` in help text 9 months ago
Pavel Djundik 5d0c4fb050 Bump version to 3.0.0 9 months ago
Pavel Djundik d087678628 Disallow using -remember-password and -qr without -username 9 months ago
Pavel Djundik deac83600c
Merge pull request #565 from tpill90/AddLancacheSupport
Adding support for Lancache
9 months ago
Tim Pilius f567a63d84 Adding log message for when the lancache has been detected. 9 months ago
Tim Pilius e9a5abecb7 Adding support for Lancache with a new optional flag. 9 months ago
Pavel Djundik 5fe8a827d8 Use depotfromapp for getting manifest codes
Partially reverts 3143362d83

Fixes #569
Fixes #570
10 months ago
Pavel Djundik 682bfbac27 Do not abort downloading if one depot fails to get depot key 10 months ago
NicknineTheEagle 1c97b42124 Use Steam manifest format 10 months ago
Pavel Djundik 0fb803b5f6 Catch RequestFreeAppLicense exception 10 months ago
Pavel Djundik 2a939053d0 Add support for FreeToDownload apps 10 months ago
Pavel Djundik 4539666214 Cleanup 10 months ago
Yaakov fac3a22f4f Fix CA2022 warning 10 months ago
Yaakov 6c09739c8c Update to .NET 9 10 months ago
Pavel Djundik ff37997713 Add InvariantGlobalization 10 months ago
Pavel Djundik 72ffd79da6 Update packages 11 months ago
Ethan 2d06bf1c63 Improve `-filelist` comment
Fixes #554
11 months ago
Pavel Djundik 6a9364029b Tick callbacks in an infinite task 11 months ago
Pavel Djundik 9ed8a70508 Update steamkit 11 months ago
Pavel Djundik 247f8324ca
Merge pull request #501 from giacomopc/master
-all-archs: Allow to download all archs
11 months ago
Pavel Djundik a5bdf23880 Use GetStdHandle_SafeHandle 11 months ago
Pavel Djundik 926c41e7e0 Use cswin32 in ansi detector 11 months ago
Pavel Djundik 33738aeb49 Disable progress ansi reporting on linux
Some terminals use this code to show notifications instead
11 months ago
Pavel Djundik 177c44ef4a Let steamkit handle connect timeouts
Ref: #546
12 months ago
Pavel Djundik 9f64bd0439 Await steam jobs instead of WaitUntilCallback 12 months ago
Pavel Djundik e7d637ace6 Change dependabot to weekly 12 months ago
Pavel Djundik 6a0147ee72 Update steamkit, use new cdn auth token function
Fixes #545
12 months ago
Pavel Djundik 5a695e6dd1
Bump version to 2.7.2 12 months ago
Yaakov bffa2d5f50
Merge pull request #541 from SteamRE/dependabot/nuget/SteamKit2-3.0.0-Beta.3
Bump SteamKit2 from 3.0.0-Beta.2 to 3.0.0-Beta.3
1 year ago
dependabot[bot] 48794cfb4d
Bump SteamKit2 from 3.0.0-Beta.2 to 3.0.0-Beta.3
Bumps [SteamKit2](https://github.com/SteamRE/SteamKit) from 3.0.0-Beta.2 to 3.0.0-Beta.3.
- [Release notes](https://github.com/SteamRE/SteamKit/releases)
- [Commits](https://github.com/SteamRE/SteamKit/compare/3.0.0-Beta.2...3.0.0-Beta.3)

---
updated-dependencies:
- dependency-name: SteamKit2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
1 year ago
Giacomo Preciado 39e43a1bf9
Merge branch 'master' into master 1 year ago
Giacomo Preciado b310d804f2 Updated README.md and help output 1 year ago
Pavel Djundik 907b3360cc
Forgot to bump version 1 year ago
Pavel Djundik 8117d8f6c2 Add -V/--version
Fixes #531
1 year ago
Pavel Djundik 53fefe6da2 Change exit code when using no params to zero 1 year ago
Pavel Djundik b9895121a4 Add header 1 year ago
Yaakov 83e2dbb03f Tweak installation instructions and add Homebrew 1 year ago
Pavel Djundik 317122f4aa Update README.md 1 year ago
Pavel Djundik 831bdb6001 Create github action to automatically submit new versions to winget 1 year ago
Pavel Djundik a3725da282
Merge pull request #530 from SteamRE/warnings
Fix warnings, enable Warnings as Errors
1 year ago
Yaakov fa486d1e5f even though we will probably never run on XP, this silences CA1416 1 year ago
Yaakov b1a36462cc Enable warnings as errors in CI 1 year ago
Yaakov 0772448cd9 Add ContinuousIntegrationBuild to CI 1 year ago
Pavel Djundik b5d4926f1e Update bug-report.yml 1 year ago
Pavel Djundik 8ffd52a214
Merge pull request #526 from SteamRE/alert
Display a message box when exe is not lauched from console
1 year ago
Pavel Djundik 92785c522b
Merge pull request #528 from SteamRE/execute
Use File.SetUnixFileMode
1 year ago
Pavel Djundik fec2fe746a Use File.SetUnixFileMode 1 year ago
Pavel Djundik 0ce116fdce Use CsWin32 1 year ago
Pavel Djundik a1f981168c Wrap parameters in code block 1 year ago
Pavel Djundik 240f789872 Update README.md 1 year ago
Pavel Djundik 785b0fe0b0 Update README.md 1 year ago
Pavel Djundik 653506ac14 Automatically upload all artifacts to releases 1 year ago
Pavel Djundik 48c00e5323 Add trim_trailing_whitespace 1 year ago
Pavel Djundik 1620090c19 Make extens stricter 1 year ago
Pavel Djundik 13b396b0d2 Align help output with spaces 1 year ago
Pavel Djundik 4c88a59f17 Display a message box when exe is not lauched from console 1 year ago
Pavel Djundik c62d2d733f Use full matrix name in sk2-ci 1 year ago
Pavel Djundik 75cbd8b12a Enable Deterministic 1 year ago
Pavel Djundik bae332b97a Add license header to all source files
Fixes #55
1 year ago
Pavel Djundik 1b95a6ba47 Copy license file to build output 1 year ago
Pavel Djundik e2194fc873 Attempt to get cdn auth when getting 403 1 year ago
Pavel Djundik 33f0a7fcba Reset ansi progress on disconnect 1 year ago
Pavel Djundik 6edab0c55e Use ReadAllLinesAsync and async main 1 year ago
Pavel Djundik baa64e9e51 Update DownloadDepotChunkAsync to use array pool 1 year ago
Pavel Djundik a3fc9c4c45 Remove inlined adler hash 1 year ago
Pavel Djundik 294dbff40a Optimize calculating adler hashes to not allocate entire chunk in memory 1 year ago
Pavel Djundik e7e2299b70 Update SteamKit 1 year ago
Pavel Djundik 9a3f27ddec
Merge pull request #517 from SteamRE/progress
Use ansi escape code to indicate download progress in taskbar
1 year ago
Pavel Djundik ccbffd1c08 Use ansi escape code to indicate download progress in taskbar 1 year ago
Pavel Djundik ae72ac03c9 Update steamkit, fix line endings 1 year ago
Pavel Djundik c6a5bcf87e
Merge pull request #511 from SteamRE/dependabot/nuget/QRCoder-1.6.0
Bump QRCoder from 1.4.3 to 1.6.0
1 year ago
Pavel Djundik f00ef83029
Merge pull request #484 from er2off/master
Add FreeBSD support
1 year ago
Pavel Djundik 65c07130a1 Fix style violations 1 year ago
Pavel Djundik 9d04652f60 Add SymmetricDecryptECB to util 1 year ago
dependabot[bot] beb8ef8507
Bump QRCoder from 1.4.3 to 1.6.0
Bumps [QRCoder](https://github.com/codebude/QRCoder) from 1.4.3 to 1.6.0.
- [Release notes](https://github.com/codebude/QRCoder/releases)
- [Commits](https://github.com/codebude/QRCoder/compare/v1.4.3...v1.6.0)

---
updated-dependencies:
- dependency-name: QRCoder
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
1 year ago
Giacomo Preciado ddda3924dc new parameter -all-archs downloads all OS archs 1 year ago
Pavel Djundik b96125f9cb Bump version 1 year ago
Pavel Djundik b75d398392 Fix bracket 1 year ago
Pavel Djundik b532f3944f Update to steamkit 3.0.0-Alpha.1 1 year ago
Pavel Djundik 544d19e925 Update github action packages 1 year ago
Er2 d8ccf800ca Add FreeBSD support 2 years ago
Pavel Djundik 9d2446404a
Merge pull request #474 from SteamRE/cleanup
Cleanup
2 years ago
Pavel Djundik 93318f2b11
Merge pull request #473 from SteamRE/tokens
Handle more invalid token eresults
2 years ago
Pavel Djundik 0f00ea592e Remove Steam3Session.Credentials 2 years ago
Pavel Djundik 93de24c7f5 Remove constructor setters 2 years ago
Pavel Djundik 7739fac67c Cleanup 2 years ago
Pavel Djundik fac3ac229e Print the actual result 2 years ago
Pavel Djundik 19feb49bfa Handle more invalid token eresults
Fixes #460
2 years ago
Yaakov 5cb0c17aa3
Update README.md for .NET 8 2 years ago
Yaakov 366f98e80b Merge branch 'dotnet8' 2 years ago
Yaakov 828ba1ecaf Merge branch 'net8' 2 years ago
Yaakov 3429010f50 Fix another instance of new .NET 8 SDK warning 2 years ago
Yaakov bf71c4c0b9 Remove obsolete sentry file code 2 years ago
Yaakov 225a26c321 Fix warning NETSDK1194 about --output from .sln files 2 years ago
Yaakov 09f9674bad Update NuGet packages (uncl SK2) 2 years ago
Yaakov 6c51846c5b fix public types causing xmldoc warnings by making them internal 2 years ago
Yaakov 679e019f27 fix compiler warning re. IDE0005 2 years ago
Yaakov 55fda1a0dd update tfm to net8.0 2 years ago
Yaakov 2027d919f9
Merge pull request #470 from SteamRE/ci/macos-arm
Update CI
2 years ago
Yaakov b75c83cbf1 Update global.json for sdk 8 2 years ago
Yaakov b4a6c70d58 update CI to use .NET 8 SDK 2 years ago
Yaakov 665901cbdc Add new GitHub Actions M1 runners to CI 2 years ago
Antoine Rybacki e81efa7a46 rectify parameters order 2 years ago
Antoine Rybacki 725b5a3955 misc 2 years ago
Antoine Rybacki db3dc55598 fix warning linked to --output 2 years ago
Antoine Rybacki 69707095cd address feedback 2 years ago
Antoine Rybacki 29eed5b9df remove unused using 2 years ago
Antoine Rybacki 4220d76de6 Remove unneeded guarddata file handling 2 years ago
Antoine Rybacki 5b4917eb29 more CA fix 2 years ago
Antoine Rybacki 58182284b2 code analysis fix 2 years ago
Antoine Rybacki bf0f89fed0 Remove Deprecated SentryData and add GuardData 2 years ago
Antoine Rybacki 5077640cf2 fix CA1834 2 years ago
Antoine Rybacki 43e0cccd47 Bump to net8 2 years ago
Pavel Djundik 4c52ad3a4c Upload only a single framework build 2 years ago
Pavel Djundik ec692a8d9e
Bump version to 2.5.0 2 years ago
Pavel Djundik 0122f0f63f
Run automatic CI only on Sundays 2 years ago
Pavel Djundik 5b6315c8ca
Merge pull request #433 from SteamRE/no-old-gids
Remove code to handle older style of gids
2 years ago
Pavel Djundik cc5da551f9 Case-insensitive comparison of `public` branch
Fixes #429
Fixes #428
2 years ago
Pavel Djundik 0e8b662715 Do not try to print machine auth hash 2 years ago
Pavel Djundik 9aaed770d7
Merge pull request #401 from SteamRE/auth/accesstoken
Add support for new Steam authentication
2 years ago
Pavel Djundik 8d31a80c98 Remove code to handle older style of gids 2 years ago
Pavel Djundik 92809ab8eb
Merge pull request #427 from SteamRE/encrypted-gid
Support new encrypted gid key
2 years ago
Pavel Djundik 2cfee72f69 Support new `gid` field in encrypted manifests 2 years ago
Pavel Djundik 4f7b601e2c Remove support for encrypted_gid (v1) 2 years ago
Pavel Djundik 33f78dfff5
Fix formatting
Fixes #426
2 years ago
Pavel Djundik 792e77d91f
Add self-contained builds (#418) 2 years ago
Pavel Djundik d5ce7ee18e
Merge pull request #399 from SteamRE/psy/rip-depot-names
Remove printing of depot name
2 years ago
Pavel Djundik 4b2fb1f7b7
Merge pull request #425 from SteamRE/psy/expanded-branch-format
Add support for appinfo depots section with expanded branch info.
2 years ago
Nicholas Hastings 196e99b30d Add support for appinfo depots section with expanded branch info. 2 years ago
Pavel Djundik 347806b53b
Add icon (#417) 3 years ago
Pavel Djundik dea7a632c1 Add issue templates 3 years ago
Yaakov d73462e077 improve pre-login auth handling (I think?) 3 years ago
Yaakov c36ddcc065 handle reconnects more gracefully 3 years ago
Yaakov 8d6c09e779 dispose of disposables 3 years ago
Yaakov 6ffa0948a4 Implement -qr CLI arg to log in with a QR code 3 years ago
Yaakov 0112ca749d Rudimentary support for new access tokens 3 years ago
Yaakov b31d79f556 Revert "be a little more specific when updating the pkg"
This reverts commit 7b0f3135ff.
3 years ago
Yaakov d071ba04cd Merge branch 'master' of github.com:SteamRE/DepotDownloader 3 years ago
Yaakov 7b0f3135ff be a little more specific when updating the pkg 3 years ago
Yaakov f9d75e05b0
Merge pull request #398 from SteamRE/dependabot/nuget/protobuf-net-3.2.16
Bump protobuf-net from 3.2.0 to 3.2.16
3 years ago
Yaakov f2fe082112 fix yaml? 3 years ago
Yaakov 790b938d76 Add scheduled workflow for nightly builds against latest SK2 3 years ago
Nicholas Hastings 5e414bc48b Remove printing of depot name. It's no longer sent. 3 years ago
dependabot[bot] 3b060a6632
Bump protobuf-net from 3.2.0 to 3.2.16
Bumps [protobuf-net](https://github.com/protobuf-net/protobuf-net) from 3.2.0 to 3.2.16.
- [Release notes](https://github.com/protobuf-net/protobuf-net/releases)
- [Changelog](https://github.com/protobuf-net/protobuf-net/blob/main/docs/releasenotes.md)
- [Commits](https://github.com/protobuf-net/protobuf-net/commits/3.2.16)

---
updated-dependencies:
- dependency-name: protobuf-net
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
3 years ago
Yaakov c26eaa60c9
Merge pull request #388 from SteamRE/dependabot/nuget/protobuf-net-3.2.0
Bump protobuf-net from 3.1.17 to 3.2.0
3 years ago
dependabot[bot] bf4df71d64 Bump protobuf-net from 3.1.17 to 3.2.0
Bumps [protobuf-net](https://github.com/protobuf-net/protobuf-net) from 3.1.17 to 3.2.0.
- [Release notes](https://github.com/protobuf-net/protobuf-net/releases)
- [Changelog](https://github.com/protobuf-net/protobuf-net/blob/main/docs/releasenotes.md)
- [Commits](https://github.com/protobuf-net/protobuf-net/commits)

---
updated-dependencies:
- dependency-name: protobuf-net
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
3 years ago
Yaakov 10cc4c9131 Add global.json, lock to .NET 6.0 SDK 3 years ago
Margen67 ced92a1128 CI updates
Rename matrix.os to runs-on.
Opt out of dotnet telemetry.
Upgrade checkout and upload-artifact to v3.
Upgrade setup-dotnet to v2.
3 years ago
Scott Ehlert 42b8584edf Simplify/refactor PlatformUtilities.SetExecutable and add support for using stat on ARM versions of Linux. 3 years ago
Ryan Kistner 3143362d83 2.4.7 - Don't use depotfromapp to request depot key or manifest request code 3 years ago
Yaakov 4ee9db7565
Merge pull request #335 from SteamRE/dependabot/nuget/protobuf-net-3.1.17
Bump protobuf-net from 3.0.101 to 3.1.17
3 years ago
dependabot[bot] b65ea1b1ec
Bump protobuf-net from 3.0.101 to 3.1.17
Bumps [protobuf-net](https://github.com/protobuf-net/protobuf-net) from 3.0.101 to 3.1.17.
- [Release notes](https://github.com/protobuf-net/protobuf-net/releases)
- [Changelog](https://github.com/protobuf-net/protobuf-net/blob/main/docs/releasenotes.md)
- [Commits](https://github.com/protobuf-net/protobuf-net/commits)

---
updated-dependencies:
- dependency-name: protobuf-net
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
3 years ago
Ryan Kistner 72683ef35c 2.4.6 Release 3 years ago
Ryan Kistner 75dc09fb0a Enforce manifest request codes 3 years ago
Ryan Kistner 4acc41fe92 Manifest request code period is more likely 5 minutes 4 years ago
Ryan Kistner 0054301ad6 Assuming manifest request codes are valid for one period following the issuing period 4 years ago
Ryan Kistner 969a394fdd Implemented manifest request codes 4 years ago
Ryan Kistner 703929dad0 Add a couple FAQs to the readme 4 years ago
Ryan Kistner 73d46d7774 Read any non-empty input when prompting for an input like 2fa code or auth code 4 years ago
Yaakov 48e8267e28
Merge pull request #300 from SteamRE/dependabot/nuget/SteamKit2-2.4.1
Bump SteamKit2 from 2.4.0-Alpha.3 to 2.4.1
4 years ago
dependabot[bot] 14fc1c7a8e
Bump SteamKit2 from 2.4.0-Alpha.3 to 2.4.1
Bumps [SteamKit2](https://github.com/SteamRE/SteamKit) from 2.4.0-Alpha.3 to 2.4.1.
- [Release notes](https://github.com/SteamRE/SteamKit/releases)
- [Commits](https://github.com/SteamRE/SteamKit/compare/2.4.0-Alpha.3...2.4.1)

---
updated-dependencies:
- dependency-name: SteamKit2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
4 years ago
Yaakov e45c8c3d21
Merge pull request #286 from SteamRE/sk-2.4.0
Update to SteamKit2 2.4.0, net6.0
4 years ago
Pavel Djundik 6f4bb748eb Delete app.config, move RollForward to csproj 4 years ago
Yaakov 7dc4ec999e we actually need to specify an sdk version otherwise this does nothing 4 years ago
Yaakov 60ff69d6e9 Update README for net6.0 4 years ago
Yaakov e735f1aa61 Merge remote-tracking branch 'origin/pr/278' into sk-2.4.0 4 years ago
Yaakov 4e81487aee Update to SK2.4.0 / net6.0 4 years ago
Pavel Djundik e915870db7 Use SteamContent.GetServersForSteamPipe 4 years ago
Pavel Djundik bef429908a Updates for SteamKit updates 4 years ago
Pavel Djundik a479aa9301 Update SteamKit 4 years ago
Wesley Pyburn (TechNobo) 389e7eb788 Removed quotes 4 years ago
Wesley Pyburn (TechNobo) 559ba38d38 Added usage for -remember-password
Not very well explained how to use -remember-password. This simple change to the README should contain everything users need to know about it.
Also added to code help.
4 years ago
Ryan Kistner 14160c39a2 Include version and runtime information in debug log 4 years ago
Ryan Kistner 2c038fd038 Remove the CDN authentication call 4 years ago
NicknineTheEagle 8b4dcc2339 Added gitattributes 4 years ago
Ryan Kistner bd1314da2e Updated to SteamKit2 2.4.0-Alpha.3 4 years ago
Ryan Kistner bb778e3883 Close file handles after validation and lazily open them as chunks are downloaded 4 years ago
Ryan Kistner 16b2f52b6f AArch64 OSX won't have a suffix on the ABI import 4 years ago
Ryan Kistner c0e837de93 Backspace in masked password input didn't work on Windows 4 years ago
Ryan Kistner 7b89e0c1c4 Simplify the FilePermissions into one set of flags 4 years ago
Ryan Kistner 08eb74a7cc Moved UnixUtilities to PlatformUtilities and added OSX support. 4 years ago
js6pak 0a1e3bf6b0 Use libc directly instead of Mono.Posix 4 years ago
js6pak 711888ebe9 Add support for Executable removal and update it only when its actually changed in the manifest 4 years ago
js6pak 0e785d04b7 Set executable permissions to files with Executable flag 4 years ago
js6pak afab5e44b6
Add roslyn-like .editorconfig (#236) 4 years ago
Yaakov 33483e594b
Merge pull request #233 from js6pak/assemblyinfo
Convert legacy AssemblyInfo.cs to the csproj format
4 years ago
js6pak bd229b4de3
Convert legacy AssemblyInfo.cs to the csproj format 4 years ago
Ryan Kistner 913c85a4dd Connection state flag fixes to ensure we actually recover when TryAnotherCM is returned 4 years ago
Ryan Kistner 22b4b5fe3c Handle TryAnotherCM as an expected disconnection 4 years ago
Ryan Kistner a9e400949d Handle TryAnotherCM as a reconnection attempt 4 years ago
Rick Gibbed ad72f53cd7
Don't pointlessly make copies of every file when verifying. (#225) 4 years ago
Ryan Kistner bdc6ebf7ee 2.4.3: Prevent HTTP sockets from using IPv6 4 years ago
Ryan Kistner 06d25ef1ed 2.4.2: Added HTTP diagnostics to -debug 4 years ago
NicknineTheEagle 4b0cbb06dc
Updated manifest-to-text conversion to imitate Steam format (#195) 4 years ago
Ryan Kistner 3111e787ef Catch and abort on out-of-space exceptions when allocating files #220 4 years ago
Ryan Kistner 08b7911d2d Provide visual feedback for masked password input #207 #216 4 years ago
Ryan Kistner 36b9684eb2 2.4.1: Target .NET 5.0 to simplify release packaging 4 years ago
Yaakov cb5c6c8a65
Merge pull request #202 from SteamRE/dependabot/add-v2-config-file
Upgrade to GitHub-native Dependabot
4 years ago
dependabot-preview[bot] 783197b960
Upgrade to GitHub-native Dependabot 4 years ago
Yaakov 5fd7a6ed37
Merge pull request #190 from SteamRE/dependabot/nuget/protobuf-net-3.0.101
Bump protobuf-net from 3.0.73 to 3.0.101
4 years ago
dependabot-preview[bot] ec8b5f4628
Bump protobuf-net from 3.0.73 to 3.0.101
Bumps [protobuf-net](https://github.com/protobuf-net/protobuf-net) from 3.0.73 to 3.0.101.
- [Release notes](https://github.com/protobuf-net/protobuf-net/releases)
- [Changelog](https://github.com/protobuf-net/protobuf-net/blob/main/docs/releasenotes.md)
- [Commits](https://github.com/protobuf-net/protobuf-net/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
5 years ago
Ryan Kistner 6b05a3e8cb When downloading files into a target directory, remove files with conflicting paths from earlier depots. Fixes #188 5 years ago
Ryan Kistner 27960f3d18 Target SteamKit 2.4.0-Alpha.2 5 years ago
Pavel Djundik 60b4451417
Normalize slashes in filepath; explicit regex support (#175)
Fixes #30 #18 #17
5 years ago
Pavel Djundik 9d4b87ba60
Fix ugc web download and remove dead code (#174) 5 years ago
Margen67 d7870040fe
ci improvements (#169) 5 years ago
Margen67 11e1bdbea6
Delete .travis.yml (#168) 5 years ago
Yaakov 069e8985ed
Merge pull request #156 from SteamRE/dependabot/nuget/protobuf-net-3.0.73
Bump protobuf-net from 3.0.52 to 3.0.73
5 years ago
dependabot-preview[bot] 223815dca5
Bump protobuf-net from 3.0.52 to 3.0.73
Bumps [protobuf-net](https://github.com/protobuf-net/protobuf-net) from 3.0.52 to 3.0.73.
- [Release notes](https://github.com/protobuf-net/protobuf-net/releases)
- [Changelog](https://github.com/protobuf-net/protobuf-net/blob/main/docs/releasenotes.md)
- [Commits](https://github.com/protobuf-net/protobuf-net/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
5 years ago
Ryan Kistner 70da480efe Allow a list of -manifest ids to match -depot 5 years ago
Ryan Kistner ffd22a52ff Use C# 7.0 tuples 5 years ago
Ryan Kistner f146251555 Anonymous users cannot use UFSGetUGCDetails 5 years ago
Ryan Kistner a58059eb80 When downloading using -ugc we need to check UGCDetails first for a file URL (like -pubfile). Resolves #59 5 years ago
Ryan Kistner 8fcfd837b0 Alternate -pubfile implementation using GetDetails 5 years ago
Ryan Kistner 079f91167f Allow multiple depot ids to be specified. Resolves #147 5 years ago
Ryan Kistner cda5eb5137 Proxy logic brought into SteamKit 5 years ago
Ryan Kistner 729d4cdc61 Actually flag off new CDNClient features 5 years ago
Ryan Kistner 618090e23d Support for proxying requests through OpenCache 5 years ago
Ryan Kistner 30312af050 If an output directory is not specified, the deleted files list should be limited to each individual depot. 5 years ago
Ryan Kistner ac97c01107 Process download chunks as tasks to increase concurrency 5 years ago
dependabot-preview[bot] df7b44f7da
Bump protobuf-net from 3.0.24 to 3.0.52 (#138)
Bumps [protobuf-net](https://github.com/protobuf-net/protobuf-net) from 3.0.24 to 3.0.52.
- [Release notes](https://github.com/protobuf-net/protobuf-net/releases)
- [Changelog](https://github.com/protobuf-net/protobuf-net/blob/main/docs/releasenotes.md)
- [Commits](https://github.com/protobuf-net/protobuf-net/compare/3.0.24...3.0.52)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
5 years ago
NicknineTheEagle 952cba8627
Implemented deleting files when updating (#113)
Implemented deleting files when updating
5 years ago
NicknineTheEagle a6d30efade
Re-fetch app info after obtaining FreeOnDemand license (#140) 5 years ago
NicknineTheEagle 618ce3a3df
Fixed loading old manifest for updating (#139) 5 years ago
Ryan Kistner 4c36d5ca31 Only capture one of each PackageToken 5 years ago
Yaakov 8436d67afa Merge branch 'dependabot/nuget/protobuf-net-3.0.24' 5 years ago
dependabot-preview[bot] 93c89552a4
Bump SteamKit2 from 2.3.0-beta.2 to 2.3.0
Bumps [SteamKit2](https://github.com/SteamRE/SteamKit) from 2.3.0-beta.2 to 2.3.0.
- [Release notes](https://github.com/SteamRE/SteamKit/releases)
- [Commits](https://github.com/SteamRE/SteamKit/compare/2.3.0-beta.2...2.3.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
5 years ago
dependabot-preview[bot] 84e8be5c80
Bump protobuf-net from 2.4.6 to 3.0.24
Bumps [protobuf-net](https://github.com/protobuf-net/protobuf-net) from 2.4.6 to 3.0.24.
- [Release notes](https://github.com/protobuf-net/protobuf-net/releases)
- [Changelog](https://github.com/protobuf-net/protobuf-net/blob/main/docs/releasenotes.md)
- [Commits](https://github.com/protobuf-net/protobuf-net/commits/3.0.24)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
5 years ago
Yaakov 4372ea7045
Merge pull request #104 from xPaw/gh-actions
Add github action build workflow
5 years ago
Ryan Kistner f8d67d8c9b Print task timeouts as connection timeouts 5 years ago
NicknineTheEagle 4299c23bed
Various manifest related improvements (#94)
* Changed saved manifest name format for better clarity
* Expanded manifest-to-text conversion
5 years ago
Pavel Djundik 05d6da9662
Implement package tokens (#103) 5 years ago
Pavel Djundik 70a6e97bef Add github action build workflow 5 years ago
Ryan Kistner 2ca1f3e8e6 Filter CDN server list to the two types of content servers we support: SteamCache and CDN. 5 years ago
Pavel Djundik 9979cda684
Format readme and add missing parameters (#96)
* Add missing parameters to readme
* Format readme
* Add examples to readme
5 years ago
Ryan Kistner 5423bdc759 Use PublishedFile.GetItemDetails when looking up pubfiles. This also requires -app to be specified with -pubfile. 5 years ago
NicknineTheEagle 6c37e21364 Updated usage help 5 years ago
NicknineTheEagle feb0f19e0d Added -osarch parameter 5 years ago
NicknineTheEagle 96e975aad9 Added -language and -lowviolence parameters 5 years ago
Ryan Kistner 3e6cd3b4b1 Limit unnecessary concurrent CDN token requests. Combine CDN token requests for steamcontent.com. Added a diagnostic timeout for lost CDN token requests. 6 years ago
Ryan Kistner 7476cdb0a3 Updated to SteamKit 2.3.0 6 years ago
Ryan Kistner 642f43864a Added -debug command line option to enable DebugLog. Report unhandled exceptions before re-throwing them. 6 years ago
Michael 04214ed516 Update readme for -loginid 6 years ago
Michael 231a05c3a6 -loginid console option to support concurrent processes 6 years ago
Michael 266c4acc04 Normalize forward slashes in filelists on Win 6 years ago
Ryan Kistner 751538019b TryWaitForLoginKey should always attempt to wait a short period of time for login key updates if configured 6 years ago
Pavel Djundik def0729fce Set LoginID 6 years ago
Pavel Djundik 8dd7c4c1b5 Fix crashing on duplicate license 6 years ago
Ryan Kistner 90dfd03b5e Corrected FileMode when saving AccountSettingsStore 6 years ago
Ryan Kistner 0d427acbb9 Added RollForward setting 6 years ago
Ryan Kistner 436519d445 Split DepotDownloader configuration file into account settings stored in IsolatedStorage, and depot installation data stored in the .DepotDownloader config directory alongside cached manifests 6 years ago
Margen67 2c46ee32ea Update travis dist to bionic 6 years ago
Ryan Kistner bc25bba261 Only show the checksum mismatch when the manifest actually exists 6 years ago
Ryan Kistner 2e30364d8f Include and validate checksums with locally cached manifests 6 years ago
Ryan Kistner 0b598b43a7 Ensure failed download task throws OperationCanceledException so that the return code is reported correctly when it is the last task 6 years ago
Yaakov 779a4697ab
Merge pull request #65 from SteamRE/dependabot/nuget/protobuf-net-2.4.4
Bump protobuf-net from 2.4.1 to 2.4.4
6 years ago
dependabot-preview[bot] 3e7a902eb4
Bump protobuf-net from 2.4.1 to 2.4.4
Bumps [protobuf-net](https://github.com/mgravell/protobuf-net) from 2.4.1 to 2.4.4.
- [Release notes](https://github.com/mgravell/protobuf-net/releases)
- [Changelog](https://github.com/protobuf-net/protobuf-net/blob/master/docs/releasenotes.md)
- [Commits](https://github.com/mgravell/protobuf-net/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
6 years ago
dependabot-preview[bot] 5f3e4334ba Bump protobuf-net from 2.1.0 to 2.4.1 (#63)
Bumps [protobuf-net](https://github.com/mgravell/protobuf-net) from 2.1.0 to 2.4.1.
- [Release notes](https://github.com/mgravell/protobuf-net/releases)
- [Changelog](https://github.com/protobuf-net/protobuf-net/blob/master/docs/releasenotes.md)
- [Commits](https://github.com/mgravell/protobuf-net/commits/2.4.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
6 years ago
Ryan Kistner da88425eb6
Merge pull request #62 from eroen/master
Be more friendly to scripts
6 years ago
Yaakov f6fa6fe9c6
Merge pull request #64 from SteamRE/no-legacy-nuget
Remove legacy NuGet packages.config
6 years ago
Yaakov ee82031a40 We shouldn't need this anymore. 6 years ago
Eroen f1ff09bf20 Exit with error code on errors
When run by a script, the script needs to know if the requested operation was
succesful.

This patch makes sure error codes are returned for a number of unhandled error
conditions.
6 years ago
Eroen ee53edc935 Allow reading passwords from redirected input
This is beneficial for scripts that don't want to expose the password in the
command line arguments.
6 years ago
Ryan Kistner ffcde1b04e Updated to SteamKit 2.2.0 6 years ago
Ryan Kistner c6975323d2 Use new ContentServerDirectoryService to fetch content servers for CDNClientPool 6 years ago
Ryan Kistner 87a238b0ec
Merge pull request #53 from xPaw/patch-2
Do not display full license list
6 years ago
Pavel Djundik 73286dd072
Do not display full license list 6 years ago
Ryan Kistner f5d519c466
Added GPLv2 license 7 years ago
Ryan Kistner e7b89df743 Skip platform check when an explicit depot id is provided 7 years ago
Nicholas Hastings 2177746a50 Update README usage info to match usage print output. 7 years ago
Ryan Kistner e0afef00e4 Report and exit on unsuccessful pubfile lookup 7 years ago
Ryan Kistner fdb5d0d408
Merge pull request #45 from SteamRE/ugc-cmd-cleanup
Add new -ugc option, removing -force-depot. (#41)
7 years ago
Nicholas Hastings 3ad0966070 Move GetPubfileDetails to saner spot in file. 7 years ago
Nicholas Hastings f957ef5da9 Add -pubfile support, dynamically getting appId + ugcId. 7 years ago
Nicholas Hastings 18a57dd1dd Update SK from 2.0.0 to 2.1.0 BECAUSE WE CAN. 7 years ago
Nicholas Hastings a2ffdd30f5 Misc cleanup to avoid unnecessary conversions. 7 years ago
Nicholas Hastings 72f633eade Add new -ugc option, removing -force-depot. (#41)
Also improve and clean up command line usage output, as well as add
automatic lookup of correct workshop depot id for UGC, instead of requiring
it on command line (usually assuming app id).
7 years ago
Ryan Kistner 7a757101bf Added shutdown token to CDN connection pool monitor 8 years ago

@ -1,7 +1,222 @@
; EditorConfig: http://EditorConfig.org
# top-most EditorConfig file
root = true
[*]
indent_style = space
indent_size = 4
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
# Code files
[*.{cs, csx, vb, vbx}]
indent_size = 4
# Github yaml files
[*.yml]
indent_size = 2
# XML project files
[*.{csproj, vbproj, vcxproj, vcxproj.filters, proj, projitems, shproj}]
indent_size = 2
# XML config files
[*.{props, targets, ruleset, config, nuspec, resx, vsixmanifest, vsct}]
indent_size = 2
# Dotnet code style settings:
[*.{cs, vb}]
# IDE0055: Fix formatting
dotnet_diagnostic.IDE0055.severity = warning
# Sort using and Import directives with System.* appearing first
dotnet_sort_system_directives_first = true
dotnet_separate_import_directive_groups = false
# Avoid "this." and "Me." if not necessary
dotnet_style_qualification_for_field = false:refactoring
dotnet_style_qualification_for_property = false:refactoring
dotnet_style_qualification_for_method = false:refactoring
dotnet_style_qualification_for_event = false:refactoring
# Use language keywords instead of framework type names for type references
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
dotnet_style_predefined_type_for_member_access = true:suggestion
# Suggest more modern language features when available
dotnet_style_object_initializer = true:suggestion
dotnet_style_collection_initializer = true:suggestion
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_null_propagation = true:suggestion
dotnet_style_explicit_tuple_names = true:suggestion
# Non-private static fields are PascalCase
dotnet_naming_rule.non_private_static_fields_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.non_private_static_fields_should_be_pascal_case.symbols = non_private_static_fields
dotnet_naming_rule.non_private_static_fields_should_be_pascal_case.style = non_private_static_field_style
dotnet_naming_symbols.non_private_static_fields.applicable_kinds = field
dotnet_naming_symbols.non_private_static_fields.applicable_accessibilities = public, protected, internal, protected_internal, private_protected
dotnet_naming_symbols.non_private_static_fields.required_modifiers = static
dotnet_naming_style.non_private_static_field_style.capitalization = pascal_case
# Non-private readonly fields are PascalCase
dotnet_naming_rule.non_private_readonly_fields_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.non_private_readonly_fields_should_be_pascal_case.symbols = non_private_readonly_fields
dotnet_naming_rule.non_private_readonly_fields_should_be_pascal_case.style = non_private_readonly_field_style
dotnet_naming_symbols.non_private_readonly_fields.applicable_kinds = field
dotnet_naming_symbols.non_private_readonly_fields.applicable_accessibilities = public, protected, internal, protected_internal, private_protected
dotnet_naming_symbols.non_private_readonly_fields.required_modifiers = readonly
dotnet_naming_style.non_private_readonly_field_style.capitalization = pascal_case
# Constants are PascalCase
dotnet_naming_rule.constants_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.constants_should_be_pascal_case.symbols = constants
dotnet_naming_rule.constants_should_be_pascal_case.style = constant_style
dotnet_naming_symbols.constants.applicable_kinds = field, local
dotnet_naming_symbols.constants.required_modifiers = const
dotnet_naming_style.constant_style.capitalization = pascal_case
# Static readonly fields are PascalCase
dotnet_naming_rule.static_fields_should_be_camel_case.severity = suggestion
dotnet_naming_rule.static_fields_should_be_camel_case.symbols = static_fields
dotnet_naming_rule.static_fields_should_be_camel_case.style = static_field_style
dotnet_naming_symbols.static_fields.applicable_kinds = field
dotnet_naming_symbols.static_fields.required_modifiers = static, readonly
dotnet_naming_style.static_field_style.capitalization = pascal_case
# Instance fields are camelCase and start with _
dotnet_naming_rule.instance_fields_should_be_camel_case.severity = suggestion
dotnet_naming_rule.instance_fields_should_be_camel_case.symbols = instance_fields
dotnet_naming_rule.instance_fields_should_be_camel_case.style = instance_field_style
dotnet_naming_symbols.instance_fields.applicable_kinds = field
dotnet_naming_style.instance_field_style.capitalization = camel_case
# Locals and parameters are camelCase
dotnet_naming_rule.locals_should_be_camel_case.severity = suggestion
dotnet_naming_rule.locals_should_be_camel_case.symbols = locals_and_parameters
dotnet_naming_rule.locals_should_be_camel_case.style = camel_case_style
dotnet_naming_symbols.locals_and_parameters.applicable_kinds = parameter, local
dotnet_naming_style.camel_case_style.capitalization = camel_case
# Local functions are PascalCase
dotnet_naming_rule.local_functions_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.local_functions_should_be_pascal_case.symbols = local_functions
dotnet_naming_rule.local_functions_should_be_pascal_case.style = local_function_style
dotnet_naming_symbols.local_functions.applicable_kinds = local_function
dotnet_naming_style.local_function_style.capitalization = pascal_case
# By default, name items with PascalCase
dotnet_naming_rule.members_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.members_should_be_pascal_case.symbols = all_members
dotnet_naming_rule.members_should_be_pascal_case.style = pascal_case_style
dotnet_naming_symbols.all_members.applicable_kinds = *
dotnet_naming_style.pascal_case_style.capitalization = pascal_case
# error RS2008: Enable analyzer release tracking for the analyzer project containing rule '{0}'
dotnet_diagnostic.RS2008.severity = none
# IDE0007: Use `var` instead of explicit type
dotnet_diagnostic.IDE0007.severity = warning
# IDE0035: Remove unreachable code
dotnet_diagnostic.IDE0035.severity = warning
# IDE0036: Order modifiers
dotnet_diagnostic.IDE0036.severity = warning
# IDE0043: Format string contains invalid placeholder
dotnet_diagnostic.IDE0043.severity = warning
# IDE0044: Make field readonly
dotnet_diagnostic.IDE0044.severity = warning
# CSharp code style settings:
[*.cs]
# Require file header OR A source file contains a header that does not match the required text
file_header_template = This file is subject to the terms and conditions defined\nin file 'LICENSE', which is part of this source code package.
dotnet_diagnostic.IDE0073.severity = error
# Newline settings
csharp_new_line_before_open_brace = all
csharp_new_line_before_else = true
csharp_new_line_before_catch = true
csharp_new_line_before_finally = true
# csharp_new_line_before_members_in_object_initializers = true TODO seems like Rider/ReSharper has the value inverted, uncomment when its fixed
csharp_new_line_before_members_in_anonymous_types = true
csharp_new_line_between_query_expression_clauses = true
# Indentation preferences
csharp_indent_block_contents = true
csharp_indent_braces = false
csharp_indent_case_contents = true
csharp_indent_case_contents_when_block = false
csharp_indent_switch_labels = true
csharp_indent_labels = flush_left
# Prefer "var" everywhere
csharp_style_var_for_built_in_types = true:suggestion
csharp_style_var_when_type_is_apparent = true:suggestion
csharp_style_var_elsewhere = true:suggestion
# Prefer method-like constructs to have a block body
csharp_style_expression_bodied_methods = false:none
csharp_style_expression_bodied_constructors = false:none
csharp_style_expression_bodied_operators = false:none
# Prefer property-like constructs to have an expression-body
csharp_style_expression_bodied_properties = true:none
csharp_style_expression_bodied_indexers = true:none
csharp_style_expression_bodied_accessors = true:none
# Suggest more modern language features when available
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
csharp_style_inlined_variable_declaration = true:suggestion
csharp_style_throw_expression = true:suggestion
csharp_style_conditional_delegate_call = true:suggestion
# Space preferences
csharp_space_after_cast = false
csharp_space_after_colon_in_inheritance_clause = true
csharp_space_after_comma = true
csharp_space_after_dot = false
csharp_space_after_keywords_in_control_flow_statements = true
csharp_space_after_semicolon_in_for_statement = true
csharp_space_around_binary_operators = before_and_after
csharp_space_around_declaration_statements = do_not_ignore
csharp_space_before_colon_in_inheritance_clause = true
csharp_space_before_comma = false
csharp_space_before_dot = false
csharp_space_before_open_square_brackets = false
csharp_space_before_semicolon_in_for_statement = false
csharp_space_between_empty_square_brackets = false
csharp_space_between_method_call_empty_parameter_list_parentheses = false
csharp_space_between_method_call_name_and_opening_parenthesis = false
csharp_space_between_method_call_parameter_list_parentheses = false
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
csharp_space_between_method_declaration_name_and_open_parenthesis = false
csharp_space_between_method_declaration_parameter_list_parentheses = false
csharp_space_between_parentheses = false
csharp_space_between_square_brackets = false
# Blocks are allowed
csharp_prefer_braces = true:silent
csharp_preserve_single_line_blocks = true
csharp_preserve_single_line_statements = true

4
.gitattributes vendored

@ -0,0 +1,4 @@
*.cs text eol=lf
*.csproj text eol=lf
*.config eol=lf
*.json eol=lf

@ -0,0 +1,60 @@
name: Bug Report
description: File a bug report
labels: [bug]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report!
- type: textarea
id: what-should-have-happened
attributes:
label: What did you expect to happen?
placeholder: I expected that...
validations:
required: true
- type: textarea
id: what-actually-happened
attributes:
label: Instead of that, what actually happened?
placeholder: ... but instead, what happened was...
validations:
required: true
- type: dropdown
id: operating-system
attributes:
label: Which operating system are you running on?
options:
- Linux
- macOS
- Windows
- Other
validations:
required: true
- type: input
id: version
attributes:
label: Version
description: What version of DepotDownloader are using?
validations:
required: true
- type: input
id: command
attributes:
label: Command
description: Specify the full command you used (except for username and password)
validations:
required: true
- type: textarea
id: logs
attributes:
label: Relevant log output
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks. Run with `-debug` parameter to get additional output.
render: shell
- type: textarea
id: additional-info
attributes:
label: Additional Information
description: Is there anything else that you think we should know?
validations:
required: false

@ -0,0 +1,5 @@
blank_issues_enabled: true
contact_links:
- name: Discussions
url: https://github.com/SteamRE/DepotDownloader/discussions/new
about: Please ask and answer questions here.

@ -0,0 +1,36 @@
name: Feature Request
description: Suggest an idea for this project
labels: [enhancement]
body:
- type: markdown
attributes:
value: |
Thanks, we appreciate good ideas!
- type: textarea
id: problem-area
attributes:
label: What problem is this feature trying to solve?
placeholder: I'm really frustrated when...
validations:
required: true
- type: textarea
id: proposed-solution
attributes:
label: How would you like it to be solved?
placeholder: I think that it could be solved by...
validations:
required: true
- type: textarea
id: alternative-solutions
attributes:
label: Have you considered any alternative solutions
placeholder: I did think that that it also could be solved by ..., but...
validations:
required: true
- type: textarea
id: additional-info
attributes:
label: Additional Information
description: Is there anything else that you think we should know?
validations:
required: false

@ -0,0 +1,15 @@
version: 2
updates:
- package-ecosystem: nuget
directory: "/"
schedule:
interval: weekly
open-pull-requests-limit: 10
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: weekly
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-minor", "version-update:semver-patch"]

@ -0,0 +1,170 @@
name: .NET Core CI
on:
push:
paths-ignore:
- '.github/*'
- '.github/*_TEMPLATE/**'
- '*.md'
pull_request:
paths-ignore:
- '.github/*'
- '.github/*_TEMPLATE/**'
- '*.md'
workflow_dispatch:
jobs:
build:
name: .NET on ${{ matrix.runs-on }} (${{ matrix.configuration }})
runs-on: ${{ matrix.runs-on }}
strategy:
fail-fast: false
matrix:
runs-on: [macos-latest, macos-14, ubuntu-latest, windows-latest]
configuration: [Release, Debug]
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
steps:
- uses: actions/checkout@v5
- name: Setup .NET Core
uses: actions/setup-dotnet@v5
- name: Build
run: dotnet publish DepotDownloader/DepotDownloader.csproj -c ${{ matrix.configuration }} -o artifacts /p:ContinuousIntegrationBuild=true
- name: Upload artifact
uses: actions/upload-artifact@v4
if: matrix.configuration == 'Release' && matrix.runs-on == 'windows-latest'
with:
name: DepotDownloader-framework
path: artifacts
if-no-files-found: error
- name: Publish Windows-x64
if: matrix.configuration == 'Release' && matrix.runs-on == 'windows-latest'
run: dotnet publish DepotDownloader/DepotDownloader.csproj --configuration Release -p:PublishSingleFile=true -p:DebugType=embedded --self-contained --runtime win-x64 --output selfcontained-win-x64
- name: Publish Windows-arm64
if: matrix.configuration == 'Release' && matrix.runs-on == 'windows-latest'
run: dotnet publish DepotDownloader/DepotDownloader.csproj --configuration Release -p:PublishSingleFile=true -p:DebugType=embedded --self-contained --runtime win-arm64 --output selfcontained-win-arm64
- name: Publish Linux-x64
if: matrix.configuration == 'Release' && matrix.runs-on == 'ubuntu-latest'
run: dotnet publish DepotDownloader/DepotDownloader.csproj --configuration Release -p:PublishSingleFile=true -p:DebugType=embedded --self-contained --runtime linux-x64 --output selfcontained-linux-x64
- name: Publish Linux-arm
if: matrix.configuration == 'Release' && matrix.runs-on == 'ubuntu-latest'
run: dotnet publish DepotDownloader/DepotDownloader.csproj --configuration Release -p:PublishSingleFile=true -p:DebugType=embedded --self-contained --runtime linux-arm --output selfcontained-linux-arm
- name: Publish Linux-arm64
if: matrix.configuration == 'Release' && matrix.runs-on == 'ubuntu-latest'
run: dotnet publish DepotDownloader/DepotDownloader.csproj --configuration Release -p:PublishSingleFile=true -p:DebugType=embedded --self-contained --runtime linux-arm64 --output selfcontained-linux-arm64
- name: Publish macOS-x64
if: matrix.configuration == 'Release' && matrix.runs-on == 'macos-latest'
run: dotnet publish DepotDownloader/DepotDownloader.csproj --configuration Release -p:PublishSingleFile=true -p:DebugType=embedded --self-contained --runtime osx-x64 --output selfcontained-osx-x64
- name: Publish macOS-arm64
if: matrix.configuration == 'Release' && matrix.runs-on == 'macos-14'
run: dotnet publish DepotDownloader/DepotDownloader.csproj --configuration Release -p:PublishSingleFile=true -p:DebugType=embedded --self-contained --runtime osx-arm64 --output selfcontained-osx-arm64
- name: Upload Windows-x64
uses: actions/upload-artifact@v4
if: matrix.configuration == 'Release' && matrix.runs-on == 'windows-latest'
with:
name: DepotDownloader-windows-x64
path: selfcontained-win-x64
if-no-files-found: error
- name: Upload Windows-arm64
uses: actions/upload-artifact@v4
if: matrix.configuration == 'Release' && matrix.runs-on == 'windows-latest'
with:
name: DepotDownloader-windows-arm64
path: selfcontained-win-arm64
if-no-files-found: error
- name: Upload Linux-x64
uses: actions/upload-artifact@v4
if: matrix.configuration == 'Release' && matrix.runs-on == 'ubuntu-latest'
with:
name: DepotDownloader-linux-x64
path: selfcontained-linux-x64
if-no-files-found: error
- name: Upload Linux-arm
uses: actions/upload-artifact@v4
if: matrix.configuration == 'Release' && matrix.runs-on == 'ubuntu-latest'
with:
name: DepotDownloader-linux-arm
path: selfcontained-linux-arm
if-no-files-found: error
- name: Upload Linux-arm64
uses: actions/upload-artifact@v4
if: matrix.configuration == 'Release' && matrix.runs-on == 'ubuntu-latest'
with:
name: DepotDownloader-linux-arm64
path: selfcontained-linux-arm64
if-no-files-found: error
- name: Upload macOS-x64
uses: actions/upload-artifact@v4
if: matrix.configuration == 'Release' && matrix.runs-on == 'macos-latest'
with:
name: DepotDownloader-macos-x64
path: selfcontained-osx-x64
if-no-files-found: error
- name: Upload macOS-arm64
uses: actions/upload-artifact@v4
if: matrix.configuration == 'Release' && matrix.runs-on == 'macos-14'
with:
name: DepotDownloader-macos-arm64
path: selfcontained-osx-arm64
if-no-files-found: error
release:
if: startsWith(github.ref, 'refs/tags/')
needs: build
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Display artifacts folder structure
run: ls -Rl
working-directory: artifacts
- name: Create release files
run: |
set -eux
mkdir release
chmod +x artifacts/DepotDownloader-linux-x64/DepotDownloader
chmod +x artifacts/DepotDownloader-linux-arm/DepotDownloader
chmod +x artifacts/DepotDownloader-linux-arm64/DepotDownloader
chmod +x artifacts/DepotDownloader-macos-x64/DepotDownloader
chmod +x artifacts/DepotDownloader-macos-arm64/DepotDownloader
zip -9j release/DepotDownloader-framework.zip artifacts/DepotDownloader-framework/*
zip -9j release/DepotDownloader-windows-x64.zip artifacts/DepotDownloader-windows-x64/*
zip -9j release/DepotDownloader-windows-arm64.zip artifacts/DepotDownloader-windows-arm64/*
zip -9j release/DepotDownloader-linux-x64.zip artifacts/DepotDownloader-linux-x64/*
zip -9j release/DepotDownloader-linux-arm.zip artifacts/DepotDownloader-linux-arm/*
zip -9j release/DepotDownloader-linux-arm64.zip artifacts/DepotDownloader-linux-arm64/*
zip -9j release/DepotDownloader-macos-x64.zip artifacts/DepotDownloader-macos-x64/*
zip -9j release/DepotDownloader-macos-arm64.zip artifacts/DepotDownloader-macos-arm64/*
- name: Display structure of archived files
run: ls -Rl
working-directory: release
- name: Release
uses: softprops/action-gh-release@v2
with:
draft: true
files: release/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

@ -0,0 +1,39 @@
name: SteamKit2 Continuous Integration
on:
schedule:
- cron: '0 1 * * SUN'
workflow_dispatch:
jobs:
build:
name: .NET on ${{ matrix.runs-on }} (${{ matrix.configuration }})
runs-on: ${{ matrix.runs-on }}
strategy:
fail-fast: false
matrix:
runs-on: [ macos-latest, macos-14, ubuntu-latest, windows-latest ]
configuration: [ Release, Debug ]
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
steps:
- uses: actions/checkout@v5
- name: Setup .NET Core
uses: actions/setup-dotnet@v5
- name: Configure NuGet
run: |
dotnet nuget add source --username USERNAME --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/SteamRE/index.json"
dotnet add DepotDownloader/DepotDownloader.csproj package SteamKit2 --prerelease
- name: Build
run: dotnet publish DepotDownloader/DepotDownloader.csproj -c ${{ matrix.configuration }} -o artifacts /p:ContinuousIntegrationBuild=true
- name: Upload artifact
uses: actions/upload-artifact@v4
if: matrix.configuration == 'Release'
with:
name: DepotDownloader-${{ matrix.runs-on }}
path: artifacts
if-no-files-found: error

@ -0,0 +1,33 @@
name: WinGet submission on release
on:
workflow_dispatch:
release:
types: [published]
jobs:
winget:
name: Publish winget package
runs-on: windows-latest
steps:
- name: Submit package to Windows Package Manager Community Repository
run: |
$wingetPackage = "SteamRE.DepotDownloader"
$headers = @{
Authorization = "Bearer ${{ secrets.GITHUB_TOKEN }}"
}
$github = Invoke-RestMethod -uri "https://api.github.com/repos/SteamRE/DepotDownloader/releases" -Headers $headers
$targetRelease = $github | Where-Object -Property name -match '^DepotDownloader' | Select -First 1
$assets = $targetRelease | Select -ExpandProperty assets -First 1
$zipX64Url = $assets | Where-Object -Property name -match 'DepotDownloader-windows-x64.zip' | Select -ExpandProperty browser_download_url
$zipArm64Url = $assets | Where-Object -Property name -match 'DepotDownloader-windows-arm64.zip' | Select -ExpandProperty browser_download_url
$ver = $targetRelease.tag_name -ireplace '^(DepotDownloader[ _])?v?'
# getting latest wingetcreate file
iwr https://aka.ms/wingetcreate/latest -OutFile wingetcreate.exe
# how to create a token: https://github.com/microsoft/winget-create?tab=readme-ov-file#github-personal-access-token-classic-permissions
.\wingetcreate.exe update $wingetPackage --submit --version $ver --urls "$zipX64Url" "$zipArm64Url" --token "${{ secrets.PT_WINGET }}"

5
.gitignore vendored

@ -60,7 +60,7 @@ _ReSharper*
*.ncrunch*
.*crunch*.local.xml
# Installshield output folder
# Installshield output folder
[Ee]xpress
# DocProject is a documentation generator add-in
@ -117,4 +117,5 @@ protobuf/
cryptopp/
# misc
Thumbs.db
Thumbs.db
launchSettings.json

@ -1,24 +0,0 @@
sudo: required
dist: trusty
language: csharp
mono: none
dotnet: 2.0.0
solution: DepotDownloader.sln
install:
- dotnet restore DepotDownloader.sln
script:
- dotnet build DepotDownloader.sln
notifications:
irc:
channels:
- "irc.gamesurge.net#opensteamworks"
on_success: never
on_failure: always
cache:
directories:
- "~/.local/share/NuGet/Cache"

@ -0,0 +1,91 @@
// This file is subject to the terms and conditions defined
// in file 'LICENSE', which is part of this source code package.
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.IO;
using System.IO.Compression;
using System.IO.IsolatedStorage;
using ProtoBuf;
namespace DepotDownloader
{
[ProtoContract]
class AccountSettingsStore
{
// Member 1 was a Dictionary<string, byte[]> for SentryData.
[ProtoMember(2, IsRequired = false)]
public ConcurrentDictionary<string, int> ContentServerPenalty { get; private set; }
// Member 3 was a Dictionary<string, string> for LoginKeys.
[ProtoMember(4, IsRequired = false)]
public Dictionary<string, string> LoginTokens { get; private set; }
[ProtoMember(5, IsRequired = false)]
public Dictionary<string, string> GuardData { get; private set; }
string FileName;
AccountSettingsStore()
{
ContentServerPenalty = new ConcurrentDictionary<string, int>();
LoginTokens = new(StringComparer.OrdinalIgnoreCase);
GuardData = new(StringComparer.OrdinalIgnoreCase);
}
static bool Loaded
{
get { return Instance != null; }
}
public static AccountSettingsStore Instance;
static readonly IsolatedStorageFile IsolatedStorage = IsolatedStorageFile.GetUserStoreForAssembly();
public static void LoadFromFile(string filename)
{
if (Loaded)
throw new Exception("Config already loaded");
if (IsolatedStorage.FileExists(filename))
{
try
{
using var fs = IsolatedStorage.OpenFile(filename, FileMode.Open, FileAccess.Read);
using var ds = new DeflateStream(fs, CompressionMode.Decompress);
Instance = Serializer.Deserialize<AccountSettingsStore>(ds);
}
catch (IOException ex)
{
Console.WriteLine("Failed to load account settings: {0}", ex.Message);
Instance = new AccountSettingsStore();
}
}
else
{
Instance = new AccountSettingsStore();
}
Instance.FileName = filename;
}
public static void Save()
{
if (!Loaded)
throw new Exception("Saved config before loading");
try
{
using var fs = IsolatedStorage.OpenFile(Instance.FileName, FileMode.Create, FileAccess.Write);
using var ds = new DeflateStream(fs, CompressionMode.Compress);
Serializer.Serialize(ds, Instance);
}
catch (IOException ex)
{
Console.WriteLine("Failed to save account settings: {0}", ex.Message);
}
}
}
}

@ -0,0 +1,59 @@
// This file is subject to the terms and conditions defined
// in file 'LICENSE', which is part of this source code package.
using System;
using Spectre.Console;
namespace DepotDownloader;
static class Ansi
{
// https://conemu.github.io/en/AnsiEscapeCodes.html#ConEmu_specific_OSC
// https://learn.microsoft.com/en-us/windows/terminal/tutorials/progress-bar-sequences
public enum ProgressState
{
Hidden = 0,
Default = 1,
Error = 2,
Indeterminate = 3,
Warning = 4,
}
const char ESC = (char)0x1B;
const char BEL = (char)0x07;
private static bool useProgress;
public static void Init()
{
if (Console.IsInputRedirected || Console.IsOutputRedirected)
{
return;
}
if (OperatingSystem.IsLinux())
{
return;
}
var (supportsAnsi, legacyConsole) = AnsiDetector.Detect(stdError: false, upgrade: true);
useProgress = supportsAnsi && !legacyConsole;
}
public static void Progress(ulong downloaded, ulong total)
{
var progress = (byte)MathF.Round(downloaded / (float)total * 100.0f);
Progress(ProgressState.Default, progress);
}
public static void Progress(ProgressState state, byte progress = 0)
{
if (!useProgress)
{
return;
}
Console.Write($"{ESC}]9;4;{(byte)state};{progress}{BEL}");
}
}

@ -0,0 +1,117 @@
// Copied from https://github.com/spectreconsole/spectre.console/blob/d79e6adc5f8e637fb35c88f987023ffda6707243/src/Spectre.Console/Internal/Backends/Ansi/AnsiDetector.cs
// MIT License - Copyright(c) 2020 Patrik Svensson, Phil Scott, Nils Andresen
// which is partially based on https://github.com/keqingrong/supports-ansi/blob/master/index.js
// <auto-generated/>
using System;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text.RegularExpressions;
using Windows.Win32;
using Windows.Win32.System.Console;
namespace Spectre.Console;
internal static class AnsiDetector
{
private static readonly Regex[] _regexes =
[
new("^xterm"), // xterm, PuTTY, Mintty
new("^rxvt"), // RXVT
new("^eterm"), // Eterm
new("^screen"), // GNU screen, tmux
new("tmux"), // tmux
new("^vt100"), // DEC VT series
new("^vt102"), // DEC VT series
new("^vt220"), // DEC VT series
new("^vt320"), // DEC VT series
new("ansi"), // ANSI
new("scoansi"), // SCO ANSI
new("cygwin"), // Cygwin, MinGW
new("linux"), // Linux console
new("konsole"), // Konsole
new("bvterm"), // Bitvise SSH Client
new("^st-256color"), // Suckless Simple Terminal, st
new("alacritty"), // Alacritty
];
public static (bool SupportsAnsi, bool LegacyConsole) Detect(bool stdError, bool upgrade)
{
// Running on Windows?
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
// Running under ConEmu?
var conEmu = Environment.GetEnvironmentVariable("ConEmuANSI");
if (!string.IsNullOrEmpty(conEmu) && conEmu.Equals("On", StringComparison.OrdinalIgnoreCase))
{
return (true, false);
}
var supportsAnsi = WindowsSupportsAnsi(upgrade, stdError, out var legacyConsole);
return (supportsAnsi, legacyConsole);
}
return DetectFromTerm();
}
private static (bool SupportsAnsi, bool LegacyConsole) DetectFromTerm()
{
// Check if the terminal is of type ANSI/VT100/xterm compatible.
var term = Environment.GetEnvironmentVariable("TERM");
if (!string.IsNullOrWhiteSpace(term))
{
if (_regexes.Any(regex => regex.IsMatch(term)))
{
return (true, false);
}
}
return (false, true);
}
private static bool WindowsSupportsAnsi(bool upgrade, bool stdError, out bool isLegacy)
{
isLegacy = false;
try
{
var @out = PInvoke.GetStdHandle_SafeHandle(stdError ? STD_HANDLE.STD_ERROR_HANDLE :STD_HANDLE.STD_OUTPUT_HANDLE);
if (!PInvoke.GetConsoleMode(@out, out var mode))
{
// Could not get console mode, try TERM (set in cygwin, WSL-Shell).
var (ansiFromTerm, legacyFromTerm) = DetectFromTerm();
isLegacy = ansiFromTerm ? legacyFromTerm : isLegacy;
return ansiFromTerm;
}
if ((mode & CONSOLE_MODE.ENABLE_VIRTUAL_TERMINAL_PROCESSING) == 0||true)
{
isLegacy = true;
if (!upgrade)
{
return false;
}
// Try enable ANSI support.
mode |= CONSOLE_MODE.ENABLE_VIRTUAL_TERMINAL_PROCESSING | CONSOLE_MODE.DISABLE_NEWLINE_AUTO_RETURN;
if (!PInvoke.SetConsoleMode(@out, mode))
{
// Enabling failed.
return false;
}
isLegacy = false;
}
return true;
}
catch
{
// All we know here is that we don't support ANSI.
return false;
}
}
}

@ -1,261 +1,93 @@
using SteamKit2;
// This file is subject to the terms and conditions defined
// in file 'LICENSE', which is part of this source code package.
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using SteamKit2.CDN;
namespace DepotDownloader
{
/// <summary>
/// CDNClientPool provides a pool of CDNClients to CDN endpoints
/// CDNClients that get re-used will be initialized for the correct depots
/// CDNClientPool provides a pool of connections to CDN endpoints, requesting CDN tokens as needed
/// </summary>
class CDNClientPool
{
private const int ServerEndpointMinimumSize = 8;
private Steam3Session steamSession;
private ConcurrentBag<CDNClient> activeClientPool;
private ConcurrentDictionary<CDNClient, Tuple<uint, CDNClient.Server>> activeClientAuthed;
private BlockingCollection<CDNClient.Server> availableServerEndpoints;
private readonly Steam3Session steamSession;
private readonly uint appId;
public Client CDNClient { get; }
public Server ProxyServer { get; private set; }
private AutoResetEvent populatePoolEvent;
private Task monitorTask;
public CancellationTokenSource ExhaustedToken { get; set; }
private readonly List<Server> servers = [];
private int nextServer;
public CDNClientPool(Steam3Session steamSession)
public CDNClientPool(Steam3Session steamSession, uint appId)
{
this.steamSession = steamSession;
activeClientPool = new ConcurrentBag<CDNClient>();
activeClientAuthed = new ConcurrentDictionary<CDNClient, Tuple<uint, CDNClient.Server>>();
availableServerEndpoints = new BlockingCollection<CDNClient.Server>();
populatePoolEvent = new AutoResetEvent(true);
monitorTask = Task.Factory.StartNew(ConnectionPoolMonitorAsync).Unwrap();
this.appId = appId;
CDNClient = new Client(steamSession.steamClient);
}
private async Task<IList<CDNClient.Server>> FetchBootstrapServerListAsync()
public async Task UpdateServerList()
{
CDNClient bootstrap = new CDNClient(steamSession.steamClient);
var servers = await this.steamSession.steamContent.GetServersForSteamPipe();
while (true)
{
try
ProxyServer = servers.Where(x => x.UseAsProxy).FirstOrDefault();
var weightedCdnServers = servers
.Where(server =>
{
var cdnServers = await bootstrap.FetchServerListAsync(cellId: (uint)ContentDownloader.Config.CellID).ConfigureAwait(false);
if (cdnServers != null)
{
return cdnServers;
}
}
catch (Exception ex)
var isEligibleForApp = server.AllowedAppIds.Length == 0 || server.AllowedAppIds.Contains(appId);
return isEligibleForApp && (server.Type == "SteamCache" || server.Type == "CDN");
})
.Select(server =>
{
Console.WriteLine("Failed to retrieve content server list: {0}", ex.Message);
}
}
}
AccountSettingsStore.Instance.ContentServerPenalty.TryGetValue(server.Host, out var penalty);
private async Task ConnectionPoolMonitorAsync()
{
bool didPopulate = false;
return (server, penalty);
})
.OrderBy(pair => pair.penalty).ThenBy(pair => pair.server.WeightedLoad);
while(true)
foreach (var (server, weight) in weightedCdnServers)
{
populatePoolEvent.WaitOne(TimeSpan.FromSeconds(1));
// peek ahead into steam session to see if we have servers
if (availableServerEndpoints.Count < ServerEndpointMinimumSize &&
steamSession.steamClient.IsConnected &&
steamSession.steamClient.GetServersOfType(EServerType.CS).Count > 0)
{
var servers = await FetchBootstrapServerListAsync().ConfigureAwait(false);
var weightedCdnServers = servers.Select(x =>
{
int penalty = 0;
ConfigStore.TheConfig.ContentServerPenalty.TryGetValue(x.Host, out penalty);
return Tuple.Create(x, penalty);
}).OrderBy(x => x.Item2).ThenBy(x => x.Item1.WeightedLoad);
foreach (var endpoint in weightedCdnServers)
{
for (var i = 0; i < endpoint.Item1.NumEntries; i++) {
availableServerEndpoints.Add(endpoint.Item1);
}
}
didPopulate = true;
}
else if ( availableServerEndpoints.Count == 0 && !steamSession.steamClient.IsConnected && didPopulate )
for (var i = 0; i < server.NumEntries; i++)
{
ExhaustedToken?.Cancel();
this.servers.Add(server);
}
}
}
private void ReleaseConnection(CDNClient client)
{
Tuple<uint, CDNClient.Server> authData;
activeClientAuthed.TryRemove(client, out authData);
}
private async Task<CDNClient> BuildConnectionAsync(uint appId, uint depotId, byte[] depotKey, CDNClient.Server serverSeed, CancellationToken token)
{
CDNClient.Server server = null;
CDNClient client = null;
while (client == null)
if (this.servers.Count == 0)
{
// if we want to re-initialize a specific content server, try that one first
if (serverSeed != null)
{
server = serverSeed;
serverSeed = null;
}
else
{
if (availableServerEndpoints.Count < ServerEndpointMinimumSize)
{
populatePoolEvent.Set();
}
server = availableServerEndpoints.Take(token);
}
client = new CDNClient(steamSession.steamClient, steamSession.AppTickets[depotId]);
string cdnAuthToken = null;
try
{
if (server.Type == "CDN")
{
steamSession.RequestCDNAuthToken(appId, depotId, server.Host);
var cdnKey = string.Format("{0:D}:{1}", depotId, steamSession.ResolveCDNTopLevelHost(server.Host));
SteamApps.CDNAuthTokenCallback authTokenCallback;
if (steamSession.CDNAuthTokens.TryGetValue(cdnKey, out authTokenCallback))
{
cdnAuthToken = authTokenCallback.Token;
}
else
{
throw new Exception(String.Format("Failed to retrieve CDN token for server {0} depot {1}", server.Host, depotId));
}
}
await client.ConnectAsync(server).ConfigureAwait(false);
await client.AuthenticateDepotAsync(depotId, depotKey, cdnAuthToken).ConfigureAwait(false);
}
catch (Exception ex)
{
client = null;
Console.WriteLine("Failed to connect to content server {0}: {1}", server, ex.Message);
int penalty = 0;
ConfigStore.TheConfig.ContentServerPenalty.TryGetValue(server.Host, out penalty);
ConfigStore.TheConfig.ContentServerPenalty[server.Host] = penalty + 1;
}
throw new Exception("Failed to retrieve any download servers.");
}
Console.WriteLine("Initialized connection to content server {0} with depot id {1}", server, depotId);
activeClientAuthed[client] = Tuple.Create(depotId, server);
return client;
}
private async Task<bool> ReauthConnectionAsync(CDNClient client, CDNClient.Server server, uint appId, uint depotId, byte[] depotKey)
public Server GetConnection()
{
DebugLog.Assert(server.Type == "CDN" || steamSession.AppTickets[depotId] == null, "CDNClientPool", "Re-authing a CDN or anonymous connection");
String cdnAuthToken = null;
try
{
if (server.Type == "CDN")
{
steamSession.RequestCDNAuthToken(appId, depotId, server.Host);
var cdnKey = string.Format("{0:D}:{1}", depotId, steamSession.ResolveCDNTopLevelHost(server.Host));
SteamApps.CDNAuthTokenCallback authTokenCallback;
if (steamSession.CDNAuthTokens.TryGetValue(cdnKey, out authTokenCallback))
{
cdnAuthToken = authTokenCallback.Token;
}
else
{
throw new Exception(String.Format("Failed to retrieve CDN token for server {0} depot {1}", server.Host, depotId));
}
}
await client.AuthenticateDepotAsync(depotId, depotKey, cdnAuthToken).ConfigureAwait(false);
activeClientAuthed[client] = Tuple.Create(depotId, server);
return true;
}
catch (Exception ex)
{
Console.WriteLine("Failed to reauth to content server {0}: {1}", server, ex.Message);
}
return false;
return servers[nextServer % servers.Count];
}
public async Task<CDNClient> GetConnectionForDepotAsync(uint appId, uint depotId, byte[] depotKey, CancellationToken token)
public void ReturnConnection(Server server)
{
CDNClient client = null;
Tuple<uint, CDNClient.Server> authData;
if (server == null) return;
activeClientPool.TryTake(out client);
// nothing to do, maybe remove from ContentServerPenalty?
}
// if we couldn't find a connection, make one now
if (client == null)
{
client = await BuildConnectionAsync(appId, depotId, depotKey, null, token).ConfigureAwait(false);
}
public void ReturnBrokenConnection(Server server)
{
if (server == null) return;
// if we couldn't find the authorization data or it's not authed to this depotid, re-initialize
if (!activeClientAuthed.TryGetValue(client, out authData) || authData.Item1 != depotId)
lock (servers)
{
if (authData.Item2.Type == "CDN" && await ReauthConnectionAsync(client, authData.Item2, appId, depotId, depotKey).ConfigureAwait(false))
{
Console.WriteLine("Re-authed CDN connection to content server {0} from {1} to {2}", authData.Item2, authData.Item1, depotId);
}
else if (authData.Item2.Type == "CS" && steamSession.AppTickets[depotId] == null && await ReauthConnectionAsync(client, authData.Item2, appId, depotId, depotKey).ConfigureAwait(false))
{
Console.WriteLine("Re-authed anonymous connection to content server {0} from {1} to {2}", authData.Item2, authData.Item1, depotId);
}
else
if (servers[nextServer % servers.Count] == server)
{
ReleaseConnection(client);
client = await BuildConnectionAsync(appId, depotId, depotKey, authData.Item2, token).ConfigureAwait(false);
nextServer++;
// TODO: Add server to ContentServerPenalty
}
}
return client;
}
public void ReturnConnection(CDNClient client)
{
if (client == null) return;
activeClientPool.Add(client);
}
public void ReturnBrokenConnection(CDNClient client)
{
if (client == null) return;
ReleaseConnection(client);
}
}
}

@ -1,70 +0,0 @@
using System;
using System.Collections.Generic;
using ProtoBuf;
using System.IO;
using System.IO.Compression;
namespace DepotDownloader
{
[ProtoContract]
class ConfigStore
{
[ProtoMember(1)]
public Dictionary<uint, ulong> LastManifests { get; private set; }
[ProtoMember(3, IsRequired=false)]
public Dictionary<string, byte[]> SentryData { get; private set; }
[ProtoMember(4, IsRequired = false)]
public System.Collections.Concurrent.ConcurrentDictionary<string, int> ContentServerPenalty { get; private set; }
[ProtoMember(5, IsRequired = false)]
public Dictionary<string, string> LoginKeys { get; private set; }
string FileName = null;
ConfigStore()
{
LastManifests = new Dictionary<uint, ulong>();
SentryData = new Dictionary<string, byte[]>();
ContentServerPenalty = new System.Collections.Concurrent.ConcurrentDictionary<string, int>();
LoginKeys = new Dictionary<string, string>();
}
static bool Loaded
{
get { return TheConfig != null; }
}
public static ConfigStore TheConfig = null;
public static void LoadFromFile(string filename)
{
if (Loaded)
throw new Exception("Config already loaded");
if (File.Exists(filename))
{
using (FileStream fs = File.Open(filename, FileMode.Open))
using (DeflateStream ds = new DeflateStream(fs, CompressionMode.Decompress))
TheConfig = ProtoBuf.Serializer.Deserialize<ConfigStore>(ds);
}
else
{
TheConfig = new ConfigStore();
}
TheConfig.FileName = filename;
}
public static void Save()
{
if (!Loaded)
throw new Exception("Saved config before loading");
using (FileStream fs = File.Open(TheConfig.FileName, FileMode.Create))
using (DeflateStream ds = new DeflateStream(fs, CompressionMode.Compress))
ProtoBuf.Serializer.Serialize<ConfigStore>(ds, TheConfig);
}
}
}

@ -0,0 +1,76 @@
// This file is subject to the terms and conditions defined
// in file 'LICENSE', which is part of this source code package.
using System;
using System.Threading.Tasks;
using SteamKit2.Authentication;
namespace DepotDownloader
{
// This is practically copied from https://github.com/SteamRE/SteamKit/blob/master/SteamKit2/SteamKit2/Steam/Authentication/UserConsoleAuthenticator.cs
internal class ConsoleAuthenticator : IAuthenticator
{
/// <inheritdoc />
public Task<string> GetDeviceCodeAsync(bool previousCodeWasIncorrect)
{
if (previousCodeWasIncorrect)
{
Console.Error.WriteLine("The previous 2-factor auth code you have provided is incorrect.");
}
string code;
do
{
Console.Error.Write("STEAM GUARD! Please enter your 2-factor auth code from your authenticator app: ");
code = Console.ReadLine()?.Trim();
if (code == null)
{
break;
}
}
while (string.IsNullOrEmpty(code));
return Task.FromResult(code!);
}
/// <inheritdoc />
public Task<string> GetEmailCodeAsync(string email, bool previousCodeWasIncorrect)
{
if (previousCodeWasIncorrect)
{
Console.Error.WriteLine("The previous 2-factor auth code you have provided is incorrect.");
}
string code;
do
{
Console.Error.Write($"STEAM GUARD! Please enter the auth code sent to the email at {email}: ");
code = Console.ReadLine()?.Trim();
if (code == null)
{
break;
}
}
while (string.IsNullOrEmpty(code));
return Task.FromResult(code!);
}
/// <inheritdoc />
public Task<bool> AcceptDeviceConfirmationAsync()
{
if (ContentDownloader.Config.SkipAppConfirmation)
{
return Task.FromResult(false);
}
Console.Error.WriteLine("STEAM GUARD! Use the Steam Mobile App to confirm your sign in...");
return Task.FromResult(true);
}
}
}

File diff suppressed because it is too large Load Diff

@ -0,0 +1,61 @@
// This file is subject to the terms and conditions defined
// in file 'LICENSE', which is part of this source code package.
using System;
using System.Collections.Generic;
using System.IO;
using System.IO.Compression;
using ProtoBuf;
namespace DepotDownloader
{
[ProtoContract]
class DepotConfigStore
{
[ProtoMember(1)]
public Dictionary<uint, ulong> InstalledManifestIDs { get; private set; }
string FileName;
DepotConfigStore()
{
InstalledManifestIDs = [];
}
static bool Loaded
{
get { return Instance != null; }
}
public static DepotConfigStore Instance;
public static void LoadFromFile(string filename)
{
if (Loaded)
throw new Exception("Config already loaded");
if (File.Exists(filename))
{
using var fs = File.Open(filename, FileMode.Open);
using var ds = new DeflateStream(fs, CompressionMode.Decompress);
Instance = Serializer.Deserialize<DepotConfigStore>(ds);
}
else
{
Instance = new DepotConfigStore();
}
Instance.FileName = filename;
}
public static void Save()
{
if (!Loaded)
throw new Exception("Saved config before loading");
using var fs = File.Open(Instance.FileName, FileMode.Create);
using var ds = new DeflateStream(fs, CompressionMode.Compress);
Serializer.Serialize(ds, Instance);
}
}
}

@ -1,11 +1,32 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<TargetFramework>net9.0</TargetFramework>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<RollForward>LatestMajor</RollForward>
<Version>3.4.0</Version>
<Description>Steam Downloading Utility</Description>
<Authors>SteamRE Team</Authors>
<Copyright>Copyright © SteamRE Team 2025</Copyright>
<ApplicationIcon>..\Icon\DepotDownloader.ico</ApplicationIcon>
<Deterministic>true</Deterministic>
<TreatWarningsAsErrors Condition="'$(ContinuousIntegrationBuild)' == 'true'">true</TreatWarningsAsErrors>
<InvariantGlobalization>true</InvariantGlobalization>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="protobuf-net" Version="2.1.0" />
<PackageReference Include="SteamKit2" Version="2.0.0" />
<None Include="..\LICENSE" Link="LICENSE">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>
<ItemGroup>
<PackageReference Include="Microsoft.Windows.CsWin32" Version="0.3.183">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="protobuf-net" Version="3.2.52" />
<PackageReference Include="QRCoder" Version="1.6.0" />
<PackageReference Include="SteamKit2" Version="3.3.0" />
</ItemGroup>
</Project>

@ -1,31 +1,36 @@
using System.Collections.Generic;
using System.Text.RegularExpressions;
namespace DepotDownloader
{
class DownloadConfig
{
public int CellID { get; set; }
public bool DownloadAllPlatforms { get; set; }
public bool DownloadManifestOnly { get; set; }
public string InstallDirectory { get; set; }
public bool UsingFileList { get; set; }
public List<string> FilesToDownload { get; set; }
public List<Regex> FilesToDownloadRegex { get; set; }
public bool UsingExclusionList { get; set; }
public string BetaPassword { get; set; }
public ulong ManifestId { get; set; }
public bool VerifyAll { get; set; }
public int MaxServers { get; set; }
public int MaxDownloads { get; set; }
public string SuppliedPassword { get; set; }
public bool RememberPassword { get; set; }
}
}
// This file is subject to the terms and conditions defined
// in file 'LICENSE', which is part of this source code package.
using System.Collections.Generic;
using System.Text.RegularExpressions;
namespace DepotDownloader
{
class DownloadConfig
{
public int CellID { get; set; }
public bool DownloadAllPlatforms { get; set; }
public bool DownloadAllArchs { get; set; }
public bool DownloadAllLanguages { get; set; }
public bool DownloadManifestOnly { get; set; }
public string InstallDirectory { get; set; }
public bool UsingFileList { get; set; }
public HashSet<string> FilesToDownload { get; set; }
public List<Regex> FilesToDownloadRegex { get; set; }
public string BetaPassword { get; set; }
public bool VerifyAll { get; set; }
public int MaxDownloads { get; set; }
public bool RememberPassword { get; set; }
// A Steam LoginID to allow multiple concurrent connections
public uint? LoginID { get; set; }
public bool UseQrCode { get; set; }
public bool SkipAppConfirmation { get; set; }
}
}

@ -0,0 +1,52 @@
// This file is subject to the terms and conditions defined
// in file 'LICENSE', which is part of this source code package.
using System.IO;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Net.Sockets;
using System.Threading;
using System.Threading.Tasks;
namespace DepotDownloader
{
// This is based on the dotnet issue #44686 and its workaround at https://github.com/dotnet/runtime/issues/44686#issuecomment-733797994
// We don't know if the IPv6 stack is functional.
class HttpClientFactory
{
public static HttpClient CreateHttpClient()
{
var client = new HttpClient(new SocketsHttpHandler
{
ConnectCallback = IPv4ConnectAsync
});
var assemblyVersion = typeof(HttpClientFactory).Assembly.GetName().Version.ToString(fieldCount: 3);
client.DefaultRequestHeaders.UserAgent.Add(new ProductInfoHeaderValue("DepotDownloader", assemblyVersion));
return client;
}
static async ValueTask<Stream> IPv4ConnectAsync(SocketsHttpConnectionContext context, CancellationToken cancellationToken)
{
// By default, we create dual-mode sockets:
// Socket socket = new Socket(SocketType.Stream, ProtocolType.Tcp);
var socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)
{
NoDelay = true
};
try
{
await socket.ConnectAsync(context.DnsEndPoint, cancellationToken).ConfigureAwait(false);
return new NetworkStream(socket, ownsSocket: true);
}
catch
{
socket.Dispose();
throw;
}
}
}
}

@ -0,0 +1,45 @@
// This file is subject to the terms and conditions defined
// in file 'LICENSE', which is part of this source code package.
using System;
using System.Diagnostics.Tracing;
using System.Text;
namespace DepotDownloader
{
internal sealed class HttpDiagnosticEventListener : EventListener
{
public const EventKeywords TasksFlowActivityIds = (EventKeywords)0x80;
protected override void OnEventSourceCreated(EventSource eventSource)
{
if (eventSource.Name == "System.Net.Http" ||
eventSource.Name == "System.Net.Sockets" ||
eventSource.Name == "System.Net.Security" ||
eventSource.Name == "System.Net.NameResolution")
{
EnableEvents(eventSource, EventLevel.LogAlways);
}
else if (eventSource.Name == "System.Threading.Tasks.TplEventSource")
{
EnableEvents(eventSource, EventLevel.LogAlways, TasksFlowActivityIds);
}
}
protected override void OnEventWritten(EventWrittenEventArgs eventData)
{
var sb = new StringBuilder().Append($"{eventData.TimeStamp:HH:mm:ss.fffffff} {eventData.EventSource.Name}.{eventData.EventName}(");
for (var i = 0; i < eventData.Payload?.Count; i++)
{
sb.Append(eventData.PayloadNames?[i]).Append(": ").Append(eventData.Payload[i]);
if (i < eventData.Payload?.Count - 1)
{
sb.Append(", ");
}
}
sb.Append(')');
Console.WriteLine(sb.ToString());
}
}
}

@ -0,0 +1,5 @@
GetConsoleMode
GetConsoleProcessList
GetStdHandle
MessageBox
SetConsoleMode

@ -0,0 +1,51 @@
// This file is subject to the terms and conditions defined
// in file 'LICENSE', which is part of this source code package.
using System.IO;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
namespace DepotDownloader
{
static class PlatformUtilities
{
public static void SetExecutable(string path, bool value)
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
return;
}
const UnixFileMode ModeExecute = UnixFileMode.UserExecute | UnixFileMode.GroupExecute | UnixFileMode.OtherExecute;
var mode = File.GetUnixFileMode(path);
var hasExecuteMask = (mode & ModeExecute) == ModeExecute;
if (hasExecuteMask != value)
{
File.SetUnixFileMode(path, value
? mode | ModeExecute
: mode & ~ModeExecute);
}
}
[SupportedOSPlatform("windows5.0")]
public static void VerifyConsoleLaunch()
{
// Reference: https://devblogs.microsoft.com/oldnewthing/20160125-00/?p=92922
var processList = new uint[2];
var processCount = Windows.Win32.PInvoke.GetConsoleProcessList(processList);
if (processCount != 1)
{
return;
}
_ = Windows.Win32.PInvoke.MessageBox(
Windows.Win32.Foundation.HWND.Null,
"Depot Downloader is a console application; there is no GUI.\n\nIf you do not pass any command line parameters, it prints usage info and exits.\n\nYou must use this from a terminal/console.",
"Depot Downloader",
Windows.Win32.UI.WindowsAndMessaging.MESSAGEBOX_STYLE.MB_OK | Windows.Win32.UI.WindowsAndMessaging.MESSAGEBOX_STYLE.MB_ICONWARNING
);
}
}
}

@ -1,194 +1,550 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Text.RegularExpressions;
using SteamKit2;
using System.ComponentModel;
using System.Threading.Tasks;
namespace DepotDownloader
{
class Program
{
static void Main( string[] args )
=> MainAsync( args ).GetAwaiter().GetResult();
static async Task MainAsync( string[] args )
{
if ( args.Length == 0 )
{
PrintUsage();
return;
}
DebugLog.Enabled = false;
ConfigStore.LoadFromFile( Path.Combine( Directory.GetCurrentDirectory(), "DepotDownloader.config" ) );
bool bDumpManifest = HasParameter( args, "-manifest-only" );
uint appId = GetParameter<uint>( args, "-app", ContentDownloader.INVALID_APP_ID );
uint depotId = GetParameter<uint>( args, "-depot", ContentDownloader.INVALID_DEPOT_ID );
ContentDownloader.Config.ManifestId = GetParameter<ulong>( args, "-manifest", ContentDownloader.INVALID_MANIFEST_ID );
if ( appId == ContentDownloader.INVALID_APP_ID )
{
Console.WriteLine( "Error: -app not specified!" );
return;
}
if ( depotId == ContentDownloader.INVALID_DEPOT_ID && ContentDownloader.Config.ManifestId != ContentDownloader.INVALID_MANIFEST_ID )
{
Console.WriteLine( "Error: -manifest requires -depot to be specified" );
return;
}
ContentDownloader.Config.DownloadManifestOnly = bDumpManifest;
int cellId = GetParameter<int>( args, "-cellid", -1 );
if ( cellId == -1 )
{
cellId = 0;
}
ContentDownloader.Config.CellID = cellId;
ContentDownloader.Config.BetaPassword = GetParameter<string>( args, "-betapassword" );
string fileList = GetParameter<string>( args, "-filelist" );
string[] files = null;
if ( fileList != null )
{
try
{
string fileListData = File.ReadAllText( fileList );
files = fileListData.Split( new char[] { '\n', '\r' }, StringSplitOptions.RemoveEmptyEntries );
ContentDownloader.Config.UsingFileList = true;
ContentDownloader.Config.FilesToDownload = new List<string>();
ContentDownloader.Config.FilesToDownloadRegex = new List<Regex>();
foreach ( var fileEntry in files )
{
try
{
Regex rgx = new Regex( fileEntry, RegexOptions.Compiled | RegexOptions.IgnoreCase );
ContentDownloader.Config.FilesToDownloadRegex.Add( rgx );
}
catch
{
ContentDownloader.Config.FilesToDownload.Add( fileEntry );
continue;
}
}
Console.WriteLine( "Using filelist: '{0}'.", fileList );
}
catch ( Exception ex )
{
Console.WriteLine( "Warning: Unable to load filelist: {0}", ex.ToString() );
}
}
string username = GetParameter<string>( args, "-username" ) ?? GetParameter<string>( args, "-user" );
string password = GetParameter<string>( args, "-password" ) ?? GetParameter<string>( args, "-pass" );
ContentDownloader.Config.RememberPassword = HasParameter( args, "-remember-password" );
ContentDownloader.Config.InstallDirectory = GetParameter<string>( args, "-dir" );
ContentDownloader.Config.DownloadAllPlatforms = HasParameter( args, "-all-platforms" );
ContentDownloader.Config.VerifyAll = HasParameter( args, "-verify-all" ) || HasParameter( args, "-verify_all" ) || HasParameter( args, "-validate" );
ContentDownloader.Config.MaxServers = GetParameter<int>( args, "-max-servers", 20 );
ContentDownloader.Config.MaxDownloads = GetParameter<int>( args, "-max-downloads", 4 );
string branch = GetParameter<string>( args, "-branch" ) ?? GetParameter<string>( args, "-beta" ) ?? "Public";
bool forceDepot = HasParameter( args, "-force-depot" );
string os = GetParameter<string>( args, "-os", null );
if ( ContentDownloader.Config.DownloadAllPlatforms && !String.IsNullOrEmpty( os ) )
{
Console.WriteLine( "Error: Cannot specify -os when -all-platforms is specified." );
return;
}
ContentDownloader.Config.MaxServers = Math.Max( ContentDownloader.Config.MaxServers, ContentDownloader.Config.MaxDownloads );
if ( username != null && password == null && ( !ContentDownloader.Config.RememberPassword || !ConfigStore.TheConfig.LoginKeys.ContainsKey( username ) ) )
{
do
{
Console.Write("Enter account password for \"{0}\": ", username);
password = Util.ReadPassword();
Console.WriteLine();
} while ( String.Empty == password );
}
else if ( username == null )
{
Console.WriteLine( "No username given. Using anonymous account with dedicated server subscription." );
}
// capture the supplied password in case we need to re-use it after checking the login key
ContentDownloader.Config.SuppliedPassword = password;
if ( ContentDownloader.InitializeSteam3( username, password ) )
{
await ContentDownloader.DownloadAppAsync( appId, depotId, branch, os, forceDepot ).ConfigureAwait( false );
ContentDownloader.ShutdownSteam3();
}
}
static int IndexOfParam( string[] args, string param )
{
for ( int x = 0; x < args.Length; ++x )
{
if ( args[ x ].Equals( param, StringComparison.OrdinalIgnoreCase ) )
return x;
}
return -1;
}
static bool HasParameter( string[] args, string param )
{
return IndexOfParam( args, param ) > -1;
}
static T GetParameter<T>( string[] args, string param, T defaultValue = default( T ) )
{
int index = IndexOfParam( args, param );
if ( index == -1 || index == ( args.Length - 1 ) )
return defaultValue;
string strParam = args[ index + 1 ];
var converter = TypeDescriptor.GetConverter( typeof( T ) );
if ( converter != null )
{
return ( T )converter.ConvertFromString( strParam );
}
return default( T );
}
static void PrintUsage()
{
Console.WriteLine( "\nUsage: depotdownloader <parameters> [optional parameters]\n" );
Console.WriteLine( "Parameters:" );
Console.WriteLine( "\t-app <#>\t\t\t\t- the AppID to download." );
Console.WriteLine();
Console.WriteLine( "Optional Parameters:" );
Console.WriteLine( "\t-depot <#>\t\t\t- the DepotID to download." );
Console.WriteLine( "\t-cellid <#>\t\t\t- the overridden CellID of the content server to download from." );
Console.WriteLine( "\t-username <user>\t\t\t- the username of the account to login to for restricted content." );
Console.WriteLine( "\t-password <pass>\t\t\t- the password of the account to login to for restricted content." );
Console.WriteLine( "\t-remember-password\t\t\t- if set, remember the password for subsequent logins of this user." );
Console.WriteLine( "\t-dir <installdir>\t\t\t- the directory in which to place downloaded files." );
Console.WriteLine( "\t-os <os>\t\t\t- the operating system for which to download the game (windows, macos or linux, default: OS the program is currently running on)" );
Console.WriteLine( "\t-filelist <filename.txt>\t\t- a list of files to download (from the manifest). Can optionally use regex to download only certain files." );
Console.WriteLine( "\t-all-platforms\t\t\t- downloads all platform-specific depots when -app is used." );
Console.WriteLine( "\t-manifest-only\t\t\t- downloads a human readable manifest for any depots that would be downloaded." );
Console.WriteLine( "\t-beta <branchname>\t\t\t\t- download from specified branch if available (default: Public)." );
Console.WriteLine( "\t-betapassword <pass>\t\t\t- branch password if applicable." );
Console.WriteLine( "\t-manifest <id>\t\t\t- manifest id of content to download (requires -depot, default: current for branch)." );
Console.WriteLine( "\t-max-servers <#>\t\t\t- maximum number of content servers to use. (default: 8)." );
Console.WriteLine( "\t-max-downloads <#>\t\t\t- maximum number of chunks to download concurrently. (default: 4)." );
}
}
}
// This file is subject to the terms and conditions defined
// in file 'LICENSE', which is part of this source code package.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using SteamKit2;
using SteamKit2.CDN;
namespace DepotDownloader
{
class Program
{
private static bool[] consumedArgs;
static async Task<int> Main(string[] args)
{
if (args.Length == 0)
{
PrintVersion();
PrintUsage();
if (OperatingSystem.IsWindowsVersionAtLeast(5, 0))
{
PlatformUtilities.VerifyConsoleLaunch();
}
return 0;
}
Ansi.Init();
DebugLog.Enabled = false;
AccountSettingsStore.LoadFromFile("account.config");
#region Common Options
// Not using HasParameter because it is case insensitive
if (args.Length == 1 && (args[0] == "-V" || args[0] == "--version"))
{
PrintVersion(true);
return 0;
}
consumedArgs = new bool[args.Length];
if (HasParameter(args, "-debug"))
{
PrintVersion(true);
DebugLog.Enabled = true;
DebugLog.AddListener((category, message) =>
{
Console.WriteLine("[{0}] {1}", category, message);
});
var httpEventListener = new HttpDiagnosticEventListener();
}
var username = GetParameter<string>(args, "-username") ?? GetParameter<string>(args, "-user");
var password = GetParameter<string>(args, "-password") ?? GetParameter<string>(args, "-pass");
ContentDownloader.Config.RememberPassword = HasParameter(args, "-remember-password");
ContentDownloader.Config.UseQrCode = HasParameter(args, "-qr");
ContentDownloader.Config.SkipAppConfirmation = HasParameter(args, "-no-mobile");
if (username == null)
{
if (ContentDownloader.Config.RememberPassword && !ContentDownloader.Config.UseQrCode)
{
Console.WriteLine("Error: -remember-password can not be used without -username or -qr.");
return 1;
}
}
else if (ContentDownloader.Config.UseQrCode)
{
Console.WriteLine("Error: -qr can not be used with -username.");
return 1;
}
ContentDownloader.Config.DownloadManifestOnly = HasParameter(args, "-manifest-only");
var cellId = GetParameter(args, "-cellid", -1);
if (cellId == -1)
{
cellId = 0;
}
ContentDownloader.Config.CellID = cellId;
var fileList = GetParameter<string>(args, "-filelist");
if (fileList != null)
{
const string RegexPrefix = "regex:";
try
{
ContentDownloader.Config.UsingFileList = true;
ContentDownloader.Config.FilesToDownload = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
ContentDownloader.Config.FilesToDownloadRegex = [];
var files = await File.ReadAllLinesAsync(fileList);
foreach (var fileEntry in files)
{
if (string.IsNullOrWhiteSpace(fileEntry))
{
continue;
}
if (fileEntry.StartsWith(RegexPrefix))
{
var rgx = new Regex(fileEntry[RegexPrefix.Length..], RegexOptions.Compiled | RegexOptions.IgnoreCase);
ContentDownloader.Config.FilesToDownloadRegex.Add(rgx);
}
else
{
ContentDownloader.Config.FilesToDownload.Add(fileEntry.Replace('\\', '/'));
}
}
Console.WriteLine("Using filelist: '{0}'.", fileList);
}
catch (Exception ex)
{
Console.WriteLine("Warning: Unable to load filelist: {0}", ex);
}
}
ContentDownloader.Config.InstallDirectory = GetParameter<string>(args, "-dir");
ContentDownloader.Config.VerifyAll = HasParameter(args, "-verify-all") || HasParameter(args, "-verify_all") || HasParameter(args, "-validate");
if (HasParameter(args, "-use-lancache"))
{
await Client.DetectLancacheServerAsync();
if (Client.UseLancacheServer)
{
Console.WriteLine("Detected Lancache server! Downloads will be directed through the Lancache.");
// Increasing the number of concurrent downloads when the cache is detected since the downloads will likely
// be served much faster than over the internet. Steam internally has this behavior as well.
if (!HasParameter(args, "-max-downloads"))
{
ContentDownloader.Config.MaxDownloads = 25;
}
}
}
ContentDownloader.Config.MaxDownloads = GetParameter(args, "-max-downloads", 8);
ContentDownloader.Config.LoginID = HasParameter(args, "-loginid") ? GetParameter<uint>(args, "-loginid") : null;
#endregion
var appId = GetParameter(args, "-app", ContentDownloader.INVALID_APP_ID);
if (appId == ContentDownloader.INVALID_APP_ID)
{
Console.WriteLine("Error: -app not specified!");
return 1;
}
var pubFile = GetParameter(args, "-pubfile", ContentDownloader.INVALID_MANIFEST_ID);
var ugcId = GetParameter(args, "-ugc", ContentDownloader.INVALID_MANIFEST_ID);
if (pubFile != ContentDownloader.INVALID_MANIFEST_ID)
{
#region Pubfile Downloading
PrintUnconsumedArgs(args);
if (InitializeSteam(username, password))
{
try
{
await ContentDownloader.DownloadPubfileAsync(appId, pubFile).ConfigureAwait(false);
}
catch (Exception ex) when (
ex is ContentDownloaderException
|| ex is OperationCanceledException)
{
Console.WriteLine(ex.Message);
return 1;
}
catch (Exception e)
{
Console.WriteLine("Download failed to due to an unhandled exception: {0}", e.Message);
throw;
}
finally
{
ContentDownloader.ShutdownSteam3();
}
}
else
{
Console.WriteLine("Error: InitializeSteam failed");
return 1;
}
#endregion
}
else if (ugcId != ContentDownloader.INVALID_MANIFEST_ID)
{
#region UGC Downloading
PrintUnconsumedArgs(args);
if (InitializeSteam(username, password))
{
try
{
await ContentDownloader.DownloadUGCAsync(appId, ugcId).ConfigureAwait(false);
}
catch (Exception ex) when (
ex is ContentDownloaderException
|| ex is OperationCanceledException)
{
Console.WriteLine(ex.Message);
return 1;
}
catch (Exception e)
{
Console.WriteLine("Download failed to due to an unhandled exception: {0}", e.Message);
throw;
}
finally
{
ContentDownloader.ShutdownSteam3();
}
}
else
{
Console.WriteLine("Error: InitializeSteam failed");
return 1;
}
#endregion
}
else
{
#region App downloading
var branch = GetParameter<string>(args, "-branch") ?? GetParameter<string>(args, "-beta") ?? ContentDownloader.DEFAULT_BRANCH;
ContentDownloader.Config.BetaPassword = GetParameter<string>(args, "-branchpassword") ?? GetParameter<string>(args, "-betapassword");
if (!string.IsNullOrEmpty(ContentDownloader.Config.BetaPassword) && string.IsNullOrEmpty(branch))
{
Console.WriteLine("Error: Cannot specify -branchpassword when -branch is not specified.");
return 1;
}
ContentDownloader.Config.DownloadAllPlatforms = HasParameter(args, "-all-platforms");
var os = GetParameter<string>(args, "-os");
if (ContentDownloader.Config.DownloadAllPlatforms && !string.IsNullOrEmpty(os))
{
Console.WriteLine("Error: Cannot specify -os when -all-platforms is specified.");
return 1;
}
ContentDownloader.Config.DownloadAllArchs = HasParameter(args, "-all-archs");
var arch = GetParameter<string>(args, "-osarch");
if (ContentDownloader.Config.DownloadAllArchs && !string.IsNullOrEmpty(arch))
{
Console.WriteLine("Error: Cannot specify -osarch when -all-archs is specified.");
return 1;
}
ContentDownloader.Config.DownloadAllLanguages = HasParameter(args, "-all-languages");
var language = GetParameter<string>(args, "-language");
if (ContentDownloader.Config.DownloadAllLanguages && !string.IsNullOrEmpty(language))
{
Console.WriteLine("Error: Cannot specify -language when -all-languages is specified.");
return 1;
}
var lv = HasParameter(args, "-lowviolence");
var depotManifestIds = new List<(uint, ulong)>();
var isUGC = false;
var depotIdList = GetParameterList<uint>(args, "-depot");
var manifestIdList = GetParameterList<ulong>(args, "-manifest");
if (manifestIdList.Count > 0)
{
if (depotIdList.Count != manifestIdList.Count)
{
Console.WriteLine("Error: -manifest requires one id for every -depot specified");
return 1;
}
var zippedDepotManifest = depotIdList.Zip(manifestIdList, (depotId, manifestId) => (depotId, manifestId));
depotManifestIds.AddRange(zippedDepotManifest);
}
else
{
depotManifestIds.AddRange(depotIdList.Select(depotId => (depotId, ContentDownloader.INVALID_MANIFEST_ID)));
}
PrintUnconsumedArgs(args);
if (InitializeSteam(username, password))
{
try
{
await ContentDownloader.DownloadAppAsync(appId, depotManifestIds, branch, os, arch, language, lv, isUGC).ConfigureAwait(false);
}
catch (Exception ex) when (
ex is ContentDownloaderException
|| ex is OperationCanceledException)
{
Console.WriteLine(ex.Message);
return 1;
}
catch (Exception e)
{
Console.WriteLine("Download failed to due to an unhandled exception: {0}", e.Message);
throw;
}
finally
{
ContentDownloader.ShutdownSteam3();
}
}
else
{
Console.WriteLine("Error: InitializeSteam failed");
return 1;
}
#endregion
}
return 0;
}
static bool InitializeSteam(string username, string password)
{
if (!ContentDownloader.Config.UseQrCode)
{
if (username != null && password == null && (!ContentDownloader.Config.RememberPassword || !AccountSettingsStore.Instance.LoginTokens.ContainsKey(username)))
{
if (AccountSettingsStore.Instance.LoginTokens.ContainsKey(username))
{
Console.WriteLine($"Account \"{username}\" has stored credentials. Did you forget to specify -remember-password?");
}
do
{
Console.Write("Enter account password for \"{0}\": ", username);
if (Console.IsInputRedirected)
{
password = Console.ReadLine();
}
else
{
// Avoid console echoing of password
password = Util.ReadPassword();
}
Console.WriteLine();
} while (string.Empty == password);
}
else if (username == null)
{
Console.WriteLine("No username given. Using anonymous account with dedicated server subscription.");
}
}
if (!string.IsNullOrEmpty(password))
{
const int MAX_PASSWORD_SIZE = 64;
if (password.Length > MAX_PASSWORD_SIZE)
{
Console.Error.WriteLine($"Warning: Password is longer than {MAX_PASSWORD_SIZE} characters, which is not supported by Steam.");
}
if (!password.All(char.IsAscii))
{
Console.Error.WriteLine("Warning: Password contains non-ASCII characters, which is not supported by Steam.");
}
}
return ContentDownloader.InitializeSteam3(username, password);
}
static int IndexOfParam(string[] args, string param)
{
for (var x = 0; x < args.Length; ++x)
{
if (args[x].Equals(param, StringComparison.OrdinalIgnoreCase))
{
consumedArgs[x] = true;
return x;
}
}
return -1;
}
static bool HasParameter(string[] args, string param)
{
return IndexOfParam(args, param) > -1;
}
static T GetParameter<T>(string[] args, string param, T defaultValue = default)
{
var index = IndexOfParam(args, param);
if (index == -1 || index == (args.Length - 1))
return defaultValue;
var strParam = args[index + 1];
var converter = TypeDescriptor.GetConverter(typeof(T));
if (converter != null)
{
consumedArgs[index + 1] = true;
return (T)converter.ConvertFromString(strParam);
}
return default;
}
static List<T> GetParameterList<T>(string[] args, string param)
{
var list = new List<T>();
var index = IndexOfParam(args, param);
if (index == -1 || index == (args.Length - 1))
return list;
index++;
while (index < args.Length)
{
var strParam = args[index];
if (strParam[0] == '-') break;
var converter = TypeDescriptor.GetConverter(typeof(T));
if (converter != null)
{
consumedArgs[index] = true;
list.Add((T)converter.ConvertFromString(strParam));
}
index++;
}
return list;
}
static void PrintUnconsumedArgs(string[] args)
{
var printError = false;
for (var index = 0; index < consumedArgs.Length; index++)
{
if (!consumedArgs[index])
{
printError = true;
Console.Error.WriteLine($"Argument #{index + 1} {args[index]} was not used.");
}
}
if (printError)
{
Console.Error.WriteLine("Make sure you specified the arguments correctly. Check --help for correct arguments.");
Console.Error.WriteLine();
}
}
static void PrintUsage()
{
// Do not use tabs to align parameters here because tab size may differ
Console.WriteLine();
Console.WriteLine("Usage: downloading one or all depots for an app:");
Console.WriteLine(" depotdownloader -app <id> [-depot <id> [-manifest <id>]]");
Console.WriteLine(" [-username <username> [-password <password>]] [other options]");
Console.WriteLine();
Console.WriteLine("Usage: downloading a workshop item using pubfile id");
Console.WriteLine(" depotdownloader -app <id> -pubfile <id> [-username <username> [-password <password>]]");
Console.WriteLine("Usage: downloading a workshop item using ugc id");
Console.WriteLine(" depotdownloader -app <id> -ugc <id> [-username <username> [-password <password>]]");
Console.WriteLine();
Console.WriteLine("Parameters:");
Console.WriteLine(" -app <#> - the AppID to download.");
Console.WriteLine(" -depot <#> - the DepotID to download.");
Console.WriteLine(" -manifest <id> - manifest id of content to download (requires -depot, default: current for branch).");
Console.WriteLine($" -branch <branchname> - download from specified branch if available (default: {ContentDownloader.DEFAULT_BRANCH}).");
Console.WriteLine(" -branchpassword <pass> - branch password if applicable.");
Console.WriteLine(" -all-platforms - downloads all platform-specific depots when -app is used.");
Console.WriteLine(" -all-archs - download all architecture-specific depots when -app is used.");
Console.WriteLine(" -os <os> - the operating system for which to download the game (windows, macos or linux, default: OS the program is currently running on)");
Console.WriteLine(" -osarch <arch> - the architecture for which to download the game (32 or 64, default: the host's architecture)");
Console.WriteLine(" -all-languages - download all language-specific depots when -app is used.");
Console.WriteLine(" -language <lang> - the language for which to download the game (default: english)");
Console.WriteLine(" -lowviolence - download low violence depots when -app is used.");
Console.WriteLine();
Console.WriteLine(" -ugc <#> - the UGC ID to download.");
Console.WriteLine(" -pubfile <#> - the PublishedFileId to download. (Will automatically resolve to UGC id)");
Console.WriteLine();
Console.WriteLine(" -username <user> - the username of the account to login to for restricted content.");
Console.WriteLine(" -password <pass> - the password of the account to login to for restricted content.");
Console.WriteLine(" -remember-password - if set, remember the password for subsequent logins of this user.");
Console.WriteLine(" use -username <username> -remember-password as login credentials.");
Console.WriteLine(" -qr - display a login QR code to be scanned with the Steam mobile app");
Console.WriteLine(" -no-mobile - prefer entering a 2FA code instead of prompting to accept in the Steam mobile app");
Console.WriteLine();
Console.WriteLine(" -dir <installdir> - the directory in which to place downloaded files.");
Console.WriteLine(" -filelist <file.txt> - the name of a local file that contains a list of files to download (from the manifest).");
Console.WriteLine(" prefix file path with `regex:` if you want to match with regex. each file path should be on their own line.");
Console.WriteLine();
Console.WriteLine(" -validate - include checksum verification of files already downloaded");
Console.WriteLine(" -manifest-only - downloads a human readable manifest for any depots that would be downloaded.");
Console.WriteLine(" -cellid <#> - the overridden CellID of the content server to download from.");
Console.WriteLine(" -max-downloads <#> - maximum number of chunks to download concurrently. (default: 8).");
Console.WriteLine(" -loginid <#> - a unique 32-bit integer Steam LogonID in decimal, required if running multiple instances of DepotDownloader concurrently.");
Console.WriteLine(" -use-lancache - forces downloads over the local network via a Lancache instance.");
Console.WriteLine();
Console.WriteLine(" -debug - enable verbose debug logging.");
Console.WriteLine(" -V or --version - print version and runtime.");
}
static void PrintVersion(bool printExtra = false)
{
var version = typeof(Program).Assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>().InformationalVersion;
Console.WriteLine($"DepotDownloader v{version}");
if (!printExtra)
{
return;
}
Console.WriteLine($"Runtime: {RuntimeInformation.FrameworkDescription} on {RuntimeInformation.OSDescription}");
}
}
}

@ -1,34 +0,0 @@
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle( "DepotDownloader" )]
[assembly: AssemblyDescription("Steam Downloading Utility")]
[assembly: AssemblyConfiguration( "" )]
[assembly: AssemblyCompany("SteamRE Team")]
[assembly: AssemblyProduct( "DepotDownloader" )]
[assembly: AssemblyCopyright("Copyright © SteamRE Team 2017")]
[assembly: AssemblyTrademark( "" )]
[assembly: AssemblyCulture( "" )]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible( false )]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid( "df2ab32a-923c-46e3-a1b4-c901ee92ec94" )]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.3.0.0")]

@ -1,7 +0,0 @@
{
"profiles": {
"DepotDownloader": {
"commandName": "Project"
}
}
}

@ -1,34 +1,40 @@
using System.Collections.Generic;
// This file is subject to the terms and conditions defined
// in file 'LICENSE', which is part of this source code package.
using System;
using System.Collections.Generic;
using System.IO;
using System.IO.Compression;
using System.Security.Cryptography;
using System.Text;
using ProtoBuf;
using SteamKit2;
namespace DepotDownloader
{
[ProtoContract()]
[ProtoContract]
class ProtoManifest
{
// Proto ctor
private ProtoManifest()
{
Files = new List<FileData>();
Files = [];
}
public ProtoManifest(DepotManifest sourceManifest, ulong id) : this()
{
sourceManifest.Files.ForEach(f => Files.Add(new FileData(f)));
ID = id;
CreationTime = sourceManifest.CreationTime;
}
[ProtoContract()]
[ProtoContract]
public class FileData
{
// Proto ctor
private FileData()
{
Chunks = new List<ChunkData>();
Chunks = [];
}
public FileData(DepotManifest.FileData sourceData) : this()
@ -74,7 +80,7 @@ namespace DepotDownloader
public ChunkData(DepotManifest.ChunkData sourceChunk)
{
ChunkID = sourceChunk.ChunkID;
Checksum = sourceChunk.Checksum;
Checksum = BitConverter.GetBytes(sourceChunk.Checksum);
Offset = sourceChunk.Offset;
CompressedLength = sourceChunk.CompressedLength;
UncompressedLength = sourceChunk.UncompressedLength;
@ -117,21 +123,74 @@ namespace DepotDownloader
[ProtoMember(2)]
public ulong ID { get; private set; }
public static ProtoManifest LoadFromFile(string filename)
[ProtoMember(3)]
public DateTime CreationTime { get; private set; }
public static ProtoManifest LoadFromFile(string filename, out byte[] checksum)
{
if (!File.Exists(filename))
{
checksum = null;
return null;
}
using var ms = new MemoryStream();
using (var fs = File.Open(filename, FileMode.Open))
using (var ds = new DeflateStream(fs, CompressionMode.Decompress))
ds.CopyTo(ms);
using (FileStream fs = File.Open(filename, FileMode.Open))
using (DeflateStream ds = new DeflateStream(fs, CompressionMode.Decompress))
return ProtoBuf.Serializer.Deserialize<ProtoManifest>(ds);
checksum = SHA1.HashData(ms.ToArray());
ms.Seek(0, SeekOrigin.Begin);
return Serializer.Deserialize<ProtoManifest>(ms);
}
public void SaveToFile(string filename)
public void SaveToFile(string filename, out byte[] checksum)
{
using (FileStream fs = File.Open(filename, FileMode.Create))
using (DeflateStream ds = new DeflateStream(fs, CompressionMode.Compress))
ProtoBuf.Serializer.Serialize<ProtoManifest>(ds, this);
using var ms = new MemoryStream();
Serializer.Serialize(ms, this);
checksum = SHA1.HashData(ms.ToArray());
ms.Seek(0, SeekOrigin.Begin);
using var fs = File.Open(filename, FileMode.Create);
using var ds = new DeflateStream(fs, CompressionMode.Compress);
ms.CopyTo(ds);
}
public DepotManifest ConvertToSteamManifest(uint depotId)
{
ulong uncompressedSize = 0, compressedSize = 0;
var newManifest = new DepotManifest();
newManifest.Files = new List<DepotManifest.FileData>(Files.Count);
foreach (var file in Files)
{
var fileNameHash = SHA1.HashData(Encoding.UTF8.GetBytes(file.FileName.Replace('/', '\\').ToLowerInvariant()));
var newFile = new DepotManifest.FileData(file.FileName, fileNameHash, file.Flags, file.TotalSize, file.FileHash, null, false, file.Chunks.Count);
foreach (var chunk in file.Chunks)
{
var newChunk = new DepotManifest.ChunkData(chunk.ChunkID, BitConverter.ToUInt32(chunk.Checksum, 0), chunk.Offset, chunk.CompressedLength, chunk.UncompressedLength);
newFile.Chunks.Add(newChunk);
uncompressedSize += chunk.UncompressedLength;
compressedSize += chunk.CompressedLength;
}
newManifest.Files.Add(newFile);
}
newManifest.FilenamesEncrypted = false;
newManifest.DepotID = depotId;
newManifest.ManifestGID = ID;
newManifest.CreationTime = CreationTime;
newManifest.TotalUncompressedSize = uncompressedSize;
newManifest.TotalCompressedSize = compressedSize;
newManifest.EncryptedCRC = 0;
return newManifest;
}
}
}

File diff suppressed because it is too large Load Diff

@ -1,131 +1,239 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Security.Cryptography;
using System.Text;
namespace DepotDownloader
{
static class Util
{
public static string GetSteamOS()
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
return "windows";
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
return "macos";
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
{
return "linux";
}
return "unknown";
}
public static string ReadPassword()
{
ConsoleKeyInfo keyInfo;
StringBuilder password = new StringBuilder();
do
{
keyInfo = Console.ReadKey( true );
if ( keyInfo.Key == ConsoleKey.Backspace )
{
if ( password.Length > 0 )
password.Remove( password.Length - 1, 1 );
continue;
}
/* Printable ASCII characters only */
char c = keyInfo.KeyChar;
if ( c >= ' ' && c <= '~' )
password.Append( c );
} while ( keyInfo.Key != ConsoleKey.Enter );
return password.ToString();
}
// Validate a file against Steam3 Chunk data
public static List<ProtoManifest.ChunkData> ValidateSteam3FileChecksums(FileStream fs, ProtoManifest.ChunkData[] chunkdata)
{
var neededChunks = new List<ProtoManifest.ChunkData>();
int read;
foreach (var data in chunkdata)
{
byte[] chunk = new byte[data.UncompressedLength];
fs.Seek((long)data.Offset, SeekOrigin.Begin);
read = fs.Read(chunk, 0, (int)data.UncompressedLength);
byte[] tempchunk;
if (read < data.UncompressedLength)
{
tempchunk = new byte[read];
Array.Copy(chunk, 0, tempchunk, 0, read);
}
else
{
tempchunk = chunk;
}
byte[] adler = AdlerHash(tempchunk);
if (!adler.SequenceEqual(data.Checksum))
{
neededChunks.Add(data);
}
}
return neededChunks;
}
public static byte[] AdlerHash(byte[] input)
{
uint a = 0, b = 0;
for (int i = 0; i < input.Length; i++)
{
a = (a + input[i]) % 65521;
b = (b + a) % 65521;
}
return BitConverter.GetBytes(a | (b << 16));
}
public static byte[] SHAHash( byte[] input )
{
using (var sha = SHA1.Create())
{
var output = sha.ComputeHash( input );
return output;
}
}
public static byte[] DecodeHexString( string hex )
{
if ( hex == null )
return null;
int chars = hex.Length;
byte[] bytes = new byte[ chars / 2 ];
for ( int i = 0 ; i < chars ; i += 2 )
bytes[ i / 2 ] = Convert.ToByte( hex.Substring( i, 2 ), 16 );
return bytes;
}
public static string EncodeHexString( byte[] input )
{
return input.Aggregate( new StringBuilder(),
( sb, v ) => sb.Append( v.ToString( "x2" ) )
).ToString();
}
}
}
// This file is subject to the terms and conditions defined
// in file 'LICENSE', which is part of this source code package.
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
using SteamKit2;
namespace DepotDownloader
{
static class Util
{
public static string GetSteamOS()
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
return "windows";
}
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
return "macos";
}
if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
{
return "linux";
}
if (RuntimeInformation.IsOSPlatform(OSPlatform.FreeBSD))
{
// Return linux as freebsd steam client doesn't exist yet
return "linux";
}
return "unknown";
}
public static string GetSteamArch()
{
return Environment.Is64BitOperatingSystem ? "64" : "32";
}
public static string ReadPassword()
{
ConsoleKeyInfo keyInfo;
var password = new StringBuilder();
do
{
keyInfo = Console.ReadKey(true);
if (keyInfo.Key == ConsoleKey.Backspace)
{
if (password.Length > 0)
{
password.Remove(password.Length - 1, 1);
Console.Write("\b \b");
}
continue;
}
/* Printable ASCII characters only */
var c = keyInfo.KeyChar;
if (c >= ' ' && c <= '~')
{
password.Append(c);
Console.Write('*');
}
} while (keyInfo.Key != ConsoleKey.Enter);
return password.ToString();
}
// Validate a file against Steam3 Chunk data
public static List<DepotManifest.ChunkData> ValidateSteam3FileChecksums(FileStream fs, DepotManifest.ChunkData[] chunkdata)
{
var neededChunks = new List<DepotManifest.ChunkData>();
foreach (var data in chunkdata)
{
fs.Seek((long)data.Offset, SeekOrigin.Begin);
var adler = AdlerHash(fs, (int)data.UncompressedLength);
if (!adler.SequenceEqual(BitConverter.GetBytes(data.Checksum)))
{
neededChunks.Add(data);
}
}
return neededChunks;
}
public static byte[] AdlerHash(Stream stream, int length)
{
uint a = 0, b = 0;
for (var i = 0; i < length; i++)
{
var c = (uint)stream.ReadByte();
a = (a + c) % 65521;
b = (b + a) % 65521;
}
return BitConverter.GetBytes(a | (b << 16));
}
public static byte[] FileSHAHash(string filename)
{
using (var fs = File.Open(filename, FileMode.Open))
using (var sha = SHA1.Create())
{
var output = sha.ComputeHash(fs);
return output;
}
}
public static DepotManifest LoadManifestFromFile(string directory, uint depotId, ulong manifestId, bool badHashWarning)
{
// Try loading Steam format manifest first.
var filename = Path.Combine(directory, string.Format("{0}_{1}.manifest", depotId, manifestId));
if (File.Exists(filename))
{
byte[] expectedChecksum;
try
{
expectedChecksum = File.ReadAllBytes(filename + ".sha");
}
catch (IOException)
{
expectedChecksum = null;
}
var currentChecksum = FileSHAHash(filename);
if (expectedChecksum != null && expectedChecksum.SequenceEqual(currentChecksum))
{
return DepotManifest.LoadFromFile(filename);
}
else if (badHashWarning)
{
Console.WriteLine("Manifest {0} on disk did not match the expected checksum.", manifestId);
}
}
// Try converting legacy manifest format.
filename = Path.Combine(directory, string.Format("{0}_{1}.bin", depotId, manifestId));
if (File.Exists(filename))
{
byte[] expectedChecksum;
try
{
expectedChecksum = File.ReadAllBytes(filename + ".sha");
}
catch (IOException)
{
expectedChecksum = null;
}
byte[] currentChecksum;
var oldManifest = ProtoManifest.LoadFromFile(filename, out currentChecksum);
if (oldManifest != null && (expectedChecksum == null || !expectedChecksum.SequenceEqual(currentChecksum)))
{
oldManifest = null;
if (badHashWarning)
{
Console.WriteLine("Manifest {0} on disk did not match the expected checksum.", manifestId);
}
}
if (oldManifest != null)
{
return oldManifest.ConvertToSteamManifest(depotId);
}
}
return null;
}
public static bool SaveManifestToFile(string directory, DepotManifest manifest)
{
try
{
var filename = Path.Combine(directory, string.Format("{0}_{1}.manifest", manifest.DepotID, manifest.ManifestGID));
manifest.SaveToFile(filename);
File.WriteAllBytes(filename + ".sha", FileSHAHash(filename));
return true; // If serialization completes without throwing an exception, return true
}
catch (Exception)
{
return false; // Return false if an error occurs
}
}
public static byte[] DecodeHexString(string hex)
{
if (hex == null)
return null;
var chars = hex.Length;
var bytes = new byte[chars / 2];
for (var i = 0; i < chars; i += 2)
bytes[i / 2] = Convert.ToByte(hex.Substring(i, 2), 16);
return bytes;
}
/// <summary>
/// Decrypts using AES/ECB/PKCS7
/// </summary>
public static byte[] SymmetricDecryptECB(byte[] input, byte[] key)
{
using var aes = Aes.Create();
aes.BlockSize = 128;
aes.KeySize = 256;
aes.Mode = CipherMode.ECB;
aes.Padding = PaddingMode.PKCS7;
using var aesTransform = aes.CreateDecryptor(key, null);
var output = aesTransform.TransformFinalBlock(input, 0, input.Length);
return output;
}
}
}

@ -1,14 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="protobuf-net" publicKeyToken="257b51d87d2e4d67" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-2.0.0.640" newVersion="2.0.0.640"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="protobuf-net" version="2.0.0.668" targetFramework="net4" />
<package id="SteamKit2" version="1.8.1" targetFramework="net45" />
</packages>

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="100%" height="100%" viewBox="0 0 65 65" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
<g id="B" transform="matrix(1,0,0,1,0.5,0.5)">
<g>
<path d="M1.305,41.202C5.259,54.386 17.488,64 31.959,64C49.632,64 63.959,49.673 63.959,32C63.959,14.327 49.632,0 31.959,0C15.001,0 1.124,13.193 0.028,29.874C2.102,33.351 2.907,35.502 1.303,41.202L1.305,41.202Z" style="fill:rgb(56,61,72);fill-rule:nonzero;"/>
<g transform="matrix(-0.984183,-1.19698e-16,9.80712e-17,-0.795301,95.4776,96.4352)">
<g id="Arrow">
<path d="M45.613,41.896C45.811,41.658 46.125,41.658 46.322,41.896C48.069,44.002 55.776,53.297 58.421,56.487C58.569,56.666 58.615,56.938 58.537,57.174C58.459,57.411 58.273,57.566 58.067,57.566C55.616,57.566 50.417,57.566 50.417,57.566L50.417,80.833L41.519,90.628L41.519,57.566L33.869,57.566C33.662,57.566 33.476,57.411 33.399,57.174C33.321,56.938 33.367,56.666 33.515,56.487C36.16,53.297 43.867,44.002 45.613,41.896Z" style="fill:white;"/>
<path d="M44.904,40.996C43.158,43.102 35.45,52.397 32.805,55.587C32.361,56.122 32.224,56.937 32.457,57.648C32.691,58.359 33.249,58.824 33.869,58.824L40.502,58.824C40.502,58.824 40.502,90.628 40.502,90.628L42.194,91.567L51.433,81.398L51.433,58.824C51.433,58.824 58.067,58.824 58.067,58.824C58.687,58.824 59.245,58.359 59.478,57.648C59.712,56.937 59.574,56.122 59.13,55.587C56.485,52.397 48.778,43.102 47.032,40.996C46.44,40.282 45.496,40.282 44.904,40.996L44.904,40.996ZM45.613,41.896C45.811,41.658 46.125,41.658 46.322,41.896C48.069,44.002 55.776,53.297 58.421,56.487C58.569,56.666 58.615,56.938 58.537,57.174C58.459,57.411 58.273,57.566 58.067,57.566C55.616,57.566 50.417,57.566 50.417,57.566L50.417,80.833L41.519,90.628L41.519,57.566L33.869,57.566C33.662,57.566 33.476,57.411 33.399,57.174C33.321,56.938 33.367,56.666 33.515,56.487C36.16,53.297 43.867,44.002 45.613,41.896Z" style="fill:rgb(56,61,72);"/>
</g>
</g>
<path id="Steam" d="M30.31,23.985L30.313,24.143L22.483,35.518C21.215,35.46 19.943,35.683 18.735,36.18C18.209,36.394 17.707,36.662 17.237,36.98L0.042,29.893C0.042,29.893 -0.356,36.439 1.302,41.317L13.458,46.333C14.058,49.061 15.938,51.453 18.7,52.603C23.194,54.47 28.43,52.313 30.303,47.821C30.786,46.664 31.019,45.418 30.987,44.165L42.18,36.16L42.455,36.165C49.16,36.165 54.61,30.699 54.61,23.985C54.61,17.271 49.17,11.825 42.455,11.811C35.753,11.811 30.3,17.271 30.3,23.985L30.31,23.985ZM28.43,47.035C26.976,50.535 22.964,52.182 19.477,50.729C17.93,50.079 16.675,48.882 15.953,47.367L19.91,49.007C20.524,49.262 21.182,49.394 21.847,49.394C23.879,49.394 25.721,48.165 26.501,46.288C27.565,43.733 26.34,40.754 23.786,39.687L19.686,37.992C21.264,37.392 23.058,37.372 24.736,38.069C26.436,38.772 27.736,40.096 28.432,41.789C29.128,43.482 29.124,45.349 28.422,47.035M42.466,32.1C38.022,32.088 34.372,28.431 34.368,23.987C34.373,19.544 38.023,15.888 42.466,15.876C46.91,15.887 50.561,19.543 50.566,23.987C50.562,28.431 46.91,32.089 42.466,32.1M36.398,23.974C36.395,20.635 39.139,17.884 42.478,17.879C45.833,17.879 48.562,20.609 48.562,23.974C48.564,27.314 45.818,30.064 42.478,30.067C39.139,30.062 36.395,27.313 36.397,23.974L36.398,23.974Z" style="fill:rgb(175,212,255);fill-rule:nonzero;"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.6 KiB

@ -0,0 +1,339 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.

@ -1,30 +1,131 @@
DepotDownloader
===============
Steam depot downloader utilizing the SteamKit2 library. Supports .NET Core 2.0
Steam depot downloader utilizing the SteamKit2 library. Supports .NET 8.0
This program must be run from a console, it has no GUI.
## Installation
### Directly from GitHub
Download a binary from [the releases page](https://github.com/SteamRE/DepotDownloader/releases/latest).
### via Windows Package Manager CLI (aka winget)
On Windows, [winget](https://github.com/microsoft/winget-cli) users can download and install
the latest Terminal release by installing the `SteamRE.DepotDownloader`
package:
```powershell
winget install --exact --id SteamRE.DepotDownloader
```
Usage: ./depotdownloader <parameters> [optional parameters]
OR: dotnet DepotDownloader.dll <parameters> [optional parameters]
Parameters:
-app <#> - the AppID to download.
Optional Parameters:
-depot <#> - the DepotID to download.
-cellid <#> - the overridden CellID of the content server to download from.
-username <user> - the username of the account to login to for restricted content.
-password <pass> - the password of the account to login to for restricted content.
-remember-password - if set, remember the password for subsequent logins of this user.
-dir <installdir> - the directory in which to place downloaded files.
-os <os> - the operating system for which to download the game (windows, macos or linux, default: OS the program is currently running on)
-filelist <file.txt> - a list of files to download (from the manifest).
Can optionally use regex to download only certain files.
-all-platforms - downloads all platform-specific depots when -app is used.
-manifest-only - downloads a human readable manifest for any depots that would be downloaded.
-beta <branchname> - download from specified branch if available (default: Public).
-betapassword <pass> - branch password if applicable.
-manifest <id> - manifest id of content to download (requires -depot, default: latest for branch).
-max-servers <#> - maximum number of content servers to use. (default: 8).
-max-downloads <#> - maximum number of chunks to download concurrently. (default: 4).
### via Homebrew
On macOS, [Homebrew](https://brew.sh) users can download and install that latest release by running the following commands:
```shell
brew tap steamre/tools
brew install depotdownloader
```
## Usage
### Downloading one or all depots for an app
```powershell
./DepotDownloader -app <id> [-depot <id> [-manifest <id>]]
[-username <username> [-password <password>]] [other options]
```
For example: `./DepotDownloader -app 730 -depot 731 -manifest 7617088375292372759`
By default it will use anonymous account ([view which apps are available on it here](https://steamdb.info/sub/17906/)).
To use your account, specify the `-username <username>` parameter. Password will be asked interactively if you do
not use specify the `-password` parameter.
### Downloading a workshop item using pubfile id
```powershell
./DepotDownloader -app <id> -pubfile <id> [-username <username> [-password <password>]]
```
For example: `./DepotDownloader -app 730 -pubfile 1885082371`
### Downloading a workshop item using ugc id
```powershell
./DepotDownloader -app <id> -ugc <id> [-username <username> [-password <password>]]
```
For example: `./DepotDownloader -app 730 -ugc 770604181014286929`
## Parameters
#### Authentication
Parameter | Description
----------------------- | -----------
`-username <user>` | the username of the account to login to for restricted content.
`-password <pass>` | the password of the account to login to for restricted content.
`-remember-password` | if set, remember the password for subsequent logins of this user. (Use `-username <username> -remember-password` as login credentials)
`-qr` | display a login QR code to be scanned with the Steam mobile app
`-no-mobile` | prefer entering a 2FA code instead of prompting to accept in the Steam mobile app.
`-loginid <#>` | a unique 32-bit integer Steam LogonID in decimal, required if running multiple instances of DepotDownloader concurrently.
#### Downloading
Parameter | Description
------------------------ | -----------
`-app <#>` | the AppID to download.
`-depot <#>` | the DepotID to download.
`-manifest <id>` | manifest id of content to download (requires `-depot`, default: current for branch).
`-ugc <#>` | the UGC ID to download.
`-pubfile <#>` | the PublishedFileId to download. (Will automatically resolve to UGC id)
`-branch <branchname>` | download from specified branch if available (default: Public).
`-branchpassword <pass>` | branch password if applicable.
#### Download configuration
Parameter | Description
----------------------- | -----------
`-all-platforms` | downloads all platform-specific depots when `-app` is used.
`-os <os>` | the operating system for which to download the game (windows, macos or linux, default: OS the program is currently running on)
`-osarch <arch>` | the architecture for which to download the game (32 or 64, default: the host's architecture)
`-all-archs` | download all architecture-specific depots when `-app` is used.
`-all-languages` | download all language-specific depots when `-app` is used.
`-language <lang>` | the language for which to download the game (default: english)
`-lowviolence` | download low violence depots when `-app` is used.
`-dir <installdir>` | the directory in which to place downloaded files.
`-filelist <file.txt>` | the name of a local file that contains a list of files to download (from the manifest). prefix file path with `regex:` if you want to match with regex. each file path should be on their own line.
`-validate` | include checksum verification of files already downloaded.
`-manifest-only` | downloads a human readable manifest for any depots that would be downloaded.
`-cellid <#>` | the overridden CellID of the content server to download from.
`-max-downloads <#>` | maximum number of chunks to download concurrently. (default: 8).
`-use-lancache` | forces downloads over the local network via a Lancache instance.
#### Other
Parameter | Description
----------------------- | -----------
`-debug` | enable verbose debug logging.
`-V` or `--version` | print version and runtime.
## Frequently Asked Questions
### Why am I prompted to enter a 2-factor code every time I run the app?
Your 2-factor code authenticates a Steam session. You need to "remember" your session with `-remember-password` which persists the login key for your Steam session.
### Can I run DepotDownloader while an account is already connected to Steam?
Any connection to Steam will be closed if they share a LoginID. You can specify a different LoginID with `-loginid`.
### Why doesn't my password containing special characters work? Do I have to specify the password on the command line?
If you pass the `-password` parameter with a password that contains special characters, you will need to escape the command appropriately for the shell you are using. You do not have to include the `-password` parameter on the command line as long as you include a `-username`. You will be prompted to enter your password interactively.
### I am getting error 401 or no manifest code returned for old manifest ids
Try logging in with a Steam account, this may happen when using anonymous account.
Steam allows developers to block downloading old manifests, in which case no manifest code is returned even when parameters appear correct.
### Why am I getting slow download speeds and frequent connection timeouts?
When downloading old builds, cache server may not have the chunks readily available which makes downloading slower.
Try increasing `-max-downloads` to saturate the network more.

@ -0,0 +1,6 @@
{
"sdk": {
"version": "9.0.100",
"rollForward": "latestMinor"
}
}
Loading…
Cancel
Save