Upgraded to UniFlash, removed unsupported FDLs and fixed a critical HDLC encoding issue

This commit is contained in:
Luxferre
2021-12-20 01:16:41 +02:00
parent 2a5090483c
commit 15c838f256
7 changed files with 57 additions and 44 deletions
+10 -22
View File
@@ -1,14 +1,16 @@
# UniDump: an opensource Unisoc/Spreadtrum phone flash reader
# UniFlash: an opensource Unisoc/Spreadtrum phone flash reader/writer
## About
Cross-platform MediaTek feature phone dumping had been achieved long ago with [MTreader](https://gitlab.com/suborg/mtreader). Now it's time to do the same for Unisoc (ex-Spreadtrum) phones.
Cross-platform MediaTek feature phone dumping had been achieved long ago with [MTreader](https://gitlab.com/suborg/mtreader). Now it's time to do the same for Unisoc (ex-Spreadtrum) phones. And not only that, but also to be able to flash them!
Unfortunately, the architecture of Unisoc chipset boot ROM doesn't allow us to get away without any loader blobs. So, some FDL binaries are also shipped in this repo.
The `unidump.py` file is the main script to use. The `unicmd.py` file is the library created for easier command interface encapsulation.
UniFlash started out as UniDump (see [this blog post](https://chronovir.us/2021/12/18/Opus-Spreadtrum/)) but had been quickly upgraded to do both tasks.
For further dumped firmware unpacking, I recommend [bzpwork](https://github.com/ilyazx/bzpwork) by ilyazx.
The `uniflash.py` file is the main script to use. The `unicmd.py` file is the library created for easier command interface encapsulation.
For further dumped firmware unpacking/repacking, I recommend [bzpwork](https://github.com/ilyazx/bzpwork) by ilyazx.
## Dependencies
@@ -16,33 +18,19 @@ Python 3.8+ and PyUSB.
## Usage
Run `python unidump.py -h` to see all parameters. But there are several typical scenarios that UniDump officially supports.
Run `python uniflash.py -h` to see all parameters. But there are several typical scenarios that UniFlash officially supports.
**Note**: you need to hold a bootkey pressed when connecting the device for it to be detected correctly. This key can vary across devices. Typically it's Call, Soft Left, Soft Right, Center, 9 or #, but it can be anything else.
### SC6531E/F/M
This is the default target for UniDump, FDLs for it are shipped in the repo and you don't need to configure anything else.
This is the default target for UniFlash, FDLs for it are shipped in the repo and you don't need to configure anything else.
For SC6531E, firmware is usually 4MB long, so you just need to run `python unidump.py your-output-file.bin`.
For SC6531E, firmware is usually 4MB long, so you just need to run `python uniflash.py dump your-output-file.bin` to dump the firmware image and `python uniflash.py flash your-input-file.bin` to flash it.
For SC6531F or SC6531M where firmware can be larger, you need to pass in the length. As with any integer parameter here, you can pass it in hexadecimal format as well.
E.g. for CAT B26 (bootkey is `#`): `python unidump.py -l 0x6b7000 b26.bin`
### ~~UMS9117/UMS9117L~~ (NOT SUPPORTED YET)
For these 4G chipsets you need to use your own FDLs (although you **may** try the ones shipped with UniDump) and the following addresses: 0x6200 for FDL1, 0x80100000 for FDL2.
E.g. for Nokia 225 4G (if you're in the UniDump directory): `python unidump.py -fdl1 fdls/ums9117/fdl1.bin -addr1 0x6200 -fdl2 fdls/ums9117/fdl2.bin -addr2 0x80100000 225.bin`
### ~~SC7701/SC7702/SC7703~~ (NOT SUPPORTED YET)
First, for these 3G chipsets you need to use your own FDLs (although you **may** try the ones shipped with UniDump) and the following addresses: 0x40000000 for FDL1, 0x0 for FDL2.
E.g. for Nokia 3310 3G (if you're in the UniDump directory): `python unidump.py -fdl1 fdls/sc770x/fdl1.bin -addr1 0x40000000 -fdl2 fdls/sc770x/fdl2.bin -addr2 0 3310-3g.bin`
Second, these phones are connected in a different way: disconnect the cable, remove the battery, run the command, connect the cable, hold the bootkey and then insert the battery.
E.g. for CAT B26 (bootkey is `#`) the dumping command is: `python uniflash.py -l 0x6b7000 dump b26.bin`
### SC6531D and lower