Added the serial number block. I hope it works alright.
[MenuTunes.git] / MTeSerialNumber.m
index 9d8da42..a4882ce 100755 (executable)
@@ -1,6 +1,6 @@
 #import "MTeSerialNumber.h"
 #import "validate.h"
-
+#import <openssl/sha.h>
 
 @interface MTeSerialNumber (Private)
 - (short)validate;
@@ -19,7 +19,7 @@
                      extra:(NSString *)extra
                  publisher:(NSString *)publisher
 {
-    if ( self = [super init] ) {
+    if ( (self = [super init]) ) {
         _serialNumber = serial;
         _nameBasedKey = name;
         _extraDataKey = nil;       //extra data is currently unused.
     if ( _serialNumber ) {
 
         BOOL dead = NO;
-        
+        unsigned char *result = SHA1([[_serialNumber stringByAppendingString:@"-h4x0r"] UTF8String], [_serialNumber length] + 5, NULL);
+               if ([[[NSData dataWithBytes:result length:strlen(result)] description] isEqualToString:@"<db7ea71c 2919ff4b 520b6491 8d6813db b70647>"]) {
+                       dead = YES;
+               }
+               
         if ( [_deadSerials count] )  {
             NSEnumerator *deadEnum = [_deadSerials objectEnumerator];
             id            aDeadSerial;
             
-            while ( aDeadSerial = [deadEnum nextObject] ) {
+            while ( (aDeadSerial = [deadEnum nextObject]) ) {
                 if ( [aDeadSerial isEqualToString:_serialNumber] ) {
                     dead = YES;
                }