Last active
September 9, 2020 19:37
-
-
Save luca020400/b67edb8d27b2094fd0918560d8c2073e to your computer and use it in GitHub Desktop.
This file contains hidden or 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/env python3 | |
with open("vbmeta.img", "rb+") as vbmeta: | |
# Get current flags | |
vbmeta.seek(123) | |
flags = int.from_bytes(vbmeta.read(1), byteorder='big') | |
# Disable verity | |
flags |= 0x01 | |
# Disable verification | |
flags |= 0x02 | |
# Write the new flags | |
vbmeta.seek(123) | |
vbmeta.write(flags.to_bytes(1, byteorder='big')) |
This file contains hidden or 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/env python3 | |
with open("vbmeta.img", "rb+") as vbmeta: | |
# Get current flags | |
vbmeta.seek(123) | |
flags = int.from_bytes(vbmeta.read(1), byteorder='big') | |
# Enable verity | |
flags &= ~0x01 | |
# Enable verification | |
flags &= ~0x02 | |
# Write the new flags | |
vbmeta.seek(123) | |
vbmeta.write(flags.to_bytes(1, byteorder='big')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment