mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-20 13:23:51 -07:00
style
This commit is contained in:
parent
b5ecdde19e
commit
7f40ad7f9d
11 changed files with 183 additions and 102 deletions
|
@ -225,7 +225,7 @@ static int bitstream_target_to_index(FPGA_config bitstream_target) {
|
||||||
static int8_t bitstream_index_map[FPGA_BITSTREAM_MAX] = {-1};
|
static int8_t bitstream_index_map[FPGA_BITSTREAM_MAX] = {-1};
|
||||||
|
|
||||||
// Initialize
|
// Initialize
|
||||||
if (bitstream_index_map[0] == -1){
|
if (bitstream_index_map[0] == -1) {
|
||||||
bitstream_index_map[0] = 0;
|
bitstream_index_map[0] = 0;
|
||||||
|
|
||||||
for (size_t i = 0; i < g_fpga_bitstream_num; i++) {
|
for (size_t i = 0; i < g_fpga_bitstream_num; i++) {
|
||||||
|
|
|
@ -419,7 +419,7 @@ static int CmdHf14AConfig(const char *Cmd) {
|
||||||
return hf14a_setconfig(&config, verbose);
|
return hf14a_setconfig(&config, verbose);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char* get_uid_type(iso14a_card_select_t *card) {
|
static const char *get_uid_type(iso14a_card_select_t *card) {
|
||||||
|
|
||||||
static char s[60] = {0};
|
static char s[60] = {0};
|
||||||
memset(s, 0, sizeof(s));
|
memset(s, 0, sizeof(s));
|
||||||
|
|
|
@ -2770,10 +2770,10 @@ static int CmdHF14AMfUWrBl(const char *Cmd) {
|
||||||
int res = 0;
|
int res = 0;
|
||||||
if (datalen == 16) {
|
if (datalen == 16) {
|
||||||
// Comp write may take 16bytes, but only write 4bytes. See UL-C datasheet
|
// Comp write may take 16bytes, but only write 4bytes. See UL-C datasheet
|
||||||
for (uint8_t i = 0; i < 4; i++ ) {
|
for (uint8_t i = 0; i < 4; i++) {
|
||||||
|
|
||||||
res = mfu_write_block(d, 4, has_auth_key, has_pwd, auth_key_ptr, blockno + i);
|
res = mfu_write_block(d, 4, has_auth_key, has_pwd, auth_key_ptr, blockno + i);
|
||||||
if ( res == PM3_SUCCESS) {
|
if (res == PM3_SUCCESS) {
|
||||||
d += 4;
|
d += 4;
|
||||||
} else {
|
} else {
|
||||||
PrintAndLogEx(INFO, "Write ( %s )", _RED_("fail"));
|
PrintAndLogEx(INFO, "Write ( %s )", _RED_("fail"));
|
||||||
|
|
|
@ -292,8 +292,10 @@ static int CmdLFHitagSList(const char *Cmd) {
|
||||||
static command_t CommandTable[] = {
|
static command_t CommandTable[] = {
|
||||||
{"help", CmdHelp, AlwaysAvailable, "This help"},
|
{"help", CmdHelp, AlwaysAvailable, "This help"},
|
||||||
{"list", CmdLFHitagSList, AlwaysAvailable, "List Hitag S trace history"},
|
{"list", CmdLFHitagSList, AlwaysAvailable, "List Hitag S trace history"},
|
||||||
{"-----------", CmdHelp, IfPm3Hitag, "----------------------- " _CYAN_(
|
{
|
||||||
"General") " ------------------------"},
|
"-----------", CmdHelp, IfPm3Hitag, "----------------------- " _CYAN_(
|
||||||
|
"General") " ------------------------"
|
||||||
|
},
|
||||||
{"read", CmdLFHitagSRead, IfPm3Hitag, "Read Hitag S memory"},
|
{"read", CmdLFHitagSRead, IfPm3Hitag, "Read Hitag S memory"},
|
||||||
{"write", CmdLFHitagSWrite, IfPm3Hitag, "Write Hitag S page"},
|
{"write", CmdLFHitagSWrite, IfPm3Hitag, "Write Hitag S page"},
|
||||||
{NULL, NULL, 0, NULL}
|
{NULL, NULL, 0, NULL}
|
||||||
|
@ -325,8 +327,10 @@ hitags_config_t hitags_config_unpack(const uint8_t *config_bytes) {
|
||||||
|
|
||||||
void hitags_config_print(hitags_config_t config) {
|
void hitags_config_print(hitags_config_t config) {
|
||||||
PrintAndLogEx(INFO, " Memory type...... " _GREEN_("%s"),
|
PrintAndLogEx(INFO, " Memory type...... " _GREEN_("%s"),
|
||||||
(const char *[]) {"Hitag S 32", "Hitag S 256", "Hitag S 2048",
|
(const char *[]) {
|
||||||
"Unknown Hitag S/8211"}[config.memory_type]);
|
"Hitag S 32", "Hitag S 256", "Hitag S 2048",
|
||||||
|
"Unknown Hitag S/8211"
|
||||||
|
}[config.memory_type]);
|
||||||
|
|
||||||
PrintAndLogEx(INFO, " Authenticaion.... %s", config.authentication ? _YELLOW_("Yes") : "No");
|
PrintAndLogEx(INFO, " Authenticaion.... %s", config.authentication ? _YELLOW_("Yes") : "No");
|
||||||
|
|
||||||
|
@ -334,12 +338,16 @@ void hitags_config_print(hitags_config_t config) {
|
||||||
(const char *[]) {"Manchester", "Biphase"}[config.ttf_coding]);
|
(const char *[]) {"Manchester", "Biphase"}[config.ttf_coding]);
|
||||||
|
|
||||||
PrintAndLogEx(INFO, " TTF data rate.... %s",
|
PrintAndLogEx(INFO, " TTF data rate.... %s",
|
||||||
(const char *[]) {"4 kBit", "8 kBit", "2 kBit",
|
(const char *[]) {
|
||||||
"2 kBit and Pigeon Race Standard"}[config.ttf_data_rate]);
|
"4 kBit", "8 kBit", "2 kBit",
|
||||||
|
"2 kBit and Pigeon Race Standard"
|
||||||
|
}[config.ttf_data_rate]);
|
||||||
|
|
||||||
PrintAndLogEx(INFO, " TTF mode......... %s",
|
PrintAndLogEx(INFO, " TTF mode......... %s",
|
||||||
(const char *[]) {"TTF Mode disabled (= RTF Mode)", "Page 4, Page 5",
|
(const char *[]) {
|
||||||
"Page 4, Page 5, Page 6, Page 7", "Page 4"}[config.ttf_mode]);
|
"TTF Mode disabled (= RTF Mode)", "Page 4, Page 5",
|
||||||
|
"Page 4, Page 5, Page 6, Page 7", "Page 4"
|
||||||
|
}[config.ttf_mode]);
|
||||||
|
|
||||||
PrintAndLogEx(INFO, " Config locked.... %s", config.lock_config ? _RED_("Yes") : _GREEN_("No"));
|
PrintAndLogEx(INFO, " Config locked.... %s", config.lock_config ? _RED_("Yes") : _GREEN_("No"));
|
||||||
PrintAndLogEx(INFO, " Key/PWD locked... %s", config.lock_key ? _RED_("Yes") : _GREEN_("No"));
|
PrintAndLogEx(INFO, " Key/PWD locked... %s", config.lock_key ? _RED_("Yes") : _GREEN_("No"));
|
||||||
|
|
|
@ -2519,7 +2519,7 @@ static int CmdT55xxDump(const char *Cmd) {
|
||||||
arg_str0("f", "file", "<fn>", "filename (default is generated on blk 0)"),
|
arg_str0("f", "file", "<fn>", "filename (default is generated on blk 0)"),
|
||||||
arg_lit0("o", "override", "override, force pwd read despite danger to card"),
|
arg_lit0("o", "override", "override, force pwd read despite danger to card"),
|
||||||
arg_str0("p", "pwd", "<hex>", "password (4 hex bytes)"),
|
arg_str0("p", "pwd", "<hex>", "password (4 hex bytes)"),
|
||||||
arg_lit0(NULL, "ns", "no save"),
|
arg_lit0(NULL, "ns", "no save to file"),
|
||||||
};
|
};
|
||||||
uint8_t idx = 5;
|
uint8_t idx = 5;
|
||||||
arg_add_t55xx_downloadlink(argtable, &idx, T55XX_DLMODE_SINGLE, T55XX_DLMODE_SINGLE);
|
arg_add_t55xx_downloadlink(argtable, &idx, T55XX_DLMODE_SINGLE, T55XX_DLMODE_SINGLE);
|
||||||
|
|
|
@ -669,6 +669,10 @@ const static vocabulary_t vocabulary[] = {
|
||||||
{ 0, "lf hitag chk" },
|
{ 0, "lf hitag chk" },
|
||||||
{ 1, "lf hitag lookup" },
|
{ 1, "lf hitag lookup" },
|
||||||
{ 0, "lf hitag ta" },
|
{ 0, "lf hitag ta" },
|
||||||
|
{ 1, "lf hitag hts help" },
|
||||||
|
{ 1, "lf hitag hts list" },
|
||||||
|
{ 0, "lf hitag hts read" },
|
||||||
|
{ 0, "lf hitag hts write" },
|
||||||
{ 1, "lf idteck help" },
|
{ 1, "lf idteck help" },
|
||||||
{ 1, "lf idteck demod" },
|
{ 1, "lf idteck demod" },
|
||||||
{ 0, "lf idteck reader" },
|
{ 0, "lf idteck reader" },
|
||||||
|
|
|
@ -33,8 +33,7 @@
|
||||||
#define FPGA_TRACE_SIZE 3072
|
#define FPGA_TRACE_SIZE 3072
|
||||||
|
|
||||||
// definitions for multiple FPGA config files support
|
// definitions for multiple FPGA config files support
|
||||||
typedef enum
|
typedef enum {
|
||||||
{
|
|
||||||
FPGA_BITSTREAM_UNKNOWN = 0,
|
FPGA_BITSTREAM_UNKNOWN = 0,
|
||||||
FPGA_BITSTREAM_LF = 1,
|
FPGA_BITSTREAM_LF = 1,
|
||||||
FPGA_BITSTREAM_HF,
|
FPGA_BITSTREAM_HF,
|
||||||
|
@ -43,8 +42,7 @@ typedef enum
|
||||||
FPGA_BITSTREAM_MAX = FPGA_BITSTREAM_HF_15,
|
FPGA_BITSTREAM_MAX = FPGA_BITSTREAM_HF_15,
|
||||||
} FPGA_config;
|
} FPGA_config;
|
||||||
|
|
||||||
typedef struct
|
typedef struct {
|
||||||
{
|
|
||||||
const char *const versionString;
|
const char *const versionString;
|
||||||
const FPGA_config target_config;
|
const FPGA_config target_config;
|
||||||
} FPGA_VERSION_INFORMATION;
|
} FPGA_VERSION_INFORMATION;
|
||||||
|
|
|
@ -4253,11 +4253,11 @@
|
||||||
"--slow Slower acquisition (required by some non standard cards)",
|
"--slow Slower acquisition (required by some non standard cards)",
|
||||||
"-l, --legacy legacy mode (use the slow `hf mf chk`)",
|
"-l, --legacy legacy mode (use the slow `hf mf chk`)",
|
||||||
"-v, --verbose verbose output",
|
"-v, --verbose verbose output",
|
||||||
|
"--ns No save to file",
|
||||||
"--mini MIFARE Classic Mini / S20",
|
"--mini MIFARE Classic Mini / S20",
|
||||||
"--1k MIFARE Classic 1k / S50 (default)",
|
"--1k MIFARE Classic 1k / S50 (default)",
|
||||||
"--2k MIFARE Classic/Plus 2k",
|
"--2k MIFARE Classic/Plus 2k",
|
||||||
"--4k MIFARE Classic 4k / S70",
|
"--4k MIFARE Classic 4k / S70",
|
||||||
"--ns No save",
|
|
||||||
"--in None (use CPU regular instruction set)",
|
"--in None (use CPU regular instruction set)",
|
||||||
"--im MMX",
|
"--im MMX",
|
||||||
"--is SSE2",
|
"--is SSE2",
|
||||||
|
@ -4265,7 +4265,7 @@
|
||||||
"--i2 AVX2",
|
"--i2 AVX2",
|
||||||
"--i5 AVX512"
|
"--i5 AVX512"
|
||||||
],
|
],
|
||||||
"usage": "hf mf autopwn [-hablv] [-k <hex>]... [-s <dec>] [-f <fn>] [--slow] [--mini] [--1k] [--2k] [--4k] [--ns] [--in] [--im] [--is] [--ia] [--i2] [--i5]"
|
"usage": "hf mf autopwn [-hablv] [-k <hex>]... [-s <dec>] [-f <fn>] [--slow] [--ns] [--mini] [--1k] [--2k] [--4k] [--in] [--im] [--is] [--ia] [--i2] [--i5]"
|
||||||
},
|
},
|
||||||
"hf mf brute": {
|
"hf mf brute": {
|
||||||
"command": "hf mf brute",
|
"command": "hf mf brute",
|
||||||
|
@ -4346,7 +4346,7 @@
|
||||||
"--emu Fill simulator keys from found keys",
|
"--emu Fill simulator keys from found keys",
|
||||||
"--dump Dump found keys to binary file",
|
"--dump Dump found keys to binary file",
|
||||||
"-f, --file <fn> Filename of dictionary",
|
"-f, --file <fn> Filename of dictionary",
|
||||||
"--no-default Don't add the bunch of extra default keys"
|
"--no-default Skip check default keys"
|
||||||
],
|
],
|
||||||
"usage": "hf mf chk [-hab*] [-k <hex>]... [--tblk <dec>] [--mini] [--1k] [--2k] [--4k] [--emu] [--dump] [-f <fn>] [--no-default]"
|
"usage": "hf mf chk [-hab*] [-k <hex>]... [--tblk <dec>] [--mini] [--1k] [--2k] [--4k] [--emu] [--dump] [-f <fn>] [--no-default]"
|
||||||
},
|
},
|
||||||
|
@ -4710,7 +4710,7 @@
|
||||||
"--blk <dec> block number (single block recovery mode)",
|
"--blk <dec> block number (single block recovery mode)",
|
||||||
"-a single block recovery key A",
|
"-a single block recovery key A",
|
||||||
"-b single block recovery key B",
|
"-b single block recovery key B",
|
||||||
"--no-default Don't add the bunch of extra default keys"
|
"--no-default Skip check default keys"
|
||||||
],
|
],
|
||||||
"usage": "hf mf fchk [-hab] [-k <hex>]... [--mini] [--1k] [--2k] [--4k] [--emu] [--dump] [--mem] [-f <fn>] [--blk <dec>] [--no-default]"
|
"usage": "hf mf fchk [-hab] [-k <hex>]... [--mini] [--1k] [--2k] [--4k] [--emu] [--dump] [--mem] [-f <fn>] [--blk <dec>] [--no-default]"
|
||||||
},
|
},
|
||||||
|
@ -7228,10 +7228,10 @@
|
||||||
},
|
},
|
||||||
"hf mfu wipe": {
|
"hf mfu wipe": {
|
||||||
"command": "hf mfu wipe",
|
"command": "hf mfu wipe",
|
||||||
"description": "Wipe card to zeros. It will ignore block0,1,2,3 you will need to call it with password in order to wipe the config and sett default pwd/pack Abort by pressing a key New password.... FFFFFFFF New 3-DES key... 425245414B4D454946594F5543414E21",
|
"description": "Wipe card to zeros. It will ignore block0,1,2,3 you will need to call it with password in order to wipe the config and sett default pwd/pack Abort by pressing a key New password.... FFFFFFFF New 3-DES key... 49454D4B41455242214E4143554F5946",
|
||||||
"notes": [
|
"notes": [
|
||||||
"hf mfu wipe",
|
"hf mfu wipe",
|
||||||
"hf mfu wipe -k 425245414B4D454946594F5543414E21"
|
"hf mfu wipe -k 49454D4B41455242214E4143554F5946"
|
||||||
],
|
],
|
||||||
"offline": false,
|
"offline": false,
|
||||||
"options": [
|
"options": [
|
||||||
|
@ -9681,7 +9681,7 @@
|
||||||
},
|
},
|
||||||
"lf hitag help": {
|
"lf hitag help": {
|
||||||
"command": "lf hitag help",
|
"command": "lf hitag help",
|
||||||
"description": "help This help list List Hitag trace history test Perform self tests view Display content from tag dump file lookup Uses authentication trace to check for key in dictionary file --------------------------------------------------------------------------------------- lf hitag list available offline: yes Alias of `trace list -t hitag2` with selected protocol data to annotate trace buffer You can load a trace from file (see `trace load -h`) or it be downloaded from device by default It accepts all other arguments of `trace list`. Note that some might not be relevant for this specific protocol",
|
"description": "help This help list List Hitag trace history hts { Hitag S/8211 operations } test Perform self tests view Display content from tag dump file lookup Uses authentication trace to check for key in dictionary file --------------------------------------------------------------------------------------- lf hitag list available offline: yes Alias of `trace list -t hitag2` with selected protocol data to annotate trace buffer You can load a trace from file (see `trace load -h`) or it be downloaded from device by default It accepts all other arguments of `trace list`. Note that some might not be relevant for this specific protocol",
|
||||||
"notes": [
|
"notes": [
|
||||||
"lf hitag list --frame -> show frame delay times",
|
"lf hitag list --frame -> show frame delay times",
|
||||||
"lf hitag list -1 -> use trace buffer"
|
"lf hitag list -1 -> use trace buffer"
|
||||||
|
@ -9700,6 +9700,65 @@
|
||||||
],
|
],
|
||||||
"usage": "lf hitag list [-h1crux] [--frame] [-f <fn>]"
|
"usage": "lf hitag list [-h1crux] [--frame] [-f <fn>]"
|
||||||
},
|
},
|
||||||
|
"lf hitag hts help": {
|
||||||
|
"command": "lf hitag hts help",
|
||||||
|
"description": "help This help list List Hitag S trace history --------------------------------------------------------------------------------------- lf hitag hts list available offline: yes Alias of `trace list -t hitags` with selected protocol data to annotate trace buffer You can load a trace from file (see `trace load -h`) or it be downloaded from device by default It accepts all other arguments of `trace list`. Note that some might not be relevant for this specific protocol",
|
||||||
|
"notes": [
|
||||||
|
"lf hitag hts list --frame -> show frame delay times",
|
||||||
|
"lf hitag hts list -1 -> use trace buffer"
|
||||||
|
],
|
||||||
|
"offline": true,
|
||||||
|
"options": [
|
||||||
|
"-h, --help This help",
|
||||||
|
"-1, --buffer use data from trace buffer",
|
||||||
|
"--frame show frame delay times",
|
||||||
|
"-c mark CRC bytes",
|
||||||
|
"-r show relative times (gap and duration)",
|
||||||
|
"-u display times in microseconds instead of clock cycles",
|
||||||
|
"-x show hexdump to convert to pcap(ng)",
|
||||||
|
"or to import into Wireshark using encapsulation type \"ISO 14443\"",
|
||||||
|
"-f, --file <fn> filename of dictionary"
|
||||||
|
],
|
||||||
|
"usage": "lf hitag hts list [-h1crux] [--frame] [-f <fn>]"
|
||||||
|
},
|
||||||
|
"lf hitag hts read": {
|
||||||
|
"command": "lf hitag hts read",
|
||||||
|
"description": "Read Hitag S memory. Crypto mode: - key format ISK high + ISK low - default key 4F4E4D494B52 (ONMIKR)",
|
||||||
|
"notes": [
|
||||||
|
"lf hitag s read -> Hitag S, plain mode",
|
||||||
|
"lf hitag hts read --nrar 0102030411223344 -> Hitag S, challenge mode",
|
||||||
|
"lf hitag hts read --crypto -> Hitag S, crypto mode, def key",
|
||||||
|
"lf hitag hts read -k 4F4E4D494B52 -> Hitag S, crypto mode"
|
||||||
|
],
|
||||||
|
"offline": false,
|
||||||
|
"options": [
|
||||||
|
"-h, --help This help",
|
||||||
|
"--nrar <hex> nonce / answer writer, 8 hex bytes",
|
||||||
|
"--crypto crypto mode",
|
||||||
|
"-k, --key <hex> key, 4 or 6 hex bytes"
|
||||||
|
],
|
||||||
|
"usage": "lf hitag hts read [-h] [--nrar <hex>] [--crypto] [-k <hex>]"
|
||||||
|
},
|
||||||
|
"lf hitag hts write": {
|
||||||
|
"command": "lf hitag hts write",
|
||||||
|
"description": "Write a page in Hitag S memory. Crypto mode: - key format ISK high + ISK low - default key 4F4E4D494B52 (ONMIKR)",
|
||||||
|
"notes": [
|
||||||
|
"lf hitag write -p 6 -d 01020304 -> Hitag S, plain mode",
|
||||||
|
"lf hitag hts write -p 6 -d 01020304 --nrar 0102030411223344 -> Hitag S, challenge mode",
|
||||||
|
"lf hitag hts write -p 6 -d 01020304 --crypto -> Hitag S, crypto mode, default key",
|
||||||
|
"lf hitag hts write -p 6 -d 01020304 -k 4F4E4D494B52 -> Hitag S, crypto mode"
|
||||||
|
],
|
||||||
|
"offline": false,
|
||||||
|
"options": [
|
||||||
|
"-h, --help This help",
|
||||||
|
"--nrar <hex> nonce / answer writer, 8 hex bytes",
|
||||||
|
"--crypto crypto mode",
|
||||||
|
"-k, --key <hex> key, 6 hex bytes",
|
||||||
|
"-p, --page <dec> page address to write to",
|
||||||
|
"-d, --data <hex> data, 4 hex bytes"
|
||||||
|
],
|
||||||
|
"usage": "lf hitag hts write [-h] [--nrar <hex>] [--crypto] [-k <hex>] -p <dec> -d <hex>"
|
||||||
|
},
|
||||||
"lf hitag info": {
|
"lf hitag info": {
|
||||||
"command": "lf hitag info",
|
"command": "lf hitag info",
|
||||||
"description": "Hitag 2 tag information",
|
"description": "Hitag 2 tag information",
|
||||||
|
@ -11090,7 +11149,7 @@
|
||||||
"-f, --file <fn> filename (default is generated on blk 0)",
|
"-f, --file <fn> filename (default is generated on blk 0)",
|
||||||
"-o, --override override, force pwd read despite danger to card",
|
"-o, --override override, force pwd read despite danger to card",
|
||||||
"-p, --pwd <hex> password (4 hex bytes)",
|
"-p, --pwd <hex> password (4 hex bytes)",
|
||||||
"--ns no save",
|
"--ns no save to file",
|
||||||
"--r0 downlink - fixed bit length",
|
"--r0 downlink - fixed bit length",
|
||||||
"--r1 downlink - long leading reference",
|
"--r1 downlink - long leading reference",
|
||||||
"--r2 downlink - leading zero",
|
"--r2 downlink - leading zero",
|
||||||
|
@ -12820,8 +12879,8 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"commands_extracted": 740,
|
"commands_extracted": 743,
|
||||||
"extracted_by": "PM3Help2JSON v1.00",
|
"extracted_by": "PM3Help2JSON v1.00",
|
||||||
"extracted_on": "2024-08-25T12:04:45"
|
"extracted_on": "2024-08-29T10:28:11"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1067,6 +1067,18 @@ Check column "offline" for their availability.
|
||||||
|`lf hitag ta `|N |`Hitag 2: test all recorded authentications`
|
|`lf hitag ta `|N |`Hitag 2: test all recorded authentications`
|
||||||
|
|
||||||
|
|
||||||
|
### lf hitag hts
|
||||||
|
|
||||||
|
{ Hitag S/8211 operations }
|
||||||
|
|
||||||
|
|command |offline |description
|
||||||
|
|------- |------- |-----------
|
||||||
|
|`lf hitag hts help `|Y |`This help`
|
||||||
|
|`lf hitag hts list `|Y |`List Hitag S trace history`
|
||||||
|
|`lf hitag hts read `|N |`Read Hitag S memory`
|
||||||
|
|`lf hitag hts write `|N |`Write Hitag S page`
|
||||||
|
|
||||||
|
|
||||||
### lf idteck
|
### lf idteck
|
||||||
|
|
||||||
{ Idteck RFIDs... }
|
{ Idteck RFIDs... }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue