mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2024-12-26 18:12:34 +08:00
Changed modulation max bit length from 512 to 4096, since we now can get much longer traces
This commit is contained in:
parent
17a93a3b1b
commit
bcbe76064d
3 changed files with 12 additions and 9 deletions
|
@ -222,7 +222,7 @@ static int CmdSetDebugMode(const char *Cmd) {
|
|||
return PM3_SUCCESS;
|
||||
}
|
||||
|
||||
// max output to 512 bits if we have more
|
||||
// max output to MAX_DEMODULATION_BITS bits if we have more
|
||||
// doesn't take inconsideration where the demod offset or bitlen found.
|
||||
int printDemodBuff(uint8_t offset, bool strip_leading, bool invert, bool print_hex) {
|
||||
size_t len = g_DemodBufferLen;
|
||||
|
@ -257,8 +257,8 @@ int printDemodBuff(uint8_t offset, bool strip_leading, bool invert, bool print_h
|
|||
len = (g_DemodBufferLen - offset);
|
||||
}
|
||||
|
||||
if (len > 512) {
|
||||
len = 512;
|
||||
if (len > MAX_DEMODULATION_BITS) {
|
||||
len = MAX_DEMODULATION_BITS;
|
||||
}
|
||||
|
||||
if (invert) {
|
||||
|
@ -275,7 +275,7 @@ int printDemodBuff(uint8_t offset, bool strip_leading, bool invert, bool print_h
|
|||
|
||||
if (print_hex) {
|
||||
p = (buf + offset);
|
||||
char hex[512] = {0x00};
|
||||
char hex[MAX_DEMODULATION_BITS + 1] = {0x00};
|
||||
int num_bits = binarraytohex(hex, sizeof(hex), (char *)p, len);
|
||||
if (num_bits == 0) {
|
||||
p = NULL;
|
||||
|
|
|
@ -53,8 +53,8 @@
|
|||
// **********************************************************************************************
|
||||
// ---------------------------------Utilities Section--------------------------------------------
|
||||
// **********************************************************************************************
|
||||
#define LOWEST_DEFAULT_CLOCK 32
|
||||
#define FSK_PSK_THRESHOLD 123
|
||||
#define LOWEST_DEFAULT_CLOCK 32
|
||||
#define FSK_PSK_THRESHOLD 123
|
||||
|
||||
//to allow debug print calls when used not on dev
|
||||
|
||||
|
@ -1496,7 +1496,7 @@ bool DetectST(uint8_t *buffer, size_t *size, int *foundclock, size_t *ststart, s
|
|||
static int millerRawDecode(uint8_t *bits, size_t *size, int invert) {
|
||||
if (*size < 16) return -1;
|
||||
|
||||
uint16_t MaxBits = 512, errCnt = 0;
|
||||
uint16_t MaxBits = MAX_DEMODULATION_BITS, errCnt = 0;
|
||||
size_t i, bitCnt = 0;
|
||||
uint8_t alignCnt = 0, curBit = bits[0], alignedIdx = 0, halfClkErr = 0;
|
||||
|
||||
|
@ -1540,7 +1540,7 @@ int BiphaseRawDecode(uint8_t *bits, size_t *size, int *offset, int invert) {
|
|||
uint16_t bitnum = 0;
|
||||
uint16_t errCnt = 0;
|
||||
size_t i = *offset;
|
||||
uint16_t maxbits = 512;
|
||||
uint16_t maxbits = MAX_DEMODULATION_BITS;
|
||||
|
||||
//check for phase change faults - skip one sample if faulty
|
||||
bool offsetA = true, offsetB = true;
|
||||
|
@ -1580,7 +1580,7 @@ uint16_t manrawdecode(uint8_t *bits, size_t *size, uint8_t invert, uint8_t *alig
|
|||
if (*size < 16) return 0xFFFF;
|
||||
|
||||
int errCnt = 0, bestErr = 1000;
|
||||
uint16_t bitnum = 0, maxBits = 512, bestRun = 0;
|
||||
uint16_t bitnum = 0, maxBits = MAX_DEMODULATION_BITS, bestRun = 0;
|
||||
size_t i;
|
||||
|
||||
//find correct start position [alignment]
|
||||
|
|
|
@ -30,6 +30,9 @@
|
|||
// ignore first x samples of the buffer
|
||||
#define SIGNAL_IGNORE_FIRST_SAMPLES 10
|
||||
|
||||
// Max number of bits when demodulating a signal
|
||||
#define MAX_DEMODULATION_BITS 4096
|
||||
|
||||
// generic
|
||||
typedef struct {
|
||||
int low;
|
||||
|
|
Loading…
Reference in a new issue