mirror of
https://github.com/Proxmark/proxmark3.git
synced 2025-08-20 21:33:19 -07:00
hf mf sniff
small fix
This commit is contained in:
parent
138a0e7a6b
commit
feb328c90a
2 changed files with 10 additions and 11 deletions
|
@ -2539,7 +2539,9 @@ void RAMFUNC SniffMifare(uint8_t param) {
|
||||||
if(!TagIsActive) { // no need to try decoding tag data if the reader is sending
|
if(!TagIsActive) { // no need to try decoding tag data if the reader is sending
|
||||||
uint8_t readerdata = (previous_data & 0xF0) | (*data >> 4);
|
uint8_t readerdata = (previous_data & 0xF0) | (*data >> 4);
|
||||||
if(MillerDecoding(readerdata, (sniffCounter-1)*4)) {
|
if(MillerDecoding(readerdata, (sniffCounter-1)*4)) {
|
||||||
LED_C_INV();
|
LED_B_ON();
|
||||||
|
LED_C_OFF();
|
||||||
|
|
||||||
if (MfSniffLogic(receivedCmd, Uart.len, Uart.parity, Uart.bitCount, true)) break;
|
if (MfSniffLogic(receivedCmd, Uart.len, Uart.parity, Uart.bitCount, true)) break;
|
||||||
|
|
||||||
/* And ready to receive another command. */
|
/* And ready to receive another command. */
|
||||||
|
@ -2549,12 +2551,14 @@ void RAMFUNC SniffMifare(uint8_t param) {
|
||||||
DemodReset();
|
DemodReset();
|
||||||
}
|
}
|
||||||
ReaderIsActive = (Uart.state != STATE_UNSYNCD);
|
ReaderIsActive = (Uart.state != STATE_UNSYNCD);
|
||||||
|
TagIsActive = !ReaderIsActive;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!ReaderIsActive) { // no need to try decoding tag data if the reader is sending
|
if(!ReaderIsActive) { // no need to try decoding tag data if the reader is sending
|
||||||
uint8_t tagdata = (previous_data << 4) | (*data & 0x0F);
|
uint8_t tagdata = (previous_data << 4) | (*data & 0x0F);
|
||||||
if(ManchesterDecoding(tagdata, 0, (sniffCounter-1)*4)) {
|
if(ManchesterDecoding(tagdata, 0, (sniffCounter-1)*4)) {
|
||||||
LED_C_INV();
|
LED_B_OFF();
|
||||||
|
LED_C_ON();
|
||||||
|
|
||||||
if (MfSniffLogic(receivedResponse, Demod.len, Demod.parity, Demod.bitCount, false)) break;
|
if (MfSniffLogic(receivedResponse, Demod.len, Demod.parity, Demod.bitCount, false)) break;
|
||||||
|
|
||||||
|
@ -2564,6 +2568,7 @@ void RAMFUNC SniffMifare(uint8_t param) {
|
||||||
UartInit(receivedCmd, receivedCmdPar);
|
UartInit(receivedCmd, receivedCmdPar);
|
||||||
}
|
}
|
||||||
TagIsActive = (Demod.state != DEMOD_UNSYNCD);
|
TagIsActive = (Demod.state != DEMOD_UNSYNCD);
|
||||||
|
ReaderIsActive = !TagIsActive;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -124,16 +124,10 @@ bool RAMFUNC MfSniffLogic(const uint8_t *data, uint16_t len, uint8_t *parity, ui
|
||||||
sniffBuf[12] = 0xFF;
|
sniffBuf[12] = 0xFF;
|
||||||
sniffBuf[13] = 0xFF;
|
sniffBuf[13] = 0xFF;
|
||||||
LogTrace(sniffBuf, 14, 0, 0, NULL, TRUE);
|
LogTrace(sniffBuf, 14, 0, 0, NULL, TRUE);
|
||||||
} // intentionally no break;
|
|
||||||
case SNF_CARD_CMD:{
|
|
||||||
LogTrace(data, len, 0, 0, NULL, TRUE);
|
|
||||||
sniffState = SNF_CARD_RESP;
|
|
||||||
timerData = GetTickCount();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case SNF_CARD_RESP:{
|
|
||||||
LogTrace(data, len, 0, 0, NULL, FALSE);
|
|
||||||
sniffState = SNF_CARD_CMD;
|
sniffState = SNF_CARD_CMD;
|
||||||
|
} // intentionally no break;
|
||||||
|
case SNF_CARD_CMD:{
|
||||||
|
LogTrace(data, len, 0, 0, NULL, reader);
|
||||||
timerData = GetTickCount();
|
timerData = GetTickCount();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue