-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathProgram.cs
More file actions
42 lines (33 loc) · 1.22 KB
/
Program.cs
File metadata and controls
42 lines (33 loc) · 1.22 KB
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
38
39
40
41
42
using McCrypt;
using System;
using System.IO;
using System.Reflection;
using System.Text;
namespace McEncryptor
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("-- McEncryptor --");
string runningInFolder = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
string keysDbFile = Path.Combine(runningInFolder, "keys.db");
Directory.SetCurrentDirectory(runningInFolder);
if (File.Exists(keysDbFile))
{
Console.WriteLine("Parsing Key Cache File. (keys.db)");
Keys.ReadKeysDb(keysDbFile);
}
Console.WriteLine("Path to pack file: ");
string packPath = Console.ReadLine();
string uuid = Manifest.ReadUUID(Path.Combine(packPath, "manifest.json"));
byte[] ckey = Keys.LookupKey(uuid);
string contentKey = "s5s5ejuDru4uchuF2drUFuthaspAbepE";
if (ckey != null)
contentKey = Encoding.UTF8.GetString(ckey);
Console.WriteLine("uuid: " + uuid);
Manifest.SignManifest(packPath);
Marketplace.EncryptContents(packPath, uuid, contentKey);
}
}
}