mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-01-02 21:54:10 +08:00
CHG: enhanced the debug output for some LF demod/decode
This commit is contained in:
parent
22eece1e2d
commit
c08c796e8d
2 changed files with 22 additions and 18 deletions
|
@ -1512,17 +1512,17 @@ int CmdFSKdemodPyramid(const char *Cmd)
|
|||
if (idx < 0){
|
||||
if (g_debugMode){
|
||||
if (idx == -5)
|
||||
PrintAndLog("DEBUG: Error - not enough samples");
|
||||
PrintAndLog("DEBUG: Error - Pyramid: not enough samples");
|
||||
else if (idx == -1)
|
||||
PrintAndLog("DEBUG: Error - only noise found");
|
||||
PrintAndLog("DEBUG: Error - Pyramid: only noise found");
|
||||
else if (idx == -2)
|
||||
PrintAndLog("DEBUG: Error - problem during FSK demod");
|
||||
PrintAndLog("DEBUG: Error - Pyramid: problem during FSK demod");
|
||||
else if (idx == -3)
|
||||
PrintAndLog("DEBUG: Error - Size not correct: %d", size);
|
||||
PrintAndLog("DEBUG: Error - Pyramid: size not correct: %d", size);
|
||||
else if (idx == -4)
|
||||
PrintAndLog("DEBUG: Error - Pyramid preamble not found");
|
||||
PrintAndLog("DEBUG: Error - Pyramid: preamble not found");
|
||||
else
|
||||
PrintAndLog("DEBUG: Error - idx: %d",idx);
|
||||
PrintAndLog("DEBUG: Error - Pyramid: idx: %d",idx);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -1566,8 +1566,12 @@ int CmdFSKdemodPyramid(const char *Cmd)
|
|||
|
||||
size = removeParity(BitStream, idx+8, 8, 1, 120);
|
||||
if (size != 105){
|
||||
if (g_debugMode)
|
||||
PrintAndLog("DEBUG: Error at parity check - tag size does not match Pyramid format, SIZE: %d, IDX: %d, hi3: %x",size, idx, rawHi3);
|
||||
if (g_debugMode) {
|
||||
if ( size == 0)
|
||||
PrintAndLog("DEBUG: Error - Pyramid: parity check failed - IDX: %d, hi3: %08X", idx, rawHi3);
|
||||
else
|
||||
PrintAndLog("DEBUG: Error - Pyramid: at parity check - tag size does not match Pyramid format, SIZE: %d, IDX: %d, hi3: %08X", size, idx, rawHi3);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1625,7 +1629,7 @@ int CmdFSKdemodPyramid(const char *Cmd)
|
|||
PrintAndLog("Checksum %02x failed - should have been %02x", checksum, checkCS);
|
||||
|
||||
if (g_debugMode){
|
||||
PrintAndLog("DEBUG: idx: %d, Len: %d, Printing Demod Buffer:", idx, 128);
|
||||
PrintAndLog("DEBUG: Pyramid: idx: %d, Len: %d, Printing Demod Buffer:", idx, 128);
|
||||
printDemodBuff();
|
||||
}
|
||||
return 1;
|
||||
|
|
|
@ -815,7 +815,7 @@ int PyramiddemodFSK(uint8_t *dest, size_t *size)
|
|||
*size = fskdemod(dest, *size, 50, 1, 10, 8); // fsk2a RF/50
|
||||
if (*size < 128) return -2; //did we get a good demod?
|
||||
|
||||
uint8_t preamble[] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1};
|
||||
uint8_t preamble[] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1};
|
||||
size_t startIdx = 0;
|
||||
uint8_t errChk = preambleSearch(dest, preamble, sizeof(preamble), size, &startIdx);
|
||||
if (errChk == 0) return -4; //preamble not found
|
||||
|
|
Loading…
Reference in a new issue