2020-10-02 20:30:15 +08:00
|
|
|
//-----------------------------------------------------------------------------
|
2022-01-07 08:58:03 +08:00
|
|
|
// Copyright (C) Proxmark3 contributors. See AUTHORS.md for details.
|
2020-10-02 20:30:15 +08:00
|
|
|
//
|
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.
|
2020-10-02 20:30:15 +08:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// ISO 15693 type prototyping
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
#ifndef _ISO15_H_
|
|
|
|
#define _ISO15_H_
|
|
|
|
|
|
|
|
#include "common.h"
|
2020-10-07 00:00:00 +08:00
|
|
|
typedef struct {
|
2021-05-05 15:55:58 +08:00
|
|
|
uint8_t uid[8];
|
2020-10-02 20:30:15 +08:00
|
|
|
uint8_t uidlen;
|
|
|
|
uint8_t atqb[7];
|
|
|
|
uint8_t chipid;
|
|
|
|
uint8_t cid;
|
2021-05-05 15:55:58 +08:00
|
|
|
} PACKED iso15_card_select_t;
|
2020-10-02 20:30:15 +08:00
|
|
|
|
|
|
|
typedef enum ISO15_COMMAND {
|
2020-10-07 00:00:00 +08:00
|
|
|
ISO15_CONNECT = (1 << 0),
|
|
|
|
ISO15_NO_DISCONNECT = (1 << 1),
|
|
|
|
ISO15_RAW = (1 << 2),
|
|
|
|
ISO15_APPEND_CRC = (1 << 3),
|
|
|
|
ISO15_HIGH_SPEED = (1 << 4),
|
2024-01-14 21:23:51 +08:00
|
|
|
ISO15_READ_RESPONSE = (1 << 5),
|
|
|
|
ISO15_LONG_WAIT = (1 << 6),
|
2020-10-02 20:30:15 +08:00
|
|
|
} iso15_command_t;
|
|
|
|
|
2024-01-14 21:23:51 +08:00
|
|
|
typedef struct {
|
2024-01-14 23:17:40 +08:00
|
|
|
uint8_t flags; // PM3 Flags - see iso15_command_t
|
2024-01-14 21:23:51 +08:00
|
|
|
uint16_t rawlen;
|
2024-01-14 23:17:40 +08:00
|
|
|
uint8_t raw[]; // First byte in raw, raw[0] is ISO15693 protocol flag byte
|
2024-01-14 21:23:51 +08:00
|
|
|
} PACKED iso15_raw_cmd_t;
|
2020-10-02 20:30:15 +08:00
|
|
|
|
2024-01-26 21:25:39 +08:00
|
|
|
#define ISO15693_TAG_MAX_PAGES 160 // in pages (0xA0)
|
2024-01-23 22:41:33 +08:00
|
|
|
#define ISO15693_TAG_MAX_SIZE 2048 // in byte (64 pages of 256 bits)
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
uint8_t uid[8];
|
|
|
|
uint8_t dsfid;
|
|
|
|
bool dsfidLock;
|
|
|
|
uint8_t afi;
|
|
|
|
bool afiLock;
|
|
|
|
uint8_t bytesPerPage;
|
|
|
|
uint8_t pagesCount;
|
|
|
|
uint8_t ic;
|
|
|
|
uint8_t locks[ISO15693_TAG_MAX_PAGES];
|
|
|
|
uint8_t data[ISO15693_TAG_MAX_SIZE];
|
|
|
|
uint8_t random[2];
|
|
|
|
uint8_t privacyPasswd[4];
|
|
|
|
enum {
|
|
|
|
TAG_STATE_NO_FIELD,
|
|
|
|
TAG_STATE_READY,
|
|
|
|
TAG_STATE_ACTIVATED, // useless ?
|
|
|
|
TAG_STATE_SELECTED,
|
|
|
|
TAG_STATE_SILENCED
|
|
|
|
} state;
|
|
|
|
bool expectFast;
|
|
|
|
bool expectFsk;
|
|
|
|
} PACKED iso15_tag_t;
|
|
|
|
|
2020-10-07 00:00:00 +08:00
|
|
|
#endif // _ISO15_H_
|