Thealexbarney / PqSave

Pokémon Quest save reader and writer
MIT License
32 stars 13 forks source link

Editor doesn't work with Android and iOS #11

Open mickeyandkaka opened 6 years ago

mickeyandkaka commented 6 years ago

Also want to know, does it work on ios or android version?

mickeyandkaka commented 6 years ago

It seems that it doesn't work for my ios version. I run the binary and dll in windows and macos, but they all get exception.

Thealexbarney commented 6 years ago

Can you post an ios or android save?

mickeyandkaka commented 6 years ago

https://drive.google.com/file/d/11SD80sKdv6ocYXEU70nqStJ2jiSVLtwR/view?usp=sharing

this is what i get from my ios11 users folder, using imazing

exception is Unhandled Exception: System.Security.Cryptography.CryptographicException: Padding is invalid and cannot be removed.

i guess there are something different with key iv checksumkey private static readonly byte[] Key = Encoding.UTF8.GetBytes("C7PxX4jPfPQ2SmzB"); private static readonly byte[] Iv = Encoding.UTF8.GetBytes("nSdhdc3ecDDEM7fA"); private static readonly byte[] ChecksumKey = Encoding.UTF8.GetBytes("chikuwa-hanpen");

ghost commented 6 years ago

@Thealexbarney Android version(Ios idk) has a different KEY and IV. The IV needs to be reversed

Preware commented 6 years ago

Will this be getting fixed anytime soon?

pmsmall commented 6 years ago

Is there any method to dump the AES key and iv of the Android version?

pmsmall commented 6 years ago

@Thealexbarney Are the AES key and iv compiled into the libil2cpp.so? Or written in some other files?Could you please write a tutorial about how to dump the key and iv?

Thealexbarney commented 6 years ago

I've taken a quick look into the Android version and the key appears to be the same as the Switch version, so I'm not sure what the differences between the versions are. Someone would have to look into it more.

pmsmall commented 6 years ago

@Thealexbarney The Android version use the /data/data/jp.pokemon.pokemonquest/shared_prefs/pqdata.xml to make the AES key, but the iv and the checksumKey are some as the switch version.

tom23rd commented 6 years ago

on https://gbatemp.net/threads/qedit-a-pokemon-quest-web-based-save-editor.509951/page-4, post #75 says:

Update: Got it. IV: 6E 53 64 68 64 63 33 65 63 44 44 45 4D 37 66 41 AES Key: 2F 39 65 45 45 65 76 6D 77 4A 36 41 6E 75 58 39 AES Type: 256 bit CBC

hope that can be of use.

tom23rd commented 5 years ago

i have to take that back, seems the skey is on a per user basis. there are instructions later in that same thread in my previous post to use game guardian, search for the iv and recover the user's skey which is in plaintext in memory.