mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-20 21:33:47 -07:00
binarraytohex: handle Manchester wrong bit markers
This commit is contained in:
parent
da5ad8438c
commit
f1a0e57f65
4 changed files with 46 additions and 22 deletions
|
@ -417,18 +417,17 @@ int CmdPrintDemodBuff(const char *Cmd) {
|
|||
return 0;
|
||||
}
|
||||
length = (length > (DemodBufferLen - offset)) ? DemodBufferLen - offset : length;
|
||||
int numBits = (length) & 0x00FFC; //make sure we don't exceed our string
|
||||
|
||||
if (hexMode) {
|
||||
char *buf = (char *)(DemodBuffer + offset);
|
||||
numBits = (numBits > sizeof(hex)) ? sizeof(hex) : numBits;
|
||||
numBits = binarraytohex(hex, buf, numBits);
|
||||
int numBits = binarraytohex(hex, sizeof(hex), buf, length);
|
||||
if (numBits == 0) {
|
||||
return 0;
|
||||
}
|
||||
PrintAndLogEx(NORMAL, "DemodBuffer: %i bits consumed", numBits);
|
||||
PrintAndLogEx(NORMAL, "DemodBuffer: %s", hex);
|
||||
} else {
|
||||
PrintAndLogEx(NORMAL, "DemodBuffer:\n%s", sprint_bin_break(DemodBuffer + offset, numBits, 16));
|
||||
PrintAndLogEx(NORMAL, "DemodBuffer:\n%s", sprint_bin_break(DemodBuffer + offset, length, 16));
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue