Gaming Pokemon Sun and Moon - Hacking QR Codes?

Hacked Pokemon QR Codes, Yay, Nay?


  • Total voters
    31

DJ91990

Grookey Gang!
OP
Member
Joined
Feb 9, 2009
Messages
939
Trophies
0
Age
33
Location
Mom's Basement
Website
www.youtube.com
XP
418
Country
United States
I'm very curious on how the data in the QR Code is made up.

I used a Web QR Scanner to scan a number of Pokemon QR Codes.
I found something that appears in all of them:

HEX: 50 4F 4B 45
Text: POKE
The data from 0000000000-000000500D contains raw data.

You can take this raw data:
Code:
t.º*º#@.a¬..2'...ÿ¢xFbþ..YÝÂ@.à.£.¦ç.`QÈ7......!þ!±¨.\..w.¡@Y~.í>¯/Ø,.k.æ» .KÆÎ.éúÂåÜÝ@%.=å|gÊPOKE
and toss it into a QR Code generator to generate a working QR Code.

This raw data appears as this in HEX:
Code:
74 1C BA 2A BA 23 40 00 61 AC 16 00 32 27 19 00 15 FF A2 78 46 62 FE 16 00 59 DD C2 40 00 E0 8F A3 02 A6 E7 02 60 51 C8 37 8D 09 00 00 02 00 21 FE 21 B1 A8 16 5C 00 18 77 00 A1 40 59 7E 03 ED 3E AF 2F D8 2C 02 6B 17 E6 BB 20 1C 4B C6 CE 06 E9 FA C2 E5 DC DD 40 25 00 3D E5 7C 67 CA 50 4F 4B 45

This data is from the Magerna QR Code
Somewhere in that data string is a region lock code. I wonder if anyone else has tried this, and managed to create a USA-Region Magerna QR Code?

If we can find what value indicates region, we could modify the raw data and input that data into a QR Code Generator to make a Magerna QR Code that's region free!

One other thing I'm curious about is Battle Team QR Codes. We won't be able to get out hands on some until the Pokemon Global Link launches for Sun and Moon, but I'd love to see a program that can take Pokemon Generated in PKHeX and turn it into a Battle Team QR Code.

I'm sure it will need to contain at the very least:
Team Name
Pokemon Party Index Number
Pokemon Data {
Movesets
Nature, Shiny & Personality Value (PID)
Base Stats
Forme Info if applicaple
OT Data {Trainer Name, ID, SID, Latest Handler}
Held Item Data
}

It would be awesome if we could reverse engineer this and add a feature in PKHeX that could Generate Specific Wonder QR Codes for Obtaining Pokemon, QR Codes for adding Pokemon to the Seen Dex, and Team QR Codes!
 
Last edited by DJ91990,

Joshmas

Well-Known Member
Newcomer
Joined
Dec 18, 2014
Messages
94
Trophies
0
Age
33
XP
708
Country
I'm very curious on how the data in the QR Code is made up.

I used a Web QR Scanner to scan a number of Pokemon QR Codes.
I found something that appears in all of them:

HEX: 50 4F 4B 45
Text: POKE
The data from 0000000000-000000500D contains raw data.

You can take this raw data:
Code:
t.º*º#@.a¬..2'...ÿ¢xFbþ..YÝÂ@.à.£.¦ç.`QÈ7......!þ!±¨.\..w.¡@Y~.í>¯/Ø,.k.æ» .KÆÎ.éúÂåÜÝ@%.=å|gÊPOKE
and toss it into a QR Code generator to generate a working QR Code.

This raw data appears as this in HEX:
Code:
74 1C BA 2A BA 23 40 00 61 AC 16 00 32 27 19 00 15 FF A2 78 46 62 FE 16 00 59 DD C2 40 00 E0 8F A3 02 A6 E7 02 60 51 C8 37 8D 09 00 00 02 00 21 FE 21 B1 A8 16 5C 00 18 77 00 A1 40 59 7E 03 ED 3E AF 2F D8 2C 02 6B 17 E6 BB 20 1C 4B C6 CE 06 E9 FA C2 E5 DC DD 40 25 00 3D E5 7C 67 CA 50 4F 4B 45

This data is from the Magerna QR Code
Somewhere in that data string is a region lock code. I wonder if anyone else has tried this, and managed to create a USA-Region Magerna QR Code?

If we can find what value indicates region, we could modify the raw data and input that data into a QR Code Generator to make a Magerna QR Code that's region free!

One other thing I'm curious about is Battle Team QR Codes. We won't be able to get out hands on some until the Pokemon Global Link launches for Sun and Moon, but I'd love to see a program that can take Pokemon Generated in PKHeX and turn it into a Battle Team QR Code.

I'm sure it will need to contain at the very least:
Team Name
Pokemon Party Index Number
Pokemon Data {
Movesets
Nature, Shiny & Personality Value (PID)
Base Stats
Forme Info if applicaple
OT Data {Trainer Name, ID, SID, Latest Handler}
Held Item Data
}

It would be awesome if we could reverse engineer this and add a feature in PKHeX that could Generate Specific Wonder QR Codes for Obtaining Pokemon, QR Codes for adding Pokemon to the Seen Dex, and Team QR Codes!
Would be cool or you could just use HANS or NTR to change the region.... a tad easier and even works with this qr code. But Id still say It's worth looking into.
 

DJ91990

Grookey Gang!
OP
Member
Joined
Feb 9, 2009
Messages
939
Trophies
0
Age
33
Location
Mom's Basement
Website
www.youtube.com
XP
418
Country
United States
The Pokemon games are region free.
I was able to get the Magerna QR Code to work when I Region Spoofed my region as JPN using Luma. It's very easy to use that.
You need to become a champion to use it.

I was wondering if it would be possible to modify the QR Code itself to be region free for those that don't have a hacked 3DS or access to homebrew.
 

Falo

Well-Known Member
Member
Joined
Jul 22, 2012
Messages
680
Trophies
2
XP
2,627
Country
Germany
QR Codes use the same crypto as the save signing algo, but it uses 14 different keys
- 3 for unknown 504 Byte QR Codes (event distributions?)
- 10 are used for pokedex entrys, but so far only 2 types are used, type 3 (Pokedex) and type 4 (GaOle)
- 1 is special, it uses a 1062 * 8 byte entry lookup table to generate a pokedex entry

If you decrypt a pokedex (type 3) qr code, then it looks like this: (#722 Rowlet)
Code:
Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
00000000  FF FF FF FF FF FF 00 00 01 00 00 00 01 00 00 00  ÿÿÿÿÿÿ..........
00000010  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
00000020  00 00 00 00 00 00 00 00 D2 02 00 00 00 01 00 00  ........Ò.......
00000030  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
00000040  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
00000050  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
00000060  00 00 50 4F 4B 45 03 00 00 00 00 00  ..POKE......
 
  • Like
Reactions: GilgameshArcher

SciresM

Developer
Developer
Joined
Mar 21, 2014
Messages
973
Trophies
3
Age
33
XP
8,294
Country
United States
QR Codes use the same crypto as the save signing algo, but it uses 14 different keys
- 3 for unknown 504 Byte QR Codes (event distributions?)
- 10 are used for pokedex entrys, but so far only 2 types are used, type 3 (Pokedex) and type 4 (GaOle)
- 1 is special, it uses a 1062 * 8 byte entry lookup table to generate a pokedex entry

If you decrypt a pokedex (type 3) qr code, then it looks like this: (#722 Rowlet)
Code:
Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
00000000  FF FF FF FF FF FF 00 00 01 00 00 00 01 00 00 00  ÿÿÿÿÿÿ..........
00000010  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
00000020  00 00 00 00 00 00 00 00 D2 02 00 00 00 01 00 00  ........Ò.......
00000030  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
00000040  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
00000050  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
00000060  00 00 50 4F 4B 45 03 00 00 00 00 00  ..POKE......

Magearna event QR is type 5 actually.
 
  • Like
Reactions: Queno138

Pokem

Well-Known Member
Member
Joined
Jul 22, 2016
Messages
1,058
Trophies
0
XP
1,434
Country
United States
inb4 noobs be like "OMG!1!!!!1111111!!!!!!!! THERE R QR CODES IN SUN AND MOON1!!!111 HAX EXPLOIT CONFIRMED."
 

azerti1304

Well-Known Member
Member
Joined
Sep 20, 2015
Messages
231
Trophies
0
XP
234
Country
France
I'm very curious on how the data in the QR Code is made up.

I used a Web QR Scanner to scan a number of Pokemon QR Codes.
I found something that appears in all of them:

HEX: 50 4F 4B 45
Text: POKE
The data from 0000000000-000000500D contains raw data.

You can take this raw data:
Code:
t.º*º#@.a¬..2'...ÿ¢xFbþ..YÝÂ@.à.£.¦ç.`QÈ7......!þ!±¨.\..w.¡@Y~.í>¯/Ø,.k.æ» .KÆÎ.éúÂåÜÝ@%.=å|gÊPOKE
and toss it into a QR Code generator to generate a working QR Code.

This raw data appears as this in HEX:
Code:
74 1C BA 2A BA 23 40 00 61 AC 16 00 32 27 19 00 15 FF A2 78 46 62 FE 16 00 59 DD C2 40 00 E0 8F A3 02 A6 E7 02 60 51 C8 37 8D 09 00 00 02 00 21 FE 21 B1 A8 16 5C 00 18 77 00 A1 40 59 7E 03 ED 3E AF 2F D8 2C 02 6B 17 E6 BB 20 1C 4B C6 CE 06 E9 FA C2 E5 DC DD 40 25 00 3D E5 7C 67 CA 50 4F 4B 45

This data is from the Magerna QR Code
Somewhere in that data string is a region lock code. I wonder if anyone else has tried this, and managed to create a USA-Region Magerna QR Code?

If we can find what value indicates region, we could modify the raw data and input that data into a QR Code Generator to make a Magerna QR Code that's region free!

One other thing I'm curious about is Battle Team QR Codes. We won't be able to get out hands on some until the Pokemon Global Link launches for Sun and Moon, but I'd love to see a program that can take Pokemon Generated in PKHeX and turn it into a Battle Team QR Code.

I'm sure it will need to contain at the very least:
Team Name
Pokemon Party Index Number
Pokemon Data {
Movesets
Nature, Shiny & Personality Value (PID)
Base Stats
Forme Info if applicaple
OT Data {Trainer Name, ID, SID, Latest Handler}
Held Item Data
}

It would be awesome if we could reverse engineer this and add a feature in PKHeX that could Generate Specific Wonder QR Codes for Obtaining Pokemon, QR Codes for adding Pokemon to the Seen Dex, and Team QR Codes!
 

DJ91990

Grookey Gang!
OP
Member
Joined
Feb 9, 2009
Messages
939
Trophies
0
Age
33
Location
Mom's Basement
Website
www.youtube.com
XP
418
Country
United States
QR Codes use the same crypto as the save signing algo, but it uses 14 different keys
- 3 for unknown 504 Byte QR Codes (event distributions?)
- 10 are used for pokedex entrys, but so far only 2 types are used, type 3 (Pokedex) and type 4 (GaOle)
- 1 is special, it uses a 1062 * 8 byte entry lookup table to generate a pokedex entry

If you decrypt a pokedex (type 3) qr code, then it looks like this: (#722 Rowlet)
Code:
Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
00000000  FF FF FF FF FF FF 00 00 01 00 00 00 01 00 00 00  ÿÿÿÿÿÿ..........
00000010  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
00000020  00 00 00 00 00 00 00 00 D2 02 00 00 00 01 00 00  ........Ò.......
00000030  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
00000040  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
00000050  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
00000060  00 00 50 4F 4B 45 03 00 00 00 00 00  ..POKE......


When you mention Crypto, you mean that the data is encrypted and is actually not raw and open to editing correct?
Would it be possible to create fake mystery gift codes based off the Magerna QR Code, provided we could crack the crypto, if that's even at all possible.

I know that it would just be easier to use PKHeX. It would still be nice to send a friend or twenty a QR Code that gave you a hacked event.

The real interesting part is the battle QR Codes that give you rental teams. I wonder if that will eventually get hacked and people just make a team of 6 stupid-powerful Pokemon all with Wonder Guard.
 

Apache Thunder

I have cameras in your head!
Member
Joined
Oct 7, 2007
Messages
4,426
Trophies
3
Age
36
Location
Levelland, Texas
Website
www.mariopc.co.nr
XP
6,792
Country
United States
When you mention Crypto, you mean that the data is encrypted and is actually not raw and open to editing correct?
Would it be possible to create fake mystery gift codes based off the Magerna QR Code, provided we could crack the crypto, if that's even at all possible.

I know that it would just be easier to use PKHeX. It would still be nice to send a friend or twenty a QR Code that gave you a hacked event.

The real interesting part is the battle QR Codes that give you rental teams. I wonder if that will eventually get hacked and people just make a team of 6 stupid-powerful Pokemon all with Wonder Guard.

No I believe it's more like the save crypto. It's a crypto involving the hash of the save/QR. Not necessarily the data contained in the QR. It's how the game "signs" the QR code to make sure it wasn't modified. (He was just saying that the QR used the same signing method as the save file system)

By the way, I wonder how the "team QR" codes works. Could you gen in an entire team with that or does the QR only contain a link on a server?
 

Falo

Well-Known Member
Member
Joined
Jul 22, 2012
Messages
680
Trophies
2
XP
2,627
Country
Germany
Yes it's encrypted, to edit it you need to decrypt and re-encrypt it.
But the problem is, we only have privatekey03.der, so we can only encrypt type 3 qr's (pokedex) not event or gaole.
Only Game Freak has the RSA Private keys to do this. GaOle is Type 4, Event is Type 5.

Team qr codes are simple, if you do a pgl sync, your entire save is uploaded and you can create online a qr code for this.
 

DJ91990

Grookey Gang!
OP
Member
Joined
Feb 9, 2009
Messages
939
Trophies
0
Age
33
Location
Mom's Basement
Website
www.youtube.com
XP
418
Country
United States
From what I understand, people are able to assemble teams in one of the battle boxes. When you connect to the PGL and get your PGL ID, you can generate a QR Code that allows other players to scan in that code and rent the Pokemon you used in that battle box. I don't know if the QR Code has the data for the rental sitting on a server, or if the QR Code itself contains all the information for the team.
 

Falo

Well-Known Member
Member
Joined
Jul 22, 2012
Messages
680
Trophies
2
XP
2,627
Country
Germany
From what I understand, people are able to assemble teams in one of the battle boxes. When you connect to the PGL and get your PGL ID, you can generate a QR Code that allows other players to scan in that code and rent the Pokemon you used in that battle box. I don't know if the QR Code has the data for the rental sitting on a server, or if the QR Code itself contains all the information for the team.
The qr code has all the data, Gamefreak uses RSA as Encryption, not as Signing.
 

hacksn5s4

Banned!
Banned
Joined
Aug 12, 2015
Messages
4,332
Trophies
0
XP
1,322
Country
the save crypto was easliy cracked for pkhex so i don't see why the same can't happen with these qr codes i mean the event qr codes not the pgl battle team ones
 
Last edited by hacksn5s4,

SciresM

Developer
Developer
Joined
Mar 21, 2014
Messages
973
Trophies
3
Age
33
XP
8,294
Country
United States
Won't be possible without CFW, because we don't have the signing keys for the non-pokedex QRs.

With CFW, you can edit code...and that means you can make the other QRs try to decrypt with the right key, and if it fails try again with the QR key that we have.

;)

Will probably release the patch I made when I've added more features to it.

qgGXy97.jpg

9ZkVBbz.jpg
 

SciresM

Developer
Developer
Joined
Mar 21, 2014
Messages
973
Trophies
3
Age
33
XP
8,294
Country
United States
Won't be possible without CFW, because we don't have the signing keys for the non-pokedex QRs.

With CFW, you can edit code...and that means you can make the other QRs try to decrypt with the right key, and if it fails try again with the QR key that we have.

;)

Will probably release the patch I made when I've added more features to it.

qgGXy97.jpg

9ZkVBbz.jpg

Here's a proof of concept patch video:

 

Ghostly_Love

New Member
Newbie
Joined
Nov 17, 2016
Messages
1
Trophies
0
Age
32
XP
51
Country
United States
Hello, i downloaded Pokemon Sun And Moon rar, and it says i need an encryption password, can anybody help me with this? or a better rom download? i only have a phone but really want to play >.<
 

Sailormaidyn

Member
Newcomer
Joined
Nov 9, 2016
Messages
5
Trophies
0
Age
50
XP
55
Country
United States
Won't be possible without CFW, because we don't have the signing keys for the non-pokedex QRs.

With CFW, you can edit code...and that means you can make the other QRs try to decrypt with the right key, and if it fails try again with the QR key that we have.

;)

Will probably release the patch I made when I've added more features to it.

qgGXy97.jpg

9ZkVBbz.jpg
Could you please post the marshadow qr code?
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • Veho @ Veho:
    Illinois is working to ban toxic food additives that have been banned for decades in other countries; additives that can be replaced and all those countries still have Skittles and Mountain Dew. Title of the piece: GUBMINT WANTS TO TAKE AWAY YOUR CANDY
  • Veho @ Veho:
    Gee, I wonder if the author is biased?
  • SylverReZ @ SylverReZ:
    @Veho, Sounds and smells like bullshit. They don't give you cancer, and California should know that. I don't get why they stick labels that say "may or may not cause reproductive harm or cancer".
  • Veho @ Veho:
    Arsenic doesn't give you cancer either.
    +2
  • Veho @ Veho:
    California has already banned those additives BTW.
    +2
  • Veho @ Veho:
    Psi has been banned in the state of California.
    +2
  • Psionic Roshambo @ Psionic Roshambo:
    I am the cancer!!! lol
  • Psionic Roshambo @ Psionic Roshambo:
    Yayyy got arcade games on the Pi working lol
  • Veho @ Veho:
    Cool.
  • Psionic Roshambo @ Psionic Roshambo:
    Now to spend 6 months deleting all the garbage lol
  • Psionic Roshambo @ Psionic Roshambo:
    Mame should be two sets one for preservation of everything and one set for people who just want to play and enjoy the old old ganes
  • SylverReZ @ SylverReZ:
    @Psionic Roshambo, Shouldn't preservation be legal tho?
    +1
  • SylverReZ @ SylverReZ:
    @Psionic Roshambo, I always see this dude's shorts, he sounds pretty annoying.
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    Preservation yeah it absolutely should be legal
    +1
  • SylverReZ @ SylverReZ:
    @Psionic Roshambo, Believe Japan was going to make it legal at some point, according to a Kotaku story.
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    I swear like 99% of arcade games wouldn't even exist these days outside of MAME the arcade machines are old and busted very few ever saw any sort of home conversion
  • Psionic Roshambo @ Psionic Roshambo:
    We get 37 versions of Super Mario Bros but 0 of Beast Busters
    +1
  • SylverReZ @ SylverReZ:
    @Psionic Roshambo, There's a lot of obscure Japanese arcade titles that are either lost to time or dumped.
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    It's so unfair, maybe AI can save us lol
  • Psionic Roshambo @ Psionic Roshambo:
    I mean if a company could use AI to do the work of a home conversion for essentially free why not? The rights for some games are completely lost though
  • SylverReZ @ SylverReZ:
    @Psionic Roshambo, AI is taking our jobs!
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    Just tried the Master System version.... Ugghh
    Psionic Roshambo @ Psionic Roshambo: Just tried the Master System version.... Ugghh