mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-20 21:33:47 -07:00
text
Some checks failed
CodeQL / Analyze (push) Has been cancelled
MacOS Build and Test / macos-make (push) Has been cancelled
MacOS Build and Test / macos-make-btaddon (push) Has been cancelled
MacOS Build and Test / macos-cmake (push) Has been cancelled
Ubuntu Build and Test / ubuntu-make (push) Has been cancelled
Ubuntu Build and Test / ubuntu-make-btaddon (push) Has been cancelled
Ubuntu Build and Test / ubuntu-cmake (push) Has been cancelled
Windows Build and Test / proxspace (push) Has been cancelled
Windows Build and Test / wsl (push) Has been cancelled
Some checks failed
CodeQL / Analyze (push) Has been cancelled
MacOS Build and Test / macos-make (push) Has been cancelled
MacOS Build and Test / macos-make-btaddon (push) Has been cancelled
MacOS Build and Test / macos-cmake (push) Has been cancelled
Ubuntu Build and Test / ubuntu-make (push) Has been cancelled
Ubuntu Build and Test / ubuntu-make-btaddon (push) Has been cancelled
Ubuntu Build and Test / ubuntu-cmake (push) Has been cancelled
Windows Build and Test / proxspace (push) Has been cancelled
Windows Build and Test / wsl (push) Has been cancelled
This commit is contained in:
parent
53b2dc7d4b
commit
7717dfc04d
3 changed files with 32 additions and 18 deletions
|
@ -1941,24 +1941,24 @@ void iClass_WriteBlock(uint8_t *msg) {
|
||||||
if (payload->req.use_replay && (memcmp(payload->mac, "\x00\x00\x00\x00", 4) != 0)) {
|
if (payload->req.use_replay && (memcmp(payload->mac, "\x00\x00\x00\x00", 4) != 0)) {
|
||||||
memcpy(write + 10, payload->mac, sizeof(payload->mac));
|
memcpy(write + 10, payload->mac, sizeof(payload->mac));
|
||||||
} else {
|
} else {
|
||||||
// Secure tags uses MAC
|
// Secure tags uses MAC
|
||||||
uint8_t wb[9];
|
uint8_t wb[9];
|
||||||
wb[0] = payload->req.blockno;
|
wb[0] = payload->req.blockno;
|
||||||
memcpy(wb + 1, payload->data, PICOPASS_BLOCK_SIZE);
|
memcpy(wb + 1, payload->data, PICOPASS_BLOCK_SIZE);
|
||||||
|
|
||||||
if (payload->req.use_credit_key){
|
if (payload->req.use_credit_key) {
|
||||||
doMAC_N(wb, sizeof(wb), hdr.key_c, mac);
|
doMAC_N(wb, sizeof(wb), hdr.key_c, mac);
|
||||||
} else if (payload->req.use_replay) {
|
} else if (payload->req.use_replay) {
|
||||||
priv_esc = do_privilege_escalation(read_check_cc, sizeof(read_check_cc), &eof_time);
|
priv_esc = do_privilege_escalation(read_check_cc, sizeof(read_check_cc), &eof_time);
|
||||||
if (priv_esc == false) {
|
if (priv_esc == false) {
|
||||||
goto out;
|
goto out;
|
||||||
|
}
|
||||||
|
doMAC_N(wb, sizeof(wb), div_cc, mac);
|
||||||
|
} else {
|
||||||
|
doMAC_N(wb, sizeof(wb), hdr.key_d, mac);
|
||||||
}
|
}
|
||||||
doMAC_N(wb, sizeof(wb), div_cc, mac);
|
|
||||||
}else{
|
|
||||||
doMAC_N(wb, sizeof(wb), hdr.key_d, mac);
|
|
||||||
}
|
|
||||||
|
|
||||||
memcpy(write + 10, mac, sizeof(mac));
|
memcpy(write + 10, mac, sizeof(mac));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -698,8 +698,13 @@ int flash_write(flash_file_t *ctx) {
|
||||||
|
|
||||||
PrintAndLogEx(SUCCESS, " 0x%08x..0x%08x [0x%x / %u blocks]", seg->start, end - 1, length, blocks);
|
PrintAndLogEx(SUCCESS, " 0x%08x..0x%08x [0x%x / %u blocks]", seg->start, end - 1, length, blocks);
|
||||||
if (is_loaded) {
|
if (is_loaded) {
|
||||||
fprintf(stdout, "\n\n");
|
if (blocks < 50) {
|
||||||
|
PrintAndLogEx(SUCCESS, "" NOLF);
|
||||||
|
} else {
|
||||||
|
fprintf(stdout, "\n\n");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
int block = 0;
|
int block = 0;
|
||||||
uint8_t *data = seg->data;
|
uint8_t *data = seg->data;
|
||||||
|
@ -721,6 +726,15 @@ int flash_write(flash_file_t *ctx) {
|
||||||
length -= block_size;
|
length -= block_size;
|
||||||
block++;
|
block++;
|
||||||
|
|
||||||
|
// small files, like bootrom
|
||||||
|
if (blocks < 50) {
|
||||||
|
fprintf(stdout, ".");
|
||||||
|
len++;
|
||||||
|
fflush(stdout);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// large fullimage write
|
||||||
if (is_loaded) {
|
if (is_loaded) {
|
||||||
if (len < ice3len) {
|
if (len < ice3len) {
|
||||||
fprintf(stdout, "%c", ice3[len++]);
|
fprintf(stdout, "%c", ice3[len++]);
|
||||||
|
|
|
@ -3810,7 +3810,7 @@
|
||||||
"--credit key is assumed to be the credit key",
|
"--credit key is assumed to be the credit key",
|
||||||
"--elite elite computations applied to key",
|
"--elite elite computations applied to key",
|
||||||
"--raw no computations applied to key",
|
"--raw no computations applied to key",
|
||||||
"--nr replay of NR/MAC",
|
"--nr replay of NR/MAC block write or use privilege escalation if mac is empty",
|
||||||
"-v, --verbose verbose output",
|
"-v, --verbose verbose output",
|
||||||
"--shallow use shallow (ASK) reader modulation instead of OOK"
|
"--shallow use shallow (ASK) reader modulation instead of OOK"
|
||||||
],
|
],
|
||||||
|
@ -13377,6 +13377,6 @@
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"commands_extracted": 768,
|
"commands_extracted": 768,
|
||||||
"extracted_by": "PM3Help2JSON v1.00",
|
"extracted_by": "PM3Help2JSON v1.00",
|
||||||
"extracted_on": "2025-07-04T10:19:21"
|
"extracted_on": "2025-07-06T18:10:18"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue