Created
July 27, 2020 22:32
-
-
Save xperia64/1d4ceb4c3b3f27c9c4fdec6acc272b93 to your computer and use it in GitHub Desktop.
seeddb to dat
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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