From 0f07e85746b28fce387aa3814c1e0c85201d7581 Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Wed, 12 Oct 2022 19:03:02 +0100 Subject: [PATCH] Fix casting of CD sector EDC. --- src/ecc_cd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ecc_cd.c b/src/ecc_cd.c index 23b32c2..c18edab 100644 --- a/src/ecc_cd.c +++ b/src/ecc_cd.c @@ -98,7 +98,7 @@ bool aaruf_ecc_cd_is_suffix_correct(void* context, const uint8_t* sector) bool correctEccQ = aaruf_ecc_cd_check(context, sector, sector, 52, 43, 86, 88, sector, 0xC, 0x10, 0x81C + 0xAC); if(!correctEccQ) return false; - storedEdc = sector[0x810]; // TODO: Check casting + storedEdc = (sector[0x813] << 24) + (sector[0x812] << 16) + (sector[0x811] << 8) + sector[0x810]; edc = 0; size = 0x810; pos = 0; @@ -129,7 +129,7 @@ bool aaruf_ecc_cd_is_suffix_correct_mode2(void* context, const uint8_t* sector) bool correctEccQ = aaruf_ecc_cd_check(context, zeroaddress, sector, 52, 43, 86, 88, sector, 0, 0x10, 0x81C + 0xAC); if(!correctEccQ) return false; - storedEdc = sector[0x818]; // TODO: Check cast + storedEdc = (sector[0x81B] << 24) + (sector[0x81A] << 16) + (sector[0x819] << 8) + sector[0x818]; edc = 0; size = 0x808; pos = 0x10;