Ok, fixed (although I'm not sure exactly why/how; I haven't taken the time to see whether the lengths mentioned below are actually correct... <g>).
in skindle.c, on line 842, you allocate DataOut.cbData + 2 * MD5_DIGEST_LENGTH + 1 bytes. You then copy to that pointer:
memcpy(devId, DataOut.pbData, DataOut.cbData);
strcpy(devId + DataOut.cbData, vsn);
strcat(devId + DataOut.cbData, username)
However, vsn and username both are 32 bytes long (and MD5_DIGEST_LENGTH is only 16).
When I added another 32 bytes, I was able to de-drm a book (I only have one kindle 4 pc content; it was a free book that I once "bought". However, the original is DRMed, at least enough that calibre refuses to show it)!
EDIT: Try this with cygwin; if you want, I'll send you the mingw32-gcc build as well, if you don't have an environment.
EDIT2: For some reason, after this is done, Calibre no longer sees metadata in these files. Mobipocket reader crashes each time I try to import one of these files [although the copy with DRM does show up (with a warning)]
Last edited by mikeage; 12-29-2009 at 05:08 AM.
Reason: added comment about mingw32 & metadata
|