From 083874bd4ede6972077a649dcd9ed993ad948417 Mon Sep 17 00:00:00 2001 From: Pablo Curiel Date: Sat, 19 Sep 2020 06:21:23 -0400 Subject: [PATCH] Fix unaligned reads from the gamecard secure storage area. Big thanks to Whovian for finding the bug and testing the change. --- source/gamecard.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/gamecard.c b/source/gamecard.c index 37077c7..7582e05 100644 --- a/source/gamecard.c +++ b/source/gamecard.c @@ -977,7 +977,7 @@ static bool gamecardReadStorageArea(void *out, u64 read_size, u64 offset, bool l memcpy(out_u8, g_gameCardReadBuf + data_start_offset, out_chunk_size); - success = (block_size > GAMECARD_READ_BUFFER_SIZE ? gamecardReadStorageArea(out_u8 + out_chunk_size, read_size - out_chunk_size, base_offset + out_chunk_size, false) : true); + success = (block_size > GAMECARD_READ_BUFFER_SIZE ? gamecardReadStorageArea(out_u8 + out_chunk_size, read_size - out_chunk_size, offset + out_chunk_size, false) : true); } end: