proxmark3/client/cmdhficlass.h

41 lines
1.5 KiB
C
Raw Normal View History

//-----------------------------------------------------------------------------
// Copyright (C) 2010 iZsh <izsh at fail0verflow.com>
// Copyright (C) 2011 Gerhard de Koning Gans
//
// This code is licensed to you under the terms of the GNU GPL, version 2 or,
// at your option, any later version. See the LICENSE.txt file for the text of
// the license.
//-----------------------------------------------------------------------------
// High frequency iClass support
//-----------------------------------------------------------------------------
#ifndef CMDHFICLASS_H__
#define CMDHFICLASS_H__
#include "common.h"
#include "fileutils.h"
2017-12-24 17:59:24 +08:00
typedef struct iclass_block {
uint8_t d[8];
} iclass_block_t;
typedef struct iclass_premac {
2019-03-10 06:35:06 +08:00
uint8_t mac[4];
} iclass_premac_t;
typedef struct iclass_prekey {
2019-03-10 06:35:06 +08:00
uint8_t mac[4];
uint8_t key[8];
} iclass_prekey_t;
2017-12-24 17:59:24 +08:00
int CmdHFiClass(const char *Cmd);
int readIclass(bool loop, bool verbose);
void printIclassDumpContents(uint8_t *iclass_dump, uint8_t startblock, uint8_t endblock, size_t filesize);
2019-03-10 06:35:06 +08:00
void HFiClassCalcDivKey(uint8_t *CSN, uint8_t *KEY, uint8_t *div_key, bool elite);
void GenerateMacFrom(uint8_t *CSN, uint8_t *CCNR, bool use_raw, bool use_elite, uint8_t *keys, int keycnt, iclass_premac_t *list);
void GenerateMacKeyFrom(uint8_t *CSN, uint8_t *CCNR, bool use_raw, bool use_elite, uint8_t *keys, int keycnt, iclass_prekey_t *list);
2019-03-10 07:00:59 +08:00
void PrintPreCalcMac(uint8_t *keys, int keycnt, iclass_premac_t *pre_list);
void PrintPreCalc(iclass_prekey_t *list, int itemcnt);
#endif