-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.cs
61 lines (50 loc) · 1.61 KB
/
Program.cs
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
using System.Reflection;
namespace FEZStripGen
{
internal class Program
{
static readonly string[] AssembliesToStrip = {
"FEZ.exe",
"FezEngine.dll",
"FNA.dll",
"Common.dll",
"EasyStorage.dll",
"ContentSerialization.dll",
"XnaWordWrapCore.dll"
};
static string StrippedAssembliesOutDir = "Stripped";
static void Main(string[] args)
{
var loader = new ModuleLoader(GetWorkingDir(args));
foreach (var assemblyName in AssembliesToStrip)
{
if (!loader.ModuleExists(assemblyName))
{
Console.WriteLine($"Could not find assembly to strip: {assemblyName}");
continue;
}
var module = loader.LoadModule(assemblyName);
Console.WriteLine($"Stripping {assemblyName}...");
Stripper.Strip(module);
loader.SaveModule(module, Path.Combine(StrippedAssembliesOutDir, assemblyName));
}
Console.WriteLine($"Done!");
}
private static string GetWorkingDir(string[] args)
{
var workingDir = Directory.GetCurrentDirectory();
if (args.Length > 0)
{
if (!Directory.Exists(args[0]))
{
throw new DirectoryNotFoundException();
}
else
{
workingDir = args[0];
}
}
return workingDir;
}
}
}