mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-19 13:00:42 -07:00
Changed max sector for AUTH to be executed only once and result cached in local variable
This commit is contained in:
parent
606c3ac0de
commit
a9c10c872e
1 changed files with 2 additions and 1 deletions
|
@ -478,6 +478,7 @@ void Mifare1ksim(uint16_t flags, uint8_t exitAfterNReads, uint8_t *uid, uint16_t
|
||||||
|
|
||||||
uint8_t cardWRBL = 0;
|
uint8_t cardWRBL = 0;
|
||||||
uint8_t cardAUTHSC = 0;
|
uint8_t cardAUTHSC = 0;
|
||||||
|
uint8_t cardMaxSEC = MifareMaxSector(flags);
|
||||||
uint8_t cardAUTHKEY = AUTHKEYNONE; // no authentication
|
uint8_t cardAUTHKEY = AUTHKEYNONE; // no authentication
|
||||||
uint32_t cardRr = 0;
|
uint32_t cardRr = 0;
|
||||||
uint32_t ans = 0;
|
uint32_t ans = 0;
|
||||||
|
@ -784,7 +785,7 @@ void Mifare1ksim(uint16_t flags, uint8_t exitAfterNReads, uint8_t *uid, uint16_t
|
||||||
if (g_dbglevel >= DBG_EXTENDED) Dbprintf("[MFEMUL_WORK] KEY %c: %012" PRIx64, (cardAUTHKEY == 0) ? 'A' : 'B', emlGetKey(cardAUTHSC, cardAUTHKEY));
|
if (g_dbglevel >= DBG_EXTENDED) Dbprintf("[MFEMUL_WORK] KEY %c: %012" PRIx64, (cardAUTHKEY == 0) ? 'A' : 'B', emlGetKey(cardAUTHSC, cardAUTHKEY));
|
||||||
|
|
||||||
// sector out of range - do not respond
|
// sector out of range - do not respond
|
||||||
if (cardAUTHSC >= MifareMaxSector(flags)) {
|
if (cardAUTHSC >= cardMaxSEC) {
|
||||||
cardAUTHKEY = AUTHKEYNONE; // not authenticated
|
cardAUTHKEY = AUTHKEYNONE; // not authenticated
|
||||||
cardSTATE_TO_IDLE();
|
cardSTATE_TO_IDLE();
|
||||||
if (g_dbglevel >= DBG_EXTENDED) Dbprintf("[MFEMUL_WORK] Out of range sector %d(0x%02x)", cardAUTHSC, cardAUTHSC);
|
if (g_dbglevel >= DBG_EXTENDED) Dbprintf("[MFEMUL_WORK] Out of range sector %d(0x%02x)", cardAUTHSC, cardAUTHSC);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue