Jump to content

Recommended Posts

Posted (edited)

General Research Thread.

Save1 Decryption method (can then be viewed with PKHeX).

Wiki - Updating periodically with our knowledge.

--

Have been doing a bunch of structure research with SciresM and Codemonkey85 on IRC; since we're able to decrypt the majority of save files now we're getting some meaningful data.

6th Gen Wondercard Structure Wiki

Edited by Kaphotics
  • Replies 213
  • Created
  • Last Reply

Top Posters In This Topic

Posted (edited)

Just dumped the item numbers for most of the Key items and all of the new TMs:

Town map - 1BA - 442

Holo Caster - 281 - 641

Adventure Rules - 2BF - 703

Roller Skates - 283 - 643

Exp Share - 0D8 - 216

Sprinklotad - 2B1 - 689

Dowsing Machine - 1D7 - 471

Intriguing Stone - 2B9 - 697

Mega Ring - 2B8 - 696

Power Plant Pass - 2B7 - 695

Elevator Key - 2BC - 700

Honor of Kalos - 2BE - 702

TMV Pass - 2BD - 701

Vs Recorder - 1D1 - 465

Pokeradar - 1AF - 431

Bicycle - 1C2 - 450

Super Rod - 1BF - 447

Shiny Charm - 278 - 632

Oval Charm - 277 - 631

Lens Case - 2C1 - 705

Looker Ticket - 2C8 - 712

Prof's Letter - 282 - 642

--

TM100 - 2B6 - 694

TM99 - 2B5 - 693

TM98 - 2B4 - 692

TM97 - 2B3 - 691

TM96 - 2B2 - 690

Edit: Got Lens Case and Looker Ticket

Edit 2: Got Prof's Letter

Edited by SciresM
Posted
  OmegaDonut said:
Nope. We can get the encryption keys used for a single cartridge, but we do not know how the keys are generated.

I'm probably woefully ignorant of the facts here, so forgive me, but I asked because KeySAV is seemingly managing to decrypt the save files. What I was wondering is if there was any information available on how this is done (short of decompiling it).

Posted

KeySAV doesn't need the key - it instead operates on a simple concept which involves rearranging slot data and knowing how save files are encrypted.

The trick which was used to reveal more contents of the save file didn't need a key either; it's essentially KeySAV's exploit pushed a little further in terms of rearranging data.

Posted
  Kaphotics said:
KeySAV doesn't need the key - it instead operates on a simple concept which involves rearranging slot data and knowing how save files are encrypted.

The trick which was used to reveal more contents of the save file didn't need a key either; it's essentially KeySAV's exploit pushed a little further in terms of rearranging data.

News to me. Thanks. The whole thing makes a lot more sense now.

Posted (edited)

I found, after much searching, where "Lumiose Style" is stored in the save. It's a single integer value ranging from 0-255. Buying something increases style by 2. Asking alexa to show you around increases style by 5. More values to come when I catalog them.

Discounts are as follows on the megastone in the stone emporium (Thanks, Kaphotics, for the chart):

Stage---Style--Price

0--------0-----1,000,000

1--------10----700,000

2--------25----300,000

3--------50----150,000

4--------90----100,000

5--------140---70,000

6--------190---50,000

7--------255---10,000

Edit: I got around to logging how much style everything in lumiose is worth: https://docs.google.com/spreadsheet/ccc?key=0AgF4wNipOQuCdC1obHRfU3JnUG5JZ0ZCNmRnMW1Xd1E

Edited by SciresM
Posted

Thanks to theSLAYER, I was able to find the Bank Celebi data, which is treated kinda like a wondercard.

toyEu.jpg

Stored inside the Pokemon Bank block. There's data afterwards which I can't figure out, so I'm not gonna post an entire dump of his saveblock.

02CB = 715

0269 = 617

022F = 559

0072 = 114

9C54 = 40020

9C71 = 40049

and some japanese unicode (サトシ = Satoshi/Ash)

Posted

Hey Kaphotics, I'm curious:

On the 6th gen wiki for wondercards, there is an used/unused byte.

If used, are the "Pokemon data" removed.

If not, that means that used wondercards can be flagged and unused and can be uploaded to gallery, right?

Posted
  Kaphotics said:
If they're used, it's just a byte signaling that the card cannot be received in the future. All of the card data remains.

Just flip the bit if you've received it.

That's what I wanted to hear.

Now, all we have to do is to find people with other wondercards to share (Garchomps and stuff)

Anyway, is the "share wondercard" function still programmed in?

I think I last heard it it.. gen IV?

  • 3 weeks later...
Posted

Might as well make a few comments:

Save file "decryption" and the process:

  Reveal hidden contents

About KeySAV & Mass Dumper, and the trick that makes them work:

  Reveal hidden contents

About KeyBV and the trick that makes it work:

  Reveal hidden contents
Posted (edited)

There is an error with your KeySAV / Mass Dumper, after several useless trys to make it work i found out that your blank.ekx is the mistake.

A real blank.ekx is only zeros + encryption, there is no "Egg" data in them, after generating a blank.ekx with just zeros i was able to

dump all of my boxes without a single checksum error.

The egg data is a error by xoring a new save against a old save, this only applies for box data & battle box data.

Also here the german torchic wondercard, only the text and 1 byte is different

72zc46mw.jpg

// edit:

Region & Country id's can be dumped through the passerby data

struct PASSERBY{
   struct PASSERBY_ENTRY entry[102]<optimize=false>;
   ubyte padding[0x50];
};

struct PASSERBY_ENTRY{
   uint unk1;
   uint unk2;
   wchar_t Name[13];
   wchar_t Message[17];
   ubyte unk3[0x12];
   ubyte region;
   ubyte country;
   ubyte unk4[0x44];
   ushort favoritePKM;
   ubyte unk5[7];
   byte stars;
   ubyte data[0x22];
   Printf("%s: %d, %d\n", Name, country, region);
};

some dumped country id's:

  Reveal hidden contents

1501 - Torchic (GER).zip

1501 - Torchic (GER).zipFetching info...

Edited by Bond697
Posted

I followed Kaphotics decryption process to try to edit a french savefile. There are some things I must talk about.

Firstly, the offset on the Wiki are not exactly the same on my save. I found a gap of 9C between mines and yours for all of the Item Pockets. Is it relative to the language ?

Then, trying to modify the quantity of a berry, I turned back the savefile to its original file. But Powersaves software doesn't display the save anymore. Do you know anything about a checksum or something else that could block any kind of mods ?

Posted

The gap of 0x9C is because you have the powersaves header. Strip it out and you'll have the actual offsets.

The save file must be valid for Datel to load it; they are running modified 3DSes to load,decrypt,edit,encrypt,save. There is no way to alter the savefile and have Datel fix it.

Posted
  Megadrifter said:
So there's no way to restore a save file through Datel software ? Too bad...

There are a few barriers --

a) there is a checksum in the header that Datel adds to the save file. If the checksum fails to match the data, Powersaves will not recognize it. I haven't gotten around to figuring out how the checksum is calculated, but I've been able to get around it by using Cheat Engine to edit the loaded save file in RAM, and having Powersaves write the "backup" to a file with the correct checksum.

b) data in the save file is hashed with SHA-256, if the hash doesn't match the data the game will not load it. If the game can't load it, Datel's servers can't edit it. If we had a completely decrypted save file, we *might* be able to figure it out, but we don't. We only have partially decrypted data - but not the constants in the save file.

c) Save files are signed with an AES-256 MAC at the very start of the save file, using a key hidden in the 3DS (in a write-only register, cannot be read). Datel's servers uses modded 3DSes to sign save files. The good news here is that if you have a save file that isn't signed properly and ask Datel's servers to apply cheats, they will send you a save file with a fixed signature - but ONLY if the hashes in b) are correct. They need to be able to load the save files to apply the RAM edits for cheats.

d) Without having a fully decrypted save file, we don't have the encryption keystream on top of the hashes and the AES MAC.

Posted

This is likely a profoundly stupid question - apologies in advance, especially if this isn't the place for it.

Does Powersaves alter save games in any way when simply backing up or restoring data?

Come to think of it, do we know how Powersaves backs up/restores X/Y saves? I recall this being a problem not too long ago...

Posted

They don't alter the gamesave at all.

Copy from cart to RAM -> checksum the save -> apply header with checksum -> store / send.

All edits are done server side on their 3DS farm which loads and decrypts, then applies the edits.

Posted
  papadragon418 said:
This is likely a profoundly stupid question - apologies in advance, especially if this isn't the place for it.

Does Powersaves alter save games in any way when simply backing up or restoring data?

Come to think of it, do we know how Powersaves backs up/restores X/Y saves? I recall this being a problem not too long ago...

For detailed info about the savegames look here: http://www.3dbrew.org/wiki/Savegames

To dump and restore saves it reads the NCSD/NCCH header from the rom, this is where it gets the needed informations (NAND save/EPROM save/etc...).

The Pokemon X/Y save is missing the "Wear leveling" sector structs, (after the powersave header) it starts directly with the AES-MAC hash, then the DISA/DIFI/... stuff.

It's most likely that the save id (which should protect against save modding) is tricked by not modifing these structs and just copy/pasting the save data, but i don't know exactly how it works.

@OmegaDonut

I have my doubts about datel using a real 3DS and ram hacks to modify saves, datel has enough resources to break any encryption/private keys (they did prove this with the PSP AR), their setup modifies values where a real 3DS just writes 0xFF, this proves they calculate more than a real 3DS would do and it makes more sense then a 3DS farm.

Posted
  Falo said:
datel has enough resources to break any encryption/private keys (they did prove this with the PSP AR)

I don't know much about the history of the PSP AR, but from what I can tell the AR was broken several times by firmware updates, which indicates that Datel found ways to fool the PSP into loading unsigned code that were patched, not that they were able to break encryption keys. And by the end of the PSP's lifetime, the security had more holes than Swiss cheese anyway.

  Quote
their setup modifies values where a real 3DS just writes 0xFF, this proves they calculate more than a real 3DS would do and it makes more sense then a 3DS farm.

Actually, it doesn't. I have a 3DS that can run unsigned code, and I can have it use its internal AES engine to encrypt\decrypt any data I want. I can even instruct it to use the same keys used in savefile encryption\decryption. But I can't ask it to tell me what the keys are, as they are in write-only registers, and initialized by the firmware at boot.

The most realistic possibility is Datel does not know the keys, and have to use the same AES engine to encrypt\decrypt savefiles. The fact that Datel chooses to encrypt regions never edited by the game is sloppiness on their part, not an indication of superior knowledge.

Posted
  Kaphotics said:
They don't alter the gamesave at all.

Copy from cart to RAM -> checksum the save -> apply header with checksum -> store / send.

All edits are done server side on their 3DS farm which loads and decrypts, then applies the edits.

Let me know if I understood:

When you backup a gamesave using Powersaves, is the information going to Datel? (only for a backup, not editing or restoring information).

- Hide

Posted

PGL Promotion Gifts:

@ 0x26200:

u32 flag == 1 --> delivery type (item)

u16 item

u16 quantity

4AXWe.jpg

@ 0x26394:

u32 flag == 1 --> deliver (0 no delivery)

afterwards is some date related stuff (and maybe PGL IDs) so I'm not posting a pic of this section.

thanks to TheSonAlsoRises for contributing save files (Discount Coupon).

Guest
This topic is now closed to further replies.
×
×
  • Create New...