]> git.zerfleddert.de Git - proxmark3-svn/blob - client/cmdlft55xx.h
cleaning up uart_posix.c
[proxmark3-svn] / client / cmdlft55xx.h
1 //-----------------------------------------------------------------------------
2 //
3 // This code is licensed to you under the terms of the GNU GPL, version 2 or,
4 // at your option, any later version. See the LICENSE.txt file for the text of
5 // the license.
6 //-----------------------------------------------------------------------------
7 // Low frequency T55xx commands
8 //-----------------------------------------------------------------------------
9
10 #ifndef CMDLFT55XX_H__
11 #define CMDLFT55XX_H__
12
13 #include <stdint.h>
14 #include <stdbool.h>
15
16 typedef struct {
17 uint32_t bl1;
18 uint32_t bl2;
19 uint32_t acl;
20 uint32_t mfc;
21 uint32_t cid;
22 uint32_t year;
23 uint32_t quarter;
24 uint32_t icr;
25 uint32_t lotid;
26 uint32_t wafer;
27 uint32_t dw;
28 } t55x7_tracedata_t;
29
30 typedef struct {
31 uint32_t bl1;
32 uint32_t bl2;
33 uint32_t icr;
34 char lotidc;
35 uint32_t lotid;
36 uint32_t wafer;
37 uint32_t dw;
38 } t5555_tracedata_t;
39
40 typedef struct {
41 enum {
42 DEMOD_NRZ = 0x00,
43 DEMOD_PSK1 = 0x01,
44 DEMOD_PSK2 = 0x02,
45 DEMOD_PSK3 = 0x03,
46 DEMOD_FSK1 = 0x04,
47 DEMOD_FSK1a = 0x05,
48 DEMOD_FSK2 = 0x06,
49 DEMOD_FSK2a = 0x07,
50 DEMOD_FSK = 0xF0, //generic FSK (auto detect FCs)
51 DEMOD_ASK = 0x08,
52 DEMOD_BI = 0x10,
53 DEMOD_BIa = 0x18
54 } modulation;
55 bool inverted;
56 uint8_t offset;
57 uint32_t block0;
58 enum {
59 RF_8 = 0x00,
60 RF_16 = 0x01,
61 RF_32 = 0x02,
62 RF_40 = 0x03,
63 RF_50 = 0x04,
64 RF_64 = 0x05,
65 RF_100 = 0x06,
66 RF_128 = 0x07
67 } bitrate;
68 bool Q5;
69 bool ST;
70 } t55xx_conf_block_t;
71
72 t55xx_conf_block_t Get_t55xx_Config(void);
73 void Set_t55xx_Config(t55xx_conf_block_t conf);
74
75 extern int CmdLFT55XX(const char *Cmd);
76 extern int CmdT55xxBruteForce(const char *Cmd);
77 extern int CmdT55xxSetConfig(const char *Cmd);
78 extern int CmdT55xxReadBlock(const char *Cmd);
79 extern int CmdT55xxWriteBlock(const char *Cmd);
80 extern int CmdT55xxReadTrace(const char *Cmd);
81 extern int CmdT55xxInfo(const char *Cmd);
82 extern int CmdT55xxDetect(const char *Cmd);
83 extern int CmdResetRead(const char *Cmd);
84 extern int CmdT55xxWipe(const char *Cmd);
85
86 char * GetBitRateStr(uint32_t id, bool xmode);
87 char * GetSaferStr(uint32_t id);
88 char * GetModulationStr( uint32_t id);
89 char * GetModelStrFromCID(uint32_t cid);
90 char * GetSelectedModulationStr( uint8_t id);
91 uint32_t PackBits(uint8_t start, uint8_t len, uint8_t *bitstream);
92 void printT5xxHeader(uint8_t page);
93 void printT55xxBlock(const char *demodStr);
94 int printConfiguration( t55xx_conf_block_t b);
95
96 bool DecodeT55xxBlock(void);
97 bool tryDetectModulation(void);
98 extern bool tryDetectP1(bool getData);
99 bool test(uint8_t mode, uint8_t *offset, int *fndBitRate, uint8_t clk, bool *Q5);
100 int special(const char *Cmd);
101 int AquireData( uint8_t page, uint8_t block, bool pwdmode, uint32_t password,uint8_t downlink_mode );
102
103 void printT55x7Trace( t55x7_tracedata_t data, uint8_t repeat );
104 void printT5555Trace( t5555_tracedata_t data, uint8_t repeat );
105
106 #endif
Impressum, Datenschutz