Created
January 6, 2026 13:41
-
-
Save N1kroks/83c869199c07dd3a202b3702486da208 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
| from argparse import ArgumentParser | |
| import struct | |
| if __name__ == "__main__": | |
| arg_parse = ArgumentParser() | |
| arg_parse.add_argument("input") | |
| arg_parse.add_argument("-o", "--output") | |
| args = arg_parse.parse_args() | |
| with open(args.input, "rb") as f: | |
| data = bytearray(f.read()) | |
| name_offset = data.find(b"\\_SB_.UFS0") | |
| if name_offset <= 0: | |
| raise Exception("Failed to find \\\\_SB_.UFS0") | |
| cache_coherency_offset = name_offset - 9 | |
| struct.pack_into("<I", data, cache_coherency_offset, 1) | |
| with open(args.output, "wb") as f: | |
| f.write(data) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment