Merge pull request #12 from aczid/hardnested

Fixed Sector/Block conversion for cards over 1k
This commit is contained in:
Valentin 2019-10-31 09:40:08 +01:00 committed by GitHub
commit 7637c92ef3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -1289,8 +1289,8 @@ static int acquire_nonces(uint8_t blockNo, uint8_t keyType, uint8_t *key, uint8_
num_acquired_nonces = 0; num_acquired_nonces = 0;
int e_sector = blockNo / 4; int e_sector = block_to_sector(blockNo);
int a_sector = trgBlockNo / 4; int a_sector = block_to_sector(trgBlockNo);
pKeys pk = {NULL, 0}; pKeys pk = {NULL, 0};
bool dumpKeysA = (trgKeyType == MC_AUTH_A ? true : false); bool dumpKeysA = (trgKeyType == MC_AUTH_A ? true : false);
// //

View File

@ -1028,7 +1028,7 @@ int mf_enhanced_auth(int e_sector, int a_sector, mftag t, mfreader r, denonce *d
// Prepare AUTH command // Prepare AUTH command
Auth[0] = (t.sectors[e_sector].foundKeyA) ? MC_AUTH_A : MC_AUTH_B; Auth[0] = (t.sectors[e_sector].foundKeyA) ? MC_AUTH_A : MC_AUTH_B;
if (mode == 'h') { if (mode == 'h') {
Auth[1] = e_sector * 4; //block Auth[1] = sector_to_block(e_sector); //block
} }
iso14443a_crc_append(Auth, 2); iso14443a_crc_append(Auth, 2);
// fprintf(stdout, "\nAuth command:\t"); // fprintf(stdout, "\nAuth command:\t");