forked from AnErrupTion/LoGiC.NET
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.cs
75 lines (57 loc) · 2.48 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
using System;
using System.IO;
using dnlib.DotNet;
using dnlib.DotNet.Writer;
using LoGiC.NET.Protections;
using SharpConfigParser;
using LoGiC.NET.Utils;
namespace LoGiC.NET
{
class Program
{
public static ModuleDefMD Module { get; set; }
public static string FileExtension { get; set; }
public static bool DontRename { get; set; }
public static bool ForceWinForms { get; set; }
public static string FilePath { get; set; }
static void Main(string[] args)
{
Console.WriteLine("Drag & drop your file : ");
string path = Console.ReadLine();
Console.WriteLine("Preparing obfuscation...");
if (!File.Exists("config.txt"))
{
Console.WriteLine("Config file not found, continuing without it.");
goto obfuscation;
}
Parser p = new Parser() { ConfigFile = "config.txt" };
ForceWinForms = bool.Parse(p.Read("ForceWinFormsCompatibility").ReadResponse().ReplaceSpaces());
DontRename = bool.Parse(p.Read("DontRename").ReadResponse().ReplaceSpaces());
obfuscation:
Module = ModuleDefMD.Load(path);
FileExtension = Path.GetExtension(path);
Console.WriteLine("Renaming...");
Renamer.Execute();
Console.WriteLine("Adding junk methods...");
JunkMethods.Execute();
Console.WriteLine("Adding proxy calls...");
ProxyAdder.Execute();
Console.WriteLine("Encoding ints...");
IntEncoding.Execute();
Console.WriteLine("Encrypting strings...");
StringEncryption.Execute();
Console.WriteLine("Injecting Anti-Tamper...");
AntiTamper.Execute();
Console.WriteLine("Watermarking...");
Watermark.AddAttribute();
Console.WriteLine("Saving file...");
FilePath = @"C:\Users\" + Environment.UserName + @"\Desktop\" + Path.GetFileNameWithoutExtension(path) + "_protected" +
FileExtension;
ModuleWriterOptions opts = new ModuleWriterOptions(Module) { Logger = DummyLogger.NoThrowInstance };
Module.Write(FilePath, opts);
if (AntiTamper.HasBeenTampered) AntiTamper.InjectMd5(FilePath);
Console.WriteLine("Done! Press any key to exit...");
Console.ReadKey();
}
}
}