def get_decrypted_data(self): bs = [] offset = self.offset + POKEMON_TABLE["DATA"] for index in range(offset, offset + 48, 4): decrypted_values = self.decryption_key ^ savefile.value_at( index, 4) decrypted_bytes = decrypted_values.to_bytes(4, "little") bs.extend(decrypted_bytes) return bs
def get_checksum(self): return savefile.value_at(self.offset + POKEMON_TABLE["CHECKSUM"], 2)
def get_data_table(self): p_value = savefile.value_at( self.offset + POKEMON_TABLE["PERSONALITY_VALUE"], 4) order = DATA_ORDER_MAP[p_value % 24] return dict(zip(order, [0, 12, 24, 36]))
def get_decryption_key(self): p_value = savefile.value_at( self.offset + POKEMON_TABLE["PERSONALITY_VALUE"], 4) ot_id = savefile.value_at(self.offset + POKEMON_TABLE["OT_ID"], 4) return p_value ^ ot_id
def get_team_size(): return savefile.value_at( savefile.section_table["TEAM_AND_ITEMS"] + PARTY_TABLE["TEAM_SIZE"], 2)