mirror of
https://github.com/Proxmark/proxmark3.git
synced 2025-08-20 13:23:25 -07:00
Fix incorrect memset parameters in lf t55xx wipe
thanks @iceman1001 for the catch add added a restore graphbuffer after lf t55xx psk demodulation
This commit is contained in:
parent
7bc6fac3ce
commit
534678c3e9
1 changed files with 7 additions and 1 deletions
|
@ -385,17 +385,23 @@ bool DecodeT55xxBlock(){
|
||||||
break;
|
break;
|
||||||
case DEMOD_PSK1:
|
case DEMOD_PSK1:
|
||||||
// skip first 160 samples to allow antenna to settle in (psk gets inverted occasionally otherwise)
|
// skip first 160 samples to allow antenna to settle in (psk gets inverted occasionally otherwise)
|
||||||
|
save_restoreGB(1);
|
||||||
CmdLtrim("160");
|
CmdLtrim("160");
|
||||||
snprintf(cmdStr, sizeof(buf),"%d %d 6", bitRate[config.bitrate], config.inverted );
|
snprintf(cmdStr, sizeof(buf),"%d %d 6", bitRate[config.bitrate], config.inverted );
|
||||||
ans = PSKDemod(cmdStr, FALSE);
|
ans = PSKDemod(cmdStr, FALSE);
|
||||||
|
//undo trim samples
|
||||||
|
save_restoreGB(0);
|
||||||
break;
|
break;
|
||||||
case DEMOD_PSK2: //inverted won't affect this
|
case DEMOD_PSK2: //inverted won't affect this
|
||||||
case DEMOD_PSK3: //not fully implemented
|
case DEMOD_PSK3: //not fully implemented
|
||||||
// skip first 160 samples to allow antenna to settle in (psk gets inverted occasionally otherwise)
|
// skip first 160 samples to allow antenna to settle in (psk gets inverted occasionally otherwise)
|
||||||
|
save_restoreGB(1);
|
||||||
CmdLtrim("160");
|
CmdLtrim("160");
|
||||||
snprintf(cmdStr, sizeof(buf),"%d 0 6", bitRate[config.bitrate] );
|
snprintf(cmdStr, sizeof(buf),"%d 0 6", bitRate[config.bitrate] );
|
||||||
ans = PSKDemod(cmdStr, FALSE);
|
ans = PSKDemod(cmdStr, FALSE);
|
||||||
psk1TOpsk2(DemodBuffer, DemodBufferLen);
|
psk1TOpsk2(DemodBuffer, DemodBufferLen);
|
||||||
|
//undo trim samples
|
||||||
|
save_restoreGB(0);
|
||||||
break;
|
break;
|
||||||
case DEMOD_NRZ:
|
case DEMOD_NRZ:
|
||||||
snprintf(cmdStr, sizeof(buf),"%d %d 1", bitRate[config.bitrate], config.inverted );
|
snprintf(cmdStr, sizeof(buf),"%d %d 1", bitRate[config.bitrate], config.inverted );
|
||||||
|
@ -1310,7 +1316,7 @@ int CmdT55xxWipe(const char *Cmd) {
|
||||||
if (!CmdT55xxWriteBlock(ptrData))
|
if (!CmdT55xxWriteBlock(ptrData))
|
||||||
PrintAndLog("Error writing blk %d", blk);
|
PrintAndLog("Error writing blk %d", blk);
|
||||||
|
|
||||||
memset(writeData, sizeof(writeData), 0x00);
|
memset(writeData, 0x00, sizeof(writeData));
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue