Skip to content

Instantly share code, notes, and snippets.

@RoxasShadow
Created July 28, 2012 11:35
Show Gist options
  • Save RoxasShadow/3192926 to your computer and use it in GitHub Desktop.
Save RoxasShadow/3192926 to your computer and use it in GitHub Desktop.
Pokémon viewer
class Pokemon
attr_accessor :pid, :checksum
def to_s
"PID: #{@pid}\nChecksum: #{@checksum}"
end
end
data = File.read ARGV[0]
pokemon = Pokemon.new
# http://projectpokemon.org/wiki/Pokemon_NDS_Structure#Unencrypted_bytes
pokemon.pid = data.unpack('<L').first
pokemon.checksum = data.unpack('<H').first
puts pokemon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment