feat: start on cli

This commit is contained in:
tresabhi committed 2025-01-20 22:16:15 -06:00
1 parent 438b565cbb
commit 8e4f4c39bb
9 files changed
+584 -1

No files matched your search

+10
View File
@@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>
+13
View File
@@ -0,0 +1,13 @@
namespace CLI.Models
{
public class PakFile
{
public long FileSize { get; set; }
public required string FileHash { get; set; }
}
public class LocalManifest
{
public required Dictionary<string, PakFile> PakFiles { get; set; }
}
}
+28
View File
@@ -0,0 +1,28 @@
using System.Text.Json;
using CLI.Models;
namespace CLI
{
class Program
{
static readonly JsonSerializerOptions options = new() { PropertyNameCaseInsensitive = true };
static void Main(string[] args)
{
string RootDir = @"C:\Users\coola\AppData\Local\Blitz";
string paksPath = Path.Combine(RootDir, @"Saved\PersistentDownloadDir\Dlc\PakCache");
string localManifestPath = Path.Combine(paksPath, "LocalManifest.json");
string localManifestContent = File.ReadAllText(localManifestPath);
LocalManifest localManifest =
JsonSerializer.Deserialize<LocalManifest>(localManifestContent, options)
?? throw new Exception("Failed to deserialize LocalManifest");
foreach (var pakFile in localManifest.PakFiles)
{
string pakFilePath = Path.Combine(paksPath, pakFile.Key);
Console.WriteLine($"({pakFile.Value.FileSize}) {pakFilePath}");
}
}
}
}