View Single Post
Old 11-27-2007, 06:57 AM   #33
igorsk
Wizard
igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.
 
Posts: 3,442
Karma: 300001
Join Date: Sep 2006
Location: Belgium
Device: PRS-500/505/700, Kindle, Cybook Gen3, Words Gear
Version 4 adds support for DRMv2 (PID-based) and extents MOBI header to 0xD0 bytes. It's not that v3 is "preferred" but it should be enough for your purposes. Maybe Cybook's parser assumes header v4 and doesn't check the actual size. Since you say you get corrupted title, my guess is that it expects the extended title record to be present (in addition to the title at the beginning of the prc file). This extra info is specified by these fields:
Code:
44 Dword  dwTitleOffset  //from the start of record 0, codepage is dwCodepage
48 Dword  dwTitleLength
Here's the format of EXTH header which immediately follows the MOBI header (i.e. at 0x10+MOBI.dwSize in rec0). I beleive you also need to set flag 0x40 in dword at MOBI+0x70 if EXTH is present.
Code:
0 dd dwSignature //'EXTH'
4 dd dwSize  //including everything
8 dd dwCount //count of extra data items
extra item:
  0 dd id
  4 dd size
  8 <size-8> data

ids:
  1: drm_server_id
  2: drm_commerce_id
  3: drm_ebookbase_book_id
100: Author
101: Publisher
102: Imprint
104: ISBN
105: Subject
106: PublishingDate
107: Review
108: Contributor
109: Rights
110: SubjectCode
111: Type
112: Source
113: ASIN
114: VersionNumber
115: Sample
116: StartReading
203: hasFakeCover
igorsk is offline   Reply With Quote