]> git.zerfleddert.de Git - proxmark3-svn/blob - armsrc/mifareutil.h
715dfe63c05d83cd998843dc28f2fcd255a4b497
[proxmark3-svn] / armsrc / mifareutil.h
1 //-----------------------------------------------------------------------------
2 // Merlok, May 2011
3 // Many authors, that makes it possible
4 //
5 // This code is licensed to you under the terms of the GNU GPL, version 2 or,
6 // at your option, any later version. See the LICENSE.txt file for the text of
7 // the license.
8 //-----------------------------------------------------------------------------
9 // code for work with mifare cards.
10 //-----------------------------------------------------------------------------
11
12 #define CRYPT_NONE 0
13 #define CRYPT_ALL 1
14 #define CRYPT_REQUEST 2
15 #define AUTH_FIRST 0
16 #define AUTH_NESTED 2
17
18 //mifare emulate states
19 #define MFEMUL_NOFIELD 0
20 #define MFEMUL_IDLE 1
21 #define MFEMUL_SELECT1 2
22 #define MFEMUL_SELECT2 3
23 #define MFEMUL_AUTH1 4
24 #define MFEMUL_AUTH2 5
25 #define MFEMUL_HALTED 6
26
27 //functions
28 uint8_t* mifare_get_bigbufptr(void);
29 int mifare_sendcmd_short(struct Crypto1State *pcs, uint8_t crypted, uint8_t cmd, uint8_t data, uint8_t* answer);
30 int mifare_sendcmd_shortex(struct Crypto1State *pcs, uint8_t crypted, uint8_t cmd, uint8_t data, uint8_t* answer, uint32_t * parptr);
31
32 int mifare_classic_auth(struct Crypto1State *pcs, uint32_t uid, \
33 uint8_t blockNo, uint8_t keyType, uint64_t ui64Key, uint64_t isNested);
34 int mifare_classic_authex(struct Crypto1State *pcs, uint32_t uid, \
35 uint8_t blockNo, uint8_t keyType, uint64_t ui64Key, uint64_t isNested, uint32_t * ntptr);
36 int mifare_classic_readblock(struct Crypto1State *pcs, uint32_t uid, uint8_t blockNo, uint8_t *blockData);
37 int mifare_classic_writeblock(struct Crypto1State *pcs, uint32_t uid, uint8_t blockNo, uint8_t *blockData);
38 int mifare_classic_halt(struct Crypto1State *pcs, uint32_t uid);
39
Impressum, Datenschutz