Skip to content

Instantly share code, notes, and snippets.

@xperia64
Created Jul 27, 2020
Embed
What would you like to do?
seeddb to dat
#!/usr/bin/env python3
import sys
import os
with open(sys.argv[1], mode='rb') as seeddb:
seedbyte = seeddb.read()[16:]
try:
os.mkdir("seed")
except OSError as e:
pass
i = 0
while i < len(seedbyte):
gameId = 0
typ = 0
for o in range(0,4):
gameId |= seedbyte[i+o] << o * 8
typ |= seedbyte[i+o+4] << o * 8
i += 8
print("{:08x}{:08x}.dat".format(typ, gameId))
seed = seedbyte[i:i+16]
i += 24
with open("seed/{:08x}{:08x}.dat".format(typ, gameId), 'wb') as dat:
dat.write(seed)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment