mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 05:43:48 -07:00
ADD 'lf nexawatch' by marshmellow42
ADD 'lf securakey' by marshmellow42 ADD 'lf pac' by marshmellow42 chg: parity.h got some love from pm3 master.
This commit is contained in:
parent
c5e04ba927
commit
d2f79fa83f
12 changed files with 444 additions and 58 deletions
|
@ -1865,51 +1865,6 @@ int CmdIndalaDecode(const char *Cmd)
|
|||
return 1;
|
||||
}
|
||||
|
||||
int CmdPSKNexWatch(const char *Cmd)
|
||||
{
|
||||
if (!PSKDemod("", false)) return 0;
|
||||
|
||||
uint8_t preamble[28] = {0,0,0,0,0,1,0,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
|
||||
size_t startIdx = 0, size = DemodBufferLen;
|
||||
|
||||
// sanity check.
|
||||
if ( size < sizeof(preamble) + 100) return 0;
|
||||
|
||||
bool invert = false;
|
||||
if (!preambleSearch(DemodBuffer, preamble, sizeof(preamble), &size, &startIdx)){
|
||||
// if didn't find preamble try again inverting
|
||||
if (!PSKDemod("1", false)) return 0;
|
||||
|
||||
size = DemodBufferLen;
|
||||
if (!preambleSearch(DemodBuffer, preamble, sizeof(preamble), &size, &startIdx)) return 0;
|
||||
invert = true;
|
||||
}
|
||||
if (size != 128) return 0;
|
||||
setDemodBuf(DemodBuffer, size, startIdx+4);
|
||||
startIdx = 8+32; //4 = extra i added, 8 = preamble, 32 = reserved bits (always 0)
|
||||
//get ID
|
||||
uint32_t ID = 0;
|
||||
for (uint8_t wordIdx=0; wordIdx<4; wordIdx++){
|
||||
for (uint8_t idx=0; idx<8; idx++){
|
||||
ID = (ID << 1) | DemodBuffer[startIdx+wordIdx+(idx*4)];
|
||||
}
|
||||
}
|
||||
//parity check (TBD)
|
||||
|
||||
//checksum check (TBD)
|
||||
|
||||
//output
|
||||
PrintAndLog("NexWatch ID: %d", ID);
|
||||
if (invert){
|
||||
PrintAndLog("DEBUG: Error - NexWatch had to Invert - probably NexKey");
|
||||
for (uint8_t idx=0; idx<size; idx++)
|
||||
DemodBuffer[idx] ^= 1;
|
||||
}
|
||||
|
||||
CmdPrintDemodBuff("x");
|
||||
return 1;
|
||||
}
|
||||
|
||||
int CmdPSKIdteck(const char *Cmd) {
|
||||
|
||||
if (!PSKDemod("", false)) {
|
||||
|
@ -2624,7 +2579,6 @@ static command_t CommandTable[] =
|
|||
{"plot", CmdPlot, 1, "Show graph window (hit 'h' in window for keystroke help)"},
|
||||
{"printdemodbuffer",CmdPrintDemodBuff, 1, "[x] [o] <offset> [l] <length> -- print the data in the DemodBuffer - 'x' for hex output"},
|
||||
{"pskindalademod", CmdIndalaDecode, 1, "[clock] [invert<0|1>] -- Demodulate an indala tag (PSK1) from GraphBuffer (args optional)"},
|
||||
{"psknexwatchdemod",CmdPSKNexWatch, 1, "Demodulate a NexWatch tag (nexkey, quadrakey) (PSK1) from GraphBuffer"},
|
||||
{"rawdemod", CmdRawDemod, 1, "[modulation] ... <options> -see help (h option) -- Demodulate the data in the GraphBuffer and output binary"},
|
||||
{"samples", CmdSamples, 0, "[512 - 40000] -- Get raw samples for graph window (GraphBuffer)"},
|
||||
{"save", CmdSave, 1, "<filename> -- Save trace (from graph window)"},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue