diff --git a/CHANGELOG.md b/CHANGELOG.md index 0bc8e9ece..bd3d91adf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ All notable changes to this project will be documented in this file. This project uses the changelog in accordance with [keepchangelog](http://keepachangelog.com/). Please use this to write notable changes, which is not the same as git commit log... ## [unreleased][unreleased] + - Added mmbit-002 (kibi-002, kb5004xk1) russian tag to `hf texkom read` command (@merlokk) - Added `hf sniff --smode` skip/group adc data to consume less memory. Now it can sniff very long signals (@merlokk) - Added `hf fudan` skeleton commands (@iceman1001) - Added `--reboot-to-bootloader` arg to pm3 diff --git a/client/src/cmdhftexkom.c b/client/src/cmdhftexkom.c index 18a1f5c48..b62460e6c 100644 --- a/client/src/cmdhftexkom.c +++ b/client/src/cmdhftexkom.c @@ -191,6 +191,15 @@ 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) + ) ^ 0x0f + ) & 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 +548,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)); @@ -707,6 +723,18 @@ static int CmdHFTexkomReader(const char *Cmd) { else PrintAndLogEx(WARNING, "crc : WRONG"); + } else if (tcode[2] == 0xFF && tcode[3] == 0xFF) { + // MMBIT + if (codefound != TexkomModTK13) { + PrintAndLogEx(WARNING, " mod type: WRONG"); + } + PrintAndLogEx(INFO, "type : MMBIT"); + PrintAndLogEx(INFO, "uid : %s", sprint_hex(&tcode[4], 3)); + + if (MMBITCRC(&tcode[4]) == tcode[7] >> 4) + PrintAndLogEx(INFO, "crc : OK"); + else + PrintAndLogEx(WARNING, "crc : WRONG"); } else if (tcode[2] == 0xCA) { // TK17 if (codefound != TexkomModTK17) {