From 051ebad2f8bf48c1200f0ffbeeaa66b953e64fd9 Mon Sep 17 00:00:00 2001 From: Aurora Date: Sun, 16 Oct 2016 20:48:25 +0200 Subject: [PATCH] Update the uninstalling feature --- source/installer.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/source/installer.c b/source/installer.c index a32aa5f..e581645 100755 --- a/source/installer.c +++ b/source/installer.c @@ -276,8 +276,13 @@ static inline void uninstaller(void) { setupKeyslot0x11(NULL, true); getSector(keySector, true); - if(memcmp(keySector + AES_BLOCK_SIZE, key2s[1], AES_BLOCK_SIZE) != 0 && memcmp(keySector + AES_BLOCK_SIZE, key2s[2], AES_BLOCK_SIZE) != 0) - shutdown(1, "Error: the OTP hash or the NAND key sector\nare invalid"); + + u32 i; + for(i = 1; i < 5; i++) + if(memcmp(keySector + AES_BLOCK_SIZE, key2s[i], AES_BLOCK_SIZE) == 0) break; + + if(i == 5) shutdown(1, "Error: the OTP hash or the NAND key sector\nare invalid"); + generateSector(keySector, 2); } else memset32(keySector, 0, sizeof(keySector));