Last active
November 4, 2020 22:09
-
-
Save neuschaefer/a12044e51af8a2f9a0767b50703ebe4a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
# MStar firmware decryption tool | |
from Crypto.Cipher import AES | |
import sys | |
key = 4 * b'\x12\x34\x56\x78' | |
aes = AES.new(bytes(key), AES.MODE_ECB) | |
for filename in sys.argv[1:]: | |
with open(filename, 'rb') as f: | |
data = f.read() | |
dec = aes.decrypt(data[:(len(data)-16)&~0xf]) | |
with open(filename + '.out', 'wb') as f: | |
f.write(dec) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment