Fixed indent

Fixed indent
This commit is contained in:
Antiklesys 2024-09-09 17:58:47 +08:00
commit 96b1b6d72c

View file

@ -2044,46 +2044,46 @@ static int CmdHFiClassDump(const char *Cmd) {
if(key_len > 0 && deb_key_nr >= 0){ if(key_len > 0 && deb_key_nr >= 0){
clearCommandBuffer(); clearCommandBuffer();
SendCommandNG(CMD_HF_ICLASS_DUMP, (uint8_t *)&payload, sizeof(payload)); SendCommandNG(CMD_HF_ICLASS_DUMP, (uint8_t *)&payload, sizeof(payload));
while (true) { while (true) {
PrintAndLogEx(NORMAL, "." NOLF); PrintAndLogEx(NORMAL, "." NOLF);
if (kbd_enter_pressed()) { if (kbd_enter_pressed()) {
PrintAndLogEx(WARNING, "\naborted via keyboard!\n"); PrintAndLogEx(WARNING, "\naborted via keyboard!\n");
DropField(); DropField();
return PM3_EOPABORTED; return PM3_EOPABORTED;
}
if (WaitForResponseTimeout(CMD_HF_ICLASS_DUMP, &resp, 2000))
break;
} }
if (WaitForResponseTimeout(CMD_HF_ICLASS_DUMP, &resp, 2000)) PrintAndLogEx(NORMAL, "");
break; if (resp.status != PM3_SUCCESS) {
} PrintAndLogEx(ERR, "failed to communicate with card");
return resp.status;
}
PrintAndLogEx(NORMAL, ""); if (packet->isOK == false) {
if (resp.status != PM3_SUCCESS) { PrintAndLogEx(WARNING, "read AA1 blocks failed");
PrintAndLogEx(ERR, "failed to communicate with card"); return PM3_ESOFT;
return resp.status; }
}
if (packet->isOK == false) { // response ok - now get bigbuf content of the dump
PrintAndLogEx(WARNING, "read AA1 blocks failed"); if (!GetFromDevice(BIG_BUF, tempbuf, sizeof(tempbuf), startindex, NULL, 0, NULL, 2500, false)) {
return PM3_ESOFT; PrintAndLogEx(WARNING, "command execution time out");
} return PM3_ETIMEOUT;
}
// response ok - now get bigbuf content of the dump if (pagemap != PICOPASS_NON_SECURE_PAGEMODE) {
if (!GetFromDevice(BIG_BUF, tempbuf, sizeof(tempbuf), startindex, NULL, 0, NULL, 2500, false)) { // div key KD
PrintAndLogEx(WARNING, "command execution time out"); memcpy(tag_data + (PICOPASS_BLOCK_SIZE * 3),
return PM3_ETIMEOUT; tempbuf + (PICOPASS_BLOCK_SIZE * 3), PICOPASS_BLOCK_SIZE);
} }
// all memory available
if (pagemap != PICOPASS_NON_SECURE_PAGEMODE) { memcpy(tag_data + (PICOPASS_BLOCK_SIZE * payload.start_block),
// div key KD
memcpy(tag_data + (PICOPASS_BLOCK_SIZE * 3),
tempbuf + (PICOPASS_BLOCK_SIZE * 3), PICOPASS_BLOCK_SIZE);
}
// all memory available
memcpy(tag_data + (PICOPASS_BLOCK_SIZE * payload.start_block),
tempbuf + (PICOPASS_BLOCK_SIZE * payload.start_block), tempbuf + (PICOPASS_BLOCK_SIZE * payload.start_block),
blocks_read * PICOPASS_BLOCK_SIZE); blocks_read * PICOPASS_BLOCK_SIZE);
} }