proxmark3/client/src/cmdhf.c

431 lines
15 KiB
C
Raw Normal View History

//-----------------------------------------------------------------------------
// Copyright (C) 2010 iZsh <izsh at fail0verflow.com>
// Merlok - 2017
// Doegox - 2019
// Iceman - 2019
// Piwi - 2019
//
// This code is licensed to you under the terms of the GNU GPL, version 2 or,
// at your option, any later version. See the LICENSE.txt file for the text of
// the license.
//-----------------------------------------------------------------------------
// High frequency commands
//-----------------------------------------------------------------------------
#include "cmdhf.h"
#include <ctype.h> // tolower
#include "cmdparser.h" // command_t
2020-12-21 09:06:43 +08:00
#include "cliparser.h" // parse
#include "comms.h" // clearCommandBuffer
2020-01-13 00:13:02 +08:00
#include "lfdemod.h" // computeSignalProperties
#include "cmdhf14a.h" // ISO14443-A
#include "cmdhf14b.h" // ISO14443-B
#include "cmdhf15.h" // ISO15693
#include "cmdhfepa.h"
#include "cmdhfemrtd.h" // eMRTD
#include "cmdhflegic.h" // LEGIC
#include "cmdhficlass.h" // ICLASS
#include "cmdhfmf.h" // CLASSIC
#include "cmdhfmfu.h" // ULTRALIGHT/NTAG etc
#include "cmdhfmfp.h" // Mifare Plus
#include "cmdhfmfdes.h" // DESFIRE
#include "cmdhftopaz.h" // TOPAZ
#include "cmdhffelica.h" // ISO18092 / FeliCa
#include "cmdhffido.h" // FIDO authenticators
#include "cmdhfthinfilm.h" // Thinfilm
#include "cmdhflto.h" // LTO-CM
2020-04-06 12:17:05 +08:00
#include "cmdhfcryptorf.h" // CryptoRF
#include "cmdhfst.h" // ST rothult
#include "cmdhfwaveshare.h" // Waveshare
#include "cmdtrace.h" // trace list
#include "ui.h"
2020-05-03 06:33:28 +08:00
#include "proxgui.h"
#include "cmddata.h"
#include "graph.h"
2020-04-19 19:00:35 +08:00
#include "fpga.h"
Client cleanup and restructuring. Stage 1... Next Step is refactoring some of the giant functions which are just copy/paste of some other ones with just a few line changes, removing unnecessary 'goto' etc. The MS Windows version is broken with this commit but will be fixed soon. Everything can't be done all at once :P The commands are now hierarchical, for example: "hf 14a read" vs. "hf 14b read". You can also request help: "hf help", "data help", "hf 15 help" etc. Indents are now space-based, not tab-based anymore. Hopefully no one will be trolling about it, considering the suicide-prone work being done here ;) client/cmdhw.c, client/proxusb.c, client/cmdhw.h, client/proxusb.h, client/cmdmain.c, client/cmdlfhid.c, client/cmdmain.h, client/cmdlfhid.h, client/data.c, client/data.h, client/cmdhf.c, client/cmdlf.c, client/cmdhf.h, client/cmdhf15.c, client/cmdhf14b.c, client/cmdlf.h, client/cmdhf15.h, client/cmdhf14b.h, client/cmddata.c, client/cmddata.h, client/ui.c, client/cmdparser.c, client/cmdlfti.c, client/ui.h, client/cmdlfem4x.c, client/cmdparser.h, client/cmdlfti.h, client/cmdlfem4x.h, client/graph.c, client/graph.h, client/cmdhf14a.c, client/cmdhf14a.h, client/cmdhflegic.c, client/cmdhflegic.c: New files. client/cli.c, client/flasher.c, client/snooper.c, client/proxmark3.c, client/proxmark3.h, client/Makefile: Update accordingly. client/flash.h, client/flash.c, client/proxgui.cpp: Cosmetic changes. client/translate.h, client/command.c, client/gui.c, client/usb.c, client/prox.h: Remove. include/usb_cmd.h (CMD_ACQUIRE_RAW_ADC_SAMPLES_ISO_14443_SIM): Remove dead cmd. common/crc16.h: New file. common/crc16.c: Modify accordingly. common/iso14443crc.h: New file. common/iso14443_crc.c: Rename to common/iso14443crc.c: and modify accordingly. armsrc/lfops.c, armsrc/iso14443.c, armsrc/iso14443a.c: include .h files from the common directory instead of including the c files. common/Makefile.common, armsrc/Makefile: Modify accordingly.
2010-02-04 09:27:07 +08:00
static int CmdHelp(const char *Cmd);
int CmdHFSearch(const char *Cmd) {
2020-12-21 09:40:04 +08:00
CLIParserContext *ctx;
CLIParserInit(&ctx, "hf search",
"Will try to find a HF read out of the unknown tag.\n"
"Continues to search for all different HF protocols.",
2020-12-24 17:55:36 +08:00
"hf search"
2020-12-24 02:51:10 +08:00
);
2020-12-21 09:40:04 +08:00
void *argtable[] = {
arg_param_begin,
arg_param_end
};
CLIExecWithReturn(ctx, Cmd, argtable, true);
2020-12-24 17:55:36 +08:00
CLIParserFree(ctx);
2020-04-16 15:01:14 +08:00
int res = PM3_ESOFT;
PROMPT_CLEARLINE;
2020-06-27 05:31:32 +08:00
PrintAndLogEx(INPLACE, " Searching for ThinFilm tag...");
if (IfPm3NfcBarcode()) {
if (infoThinFilm(false) == PM3_SUCCESS) {
PrintAndLogEx(SUCCESS, "\nValid " _GREEN_("Thinfilm tag") " found\n");
res = PM3_SUCCESS;
}
}
PROMPT_CLEARLINE;
2020-06-27 05:31:32 +08:00
PrintAndLogEx(INPLACE, " Searching for LTO-CM tag...");
if (IfPm3Iso14443a()) {
if (infoLTO(false) == PM3_SUCCESS) {
PrintAndLogEx(SUCCESS, "\nValid " _GREEN_("LTO-CM tag") " found\n");
res = PM3_SUCCESS;
}
}
PROMPT_CLEARLINE;
2020-06-27 05:31:32 +08:00
PrintAndLogEx(INPLACE, " Searching for ISO14443-A tag...");
if (IfPm3Iso14443a()) {
2019-11-05 01:54:51 +08:00
if (infoHF14A(false, false, false) > 0) {
PrintAndLogEx(SUCCESS, "\nValid " _GREEN_("ISO14443-A tag") " found\n");
res = PM3_SUCCESS;
}
2019-03-10 06:35:06 +08:00
}
2019-10-21 19:46:23 +08:00
PROMPT_CLEARLINE;
2020-06-27 05:31:32 +08:00
PrintAndLogEx(INPLACE, " Searching for ISO15693 tag...");
if (IfPm3Iso15693()) {
2020-08-14 20:57:02 +08:00
if (readHF15Uid(false, false)) {
PrintAndLogEx(SUCCESS, "\nValid " _GREEN_("ISO15693 tag") " found\n");
res = PM3_SUCCESS;
}
2019-03-10 06:35:06 +08:00
}
PROMPT_CLEARLINE;
PrintAndLogEx(INPLACE, " Searching for iCLASS / PicoPass tag...");
if (IfPm3Iclass()) {
if (read_iclass_csn(false, false) == PM3_SUCCESS) {
PrintAndLogEx(SUCCESS, "\nValid " _GREEN_("iCLASS tag / PicoPass tag") " found\n");
res = PM3_SUCCESS;
}
}
PROMPT_CLEARLINE;
2020-06-27 05:31:32 +08:00
PrintAndLogEx(INPLACE, " Searching for LEGIC tag...");
if (IfPm3Legicrf()) {
if (readLegicUid(false, false) == PM3_SUCCESS) {
PrintAndLogEx(SUCCESS, "\nValid " _GREEN_("LEGIC Prime tag") " found\n");
res = PM3_SUCCESS;
}
2019-03-10 06:35:06 +08:00
}
PROMPT_CLEARLINE;
2020-06-27 05:31:32 +08:00
PrintAndLogEx(INPLACE, " Searching for Topaz tag...");
if (IfPm3Iso14443a()) {
if (readTopazUid(false) == PM3_SUCCESS) {
PrintAndLogEx(SUCCESS, "\nValid " _GREEN_("Topaz tag") " found\n");
res = PM3_SUCCESS;
}
2019-03-10 06:35:06 +08:00
}
// 14b is the longest test (put last)
PROMPT_CLEARLINE;
PrintAndLogEx(INPLACE, " Searching for ISO14443-B tag...");
if (IfPm3Iso14443b()) {
if (readHF14B(false) == 1) {
PrintAndLogEx(SUCCESS, "\nValid " _GREEN_("ISO14443-B tag") " found\n");
res = PM3_SUCCESS;
}
}
2020-09-07 16:35:09 +08:00
/*
PROMPT_CLEARLINE;
PrintAndLogEx(INPLACE, " Searching for FeliCa tag...");
if (IfPm3Felica()) {
if (readFelicaUid(false) == PM3_SUCCESS) {
PrintAndLogEx(NORMAL, "\nValid " _GREEN_("ISO18092 / FeliCa tag") " found\n");
res = PM3_SUCCESS;
}
}
2020-09-07 16:35:09 +08:00
*/
2020-04-16 15:01:14 +08:00
/*
PROMPT_CLEARLINE;
2020-06-27 05:31:32 +08:00
PrintAndLogEx(INPLACE, " Searching for CryptoRF tag...");
2020-04-16 15:01:14 +08:00
if (IfPm3Iso14443b()) {
if (readHFCryptoRF(false) == PM3_SUCCESS) {
PrintAndLogEx(SUCCESS, "\nValid " _GREEN_("CryptoRF tag") " found\n");
2020-04-16 15:01:14 +08:00
res = PM3_SUCCESS;
}
2020-04-06 12:17:05 +08:00
}
2020-04-16 15:01:14 +08:00
*/
2019-12-14 19:56:19 +08:00
PROMPT_CLEARLINE;
if (res != PM3_SUCCESS) {
PrintAndLogEx(WARNING, _RED_("No known/supported 13.56 MHz tags found"));
res = PM3_ESOFT;
}
2020-08-29 01:24:10 +08:00
2020-12-22 03:50:47 +08:00
DropField();
return res;
}
Client cleanup and restructuring. Stage 1... Next Step is refactoring some of the giant functions which are just copy/paste of some other ones with just a few line changes, removing unnecessary 'goto' etc. The MS Windows version is broken with this commit but will be fixed soon. Everything can't be done all at once :P The commands are now hierarchical, for example: "hf 14a read" vs. "hf 14b read". You can also request help: "hf help", "data help", "hf 15 help" etc. Indents are now space-based, not tab-based anymore. Hopefully no one will be trolling about it, considering the suicide-prone work being done here ;) client/cmdhw.c, client/proxusb.c, client/cmdhw.h, client/proxusb.h, client/cmdmain.c, client/cmdlfhid.c, client/cmdmain.h, client/cmdlfhid.h, client/data.c, client/data.h, client/cmdhf.c, client/cmdlf.c, client/cmdhf.h, client/cmdhf15.c, client/cmdhf14b.c, client/cmdlf.h, client/cmdhf15.h, client/cmdhf14b.h, client/cmddata.c, client/cmddata.h, client/ui.c, client/cmdparser.c, client/cmdlfti.c, client/ui.h, client/cmdlfem4x.c, client/cmdparser.h, client/cmdlfti.h, client/cmdlfem4x.h, client/graph.c, client/graph.h, client/cmdhf14a.c, client/cmdhf14a.h, client/cmdhflegic.c, client/cmdhflegic.c: New files. client/cli.c, client/flasher.c, client/snooper.c, client/proxmark3.c, client/proxmark3.h, client/Makefile: Update accordingly. client/flash.h, client/flash.c, client/proxgui.cpp: Cosmetic changes. client/translate.h, client/command.c, client/gui.c, client/usb.c, client/prox.h: Remove. include/usb_cmd.h (CMD_ACQUIRE_RAW_ADC_SAMPLES_ISO_14443_SIM): Remove dead cmd. common/crc16.h: New file. common/crc16.c: Modify accordingly. common/iso14443crc.h: New file. common/iso14443_crc.c: Rename to common/iso14443crc.c: and modify accordingly. armsrc/lfops.c, armsrc/iso14443.c, armsrc/iso14443a.c: include .h files from the common directory instead of including the c files. common/Makefile.common, armsrc/Makefile: Modify accordingly.
2010-02-04 09:27:07 +08:00
int CmdHFTune(const char *Cmd) {
2020-12-21 09:06:43 +08:00
CLIParserContext *ctx;
CLIParserInit(&ctx, "hf tune",
"Continuously measure HF antenna tuning.\n"
"Press button or <Enter> to interrupt.",
"hf tune\n"
2020-12-21 19:55:36 +08:00
"hf tune --mix"
2020-12-21 09:06:43 +08:00
);
void *argtable[] = {
arg_param_begin,
arg_u64_0("n", "iter", "<dec>", "number of iterations (default: 0=infinite)"),
arg_lit0(NULL, "bar", "bar style"),
arg_lit0(NULL, "mix", "mixed style"),
arg_lit0(NULL, "value", "values style"),
arg_param_end
};
CLIExecWithReturn(ctx, Cmd, argtable, true);
uint32_t iter = arg_get_u32_def(ctx, 1, 0);
bool is_bar = arg_get_lit(ctx, 2);
bool is_mix = arg_get_lit(ctx, 3);
bool is_value = arg_get_lit(ctx, 4);
CLIParserFree(ctx);
if ((is_bar + is_mix + is_value) > 1) {
PrintAndLogEx(ERR, "Select only one output style");
return PM3_EINVARG;
}
barMode_t style = session.bar_mode;
if (is_bar)
style = STYLE_BAR;
if (is_mix)
style = STYLE_MIXED;
if (is_value)
style = STYLE_VALUE;
PrintAndLogEx(INFO, "Measuring HF antenna, click " _GREEN_("pm3 button") " or press " _GREEN_("Enter") " to exit");
PacketResponseNG resp;
clearCommandBuffer();
2020-02-24 16:44:48 +08:00
2019-05-14 14:25:26 +08:00
uint8_t mode[] = {1};
SendCommandNG(CMD_MEASURE_ANTENNA_TUNING_HF, mode, sizeof(mode));
if (!WaitForResponseTimeout(CMD_MEASURE_ANTENNA_TUNING_HF, &resp, 1000)) {
2019-05-14 14:25:26 +08:00
PrintAndLogEx(WARNING, "Timeout while waiting for Proxmark HF initialization, aborting");
return PM3_ETIMEOUT;
}
2020-02-24 16:44:48 +08:00
2019-05-14 14:25:26 +08:00
mode[0] = 2;
2020-12-21 09:06:43 +08:00
uint32_t max = 0xFFFF;
bool first = true;
2020-12-23 08:12:35 +08:00
print_progress(0, max, style);
2020-12-21 09:06:43 +08:00
2019-05-14 14:25:26 +08:00
// loop forever (till button pressed) if iter = 0 (default)
2019-05-14 23:42:17 +08:00
for (uint8_t i = 0; iter == 0 || i < iter; i++) {
2020-02-24 16:44:48 +08:00
if (kbd_enter_pressed()) {
break;
}
2020-02-24 16:44:48 +08:00
2019-05-14 14:25:26 +08:00
SendCommandNG(CMD_MEASURE_ANTENNA_TUNING_HF, mode, sizeof(mode));
if (!WaitForResponseTimeout(CMD_MEASURE_ANTENNA_TUNING_HF, &resp, 1000)) {
2020-02-24 16:44:48 +08:00
PrintAndLogEx(NORMAL, "");
PrintAndLogEx(WARNING, "Timeout while waiting for Proxmark HF measure, aborting");
2020-12-21 09:06:43 +08:00
break;
}
2020-02-24 16:44:48 +08:00
if ((resp.status == PM3_EOPABORTED) || (resp.length != sizeof(uint16_t))) {
2020-12-21 09:06:43 +08:00
PrintAndLogEx(NORMAL, "");
break;
2020-02-24 16:44:48 +08:00
}
2019-08-07 18:58:25 +08:00
uint16_t volt = resp.data.asDwords[0] & 0xFFFF;
2020-12-21 09:06:43 +08:00
if (first) {
max = (volt * 1.03);
first = false;
}
2020-12-24 02:51:10 +08:00
if (volt > max) {
2020-12-21 09:06:43 +08:00
max = (volt * 1.03);
}
print_progress(volt, max, style);
}
2019-05-14 14:25:26 +08:00
mode[0] = 3;
2020-02-24 16:44:48 +08:00
2019-05-14 14:25:26 +08:00
SendCommandNG(CMD_MEASURE_ANTENNA_TUNING_HF, mode, sizeof(mode));
if (!WaitForResponseTimeout(CMD_MEASURE_ANTENNA_TUNING_HF, &resp, 1000)) {
2019-05-14 14:25:26 +08:00
PrintAndLogEx(WARNING, "Timeout while waiting for Proxmark HF shutdown, aborting");
return PM3_ETIMEOUT;
}
2020-12-21 09:06:43 +08:00
PrintAndLogEx(NORMAL, "\x1b%c[2K\r", 30);
2020-03-16 05:41:05 +08:00
PrintAndLogEx(INFO, "Done.");
return PM3_SUCCESS;
}
2020-06-20 00:34:47 +08:00
// Collects pars of u8,
// uses 16bit transfers from FPGA for speed
// Takes all available bigbuff memory
// data sample to download? Not sure what we can do with the data.
int CmdHFSniff(const char *Cmd) {
2020-12-21 09:06:43 +08:00
CLIParserContext *ctx;
CLIParserInit(&ctx, "hf sniff",
2020-12-21 09:40:04 +08:00
"The high frequency sniffer will assign all available memory on device for sniffed data.\n"
2020-12-21 09:06:43 +08:00
"Use `data samples` to download from device and `data plot` to visualize it.\n"
"Press button to quit the sniffing.",
"hf sniff\n"
"hf sniff --sp 1000 --st 0 -> skip 1000 pairs, skip 0 triggers"
2020-12-24 02:51:10 +08:00
);
2020-12-21 09:06:43 +08:00
void *argtable[] = {
arg_param_begin,
arg_u64_0(NULL, "sp", "<dec>", "skip sample pairs"),
arg_u64_0(NULL, "st", "<dec>", "skip number of triggers"),
arg_param_end
};
CLIExecWithReturn(ctx, Cmd, argtable, true);
struct {
uint32_t samplesToSkip;
uint32_t triggersToSkip;
} PACKED params;
2020-12-21 09:06:43 +08:00
params.samplesToSkip = arg_get_u32_def(ctx, 1, 0);
params.triggersToSkip = arg_get_u32_def(ctx, 2, 0);
CLIParserFree(ctx);
2019-03-10 06:35:06 +08:00
clearCommandBuffer();
2020-06-20 00:34:47 +08:00
SendCommandNG(CMD_HF_SNIFF, (uint8_t *)&params, sizeof(params));
for (;;) {
if (kbd_enter_pressed()) {
SendCommandNG(CMD_BREAK_LOOP, NULL, 0);
PrintAndLogEx(INFO, "User aborted");
break;
}
PacketResponseNG resp;
if (WaitForResponseTimeout(CMD_HF_SNIFF, &resp, 1000)) {
if (resp.status == PM3_EOPABORTED) {
PrintAndLogEx(INFO, "Button pressed, user aborted");
break;
}
if (resp.status == PM3_SUCCESS) {
struct r {
uint16_t len;
} PACKED;
struct r *retval = (struct r *)resp.data.asBytes;
2020-08-13 18:25:04 +08:00
PrintAndLogEx(INFO, "HF sniff (%u samples)", retval->len);
PrintAndLogEx(HINT, "Use `" _YELLOW_("data hpf") "` to remove offset");
PrintAndLogEx(HINT, "Use `" _YELLOW_("data plot") "` to view");
PrintAndLogEx(HINT, "Use `" _YELLOW_("data save") "` to save");
2020-06-20 00:34:47 +08:00
2020-08-13 18:25:04 +08:00
// download bigbuf_malloc:d.
// it reserve memory from the higher end.
2020-08-13 18:25:04 +08:00
// At the moment, sniff takes all free memory in bigbuff. If this changes,
// we can't start from beginning idx 0 but from that hi-to-start-of-allocated.
uint32_t start = pm3_capabilities.bigbuf_size - retval->len;
int res = getSamplesEx(start, start, false);
if (res != PM3_SUCCESS) {
PrintAndLogEx(WARNING, "failed to download samples to client");
return res;
}
break;
}
}
}
PrintAndLogEx(INFO, "Done.");
return PM3_SUCCESS;
}
2020-10-24 17:56:47 +08:00
int handle_hf_plot(void) {
2020-11-02 08:46:47 +08:00
2020-01-13 00:28:12 +08:00
uint8_t buf[FPGA_TRACE_SIZE];
PacketResponseNG response;
if (!GetFromDevice(FPGA_MEM, buf, FPGA_TRACE_SIZE, 0, NULL, 0, &response, 4000, true)) {
PrintAndLogEx(WARNING, "timeout while waiting for reply.");
return PM3_ETIMEOUT;
}
for (size_t i = 0; i < FPGA_TRACE_SIZE; i++) {
2020-10-24 17:56:47 +08:00
GraphBuffer[i] = ((int)buf[i]) - 128;
}
GraphTraceLen = FPGA_TRACE_SIZE;
2020-01-13 00:13:02 +08:00
ShowGraphWindow();
2020-01-13 00:13:02 +08:00
// remove signal offset
CmdHpf("");
setClockGrid(0, 0);
DemodBufferLen = 0;
RepaintGraphWindow();
2020-01-13 00:28:12 +08:00
return PM3_SUCCESS;
}
2020-10-24 17:56:47 +08:00
int CmdHFPlot(const char *Cmd) {
CLIParserContext *ctx;
CLIParserInit(&ctx, "hf plot",
"Plots HF signal after RF signal path and A/D conversion.",
"This can be used after any hf command and will show the last few milliseconds of the HF signal.\n"
"Note: If the last hf command terminated because of a timeout you will most probably see nothing.\n");
void *argtable[] = {
arg_param_begin,
arg_param_end
};
CLIExecWithReturn(ctx, Cmd, argtable, true);
CLIParserFree(ctx);
return handle_hf_plot();
}
static command_t CommandTable[] = {
2020-11-02 08:46:47 +08:00
2020-10-23 04:16:44 +08:00
{"--------", CmdHelp, AlwaysAvailable, "----------------------- " _CYAN_("High Frequency") " -----------------------"},
{"14a", CmdHF14A, AlwaysAvailable, "{ ISO14443A RFIDs... }"},
{"14b", CmdHF14B, AlwaysAvailable, "{ ISO14443B RFIDs... }"},
{"15", CmdHF15, AlwaysAvailable, "{ ISO15693 RFIDs... }"},
// {"cryptorf", CmdHFCryptoRF, AlwaysAvailable, "{ CryptoRF RFIDs... }"},
{"epa", CmdHFEPA, AlwaysAvailable, "{ German Identification Card... }"},
{"emrtd", CmdHFeMRTD, AlwaysAvailable, "{ Machine Readable Travel Document... }"},
{"felica", CmdHFFelica, AlwaysAvailable, "{ ISO18092 / FeliCa RFIDs... }"},
{"fido", CmdHFFido, AlwaysAvailable, "{ FIDO and FIDO2 authenticators... }"},
{"iclass", CmdHFiClass, AlwaysAvailable, "{ ICLASS RFIDs... }"},
{"legic", CmdHFLegic, AlwaysAvailable, "{ LEGIC RFIDs... }"},
{"lto", CmdHFLTO, AlwaysAvailable, "{ LTO Cartridge Memory RFIDs... }"},
{"mf", CmdHFMF, AlwaysAvailable, "{ MIFARE RFIDs... }"},
{"mfp", CmdHFMFP, AlwaysAvailable, "{ MIFARE Plus RFIDs... }"},
{"mfu", CmdHFMFUltra, AlwaysAvailable, "{ MIFARE Ultralight RFIDs... }"},
{"mfdes", CmdHFMFDes, AlwaysAvailable, "{ MIFARE Desfire RFIDs... }"},
{"st", CmdHF_ST, AlwaysAvailable, "{ ST Rothult RFIDs... }"},
{"thinfilm", CmdHFThinfilm, AlwaysAvailable, "{ Thinfilm RFIDs... }"},
{"topaz", CmdHFTopaz, AlwaysAvailable, "{ TOPAZ (NFC Type 1) RFIDs... }"},
{"waveshare", CmdHFWaveshare, AlwaysAvailable, "{ Waveshare NFC ePaper... }"},
2020-11-02 08:46:47 +08:00
{"-----------", CmdHelp, AlwaysAvailable, "--------------------- " _CYAN_("General") " ---------------------"},
2020-10-23 04:16:44 +08:00
{"help", CmdHelp, AlwaysAvailable, "This help"},
{"list", CmdTraceList, AlwaysAvailable, "List protocol data in trace buffer"},
{"plot", CmdHFPlot, IfPm3Hfplot, "Plot signal"},
{"tune", CmdHFTune, IfPm3Present, "Continuously measure HF antenna tuning"},
{"search", CmdHFSearch, AlwaysAvailable, "Search for known HF tags"},
{"sniff", CmdHFSniff, IfPm3Hfsniff, "<samples to skip (10000)> <triggers to skip (1)> Generic HF Sniff"},
{NULL, NULL, NULL, NULL}
Client cleanup and restructuring. Stage 1... Next Step is refactoring some of the giant functions which are just copy/paste of some other ones with just a few line changes, removing unnecessary 'goto' etc. The MS Windows version is broken with this commit but will be fixed soon. Everything can't be done all at once :P The commands are now hierarchical, for example: "hf 14a read" vs. "hf 14b read". You can also request help: "hf help", "data help", "hf 15 help" etc. Indents are now space-based, not tab-based anymore. Hopefully no one will be trolling about it, considering the suicide-prone work being done here ;) client/cmdhw.c, client/proxusb.c, client/cmdhw.h, client/proxusb.h, client/cmdmain.c, client/cmdlfhid.c, client/cmdmain.h, client/cmdlfhid.h, client/data.c, client/data.h, client/cmdhf.c, client/cmdlf.c, client/cmdhf.h, client/cmdhf15.c, client/cmdhf14b.c, client/cmdlf.h, client/cmdhf15.h, client/cmdhf14b.h, client/cmddata.c, client/cmddata.h, client/ui.c, client/cmdparser.c, client/cmdlfti.c, client/ui.h, client/cmdlfem4x.c, client/cmdparser.h, client/cmdlfti.h, client/cmdlfem4x.h, client/graph.c, client/graph.h, client/cmdhf14a.c, client/cmdhf14a.h, client/cmdhflegic.c, client/cmdhflegic.c: New files. client/cli.c, client/flasher.c, client/snooper.c, client/proxmark3.c, client/proxmark3.h, client/Makefile: Update accordingly. client/flash.h, client/flash.c, client/proxgui.cpp: Cosmetic changes. client/translate.h, client/command.c, client/gui.c, client/usb.c, client/prox.h: Remove. include/usb_cmd.h (CMD_ACQUIRE_RAW_ADC_SAMPLES_ISO_14443_SIM): Remove dead cmd. common/crc16.h: New file. common/crc16.c: Modify accordingly. common/iso14443crc.h: New file. common/iso14443_crc.c: Rename to common/iso14443crc.c: and modify accordingly. armsrc/lfops.c, armsrc/iso14443.c, armsrc/iso14443a.c: include .h files from the common directory instead of including the c files. common/Makefile.common, armsrc/Makefile: Modify accordingly.
2010-02-04 09:27:07 +08:00
};
int CmdHF(const char *Cmd) {
2019-03-10 06:35:06 +08:00
clearCommandBuffer();
2019-04-19 06:47:51 +08:00
return CmdsParse(CommandTable, Cmd);
Client cleanup and restructuring. Stage 1... Next Step is refactoring some of the giant functions which are just copy/paste of some other ones with just a few line changes, removing unnecessary 'goto' etc. The MS Windows version is broken with this commit but will be fixed soon. Everything can't be done all at once :P The commands are now hierarchical, for example: "hf 14a read" vs. "hf 14b read". You can also request help: "hf help", "data help", "hf 15 help" etc. Indents are now space-based, not tab-based anymore. Hopefully no one will be trolling about it, considering the suicide-prone work being done here ;) client/cmdhw.c, client/proxusb.c, client/cmdhw.h, client/proxusb.h, client/cmdmain.c, client/cmdlfhid.c, client/cmdmain.h, client/cmdlfhid.h, client/data.c, client/data.h, client/cmdhf.c, client/cmdlf.c, client/cmdhf.h, client/cmdhf15.c, client/cmdhf14b.c, client/cmdlf.h, client/cmdhf15.h, client/cmdhf14b.h, client/cmddata.c, client/cmddata.h, client/ui.c, client/cmdparser.c, client/cmdlfti.c, client/ui.h, client/cmdlfem4x.c, client/cmdparser.h, client/cmdlfti.h, client/cmdlfem4x.h, client/graph.c, client/graph.h, client/cmdhf14a.c, client/cmdhf14a.h, client/cmdhflegic.c, client/cmdhflegic.c: New files. client/cli.c, client/flasher.c, client/snooper.c, client/proxmark3.c, client/proxmark3.h, client/Makefile: Update accordingly. client/flash.h, client/flash.c, client/proxgui.cpp: Cosmetic changes. client/translate.h, client/command.c, client/gui.c, client/usb.c, client/prox.h: Remove. include/usb_cmd.h (CMD_ACQUIRE_RAW_ADC_SAMPLES_ISO_14443_SIM): Remove dead cmd. common/crc16.h: New file. common/crc16.c: Modify accordingly. common/iso14443crc.h: New file. common/iso14443_crc.c: Rename to common/iso14443crc.c: and modify accordingly. armsrc/lfops.c, armsrc/iso14443.c, armsrc/iso14443a.c: include .h files from the common directory instead of including the c files. common/Makefile.common, armsrc/Makefile: Modify accordingly.
2010-02-04 09:27:07 +08:00
}
int CmdHelp(const char *Cmd) {
2019-04-10 18:23:40 +08:00
(void)Cmd; // Cmd is not used so far
2019-03-10 06:35:06 +08:00
CmdsHelp(CommandTable);
return PM3_SUCCESS;
Client cleanup and restructuring. Stage 1... Next Step is refactoring some of the giant functions which are just copy/paste of some other ones with just a few line changes, removing unnecessary 'goto' etc. The MS Windows version is broken with this commit but will be fixed soon. Everything can't be done all at once :P The commands are now hierarchical, for example: "hf 14a read" vs. "hf 14b read". You can also request help: "hf help", "data help", "hf 15 help" etc. Indents are now space-based, not tab-based anymore. Hopefully no one will be trolling about it, considering the suicide-prone work being done here ;) client/cmdhw.c, client/proxusb.c, client/cmdhw.h, client/proxusb.h, client/cmdmain.c, client/cmdlfhid.c, client/cmdmain.h, client/cmdlfhid.h, client/data.c, client/data.h, client/cmdhf.c, client/cmdlf.c, client/cmdhf.h, client/cmdhf15.c, client/cmdhf14b.c, client/cmdlf.h, client/cmdhf15.h, client/cmdhf14b.h, client/cmddata.c, client/cmddata.h, client/ui.c, client/cmdparser.c, client/cmdlfti.c, client/ui.h, client/cmdlfem4x.c, client/cmdparser.h, client/cmdlfti.h, client/cmdlfem4x.h, client/graph.c, client/graph.h, client/cmdhf14a.c, client/cmdhf14a.h, client/cmdhflegic.c, client/cmdhflegic.c: New files. client/cli.c, client/flasher.c, client/snooper.c, client/proxmark3.c, client/proxmark3.h, client/Makefile: Update accordingly. client/flash.h, client/flash.c, client/proxgui.cpp: Cosmetic changes. client/translate.h, client/command.c, client/gui.c, client/usb.c, client/prox.h: Remove. include/usb_cmd.h (CMD_ACQUIRE_RAW_ADC_SAMPLES_ISO_14443_SIM): Remove dead cmd. common/crc16.h: New file. common/crc16.c: Modify accordingly. common/iso14443crc.h: New file. common/iso14443_crc.c: Rename to common/iso14443crc.c: and modify accordingly. armsrc/lfops.c, armsrc/iso14443.c, armsrc/iso14443a.c: include .h files from the common directory instead of including the c files. common/Makefile.common, armsrc/Makefile: Modify accordingly.
2010-02-04 09:27:07 +08:00
}