Skip to content

Instantly share code, notes, and snippets.

@bbayles
Created January 18, 2023 02:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bbayles/1131d3f4692967ca05fe9043687bfd52 to your computer and use it in GitHub Desktop.
Save bbayles/1131d3f4692967ca05fe9043687bfd52 to your computer and use it in GitHub Desktop.
"""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