mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2024-11-11 01:55:38 +08:00
fix lf t55xx wipe - calling write with correct params
This commit is contained in:
parent
f2a0f3e272
commit
fd656541dd
1 changed files with 13 additions and 12 deletions
|
@ -2939,35 +2939,36 @@ static int CmdT55xxWipe(const char *Cmd) {
|
|||
PrintAndLogEx(INFO, "Begin wiping...");
|
||||
|
||||
// Creating cmd string for write block :)
|
||||
char writeData[36] = {0};
|
||||
char *ptrData = writeData;
|
||||
snprintf(ptrData, sizeof(writeData), "-b 0 ");
|
||||
char wcmd[36] = {0};
|
||||
char *pwcmd = wcmd;
|
||||
|
||||
snprintf(pwcmd, sizeof(wcmd), "-b 0 ");
|
||||
|
||||
if (usepwd) {
|
||||
snprintf(ptrData + strlen(writeData), sizeof(writeData) - strlen(writeData), "p %08x ", password);
|
||||
snprintf(pwcmd + strlen(wcmd), sizeof(wcmd) - strlen(wcmd), "-p %08x ", password);
|
||||
}
|
||||
snprintf(ptrData + strlen(writeData), sizeof(writeData) - strlen(writeData), "d %08X", block0);
|
||||
snprintf(pwcmd + strlen(wcmd), sizeof(wcmd) - strlen(wcmd), "-d %08X", block0);
|
||||
|
||||
if (CmdT55xxWriteBlock(ptrData) != PM3_SUCCESS)
|
||||
if (CmdT55xxWriteBlock(pwcmd) != PM3_SUCCESS)
|
||||
PrintAndLogEx(WARNING, "Warning: error writing blk 0");
|
||||
|
||||
for (uint8_t blk = 1; blk < 8; blk++) {
|
||||
|
||||
snprintf(ptrData, sizeof(writeData), "-b %d -d 0", blk);
|
||||
snprintf(pwcmd, sizeof(wcmd), "-b %d -d 00000000", blk);
|
||||
|
||||
if (CmdT55xxWriteBlock(ptrData) != PM3_SUCCESS)
|
||||
if (CmdT55xxWriteBlock(pwcmd) != PM3_SUCCESS)
|
||||
PrintAndLogEx(WARNING, "Warning: error writing blk %d", blk);
|
||||
|
||||
memset(writeData, 0x00, sizeof(writeData));
|
||||
memset(wcmd, 0x00, sizeof(wcmd));
|
||||
}
|
||||
|
||||
// Check and rest t55xx downlink mode.
|
||||
if (config.downlink_mode != T55XX_DLMODE_FIXED) { // Detect found a different mode so card must support
|
||||
snprintf(ptrData, sizeof(writeData), "-b 3 --pg1 -d 00000000");
|
||||
if (CmdT55xxWriteBlock(ptrData) != PM3_SUCCESS) {
|
||||
snprintf(pwcmd, sizeof(wcmd), "-b 3 --pg1 -d 00000000");
|
||||
if (CmdT55xxWriteBlock(pwcmd) != PM3_SUCCESS) {
|
||||
PrintAndLogEx(WARNING, "Warning: failed writing block 3 page 1 (config)");
|
||||
}
|
||||
memset(writeData, 0x00, sizeof(writeData));
|
||||
memset(wcmd, 0x00, sizeof(wcmd));
|
||||
}
|
||||
return PM3_SUCCESS;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue