Skip to content

Instantly share code, notes, and snippets.

@zaksabeast
zaksabeast / non-shiny-wishmaker-spreads.js
Created July 11, 2018 05:49
Better IVs (non-shiny) Wishmaker spreads, for use with the wishmaker-calc
// Someday the spaces in front of the strings should be removed
export const spreads = {
'7344': {
pid: ' 8DE8A80C',
nature: ' Adamant',
ivs: ' HP: 28, AT: 28, DF: 27, SA: 19, SD: 21, SP: 31'
},
'035A': {
pid: ' 72A33E77',
nature: ' Impish',
@zaksabeast
zaksabeast / gen7-initial-seed-rng.md
Last active November 9, 2019 22:03
Gen 7 Initial Seed RNG

Gen 7 initial seed research

Initial seed process

The papertrail (in chronological order)

sub_3FCAD0 -> sub_367D90 (at 0x3FCBDC)
sub_367D90 -> sub_367F54 (at 0x367DA8)
sub_367F54 -> sub_280F04 (at 0x367FAC)
sub_280F04 -> sub_281E4C (at 0x280F10)
// Reading transfers from Dream Radar on b2/w2 saves:
// 1. Read the 32 bit value at 0x25E00
// 2. key = ((value * 0x5d588b65) + ((value * 0x6c078965) >> 32)) & 0xFFFFFFFF
// 3. xor the key with every 32 bit value from 0x7F010-0x7F094
// 4. The resulting numbers correspond to Dream Radar transfers - 0 means no Pokemon exists. Dream radar legends are associated with specific numbers (e.g. Dialga is 0x96436763)
const fs = require('fs');
// Check to ensure a save location is provided
if (process.argv.length < 3) {
@zaksabeast
zaksabeast / calculate-oras-seed.c
Last active November 23, 2021 21:38
Calculates an ORAS seed
#include <stdio.h>
#include <stdlib.h>
typedef uint64_t u64;
typedef uint32_t u32;
// Usage: ./calc 0x<save value> <epoch in milliseconds>
// saveValue is pulled from 0x8C71DB8 in v1.4. The value is the random number pulled 26 frames after pressing "A" to save
// epochTime is the current time in milliseconds
@zaksabeast
zaksabeast / swsh-watt-trader-inventory-order.txt
Created January 28, 2020 14:00
Sword and Shield Watt Trader Inventory Order
Watt trader inventory order:
- Timer Ball
- Sludge bomb
- Iron defense
- Focus blast
- Hurricane
- Leech life
- Luxury Ball
@zaksabeast
zaksabeast / swsh-cheats.txt
Created January 28, 2020 14:14
Sword and Shield Cheats
# Both Sword and Shield v1.1
[Shiny Square Raids (Hold R at den)]
04000000 0076fda4 540006c0
80000080
04000000 0076fda4 14000036
20000000
[Shiny Star Raids (Hold R at Den)]
04000000 0076ff04 54fff4a1
@zaksabeast
zaksabeast / pokemon-mystery-dungeon-dx-friend-password-documentation.md
Last active May 12, 2023 18:37
Pokemon Mystery Dungeon DX Friend Password Documentation

Pokemon Mystery Dungeon DX Friend Password Documentation

Almost all of this was done by reading the disassembly and no debugging tools, so some of this may change over time as more info is found.

This document primarily covers reading the password since creating a password is the exact same process, but in reverse.

Note: There are screenshots in the first comment of this gist which may be good to look at if you don't know much about the game.

Notable locations in the binary

@zaksabeast
zaksabeast / apollo-web-worker-comlink-example.js
Created April 27, 2020 23:50
Short gist to demonstrate orchestrating web workers with Apollo client and comlink
@zaksabeast
zaksabeast / decrypt-api-body.js
Last active February 20, 2024 13:18
Pokemon Home Mobile App API Documentation
const crypto = require('crypto');
const zlib = require('zlib');
const util = require('util');
const gunzip = util.promisify(zlib.gunzip);
const decrypt = (data, key, iv) => {
const decipher = crypto.createDecipheriv('aes-256-cbc', key, iv);
const decrypted = decipher.update(data);
return Buffer.concat([decrypted, decipher.final()]);
@zaksabeast
zaksabeast / wishmaker-seed-calculator.js
Created January 19, 2021 00:50
A heavily commented script to find Wishmaker Jirachi seeds
// This code is meant to act as documentation for calculating Wishmaker Jirachi seeds.
// As a result, it's not the most efficient code, but can hopefully serve as a guide for anyone interested in the mechanics.
//
// Admittedly, I wrote this fairly quickly, so it's not quite as clean as I'd like it either, and I haven't tested it too much.
// If you have any questions or updates, please leave them in the comments below.
//
// This code assumes some knowledge of Wishmaker, as well as a disabled RTC.
// ----------------------------------------
// Jirachi seed logic