SHARE
TWEET

deBockle

a guest Aug 5th, 2009 467 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. *** eReader2html003.py  2009-08-05 20:22:19.000000000 -0400
  2. --- eReader2html003b.py 2009-08-05 20:32:48.000000000 -0400
  3. ***************
  4. *** 261,267 ****
  5.                 self.section_reader = section_reader
  6.                 data = section_reader(0)
  7.                 version,  = struct.unpack('>H', data[0:2])
  8. !               if version != 272 and version != 260:
  9.                         raise ValueError('incorrect eReader version %d (error 1)' % version)
  10.                 data = section_reader(1)
  11.                 self.data = data
  12. --- 261,267 ----
  13.                 self.section_reader = section_reader
  14.                 data = section_reader(0)
  15.                 version,  = struct.unpack('>H', data[0:2])
  16. !               if version != 272 and version != 260 and version != 259:
  17.                         raise ValueError('incorrect eReader version %d (error 1)' % version)
  18.                 data = section_reader(1)
  19.                 self.data = data
  20. ***************
  21. *** 296,302 ****
  22.                         print "Flags: 0x%X" % self.flags
  23.                         raise ValueError('incompatible eReader file')
  24.                 des = Des(fixKey(user_key))
  25. !               if version == 260:
  26.                         if drm_sub_version != 13:
  27.                                 raise ValueError('incorrect eReader version %d (error 3)' % drm_sub_version)
  28.                         encrypted_key = r[44:44+8]
  29. --- 296,307 ----
  30.                         print "Flags: 0x%X" % self.flags
  31.                         raise ValueError('incompatible eReader file')
  32.                 des = Des(fixKey(user_key))
  33. !               if version == 259:
  34. !                       if drm_sub_version != 7:
  35. !                               raise ValueError('incorrect eReader version %d (error 3)' % drm_sub_version)
  36. !                       encrypted_key_sha = r[44:44+20]
  37. !                       encrypted_key = r[64:64+8]
  38. !               elif version == 260:
  39.                         if drm_sub_version != 13:
  40.                                 raise ValueError('incorrect eReader version %d (error 3)' % drm_sub_version)
  41.                         encrypted_key = r[44:44+8]
  42. ***************
  43. *** 476,482 ****
  44.         pml = PmlConverter(er.getText())
  45.         file(os.path.join(outdir, 'book.html'),'wb').write(pml.process())
  46.  
  47. ! print "eReader2Html v0.03. Copyright (c) 2008 The Dark Reverser"
  48.   if len(sys.argv)!=5:
  49.         print "Converts eReader books to HTML"
  50.         print "Usage:"
  51. --- 481,490 ----
  52.         pml = PmlConverter(er.getText())
  53.         file(os.path.join(outdir, 'book.html'),'wb').write(pml.process())
  54.  
  55. ! print "eReader2Html v0.03b, derived from:"
  56. ! print "\teReader2Html v0.03. Copyright (c) 2008 The Dark Reverser"
  57. ! print "with enhancement by DeBockle"
  58. !
  59.   if len(sys.argv)!=5:
  60.         print "Converts eReader books to HTML"
  61.         print "Usage:"
  62. ***************
  63. *** 490,493 ****
  64.                 convertEreaderToHtml(infile, name, cc, outdir)
  65.                 print "done"
  66.         except ValueError, e:
  67. !               print "Error: %s" % e
  68. \ No newline at end of file
  69. --- 498,501 ----
  70.                 convertEreaderToHtml(infile, name, cc, outdir)
  71.                 print "done"
  72.         except ValueError, e:
  73. !               print "Error: %s" % e
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top