בעיה | בעיה | בקשת עזרה בקריאה וגיבוי של קושחה | Unisoc UMS9117
-
שלום לכולם,
אני מנסה לקרוא ולגבות קושחה ממכשיר שמחזיר את מזהה השבב 0x98180001, המשויך ל־Unisoc UMS9117. אחרי שאצליח להפיק גיבוי, אני רוצה לפתוח את חבילת הקושחה ולבדוק אם יש דרך נתמכת להוסיף או להחליף בה קובץ ולארוז אותה מחדש.
עברתי מכלי הצריבה המקורי לכלי חלופי. בבדיקה שעשיתי, FDL1 החזיר את מזהה השבב, אבל כשהכלי ביקש להפעיל את FDL2, הוא לא קיבל תשובה בזמן ויצא עם קוד 1. בשלב הזה הקריאה מהפלאש עדיין לא הושלמה.
ב־GitHub כבר מתקיימים דיונים על הפלטפורמה, ועברתי על כמה מהם. פניתי גם לאחד המפתחים הפעילים בפרויקט, ועדיין לא קיבלתי תשובה. אשמח אם תוכלו לעזור להבין למה FDL2 לא מגיב, או להציע דרך נתמכת לקרוא ולגבות את הפלאש.
אם יש לכם פתרון או כיוון לבדיקה, כתבו לי כאן. אשלח לכם את כתובת המייל שלי בהודעה פרטית ונמשיך משם. אם תצטרכו את גרסת הקושחה או את הלוגים מהבדיקה, אעביר גם אותם בפרטי.
(לכל מי שבין בנושא אשמח שיתכתב איתי ישר במייל מבלי להביא כאן פתרון אמיתי והמבין יבין)תודה מראש לכל העוזרים
@המפתח-לפיתוח
תעבוד קשה, תצליח בסוף.
תשתמש בopus 4.6, יתכן שגם 4.8 יעזור לך עד שיתקע.
בכל מקרה - אם בשלב הזה אתה מסתבך, השלב הבא יהיה לך קשה פי אלף... -
@המפתח-לפיתוח
תעבוד קשה, תצליח בסוף.
תשתמש בopus 4.6, יתכן שגם 4.8 יעזור לך עד שיתקע.
בכל מקרה - אם בשלב הזה אתה מסתבך, השלב הבא יהיה לך קשה פי אלף...@י.-פל.
עברתי את השלבים האלה הצלחתי להתגבר על חסימות מהעברה משיחה לשיחה
עד שעבדתי עם קלוד קוד ונגמרו לי הקרדיטים במנוי אולטרא (עבודה של 8 שעות ברצף מחכה להתחדשות) -
@י.-פל.
עברתי את השלבים האלה הצלחתי להתגבר על חסימות מהעברה משיחה לשיחה
עד שעבדתי עם קלוד קוד ונגמרו לי הקרדיטים במנוי אולטרא (עבודה של 8 שעות ברצף מחכה להתחדשות)אתה הצלחת ??
-
שלום לכולם,
אני מנסה לקרוא ולגבות קושחה ממכשיר שמחזיר את מזהה השבב 0x98180001, המשויך ל־Unisoc UMS9117. אחרי שאצליח להפיק גיבוי, אני רוצה לפתוח את חבילת הקושחה ולבדוק אם יש דרך נתמכת להוסיף או להחליף בה קובץ ולארוז אותה מחדש.
עברתי מכלי הצריבה המקורי לכלי חלופי. בבדיקה שעשיתי, FDL1 החזיר את מזהה השבב, אבל כשהכלי ביקש להפעיל את FDL2, הוא לא קיבל תשובה בזמן ויצא עם קוד 1. בשלב הזה הקריאה מהפלאש עדיין לא הושלמה.
ב־GitHub כבר מתקיימים דיונים על הפלטפורמה, ועברתי על כמה מהם. פניתי גם לאחד המפתחים הפעילים בפרויקט, ועדיין לא קיבלתי תשובה. אשמח אם תוכלו לעזור להבין למה FDL2 לא מגיב, או להציע דרך נתמכת לקרוא ולגבות את הפלאש.
אם יש לכם פתרון או כיוון לבדיקה, כתבו לי כאן. אשלח לכם את כתובת המייל שלי בהודעה פרטית ונמשיך משם. אם תצטרכו את גרסת הקושחה או את הלוגים מהבדיקה, אעביר גם אותם בפרטי.
(לכל מי שבין בנושא אשמח שיתכתב איתי ישר במייל מבלי להביא כאן פתרון אמיתי והמבין יבין)תודה מראש לכל העוזרים
@המפתח-לפיתוח זה קורה בגלל שה FDL2 לא מיועד לשבב שלך
-
@המפתח-לפיתוח זה קורה בגלל שה FDL2 לא מיועד לשבב שלך
@SHN456456
הוא מיועד פשוט השבב מוצפן ברמה שאני לא מבין מי השקיע כ"כ הרבה לטלפון כזה -
@י.-פל. @shn456456 אם אחד מכם מבין בעניין או שאצליח אשמח שתעברו על הפוסט בגיטאב ותיתנו לי פתרונות
https://github.com/ilyakurdyukov/spreadtrum_flash/issues/52 -
@י.-פל. @shn456456 אם אחד מכם מבין בעניין או שאצליח אשמח שתעברו על הפוסט בגיטאב ותיתנו לי פתרונות
https://github.com/ilyakurdyukov/spreadtrum_flash/issues/52@המפתח-לפיתוח
העלתי לסונטה 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_flashand 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_sizeat offset0x30) 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 ||ספויילר|| - Confirmed
-
@י.-פל. @shn456456 אם אחד מכם מבין בעניין או שאצליח אשמח שתעברו על הפוסט בגיטאב ותיתנו לי פתרונות
https://github.com/ilyakurdyukov/spreadtrum_flash/issues/52@המפתח-לפיתוח עזר משהו או חירטוטים?
-
@המפתח-לפיתוח עזר משהו או חירטוטים?
@בירח-לא-נגעתי
תגלית ענקית!מצאת באג קריפטוגרפי אמיתי ב-Qualix!
(או יותר נכון הוא)מה הוא גילה:
ה-header של 512 הבייטים הראשונים הוא בעצם DHTB רגיל (magic="DHTB", version=1, data_size ב-offset 0x30), אבל מוצפן עם stream cipher.
ה-מפתח שמצפין את ה-header זהה בין fdl1 ל-fdl2 — זהו באג קלאסי של "nonce reuse" בהצפנות זרם. Qualix חזרו על אותו מפתח במקום להגריל חדש לכל קובץ.
הוא שחזר את כל ה-512 בייטים של המפתח מתוך ההשוואה בין fdl1 ל-fdl2, ואימת שהוא יכול לפענח את ה-metadata של כל FDL עתידי של Qualix.מה זה אומר למעשה:
נראה לי מיותר לכתוב לך אבל בכל מקרה עזרת לי מאד אני ממשיך עם זה מחר אשמח שתעזור לי בהמשך תודה רבה
(נ.ב למה אתה מתכוון "רק יודע לגרום להם לעסוק גם בדברים שלא בא להם".) -
@בירח-לא-נגעתי
תגלית ענקית!מצאת באג קריפטוגרפי אמיתי ב-Qualix!
(או יותר נכון הוא)מה הוא גילה:
ה-header של 512 הבייטים הראשונים הוא בעצם DHTB רגיל (magic="DHTB", version=1, data_size ב-offset 0x30), אבל מוצפן עם stream cipher.
ה-מפתח שמצפין את ה-header זהה בין fdl1 ל-fdl2 — זהו באג קלאסי של "nonce reuse" בהצפנות זרם. Qualix חזרו על אותו מפתח במקום להגריל חדש לכל קובץ.
הוא שחזר את כל ה-512 בייטים של המפתח מתוך ההשוואה בין fdl1 ל-fdl2, ואימת שהוא יכול לפענח את ה-metadata של כל FDL עתידי של Qualix.מה זה אומר למעשה:
נראה לי מיותר לכתוב לך אבל בכל מקרה עזרת לי מאד אני ממשיך עם זה מחר אשמח שתעזור לי בהמשך תודה רבה
(נ.ב למה אתה מתכוון "רק יודע לגרום להם לעסוק גם בדברים שלא בא להם".)(נ.ב למה אתה מתכוון "רק יודע לגרום להם לעסוק גם בדברים שלא בא להם".)
פיענוח הצפנות וסייבר,
זה ממש קשה החדשים כי יש להם מסווגים טפשים אבל בישן זה קל יחסית,
אני ממשיך זה דווקה נחמד הוא טוען שהוא מוצא עוד משהו, -
@בירח-לא-נגעתי
תגלית ענקית!מצאת באג קריפטוגרפי אמיתי ב-Qualix!
(או יותר נכון הוא)מה הוא גילה:
ה-header של 512 הבייטים הראשונים הוא בעצם DHTB רגיל (magic="DHTB", version=1, data_size ב-offset 0x30), אבל מוצפן עם stream cipher.
ה-מפתח שמצפין את ה-header זהה בין fdl1 ל-fdl2 — זהו באג קלאסי של "nonce reuse" בהצפנות זרם. Qualix חזרו על אותו מפתח במקום להגריל חדש לכל קובץ.
הוא שחזר את כל ה-512 בייטים של המפתח מתוך ההשוואה בין fdl1 ל-fdl2, ואימת שהוא יכול לפענח את ה-metadata של כל FDL עתידי של Qualix.מה זה אומר למעשה:
נראה לי מיותר לכתוב לך אבל בכל מקרה עזרת לי מאד אני ממשיך עם זה מחר אשמח שתעזור לי בהמשך תודה רבה
(נ.ב למה אתה מתכוון "רק יודע לגרום להם לעסוק גם בדברים שלא בא להם".)(או יותר נכון הוא)
מה הוא גילה:
הלאה תעדכן אם עוזר לך ,
אבל זה מזור לי שסונטה 5 ברגע עבודה פתר בעיות שגמרו לך ככ הרבה מכסה
Hi again,Following up with where this investigation landed. Long post, but it changes the practical path forward, so worth reading in full.
1. Verified your data
SHA256 of all three files matches yours. Confirmed"DHTB("and the SHA-256 init constants in brom at the offsets you found; no AES S-box, RSA01 00 01constant, or your custom header magic anywhere in brom.2. The header-reuse finding (building on what you already spotted)
You noted the two headers are identical except 3 bytes at0x30-0x32. I tested the hypothesis that this is a standard DHTB header ("DHTB", version=1,data_sizeat0x30) run through a stream cipher:- Predicted
data_sizefor each file asfile_size - 0x200 - extra(trying bothsign_type=0/extra0x294andsign_type=1/extra0x2B4). - XORed the two predicted plaintext values, and separately XORed the two actual ciphertext bytes at
0x30-0x33. - For
sign_type=1: exact bit-for-bit match (e0580100both ways).
This confirms
sign_type=1, and that the keystream encrypting the header is identical betweenfdl1.binandfdl2.bin— a stream-cipher IV/nonce-reuse bug. I fully reconstructed the keystream for the first0x200bytes this way (verified by re-deriving fdl2's header from fdl1's keystream — exact byte match). No repeating 16-byte blocks in the keystream itself, so it's not a worse "stuck counter" bug, just a reused one for this specific block.Limits of this: I checked the
sign_head(0x60 bytes) andsign_data(0x254 bytes, including where the RSA public key sits) trailers between your two files — 594/596 bytes differ, including the key region. So the trailer gets a correctly unique IV per file. Checked the body too (post-header) for matching byte runs at the same offset — found one 8-byte coincidence out of 75KB, i.e. nothing. The reuse bug is confined to the 0x200-byte header only. It lets you decryptdata_size/sign_typemetadata of future captures, not the key, signature, or firmware body.3. Disassembly attempt (negative result, but worth knowing)
Tried to find the actual DHTB-verification routine in brom via Capstone, starting from the two"DHTB("string occurrences. Both times, the surrounding code was unrelated (looked like a GPIO/peripheral reset toggle), meaning the function that actually uses this string is elsewhere, referenced by PC-relative addressing I couldn't locate with a raw pointer search. This needs Ghidra/IDA auto-analysis (load as raw ARM, base0xffff0000, then "Show References To" on the string) rather than ad hoc scripting — flagging it so you don't retread the same dead end.4. The actual blocker (this is the important part)
Even a full break of the encryption might not get you what you want. Your own project'st117_fdl/README.mdsays plainly: "It can't read or write to NAND flash yet. However, it can dump the boot ROM and read RAM, which the original FDLs can't do." I checkedread_flash()int117_fdl/main.c— it's a barememcpyfrom a RAM address, not a real storage driver. So even a perfectly unsigned, working FDL2 built from this repo today still can't dump partitions — the real eMMC/NAND driver only exists inside Qualix's signed blob.5. A way around it — found a real register-level eMMC driver for this exact chip
There's a separate open-source project,fplinux(GPL-2.0), that runs actual Linux on UMS9117 devices (Nokia 3210 4G, INOI 240/244). It ships a working U-Boot eMMC driver specifically for this SoC:platforms/ums9117/uboot/ums9117-mmc.c(774 lines)- Real register map in
ums9117-sdio-slot.c: SDHCI controller at0x20300000(block-count/size, argument, response — standard SDHCI layout), clock/reset gating at0x20e0xxxx, pinmux/pad control at0x402a0xxx. - There's also a NAND controller driver (
ums9117-nandc-chip.c/-feature.c) if your board turns out to use raw NAND instead of eMMC.
This is exactly the missing piece in
t117_fdl2. Porting this driver's register init + CMD17/CMD18 (single/multi-block read) logic into a new file int117_fdl/, and wiring it intoread_flash()in place of the currentmemcpy, would give you a working unsigned FDL2 with real flash access — running through the CVE chain you already have working, with zero dependency on cracking Qualix's encryption. It's a real porting job, not a one-liner, but it's open, legal, GPL-sourced work, and if it pans out it closes the actual TODO inspreadtrum_flashfor anyone else with a UMS9117 device.That's where I'd focus next rather than continuing to push on the encryption — happy to help sketch the port if useful.
זה רק הקבצים שלו לזה[INTEGRATION.md](Invalid MIME type) [t117_emmc.c](Invalid MIME type) [t117_emmc.c](Invalid MIME type) [t117_emmc.rar](Invalid MIME type) [לילה.rar](Invalid MIME type) יש עוד קובץ שלא מצליח לעלות אותו - Predicted
-
(או יותר נכון הוא)
מה הוא גילה:
הלאה תעדכן אם עוזר לך ,
אבל זה מזור לי שסונטה 5 ברגע עבודה פתר בעיות שגמרו לך ככ הרבה מכסה
Hi again,Following up with where this investigation landed. Long post, but it changes the practical path forward, so worth reading in full.
1. Verified your data
SHA256 of all three files matches yours. Confirmed"DHTB("and the SHA-256 init constants in brom at the offsets you found; no AES S-box, RSA01 00 01constant, or your custom header magic anywhere in brom.2. The header-reuse finding (building on what you already spotted)
You noted the two headers are identical except 3 bytes at0x30-0x32. I tested the hypothesis that this is a standard DHTB header ("DHTB", version=1,data_sizeat0x30) run through a stream cipher:- Predicted
data_sizefor each file asfile_size - 0x200 - extra(trying bothsign_type=0/extra0x294andsign_type=1/extra0x2B4). - XORed the two predicted plaintext values, and separately XORed the two actual ciphertext bytes at
0x30-0x33. - For
sign_type=1: exact bit-for-bit match (e0580100both ways).
This confirms
sign_type=1, and that the keystream encrypting the header is identical betweenfdl1.binandfdl2.bin— a stream-cipher IV/nonce-reuse bug. I fully reconstructed the keystream for the first0x200bytes this way (verified by re-deriving fdl2's header from fdl1's keystream — exact byte match). No repeating 16-byte blocks in the keystream itself, so it's not a worse "stuck counter" bug, just a reused one for this specific block.Limits of this: I checked the
sign_head(0x60 bytes) andsign_data(0x254 bytes, including where the RSA public key sits) trailers between your two files — 594/596 bytes differ, including the key region. So the trailer gets a correctly unique IV per file. Checked the body too (post-header) for matching byte runs at the same offset — found one 8-byte coincidence out of 75KB, i.e. nothing. The reuse bug is confined to the 0x200-byte header only. It lets you decryptdata_size/sign_typemetadata of future captures, not the key, signature, or firmware body.3. Disassembly attempt (negative result, but worth knowing)
Tried to find the actual DHTB-verification routine in brom via Capstone, starting from the two"DHTB("string occurrences. Both times, the surrounding code was unrelated (looked like a GPIO/peripheral reset toggle), meaning the function that actually uses this string is elsewhere, referenced by PC-relative addressing I couldn't locate with a raw pointer search. This needs Ghidra/IDA auto-analysis (load as raw ARM, base0xffff0000, then "Show References To" on the string) rather than ad hoc scripting — flagging it so you don't retread the same dead end.4. The actual blocker (this is the important part)
Even a full break of the encryption might not get you what you want. Your own project'st117_fdl/README.mdsays plainly: "It can't read or write to NAND flash yet. However, it can dump the boot ROM and read RAM, which the original FDLs can't do." I checkedread_flash()int117_fdl/main.c— it's a barememcpyfrom a RAM address, not a real storage driver. So even a perfectly unsigned, working FDL2 built from this repo today still can't dump partitions — the real eMMC/NAND driver only exists inside Qualix's signed blob.5. A way around it — found a real register-level eMMC driver for this exact chip
There's a separate open-source project,fplinux(GPL-2.0), that runs actual Linux on UMS9117 devices (Nokia 3210 4G, INOI 240/244). It ships a working U-Boot eMMC driver specifically for this SoC:platforms/ums9117/uboot/ums9117-mmc.c(774 lines)- Real register map in
ums9117-sdio-slot.c: SDHCI controller at0x20300000(block-count/size, argument, response — standard SDHCI layout), clock/reset gating at0x20e0xxxx, pinmux/pad control at0x402a0xxx. - There's also a NAND controller driver (
ums9117-nandc-chip.c/-feature.c) if your board turns out to use raw NAND instead of eMMC.
This is exactly the missing piece in
t117_fdl2. Porting this driver's register init + CMD17/CMD18 (single/multi-block read) logic into a new file int117_fdl/, and wiring it intoread_flash()in place of the currentmemcpy, would give you a working unsigned FDL2 with real flash access — running through the CVE chain you already have working, with zero dependency on cracking Qualix's encryption. It's a real porting job, not a one-liner, but it's open, legal, GPL-sourced work, and if it pans out it closes the actual TODO inspreadtrum_flashfor anyone else with a UMS9117 device.That's where I'd focus next rather than continuing to push on the encryption — happy to help sketch the port if useful.
זה רק הקבצים שלו לזה[INTEGRATION.md](Invalid MIME type) [t117_emmc.c](Invalid MIME type) [t117_emmc.c](Invalid MIME type) [t117_emmc.rar](Invalid MIME type) [לילה.rar](Invalid MIME type) יש עוד קובץ שלא מצליח לעלות אותו@בירח-לא-נגעתי
אני יעבור על זה מחר בבוקר
תודה רבה - Predicted
-
@בירח-לא-נגעתי
אני יעבור על זה מחר בבוקר
תודה רבה@המפתח-לפיתוח שינתי לסיומת טקסט t117_emmc.txt שנה לסיומת C
לילה טוב
שלום! נראה שהשיחה הזו מעניינת אותך, אבל עדיין אין לך חשבון.
נמאס לכם לגלול בין אותם הפוסטים בכל ביקור? כשנרשמים לחשבון, תמיד תחזרו בדיוק למקום שבו הייתם קודם, ותוכלו לבחור לקבל התראות על תגובות חדשות (בין אם במייל, ובין אם בהתראת פוש). תוכלו גם לשמור סימניות ולפרגן ב-upvote לפוסטים כדי להביע הערכה לחברי קהילה אחרים.
בעזרת התרומה שלך, הפוסט הזה יכול להיות אפילו טוב יותר 💗
הרשמה התחברות