]> xmof Git - DeDRM.git/commitdiff
CMBDTC 2.2 tweak by clarknova
authorclarknova <clarknova@openrce.org>
Wed, 28 Jan 2009 12:07:01 +0000 (12:07 +0000)
committerApprentice Alf <apprenticealf@gmail.com>
Sat, 28 Feb 2015 12:07:10 +0000 (12:07 +0000)
Topaz_Tools/lib/CMBDTC.py

index bf5777af0ddb0d7e1cfcf6fb87fe68d5800ff2d3..98a807fedca59e8221382d7d44d76a7c48421376 100644 (file)
@@ -2,7 +2,7 @@
 
 """
 
-Comprehensive Mazama Book DRM with Topaz Cryptography V2.1
+Comprehensive Mazama Book DRM with Topaz Cryptography V2.2
 
 -----BEGIN PUBLIC KEY-----
 MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDdBHJ4CNc6DNFCw4MRCw4SWAK6
@@ -304,7 +304,10 @@ def encodeNumber(number):
        byte += flag
        result += chr(byte)
        flag = 0x80
-       if number == 0 : break
+       if number == 0 : 
+           if (byte == 0xFF and negative == False) :
+               result += chr(0x80)
+           break
    
    if negative:
        result += chr(0xFF)
@@ -650,10 +653,10 @@ def createDecryptedPayload(payload):
     for headerRecord in bookHeaderRecords:
        name = headerRecord
        newRecord = []
-       # if you are reading this, you might want to uncomment the next line :-D
-       #if name != "dkey" :
+
+       if name != "dkey" :
        
-       for index in range (0,len(bookHeaderRecords[name])) :
+           for index in range (0,len(bookHeaderRecords[name])) :
                offset = currentOffset
                
                if payload != None: 
@@ -747,7 +750,7 @@ def main(argv=sys.argv):
     
     
     try:
-        opts, args = getopt.getopt(sys.argv[1:], "vir:o:p:")
+        opts, args = getopt.getopt(sys.argv[1:], "vdir:o:p:")
     except getopt.GetoptError, err:
         # print help information and exit:
         print str(err) # will print something like "option -a not recognized"
@@ -894,3 +897,4 @@ def main(argv=sys.argv):
 
 if __name__ == '__main__':
     sys.exit(main())
+