Created
January 18, 2023 02:49
-
-
Save bbayles/1131d3f4692967ca05fe9043687bfd52 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
"""Burning Rangers Taikenben editor. | |
Modifies the .bin file with the main game on it to play additional missions. | |
Expects an input file (before modification) with the SHA-1 hash | |
acdb237c6c6fa34f6f6bdab767e88f15a6670d6b. | |
""" | |
from argparse import ArgumentParser | |
parser = ArgumentParser('Modify Burning Rangers Taikenben') | |
parser.add_argument('file_path', type=str, help='Path to first .bin file') | |
parser.add_argument('round_number', type=int, help='Which round to load') | |
args = parser.parse_args() | |
round_number = args.round_number.to_bytes(1, 'big') | |
with open(args.file_path, 'rb+') as f: | |
# The bytes at this position should be 0xE000 | |
f.seek(0x61536) | |
if f.read(1) != b'\xe0': | |
raise RuntimeError('Could not locate position to write') | |
f.write(round_number) | |
print(f'Updated round number to {args.round_number}') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment