Created
May 15, 2018 21:17
-
-
Save MCMrARM/bf78c7c77704c7db9f424b02fed51280 to your computer and use it in GitHub Desktop.
A simple script to brick the BCT
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
import os | |
def do_brick(file, bct_offset, unbrick): | |
os.lseek(file, bct_offset + 0x0530, os.SEEK_SET) | |
print("Org = " + str(os.read(file, 1))) | |
os.lseek(file, bct_offset + 0x0530, os.SEEK_SET) | |
new_val = b'\01' if unbrick else b'\00' | |
print("New = " + str(new_val)) | |
os.write(file, new_val) | |
unbrick = False | |
file = os.open("/dev/mmcblk1boot0", os.O_RDWR) | |
do_brick(file, 0x000000, unbrick) | |
do_brick(file, 0x004000, unbrick) | |
do_brick(file, 0x008000, unbrick) | |
do_brick(file, 0x00C000, unbrick) | |
os.close(file) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment