mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-02-15 19:59:34 +08:00
unshadow clock, the mysterious one
This commit is contained in:
parent
2b3e5b7aac
commit
29d73046cc
1 changed files with 28 additions and 26 deletions
|
@ -101,9 +101,9 @@ int GetAskClock(const char *str, bool printAns) {
|
||||||
if (getSignalProperties()->isnoise)
|
if (getSignalProperties()->isnoise)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
int clock = param_get32ex(str, 0, 0, 10);
|
int clock1 = param_get32ex(str, 0, 0, 10);
|
||||||
if (clock > 0)
|
if (clock1 > 0)
|
||||||
return clock;
|
return clock1;
|
||||||
|
|
||||||
// Auto-detect clock
|
// Auto-detect clock
|
||||||
uint8_t bits[MAX_GRAPH_TRACE_LEN] = {0};
|
uint8_t bits[MAX_GRAPH_TRACE_LEN] = {0};
|
||||||
|
@ -114,20 +114,20 @@ int GetAskClock(const char *str, bool printAns) {
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t ststart = 0, stend = 0;
|
size_t ststart = 0, stend = 0;
|
||||||
bool st = DetectST(bits, &size, &clock, &ststart, &stend);
|
bool st = DetectST(bits, &size, &clock1, &ststart, &stend);
|
||||||
int idx = stend;
|
int idx = stend;
|
||||||
if (st == false) {
|
if (st == false) {
|
||||||
idx = DetectASKClock(bits, size, &clock, 20);
|
idx = DetectASKClock(bits, size, &clock1, 20);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (clock > 0) {
|
if (clock1 > 0) {
|
||||||
setClockGrid(clock, idx);
|
setClockGrid(clock1, idx);
|
||||||
}
|
}
|
||||||
// Only print this message if we're not looping something
|
// Only print this message if we're not looping something
|
||||||
if (printAns || g_debugMode)
|
if (printAns || g_debugMode)
|
||||||
PrintAndLogEx(SUCCESS, "Auto-detected clock rate: %d, Best Starting Position: %d", clock, idx);
|
PrintAndLogEx(SUCCESS, "Auto-detected clock rate: %d, Best Starting Position: %d", clock1, idx);
|
||||||
|
|
||||||
return clock;
|
return clock1;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t GetPskCarrier(const char *str, bool printAns) {
|
uint8_t GetPskCarrier(const char *str, bool printAns) {
|
||||||
|
@ -156,9 +156,9 @@ int GetPskClock(const char *str, bool printAns) {
|
||||||
if (getSignalProperties()->isnoise)
|
if (getSignalProperties()->isnoise)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
int clock = param_get32ex(str, 0, 0, 10);
|
int clock1 = param_get32ex(str, 0, 0, 10);
|
||||||
if (clock != 0)
|
if (clock1 != 0)
|
||||||
return clock;
|
return clock1;
|
||||||
|
|
||||||
// Auto-detect clock
|
// Auto-detect clock
|
||||||
uint8_t grph[MAX_GRAPH_TRACE_LEN] = {0};
|
uint8_t grph[MAX_GRAPH_TRACE_LEN] = {0};
|
||||||
|
@ -169,12 +169,13 @@ int GetPskClock(const char *str, bool printAns) {
|
||||||
}
|
}
|
||||||
size_t firstPhaseShiftLoc = 0;
|
size_t firstPhaseShiftLoc = 0;
|
||||||
uint8_t curPhase = 0, fc = 0;
|
uint8_t curPhase = 0, fc = 0;
|
||||||
clock = DetectPSKClock(grph, size, 0, &firstPhaseShiftLoc, &curPhase, &fc);
|
clock1 = DetectPSKClock(grph, size, 0, &firstPhaseShiftLoc, &curPhase, &fc);
|
||||||
setClockGrid(clock, firstPhaseShiftLoc);
|
setClockGrid(clock1, firstPhaseShiftLoc);
|
||||||
// Only print this message if we're not looping something
|
// Only print this message if we're not looping something
|
||||||
if (printAns)
|
if (printAns)
|
||||||
PrintAndLogEx(SUCCESS, "Auto-detected clock rate: %d", clock);
|
PrintAndLogEx(SUCCESS, "Auto-detected clock rate: %d", clock1);
|
||||||
return clock;
|
|
||||||
|
return clock1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int GetNrzClock(const char *str, bool printAns) {
|
int GetNrzClock(const char *str, bool printAns) {
|
||||||
|
@ -182,9 +183,9 @@ int GetNrzClock(const char *str, bool printAns) {
|
||||||
if (getSignalProperties()->isnoise)
|
if (getSignalProperties()->isnoise)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
int clock = param_get32ex(str, 0, 0, 10);
|
int clock1 = param_get32ex(str, 0, 0, 10);
|
||||||
if (clock != 0)
|
if (clock1 != 0)
|
||||||
return clock;
|
return clock1;
|
||||||
|
|
||||||
// Auto-detect clock
|
// Auto-detect clock
|
||||||
uint8_t grph[MAX_GRAPH_TRACE_LEN] = {0};
|
uint8_t grph[MAX_GRAPH_TRACE_LEN] = {0};
|
||||||
|
@ -194,20 +195,21 @@ int GetNrzClock(const char *str, bool printAns) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
size_t clkStartIdx = 0;
|
size_t clkStartIdx = 0;
|
||||||
clock = DetectNRZClock(grph, size, 0, &clkStartIdx);
|
clock1 = DetectNRZClock(grph, size, 0, &clkStartIdx);
|
||||||
setClockGrid(clock, clkStartIdx);
|
setClockGrid(clock1, clkStartIdx);
|
||||||
// Only print this message if we're not looping something
|
// Only print this message if we're not looping something
|
||||||
if (printAns)
|
if (printAns)
|
||||||
PrintAndLogEx(SUCCESS, "Auto-detected clock rate: %d", clock);
|
PrintAndLogEx(SUCCESS, "Auto-detected clock rate: %d", clock1);
|
||||||
return clock;
|
|
||||||
|
return clock1;
|
||||||
}
|
}
|
||||||
//by marshmellow
|
//by marshmellow
|
||||||
//attempt to detect the field clock and bit clock for FSK
|
//attempt to detect the field clock and bit clock for FSK
|
||||||
int GetFskClock(const char *str, bool printAns) {
|
int GetFskClock(const char *str, bool printAns) {
|
||||||
|
|
||||||
int clock = param_get32ex(str, 0, 0, 10);
|
int clock1 = param_get32ex(str, 0, 0, 10);
|
||||||
if (clock != 0)
|
if (clock1 != 0)
|
||||||
return clock;
|
return clock1;
|
||||||
|
|
||||||
uint8_t fc1 = 0, fc2 = 0, rf1 = 0;
|
uint8_t fc1 = 0, fc2 = 0, rf1 = 0;
|
||||||
int firstClockEdge = 0;
|
int firstClockEdge = 0;
|
||||||
|
|
Loading…
Reference in a new issue