-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
185 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
using Newtonsoft.Json; | ||
|
||
namespace SaveGetter | ||
{ | ||
public class LoginToken | ||
{ | ||
[JsonProperty("access_token")] | ||
public string AccessToken { get; set; } | ||
|
||
[JsonProperty("bans")] | ||
public List<object> Bans { get; set; } | ||
|
||
[JsonProperty("display_name")] | ||
public string DisplayName { get; set; } | ||
|
||
[JsonProperty("expires_in")] | ||
public long ExpiresIn { get; set; } | ||
|
||
[JsonProperty("is_comply")] | ||
public bool IsComply { get; set; } | ||
|
||
[JsonProperty("jflgs")] | ||
public long Jflgs { get; set; } | ||
|
||
[JsonProperty("namespace")] | ||
public string Namespace { get; set; } | ||
|
||
[JsonProperty("namespace_roles")] | ||
public List<NamespaceRole> NamespaceRoles { get; set; } | ||
|
||
[JsonProperty("permissions")] | ||
public List<object> Permissions { get; set; } | ||
|
||
[JsonProperty("platform_id")] | ||
public string PlatformId { get; set; } | ||
|
||
[JsonProperty("platform_user_id")] | ||
public string PlatformUserId { get; set; } | ||
|
||
[JsonProperty("refresh_expires_in")] | ||
public long RefreshExpiresIn { get; set; } | ||
|
||
[JsonProperty("refresh_token")] | ||
public string RefreshToken { get; set; } | ||
|
||
[JsonProperty("roles")] | ||
public List<string> Roles { get; set; } | ||
|
||
[JsonProperty("scope")] | ||
public string Scope { get; set; } | ||
|
||
[JsonProperty("token_type")] | ||
public string TokenType { get; set; } | ||
|
||
[JsonProperty("user_id")] | ||
public string UserId { get; set; } | ||
} | ||
public partial class NamespaceRole | ||
{ | ||
[JsonProperty("roleId")] | ||
public string RoleId { get; set; } | ||
|
||
[JsonProperty("namespace")] | ||
public string Namespace { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
using Newtonsoft.Json; | ||
using Steamworks; | ||
|
||
namespace SaveGetter | ||
{ | ||
internal class Program | ||
{ | ||
static void Main(string[] args) | ||
{ | ||
Console.WriteLine("Getting your save!"); | ||
|
||
if (!SteamAPI.Init()) | ||
{ | ||
Console.WriteLine("Steam not running, make sure it is running in the background!"); | ||
Environment.Exit(0); | ||
} | ||
byte[] buffer = new byte[1024]; | ||
_ = SteamUser.GetAuthSessionTicket(buffer, 1024, out uint tikcet); | ||
var Token = BitConverter.ToString(buffer[..(int)tikcet]).Replace("-", string.Empty); | ||
//Console.WriteLine(Token); | ||
var token = Auth(Token); | ||
GetSave(token); | ||
Exit(); | ||
} | ||
|
||
static LoginToken Auth(string Token) | ||
{ | ||
HttpClient client = new HttpClient(); | ||
client.BaseAddress = new Uri("https://nebula.starbreeze.com"); | ||
|
||
var formvalues = new Dictionary<string, string> | ||
{ | ||
{ "platform_token", Token } | ||
}; | ||
var content = new FormUrlEncodedContent(formvalues); | ||
//client.DefaultRequestHeaders.Add("Content-Type", "application/x-www-form-urlencoded"); | ||
client.DefaultRequestHeaders.Add("Authorization", "Basic MGIzYmZkZjVhMjVmNDUyZmJkMzNhMzYxMzNhMmRlYWI6"); | ||
client.DefaultRequestHeaders.Add("Namespace", "pd3"); | ||
var resp = client.PostAsync("/iam/v3/oauth/platforms/steam/token", content).Result; | ||
if (resp.StatusCode == System.Net.HttpStatusCode.OK) | ||
{ | ||
Console.WriteLine("SUCCESS! Got your Login Tokens"); | ||
var json = JsonConvert.DeserializeObject<LoginToken>(resp.Content.ReadAsStringAsync().Result); | ||
//Console.WriteLine(JsonConvert.SerializeObject(json)); | ||
return json; | ||
Check warning on line 45 in SaveGetter/Program.cs GitHub Actions / .NET on windows-latest (Release)
Check warning on line 45 in SaveGetter/Program.cs GitHub Actions / .NET on ubuntu-latest (Release)
Check warning on line 45 in SaveGetter/Program.cs GitHub Actions / .NET on windows-latest (Release)
|
||
} | ||
else | ||
{ | ||
Console.WriteLine("Error!"); | ||
Console.WriteLine(resp.StatusCode); | ||
Console.WriteLine(resp.Content.ReadAsStringAsync().Result); | ||
Exit(); | ||
return null; | ||
Check warning on line 53 in SaveGetter/Program.cs GitHub Actions / .NET on windows-latest (Release)
Check warning on line 53 in SaveGetter/Program.cs GitHub Actions / .NET on ubuntu-latest (Release)
Check warning on line 53 in SaveGetter/Program.cs GitHub Actions / .NET on windows-latest (Release)
|
||
} | ||
} | ||
|
||
static void GetSave(LoginToken token) | ||
{ | ||
string save = "cloudsave/v1/namespaces/__namespace__/users/__userId__/records/progressionsavegame"; | ||
HttpClient client = new HttpClient(); | ||
client.BaseAddress = new Uri("https://nebula.starbreeze.com"); | ||
client.DefaultRequestHeaders.Add("Authorization", "Bearer " + token.AccessToken); | ||
client.DefaultRequestHeaders.Add("Cookie", $"access_token={token.AccessToken};refresh_token={token.RefreshToken}"); | ||
client.DefaultRequestHeaders.Add("Namespace", token.Namespace); | ||
|
||
var result = client.GetAsync(save.Replace("__namespace__", token.Namespace).Replace("__userId__", token.UserId)).Result; | ||
|
||
if (result.StatusCode == System.Net.HttpStatusCode.OK) | ||
{ | ||
Console.WriteLine("SUCCESS! Your save saved!"); | ||
File.WriteAllText($"{token.UserId}.save.txt", result.Content.ReadAsStringAsync().Result); | ||
} | ||
else | ||
{ | ||
Console.WriteLine("Error!"); | ||
Exit(); | ||
} | ||
} | ||
|
||
static void Exit() | ||
{ | ||
Console.WriteLine("Quitting.."); | ||
SteamAPI.Shutdown(); | ||
Environment.Exit(0); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" /> | ||
<PackageReference Include="Steamworks.NET" Version="20.1.0" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<None Update="steam_api64.dll"> | ||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
</None> | ||
<None Update="steam_appid.txt"> | ||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
</None> | ||
</ItemGroup> | ||
|
||
</Project> |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1272080 |