-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
39 lines (27 loc) · 931 Bytes
/
Program.cs
File metadata and controls
39 lines (27 loc) · 931 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// See https://aka.ms/new-console-template for more information
using System;
using Newtonsoft.Json;
using ModLoader;
using System.IO;
string[] commandArgs = Environment.GetCommandLineArgs();
if (commandArgs.Length < 3)
{
Console.WriteLine("Faltan argumentos");
return 1;
}
string packPath = commandArgs[1];
string dllPath = commandArgs[2];
Console.WriteLine("Reading Pack");
string packContent = File.ReadAllText(packPath);
Console.WriteLine("Deserialize Pack");
AssetBundlePack pack = JsonConvert.DeserializeObject<AssetBundlePack>(packContent);
Console.WriteLine("Reading dll bytes");
byte[] newdll = File.ReadAllBytes(dllPath);
Console.WriteLine("Add new dll to pack");
pack.CodeAssembly = newdll;
Console.WriteLine("Serialize Pack");
string packText = JsonConvert.SerializeObject(pack);
Console.WriteLine("Saving Pack");
File.WriteAllText(packPath, packText);
Console.WriteLine("Completed!");
return 0;