From 6ceeb199181d64031f4173cfbffa066f5b9796b8 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Sun, 10 Sep 2017 22:12:47 -0400 Subject: Added identifying hash to Pokémon data structure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The purpose of this hash is described in detail in pokemon.h. The hash is computed using an implementation of SHA-224. To allow the GBA sufficient time to compute this hash, a delay of 5 milliseconds was introduced on the GC side before reading a Pokémon. --- source/main.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'source/main.c') diff --git a/source/main.c b/source/main.c index 1355533..3806106 100644 --- a/source/main.c +++ b/source/main.c @@ -210,6 +210,8 @@ void* extractor(void* userdata) for (u32 i = 0; i < partyCount; i++) { + usleep(5000); + u32 rawdata[sizeof(struct PokemonIntermediate) / 4]; getMsgArr(rawdata, sizeof(struct PokemonIntermediate) / 4); @@ -221,6 +223,18 @@ void* extractor(void* userdata) char d_otName[22]; decodePokemonCharset(pki->otName, 7, d_otName, pki->language); + char d_key[57]; + sprintf( + d_key, + "%08lx%08lx%08lx%08lx%08lx%08lx%08lx", + pki->key[0], + pki->key[1], + pki->key[2], + pki->key[3], + pki->key[4], + pki->key[5], + pki->key[6]); + printf("Species: %d\n", __builtin_bswap16(pki->species)); printf("Nickname: %s\n", d_pokename); printf("OT: %s\n", d_otName); @@ -231,6 +245,7 @@ void* extractor(void* userdata) printf("Special Attack: %ld\n", __builtin_bswap32(pki->spAttack)); printf("Special Defense: %ld\n", __builtin_bswap32(pki->spDefense)); printf("Speed: %ld\n", __builtin_bswap32(pki->speed)); + printf("Key: %s\n", d_key); printf("\n"); } -- cgit 1.4.1