illinialex24
Smash Hero
What does Comex mean when he said this:
I think you can already create your own snapshot, how do you do so???? I need 3 snapshots at least...So guys... guess what I found (with the help of crediar and a lot of other people)
To calculate the checksum of a decrypted replay/snapshot/stage, take the number at 0x1c (big-endian). Add 0x20 to that and take that much of the file from the beginning (should be most of the file, except for null bytes at the end for padding). Then, replace the four bytes at 0x10 with 0xDEADBEEF. crc32 and stick the result (again, big-endian) into 0x10.
Here is a quick Python script to do that:
import sys, struct, zlib
from UserString import MutableString
N = False
if len(sys.argv) == 4 and sys.argv[1] == '-n':
N = True
sys.argv = sys.argv[1:]
if len(sys.argv) != 3:
print 'Usage: brawl-cksum [-n] <input> <output>'
print 'If -n, I won\'t modify the size to 0'
sys.exit(1)
f = open(sys.argv[1], 'r')
g = f.read()
f.close()
n = MutableString(g)
if not N: n[0x1c:0x20] = struct.pack('>I', 0) # Set the size to 0, it doesn't care if it's compressed
size = struct.unpack('>I', str(n[0x1c:0x20]))[0] + 0x20
m = MutableString(n[:size])
m[0x10:0x14] = struct.pack('>I', 0xDEADBEEF)
n[0x10:0x14] = struct.pack('>I', zlib.crc32(str(m)))
f = open(sys.argv[2], 'w')
f.write(str(n))
f.close()
so,
1. Decrypt the file using the sd-key (AB 01 B9...) and the brawl specific IV (4E 03 41...).
2. Run DeLZSS on it
3. Change the 4 bytes at 0x1c to be the same as the bytes as the 4 bytes at 0x18.
4. Run ^ with -n
5. Encrypt
and you can use the modified file. Warning, a lot of stuff (like having no tiles) causes Brawl to crash.
Really this should be a lot easier than using the USBGecko to mess with stuff...