Last active
August 29, 2015 13:57
-
-
Save racerxdl/b561f56f3ceae109a274 to your computer and use it in GitHub Desktop.
Pump It Up Fiesta 2 Save Decrypter/Encrypter
This file contains 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
#Name # offset length datatype | |
adler32 # 0x00 0x04 LE int | |
adlerSeed # 0x04 0x04 LE int | |
playerID # 0x08 0x08 string (null term) | |
region # 0x14 0x04 LE int | |
avatarID # 0x18 0x04 LE int | |
level # 0x1C 0x04 LE int | |
totalCalories # 0x20 0x04 LE float | |
totalV02 # 0x24 0x04 LE float | |
numberRunningSteps # 0x28 0x08 LE int64 | |
numberGamesPlayed # 0x30 0x08 LE int64 | |
exp # 0x38 0x08 LE int64 | |
arcadeScore # 0x40 0x08 LE int64 | |
numberMissionsCompleted # 0x48 0x04 LE int | |
numberCoopMissionsCompleted # 0x4C 0x04 LE int | |
battleCountWins # 0x50 0x04 LE int | |
battleCountLoses # 0x54 0x04 LE int | |
battleCountDraws # 0x58 0x04 LE int | |
versionString # 0x120 0x08 string (null term) | |
cpuString # 0x128 0x80 string (null term) | |
motherboardString # 0x1A8 0x80 string (null term) | |
gfxcardString # 0x228 0x80 string (null term) | |
hddString # 0x2A8 0x20 string (null term) | |
totalRamBytes # 0x2C8 0x04 LE int | |
haspkeyID # 0x2CC 0x04 LE int | |
machineStatsBeginnerModePlayCount # 0x2D0 0x04 LE int | |
machineStatsManiacModePlayCount # 0x2D4 0x04 LE int | |
machineStatsUnknown # 0x2D8 0x04 LE int | |
machineStatsUnknown2 # 0x2DC 0x04 LE int | |
machineStatsBattleModePlayCount # 0x2E0 0x04 LE int | |
machineStatsMissionZonePlayCount # 0x2E4 0x04 LE int | |
machineStatsSkillZonePlayCount # 0x2E8 0x04 LE int | |
machineStatsCoopMissionPlayCount # 0x2EC 0x04 LE int | |
# Machine HighScore Struct (The array starts at 0x2F0) | |
songID # 0x00 0x04 LE hex | |
difficulty # 0x04 0x01 byte | |
mode # 0x05 0x01 byte | |
grade # 0x06 0x01 byte | |
clearState # 0x07 0x01 byte | |
scoreTotal # 0x08 0x04 LE int | |
playCountTotal # 0x0C 0x04 LE int | |
unknown # 0x10 0x04 LE int | |
playerID # 0x14 0x08 string (null term) | |
unknown2 # 0x1C 0x04 LE int | |
nullPadding # 0x20 0x04 LE int | |
# Personal HighScore Struct (The array starts at 0x25970) | |
songID # 0x00 0x04 LE hex | |
difficulty # 0x04 0x01 byte | |
mode # 0x05 0x01 byte | |
grade # 0x06 0x01 byte | |
clearAndUnlockedState # 0x07 0x01 byte # Do an |= 0x40 to unlock | |
scoreTotal # 0x08 0x04 LE int | |
playCountTotal # 0x0C 0x04 LE int | |
nullPadding # 0x10 0x04 LE int | |
This file contains 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
import struct | |
import zlib | |
def decryptprofile(savedata,rankdata): | |
seed = 0xEBADA1 | |
for i in range(0,len(savedata)): | |
smbuff = savedata[i] | |
savedata[i] ^= (seed >> 8) & 0xFF | |
seed = (0x68993 * (smbuff + seed) + 0x4FDCF) & 0xFFFFFFFF | |
seed = 0xEBADA1 | |
for i in range(0,len(rankdata)): | |
smbuff = rankdata[i] | |
rankdata[i] ^= (seed >> 8) & 0xFF | |
seed = (0x68993 * (smbuff + seed) + 0x4FDCF) & 0xFFFFFFFF | |
return savedata,rankdata | |
def encryptprofile(savedata,rankdata): | |
adlerseed = struct.unpack("<I",savedata[4:8]) | |
newsaveadler = zlib.adler32(savedata[4:],adlerseed[0]) & 0xFFFFFFFF | |
newrankadler = zlib.adler32(rankdata[4:],adlerseed[0]) & 0xFFFFFFFF | |
#savedata[0:4] = struct.pack("<I",newsaveadler) | |
#rankdata[0:4] = struct.pack("<I",newrankadler) | |
savedata = struct.pack("<I",newsaveadler) + savedata[4:] | |
rankdata = struct.pack("<I",newrankadler) + rankdata[4:] | |
savedata = bytearray(savedata) | |
rankdata = bytearray(rankdata) | |
seed = 0xEBADA1 | |
for i in range(0,len(savedata)): | |
smbuff = savedata[i] ^ (seed >> 8) & 0xFF | |
savedata[i] = smbuff | |
seed = (0x68993 * (smbuff + seed) + 0x4FDCF) & 0xFFFFFFFF | |
seed = 0xEBADA1 | |
for i in range(0,len(rankdata)): | |
smbuff = rankdata[i] ^ (seed >> 8) & 0xFF | |
rankdata[i] = smbuff | |
seed = (0x68993 * (smbuff + seed) + 0x4FDCF) & 0xFFFFFFFF | |
return savedata,rankdata |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment