2019-03-09 15:49:41 +08:00
|
|
|
//-----------------------------------------------------------------------------
|
2019-08-08 22:57:33 +08:00
|
|
|
// Jonathan Westhues, Aug 2005
|
|
|
|
// Gerhard de Koning Gans, April 2008, May 2011
|
2019-03-09 15:49:41 +08:00
|
|
|
//
|
|
|
|
// 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.
|
|
|
|
//-----------------------------------------------------------------------------
|
2019-08-08 22:57:33 +08:00
|
|
|
// Definitions internal to the app source.
|
2019-03-09 15:49:41 +08:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
#ifndef __MIFARECMD_H
|
|
|
|
#define __MIFARECMD_H
|
|
|
|
|
|
|
|
#include "common.h"
|
2019-08-08 22:57:33 +08:00
|
|
|
|
|
|
|
void MifareReadBlock(uint8_t blockNo, uint8_t keyType, uint8_t *datain);
|
|
|
|
|
|
|
|
void MifareUReadBlock(uint8_t arg0, uint8_t arg1, uint8_t *datain);
|
|
|
|
void MifareUC_Auth(uint8_t arg0, uint8_t *keybytes);
|
|
|
|
void MifareUReadCard(uint8_t arg0, uint16_t arg1, uint8_t arg2, uint8_t *datain);
|
|
|
|
void MifareReadSector(uint8_t arg0, uint8_t arg1, uint8_t *datain);
|
|
|
|
void MifareWriteBlock(uint8_t arg0, uint8_t arg1, uint8_t *datain);
|
|
|
|
//void MifareUWriteBlockCompat(uint8_t arg0,uint8_t *datain);
|
2019-10-03 22:15:47 +08:00
|
|
|
|
2019-08-08 22:57:33 +08:00
|
|
|
void MifareUWriteBlock(uint8_t arg0, uint8_t arg1, uint8_t *datain);
|
2019-10-03 22:15:47 +08:00
|
|
|
void MifareNested(uint8_t blockNo, uint8_t keyType, uint8_t targetBlockNo, uint8_t targetKeyType, bool calibrate, uint8_t *key);
|
|
|
|
|
2019-08-08 22:57:33 +08:00
|
|
|
void MifareAcquireEncryptedNonces(uint32_t arg0, uint32_t arg1, uint32_t flags, uint8_t *datain);
|
|
|
|
void MifareAcquireNonces(uint32_t arg0, uint32_t flags);
|
|
|
|
void MifareChkKeys(uint8_t *datain);
|
|
|
|
void MifareChkKeys_fast(uint32_t arg0, uint32_t arg1, uint32_t arg2, uint8_t *datain);
|
|
|
|
|
|
|
|
void MifareEMemClr(void);
|
|
|
|
void MifareEMemSet(uint8_t blockno, uint8_t blockcnt, uint8_t blockwidth, uint8_t *datain);
|
|
|
|
void MifareEMemGet(uint8_t blockno, uint8_t blockcnt);
|
2019-08-29 03:23:31 +08:00
|
|
|
int MifareECardLoad(uint8_t sectorcnt, uint8_t keytype);
|
|
|
|
int MifareECardLoadExt(uint8_t numSectors, uint8_t keyType);
|
2019-08-08 22:57:33 +08:00
|
|
|
|
|
|
|
void MifareCSetBlock(uint32_t arg0, uint32_t arg1, uint8_t *datain); // Work with "magic Chinese" card
|
|
|
|
void MifareCGetBlock(uint32_t arg0, uint32_t arg1, uint8_t *datain);
|
|
|
|
void MifareCIdent(); // is "magic chinese" card?
|
|
|
|
|
|
|
|
void MifareSetMod(uint8_t *datain);
|
|
|
|
void MifareUSetPwd(uint8_t arg0, uint8_t *datain);
|
|
|
|
void OnSuccessMagic();
|
|
|
|
void OnErrorMagic(uint8_t reason);
|
|
|
|
|
|
|
|
int32_t dist_nt(uint32_t nt1, uint32_t nt2);
|
|
|
|
void ReaderMifare(bool first_try, uint8_t block, uint8_t keytype);
|
|
|
|
//void RAMFUNC SniffMifare(uint8_t param);
|
|
|
|
|
|
|
|
void Mifare_DES_Auth1(uint8_t arg0, uint8_t *datain);
|
|
|
|
void Mifare_DES_Auth2(uint32_t arg0, uint8_t *datain);
|
|
|
|
|
2019-11-08 17:28:29 +08:00
|
|
|
// Tear-off test for MFU
|
|
|
|
void MifareU_Otp_Tearoff();
|
|
|
|
|
2019-03-12 07:12:26 +08:00
|
|
|
#endif
|