Skip to content

Commit

Permalink
Renamed a file for easier wrangling.
Browse files Browse the repository at this point in the history
  • Loading branch information
dboddie committed Mar 4, 2024
1 parent 13ac004 commit 990c342
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions Fixes/Lunar_Rescue/patch_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,18 @@

import os, shlex, sys

# Change the file name of the last file in the penultimate file.
t = open("temp/Lunar2", "rb").read()
t = b"Lunar33" + t[7:]
open("temp/Lunar2", "wb").write(t)

# Patch out the JMP (&FFFC) reset call EORed with 0x0e in the final file.
# 0x04 is 0xea ^ 0x0e where 0xea is the opcode for NOP.
t = open("temp/Lunar3\xc3", "rb").read()
t = t[:0x261e] + b"\x04\x04\x04" + t[0x2621:]
open("temp/Lunar3\xc3", "wb").write(t)
open("temp/Lunar33", "wb").write(t)

t = open("temp/Lunar3\xc3.inf", "rb").read()
open("temp/Lunar33.inf", "wb").write(t)

os.system("UEFtrans.py " + shlex.quote(sys.argv[1]) + " insert 3 temp/Lunar3\xc3")
os.system("UEFtrans.py " + shlex.quote(sys.argv[1]) + " insert 3 temp/Lunar33")

0 comments on commit 990c342

Please sign in to comment.