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 05-08-2026, 08:18 AM   #1
Sats
Connoisseur
Sats ought to be getting tired of karma fortunes by now.Sats ought to be getting tired of karma fortunes by now.Sats ought to be getting tired of karma fortunes by now.Sats ought to be getting tired of karma fortunes by now.Sats ought to be getting tired of karma fortunes by now.Sats ought to be getting tired of karma fortunes by now.Sats ought to be getting tired of karma fortunes by now.Sats ought to be getting tired of karma fortunes by now.Sats ought to be getting tired of karma fortunes by now.Sats ought to be getting tired of karma fortunes by now.Sats ought to be getting tired of karma fortunes by now.
 
Posts: 65
Karma: 1876850
Join Date: Jun 2023
Device: iPhone
Some help with compilation and/or testing

Recently, there have been complaints about Dedrm not working on various firmware versions of Kindle. I guess the interest in such tools for jailbroken Kindles is not very high, though, since the possible solution is, well, porting KFXArchiver to the device, because why not? So I tried doing that (in KUAL addon form), just for completion's sake. However, I only have pw2 with 5.12.2.2 firmware, (recently got it on a whim) little to no experience with cross-compiling and no way to test the compiled executables. So I would like some help with that, if possible?

As one can see, I thought that there are roughly 4 divisions, compilation with c++11 strings and without, as well as HF and not HF glibc. There might be more, and I might have compiled them wrong in the first place. Oasis, for example *should* be HF/old strings. But once again, not much knowledge in this area. There is also a possibility that different FW have different method signatures...

So, if possible, could somebody here either compile the source and try it for various jailbroken devices or at least try prepared executables and report, here or in DM, about their failure modes?

Expected failure modes:
Wrong HF - executable "is not found"
Wrong C++ ABI: usually bad_alloc but may very with segfault
Wrong signature in shared lib: segfault (null call)
Wrong implementation for newer firmware (scribe, etc?): runs but the books are not decrypted.
Sats is offline   Reply With Quote
Old 05-08-2026, 09:53 AM   #2
shamanNS
Wizard
shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.
 
Posts: 1,184
Karma: 12360286
Join Date: Feb 2010
Location: Serbia
Device: Kindle PW5, Kobo Libra 2, Kindle PW1
Did you try using this toolchain for compiling?

https://github.com/koreader/koxtoolchain

As for Kindle devices using v5.x firmware branch stuff is usually compiled to target ABI and use certain compiler flags in groups like this:

1) Kindle Touch & PW1
2) PW2 and all later models, all the way to firmware 5.16.2.1.1 ( = the last "soft float" firmware)
3) armhf ABI / firmware 5.16.3 and later.

So then you have situation that all models released between PW4 and PW6 could be on armel or armhf ABI depending on if the device is on older or latest available firmware for that particular model. Thus the end user needs to know and use correct binaries.

Like, I have a PW5 on 5.16.2.1.1 firmware that I do not want to ever update to newer, armhf firmware.
shamanNS is offline   Reply With Quote
Advert
Old 05-08-2026, 10:40 AM   #3
Sats
Connoisseur
Sats ought to be getting tired of karma fortunes by now.Sats ought to be getting tired of karma fortunes by now.Sats ought to be getting tired of karma fortunes by now.Sats ought to be getting tired of karma fortunes by now.Sats ought to be getting tired of karma fortunes by now.Sats ought to be getting tired of karma fortunes by now.Sats ought to be getting tired of karma fortunes by now.Sats ought to be getting tired of karma fortunes by now.Sats ought to be getting tired of karma fortunes by now.Sats ought to be getting tired of karma fortunes by now.Sats ought to be getting tired of karma fortunes by now.
 
Posts: 65
Karma: 1876850
Join Date: Jun 2023
Device: iPhone
Thank you for your response.
Quote:
Originally Posted by shamanNS View Post
Did you try using this toolchain for compiling?
https://github.com/koreader/koxtoolchain
Yes, but there was a problem of it using GCC that was too new.
Later it turned out that combination of static stdlib and flags to disable c++11 ABI would work, but at first, I had to compile using gcc 4.9.4

Quote:
Originally Posted by shamanNS View Post

As for Kindle devices using v5.x firmware branch stuff is usually compiled to target ABI and use certain compiler flags in groups like this:
1) Kindle Touch & PW1
These might be out of scope, given they will not be able to get new books soon...

Quote:
Originally Posted by shamanNS View Post
2) PW2 and all later models, all the way to firmware 5.16.2.1.1 ( = the last "soft float" firmware)
Do all of those use c++09 ABI? That is not clear. And that is probably the most important part, since my program interfaces with system library and has to feed it strings and maps.

Quote:
Originally Posted by shamanNS View Post
3) armhf ABI / firmware 5.16.3 and later.
Same as above, both instruction set and ABI should match, I think. If anything, software FP might still work, I am not too concerned with performance, it is slow as molasses.


Quote:
Originally Posted by shamanNS View Post
So then you have situation that all models released between PW4 and PW6 could be on armel or armhf ABI depending on if the device is on older or latest available firmware for that particular model. Thus the end user needs to know and use correct binaries.

Like, I have a PW5 on 5.16.2.1.1 firmware that I do not want to ever update to newer, armhf firmware.
Could you try running the executables and tell me if any of them work? I have rebuilt them with gcc 10-something and they should represent combinations of el/hf and c++11/legacy. Not sure about library compatibility.
Sats is offline   Reply With Quote
Old 05-08-2026, 04:07 PM   #4
Hag_Sub
Doingsmth
Hag_Sub began at the beginning.
 
Posts: 54
Karma: 10
Join Date: Mar 2026
Device: Kindle PW3
Quote:
Originally Posted by Sats View Post
Thank you for your response.

Yes, but there was a problem of it using GCC that was too new.
Later it turned out that combination of static stdlib and flags to disable c++11 ABI would work, but at first, I had to compile using gcc 4.9.4


These might be out of scope, given they will not be able to get new books soon...


Do all of those use c++09 ABI? That is not clear. And that is probably the most important part, since my program interfaces with system library and has to feed it strings and maps.


Same as above, both instruction set and ABI should match, I think. If anything, software FP might still work, I am not too concerned with performance, it is slow as molasses.



Could you try running the executables and tell me if any of them work? I have rebuilt them with gcc 10-something and they should represent combinations of el/hf and c++11/legacy. Not sure about library compatibility.
Well i agree the general gcc being used in kindles(2015 or earlier) have 2.2 or 2.3 or lower versions.
Well in have pw3(pw 7) if you want i can test for you and I can compile for you to(using tccmake)
Hag_Sub is offline   Reply With Quote
Old 05-08-2026, 08:03 PM   #5
Sats
Connoisseur
Sats ought to be getting tired of karma fortunes by now.Sats ought to be getting tired of karma fortunes by now.Sats ought to be getting tired of karma fortunes by now.Sats ought to be getting tired of karma fortunes by now.Sats ought to be getting tired of karma fortunes by now.Sats ought to be getting tired of karma fortunes by now.Sats ought to be getting tired of karma fortunes by now.Sats ought to be getting tired of karma fortunes by now.Sats ought to be getting tired of karma fortunes by now.Sats ought to be getting tired of karma fortunes by now.Sats ought to be getting tired of karma fortunes by now.
 
Posts: 65
Karma: 1876850
Join Date: Jun 2023
Device: iPhone
Quote:
Originally Posted by Hag_Sub View Post
Well i agree the general gcc being used in kindles(2015 or earlier) have 2.2 or 2.3 or lower versions.
Well in have pw3(pw 7) if you want i can test for you and I can compile for you to(using tccmake)
Could you please first try executables from repo? If none work, a compilation would be welcome, yes. The library it needs it -ldl for dlopen, etc.
Sats is offline   Reply With Quote
Advert
Old 05-09-2026, 10:44 AM   #6
shamanNS
Wizard
shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.
 
Posts: 1,184
Karma: 12360286
Join Date: Feb 2010
Location: Serbia
Device: Kindle PW5, Kobo Libra 2, Kindle PW1
Code:
root@kindle dedrm_test]# ./kfxdedrm_c11 -h
Kindle reader , 2 arguments
Selected Out folder: "/mnt/us/dedrm"
Created directory: "/mnt/us/dedrm"
usid length 17 strind legnth: 24
DSN_removed_serial_
Booksec: 0x1ef00e8
Vtable: 0xb6d471a0
Found getbook 0xb6b04a89
DeDRM all done.
[root@kindle dedrm_test]#
[root@kindle dedrm_test]#
[root@kindle dedrm_test]# ./kfxdedrm_old -h
Kindle reader , 2 arguments
Selected Out folder: "/mnt/us/dedrm"
usid length 17 strind legnth: 4
DSN_removed_serial_
Booksec: 0x1890130
Vtable: 0xb6d871a0
Found getbook 0xb6b44a89
DeDRM all done.
[root@kindle dedrm_test]#
[root@kindle dedrm_test]#
[root@kindle dedrm_test]# ./kfxdedrmhf_static_c11 -h
-sh: ./kfxdedrmhf_static_c11: not found
[root@kindle dedrm_test]#
[root@kindle dedrm_test]#
[root@kindle dedrm_test]# ./kfxdedrmhf_static_old -h
-sh: ./kfxdedrmhf_static_old: not found
[root@kindle dedrm_test]#
shamanNS is offline   Reply With Quote
Old 05-09-2026, 01:19 PM   #7
Sats
Connoisseur
Sats ought to be getting tired of karma fortunes by now.Sats ought to be getting tired of karma fortunes by now.Sats ought to be getting tired of karma fortunes by now.Sats ought to be getting tired of karma fortunes by now.Sats ought to be getting tired of karma fortunes by now.Sats ought to be getting tired of karma fortunes by now.Sats ought to be getting tired of karma fortunes by now.Sats ought to be getting tired of karma fortunes by now.Sats ought to be getting tired of karma fortunes by now.Sats ought to be getting tired of karma fortunes by now.Sats ought to be getting tired of karma fortunes by now.
 
Posts: 65
Karma: 1876850
Join Date: Jun 2023
Device: iPhone
Thank you!
Are there any KFX books on that kindle? As expected, hf did not work, but...
Maybe I should be explicit as to what the executables (are supposed to) do...
They are supposed to scan us/documents for KFX books and decrypt them, if possible, to "/mnt/us/dedrm". I expect the ones with CXXABI mismatch to crash when it tries decryption, but sadly, without books present, I cannot tell if it works or not Maybe I should also ask in one of the parent forum threads...
Note, executables do not have command line arguments, I wanted to, ah, simplify them for eventual use with KUAL.
Sats is offline   Reply With Quote
Old 05-09-2026, 04:26 PM   #8
Hag_Sub
Doingsmth
Hag_Sub began at the beginning.
 
Posts: 54
Karma: 10
Join Date: Mar 2026
Device: Kindle PW3
Well it's works too well(tried kfxdedrm_c11) well in have a lot of books and well when I used it after just a while it kinda filled my storage....

Kindle reader , 1 arguments
Selected Out folder: "/mnt/us/dedrm"
usid length 16 strind legnth: 24
DSNG090G1058263026X
Booksec: 0xd48868
Vtable: 0x4069f1a0
Found getbook 0x4045ca89
Adding "IMG-20251108-WA0006_6D64DD8CF9724C23B76C3EE04CE62243.kfx" as book candidate
Adding "Prabhat Advanced Hindi English Dictionary (Hindi Edition)_B06VW73857.kfx" as book candidate
Adding "The-Martial-Unity_700B5820ABB74B449153513C580190E2.kfx" as book candidate
Adding "552604629_699152783227259_5696614269396812001_n_4 D42EB3C3A0D413FA74703E1C2E4CEBA.kfx" as book candidate
Adding "IMG_20250818_144140_223_7D4AFBA4B1DD4869813F15AA5 FA74AE5.kfx" as book candidate
Adding "City_of_Sin_D0032BBF2D384420A216D6183DE8F4BC. kfx" as book candidate
Adding "Screenshot 2025-10-14 005520_5FF53BEC74F64234AE1960CED47C5020.kfx" as book candidate
Adding "538045760_805200355410574_3400909187705123903_n_9 610067095F34310801903B1275B03D5.kfx" as book candidate
Adding "547576386_771450569070739_1581618550762328268_n_7 64339ADA31B4E3DACA1078843F2050C.kfx" as book candidate
Adding "IMG_20250904_235941_814_57E2EBC6334B4D2781BC46083 D7A4F35.kfx" as book candidate
Adding "547512877_1492599781883299_4402028627756705956_n_ DF5BE2AA63ED4F91AD9BB6A601E3EA5D.kfx" as book candidate
Adding "551574510_1116261957319288_1598189977775533327_n_ 8670436AD541418291BD108E69194A31.kfx" as book candidate
Adding "551181119_3682910701845436_4063045626028104048_n_ 115E2791C06246D789905FF52BEAE26D.kfx" as book candidate
Adding "Screenshot_20251231_091614_Drive-cd3598a3-4da2-4aeb-8629-8c99f3202dad_8714BED021BE48E2A0EC41F84E13A546.kfx" as book candidate
IMG-20251108-WA0006_6D64DD8CF9724C23B76C3EE04CE62243.kfx
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
Aborted

Last edited by Hag_Sub; 05-09-2026 at 04:41 PM.
Hag_Sub is offline   Reply With Quote
Old 05-09-2026, 04:41 PM   #9
Hag_Sub
Doingsmth
Hag_Sub began at the beginning.
 
Posts: 54
Karma: 10
Join Date: Mar 2026
Device: Kindle PW3
Well nvm it did nothing for some reason...
Hag_Sub is offline   Reply With Quote
Old 05-09-2026, 04:43 PM   #10
Hag_Sub
Doingsmth
Hag_Sub began at the beginning.
 
Posts: 54
Karma: 10
Join Date: Mar 2026
Device: Kindle PW3
And permission denied for run_cmd.sh
Hag_Sub is offline   Reply With Quote
Old 05-09-2026, 09:54 PM   #11
shamanNS
Wizard
shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.
 
Posts: 1,184
Karma: 12360286
Join Date: Feb 2010
Location: Serbia
Device: Kindle PW5, Kobo Libra 2, Kindle PW1
Quote:
Originally Posted by Sats View Post
Thank you!
Are there any KFX books on that kindle?
Retail, DRMed ones? Nope, I only use KOReader and read "liberated" epubs on my Kindle.
shamanNS is offline   Reply With Quote
Old 05-10-2026, 01:18 AM   #12
Sats
Connoisseur
Sats ought to be getting tired of karma fortunes by now.Sats ought to be getting tired of karma fortunes by now.Sats ought to be getting tired of karma fortunes by now.Sats ought to be getting tired of karma fortunes by now.Sats ought to be getting tired of karma fortunes by now.Sats ought to be getting tired of karma fortunes by now.Sats ought to be getting tired of karma fortunes by now.Sats ought to be getting tired of karma fortunes by now.Sats ought to be getting tired of karma fortunes by now.Sats ought to be getting tired of karma fortunes by now.Sats ought to be getting tired of karma fortunes by now.
 
Posts: 65
Karma: 1876850
Join Date: Jun 2023
Device: iPhone
Quote:
Originally Posted by shamanNS View Post
Retail, DRMed ones? Nope, I only use KOReader and read "liberated" epubs on my Kindle.
Fair enough, though liberating them is getting harder...


Quote:
Originally Posted by Hag_Sub View Post
Well nvm it did nothing for some reason...
If you are on PW1, or anything under and potentially including oasis, please try kfxdedrm_old, though space might be an issue. Not sure what to do about it (space) for now. kfxdedrm_c11 has incompatible ABI, hence the bad_alloc crash.
Sats is offline   Reply With Quote
Old 05-10-2026, 06:26 AM   #13
shamanNS
Wizard
shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.
 
Posts: 1,184
Karma: 12360286
Join Date: Feb 2010
Location: Serbia
Device: Kindle PW5, Kobo Libra 2, Kindle PW1
He has a PW3, you can see the serial number in output text (G090G1 = PW3).
shamanNS is offline   Reply With Quote
Old 05-10-2026, 06:36 AM   #14
lkmiller
Laura
lkmiller ought to be getting tired of karma fortunes by now.lkmiller ought to be getting tired of karma fortunes by now.lkmiller ought to be getting tired of karma fortunes by now.lkmiller ought to be getting tired of karma fortunes by now.lkmiller ought to be getting tired of karma fortunes by now.lkmiller ought to be getting tired of karma fortunes by now.lkmiller ought to be getting tired of karma fortunes by now.lkmiller ought to be getting tired of karma fortunes by now.lkmiller ought to be getting tired of karma fortunes by now.lkmiller ought to be getting tired of karma fortunes by now.lkmiller ought to be getting tired of karma fortunes by now.
 
lkmiller's Avatar
 
Posts: 1,728
Karma: 24000000
Join Date: Nov 2009
Device: Kobo Sage, Kobo Elipsa, Nook Glowlight 4 Plus, Kindle Oasis 2
Since the Paperwhite 1 (5th gen) doesn't get kfx and is one of the ones getting disconnected in a few days, is this testing for the older formats which might still occasionally show up on newer devices?
lkmiller is offline   Reply With Quote
Old 05-10-2026, 07:05 AM   #15
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 83,294
Karma: 153646249
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by lkmiller View Post
Since the Paperwhite 1 (5th gen) doesn't get kfx and is one of the ones getting disconnected in a few days, is this testing for the older formats which might still occasionally show up on newer devices?
This is testing to try to get KFX off of a Kindle and have it end up in calibre with no DRM.

Last edited by JSWolf; 05-10-2026 at 04:47 PM.
JSWolf is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Please help with these compilation errors darkbreath Sigil 24 07-22-2016 11:47 AM
Can I make a compilation within a compilation? Villordsutch Amazon Kindle 5 01-04-2012 03:10 AM
compilation error iomari Calibre 1 10-04-2011 09:01 AM
New firmware compilation (June 9) ahhahh iRex 38 06-16-2010 04:28 PM
Compilation of Q&A FGFuzaxx iRex 14 07-17-2006 07:51 AM


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


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