diff --git a/CHANGELOG.md b/CHANGELOG.md index 9e2359f72..c9d8dcd19 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,8 @@ This project uses the changelog in accordance with [keepchangelog](http://keepac - Added support for PCSC's proprietary HID 37bit format P10004 (@bthedorff) - Added `nfc decode` - now NDEF vCard messages with a PHOTO in base64 format is shown (@iceman1001) - Changed - AID limitations when using Gallagher key diversification (@DarkMatterMatt) + - Fixed build issues that may happen from building `mfd_aes_brute` (@linuxgemini) + - Added silicon data parsing logic for NXP chips in `hf mfu info` (@linuxgemini) ## [Frostbit.4.14831] [2022-01-11] - Changed Wiegand format lookup - now case-insensitive (@iceman1001) diff --git a/client/src/cmdhfmfu.c b/client/src/cmdhfmfu.c index ac333df6f..7e94619f4 100644 --- a/client/src/cmdhfmfu.c +++ b/client/src/cmdhfmfu.c @@ -123,6 +123,31 @@ static char *getProductTypeStr(uint8_t id) { return buf; } +static int ul_print_nxp_silicon_info(uint8_t *card_uid) { + + uint8_t uid[7]; + memcpy(&uid, card_uid, 7); + + if (uid[0] != 0x04) { + return PM3_SUCCESS; + } + + uint8_t maskedBit1 = uid[6] & -1; + uint8_t maskedBit2 = uid[3] & -1; + unsigned long waferCoordX = ((maskedBit1 & 3) << 8) | (uid[1] & -1); + unsigned long waferCoordY = ((maskedBit1 & 12) << 6) | (uid[2] & -1); + unsigned long waferCounter = ((uid[4] & -1) << 5) | ((maskedBit1 & 240) << 17) | ((uid[5] & -1) << 13) | (maskedBit2 >> 3); + unsigned long testSite = maskedBit2 & 7; + + PrintAndLogEx(NORMAL, ""); + PrintAndLogEx(INFO, "--- " _CYAN_("Tag Silicon Information")); + PrintAndLogEx(INFO, " Wafer Counter: %ld (0x%02lX)", waferCounter, waferCounter); + PrintAndLogEx(INFO, " Wafer Coordinates: [%ld, %ld] (0x%02lX, 0x%02lX)", waferCoordX, waferCoordY, waferCoordX, waferCoordY); + PrintAndLogEx(INFO, " Test Site: %ld", testSite); + + return PM3_SUCCESS; +} + /* The 7 MSBits (=n) code the storage size itself based on 2^n, the LSBit is set to '0' if the size is exactly 2^n @@ -1644,6 +1669,9 @@ static int CmdHF14AMfUInfo(const char *Cmd) { } } + // print silicon info + ul_print_nxp_silicon_info(card.uid); + // Get Version uint8_t version[10] = {0x00}; status = ulev1_getVersion(version, sizeof(version));