2010-02-21 08:47:22 +08:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// Copyright (C) 2010 iZsh <izsh at fail0verflow.com>
|
|
|
|
//
|
|
|
|
// This code is licensed to you under the terms of the GNU GPL, version 2 or,
|
|
|
|
// at your option, any later version. See the LICENSE.txt file for the text of
|
|
|
|
// the license.
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// Graph utilities
|
|
|
|
//-----------------------------------------------------------------------------
|
Client cleanup and restructuring. Stage 1...
Next Step is refactoring some of the giant functions which are
just copy/paste of some other ones with just a few line changes,
removing unnecessary 'goto' etc.
The MS Windows version is broken with this commit but will be fixed
soon. Everything can't be done all at once :P
The commands are now hierarchical, for example:
"hf 14a read" vs. "hf 14b read".
You can also request help:
"hf help", "data help", "hf 15 help" etc.
Indents are now space-based, not tab-based anymore. Hopefully
no one will be trolling about it, considering the suicide-prone work
being done here ;)
client/cmdhw.c, client/proxusb.c, client/cmdhw.h, client/proxusb.h,
client/cmdmain.c, client/cmdlfhid.c, client/cmdmain.h, client/cmdlfhid.h,
client/data.c, client/data.h, client/cmdhf.c, client/cmdlf.c,
client/cmdhf.h, client/cmdhf15.c, client/cmdhf14b.c, client/cmdlf.h,
client/cmdhf15.h, client/cmdhf14b.h, client/cmddata.c, client/cmddata.h,
client/ui.c, client/cmdparser.c, client/cmdlfti.c, client/ui.h,
client/cmdlfem4x.c, client/cmdparser.h, client/cmdlfti.h, client/cmdlfem4x.h,
client/graph.c, client/graph.h, client/cmdhf14a.c, client/cmdhf14a.h,
client/cmdhflegic.c, client/cmdhflegic.c: New files.
client/cli.c, client/flasher.c, client/snooper.c, client/proxmark3.c,
client/proxmark3.h, client/Makefile: Update accordingly.
client/flash.h, client/flash.c, client/proxgui.cpp: Cosmetic changes.
client/translate.h, client/command.c, client/gui.c,
client/usb.c, client/prox.h: Remove.
include/usb_cmd.h (CMD_ACQUIRE_RAW_ADC_SAMPLES_ISO_14443_SIM): Remove dead cmd.
common/crc16.h: New file.
common/crc16.c: Modify accordingly.
common/iso14443crc.h: New file.
common/iso14443_crc.c: Rename to
common/iso14443crc.c: and modify accordingly.
armsrc/lfops.c, armsrc/iso14443.c,
armsrc/iso14443a.c: include .h files from
the common directory instead of including the c files.
common/Makefile.common, armsrc/Makefile: Modify accordingly.
2010-02-04 09:27:07 +08:00
|
|
|
#include "graph.h"
|
|
|
|
|
|
|
|
int GraphBuffer[MAX_GRAPH_TRACE_LEN];
|
|
|
|
int GraphTraceLen;
|
2017-07-28 04:05:54 +08:00
|
|
|
int s_Buff[MAX_GRAPH_TRACE_LEN];
|
|
|
|
|
2019-03-10 03:34:20 +08:00
|
|
|
/* write a manchester bit to the graph
|
|
|
|
TODO, verfy that this doesn't overflow buffer (iceman)
|
|
|
|
*/
|
|
|
|
void AppendGraph(bool redraw, int clock, int bit) {
|
2019-03-10 06:35:06 +08:00
|
|
|
int i;
|
|
|
|
//set first half the clock bit (all 1's or 0's for a 0 or 1 bit)
|
|
|
|
for (i = 0; i < (int)(clock / 2); ++i)
|
|
|
|
GraphBuffer[GraphTraceLen++] = bit ;
|
|
|
|
//set second half of the clock bit (all 0's or 1's for a 0 or 1 bit)
|
|
|
|
for (i = (int)(clock / 2); i < clock; ++i)
|
|
|
|
GraphBuffer[GraphTraceLen++] = bit ^ 1;
|
|
|
|
|
|
|
|
if (redraw)
|
|
|
|
RepaintGraphWindow();
|
Client cleanup and restructuring. Stage 1...
Next Step is refactoring some of the giant functions which are
just copy/paste of some other ones with just a few line changes,
removing unnecessary 'goto' etc.
The MS Windows version is broken with this commit but will be fixed
soon. Everything can't be done all at once :P
The commands are now hierarchical, for example:
"hf 14a read" vs. "hf 14b read".
You can also request help:
"hf help", "data help", "hf 15 help" etc.
Indents are now space-based, not tab-based anymore. Hopefully
no one will be trolling about it, considering the suicide-prone work
being done here ;)
client/cmdhw.c, client/proxusb.c, client/cmdhw.h, client/proxusb.h,
client/cmdmain.c, client/cmdlfhid.c, client/cmdmain.h, client/cmdlfhid.h,
client/data.c, client/data.h, client/cmdhf.c, client/cmdlf.c,
client/cmdhf.h, client/cmdhf15.c, client/cmdhf14b.c, client/cmdlf.h,
client/cmdhf15.h, client/cmdhf14b.h, client/cmddata.c, client/cmddata.h,
client/ui.c, client/cmdparser.c, client/cmdlfti.c, client/ui.h,
client/cmdlfem4x.c, client/cmdparser.h, client/cmdlfti.h, client/cmdlfem4x.h,
client/graph.c, client/graph.h, client/cmdhf14a.c, client/cmdhf14a.h,
client/cmdhflegic.c, client/cmdhflegic.c: New files.
client/cli.c, client/flasher.c, client/snooper.c, client/proxmark3.c,
client/proxmark3.h, client/Makefile: Update accordingly.
client/flash.h, client/flash.c, client/proxgui.cpp: Cosmetic changes.
client/translate.h, client/command.c, client/gui.c,
client/usb.c, client/prox.h: Remove.
include/usb_cmd.h (CMD_ACQUIRE_RAW_ADC_SAMPLES_ISO_14443_SIM): Remove dead cmd.
common/crc16.h: New file.
common/crc16.c: Modify accordingly.
common/iso14443crc.h: New file.
common/iso14443_crc.c: Rename to
common/iso14443crc.c: and modify accordingly.
armsrc/lfops.c, armsrc/iso14443.c,
armsrc/iso14443a.c: include .h files from
the common directory instead of including the c files.
common/Makefile.common, armsrc/Makefile: Modify accordingly.
2010-02-04 09:27:07 +08:00
|
|
|
}
|
|
|
|
|
2015-01-08 12:02:00 +08:00
|
|
|
// clear out our graph window
|
2019-03-10 03:34:20 +08:00
|
|
|
int ClearGraph(bool redraw) {
|
2019-03-10 06:35:06 +08:00
|
|
|
int gtl = GraphTraceLen;
|
|
|
|
memset(GraphBuffer, 0x00, GraphTraceLen);
|
|
|
|
GraphTraceLen = 0;
|
|
|
|
if (redraw)
|
|
|
|
RepaintGraphWindow();
|
|
|
|
return gtl;
|
Client cleanup and restructuring. Stage 1...
Next Step is refactoring some of the giant functions which are
just copy/paste of some other ones with just a few line changes,
removing unnecessary 'goto' etc.
The MS Windows version is broken with this commit but will be fixed
soon. Everything can't be done all at once :P
The commands are now hierarchical, for example:
"hf 14a read" vs. "hf 14b read".
You can also request help:
"hf help", "data help", "hf 15 help" etc.
Indents are now space-based, not tab-based anymore. Hopefully
no one will be trolling about it, considering the suicide-prone work
being done here ;)
client/cmdhw.c, client/proxusb.c, client/cmdhw.h, client/proxusb.h,
client/cmdmain.c, client/cmdlfhid.c, client/cmdmain.h, client/cmdlfhid.h,
client/data.c, client/data.h, client/cmdhf.c, client/cmdlf.c,
client/cmdhf.h, client/cmdhf15.c, client/cmdhf14b.c, client/cmdlf.h,
client/cmdhf15.h, client/cmdhf14b.h, client/cmddata.c, client/cmddata.h,
client/ui.c, client/cmdparser.c, client/cmdlfti.c, client/ui.h,
client/cmdlfem4x.c, client/cmdparser.h, client/cmdlfti.h, client/cmdlfem4x.h,
client/graph.c, client/graph.h, client/cmdhf14a.c, client/cmdhf14a.h,
client/cmdhflegic.c, client/cmdhflegic.c: New files.
client/cli.c, client/flasher.c, client/snooper.c, client/proxmark3.c,
client/proxmark3.h, client/Makefile: Update accordingly.
client/flash.h, client/flash.c, client/proxgui.cpp: Cosmetic changes.
client/translate.h, client/command.c, client/gui.c,
client/usb.c, client/prox.h: Remove.
include/usb_cmd.h (CMD_ACQUIRE_RAW_ADC_SAMPLES_ISO_14443_SIM): Remove dead cmd.
common/crc16.h: New file.
common/crc16.c: Modify accordingly.
common/iso14443crc.h: New file.
common/iso14443_crc.c: Rename to
common/iso14443crc.c: and modify accordingly.
armsrc/lfops.c, armsrc/iso14443.c,
armsrc/iso14443a.c: include .h files from
the common directory instead of including the c files.
common/Makefile.common, armsrc/Makefile: Modify accordingly.
2010-02-04 09:27:07 +08:00
|
|
|
}
|
2015-04-03 00:48:52 +08:00
|
|
|
// option '1' to save GraphBuffer any other to restore
|
2017-07-31 03:21:02 +08:00
|
|
|
void save_restoreGB(uint8_t saveOpt) {
|
2019-03-10 06:35:06 +08:00
|
|
|
static int SavedGB[MAX_GRAPH_TRACE_LEN];
|
|
|
|
static int SavedGBlen = 0;
|
|
|
|
static bool GB_Saved = false;
|
|
|
|
static int SavedGridOffsetAdj = 0;
|
|
|
|
|
|
|
|
if (saveOpt == GRAPH_SAVE) { //save
|
|
|
|
memcpy(SavedGB, GraphBuffer, sizeof(GraphBuffer));
|
|
|
|
SavedGBlen = GraphTraceLen;
|
|
|
|
GB_Saved = true;
|
|
|
|
SavedGridOffsetAdj = GridOffset;
|
|
|
|
} else if (GB_Saved){ //restore
|
|
|
|
memcpy(GraphBuffer, SavedGB, sizeof(GraphBuffer));
|
|
|
|
GraphTraceLen = SavedGBlen;
|
|
|
|
GridOffset = SavedGridOffsetAdj;
|
|
|
|
RepaintGraphWindow();
|
|
|
|
}
|
|
|
|
return;
|
2015-04-03 00:48:52 +08:00
|
|
|
}
|
Client cleanup and restructuring. Stage 1...
Next Step is refactoring some of the giant functions which are
just copy/paste of some other ones with just a few line changes,
removing unnecessary 'goto' etc.
The MS Windows version is broken with this commit but will be fixed
soon. Everything can't be done all at once :P
The commands are now hierarchical, for example:
"hf 14a read" vs. "hf 14b read".
You can also request help:
"hf help", "data help", "hf 15 help" etc.
Indents are now space-based, not tab-based anymore. Hopefully
no one will be trolling about it, considering the suicide-prone work
being done here ;)
client/cmdhw.c, client/proxusb.c, client/cmdhw.h, client/proxusb.h,
client/cmdmain.c, client/cmdlfhid.c, client/cmdmain.h, client/cmdlfhid.h,
client/data.c, client/data.h, client/cmdhf.c, client/cmdlf.c,
client/cmdhf.h, client/cmdhf15.c, client/cmdhf14b.c, client/cmdlf.h,
client/cmdhf15.h, client/cmdhf14b.h, client/cmddata.c, client/cmddata.h,
client/ui.c, client/cmdparser.c, client/cmdlfti.c, client/ui.h,
client/cmdlfem4x.c, client/cmdparser.h, client/cmdlfti.h, client/cmdlfem4x.h,
client/graph.c, client/graph.h, client/cmdhf14a.c, client/cmdhf14a.h,
client/cmdhflegic.c, client/cmdhflegic.c: New files.
client/cli.c, client/flasher.c, client/snooper.c, client/proxmark3.c,
client/proxmark3.h, client/Makefile: Update accordingly.
client/flash.h, client/flash.c, client/proxgui.cpp: Cosmetic changes.
client/translate.h, client/command.c, client/gui.c,
client/usb.c, client/prox.h: Remove.
include/usb_cmd.h (CMD_ACQUIRE_RAW_ADC_SAMPLES_ISO_14443_SIM): Remove dead cmd.
common/crc16.h: New file.
common/crc16.c: Modify accordingly.
common/iso14443crc.h: New file.
common/iso14443_crc.c: Rename to
common/iso14443crc.c: and modify accordingly.
armsrc/lfops.c, armsrc/iso14443.c,
armsrc/iso14443a.c: include .h files from
the common directory instead of including the c files.
common/Makefile.common, armsrc/Makefile: Modify accordingly.
2010-02-04 09:27:07 +08:00
|
|
|
|
2017-07-31 03:21:02 +08:00
|
|
|
void setGraphBuf(uint8_t *buf, size_t size) {
|
2019-03-10 06:35:06 +08:00
|
|
|
if ( buf == NULL ) return;
|
2019-03-09 15:59:13 +08:00
|
|
|
|
2019-03-10 06:35:06 +08:00
|
|
|
ClearGraph(false);
|
2019-03-09 15:59:13 +08:00
|
|
|
|
2019-03-10 06:35:06 +08:00
|
|
|
if ( size > MAX_GRAPH_TRACE_LEN )
|
|
|
|
size = MAX_GRAPH_TRACE_LEN;
|
2019-03-09 15:59:13 +08:00
|
|
|
|
2019-03-10 06:35:06 +08:00
|
|
|
for (uint32_t i = 0; i < size; ++i)
|
|
|
|
GraphBuffer[i] = buf[i] - 128;
|
2017-03-03 04:00:51 +08:00
|
|
|
|
2019-03-10 06:35:06 +08:00
|
|
|
GraphTraceLen = size;
|
|
|
|
RepaintGraphWindow();
|
|
|
|
return;
|
2014-12-31 05:08:33 +08:00
|
|
|
}
|
2018-09-10 01:56:25 +08:00
|
|
|
|
2017-07-31 03:21:02 +08:00
|
|
|
size_t getFromGraphBuf(uint8_t *buf) {
|
2019-03-10 06:35:06 +08:00
|
|
|
if (buf == NULL ) return 0;
|
|
|
|
uint32_t i;
|
|
|
|
for (i=0; i < GraphTraceLen; ++i){
|
|
|
|
//trim
|
|
|
|
if (GraphBuffer[i] > 127) GraphBuffer[i] = 127;
|
|
|
|
if (GraphBuffer[i] < -127) GraphBuffer[i] = -127;
|
|
|
|
buf[i] = (uint8_t)(GraphBuffer[i] + 128);
|
|
|
|
}
|
|
|
|
return i;
|
2014-12-31 05:08:33 +08:00
|
|
|
}
|
2015-01-21 06:28:51 +08:00
|
|
|
|
2019-03-09 15:59:13 +08:00
|
|
|
// A simple test to see if there is any data inside Graphbuffer.
|
2015-01-21 05:14:56 +08:00
|
|
|
bool HasGraphData(){
|
2019-03-10 06:35:06 +08:00
|
|
|
if ( GraphTraceLen <= 0) {
|
|
|
|
PrintAndLogEx(NORMAL, "No data available, try reading something first");
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
return true;
|
2015-01-21 05:14:56 +08:00
|
|
|
}
|
|
|
|
|
2015-02-10 00:11:04 +08:00
|
|
|
// Get or auto-detect ask clock rate
|
2017-11-10 02:15:56 +08:00
|
|
|
int GetAskClock(const char *str, bool printAns) {
|
2019-03-09 21:00:46 +08:00
|
|
|
if (getSignalProperties()->isnoise)
|
|
|
|
return false;
|
2019-03-10 06:35:06 +08:00
|
|
|
|
|
|
|
int clock = param_get32ex(str, 0, 0, 10);
|
|
|
|
if (clock > 0)
|
|
|
|
return clock;
|
|
|
|
|
|
|
|
// Auto-detect clock
|
|
|
|
uint8_t bits[MAX_GRAPH_TRACE_LEN] = {0};
|
|
|
|
size_t size = getFromGraphBuf(bits);
|
|
|
|
if (size == 0) {
|
|
|
|
PrintAndLogEx(WARNING, "Failed to copy from graphbuffer");
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
size_t ststart = 0, stend = 0;
|
|
|
|
bool st = DetectST(bits, &size, &clock, &ststart, &stend);
|
|
|
|
int idx = stend;
|
|
|
|
if (st == false) {
|
|
|
|
idx = DetectASKClock(bits, size, &clock, 20);
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( clock > 0 ) {
|
|
|
|
setClockGrid(clock, idx);
|
|
|
|
}
|
|
|
|
// Only print this message if we're not looping something
|
|
|
|
if (printAns || g_debugMode)
|
|
|
|
PrintAndLogEx(SUCCESS, "Auto-detected clock rate: %d, Best Starting Position: %d", clock, idx);
|
|
|
|
|
|
|
|
return clock;
|
2015-02-06 06:01:18 +08:00
|
|
|
}
|
|
|
|
|
2017-11-10 02:15:56 +08:00
|
|
|
uint8_t GetPskCarrier(const char *str, bool printAns) {
|
2019-03-09 21:00:46 +08:00
|
|
|
if (getSignalProperties()->isnoise)
|
|
|
|
return false;
|
2019-03-10 06:35:06 +08:00
|
|
|
|
|
|
|
uint8_t carrier = 0;
|
|
|
|
uint8_t bits[MAX_GRAPH_TRACE_LEN] = {0};
|
|
|
|
size_t size = getFromGraphBuf(bits);
|
|
|
|
if ( size == 0 ) {
|
|
|
|
PrintAndLogEx(WARNING, "Failed to copy from graphbuffer");
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
uint16_t fc = countFC(bits, size, false);
|
|
|
|
carrier = fc & 0xFF;
|
|
|
|
if (carrier != 2 && carrier != 4 && carrier != 8) return 0;
|
|
|
|
if (( fc >> 8) == 10 && carrier == 8) return 0;
|
|
|
|
// Only print this message if we're not looping something
|
|
|
|
if (printAns)
|
|
|
|
PrintAndLogEx(SUCCESS, "Auto-detected PSK carrier rate: %d", carrier);
|
|
|
|
return carrier;
|
2015-02-22 10:36:02 +08:00
|
|
|
}
|
|
|
|
|
2017-11-10 02:15:56 +08:00
|
|
|
int GetPskClock(const char* str, bool printAns) {
|
2019-03-09 21:00:46 +08:00
|
|
|
|
|
|
|
if (getSignalProperties()->isnoise)
|
|
|
|
return -1;
|
2019-03-10 06:35:06 +08:00
|
|
|
|
|
|
|
int clock = param_get32ex(str, 0, 0, 10);
|
|
|
|
if (clock != 0)
|
|
|
|
return clock;
|
|
|
|
|
|
|
|
// Auto-detect clock
|
|
|
|
uint8_t grph[MAX_GRAPH_TRACE_LEN] = {0};
|
|
|
|
size_t size = getFromGraphBuf(grph);
|
|
|
|
if ( size == 0 ) {
|
|
|
|
PrintAndLogEx(WARNING, "Failed to copy from graphbuffer");
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
size_t firstPhaseShiftLoc = 0;
|
|
|
|
uint8_t curPhase = 0, fc = 0;
|
|
|
|
clock = DetectPSKClock(grph, size, 0, &firstPhaseShiftLoc, &curPhase, &fc);
|
|
|
|
setClockGrid(clock, firstPhaseShiftLoc);
|
|
|
|
// Only print this message if we're not looping something
|
|
|
|
if (printAns)
|
|
|
|
PrintAndLogEx(SUCCESS, "Auto-detected clock rate: %d", clock);
|
|
|
|
return clock;
|
2015-02-10 00:11:04 +08:00
|
|
|
}
|
|
|
|
|
2017-11-10 02:15:56 +08:00
|
|
|
int GetNrzClock(const char* str, bool printAns) {
|
2015-01-07 12:29:45 +08:00
|
|
|
|
2019-03-09 21:00:46 +08:00
|
|
|
if (getSignalProperties()->isnoise)
|
|
|
|
return -1;
|
2019-03-10 06:35:06 +08:00
|
|
|
|
|
|
|
int clock = param_get32ex(str, 0, 0, 10);
|
|
|
|
if (clock != 0)
|
|
|
|
return clock;
|
|
|
|
|
|
|
|
// Auto-detect clock
|
|
|
|
uint8_t grph[MAX_GRAPH_TRACE_LEN] = {0};
|
|
|
|
size_t size = getFromGraphBuf(grph);
|
|
|
|
if ( size == 0 ) {
|
|
|
|
PrintAndLogEx(WARNING, "Failed to copy from graphbuffer");
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
size_t clkStartIdx = 0;
|
|
|
|
clock = DetectNRZClock(grph, size, 0, &clkStartIdx);
|
|
|
|
setClockGrid(clock, clkStartIdx);
|
|
|
|
// Only print this message if we're not looping something
|
|
|
|
if (printAns)
|
|
|
|
PrintAndLogEx(SUCCESS, "Auto-detected clock rate: %d", clock);
|
|
|
|
return clock;
|
2015-01-06 22:20:36 +08:00
|
|
|
}
|
2015-02-10 00:11:04 +08:00
|
|
|
//by marshmellow
|
|
|
|
//attempt to detect the field clock and bit clock for FSK
|
2017-11-10 02:15:56 +08:00
|
|
|
int GetFskClock(const char* str, bool printAns) {
|
2015-02-10 00:11:04 +08:00
|
|
|
|
2019-03-10 06:35:06 +08:00
|
|
|
int clock = param_get32ex(str, 0, 0, 10);
|
|
|
|
if (clock != 0)
|
|
|
|
return clock;
|
2015-02-20 10:35:34 +08:00
|
|
|
|
2019-03-10 06:35:06 +08:00
|
|
|
uint8_t fc1 = 0, fc2 = 0, rf1 = 0;
|
|
|
|
int firstClockEdge = 0;
|
2019-03-09 15:59:13 +08:00
|
|
|
|
2019-03-10 06:35:06 +08:00
|
|
|
if ( !fskClocks(&fc1, &fc2, &rf1, &firstClockEdge))
|
|
|
|
return 0;
|
2019-03-09 15:59:13 +08:00
|
|
|
|
2019-03-10 06:35:06 +08:00
|
|
|
if ((fc1==10 && fc2==8) || (fc1==8 && fc2==5)){
|
|
|
|
if (printAns)
|
|
|
|
PrintAndLogEx(SUCCESS, "Detected Field Clocks: FC/%d, FC/%d - Bit Clock: RF/%d", fc1, fc2, rf1);
|
|
|
|
setClockGrid(rf1, firstClockEdge);
|
|
|
|
return rf1;
|
|
|
|
}
|
2018-02-21 23:46:38 +08:00
|
|
|
|
2019-03-10 06:35:06 +08:00
|
|
|
PrintAndLogEx(DEBUG, "DEBUG: unknown fsk field clock detected");
|
|
|
|
PrintAndLogEx(DEBUG, "Detected Field Clocks: FC/%d, FC/%d - Bit Clock: RF/%d", fc1, fc2, rf1);
|
|
|
|
return 0;
|
2015-02-20 10:35:34 +08:00
|
|
|
}
|
2018-09-10 01:56:25 +08:00
|
|
|
bool fskClocks(uint8_t *fc1, uint8_t *fc2, uint8_t *rf1, int *firstClockEdge) {
|
2019-03-09 21:00:46 +08:00
|
|
|
|
|
|
|
if (getSignalProperties()->isnoise)
|
|
|
|
return false;
|
|
|
|
|
2019-03-10 06:35:06 +08:00
|
|
|
uint8_t bits[MAX_GRAPH_TRACE_LEN] = {0};
|
|
|
|
size_t size = getFromGraphBuf(bits);
|
|
|
|
if (size == 0)
|
|
|
|
return false;
|
|
|
|
|
|
|
|
uint16_t ans = countFC(bits, size, true);
|
|
|
|
if (ans == 0) {
|
|
|
|
PrintAndLogEx(DEBUG, "DEBUG: No data found");
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
*fc1 = (ans >> 8) & 0xFF;
|
|
|
|
*fc2 = ans & 0xFF;
|
|
|
|
*rf1 = detectFSKClk(bits, size, *fc1, *fc2, firstClockEdge);
|
|
|
|
if (*rf1 == 0) {
|
|
|
|
PrintAndLogEx(DEBUG, "DEBUG: Clock detect error");
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
return true;
|
2015-02-10 00:11:04 +08:00
|
|
|
}
|
2017-02-04 19:41:30 +08:00
|
|
|
|