Log in

View Full Version : Reversing Microsoft Reader .lit format to text format, any ideas?


ultraungar
March 19th, 2001, 08:35
Wondering if there are any thoughts to convert the .lit format used by the Microsoft Reader program to other formats.

There are programs to convert from several different to .lit but I haven't heard of anyone being able to convert it back to other formats.

If anyone has any ideas, please post.

MO`K
March 20th, 2001, 14:44
I don't know of any progams that automate the task, but i my
give you a hint on writing your own.

First, get the "reader" application that processes the given file.
Look in its disassembly for some sort of an "open" function call.
Applications first open the target file, and use some sort of
handle -returned by the OS- to reffer to the file.

First find the function that opens the file, and pay a close
attention to the code that follows.

See if the code reads the values of particular offsets within the file, and note where it stores these values. You will see them reused later, so you will need to jot them down (the offset within
the file, its value as seen in the debugger, and memory location
where it is stored.)

Try to pick one value at a time, and hexedit it to a different value. The reader application will complain about an erraneous
value X, Bingo!

Some times the application will read the entire header at once,
and store it in a dynamic array. Use IDA to isolate the usual
open/malloc/read functions, and concentrate on the guts.
Note down the base of the array, and watch out for any variables being compared to an offset of ESI, EDI at rare times.

If the application reads an entire chunk from the file, note the
size of that chunk. mostly a paremeter passed to read() which
ends up in ECX ;P

I don't know about how much intimacy with the application are
you willing to have, and how important it is to you. So if really
intersted, let me know and i will write more on the topic.

Hunt down for those little closed-source DOS demos, which
happen to have a run time library for sound and graphics and
such. They are the easiest to understand, and you will grow so
little reversing muscles disassembling them.

Get SkyRoads, it is tiny and comes with 30 or so files, and the
game is really interesting. Hint, the sprite for the space jet is
hardcoded in the main app, but all the levels and their repectve
sound data are in files ; )

dan
March 21st, 2001, 01:34
I think someone at alt.binaries.e-books is working on something. Ping the group and ask.

ultraungar
March 22nd, 2001, 14:01
Thanks for the hints. This is what I found from the bookwarez crowd.

================================

Ok now the correct instructions. Thanks to Chase for pointing out my
mistake along with the correct link.

Download and install wintask from http://www.wintask.com/

Open the lit file you wish to convert and make sure you're on the
first page of TEXT not the chapter listing. Take note of that number,
go to the last page you wish to convert and subtract the page number
of the first page of text from the last page you wish to convert. Now
go back to the first page of text.

Now open up wordpad. I use the name convert.doc on my desktop.

Now open the SRC file I've attached in WinTask and click on Play, then
a box should come up, click run, then click Ok. Now type in the
number of pages to convert (the number you calculated earlier). It
should handle everything.

I put a dialog box with some info in it, if you decide to modify and
redistribute it change it to "Convert by Tecnodude version
" add to the version number " Modifyed by: " your name or handle
and the current date. This way we can keep all the revisions separate.

Thanks
Tecnodude

--------------------
CallDialog Dialog
CallDialog PageD

BEGINDIALOG Dialog 337, 260, 350, 110
CAPTION "Convert by Tecnodude"
TEXT "Convert Version .03 by Tecnodude 1-19-2001", 59, 15
DEFPUSHBUTTON "&OK", btnOK, 125, 41, 75, 23
ENDDIALOG

BEGINDIALOG PageD 337, 260, 350, 138
CAPTION "Number of pages to convert"
TEXT "Please enter the number of pages to convert:", 55, 19
EDITTEXT pages$, 128, 42, 78, 20
DEFPUSHBUTTON "&OK", btnOK, 130, 78, 75, 23
ENDDIALOG
pages=val(pages$)
repeat
UseWindow("MSREADER.EXE|EBUI_CHILD|Microsoft Reader|1",1)
ClickMouse(Left,Down,54,62)
MoveMouse(84,654)
ClickMouse(Left,Up,84,654)

UseWindow("MSREADER.EXE|EBUI_CHILD|Microsoft Reader|1",1)
ClickMouse(Left,Down,31,131)
ClickMouse(Left,Up,31,131)

UseWindow("MSREADER.EXE|EBUI_CHILD|Microsoft Reader|1",1)
SendKeys("<Alt>"

UseWindow("WORDPAD.EXE|RichEdit20W|New WordPad Document - WordPad|1",1)
SendKeys("<Ctrl v>"

UseWindow("MSREADER.EXE|EBUI_CHILD|Microsoft Reader|1",1)
SendKeys("<pagedown>"
pages=pages-1
until pages<1



PS: <Dunamai> Von_Cha, one note. Make sure the Reader Font Size is at its default (middle setting)

ultraungar
March 22nd, 2001, 14:04
Now if we could just find Win Task ...