mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-14 18:48:13 -07:00
Sync from Upstream
This commit is contained in:
parent
ea53e1f981
commit
6a52b6074f
161 changed files with 2002 additions and 1463 deletions
|
@ -375,7 +375,7 @@ typedef struct _AT91S_DBGU {
|
|||
#define AT91C_US_TXBUFE (0x1 << 11) // (DBGU) TXBUFE Interrupt
|
||||
#define AT91C_US_RXBUFF (0x1 << 12) // (DBGU) RXBUFF Interrupt
|
||||
#define AT91C_US_COMM_TX (0x1 << 30) // (DBGU) COMM_TX Interrupt
|
||||
#define AT91C_US_COMM_RX (0x1 << 31) // (DBGU) COMM_RX Interrupt
|
||||
#define AT91C_US_COMM_RX (0x1u << 31) // (DBGU) COMM_RX Interrupt
|
||||
// -------- DBGU_IDR : (DBGU Offset: 0xc) Debug Unit Interrupt Disable Register --------
|
||||
// -------- DBGU_IMR : (DBGU Offset: 0x10) Debug Unit Interrupt Mask Register --------
|
||||
// -------- DBGU_CSR : (DBGU Offset: 0x14) Debug Unit Channel Status Register --------
|
||||
|
|
|
@ -115,4 +115,4 @@ typedef struct {
|
|||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
|
117
include/hitag.h
Normal file
117
include/hitag.h
Normal file
|
@ -0,0 +1,117 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// 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.
|
||||
//-----------------------------------------------------------------------------
|
||||
// Hitag2, HitagS
|
||||
//
|
||||
// (c) 2012 Roel Verdult
|
||||
// (c) 2016 Oguzhan Cicek, Hendrik Schwartke, Ralf Spenneberg
|
||||
// <info@os-s.de>
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
|
||||
#ifndef HITAG_H__
|
||||
#define HITAG_H__
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#define PACKED
|
||||
#else
|
||||
#define PACKED __attribute__((packed))
|
||||
#endif
|
||||
|
||||
typedef enum {
|
||||
RHTSF_CHALLENGE = 01,
|
||||
RHTSF_KEY = 02,
|
||||
WHTSF_CHALLENGE = 03,
|
||||
WHTSF_KEY = 04,
|
||||
RHT2F_PASSWORD = 21,
|
||||
RHT2F_AUTHENTICATE = 22,
|
||||
RHT2F_CRYPTO = 23,
|
||||
WHT2F_CRYPTO = 24,
|
||||
RHT2F_TEST_AUTH_ATTEMPTS = 25,
|
||||
RHT2F_UID_ONLY = 26,
|
||||
} hitag_function;
|
||||
|
||||
typedef struct {
|
||||
uint8_t password[4];
|
||||
} PACKED rht2d_password;
|
||||
|
||||
typedef struct {
|
||||
uint8_t NrAr[8];
|
||||
uint8_t data[4];
|
||||
} PACKED rht2d_authenticate;
|
||||
|
||||
typedef struct {
|
||||
uint8_t key[6];
|
||||
uint8_t data[4];
|
||||
} PACKED rht2d_crypto;
|
||||
|
||||
typedef union {
|
||||
rht2d_password pwd;
|
||||
rht2d_authenticate auth;
|
||||
rht2d_crypto crypto;
|
||||
} hitag_data;
|
||||
|
||||
|
||||
//---------------------------------------------------------
|
||||
// Hitag S
|
||||
//---------------------------------------------------------
|
||||
// protocol-state
|
||||
typedef enum PROTO_STATE {
|
||||
HT_READY = 0,
|
||||
HT_INIT,
|
||||
HT_AUTHENTICATE,
|
||||
HT_SELECTED,
|
||||
HT_QUIET,
|
||||
HT_TTF,
|
||||
HT_FAIL
|
||||
} PSTATE;
|
||||
|
||||
typedef enum TAG_STATE {
|
||||
HT_NO_OP = 0,
|
||||
HT_READING_PAGE,
|
||||
HT_WRITING_PAGE_ACK,
|
||||
HT_WRITING_PAGE_DATA,
|
||||
HT_WRITING_BLOCK_DATA
|
||||
} TSATE;
|
||||
|
||||
//number of start-of-frame bits
|
||||
typedef enum SOF_TYPE {
|
||||
HT_STANDARD = 0,
|
||||
HT_ADVANCED,
|
||||
HT_FAST_ADVANCED,
|
||||
HT_ONE,
|
||||
HT_NO_BITS
|
||||
} stype;
|
||||
|
||||
struct hitagS_tag {
|
||||
PSTATE pstate; //protocol-state
|
||||
TSATE tstate; //tag-state
|
||||
uint32_t uid;
|
||||
uint8_t pages[64][4];
|
||||
uint64_t key;
|
||||
uint8_t pwdl0, pwdl1, pwdh0;
|
||||
//con0
|
||||
int max_page;
|
||||
stype mode;
|
||||
//con1
|
||||
bool auth; //0=Plain 1=Auth
|
||||
bool TTFC; //Transponder Talks first coding. 0=Manchester 1=Biphase
|
||||
int TTFDR; //data rate in TTF Mode
|
||||
int TTFM; //the number of pages that are sent to the RWD
|
||||
bool LCON; //0=con1/2 read write 1=con1 read only and con2 OTP
|
||||
bool LKP; //0=page2/3 read write 1=page2/3 read only in Plain mode and no access in authenticate mode
|
||||
//con2
|
||||
//0=read write 1=read only
|
||||
bool LCK7; //page4/5
|
||||
bool LCK6; //page6/7
|
||||
bool LCK5; //page8-11
|
||||
bool LCK4; //page12-15
|
||||
bool LCK3; //page16-23
|
||||
bool LCK2; //page24-31
|
||||
bool LCK1; //page32-47
|
||||
bool LCK0; //page48-63
|
||||
};
|
||||
|
||||
#endif
|
|
@ -71,7 +71,8 @@ typedef enum ISO14B_COMMAND {
|
|||
ISO14B_REQUEST_TRIGGER = (1 << 4),
|
||||
ISO14B_APPEND_CRC = (1 << 5),
|
||||
ISO14B_SELECT_STD = (1 << 6),
|
||||
ISO14B_SELECT_SR = (1 << 7)
|
||||
ISO14B_SELECT_SR = (1 << 7),
|
||||
ISO14B_SET_TIMEOUT = (1 << 8),
|
||||
} iso14b_command_t;
|
||||
|
||||
typedef enum ISO15_COMMAND {
|
||||
|
|
|
@ -129,7 +129,7 @@ typedef struct {
|
|||
#define CMD_IO_DEMOD_FSK 0x021A
|
||||
#define CMD_IO_CLONE_TAG 0x021B
|
||||
#define CMD_EM410X_DEMOD 0x021c
|
||||
// Sampling configuration for LF reader/snooper
|
||||
// Sampling configuration for LF reader/sniffer
|
||||
#define CMD_SET_LF_SAMPLING_CONFIG 0x021d
|
||||
#define CMD_FSK_SIM_TAG 0x021E
|
||||
#define CMD_ASK_SIM_TAG 0x021F
|
||||
|
@ -154,10 +154,10 @@ typedef struct {
|
|||
#define CMD_ISO_15693_COMMAND 0x0313
|
||||
#define CMD_ISO_15693_COMMAND_DONE 0x0314
|
||||
#define CMD_ISO_15693_FIND_AFI 0x0315
|
||||
#define CMD_LF_SNOOP_RAW_ADC_SAMPLES 0x0317
|
||||
#define CMD_LF_SNIFF_RAW_ADC_SAMPLES 0x0317
|
||||
|
||||
// For Hitag2 transponders
|
||||
#define CMD_SNOOP_HITAG 0x0370
|
||||
#define CMD_SNIFF_HITAG 0x0370
|
||||
#define CMD_SIMULATE_HITAG 0x0371
|
||||
#define CMD_READER_HITAG 0x0372
|
||||
|
||||
|
@ -170,9 +170,9 @@ typedef struct {
|
|||
|
||||
#define CMD_ANTIFUZZ_ISO_14443a 0x0380
|
||||
#define CMD_SIMULATE_TAG_ISO_14443B 0x0381
|
||||
#define CMD_SNOOP_ISO_14443B 0x0382
|
||||
#define CMD_SNIFF_ISO_14443B 0x0382
|
||||
|
||||
#define CMD_SNOOP_ISO_14443a 0x0383
|
||||
#define CMD_SNIFF_ISO_14443a 0x0383
|
||||
#define CMD_SIMULATE_TAG_ISO_14443a 0x0384
|
||||
|
||||
#define CMD_READER_ISO_14443a 0x0385
|
||||
|
@ -192,7 +192,7 @@ typedef struct {
|
|||
#define CMD_ICLASS_READCHECK 0x038F
|
||||
#define CMD_ICLASS_CLONE 0x0390
|
||||
#define CMD_ICLASS_DUMP 0x0391
|
||||
#define CMD_SNOOP_ICLASS 0x0392
|
||||
#define CMD_SNIFF_ICLASS 0x0392
|
||||
#define CMD_SIMULATE_TAG_ICLASS 0x0393
|
||||
#define CMD_READER_ICLASS 0x0394
|
||||
#define CMD_READER_ICLASS_REPLAY 0x0395
|
||||
|
@ -204,7 +204,7 @@ typedef struct {
|
|||
|
||||
// For ISO1092 / FeliCa
|
||||
#define CMD_FELICA_SIMULATE_TAG 0x03A0
|
||||
#define CMD_FELICA_SNOOP 0x03A1
|
||||
#define CMD_FELICA_SNIFF 0x03A1
|
||||
#define CMD_FELICA_COMMAND 0x03A2
|
||||
//temp
|
||||
#define CMD_FELICA_LITE_DUMP 0x03AA
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue