Skip to content

Instantly share code, notes, and snippets.

View qaz6750's full-sized avatar
πŸ˜΅β€πŸ’«
I may be slow to respond.

XiaoYeZi qaz6750

πŸ˜΅β€πŸ’«
I may be slow to respond.
View GitHub Profile
def TuneDataPatch(data, value1, value2):
movInstruction = 0x52800002
instr1 = movInstruction | (value1 << 5)
instr2 = movInstruction | (value2 << 5)
loc = data.find(instr1.to_bytes(4, byteorder='little'))
if loc < 0 or loc % 4 != 0:
return data
print("Patching tune data at 0x{:08x}".format(loc))