From 0313b7bcc50dec023e0945075aca0192d8819c41 Mon Sep 17 00:00:00 2001 From: Daniel Seiller Date: Wed, 14 Aug 2019 17:56:59 +0200 Subject: [PATCH] Pick exploit sector starting from last sector --- src/mfoc.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/mfoc.c b/src/mfoc.c index 549b6c0..73571ca 100644 --- a/src/mfoc.c +++ b/src/mfoc.c @@ -933,9 +933,10 @@ int find_exploit_sector(mftag t) return -1; } for (i = 0; i < t.num_sectors; i++) { - if ((t.sectors[i].foundKeyA) || (t.sectors[i].foundKeyB)) { - fprintf(stdout, "\n\nUsing sector %02d as an exploit sector\n", i); - return i; + int s=(t.num_sectors-i)-1; + if ((t.sectors[s].foundKeyA) || (t.sectors[s].foundKeyB)) { + fprintf(stdout, "\n\nUsing sector %02d as an exploit sector\n", s); + return s; } } ERR("\n\nNo sector encrypted with the default key has been found, exiting..");