MCPcopy Create free account
hub / github.com/ParaN3xus/udon-decompiler / Main

Method Main

tools/UdonProgramDumper/Program.cs:5–63  ·  view source on GitHub ↗
(string[] args)

Source from the content-addressed store, hash-verified

3internal static partial class Program
4{
5 public static int Main(string[] args)
6 {
7 var bundleArgument = new Argument<string>("bundle") {
8 Description = "A Unity asset bundle file to dump.",
9 };
10
11 var dumpCommand = new Command(
12 "dump",
13 "Dump SerializedUdonProgramAsset programs from one or more Unity asset bundles.") {
14 bundleArgument,
15 };
16 dumpCommand.SetAction(
17 parseResult =>
18 {
19 var options = new DumpOptions { Input = parseResult.GetValue(bundleArgument)! };
20 return RunDump(options);
21 });
22
23 var bpidOption = new Option<string>("--bpid", "-b") {
24 Description = "The VRChat blueprint ID used to derive the decryption key.",
25 Required = true,
26 };
27 var inputOption = new Option<string?>("--input", "-i") {
28 Description = "A bundle file to decrypt.",
29 };
30 var outputOption = new Option<string?>("--output", "-o") {
31 Description = "Output file path. Defaults to a derived sibling path.",
32 };
33 var positionalInputArgument = new Argument<string?>("input") {
34 Description = "A bundle file to decrypt.",
35 Arity = ArgumentArity.ZeroOrOne,
36 };
37
38 var decryptCommand =
39 new Command("decrypt", "Decrypt VRChat asset bundle files using a BPID.") {
40 bpidOption,
41 inputOption,
42 outputOption,
43 positionalInputArgument,
44 };
45 decryptCommand.SetAction(parseResult =>
46 {
47 var options = new DecryptOptions {
48 Bpid = parseResult.GetValue(bpidOption)!,
49 InputPath = parseResult.GetValue(inputOption),
50 OutputPath = parseResult.GetValue(outputOption),
51 PositionalInputPath =
52 parseResult.GetValue(positionalInputArgument),
53 };
54 return RunDecrypt(options);
55 });
56
57 var rootCommand =
58 new RootCommand("Dump and decrypt Udon-related Unity asset bundles.") {
59 dumpCommand,
60 decryptCommand,
61 };
62 return rootCommand.Parse(args).Invoke();

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected