View Single Post
Old 03-31-2009, 02:51 PM   #163
elinares
Xtreme Quijote
elinares doesn't litterelinares doesn't litterelinares doesn't litter
 
elinares's Avatar
 
Posts: 101
Karma: 208
Join Date: Sep 2008
Location: La Mancha, Spain
Device: Sony PRS-505
Quote:
Originally Posted by igorsk View Post
Does lrf2lrs fail on those books too? I'd like to see some samples.
AFAIK you just need to check the object type and stream length. See here:
http://www.sven.de/librie/Librie/Psu...on?action=diff
I've tested both books with Calibre, it can not show or transform none of them. The unscrambling method described on sven.de/librie is exactly the same I implemented in LRFTools, but for some streams it does not work.

I'm going to pm you the books.

The following code
Code:
        BYTE keybyte;

        declen = LengthOfStream
        keybyte = (declen % PsuedoEncryptionKeyByte) + 0x0F; 
        if ((type == 0x11)||(type == 0x19)||(type == 0x17))
        {
            if (declen > 0x400) declen = 0x400;
        }       
        for (i = 0; i < declen; i++) {
            *(p + i) ^= keybyte;
        }
sometimes produces a byte stream (p) wich is not a zip-encoded stream. As keybyte holds 256 possible values, I've test each value trying to unzip resulting streams. If one of them works, I suppose this is the correct keybyte an continue. This weekend I'll try to figure out how can be the keybyte be infered with these sample books directly, because I like to think LRFTools is a fast tools.
elinares is offline   Reply With Quote