Skip to content

Instantly share code, notes, and snippets.

@MCMrARM
Created May 15, 2018 21:17
Show Gist options
  • Save MCMrARM/bf78c7c77704c7db9f424b02fed51280 to your computer and use it in GitHub Desktop.
Save MCMrARM/bf78c7c77704c7db9f424b02fed51280 to your computer and use it in GitHub Desktop.
A simple script to brick the BCT
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