@@ -52,12 +52,12 @@ public static class ProtectionFind
52
52
/// - The Bongle (http://web.archive.org/web/19990508193708/www.hideseek.com/products.htm)
53
53
/// - The Copy-Protected CD (http://web.archive.org/web/19990508193708/www.hideseek.com/products.htm)
54
54
/// </remarks>
55
- public static Dictionary < string , string > Scan ( string path , IProgress < Progress > progress = null )
55
+ public static Dictionary < string , string > Scan ( string path , IProgress < FileProtection > progress = null )
56
56
{
57
57
var protections = new Dictionary < string , string > ( ) ;
58
58
59
59
// Checkpoint
60
- progress ? . Report ( new Progress ( null , 0 , null ) ) ;
60
+ progress ? . Report ( new FileProtection ( null , 0 , null ) ) ;
61
61
62
62
// Create mappings for checking against
63
63
var mappings = CreateFilenameProtectionMapping ( ) ;
@@ -79,7 +79,7 @@ public static Dictionary<string, string> Scan(string path, IProgress<Progress> p
79
79
protections [ path ] = protectionname ;
80
80
81
81
// Checkpoint
82
- progress ? . Report ( new Progress ( path , 1 , protectionname ) ) ;
82
+ progress ? . Report ( new FileProtection ( path , 1 , protectionname ) ) ;
83
83
}
84
84
// If we have a directory
85
85
else if ( Directory . Exists ( path ) )
@@ -127,7 +127,7 @@ public static Dictionary<string, string> Scan(string path, IProgress<Progress> p
127
127
protections [ file ] = protectionname ;
128
128
129
129
// Checkpoint
130
- progress ? . Report ( new Progress ( file , i / files . Length , protectionname ) ) ;
130
+ progress ? . Report ( new FileProtection ( file , i / files . Length , protectionname ) ) ;
131
131
}
132
132
}
133
133
@@ -193,6 +193,13 @@ private static string ScanInFile(string file)
193
193
+ ( char ) 0x00 + "I" + ( char ) 0x00 + "O" + ( char ) 0x00 + "N" ) )
194
194
return "Impulse Reactor " + GetFileVersion ( file ) ;
195
195
196
+ // Inno Setup
197
+ if ( ( position = FileContent . IndexOf ( "Inno" ) ) == 0x30 )
198
+ {
199
+ // TOOO: Add Inno Setup extraction
200
+ return "Inno Setup " + GetInnoSetupVersion ( file ) ;
201
+ }
202
+
196
203
// JoWooD X-Prot
197
204
if ( FileContent . Contains ( ".ext " )
198
205
&& ( position = FileContent . IndexOf ( "kernel32.dll" + ( char ) 0x00 + ( char ) 0x00 + ( char ) 0x00 + "VirtualProtect" ) ) > - 1 )
@@ -738,6 +745,30 @@ private static string GetCDDVDCopsVersion(string file, int position)
738
745
return new string ( version ) ;
739
746
}
740
747
748
+ private static string GetInnoSetupVersion ( string file )
749
+ {
750
+ BinaryReader br = new BinaryReader ( new StreamReader ( file ) . BaseStream ) ;
751
+ br . BaseStream . Seek ( 0x30 , SeekOrigin . Begin ) ;
752
+ string signature = new String ( br . ReadChars ( 12 ) ) ;
753
+
754
+ if ( signature == "rDlPtS02" + ( char ) 0x87 + "eVx" )
755
+ return "1.2.10" ;
756
+ else if ( signature == "rDlPtS04" + ( char ) 0x87 + "eVx" )
757
+ return "4.0.0" ;
758
+ else if ( signature == "rDlPtS05" + ( char ) 0x87 + "eVx" )
759
+ return "4.0.3" ;
760
+ else if ( signature == "rDlPtS06" + ( char ) 0x87 + "eVx" )
761
+ return "4.0.10" ;
762
+ else if ( signature == "rDlPtS07" + ( char ) 0x87 + "eVx" )
763
+ return "4.1.6" ;
764
+ else if ( signature == "rDlPtS" + ( char ) 0xcd + ( char ) 0xe6 + ( char ) 0xd7 + "{" + ( char ) 0x0b + "*" )
765
+ return "5.1.5" ;
766
+ else if ( signature == "nS5W7dT" + ( char ) 0x83 + ( char ) 0xaa + ( char ) 0x1b + ( char ) 0x0f + "j" )
767
+ return "5.1.5" ;
768
+
769
+ return string . Empty ;
770
+ }
771
+
741
772
private static string GetJoWooDXProt1Version ( string file , int position )
742
773
{
743
774
char [ ] version = new char [ 5 ] ;
0 commit comments