Jump to content


Popular Content

Showing content with the highest reputation since 11/30/16 in Technical Documents

  1. 5 points
    This page is an ongoing progress. It's aim is to list: 1. All the Fly-to points 2. Maps not revisited/cannot be re-accessed after certain points in the story 3. Any Discovered unused maps Fly-To List MELEMELE Image Map Coordinates Comments Credits Route 1 Player's House Map: 0 X: 28213.00000 Y: 0.00000 Z: 18490.00000 @Ruby Genseki Route 1 Ten Carat Hill Map: 0 X: 27578.70000 Y: 0.00000 Z: 23023.70000 @Ruby Genseki Route 1 Pokémon Center Map: 0 X: 25831.30000 Y: 0.00000 Z: 19451.80000 @Ruby Genseki Hau'oli City Shopping District Map: 0 X: 8531.50500 Y: 0.00000 Z: 18201.19000 @Ruby Genseki Route 2 Hau'oli Cementery Map: 0 X: 9249.00000 Y: 0.00000 Z: 14015.00000 Ruby Genseki Route 2 Verdant Cave Map: 0 X: 13879.70000 Y: 0.00000 Z: 7593.20000 Ruby Genseki Route 2 Pokémon Center Map: 0 X: 12629.74000 Y: 0.00000 Z: 6490.64200 Ruby Genseki Melemele Meadow Map: 0 X: 19037.60000 Y: 0.00000 Z: 6979.00000 Ruby Genseki Iki Town Map: 0 X: 18122.30000 Y: 0.00000 Z: 13724.60000 Ruby Genseki Ruins of Conflict Map: 5 X: 1394.34100 Y: 0.00000 Z: 794.84900 Ruby Genseki AKALA Image Map Coordinates Comments Credits Heahea City Map: 49 X: 15253.00000 Y: 0.00000 Z: 30524.60000 @Ruby Genseki Paniola Town Map: 49 X: 19373.00000 Y: 0.00000 Z: 22274.00000 Ruby Genseki Paniola Ranch Map: 88 X: 5839.31800 Y: 0.00000 Z: 3327.02000 Ruby Genseki Route 5 Pokémon Center Map: 49 X: 18523.30000 Y: 0.00000 Z: 16331.50000 Ruby Genseki Route 5 Lush Jungle Map: 49 X: 21419.00000 Y: 0.00000 Z: 12238.00000 Ruby Genseki Royal Avenue Pokémon Center Map: 49 X: 23657.00000 Y: 0.00000 Z: 24250.00000 Ruby Genseki Royal Avenue Battle Royal Dome Map: 49 X: 25242.90000 Y: 0.00000 Z: 21598.06000 Ruby Genseki Route 7 Map: 49 X: 28202.00000 Y: 0.00000 Z: 17408.00000 Ruby Genseki Route 8 Map: 49 X: 18486.57000 Y: 0.00000 Z: 10386.39000 Ruby Genseki Route 9 Map: 49 X: 11662.10000 Y: 0.00000 Z: 39963.90000 Ruby Genseki Konikoni City Map: 49 X: 9274.00000 Y: 0.00000 Z: 36830.00000 Ruby Genseki Ruins of Life Map: 50 X: 1911.44400 Y: 0.00000 Z: 1348.00000 Ruby Genseki Hano Grand Resort Map: 49 X: 25156.00000 Y: 0.00000 Z: 30505.00000 Ruby Genseki ULA'ULA Image Map Coordinates Comments Credits Malie City Map: 97 X: 25782.30000 Y: 0.00000 Z: 18065.57000 @Ruby Genseki Mount Hokulani Map: 103 X: 4472.10000 Y: 0.00000 Z: 3077.18800 Ruby Genseki Route 12 Map: 97 X: 31306.50000 Y: 0.00000 Z: 28674.95000 Ruby Genseki Tapu Village Map: 97 X: 12974.91000 Y: 0.00000 Z: 35026.52000 Ruby Genseki Ruins of Abundance Map: 105 X: 1898.42400 Y: 0.00000 Z: 1342.61300 Ruby Genseki Route 16 Map: 97 X: 5835.00000 Y: 0.00000 Z: 24174.50000 Ruby Genseki Lake of the Sunne/Moone Map: 101 X: 6157.06900 Y: 0.00000 Z: 1612.61100 Technically the entrance, outside of the lake. Whichever one you access, depends on: 1. What game you're playing 2. whether you "crossed the portal" Ruby Genseki Po Town Map: 97 X: 9799.90000 Y: 0.00000 Z: 9905.20000 Ruby Genseki Mount Lanakila Map: 119 X: 6702.00000 Y: 0.00000 Z: 10079.00000 Elite Four gate doesn't check your Trial progress, if warped to here. Ruby Genseki PONI Image Map Coordinates Comments Credits Seafolk Village Map: 168 X: 16024.92000 Y: 0.00000 Z: 17538.70000 @Ruby Genseki Exeggutor Island Map: 185 X: 3764.69100 Y: 0.00000 Z: 7424.45200 Ruby Genseki Ruins of Hope Map: 180 X: 2423.43100 Y: 0.00000 Z: 1251.30000 Ruby Genseki Vast Poni Canyon Map: 168 X: 24716.60000 Y: 0.00000 Z: 14276.30000 Ruby Genseki Altar of the Sunne/Moone Map: 175 X: 2302.09400 Y: 0.00000 Z: 4296.94400 Once again, technically an entrance, so access to whichever, is based on criteria mentioned above at the Lake. Ruby Genseki Poni Meadow Map: 168 X: 31680.90000 Y: 0.00000 Z: 11500.87000 Ruby Genseki Battle Tree Map: 168 X: 25549.25000 Y: 0.00000 Z: 3737.76900 Ruby Genseki AETHER PARADISE Image Map Coordinates Comments Credits Aether Paradise Map: 196 X: 6596.75700 Y: 0.00000 Z: 11714.80000 @Ruby Genseki Limited Access Image Map Coordinates Comments Credits Lusamine's Cryo Chamber Map: 208 X: 2188.56000 Y: 1.00000 Z: 1915.76800 @Ruby Genseki Abandoned Thrifty Megamart (Acerola's Trial) Map: 132 X: 1720.41700 Y: 1.00000 Z: 1472.11200 This version has access to Mimikyu's room @Ruby Genseki Mimikyu's Room Map: 133 X: 925.01460 Y: 0.00000 Z: 825.41140 @Ruby Genseki Ultra Space Map: 211 X: 2050.87400 Y: 0.00000 Z: 6355.98400 @theSLAYER Iki Town (Hau's Ceremonial Battle) Map: 1 X: 16910.58000 Y: 0.00000 Z: 11564.29000 Ruby Genseki Iki Town (Champion Party) Map: 2 X: 16974.28000 Y: 0.00000 Z: 11512.06000 Ruby Genseki Unused Maps Image Map Coordinates Comments Credits Unused Garage Map: 16 X: 18953.10000 Y: 0.00000 Z: 10722.50000 Same Map ID as Mother's Room Also holds a second surfboard. @Ruby Genseki Unused Bathroom Map: 16 X: 10538.05000 Y: 0.00000 Z: 10429.66000 @Lady Ariel @Ruby Genseki Unused Toilet Unused Toilet Map: 16 X: 27427.50000 Y: 0.00000 Z: 2074.60300 Lady Ariel Ruby Genseki
  2. 2 points
    6th and 7th Generation Wonder Card Map Mystery Gift Data WCxFULL Offset WCx Offset Gen 6 Gen 7 0x00-0x03 - Bit 0 - Y Bit 1 - X Bit 2 - AS Bit 3 - OR Bit 0 - S Bit 1 - M Bit 2 - US Bit 3 - UM 0x04-0x01FD - Redemption Text 0x01FE - 0x01 - Green Background 0x01 - Halo Animation 0x01FF - Allowed Languages 0x00 - Any Language Otherwise Language ID 0x200 - Once Per Week Bit 0 - Multiple WCs 0x201 - Unused? SubID 0x0202-0x0203 - Checksum 0x0204 - Unused? Set Count 0x205 - Always 0x46 Rarity Weight 0x206-0x207 - Always 0x4646 0x208-0x209 0x00-0x01 Card ID 0x20A-0x253 0x02-0x4B Card Title 0x254-0x257 0x4C-0x4F Card Reception Date YYYYMMDD Card Redemption Date YYMMDD 0x258 0x50 Card Location 0x259 0x51 Card Type 0x0 - Pokemon 0x1 - Item Card Type 0x0 - Pokemon 0x1 - Item 0x3 - BP 0x25A 0x52 Statuses Bit 0 - Only Once Bit 1 - Used Statuses Bit 0 - Only Once Bit 1 - Used Bit 2 - Once per Day 0x25B 0x53 Animation Background Color 0x0 - Blue 0x1 - Green (0x53 offset only) Card Background Color 0x0 - Blue 0x1- Purple 0x2 - Gold 0x25C-0x26F 0x54-0x67 Unknown/Unused 0x26E - Always 0xFF Pokémon Cards WCxFULL Offset WCx Offset Gen 6 Gen 7 0x270-0x271 0x68-0x69 Trainer ID 0x272-0x273 0x6A-0x6B Secret ID 0x274 0x6C Game of Origin 0x0 - Receiver's Game 0x274-0x277 0x6D-0x70 Unused 0x278-0x27B 0x71-0x73 Encryption Constant 0x0 - Randomly Generated 0x27C-0x27D 0x74-0x75 Ribbons See Ribbon Data Below 0x27E-0x27F 0x76-0x77 PokéBall Caught In 0x280-0x281 0x78-0x79 Held Item 0x282-0x283 0x7A-0x7B Move #1 0x284-0x285 0x7C-0x7D Move #2 0x286-0x287 0x7E-0x7F Move #3 0x288-0x289 0x80-0x81 Move #4 0x28A-0x28B 0x82-0x83 PokéDex Number 0x28C 0x84 Form Index 0x28D 0x85 Language 0x0 - Receiver's Language Otherwise Language ID 0x28E-0x2A7 0x86-0x9F Pokémon Nickname No terminator if no nickname 0x2A8 0xA0 Nature 0xFF - Random 0x2A9 0xA1 Pokémon Gender 0x0 - Male 0x1 - Female 0x2 - Genderless 0x3 - Random 0x2AA 0xA2 Pokémon Ability 0x0 - Ability 1 0x1 - Ability 2 0x2 - Hidden Ability 0x3 - Ability Random (No HA) 0x4 - Ability Random (All) 0x2AB 0xA3 Personality ID Generation Method 0x0 - Use specified PID 0x1 - Random can be shiny PID 0x2 - Random always shiny PID 0x3 - Random never shiny PID 0x2AC-0x2AD 0xA4-0xA5 Egg Met Location 0x2AE-0x2AF 0xA6-0xA7 Met Location 0x2B0 0xA8 Met Level 0x2B1-0x2B6 0xA9-0xAE Contest Stats Last byte is Sheen 0x2B7-0x2BC 0xAF-0xB4 IVs 0xFFFFFFFF - Random 0xFFFFFFFE - 3 31s 0xFFFFFFFD - 2 31s 0x2BD 0xB5 Trainer Gender 0x0 - Male 0x1 - Female 0x3 - Recipient's Gender 0x2BE-0x2D7 0xB6-0xCF Trainer Name All 00's - Recipient's Name 0x2D8 0xD0 Current Level 0x2D9 0xD1 Egg Flag 0x1 - Is Egg 0x2DA-0x2DB 0xD2-0xD3 Unused Bundled Item ID 0x2DC-0x2DF 0xD4-0xD7 Personality ID Almost Always 0xEE6B2802 Sometimes 0x00000000 0x2E0-0x2E1 0xD8-0xD9 Relearn Move 1 0x2E2-0x2E3 0xDA-0xDB Relearn Move 2 0x2E4-0x2E5 0xDC-0xDD Relearn Move 3 0x2E6-0x2E7 0xDE-0xDF Relearn Move 4 0x2E8-0x2E9 0xE0-0xE1 Trainer Memory Intensity Unused 0x2EA-0x2EB 0xE2-0xE3 Trainer Memory Line Unused 0x2EC-0x2ED 0xE4-0xE5 Trainer Memory TextVar 0xE5-0xEA: EVs 0x2EF-0x2F0 0xE6-0xE7 Trainer Memory Feeling 0x2F1-0x2F3 0xE8-0xEA Unused 0x2F4-0x30F 0xEB-0x107 Unused Unused Item Cards WCxFULL Offset WCx Offset Gen 6 Gen 7 0x270-0x271 0x68-0x69 Item ID Item 1 ID 0x272-0x273 0x6A-0x6B Unused Item 1 Quantity 0x274-0x275 0x6C-0x6D Unused Item 2 ID 0x276-0x277 0x6E-0x6F Unused Item 2 Quantity 0x278-0x279 0x70-0x71 Item Quantity Item 3 ID 0x27A-0x27B 0x72-0x73 Unused Item 3 Quantity 0x27C-0x27D 0x74-0x75 Unused Item 4 ID 0x27E-0x27F 0x76-0x77 Unused Item 4 Quantity 0x280-0x281 0x78-0x79 Unused Item 5 ID 0x282-0x283 0x7A-0x7B Unused Item 5 Quantity 0x284-0x285 0x7C-0x7D Unused Item 6 ID 0x286-0x287 0x7E-0x7F Unused Item 6 Quantity Ribbon Set Flag Value 0x74 0x75 0x01 Battle Champ Ribbon World Champ Ribbon 0x02 Regional Champ Ribbon Birthday Ribbon 0x04 National Champ Ribbon Special Ribbon 0x08 Country Ribbon Souvenir Ribbon 0x10 National Ribbon Wishing Ribbon 0x20 Earth Ribbon Classic Ribbon 0x40 World Ribbon Premier Ribbon 0x80 Event Ribbon Empty
  3. 1 point
    banner.bin and banner_s.bin are both found in the /FONT/ folder. They contain data for the dungeon title font. File Structure The file uses SIR0 headers to store its pointers. General SIR0 details can be found in the main SIR0 documentation. The sections below will cover only banner.bin-specific blocks of data. Name Offset Size (Per Element) # of Elements Description SIR0 Header 0x00 16 Bytes 1 Details in the SIR0 documentation Glyph Textures Pointed by Glyph Metadata Varies Specified by Content Header Each element is read nibble-by-nibble to assemble the glyph. Glyph Metadata Pointed by Content Header 8 Bytes Specified by Content Header Each element contains a pointer to the glyph texture, the letter it represents, and how many pixels wide the letter is. Content Header Pointed by SIR0 Header 12 Bytes 1 Contains the pointer to Glyph Metadata, and the number of elements in that data block. Pointer Offsets List Pointed by SIR0 Header 1 Byte Varies Details in the SIR0 documentation SIR0 Padding After Pointer Offsets List Varies --- Details in the SIR0 documentation Content Header 3 Sections containing 4 bytes each: AA AA AA AA BB BB BB BB CC CC CC CC A. Pointer to the start of the Glyph Metadata block. Little-Endian. B. Pointer to the number of elements in the Glyph Metadata block. Little-Endian. C. Unknown. Glyph Metadata This is an array of elements, each 8 bytes. Contains 3 sections: AA AA AA AA BB BB CC CC A. Pointer to this element's texture data in the Glyph Textures block. Little-Endian. B. The letter that the glyph represents. Little-Endian. The encoding varies by language, which is covered in the strings documentation. C. The number of pixels to move the cursor to the right, when drawing the text in-game. Little-Endian. Appears to be signed. Glyph Textures Individual elements in the Glyph Textures block have a variable length. Data is read nibble-by-nibble: First, the high bit of the nibble is checked. If it is 1, then the game will read the next nibble as pixel data and draw it N times. N is the other 3 bits of the first nibble. If it is 0, then the game will read the next N nibbles as pixel data and draw them in that order. N is the other 3 bits of the first nibble. The game draws pixels in order of left to right, top to bottom. It moves on to the next row when 24 pixels have been drawn, and ends the parsing when 24 rows have been drawn. Parsing For convenience, the following python code is provided below to parse these files: import sys import os import re import shutil import math import struct import glob from PIL import Image GLYPH_SIZE_D = 24 PALETTE_MAP = [0,8,24,41,57,74,90,107,123,140,156,173,189,206,214,231] def ReadNextNib(reader, next_nibbles): if len(next_nibbles) > 0: return next_nibbles.pop() byte = int.from_bytes(reader.read(1), 'little') next_nibbles.append(byte & 15) return byte >> 4 def ExportDChar(reader, char_val): pixels = [] next_nibbles = [] while len(pixels) < GLYPH_SIZE_D * GLYPH_SIZE_D: control_nib = ReadNextNib(reader, next_nibbles) draw_repeat = control_nib >> 3 draw_amount = control_nib & 7 if draw_repeat == 1: pixel_nib = ReadNextNib(reader, next_nibbles) pixel_val = PALETTE_MAP[pixel_nib] for ii in range(draw_amount): pixels.append(pixel_val) else: for ii in range(draw_amount): pixel_nib = ReadNextNib(reader, next_nibbles) pixel_val = PALETTE_MAP[pixel_nib] pixels.append(pixel_val) return_img = Image.new('RGBA', (GLYPH_SIZE_D, GLYPH_SIZE_D), (0, 0, 0, 0)) datas = [(0, 0, 0, 0)] * (GLYPH_SIZE_D * GLYPH_SIZE_D) for yy in range(GLYPH_SIZE_D): for xx in range(GLYPH_SIZE_D): pixel_idx = yy * GLYPH_SIZE_D + xx if pixels[pixel_idx] > 0: datas[pixel_idx] = (255,255,255,pixels[pixel_idx]) return_img.putdata(datas) return return_img def ReadChars(reader, amt): return_imgs = [] for ii in range(amt): glyph_ptr = int.from_bytes(reader.read(4), 'little') glyph_val = int.from_bytes(reader.read(2), 'little') advance = int.from_bytes(reader.read(2), 'little') cur_ptr = reader.tell() reader.seek(glyph_ptr) return_img = ExportDChar(reader, glyph_val) return_imgs.append((return_img, glyph_val, advance)) reader.seek(cur_ptr) return return_imgs def ReadFont(input_file): output_parent, basename = os.path.split(input_file) dir, _ = os.path.splitext(basename) output_dir = os.path.join(output_parent, dir) if not os.path.exists(output_dir): os.mkdir(output_dir) with open(input_file, "rb") as reader: ##Read SIR0 Header: ptr to font header reader.seek(4) font_ptr = int.from_bytes(reader.read(4),'little') ##Read font header: ptr to charmap, amount of chars reader.seek(font_ptr) list_ptr = int.from_bytes(reader.read(4),'little') char_amt = int.from_bytes(reader.read(4),'little') _ = int.from_bytes(reader.read(4), 'little')#don't know what this is reader.seek(list_ptr) imgs = ReadChars(reader, char_amt, mode) for idx, img_pair in enumerate(imgs): img = img_pair[0] code = img_pair[1] advance = img_pair[2] if advance > 0: img = img.crop((0,0,advance,GLYPH_SIZE_D)) img.save(os.path.join(output_dir, str(code) + '.png'))
  4. 1 point
    Background These games do not save the wonder card in their saves, however some details are left behind, in the form of the Wonder Card Records Album (or Gift Records Album). Findings may be incomplete, until more events gets released. Save Offsets Starts at 0x45600, taking up every 0x140 Save Offset (First Slot) Data Offset (from 0x0) Gen 7 0x45600 to 0x45604 0x000 to 0x004 Epoch Time code of Event received 0x45608 to 0x45609 0x008 to 0x009 Wonder Card ID 0x4560A 0x00A Gift Title/Wonder Card Type (as listed below) 0x4560C 0x00C Gift Type 0x01 are for Pokémon type and 0x02 are for Item type. 0x4560D 0x00D Number of kinds of Items, max 06 (for Item-Type gift only) 0x4570C to 0x4570D 0x10C to 0x10D Species Value for Pokémon Item ID 1 for Items only 0x4570E to 0x4570F 0x10E to 0x10F Amount of Item ID 1, for Item-Type gift only 0x45710 to 0x45724 0x110 to 0x124 Item IDs and Amounts (2 byte of Item ID, 2 byte for amount, repeat) 0x45710 to 0x45711 0x110 to 0x111 Move 1 ID, for Pokémon-Type Gift. 0x45714 to 0x45715 0x114 to 0x115 Move 2 ID, for Pokémon-Type Gift. 0x45718 to 0x45719 0x118 to 0x119 Move 3 ID, for Pokémon-Type Gift. 0x4571C to 0x4571D 0x11C to 0x11D Move 4 ID, for Pokémon-Type Gift. 0x45720 to 0x45739 0x120 to 0x139 Original Trainer (used for Pokémon-Type Gift) (follows trainer name if it's unset) 0x4573A 0x13A Language tag assigned upon being received. Gift Title/Wonder Card Type ID Titles ripped from Game Text Example (based on modifying Counterattack Mewtwo) 0 [VAR PKNAME(0000)] Gift Mewtwo Gift 1 [VAR ITEM2(0008)] Gift None Gift Chesto Berry Gift (modified to item-type) 2 Item Set Gift 3 [VAR 0104(0001)] [VAR PKNAME(0000)] Gift Genetic Pokémon Mewtwo Gift 4 Mythical Pokémon [VAR PKNAME(0000)] Gift Mythical Pokémon Mewtwo Gift 5 [VAR TRNAME(0003)]’s [VAR PKNAME(0000)] Gift はかせ's Mewtwo Gift 6 Shiny [VAR PKNAME(0000)] Gift Shiny Mewtwo Gift 7 [VAR PKNAME(0000)] ([VAR 01CA(0002)]) Gift Mewtwo () Gift * (12) Gift (modified to item-type) 8 [VAR 01CA(0002)] Gift Gift 12 Gift (modified to item-type) 9 Hidden Ability [VAR PKNAME(0000)] Gift Hidden Ability Mewtwo Gift 10 [VAR MOVE(0004)] [VAR PKNAME(0000)] Gift Psychic Mewtwo Gift 11 [VAR PKNAME(0000)] with [VAR MOVE(0005)] Gift Mewtwo with Shadow Ball Gift 12 [VAR PKNAME(0000)] with [VAR MOVE(0006)] Gift Mewtwo with Barrier Gift 13 [VAR PKNAME(0000)] with [VAR MOVE(0007)] Gift Mewtwo with Calm Mind Gift 14 [VAR PKNAME(0000)] & [VAR ITEM2(0009)] Gift Mewtwo & None Gift * & None Gift (modified to item-type) 15 Downloadable Version Bonus 16 Special Pack Purchase Bonus 17 Store Purchase Bonus 18 Strategy Guide Purchase Bonus 19 Purchase Bonus 20 Happy Birthday! 21 Virtual Console Bonus 22 Pokémon Trainer Club Gift 23 Pokémon Global Link Gift 24 Pokémon Bank Gift Note: The * appears to be based on total amount of records in the album. I've seen the number change when I add or remove records. If you have 6 records, it'll be 6 & None Gift Additional Notes Can't get WC type 14 to function properly. Keep getting "Mew & None Gift" (Mew intended, None unintended). When I swap past an item entry, the None get's updated to the third item. Maybe this type is a remnant of Gen 8's system? WC type 10 seems to work as per normal, however can't get WC type 11 to 13 to function, even after various tests. I have concluded that it is possibly leftover/unused, as those 3 entries were phrased different from WC type 10, on top of the "not working" issue. Either that, or there's a byte that controls the amount of moves a Pokemon has, and I'm clearly missing it., and so are the other 3! Images: Big thanks to @wo0ts for the various contributions for gift records!
  5. 1 point
    Pokemon Temp Data Offset Type Description Before Generation 0x0 u64 Encryption Constant If = 0xFFFFFFFF FFFFFFFF, random u32 0x8 u32 PID If = 0xFFFFFFFF, random 0xC u32 PID Type 1: Anti-Shiny 2: Forced Shiny 3: Random 0x10 u64 OT TID/SID If = 0xFFFFFFFF FFFFFFFF, random u32 0x18 u16 Species ID 0x1A u16 Form ID If = 0xFF, random according to personal info 0x1C u16 Level 0x1E u16 Gender If = 0xFF, random(252) according to personal info 0x20 u16 Nature If = 0xFFFF, random(25) 0x22 u8 Ability Number If = 0xFF, random 1/2; If = 0xFE random 1/2/H. 0x23 u8 PID Roll Count For PID type = 3 (random), related to shiny chance 0x24 u16 HP IV If = 0xFFFF, random(32) 0x26 u16 Attack IV If = 0xFFFF, random(32) 0x28 u16 Defense IV If = 0xFFFF, random(32) 0x2A u16 SpA IV If = 0xFFFF, random(32) 0x2C u16 SpD IV If = 0xFFFF, random(32) 0x2E u16 Speed IV If = 0xFFFF, random(32) 0x30 u16 Friendship If = 0xFFFF, set default friendship 0x34 u8 Perfect IV Count If > 0, clear all IV locks SOS Status Data RAM location: 0x30038E20 (USUM v1.2); 0x30038C44 (SM v1.2) Offset Type Description 0x10 u32 [624] SFMT RNG Table 0x9D0 u16 SFMT RNG Table Index 0x9D8 u8 Adrenaline Orb Used 0x9D9 u8 Chain Length 0x9DA u8 Ally Identifier? 0x9DB u8 Last SOS Call Succeeded Berry Pile Data RAM location: 0x32DE3208 (USUM v1.2) Offset Type Description 0x25 u8 Bit flag for Crabrawler existence 0x26 u16 Crabrawler level 0x28 u16 [6] Regular random berry ID
  6. 1 point
    Pokemon Gold, Silver and Crystal introduced the concept of Shiny Pokemon, and in order to retain shininess of a Pokemon that was traded to Pokemon Red, Blue, Yellow, Green, Shininess was set to be determined by a Pokemon's Determinant Values (DVs). As such, this mechanic also allowed for Pokemon caught or received in Gen I with the correct DV combination to become shiny when traded to Gen II. Additionally, with the introduction of Generation I & II to the Virtual Console on the Nintendo 3DS, these shiny Pokemon can be transported up to Generation VII and remain shiny. Generation I's RNG - DV correlation has been analyzed, and it has been discovered that only certain Pokemon can be encountered legitimately shiny (ignoring using glitches), mainly: (1) received by in-game trade, (2) encountered by fishing, (3) stationary encounters, (4) gift (starters, Eevee, game corner, etc). Do note that confusion may arise, if a shiny Pokemon was hatched/caught in Gen II, and traded back to Gen I, before transported to Gen VII. (Even if hatched/caught in Gen II, it will say from Kanto if it was transferred from Gen I) The google sheet below shows the list of Pokemon relating to Gen I shiny legality, and other pages involving RNG-DV correlation based on encounter rate. Sources: Various Encounter Rates on Smogon @Collector Togami's Excel and collected data Pokemon Red and Blue DVs generation
  7. 1 point
  8. 1 point
    Communication with the GTS is done over regular HTTP with http://gamestats2.gs.nintendowifi.net/. The same protocol is used for all five Gen IV games. HTTP headers The games don't seem to care about these at all. The GTS sends back a bunch of boilerplate response headers, but the game happily accepts a response with only a Content-Length. Protocol All requests to the server are GET requests of the form page.asp?pid=pid followed by page.asp?pid=pid&hash=hash&data=data. The hash variable in the latter, is a hash of the string returned by the former, as described bellow. pid The pid is an unsigned 32-bit integer that appears to uniquely identify a game cartridge. Although this has not been confirmed entirely: Your PID is generated when you get your friendcode for the first time and is set to: friendcode & 0x7fffffff When you change the device and are forced to change your friendcode with it, your PID doesn't change but you get a new friendcode. Your new Friend Code appears to be set by appending a random byte (likely sent from Nintendo's servers) to the end of your PID. For example, nicholas's Soul Silver PID is 258303618 (0x8266650f)and his Friend Code is 4297 5503 3218 (0xf8266650f64) taking endianness into account. Challenge/response Before each "real" request, the game sends a request of the form page.asp?pid=pid and the server responds with a 32-byte challenge token. The game computes sha1("sAdeqWo3voLeC5r16DYv" + token) and uses that as the hash value which it sends to the server. The data parameter is encrypted, as explained further down. For 5th gen GTS, the hash is instead, generated by sha1("HZEdGCzcGGLvguqUEKQN" + token) That is, each request looks like the following: Game requests GET /pokemondpds/page.asp?pid=pid Server responds with token Game requests GET /pokemondpds/page.asp?pid=pid&hash=sha1(...)&data=data Server responds with payload Data The data sent to the server consists of a checksum, your pid, and a payload. The 5th gen GTS also adds the length of the payload, after the pid. In generation 5, the server must append to all its responses a footer generated by sha1("HZEdGCzcGGLvguqUEKQN"+urlsafe_base64(response)+"HZEdGCzcGGLvguqUEKQN"). Checksum The checksum is a 32-bit integer, computed by simply taking the sum of every byte of the pid and payload. It is the first four bytes of the data, xor-ed with 0x4a3b2c1d (0x2db842b2 for 5th gen) and packed in network byte order (big-endian). Payload The pid and payload are encrypted with a stream cipher in for the 4th gen protocol. This encryption algorithm, like others used in the game, uses a Linear Congruential Generator (not a very strong choice). The multiplicative constant is 0x45, and the additive constant is 0x1111. It appears that the game uses a signed dword to store the seed, which doesn't really matter; it shouldn't affect anything. (It means that the modulus is effectively 0x80000000.) GRNG[n+1] = (GRNG[n] * 0x45 + 0x1111) & 0x7fffffff The GRNG is seeded with the checksum, like so: GRNG[0] = checksum | (checksum << 16) The keystream is composed of the lower byte of the high word of successive GRNG values. keystream[n] = (GRNG[n] >> 16) & 0xff Xor the keystream with the plaintext to get the ciphertext. Xor the keystream with the ciphertext to get the plaintext. The entire data string is then encoded with urlsafe-base64. Conversation The first request the game makes is to /pokemondpds/worldexchange/info.asp. The server responds with 0x0001. Platinum, Heart Gold, and Soul Silver will then make a request to /pokemondpds/common/setProfile.asp. The server responds with eight NULs (0x00000000 0x00000000). After the above step(s) or performing any of the tasks below other than searching, the game makes a request to /pokemondpds/worldexchange/result.asp. If the game has had a Pokémon sent to it via a trade, the server responds with the entire encrypted Pokémon save struct. Otherwise, if there is a Pokémon deposited in the GTS, it responds with 0x0004; if not, it responds with 0x0005. Receiving a traded Pokémon If the game receives a Pokémon from a successful trade as a response from result.asp, it next requests /pokemondpds/worldexchange/delete.asp. The server responds with 0x0001. A note on sendpkm.py After doing the above, some Platinum, Heart Gold, and Soul Silver games will report a communication error and dump the player back to the title screen. The Pokémon is still successfully received. At least one person with HG/SS has received a Pokémon from a fake server without getting the error, and Diamond/Pearl have never been reported to have the problem. Depositing a Pokémon Pokémon are offered on the GTS by requesting /pokemondpds/worldexchange/post.asp. If the Pokémon is rejected by the server, the response is 0x000c; otherwise, if the deposit is successful, 0x0001. Note that in generation 5, some tests are performed on a pokémon before it is deposited. If the pokémon is rejected at this stage (a problem was detected or one of the OT name or nickname is inappropriate) it is NOT sent to the GTS and error 13267 is displayed. The game then saves. After the save is complete, it issues a request to /pokemondpds/worldexchange/post_finish.asp. In generation 5, the sent data is 444 bytes long as follows: Offset Contents 0x00-0x03 Checksum (sum of all bytes xor 0x2db842b2) 0x04-0x07 pid 0x08-0x09 Data length (minus the 12 bytes of header) 0x0A-0x0B Unknown / Zero 0x0C-0xE7 Encrypted party pokemon data structure 0xE8-0xF7 Unknown / Zero 0xF8-0xF9 Nat. Dex ID 0xFA Gender 0xFB Level 0xFC-0xFD Requested Nat. Dex ID 0xFE Requested Gender 0xFF Requested Min Level 0x100 Requested Max Level 0x101 Unknown / Always 0 0x102 Trainer gender 0x103 Trainer nature 0x104-0x107 Always 0? 0x108-0x117 Timestamp placeholder, always 0 (set by server) 0x118-0x119 Trainer ID 0x11A-0x11B Secret ID 0x11C-0x12B OT Name (Unicode, must end with 0xFFFF) 0x12C Country 0x12D City 0x12E Trainer class/sprite 0x12F Is Exchanged Flag (Always 0) 0x130 Game version 0x131 Region/language 0x132 Unknown (0 to 8) 0x133 Unlocked floors in Unity Tower 0x134-0x137 Unused 0x138-0x1B7 Signature of pokémon struct 0x1B8-0x1BB Terminator (0x80000000) In generation 4, the sent data is 296 bytes long and as follows: Offset Contents 0x00-0x04 PID 0x04-0xEF Encrypted party pokemon data structure 0xF0-0xF1 Nat. Dex ID 0xF2 Gender 0xF3 Level 0xF4-Fx05 Requested Nat. Dex ID 0xF6 Requested Gender 0xF7 Requested Min Level 0xF8 Requested Max Level 0x09 Always 0 0x0A Trainer's Gender 0xF9-0x109 Zero / Timestamps and PID placeholders 0x110-0x11F Trainer's Name 0x120-0x121 Trainer's OT ID 0x122 Country 0x123 City 0x124 Trainer's Sprite 0x125 Is Exchanged Flag 0x126 Game Version 0x127 Language Retrieving the deposited Pokémon Checking on the deposited Pokémon is apparently done by /pokemondpds/worldexchange/get.asp. The response appears to be a Pokémon save struct. Retrieving the deposited Pokémon is done by /pokemondpds/worldexchange/return.asp. The response is merely 0x0001; the actual Pokémon data is taken from the get.asp request. Searching Searching is done through /pokemondpds/worldexchange/search.asp. The sent data is either 15 or 16 bytes long. The server responds with a full 292-byte Pokémon struct for each result. If there are n results, the response will be 292 * n bytes long. If there are no results, the server will give an empty response (0 bytes). Pokémon struct The Pokémon data for the Generation IV GTS is 292 bytes—56 bytes larger than a party Pokémon struct. The extra 56 bytes are GTS-specific data, such as the player's name & country, and what Pokémon they are requesting. In Generation IV, the trainer name is encoded with the Pokémon character table, while in Generation V, the trainer name is Unicode encoded. They are as follows: Generation IV Encrypted Bytes Offset Contents 0x00-0x01 Nat. Dex ID 0x02 Gender 0x03 Level 0x04-0x05 Requested Nat. Dex ID 0x06 Requested Gender 0x07 Requested Min Level 0x08 Requested Max Level 0x09 Unknown - always 0? 0x0A Trainer's Gender 0x0B Unknown - always 0? 0x0C-0x13 Timestamp - deposited time 0x14-0x1B Timestamp - time traded? 0x1C-0x1F PID 0x20-0x2F Trainer's Name 0x30-0x31 Trainer's OT ID 0x32 Country 0x33 City 0x34 Trainer's Sprite 0x35 Is Exchanged Flag 0x36 Game Version 0x37 Language The data for the Generation V GTS is 296 bytes (16 bytes of padding in between the encrypted party data and the GTS data) and adds the trainer's secret ID, an additional two unknown bytes at the end, and shifts the position of the trainer name to after the trainer and secret IDs. Generation V Encrypted Bytes Offset Contents 0x00-0x01 Nat. Dex ID 0x02 Gender 0x03 Level 0x04-0x05 Requested Nat. Dex ID 0x06 Requested Gender 0x07 Requested Min Level 0x08 Requested Max Level 0x09 Unknown - always 0? 0x0A Trainer's Gender 0x0B Unknown - always 0? 0x0C-0x13 Timestamp - deposited time 0x14-0x1B Timestamp - time traded? 0x1C-0x1F PID 0x20-0x21 Trainer's OT ID 0x22-0x23 Trainer's Secret ID 0x24-0x33 Trainer's Name 0x34 Country 0x35 City 0x36 Trainer's Sprite 0x37 Is Exchanged Flag 0x38 Game Version 0x39 Language 0x3A-0x3B Unknown Pokémon Gender Value Type 0x01 Male 0x02 Female 0x03 Either/neither Trainer Gender Value Type 0x00 Male 0x01 Female Timestamp Format The timestamps are set by the server, and are always PST (UTC-8). Offset Contents 0x00-0x01 Year 0x02 Month 0x03 Day 0x04 Hour 0x05 Minute 0x06 Second 0x07 Unknown - always 0? Trainer Class (for generation 5) Value Class 0x00 Youngster 0x01 Ace Trainer 0x02 Pokémon Ranger 0x03 Pokémon Breeder 0x04 Researcher 0x05 Hiker 0x06 Skinhead 0x07 Day-Care student 0x08 Lass 0x09 Ace Trainer (female) 0x0a Pokémon Ranger (female) 0x0b Pokémon Breeder (female) 0x0c Researcher (female) 0x0d Parasol Lady 0x0e Nurse 0x0f Day-Care student (female) Game Version Value Version 0x0A Diamond 0x0B Pearl 0x0C Platinum 0x07 HeartGold 0x08 SoulSilver 0x15 Black 0x14 White
  9. 1 point
    85h 85h Values 85h is an offset in the data structure of 4th Generation Pokémon, and shows how a Pokémon was encountered. Currently 85h has no relevance to gameplay, but in certain cases it can be used to determine the Legality of a Pokémon. 85h List 00 - Egg/Pal Park/Event 02 - Tall Grass/Honey Tree 04 - Dialga/Palkia 05 - Cave/Hall of Origin 07 - Caught in the Water 09 - Caught in Buildings 0A - Great Marsh/Safari Zone 0C- Starter Pokemon/Fossils (D/P) 18 - Starter Pokemon/Bebe's Eevee (Platinum) 17- Giratina (Origin)(Platinum) ??- Giratina (Another)(Platinum) ??- Fossils (Platinum)- 18? ??- Honey Tree (Platinum)- Pretty sure its 02 but not confirmed. ??- Dialga/Palkia (Platinum)
  10. 1 point
    5th Generation Wonder Card Map Gift Data Offset Description 0x00-0x01 Trainer ID Number, Item Number, Power Type 0x02-0x03 Secret ID Number 0x04 Hometown 00 - Game Received In 01 - Hoenn(Sapphire) Values follow in standard order through 21 0x05-0x07 Unused 0x08-0x0B PID Unset = 00000000 0x0C Primary Ribbons Ribbon data available below. 0x0D Secondary Ribbons Ribbon data available below. 0x0E PokéBall 0x0F Unused 0x10-0x11 Held Item 0x12-0x13 Move ID #1 0x14-0x15 Move ID #2 0x16-0x17 Move ID #3 0x18-0x19 Move ID #4 0x1A-0x1B PokéDex Number 0x1C Unused 0x1D Language 00 for Game Received In 0x1E-0x33 Pokémon Nickname (0x32-0x33 FF FF terminated) If no nickname, all FF. 0x34 Nature FF - Unset 0x35 Pokémon Gender 00 - Male 01 - Female 02 - Random 0x36 Pokémon Ability 00 - Ability 1 01 - Ability 2 02 - Dream World Ability 03 - RND(Abil1, Abil2) 04 - RND(Abil1, Abil2, AbilDW) 0x37 Shiny Toggle 00 - Not Shiny 01 - Allow Shiny 02 - Generate Shiny PID Shows Shiny Pokemon on Card 0x38-0x39 Egg Met Location 0x3A-0x3B Met Location of Pokémon 0x3C Level - unused(?) 0x3D-0x42 Contest Stats Last byte is Sheen 0x43-0x48 IVs FFs for unset IVs 0x49 Unused 0x4A-0x59 OT Name 0x5A OT Gender 00 - Male 01 - Female 03 - Recipient's Gender 0x5B Level(random if set to 0) 0x5C Egg Flag 00 - Is Not Egg 01 - Is Egg 0x5D-0x5F Unused Card Data Offset Description 0x60-0xA9 Card Title 0xAA-0xAB Unknown 0xAC-0xAF Date Card Received 0xB0-0xB1 Card ID 0xB2 "Card From" Location 0xB3 Card Type 01 - Pokémon [Blue] 02 - (Key) Item [Pink] 03 - Power [Yellow] 0xB4 Gift Status: Used / Unused 00 - Repeatable gift 01 - Unused 03 - Used 0xB5-0xCB Unused Ribbon Sets These are the values for each ribbon byte: Flag Value 0x0C 0x0D 0x01 Country Ribbon Special Ribbon 0x02 National Ribbon Memorial Ribbon 0x04 Earth Ribbon Wish Ribbon 0x08 World Ribbon Battle Champ Ribbon 0x10 Classic Ribbon Regional Champ Ribbon 0x20 Premiere Ribbon National Champ Ribbon 0x40 Event Ribbon World Champ Ribbon 0x80 Birthday Ribbon No Ribbon(Empty) First Appearance in the Memory The Wonder Cards do appear in the active memory while the game is running, however there are certain things that are set in addition to the card data in addition to it being in two locations. The cards appear in the region of 0x0226BE30-0x0226C87F in Black, and 0x0226BE50-0x0226C89F for White. Card data is unencrypted when viewing, but encrypted at all other times. Each card is separated by 220 bytes of data. Memory Offsets of each Card when viewing, including the leading 4 bytes: Card # Offset (Black) Offset (White) 1 0x0226BE30 0x0226BE50 2 0x0226BF0C 0x0226BF2C 3 0x0226BFE8 0x0226C008 4 0x0226C0C8 0x0226C0E8 5 0x0226C1A4 0x0226C1C4 6 0x0226C280 0x0226C2A0 7 0x0226C35C 0x0226C37C 8 0x0226C438 0x0226C458 9 0x0226C514 0x0226C534 10 0x0226C5F0 0x0226C610 11 0x0226C6CC 0x0226C6EC 12 0x0226C7A8 0x0226C7C8 The card is preceded by 4 bytes, in which the first is 1 to indicate that there is a card present in that slot, being 0 when a card is not present. Meaning Data Card Present 0x00000001 No Card Present 0x00000000 The card data is then present, byte for byte for the entire 204 bytes. After the card data, there are 4 bytes (pointer?). Card # Trash Value (Black) Trash Value (White) 1 0x0226CAA4 0x0226CAC4 2 0x0226CD88 0x0226CDA8 3 0x0226D06C 0x0226D08C 4 0x0226D350 0x0226D370 5 0x0226D388 0x0226D3A8 6 0x0226D3C0 0x0226D3E0 7 0x0226D3F8 0x0226D418 8 0x0226D430 0x0226D450 9 0x0226D468 0x0226D488 10 0x0226D4A0 0x0226D4C0 11 0x0226D4D8 0x0226D4F8 12 0x02270248 0x02270268 There are then 8 unused bytes (all 00), leading up to the next card. Second Appearance in the Memory The second appearance of the unencrypted card data while viewing is varied based on the number of cards currently on the save. Since it has not been tested whether or not active/inactive gifts may change the locations, trash all used cards before using any memory codes. Cards and the surrounding data follow the first appearance's format. Kaphotics' Test Card 1 Memory Location of N Cards [Stop at (N) cards]: Black: 02277F20(1 card) +58C(2c) +590(3) +58C(4) +2E8(5) +2E4(6) +2E8(7) +2E4(8) [9-12 still testing] White: 02277F40(1 card) +58C(2c) +590(3) +58C(4) +2E8(5) +2E4(6) +2E8(7) +2E4(8) [9-12 still testing] Card 2 = Card 1 Memory + 420 Card n = Card 1 Memory + 5020 + (n-3)*4C34 || Number of cards: 13>n>2 For other DS's (with different MAC addresses) the 1st location is the same but the rest follow different additive constants between cards. The second appearances will appear in the block range of 0x02270000-0x022AFFFF.
  • Newsletter

    Want to keep up to date with all our latest news and information?
    Sign Up
  • Create New...