Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle > Kindle Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 02-25-2025, 12:24 AM   #1
hardfloat
Member
hardfloat ought to be getting tired of karma fortunes by now.hardfloat ought to be getting tired of karma fortunes by now.hardfloat ought to be getting tired of karma fortunes by now.hardfloat ought to be getting tired of karma fortunes by now.hardfloat ought to be getting tired of karma fortunes by now.hardfloat ought to be getting tired of karma fortunes by now.hardfloat ought to be getting tired of karma fortunes by now.hardfloat ought to be getting tired of karma fortunes by now.hardfloat ought to be getting tired of karma fortunes by now.hardfloat ought to be getting tired of karma fortunes by now.hardfloat ought to be getting tired of karma fortunes by now.
 
Posts: 10
Karma: 222224
Join Date: Feb 2025
Device: Kindle 11th Gen 2022 (KT5)
Kindle Browser Patch

I have developed a patch for the built-in web browser on armhf Kindle devices (firmware >= 5.16.3). It provides the following features:
- Remove the restriction on what kind of filetypes you can download
- Remove the restriction on what protocols you can browse, enabling the use of file://

Check it out here.
hardfloat is offline   Reply With Quote
Old 02-25-2025, 12:39 AM   #2
hardfloat
Member
hardfloat ought to be getting tired of karma fortunes by now.hardfloat ought to be getting tired of karma fortunes by now.hardfloat ought to be getting tired of karma fortunes by now.hardfloat ought to be getting tired of karma fortunes by now.hardfloat ought to be getting tired of karma fortunes by now.hardfloat ought to be getting tired of karma fortunes by now.hardfloat ought to be getting tired of karma fortunes by now.hardfloat ought to be getting tired of karma fortunes by now.hardfloat ought to be getting tired of karma fortunes by now.hardfloat ought to be getting tired of karma fortunes by now.hardfloat ought to be getting tired of karma fortunes by now.
 
Posts: 10
Karma: 222224
Join Date: Feb 2025
Device: Kindle 11th Gen 2022 (KT5)
Typo, it's actually only for >= 5.16.4
hardfloat is offline   Reply With Quote
Advert
Old 02-25-2025, 11:55 AM   #3
BionicGecko
Fanatic
BionicGecko ought to be getting tired of karma fortunes by now.BionicGecko ought to be getting tired of karma fortunes by now.BionicGecko ought to be getting tired of karma fortunes by now.BionicGecko ought to be getting tired of karma fortunes by now.BionicGecko ought to be getting tired of karma fortunes by now.BionicGecko ought to be getting tired of karma fortunes by now.BionicGecko ought to be getting tired of karma fortunes by now.BionicGecko ought to be getting tired of karma fortunes by now.BionicGecko ought to be getting tired of karma fortunes by now.BionicGecko ought to be getting tired of karma fortunes by now.BionicGecko ought to be getting tired of karma fortunes by now.
 
BionicGecko's Avatar
 
Posts: 509
Karma: 5555555
Join Date: Aug 2016
Location: Czech Republic
Device: Voyage, Oasis, Scribe, Colorsoft, Libra Colour
This is awesome! Just tested on my Oasis 3 and it works great

Makes it possible to download KFX and AZW3 files from something like Calibre-Web or COPS. This makes the browser much more useful!
BionicGecko is offline   Reply With Quote
Old 02-25-2025, 08:05 PM   #4
kaspar
Member
kaspar began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Dec 2024
Device: Kindle Scribe
Nice work. Is there any way to enable landscape mode? Would be useful on the Scribe's big screen.
kaspar is offline   Reply With Quote
Old 02-25-2025, 09:26 PM   #5
kaspar
Member
kaspar began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Dec 2024
Device: Kindle Scribe
I found this:

https://www.mobileread.com/forums/sh...84&postcount=8

I will try and report back.
kaspar is offline   Reply With Quote
Advert
Old 03-03-2025, 01:08 AM   #6
bricker
Junior Member
bricker began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Feb 2025
Device: Kindle Scribe 2022; PW 2021
Quote:
Originally Posted by hardfloat View Post
I have developed a patch for the built-in web browser on armhf Kindle devices (firmware >= 5.16.3). It provides the following features:
- Remove the restriction on what kind of filetypes you can download
- Remove the restriction on what protocols you can browse, enabling the use of file://

Check it out here.
incredible. how does this work on a technical level? how did you find what to replace in the binary?
bricker is offline   Reply With Quote
Old 03-06-2025, 11:49 PM   #7
hardfloat
Member
hardfloat ought to be getting tired of karma fortunes by now.hardfloat ought to be getting tired of karma fortunes by now.hardfloat ought to be getting tired of karma fortunes by now.hardfloat ought to be getting tired of karma fortunes by now.hardfloat ought to be getting tired of karma fortunes by now.hardfloat ought to be getting tired of karma fortunes by now.hardfloat ought to be getting tired of karma fortunes by now.hardfloat ought to be getting tired of karma fortunes by now.hardfloat ought to be getting tired of karma fortunes by now.hardfloat ought to be getting tired of karma fortunes by now.hardfloat ought to be getting tired of karma fortunes by now.
 
Posts: 10
Karma: 222224
Join Date: Feb 2025
Device: Kindle 11th Gen 2022 (KT5)
Quote:
Originally Posted by bricker View Post
incredible. how does this work on a technical level? how did you find what to replace in the binary?
After identifying kindle_browser as the primary binary, I disassembled it using Ghidra. I searched for the string "azw3", because the browser must have that string in memory at some point in order to compare whether the file you are downloading matches one of the allowed extensions. I searched for x-refs to the string to find this code:

Code:
  FUN_00036b7e(auStack_6c,".azw1");
  FUN_00036b7e(auStack_60,".azw2");
  FUN_00036b7e(auStack_54,".azw3");
  FUN_00036b7e(auStack_48,&DAT_000323a4);
  FUN_00036b7e(auStack_3c,".mobi");
  FUN_00036b7e(auStack_30,&DAT_0002f676);
  iVar10 = 0;
  do {
    if (iVar10 == 0x54) {
      bVar1 = false;
      goto LAB_0004d7d0;
    }
    base::BasicStringPiece<>::BasicStringPiece((char *)&uStack_90);
    iVar7 = base::FilePath::MatchesExtension((GURL *)aFStack_84,uStack_90,uStack_8c);
    iVar10 = iVar10 + 0xc;
  } while (iVar7 == 0);
  bVar1 = true;
LAB_0004d7d0:
which is essentially a for loop checking each extension to see if it matches, and if after checking all of them if it still hasn't matched, it sets the bVar1 to false, indicating our extension is not in the allowed list.

I patched it to:
Code:
FUN_00036b7e(auStack_6c,".azw1");
  FUN_00036b7e(auStack_60,".azw2");
  FUN_00036b7e(auStack_54,".azw3");
  FUN_00036b7e(auStack_48,&DAT_000323a4);
  FUN_00036b7e(auStack_3c,".mobi");
  FUN_00036b7e(auStack_30,&DAT_0002f676);
  iVar10 = 0;
  do {
    if (iVar10 == 0x54) {
      bVar1 = true;                   <-- PATCH
      goto LAB_0004d7d0;
    }
    base::BasicStringPiece<>::BasicStringPiece((char *)&uStack_90);
    iVar7 = base::FilePath::MatchesExtension((GURL *)aFStack_84,uStack_90,uStack_8c);
    iVar10 = iVar10 + 0xc;
  } while (iVar7 == 0);
  bVar1 = true;
LAB_0004d7d0:
so that in the case where no extension in the list matches, it still returns true instead of false.

old:

Code:
0004d7ce 00 25           movs       r5,#0x0
new:

Code:
0004d7ce 01 25           movs       r5,#0x1
Next, I searched for strings "http" and https", but the only thing I could find was this import from libchromium.so:

Code:
/* GURL::SchemeIsHTTPOrHTTPS() const */

undefined4 __thiscall GURL::SchemeIsHTTPOrHTTPS(GURL *this)

{
  size_t sVar1;
  int iVar2;
  undefined4 uVar3;
  
  sVar1 = strlen("http");
  iVar2 = FUN_018d3db8(this,&DAT_00840f1b,sVar1);
  if (iVar2 != 0) {
    return 1;
  }
  sVar1 = strlen("https");
  uVar3 = FUN_018d3db8(this,"https",sVar1);
  return uVar3;
}
I tried patching it to:

Code:
/* GURL::SchemeIsHTTPOrHTTPS() const */

undefined4 __thiscall GURL::SchemeIsHTTPOrHTTPS(GURL *this)

{
  size_t sVar1;
  int iVar2;
  undefined4 uVar3;
  
  sVar1 = strlen("http");
  iVar2 = FUN_018d3db8(this,&DAT_00840f1b,sVar1);
  
  return 1;              <-- PATCH

  sVar1 = strlen("https");
  uVar3 = FUN_018d3db8(this,"https",sVar1);
  return uVar3;
}
We removed the if statement, and simply executed the return.

old:
Code:
018d3e04 08 b1           cbz        this,LAB_018d3e0a
new:
Code:
018d3e04 00 bf           nop
The installation script does 3 things:
- Copies the browser binaries from system directories to a new directory in /mnt/us
- Patches them
- Updates /var/local/appreg.db so that the browser launch command executed when you open the browser from the GUI points to the new, patched browser instead.
hardfloat is offline   Reply With Quote
Old 03-07-2025, 11:56 AM   #8
BionicGecko
Fanatic
BionicGecko ought to be getting tired of karma fortunes by now.BionicGecko ought to be getting tired of karma fortunes by now.BionicGecko ought to be getting tired of karma fortunes by now.BionicGecko ought to be getting tired of karma fortunes by now.BionicGecko ought to be getting tired of karma fortunes by now.BionicGecko ought to be getting tired of karma fortunes by now.BionicGecko ought to be getting tired of karma fortunes by now.BionicGecko ought to be getting tired of karma fortunes by now.BionicGecko ought to be getting tired of karma fortunes by now.BionicGecko ought to be getting tired of karma fortunes by now.BionicGecko ought to be getting tired of karma fortunes by now.
 
BionicGecko's Avatar
 
Posts: 509
Karma: 5555555
Join Date: Aug 2016
Location: Czech Republic
Device: Voyage, Oasis, Scribe, Colorsoft, Libra Colour
Thanks for this detailed overview and for sharing your thought process, this was very informative.
BionicGecko is offline   Reply With Quote
Old 03-08-2025, 12:54 PM   #9
kaspar
Member
kaspar began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Dec 2024
Device: Kindle Scribe
Do you think you could similarly patch the Bluetooth manager to allow any device (a keyboard) instead of only audio devices? Obviously more work would be required after that, but it would be a great start.
kaspar is offline   Reply With Quote
Old 03-17-2025, 06:23 PM   #10
juegos
Connoisseur
juegos can extract oil from cheesejuegos can extract oil from cheesejuegos can extract oil from cheesejuegos can extract oil from cheesejuegos can extract oil from cheesejuegos can extract oil from cheesejuegos can extract oil from cheesejuegos can extract oil from cheese
 
Posts: 70
Karma: 1000
Join Date: May 2017
Device: none
What would file:// allow you to do? Thank you!
juegos is offline   Reply With Quote
Old 03-17-2025, 07:30 PM   #11
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 46,191
Karma: 168983734
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by juegos View Post
What would file:// allow you to do? Thank you!
File:// lets you open a local file in a web browser. Firefox has Open file in it's file menu to allow browsing to a file or you can type ctrl-O and browse that way. For Chrome and Edge, you need to type ctrl-O, browse to the file and then open it. I find it useful when looking a downloaded HTML file or testing a file before uploading it. File:// requires you to know the path to the file so you would have to type file://d:/downloads/abenigy.html to open the file.

At one point when Edge supported displaying ePub files, I used ctrl-O to browse to and open the ePub but gave on using Edge since the renderer was not anything to write home about.
DNSB is offline   Reply With Quote
Reply

Tags
browser


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Forma plans for a old web browser patch? Scaledish Kobo Developer's Corner 1 08-15-2020 07:35 AM
DX(G) Develop patch for missing certificate Kindle DX DeKuns Kindle Developer's Corner 34 05-22-2019 01:42 PM
Free (Kindle/Nook/Sony) Pumpkin Cookbook by Gooseberry Patch arcadata Deals and Resources (No Self-Promotion or Affiliate Links) 7 09-30-2011 02:42 AM
Free (Kindle) Tailgating Cookbook by Gooseberry Patch arcadata Deals and Resources (No Self-Promotion or Affiliate Links) 2 09-12-2011 03:08 AM
kindlepid.py patch for Kindle 2 International bloovis Kindle Developer's Corner 2 11-07-2009 07:14 AM


All times are GMT -4. The time now is 03:48 PM.


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