mfCWipe works

This commit is contained in:
merlokk 2017-09-20 13:03:33 +03:00
commit ed41fddb4e
3 changed files with 11 additions and 5 deletions

View file

@ -1917,6 +1917,9 @@ int CmdHF14AMfCWipe(const char *Cmd)
cmdp++;
}
if (!wipeCard & !fillCard)
wipeCard = TRUE;
PrintAndLog("--sectors count:%2d wipe:%c fill:%c", numSectors, (wipeCard)?'y':'n', (fillCard)?'y':'n');
if (gen == 2) {

View file

@ -415,6 +415,7 @@ int mfEmlSetMem(uint8_t *data, int blockNum, int blocksCount) {
int mfCGetBlock(uint8_t blockNo, uint8_t *data, uint8_t params) {
uint8_t isOK = 0;
return 0;
UsbCommand c = {CMD_MIFARE_CGETBLOCK, {params, 0, blockNo}};
SendCommand(&c);
@ -452,14 +453,16 @@ int mfCSetBlock(uint8_t blockNo, uint8_t *data, uint8_t *uid, bool wantWipe, uin
return 0;
}
int mfCWipe(uint8_t numSectors, bool wantWipe, bool wantSet) {
UsbCommand c = {CMD_MIFARE_CWIPE, {ISO14A_CONNECT | ISO14A_NO_DISCONNECT, 0, 0}};
int mfCWipe(uint8_t numSectors, bool wantWipe, bool wantFill) {
uint8_t isOK = 0;
UsbCommand c = {CMD_MIFARE_CWIPE, {numSectors, wantWipe, wantFill}};
SendCommand(&c);
UsbCommand resp;
WaitForResponse(CMD_ACK,&resp);
isOK = resp.arg[0] & 0xff;
return 0;
return isOK;
}
int mfCSetUID(uint8_t *uid, uint8_t *atqa, uint8_t *sak, uint8_t *oldUID, bool wantWipe, bool wantFill) {

View file

@ -33,7 +33,7 @@ extern int mfCheckKeys (uint8_t blockNo, uint8_t keyType, bool clear_trace, uint
extern int mfEmlGetMem(uint8_t *data, int blockNum, int blocksCount);
extern int mfEmlSetMem(uint8_t *data, int blockNum, int blocksCount);
extern int mfCWipe(uint8_t numSectors, bool wantWipe, bool wantSet);
extern int mfCWipe(uint8_t numSectors, bool wantWipe, bool wantFill);
extern int mfCSetUID(uint8_t *uid, uint8_t *atqa, uint8_t *sak, uint8_t *oldUID, bool wantWipe, bool wantFill);
extern int mfCSetBlock(uint8_t blockNo, uint8_t *data, uint8_t *uid, bool wantWipe, uint8_t params);
extern int mfCGetBlock(uint8_t blockNo, uint8_t *data, uint8_t params);