04-12-2016, 04:14 PM | #1 |
Connoisseur
Posts: 53
Karma: 118948
Join Date: Jul 2014
Device: Kindle PaperWhite 3
|
reverse engineering azw3r?
I've been reading a book for months now and making important highlights as I go, and yesterday I realized that all highlights from the first 60% of the book were gone (I'm at around 80% now).
I loaded up the kindle and I see both the .azw3r file, which AFAIK contains the offsets for the highlights, but I also see an .azw3r.bad_file file alongside it. So somehow it became corrupted? I have no idea. I opened them both in a hex editor and I definitely see data in both. I have no experience with reverse engineering, but I'm willing to put in the work if it means that I may have a chance to recover those highlights. Preferably I'd love to merge both, but alternatively I'd love it if I could fix and use the old one since it should have way more highlights, then I can duplicate the book with a different name and give that one the newer .azw3r, then I can manually add the new highlights to the old one. I guess I'm mainly curious if anyone has any idea what kind of format the file is in. I imagine it should be the same or similar to the other azw3 metadata files? Is it some serialization format similar to protocol buffers, BSON, or Thrift? Or is it some other custom format? And does anyone know the way in which the data is arranged? Are the highlights stored from earliest to latest in the book? Could there be a way to determine why the .bad_file one is considered to be a bad file, in the hopes that I may fix it? I'm mainly looking for some direction to get started with this, as I've never done this sort of thing. Or if someone knows that it's hopeless then I won't bother As an aside, the reason these highlights are important to me is that I read through the book making highlights as I go, then I go back and write up notes based on the highlights (i.e. the important bits). This allows me to read at a faster pace than I would if I had to writes notes as I went along. It has worked perfectly for dozens of books that I've read before, I just never imagined that the rug would be pulled from under me like this! |
04-12-2016, 05:47 PM | #2 | ||
Carpe diem, c'est la vie.
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Hope this helps:
Quote:
Quote:
Last edited by geekmaster; 04-12-2016 at 06:07 PM. |
||
Advert | |
|
04-12-2016, 07:16 PM | #3 |
Connoisseur
Posts: 53
Karma: 118948
Join Date: Jul 2014
Device: Kindle PaperWhite 3
|
Thanks! But the linked thread is one that I created, and unfortunately doesn't contain much information about the metadata file which contains the highlights (azw3r AFAIK).
As for the quotes, thanks as well, but I have a feeling that KF8/kindleunpack is independent of the highlights no? That is, the highlights are stored outside of the actual azw3 book, in the sdr folder's azw3r file. |
04-12-2016, 08:21 PM | #4 |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Aren't the highlight's file just offset and length into the text of the book?
If that is the case, then you will have to unpack the book to reach that text content. I.E: They will not be offset and length into the packed file. |
04-13-2016, 01:27 PM | #5 |
Ex-Helpdesk Junkie
Posts: 19,421
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
I did find references for the older .mbp format (used for storing annotations data for MOBI books).
http://www.angelfire.com/ego2/idleloop/mbp_reader.html It is possible you can get some idea how it works/worked from there. As a general rule, lab126 is fond of their byte offsets. But no one has really devoted time to exploring the wonders of the annotations files.... |
Advert | |
|
04-13-2016, 01:56 PM | #6 | |
Carpe diem, c'est la vie.
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Here is a kindle highlights fetcher (with source code):
https://rubygems.org/gems/kindle-highlights https://github.com/speric/kindle-highlights It may have some code snippets to guide you in your "missing highlights" recovery efforts. One note of interest regarding this tool: Quote:
Last edited by geekmaster; 04-13-2016 at 02:02 PM. |
|
04-17-2016, 03:53 AM | #7 |
Groupie
Posts: 175
Karma: 54048
Join Date: Mar 2016
Device: PW3 5.6.5-usbnet
|
You may ask Amazon whether they can fix the file. Hacking the format may take longer than re-reading the book. As you have backups of both files (and hopefully everything else) you could try to rename the bad file to .azw3r and hope that it can be read by your PW after a restart/reboot.
|
Tags |
azw3r |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Reverse Engineering Whispersync | Fmstrat | Kindle Developer's Corner | 3 | 01-02-2013 03:59 PM |
Reverse Engineering Built-In Plugins | Agama | Plugins | 6 | 01-10-2012 05:35 PM |
KDK Reverse Engineering - For Those who Cannot wait... | DairyKnight | Kindle Developer's Corner | 0 | 05-14-2010 12:29 AM |
Reverse-engineering the .IMP format | nrapallo | IMP | 23 | 02-12-2009 01:44 PM |
Introduction to Reverse Engineering Software | Colin Dunstan | Deals and Resources (No Self-Promotion or Affiliate Links) | 0 | 05-25-2004 11:31 AM |