]> git.zerfleddert.de Git - proxmark3-svn/blame - include/mifare.h
CHG: finalized the merge between peter filmoores 14atagfuzz branch (emv). I seriou...
[proxmark3-svn] / include / mifare.h
CommitLineData
ecab772e 1//-----------------------------------------------------------------------------
2// (c) 2012 Roel Verdult
3//
4// This code is licensed to you under the terms of the GNU GPL, version 2 or,
5// at your option, any later version. See the LICENSE.txt file for the text of
6// the license.
7//-----------------------------------------------------------------------------
8// MIFARE type prototyping
9//-----------------------------------------------------------------------------
10
11#ifndef _MIFARE_H_
12#define _MIFARE_H_
13
22e24700 14#include "common.h"
ecab772e 15
16//-----------------------------------------------------------------------------
17// ISO 14443A
18//-----------------------------------------------------------------------------
19typedef struct {
20 byte_t uid[10];
21 byte_t uidlen;
22 byte_t atqa[2];
23 byte_t sak;
24 byte_t ats_len;
25 byte_t ats[256];
26} __attribute__((__packed__)) iso14a_card_select_t;
27
28typedef enum ISO14A_COMMAND {
0ec548dc 29 ISO14A_CONNECT = (1 << 0),
30 ISO14A_NO_DISCONNECT = (1 << 1),
31 ISO14A_APDU = (1 << 2),
32 ISO14A_RAW = (1 << 3),
33 ISO14A_REQUEST_TRIGGER = (1 << 4),
34 ISO14A_APPEND_CRC = (1 << 5),
35 ISO14A_SET_TIMEOUT = (1 << 6),
36 ISO14A_NO_SELECT = (1 << 7),
37 ISO14A_TOPAZMODE = (1 << 8)
ecab772e 38} iso14a_command_t;
39
99136c6e 40typedef struct {
41 uint8_t* response;
42 size_t response_n;
43 uint8_t* modulation;
44 size_t modulation_n;
45 uint32_t ProxToAirDuration;
46} tag_response_info_t;
6fc68747 47//-----------------------------------------------------------------------------
48// ISO 14443B
49//-----------------------------------------------------------------------------
50typedef struct {
51 byte_t uid[10];
52 byte_t uidlen;
53 byte_t atqb[7];
54 byte_t chipid;
55 byte_t cid;
56} __attribute__((__packed__)) iso14b_card_select_t;
57
58
59typedef enum ISO14B_COMMAND {
60 ISO14B_CONNECT = (1 << 0),
61 ISO14B_DISCONNECT = (1 << 1),
62 ISO14B_APDU = (1 << 2),
63 ISO14B_RAW = (1 << 3),
64 ISO14B_REQUEST_TRIGGER = (1 << 4),
65 ISO14B_APPEND_CRC = (1 << 5),
66 ISO14B_SELECT_STD = (1 << 6),
67 ISO14B_SELECT_SR = (1 << 7)
68} iso14b_command_t;
69
e7470660 70//-----------------------------------------------------------------------------
71// "hf 14a sim x", "hf mf sim x" attacks
72//-----------------------------------------------------------------------------
73typedef struct {
74 uint32_t cuid;
e7470660 75 uint32_t nonce;
76 uint32_t ar;
77 uint32_t nr;
78 uint32_t nonce2;
79 uint32_t ar2;
80 uint32_t nr2;
bf5d7992 81 uint8_t sector;
82 uint8_t keytype;
84bdbc19 83 enum {
84 EMPTY,
85 FIRST,
86 SECOND,
87 } state;
e7470660 88} nonces_t;
6fc68747 89
ecab772e 90#endif // _MIFARE_H_
Impressum, Datenschutz