mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2024-11-10 17:49:32 +08:00
chg: 'hf mfu read'
chg: 'hf mfu dump' - 5 retries if failed readblock. Loop for CRC error or incomplete reads. This will make reading / dumping more stable.
This commit is contained in:
parent
a7fd398d33
commit
ce418fb720
1 changed files with 20 additions and 1 deletions
|
@ -334,7 +334,7 @@ int mifare_ultra_auth(uint8_t *keybytes){
|
|||
return 1;
|
||||
}
|
||||
|
||||
int mifare_ultra_readblock(uint8_t blockNo, uint8_t *blockData) {
|
||||
int mifare_ultra_readblockEx(uint8_t blockNo, uint8_t *blockData) {
|
||||
uint16_t len = 0;
|
||||
uint8_t bt[2] = {0x00, 0x00};
|
||||
uint8_t receivedAnswer[MAX_FRAME_SIZE] = {0x00};
|
||||
|
@ -360,6 +360,25 @@ int mifare_ultra_readblock(uint8_t blockNo, uint8_t *blockData) {
|
|||
memcpy(blockData, receivedAnswer, 14);
|
||||
return 0;
|
||||
}
|
||||
int mifare_ultra_readblock(uint8_t blockNo, uint8_t *blockData) {
|
||||
#define MFU_MAX_CRC_RETRIES 5
|
||||
uint8_t retries = 0;
|
||||
uint8_t res;
|
||||
|
||||
for (retries = 0; retries < MFU_MAX_CRC_RETRIES; ++retries) {
|
||||
res = mifare_ultra_readblockEx(blockNo, blockData);
|
||||
|
||||
// break if OK, or NACK.
|
||||
switch ( res ) {
|
||||
case 0:
|
||||
case 1:
|
||||
break;
|
||||
default:
|
||||
continue;
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
int mifare_classic_writeblock(struct Crypto1State *pcs, uint32_t uid, uint8_t blockNo, uint8_t *blockData) {
|
||||
// variables
|
||||
|
|
Loading…
Reference in a new issue