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 09-24-2022, 10:50 AM   #1
HackerDude
Kindle Bricker
HackerDude ought to be getting tired of karma fortunes by now.HackerDude ought to be getting tired of karma fortunes by now.HackerDude ought to be getting tired of karma fortunes by now.HackerDude ought to be getting tired of karma fortunes by now.HackerDude ought to be getting tired of karma fortunes by now.HackerDude ought to be getting tired of karma fortunes by now.HackerDude ought to be getting tired of karma fortunes by now.HackerDude ought to be getting tired of karma fortunes by now.HackerDude ought to be getting tired of karma fortunes by now.HackerDude ought to be getting tired of karma fortunes by now.HackerDude ought to be getting tired of karma fortunes by now.
 
HackerDude's Avatar
 
Posts: 120
Karma: 862606
Join Date: Sep 2022
Location: Why do you want to know?
Device: PW6, PW6(dead), PW5 (brick), PW5 (brick), PW4 (brick)
Lightbulb Questions about web browser reverse-engineering

I'm working on some web-browser based JS stuff, and looking at the Kindle's USB partition, I can see a folder called .active_content_sandbox

In there, there is are cached Kindle store files, such as index.html, secondaryStore.html, e.t.c.

Most of them are obfuscated, but I can see some code that is related to a custom window.kindle property:
Code:
if(!kindle || typeof kindle === 'undefined') {
                    var kindle = window.kindle || top.kindle;
                }
                var host = kindle;
                
                if (host.dev.webkitLog) {
                    host.dev.webkitLog('on');
                }  
                
                var Locale = window.Locale || top.Locale;
                var DateTimeFormat = window.DateTimeFormat || top.DateTimeFormat;
                var NumberFormat = window.NumberFormat || top.NumberFormat;
and also

Code:
kindle.dev.loadResource&&(kindle.dev.loadResource(window.frameElement?window.frameElement.id:"externalPage","jquery"),kindle.dev.setSensitivity(!0,1500)),kindle&&(kindle.chrome.setTitleBar("",pageTitle)

However, when I try to observer window.kindle from the browser, it merely shows up as undefined, running the following code:
Code:
for (prop in window) {
  log(prop);
}
Shows that it does indeed exist, however, checking its type shows as "undefined" and it appears to be inaccessible


Does anyone know anything about how this works???
Thanks

Last edited by HackerDude; 09-24-2022 at 10:55 AM.
HackerDude is offline   Reply With Quote
Old 09-25-2022, 04:16 AM   #2
Kusuri
Connoisseur
Kusuri ought to be getting tired of karma fortunes by now.Kusuri ought to be getting tired of karma fortunes by now.Kusuri ought to be getting tired of karma fortunes by now.Kusuri ought to be getting tired of karma fortunes by now.Kusuri ought to be getting tired of karma fortunes by now.Kusuri ought to be getting tired of karma fortunes by now.Kusuri ought to be getting tired of karma fortunes by now.Kusuri ought to be getting tired of karma fortunes by now.Kusuri ought to be getting tired of karma fortunes by now.Kusuri ought to be getting tired of karma fortunes by now.Kusuri ought to be getting tired of karma fortunes by now.
 
Posts: 99
Karma: 909418
Join Date: Aug 2021
Location: Germany
Device: PW4+Fire 7", Onyx Boox Nova Air
i'm not really experienced that much in kindle hacking, but i know a bit of javascript (the code you posted here is js). and my guess is that window.kindle gets defined inside the application self (main kindle UI?), so if you try to access it outside of that context of the application where it is used, it isn't defined as a variable (window.kindle).. so it's undefined.

if i where you, i would try if i somehow could inject code into that main application where that code you posted is used to learn more about window.kindle and what exactly it contains. on a windows pc i would do something like "console.log(window.kindle);" but on a kindle you would need to save it somehow in a logfile i guess.

edit: maybe you could use the KindleTool to extract a kindle update to maybe find more of the code of the main application where the window.kindle gets defined that you can't normally access (in the filesystem of the kindle)?

Last edited by Kusuri; 09-25-2022 at 04:26 AM.
Kusuri is offline   Reply With Quote
Advert
Old 09-25-2022, 11:01 AM   #3
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,506
Karma: 26047202
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
Historically, you'd have to look into a factory image and the diags partition to have a look at un (or less-) obfuscated code. But that was a hell of a lot of FW versions ago (and, like, 6 UI iterations ago? ).

TL;DR: No idea how this shit works since the React stuff.
NiLuJe is offline   Reply With Quote
Old 09-27-2022, 01:28 PM   #4
HackerDude
Kindle Bricker
HackerDude ought to be getting tired of karma fortunes by now.HackerDude ought to be getting tired of karma fortunes by now.HackerDude ought to be getting tired of karma fortunes by now.HackerDude ought to be getting tired of karma fortunes by now.HackerDude ought to be getting tired of karma fortunes by now.HackerDude ought to be getting tired of karma fortunes by now.HackerDude ought to be getting tired of karma fortunes by now.HackerDude ought to be getting tired of karma fortunes by now.HackerDude ought to be getting tired of karma fortunes by now.HackerDude ought to be getting tired of karma fortunes by now.HackerDude ought to be getting tired of karma fortunes by now.
 
HackerDude's Avatar
 
Posts: 120
Karma: 862606
Join Date: Sep 2022
Location: Why do you want to know?
Device: PW6, PW6(dead), PW5 (brick), PW5 (brick), PW4 (brick)
My bad! It turns out, upon further investigation, that merely checking if window.kindle exists defined it (JS be like). It appears to be defined only when viewing the Kindle's "store" app, as the store app is basically just a glorified webview

I have also discovered that the Kindle's browser is the equivalent of Safari 5, so I can now locally test HTML and JS code

Unfortunately, as a result of this, it doesn't seem to be that useful to me

Last edited by HackerDude; 09-27-2022 at 01:29 PM. Reason: update the text
HackerDude is offline   Reply With Quote
Old 09-27-2022, 09:53 PM   #5
luketheduke
Connoisseur
luketheduke knows what's going on.luketheduke knows what's going on.luketheduke knows what's going on.luketheduke knows what's going on.luketheduke knows what's going on.luketheduke knows what's going on.luketheduke knows what's going on.luketheduke knows what's going on.luketheduke knows what's going on.luketheduke knows what's going on.luketheduke knows what's going on.
 
luketheduke's Avatar
 
Posts: 87
Karma: 25608
Join Date: Sep 2022
Device: PW3, PW2, KT2, 2xKT, 2xK3G
Quote:
Originally Posted by Bluebotlabs View Post
It turns out, upon further investigation, that merely checking if window.kindle exists defined it (JS be like).
Don't you love Javascript?
luketheduke is offline   Reply With Quote
Advert
Old 09-28-2022, 08:12 AM   #6
HackerDude
Kindle Bricker
HackerDude ought to be getting tired of karma fortunes by now.HackerDude ought to be getting tired of karma fortunes by now.HackerDude ought to be getting tired of karma fortunes by now.HackerDude ought to be getting tired of karma fortunes by now.HackerDude ought to be getting tired of karma fortunes by now.HackerDude ought to be getting tired of karma fortunes by now.HackerDude ought to be getting tired of karma fortunes by now.HackerDude ought to be getting tired of karma fortunes by now.HackerDude ought to be getting tired of karma fortunes by now.HackerDude ought to be getting tired of karma fortunes by now.HackerDude ought to be getting tired of karma fortunes by now.
 
HackerDude's Avatar
 
Posts: 120
Karma: 862606
Join Date: Sep 2022
Location: Why do you want to know?
Device: PW6, PW6(dead), PW5 (brick), PW5 (brick), PW4 (brick)
Quote:
Originally Posted by luketheduke View Post
Don't you love Javascript?

Unfortunately, I'm going to have to learn to for this current project...
HackerDude is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Reverse Engineering Conversion Conday Conversion 6 09-16-2021 10:11 AM
K4 sync reverse engineering xifer Kindle Developer's Corner 3 10-16-2020 10:03 AM
reverse engineering azw3r? blaenk Kindle Developer's Corner 6 04-17-2016 03:53 AM
Reverse Engineering Whispersync Fmstrat Kindle Developer's Corner 3 01-02-2013 03:59 PM
Introduction to Reverse Engineering Software Colin Dunstan Deals and Resources (No Self-Promotion or Affiliate Links) 0 05-25-2004 11:31 AM


All times are GMT -4. The time now is 05:54 AM.


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