@@ -15,18 +15,27 @@ class Program
15
15
public static string FileExtension { get ; set ; }
16
16
17
17
public static bool DontRename { get ; set ; }
18
+
18
19
public static bool ForceWinForms { get ; set ; }
19
20
21
+ public static string FilePath { get ; set ; }
22
+
20
23
static void Main ( string [ ] args )
21
24
{
22
25
Console . WriteLine ( "Drag & drop your file : " ) ;
23
26
string path = Console . ReadLine ( ) ;
24
27
25
28
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
+ }
26
34
Parser p = new Parser ( ) { ConfigFile = "config.txt" } ;
27
35
ForceWinForms = bool . Parse ( p . Read ( "ForceWinFormsCompatibility" ) . ReadResponse ( ) . ReplaceSpaces ( ) ) ;
28
36
DontRename = bool . Parse ( p . Read ( "DontRename" ) . ReadResponse ( ) . ReplaceSpaces ( ) ) ;
29
37
38
+ obfuscation :
30
39
Module = ModuleDefMD . Load ( path ) ;
31
40
FileExtension = Path . GetExtension ( path ) ;
32
41
@@ -45,13 +54,19 @@ static void Main(string[] args)
45
54
Console . WriteLine ( "Encrypting strings..." ) ;
46
55
StringEncryption . Execute ( ) ;
47
56
57
+ Console . WriteLine ( "Injecting Anti-Tamper..." ) ;
58
+ AntiTamper . Execute ( ) ;
59
+
48
60
Console . WriteLine ( "Watermarking..." ) ;
49
61
Watermark . AddAttribute ( ) ;
50
62
51
63
Console . WriteLine ( "Saving file..." ) ;
64
+ FilePath = @"C:\Users\" + Environment . UserName + @"\Desktop\" + Path . GetFileNameWithoutExtension ( path ) + "_protected" +
65
+ FileExtension ;
52
66
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 ) ;
55
70
56
71
Console . WriteLine ( "Done! Press any key to exit..." ) ;
57
72
Console . ReadKey ( ) ;
0 commit comments