-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
56 lines (38 loc) · 1.68 KB
/
Program.cs
File metadata and controls
56 lines (38 loc) · 1.68 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
43
44
45
46
47
48
49
50
51
52
53
54
55
using System;
using System.Reflection;
using AsmResolver.DotNet;
using AsmResolver.PE.DotNet.Cil;
public class Program
{
public static void Main(string[] args)
{
const string banner = @"
__ ______ __ _
| ] .' ___ | [ | (_)
.--.| | .---. / .' \_| _ .--. .---. _ .--..--. | | __ _ .--.
/ /'`\' |/ /__\\| | ____[ `/'`\]/ /__\\[ `.-. .-. | | | [ | [ `.-. |
| \__/ || \__.,\ `.___] || | | \__., | | | | | | | | | | | | | |
'.__.;__]'.__.' `._____.'[___] '.__.'[___||__||__][___][___][___||__]
P.S: little bit Appfuscator
";
Console.WriteLine(banner);
if (args.Length < 2) {
Console.WriteLine("Usage:");
Console.WriteLine("degremlin.exe [filepath] [method_token]");
System.Environment.Exit(0);
}
string filepath = args[0];
int token = Convert.ToInt32(args[1], 16);
Assembly assembly1 = Assembly.LoadFrom(filepath);
var module = ModuleDefinition.FromFile(filepath);
var degremlin = new DeGremlin(assembly1, module, token);
degremlin.Process();
var assembly = Assembly.LoadFrom(filepath);
//Console.WriteLine(result);
string filename = Path.GetFileName(filepath);
filepath = filepath.Replace(filename, $"patched_{filename}");
module.Write(filepath);
Console.WriteLine($"Strings patched successfully! Written to {filepath}");
}
}