]> cvs.zerfleddert.de Git - proxmark3-svn/blob - client/mifarehost.h
8241ab70bcdc365d450833beaa2dfac63cbd31d1
[proxmark3-svn] / client / mifarehost.h
1 // Merlok, 2011
2 // people from mifare@nethemba.com, 2010
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 // High frequency ISO14443A commands
9 //-----------------------------------------------------------------------------
10
11 #include <stdio.h>
12 #include <stdlib.h>
13 #include <unistd.h>
14 #include "common.h"
15 #include "cmdmain.h"
16 #include "ui.h"
17 #include "data.h"
18 #include "proxusb.h"
19 #include "util.h"
20 #include "nonce2key/nonce2key.h"
21 #include "nonce2key/crapto1.h"
22
23 #define MEM_CHUNK 1000000
24 #define NESTED_SECTOR_RETRY 10
25
26 // mfCSetBlock work flags
27 #define CSETBLOCK_UID 0x01
28 #define CSETBLOCK_WUPC 0x02
29 #define CSETBLOCK_HALT 0x04
30 #define CSETBLOCK_INIT_FIELD 0x08
31 #define CSETBLOCK_RESET_FIELD 0x10
32 #define CSETBLOCK_SINGLE_OPER 0x1F
33
34 typedef struct fnVector { uint8_t blockNo, keyType; uint32_t uid, nt, ks1; } fnVector;
35
36 typedef struct {
37 uint64_t Key[2];
38 int foundKey[2];
39 } sector;
40
41 typedef struct {
42 uint64_t *possibleKeys;
43 uint32_t size;
44 } pKeys;
45
46 typedef struct {
47 uint64_t key;
48 int count;
49 } countKeys;
50
51 int mfnested(uint8_t blockNo, uint8_t keyType, uint8_t * key, uint8_t trgBlockNo, uint8_t trgKeyType, uint8_t * ResultKeys);
52 int mfCheckKeys (uint8_t blockNo, uint8_t keyType, uint8_t keycnt, uint8_t * keyBlock, uint64_t * key);
53 int mfEmlGetMem(uint8_t *data, int blockNum, int blocksCount);
54 int mfEmlSetMem(uint8_t *data, int blockNum, int blocksCount);
55 int mfCSetUID(uint8_t *uid, uint8_t *oldUID, int wantWipe);
56 int mfCSetBlock(uint8_t blockNo, uint8_t *data, uint8_t *uid, int wantWipe, uint8_t params);
57 int mfCGetBlock(uint8_t blockNo, uint8_t *data, uint8_t params);
Impressum, Datenschutz