@המפתח-לפיתוח
העלתי לסונטה 5.5 עבר ל5 בע"כ אני לא מבין בזה רק יודע לגרום להם לעסוק גם בדברים שלא בא להם..
זה תשובתו
||ספויילר||Hi,
I pulled your attached zip (brom.bin, fdl1.bin, fdl2.bin) and dug into it. Summary below, plus the steps I took so you can reproduce/extend it.
1. Verified your data
SHA256 of all three files matches what you posted (fdl2 = CCFD23E5..., brom = 1C633DF8...).
2. Cloned spreadtrum_flash and checked brom against known constants
- Confirmed
"DHTB("string appears at the two offsets you found, and the SHA-256 init constants at0x574. - Searched for an AES S-box table, the RSA public-exponent constant
01 00 01, and your custom magic7f a7 2c 33 56 6d 6c 32as a literal anywhere in brom — none found. Matches what you already reported; brom doesn't contain an obvious static crypto table or the magic itself. - Also checked
t117_fdl/main.c(the open-source FDL1 you're using for the CVE bypass): itsdata_exec()does zero validation — it just jumps to the loaded address. That's a useful data point for your scenario (c): if the Qualix fdl2 body really is ciphertext, jumping into it as ARM code would just crash/hang the core with no USB response — exactly what you observed. It's independent support for "this is really encrypted," not just an artifact of your CVE path.
3. Cryptanalysis of the header (the actual new finding)
Hypothesis: the "signed" header is just the standard DHTB header (magic="DHTB", version=1, data_size at offset 0x30) run through a stream cipher.
- Computed the expected
data_sizefor each file asfile_size - 0x200 - extra, for both possible signature-trailer sizes (sign_type=0→ extra0x294,sign_type=1→ extra0x2B4). - XORed the two predicted plaintext
data_sizevalues together, and separately XORed the two actual ciphertext bytes at offset0x30–0x33. - For
sign_type=1: exact match, bit for bit (e0580100both ways). Confirmssign_type=1, and confirms the keystream encrypting the header is identical betweenfdl1.binandfdl2.bin— a classic stream-cipher nonce/IV-reuse bug. - This let me fully reconstruct the keystream for the first
0x200bytes (treating the rest of the header as zero-padding, which checks out — literally every other byte in the 0x200-byte header is identical between the two files). Validated by re-deriving fdl2's header from fdl1's recovered keystream + fdl2's owndata_size— reproduces fdl2's actual header byte-for-byte. - Checked the keystream itself for red flags (e.g. a stuck/repeating 16-byte block, which would mean ECB with a fixed counter): none found — it's a properly-evolving stream, just reused across files for this one block.
4. Checked how far the break extends — it doesn't reach the body or signature
- Compared the
sign_head(0x60 bytes) andsign_data(0x254 bytes, including where the RSA public key should sit) trailers between the two files: 594/596 bytes differ, including the key region. So the trailer gets a properly unique IV/keystream per file — no reuse there. - Also checked the body (post-header data) for any identical byte runs at matching offsets between fdl1/fdl2: found one 8-byte coincidence out of 75KB — statistical noise, not a pattern. Consistent with your entropy/autocorrelation results.
Bottom line: there's a real, demonstrable implementation flaw — the 0x200-byte header is encrypted with a keystream that gets reused (likely a fixed/reset IV specifically for the header-encryption step), letting you decrypt the metadata (data_size, sign_type) of any future captured image from this vendor without the key. But the actual firmware body and the signature/public-key trailer are encrypted correctly (unique IV each time) and this technique doesn't touch them — so it's a metadata leak, not a path to running unsigned code by itself.
Suggested next steps, in order of effort:
- If you can get one more signed image from this vendor (different firmware version of the same FDL1/FDL2, or a signed FDL from another Qualix unit/model), check whether the same recovered keystream bytes show up again. If yes, it's a vendor-wide static header key, not session-specific — more broadly useful and worth documenting.
- USB sniffing during a real burn (your own plan) is still the most direct way to find out whether WOT transforms the FDL on the wire versus what's on disk — that's the thing most likely to actually unblock execution.
- I'd treat
CmdDloader.exe/VMProtect as last resort given the cost of static/dynamic analysis against it.
Here's the recovery code so you can rerun it against new samples:
This script (recover header keystream) runs the same analysis so he can check new samples himself — and it'll tell him right away if a second sample reuses the same keystream (the key open question).recover_header_keystream.py ||ספויילר||