Skip to content
This repository was archived by the owner on Nov 24, 2023. It is now read-only.

Commit d8cb776

Browse files
authored
1.3 : More optimizations and better protections
1 parent 84b26da commit d8cb776

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

Program.cs

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,27 @@ class Program
1515
public static string FileExtension { get; set; }
1616

1717
public static bool DontRename { get; set; }
18+
1819
public static bool ForceWinForms { get; set; }
1920

21+
public static string FilePath { get; set; }
22+
2023
static void Main(string[] args)
2124
{
2225
Console.WriteLine("Drag & drop your file : ");
2326
string path = Console.ReadLine();
2427

2528
Console.WriteLine("Preparing obfuscation...");
29+
if (!File.Exists("config.txt"))
30+
{
31+
Console.WriteLine("Config file not found, continuing without it.");
32+
goto obfuscation;
33+
}
2634
Parser p = new Parser() { ConfigFile = "config.txt" };
2735
ForceWinForms = bool.Parse(p.Read("ForceWinFormsCompatibility").ReadResponse().ReplaceSpaces());
2836
DontRename = bool.Parse(p.Read("DontRename").ReadResponse().ReplaceSpaces());
2937

38+
obfuscation:
3039
Module = ModuleDefMD.Load(path);
3140
FileExtension = Path.GetExtension(path);
3241

@@ -45,13 +54,19 @@ static void Main(string[] args)
4554
Console.WriteLine("Encrypting strings...");
4655
StringEncryption.Execute();
4756

57+
Console.WriteLine("Injecting Anti-Tamper...");
58+
AntiTamper.Execute();
59+
4860
Console.WriteLine("Watermarking...");
4961
Watermark.AddAttribute();
5062

5163
Console.WriteLine("Saving file...");
64+
FilePath = @"C:\Users\" + Environment.UserName + @"\Desktop\" + Path.GetFileNameWithoutExtension(path) + "_protected" +
65+
FileExtension;
5266
ModuleWriterOptions opts = new ModuleWriterOptions(Module) { Logger = DummyLogger.NoThrowInstance };
53-
Module.Write(@"C:\Users\" + Environment.UserName + @"\Desktop\" + Path.GetFileNameWithoutExtension(path) + "_protected" +
54-
FileExtension, opts);
67+
Module.Write(FilePath, opts);
68+
69+
if (AntiTamper.HasBeenTampered) AntiTamper.InjectMd5(FilePath);
5570

5671
Console.WriteLine("Done! Press any key to exit...");
5772
Console.ReadKey();

0 commit comments

Comments
 (0)