]>
Commit | Line | Data |
---|---|---|
f397b5cc M |
1 | // Merlok, 2011\r |
2 | // people from mifare@nethemba.com, 2010\r | |
3 | //\r | |
4 | // This code is licensed to you under the terms of the GNU GPL, version 2 or,\r | |
5 | // at your option, any later version. See the LICENSE.txt file for the text of\r | |
6 | // the license.\r | |
7 | //-----------------------------------------------------------------------------\r | |
8 | // High frequency ISO14443A commands\r | |
9 | //-----------------------------------------------------------------------------\r | |
10 | \r | |
11 | #include <stdio.h>\r | |
12 | #include <stdlib.h>\r | |
13 | #include <unistd.h>\r | |
f397b5cc M |
14 | #include "common.h"\r |
15 | #include "cmdmain.h"\r | |
16 | #include "ui.h"\r | |
17 | #include "data.h"\r | |
18 | #include "proxusb.h"\r | |
19 | #include "util.h"\r | |
20 | #include "nonce2key/nonce2key.h"\r | |
21 | #include "nonce2key/crapto1.h"\r | |
22 | \r | |
23 | #define MEM_CHUNK 1000000\r | |
24 | #define NESTED_SECTOR_RETRY 10\r | |
25 | \r | |
26 | typedef struct fnVector { uint8_t blockNo, keyType; uint32_t uid, nt, ks1; } fnVector;\r | |
27 | \r | |
28 | typedef struct {\r | |
29 | uint64_t Key[2];\r | |
30 | int foundKey[2];\r | |
31 | } sector;\r | |
32 | \r | |
33 | typedef struct {\r | |
34 | uint64_t *possibleKeys;\r | |
35 | uint32_t size;\r | |
36 | } pKeys;\r | |
37 | \r | |
38 | typedef struct {\r | |
39 | uint64_t key;\r | |
40 | int count;\r | |
41 | } countKeys;\r | |
42 | \r | |
43 | int mfnested(uint8_t blockNo, uint8_t keyType, uint8_t * key, uint8_t trgBlockNo, uint8_t trgKeyType, uint8_t * ResultKeys);\r | |
44 | int mfCheckKeys (uint8_t blockNo, uint8_t keyType, uint8_t keycnt, uint8_t * keyBlock, uint64_t * key);\r | |
8556b852 M |
45 | int mfEmlGetMem(uint8_t *data, int blockNum, int blocksCount);\r |
46 | int mfEmlSetMem(uint8_t *data, int blockNum, int blocksCount);\r | |
f397b5cc | 47 | \r |