05-07-2014, 06:16 PM | #1 |
Connoisseur
Posts: 51
Karma: 76234
Join Date: May 2013
Device: k3w, gloHD
|
Adding downloadable filetypes to browserd?
I would like to add allowable file extensions and mime types to the browserd file on my Kindle Keyboard v3.4 so I can download .azw3 and .pdf (and other) filetypes directly from Calibre web server.
My /usr/bin/browserd is 767060 bytes. I am aware of the Free Download Hack but it seems like so much could go wrong and I'd rather not add background curl downloading if I don't have to. https://www.mobileread.com/forums/sho...d.php?t=121008 After reading these forums it is my understanding that browserd has a hard coded list of file extensions and mime types that are allowed to be downloaded (by matching strings, and wildcards are not allowed). I would like to add to this list. Calibre has the .azw3 has mime type: application/x-mobi8-ebook (I don't want to change it, I'd rather just modify my kindle ones and have it work with any Calibre server) While using a hex editor I noticed that this older browserd was modified to allow .epub and .pdf files and it looks like they were just inserted in there? https://code.google.com/p/gsnippet/s.../data/browserd Code:
A8B10: 00 00 00 00-44 6F 77 6E-6C 6F 61 64-69 6E 67 2C Downloading, A8B20: 49 64 3D 25-70 2C 20 66-69 6C 65 3D-25 73 00 00 Id=%p, file=%s A8B30: 2E 61 7A 77-00 00 00 00-2E 61 7A 77-31 00 00 00 .azw .azw1 A8B40: 2E 70 72 63-00 00 00 00-2E 70 64 66-00 00 00 00 .prc .pdf A8B50: 2E 65 70 75-62 00 00 00-2E 6D 6F 62-69 00 00 00 .epub .mobi A8B60: 4C 4F 41 44-20 44 45 43-4C 49 4E 45-44 3A 20 42 LOAD DECLINED: B Here is my unmodified binary (at a different location): Code:
AAD40: 00 00 00 00-44 6F 77 6E-6C 6F 61 64-20 72 65 71 Download req AAD50: 75 65 73 74-65 64 2C 20-64 6F 77 6E-6C 6F 61 64 uested, download AAD60: 49 64 3D 25-70 2C 20 66-69 6C 65 3D-25 73 00 00 Id=%p, file=%s AAD70: 2E 61 7A 77-00 00 00 00-2E 61 7A 77-31 00 00 00 .azw .azw1 AAD80: 2E 70 72 63-00 00 00 00-2E 6D 6F 62-69 00 00 00 .prc .mobi AAD90: 4C 4F 41 44-20 44 45 43-4C 49 4E 45-44 3A 20 42 LOAD DECLINED: B Code:
AA540: 64 65 64 00-73 74 61 74-75 73 00 00-74 65 78 74 ded status text AA550: 2F 78 2D 70-72 63 00 00-61 70 70 6C-69 63 61 74 /x-prc applicat AA560: 69 6F 6E 2F-78 2D 6D 6F-62 69 70 6F-63 6B 65 74 ion/x-mobipocket AA570: 2D 65 62 6F-6F 6B 00 00-61 70 70 6C-69 63 61 74 -ebook applicat AA580: 69 6F 6E 2F-6F 63 74 65-74 2D 73 74-72 65 61 6D ion/octet-stream AA590: 00 00 00 00-74 65 78 74-2F 70 6C 61-69 6E 00 00 text/plain AA5A0: 2E 74 78 74-00 00 00 00-44 65 66 61-75 6C 74 69 .txt Defaulti AA5B0: 6E 67 20 4D-49 4D 45 20-70 6F 6C 69-63 79 20 66 ng MIME policy f Last edited by kaito; 05-07-2014 at 06:18 PM. |
05-07-2014, 06:57 PM | #2 | |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Quote:
(I.E: Fixed length array of strings - at least in the above example.) |
|
Advert | |
|
05-07-2014, 07:47 PM | #3 | |
Connoisseur
Posts: 51
Karma: 76234
Join Date: May 2013
Device: k3w, gloHD
|
Quote:
So an unlimited number of fixed length items can be added? Doesn't the array size need to be updated somewhere? What about the mime types? Those don't look like fixed length. Is it really all just guess work? |
|
05-07-2014, 08:34 PM | #4 | |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Quote:
- - - - - If the snippets you are posting are from a file similar to the browserd that you linked to - - Then the first thing to look at is the first few bytes of the file. Once you do that, then no guessing in this case is required. (It is a very well defined file format, with many tools available to display the details of its content.) |
|
05-07-2014, 08:56 PM | #5 |
Addict
Posts: 243
Karma: 44444
Join Date: Mar 2014
Device: Kindle PW2 special offers removed by Amazon for FREE
|
the last 16 charactars at the end of every line correspond to the 16 character sets in the middle, based on the last two characters of each Unicode character.
Last edited by user743; 05-07-2014 at 09:30 PM. |
Advert | |
|
05-07-2014, 09:07 PM | #6 | |
Connoisseur
Posts: 51
Karma: 76234
Join Date: May 2013
Device: k3w, gloHD
|
Quote:
browserd: ELF 32-bit LSB executable, ARM, version 1 (SYSV), for GNU/Linux 2.6.14, dynamically linked (uses shared libs), stripped browserd: file format elf32-little objdump: Can't disassemble for architecture UNKNOWN! Sorry, I don't know how to read this file format. An example of a tool for windows x86 or linux x86 that would let me insert items into these two areas without screwing up the format would be appreciated. A generic hex editor doesn't respect its format. |
|
05-07-2014, 11:03 PM | #7 | |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Quote:
The command you gave above probably executed an "Intel arch only" version of objdump installed on the machine you where using. |
|
05-08-2014, 12:09 AM | #8 |
Connoisseur
Posts: 51
Karma: 76234
Join Date: May 2013
Device: k3w, gloHD
|
Unfortunately I don't think I have the time to learn all about assembly for this task; the output of objdump -D isn't something I understand. I was hoping for a utility that would make the editing easy or maybe pointers from someone else that has already gone through this.
|
05-08-2014, 08:59 AM | #9 | |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Quote:
or just generating a modified one from the sources. Most likely, combine the two methods (the original binary + just the binary modifications): Spoiler:
Reading the ARM instructions that you just dump'd will answer your questions about "Where / How do I change the limit on the array length?" "What is the storage format for mime types?" and just about any other question you might have about how it works / how to change it. Sometimes changing the behavior of a binary does include the WAFG (Wild Ass F...ing Guess) protocol you mentioned - but only rarely. C.S. -> The "S" stands for: Science - - - There is a method to all this madness here. - - - - - Hint: Give up on the built-in browser - just install one of our alternate browser packages. (If we have a build for the K3 that is, I don't recall off-hand if we do.) Last edited by knc1; 05-08-2014 at 09:23 AM. |
|
05-08-2014, 11:51 AM | #10 | ||
Connoisseur
Posts: 51
Karma: 76234
Join Date: May 2013
Device: k3w, gloHD
|
Quote:
Quote:
|
||
05-08-2014, 12:27 PM | #11 |
Addict
Posts: 243
Karma: 44444
Join Date: Mar 2014
Device: Kindle PW2 special offers removed by Amazon for FREE
|
deleted
Last edited by user743; 05-08-2014 at 03:18 PM. |
05-08-2014, 01:43 PM | #12 | ||
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Quote:
Quote:
So instead, you want me (very near the big 70 myself) to work out the solution and hand it to you? What about my limited life span? I don't want this change, you want it, you invest your life span in learning how to do it. Or just use the download hack linked to in the above post - the one you refused to use earlier. |
||
05-08-2014, 02:30 PM | #13 | |
Connoisseur
Posts: 51
Karma: 76234
Join Date: May 2013
Device: k3w, gloHD
|
Quote:
I am aware of that hack (as I said in my original post), but why have a forum if everyone should just go and figure things out on their own? Why have communication or language at all? Silly social human beings. I am still interested in hearing from anyone else that has a helpful answer that would accomplish my original goal of editing that file. It isn't a life or death issue, just something I wanted to do. |
|
05-08-2014, 10:12 PM | #14 | |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Quote:
Your other requirements have eliminated any choice. - - - - The true mysteries of life: Last edited by knc1; 05-09-2014 at 10:11 AM. |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Export - different filetypes | marcl | Calibre | 2 | 01-14-2014 05:30 AM |
Downloadable Vox update! | Kboland | Kobo Tablets | 5 | 03-23-2012 02:25 AM |
Downloadable Textbooks | mattodunlap | Deals and Resources (No Self-Promotion or Affiliate Links) | 3 | 03-14-2011 02:49 AM |
Downloadable apps and | cheyennedonna | enTourage Archive | 6 | 01-04-2011 01:27 PM |
LRF filetypes from this site... | ProDigit | Sony Reader | 20 | 10-21-2008 04:57 AM |