|
|
#1 |
|
Junior Member
![]() Posts: 2
Karma: 10
Join Date: Sep 2026
Device: PW4 (bricked)
|
Hello,
Has anyone had any luck on debricking a PW4? I recently acquired a PW4 which seems to be bricked its current state is: - Stuck on tree with boy screen on startup - When connected to pc, it gets detected but shows an empty drive (hidden drive with 0 bytes, on linux it shows as /dev/sdb with 0 bytes as well) - I have accessed its serial port using 1.8v UART was able to access fastboot mode but the flash commands are locked, no recovery menu as it boots directly to "BOOTING DEFAULT" if I let the kernel load. Was there any progress made on unlocking the fastboot of the PW4? Or is there still a way I could do a factory reset on this device on its current state? Thanks in advance! |
|
|
|
|
|
#2 |
|
Junior Member
![]() Posts: 2
Karma: 10
Join Date: Sep 2026
Device: PW4 (bricked)
|
Unlocking PW4 u-boot fastboot commands
Just writing here to document some progress and findings.
I was able to do some more digging and reverse engineering some of the information are from the source code package and disassembling u-boot.bin, here's a summary: - UART is available on S700, 1.8V at 115200 baudrate - Pressing any key during boot will let you enter fastboot mode - Fastboot can be accessed via the micro-USB connector and will enumerate as "USB download gadget" with VID 0x1949 PID 0x0320 - Most commands are locked but can be unlocked with the correct unlock signature - Fastboot command "getvar unlock_code" will give a string based from the device serial number in the format "0xXXXXXXXXXXXXXXXX" - The unlock signature can be derived from this unlock code with the process: unlock_code -> SHA256 hash -> RSA-PSS signature (2048-bit key, SHA256 digest, 32-byte salt) - Fastboot command "download <signature_file>" will write the signature to memory - Fastboot command "flash unlock" will verify the signature and write to IDME if valid - Once IDME has the correct unlock signature, locked commands can now be accessed In short, to unlock the restricted fastboot commands, the following process can be used: Code:
# In this example, assume: # - The unlock_code to result be: 0x0123456789abcdef # - RSA-2048 private key file to be: privatekey.pem $ ./fastboot getvar unlock_code $ echo -n "0x0123456789abcdef" | openssl dgst -sha256 -binary | openssl pkeyutl -sign -inkey privatekey.pem -pkeyopt digest:sha256 -pkeyopt rsa_padding_mode:pss -pkeyopt rsa_pss_saltlen:32 > unlock_code.sig $ ./fastboot download unlock_code.sig $ ./fastboot flash unlock ![]() A more detailed breakdown: All fastboot commands that are received by the device goes through is_restricted_command_on_locked_hw() which, as the name suggests, checks if the received command is a restricted command on a locked hardware. It does this by: 1. Calling amzn_target_device_type() to check if the devices OTP fuses are configured for engineering device or production device. 2. If running on a production device, use amzn_target_is_unlocked() to check if locked/unlock by reading the unlock signature from the IDME and calling amzn_verify_unlock() to validate the stored unlock signature. The function amzn_verify_unlock() is one of the codes that have been redacted from the source code release but I was able to disassemble and decompile this from u-boot.bin with a simplified reconstruction of its implementation below: Spoiler:
Some miscellaneous information I've gathered during this activity: - Function amzn_verify_unlock() uses LibTomCrypt 1.17 library to perform hash and signature calculations. - Reset/interrupt vector on u-boot.bin is found on offset 0x402C. Because of this, you will have better disassembly when you load this binary to base address 0x87800000 and file offset 0x402C. Some hardcoded addresses may still be a mess though. - Available fastboot commands: reboot, getvar, download, boot, continue, flash, erase, oem - Available fastboot getvar variables: version, bootloader-version, downloadsize or max-download-size, emmc-capacity, serialno, unlock_code, unlock_status, unlock_version - Available fastboot oem commands: format, relock |
|
|
|
| Advert | |
|
|
![]() |
| Thread Tools | Search this Thread |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| PW3 Need help for debricking | algenist | Kindle Developer's Corner | 5 | 08-01-2019 12:27 AM |
| Please help with debricking | kbreads | Kindle Developer's Corner | 15 | 10-25-2014 12:44 AM |
| Help debricking K3 | metafisica | Kindle Developer's Corner | 2 | 06-06-2013 06:33 AM |
| Debricking PW 5.3? | xor_ | Kindle Developer's Corner | 9 | 12-07-2012 11:56 PM |
| Debricking | sowtus | Kindle Developer's Corner | 11 | 10-05-2012 11:11 AM |