You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
877 B
38 lines
877 B
# Seed values (break at s03_A13A to fetch them)
|
|
s03_A0F3 = 0x5D0B1C11 # Match
|
|
s03_A0F7 = 0x35E79125 # Match
|
|
s03_A0FB = 0x56596b10 # Match
|
|
s03_A0FF = 0x7FFFFB0A # Match
|
|
s03_A103 = 0x1b080733 # Match
|
|
|
|
file = open("fools.sav", "rb")
|
|
file.seek(0x6567)
|
|
buf = bytearray(file.read(0x200))
|
|
file.close()
|
|
|
|
while s03_A0FF != 0:
|
|
s03_A107 = s03_A103
|
|
|
|
s03_A10B = (s03_A0F3 & 0xFF00) >> 8
|
|
s03_A10D = (s03_A0F3 & 0xFF0000) >> 16
|
|
s03_A10E = (s03_A0F3 & 0xFF000000) >> 24
|
|
|
|
print(s03_A0FF - i_out)
|
|
|
|
bufi = 0
|
|
i = 0
|
|
while s03_A107 != 0:
|
|
s03_A10B = ((s03_A10B // 2) * s03_A10D + s03_A10E) & 0xFFFF
|
|
buf[bufi] ^= (s03_A10B) & 0xFF
|
|
|
|
bufi += 1
|
|
if bufi >= 0x200:
|
|
bufi = 0
|
|
|
|
s03_A107 -= 1
|
|
|
|
s03_A0F3 = (s03_A0F3 * s03_A0F7 + s03_A0FB) & 0xFFFFFFFF
|
|
|
|
s03_A0FF -= 1
|
|
|
|
file = open("output.buffer", "wb").write(buf)
|
|
|