]> git.zerfleddert.de Git - proxmark3-svn/blame - include/hitagS.h
FIX: corrected the FLAG_NR_AR_ATTACK
[proxmark3-svn] / include / hitagS.h
CommitLineData
0db11b71 1//-----------------------------------------------------------------------------
2// This code is licensed to you under the terms of the GNU GPL, version 2 or,
3// at your option, any later version. See the LICENSE.txt file for the text of
4// the license.
5//-----------------------------------------------------------------------------
6// HitagS emulation (preliminary test version)
7//
8// (c) 2016 Oguzhan Cicek, Hendrik Schwartke, Ralf Spenneberg
9// <info@os-s.de>
10//-----------------------------------------------------------------------------
11
12
13#include <stdio.h>
14#include <stdlib.h>
15#include <string.h>
16#include <hitag2.h>
17
18#ifndef _HITAGS_H_
19#define _HITAGS_H_
20
21//protocol-state
22typedef enum PROTO_STATE {
23 HT_READY=0,
24 HT_INIT,
25 HT_AUTHENTICATE,
26 HT_SELECTED,
27 HT_QUIET,
28 HT_TTF,
29 HT_FAIL} PSTATE;
30
31//tag-state
32typedef enum TAG_STATE {
33 HT_NO_OP=0,
34 HT_READING_PAGE,
35 HT_WRITING_PAGE_ACK,
36 HT_WRITING_PAGE_DATA,
37 HT_WRITING_BLOCK_DATA} TSATE;
38
39//number of start-of-frame bits
40typedef enum SOF_TYPE {
41 HT_STANDARD=0,
42 HT_ADVANCED,
43 HT_FAST_ADVANCED,
44 HT_ONE,
45 HT_NO_BITS} stype;
46
47struct hitagS_tag {
48 PSTATE pstate; //protocol-state
49 TSATE tstate; //tag-state
50 uint32_t uid;
51 uint32_t pages[16][4];
52 uint64_t key;
53 byte_t pwdl0, pwdl1, pwdh0;
54 //con0
55 int max_page;
56 stype mode;
57 //con1
58 bool auth; //0=Plain 1=Auth
59 bool TTFC; //Transponder Talks first coding. 0=Manchester 1=Biphase
60 int TTFDR; //data rate in TTF Mode
61 int TTFM; //the number of pages that are sent to the RWD
62 bool LCON; //0=con1/2 read write 1=con1 read only and con2 OTP
63 bool LKP; //0=page2/3 read write 1=page2/3 read only in Plain mode and no access in authenticate mode
64 //con2
65 //0=read write 1=read only
66 bool LCK7; //page4/5
67 bool LCK6; //page6/7
68 bool LCK5; //page8-11
69 bool LCK4; //page12-15
70 bool LCK3; //page16-23
71 bool LCK2; //page24-31
72 bool LCK1; //page32-47
73 bool LCK0; //page48-63
74} ;
75
76#endif
Impressum, Datenschutz