mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-22 06:13:51 -07:00
adapt chunksize as we progress
This commit is contained in:
parent
441bf920fc
commit
2089edbba9
1 changed files with 7 additions and 2 deletions
|
@ -310,6 +310,7 @@ int mfCheckKeys_file(uint8_t *destfn, uint64_t *key) {
|
||||||
} PACKED;
|
} PACKED;
|
||||||
struct kr *keyresult = (struct kr *)&resp.data.asBytes;
|
struct kr *keyresult = (struct kr *)&resp.data.asBytes;
|
||||||
if (!keyresult->found) return PM3_ESOFT;
|
if (!keyresult->found) return PM3_ESOFT;
|
||||||
|
|
||||||
*key = bytes_to_num(keyresult->key, sizeof(keyresult->key));
|
*key = bytes_to_num(keyresult->key, sizeof(keyresult->key));
|
||||||
return PM3_SUCCESS;
|
return PM3_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -560,6 +561,7 @@ out:
|
||||||
return -4;
|
return -4;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int mfStaticNested(uint8_t blockNo, uint8_t keyType, uint8_t *key, uint8_t trgBlockNo, uint8_t trgKeyType, uint8_t *resultKey) {
|
int mfStaticNested(uint8_t blockNo, uint8_t keyType, uint8_t *key, uint8_t trgBlockNo, uint8_t trgKeyType, uint8_t *resultKey) {
|
||||||
|
|
||||||
uint32_t uid;
|
uint32_t uid;
|
||||||
|
@ -691,6 +693,10 @@ int mfStaticNested(uint8_t blockNo, uint8_t keyType, uint8_t *key, uint8_t trgBl
|
||||||
|
|
||||||
// check a block of generated key candidates.
|
// check a block of generated key candidates.
|
||||||
if (IfPm3Flash()) {
|
if (IfPm3Flash()) {
|
||||||
|
|
||||||
|
mem[3] = ((chunk >> 8) & 0xFF);
|
||||||
|
mem[4] = (chunk & 0xFF);
|
||||||
|
|
||||||
// upload to flash.
|
// upload to flash.
|
||||||
res = flashmem_spiffs_load(destfn, mem, 5 + (chunk * 6));
|
res = flashmem_spiffs_load(destfn, mem, 5 + (chunk * 6));
|
||||||
if (res != PM3_SUCCESS) {
|
if (res != PM3_SUCCESS) {
|
||||||
|
@ -698,7 +704,6 @@ int mfStaticNested(uint8_t blockNo, uint8_t keyType, uint8_t *key, uint8_t trgBl
|
||||||
free(mem);
|
free(mem);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
res = mfCheckKeys_file(destfn, &key64);
|
res = mfCheckKeys_file(destfn, &key64);
|
||||||
} else {
|
} else {
|
||||||
res = mfCheckKeys(statelists[0].blockNo, statelists[0].keyType, false, chunk, mem, &key64);
|
res = mfCheckKeys(statelists[0].blockNo, statelists[0].keyType, false, chunk, mem, &key64);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue