All Projects → dipcore → Mstar Bin Tool

dipcore / Mstar Bin Tool

Scripts to manipulate Mstar firmware binaries (e.g. MstarUpgrade.bin, LetvUpgrade.bin etc)

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Mstar Bin Tool

Wolfboot
wolfBoot is a portable, OS-agnostic, secure bootloader for microcontrollers, supporting firmware authentication and firmware update mechanisms.
Stars: ✭ 110 (-19.71%)
Mutual labels:  firmware, cryptography
Ergodox Layout
algernon's ErgoDox EZ layout
Stars: ✭ 135 (-1.46%)
Mutual labels:  firmware
Stream Ciphers
Collection of stream cipher algorithms
Stars: ✭ 127 (-7.3%)
Mutual labels:  cryptography
Sodium Plus
Developer-friendly libsodium interface
Stars: ✭ 132 (-3.65%)
Mutual labels:  cryptography
Libsodium Doc
Gitbook documentation for libsodium
Stars: ✭ 129 (-5.84%)
Mutual labels:  cryptography
Marlin Ai3m 2.0.x
🖨 Marlin 2.0.x optimized for the Anycubic i3 Mega 3D printer
Stars: ✭ 134 (-2.19%)
Mutual labels:  firmware
Firmware password manager
A Python script to help Macintosh administrators manage the firmware passwords of their computers.
Stars: ✭ 127 (-7.3%)
Mutual labels:  firmware
Cli
🧰 A zero trust swiss army knife for working with X509, OAuth, JWT, OATH OTP, etc.
Stars: ✭ 2,151 (+1470.07%)
Mutual labels:  cryptography
Kmk firmware
Clackety Keyboards Powered by Python
Stars: ✭ 132 (-3.65%)
Mutual labels:  firmware
Multi Env Deploy
Complete example of deploying complex web apps to AWS using Terraform, Ansible, and Packer
Stars: ✭ 132 (-3.65%)
Mutual labels:  packer
Useful Crypto Resources
A place for useful crypto-related resources plus some of my fav stuff
Stars: ✭ 131 (-4.38%)
Mutual labels:  cryptography
Merkle Tree
Merkle Trees and Merkle Inclusion Proofs
Stars: ✭ 130 (-5.11%)
Mutual labels:  cryptography
Heimdall
Heimdall is a cross-platform open-source tool suite used to flash firmware (aka ROMs) onto Samsung Galaxy devices.
Stars: ✭ 1,829 (+1235.04%)
Mutual labels:  firmware
Demo Twilio Backend Nodejs
A sample backend that demonstrates how to generate a Virgil JWT and Twilio token used for authentication with the Virgil and Twilio services
Stars: ✭ 128 (-6.57%)
Mutual labels:  cryptography
Padding Oracle Attacker
🔓 CLI tool and library to execute padding oracle attacks easily, with support for concurrent network requests and an elegant UI.
Stars: ✭ 136 (-0.73%)
Mutual labels:  cryptography
Torchbear
🔥🐻 The Speakeasy Scripting Engine Which Combines Speed, Safety, and Simplicity
Stars: ✭ 128 (-6.57%)
Mutual labels:  cryptography
Botan
Cryptography Toolkit
Stars: ✭ 1,798 (+1212.41%)
Mutual labels:  cryptography
Esp32 Ota Https
Secure over-the-air updates for the ESP32 platform
Stars: ✭ 132 (-3.65%)
Mutual labels:  firmware
Curv
Rust language general purpose elliptic curve cryptography.
Stars: ✭ 138 (+0.73%)
Mutual labels:  cryptography
Packer
Package and deploy apps built with NodeGui to all platforms
Stars: ✭ 137 (+0%)
Mutual labels:  packer

mstar-bin-tool

Command line tools to pack/unpack MStar bin firmware

Currently available tools:

  • unpack.py - unpack MStar bin firmware
  • pack.py - pack MStar bin firmware
  • extract_keys.py - extract AES and RSA-public keys from MBOOT binary
  • secure_partition.py - encrypt image and generate signature file

Unpack MStar bin firmware files

Usage: unpack.py <firmware> <output folder [default: ./unpacked/]>
        <firmware> - MStar bin firmware to unpack
        <output folder> - directory to store unpacked stuff. Default value: ./unpacked/

Pack MStar bin firmware

Usage: pack.py <config file>
Example: pack.py configs/letv-x355pro-full.ini
		<config file> - Configuration file. The config file structure will be described later.
                        For now you can take a look at configs/letv-x355pro-full.ini
                        and use it as an example

Extract keys from MBOOT

That tool is used to get AES and public RSA keys from the MBOOT. AES keys are needed to encrypt/decrypt boot.img and recovery.img images. aescrypt2 tool is used.

Usage: extract_keys.py <path to mboot> [<folder to store keys>] [<key bank offset>] [<key bank size>]
Defaults:
          <folder to store keys>        keys
          <key bank offset>             0x168e00
          <key bank size>               0x450
Example: extract_keys.py ./unpacked/MBOOT.img
Example: extract_keys.py ./unpacked/MBOOT.img ./keys 0x169e00 0x450

Encrypt/Decrypt partition

You can encrypt/decrypt partition with using aescrypt2.exe tool, which is located in bin/win32 folder

Default mstar key is hex:0007FF4154534D92FC55AA0FFF0110E0 All mstar default keys are in default_keys folder. (These keys are in public access in github)

Last parameter can be hex value or path to AES key. If your vendor is using custom aes keys you can use extract_keys.py to extract them.

To encrypt image use:

aescrypt2 0 boot.img boot.img.aes hex:0007FF4154534D92FC55AA0FFF0110E0
or
aescrypt2 0 boot.img boot.img.aes keys/AESBootKey

So to decrypt image use:

aescrypt2 1 boot.img.aes boot.img hex:0007FF4154534D92FC55AA0FFF0110E0
or
aescrypt2 1 boot.img boot.img.aes keys/AESBootKey

Encrypt partition and generate signature

All new MStar builds have SECURE_BOOT option enabled. In that case boot.img and recovery.img is encrypted (AES) and signed with RSA priv keys. That script is used to encrypt image and generate sign file.

To manually encrypt|decrypt image use aescrypt2 tool from bin folder. AES key can be extracted from MBOOT with extract_keys.py script.

Usage: secure_partition.py <file to encrypt> <AES key file> <RSA private key file> <RSA public key file> <output encrypted file> <output signature file>
Example: secure_partition.py ./pack/boot.img ./keys/AESbootKey ./keys/RSAboot_priv.txt ./keys/RSAboot_pub.txt ./pack/boot.img.aes ./pack/bootSign
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].