Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Sony Reader > Sony Reader Dev Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 10-21-2006, 03:22 AM   #1
geekraver
Addict
geekraver ought to be getting tired of karma fortunes by now.geekraver ought to be getting tired of karma fortunes by now.geekraver ought to be getting tired of karma fortunes by now.geekraver ought to be getting tired of karma fortunes by now.geekraver ought to be getting tired of karma fortunes by now.geekraver ought to be getting tired of karma fortunes by now.geekraver ought to be getting tired of karma fortunes by now.geekraver ought to be getting tired of karma fortunes by now.geekraver ought to be getting tired of karma fortunes by now.geekraver ought to be getting tired of karma fortunes by now.geekraver ought to be getting tired of karma fortunes by now.
 
Posts: 364
Karma: 1035291
Join Date: Jul 2006
Location: Redmond, WA
Device: iPad Mini,Kindle Paperwhite
Logging ebookUsb.dll calls

If anyone is interested, I have made a replacement ebookUsb.dll that can be dropped in to the reader software directory. It logs all the calls into the DLL to a file c:\reader.log (and then calls into the real DLL; i.e. its just a thin wrapper).

Note that you *will* need to modify your existing ebookUsb.dll, changing the name to ibookUsb.dll, and changing the first letter of each entry point to be an I (so the Usb* functions become Isb* and the CheckBlock function becomes IheckBlock). Obviously you should keep a backup first. I'm not including a patched version of the original DLL due to copyright and other restrictions.

VS.Net project is available here . You can also use this to set breakpoints in calls in the VS debugger, etc. I did this mostly to figure out why my prsutils prog isn't copying files, but it could be useful to others who want to take things much further than I'm interested in going.

Last edited by geekraver; 10-21-2006 at 03:33 AM.
geekraver is offline   Reply With Quote
Old 10-21-2006, 08:54 AM   #2
gseryakov
Enthusiast
gseryakov began at the beginning.
 
Posts: 27
Karma: 10
Join Date: Oct 2006
Device: Sony Reader
Quote:
Originally Posted by geekraver
Note that you *will* need to modify your existing ebookUsb.dll, changing the name to ibookUsb.dll, and changing the first letter of each entry point to be an I (so the Usb* functions become Isb* and the CheckBlock function becomes IheckBlock).
You can avoid the binary editing: use run-time dynamic linking (LoadLibrary/GetProcAddress). Another possibility could be (I am not 100% sure about it) to create a custom export lib with exports renaming like
Code:
; ibookUsb.def
LIBRARY      "ibookUsb"
EXPORTS
...
    IheckBlock = CheckBlock
...
gseryakov is offline   Reply With Quote
Advert
Old 12-29-2006, 08:25 PM   #3
dstewart
Junior Member
dstewart began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Dec 2006
Location: Seattle, WA
Device: Sony PRS-500
GetProcAddress version

I modded the file to use LoadLibrary/GetProcAddress instead, which means you don't need to modify the original ebookUsb.dll in any way except temporarilty renaming it to ebookUsb.org.dll. However, I hesitate to release it as it crashes after a while ... I'll track that down -- but in the meantime, geekraver, as you seeing the same with your code? (seems to run fine for a while but then crashes after a call to UsbBeginEnd?)
dstewart is offline   Reply With Quote
Old 12-29-2006, 08:35 PM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You can also log the actual USB packets for more information using one of the many freely available USB packet sniffers.
kovidgoyal is offline   Reply With Quote
Old 12-30-2006, 01:06 AM   #5
geekraver
Addict
geekraver ought to be getting tired of karma fortunes by now.geekraver ought to be getting tired of karma fortunes by now.geekraver ought to be getting tired of karma fortunes by now.geekraver ought to be getting tired of karma fortunes by now.geekraver ought to be getting tired of karma fortunes by now.geekraver ought to be getting tired of karma fortunes by now.geekraver ought to be getting tired of karma fortunes by now.geekraver ought to be getting tired of karma fortunes by now.geekraver ought to be getting tired of karma fortunes by now.geekraver ought to be getting tired of karma fortunes by now.geekraver ought to be getting tired of karma fortunes by now.
 
Posts: 364
Karma: 1035291
Join Date: Jul 2006
Location: Redmond, WA
Device: iPad Mini,Kindle Paperwhite
Quote:
Originally Posted by dstewart
I modded the file to use LoadLibrary/GetProcAddress instead, which means you don't need to modify the original ebookUsb.dll in any way except temporarilty renaming it to ebookUsb.org.dll. However, I hesitate to release it as it crashes after a while ... I'll track that down -- but in the meantime, geekraver, as you seeing the same with your code? (seems to run fine for a while but then crashes after a call to UsbBeginEnd?)
Haven't used this in a long time so I'm not sure, but I don't recall seeing crashes.

Guess you finally got yourself a reader for Xmas, eh Dave?
geekraver is offline   Reply With Quote
Advert
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Trouble logging in to Philly Free Library JSWolf General Discussions 12 10-17-2010 08:28 PM
Desktop app: libusb0.dll was not found. mwlcarter Kobo Reader 3 07-17-2010 01:01 AM
Unhandled exception in calibre.exe (python26.dll) jusmee Calibre 0 12-14-2009 12:53 AM
Why do I have to keep logging in? Laine Feedback 7 02-01-2009 01:01 PM
Trouble Logging In To Connect Reader bspill Sony Reader 2 11-11-2006 09:21 AM


All times are GMT -4. The time now is 10:32 PM.


MobileRead.com is a privately owned, operated and funded community.