Created
July 28, 2012 11:35
-
-
Save RoxasShadow/3192926 to your computer and use it in GitHub Desktop.
Pokémon viewer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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