View Single Post
Old 11-24-2008, 08:36 PM   #47
nrapallo
GuteBook/Mobi2IMP Creator
nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.
 
nrapallo's Avatar
 
Posts: 2,958
Karma: 2530691
Join Date: Dec 2007
Location: Toronto, Canada
Device: REB1200 EBW1150 Device: T1 NSTG iLiad_v2 NC Device: Asus_TF Next1 WPDN
Quote:
Originally Posted by AZed View Post
Well, I hope you have access to a better version of the .IMP standard than can be found at http://krausyaoj.tripod.com/reb1200.htm
No, that's all we've got.

However, I've been able to put down my own .imp reverse-engineering knowledge in some perl code you can have, to see what's required to further your understanding. It's an uphill battle that I would like to help with.

Quote:
-- I've just run into a brick wall. EBook::Tools can now recognize IMP files and parse the header data, but the table of contents data I'm getting on the test file I'm using downloaded from Fictionwise bears no resemblance at all to the file types in the documentation.

Code:
DEBUG: found toc entry 'AXIB' [92 bytes]
DEBUG: found toc entry '    ' [5865 bytes]
DEBUG: found toc entry 'EJWD' [76 bytes]
DEBUG: found toc entry 'GHEJ' [76 bytes]
DEBUG: found toc entry 'GJOB' [484 bytes]
DEBUG: found toc entry 'GJSB' [45 bytes]
DEBUG: found toc entry 'GLMV' [1497 bytes]
DEBUG: found toc entry 'MVGJ' [1392 bytes]
DEBUG: found toc entry 'MVMR' [136 bytes]
DEBUG: found toc entry 'OZSN' [60 bytes]
DEBUG: found toc entry 'SRWH' [64 bytes]
DEBUG: found toc entry 'WPER' [152 bytes]
DEBUG: found toc entry 'YFOX' [1838 bytes]
DEBUG: found toc entry 'YLAB' [458 bytes]
DEBUG: found toc entry 'YVGH' [52 bytes]
The .res filename is what you've found above; you need to look at the next four-letter resource filetypes like 'BGcl', 'PNG ', 'Styl', etc.

Quote:
The ' ' file is the DATA.FRK text, but that's the only thing that matches, and if it's using some form of LZSS for compression, it's using a very strange version that doesn't use a sliding window, but instead must be sticking all of its dictionary entries into one of those other resource files, because there's no initial ASCII data at all to work with. It's also not ZLib compression, which I checked just in case.
If the .imp is compressed then the text will be LZSS compressed using a 14 bit dictionary size with a 3 bit sliding window. I've figured out the algorithm used (using some trial and error 'guessing') and produced a program called deimp.exe in the Fictionwise ebookwise forum. I'll provide you with what I've learned so far.

Quote:
Unless you have some idea of how to proceed, I'm going to end up releasing 0.4.0 with just minimal support for unpacking a .imp file into a REB1200 .RES directory, but no way to actually access the text.

Update: it just occurred to me that they might be adding a ninth bit before every 8 bits of real data, instead of using the 8th bit as a compression flag. This is something of a long shot, but I can at least try to check for it by staring at the beginning of the bitstream 9 bits at a time and see if I can pull out a pattern. Not tonight, though.
I'm grateful that you are willing to venture into this uncharted terrority. I tried my hand at creating a IMP.pm based on the PDB.pm you include with EBook-Tools. I'm almost finished the header parse routine as well as the resource filetypes separation into "records". I think it best that we collaborate now to avoid anymore hair-pulling...

I'll contact you via PM to see how best to pick up where I've left off.

Thanks again for doing this for me (and the ebookwise community).
nrapallo is offline   Reply With Quote