mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-24 23:25:40 -07:00
add mmbit
This commit is contained in:
parent
07e5f62cab
commit
4b55047c5b
1 changed files with 14 additions and 0 deletions
|
@ -191,6 +191,13 @@ static uint8_t TexcomTK13CRC(const uint8_t *data) {
|
|||
return crc;
|
||||
}
|
||||
|
||||
static uint8_t MMBITCRC(const uint8_t *data) {
|
||||
return
|
||||
(data[0] & 0x0f) ^ ((data[0] >> 4) & 0x0f) ^
|
||||
(data[1] & 0x0f) ^ ((data[1] >> 4) & 0x0f) ^
|
||||
(data[2] & 0x0f) ^ ((data[2] >> 4) & 0x0f);
|
||||
}
|
||||
|
||||
static unsigned char dallas_crc8(const unsigned char *data, const unsigned int size) {
|
||||
unsigned char crc = 0;
|
||||
for (unsigned int i = 0; i < size; ++i) {
|
||||
|
@ -539,6 +546,13 @@ int read_texkom_uid(bool loop, bool verbose) {
|
|||
if (verbose) {
|
||||
PrintAndLogEx(INFO, "CRC...... %s", (crc) ? _GREEN_("ok") : _RED_("fail"));
|
||||
}
|
||||
} else if (card.tcode[2] == 0xFF && card.tcode[3] == 0xFF) {
|
||||
PrintAndLogEx(INFO, "TYPE..... MMBIT");
|
||||
PrintAndLogEx(INFO, "UID...... " _GREEN_("%s"), sprint_hex(&card.tcode[4], 3));
|
||||
crc = (MMBITCRC(&card.tcode[4]) == card.tcode[7] >> 4);
|
||||
if (verbose) {
|
||||
PrintAndLogEx(INFO, "CRC...... %s", (crc) ? _GREEN_("ok") : _RED_("fail"));
|
||||
}
|
||||
}
|
||||
if (verbose) {
|
||||
PrintAndLogEx(INFO, "Raw... %s", sprint_hex(card.tcode, 8));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue