mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-19 21:03:48 -07:00
Use Variable
This commit is contained in:
parent
a3e0e90bf3
commit
619ef2ba37
1 changed files with 4 additions and 2 deletions
|
@ -592,7 +592,7 @@ void emlClearMem(void) {
|
||||||
memset(emCARD, 0, CARD_MEMORY_SIZE);
|
memset(emCARD, 0, CARD_MEMORY_SIZE);
|
||||||
|
|
||||||
// fill sectors trailer data
|
// fill sectors trailer data
|
||||||
for (uint16_t b = 3; b < 256; ((b < 127) ? (b += 4) : (b += 16)))
|
for (uint16_t b = 3; b <= MIFARE_4K_MAXBLOCK; ((b <= MIFARE_2K_MAXBLOCK ) ? (b += 4) : (b += 16)))
|
||||||
emlSetMem((uint8_t *)trailer, b, 1);
|
emlSetMem((uint8_t *)trailer, b, 1);
|
||||||
|
|
||||||
// uid
|
// uid
|
||||||
|
@ -601,9 +601,11 @@ void emlClearMem(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t SectorTrailer(uint8_t blockNo) {
|
uint8_t SectorTrailer(uint8_t blockNo) {
|
||||||
if (blockNo < 32 * 4) {
|
if (blockNo <= MIFARE_2K_MAXBLOCK) {
|
||||||
|
if (MF_DBGLEVEL >= MF_DBG_EXTENDED) Dbprintf("Sector Trailer for block %d : %d", blockNo, (blockNo | 0x03));
|
||||||
return (blockNo | 0x03);
|
return (blockNo | 0x03);
|
||||||
} else {
|
} else {
|
||||||
|
if (MF_DBGLEVEL >= MF_DBG_EXTENDED) Dbprintf("Sector Trailer for block %d : %d", blockNo, (blockNo | 0x0f));
|
||||||
return (blockNo | 0x0f);
|
return (blockNo | 0x0f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue