proxmark3/client/src/cmdhfst.c

69 lines
2.2 KiB
C
Raw Normal View History

//-----------------------------------------------------------------------------
2022-01-07 08:58:03 +08:00
// Copyright (C) Proxmark3 contributors. See AUTHORS.md for details.
//
2022-01-07 08:58:03 +08:00
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// See LICENSE.txt for the text of the license.
//-----------------------------------------------------------------------------
// High frequency ISO14443A / ST commands
//-----------------------------------------------------------------------------
#include "cmdhfst.h"
2021-05-30 20:55:58 +08:00
#include <string.h>
#include <stdio.h>
#define TIMEOUT 2000
2020-09-12 21:11:43 +08:00
// get ST Microelectronics chip model (from UID)
2022-06-12 03:02:48 +08:00
const char *get_st_chip_model(uint8_t pc) {
2020-09-12 21:11:43 +08:00
switch (pc) {
case 0x0:
2022-06-12 03:02:48 +08:00
return "SRIX4K (Special)";
case 0x2:
2022-06-12 03:02:48 +08:00
return "SR176";
case 0x3:
2022-06-12 03:02:48 +08:00
return "SRIX4K";
case 0x4:
2022-06-12 03:02:48 +08:00
return "SRIX512";
case 0x6:
2022-06-12 03:02:48 +08:00
return "SRI512";
case 0x7:
2022-06-12 03:02:48 +08:00
return "SRI4K";
case 0xC:
2022-06-12 03:02:48 +08:00
return "SRT512";
2020-09-16 04:51:36 +08:00
case 0xC4:
2022-06-12 03:02:48 +08:00
return "ST25TA64K";
2020-09-12 21:11:43 +08:00
case 0xE2:
2022-06-12 03:02:48 +08:00
return "ST25??? IKEA Rothult";
2020-09-12 21:11:43 +08:00
case 0xE3:
2022-06-12 03:02:48 +08:00
return "ST25TA02KB";
2020-09-30 20:27:19 +08:00
case 0xE4:
2022-06-12 03:02:48 +08:00
return "ST25TA512B";
2020-09-12 21:11:43 +08:00
case 0xA3:
2022-06-12 03:02:48 +08:00
return "ST25TA02KB-P";
2020-09-12 21:11:43 +08:00
case 0xF3:
2022-06-12 03:02:48 +08:00
return "ST25TA02KB-D";
default:
return "Unknown";
}
}
2020-09-12 21:11:43 +08:00
/*
// print UID info from SRx chips (ST Microelectronics)
2021-05-30 20:55:58 +08:00
void print_st_general_info(uint8_t *data, uint8_t len) {
//uid = first 8 bytes in data
PrintAndLogEx(NORMAL, "");
PrintAndLogEx(SUCCESS, " UID: " _GREEN_("%s"), sprint_hex(SwapEndian64(data, 8, 8), len));
PrintAndLogEx(SUCCESS, " MFG: %02X, " _YELLOW_("%s"), data[6], getTagInfo(data[6]));
PrintAndLogEx(SUCCESS, "Chip: %02X, " _YELLOW_("%s"), data[5] >> 2, get_st_chip_model(data[5] >> 2));
}
*/