]> cvs.zerfleddert.de Git - proxmark3-svn/blame_incremental - client/mifarehost.h
FIX: Coverity, CID#121314, Explicit null dereferenced, in really odd occasions...
[proxmark3-svn] / client / mifarehost.h
... / ...
CommitLineData
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
14#include "common.h"\r
15#include "cmdmain.h"\r
16#include "ui.h"\r
17#include "data.h"\r
18#include "util.h"\r
19#include "nonce2key/nonce2key.h"\r
20#include "nonce2key/crapto1.h"\r
21#include "iso14443crc.h"\r
22#include "protocols.h"\r
23\r
24#define MEM_CHUNK 1000000\r
25#define NESTED_SECTOR_RETRY 10\r
26\r
27// mifare tracer flags\r
28#define TRACE_IDLE 0x00\r
29#define TRACE_AUTH1 0x01\r
30#define TRACE_AUTH2 0x02\r
31#define TRACE_AUTH_OK 0x03\r
32#define TRACE_READ_DATA 0x04\r
33#define TRACE_WRITE_OK 0x05\r
34#define TRACE_WRITE_DATA 0x06\r
35\r
36#define TRACE_ERROR 0xFF\r
37\r
38typedef struct {\r
39 uint64_t Key[2];\r
40 int foundKey[2];\r
41} sector;\r
42 \r
43extern char logHexFileName[FILE_PATH_SIZE];\r
44\r
45int mfnested(uint8_t blockNo, uint8_t keyType, uint8_t * key, uint8_t trgBlockNo, uint8_t trgKeyType, uint8_t * ResultKeys, bool calibrate);\r
46int mfCheckKeys (uint8_t blockNo, uint8_t keyType, bool clear_trace, uint8_t keycnt, uint8_t * keyBlock, uint64_t * key);\r
47\r
48int mfEmlGetMem(uint8_t *data, int blockNum, int blocksCount);\r
49int mfEmlSetMem(uint8_t *data, int blockNum, int blocksCount);\r
50int mfEmlSetMem_xt(uint8_t *data, int blockNum, int blocksCount, int blockBtWidth);\r
51\r
52int mfCSetUID(uint8_t *uid, uint8_t *atqa, uint8_t *sak, uint8_t *oldUID, uint8_t wipecard);\r
53int mfCSetBlock(uint8_t blockNo, uint8_t *data, uint8_t *uid, uint8_t params);\r
54int mfCGetBlock(uint8_t blockNo, uint8_t *data, uint8_t params);\r
55\r
56int mfTraceInit(uint8_t *tuid, uint8_t *atqa, uint8_t sak, bool wantSaveToEmlFile);\r
57int mfTraceDecode(uint8_t *data_src, int len, bool wantSaveToEmlFile);\r
58\r
59int isTraceCardEmpty(void);\r
60int isBlockEmpty(int blockN);\r
61int isBlockTrailer(int blockN);\r
62int loadTraceCard(uint8_t *tuid);\r
63int saveTraceCard(void);\r
64int tryDecryptWord(uint32_t nt, uint32_t ar_enc, uint32_t at_enc, uint8_t *data, int len);\r
Impressum, Datenschutz