mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-14 18:48:13 -07:00
rename few CMD_* to get some less diversity
This commit is contained in:
parent
cbf5c717f7
commit
a0a232a985
71 changed files with 687 additions and 687 deletions
|
@ -138,18 +138,18 @@ void RunMod() {
|
|||
SpinDelay(500);
|
||||
// Begin clone function here:
|
||||
/* Example from client/mifarehost.c for commanding a block write for "magic Chinese" cards:
|
||||
SendCommandOLD(CMD_MIFARE_CSETBLOCK, params & (0xFE | (uid == NULL ? 0:1)), blockNo, 0, data, 16);
|
||||
SendCommandOLD(CMD_HF_MIFARE_CSETBL, params & (0xFE | (uid == NULL ? 0:1)), blockNo, 0, data, 16);
|
||||
|
||||
Block read is similar:
|
||||
SendCommandOLD(CMD_MIFARE_CGETBLOCK, params, blockNo, 0,...};
|
||||
SendCommandOLD(CMD_HF_MIFARE_CGETBL, params, blockNo, 0,...};
|
||||
We need to imitate that call with blockNo 0 to set a uid.
|
||||
|
||||
The get and set commands are handled in this file:
|
||||
// Work with "magic Chinese" card
|
||||
case CMD_MIFARE_CSETBLOCK:
|
||||
case CMD_HF_MIFARE_CSETBL:
|
||||
MifareCSetBlock(c->arg[0], c->arg[1], c->d.asBytes);
|
||||
break;
|
||||
case CMD_MIFARE_CGETBLOCK:
|
||||
case CMD_HF_MIFARE_CGETBL:
|
||||
MifareCGetBlock(c->arg[0], c->arg[1], c->d.asBytes);
|
||||
break;
|
||||
|
||||
|
|
238
armsrc/appmain.c
238
armsrc/appmain.c
|
@ -756,25 +756,25 @@ static void PacketReceived(PacketCommandNG *packet) {
|
|||
reply_via_usb = false;
|
||||
break;
|
||||
#ifdef WITH_LF
|
||||
case CMD_SET_LF_T55XX_CONFIG: {
|
||||
case CMD_LF_T55XX_SET_CONFIG: {
|
||||
setT55xxConfig(packet->oldarg[0], (t55xx_configurations_t *) packet->data.asBytes);
|
||||
break;
|
||||
}
|
||||
case CMD_SET_LF_SAMPLING_CONFIG: {
|
||||
case CMD_LF_SAMPLING_SET_CONFIG: {
|
||||
setSamplingConfig((sample_config *) packet->data.asBytes);
|
||||
break;
|
||||
}
|
||||
case CMD_ACQUIRE_RAW_ADC_SAMPLES_125K: {
|
||||
case CMD_LF_ACQ_RAW_ADC: {
|
||||
struct p {
|
||||
uint8_t silent;
|
||||
uint32_t samples;
|
||||
} PACKED;
|
||||
struct p *payload = (struct p *)packet->data.asBytes;
|
||||
uint32_t bits = SampleLF(payload->silent, payload->samples);
|
||||
reply_ng(CMD_ACQUIRE_RAW_ADC_SAMPLES_125K, PM3_SUCCESS, (uint8_t *)&bits, sizeof(bits));
|
||||
reply_ng(CMD_LF_ACQ_RAW_ADC, PM3_SUCCESS, (uint8_t *)&bits, sizeof(bits));
|
||||
break;
|
||||
}
|
||||
case CMD_MOD_THEN_ACQUIRE_RAW_ADC_SAMPLES_125K: {
|
||||
case CMD_LF_MOD_THEN_ACQ_RAW_ADC: {
|
||||
struct p {
|
||||
uint32_t delay;
|
||||
uint16_t ones;
|
||||
|
@ -784,67 +784,67 @@ static void PacketReceived(PacketCommandNG *packet) {
|
|||
ModThenAcquireRawAdcSamples125k(payload->delay, payload->zeros, payload->ones, packet->data.asBytes + 8);
|
||||
break;
|
||||
}
|
||||
case CMD_LF_SNIFF_RAW_ADC_SAMPLES: {
|
||||
case CMD_LF_SNIFF_RAW_ADC: {
|
||||
uint32_t bits = SniffLF();
|
||||
reply_mix(CMD_ACK, bits, 0, 0, 0, 0);
|
||||
break;
|
||||
}
|
||||
case CMD_HID_DEMOD_FSK: {
|
||||
case CMD_LF_HID_DEMOD: {
|
||||
uint32_t high, low;
|
||||
CmdHIDdemodFSK(packet->oldarg[0], &high, &low, 1);
|
||||
break;
|
||||
}
|
||||
case CMD_HID_SIM_TAG: {
|
||||
case CMD_LF_HID_SIMULATE: {
|
||||
CmdHIDsimTAG(packet->oldarg[0], packet->oldarg[1], 1);
|
||||
break;
|
||||
}
|
||||
case CMD_FSK_SIM_TAG: {
|
||||
case CMD_LF_FSK_SIMULATE: {
|
||||
lf_fsksim_t *payload = (lf_fsksim_t *)packet->data.asBytes;
|
||||
CmdFSKsimTAG(payload->fchigh, payload->fclow, payload->separator, payload->clock, packet->length - sizeof(lf_fsksim_t), payload->data, true);
|
||||
break;
|
||||
}
|
||||
case CMD_ASK_SIM_TAG: {
|
||||
case CMD_LF_ASK_SIMULATE: {
|
||||
lf_asksim_t *payload = (lf_asksim_t *)packet->data.asBytes;
|
||||
CmdASKsimTAG(payload->encoding, payload->invert, payload->separator, payload->clock, packet->length - sizeof(lf_asksim_t), payload->data, true);
|
||||
break;
|
||||
}
|
||||
case CMD_PSK_SIM_TAG: {
|
||||
case CMD_LF_PSK_SIMULATE: {
|
||||
lf_psksim_t *payload = (lf_psksim_t *)packet->data.asBytes;
|
||||
CmdPSKsimTag(payload->carrier, payload->invert, payload->clock, packet->length - sizeof(lf_psksim_t), payload->data, true);
|
||||
break;
|
||||
}
|
||||
case CMD_HID_CLONE_TAG: {
|
||||
case CMD_LF_HID_CLONE: {
|
||||
CopyHIDtoT55x7(packet->oldarg[0], packet->oldarg[1], packet->oldarg[2], packet->data.asBytes[0]);
|
||||
break;
|
||||
}
|
||||
case CMD_IO_DEMOD_FSK: {
|
||||
case CMD_LF_IO_DEMOD: {
|
||||
uint32_t high, low;
|
||||
CmdIOdemodFSK(packet->oldarg[0], &high, &low, 1);
|
||||
break;
|
||||
}
|
||||
case CMD_IO_CLONE_TAG: {
|
||||
case CMD_LF_IO_CLONE: {
|
||||
CopyIOtoT55x7(packet->oldarg[0], packet->oldarg[1]);
|
||||
break;
|
||||
}
|
||||
case CMD_EM410X_DEMOD: {
|
||||
case CMD_LF_EM410X_DEMOD: {
|
||||
uint32_t high;
|
||||
uint64_t low;
|
||||
CmdEM410xdemod(packet->oldarg[0], &high, &low, 1);
|
||||
break;
|
||||
}
|
||||
case CMD_EM410X_WRITE_TAG: {
|
||||
case CMD_LF_EM410X_WRITE: {
|
||||
WriteEM410x(packet->oldarg[0], packet->oldarg[1], packet->oldarg[2]);
|
||||
break;
|
||||
}
|
||||
case CMD_READ_TI_TYPE: {
|
||||
case CMD_LF_TI_READ: {
|
||||
ReadTItag();
|
||||
break;
|
||||
}
|
||||
case CMD_WRITE_TI_TYPE: {
|
||||
case CMD_LF_TI_WRITE: {
|
||||
WriteTItag(packet->oldarg[0], packet->oldarg[1], packet->oldarg[2]);
|
||||
break;
|
||||
}
|
||||
case CMD_SIMULATE_TAG_125K: {
|
||||
case CMD_LF_SIMULATE: {
|
||||
LED_A_ON();
|
||||
struct p {
|
||||
uint16_t len;
|
||||
|
@ -853,7 +853,7 @@ static void PacketReceived(PacketCommandNG *packet) {
|
|||
struct p *payload = (struct p *)packet->data.asBytes;
|
||||
// length, start gap, led control
|
||||
SimulateTagLowFrequency(payload->len, payload->gap, 1);
|
||||
reply_ng(CMD_SIMULATE_TAG_125K, PM3_EOPABORTED, NULL, 0);
|
||||
reply_ng(CMD_LF_SIMULATE, PM3_EOPABORTED, NULL, 0);
|
||||
LED_A_OFF();
|
||||
break;
|
||||
}
|
||||
|
@ -861,18 +861,18 @@ static void PacketReceived(PacketCommandNG *packet) {
|
|||
SimulateTagLowFrequencyBidir(packet->oldarg[0], packet->oldarg[1]);
|
||||
break;
|
||||
}
|
||||
case CMD_INDALA_CLONE_TAG: {
|
||||
case CMD_LF_INDALA_CLONE: {
|
||||
CopyIndala64toT55x7(packet->data.asDwords[0], packet->data.asDwords[1]);
|
||||
break;
|
||||
}
|
||||
case CMD_INDALA_CLONE_TAG_L: {
|
||||
case CMD_LF_INDALA224_CLONE: {
|
||||
CopyIndala224toT55x7(
|
||||
packet->data.asDwords[0], packet->data.asDwords[1], packet->data.asDwords[2], packet->data.asDwords[3],
|
||||
packet->data.asDwords[4], packet->data.asDwords[5], packet->data.asDwords[6]
|
||||
);
|
||||
break;
|
||||
}
|
||||
case CMD_T55XX_READ_BLOCK: {
|
||||
case CMD_LF_T55XX_READBL: {
|
||||
struct p {
|
||||
uint32_t password;
|
||||
uint8_t blockno;
|
||||
|
@ -884,28 +884,28 @@ static void PacketReceived(PacketCommandNG *packet) {
|
|||
T55xxReadBlock(payload->page, payload->pwdmode, false, payload->blockno, payload->password, payload->downlink_mode);
|
||||
break;
|
||||
}
|
||||
case CMD_T55XX_WRITE_BLOCK: {
|
||||
case CMD_LF_T55XX_WRITEBL: {
|
||||
// uses NG format
|
||||
T55xxWriteBlock(packet->data.asBytes);
|
||||
break;
|
||||
}
|
||||
case CMD_T55XX_WAKEUP: {
|
||||
case CMD_LF_T55XX_WAKEUP: {
|
||||
T55xxWakeUp(packet->oldarg[0], packet->oldarg[1]);
|
||||
break;
|
||||
}
|
||||
case CMD_T55XX_RESET_READ: {
|
||||
case CMD_LF_T55XX_RESET_READ: {
|
||||
T55xxResetRead(packet->data.asBytes[0] & 0xff);
|
||||
break;
|
||||
}
|
||||
case CMD_T55XX_CHKPWDS: {
|
||||
case CMD_LF_T55XX_CHK_PWDS: {
|
||||
T55xx_ChkPwds(packet->data.asBytes[0] & 0xff);
|
||||
break;
|
||||
}
|
||||
case CMD_PCF7931_READ: {
|
||||
case CMD_LF_PCF7931_READ: {
|
||||
ReadPCF7931();
|
||||
break;
|
||||
}
|
||||
case CMD_PCF7931_WRITE: {
|
||||
case CMD_LF_PCF7931_WRITE: {
|
||||
WritePCF7931(
|
||||
packet->data.asBytes[0], packet->data.asBytes[1], packet->data.asBytes[2], packet->data.asBytes[3],
|
||||
packet->data.asBytes[4], packet->data.asBytes[5], packet->data.asBytes[6], packet->data.asBytes[9],
|
||||
|
@ -916,7 +916,7 @@ static void PacketReceived(PacketCommandNG *packet) {
|
|||
);
|
||||
break;
|
||||
}
|
||||
case CMD_EM4X_READ_WORD: {
|
||||
case CMD_LF_EM4X_READWORD: {
|
||||
struct p {
|
||||
uint32_t password;
|
||||
uint8_t address;
|
||||
|
@ -926,7 +926,7 @@ static void PacketReceived(PacketCommandNG *packet) {
|
|||
EM4xReadWord(payload->address, payload->password, payload->usepwd);
|
||||
break;
|
||||
}
|
||||
case CMD_EM4X_WRITE_WORD: {
|
||||
case CMD_LF_EM4X_WRITEWORD: {
|
||||
struct p {
|
||||
uint32_t password;
|
||||
uint32_t data;
|
||||
|
@ -937,48 +937,48 @@ static void PacketReceived(PacketCommandNG *packet) {
|
|||
EM4xWriteWord(payload->address, payload->data, payload->password, payload->usepwd);
|
||||
break;
|
||||
}
|
||||
case CMD_AWID_DEMOD_FSK: {
|
||||
case CMD_LF_AWID_DEMOD: {
|
||||
uint32_t high, low;
|
||||
// Set realtime AWID demodulation
|
||||
CmdAWIDdemodFSK(packet->oldarg[0], &high, &low, 1);
|
||||
break;
|
||||
}
|
||||
case CMD_VIKING_CLONE_TAG: {
|
||||
case CMD_LF_VIKING_CLONE: {
|
||||
CopyVikingtoT55xx(packet->oldarg[0], packet->oldarg[1], packet->oldarg[2]);
|
||||
break;
|
||||
}
|
||||
case CMD_COTAG: {
|
||||
case CMD_LF_COTAG_READ: {
|
||||
Cotag(packet->oldarg[0]);
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef WITH_HITAG
|
||||
case CMD_SNIFF_HITAG: { // Eavesdrop Hitag tag, args = type
|
||||
case CMD_LF_HITAG_SNIFF: { // Eavesdrop Hitag tag, args = type
|
||||
SniffHitag();
|
||||
break;
|
||||
}
|
||||
case CMD_SIMULATE_HITAG: { // Simulate Hitag tag, args = memory content
|
||||
case CMD_LF_HITAG_SIMULATE: { // Simulate Hitag tag, args = memory content
|
||||
SimulateHitagTag((bool)packet->oldarg[0], packet->data.asBytes);
|
||||
break;
|
||||
}
|
||||
case CMD_READER_HITAG: { // Reader for Hitag tags, args = type and function
|
||||
case CMD_LF_HITAG_READER: { // Reader for Hitag tags, args = type and function
|
||||
ReaderHitag((hitag_function)packet->oldarg[0], (hitag_data *)packet->data.asBytes);
|
||||
break;
|
||||
}
|
||||
case CMD_SIMULATE_HITAG_S: { // Simulate Hitag s tag, args = memory content
|
||||
case CMD_LF_HITAGS_SIMULATE: { // Simulate Hitag s tag, args = memory content
|
||||
SimulateHitagSTag((bool)packet->oldarg[0], packet->data.asBytes);
|
||||
break;
|
||||
}
|
||||
case CMD_TEST_HITAGS_TRACES: { // Tests every challenge within the given file
|
||||
case CMD_LF_HITAGS_TEST_TRACES: { // Tests every challenge within the given file
|
||||
check_challenges((bool)packet->oldarg[0], packet->data.asBytes);
|
||||
break;
|
||||
}
|
||||
case CMD_READ_HITAG_S: { //Reader for only Hitag S tags, args = key or challenge
|
||||
case CMD_LF_HITAGS_READ: { //Reader for only Hitag S tags, args = key or challenge
|
||||
ReadHitagS((hitag_function)packet->oldarg[0], (hitag_data *)packet->data.asBytes);
|
||||
break;
|
||||
}
|
||||
case CMD_WR_HITAG_S: { //writer for Hitag tags args=data to write,page and key or challenge
|
||||
case CMD_LF_HITAGS_WRITE: { //writer for Hitag tags args=data to write,page and key or challenge
|
||||
if ((hitag_function)packet->oldarg[0] < 10) {
|
||||
WritePageHitagS((hitag_function)packet->oldarg[0], (hitag_data *)packet->data.asBytes, packet->oldarg[2]);
|
||||
} else {
|
||||
|
@ -989,50 +989,50 @@ static void PacketReceived(PacketCommandNG *packet) {
|
|||
#endif
|
||||
|
||||
#ifdef WITH_ISO15693
|
||||
case CMD_ACQUIRE_RAW_ADC_SAMPLES_ISO_15693: {
|
||||
case CMD_HF_ISO15693_ACQ_RAW_ADC: {
|
||||
AcquireRawAdcSamplesIso15693();
|
||||
break;
|
||||
}
|
||||
case CMD_RECORD_RAW_ADC_SAMPLES_ISO_15693: {
|
||||
case CMD_HF_ISO15693_RAWADC: {
|
||||
RecordRawAdcSamplesIso15693();
|
||||
break;
|
||||
}
|
||||
case CMD_ISO_15693_COMMAND: {
|
||||
case CMD_HF_ISO15693_COMMAND: {
|
||||
DirectTag15693Command(packet->oldarg[0], packet->oldarg[1], packet->oldarg[2], packet->data.asBytes);
|
||||
break;
|
||||
}
|
||||
case CMD_ISO_15693_FIND_AFI: {
|
||||
case CMD_HF_ISO15693_FINDAFI: {
|
||||
BruteforceIso15693Afi(packet->oldarg[0]);
|
||||
break;
|
||||
}
|
||||
case CMD_READER_ISO_15693: {
|
||||
case CMD_HF_ISO15693_READER: {
|
||||
ReaderIso15693(packet->oldarg[0]);
|
||||
break;
|
||||
}
|
||||
case CMD_SIMTAG_ISO_15693: {
|
||||
case CMD_HF_ISO15693_SIMULATE: {
|
||||
SimTagIso15693(packet->oldarg[0], packet->data.asBytes);
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef WITH_LEGICRF
|
||||
case CMD_SIMULATE_TAG_LEGIC_RF: {
|
||||
case CMD_HF_LEGIC_SIMULATE: {
|
||||
LegicRfSimulate(packet->oldarg[0]);
|
||||
break;
|
||||
}
|
||||
case CMD_WRITER_LEGIC_RF: {
|
||||
case CMD_HF_LEGIC_WRITER: {
|
||||
LegicRfWriter(packet->oldarg[0], packet->oldarg[1], packet->oldarg[2], packet->data.asBytes);
|
||||
break;
|
||||
}
|
||||
case CMD_READER_LEGIC_RF: {
|
||||
case CMD_HF_LEGIC_READER: {
|
||||
LegicRfReader(packet->oldarg[0], packet->oldarg[1], packet->oldarg[2]);
|
||||
break;
|
||||
}
|
||||
case CMD_LEGIC_INFO: {
|
||||
case CMD_HF_LEGIC_INFO: {
|
||||
LegicRfInfo();
|
||||
break;
|
||||
}
|
||||
case CMD_LEGIC_ESET: {
|
||||
case CMD_HF_LEGIC_ESET: {
|
||||
//-----------------------------------------------------------------------------
|
||||
// Note: we call FpgaDownloadAndGo(FPGA_BITSTREAM_HF) here although FPGA is not
|
||||
// involved in dealing with emulator memory. But if it is called later, it might
|
||||
|
@ -1047,19 +1047,19 @@ static void PacketReceived(PacketCommandNG *packet) {
|
|||
#endif
|
||||
|
||||
#ifdef WITH_ISO14443b
|
||||
case CMD_READ_SRI_TAG: {
|
||||
case CMD_HF_SRI_READ: {
|
||||
ReadSTMemoryIso14443b(packet->oldarg[0]);
|
||||
break;
|
||||
}
|
||||
case CMD_SNIFF_ISO_14443B: {
|
||||
case CMD_HF_ISO14443B_SNIFF: {
|
||||
SniffIso14443b();
|
||||
break;
|
||||
}
|
||||
case CMD_SIMULATE_TAG_ISO_14443B: {
|
||||
case CMD_HF_ISO14443B_SIMULATE: {
|
||||
SimulateIso14443bTag(packet->oldarg[0]);
|
||||
break;
|
||||
}
|
||||
case CMD_ISO_14443B_COMMAND: {
|
||||
case CMD_HF_ISO14443B_COMMAND: {
|
||||
//SendRawCommand14443B(packet->oldarg[0],packet->oldarg[1],packet->oldarg[2],packet->data.asBytes);
|
||||
SendRawCommand14443B_Ex(packet);
|
||||
break;
|
||||
|
@ -1067,34 +1067,34 @@ static void PacketReceived(PacketCommandNG *packet) {
|
|||
#endif
|
||||
|
||||
#ifdef WITH_FELICA
|
||||
case CMD_FELICA_COMMAND: {
|
||||
case CMD_HF_FELICA_COMMAND: {
|
||||
felica_sendraw(packet);
|
||||
break;
|
||||
}
|
||||
case CMD_FELICA_LITE_SIM: {
|
||||
case CMD_HF_FELICALITE_SIMULATE: {
|
||||
felica_sim_lite(packet->oldarg[0]);
|
||||
break;
|
||||
}
|
||||
case CMD_FELICA_SNIFF: {
|
||||
case CMD_HF_FELICA_SNIFF: {
|
||||
felica_sniff(packet->oldarg[0], packet->oldarg[1]);
|
||||
break;
|
||||
}
|
||||
case CMD_FELICA_LITE_DUMP: {
|
||||
case CMD_HF_FELICALITE_DUMP: {
|
||||
felica_dump_lite_s();
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef WITH_ISO14443a
|
||||
case CMD_SNIFF_ISO_14443a: {
|
||||
case CMD_HF_ISO14443A_SNIFF: {
|
||||
SniffIso14443a(packet->data.asBytes[0]);
|
||||
break;
|
||||
}
|
||||
case CMD_READER_ISO_14443a: {
|
||||
case CMD_HF_ISO14443A_READER: {
|
||||
ReaderIso14443a(packet);
|
||||
break;
|
||||
}
|
||||
case CMD_SIMULATE_TAG_ISO_14443a: {
|
||||
case CMD_HF_ISO14443A_SIMULATE: {
|
||||
struct p {
|
||||
uint8_t tagtype;
|
||||
uint8_t flags;
|
||||
|
@ -1104,80 +1104,80 @@ static void PacketReceived(PacketCommandNG *packet) {
|
|||
SimulateIso14443aTag(payload->tagtype, payload->flags, payload->uid); // ## Simulate iso14443a tag - pass tag type & UID
|
||||
break;
|
||||
}
|
||||
case CMD_ANTIFUZZ_ISO_14443a: {
|
||||
case CMD_HF_ISO14443A_ANTIFUZZ: {
|
||||
iso14443a_antifuzz(packet->oldarg[0]);
|
||||
break;
|
||||
}
|
||||
case CMD_EPA_PACE_COLLECT_NONCE: {
|
||||
case CMD_HF_EPA_COLLECT_NONCE: {
|
||||
EPA_PACE_Collect_Nonce(packet);
|
||||
break;
|
||||
}
|
||||
case CMD_EPA_PACE_REPLAY: {
|
||||
case CMD_HF_EPA_REPLAY: {
|
||||
EPA_PACE_Replay(packet);
|
||||
break;
|
||||
}
|
||||
case CMD_READER_MIFARE: {
|
||||
case CMD_HF_MIFARE_READER: {
|
||||
ReaderMifare(packet->oldarg[0], packet->oldarg[1], packet->oldarg[2]);
|
||||
break;
|
||||
}
|
||||
case CMD_MIFARE_READBL: {
|
||||
case CMD_HF_MIFARE_READBL: {
|
||||
mf_readblock_t *payload = (mf_readblock_t *)packet->data.asBytes;
|
||||
MifareReadBlock(payload->blockno, payload->keytype, payload->key);
|
||||
break;
|
||||
}
|
||||
case CMD_MIFAREU_READBL: {
|
||||
case CMD_HF_MIFAREU_READBL: {
|
||||
MifareUReadBlock(packet->oldarg[0], packet->oldarg[1], packet->data.asBytes);
|
||||
break;
|
||||
}
|
||||
case CMD_MIFAREUC_AUTH: {
|
||||
case CMD_HF_MIFAREUC_AUTH: {
|
||||
MifareUC_Auth(packet->oldarg[0], packet->data.asBytes);
|
||||
break;
|
||||
}
|
||||
case CMD_MIFAREU_READCARD: {
|
||||
case CMD_HF_MIFAREU_READCARD: {
|
||||
MifareUReadCard(packet->oldarg[0], packet->oldarg[1], packet->oldarg[2], packet->data.asBytes);
|
||||
break;
|
||||
}
|
||||
case CMD_MIFAREUC_SETPWD: {
|
||||
case CMD_HF_MIFAREUC_SETPWD: {
|
||||
MifareUSetPwd(packet->oldarg[0], packet->data.asBytes);
|
||||
break;
|
||||
}
|
||||
case CMD_MIFARE_READSC: {
|
||||
case CMD_HF_MIFARE_READSC: {
|
||||
MifareReadSector(packet->oldarg[0], packet->oldarg[1], packet->data.asBytes);
|
||||
break;
|
||||
}
|
||||
case CMD_MIFARE_WRITEBL: {
|
||||
case CMD_HF_MIFARE_WRITEBL: {
|
||||
MifareWriteBlock(packet->oldarg[0], packet->oldarg[1], packet->data.asBytes);
|
||||
break;
|
||||
}
|
||||
//case CMD_MIFAREU_WRITEBL_COMPAT: {
|
||||
//case CMD_HF_MIFAREU_WRITEBL_COMPAT: {
|
||||
//MifareUWriteBlockCompat(packet->oldarg[0], packet->data.asBytes);
|
||||
//break;
|
||||
//}
|
||||
case CMD_MIFAREU_WRITEBL: {
|
||||
case CMD_HF_MIFAREU_WRITEBL: {
|
||||
MifareUWriteBlock(packet->oldarg[0], packet->oldarg[1], packet->data.asBytes);
|
||||
break;
|
||||
}
|
||||
case CMD_MIFARE_ACQUIRE_ENCRYPTED_NONCES: {
|
||||
case CMD_HF_MIFARE_ACQ_ENCRYPTED_NONCES: {
|
||||
MifareAcquireEncryptedNonces(packet->oldarg[0], packet->oldarg[1], packet->oldarg[2], packet->data.asBytes);
|
||||
break;
|
||||
}
|
||||
case CMD_MIFARE_ACQUIRE_NONCES: {
|
||||
case CMD_HF_MIFARE_ACQ_NONCES: {
|
||||
MifareAcquireNonces(packet->oldarg[0], packet->oldarg[2]);
|
||||
break;
|
||||
}
|
||||
case CMD_MIFARE_NESTED: {
|
||||
case CMD_HF_MIFARE_NESTED: {
|
||||
MifareNested(packet->oldarg[0], packet->oldarg[1], packet->oldarg[2], packet->data.asBytes);
|
||||
break;
|
||||
}
|
||||
case CMD_MIFARE_CHKKEYS: {
|
||||
case CMD_HF_MIFARE_CHKKEYS: {
|
||||
MifareChkKeys(packet->data.asBytes);
|
||||
break;
|
||||
}
|
||||
case CMD_MIFARE_CHKKEYS_FAST: {
|
||||
case CMD_HF_MIFARE_CHKKEYS_FAST: {
|
||||
MifareChkKeys_fast(packet->oldarg[0], packet->oldarg[1], packet->oldarg[2], packet->data.asBytes);
|
||||
break;
|
||||
}
|
||||
case CMD_SIMULATE_MIFARE_CARD: {
|
||||
case CMD_HF_MIFARE_SIMULATE: {
|
||||
struct p {
|
||||
uint16_t flags;
|
||||
uint8_t exitAfter;
|
||||
|
@ -1194,12 +1194,12 @@ static void PacketReceived(PacketCommandNG *packet) {
|
|||
reply_ng(CMD_SET_DBGMODE, PM3_SUCCESS, NULL, 0);
|
||||
break;
|
||||
}
|
||||
case CMD_MIFARE_EML_MEMCLR: {
|
||||
case CMD_HF_MIFARE_EML_MEMCLR: {
|
||||
MifareEMemClr();
|
||||
reply_ng(CMD_MIFARE_EML_MEMCLR, PM3_SUCCESS, NULL, 0);
|
||||
reply_ng(CMD_HF_MIFARE_EML_MEMCLR, PM3_SUCCESS, NULL, 0);
|
||||
break;
|
||||
}
|
||||
case CMD_MIFARE_EML_MEMSET: {
|
||||
case CMD_HF_MIFARE_EML_MEMSET: {
|
||||
struct p {
|
||||
uint8_t blockno;
|
||||
uint8_t blockcnt;
|
||||
|
@ -1210,7 +1210,7 @@ static void PacketReceived(PacketCommandNG *packet) {
|
|||
MifareEMemSet(payload->blockno, payload->blockcnt, payload->blockwidth, payload->data);
|
||||
break;
|
||||
}
|
||||
case CMD_MIFARE_EML_MEMGET: {
|
||||
case CMD_HF_MIFARE_EML_MEMGET: {
|
||||
struct p {
|
||||
uint8_t blockno;
|
||||
uint8_t blockcnt;
|
||||
|
@ -1219,71 +1219,71 @@ static void PacketReceived(PacketCommandNG *packet) {
|
|||
MifareEMemGet(payload->blockno, payload->blockcnt);
|
||||
break;
|
||||
}
|
||||
case CMD_MIFARE_EML_CARDLOAD: {
|
||||
case CMD_HF_MIFARE_EML_LOAD: {
|
||||
MifareECardLoad(packet->oldarg[0], packet->oldarg[1]);
|
||||
break;
|
||||
}
|
||||
// Work with "magic Chinese" card
|
||||
case CMD_MIFARE_CSETBLOCK: {
|
||||
case CMD_HF_MIFARE_CSETBL: {
|
||||
MifareCSetBlock(packet->oldarg[0], packet->oldarg[1], packet->data.asBytes);
|
||||
break;
|
||||
}
|
||||
case CMD_MIFARE_CGETBLOCK: {
|
||||
case CMD_HF_MIFARE_CGETBL: {
|
||||
MifareCGetBlock(packet->oldarg[0], packet->oldarg[1], packet->data.asBytes);
|
||||
break;
|
||||
}
|
||||
case CMD_MIFARE_CIDENT: {
|
||||
case CMD_HF_MIFARE_CIDENT: {
|
||||
MifareCIdent();
|
||||
break;
|
||||
}
|
||||
// mifare sniffer
|
||||
// case CMD_MIFARE_SNIFFER: {
|
||||
// case CMD_HF_MIFARE_SNIFF: {
|
||||
// SniffMifare(packet->oldarg[0]);
|
||||
// break;
|
||||
// }
|
||||
case CMD_MIFARE_SETMOD: {
|
||||
case CMD_HF_MIFARE_SETMOD: {
|
||||
MifareSetMod(packet->data.asBytes);
|
||||
break;
|
||||
}
|
||||
//mifare desfire
|
||||
case CMD_MIFARE_DESFIRE_READBL: {
|
||||
case CMD_HF_DESFIRE_READBL: {
|
||||
break;
|
||||
}
|
||||
case CMD_MIFARE_DESFIRE_WRITEBL: {
|
||||
case CMD_HF_DESFIRE_WRITEBL: {
|
||||
break;
|
||||
}
|
||||
case CMD_MIFARE_DESFIRE_AUTH1: {
|
||||
case CMD_HF_DESFIRE_AUTH1: {
|
||||
MifareDES_Auth1(packet->oldarg[0], packet->oldarg[1], packet->oldarg[2], packet->data.asBytes);
|
||||
break;
|
||||
}
|
||||
case CMD_MIFARE_DESFIRE_AUTH2: {
|
||||
case CMD_HF_DESFIRE_AUTH2: {
|
||||
//MifareDES_Auth2(packet->oldarg[0],packet->data.asBytes);
|
||||
break;
|
||||
}
|
||||
case CMD_MIFARE_DES_READER: {
|
||||
case CMD_HF_DESFIRE_READER: {
|
||||
//readermifaredes(packet->oldarg[0], packet->oldarg[1], packet->data.asBytes);
|
||||
break;
|
||||
}
|
||||
case CMD_MIFARE_DESFIRE_INFO: {
|
||||
case CMD_HF_DESFIRE_INFO: {
|
||||
MifareDesfireGetInformation();
|
||||
break;
|
||||
}
|
||||
case CMD_MIFARE_DESFIRE: {
|
||||
case CMD_HF_DESFIRE_COMMAND: {
|
||||
MifareSendCommand(packet->oldarg[0], packet->oldarg[1], packet->data.asBytes);
|
||||
break;
|
||||
}
|
||||
case CMD_MIFARE_COLLECT_NONCES: {
|
||||
case CMD_HF_MIFARE_COLLECT_NONCES: {
|
||||
break;
|
||||
}
|
||||
case CMD_MIFARE_NACK_DETECT: {
|
||||
case CMD_HF_MIFARE_NACK_DETECT: {
|
||||
DetectNACKbug();
|
||||
break;
|
||||
}
|
||||
case CMD_THINFILM_READ: {
|
||||
case CMD_HF_THINFILM_READ: {
|
||||
ReadThinFilm();
|
||||
break;
|
||||
}
|
||||
case CMD_SIMULATE_TAG_THINFILM: {
|
||||
case CMD_HF_THINFILM_SIMULATE: {
|
||||
SimulateThinFilm(packet->data.asBytes, packet->length);
|
||||
break;
|
||||
}
|
||||
|
@ -1291,60 +1291,60 @@ static void PacketReceived(PacketCommandNG *packet) {
|
|||
|
||||
#ifdef WITH_ICLASS
|
||||
// Makes use of ISO14443a FPGA Firmware
|
||||
case CMD_SNIFF_ICLASS: {
|
||||
case CMD_HF_ICLASS_SNIFF: {
|
||||
SniffIClass();
|
||||
break;
|
||||
}
|
||||
case CMD_SIMULATE_TAG_ICLASS: {
|
||||
case CMD_HF_ICLASS_SIMULATE: {
|
||||
SimulateIClass(packet->oldarg[0], packet->oldarg[1], packet->oldarg[2], packet->data.asBytes);
|
||||
break;
|
||||
}
|
||||
case CMD_READER_ICLASS: {
|
||||
case CMD_HF_ICLASS_READER: {
|
||||
ReaderIClass(packet->oldarg[0]);
|
||||
break;
|
||||
}
|
||||
case CMD_READER_ICLASS_REPLAY: {
|
||||
case CMD_HF_ICLASS_REPLAY: {
|
||||
ReaderIClass_Replay(packet->oldarg[0], packet->data.asBytes);
|
||||
break;
|
||||
}
|
||||
case CMD_ICLASS_EML_MEMSET: {
|
||||
case CMD_HF_ICLASS_EML_MEMSET: {
|
||||
//iceman, should call FPGADOWNLOAD before, since it corrupts BigBuf
|
||||
FpgaDownloadAndGo(FPGA_BITSTREAM_HF);
|
||||
emlSet(packet->data.asBytes, packet->oldarg[0], packet->oldarg[1]);
|
||||
break;
|
||||
}
|
||||
case CMD_ICLASS_WRITEBLOCK: {
|
||||
case CMD_HF_ICLASS_WRITEBL: {
|
||||
iClass_WriteBlock(packet->oldarg[0], packet->data.asBytes);
|
||||
break;
|
||||
}
|
||||
case CMD_ICLASS_READCHECK: { // auth step 1
|
||||
case CMD_HF_ICLASS_READCHECK: { // auth step 1
|
||||
iClass_ReadCheck(packet->oldarg[0], packet->oldarg[1]);
|
||||
break;
|
||||
}
|
||||
case CMD_ICLASS_READBLOCK: {
|
||||
case CMD_HF_ICLASS_READBL: {
|
||||
iClass_ReadBlk(packet->oldarg[0]);
|
||||
break;
|
||||
}
|
||||
case CMD_ICLASS_AUTHENTICATION: { //check
|
||||
case CMD_HF_ICLASS_AUTH: { //check
|
||||
iClass_Authentication(packet->data.asBytes);
|
||||
break;
|
||||
}
|
||||
case CMD_ICLASS_CHECK_KEYS: {
|
||||
case CMD_HF_ICLASS_CHKKEYS: {
|
||||
iClass_Authentication_fast(packet->oldarg[0], packet->oldarg[1], packet->data.asBytes);
|
||||
break;
|
||||
}
|
||||
case CMD_ICLASS_DUMP: {
|
||||
case CMD_HF_ICLASS_DUMP: {
|
||||
iClass_Dump(packet->oldarg[0], packet->oldarg[1]);
|
||||
break;
|
||||
}
|
||||
case CMD_ICLASS_CLONE: {
|
||||
case CMD_HF_ICLASS_CLONE: {
|
||||
iClass_Clone(packet->oldarg[0], packet->oldarg[1], packet->data.asBytes);
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef WITH_HFSNIFF
|
||||
case CMD_HF_SNIFFER: {
|
||||
case CMD_HF_SNIFF: {
|
||||
HfSniff(packet->oldarg[0], packet->oldarg[1]);
|
||||
break;
|
||||
}
|
||||
|
@ -1546,7 +1546,7 @@ static void PacketReceived(PacketCommandNG *packet) {
|
|||
break;
|
||||
}
|
||||
#ifdef WITH_LF
|
||||
case CMD_UPLOAD_SIM_SAMPLES_125K: {
|
||||
case CMD_LF_UPLOAD_SIM_SAMPLES: {
|
||||
// iceman; since changing fpga_bitstreams clears bigbuff, Its better to call it before.
|
||||
// to be able to use this one for uploading data to device
|
||||
// flag =
|
||||
|
@ -1568,7 +1568,7 @@ static void PacketReceived(PacketCommandNG *packet) {
|
|||
|
||||
uint8_t *mem = BigBuf_get_addr();
|
||||
memcpy(mem + payload->offset, &payload->data, PM3_CMD_DATA_SIZE - 3);
|
||||
reply_ng(CMD_UPLOAD_SIM_SAMPLES_125K, PM3_SUCCESS, NULL, 0);
|
||||
reply_ng(CMD_LF_UPLOAD_SIM_SAMPLES, PM3_SUCCESS, NULL, 0);
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
@ -1836,7 +1836,7 @@ static void PacketReceived(PacketCommandNG *packet) {
|
|||
break;
|
||||
}
|
||||
#endif
|
||||
case CMD_SET_LF_DIVISOR: {
|
||||
case CMD_LF_SET_DIVISOR: {
|
||||
FpgaDownloadAndGo(FPGA_BITSTREAM_LF);
|
||||
FpgaSendCommand(FPGA_CMD_SET_DIVISOR, packet->data.asBytes[0]);
|
||||
break;
|
||||
|
|
|
@ -1195,11 +1195,11 @@ void SimulateIClass(uint32_t arg0, uint32_t arg1, uint32_t arg2, uint8_t *datain
|
|||
|
||||
if (doIClassSimulation(MODE_EXIT_AFTER_MAC, mac_responses + i * EPURSE_MAC_SIZE)) {
|
||||
// Button pressed
|
||||
reply_old(CMD_ACK, CMD_SIMULATE_TAG_ICLASS, i, 0, mac_responses, i * EPURSE_MAC_SIZE);
|
||||
reply_old(CMD_ACK, CMD_HF_ICLASS_SIMULATE, i, 0, mac_responses, i * EPURSE_MAC_SIZE);
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
reply_old(CMD_ACK, CMD_SIMULATE_TAG_ICLASS, i, 0, mac_responses, i * EPURSE_MAC_SIZE);
|
||||
reply_old(CMD_ACK, CMD_HF_ICLASS_SIMULATE, i, 0, mac_responses, i * EPURSE_MAC_SIZE);
|
||||
|
||||
} else if (simType == 3) {
|
||||
//This is 'full sim' mode, where we use the emulator storage for data.
|
||||
|
@ -1226,20 +1226,20 @@ void SimulateIClass(uint32_t arg0, uint32_t arg1, uint32_t arg2, uint8_t *datain
|
|||
|
||||
// keyroll 1
|
||||
if (doIClassSimulation(MODE_EXIT_AFTER_MAC, mac_responses + i * EPURSE_MAC_SIZE)) {
|
||||
reply_old(CMD_ACK, CMD_SIMULATE_TAG_ICLASS, i * 2, 0, mac_responses, i * EPURSE_MAC_SIZE * 2);
|
||||
reply_old(CMD_ACK, CMD_HF_ICLASS_SIMULATE, i * 2, 0, mac_responses, i * EPURSE_MAC_SIZE * 2);
|
||||
// Button pressed
|
||||
goto out;
|
||||
}
|
||||
|
||||
// keyroll 2
|
||||
if (doIClassSimulation(MODE_EXIT_AFTER_MAC, mac_responses + (i + numberOfCSNS) * EPURSE_MAC_SIZE)) {
|
||||
reply_old(CMD_ACK, CMD_SIMULATE_TAG_ICLASS, i * 2, 0, mac_responses, i * EPURSE_MAC_SIZE * 2);
|
||||
reply_old(CMD_ACK, CMD_HF_ICLASS_SIMULATE, i * 2, 0, mac_responses, i * EPURSE_MAC_SIZE * 2);
|
||||
// Button pressed
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
// double the amount of collected data.
|
||||
reply_old(CMD_ACK, CMD_SIMULATE_TAG_ICLASS, i * 2, 0, mac_responses, i * EPURSE_MAC_SIZE * 2);
|
||||
reply_old(CMD_ACK, CMD_HF_ICLASS_SIMULATE, i * 2, 0, mac_responses, i * EPURSE_MAC_SIZE * 2);
|
||||
|
||||
} else {
|
||||
// We may want a mode here where we hardcode the csns to use (from proxclone).
|
||||
|
@ -2222,7 +2222,7 @@ void ReaderIClass_Replay(uint8_t arg0, uint8_t *mac) {
|
|||
switch_off();
|
||||
}
|
||||
|
||||
// not used. ?!? ( CMD_ICLASS_READCHECK)
|
||||
// not used. ?!? ( CMD_HF_ICLASS_READCHECK)
|
||||
// turn off afterwards
|
||||
void iClass_ReadCheck(uint8_t blockno, uint8_t keytype) {
|
||||
uint8_t readcheck[] = { keytype, blockno };
|
||||
|
|
|
@ -1149,7 +1149,7 @@ void SimulateIso14443aTag(uint8_t tagType, uint8_t flags, uint8_t *data) {
|
|||
|
||||
if (SimulateIso14443aInit(tagType, flags, data, &responses, &cuid, counters, tearings, &pages) == false) {
|
||||
BigBuf_free_keep_EM();
|
||||
reply_ng(CMD_SIMULATE_MIFARE_CARD, PM3_EINIT, NULL, 0);
|
||||
reply_ng(CMD_HF_MIFARE_SIMULATE, PM3_EINIT, NULL, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1269,7 +1269,7 @@ void SimulateIso14443aTag(uint8_t tagType, uint8_t flags, uint8_t *data) {
|
|||
ar_nr_nonces[index].state = SECOND;
|
||||
|
||||
// send to client (one struct nonces_t)
|
||||
reply_ng(CMD_SIMULATE_MIFARE_CARD, PM3_SUCCESS, (uint8_t *)&ar_nr_nonces[index], sizeof(nonces_t));
|
||||
reply_ng(CMD_HF_MIFARE_SIMULATE, PM3_SUCCESS, (uint8_t *)&ar_nr_nonces[index], sizeof(nonces_t));
|
||||
|
||||
ar_nr_nonces[index].state = EMPTY;
|
||||
ar_nr_nonces[index].sector = 0;
|
||||
|
@ -1593,7 +1593,7 @@ void SimulateIso14443aTag(uint8_t tagType, uint8_t flags, uint8_t *data) {
|
|||
Dbprintf("-[ Num of moebius tries [%d]", moebius_count);
|
||||
}
|
||||
|
||||
reply_ng(CMD_SIMULATE_MIFARE_CARD, retval, NULL, 0);
|
||||
reply_ng(CMD_HF_MIFARE_SIMULATE, retval, NULL, 0);
|
||||
}
|
||||
|
||||
// prepare a delayed transfer. This simply shifts ToSend[] by a number
|
||||
|
@ -3246,7 +3246,7 @@ void DetectNACKbug(void) {
|
|||
data[0] = isOK;
|
||||
data[1] = num_nacks;
|
||||
num_to_bytes(i, 2, data + 2);
|
||||
reply_ng(CMD_MIFARE_NACK_DETECT, status, data, 4);
|
||||
reply_ng(CMD_HF_MIFARE_NACK_DETECT, status, data, 4);
|
||||
|
||||
//reply_mix(CMD_ACK, isOK, num_nacks, i, 0, 0);
|
||||
BigBuf_free();
|
||||
|
|
|
@ -432,7 +432,7 @@ void ModThenAcquireRawAdcSamples125k(uint32_t delay_off, uint32_t period_0, uint
|
|||
// Turn off antenna
|
||||
FpgaWriteConfWord(FPGA_MAJOR_MODE_OFF);
|
||||
// tell client we are done
|
||||
reply_ng(CMD_MOD_THEN_ACQUIRE_RAW_ADC_SAMPLES_125K, PM3_SUCCESS, NULL, 0);
|
||||
reply_ng(CMD_LF_MOD_THEN_ACQ_RAW_ADC, PM3_SUCCESS, NULL, 0);
|
||||
}
|
||||
|
||||
/* blank r/w tag data stream
|
||||
|
@ -1012,7 +1012,7 @@ void CmdHIDsimTAGEx(uint32_t hi, uint32_t lo, bool ledcontrol, int numcycles) {
|
|||
|
||||
void CmdHIDsimTAG(uint32_t hi, uint32_t lo, bool ledcontrol) {
|
||||
CmdHIDsimTAGEx(hi, lo, ledcontrol, -1);
|
||||
reply_ng(CMD_HID_SIM_TAG, PM3_EOPABORTED, NULL, 0);
|
||||
reply_ng(CMD_LF_HID_SIMULATE, PM3_EOPABORTED, NULL, 0);
|
||||
}
|
||||
|
||||
// prepare a waveform pattern in the buffer based on the ID given then
|
||||
|
@ -1050,7 +1050,7 @@ void CmdFSKsimTAG(uint8_t fchigh, uint8_t fclow, uint8_t separator, uint8_t clk,
|
|||
if (ledcontrol) LED_A_ON();
|
||||
SimulateTagLowFrequency(n, 0, ledcontrol);
|
||||
if (ledcontrol) LED_A_OFF();
|
||||
reply_ng(CMD_FSK_SIM_TAG, PM3_EOPABORTED, NULL, 0);
|
||||
reply_ng(CMD_LF_FSK_SIMULATE, PM3_EOPABORTED, NULL, 0);
|
||||
}
|
||||
|
||||
// compose ask waveform for one bit(ASK)
|
||||
|
@ -1139,7 +1139,7 @@ void CmdASKsimTAG(uint8_t encoding, uint8_t invert, uint8_t separator, uint8_t c
|
|||
if (ledcontrol) LED_A_ON();
|
||||
SimulateTagLowFrequency(n, 0, ledcontrol);
|
||||
if (ledcontrol) LED_A_OFF();
|
||||
reply_ng(CMD_ASK_SIM_TAG, PM3_EOPABORTED, NULL, 0);
|
||||
reply_ng(CMD_LF_ASK_SIMULATE, PM3_EOPABORTED, NULL, 0);
|
||||
}
|
||||
|
||||
//carrier can be 2,4 or 8
|
||||
|
@ -1186,7 +1186,7 @@ void CmdPSKsimTag(uint8_t carrier, uint8_t invert, uint8_t clk, uint16_t size, u
|
|||
if (ledcontrol) LED_A_ON();
|
||||
SimulateTagLowFrequency(n, 0, ledcontrol);
|
||||
if (ledcontrol) LED_A_OFF();
|
||||
reply_ng(CMD_PSK_SIM_TAG, PM3_EOPABORTED, NULL, 0);
|
||||
reply_ng(CMD_LF_PSK_SIMULATE, PM3_EOPABORTED, NULL, 0);
|
||||
}
|
||||
|
||||
// loop to get raw HID waveform then FSK demodulate the TAG ID from it
|
||||
|
@ -1803,7 +1803,7 @@ void T55xxWriteBlock(uint8_t *data) {
|
|||
FpgaWriteConfWord(FPGA_MAJOR_MODE_OFF);
|
||||
|
||||
// cmd_send(CMD_ACK,0,0,0,0,0);
|
||||
reply_ng(CMD_T55XX_WRITE_BLOCK, PM3_SUCCESS, NULL, 0);
|
||||
reply_ng(CMD_LF_T55XX_WRITEBL, PM3_SUCCESS, NULL, 0);
|
||||
LED_A_OFF();
|
||||
}
|
||||
|
||||
|
@ -1812,7 +1812,7 @@ void T55xxWriteBlock(uint8_t *data) {
|
|||
void T55xxWriteBlock(uint8_t *data) {
|
||||
t55xx_write_block_t *c = (t55xx_write_block_t *)data;
|
||||
T55xxWriteBlockExt(c->data, c->blockno, c->pwd, c->flags);
|
||||
// reply_ng(CMD_T55XX_WRITE_BLOCK, PM3_SUCCESS, NULL, 0);
|
||||
// reply_ng(CMD_LF_T55XX_WRITEBL, PM3_SUCCESS, NULL, 0);
|
||||
}
|
||||
*/
|
||||
/*
|
||||
|
@ -1864,7 +1864,7 @@ bool brute_mem = (flags & 0x0100) >> 8;
|
|||
// Turn the field off
|
||||
if (!brute_mem) {
|
||||
FpgaWriteConfWord(FPGA_MAJOR_MODE_OFF);
|
||||
reply_ng(CMD_T55XX_READ_BLOCK, PM3_SUCCESS, NULL, 0);
|
||||
reply_ng(CMD_LF_T55XX_READBL, PM3_SUCCESS, NULL, 0);
|
||||
LED_A_OFF();
|
||||
}
|
||||
}
|
||||
|
@ -1924,7 +1924,7 @@ void T55xxReadBlock(uint8_t page, bool pwd_mode, bool brute_mem, uint8_t block,
|
|||
// Turn the field off
|
||||
if (!brute_mem) {
|
||||
FpgaWriteConfWord(FPGA_MAJOR_MODE_OFF);
|
||||
reply_ng(CMD_T55XX_READ_BLOCK, PM3_SUCCESS, NULL, 0);
|
||||
reply_ng(CMD_LF_T55XX_READBL, PM3_SUCCESS, NULL, 0);
|
||||
LED_A_OFF();
|
||||
}
|
||||
|
||||
|
@ -2412,7 +2412,7 @@ void EM4xReadWord(uint8_t addr, uint32_t pwd, uint8_t usepwd) {
|
|||
DoPartialAcquisition(20, true, 6000, 1000);
|
||||
|
||||
FpgaWriteConfWord(FPGA_MAJOR_MODE_OFF);
|
||||
reply_ng(CMD_EM4X_READ_WORD, PM3_SUCCESS, NULL, 0);
|
||||
reply_ng(CMD_LF_EM4X_READWORD, PM3_SUCCESS, NULL, 0);
|
||||
LED_A_OFF();
|
||||
}
|
||||
|
||||
|
@ -2445,7 +2445,7 @@ void EM4xWriteWord(uint8_t addr, uint32_t data, uint32_t pwd, uint8_t usepwd) {
|
|||
DoPartialAcquisition(20, true, 6000, 1000);
|
||||
|
||||
FpgaWriteConfWord(FPGA_MAJOR_MODE_OFF);
|
||||
reply_ng(CMD_EM4X_WRITE_WORD, PM3_SUCCESS, NULL, 0);
|
||||
reply_ng(CMD_LF_EM4X_WRITEWORD, PM3_SUCCESS, NULL, 0);
|
||||
LED_A_OFF();
|
||||
}
|
||||
|
||||
|
|
|
@ -94,7 +94,7 @@ void MifareReadBlock(uint8_t blockNo, uint8_t keyType, uint8_t *datain) {
|
|||
if (DBGLEVEL >= 2) DbpString("READ BLOCK FINISHED");
|
||||
|
||||
LED_B_ON();
|
||||
reply_ng(CMD_MIFARE_READBL, status, dataoutbuf, 16);
|
||||
reply_ng(CMD_HF_MIFARE_READBL, status, dataoutbuf, 16);
|
||||
LED_B_OFF();
|
||||
|
||||
FpgaWriteConfWord(FPGA_MAJOR_MODE_OFF);
|
||||
|
@ -1601,7 +1601,7 @@ void MifareChkKeys(uint8_t *datain) {
|
|||
|
||||
LED_B_ON();
|
||||
|
||||
reply_ng(CMD_MIFARE_CHKKEYS, PM3_SUCCESS, (uint8_t *)&keyresult, sizeof(keyresult));
|
||||
reply_ng(CMD_HF_MIFARE_CHKKEYS, PM3_SUCCESS, (uint8_t *)&keyresult, sizeof(keyresult));
|
||||
FpgaWriteConfWord(FPGA_MAJOR_MODE_OFF);
|
||||
LEDsoff();
|
||||
|
||||
|
@ -1637,7 +1637,7 @@ void MifareEMemGet(uint8_t blockno, uint8_t blockcnt) {
|
|||
//
|
||||
size_t size = blockcnt * 16;
|
||||
if (size > PM3_CMD_DATA_SIZE) {
|
||||
reply_ng(CMD_MIFARE_EML_MEMGET, PM3_EMALLOC, NULL, 0);
|
||||
reply_ng(CMD_HF_MIFARE_EML_MEMGET, PM3_EMALLOC, NULL, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1646,7 +1646,7 @@ void MifareEMemGet(uint8_t blockno, uint8_t blockcnt) {
|
|||
emlGetMem(buf, blockno, blockcnt); // data, block num, blocks count (max 4)
|
||||
|
||||
LED_B_ON();
|
||||
reply_ng(CMD_MIFARE_EML_MEMGET, PM3_SUCCESS, buf, size);
|
||||
reply_ng(CMD_HF_MIFARE_EML_MEMGET, PM3_SUCCESS, buf, size);
|
||||
LED_B_OFF();
|
||||
BigBuf_free_keep_EM();
|
||||
}
|
||||
|
@ -1990,7 +1990,7 @@ TEST2:
|
|||
OUT:
|
||||
|
||||
data[0] = isGen;
|
||||
reply_ng(CMD_MIFARE_CIDENT, PM3_SUCCESS, data, sizeof(data));
|
||||
reply_ng(CMD_HF_MIFARE_CIDENT, PM3_SUCCESS, data, sizeof(data));
|
||||
// turns off
|
||||
OnSuccessMagic();
|
||||
BigBuf_free();
|
||||
|
@ -2059,7 +2059,7 @@ void MifareSetMod(uint8_t *datain) {
|
|||
crypto1_destroy(pcs);
|
||||
|
||||
LED_B_ON();
|
||||
reply_ng(CMD_MIFARE_SETMOD, isOK, NULL, 0);
|
||||
reply_ng(CMD_HF_MIFARE_SETMOD, isOK, NULL, 0);
|
||||
|
||||
LED_B_OFF();
|
||||
|
||||
|
|
|
@ -1221,7 +1221,7 @@ void Mifare1ksim(uint16_t flags, uint8_t exitAfterNReads, uint8_t *datain) {
|
|||
|
||||
if ((flags & FLAG_INTERACTIVE) == FLAG_INTERACTIVE) { // Interactive mode flag, means we need to send ACK
|
||||
//Send the collected ar_nr in the response
|
||||
reply_old(CMD_ACK, CMD_SIMULATE_MIFARE_CARD, button_pushed, 0, &ar_nr_resp, sizeof(ar_nr_resp));
|
||||
reply_old(CMD_ACK, CMD_HF_MIFARE_SIMULATE, button_pushed, 0, &ar_nr_resp, sizeof(ar_nr_resp));
|
||||
}
|
||||
|
||||
FpgaWriteConfWord(FPGA_MAJOR_MODE_OFF);
|
||||
|
|
|
@ -30,7 +30,7 @@ void ReadThinFilm(void) {
|
|||
|
||||
// power on and listen for answer.
|
||||
bool status = GetIso14443aAnswerFromTag_Thinfilm(buf, &len);
|
||||
reply_ng(CMD_THINFILM_READ, status ? PM3_SUCCESS : PM3_ENODATA, buf, len);
|
||||
reply_ng(CMD_HF_THINFILM_READ, status ? PM3_SUCCESS : PM3_ENODATA, buf, len);
|
||||
|
||||
iso14443a_off();
|
||||
set_tracing(false);
|
||||
|
@ -148,5 +148,5 @@ void SimulateThinFilm(uint8_t *data, size_t len) {
|
|||
}
|
||||
}
|
||||
LED_A_OFF();
|
||||
reply_ng(CMD_SIMULATE_TAG_THINFILM, status, NULL, 0);
|
||||
reply_ng(CMD_HF_THINFILM_SIMULATE, status, NULL, 0);
|
||||
}
|
||||
|
|
|
@ -146,7 +146,7 @@ int CmdHFSniff(const char *Cmd) {
|
|||
int skiptriggers = param_get32ex(Cmd, 1, 0, 10);
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandMIX(CMD_HF_SNIFFER, skippairs, skiptriggers, 0, NULL, 0);
|
||||
SendCommandMIX(CMD_HF_SNIFF, skippairs, skiptriggers, 0, NULL, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -227,7 +227,7 @@ static int CmdHF14AList(const char *Cmd) {
|
|||
}
|
||||
|
||||
int Hf14443_4aGetCardData(iso14a_card_select_t *card) {
|
||||
SendCommandMIX(CMD_READER_ISO_14443a, ISO14A_CONNECT, 0, 0, NULL, 0);
|
||||
SendCommandMIX(CMD_HF_ISO14443A_READER, ISO14A_CONNECT, 0, 0, NULL, 0);
|
||||
|
||||
PacketResponseNG resp;
|
||||
WaitForResponse(CMD_ACK, &resp);
|
||||
|
@ -297,7 +297,7 @@ static int CmdHF14AReader(const char *Cmd) {
|
|||
cm |= ISO14A_NO_DISCONNECT;
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandMIX(CMD_READER_ISO_14443a, cm, 0, 0, NULL, 0);
|
||||
SendCommandMIX(CMD_HF_ISO14443A_READER, cm, 0, 0, NULL, 0);
|
||||
|
||||
if (ISO14A_CONNECT & cm) {
|
||||
PacketResponseNG resp;
|
||||
|
@ -380,7 +380,7 @@ static int CmdHF14ACUIDs(const char *Cmd) {
|
|||
}
|
||||
|
||||
// execute anticollision procedure
|
||||
SendCommandMIX(CMD_READER_ISO_14443a, ISO14A_CONNECT | ISO14A_NO_RATS, 0, 0, NULL, 0);
|
||||
SendCommandMIX(CMD_HF_ISO14443A_READER, ISO14A_CONNECT | ISO14A_NO_RATS, 0, 0, NULL, 0);
|
||||
|
||||
PacketResponseNG resp;
|
||||
WaitForResponse(CMD_ACK, &resp);
|
||||
|
@ -481,13 +481,13 @@ int CmdHF14ASim(const char *Cmd) {
|
|||
memcpy(payload.uid, uid, uidlen);
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_SIMULATE_TAG_ISO_14443a, (uint8_t *)&payload, sizeof(payload));
|
||||
SendCommandNG(CMD_HF_ISO14443A_SIMULATE, (uint8_t *)&payload, sizeof(payload));
|
||||
PacketResponseNG resp;
|
||||
|
||||
PrintAndLogEx(SUCCESS, "press pm3-button to abort simulation");
|
||||
|
||||
while (!kbd_enter_pressed()) {
|
||||
if (WaitForResponseTimeout(CMD_SIMULATE_MIFARE_CARD, &resp, 1500) == 0) continue;
|
||||
if (WaitForResponseTimeout(CMD_HF_MIFARE_SIMULATE, &resp, 1500) == 0) continue;
|
||||
if (resp.status != PM3_SUCCESS) break;
|
||||
|
||||
if ((flags & FLAG_NR_AR_ATTACK) != FLAG_NR_AR_ATTACK) break;
|
||||
|
@ -511,7 +511,7 @@ int CmdHF14ASniff(const char *Cmd) {
|
|||
if (ctmp == 'r') param |= 0x02;
|
||||
}
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_SNIFF_ISO_14443a, (uint8_t *)¶m, sizeof(uint8_t));
|
||||
SendCommandNG(CMD_HF_ISO14443A_SNIFF, (uint8_t *)¶m, sizeof(uint8_t));
|
||||
return PM3_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -525,7 +525,7 @@ int ExchangeRAW14a(uint8_t *datain, int datainlen, bool activateField, bool leav
|
|||
PacketResponseNG resp;
|
||||
|
||||
// Anticollision + SELECT card
|
||||
SendCommandMIX(CMD_READER_ISO_14443a, ISO14A_CONNECT | ISO14A_NO_DISCONNECT, 0, 0, NULL, 0);
|
||||
SendCommandMIX(CMD_HF_ISO14443A_READER, ISO14A_CONNECT | ISO14A_NO_DISCONNECT, 0, 0, NULL, 0);
|
||||
if (!WaitForResponseTimeout(CMD_ACK, &resp, 1500)) {
|
||||
PrintAndLogEx(ERR, "Proxmark3 connection timeout.");
|
||||
return 1;
|
||||
|
@ -545,7 +545,7 @@ int ExchangeRAW14a(uint8_t *datain, int datainlen, bool activateField, bool leav
|
|||
if (resp.oldarg[0] == 2) { // 0: couldn't read, 1: OK, with ATS, 2: OK, no ATS, 3: proprietary Anticollision
|
||||
// get ATS
|
||||
uint8_t rats[] = { 0xE0, 0x80 }; // FSDI=8 (FSD=256), CID=0
|
||||
SendCommandOLD(CMD_READER_ISO_14443a, ISO14A_RAW | ISO14A_APPEND_CRC | ISO14A_NO_DISCONNECT, 2, 0, rats, 2);
|
||||
SendCommandOLD(CMD_HF_ISO14443A_READER, ISO14A_RAW | ISO14A_APPEND_CRC | ISO14A_NO_DISCONNECT, 2, 0, rats, 2);
|
||||
if (!WaitForResponseTimeout(CMD_ACK, &resp, 1500)) {
|
||||
PrintAndLogEx(ERR, "Proxmark3 connection timeout.");
|
||||
return 1;
|
||||
|
@ -564,7 +564,7 @@ int ExchangeRAW14a(uint8_t *datain, int datainlen, bool activateField, bool leav
|
|||
uint8_t data[PM3_CMD_DATA_SIZE] = { 0x0a | responseNum, 0x00};
|
||||
responseNum ^= 1;
|
||||
memcpy(&data[2], datain, datainlen & 0xFFFF);
|
||||
SendCommandOLD(CMD_READER_ISO_14443a, ISO14A_RAW | ISO14A_APPEND_CRC | cmdc, (datainlen & 0xFFFF) + 2, 0, data, (datainlen & 0xFFFF) + 2);
|
||||
SendCommandOLD(CMD_HF_ISO14443A_READER, ISO14A_RAW | ISO14A_APPEND_CRC | cmdc, (datainlen & 0xFFFF) + 2, 0, data, (datainlen & 0xFFFF) + 2);
|
||||
|
||||
uint8_t *recv;
|
||||
PacketResponseNG resp;
|
||||
|
@ -619,7 +619,7 @@ static int SelectCard14443_4(bool disconnect, iso14a_card_select_t *card) {
|
|||
DropField();
|
||||
|
||||
// Anticollision + SELECT card
|
||||
SendCommandMIX(CMD_READER_ISO_14443a, ISO14A_CONNECT | ISO14A_NO_DISCONNECT, 0, 0, NULL, 0);
|
||||
SendCommandMIX(CMD_HF_ISO14443A_READER, ISO14A_CONNECT | ISO14A_NO_DISCONNECT, 0, 0, NULL, 0);
|
||||
if (!WaitForResponseTimeout(CMD_ACK, &resp, 1500)) {
|
||||
PrintAndLogEx(ERR, "Proxmark3 connection timeout.");
|
||||
return 1;
|
||||
|
@ -639,7 +639,7 @@ static int SelectCard14443_4(bool disconnect, iso14a_card_select_t *card) {
|
|||
if (resp.oldarg[0] == 2) { // 0: couldn't read, 1: OK, with ATS, 2: OK, no ATS, 3: proprietary Anticollision
|
||||
// get ATS
|
||||
uint8_t rats[] = { 0xE0, 0x80 }; // FSDI=8 (FSD=256), CID=0
|
||||
SendCommandOLD(CMD_READER_ISO_14443a, ISO14A_RAW | ISO14A_APPEND_CRC | ISO14A_NO_DISCONNECT, sizeof(rats), 0, rats, sizeof(rats));
|
||||
SendCommandOLD(CMD_HF_ISO14443A_READER, ISO14A_RAW | ISO14A_APPEND_CRC | ISO14A_NO_DISCONNECT, sizeof(rats), 0, rats, sizeof(rats));
|
||||
if (!WaitForResponseTimeout(CMD_ACK, &resp, 1500)) {
|
||||
PrintAndLogEx(ERR, "Proxmark3 connection timeout.");
|
||||
return 1;
|
||||
|
@ -694,9 +694,9 @@ static int CmdExchangeAPDU(bool chainingin, uint8_t *datain, int datainlen, bool
|
|||
// here length PM3_CMD_DATA_SIZE=512
|
||||
// timeout must be authomatically set by "get ATS"
|
||||
if (datain)
|
||||
SendCommandOLD(CMD_READER_ISO_14443a, ISO14A_APDU | ISO14A_NO_DISCONNECT | cmdc, (datainlen & 0xFFFF), 0, datain, datainlen & 0xFFFF);
|
||||
SendCommandOLD(CMD_HF_ISO14443A_READER, ISO14A_APDU | ISO14A_NO_DISCONNECT | cmdc, (datainlen & 0xFFFF), 0, datain, datainlen & 0xFFFF);
|
||||
else
|
||||
SendCommandMIX(CMD_READER_ISO_14443a, ISO14A_APDU | ISO14A_NO_DISCONNECT | cmdc, 0, 0, NULL, 0);
|
||||
SendCommandMIX(CMD_HF_ISO14443A_READER, ISO14A_APDU | ISO14A_NO_DISCONNECT | cmdc, 0, 0, NULL, 0);
|
||||
|
||||
PacketResponseNG resp;
|
||||
|
||||
|
@ -1086,7 +1086,7 @@ static int CmdHF14ACmdRaw(const char *Cmd) {
|
|||
datalen = (datalen > PM3_CMD_DATA_SIZE) ? PM3_CMD_DATA_SIZE : datalen;
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandOLD(CMD_READER_ISO_14443a, flags, (datalen & 0xFFFF) | ((uint32_t)(numbits << 16)), argtimeout, data, datalen & 0xFFFF);
|
||||
SendCommandOLD(CMD_HF_ISO14443A_READER, flags, (datalen & 0xFFFF) | ((uint32_t)(numbits << 16)), argtimeout, data, datalen & 0xFFFF);
|
||||
|
||||
if (reply) {
|
||||
int res = 0;
|
||||
|
@ -1149,7 +1149,7 @@ static int CmdHF14AAntiFuzz(const char *Cmd) {
|
|||
|
||||
CLIParserFree();
|
||||
clearCommandBuffer();
|
||||
SendCommandMIX(CMD_ANTIFUZZ_ISO_14443a, arg0, 0, 0, NULL, 0);
|
||||
SendCommandMIX(CMD_HF_ISO14443A_ANTIFUZZ, arg0, 0, 0, NULL, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1212,7 +1212,7 @@ int CmdHF14A(const char *Cmd) {
|
|||
|
||||
int infoHF14A(bool verbose, bool do_nack_test) {
|
||||
clearCommandBuffer();
|
||||
SendCommandMIX(CMD_READER_ISO_14443a, ISO14A_CONNECT | ISO14A_NO_DISCONNECT, 0, 0, NULL, 0);
|
||||
SendCommandMIX(CMD_HF_ISO14443A_READER, ISO14A_CONNECT | ISO14A_NO_DISCONNECT, 0, 0, NULL, 0);
|
||||
PacketResponseNG resp;
|
||||
if (!WaitForResponseTimeout(CMD_ACK, &resp, 2500)) {
|
||||
if (verbose) PrintAndLogEx(WARNING, "iso14443a card select failed");
|
||||
|
@ -1264,7 +1264,7 @@ int infoHF14A(bool verbose, bool do_nack_test) {
|
|||
|
||||
// reconnect for further tests
|
||||
clearCommandBuffer();
|
||||
SendCommandMIX(CMD_READER_ISO_14443a, ISO14A_CONNECT | ISO14A_NO_DISCONNECT, 0, 0, NULL, 0);
|
||||
SendCommandMIX(CMD_HF_ISO14443A_READER, ISO14A_CONNECT | ISO14A_NO_DISCONNECT, 0, 0, NULL, 0);
|
||||
WaitForResponse(CMD_ACK, &resp);
|
||||
|
||||
memcpy(&card, (iso14a_card_select_t *)resp.data.asBytes, sizeof(iso14a_card_select_t));
|
||||
|
@ -1334,7 +1334,7 @@ int infoHF14A(bool verbose, bool do_nack_test) {
|
|||
if (select_status == 2) {
|
||||
uint8_t rats[] = { 0xE0, 0x80 }; // FSDI=8 (FSD=256), CID=0
|
||||
clearCommandBuffer();
|
||||
SendCommandOLD(CMD_READER_ISO_14443a, ISO14A_RAW | ISO14A_APPEND_CRC | ISO14A_NO_DISCONNECT, 2, 0, rats, sizeof(rats));
|
||||
SendCommandOLD(CMD_HF_ISO14443A_READER, ISO14A_RAW | ISO14A_APPEND_CRC | ISO14A_NO_DISCONNECT, 2, 0, rats, sizeof(rats));
|
||||
WaitForResponse(CMD_ACK, &resp);
|
||||
|
||||
memcpy(card.ats, resp.data.asBytes, resp.oldarg[0]);
|
||||
|
|
|
@ -109,13 +109,13 @@ static int usage_hf_14b_dump(void) {
|
|||
/*
|
||||
static void switch_on_field_14b(void) {
|
||||
clearCommandBuffer();
|
||||
SendCommandMIX(CMD_ISO_14443B_COMMAND, ISO14B_CONNECT, 0, 0, NULL, 0);
|
||||
SendCommandMIX(CMD_HF_ISO14443B_COMMAND, ISO14B_CONNECT, 0, 0, NULL, 0);
|
||||
}
|
||||
*/
|
||||
|
||||
static int switch_off_field_14b(void) {
|
||||
clearCommandBuffer();
|
||||
SendCommandMIX(CMD_ISO_14443B_COMMAND, ISO14B_DISCONNECT, 0, 0, NULL, 0);
|
||||
SendCommandMIX(CMD_HF_ISO14443B_COMMAND, ISO14B_DISCONNECT, 0, 0, NULL, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -170,7 +170,7 @@ static int CmdHF14BSim(const char *Cmd) {
|
|||
}
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandMIX(CMD_SIMULATE_TAG_ISO_14443B, pupi, 0, 0, NULL, 0);
|
||||
SendCommandMIX(CMD_HF_ISO14443B_SIMULATE, pupi, 0, 0, NULL, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -180,7 +180,7 @@ static int CmdHF14BSniff(const char *Cmd) {
|
|||
if (cmdp == 'h') return usage_hf_14b_sniff();
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_SNIFF_ISO_14443B, NULL, 0);
|
||||
SendCommandNG(CMD_HF_ISO14443B_SNIFF, NULL, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -274,7 +274,7 @@ static int CmdHF14BCmdRaw(const char *Cmd) {
|
|||
datalen = (datalen > PM3_CMD_DATA_SIZE) ? PM3_CMD_DATA_SIZE : datalen;
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandOLD(CMD_ISO_14443B_COMMAND, flags, datalen, time_wait, data, datalen);
|
||||
SendCommandOLD(CMD_HF_ISO14443B_COMMAND, flags, datalen, time_wait, data, datalen);
|
||||
|
||||
if (!reply) return 1;
|
||||
|
||||
|
@ -301,7 +301,7 @@ static bool get_14b_UID(iso14b_card_select_t *card) {
|
|||
while (retry--) {
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandMIX(CMD_ISO_14443B_COMMAND, ISO14B_CONNECT | ISO14B_SELECT_SR | ISO14B_DISCONNECT, 0, 0, NULL, 0);
|
||||
SendCommandMIX(CMD_HF_ISO14443B_COMMAND, ISO14B_CONNECT | ISO14B_SELECT_SR | ISO14B_DISCONNECT, 0, 0, NULL, 0);
|
||||
if (WaitForResponseTimeout(CMD_ACK, &resp, TIMEOUT)) {
|
||||
|
||||
uint8_t status = resp.oldarg[0];
|
||||
|
@ -317,7 +317,7 @@ static bool get_14b_UID(iso14b_card_select_t *card) {
|
|||
while (retry--) {
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandMIX(CMD_ISO_14443B_COMMAND, ISO14B_CONNECT | ISO14B_SELECT_STD | ISO14B_DISCONNECT, 0, 0, NULL, 0);
|
||||
SendCommandMIX(CMD_HF_ISO14443B_COMMAND, ISO14B_CONNECT | ISO14B_SELECT_STD | ISO14B_DISCONNECT, 0, 0, NULL, 0);
|
||||
if (WaitForResponseTimeout(CMD_ACK, &resp, TIMEOUT)) {
|
||||
|
||||
uint8_t status = resp.oldarg[0];
|
||||
|
@ -501,7 +501,7 @@ static bool HF14B_Std_Info(bool verbose) {
|
|||
|
||||
// 14b get and print UID only (general info)
|
||||
clearCommandBuffer();
|
||||
SendCommandMIX(CMD_ISO_14443B_COMMAND, ISO14B_CONNECT | ISO14B_SELECT_STD | ISO14B_DISCONNECT, 0, 0, NULL, 0);
|
||||
SendCommandMIX(CMD_HF_ISO14443B_COMMAND, ISO14B_CONNECT | ISO14B_SELECT_STD | ISO14B_DISCONNECT, 0, 0, NULL, 0);
|
||||
PacketResponseNG resp;
|
||||
|
||||
if (!WaitForResponseTimeout(CMD_ACK, &resp, TIMEOUT)) {
|
||||
|
@ -541,7 +541,7 @@ static bool HF14B_Std_Info(bool verbose) {
|
|||
static bool HF14B_ST_Info(bool verbose) {
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandMIX(CMD_ISO_14443B_COMMAND, ISO14B_CONNECT | ISO14B_SELECT_SR | ISO14B_DISCONNECT, 0, 0, NULL, 0);
|
||||
SendCommandMIX(CMD_HF_ISO14443B_COMMAND, ISO14B_CONNECT | ISO14B_SELECT_SR | ISO14B_DISCONNECT, 0, 0, NULL, 0);
|
||||
PacketResponseNG resp;
|
||||
|
||||
if (!WaitForResponseTimeout(CMD_ACK, &resp, TIMEOUT)) {
|
||||
|
@ -597,7 +597,7 @@ static bool HF14B_ST_Reader(bool verbose) {
|
|||
|
||||
// SRx get and print general info about SRx chip from UID
|
||||
clearCommandBuffer();
|
||||
SendCommandMIX(CMD_ISO_14443B_COMMAND, ISO14B_CONNECT | ISO14B_SELECT_SR | ISO14B_DISCONNECT, 0, 0, NULL, 0);
|
||||
SendCommandMIX(CMD_HF_ISO14443B_COMMAND, ISO14B_CONNECT | ISO14B_SELECT_SR | ISO14B_DISCONNECT, 0, 0, NULL, 0);
|
||||
PacketResponseNG resp;
|
||||
if (!WaitForResponseTimeout(CMD_ACK, &resp, TIMEOUT)) {
|
||||
if (verbose) PrintAndLogEx(WARNING, "command execution timeout");
|
||||
|
@ -636,7 +636,7 @@ static bool HF14B_Std_Reader(bool verbose) {
|
|||
|
||||
// 14b get and print UID only (general info)
|
||||
clearCommandBuffer();
|
||||
SendCommandMIX(CMD_ISO_14443B_COMMAND, ISO14B_CONNECT | ISO14B_SELECT_STD | ISO14B_DISCONNECT, 0, 0, NULL, 0);
|
||||
SendCommandMIX(CMD_HF_ISO14443B_COMMAND, ISO14B_CONNECT | ISO14B_SELECT_STD | ISO14B_DISCONNECT, 0, 0, NULL, 0);
|
||||
PacketResponseNG resp;
|
||||
|
||||
if (!WaitForResponseTimeout(CMD_ACK, &resp, TIMEOUT)) {
|
||||
|
@ -680,7 +680,7 @@ static bool HF14B_Other_Reader() {
|
|||
// uint32_t flags = ISO14B_CONNECT | ISO14B_SELECT_STD | ISO14B_RAW | ISO14B_APPEND_CRC;
|
||||
|
||||
// clearCommandBuffer();
|
||||
// SendCommandOLD(CMD_ISO_14443B_COMMAND, flags, datalen, 0, data, datalen);
|
||||
// SendCommandOLD(CMD_HF_ISO14443B_COMMAND, flags, datalen, 0, data, datalen);
|
||||
// PacketResponseNG resp;
|
||||
// WaitForResponse(CMD_ACK,&resp);
|
||||
|
||||
|
@ -694,7 +694,7 @@ static bool HF14B_Other_Reader() {
|
|||
|
||||
// data[0] = ISO14443B_AUTHENTICATE;
|
||||
// clearCommandBuffer();
|
||||
// SendCommandOLD(CMD_ISO_14443B_COMMAND, flags, 1, 0, data, 1);
|
||||
// SendCommandOLD(CMD_HF_ISO14443B_COMMAND, flags, 1, 0, data, 1);
|
||||
// PacketResponseNG resp;
|
||||
// WaitForResponse(CMD_ACK, &resp);
|
||||
|
||||
|
@ -708,7 +708,7 @@ static bool HF14B_Other_Reader() {
|
|||
|
||||
// data[0] = ISO14443B_RESET;
|
||||
// clearCommandBuffer();
|
||||
// SendCommandOLD(CMD_ISO_14443B_COMMAND, flags, 1, 0, data, 1);
|
||||
// SendCommandOLD(CMD_HF_ISO14443B_COMMAND, flags, 1, 0, data, 1);
|
||||
// PacketResponseNG resp;
|
||||
// WaitForResponse(CMD_ACK, &resp);
|
||||
|
||||
|
@ -745,7 +745,7 @@ static int CmdHF14BReadSri(const char *Cmd) {
|
|||
uint8_t blocks = (tagtype == 1) ? 0x7F : 0x0F;
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandMIX(CMD_READ_SRI_TAG, blocks, 0, 0, NULL, 0);
|
||||
SendCommandMIX(CMD_HF_SRI_READ, blocks, 0, 0, NULL, 0);
|
||||
return 0;
|
||||
}
|
||||
// New command to write a SRI512/SRIX4K tag.
|
||||
|
@ -884,7 +884,7 @@ static int CmdHF14BDump(const char *Cmd) {
|
|||
|
||||
PacketResponseNG resp;
|
||||
clearCommandBuffer();
|
||||
SendCommandMIX(CMD_ISO_14443B_COMMAND, ISO14B_CONNECT | ISO14B_SELECT_SR, 0, 0, NULL, 0);
|
||||
SendCommandMIX(CMD_HF_ISO14443B_COMMAND, ISO14B_CONNECT | ISO14B_SELECT_SR, 0, 0, NULL, 0);
|
||||
|
||||
//select
|
||||
if (WaitForResponseTimeout(CMD_ACK, &resp, 2000)) {
|
||||
|
@ -901,7 +901,7 @@ static int CmdHF14BDump(const char *Cmd) {
|
|||
req[1] = blocknum;
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandOLD(CMD_ISO_14443B_COMMAND, ISO14B_APPEND_CRC | ISO14B_RAW, 2, 0, req, sizeof(req));
|
||||
SendCommandOLD(CMD_HF_ISO14443B_COMMAND, ISO14B_APPEND_CRC | ISO14B_RAW, 2, 0, req, sizeof(req));
|
||||
|
||||
if (WaitForResponseTimeout(CMD_ACK, &resp, 2000)) {
|
||||
|
||||
|
|
|
@ -212,7 +212,7 @@ static int getUID(uint8_t *buf) {
|
|||
for (retry = 0; retry < 3; retry++) {
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandOLD(CMD_ISO_15693_COMMAND, sizeof(data), 1, 1, data, sizeof(data));
|
||||
SendCommandOLD(CMD_HF_ISO15693_COMMAND, sizeof(data), 1, 1, data, sizeof(data));
|
||||
|
||||
if (WaitForResponseTimeout(CMD_ACK, &resp, 2000)) {
|
||||
|
||||
|
@ -583,7 +583,7 @@ static int CmdHF15Samples(const char *Cmd) {
|
|||
if (cmdp == 'h') return usage_15_samples();
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_ACQUIRE_RAW_ADC_SAMPLES_ISO_15693, NULL, 0);
|
||||
SendCommandNG(CMD_HF_ISO15693_ACQ_RAW_ADC, NULL, 0);
|
||||
|
||||
getSamples(0, false);
|
||||
return 0;
|
||||
|
@ -617,7 +617,7 @@ static int CmdHF15Info(const char *Cmd) {
|
|||
//PrintAndLogEx(NORMAL, "cmd %s", sprint_hex(req, reqlen) );
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandOLD(CMD_ISO_15693_COMMAND, reqlen, arg1, 1, req, reqlen);
|
||||
SendCommandOLD(CMD_HF_ISO15693_COMMAND, reqlen, arg1, 1, req, reqlen);
|
||||
|
||||
if (!WaitForResponseTimeout(CMD_ACK, &resp, 2000)) {
|
||||
PrintAndLogEx(WARNING, "iso15693 card select failed");
|
||||
|
@ -680,7 +680,7 @@ static int CmdHF15Record(const char *Cmd) {
|
|||
if (cmdp == 'h') return usage_15_record();
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_RECORD_RAW_ADC_SAMPLES_ISO_15693, NULL, 0);
|
||||
SendCommandNG(CMD_HF_ISO15693_RAWADC, NULL, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -707,7 +707,7 @@ static int CmdHF15Sim(const char *Cmd) {
|
|||
PrintAndLogEx(SUCCESS, "Starting simulating UID %s", sprint_hex(uid, sizeof(uid)));
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandOLD(CMD_SIMTAG_ISO_15693, 0, 0, 0, uid, 8);
|
||||
SendCommandOLD(CMD_HF_ISO15693_SIMULATE, 0, 0, 0, uid, 8);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -721,7 +721,7 @@ static int CmdHF15Afi(const char *Cmd) {
|
|||
PrintAndLogEx(SUCCESS, "press pm3-button to cancel");
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandMIX(CMD_ISO_15693_FIND_AFI, strtol(Cmd, NULL, 0), 0, 0, NULL, 0);
|
||||
SendCommandMIX(CMD_HF_ISO15693_FINDAFI, strtol(Cmd, NULL, 0), 0, 0, NULL, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -798,7 +798,7 @@ static int CmdHF15Dump(const char *Cmd) {
|
|||
AddCrc15(req, 11);
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandOLD(CMD_ISO_15693_COMMAND, sizeof(req), 1, 1, req, sizeof(req));
|
||||
SendCommandOLD(CMD_HF_ISO15693_COMMAND, sizeof(req), 1, 1, req, sizeof(req));
|
||||
|
||||
if (WaitForResponseTimeout(CMD_ACK, &resp, 2000)) {
|
||||
|
||||
|
@ -915,7 +915,7 @@ static int CmdHF15Raw(const char *Cmd) {
|
|||
}
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandOLD(CMD_ISO_15693_COMMAND, datalen, fast, reply, data, datalen);
|
||||
SendCommandOLD(CMD_HF_ISO15693_COMMAND, datalen, fast, reply, data, datalen);
|
||||
|
||||
if (reply) {
|
||||
if (WaitForResponseTimeout(CMD_ACK, &resp, 2000)) {
|
||||
|
@ -970,7 +970,7 @@ static int CmdHF15Readmulti(const char *Cmd) {
|
|||
reqlen += 2;
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandOLD(CMD_ISO_15693_COMMAND, reqlen, arg1, 1, req, reqlen);
|
||||
SendCommandOLD(CMD_HF_ISO15693_COMMAND, reqlen, arg1, 1, req, reqlen);
|
||||
|
||||
if (!WaitForResponseTimeout(CMD_ACK, &resp, 2000)) {
|
||||
PrintAndLogEx(FAILED, "iso15693 card select failed");
|
||||
|
@ -1048,7 +1048,7 @@ static int CmdHF15Read(const char *Cmd) {
|
|||
reqlen += 2;
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandOLD(CMD_ISO_15693_COMMAND, reqlen, arg1, 1, req, reqlen);
|
||||
SendCommandOLD(CMD_HF_ISO15693_COMMAND, reqlen, arg1, 1, req, reqlen);
|
||||
|
||||
if (!WaitForResponseTimeout(CMD_ACK, &resp, 2000)) {
|
||||
PrintAndLogEx(NORMAL, "iso15693 card select failed");
|
||||
|
@ -1131,7 +1131,7 @@ static int CmdHF15Write(const char *Cmd) {
|
|||
PrintAndLogEx(NORMAL, "iso15693 writing to page %02d (0x%02X) | data ", pagenum, pagenum);
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandOLD(CMD_ISO_15693_COMMAND, reqlen, arg1, 1, req, reqlen);
|
||||
SendCommandOLD(CMD_HF_ISO15693_COMMAND, reqlen, arg1, 1, req, reqlen);
|
||||
|
||||
if (!WaitForResponseTimeout(CMD_ACK, &resp, 2000)) {
|
||||
PrintAndLogEx(FAILED, "iso15693 card timeout, data may be written anyway");
|
||||
|
@ -1352,7 +1352,7 @@ static int CmdHF15CSetUID(const char *Cmd) {
|
|||
AddCrc15(data[i], 7);
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandOLD(CMD_ISO_15693_COMMAND, sizeof(data[i]), fast, reply, data[i], sizeof(data[i]));
|
||||
SendCommandOLD(CMD_HF_ISO15693_COMMAND, sizeof(data[i]), fast, reply, data[i], sizeof(data[i]));
|
||||
|
||||
if (reply) {
|
||||
if (WaitForResponseTimeout(CMD_ACK, &resp, 2000)) {
|
||||
|
|
|
@ -32,7 +32,7 @@ static int CmdHFEPACollectPACENonces(const char *Cmd) {
|
|||
for (uint32_t i = 0; i < n; i++) {
|
||||
// execute PACE
|
||||
clearCommandBuffer();
|
||||
SendCommandMIX(CMD_EPA_PACE_COLLECT_NONCE, (int)m, 0, 0, NULL, 0);
|
||||
SendCommandMIX(CMD_HF_EPA_COLLECT_NONCE, (int)m, 0, 0, NULL, 0);
|
||||
PacketResponseNG resp;
|
||||
WaitForResponse(CMD_ACK, &resp);
|
||||
|
||||
|
@ -130,7 +130,7 @@ static int CmdHFEPAPACEReplay(const char *Cmd) {
|
|||
clearCommandBuffer();
|
||||
// arg0: APDU number
|
||||
// arg1: offset into the APDU
|
||||
SendCommandOLD(CMD_EPA_PACE_REPLAY, i + 1, j * sizeof(data), packet_length, data, packet_length);
|
||||
SendCommandOLD(CMD_HF_EPA_REPLAY, i + 1, j * sizeof(data), packet_length, data, packet_length);
|
||||
WaitForResponse(CMD_ACK, &resp);
|
||||
if (resp.oldarg[0] != 0) {
|
||||
PrintAndLogEx(WARNING, "Transfer of APDU #%d Part %d failed!", i, j);
|
||||
|
@ -141,7 +141,7 @@ static int CmdHFEPAPACEReplay(const char *Cmd) {
|
|||
|
||||
// now perform the replay
|
||||
clearCommandBuffer();
|
||||
SendCommandMIX(CMD_EPA_PACE_REPLAY, 0, 0, 0, NULL, 0);
|
||||
SendCommandMIX(CMD_HF_EPA_REPLAY, 0, 0, 0, NULL, 0);
|
||||
WaitForResponse(CMD_ACK, &resp);
|
||||
if (resp.oldarg[0] != 0) {
|
||||
PrintAndLogEx(NORMAL, "\nPACE replay failed in step %u!", (uint32_t)resp.oldarg[0]);
|
||||
|
|
|
@ -129,7 +129,7 @@ static int CmdHFFelicaSim(const char *Cmd) {
|
|||
if (errors || cmdp == 0) return usage_hf_felica_sim();
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandOLD(CMD_FELICA_SIMULATE_TAG, tagtype, flags, 0, uid, uidlen >> 1);
|
||||
SendCommandOLD(CMD_HF_FELICA_SIMULATE, tagtype, flags, 0, uid, uidlen >> 1);
|
||||
PacketResponseNG resp;
|
||||
|
||||
if (verbose)
|
||||
|
@ -173,7 +173,7 @@ static int CmdHFFelicaSniff(const char *Cmd) {
|
|||
if (errors || cmdp == 0) return usage_hf_felica_sniff();
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandMIX(CMD_FELICA_SNIFF, samples2skip, triggers2skip, 0, NULL, 0);
|
||||
SendCommandMIX(CMD_HF_FELICA_SNIFF, samples2skip, triggers2skip, 0, NULL, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -186,7 +186,7 @@ static int CmdHFFelicaSimLite(const char *Cmd) {
|
|||
return usage_hf_felica_simlite();
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandMIX(CMD_FELICA_LITE_SIM, uid, 0, 0, NULL, 0);
|
||||
SendCommandMIX(CMD_HF_FELICALITE_SIMULATE, uid, 0, 0, NULL, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -349,7 +349,7 @@ static int CmdHFFelicaDumpLite(const char *Cmd) {
|
|||
PrintAndLogEx(SUCCESS, "FeliCa lite - dump started");
|
||||
PrintAndLogEx(SUCCESS, "press pm3-button to cancel");
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_FELICA_LITE_DUMP, NULL, 0);
|
||||
SendCommandNG(CMD_HF_FELICALITE_DUMP, NULL, 0);
|
||||
PacketResponseNG resp;
|
||||
|
||||
uint8_t timeout = 0;
|
||||
|
@ -520,7 +520,7 @@ static int CmdHFFelicaCmdRaw(const char *Cmd) {
|
|||
datalen = (datalen > PM3_CMD_DATA_SIZE) ? PM3_CMD_DATA_SIZE : datalen;
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandOLD(CMD_FELICA_COMMAND, flags, (datalen & 0xFFFF) | (uint32_t)(numbits << 16), 0, data, datalen);
|
||||
SendCommandOLD(CMD_HF_FELICA_COMMAND, flags, (datalen & 0xFFFF) | (uint32_t)(numbits << 16), 0, data, datalen);
|
||||
|
||||
if (reply) {
|
||||
if (active_select)
|
||||
|
@ -558,11 +558,11 @@ int CmdHFFelica(const char *Cmd) {
|
|||
int readFelicaUid(bool verbose) {
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandMIX(CMD_FELICA_COMMAND, FELICA_CONNECT, 0, 0, NULL, 0);
|
||||
SendCommandMIX(CMD_HF_FELICA_COMMAND, FELICA_CONNECT, 0, 0, NULL, 0);
|
||||
PacketResponseNG resp;
|
||||
if (!WaitForResponseTimeout(CMD_ACK, &resp, 2500)) {
|
||||
if (verbose) PrintAndLogEx(WARNING, "FeliCa card select failed");
|
||||
//SendCommandMIX(CMD_FELICA_COMMAND, 0, 0, 0, NULL, 0);
|
||||
//SendCommandMIX(CMD_HF_FELICA_COMMAND, 0, 0, 0, NULL, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -281,7 +281,7 @@ static int CmdHFiClassList(const char *Cmd) {
|
|||
static int CmdHFiClassSniff(const char *Cmd) {
|
||||
char cmdp = tolower(param_getchar(Cmd, 0));
|
||||
if (cmdp == 'h') return usage_hf_iclass_sniff();
|
||||
SendCommandNG(CMD_SNIFF_ICLASS, NULL, 0);
|
||||
SendCommandNG(CMD_HF_ICLASS_SNIFF, NULL, 0);
|
||||
return PM3_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -379,7 +379,7 @@ static int CmdHFiClassSim(const char *Cmd) {
|
|||
PrintAndLogEx(INFO, "press Enter to cancel");
|
||||
PacketResponseNG resp;
|
||||
clearCommandBuffer();
|
||||
SendCommandOLD(CMD_SIMULATE_TAG_ICLASS, simType, NUM_CSNS, 0, csns, 8 * NUM_CSNS);
|
||||
SendCommandOLD(CMD_HF_ICLASS_SIMULATE, simType, NUM_CSNS, 0, csns, 8 * NUM_CSNS);
|
||||
|
||||
while (!WaitForResponseTimeout(CMD_ACK, &resp, 2000)) {
|
||||
tries++;
|
||||
|
@ -428,7 +428,7 @@ static int CmdHFiClassSim(const char *Cmd) {
|
|||
PrintAndLogEx(INFO, "press Enter to cancel");
|
||||
PacketResponseNG resp;
|
||||
clearCommandBuffer();
|
||||
SendCommandOLD(CMD_SIMULATE_TAG_ICLASS, simType, NUM_CSNS, 0, csns, 8 * NUM_CSNS);
|
||||
SendCommandOLD(CMD_HF_ICLASS_SIMULATE, simType, NUM_CSNS, 0, csns, 8 * NUM_CSNS);
|
||||
|
||||
while (!WaitForResponseTimeout(CMD_ACK, &resp, 2000)) {
|
||||
tries++;
|
||||
|
@ -491,7 +491,7 @@ static int CmdHFiClassSim(const char *Cmd) {
|
|||
default: {
|
||||
uint8_t numberOfCSNs = 0;
|
||||
clearCommandBuffer();
|
||||
SendCommandOLD(CMD_SIMULATE_TAG_ICLASS, simType, numberOfCSNs, 0, CSN, 8);
|
||||
SendCommandOLD(CMD_HF_ICLASS_SIMULATE, simType, numberOfCSNs, 0, CSN, 8);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -519,7 +519,7 @@ static int CmdHFiClassReader_Replay(const char *Cmd) {
|
|||
}
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandMIX(CMD_READER_ICLASS_REPLAY, readerType, 0, 0, MAC, 4);
|
||||
SendCommandMIX(CMD_HF_ICLASS_REPLAY, readerType, 0, 0, MAC, 4);
|
||||
return PM3_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -588,7 +588,7 @@ static int CmdHFiClassELoad(const char *Cmd) {
|
|||
conn.block_after_ACK = false;
|
||||
}
|
||||
clearCommandBuffer();
|
||||
SendCommandOLD(CMD_ICLASS_EML_MEMSET, bytes_sent, bytes_in_packet, 0, dump + bytes_sent, bytes_in_packet);
|
||||
SendCommandOLD(CMD_HF_ICLASS_EML_MEMSET, bytes_sent, bytes_in_packet, 0, dump + bytes_sent, bytes_in_packet);
|
||||
bytes_remaining -= bytes_in_packet;
|
||||
bytes_sent += bytes_in_packet;
|
||||
}
|
||||
|
@ -757,7 +757,7 @@ static bool select_only(uint8_t *CSN, uint8_t *CCNR, bool use_credit_key, bool v
|
|||
flags |= FLAG_ICLASS_READER_CEDITKEY;
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandMIX(CMD_READER_ICLASS, flags, 0, 0, NULL, 0);
|
||||
SendCommandMIX(CMD_HF_ICLASS_READER, flags, 0, 0, NULL, 0);
|
||||
if (!WaitForResponseTimeout(CMD_ACK, &resp, 4000)) {
|
||||
PrintAndLogEx(WARNING, "command execute timeout");
|
||||
return false;
|
||||
|
@ -802,7 +802,7 @@ static bool select_and_auth(uint8_t *KEY, uint8_t *MAC, uint8_t *div_key, bool u
|
|||
doMAC(CCNR, div_key, MAC);
|
||||
PacketResponseNG resp;
|
||||
clearCommandBuffer();
|
||||
SendCommandOLD(CMD_ICLASS_AUTHENTICATION, 0, 0, 0, MAC, 4);
|
||||
SendCommandOLD(CMD_HF_ICLASS_AUTH, 0, 0, 0, MAC, 4);
|
||||
if (!WaitForResponseTimeout(CMD_ACK, &resp, 4000)) {
|
||||
if (verbose) PrintAndLogEx(FAILED, "auth command execute timeout");
|
||||
return false;
|
||||
|
@ -923,7 +923,7 @@ static int CmdHFiClassReader_Dump(const char *Cmd) {
|
|||
uint8_t tag_data[255 * 8];
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandMIX(CMD_READER_ICLASS, flags, 0, 0, NULL, 0);
|
||||
SendCommandMIX(CMD_HF_ICLASS_READER, flags, 0, 0, NULL, 0);
|
||||
if (!WaitForResponseTimeout(CMD_ACK, &resp, 4500)) {
|
||||
PrintAndLogEx(WARNING, "command execute timeout");
|
||||
DropField();
|
||||
|
@ -961,7 +961,7 @@ static int CmdHFiClassReader_Dump(const char *Cmd) {
|
|||
|
||||
// begin dump
|
||||
clearCommandBuffer();
|
||||
SendCommandMIX(CMD_ICLASS_DUMP, blockno, numblks - blockno + 1, 0, NULL, 0);
|
||||
SendCommandMIX(CMD_HF_ICLASS_DUMP, blockno, numblks - blockno + 1, 0, NULL, 0);
|
||||
while (true) {
|
||||
printf(".");
|
||||
fflush(stdout);
|
||||
|
@ -1015,7 +1015,7 @@ static int CmdHFiClassReader_Dump(const char *Cmd) {
|
|||
if (maxBlk > blockno + numblks + 1) {
|
||||
// setup dump and start
|
||||
clearCommandBuffer();
|
||||
SendCommandMIX(CMD_ICLASS_DUMP, blockno + blocksRead, maxBlk - (blockno + blocksRead), 0, NULL, 0);
|
||||
SendCommandMIX(CMD_HF_ICLASS_DUMP, blockno + blocksRead, maxBlk - (blockno + blocksRead), 0, NULL, 0);
|
||||
if (!WaitForResponseTimeout(CMD_ACK, &resp, 4500)) {
|
||||
PrintAndLogEx(WARNING, "command execute timeout 2");
|
||||
return 0;
|
||||
|
@ -1079,7 +1079,7 @@ static int WriteBlock(uint8_t blockno, uint8_t *bldata, uint8_t *KEY, bool use_c
|
|||
memcpy(data + 8, MAC, 4);
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandOLD(CMD_ICLASS_WRITEBLOCK, blockno, 0, 0, data, sizeof(data));
|
||||
SendCommandOLD(CMD_HF_ICLASS_WRITEBL, blockno, 0, 0, data, sizeof(data));
|
||||
if (!WaitForResponseTimeout(CMD_ACK, &resp, 4500)) {
|
||||
if (verbose) PrintAndLogEx(WARNING, "Write Command execute timeout");
|
||||
return 0;
|
||||
|
@ -1317,7 +1317,7 @@ static int CmdHFiClassCloneTag(const char *Cmd) {
|
|||
|
||||
PacketResponseNG resp;
|
||||
clearCommandBuffer();
|
||||
SendCommandOLD(CMD_ICLASS_CLONE, startblock, endblock, 0, data, (endblock - startblock) * 12);
|
||||
SendCommandOLD(CMD_HF_ICLASS_CLONE, startblock, endblock, 0, data, (endblock - startblock) * 12);
|
||||
if (!WaitForResponseTimeout(CMD_ACK, &resp, 4500)) {
|
||||
PrintAndLogEx(WARNING, "command execute timeout");
|
||||
return 0;
|
||||
|
@ -1341,7 +1341,7 @@ static int ReadBlock(uint8_t *KEY, uint8_t blockno, uint8_t keyType, bool elite,
|
|||
|
||||
PacketResponseNG resp;
|
||||
clearCommandBuffer();
|
||||
SendCommandMIX(CMD_ICLASS_READBLOCK, blockno, 0, 0, NULL, 0);
|
||||
SendCommandMIX(CMD_HF_ICLASS_READBL, blockno, 0, 0, NULL, 0);
|
||||
if (!WaitForResponseTimeout(CMD_ACK, &resp, 4500)) {
|
||||
PrintAndLogEx(WARNING, "Command execute timeout");
|
||||
return 0;
|
||||
|
@ -1959,7 +1959,7 @@ static int CmdHFiClassCheckKeys(const char *Cmd) {
|
|||
flags |= (use_credit_key << 16);
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandOLD(CMD_ICLASS_CHECK_KEYS, flags, keys, 0, pre + i, 4 * keys);
|
||||
SendCommandOLD(CMD_HF_ICLASS_CHKKEYS, flags, keys, 0, pre + i, 4 * keys);
|
||||
PacketResponseNG resp;
|
||||
|
||||
while (!WaitForResponseTimeout(CMD_ACK, &resp, 2000)) {
|
||||
|
@ -2441,7 +2441,7 @@ int readIclass(bool loop, bool verbose) {
|
|||
while (!kbd_enter_pressed()) {
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandMIX(CMD_READER_ICLASS, flags, 0, 0, NULL, 0);
|
||||
SendCommandMIX(CMD_HF_ICLASS_READER, flags, 0, 0, NULL, 0);
|
||||
if (WaitForResponseTimeout(CMD_ACK, &resp, 4500)) {
|
||||
uint8_t readStatus = resp.oldarg[0] & 0xff;
|
||||
uint8_t *data = resp.data.asBytes;
|
||||
|
|
|
@ -527,7 +527,7 @@ static int CmdLegicRfSim(const char *Cmd) {
|
|||
uint64_t id = 1;
|
||||
sscanf(Cmd, " %" SCNi64, &id);
|
||||
clearCommandBuffer();
|
||||
SendCommandMIX(CMD_SIMULATE_TAG_LEGIC_RF, id, 0, 0, NULL, 0);
|
||||
SendCommandMIX(CMD_HF_LEGIC_SIMULATE, id, 0, 0, NULL, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -644,7 +644,7 @@ static int CmdLegicRfWrite(const char *Cmd) {
|
|||
|
||||
PacketResponseNG resp;
|
||||
clearCommandBuffer();
|
||||
SendCommandOLD(CMD_WRITER_LEGIC_RF, offset, len, IV, data, len);
|
||||
SendCommandOLD(CMD_HF_LEGIC_WRITER, offset, len, IV, data, len);
|
||||
|
||||
|
||||
uint8_t timeout = 0;
|
||||
|
@ -755,7 +755,7 @@ int legic_read_mem(uint32_t offset, uint32_t len, uint32_t iv, uint8_t *out, uin
|
|||
legic_chk_iv(&iv);
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandMIX(CMD_READER_LEGIC_RF, offset, len, iv, NULL, 0);
|
||||
SendCommandMIX(CMD_HF_LEGIC_READER, offset, len, iv, NULL, 0);
|
||||
PacketResponseNG resp;
|
||||
|
||||
uint8_t timeout = 0;
|
||||
|
@ -808,7 +808,7 @@ int legic_get_type(legic_card_select_t *card) {
|
|||
if (card == NULL) return 1;
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_LEGIC_INFO, NULL, 0);
|
||||
SendCommandNG(CMD_HF_LEGIC_INFO, NULL, 0);
|
||||
PacketResponseNG resp;
|
||||
if (!WaitForResponseTimeout(CMD_ACK, &resp, 1500))
|
||||
return 2;
|
||||
|
@ -842,7 +842,7 @@ void legic_seteml(uint8_t *src, uint32_t offset, uint32_t numofbytes) {
|
|||
conn.block_after_ACK = false;
|
||||
}
|
||||
clearCommandBuffer();
|
||||
SendCommandOLD(CMD_LEGIC_ESET, i, len, 0, src + i, len);
|
||||
SendCommandOLD(CMD_HF_LEGIC_ESET, i, len, 0, src + i, len);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -898,7 +898,7 @@ static int CmdLegicDump(const char *Cmd) {
|
|||
PrintAndLogEx(SUCCESS, "Reading tag memory %d b...", dumplen);
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandMIX(CMD_READER_LEGIC_RF, 0x00, dumplen, 0x55, NULL, 0);
|
||||
SendCommandMIX(CMD_HF_LEGIC_READER, 0x00, dumplen, 0x55, NULL, 0);
|
||||
PacketResponseNG resp;
|
||||
|
||||
uint8_t timeout = 0;
|
||||
|
@ -1057,7 +1057,7 @@ static int CmdLegicRestore(const char *Cmd) {
|
|||
conn.block_after_ACK = false;
|
||||
}
|
||||
clearCommandBuffer();
|
||||
SendCommandOLD(CMD_WRITER_LEGIC_RF, i, len, 0x55, data + i, len);
|
||||
SendCommandOLD(CMD_HF_LEGIC_WRITER, i, len, 0x55, data + i, len);
|
||||
|
||||
uint8_t timeout = 0;
|
||||
while (!WaitForResponseTimeout(CMD_ACK, &resp, 2000)) {
|
||||
|
@ -1254,7 +1254,7 @@ static int CmdLegicWipe(const char *Cmd) {
|
|||
conn.block_after_ACK = false;
|
||||
}
|
||||
clearCommandBuffer();
|
||||
SendCommandOLD(CMD_WRITER_LEGIC_RF, i, len, 0x55, data + i, len);
|
||||
SendCommandOLD(CMD_HF_LEGIC_WRITER, i, len, 0x55, data + i, len);
|
||||
|
||||
uint8_t timeout = 0;
|
||||
while (!WaitForResponseTimeout(CMD_ACK, &resp, 2000)) {
|
||||
|
|
|
@ -398,7 +398,7 @@ static int usage_hf14_nack(void) {
|
|||
|
||||
static int GetHFMF14AUID(uint8_t *uid, int *uidlen) {
|
||||
clearCommandBuffer();
|
||||
SendCommandMIX(CMD_READER_ISO_14443a, ISO14A_CONNECT, 0, 0, NULL, 0);
|
||||
SendCommandMIX(CMD_HF_ISO14443A_READER, ISO14A_CONNECT, 0, 0, NULL, 0);
|
||||
PacketResponseNG resp;
|
||||
if (!WaitForResponseTimeout(CMD_ACK, &resp, 2500)) {
|
||||
PrintAndLogEx(WARNING, "iso14443a card select failed");
|
||||
|
@ -511,7 +511,7 @@ static int CmdHF14AMfWrBl(const char *Cmd) {
|
|||
memcpy(data, key, 6);
|
||||
memcpy(data + 10, bldata, 16);
|
||||
clearCommandBuffer();
|
||||
SendCommandOLD(CMD_MIFARE_WRITEBL, blockNo, keyType, 0, data, sizeof(data));
|
||||
SendCommandOLD(CMD_HF_MIFARE_WRITEBL, blockNo, keyType, 0, data, sizeof(data));
|
||||
|
||||
PacketResponseNG resp;
|
||||
if (WaitForResponseTimeout(CMD_ACK, &resp, 1500)) {
|
||||
|
@ -559,10 +559,10 @@ static int CmdHF14AMfRdBl(const char *Cmd) {
|
|||
memcpy(payload.key, key, sizeof(payload.key));
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_MIFARE_READBL, (uint8_t *)&payload, sizeof(mf_readblock_t));
|
||||
SendCommandNG(CMD_HF_MIFARE_READBL, (uint8_t *)&payload, sizeof(mf_readblock_t));
|
||||
|
||||
PacketResponseNG resp;
|
||||
if (WaitForResponseTimeout(CMD_MIFARE_READBL, &resp, 1500)) {
|
||||
if (WaitForResponseTimeout(CMD_HF_MIFARE_READBL, &resp, 1500)) {
|
||||
uint8_t *data = resp.data.asBytes;
|
||||
|
||||
if (resp.status == PM3_SUCCESS) {
|
||||
|
@ -624,7 +624,7 @@ static int CmdHF14AMfRdSc(const char *Cmd) {
|
|||
PrintAndLogEx(NORMAL, "--sector no:%d key type:%c key:%s ", sectorNo, keyType ? 'B' : 'A', sprint_hex(key, 6));
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandOLD(CMD_MIFARE_READSC, sectorNo, keyType, 0, key, 6);
|
||||
SendCommandOLD(CMD_HF_MIFARE_READSC, sectorNo, keyType, 0, key, 6);
|
||||
PrintAndLogEx(NORMAL, "");
|
||||
|
||||
PacketResponseNG resp;
|
||||
|
@ -797,9 +797,9 @@ static int CmdHF14AMfDump(const char *Cmd) {
|
|||
memcpy(payload.key, keyA[sectorNo], sizeof(payload.key));
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_MIFARE_READBL, (uint8_t *)&payload, sizeof(mf_readblock_t));
|
||||
SendCommandNG(CMD_HF_MIFARE_READBL, (uint8_t *)&payload, sizeof(mf_readblock_t));
|
||||
|
||||
if (WaitForResponseTimeout(CMD_MIFARE_READBL, &resp, 1500)) {
|
||||
if (WaitForResponseTimeout(CMD_HF_MIFARE_READBL, &resp, 1500)) {
|
||||
|
||||
uint8_t *data = resp.data.asBytes;
|
||||
if (resp.status == PM3_SUCCESS) {
|
||||
|
@ -836,8 +836,8 @@ static int CmdHF14AMfDump(const char *Cmd) {
|
|||
memcpy(payload.key, keyA[sectorNo], sizeof(payload.key));
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_MIFARE_READBL, (uint8_t *)&payload, sizeof(mf_readblock_t));
|
||||
received = WaitForResponseTimeout(CMD_MIFARE_READBL, &resp, 1500);
|
||||
SendCommandNG(CMD_HF_MIFARE_READBL, (uint8_t *)&payload, sizeof(mf_readblock_t));
|
||||
received = WaitForResponseTimeout(CMD_HF_MIFARE_READBL, &resp, 1500);
|
||||
} else { // data block. Check if it can be read with key A or key B
|
||||
uint8_t data_area = (sectorNo < 32) ? blockNo : blockNo / 5;
|
||||
if ((rights[sectorNo][data_area] == 0x03) || (rights[sectorNo][data_area] == 0x05)) { // only key B would work
|
||||
|
@ -847,8 +847,8 @@ static int CmdHF14AMfDump(const char *Cmd) {
|
|||
memcpy(payload.key, keyB[sectorNo], sizeof(payload.key));
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_MIFARE_READBL, (uint8_t *)&payload, sizeof(mf_readblock_t));
|
||||
received = WaitForResponseTimeout(CMD_MIFARE_READBL, &resp, 1500);
|
||||
SendCommandNG(CMD_HF_MIFARE_READBL, (uint8_t *)&payload, sizeof(mf_readblock_t));
|
||||
received = WaitForResponseTimeout(CMD_HF_MIFARE_READBL, &resp, 1500);
|
||||
} else if (rights[sectorNo][data_area] == 0x07) { // no key would work
|
||||
PrintAndLogEx(WARNING, "access rights do not allow reading of sector %2d block %3d", sectorNo, blockNo);
|
||||
// where do you want to go?? Next sector or block?
|
||||
|
@ -860,8 +860,8 @@ static int CmdHF14AMfDump(const char *Cmd) {
|
|||
memcpy(payload.key, keyA[sectorNo], sizeof(payload.key));
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_MIFARE_READBL, (uint8_t *)&payload, sizeof(mf_readblock_t));
|
||||
received = WaitForResponseTimeout(CMD_MIFARE_READBL, &resp, 1500);
|
||||
SendCommandNG(CMD_HF_MIFARE_READBL, (uint8_t *)&payload, sizeof(mf_readblock_t));
|
||||
received = WaitForResponseTimeout(CMD_HF_MIFARE_READBL, &resp, 1500);
|
||||
}
|
||||
}
|
||||
if (received) {
|
||||
|
@ -1046,7 +1046,7 @@ static int CmdHF14AMfRestore(const char *Cmd) {
|
|||
|
||||
memcpy(data + 10, bldata, 16);
|
||||
clearCommandBuffer();
|
||||
SendCommandOLD(CMD_MIFARE_WRITEBL, FirstBlockOfSector(sectorNo) + blockNo, keyType, 0, data, sizeof(data));
|
||||
SendCommandOLD(CMD_HF_MIFARE_WRITEBL, FirstBlockOfSector(sectorNo) + blockNo, keyType, 0, data, sizeof(data));
|
||||
|
||||
PacketResponseNG resp;
|
||||
if (WaitForResponseTimeout(CMD_ACK, &resp, 1500)) {
|
||||
|
@ -1250,10 +1250,10 @@ static int CmdHF14AMfNested(const char *Cmd) {
|
|||
num_to_bytes(e_sector[i].Key[0], 6, payload.key); // KEY A
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_MIFARE_READBL, (uint8_t *)&payload, sizeof(mf_readblock_t));
|
||||
SendCommandNG(CMD_HF_MIFARE_READBL, (uint8_t *)&payload, sizeof(mf_readblock_t));
|
||||
|
||||
PacketResponseNG resp;
|
||||
if (!WaitForResponseTimeout(CMD_MIFARE_READBL, &resp, 1500)) continue;
|
||||
if (!WaitForResponseTimeout(CMD_HF_MIFARE_READBL, &resp, 1500)) continue;
|
||||
|
||||
if (resp.status != PM3_SUCCESS) continue;
|
||||
|
||||
|
@ -2014,10 +2014,10 @@ static int CmdHF14AMfChk(const char *Cmd) {
|
|||
num_to_bytes(e_sector[i].Key[0], 6, payload.key); // KEY A
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_MIFARE_READBL, (uint8_t *)&payload, sizeof(mf_readblock_t));
|
||||
SendCommandNG(CMD_HF_MIFARE_READBL, (uint8_t *)&payload, sizeof(mf_readblock_t));
|
||||
|
||||
PacketResponseNG resp;
|
||||
if (!WaitForResponseTimeout(CMD_MIFARE_READBL, &resp, 1500)) continue;
|
||||
if (!WaitForResponseTimeout(CMD_HF_MIFARE_READBL, &resp, 1500)) continue;
|
||||
|
||||
if (resp.status != PM3_SUCCESS) continue;
|
||||
|
||||
|
@ -2275,7 +2275,7 @@ static int CmdHF14AMfSim(const char *Cmd) {
|
|||
memcpy(payload.uid, uid, uidlen);
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_SIMULATE_MIFARE_CARD, (uint8_t *)&payload, sizeof(payload));
|
||||
SendCommandNG(CMD_HF_MIFARE_SIMULATE, (uint8_t *)&payload, sizeof(payload));
|
||||
PacketResponseNG resp;
|
||||
|
||||
if (flags & FLAG_INTERACTIVE) {
|
||||
|
@ -2284,7 +2284,7 @@ static int CmdHF14AMfSim(const char *Cmd) {
|
|||
while (!kbd_enter_pressed()) {
|
||||
if (!WaitForResponseTimeout(CMD_ACK, &resp, 1500)) continue;
|
||||
if (!(flags & FLAG_NR_AR_ATTACK)) break;
|
||||
if ((resp.oldarg[0] & 0xffff) != CMD_SIMULATE_MIFARE_CARD) break;
|
||||
if ((resp.oldarg[0] & 0xffff) != CMD_HF_MIFARE_SIMULATE) break;
|
||||
|
||||
memcpy(data, resp.data.asBytes, sizeof(data));
|
||||
readerAttack(data[0], setEmulatorMem, verbose);
|
||||
|
@ -2333,7 +2333,7 @@ static int CmdHF14AMfSniff(const char *Cmd) {
|
|||
PrintAndLogEx(NORMAL, "-------------------------------------------------------------------------\n");
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_MIFARE_SNIFFER, NULL, 0);
|
||||
SendCommandNG(CMD_HF_MIFARE_SNIFF, NULL, 0);
|
||||
|
||||
PacketResponseNG resp;
|
||||
|
||||
|
@ -2530,7 +2530,7 @@ static int CmdHF14AMfEClear(const char *Cmd) {
|
|||
if (c == 'h') return usage_hf14_eclr();
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_MIFARE_EML_MEMCLR, NULL, 0);
|
||||
SendCommandNG(CMD_HF_MIFARE_EML_MEMCLR, NULL, 0);
|
||||
return PM3_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -2740,7 +2740,7 @@ static int CmdHF14AMfECFill(const char *Cmd) {
|
|||
|
||||
PrintAndLogEx(NORMAL, "--params: numSectors: %d, keyType: %c\n", numSectors, (keyType == 0) ? 'A' : 'B');
|
||||
clearCommandBuffer();
|
||||
SendCommandMIX(CMD_MIFARE_EML_CARDLOAD, numSectors, keyType, 0, NULL, 0);
|
||||
SendCommandMIX(CMD_HF_MIFARE_EML_LOAD, numSectors, keyType, 0, NULL, 0);
|
||||
return PM3_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -3216,10 +3216,10 @@ static int CmdHf14AMfSetMod(const char *Cmd) {
|
|||
memcpy(data + 1, key, 6);
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_MIFARE_SETMOD, data, sizeof(data));
|
||||
SendCommandNG(CMD_HF_MIFARE_SETMOD, data, sizeof(data));
|
||||
|
||||
PacketResponseNG resp;
|
||||
if (WaitForResponseTimeout(CMD_MIFARE_SETMOD, &resp, 1500)) {
|
||||
if (WaitForResponseTimeout(CMD_HF_MIFARE_SETMOD, &resp, 1500)) {
|
||||
|
||||
if (resp.status == PM3_SUCCESS)
|
||||
PrintAndLogEx(SUCCESS, "Success");
|
||||
|
@ -3314,7 +3314,7 @@ static int CmdHF14AMfice(const char *Cmd) {
|
|||
flags |= initialize ? 0x0001 : 0;
|
||||
flags |= slow ? 0x0002 : 0;
|
||||
clearCommandBuffer();
|
||||
SendCommandMIX(CMD_MIFARE_ACQUIRE_NONCES, blockNo + keyType * 0x100, trgBlockNo + trgKeyType * 0x100, flags, NULL, 0);
|
||||
SendCommandMIX(CMD_HF_MIFARE_ACQ_NONCES, blockNo + keyType * 0x100, trgBlockNo + trgKeyType * 0x100, flags, NULL, 0);
|
||||
|
||||
if (!WaitForResponseTimeout(CMD_ACK, &resp, 3000)) goto out;
|
||||
if (resp.oldarg[0]) goto out;
|
||||
|
@ -3346,7 +3346,7 @@ out:
|
|||
}
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandMIX(CMD_MIFARE_ACQUIRE_NONCES, blockNo + keyType * 0x100, trgBlockNo + trgKeyType * 0x100, 4, NULL, 0);
|
||||
SendCommandMIX(CMD_HF_MIFARE_ACQ_NONCES, blockNo + keyType * 0x100, trgBlockNo + trgKeyType * 0x100, 4, NULL, 0);
|
||||
return PM3_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@ static int CmdHF14ADesWb(const char *Cmd) {
|
|||
uint8_t data[26];
|
||||
memcpy(data, key, 6);
|
||||
memcpy(data + 10, bldata, 16);
|
||||
SendCommandOLD(CMD_MIFARE_WRITEBL, blockNo, keyType, 0, data, sizeof(data));
|
||||
SendCommandOLD(CMD_HF_MIFARE_WRITEBL, blockNo, keyType, 0, data, sizeof(data));
|
||||
|
||||
PacketResponseNG resp;
|
||||
if (WaitForResponseTimeout(CMD_ACK,&resp,1500)) {
|
||||
|
@ -92,10 +92,10 @@ static int CmdHF14ADesRb(const char *Cmd) {
|
|||
|
||||
|
||||
mf_readblock_t payload = { blockNo, keyType, key };
|
||||
SendCommandNG(CMD_MIFARE_READBL, (uint8_t *)payload, sizeof(mf_readblock_t) );
|
||||
SendCommandNG(CMD_HF_MIFARE_READBL, (uint8_t *)payload, sizeof(mf_readblock_t) );
|
||||
|
||||
PacketResponseNG resp;
|
||||
if (WaitForResponseTimeout(CMD_MIFARE_READBL, &resp, 1500)) {
|
||||
if (WaitForResponseTimeout(CMD_HF_MIFARE_READBL, &resp, 1500)) {
|
||||
uint8_t * data = resp.data.asBytes;
|
||||
|
||||
if (resp.status == PM3_SUCCESS)
|
||||
|
@ -112,7 +112,7 @@ static int CmdHF14ADesRb(const char *Cmd) {
|
|||
static int CmdHF14ADesInfo(const char *Cmd) {
|
||||
(void)Cmd; // Cmd is not used so far
|
||||
|
||||
SendCommandNG(CMD_MIFARE_DESFIRE_INFO, NULL, 0);
|
||||
SendCommandNG(CMD_HF_DESFIRE_INFO, NULL, 0);
|
||||
PacketResponseNG resp;
|
||||
|
||||
if (!WaitForResponseTimeout(CMD_ACK, &resp, 1500)) {
|
||||
|
@ -164,7 +164,7 @@ static int CmdHF14ADesInfo(const char *Cmd) {
|
|||
|
||||
// Free memory on card
|
||||
uint8_t data[1] = {GET_FREE_MEMORY};
|
||||
SendCommandOLD(CMD_MIFARE_DESFIRE, (INIT | DISCONNECT), 0x01, 0, data, sizeof(data));
|
||||
SendCommandOLD(CMD_HF_DESFIRE_COMMAND, (INIT | DISCONNECT), 0x01, 0, data, sizeof(data));
|
||||
if (!WaitForResponseTimeout(CMD_ACK, &resp, 1500))
|
||||
return 0;
|
||||
|
||||
|
@ -256,7 +256,7 @@ void getKeySettings(uint8_t *aid) {
|
|||
PrintAndLogEx(NORMAL, "");
|
||||
{
|
||||
uint8_t data[1] = {GET_KEY_SETTINGS}; // 0x45
|
||||
SendCommandOLD(CMD_MIFARE_DESFIRE, INIT | DISCONNECT, sizeof(data), 0, data, sizeof(data));
|
||||
SendCommandOLD(CMD_HF_DESFIRE_COMMAND, INIT | DISCONNECT, sizeof(data), 0, data, sizeof(data));
|
||||
}
|
||||
if (!WaitForResponseTimeout(CMD_ACK, &resp, 1000)) {return;}
|
||||
isOK = resp.oldarg[0] & 0xff;
|
||||
|
@ -275,7 +275,7 @@ void getKeySettings(uint8_t *aid) {
|
|||
PrintAndLogEx(NORMAL, " [0x01] CMK is changeable : %s", str);
|
||||
{
|
||||
uint8_t data[2] = {GET_KEY_VERSION, 0}; // 0x64
|
||||
SendCommandOLD(CMD_MIFARE_DESFIRE, INIT | DISCONNECT, sizeof(data), 0, data, sizeof(data));
|
||||
SendCommandOLD(CMD_HF_DESFIRE_COMMAND, INIT | DISCONNECT, sizeof(data), 0, data, sizeof(data));
|
||||
}
|
||||
if (!WaitForResponseTimeout(CMD_ACK, &resp, 1000)) { return; }
|
||||
isOK = resp.oldarg[0] & 0xff;
|
||||
|
@ -290,7 +290,7 @@ void getKeySettings(uint8_t *aid) {
|
|||
|
||||
{
|
||||
uint8_t data[2] = {AUTHENTICATE, 0}; // 0x0A, KEY 0
|
||||
SendCommandOLD(CMD_MIFARE_DESFIRE, INIT | DISCONNECT, sizeof(data), 0, data, sizeof(data));
|
||||
SendCommandOLD(CMD_HF_DESFIRE_COMMAND, INIT | DISCONNECT, sizeof(data), 0, data, sizeof(data));
|
||||
}
|
||||
if (!WaitForResponseTimeout(CMD_ACK, &resp, 1000)) {return;}
|
||||
isOK = resp.data.asBytes[2] & 0xff;
|
||||
|
@ -298,7 +298,7 @@ void getKeySettings(uint8_t *aid) {
|
|||
|
||||
{
|
||||
uint8_t data[2] = {AUTHENTICATE_ISO, 0}; // 0x1A, KEY 0
|
||||
SendCommandOLD(CMD_MIFARE_DESFIRE, INIT | DISCONNECT, sizeof(data), 0, data, sizeof(data));
|
||||
SendCommandOLD(CMD_HF_DESFIRE_COMMAND, INIT | DISCONNECT, sizeof(data), 0, data, sizeof(data));
|
||||
}
|
||||
if (!WaitForResponseTimeout(CMD_ACK, &resp, 1000)) {return;}
|
||||
isOK = resp.data.asBytes[2] & 0xff;
|
||||
|
@ -306,7 +306,7 @@ void getKeySettings(uint8_t *aid) {
|
|||
|
||||
{
|
||||
uint8_t data[2] = {AUTHENTICATE_AES, 0}; // 0xAA, KEY 0
|
||||
SendCommandOLD(CMD_MIFARE_DESFIRE, INIT | DISCONNECT, sizeof(data), 0, data, sizeof(data));
|
||||
SendCommandOLD(CMD_HF_DESFIRE_COMMAND, INIT | DISCONNECT, sizeof(data), 0, data, sizeof(data));
|
||||
}
|
||||
if (!WaitForResponseTimeout(CMD_ACK, &resp, 1000)) {return;}
|
||||
isOK = resp.data.asBytes[2] & 0xff;
|
||||
|
@ -321,7 +321,7 @@ void getKeySettings(uint8_t *aid) {
|
|||
{
|
||||
uint8_t data[4] = {SELECT_APPLICATION}; // 0x5a
|
||||
memcpy(data + 1, aid, 3);
|
||||
SendCommandOLD(CMD_MIFARE_DESFIRE, INIT | CLEARTRACE, sizeof(data), 0, data, sizeof(data));
|
||||
SendCommandOLD(CMD_HF_DESFIRE_COMMAND, INIT | CLEARTRACE, sizeof(data), 0, data, sizeof(data));
|
||||
}
|
||||
if (!WaitForResponseTimeout(CMD_ACK, &resp, 1500)) {
|
||||
PrintAndLogEx(WARNING, " Timed-out");
|
||||
|
@ -336,7 +336,7 @@ void getKeySettings(uint8_t *aid) {
|
|||
// KEY SETTINGS
|
||||
{
|
||||
uint8_t data[1] = {GET_KEY_SETTINGS}; // 0x45
|
||||
SendCommandOLD(CMD_MIFARE_DESFIRE, NONE, sizeof(data), 0, data, sizeof(data));
|
||||
SendCommandOLD(CMD_HF_DESFIRE_COMMAND, NONE, sizeof(data), 0, data, sizeof(data));
|
||||
}
|
||||
if (!WaitForResponseTimeout(CMD_ACK, &resp, 1500)) {
|
||||
return;
|
||||
|
@ -378,7 +378,7 @@ void getKeySettings(uint8_t *aid) {
|
|||
// KEY VERSION - AMK
|
||||
{
|
||||
uint8_t data[2] = {GET_KEY_VERSION, 0}; // 0x64
|
||||
SendCommandOLD(CMD_MIFARE_DESFIRE, NONE, sizeof(data), 0, data, sizeof(data));
|
||||
SendCommandOLD(CMD_HF_DESFIRE_COMMAND, NONE, sizeof(data), 0, data, sizeof(data));
|
||||
}
|
||||
if (!WaitForResponseTimeout(CMD_ACK, &resp, 1500)) {
|
||||
PrintAndLogEx(WARNING, " Timed-out");
|
||||
|
@ -417,7 +417,7 @@ static int CmdHF14ADesEnumApplications(const char *Cmd) {
|
|||
uint8_t aid[3];
|
||||
{
|
||||
uint8_t data[1] = {GET_APPLICATION_IDS}; //0x6a
|
||||
SendCommandOLD(CMD_MIFARE_DESFIRE, INIT | DISCONNECT, sizeof(data), 0, data, sizeof(data));
|
||||
SendCommandOLD(CMD_HF_DESFIRE_COMMAND, INIT | DISCONNECT, sizeof(data), 0, data, sizeof(data));
|
||||
}
|
||||
PacketResponseNG resp;
|
||||
|
||||
|
@ -452,7 +452,7 @@ static int CmdHF14ADesEnumApplications(const char *Cmd) {
|
|||
{
|
||||
uint8_t data[4] = {SELECT_APPLICATION}; // 0x5a
|
||||
memcpy(data + 1, &resp.data.asBytes[i], 3);
|
||||
SendCommandOLD(CMD_MIFARE_DESFIRE, INIT, sizeof(data), 0, data, sizeof(data));
|
||||
SendCommandOLD(CMD_HF_DESFIRE_COMMAND, INIT, sizeof(data), 0, data, sizeof(data));
|
||||
}
|
||||
|
||||
if (!WaitForResponseTimeout(CMD_ACK, &respAid, 1500)) {
|
||||
|
@ -468,7 +468,7 @@ static int CmdHF14ADesEnumApplications(const char *Cmd) {
|
|||
// Get File IDs
|
||||
{
|
||||
uint8_t data[1] = {GET_FILE_IDS}; // 0x6f
|
||||
SendCommandOLD(CMD_MIFARE_DESFIRE, NONE, sizeof(data), 0, data, sizeof(data));
|
||||
SendCommandOLD(CMD_HF_DESFIRE_COMMAND, NONE, sizeof(data), 0, data, sizeof(data));
|
||||
}
|
||||
|
||||
if (!WaitForResponseTimeout(CMD_ACK, &respFiles, 1500)) {
|
||||
|
@ -489,7 +489,7 @@ static int CmdHF14ADesEnumApplications(const char *Cmd) {
|
|||
// Get ISO File IDs
|
||||
{
|
||||
uint8_t data[1] = {GET_ISOFILE_IDS}; // 0x61
|
||||
SendCommandOLD(CMD_MIFARE_DESFIRE, DISCONNECT, sizeof(data), 0, data, sizeof(data));
|
||||
SendCommandOLD(CMD_HF_DESFIRE_COMMAND, DISCONNECT, sizeof(data), 0, data, sizeof(data));
|
||||
}
|
||||
|
||||
if (!WaitForResponseTimeout(CMD_ACK, &respFiles, 1500)) {
|
||||
|
@ -600,7 +600,7 @@ static int CmdHF14ADesAuth(const char *Cmd) {
|
|||
uint8_t data[25] = {keylength}; // max length: 1 + 24 (3k3DES)
|
||||
memcpy(data + 1, key, keylength);
|
||||
clearCommandBuffer();
|
||||
SendCommandOLD(CMD_MIFARE_DESFIRE_AUTH1, cmdAuthMode, cmdAuthAlgo, cmdKeyNo, data, keylength + 1);
|
||||
SendCommandOLD(CMD_HF_DESFIRE_AUTH1, cmdAuthMode, cmdAuthAlgo, cmdKeyNo, data, keylength + 1);
|
||||
PacketResponseNG resp;
|
||||
|
||||
if (!WaitForResponseTimeout(CMD_ACK, &resp, 3000)) {
|
||||
|
|
|
@ -1379,7 +1379,7 @@ static int acquire_nonces(uint8_t blockNo, uint8_t keyType, uint8_t *key, uint8_
|
|||
flags |= field_off ? 0x0004 : 0;
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandMIX(CMD_MIFARE_ACQUIRE_ENCRYPTED_NONCES, blockNo + keyType * 0x100, trgBlockNo + trgKeyType * 0x100, flags, key, 6);
|
||||
SendCommandMIX(CMD_HF_MIFARE_ACQ_ENCRYPTED_NONCES, blockNo + keyType * 0x100, trgBlockNo + trgKeyType * 0x100, flags, key, 6);
|
||||
|
||||
if (field_off) break;
|
||||
|
||||
|
@ -1388,7 +1388,7 @@ static int acquire_nonces(uint8_t blockNo, uint8_t keyType, uint8_t *key, uint8_
|
|||
uint8_t nullkey[6] = {0};
|
||||
//strange second call (iceman)
|
||||
clearCommandBuffer();
|
||||
SendCommandMIX(CMD_MIFARE_ACQUIRE_ENCRYPTED_NONCES, blockNo + keyType * 0x100, trgBlockNo + trgKeyType * 0x100, 4, nullkey, sizeof(nullkey));
|
||||
SendCommandMIX(CMD_HF_MIFARE_ACQ_ENCRYPTED_NONCES, blockNo + keyType * 0x100, trgBlockNo + trgKeyType * 0x100, 4, nullkey, sizeof(nullkey));
|
||||
return 1;
|
||||
}
|
||||
if (resp.oldarg[0]) return resp.oldarg[0]; // error during nested_hard
|
||||
|
|
|
@ -42,7 +42,7 @@ static int CmdHFMFPInfo(const char *cmd) {
|
|||
infoHF14A(false, false);
|
||||
|
||||
// Mifare Plus info
|
||||
SendCommandMIX(CMD_READER_ISO_14443a, ISO14A_CONNECT | ISO14A_NO_DISCONNECT, 0, 0, NULL, 0);
|
||||
SendCommandMIX(CMD_HF_ISO14443A_READER, ISO14A_CONNECT | ISO14A_NO_DISCONNECT, 0, 0, NULL, 0);
|
||||
|
||||
PacketResponseNG resp;
|
||||
WaitForResponse(CMD_ACK, &resp);
|
||||
|
|
|
@ -471,12 +471,12 @@ static char *getUlev1CardSizeStr(uint8_t fsize) {
|
|||
|
||||
static void ul_switch_on_field(void) {
|
||||
clearCommandBuffer();
|
||||
SendCommandMIX(CMD_READER_ISO_14443a, ISO14A_CONNECT | ISO14A_NO_DISCONNECT | ISO14A_NO_RATS, 0, 0, NULL, 0);
|
||||
SendCommandMIX(CMD_HF_ISO14443A_READER, ISO14A_CONNECT | ISO14A_NO_DISCONNECT | ISO14A_NO_RATS, 0, 0, NULL, 0);
|
||||
}
|
||||
|
||||
static int ul_send_cmd_raw(uint8_t *cmd, uint8_t cmdlen, uint8_t *response, uint16_t responseLength) {
|
||||
clearCommandBuffer();
|
||||
SendCommandOLD(CMD_READER_ISO_14443a, ISO14A_RAW | ISO14A_NO_DISCONNECT | ISO14A_APPEND_CRC | ISO14A_NO_RATS, cmdlen, 0, cmd, cmdlen);
|
||||
SendCommandOLD(CMD_HF_ISO14443A_READER, ISO14A_RAW | ISO14A_NO_DISCONNECT | ISO14A_APPEND_CRC | ISO14A_NO_RATS, cmdlen, 0, cmd, cmdlen);
|
||||
PacketResponseNG resp;
|
||||
if (!WaitForResponseTimeout(CMD_ACK, &resp, 1500)) return -1;
|
||||
if (!resp.oldarg[0] && responseLength) return -1;
|
||||
|
@ -543,7 +543,7 @@ static int ulc_requestAuthentication(uint8_t *nonce, uint16_t nonceLength) {
|
|||
static int ulc_authentication(uint8_t *key, bool switch_off_field) {
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandOLD(CMD_MIFAREUC_AUTH, switch_off_field, 0, 0, key, 16);
|
||||
SendCommandOLD(CMD_HF_MIFAREUC_AUTH, switch_off_field, 0, 0, key, 16);
|
||||
PacketResponseNG resp;
|
||||
if (!WaitForResponseTimeout(CMD_ACK, &resp, 1500)) return 0;
|
||||
if (resp.oldarg[0] == 1) return 1;
|
||||
|
@ -630,7 +630,7 @@ static int ul_fudan_check(void) {
|
|||
|
||||
uint8_t cmd[4] = {0x30, 0x00, 0x02, 0xa7}; //wrong crc on purpose should be 0xa8
|
||||
clearCommandBuffer();
|
||||
SendCommandOLD(CMD_READER_ISO_14443a, ISO14A_RAW | ISO14A_NO_DISCONNECT | ISO14A_NO_RATS, 4, 0, cmd, sizeof(cmd));
|
||||
SendCommandOLD(CMD_HF_ISO14443A_READER, ISO14A_RAW | ISO14A_NO_DISCONNECT | ISO14A_NO_RATS, 4, 0, cmd, sizeof(cmd));
|
||||
PacketResponseNG resp;
|
||||
if (!WaitForResponseTimeout(CMD_ACK, &resp, 1500)) return UL_ERROR;
|
||||
if (resp.oldarg[0] != 1) return UL_ERROR;
|
||||
|
@ -1562,7 +1562,7 @@ static int CmdHF14AMfUWrBl(const char *Cmd) {
|
|||
}
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandOLD(CMD_MIFAREU_WRITEBL, blockNo, keytype, 0, cmddata, datalen);
|
||||
SendCommandOLD(CMD_HF_MIFAREU_WRITEBL, blockNo, keytype, 0, cmddata, datalen);
|
||||
PacketResponseNG resp;
|
||||
if (WaitForResponseTimeout(CMD_ACK, &resp, 1500)) {
|
||||
uint8_t isOK = resp.oldarg[0] & 0xff;
|
||||
|
@ -1667,7 +1667,7 @@ static int CmdHF14AMfURdBl(const char *Cmd) {
|
|||
}
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandOLD(CMD_MIFAREU_READBL, blockNo, keytype, 0, authKeyPtr, datalen);
|
||||
SendCommandOLD(CMD_HF_MIFAREU_READBL, blockNo, keytype, 0, authKeyPtr, datalen);
|
||||
PacketResponseNG resp;
|
||||
if (WaitForResponseTimeout(CMD_ACK, &resp, 1500)) {
|
||||
uint8_t isOK = resp.oldarg[0] & 0xff;
|
||||
|
@ -1933,7 +1933,7 @@ static int CmdHF14AMfUDump(const char *Cmd) {
|
|||
}
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandOLD(CMD_MIFAREU_READCARD, startPage, pages, keytype, authKeyPtr, dataLen);
|
||||
SendCommandOLD(CMD_HF_MIFAREU_READCARD, startPage, pages, keytype, authKeyPtr, dataLen);
|
||||
|
||||
PacketResponseNG resp;
|
||||
if (!WaitForResponseTimeout(CMD_ACK, &resp, 2500)) {
|
||||
|
@ -2235,7 +2235,7 @@ static int CmdHF14AMfURestore(const char *Cmd) {
|
|||
|
||||
PrintAndLogEx(NORMAL, "special PWD block written 0x%X - %s\n", MFU_NTAG_SPECIAL_PWD, sprint_hex(data, 4));
|
||||
clearCommandBuffer();
|
||||
SendCommandOLD(CMD_MIFAREU_WRITEBL, MFU_NTAG_SPECIAL_PWD, keytype, 0, data, sizeof(data));
|
||||
SendCommandOLD(CMD_HF_MIFAREU_WRITEBL, MFU_NTAG_SPECIAL_PWD, keytype, 0, data, sizeof(data));
|
||||
|
||||
wait4response(MFU_NTAG_SPECIAL_PWD);
|
||||
|
||||
|
@ -2251,7 +2251,7 @@ static int CmdHF14AMfURestore(const char *Cmd) {
|
|||
data[3] = 0;
|
||||
PrintAndLogEx(NORMAL, "special PACK block written 0x%X - %s\n", MFU_NTAG_SPECIAL_PACK, sprint_hex(data, 4));
|
||||
clearCommandBuffer();
|
||||
SendCommandOLD(CMD_MIFAREU_WRITEBL, MFU_NTAG_SPECIAL_PACK, keytype, 0, data, sizeof(data));
|
||||
SendCommandOLD(CMD_HF_MIFAREU_WRITEBL, MFU_NTAG_SPECIAL_PACK, keytype, 0, data, sizeof(data));
|
||||
wait4response(MFU_NTAG_SPECIAL_PACK);
|
||||
|
||||
// Signature
|
||||
|
@ -2259,7 +2259,7 @@ static int CmdHF14AMfURestore(const char *Cmd) {
|
|||
memcpy(data, mem->signature + i, 4);
|
||||
PrintAndLogEx(NORMAL, "special SIG block written 0x%X - %s\n", s, sprint_hex(data, 4));
|
||||
clearCommandBuffer();
|
||||
SendCommandOLD(CMD_MIFAREU_WRITEBL, s, keytype, 0, data, sizeof(data));
|
||||
SendCommandOLD(CMD_HF_MIFAREU_WRITEBL, s, keytype, 0, data, sizeof(data));
|
||||
wait4response(s);
|
||||
}
|
||||
|
||||
|
@ -2268,7 +2268,7 @@ static int CmdHF14AMfURestore(const char *Cmd) {
|
|||
memcpy(data, mem->version + i, 4);
|
||||
PrintAndLogEx(NORMAL, "special VERSION block written 0x%X - %s\n", s, sprint_hex(data, 4));
|
||||
clearCommandBuffer();
|
||||
SendCommandOLD(CMD_MIFAREU_WRITEBL, s, keytype, 0, data, sizeof(data));
|
||||
SendCommandOLD(CMD_HF_MIFAREU_WRITEBL, s, keytype, 0, data, sizeof(data));
|
||||
wait4response(s);
|
||||
}
|
||||
}
|
||||
|
@ -2282,7 +2282,7 @@ static int CmdHF14AMfURestore(const char *Cmd) {
|
|||
//Send write Block
|
||||
memcpy(data, mem->data + (b * 4), 4);
|
||||
clearCommandBuffer();
|
||||
SendCommandOLD(CMD_MIFAREU_WRITEBL, b, keytype, 0, data, sizeof(data));
|
||||
SendCommandOLD(CMD_HF_MIFAREU_WRITEBL, b, keytype, 0, data, sizeof(data));
|
||||
wait4response(b);
|
||||
printf(".");
|
||||
fflush(stdout);
|
||||
|
@ -2302,7 +2302,7 @@ static int CmdHF14AMfURestore(const char *Cmd) {
|
|||
uint8_t b = blocks[i];
|
||||
memcpy(data, mem->data + (b * 4), 4);
|
||||
clearCommandBuffer();
|
||||
SendCommandOLD(CMD_MIFAREU_WRITEBL, b, keytype, 0, data, sizeof(data));
|
||||
SendCommandOLD(CMD_HF_MIFAREU_WRITEBL, b, keytype, 0, data, sizeof(data));
|
||||
wait4response(b);
|
||||
PrintAndLogEx(NORMAL, "special block written %u - %s\n", b, sprint_hex(data, 4));
|
||||
}
|
||||
|
@ -2477,7 +2477,7 @@ static int CmdHF14AMfUCSetPwd(const char *Cmd) {
|
|||
}
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandOLD(CMD_MIFAREUC_SETPWD, 0, 0, 0, pwd, 16);
|
||||
SendCommandOLD(CMD_HF_MIFAREUC_SETPWD, 0, 0, 0, pwd, 16);
|
||||
|
||||
PacketResponseNG resp;
|
||||
if (WaitForResponseTimeout(CMD_ACK, &resp, 1500)) {
|
||||
|
@ -2512,7 +2512,7 @@ static int CmdHF14AMfUCSetUid(const char *Cmd) {
|
|||
|
||||
// read block2.
|
||||
clearCommandBuffer();
|
||||
SendCommandMIX(CMD_MIFAREU_READBL, 2, 0, 0, NULL, 0);
|
||||
SendCommandMIX(CMD_HF_MIFAREU_READBL, 2, 0, 0, NULL, 0);
|
||||
if (!WaitForResponseTimeout(CMD_ACK, &resp, 1500)) {
|
||||
PrintAndLogEx(WARNING, "Command execute timeout");
|
||||
return 2;
|
||||
|
@ -2529,7 +2529,7 @@ static int CmdHF14AMfUCSetUid(const char *Cmd) {
|
|||
data[2] = uid[2];
|
||||
data[3] = 0x88 ^ uid[0] ^ uid[1] ^ uid[2];
|
||||
clearCommandBuffer();
|
||||
SendCommandOLD(CMD_MIFAREU_WRITEBL, 0, 0, 0, data, sizeof(data));
|
||||
SendCommandOLD(CMD_HF_MIFAREU_WRITEBL, 0, 0, 0, data, sizeof(data));
|
||||
if (!WaitForResponseTimeout(CMD_ACK, &resp, 1500)) {
|
||||
PrintAndLogEx(WARNING, "Command execute timeout");
|
||||
return 3;
|
||||
|
@ -2541,7 +2541,7 @@ static int CmdHF14AMfUCSetUid(const char *Cmd) {
|
|||
data[2] = uid[5];
|
||||
data[3] = uid[6];
|
||||
clearCommandBuffer();
|
||||
SendCommandOLD(CMD_MIFAREU_WRITEBL, 1, 0, 0, data, sizeof(data));
|
||||
SendCommandOLD(CMD_HF_MIFAREU_WRITEBL, 1, 0, 0, data, sizeof(data));
|
||||
if (!WaitForResponseTimeout(CMD_ACK, &resp, 1500)) {
|
||||
PrintAndLogEx(WARNING, "Command execute timeout");
|
||||
return 4;
|
||||
|
@ -2553,7 +2553,7 @@ static int CmdHF14AMfUCSetUid(const char *Cmd) {
|
|||
data[2] = oldblock2[2];
|
||||
data[3] = oldblock2[3];
|
||||
clearCommandBuffer();
|
||||
SendCommandOLD(CMD_MIFAREU_WRITEBL, 2, 0, 0, data, sizeof(data));
|
||||
SendCommandOLD(CMD_HF_MIFAREU_WRITEBL, 2, 0, 0, data, sizeof(data));
|
||||
if (!WaitForResponseTimeout(CMD_ACK, &resp, 1500)) {
|
||||
PrintAndLogEx(WARNING, "Command execute timeout");
|
||||
return 5;
|
||||
|
@ -2570,7 +2570,7 @@ static int CmdHF14AMfUGenDiverseKeys(const char *Cmd) {
|
|||
if (cmdp == 'r') {
|
||||
// read uid from tag
|
||||
clearCommandBuffer();
|
||||
SendCommandMIX(CMD_READER_ISO_14443a, ISO14A_CONNECT | ISO14A_NO_RATS, 0, 0, NULL, 0);
|
||||
SendCommandMIX(CMD_HF_ISO14443A_READER, ISO14A_CONNECT | ISO14A_NO_RATS, 0, 0, NULL, 0);
|
||||
PacketResponseNG resp;
|
||||
WaitForResponse(CMD_ACK, &resp);
|
||||
iso14a_card_select_t card;
|
||||
|
@ -2684,7 +2684,7 @@ static int CmdHF14AMfUPwdGen(const char *Cmd) {
|
|||
if (cmdp == 'r') {
|
||||
// read uid from tag
|
||||
clearCommandBuffer();
|
||||
SendCommandMIX(CMD_READER_ISO_14443a, ISO14A_CONNECT | ISO14A_NO_RATS, 0, 0, NULL, 0);
|
||||
SendCommandMIX(CMD_HF_ISO14443A_READER, ISO14A_CONNECT | ISO14A_NO_RATS, 0, 0, NULL, 0);
|
||||
PacketResponseNG resp;
|
||||
WaitForResponse(CMD_ACK, &resp);
|
||||
iso14a_card_select_t card;
|
||||
|
|
|
@ -133,10 +133,10 @@ static int CmdHfThinFilmInfo(const char *Cmd) {
|
|||
int infoThinFilm(bool verbose) {
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_THINFILM_READ, NULL, 0);
|
||||
SendCommandNG(CMD_HF_THINFILM_READ, NULL, 0);
|
||||
|
||||
PacketResponseNG resp;
|
||||
if (!WaitForResponseTimeout(CMD_THINFILM_READ, &resp, 1500)) {
|
||||
if (!WaitForResponseTimeout(CMD_HF_THINFILM_READ, &resp, 1500)) {
|
||||
PrintAndLogEx(WARNING, "timeout while waiting for reply.");
|
||||
return PM3_ETIMEOUT;
|
||||
}
|
||||
|
@ -192,12 +192,12 @@ static int CmdHfThinFilmSim(const char *Cmd) {
|
|||
}
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_SIMULATE_TAG_THINFILM, (uint8_t *)&data, datalen);
|
||||
SendCommandNG(CMD_HF_THINFILM_SIMULATE, (uint8_t *)&data, datalen);
|
||||
PacketResponseNG resp;
|
||||
PrintAndLogEx(SUCCESS, "press pm3-button to abort simulation");
|
||||
|
||||
while (!kbd_enter_pressed()) {
|
||||
if (WaitForResponseTimeout(CMD_SIMULATE_TAG_THINFILM, &resp, 1500) == 0) continue;
|
||||
if (WaitForResponseTimeout(CMD_HF_THINFILM_SIMULATE, &resp, 1500) == 0) continue;
|
||||
if (resp.status != PM3_SUCCESS) break;
|
||||
}
|
||||
|
||||
|
|
|
@ -31,16 +31,16 @@ static struct {
|
|||
} topaz_tag;
|
||||
|
||||
static void topaz_switch_on_field(void) {
|
||||
SendCommandMIX(CMD_READER_ISO_14443a, ISO14A_CONNECT | ISO14A_NO_SELECT | ISO14A_NO_DISCONNECT | ISO14A_TOPAZMODE | ISO14A_NO_RATS, 0, 0, NULL, 0);
|
||||
SendCommandMIX(CMD_HF_ISO14443A_READER, ISO14A_CONNECT | ISO14A_NO_SELECT | ISO14A_NO_DISCONNECT | ISO14A_TOPAZMODE | ISO14A_NO_RATS, 0, 0, NULL, 0);
|
||||
}
|
||||
|
||||
static void topaz_switch_off_field(void) {
|
||||
SendCommandMIX(CMD_READER_ISO_14443a, 0, 0, 0, NULL, 0);
|
||||
SendCommandMIX(CMD_HF_ISO14443A_READER, 0, 0, 0, NULL, 0);
|
||||
}
|
||||
|
||||
// send a raw topaz command, returns the length of the response (0 in case of error)
|
||||
static int topaz_send_cmd_raw(uint8_t *cmd, uint8_t len, uint8_t *response, uint16_t *response_len, bool verbose) {
|
||||
SendCommandOLD(CMD_READER_ISO_14443a, ISO14A_RAW | ISO14A_NO_DISCONNECT | ISO14A_TOPAZMODE | ISO14A_NO_RATS, len, 0, cmd, len);
|
||||
SendCommandOLD(CMD_HF_ISO14443A_READER, ISO14A_RAW | ISO14A_NO_DISCONNECT | ISO14A_TOPAZMODE | ISO14A_NO_RATS, len, 0, cmd, len);
|
||||
|
||||
PacketResponseNG resp;
|
||||
|
||||
|
|
|
@ -451,7 +451,7 @@ static int CmdSetDivisor(const char *Cmd) {
|
|||
}
|
||||
// 12 000 000 (12Mhz)
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_SET_LF_DIVISOR, (uint8_t *)&arg, sizeof(arg));
|
||||
SendCommandNG(CMD_LF_SET_DIVISOR, (uint8_t *)&arg, sizeof(arg));
|
||||
PrintAndLogEx(SUCCESS, "Divisor set, expected %.1f kHz", ((double)12000 / (arg + 1)));
|
||||
return PM3_SUCCESS;
|
||||
}
|
||||
|
|
|
@ -201,11 +201,11 @@ int CmdLFCommandRead(const char *Cmd) {
|
|||
|
||||
PrintAndLogEx(SUCCESS, "Sending");
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_MOD_THEN_ACQUIRE_RAW_ADC_SAMPLES_125K, (uint8_t *)&payload, 8 + datalen);
|
||||
SendCommandNG(CMD_LF_MOD_THEN_ACQ_RAW_ADC, (uint8_t *)&payload, 8 + datalen);
|
||||
|
||||
printf("\n");
|
||||
uint8_t i = 10;
|
||||
while (!WaitForResponseTimeout(CMD_MOD_THEN_ACQUIRE_RAW_ADC_SAMPLES_125K, NULL, 2000) && i != 0) {
|
||||
while (!WaitForResponseTimeout(CMD_LF_MOD_THEN_ACQ_RAW_ADC, NULL, 2000) && i != 0) {
|
||||
printf(".");
|
||||
fflush(stdout);
|
||||
i--;
|
||||
|
@ -361,7 +361,7 @@ int CmdLFSetConfig(const char *Cmd) {
|
|||
sample_config config = { decimation, bps, averaging, divisor, trigger_threshold };
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_SET_LF_SAMPLING_CONFIG, (uint8_t *)&config, sizeof(sample_config));
|
||||
SendCommandNG(CMD_LF_SAMPLING_SET_CONFIG, (uint8_t *)&config, sizeof(sample_config));
|
||||
return PM3_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -378,13 +378,13 @@ int lf_read(bool silent, uint32_t samples) {
|
|||
payload.samples = samples;
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_ACQUIRE_RAW_ADC_SAMPLES_125K, (uint8_t *)&payload, sizeof(payload));
|
||||
SendCommandNG(CMD_LF_ACQ_RAW_ADC, (uint8_t *)&payload, sizeof(payload));
|
||||
|
||||
PacketResponseNG resp;
|
||||
if (g_lf_threshold_set) {
|
||||
WaitForResponse(CMD_ACQUIRE_RAW_ADC_SAMPLES_125K, &resp);
|
||||
WaitForResponse(CMD_LF_ACQ_RAW_ADC, &resp);
|
||||
} else {
|
||||
if (!WaitForResponseTimeout(CMD_ACQUIRE_RAW_ADC_SAMPLES_125K, &resp, 2500)) {
|
||||
if (!WaitForResponseTimeout(CMD_LF_ACQ_RAW_ADC, &resp, 2500)) {
|
||||
PrintAndLogEx(WARNING, "command execution time out");
|
||||
return PM3_ETIMEOUT;
|
||||
}
|
||||
|
@ -438,7 +438,7 @@ int CmdLFSniff(const char *Cmd) {
|
|||
if (cmdp == 'h') return usage_lf_sniff();
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_LF_SNIFF_RAW_ADC_SAMPLES, NULL, 0);
|
||||
SendCommandNG(CMD_LF_SNIFF_RAW_ADC, NULL, 0);
|
||||
WaitForResponse(CMD_ACK, NULL);
|
||||
getSamples(0, false);
|
||||
return PM3_SUCCESS;
|
||||
|
@ -501,8 +501,8 @@ int CmdLFSim(const char *Cmd) {
|
|||
payload_up.data[j] = GraphBuffer[i + j];
|
||||
|
||||
|
||||
SendCommandNG(CMD_UPLOAD_SIM_SAMPLES_125K, (uint8_t *)&payload_up, sizeof(struct pupload));
|
||||
WaitForResponse(CMD_UPLOAD_SIM_SAMPLES_125K, NULL);
|
||||
SendCommandNG(CMD_LF_UPLOAD_SIM_SAMPLES, (uint8_t *)&payload_up, sizeof(struct pupload));
|
||||
WaitForResponse(CMD_LF_UPLOAD_SIM_SAMPLES, NULL);
|
||||
printf(".");
|
||||
fflush(stdout);
|
||||
payload_up.flag = 0;
|
||||
|
@ -522,10 +522,10 @@ int CmdLFSim(const char *Cmd) {
|
|||
payload.gap = gap;
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_SIMULATE_TAG_125K, (uint8_t *)&payload, sizeof(payload));
|
||||
SendCommandNG(CMD_LF_SIMULATE, (uint8_t *)&payload, sizeof(payload));
|
||||
|
||||
PacketResponseNG resp;
|
||||
WaitForResponse(CMD_SIMULATE_TAG_125K, &resp);
|
||||
WaitForResponse(CMD_LF_SIMULATE, &resp);
|
||||
|
||||
PrintAndLogEx(INFO, "Done");
|
||||
if (resp.status != PM3_EOPABORTED)
|
||||
|
@ -624,12 +624,12 @@ int CmdLFfskSim(const char *Cmd) {
|
|||
PrintAndLogEx(INFO, "Simulating");
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_FSK_SIM_TAG, (uint8_t *)payload, sizeof(lf_fsksim_t) + size);
|
||||
SendCommandNG(CMD_LF_FSK_SIMULATE, (uint8_t *)payload, sizeof(lf_fsksim_t) + size);
|
||||
free(payload);
|
||||
|
||||
setClockGrid(clk, 0);
|
||||
PacketResponseNG resp;
|
||||
WaitForResponse(CMD_FSK_SIM_TAG, &resp);
|
||||
WaitForResponse(CMD_LF_FSK_SIMULATE, &resp);
|
||||
|
||||
PrintAndLogEx(INFO, "Done");
|
||||
if (resp.status != PM3_EOPABORTED)
|
||||
|
@ -726,11 +726,11 @@ int CmdLFaskSim(const char *Cmd) {
|
|||
PrintAndLogEx(INFO, "Simulating");
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_ASK_SIM_TAG, (uint8_t *)payload, sizeof(lf_asksim_t) + size);
|
||||
SendCommandNG(CMD_LF_ASK_SIMULATE, (uint8_t *)payload, sizeof(lf_asksim_t) + size);
|
||||
free(payload);
|
||||
|
||||
PacketResponseNG resp;
|
||||
WaitForResponse(CMD_ASK_SIM_TAG, &resp);
|
||||
WaitForResponse(CMD_LF_ASK_SIMULATE, &resp);
|
||||
|
||||
PrintAndLogEx(INFO, "Done");
|
||||
if (resp.status != PM3_EOPABORTED)
|
||||
|
@ -845,11 +845,11 @@ int CmdLFpskSim(const char *Cmd) {
|
|||
PrintAndLogEx(INFO, "Simulating");
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_PSK_SIM_TAG, (uint8_t *)payload, sizeof(lf_psksim_t) + size);
|
||||
SendCommandNG(CMD_LF_PSK_SIMULATE, (uint8_t *)payload, sizeof(lf_psksim_t) + size);
|
||||
free(payload);
|
||||
|
||||
PacketResponseNG resp;
|
||||
WaitForResponse(CMD_PSK_SIM_TAG, &resp);
|
||||
WaitForResponse(CMD_LF_PSK_SIMULATE, &resp);
|
||||
|
||||
PrintAndLogEx(INFO, "Done");
|
||||
if (resp.status != PM3_EOPABORTED)
|
||||
|
|
|
@ -115,7 +115,7 @@ static int sendTry(uint8_t fmtlen, uint32_t fc, uint32_t cn, uint32_t delay, uin
|
|||
memcpy(payload->data, bits, bs_len);
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_FSK_SIM_TAG, (uint8_t *)payload, sizeof(lf_fsksim_t) + bs_len);
|
||||
SendCommandNG(CMD_LF_FSK_SIMULATE, (uint8_t *)payload, sizeof(lf_fsksim_t) + bs_len);
|
||||
free(payload);
|
||||
|
||||
msleep(delay);
|
||||
|
@ -172,7 +172,7 @@ static int CmdAWIDRead_device(const char *Cmd) {
|
|||
if (Cmd[0] == 'h' || Cmd[0] == 'H') return usage_lf_awid_read();
|
||||
uint8_t findone = (Cmd[0] == '1') ? 1 : 0;
|
||||
clearCommandBuffer();
|
||||
SendCommandMIX(CMD_AWID_DEMOD_FSK, findone, 0, 0, NULL, 0);
|
||||
SendCommandMIX(CMD_LF_AWID_DEMOD, findone, 0, 0, NULL, 0);
|
||||
return PM3_SUCCESS;
|
||||
}
|
||||
*/
|
||||
|
@ -352,11 +352,11 @@ static int CmdAWIDSim(const char *Cmd) {
|
|||
memcpy(payload->data, bs, sizeof(bs));
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_FSK_SIM_TAG, (uint8_t *)payload, sizeof(lf_fsksim_t) + sizeof(bs));
|
||||
SendCommandNG(CMD_LF_FSK_SIMULATE, (uint8_t *)payload, sizeof(lf_fsksim_t) + sizeof(bs));
|
||||
free(payload);
|
||||
|
||||
PacketResponseNG resp;
|
||||
WaitForResponse(CMD_FSK_SIM_TAG, &resp);
|
||||
WaitForResponse(CMD_LF_FSK_SIMULATE, &resp);
|
||||
|
||||
PrintAndLogEx(INFO, "Done");
|
||||
if (resp.status != PM3_EOPABORTED)
|
||||
|
@ -417,8 +417,8 @@ static int CmdAWIDClone(const char *Cmd) {
|
|||
ng.blockno = i;
|
||||
ng.flags = 0;
|
||||
|
||||
SendCommandNG(CMD_T55XX_WRITE_BLOCK, (uint8_t *)&ng, sizeof(ng));
|
||||
if (!WaitForResponseTimeout(CMD_T55XX_WRITE_BLOCK, &resp, T55XX_WRITE_TIMEOUT)) {
|
||||
SendCommandNG(CMD_LF_T55XX_WRITEBL, (uint8_t *)&ng, sizeof(ng));
|
||||
if (!WaitForResponseTimeout(CMD_LF_T55XX_WRITEBL, &resp, T55XX_WRITE_TIMEOUT)) {
|
||||
PrintAndLogEx(ERR, "Error occurred, device did not respond during write operation.");
|
||||
return PM3_ETIMEOUT;
|
||||
}
|
||||
|
|
|
@ -75,7 +75,7 @@ static int CmdCOTAGRead(const char *Cmd) {
|
|||
sscanf(Cmd, "%u", &rawsignal);
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandMIX(CMD_COTAG, rawsignal, 0, 0, NULL, 0);
|
||||
SendCommandMIX(CMD_LF_COTAG_READ, rawsignal, 0, 0, NULL, 0);
|
||||
if (!WaitForResponseTimeout(CMD_ACK, NULL, 7000)) {
|
||||
PrintAndLogEx(WARNING, "command execution time out");
|
||||
return PM3_ETIMEOUT;
|
||||
|
|
|
@ -401,7 +401,7 @@ int AskEm410xDemod(const char *Cmd, uint32_t *hi, uint64_t *lo, bool verbose) {
|
|||
static int CmdEM410xRead_device(const char *Cmd) {
|
||||
char cmdp = tolower(param_getchar(Cmd, 0));
|
||||
uint8_t findone = (cmdp == '1') ? 1 : 0;
|
||||
SendCommandMIX(CMD_EM410X_DEMOD, findone, 0, 0, NULL, 0);
|
||||
SendCommandMIX(CMD_LF_EM410X_DEMOD, findone, 0, 0, NULL, 0);
|
||||
return PM3_SUCCESS;
|
||||
}
|
||||
*/
|
||||
|
@ -645,7 +645,7 @@ static int CmdEM410xWrite(const char *Cmd) {
|
|||
PrintAndLogEx(SUCCESS, "Writing %s tag with UID 0x%010" PRIx64 " (clock rate: %d)", "T55x7", id, clock1);
|
||||
// NOTE: We really should pass the clock in as a separate argument, but to
|
||||
// provide for backwards-compatibility for older firmware, and to avoid
|
||||
// having to add another argument to CMD_EM410X_WRITE_TAG, we just store
|
||||
// having to add another argument to CMD_LF_EM410X_WRITE, we just store
|
||||
// the clock rate in bits 8-15 of the card value
|
||||
card = (card & 0xFF) | ((clock1 << 8) & 0xFF00);
|
||||
} else if (card == 0) {
|
||||
|
@ -656,7 +656,7 @@ static int CmdEM410xWrite(const char *Cmd) {
|
|||
return PM3_ESOFT;
|
||||
}
|
||||
|
||||
SendCommandMIX(CMD_EM410X_WRITE_TAG, card, (uint32_t)(id >> 32), (uint32_t)id, NULL, 0);
|
||||
SendCommandMIX(CMD_LF_EM410X_WRITE, card, (uint32_t)(id >> 32), (uint32_t)id, NULL, 0);
|
||||
return PM3_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -1147,9 +1147,9 @@ static int EM4x05ReadWord_ext(uint8_t addr, uint32_t pwd, bool usePwd, uint32_t
|
|||
payload.usepwd = usePwd;
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_EM4X_READ_WORD, (uint8_t *)&payload, sizeof(payload));
|
||||
SendCommandNG(CMD_LF_EM4X_READWORD, (uint8_t *)&payload, sizeof(payload));
|
||||
PacketResponseNG resp;
|
||||
if (!WaitForResponseTimeout(CMD_EM4X_READ_WORD, &resp, 2500)) {
|
||||
if (!WaitForResponseTimeout(CMD_LF_EM4X_READWORD, &resp, 2500)) {
|
||||
PrintAndLogEx(DEBUG, "timeout while waiting for reply.");
|
||||
return PM3_ETIMEOUT;
|
||||
}
|
||||
|
@ -1259,9 +1259,9 @@ static int CmdEM4x05Write(const char *Cmd) {
|
|||
payload.usepwd = usePwd;
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_EM4X_WRITE_WORD, (uint8_t *)&payload, sizeof(payload));
|
||||
SendCommandNG(CMD_LF_EM4X_WRITEWORD, (uint8_t *)&payload, sizeof(payload));
|
||||
PacketResponseNG resp;
|
||||
if (!WaitForResponseTimeout(CMD_EM4X_WRITE_WORD, &resp, 2000)) {
|
||||
if (!WaitForResponseTimeout(CMD_LF_EM4X_WRITEWORD, &resp, 2000)) {
|
||||
PrintAndLogEx(ERR, "Error occurred, device did not respond during write operation.");
|
||||
return PM3_ETIMEOUT;
|
||||
}
|
||||
|
|
|
@ -298,8 +298,8 @@ static int CmdFdxClone(const char *Cmd) {
|
|||
ng.blockno = i;
|
||||
ng.flags = 0;
|
||||
|
||||
SendCommandNG(CMD_T55XX_WRITE_BLOCK, (uint8_t *)&ng, sizeof(ng));
|
||||
if (!WaitForResponseTimeout(CMD_T55XX_WRITE_BLOCK, &resp, T55XX_WRITE_TIMEOUT)) {
|
||||
SendCommandNG(CMD_LF_T55XX_WRITEBL, (uint8_t *)&ng, sizeof(ng));
|
||||
if (!WaitForResponseTimeout(CMD_LF_T55XX_WRITEBL, &resp, T55XX_WRITE_TIMEOUT)) {
|
||||
PrintAndLogEx(ERR, "Error occurred, device did not respond during write operation.");
|
||||
return PM3_ETIMEOUT;
|
||||
}
|
||||
|
@ -334,11 +334,11 @@ static int CmdFdxSim(const char *Cmd) {
|
|||
memcpy(payload->data, bs, sizeof(bs));
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_ASK_SIM_TAG, (uint8_t *)payload, sizeof(lf_asksim_t) + sizeof(bs));
|
||||
SendCommandNG(CMD_LF_ASK_SIMULATE, (uint8_t *)payload, sizeof(lf_asksim_t) + sizeof(bs));
|
||||
free(payload);
|
||||
|
||||
PacketResponseNG resp;
|
||||
WaitForResponse(CMD_ASK_SIM_TAG, &resp);
|
||||
WaitForResponse(CMD_LF_ASK_SIMULATE, &resp);
|
||||
|
||||
PrintAndLogEx(INFO, "Done");
|
||||
if (resp.status != PM3_EOPABORTED)
|
||||
|
|
|
@ -187,8 +187,8 @@ static int CmdGuardClone(const char *Cmd) {
|
|||
ng.blockno = i;
|
||||
ng.flags = 0;
|
||||
|
||||
SendCommandNG(CMD_T55XX_WRITE_BLOCK, (uint8_t *)&ng, sizeof(ng));
|
||||
if (!WaitForResponseTimeout(CMD_T55XX_WRITE_BLOCK, &resp, T55XX_WRITE_TIMEOUT)) {
|
||||
SendCommandNG(CMD_LF_T55XX_WRITEBL, (uint8_t *)&ng, sizeof(ng));
|
||||
if (!WaitForResponseTimeout(CMD_LF_T55XX_WRITEBL, &resp, T55XX_WRITE_TIMEOUT)) {
|
||||
PrintAndLogEx(ERR, "Error occurred, device did not respond during write operation.");
|
||||
return PM3_ETIMEOUT;
|
||||
}
|
||||
|
@ -228,11 +228,11 @@ static int CmdGuardSim(const char *Cmd) {
|
|||
memcpy(payload->data, bs, sizeof(bs));
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_ASK_SIM_TAG, (uint8_t *)payload, sizeof(lf_asksim_t) + sizeof(bs));
|
||||
SendCommandNG(CMD_LF_ASK_SIMULATE, (uint8_t *)payload, sizeof(lf_asksim_t) + sizeof(bs));
|
||||
free(payload);
|
||||
|
||||
PacketResponseNG resp;
|
||||
WaitForResponse(CMD_ASK_SIM_TAG, &resp);
|
||||
WaitForResponse(CMD_LF_ASK_SIMULATE, &resp);
|
||||
|
||||
PrintAndLogEx(INFO, "Done");
|
||||
if (resp.status != PM3_EOPABORTED)
|
||||
|
|
|
@ -111,7 +111,7 @@ static int sendTry(uint8_t fmtlen, uint32_t fc, uint32_t cn, uint32_t delay, uin
|
|||
calcWiegand(fmtlen, fc, cn, bits, 0);
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandMIX(CMD_HID_SIM_TAG, bytebits_to_byte(bits, 32), bytebits_to_byte(bits + 32, 32), 0, NULL, 0);
|
||||
SendCommandMIX(CMD_LF_HID_SIMULATE, bytebits_to_byte(bits, 32), bytebits_to_byte(bits + 32, 32), 0, NULL, 0);
|
||||
|
||||
msleep(delay);
|
||||
return sendPing();
|
||||
|
@ -240,7 +240,7 @@ static int CmdHIDRead_device(const char *Cmd) {
|
|||
if (Cmd[0] == 'h' || Cmd[0] == 'H') return usage_lf_hid_read();
|
||||
uint8_t findone = (Cmd[0] == '1') ? 1 : 0;
|
||||
clearCommandBuffer();
|
||||
SendCommandMIX(CMD_HID_DEMOD_FSK, findone, 0, 0, NULL, 0);
|
||||
SendCommandMIX(CMD_LF_HID_DEMOD, findone, 0, 0, NULL, 0);
|
||||
return PM3_SUCCESS;
|
||||
}
|
||||
*/
|
||||
|
@ -260,9 +260,9 @@ static int CmdHIDSim(const char *Cmd) {
|
|||
PrintAndLogEx(SUCCESS, "Press pm3-button to abort simulation");
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandMIX(CMD_HID_SIM_TAG, hi, lo, 0, NULL, 0);
|
||||
SendCommandMIX(CMD_LF_HID_SIMULATE, hi, lo, 0, NULL, 0);
|
||||
PacketResponseNG resp;
|
||||
WaitForResponse(CMD_HID_SIM_TAG, &resp);
|
||||
WaitForResponse(CMD_LF_HID_SIMULATE, &resp);
|
||||
PrintAndLogEx(INFO, "Done");
|
||||
if (resp.status != PM3_EOPABORTED)
|
||||
return resp.status;
|
||||
|
@ -297,7 +297,7 @@ static int CmdHIDClone(const char *Cmd) {
|
|||
}
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandOLD(CMD_HID_CLONE_TAG, hi2, hi, lo, longid, sizeof(longid));
|
||||
SendCommandOLD(CMD_LF_HID_CLONE, hi2, hi, lo, longid, sizeof(longid));
|
||||
return PM3_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
|
@ -262,7 +262,7 @@ static int CmdLFHitagSniff(const char *Cmd) {
|
|||
if (ctmp == 'h') return usage_hitag_sniff();
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_SNIFF_HITAG, NULL, 0);
|
||||
SendCommandNG(CMD_LF_HITAG_SNIFF, NULL, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -277,7 +277,7 @@ static int CmdLFHitagSim(const char *Cmd) {
|
|||
int res = 0;
|
||||
char filename[FILE_PATH_SIZE] = { 0x00 };
|
||||
|
||||
uint16_t cmd = CMD_SIMULATE_HITAG;
|
||||
uint16_t cmd = CMD_LF_HITAG_SIMULATE;
|
||||
while (param_getchar(Cmd, cmdp) != 0x00 && !errors) {
|
||||
switch (tolower(param_getchar(Cmd, cmdp))) {
|
||||
case 'h':
|
||||
|
@ -288,7 +288,7 @@ static int CmdLFHitagSim(const char *Cmd) {
|
|||
cmdp++;
|
||||
break;
|
||||
case 's':
|
||||
cmd = CMD_SIMULATE_HITAG_S;
|
||||
cmd = CMD_LF_HITAGS_SIMULATE;
|
||||
maxdatalen = 4 * 64;
|
||||
cmdp++;
|
||||
break;
|
||||
|
@ -459,7 +459,7 @@ static bool getHitagUid(uint32_t *uid) {
|
|||
hitag_data htd;
|
||||
memset(&htd, 0, sizeof(htd));
|
||||
clearCommandBuffer();
|
||||
SendCommandMIX(CMD_READER_HITAG, RHT2F_UID_ONLY, 0, 0, &htd, sizeof(htd));
|
||||
SendCommandMIX(CMD_LF_HITAG_READER, RHT2F_UID_ONLY, 0, 0, &htd, sizeof(htd));
|
||||
PacketResponseNG resp;
|
||||
if (!WaitForResponseTimeout(CMD_ACK, &resp, 2500)) {
|
||||
PrintAndLogEx(WARNING, "timeout while waiting for reply.");
|
||||
|
@ -512,19 +512,19 @@ static int CmdLFHitagInfo(const char *Cmd) {
|
|||
//
|
||||
static int CmdLFHitagReader(const char *Cmd) {
|
||||
|
||||
uint16_t cmd = CMD_READER_HITAG;
|
||||
uint16_t cmd = CMD_LF_HITAG_READER;
|
||||
hitag_data htd;
|
||||
hitag_function htf = param_get32ex(Cmd, 0, 0, 10);
|
||||
|
||||
switch (htf) {
|
||||
case RHTSF_CHALLENGE: {
|
||||
cmd = CMD_READ_HITAG_S;
|
||||
cmd = CMD_LF_HITAGS_READ;
|
||||
num_to_bytes(param_get32ex(Cmd, 1, 0, 16), 4, htd.auth.NrAr);
|
||||
num_to_bytes(param_get32ex(Cmd, 2, 0, 16), 4, htd.auth.NrAr + 4);
|
||||
break;
|
||||
}
|
||||
case RHTSF_KEY: {
|
||||
cmd = CMD_READ_HITAG_S;
|
||||
cmd = CMD_LF_HITAGS_READ;
|
||||
num_to_bytes(param_get64ex(Cmd, 1, 0, 16), 6, htd.crypto.key);
|
||||
break;
|
||||
}
|
||||
|
@ -633,9 +633,9 @@ static int CmdLFHitagCheckChallenges(const char *Cmd) {
|
|||
|
||||
clearCommandBuffer();
|
||||
if (file_given)
|
||||
SendCommandOLD(CMD_TEST_HITAGS_TRACES, 1, 0, 0, data, datalen);
|
||||
SendCommandOLD(CMD_LF_HITAGS_TEST_TRACES, 1, 0, 0, data, datalen);
|
||||
else
|
||||
SendCommandMIX(CMD_TEST_HITAGS_TRACES, 0, 0, 0, NULL, 0);
|
||||
SendCommandMIX(CMD_LF_HITAGS_TEST_TRACES, 0, 0, 0, NULL, 0);
|
||||
|
||||
free(data);
|
||||
return 0;
|
||||
|
@ -678,7 +678,7 @@ static int CmdLFHitagWriter(const char *Cmd) {
|
|||
}
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandOLD(CMD_WR_HITAG_S, htf, 0, arg2, &htd, sizeof(htd));
|
||||
SendCommandOLD(CMD_LF_HITAGS_WRITE, htf, 0, arg2, &htd, sizeof(htd));
|
||||
PacketResponseNG resp;
|
||||
if (!WaitForResponseTimeout(CMD_ACK, &resp, 4000)) {
|
||||
PrintAndLogEx(WARNING, "timeout while waiting for reply.");
|
||||
|
|
|
@ -411,11 +411,11 @@ static int CmdIndalaSim(const char *Cmd) {
|
|||
PrintAndLogEx(INFO, "Simulating");
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_PSK_SIM_TAG, (uint8_t *)payload, sizeof(lf_psksim_t) + sizeof(bs));
|
||||
SendCommandNG(CMD_LF_PSK_SIMULATE, (uint8_t *)payload, sizeof(lf_psksim_t) + sizeof(bs));
|
||||
free(payload);
|
||||
|
||||
PacketResponseNG resp;
|
||||
WaitForResponse(CMD_PSK_SIM_TAG, &resp);
|
||||
WaitForResponse(CMD_LF_PSK_SIMULATE, &resp);
|
||||
|
||||
PrintAndLogEx(INFO, "Done");
|
||||
if (resp.status != PM3_EOPABORTED)
|
||||
|
@ -461,14 +461,14 @@ static int CmdIndalaClone(const char *Cmd) {
|
|||
datawords[5] = bytes_to_num(data + 20, 4);
|
||||
datawords[6] = bytes_to_num(data + 24, 4);
|
||||
clearCommandBuffer();
|
||||
SendCommandOLD(CMD_INDALA_CLONE_TAG_L, 0, 0, 0, datawords, sizeof(datawords));
|
||||
SendCommandOLD(CMD_LF_INDALA224_CLONE, 0, 0, 0, datawords, sizeof(datawords));
|
||||
} else {
|
||||
PrintAndLogEx(INFO, "Preparing to clone Indala 64bit tag with RawID %s", sprint_hex(data, datalen));
|
||||
uint32_t datawords[2] = {0};
|
||||
datawords[0] = bytes_to_num(data, 4);
|
||||
datawords[1] = bytes_to_num(data + 4, 4);
|
||||
clearCommandBuffer();
|
||||
SendCommandOLD(CMD_INDALA_CLONE_TAG, 0, 0, 0, datawords, sizeof(datawords));
|
||||
SendCommandOLD(CMD_LF_INDALA_CLONE, 0, 0, 0, datawords, sizeof(datawords));
|
||||
}
|
||||
|
||||
return PM3_SUCCESS;
|
||||
|
|
|
@ -67,7 +67,7 @@ static int CmdIOProxRead_device(const char *Cmd) {
|
|||
if (Cmd[0] == 'h' || Cmd[0] == 'H') return usage_lf_io_read();
|
||||
int findone = (Cmd[0] == '1') ? 1 : 0;
|
||||
clearCommandBuffer();
|
||||
SendCommandMIX(CMD_IO_DEMOD_FSK, findone, 0, 0, NULL, 0);
|
||||
SendCommandMIX(CMD_LF_IO_DEMOD, findone, 0, 0, NULL, 0);
|
||||
return PM3_SUCCESS;
|
||||
}
|
||||
*/
|
||||
|
@ -214,11 +214,11 @@ static int CmdIOProxSim(const char *Cmd) {
|
|||
memcpy(payload->data, bs, sizeof(bs));
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_FSK_SIM_TAG, (uint8_t *)payload, sizeof(lf_fsksim_t) + sizeof(bs));
|
||||
SendCommandNG(CMD_LF_FSK_SIMULATE, (uint8_t *)payload, sizeof(lf_fsksim_t) + sizeof(bs));
|
||||
free(payload);
|
||||
|
||||
PacketResponseNG resp;
|
||||
WaitForResponse(CMD_FSK_SIM_TAG, &resp);
|
||||
WaitForResponse(CMD_LF_FSK_SIMULATE, &resp);
|
||||
|
||||
PrintAndLogEx(INFO, "Done");
|
||||
if (resp.status != PM3_EOPABORTED)
|
||||
|
@ -263,7 +263,7 @@ static int CmdIOProxClone(const char *Cmd) {
|
|||
print_blocks(blocks, 3);
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandMIX(CMD_IO_CLONE_TAG, blocks[1], blocks[2], 0, NULL, 0);
|
||||
SendCommandMIX(CMD_LF_IO_CLONE, blocks[1], blocks[2], 0, NULL, 0);
|
||||
return PM3_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
|
@ -172,8 +172,8 @@ static int CmdJablotronClone(const char *Cmd) {
|
|||
ng.blockno = i;
|
||||
ng.flags = 0;
|
||||
|
||||
SendCommandNG(CMD_T55XX_WRITE_BLOCK, (uint8_t *)&ng, sizeof(ng));
|
||||
if (!WaitForResponseTimeout(CMD_T55XX_WRITE_BLOCK, &resp, T55XX_WRITE_TIMEOUT)) {
|
||||
SendCommandNG(CMD_LF_T55XX_WRITEBL, (uint8_t *)&ng, sizeof(ng));
|
||||
if (!WaitForResponseTimeout(CMD_LF_T55XX_WRITEBL, &resp, T55XX_WRITE_TIMEOUT)) {
|
||||
PrintAndLogEx(ERR, "Error occurred, device did not respond during write operation.");
|
||||
return PM3_ETIMEOUT;
|
||||
}
|
||||
|
@ -208,11 +208,11 @@ static int CmdJablotronSim(const char *Cmd) {
|
|||
memcpy(payload->data, bs, sizeof(bs));
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_ASK_SIM_TAG, (uint8_t *)payload, sizeof(lf_asksim_t) + sizeof(bs));
|
||||
SendCommandNG(CMD_LF_ASK_SIMULATE, (uint8_t *)payload, sizeof(lf_asksim_t) + sizeof(bs));
|
||||
free(payload);
|
||||
|
||||
PacketResponseNG resp;
|
||||
WaitForResponse(CMD_ASK_SIM_TAG, &resp);
|
||||
WaitForResponse(CMD_LF_ASK_SIMULATE, &resp);
|
||||
|
||||
PrintAndLogEx(INFO, "Done");
|
||||
if (resp.status != PM3_EOPABORTED)
|
||||
|
|
|
@ -162,8 +162,8 @@ static int CmdKeriClone(const char *Cmd) {
|
|||
ng.blockno = i;
|
||||
ng.flags = 0;
|
||||
|
||||
SendCommandNG(CMD_T55XX_WRITE_BLOCK, (uint8_t *)&ng, sizeof(ng));
|
||||
if (!WaitForResponseTimeout(CMD_T55XX_WRITE_BLOCK, &resp, T55XX_WRITE_TIMEOUT)) {
|
||||
SendCommandNG(CMD_LF_T55XX_WRITEBL, (uint8_t *)&ng, sizeof(ng));
|
||||
if (!WaitForResponseTimeout(CMD_LF_T55XX_WRITEBL, &resp, T55XX_WRITE_TIMEOUT)) {
|
||||
PrintAndLogEx(ERR, "Error occurred, device did not respond during write operation.");
|
||||
return PM3_ETIMEOUT;
|
||||
}
|
||||
|
@ -201,11 +201,11 @@ static int CmdKeriSim(const char *Cmd) {
|
|||
PrintAndLogEx(INFO, "Simulating");
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_PSK_SIM_TAG, (uint8_t *)payload, sizeof(lf_psksim_t) + sizeof(bs));
|
||||
SendCommandNG(CMD_LF_PSK_SIMULATE, (uint8_t *)payload, sizeof(lf_psksim_t) + sizeof(bs));
|
||||
free(payload);
|
||||
|
||||
PacketResponseNG resp;
|
||||
WaitForResponse(CMD_PSK_SIM_TAG, &resp);
|
||||
WaitForResponse(CMD_LF_PSK_SIMULATE, &resp);
|
||||
|
||||
PrintAndLogEx(INFO, "Done");
|
||||
if (resp.status != PM3_EOPABORTED)
|
||||
|
|
|
@ -218,8 +218,8 @@ static int CmdLFNedapClone(const char *Cmd) {
|
|||
ng.blockno = i;
|
||||
ng.flags = 0;
|
||||
|
||||
SendCommandNG(CMD_T55XX_WRITE_BLOCK, (uint8_t *)&ng, sizeof(ng));
|
||||
if (!WaitForResponseTimeout(CMD_T55XX_WRITE_BLOCK, &resp, T55XX_WRITE_TIMEOUT)) {
|
||||
SendCommandNG(CMD_LF_T55XX_WRITEBL, (uint8_t *)&ng, sizeof(ng));
|
||||
if (!WaitForResponseTimeout(CMD_LF_T55XX_WRITEBL, &resp, T55XX_WRITE_TIMEOUT)) {
|
||||
PrintAndLogEx(ERR, "Error occurred, device did not respond during write operation.");
|
||||
return PM3_ETIMEOUT;
|
||||
}
|
||||
|
@ -259,11 +259,11 @@ static int CmdLFNedapSim(const char *Cmd) {
|
|||
memcpy(payload->data, bs, sizeof(bs));
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_ASK_SIM_TAG, (uint8_t *)payload, sizeof(lf_asksim_t) + sizeof(bs));
|
||||
SendCommandNG(CMD_LF_ASK_SIMULATE, (uint8_t *)payload, sizeof(lf_asksim_t) + sizeof(bs));
|
||||
free(payload);
|
||||
|
||||
PacketResponseNG resp;
|
||||
WaitForResponse(CMD_ASK_SIM_TAG, &resp);
|
||||
WaitForResponse(CMD_LF_ASK_SIMULATE, &resp);
|
||||
|
||||
PrintAndLogEx(INFO, "Done");
|
||||
if (resp.status != PM3_EOPABORTED)
|
||||
|
|
|
@ -170,8 +170,8 @@ static int CmdNoralsyClone(const char *Cmd) {
|
|||
ng.blockno = i;
|
||||
ng.flags = 0;
|
||||
|
||||
SendCommandNG(CMD_T55XX_WRITE_BLOCK, (uint8_t *)&ng, sizeof(ng));
|
||||
if (!WaitForResponseTimeout(CMD_T55XX_WRITE_BLOCK, &resp, T55XX_WRITE_TIMEOUT)) {
|
||||
SendCommandNG(CMD_LF_T55XX_WRITEBL, (uint8_t *)&ng, sizeof(ng));
|
||||
if (!WaitForResponseTimeout(CMD_LF_T55XX_WRITEBL, &resp, T55XX_WRITE_TIMEOUT)) {
|
||||
PrintAndLogEx(ERR, "Error occurred, device did not respond during write operation.");
|
||||
return PM3_ETIMEOUT;
|
||||
}
|
||||
|
@ -209,11 +209,11 @@ static int CmdNoralsySim(const char *Cmd) {
|
|||
memcpy(payload->data, bs, sizeof(bs));
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_ASK_SIM_TAG, (uint8_t *)payload, sizeof(lf_asksim_t) + sizeof(bs));
|
||||
SendCommandNG(CMD_LF_ASK_SIMULATE, (uint8_t *)payload, sizeof(lf_asksim_t) + sizeof(bs));
|
||||
free(payload);
|
||||
|
||||
PacketResponseNG resp;
|
||||
WaitForResponse(CMD_ASK_SIM_TAG, &resp);
|
||||
WaitForResponse(CMD_LF_ASK_SIMULATE, &resp);
|
||||
|
||||
PrintAndLogEx(INFO, "Done");
|
||||
if (resp.status != PM3_EOPABORTED)
|
||||
|
|
|
@ -142,11 +142,11 @@ static int CmdParadoxSim(const char *Cmd) {
|
|||
memcpy(payload->data, bs, sizeof(bs));
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_FSK_SIM_TAG, (uint8_t *)payload, sizeof(lf_fsksim_t) + sizeof(bs));
|
||||
SendCommandNG(CMD_LF_FSK_SIMULATE, (uint8_t *)payload, sizeof(lf_fsksim_t) + sizeof(bs));
|
||||
free(payload);
|
||||
|
||||
PacketResponseNG resp;
|
||||
WaitForResponse(CMD_FSK_SIM_TAG, &resp);
|
||||
WaitForResponse(CMD_LF_FSK_SIMULATE, &resp);
|
||||
|
||||
PrintAndLogEx(INFO, "Done");
|
||||
if (resp.status != PM3_EOPABORTED)
|
||||
|
|
|
@ -101,7 +101,7 @@ static int CmdLFPCF7931Read(const char *Cmd) {
|
|||
|
||||
PacketResponseNG resp;
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_PCF7931_READ, NULL, 0);
|
||||
SendCommandNG(CMD_LF_PCF7931_READ, NULL, 0);
|
||||
if (!WaitForResponseTimeout(CMD_ACK, &resp, 2500)) {
|
||||
PrintAndLogEx(WARNING, "command execution time out");
|
||||
return 1;
|
||||
|
@ -151,7 +151,7 @@ static int CmdLFPCF7931Write(const char *Cmd) {
|
|||
buf[9] = configPcf.InitDelay;
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandOLD(CMD_PCF7931_WRITE, block, bytepos, data, buf, sizeof(buf));
|
||||
SendCommandOLD(CMD_LF_PCF7931_WRITE, block, bytepos, data, buf, sizeof(buf));
|
||||
//no ack?
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -136,8 +136,8 @@ static int CmdPrescoClone(const char *Cmd) {
|
|||
ng.blockno = i;
|
||||
ng.flags = 0;
|
||||
|
||||
SendCommandNG(CMD_T55XX_WRITE_BLOCK, (uint8_t *)&ng, sizeof(ng));
|
||||
if (!WaitForResponseTimeout(CMD_T55XX_WRITE_BLOCK, &resp, T55XX_WRITE_TIMEOUT)) {
|
||||
SendCommandNG(CMD_LF_T55XX_WRITEBL, (uint8_t *)&ng, sizeof(ng));
|
||||
if (!WaitForResponseTimeout(CMD_LF_T55XX_WRITEBL, &resp, T55XX_WRITE_TIMEOUT)) {
|
||||
PrintAndLogEx(ERR, "Error occurred, device did not respond during write operation.");
|
||||
return PM3_ETIMEOUT;
|
||||
}
|
||||
|
@ -167,11 +167,11 @@ static int CmdPrescoSim(const char *Cmd) {
|
|||
memcpy(payload->data, bs, sizeof(bs));
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_ASK_SIM_TAG, (uint8_t *)payload, sizeof(lf_asksim_t) + sizeof(bs));
|
||||
SendCommandNG(CMD_LF_ASK_SIMULATE, (uint8_t *)payload, sizeof(lf_asksim_t) + sizeof(bs));
|
||||
free(payload);
|
||||
|
||||
PacketResponseNG resp;
|
||||
WaitForResponse(CMD_ASK_SIM_TAG, &resp);
|
||||
WaitForResponse(CMD_LF_ASK_SIMULATE, &resp);
|
||||
|
||||
PrintAndLogEx(INFO, "Done");
|
||||
if (resp.status != PM3_EOPABORTED)
|
||||
|
|
|
@ -247,8 +247,8 @@ static int CmdPyramidClone(const char *Cmd) {
|
|||
ng.blockno = i;
|
||||
ng.flags = 0;
|
||||
|
||||
SendCommandNG(CMD_T55XX_WRITE_BLOCK, (uint8_t *)&ng, sizeof(ng));
|
||||
if (!WaitForResponseTimeout(CMD_T55XX_WRITE_BLOCK, &resp, T55XX_WRITE_TIMEOUT)) {
|
||||
SendCommandNG(CMD_LF_T55XX_WRITEBL, (uint8_t *)&ng, sizeof(ng));
|
||||
if (!WaitForResponseTimeout(CMD_LF_T55XX_WRITEBL, &resp, T55XX_WRITE_TIMEOUT)) {
|
||||
PrintAndLogEx(ERR, "Error occurred, device did not respond during write operation.");
|
||||
return PM3_ETIMEOUT;
|
||||
}
|
||||
|
@ -287,11 +287,11 @@ static int CmdPyramidSim(const char *Cmd) {
|
|||
memcpy(payload->data, bs, sizeof(bs));
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_FSK_SIM_TAG, (uint8_t *)payload, sizeof(lf_fsksim_t) + sizeof(bs));
|
||||
SendCommandNG(CMD_LF_FSK_SIMULATE, (uint8_t *)payload, sizeof(lf_fsksim_t) + sizeof(bs));
|
||||
free(payload);
|
||||
|
||||
PacketResponseNG resp;
|
||||
WaitForResponse(CMD_FSK_SIM_TAG, &resp);
|
||||
WaitForResponse(CMD_LF_FSK_SIMULATE, &resp);
|
||||
|
||||
PrintAndLogEx(INFO, "Done");
|
||||
if (resp.status != PM3_EOPABORTED)
|
||||
|
|
|
@ -1136,7 +1136,7 @@ static int CmdT55xxWakeUp(const char *Cmd) {
|
|||
|
||||
flags = (downlink_mode & 3) << 3;
|
||||
clearCommandBuffer();
|
||||
SendCommandMIX(CMD_T55XX_WAKEUP, password, flags, 0, NULL, 0);
|
||||
SendCommandMIX(CMD_LF_T55XX_WAKEUP, password, flags, 0, NULL, 0);
|
||||
PrintAndLogEx(SUCCESS, "Wake up command sent. Try read now");
|
||||
|
||||
return PM3_SUCCESS;
|
||||
|
@ -1228,8 +1228,8 @@ static int CmdT55xxWriteBlock(const char *Cmd) {
|
|||
ng.blockno = block;
|
||||
ng.flags = flags;
|
||||
|
||||
SendCommandNG(CMD_T55XX_WRITE_BLOCK, (uint8_t *)&ng, sizeof(ng));
|
||||
if (!WaitForResponseTimeout(CMD_T55XX_WRITE_BLOCK, &resp, 2000)) {
|
||||
SendCommandNG(CMD_LF_T55XX_WRITEBL, (uint8_t *)&ng, sizeof(ng));
|
||||
if (!WaitForResponseTimeout(CMD_LF_T55XX_WRITEBL, &resp, 2000)) {
|
||||
PrintAndLogEx(ERR, "Error occurred, device did not ACK write operation. (May be due to old firmware)");
|
||||
return PM3_ETIMEOUT;
|
||||
}
|
||||
|
@ -1696,8 +1696,8 @@ bool AquireData(uint8_t page, uint8_t block, bool pwdmode, uint32_t password, ui
|
|||
payload.downlink_mode = downlink_mode;
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_T55XX_READ_BLOCK, (uint8_t *)&payload, sizeof(payload));
|
||||
if (!WaitForResponseTimeout(CMD_T55XX_READ_BLOCK, NULL, 2500)) {
|
||||
SendCommandNG(CMD_LF_T55XX_READBL, (uint8_t *)&payload, sizeof(payload));
|
||||
if (!WaitForResponseTimeout(CMD_LF_T55XX_READBL, NULL, 2500)) {
|
||||
PrintAndLogEx(WARNING, "command execution time out");
|
||||
return false;
|
||||
}
|
||||
|
@ -1966,7 +1966,7 @@ static int CmdResetRead(const char *Cmd) {
|
|||
printf("DL : %d\n", downlink_mode);
|
||||
flags = downlink_mode << 3;
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_T55XX_RESET_READ, &flags, sizeof(flags));
|
||||
SendCommandNG(CMD_LF_T55XX_RESET_READ, &flags, sizeof(flags));
|
||||
if (!WaitForResponseTimeout(CMD_ACK, NULL, 2500)) {
|
||||
PrintAndLogEx(WARNING, "command execution time out");
|
||||
return PM3_ETIMEOUT;
|
||||
|
@ -2076,7 +2076,7 @@ static int CmdT55xxChkPwds(const char *Cmd) {
|
|||
|
||||
if (from_flash) {
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_T55XX_CHKPWDS, &flags, sizeof(flags));
|
||||
SendCommandNG(CMD_LF_T55XX_CHK_PWDS, &flags, sizeof(flags));
|
||||
PacketResponseNG resp;
|
||||
|
||||
while (!WaitForResponseTimeout(CMD_ACK, &resp, 2000)) {
|
||||
|
@ -2649,7 +2649,7 @@ static int CmdT55xxSetDeviceConfig(const char *Cmd) {
|
|||
}
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandOLD(CMD_SET_LF_T55XX_CONFIG, shall_persist, 0, 0, &configurations, sizeof(t55xx_configurations_t));
|
||||
SendCommandOLD(CMD_LF_T55XX_SET_CONFIG, shall_persist, 0, 0, &configurations, sizeof(t55xx_configurations_t));
|
||||
return PM3_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
|
@ -276,7 +276,7 @@ out:
|
|||
static int CmdTIRead(const char *Cmd) {
|
||||
(void)Cmd; // Cmd is not used so far
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_READ_TI_TYPE, NULL, 0);
|
||||
SendCommandNG(CMD_LF_TI_READ, NULL, 0);
|
||||
return PM3_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -294,7 +294,7 @@ static int CmdTIWrite(const char *Cmd) {
|
|||
return PM3_EINVARG;
|
||||
}
|
||||
clearCommandBuffer();
|
||||
SendCommandMIX(CMD_WRITE_TI_TYPE, arg0, arg1, arg2, NULL, 0);
|
||||
SendCommandMIX(CMD_LF_TI_WRITE, arg0, arg1, arg2, NULL, 0);
|
||||
return PM3_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
|
@ -88,7 +88,7 @@ static int CmdVikingClone(const char *Cmd) {
|
|||
PrintAndLogEx(INFO, "Preparing to clone Viking tag - ID " _YELLOW_("%08X")" raw " _YELLOW_("%08X%08X"), id, (uint32_t)(rawID >> 32), (uint32_t)(rawID & 0xFFFFFFFF));
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandMIX(CMD_VIKING_CLONE_TAG, rawID >> 32, rawID & 0xFFFFFFFF, Q5, NULL, 0);
|
||||
SendCommandMIX(CMD_LF_VIKING_CLONE, rawID >> 32, rawID & 0xFFFFFFFF, Q5, NULL, 0);
|
||||
PacketResponseNG resp;
|
||||
if (!WaitForResponseTimeout(CMD_ACK, &resp, T55XX_WRITE_TIMEOUT)) {
|
||||
PrintAndLogEx(ERR, "Error occurred, device did not respond during write operation.");
|
||||
|
@ -121,11 +121,11 @@ static int CmdVikingSim(const char *Cmd) {
|
|||
memcpy(payload->data, bs, sizeof(bs));
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_ASK_SIM_TAG, (uint8_t *)payload, sizeof(lf_asksim_t) + sizeof(bs));
|
||||
SendCommandNG(CMD_LF_ASK_SIMULATE, (uint8_t *)payload, sizeof(lf_asksim_t) + sizeof(bs));
|
||||
free(payload);
|
||||
|
||||
PacketResponseNG resp;
|
||||
WaitForResponse(CMD_ASK_SIM_TAG, &resp);
|
||||
WaitForResponse(CMD_LF_ASK_SIMULATE, &resp);
|
||||
|
||||
PrintAndLogEx(INFO, "Done");
|
||||
if (resp.status != PM3_EOPABORTED)
|
||||
|
|
|
@ -183,8 +183,8 @@ static int CmdVisa2kClone(const char *Cmd) {
|
|||
ng.blockno = i;
|
||||
ng.flags = 0;
|
||||
|
||||
SendCommandNG(CMD_T55XX_WRITE_BLOCK, (uint8_t *)&ng, sizeof(ng));
|
||||
if (!WaitForResponseTimeout(CMD_T55XX_WRITE_BLOCK, &resp, T55XX_WRITE_TIMEOUT)) {
|
||||
SendCommandNG(CMD_LF_T55XX_WRITEBL, (uint8_t *)&ng, sizeof(ng));
|
||||
if (!WaitForResponseTimeout(CMD_LF_T55XX_WRITEBL, &resp, T55XX_WRITE_TIMEOUT)) {
|
||||
|
||||
PrintAndLogEx(ERR, "Error occurred, device did not respond during write operation.");
|
||||
return PM3_ETIMEOUT;
|
||||
|
@ -218,11 +218,11 @@ static int CmdVisa2kSim(const char *Cmd) {
|
|||
memcpy(payload->data, bs, sizeof(bs));
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_ASK_SIM_TAG, (uint8_t *)payload, sizeof(lf_asksim_t) + sizeof(bs));
|
||||
SendCommandNG(CMD_LF_ASK_SIMULATE, (uint8_t *)payload, sizeof(lf_asksim_t) + sizeof(bs));
|
||||
free(payload);
|
||||
|
||||
PacketResponseNG resp;
|
||||
WaitForResponse(CMD_ASK_SIM_TAG, &resp);
|
||||
WaitForResponse(CMD_LF_ASK_SIMULATE, &resp);
|
||||
|
||||
PrintAndLogEx(INFO, "Done");
|
||||
if (resp.status != PM3_EOPABORTED)
|
||||
|
|
|
@ -66,94 +66,94 @@ typedef struct {
|
|||
#define CMD_FLASHMEM_INFO 0x0125
|
||||
|
||||
// For low-frequency tags
|
||||
#define CMD_READ_TI_TYPE 0x0202
|
||||
#define CMD_WRITE_TI_TYPE 0x0203
|
||||
#define CMD_ACQUIRE_RAW_ADC_SAMPLES_125K 0x0205
|
||||
#define CMD_MOD_THEN_ACQUIRE_RAW_ADC_SAMPLES_125K 0x0206
|
||||
#define CMD_LF_TI_READ 0x0202
|
||||
#define CMD_LF_TI_WRITE 0x0203
|
||||
#define CMD_LF_ACQ_RAW_ADC 0x0205
|
||||
#define CMD_LF_MOD_THEN_ACQ_RAW_ADC 0x0206
|
||||
#define CMD_DOWNLOAD_RAW_ADC_SAMPLES_125K 0x0207
|
||||
#define CMD_DOWNLOADED_RAW_ADC_SAMPLES_125K 0x0208
|
||||
#define CMD_UPLOAD_SIM_SAMPLES_125K 0x0209
|
||||
#define CMD_SIMULATE_TAG_125K 0x020A
|
||||
#define CMD_HID_DEMOD_FSK 0x020B
|
||||
#define CMD_HID_SIM_TAG 0x020C
|
||||
#define CMD_SET_LF_DIVISOR 0x020D
|
||||
#define CMD_LF_UPLOAD_SIM_SAMPLES 0x0209
|
||||
#define CMD_LF_SIMULATE 0x020A
|
||||
#define CMD_LF_HID_DEMOD 0x020B
|
||||
#define CMD_LF_HID_SIMULATE 0x020C
|
||||
#define CMD_LF_SET_DIVISOR 0x020D
|
||||
#define CMD_LF_SIMULATE_BIDIR 0x020E
|
||||
#define CMD_SET_ADC_MUX 0x020F
|
||||
#define CMD_HID_CLONE_TAG 0x0210
|
||||
#define CMD_EM410X_WRITE_TAG 0x0211
|
||||
#define CMD_INDALA_CLONE_TAG 0x0212
|
||||
#define CMD_LF_HID_CLONE 0x0210
|
||||
#define CMD_LF_EM410X_WRITE 0x0211
|
||||
#define CMD_LF_INDALA_CLONE 0x0212
|
||||
// for 224 bits UID
|
||||
#define CMD_INDALA_CLONE_TAG_L 0x0213
|
||||
#define CMD_T55XX_READ_BLOCK 0x0214
|
||||
#define CMD_T55XX_WRITE_BLOCK 0x0215
|
||||
#define CMD_T55XX_RESET_READ 0x0216
|
||||
#define CMD_T55XX_WAKEUP 0x0224
|
||||
#define CMD_LF_INDALA224_CLONE 0x0213
|
||||
#define CMD_LF_T55XX_READBL 0x0214
|
||||
#define CMD_LF_T55XX_WRITEBL 0x0215
|
||||
#define CMD_LF_T55XX_RESET_READ 0x0216
|
||||
#define CMD_LF_T55XX_WAKEUP 0x0224
|
||||
|
||||
#define CMD_PCF7931_READ 0x0217
|
||||
#define CMD_PCF7931_WRITE 0x0223
|
||||
#define CMD_EM4X_READ_WORD 0x0218
|
||||
#define CMD_EM4X_WRITE_WORD 0x0219
|
||||
#define CMD_IO_DEMOD_FSK 0x021A
|
||||
#define CMD_IO_CLONE_TAG 0x021B
|
||||
#define CMD_EM410X_DEMOD 0x021c
|
||||
#define CMD_LF_PCF7931_READ 0x0217
|
||||
#define CMD_LF_PCF7931_WRITE 0x0223
|
||||
#define CMD_LF_EM4X_READWORD 0x0218
|
||||
#define CMD_LF_EM4X_WRITEWORD 0x0219
|
||||
#define CMD_LF_IO_DEMOD 0x021A
|
||||
#define CMD_LF_IO_CLONE 0x021B
|
||||
#define CMD_LF_EM410X_DEMOD 0x021c
|
||||
// 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
|
||||
#define CMD_PSK_SIM_TAG 0x0220
|
||||
#define CMD_AWID_DEMOD_FSK 0x0221
|
||||
#define CMD_VIKING_CLONE_TAG 0x0222
|
||||
#define CMD_T55XX_WAKEUP 0x0224
|
||||
#define CMD_COTAG 0x0225
|
||||
#define CMD_SET_LF_T55XX_CONFIG 0x0226
|
||||
#define CMD_LF_SAMPLING_SET_CONFIG 0x021d
|
||||
#define CMD_LF_FSK_SIMULATE 0x021E
|
||||
#define CMD_LF_ASK_SIMULATE 0x021F
|
||||
#define CMD_LF_PSK_SIMULATE 0x0220
|
||||
#define CMD_LF_AWID_DEMOD 0x0221
|
||||
#define CMD_LF_VIKING_CLONE 0x0222
|
||||
#define CMD_LF_T55XX_WAKEUP 0x0224
|
||||
#define CMD_LF_COTAG_READ 0x0225
|
||||
#define CMD_LF_T55XX_SET_CONFIG 0x0226
|
||||
|
||||
/* CMD_SET_ADC_MUX: ext1 is 0 for lopkd, 1 for loraw, 2 for hipkd, 3 for hiraw */
|
||||
|
||||
// For the 13.56 MHz tags
|
||||
#define CMD_ACQUIRE_RAW_ADC_SAMPLES_ISO_15693 0x0300
|
||||
#define CMD_READ_SRI_TAG 0x0303
|
||||
#define CMD_ISO_14443B_COMMAND 0x0305
|
||||
#define CMD_READER_ISO_15693 0x0310
|
||||
#define CMD_SIMTAG_ISO_15693 0x0311
|
||||
#define CMD_RECORD_RAW_ADC_SAMPLES_ISO_15693 0x0312
|
||||
#define CMD_ISO_15693_COMMAND 0x0313
|
||||
#define CMD_ISO_15693_FIND_AFI 0x0315
|
||||
#define CMD_LF_SNIFF_RAW_ADC_SAMPLES 0x0317
|
||||
#define CMD_HF_ISO15693_ACQ_RAW_ADC 0x0300
|
||||
#define CMD_HF_SRI_READ 0x0303
|
||||
#define CMD_HF_ISO14443B_COMMAND 0x0305
|
||||
#define CMD_HF_ISO15693_READER 0x0310
|
||||
#define CMD_HF_ISO15693_SIMULATE 0x0311
|
||||
#define CMD_HF_ISO15693_RAWADC 0x0312
|
||||
#define CMD_HF_ISO15693_COMMAND 0x0313
|
||||
#define CMD_HF_ISO15693_FINDAFI 0x0315
|
||||
#define CMD_LF_SNIFF_RAW_ADC 0x0317
|
||||
|
||||
// For Hitag2 transponders
|
||||
#define CMD_SNIFF_HITAG 0x0370
|
||||
#define CMD_SIMULATE_HITAG 0x0371
|
||||
#define CMD_READER_HITAG 0x0372
|
||||
#define CMD_LF_HITAG_SNIFF 0x0370
|
||||
#define CMD_LF_HITAG_SIMULATE 0x0371
|
||||
#define CMD_LF_HITAG_READER 0x0372
|
||||
|
||||
// For HitagS
|
||||
#define CMD_SIMULATE_HITAG_S 0x0368
|
||||
#define CMD_TEST_HITAGS_TRACES 0x0367
|
||||
#define CMD_READ_HITAG_S 0x0373
|
||||
#define CMD_WR_HITAG_S 0x0375
|
||||
#define CMD_LF_HITAGS_SIMULATE 0x0368
|
||||
#define CMD_LF_HITAGS_TEST_TRACES 0x0367
|
||||
#define CMD_LF_HITAGS_READ 0x0373
|
||||
#define CMD_LF_HITAGS_WRITE 0x0375
|
||||
|
||||
#define CMD_ANTIFUZZ_ISO_14443a 0x0380
|
||||
#define CMD_SIMULATE_TAG_ISO_14443B 0x0381
|
||||
#define CMD_SNIFF_ISO_14443B 0x0382
|
||||
#define CMD_SNIFF_ISO_14443a 0x0383
|
||||
#define CMD_SIMULATE_TAG_ISO_14443a 0x0384
|
||||
#define CMD_READER_ISO_14443a 0x0385
|
||||
#define CMD_HF_ISO14443A_ANTIFUZZ 0x0380
|
||||
#define CMD_HF_ISO14443B_SIMULATE 0x0381
|
||||
#define CMD_HF_ISO14443B_SNIFF 0x0382
|
||||
#define CMD_HF_ISO14443A_SNIFF 0x0383
|
||||
#define CMD_HF_ISO14443A_SIMULATE 0x0384
|
||||
#define CMD_HF_ISO14443A_READER 0x0385
|
||||
|
||||
#define CMD_SIMULATE_TAG_LEGIC_RF 0x0387
|
||||
#define CMD_READER_LEGIC_RF 0x0388
|
||||
#define CMD_WRITER_LEGIC_RF 0x0389
|
||||
#define CMD_HF_LEGIC_SIMULATE 0x0387
|
||||
#define CMD_HF_LEGIC_READER 0x0388
|
||||
#define CMD_HF_LEGIC_WRITER 0x0389
|
||||
|
||||
#define CMD_EPA_PACE_COLLECT_NONCE 0x038A
|
||||
#define CMD_EPA_PACE_REPLAY 0x038B
|
||||
#define CMD_HF_EPA_COLLECT_NONCE 0x038A
|
||||
#define CMD_HF_EPA_REPLAY 0x038B
|
||||
|
||||
#define CMD_LEGIC_INFO 0x03BC
|
||||
#define CMD_LEGIC_ESET 0x03BD
|
||||
#define CMD_HF_LEGIC_INFO 0x03BC
|
||||
#define CMD_HF_LEGIC_ESET 0x03BD
|
||||
|
||||
#define CMD_SNIFF_ICLASS 0x0392
|
||||
#define CMD_SIMULATE_TAG_ICLASS 0x0393
|
||||
#define CMD_READER_ICLASS 0x0394
|
||||
#define CMD_READER_ICLASS_REPLAY 0x0395
|
||||
#define CMD_HF_ICLASS_SNIFF 0x0392
|
||||
#define CMD_HF_ICLASS_SIMULATE 0x0393
|
||||
#define CMD_HF_ICLASS_READER 0x0394
|
||||
#define CMD_HF_ICLASS_REPLAY 0x0395
|
||||
#define CMD_ICLASS_ISO14443A_WRITE 0x0397
|
||||
#define CMD_ICLASS_EML_MEMSET 0x0398
|
||||
#define CMD_HF_ICLASS_EML_MEMSET 0x0398
|
||||
|
||||
// For measurements of the antenna tuning
|
||||
#define CMD_MEASURE_ANTENNA_TUNING 0x0400
|
||||
|
@ -166,53 +166,53 @@ typedef struct {
|
|||
|
||||
// For mifare commands
|
||||
#define CMD_MIFARE_SET_DBGMODE 0x0600
|
||||
#define CMD_MIFARE_EML_MEMCLR 0x0601
|
||||
#define CMD_MIFARE_EML_MEMSET 0x0602
|
||||
#define CMD_MIFARE_EML_MEMGET 0x0603
|
||||
#define CMD_MIFARE_EML_CARDLOAD 0x0604
|
||||
#define CMD_HF_MIFARE_EML_MEMCLR 0x0601
|
||||
#define CMD_HF_MIFARE_EML_MEMSET 0x0602
|
||||
#define CMD_HF_MIFARE_EML_MEMGET 0x0603
|
||||
#define CMD_HF_MIFARE_EML_LOAD 0x0604
|
||||
|
||||
// magic chinese card commands
|
||||
#define CMD_MIFARE_CSETBLOCK 0x0605
|
||||
#define CMD_MIFARE_CGETBLOCK 0x0606
|
||||
#define CMD_MIFARE_CIDENT 0x0607
|
||||
#define CMD_HF_MIFARE_CSETBL 0x0605
|
||||
#define CMD_HF_MIFARE_CGETBL 0x0606
|
||||
#define CMD_HF_MIFARE_CIDENT 0x0607
|
||||
|
||||
#define CMD_SIMULATE_MIFARE_CARD 0x0610
|
||||
#define CMD_HF_MIFARE_SIMULATE 0x0610
|
||||
|
||||
#define CMD_READER_MIFARE 0x0611
|
||||
#define CMD_MIFARE_NESTED 0x0612
|
||||
#define CMD_MIFARE_ACQUIRE_ENCRYPTED_NONCES 0x0613
|
||||
#define CMD_HF_MIFARE_READER 0x0611
|
||||
#define CMD_HF_MIFARE_NESTED 0x0612
|
||||
#define CMD_HF_MIFARE_ACQ_ENCRYPTED_NONCES 0x0613
|
||||
|
||||
|
||||
#define CMD_MIFARE_READBL 0x0620
|
||||
#define CMD_MIFAREU_READBL 0x0720
|
||||
#define CMD_MIFARE_READSC 0x0621
|
||||
#define CMD_MIFAREU_READCARD 0x0721
|
||||
#define CMD_MIFARE_WRITEBL 0x0622
|
||||
#define CMD_MIFAREU_WRITEBL 0x0722
|
||||
#define CMD_MIFAREU_WRITEBL_COMPAT 0x0723
|
||||
#define CMD_HF_MIFARE_READBL 0x0620
|
||||
#define CMD_HF_MIFAREU_READBL 0x0720
|
||||
#define CMD_HF_MIFARE_READSC 0x0621
|
||||
#define CMD_HF_MIFAREU_READCARD 0x0721
|
||||
#define CMD_HF_MIFARE_WRITEBL 0x0622
|
||||
#define CMD_HF_MIFAREU_WRITEBL 0x0722
|
||||
#define CMD_HF_MIFAREU_WRITEBL_COMPAT 0x0723
|
||||
|
||||
#define CMD_MIFARE_CHKKEYS 0x0623
|
||||
#define CMD_MIFARE_SETMOD 0x0624
|
||||
#define CMD_HF_MIFARE_CHKKEYS 0x0623
|
||||
#define CMD_HF_MIFARE_SETMOD 0x0624
|
||||
|
||||
#define CMD_MIFARE_SNIFFER 0x0630
|
||||
#define CMD_HF_MIFARE_SNIFF 0x0630
|
||||
//ultralightC
|
||||
#define CMD_MIFAREUC_AUTH 0x0724
|
||||
#define CMD_HF_MIFAREUC_AUTH 0x0724
|
||||
//0x0725 and 0x0726 no longer used
|
||||
#define CMD_MIFAREUC_SETPWD 0x0727
|
||||
#define CMD_HF_MIFAREUC_SETPWD 0x0727
|
||||
|
||||
|
||||
// mifare desfire
|
||||
#define CMD_MIFARE_DESFIRE_READBL 0x0728
|
||||
#define CMD_MIFARE_DESFIRE_WRITEBL 0x0729
|
||||
#define CMD_MIFARE_DESFIRE_AUTH1 0x072a
|
||||
#define CMD_MIFARE_DESFIRE_AUTH2 0x072b
|
||||
#define CMD_MIFARE_DES_READER 0x072c
|
||||
#define CMD_MIFARE_DESFIRE_INFO 0x072d
|
||||
#define CMD_MIFARE_DESFIRE 0x072e
|
||||
#define CMD_HF_DESFIRE_READBL 0x0728
|
||||
#define CMD_HF_DESFIRE_WRITEBL 0x0729
|
||||
#define CMD_HF_DESFIRE_AUTH1 0x072a
|
||||
#define CMD_HF_DESFIRE_AUTH2 0x072b
|
||||
#define CMD_HF_DESFIRE_READER 0x072c
|
||||
#define CMD_HF_DESFIRE_INFO 0x072d
|
||||
#define CMD_HF_DESFIRE_COMMAND 0x072e
|
||||
|
||||
#define CMD_MIFARE_COLLECT_NONCES 0x072f
|
||||
#define CMD_HF_MIFARE_COLLECT_NONCES 0x072f
|
||||
|
||||
#define CMD_HF_SNIFFER 0x0800
|
||||
#define CMD_HF_SNIFF 0x0800
|
||||
|
||||
#define CMD_UNKNOWN 0xFFFF
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ local Emulator = {
|
|||
function Emulator:set_mem (data, clear_first)
|
||||
if clear_first then
|
||||
-- Clear out the emulator memory first
|
||||
local memclrCmd = Command:newMIX{cmd = cmds.CMD_MIFARE_EML_MEMCLR}
|
||||
local memclrCmd = Command:newMIX{cmd = cmds.CMD_HF_MIFARE_EML_MEMCLR}
|
||||
|
||||
local _, err = memclrCmd:sendMIX()
|
||||
if err then
|
||||
|
@ -30,7 +30,7 @@ function Emulator:set_mem (data, clear_first)
|
|||
|
||||
-- arg1: start block number
|
||||
-- arg2: block count
|
||||
local memsetCmd = Command:newMIX{cmd = cmds.CMD_MIFARE_EML_MEMSET,
|
||||
local memsetCmd = Command:newMIX{cmd = cmds.CMD_HF_MIFARE_EML_MEMSET,
|
||||
data = utils.hexlify(cur_out_block),
|
||||
arg1 = i * self.BLOCK_COUNT,
|
||||
arg2 = self.BLOCK_COUNT}
|
||||
|
@ -57,7 +57,7 @@ function Emulator:get_mem (size)
|
|||
for i = 0, (size / (MAX_BLOCKS * 16)) do
|
||||
-- arg1: start block number
|
||||
-- arg2: block count (max 4)
|
||||
local getmemCmd = Command:newMIX{cmd = cmds.CMD_MIFARE_EML_MEMGET,
|
||||
local getmemCmd = Command:newMIX{cmd = cmds.CMD_HF_MIFARE_EML_MEMGET,
|
||||
arg1 = i * MAX_BLOCKS,
|
||||
arg2 = MAX_BLOCKS,
|
||||
arg3 = 0}
|
||||
|
|
|
@ -86,7 +86,7 @@ local function read14443a(dont_disconnect, no_rats)
|
|||
local command, result, info, err, data
|
||||
|
||||
command = Command:newMIX{
|
||||
cmd = cmds.CMD_READER_ISO_14443a,
|
||||
cmd = cmds.CMD_HF_ISO14443A_READER,
|
||||
arg1 = ISO14A_COMMAND.ISO14A_CONNECT
|
||||
}
|
||||
|
||||
|
@ -132,7 +132,7 @@ end
|
|||
|
||||
-- Sends an instruction to do nothing, only disconnect
|
||||
local function disconnect14443a()
|
||||
local c = Command:newMIX{cmd = cmds.CMD_READER_ISO_14443a}
|
||||
local c = Command:newMIX{cmd = cmds.CMD_HF_ISO14443A_READER}
|
||||
-- We can ignore the response here, no ACK is returned for this command
|
||||
-- Check /armsrc/iso14443a.c, ReaderIso14443a() for details
|
||||
return c:sendMIX(true)
|
||||
|
|
|
@ -70,7 +70,7 @@ local function read14443b(disconnect)
|
|||
end
|
||||
|
||||
command = Command:newMIX{
|
||||
cmd = cmds.CMD_ISO_14443B_COMMAND,
|
||||
cmd = cmds.CMD_HF_ISO14443B_COMMAND,
|
||||
arg1 = flags
|
||||
}
|
||||
|
||||
|
@ -111,13 +111,13 @@ end
|
|||
---
|
||||
-- turns on the HF field.
|
||||
local function connect14443b()
|
||||
local c = Command:newMIX{cmd = cmds.CMD_ISO_14443B_COMMAND, arg1 = ISO14B_COMMAND.ISO14B_CONNECT}
|
||||
local c = Command:newMIX{cmd = cmds.CMD_HF_ISO14443B_COMMAND, arg1 = ISO14B_COMMAND.ISO14B_CONNECT}
|
||||
return c:sendMIX(true)
|
||||
end
|
||||
---
|
||||
-- Sends an instruction to do nothing, only disconnect
|
||||
local function disconnect14443b()
|
||||
local c = Command:newMIX{cmd = cmds.CMD_ISO_14443B_COMMAND, arg1 = ISO14B_COMMAND.ISO14B_DISCONNECT}
|
||||
local c = Command:newMIX{cmd = cmds.CMD_HF_ISO14443B_COMMAND, arg1 = ISO14B_COMMAND.ISO14B_DISCONNECT}
|
||||
-- We can ignore the response here, no ACK is returned for this command
|
||||
-- Check /armsrc/iso14443b.c, ReaderIso14443b() for details
|
||||
return c:sendMIX(true)
|
||||
|
|
|
@ -95,7 +95,7 @@ local function read15693(slow, dont_readresponse)
|
|||
data = utils.Crc15("260100")
|
||||
|
||||
command = Command:newMIX{
|
||||
cmd = cmds.CMD_ISO_15693_COMMAND,
|
||||
cmd = cmds.CMD_HF_ISO15693_COMMAND,
|
||||
arg1 = #data / 2,
|
||||
arg2 = 1,
|
||||
arg3 = 1,
|
||||
|
@ -144,7 +144,7 @@ end
|
|||
|
||||
-- Sends an instruction to do nothing, only disconnect
|
||||
local function disconnect15693()
|
||||
local c = Command:newMIX{cmd = cmds.CMD_ISO_15693_COMMAND}
|
||||
local c = Command:newMIX{cmd = cmds.CMD_HF_ISO15693_COMMAND}
|
||||
-- We can ignore the response here, no ACK is returned for this command
|
||||
-- Check /armsrc/iso14443a.c, ReaderIso14443a() for details
|
||||
return c:sendMIX(true)
|
||||
|
|
|
@ -25,7 +25,7 @@ int mfDarkside(uint8_t blockno, uint8_t key_type, uint64_t *key) {
|
|||
|
||||
while (true) {
|
||||
clearCommandBuffer();
|
||||
SendCommandMIX(CMD_READER_MIFARE, arg0, blockno, key_type, NULL, 0);
|
||||
SendCommandMIX(CMD_HF_MIFARE_READER, arg0, blockno, key_type, NULL, 0);
|
||||
|
||||
//flush queue
|
||||
while (kbd_enter_pressed()) {
|
||||
|
@ -125,10 +125,10 @@ int mfCheckKeys(uint8_t blockNo, uint8_t keyType, bool clear_trace, uint8_t keyc
|
|||
data[2] = clear_trace;
|
||||
data[3] = keycnt;
|
||||
memcpy(data + 4, keyBlock, 6 * keycnt);
|
||||
SendCommandNG(CMD_MIFARE_CHKKEYS, data, (4 + 6 * keycnt));
|
||||
SendCommandNG(CMD_HF_MIFARE_CHKKEYS, data, (4 + 6 * keycnt));
|
||||
|
||||
PacketResponseNG resp;
|
||||
if (!WaitForResponseTimeout(CMD_MIFARE_CHKKEYS, &resp, 2500)) return PM3_ETIMEOUT;
|
||||
if (!WaitForResponseTimeout(CMD_HF_MIFARE_CHKKEYS, &resp, 2500)) return PM3_ETIMEOUT;
|
||||
if (resp.status != PM3_SUCCESS) return resp.status;
|
||||
|
||||
struct kr {
|
||||
|
@ -153,7 +153,7 @@ int mfCheckKeys_fast(uint8_t sectorsCnt, uint8_t firstChunk, uint8_t lastChunk,
|
|||
|
||||
// send keychunk
|
||||
clearCommandBuffer();
|
||||
SendCommandOLD(CMD_MIFARE_CHKKEYS_FAST, (sectorsCnt | (firstChunk << 8) | (lastChunk << 12)), ((use_flashmemory << 8) | strategy), size, keyBlock, 6 * size);
|
||||
SendCommandOLD(CMD_HF_MIFARE_CHKKEYS_FAST, (sectorsCnt | (firstChunk << 8) | (lastChunk << 12)), ((use_flashmemory << 8) | strategy), size, keyBlock, 6 * size);
|
||||
PacketResponseNG resp;
|
||||
|
||||
while (!WaitForResponseTimeout(CMD_ACK, &resp, 2000)) {
|
||||
|
@ -299,7 +299,7 @@ int mfnested(uint8_t blockNo, uint8_t keyType, uint8_t *key, uint8_t trgBlockNo,
|
|||
struct Crypto1State *p1, *p2, *p3, *p4;
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandOLD(CMD_MIFARE_NESTED, blockNo + keyType * 0x100, trgBlockNo + trgKeyType * 0x100, calibrate, key, 6);
|
||||
SendCommandOLD(CMD_HF_MIFARE_NESTED, blockNo + keyType * 0x100, trgBlockNo + trgKeyType * 0x100, calibrate, key, 6);
|
||||
if (!WaitForResponseTimeout(CMD_ACK, &resp, 1500)) return PM3_ETIMEOUT;
|
||||
|
||||
// error during nested
|
||||
|
@ -419,7 +419,7 @@ out:
|
|||
int mfReadSector(uint8_t sectorNo, uint8_t keyType, uint8_t *key, uint8_t *data) {
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandOLD(CMD_MIFARE_READSC, sectorNo, keyType, 0, key, 6);
|
||||
SendCommandOLD(CMD_HF_MIFARE_READSC, sectorNo, keyType, 0, key, 6);
|
||||
|
||||
PacketResponseNG resp;
|
||||
if (WaitForResponseTimeout(CMD_ACK, &resp, 1500)) {
|
||||
|
@ -456,10 +456,10 @@ int mfEmlGetMem(uint8_t *data, int blockNum, int blocksCount) {
|
|||
payload.blockcnt = blocksCount;
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_MIFARE_EML_MEMGET, (uint8_t *)&payload, sizeof(payload));
|
||||
SendCommandNG(CMD_HF_MIFARE_EML_MEMGET, (uint8_t *)&payload, sizeof(payload));
|
||||
|
||||
PacketResponseNG resp;
|
||||
if (WaitForResponseTimeout(CMD_MIFARE_EML_MEMGET, &resp, 1500) == 0) {
|
||||
if (WaitForResponseTimeout(CMD_HF_MIFARE_EML_MEMGET, &resp, 1500) == 0) {
|
||||
PrintAndLogEx(WARNING, "Command execute timeout");
|
||||
return PM3_ETIMEOUT;
|
||||
}
|
||||
|
@ -495,7 +495,7 @@ int mfEmlSetMem_xt(uint8_t *data, int blockNum, int blocksCount, int blockBtWidt
|
|||
memcpy(payload->data, data, size);
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_MIFARE_EML_MEMSET, (uint8_t *)payload, sizeof(payload) + size);
|
||||
SendCommandNG(CMD_HF_MIFARE_EML_MEMSET, (uint8_t *)payload, sizeof(payload) + size);
|
||||
return PM3_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -536,7 +536,7 @@ int mfCSetUID(uint8_t *uid, uint8_t *atqa, uint8_t *sak, uint8_t *oldUID, uint8_
|
|||
int mfCSetBlock(uint8_t blockNo, uint8_t *data, uint8_t *uid, uint8_t params) {
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandOLD(CMD_MIFARE_CSETBLOCK, params, blockNo, 0, data, 16);
|
||||
SendCommandOLD(CMD_HF_MIFARE_CSETBL, params, blockNo, 0, data, 16);
|
||||
PacketResponseNG resp;
|
||||
if (WaitForResponseTimeout(CMD_ACK, &resp, 1500)) {
|
||||
uint8_t isOK = resp.oldarg[0] & 0xff;
|
||||
|
@ -553,7 +553,7 @@ int mfCSetBlock(uint8_t blockNo, uint8_t *data, uint8_t *uid, uint8_t params) {
|
|||
|
||||
int mfCGetBlock(uint8_t blockNo, uint8_t *data, uint8_t params) {
|
||||
clearCommandBuffer();
|
||||
SendCommandMIX(CMD_MIFARE_CGETBLOCK, params, blockNo, 0, NULL, 0);
|
||||
SendCommandMIX(CMD_HF_MIFARE_CGETBL, params, blockNo, 0, NULL, 0);
|
||||
PacketResponseNG resp;
|
||||
if (WaitForResponseTimeout(CMD_ACK, &resp, 1500)) {
|
||||
uint8_t isOK = resp.oldarg[0] & 0xff;
|
||||
|
@ -905,7 +905,7 @@ int detect_classic_prng(void) {
|
|||
uint32_t flags = ISO14A_CONNECT | ISO14A_RAW | ISO14A_APPEND_CRC | ISO14A_NO_RATS;
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandMIX(CMD_READER_ISO_14443a, flags, sizeof(cmd), 0, cmd, sizeof(cmd));
|
||||
SendCommandMIX(CMD_HF_ISO14443A_READER, flags, sizeof(cmd), 0, cmd, sizeof(cmd));
|
||||
|
||||
if (!WaitForResponseTimeout(CMD_ACK, &resp, 2000)) {
|
||||
PrintAndLogEx(WARNING, "PRNG UID: Reply timeout.");
|
||||
|
@ -942,7 +942,7 @@ returns:
|
|||
int detect_classic_nackbug(bool verbose) {
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_MIFARE_NACK_DETECT, NULL, 0);
|
||||
SendCommandNG(CMD_HF_MIFARE_NACK_DETECT, NULL, 0);
|
||||
PacketResponseNG resp;
|
||||
|
||||
if (verbose)
|
||||
|
@ -955,7 +955,7 @@ int detect_classic_nackbug(bool verbose) {
|
|||
return PM3_EOPABORTED;
|
||||
}
|
||||
|
||||
if (WaitForResponseTimeout(CMD_MIFARE_NACK_DETECT, &resp, 500)) {
|
||||
if (WaitForResponseTimeout(CMD_HF_MIFARE_NACK_DETECT, &resp, 500)) {
|
||||
|
||||
if (resp.status == PM3_EOPABORTED) {
|
||||
PrintAndLogEx(WARNING, "button pressed. Aborted.");
|
||||
|
@ -1010,8 +1010,8 @@ void detect_classic_magic(void) {
|
|||
uint8_t isGeneration = 0;
|
||||
PacketResponseNG resp;
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_MIFARE_CIDENT, NULL, 0);
|
||||
if (WaitForResponseTimeout(CMD_MIFARE_CIDENT, &resp, 1500)) {
|
||||
SendCommandNG(CMD_HF_MIFARE_CIDENT, NULL, 0);
|
||||
if (WaitForResponseTimeout(CMD_HF_MIFARE_CIDENT, &resp, 1500)) {
|
||||
if (resp.status == PM3_SUCCESS)
|
||||
isGeneration = resp.data.asBytes[0];
|
||||
}
|
||||
|
|
|
@ -66,7 +66,7 @@ static int l_fast_push_mode(lua_State *L) {
|
|||
* @return
|
||||
*/
|
||||
static int l_SendCommandOLD(lua_State *L) {
|
||||
// SendCommandMIX(CMD_HF_SNIFFER, skippairs, skiptriggers, 0, NULL, 0);
|
||||
// SendCommandMIX(CMD_HF_SNIFF, skippairs, skiptriggers, 0, NULL, 0);
|
||||
// (uint64_t cmd, uint64_t arg0, uint64_t arg1, uint64_t arg2, void *data, size_t len)
|
||||
|
||||
uint64_t cmd, arg0, arg1, arg2;
|
||||
|
@ -395,7 +395,7 @@ static int l_foobar(lua_State *L) {
|
|||
printf("Arguments discarded, stack now contains %d elements", lua_gettop(L));
|
||||
|
||||
// todo: this is not used, where was it intended for?
|
||||
// PacketCommandOLD response = {CMD_MIFARE_READBL, {1337, 1338, 1339}, {{0}}};
|
||||
// PacketCommandOLD response = {CMD_HF_MIFARE_READBL, {1337, 1338, 1339}, {{0}}};
|
||||
|
||||
printf("Now returning a uint64_t as a string");
|
||||
uint64_t x = 0xDEADC0DE;
|
||||
|
|
|
@ -166,7 +166,7 @@ function sendRaw(rawdata, options)
|
|||
flags = flags + lib14a.ISO14A_COMMAND.ISO14A_APPEND_CRC
|
||||
end
|
||||
|
||||
local command = Command:newMIX{cmd = cmds.CMD_READER_ISO_14443a,
|
||||
local command = Command:newMIX{cmd = cmds.CMD_HF_ISO14443A_READER,
|
||||
arg1 = flags, -- Send raw
|
||||
-- arg2 contains the length, which is half the length
|
||||
-- of the ASCII-string rawdata
|
||||
|
|
|
@ -16,7 +16,7 @@ local luamiibo = luamiibo_open()
|
|||
local function nfc_read_amiibo ()
|
||||
|
||||
local command = Command:newMIX{
|
||||
cmd = cmds.CMD_MIFAREU_READCARD,
|
||||
cmd = cmds.CMD_HF_MIFAREU_READCARD,
|
||||
arg1 = 0,
|
||||
arg2 = 135
|
||||
}
|
||||
|
@ -90,7 +90,7 @@ local function emulate_amiibo (amiibo_data)
|
|||
|
||||
-- Begin simulating NTAG215
|
||||
local simCmd = Command:newMIX{
|
||||
cmd = cmds.CMD_SIMULATE_TAG_ISO_14443a,
|
||||
cmd = cmds.CMD_HF_ISO14443A_SIMULATE,
|
||||
arg1 = 7,
|
||||
arg2 = uid_first,
|
||||
arg3 = uid_second
|
||||
|
|
|
@ -114,7 +114,7 @@ local function calypso_send_cmd_raw(data, ignoreresponse )
|
|||
data = data or "00"
|
||||
|
||||
command = Command:newMIX{
|
||||
cmd = cmds.CMD_ISO_14443B_COMMAND,
|
||||
cmd = cmds.CMD_HF_ISO14443B_COMMAND,
|
||||
arg1 = flags,
|
||||
arg2 = #data/2, -- LEN of data, half the length of the ASCII-string hex string
|
||||
data = data} -- data bytes (commands etc)
|
||||
|
|
|
@ -475,7 +475,7 @@ local function readblock( blockno, key )
|
|||
-- Read block N
|
||||
local keytype = '00'
|
||||
local data = ('%02x%s%s'):format(blockno, keytype, key)
|
||||
local c = Command:newNG{cmd = cmds.CMD_MIFARE_READBL, data = data}
|
||||
local c = Command:newNG{cmd = cmds.CMD_HF_MIFARE_READBL, data = data}
|
||||
local b, err = getblockdata(c:sendNG(false))
|
||||
if not b then return oops(err) end
|
||||
return b
|
||||
|
|
|
@ -90,7 +90,7 @@ local function checkBlock(blockno, testkeys, keytype)
|
|||
|
||||
print(("Testing block %d, keytype %d, with %d keys"):format(blockno, keytype, chunksize))
|
||||
|
||||
local c = Command:newNG{cmd = cmds.CMD_MIFARE_CHKKEYS, data = d0..d1}
|
||||
local c = Command:newNG{cmd = cmds.CMD_HF_MIFARE_CHKKEYS, data = d0..d1}
|
||||
key, err = checkCommand(c:sendNG(false))
|
||||
|
||||
if key then return key, blockno end
|
||||
|
|
|
@ -74,7 +74,7 @@ local function sendRaw(rawdata, crc, power)
|
|||
flags = flags + lib14a.ISO14A_COMMAND.ISO14A_NO_DISCONNECT
|
||||
end
|
||||
|
||||
local command = Command:newMIX{cmd = cmds.CMD_READER_ISO_14443a,
|
||||
local command = Command:newMIX{cmd = cmds.CMD_HF_ISO14443A_READER,
|
||||
arg1 = flags, -- Send raw
|
||||
arg2 = string.len(rawdata) / 2, -- arg2 contains the length, which is half the length of the ASCII-string rawdata
|
||||
data = rawdata
|
||||
|
|
|
@ -69,7 +69,7 @@ end
|
|||
--
|
||||
-- Sends an instruction to do nothing, only disconnect
|
||||
function disconnect()
|
||||
local command = Command:newMIX{cmd = cmds.CMD_READER_ISO_14443a, arg1 = 0,}
|
||||
local command = Command:newMIX{cmd = cmds.CMD_HF_ISO14443A_READER, arg1 = 0,}
|
||||
-- We can ignore the response here, no ACK is returned for this command
|
||||
-- Check /armsrc/iso14443a.c, ReaderIso14443a() for details
|
||||
return command:sendMIX(true)
|
||||
|
@ -93,7 +93,7 @@ end
|
|||
-- @return nil, errormessage if unsuccessfull
|
||||
local function getBlock(blockno)
|
||||
local block, err
|
||||
local c = Command:newMIX{cmd = cmds.CMD_MIFAREU_READBL, arg1 = blockno, data = 0}
|
||||
local c = Command:newMIX{cmd = cmds.CMD_HF_MIFAREU_READBL, arg1 = blockno, data = 0}
|
||||
block, err = getblockdata(c:sendMIX(false))
|
||||
if not block then return oops(err) end
|
||||
|
||||
|
|
|
@ -260,7 +260,7 @@ local function test(modulation)
|
|||
|
||||
local data = ('%s%s%s%s'):format(utils.SwapEndiannessStr(p_config_cmd, 32), password, block, flags)
|
||||
|
||||
local wc = Command:newNG{cmd = cmds.CMD_T55XX_WRITE_BLOCK, data = data}
|
||||
local wc = Command:newNG{cmd = cmds.CMD_LF_T55XX_WRITEBL, data = data}
|
||||
local response, err = wc:sendNG(false, TIMEOUT)
|
||||
if not response then return oops(err) end
|
||||
|
||||
|
|
|
@ -117,7 +117,7 @@ local function test()
|
|||
dbg(('lf t55xx write b 0 d %s'):format(config))
|
||||
local data = ('%s%s%s%s'):format(utils.SwapEndiannessStr(config, 32), password, block, flags)
|
||||
|
||||
local wc = Command:newNG{cmd = cmds.CMD_T55XX_WRITE_BLOCK, data = data}
|
||||
local wc = Command:newNG{cmd = cmds.CMD_LF_T55XX_WRITEBL, data = data}
|
||||
local response, err = wc:sendNG(false, TIMEOUT)
|
||||
if not response then return oops(err) end
|
||||
|
||||
|
|
|
@ -112,7 +112,7 @@ local function test()
|
|||
|
||||
local data = ('%s%s%s%s'):format(utils.SwapEndiannessStr(config, 32), password, block, flags)
|
||||
|
||||
local wc = Command:newNG{cmd = cmds.CMD_T55XX_WRITE_BLOCK, data = data}
|
||||
local wc = Command:newNG{cmd = cmds.CMD_LF_T55XX_WRITEBL, data = data}
|
||||
local response, err = wc:sendNG(false, TIMEOUT)
|
||||
|
||||
if not response then return oops(err) end
|
||||
|
|
|
@ -113,7 +113,7 @@ local function test(modulation)
|
|||
dbg(('lf t55xx write b 0 d %s'):format(config))
|
||||
local data = ('%s%s%s%s'):format(utils.SwapEndiannessStr(config, 32), password, block, flags)
|
||||
|
||||
local wc = Command:newNG{cmd = cmds.CMD_T55XX_WRITE_BLOCK, data = data}
|
||||
local wc = Command:newNG{cmd = cmds.CMD_LF_T55XX_WRITEBL, data = data}
|
||||
local response, err = wc:sendNG(false, TIMEOUT)
|
||||
if not response then return oops(err) end
|
||||
else
|
||||
|
|
|
@ -119,7 +119,7 @@ local function test(modulation)
|
|||
|
||||
local data = ('%s%s%s%s'):format(utils.SwapEndiannessStr(config, 32), password, block, flags)
|
||||
|
||||
local wc = Command:newNG{cmd = cmds.CMD_T55XX_WRITE_BLOCK, data = data}
|
||||
local wc = Command:newNG{cmd = cmds.CMD_LF_T55XX_WRITEBL, data = data}
|
||||
local response, err = wc:sendNG(false, TIMEOUT)
|
||||
if not response then return oops(err) end
|
||||
else
|
||||
|
|
|
@ -77,7 +77,7 @@ local function readblock( blocknum, keyA )
|
|||
-- Read block N
|
||||
local keytype = '00'
|
||||
local data = ('%02x%s%s'):format(blocknum, keytype, keyA)
|
||||
local c = Command:newNG{cmd = cmds.CMD_MIFARE_READBL, data = data}
|
||||
local c = Command:newNG{cmd = cmds.CMD_HF_MIFARE_READBL, data = data}
|
||||
local b, err = getblockdata(c:sendNG(false))
|
||||
if not b then return oops(err) end
|
||||
return b
|
||||
|
@ -88,7 +88,7 @@ local function readmagicblock( blocknum )
|
|||
-- Read block N
|
||||
local CSETBLOCK_SINGLE_OPERATION = 0x1F
|
||||
local c = Command:newMIX{
|
||||
cmd = cmds.CMD_MIFARE_CGETBLOCK
|
||||
cmd = cmds.CMD_HF_MIFARE_CGETBL
|
||||
, arg1 = CSETBLOCK_SINGLE_OPERATION
|
||||
, arg3 = blocknum
|
||||
}
|
||||
|
|
|
@ -169,7 +169,7 @@ local function main(args)
|
|||
local blockno = '00'
|
||||
local keytype = '00'
|
||||
local data = ('%s%s%s'):format(blockno, keytype, keyA)
|
||||
cmd = Command:newNG{cmd = cmds.CMD_MIFARE_READBL, data = data}
|
||||
cmd = Command:newNG{cmd = cmds.CMD_HF_MIFARE_READBL, data = data}
|
||||
block0, err = getblockdata(cmd:sendNG(false))
|
||||
if not block0 then return oops(err) end
|
||||
|
||||
|
@ -179,7 +179,7 @@ local function main(args)
|
|||
dbg('Reading block 1')
|
||||
local blockno = '01'
|
||||
data = ('%s%s%s'):format(blockno, keytype, keyA)
|
||||
cmd = Command:newNG{cmd = cmds.CMD_MIFARE_READBL, data = data}
|
||||
cmd = Command:newNG{cmd = cmds.CMD_HF_MIFARE_READBL, data = data}
|
||||
block1, err = getblockdata(cmd:sendNG(false))
|
||||
if not block1 then return oops(err) end
|
||||
|
||||
|
@ -208,7 +208,7 @@ local function main(args)
|
|||
pos = (math.floor( blockNo / 4 ) * 12)+1
|
||||
key = akeys:sub(pos, pos + 11 )
|
||||
data = ('%02x%s%s'):format(blockNo, keytype, key)
|
||||
cmd = Command:newNG{cmd = cmds.CMD_MIFARE_READBL, data = data}
|
||||
cmd = Command:newNG{cmd = cmds.CMD_HF_MIFARE_READBL, data = data}
|
||||
local blockdata, err = getblockdata(cmd:sendNG(false))
|
||||
if not blockdata then return oops(err) end
|
||||
|
||||
|
|
|
@ -246,7 +246,7 @@ local function LoadEmulator(uid, blocks)
|
|||
io.write( _..',')
|
||||
io.flush()
|
||||
core.clearCommandBuffer()
|
||||
cmd = Command:newMIX{cmd = cmds.CMD_MIFARE_EML_MEMSET, arg1 = _ ,arg2 = 1,arg3 = 16, data = blockdata}
|
||||
cmd = Command:newMIX{cmd = cmds.CMD_HF_MIFARE_EML_MEMSET, arg1 = _ ,arg2 = 1,arg3 = 16, data = blockdata}
|
||||
local err, msg = cmd:sendMIX(true)
|
||||
if err == nil then return err, msg end
|
||||
end
|
||||
|
|
|
@ -96,7 +96,7 @@ function sendRaw(rawdata, options)
|
|||
+ lib14a.ISO14A_COMMAND.ISO14A_APPEND_CRC
|
||||
+ lib14a.ISO14A_COMMAND.ISO14A_NO_RATS
|
||||
|
||||
local command = Command:newMIX{cmd = cmds.CMD_READER_ISO_14443a,
|
||||
local command = Command:newMIX{cmd = cmds.CMD_HF_ISO14443A_READER,
|
||||
arg1 = flags, -- Send raw
|
||||
-- arg2 contains the length, which is half the length
|
||||
-- of the ASCII-string rawdata
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
|
||||
#ifndef DropField
|
||||
#define DropField() { \
|
||||
clearCommandBuffer(); SendCommandMIX(CMD_READER_ISO_14443a, 0, 0, 0, NULL, 0); \
|
||||
clearCommandBuffer(); SendCommandMIX(CMD_HF_ISO14443A_READER, 0, 0, 0, NULL, 0); \
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -188,7 +188,7 @@ typedef struct {
|
|||
#define CAPABILITIES_VERSION 2
|
||||
extern capabilities_t pm3_capabilities;
|
||||
|
||||
// For CMD_T55XX_WRITE_BLOCK
|
||||
// For CMD_LF_T55XX_WRITEBL
|
||||
typedef struct {
|
||||
uint32_t data;
|
||||
uint32_t pwd;
|
||||
|
@ -196,7 +196,7 @@ typedef struct {
|
|||
uint8_t flags;
|
||||
} PACKED t55xx_write_block_t;
|
||||
|
||||
// For CMD_FSK_SIM_TAG (FSK)
|
||||
// For CMD_LF_FSK_SIMULATE (FSK)
|
||||
typedef struct {
|
||||
uint8_t fchigh;
|
||||
uint8_t fclow;
|
||||
|
@ -205,7 +205,7 @@ typedef struct {
|
|||
uint8_t data[];
|
||||
} PACKED lf_fsksim_t;
|
||||
|
||||
// For CMD_ASK_SIM_TAG (ASK)
|
||||
// For CMD_LF_ASK_SIMULATE (ASK)
|
||||
typedef struct {
|
||||
uint8_t encoding;
|
||||
uint8_t invert;
|
||||
|
@ -214,7 +214,7 @@ typedef struct {
|
|||
uint8_t data[];
|
||||
} PACKED lf_asksim_t;
|
||||
|
||||
// For CMD_PSK_SIM_TAG (PSK)
|
||||
// For CMD_LF_PSK_SIMULATE (PSK)
|
||||
typedef struct {
|
||||
uint8_t carrier;
|
||||
uint8_t invert;
|
||||
|
@ -315,110 +315,110 @@ typedef struct {
|
|||
#define CMD_USART_CONFIG 0x0163
|
||||
|
||||
// For low-frequency tags
|
||||
#define CMD_READ_TI_TYPE 0x0202
|
||||
#define CMD_WRITE_TI_TYPE 0x0203
|
||||
#define CMD_ACQUIRE_RAW_ADC_SAMPLES_125K 0x0205
|
||||
#define CMD_MOD_THEN_ACQUIRE_RAW_ADC_SAMPLES_125K 0x0206
|
||||
#define CMD_LF_TI_READ 0x0202
|
||||
#define CMD_LF_TI_WRITE 0x0203
|
||||
#define CMD_LF_ACQ_RAW_ADC 0x0205
|
||||
#define CMD_LF_MOD_THEN_ACQ_RAW_ADC 0x0206
|
||||
#define CMD_DOWNLOAD_BIGBUF 0x0207
|
||||
#define CMD_DOWNLOADED_BIGBUF 0x0208
|
||||
#define CMD_UPLOAD_SIM_SAMPLES_125K 0x0209
|
||||
#define CMD_SIMULATE_TAG_125K 0x020A
|
||||
#define CMD_HID_DEMOD_FSK 0x020B
|
||||
#define CMD_HID_SIM_TAG 0x020C
|
||||
#define CMD_SET_LF_DIVISOR 0x020D
|
||||
#define CMD_LF_UPLOAD_SIM_SAMPLES 0x0209
|
||||
#define CMD_LF_SIMULATE 0x020A
|
||||
#define CMD_LF_HID_DEMOD 0x020B
|
||||
#define CMD_LF_HID_SIMULATE 0x020C
|
||||
#define CMD_LF_SET_DIVISOR 0x020D
|
||||
#define CMD_LF_SIMULATE_BIDIR 0x020E
|
||||
#define CMD_SET_ADC_MUX 0x020F
|
||||
#define CMD_HID_CLONE_TAG 0x0210
|
||||
#define CMD_EM410X_WRITE_TAG 0x0211
|
||||
#define CMD_INDALA_CLONE_TAG 0x0212
|
||||
#define CMD_LF_HID_CLONE 0x0210
|
||||
#define CMD_LF_EM410X_WRITE 0x0211
|
||||
#define CMD_LF_INDALA_CLONE 0x0212
|
||||
// for 224 bits UID
|
||||
#define CMD_INDALA_CLONE_TAG_L 0x0213
|
||||
#define CMD_T55XX_READ_BLOCK 0x0214
|
||||
#define CMD_T55XX_WRITE_BLOCK 0x0215
|
||||
#define CMD_T55XX_RESET_READ 0x0216
|
||||
#define CMD_PCF7931_READ 0x0217
|
||||
#define CMD_PCF7931_WRITE 0x0223
|
||||
#define CMD_EM4X_READ_WORD 0x0218
|
||||
#define CMD_EM4X_WRITE_WORD 0x0219
|
||||
#define CMD_IO_DEMOD_FSK 0x021A
|
||||
#define CMD_IO_CLONE_TAG 0x021B
|
||||
#define CMD_EM410X_DEMOD 0x021c
|
||||
#define CMD_LF_INDALA224_CLONE 0x0213
|
||||
#define CMD_LF_T55XX_READBL 0x0214
|
||||
#define CMD_LF_T55XX_WRITEBL 0x0215
|
||||
#define CMD_LF_T55XX_RESET_READ 0x0216
|
||||
#define CMD_LF_PCF7931_READ 0x0217
|
||||
#define CMD_LF_PCF7931_WRITE 0x0223
|
||||
#define CMD_LF_EM4X_READWORD 0x0218
|
||||
#define CMD_LF_EM4X_WRITEWORD 0x0219
|
||||
#define CMD_LF_IO_DEMOD 0x021A
|
||||
#define CMD_LF_IO_CLONE 0x021B
|
||||
#define CMD_LF_EM410X_DEMOD 0x021c
|
||||
// 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
|
||||
#define CMD_PSK_SIM_TAG 0x0220
|
||||
#define CMD_AWID_DEMOD_FSK 0x0221
|
||||
#define CMD_VIKING_CLONE_TAG 0x0222
|
||||
#define CMD_T55XX_WAKEUP 0x0224
|
||||
#define CMD_COTAG 0x0225
|
||||
#define CMD_SET_LF_T55XX_CONFIG 0x0226
|
||||
#define CMD_LF_SAMPLING_SET_CONFIG 0x021d
|
||||
#define CMD_LF_FSK_SIMULATE 0x021E
|
||||
#define CMD_LF_ASK_SIMULATE 0x021F
|
||||
#define CMD_LF_PSK_SIMULATE 0x0220
|
||||
#define CMD_LF_AWID_DEMOD 0x0221
|
||||
#define CMD_LF_VIKING_CLONE 0x0222
|
||||
#define CMD_LF_T55XX_WAKEUP 0x0224
|
||||
#define CMD_LF_COTAG_READ 0x0225
|
||||
#define CMD_LF_T55XX_SET_CONFIG 0x0226
|
||||
|
||||
#define CMD_T55XX_CHKPWDS 0x0230
|
||||
#define CMD_LF_T55XX_CHK_PWDS 0x0230
|
||||
|
||||
/* CMD_SET_ADC_MUX: ext1 is 0 for lopkd, 1 for loraw, 2 for hipkd, 3 for hiraw */
|
||||
|
||||
// For the 13.56 MHz tags
|
||||
#define CMD_ACQUIRE_RAW_ADC_SAMPLES_ISO_15693 0x0300
|
||||
#define CMD_READ_SRI_TAG 0x0303
|
||||
#define CMD_ISO_14443B_COMMAND 0x0305
|
||||
#define CMD_READER_ISO_15693 0x0310
|
||||
#define CMD_SIMTAG_ISO_15693 0x0311
|
||||
#define CMD_RECORD_RAW_ADC_SAMPLES_ISO_15693 0x0312
|
||||
#define CMD_ISO_15693_COMMAND 0x0313
|
||||
#define CMD_ISO_15693_FIND_AFI 0x0315
|
||||
#define CMD_LF_SNIFF_RAW_ADC_SAMPLES 0x0317
|
||||
#define CMD_HF_ISO15693_ACQ_RAW_ADC 0x0300
|
||||
#define CMD_HF_SRI_READ 0x0303
|
||||
#define CMD_HF_ISO14443B_COMMAND 0x0305
|
||||
#define CMD_HF_ISO15693_READER 0x0310
|
||||
#define CMD_HF_ISO15693_SIMULATE 0x0311
|
||||
#define CMD_HF_ISO15693_RAWADC 0x0312
|
||||
#define CMD_HF_ISO15693_COMMAND 0x0313
|
||||
#define CMD_HF_ISO15693_FINDAFI 0x0315
|
||||
#define CMD_LF_SNIFF_RAW_ADC 0x0317
|
||||
|
||||
// For Hitag2 transponders
|
||||
#define CMD_SNIFF_HITAG 0x0370
|
||||
#define CMD_SIMULATE_HITAG 0x0371
|
||||
#define CMD_READER_HITAG 0x0372
|
||||
#define CMD_LF_HITAG_SNIFF 0x0370
|
||||
#define CMD_LF_HITAG_SIMULATE 0x0371
|
||||
#define CMD_LF_HITAG_READER 0x0372
|
||||
|
||||
// For HitagS
|
||||
#define CMD_TEST_HITAGS_TRACES 0x0367
|
||||
#define CMD_SIMULATE_HITAG_S 0x0368
|
||||
#define CMD_READ_HITAG_S 0x0373
|
||||
#define CMD_WR_HITAG_S 0x0375
|
||||
#define CMD_LF_HITAGS_TEST_TRACES 0x0367
|
||||
#define CMD_LF_HITAGS_SIMULATE 0x0368
|
||||
#define CMD_LF_HITAGS_READ 0x0373
|
||||
#define CMD_LF_HITAGS_WRITE 0x0375
|
||||
|
||||
#define CMD_ANTIFUZZ_ISO_14443a 0x0380
|
||||
#define CMD_SIMULATE_TAG_ISO_14443B 0x0381
|
||||
#define CMD_SNIFF_ISO_14443B 0x0382
|
||||
#define CMD_HF_ISO14443A_ANTIFUZZ 0x0380
|
||||
#define CMD_HF_ISO14443B_SIMULATE 0x0381
|
||||
#define CMD_HF_ISO14443B_SNIFF 0x0382
|
||||
|
||||
#define CMD_SNIFF_ISO_14443a 0x0383
|
||||
#define CMD_SIMULATE_TAG_ISO_14443a 0x0384
|
||||
#define CMD_HF_ISO14443A_SNIFF 0x0383
|
||||
#define CMD_HF_ISO14443A_SIMULATE 0x0384
|
||||
|
||||
#define CMD_READER_ISO_14443a 0x0385
|
||||
#define CMD_HF_ISO14443A_READER 0x0385
|
||||
|
||||
#define CMD_SIMULATE_TAG_LEGIC_RF 0x0387
|
||||
#define CMD_READER_LEGIC_RF 0x0388
|
||||
#define CMD_WRITER_LEGIC_RF 0x0389
|
||||
#define CMD_HF_LEGIC_SIMULATE 0x0387
|
||||
#define CMD_HF_LEGIC_READER 0x0388
|
||||
#define CMD_HF_LEGIC_WRITER 0x0389
|
||||
|
||||
#define CMD_EPA_PACE_COLLECT_NONCE 0x038A
|
||||
#define CMD_EPA_PACE_REPLAY 0x038B
|
||||
#define CMD_HF_EPA_COLLECT_NONCE 0x038A
|
||||
#define CMD_HF_EPA_REPLAY 0x038B
|
||||
|
||||
#define CMD_LEGIC_INFO 0x03BC
|
||||
#define CMD_LEGIC_ESET 0x03BD
|
||||
#define CMD_HF_LEGIC_INFO 0x03BC
|
||||
#define CMD_HF_LEGIC_ESET 0x03BD
|
||||
|
||||
#define CMD_ICLASS_READCHECK 0x038F
|
||||
#define CMD_ICLASS_CLONE 0x0390
|
||||
#define CMD_ICLASS_DUMP 0x0391
|
||||
#define CMD_SNIFF_ICLASS 0x0392
|
||||
#define CMD_SIMULATE_TAG_ICLASS 0x0393
|
||||
#define CMD_READER_ICLASS 0x0394
|
||||
#define CMD_READER_ICLASS_REPLAY 0x0395
|
||||
#define CMD_ICLASS_READBLOCK 0x0396
|
||||
#define CMD_ICLASS_WRITEBLOCK 0x0397
|
||||
#define CMD_ICLASS_EML_MEMSET 0x0398
|
||||
#define CMD_ICLASS_AUTHENTICATION 0x0399
|
||||
#define CMD_ICLASS_CHECK_KEYS 0x039A
|
||||
#define CMD_HF_ICLASS_READCHECK 0x038F
|
||||
#define CMD_HF_ICLASS_CLONE 0x0390
|
||||
#define CMD_HF_ICLASS_DUMP 0x0391
|
||||
#define CMD_HF_ICLASS_SNIFF 0x0392
|
||||
#define CMD_HF_ICLASS_SIMULATE 0x0393
|
||||
#define CMD_HF_ICLASS_READER 0x0394
|
||||
#define CMD_HF_ICLASS_REPLAY 0x0395
|
||||
#define CMD_HF_ICLASS_READBL 0x0396
|
||||
#define CMD_HF_ICLASS_WRITEBL 0x0397
|
||||
#define CMD_HF_ICLASS_EML_MEMSET 0x0398
|
||||
#define CMD_HF_ICLASS_AUTH 0x0399
|
||||
#define CMD_HF_ICLASS_CHKKEYS 0x039A
|
||||
|
||||
// For ISO1092 / FeliCa
|
||||
#define CMD_FELICA_SIMULATE_TAG 0x03A0
|
||||
#define CMD_FELICA_SNIFF 0x03A1
|
||||
#define CMD_FELICA_COMMAND 0x03A2
|
||||
#define CMD_HF_FELICA_SIMULATE 0x03A0
|
||||
#define CMD_HF_FELICA_SNIFF 0x03A1
|
||||
#define CMD_HF_FELICA_COMMAND 0x03A2
|
||||
//temp
|
||||
#define CMD_FELICA_LITE_DUMP 0x03AA
|
||||
#define CMD_FELICA_LITE_SIM 0x03AB
|
||||
#define CMD_HF_FELICALITE_DUMP 0x03AA
|
||||
#define CMD_HF_FELICALITE_SIMULATE 0x03AB
|
||||
|
||||
// For measurements of the antenna tuning
|
||||
#define CMD_MEASURE_ANTENNA_TUNING 0x0400
|
||||
|
@ -429,58 +429,58 @@ typedef struct {
|
|||
#define CMD_FPGA_MAJOR_MODE_OFF 0x0500
|
||||
|
||||
// For mifare commands
|
||||
#define CMD_MIFARE_EML_MEMCLR 0x0601
|
||||
#define CMD_MIFARE_EML_MEMSET 0x0602
|
||||
#define CMD_MIFARE_EML_MEMGET 0x0603
|
||||
#define CMD_MIFARE_EML_CARDLOAD 0x0604
|
||||
#define CMD_HF_MIFARE_EML_MEMCLR 0x0601
|
||||
#define CMD_HF_MIFARE_EML_MEMSET 0x0602
|
||||
#define CMD_HF_MIFARE_EML_MEMGET 0x0603
|
||||
#define CMD_HF_MIFARE_EML_LOAD 0x0604
|
||||
|
||||
// magic chinese card commands
|
||||
#define CMD_MIFARE_CSETBLOCK 0x0605
|
||||
#define CMD_MIFARE_CGETBLOCK 0x0606
|
||||
#define CMD_MIFARE_CIDENT 0x0607
|
||||
#define CMD_HF_MIFARE_CSETBL 0x0605
|
||||
#define CMD_HF_MIFARE_CGETBL 0x0606
|
||||
#define CMD_HF_MIFARE_CIDENT 0x0607
|
||||
|
||||
#define CMD_SIMULATE_MIFARE_CARD 0x0610
|
||||
#define CMD_HF_MIFARE_SIMULATE 0x0610
|
||||
|
||||
#define CMD_READER_MIFARE 0x0611
|
||||
#define CMD_MIFARE_NESTED 0x0612
|
||||
#define CMD_MIFARE_ACQUIRE_ENCRYPTED_NONCES 0x0613
|
||||
#define CMD_MIFARE_ACQUIRE_NONCES 0x0614
|
||||
#define CMD_HF_MIFARE_READER 0x0611
|
||||
#define CMD_HF_MIFARE_NESTED 0x0612
|
||||
#define CMD_HF_MIFARE_ACQ_ENCRYPTED_NONCES 0x0613
|
||||
#define CMD_HF_MIFARE_ACQ_NONCES 0x0614
|
||||
|
||||
#define CMD_MIFARE_READBL 0x0620
|
||||
#define CMD_MIFAREU_READBL 0x0720
|
||||
#define CMD_MIFARE_READSC 0x0621
|
||||
#define CMD_MIFAREU_READCARD 0x0721
|
||||
#define CMD_MIFARE_WRITEBL 0x0622
|
||||
#define CMD_MIFAREU_WRITEBL 0x0722
|
||||
#define CMD_MIFAREU_WRITEBL_COMPAT 0x0723
|
||||
#define CMD_HF_MIFARE_READBL 0x0620
|
||||
#define CMD_HF_MIFAREU_READBL 0x0720
|
||||
#define CMD_HF_MIFARE_READSC 0x0621
|
||||
#define CMD_HF_MIFAREU_READCARD 0x0721
|
||||
#define CMD_HF_MIFARE_WRITEBL 0x0622
|
||||
#define CMD_HF_MIFAREU_WRITEBL 0x0722
|
||||
#define CMD_HF_MIFAREU_WRITEBL_COMPAT 0x0723
|
||||
|
||||
#define CMD_MIFARE_CHKKEYS 0x0623
|
||||
#define CMD_MIFARE_SETMOD 0x0624
|
||||
#define CMD_MIFARE_CHKKEYS_FAST 0x0625
|
||||
#define CMD_HF_MIFARE_CHKKEYS 0x0623
|
||||
#define CMD_HF_MIFARE_SETMOD 0x0624
|
||||
#define CMD_HF_MIFARE_CHKKEYS_FAST 0x0625
|
||||
|
||||
#define CMD_MIFARE_SNIFFER 0x0630
|
||||
#define CMD_HF_MIFARE_SNIFF 0x0630
|
||||
//ultralightC
|
||||
#define CMD_MIFAREUC_AUTH 0x0724
|
||||
#define CMD_HF_MIFAREUC_AUTH 0x0724
|
||||
//0x0725 and 0x0726 no longer used
|
||||
#define CMD_MIFAREUC_SETPWD 0x0727
|
||||
#define CMD_HF_MIFAREUC_SETPWD 0x0727
|
||||
|
||||
// mifare desfire
|
||||
#define CMD_MIFARE_DESFIRE_READBL 0x0728
|
||||
#define CMD_MIFARE_DESFIRE_WRITEBL 0x0729
|
||||
#define CMD_MIFARE_DESFIRE_AUTH1 0x072a
|
||||
#define CMD_MIFARE_DESFIRE_AUTH2 0x072b
|
||||
#define CMD_MIFARE_DES_READER 0x072c
|
||||
#define CMD_MIFARE_DESFIRE_INFO 0x072d
|
||||
#define CMD_MIFARE_DESFIRE 0x072e
|
||||
#define CMD_HF_DESFIRE_READBL 0x0728
|
||||
#define CMD_HF_DESFIRE_WRITEBL 0x0729
|
||||
#define CMD_HF_DESFIRE_AUTH1 0x072a
|
||||
#define CMD_HF_DESFIRE_AUTH2 0x072b
|
||||
#define CMD_HF_DESFIRE_READER 0x072c
|
||||
#define CMD_HF_DESFIRE_INFO 0x072d
|
||||
#define CMD_HF_DESFIRE_COMMAND 0x072e
|
||||
|
||||
#define CMD_MIFARE_COLLECT_NONCES 0x072f
|
||||
#define CMD_MIFARE_NACK_DETECT 0x0730
|
||||
#define CMD_HF_MIFARE_COLLECT_NONCES 0x072f
|
||||
#define CMD_HF_MIFARE_NACK_DETECT 0x0730
|
||||
|
||||
#define CMD_HF_SNIFFER 0x0800
|
||||
#define CMD_HF_SNIFF 0x0800
|
||||
|
||||
// For ThinFilm Kovio
|
||||
#define CMD_THINFILM_READ 0x0810
|
||||
#define CMD_SIMULATE_TAG_THINFILM 0x0811
|
||||
#define CMD_HF_THINFILM_READ 0x0810
|
||||
#define CMD_HF_THINFILM_SIMULATE 0x0811
|
||||
|
||||
#define CMD_UNKNOWN 0xFFFF
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue