]> git.zerfleddert.de Git - proxmark3-svn/blame - client/cmdhflist.h
Mfp read plain (#704)
[proxmark3-svn] / client / cmdhflist.h
CommitLineData
4f131b53 1//-----------------------------------------------------------------------------
2// Copyright (C) Merlok - 2017
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// Command: hf mf list. It shows data from arm buffer.
9//-----------------------------------------------------------------------------
6612a5a2 10#ifndef CMDHFLIST_H
11#define CMDHFLIST_H
4f131b53 12
6612a5a2 13#include <stdlib.h>
14#include <stdint.h>
15#include <stdbool.h>
4f131b53 16
aadc6bf1
OM
17typedef struct {
18 uint32_t uid; // UID
19 uint32_t nt; // tag challenge
20 uint32_t nt_enc; // encrypted tag challenge
21 uint8_t nt_enc_par; // encrypted tag challenge parity
22 uint32_t nr_enc; // encrypted reader challenge
23 uint32_t ar_enc; // encrypted reader response
24 uint8_t ar_enc_par; // encrypted reader response parity
25 uint32_t at_enc; // encrypted tag response
26 uint8_t at_enc_par; // encrypted tag response parity
27 bool first_auth; // is first authentication
e01bc794
OM
28 uint32_t ks2; // ar ^ ar_enc
29 uint32_t ks3; // at ^ at_enc
aadc6bf1
OM
30} TAuthData;
31extern void ClearAuthData();
32
6612a5a2 33extern uint8_t iso14443A_CRC_check(bool isResponse, uint8_t* data, uint8_t len);
34extern uint8_t mifare_CRC_check(bool isResponse, uint8_t* data, uint8_t len);
868deeb7 35extern void annotateIclass(char *exp, size_t size, uint8_t* cmd, uint8_t cmdsize);
36extern void annotateIso15693(char *exp, size_t size, uint8_t* cmd, uint8_t cmdsize);
37extern void annotateTopaz(char *exp, size_t size, uint8_t* cmd, uint8_t cmdsize);
38extern void annotateIso14443b(char *exp, size_t size, uint8_t* cmd, uint8_t cmdsize);
6612a5a2 39extern void annotateIso14443a(char *exp, size_t size, uint8_t* cmd, uint8_t cmdsize);
b957bcd3 40extern void annotateMifare(char *exp, size_t size, uint8_t* cmd, uint8_t cmdsize, uint8_t* parity, uint8_t paritysize, bool isResponse);
2d7bdee3 41extern bool DecodeMifareData(uint8_t *cmd, uint8_t cmdsize, uint8_t *parity, bool isResponse, uint8_t *mfData, size_t *mfDataLen);
7bea1581 42extern bool NTParityChk(TAuthData *ad, uint32_t ntx);
2d7bdee3 43extern bool NestedCheckKey(uint64_t key, TAuthData *ad, uint8_t *cmd, uint8_t cmdsize, uint8_t *parity);
597fca4f 44extern bool CheckCrypto1Parity(uint8_t *cmd_enc, uint8_t cmdsize, uint8_t *cmd, uint8_t *parity_enc);
0113dcf3 45extern uint64_t GetCrypto1ProbableKey(TAuthData *ad);
6612a5a2 46
47#endif // CMDHFLIST
Impressum, Datenschutz