mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 05:43:48 -07:00
add gdm flag to hf mf c* commands
this enables the use of hf mf c* commands with gdm/uscuid cards when the alt wake up mode 20(7)/23 is enabled rather than gen1 wake up
This commit is contained in:
parent
60c2446e27
commit
6d7fcc642a
6 changed files with 78 additions and 19 deletions
|
@ -2552,6 +2552,7 @@ out:
|
|||
// bit 4 - need turn off FPGA
|
||||
// bit 5 - need to set datain instead of issuing USB reply (called via ARM for StandAloneMode14a)
|
||||
// bit 6 - wipe tag.
|
||||
// bit 7 - use USCUID/GDM (20/23) magic wakeup
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
void MifareCSetBlock(uint32_t arg0, uint32_t arg1, uint8_t *datain) {
|
||||
|
@ -2620,6 +2621,22 @@ void MifareCSetBlock(uint32_t arg0, uint32_t arg1, uint8_t *datain) {
|
|||
mifare_classic_halt(NULL);
|
||||
}
|
||||
|
||||
if (workFlags & MAGIC_GDM_ALT_WUPC) {
|
||||
ReaderTransmitBitsPar(wupGDM1, 7, NULL, NULL);
|
||||
if ((ReaderReceive(receivedAnswer, sizeof(receivedAnswer), receivedAnswerPar) == 0) || (receivedAnswer[0] != 0x0a)) {
|
||||
if (g_dbglevel >= DBG_ERROR) Dbprintf("wupGDM1 error");
|
||||
errormsg = MAGIC_WUPC;
|
||||
break;
|
||||
}
|
||||
|
||||
ReaderTransmit(wupGDM2, sizeof(wupC2), NULL);
|
||||
if ((ReaderReceive(receivedAnswer, sizeof(receivedAnswer), receivedAnswerPar) == 0) || (receivedAnswer[0] != 0x0a)) {
|
||||
if (g_dbglevel >= DBG_ERROR) Dbprintf("wupGDM2 error");
|
||||
errormsg = MAGIC_WUPC;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// write block
|
||||
if (workFlags & MAGIC_WUPC) {
|
||||
ReaderTransmitBitsPar(wupC1, 7, NULL, NULL);
|
||||
|
@ -2706,6 +2723,22 @@ void MifareCGetBlock(uint32_t arg0, uint32_t arg1, uint8_t *datain) {
|
|||
|
||||
//loop doesn't loop just breaks out if error or done
|
||||
while (true) {
|
||||
if (workFlags & MAGIC_GDM_ALT_WUPC) {
|
||||
ReaderTransmitBitsPar(wupGDM1, 7, NULL, NULL);
|
||||
if ((ReaderReceive(receivedAnswer, sizeof(receivedAnswer), receivedAnswerPar) == 0) || (receivedAnswer[0] != 0x0a)) {
|
||||
if (g_dbglevel >= DBG_ERROR) Dbprintf("wupGDM1 error");
|
||||
errormsg = MAGIC_WUPC;
|
||||
break;
|
||||
}
|
||||
|
||||
ReaderTransmit(wupGDM2, sizeof(wupC2), NULL);
|
||||
if ((ReaderReceive(receivedAnswer, sizeof(receivedAnswer), receivedAnswerPar) == 0) || (receivedAnswer[0] != 0x0a)) {
|
||||
if (g_dbglevel >= DBG_ERROR) Dbprintf("wupGDM2 error");
|
||||
errormsg = MAGIC_WUPC;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (workFlags & MAGIC_WUPC) {
|
||||
ReaderTransmitBitsPar(wupC1, 7, NULL, NULL);
|
||||
if ((ReaderReceive(receivedAnswer, sizeof(receivedAnswer), receivedAnswerPar) == 0) || (receivedAnswer[0] != 0x0a)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue