FORUMS

[TOOLS] Mstar Android TV firmware tools

136 posts
Thanks Meter: 131
 
By dipcore, Senior Member on 19th February 2017, 03:54 AM
Post Reply Email Thread
9th March 2017, 05:34 PM |#31  
Junior Member
Thanks Meter: 0
 
More
dipcore......hi ............thank you for your great work
plz can you help me ...how to use aescrypt2 tool with extarcted keys files :AESBoot.bin ,AESUpgrade.bin ,
key_bank.bin,.............
i want to decrypt and unpack mboot.img , boot.img & recovery.img

thank you very much
9th March 2017, 05:45 PM |#32  
dipcore's Avatar
OP Senior Member
Thanks Meter: 131
 
Donate to Me
More
Quote:
Originally Posted by arabic devloper

Sorry but i dont Understand you
crc calculate befor packing or after
can u give me example pls

Four steps to create bin:
1. create header (contains mboot script)
2. create bin part - it's merged image parts etc.
3. create footer
4. merge header + bin +footer

So on step #3 you need to generate two crc sums. First is crc sum of the header part (after it's generated). Second is crc sum of bin part (after it's merged). And generate footer. Footer structure is:
|MAGIC|SWAPPED HEADER CRC32|SWAPPED BIN CRC32|FIRST 16 BYTES OF HEADER|

Just look at the pack.py script, it's self explanatory. I do not know what else I can explain.
9th March 2017, 06:00 PM |#33  
Junior Member
Thanks Meter: 0
 
More
Madisonupgrade.bin
Quote:
Originally Posted by dipcore

Four steps to create bin:
1. create header (contains mboot script)
2. create bin part - it's merged image parts etc.
3. create footer
4. merge header + bin +footer

So on step #3 you need to generate two crc sums. First is crc sum of the header part (after it's generated). Second is crc sum of bin part (after it's merged). And generate footer. Footer structure is:
|MAGIC|SWAPPED HEADER CRC32|SWAPPED BIN CRC32|FIRST 16 BYTES OF HEADER|

Just look at the pack.py script, it's self explanatory. I do not know what else I can explain.

i know & its very sample but hhhhh
can u aplicate your methode in this software https://assets.kogan.com/files/suppo...sonUpgrade.bin
because i am confuse
thank u again
aah can i test ur custom recovery in my tv or not
9th March 2017, 06:01 PM |#34  
dipcore's Avatar
OP Senior Member
Thanks Meter: 131
 
Donate to Me
More
Quote:
Originally Posted by dllxda

dipcore......hi ............thank you for your great work
plz can you help me ...how to use aescrypt2 tool with extarcted keys files :AESBoot.bin ,AESUpgrade.bin ,
key_bank.bin,.............
i want to decrypt and unpack mboot.img , boot.img & recovery.img

thank you very much

Just run it for help:
Code:
aescrypt2.exe
  aescrypt2 <mode> <input filename> <output filename> <key>
  <mode>: 0 = encrypt, 1 = decrypt
  example: aescrypt2 0 file file.aes hex:E76B2413958B00E193
So you need to do:
Code:
aescrypt2 1 path_to_encrypted_image.img.aes path_where_to_put_decrypted_image.img path_to_AESBoot.bin_key
After you just need to unpack it. Use any available tool to unpack uboot multi-file image. (for instance http://www.matteomattei.com/extract-...age-in-python/)

PS that's only for boot.img and recovery.img. You cannot unpack mboot.img it's binary file.
The Following User Says Thank You to dipcore For This Useful Post: [ View ] Gift dipcore Ad-Free
9th March 2017, 06:02 PM |#35  
Junior Member
Thanks Meter: 4
 
Donate to Me
More
Quote:
Originally Posted by dllxda

dipcore......hi ............thank you for your great work
plz can you help me ...how to use aescrypt2 tool with extarcted keys files :AESBoot.bin ,AESUpgrade.bin ,
key_bank.bin,.............
i want to decrypt and unpack mboot.img , boot.img & recovery.img

thank you very much

hey mate you can use this decryption/encryption key as default hex:0007FF4154534D92FC55AA0FFF0110E0

0 = encrypt
1 = decrypt

ex: aescrypt2 1 recovery.img recovery.img.dec hex:0007FF4154534D92FC55AA0FFF0110E0

use hex on recovery.img if you see MStar-linux(recovery) then you already decrypt recovery.img
The Following User Says Thank You to bamster89 For This Useful Post: [ View ] Gift bamster89 Ad-Free
9th March 2017, 06:39 PM |#36  
dipcore's Avatar
OP Senior Member
Thanks Meter: 131
 
Donate to Me
More
Quote:
Originally Posted by bamster89

hey mate you can use this decryption/encryption key as default hex:0007FF4154534D92FC55AA0FFF0110E0

0 = encrypt
1 = decrypt

ex: aescrypt2 1 recovery.img recovery.img.dec hex:0007FF4154534D92FC55AA0FFF0110E0

use hex on recovery.img if you see MStar-linux(recovery) then you already decrypt recovery.img

That's right, many vendors do not change default AES keys provided by mstar. But to be sure you are using right key use extract_keys.py tool to extract working keys.

In my case the keys were different, so I have to write that extract tool to get right keys to decrypt my images.

PS 4th parameter of aescrypt2 tool can be hex value of the aes key (i.e. hex:0007FF4154534D92FC55AA0FFF0110E0) OR it can be path to aes key file extracted by extract_keys.py
The Following User Says Thank You to dipcore For This Useful Post: [ View ] Gift dipcore Ad-Free
9th March 2017, 07:28 PM |#37  
Junior Member
Thanks Meter: 0
 
More
dipcore
Thank u very much …………..but how to unpack decrypted recovery.img using extract_u-boot.py

C:\Users\.....\AppData\Local\Programs\Python\Pytho n36>extract_u-boot.py d:\recovery.img
Traceback (most recent call last):
File "C:\Users\.....\AppData\Local\Programs\Python\Pyth on36\extract_u-boot.py", line 23, in <module>
size = toNumber(buf)
File "C:\Users\.....\AppData\Local\Programs\Python\Pyth on36\extract_u-boot.py", line 8, in toNumber
for b in buf: size=size*256+ord(b)
TypeError: ord() expected string of length 1, but int found


Attached Files
File Type: img orig-recovery.img - [Click for QR Code] (7.26 MB, 160 views)
File Type: img decrypted recovery.img - [Click for QR Code] (7.26 MB, 152 views)
File Type: img orig-boot.img - [Click for QR Code] (3.49 MB, 142 views)
File Type: img decrypted boot.img - [Click for QR Code] (3.49 MB, 132 views)
File Type: img MBOOT.img - [Click for QR Code] (1.38 MB, 158 views)
12th March 2017, 04:25 AM |#38  
dipcore's Avatar
OP Senior Member
Thanks Meter: 131
 
Donate to Me
More
@dllxda Your images are decrypted fine.
It looks like you are using windows, so there is a tool you can use to pack/unpack boot.img and recovery.img
UBoot_win_Tools.zip

Ho to use it:
1. Unpack it
2. Put your boot.img and/or recovery.img to IN folder
3. Run _Boot.bat
4. In the command window enter 9 and press Enter (9-Init tools)
5. Next enter 1 or 2 depends what do you want to unpack and press enter (1-unpack boot, 2-unpack recovery)
6. In the Unpack folder you get it unpacked
7. Do your changes
8. In the command window press 11 or 12 to pack it back
9. You'll get packed images in Pack\Image folder.
The Following User Says Thank You to dipcore For This Useful Post: [ View ] Gift dipcore Ad-Free
12th March 2017, 11:50 PM |#39  
Junior Member
Thanks Meter: 0
 
More
hi dipcore thank u
but when i try to pack the partition ,I get............................................... ......................
C:\Users\WS1\AppData\Local\Programs\Python\Python3 6\mstar-bin-tool-master\mstar-bin-tool-master>pack.py config/madison.ini
Traceback (most recent call last):
File "C:\Users\WS1\AppData\Local\Programs\Python\Python 36\mstar-bin-tool-master\mstar-bin-tool-master\pack.py", line 60, in <module>
main = config['Main'];
File "C:\Users\WS1\AppData\Local\Programs\Python\Python 36\lib\configparser.py", line 956, in __getitem__
raise KeyError(key)
KeyError: 'Main'
13th March 2017, 12:29 AM |#40  
dipcore's Avatar
OP Senior Member
Thanks Meter: 131
 
Donate to Me
More
Quote:
Originally Posted by dllxda

KeyError: 'Main'[/COLOR]

do you have madison.ini created?

you may want to do pack.py configs\dexp-madison-system.ini
The Following User Says Thank You to dipcore For This Useful Post: [ View ] Gift dipcore Ad-Free
27th March 2017, 04:09 PM |#41  
Inactive Recognized Developer
Thanks Meter: 75
 
More
@dipcore: thanks for your firmware unpacking tools. I just ordered a cheap 55" UHD Smart TV with a Mstar MSD 6488E to be delivered in the next days. The modelname is JAY-TECH GENESIS UHD 5.5 SMART DVX 5S. I think it is not an Android based Smart TV but rather a Linux based HbbTV. I think Caixun calls it a "Linux Connect" TV from what I read in their roadmap 2016/2017 doc. My TV supposably has 1GB RAM, only 512MB NAND or eMMC and a Wifi interface.

Do you know if there is a MSTAR Android SDK floating around for the MSD6488E chipset? And is it likely Ethernet NIC and eMMC interfaces are available on the mainboard, but just no connectors soldered? Finally, do you know whether UHD TV mainboards with Android OS are sold in China and do you happen to know a distributor? The display in the TV is apparently a Samsung LSC550FN06 with a standard 51 pin 8-Lane V-by-One Interface. I might swap the mainboard if it can improve things.

Best wishes,
JockyW
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes