style and text

This commit is contained in:
iceman1001 2024-08-25 15:17:02 +02:00
parent 5b64df9247
commit 6a95f16102
11 changed files with 243 additions and 219 deletions

View file

@ -2273,10 +2273,11 @@ int infoHF14A(bool verbose, bool do_nack_test, bool do_aid_search) {
} }
if (card.ats[0] != card.ats_len - 2) { if (card.ats[0] != card.ats_len - 2) {
PrintAndLogEx(WARNING, _RED_("ATS may be corrupted.") " Length of ATS (%d bytes incl. 2 Bytes CRC) doesn't match TL", card.ats_len); PrintAndLogEx(WARNING, _RED_("ATS may be corrupted."));
PrintAndLogEx(INFO, "Length of ATS (%d bytes incl. 2 Bytes CRC) doesn't match TL", card.ats_len);
} }
PrintAndLogEx(SUCCESS, "ATS: " _YELLOW_("%s")"[ %02X %02X ]", sprint_hex(card.ats, card.ats_len - 2), card.ats[card.ats_len - 1], card.ats[card.ats_len]); PrintAndLogEx(SUCCESS, "ATS: " _YELLOW_("%s")"[ %02X %02X ]", sprint_hex(card.ats, card.ats_len - 2), card.ats[card.ats_len - 2], card.ats[card.ats_len - 1]);
PrintAndLogEx(INFO, " " _YELLOW_("%02X") "............... TL length is " _GREEN_("%d") " bytes", card.ats[0], card.ats[0]); PrintAndLogEx(INFO, " " _YELLOW_("%02X") "............... TL length is " _GREEN_("%d") " bytes", card.ats[0], card.ats[0]);
if ((card.ats[0] > 1) && (card.ats_len > 3)) { // there is a format byte (T0) if ((card.ats[0] > 1) && (card.ats_len > 3)) { // there is a format byte (T0)

View file

@ -286,7 +286,7 @@ static int CmdHF14AJookiEncode(const char *Cmd) {
CLIParserContext *ctx; CLIParserContext *ctx;
CLIParserInit(&ctx, "hf jooki encode", CLIParserInit(&ctx, "hf jooki encode",
"Encode a Jooki token to base64 NDEF URI format", "Encode a Jooki token to base64 NDEF URI format",
"hf jooki encode -t --> selftest\n" "hf jooki encode --test --> self tests\n"
"hf jooki encode -r --dragon --> read uid from tag and use for encoding\n" "hf jooki encode -r --dragon --> read uid from tag and use for encoding\n"
"hf jooki encode --uid 04010203040506 --dragon\n" "hf jooki encode --uid 04010203040506 --dragon\n"
"hf jooki encode --uid 04010203040506 --tid 1 --fid 1" "hf jooki encode --uid 04010203040506 --tid 1 --fid 1"
@ -296,7 +296,7 @@ static int CmdHF14AJookiEncode(const char *Cmd) {
arg_param_begin, arg_param_begin,
arg_str0("u", "uid", "<hex>", "uid bytes"), arg_str0("u", "uid", "<hex>", "uid bytes"),
arg_lit0("r", NULL, "read uid from tag instead"), arg_lit0("r", NULL, "read uid from tag instead"),
arg_lit0("t", NULL, "self test"), arg_lit0(NULL, "test", "self test"),
arg_lit0("v", "verbose", "verbose output"), arg_lit0("v", "verbose", "verbose output"),
arg_lit0(NULL, "dragon", "figurine type"), arg_lit0(NULL, "dragon", "figurine type"),
arg_lit0(NULL, "fox", "figurine type"), arg_lit0(NULL, "fox", "figurine type"),

View file

@ -767,9 +767,14 @@ static int CmdEM410xClone(const char *Cmd) {
// 64 -> 0x20 2 kBit/s // 64 -> 0x20 2 kBit/s
packet.data[1] = 0x04; packet.data[1] = 0x04;
switch (clk) { switch (clk) {
case 32: break; case 32:
case 16: packet.data[1] |= 0x10; break; break;
case 64: packet.data[1] |= 0x20; break; case 16:
packet.data[1] |= 0x10;
break;
case 64:
packet.data[1] |= 0x20;
break;
} }
packet.data[2] = 0; packet.data[2] = 0;
packet.data[3] = 0; //TODO: keep PWDH0? packet.data[3] = 0; //TODO: keep PWDH0?

View file

@ -1386,7 +1386,13 @@ int CmdTraceList(const char *Cmd) {
if (use_buffer == false) { if (use_buffer == false) {
download_trace(); download_trace();
} else if (gs_traceLen == 0 || gs_trace == NULL) { } else if (gs_traceLen == 0 || gs_trace == NULL) {
if (IfPm3Present() == false) {
PrintAndLogEx(FAILED, "You requested a trace list in offline mode but there is no trace."); PrintAndLogEx(FAILED, "You requested a trace list in offline mode but there is no trace.");
} else {
PrintAndLogEx(FAILED, "You requested a trace list but there is no trace.");
}
PrintAndLogEx(FAILED, "Consider using `" _YELLOW_("trace load") "` or removing parameter `" _YELLOW_("-1") "`"); PrintAndLogEx(FAILED, "Consider using `" _YELLOW_("trace load") "` or removing parameter `" _YELLOW_("-1") "`");
return PM3_EINVARG; return PM3_EINVARG;
} }

View file

@ -2344,9 +2344,12 @@ int loadFileDICTIONARY_safe(const char *preferredName, void **pdata, uint8_t key
continue; continue;
} }
uint64_t key = strtoull(line, NULL, 16); if (hex_to_bytes(
line,
num_to_bytes(key, keylen >> 1, (uint8_t *)*pdata + (*keycnt * (keylen >> 1))); (uint8_t *)*pdata + (*keycnt * (keylen >> 1)),
keylen >> 1) != (keylen >> 1)) {
continue;
}
(*keycnt)++; (*keycnt)++;

View file

@ -3289,7 +3289,9 @@
"notes": [ "notes": [
"hf iclass encode --bin 10001111100000001010100011 --ki 0 -> FC 31 CN 337 (H10301)", "hf iclass encode --bin 10001111100000001010100011 --ki 0 -> FC 31 CN 337 (H10301)",
"hf iclass encode -w H10301 --fc 31 --cn 337 --ki 0 -> FC 31 CN 337 (H10301)", "hf iclass encode -w H10301 --fc 31 --cn 337 --ki 0 -> FC 31 CN 337 (H10301)",
"hf iclass encode --bin 10001111100000001010100011 --ki 0 --elite -> FC 31 CN 337 (H10301), writing w elite key" "hf iclass encode --bin 10001111100000001010100011 --ki 0 --elite -> FC 31 CN 337 (H10301), writing w elite key",
"hf iclass encode -w H10301 --fc 31 --cn 337 --emu -> Writes the ecoded data to emulator memory",
"When using emulator you have to first load a credential into emulator memory"
], ],
"offline": true, "offline": true,
"options": [ "options": [
@ -3302,11 +3304,13 @@
"--enckey <hex> 3DES transport key, 16 hex bytes", "--enckey <hex> 3DES transport key, 16 hex bytes",
"--fc <dec> facility code", "--fc <dec> facility code",
"--cn <dec> card number", "--cn <dec> card number",
"--issue <dec> issue level",
"-w, --wiegand <format> see `wiegand list` for available formats", "-w, --wiegand <format> see `wiegand list` for available formats",
"--emu Write to emulation memory instead of card",
"--shallow use shallow (ASK) reader modulation instead of OOK", "--shallow use shallow (ASK) reader modulation instead of OOK",
"-v verbose (print encoded blocks)" "-v verbose (print encoded blocks)"
], ],
"usage": "hf iclass encode [-hv] [--bin <bin>] --ki <dec> [--credit] [--elite] [--raw] [--enckey <hex>] [--fc <dec>] [--cn <dec>] [-w <format>] [--shallow]" "usage": "hf iclass encode [-hv] [--bin <bin>] [--ki <dec>] [--credit] [--elite] [--raw] [--enckey <hex>] [--fc <dec>] [--cn <dec>] [--issue <dec>] [-w <format>] [--emu] [--shallow]"
}, },
"hf iclass encrypt": { "hf iclass encrypt": {
"command": "hf iclass encrypt", "command": "hf iclass encrypt",
@ -3735,7 +3739,7 @@
"command": "hf jooki encode", "command": "hf jooki encode",
"description": "Encode a Jooki token to base64 NDEF URI format", "description": "Encode a Jooki token to base64 NDEF URI format",
"notes": [ "notes": [
"hf jooki encode -t -> selftest", "hf jooki encode --test -> self tests",
"hf jooki encode -r --dragon -> read uid from tag and use for encoding", "hf jooki encode -r --dragon -> read uid from tag and use for encoding",
"hf jooki encode --uid 04010203040506 --dragon", "hf jooki encode --uid 04010203040506 --dragon",
"hf jooki encode --uid 04010203040506 --tid 1 --fid 1" "hf jooki encode --uid 04010203040506 --tid 1 --fid 1"
@ -3745,7 +3749,7 @@
"-h, --help This help", "-h, --help This help",
"-u, --uid <hex> uid bytes", "-u, --uid <hex> uid bytes",
"-r read uid from tag instead", "-r read uid from tag instead",
"-t self test", "--test self test",
"-v, --verbose verbose output", "-v, --verbose verbose output",
"--dragon figurine type", "--dragon figurine type",
"--fox figurine type", "--fox figurine type",
@ -3763,7 +3767,7 @@
"--tid <dec> figurine type id", "--tid <dec> figurine type id",
"--fid <dec> figurine id" "--fid <dec> figurine id"
], ],
"usage": "hf jooki encode [-hrtv] [-u <hex>] [--dragon] [--fox] [--ghost] [--knight] [--whale] [--blackdragon] [--blackfox] [--blackknight] [--blackwhale] [--whitedragon] [--whitefox] [--whiteknight] [--whitewhale] [--tid <dec>] [--fid <dec>]" "usage": "hf jooki encode [-hrv] [-u <hex>] [--test] [--dragon] [--fox] [--ghost] [--knight] [--whale] [--blackdragon] [--blackfox] [--blackknight] [--blackwhale] [--whitedragon] [--whitefox] [--whiteknight] [--whitewhale] [--tid <dec>] [--fid <dec>]"
}, },
"hf jooki help": { "hf jooki help": {
"command": "hf jooki help", "command": "hf jooki help",
@ -4253,6 +4257,7 @@
"--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",
@ -4260,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] [--in] [--im] [--is] [--ia] [--i2] [--i5]" "usage": "hf mf autopwn [-hablv] [-k <hex>]... [-s <dec>] [-f <fn>] [--slow] [--mini] [--1k] [--2k] [--4k] [--ns] [--in] [--im] [--is] [--ia] [--i2] [--i5]"
}, },
"hf mf brute": { "hf mf brute": {
"command": "hf mf brute", "command": "hf mf brute",
@ -7032,7 +7037,7 @@
}, },
"hf mfu keygen": { "hf mfu keygen": {
"command": "hf mfu keygen", "command": "hf mfu keygen",
"description": "Set the DES/3DES/AES key on MIFARE Ultralight-C tag.", "description": "Calculate MFC keys based",
"notes": [ "notes": [
"hf mfu keygen -r", "hf mfu keygen -r",
"hf mfu keygen --uid 11223344556677" "hf mfu keygen --uid 11223344556677"
@ -7091,17 +7096,17 @@
"description": "Generate different passwords from known pwdgen algos", "description": "Generate different passwords from known pwdgen algos",
"notes": [ "notes": [
"hf mfu pwdgen -r", "hf mfu pwdgen -r",
"hf mfu pwdgen -t", "hf mfu pwdgen --uid 11223344556677",
"hf mfu pwdgen --uid 11223344556677" "hf mfu pwdgen --test"
], ],
"offline": true, "offline": true,
"options": [ "options": [
"-h, --help This help", "-h, --help This help",
"-u, --uid <hex> UID (7 hex bytes)", "-u, --uid <hex> UID (7 hex bytes)",
"-r Read UID from tag", "-r Read UID from tag",
"-t Selftest" "--test self test"
], ],
"usage": "hf mfu pwdgen [-hrt] [-u <hex>]" "usage": "hf mfu pwdgen [-hr] [-u <hex>] [--test]"
}, },
"hf mfu rdbl": { "hf mfu rdbl": {
"command": "hf mfu rdbl", "command": "hf mfu rdbl",
@ -7223,9 +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", "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",
"notes": [ "notes": [
"hf mfu wipe" "hf mfu wipe",
"hf mfu wipe -k 425245414B4D454946594F5543414E21"
], ],
"offline": false, "offline": false,
"options": [ "options": [
@ -8417,9 +8423,10 @@
"description": "Modulate LF reader field to send command before read. All periods in microseconds. - use `lf config` to set parameters", "description": "Modulate LF reader field to send command before read. All periods in microseconds. - use `lf config` to set parameters",
"notes": [ "notes": [
"lf cmdread -d 50 -z 116 -o 166 -e W3000 -c W00110 -> probing for Hitag 1/S", "lf cmdread -d 50 -z 116 -o 166 -e W3000 -c W00110 -> probing for Hitag 1/S",
"lf cmdread -d 50 -z 116 -o 166 -e W3000 -c W11000 -> probing for Hitag2", "lf cmdread -d 50 -z 116 -o 166 -e W3000 -c W11000 -> probing for Hitag 2/S",
"lf cmdread -d 50 -z 116 -o 166 -e W3000 -c W11000 -s 2000 -@ -> probing for Hitag2, oscilloscope style", "lf cmdread -d 50 -z 116 -o 166 -e W3000 -c W11010 -> probing for Hitag S",
"lf cmdread -d 48 -z 112 -o 176 -e W3000 -e S240 -e E336 -c W0S00000010000E -> probing for Hitag (us)" "lf cmdread -d 50 -z 116 -o 166 -e W3000 -c W11000 -s 2000 -@ -> probing for Hitag 2/S, oscilloscope style",
"lf cmdread -d 48 -z 112 -o 176 -e W3000 -e S240 -e E336 -c W0S00000010000E -> probing for Hitag \u00b5(micro)"
], ],
"offline": false, "offline": false,
"options": [ "options": [
@ -8540,11 +8547,12 @@
}, },
"lf em 410x clone": { "lf em 410x clone": {
"command": "lf em 410x clone", "command": "lf em 410x clone",
"description": "clone a EM410x ID to a T55x7, Q5/T5555 or EM4305/4469 tag.", "description": "clone a EM410x ID to a T55x7, Q5/T5555, EM4305/4469 or Hitag S/8211 tag.",
"notes": [ "notes": [
"lf em 410x clone --id 0F0368568B -> encode for T55x7 tag", "lf em 410x clone --id 0F0368568B -> encode for T55x7 tag",
"lf em 410x clone --id 0F0368568B --q5 -> encode for Q5/T5555 tag", "lf em 410x clone --id 0F0368568B --q5 -> encode for Q5/T5555 tag",
"lf em 410x clone --id 0F0368568B --em -> encode for EM4305/4469" "lf em 410x clone --id 0F0368568B --em -> encode for EM4305/4469",
"lf em 410x clone --id 0F0368568B --hs -> encode for Hitag S/8211"
], ],
"offline": false, "offline": false,
"options": [ "options": [
@ -8553,9 +8561,10 @@
"--id <hex> EM Tag ID number (5 hex bytes)", "--id <hex> EM Tag ID number (5 hex bytes)",
"--q5 optional - specify writing to Q5/T5555 tag", "--q5 optional - specify writing to Q5/T5555 tag",
"--em optional - specify writing to EM4305/4469 tag", "--em optional - specify writing to EM4305/4469 tag",
"--hs optional - specify writing to Hitag S/8211 tag",
"--electra optional - add Electra blocks to tag" "--electra optional - add Electra blocks to tag"
], ],
"usage": "lf em 410x clone [-h] [--clk <dec>] --id <hex> [--q5] [--em] [--electra]" "usage": "lf em 410x clone [-h] [--clk <dec>] --id <hex> [--q5] [--em] [--hs] [--electra]"
}, },
"lf em 410x reader": { "lf em 410x reader": {
"command": "lf em 410x reader", "command": "lf em 410x reader",
@ -12813,6 +12822,6 @@
"metadata": { "metadata": {
"commands_extracted": 740, "commands_extracted": 740,
"extracted_by": "PM3Help2JSON v1.00", "extracted_by": "PM3Help2JSON v1.00",
"extracted_on": "2024-08-14T11:49:06" "extracted_on": "2024-08-25T12:04:45"
} }
} }

View file

@ -421,9 +421,9 @@ while true; do
if ! CheckExecute "reveng readline test" "$CLIENTBIN -c 'reveng -h;reveng -D'" "CRC-64/GO-ISO"; then break; fi if ! CheckExecute "reveng readline test" "$CLIENTBIN -c 'reveng -h;reveng -D'" "CRC-64/GO-ISO"; then break; fi
if ! CheckExecute "reveng -g test" "$CLIENTBIN -c 'reveng -g abda202c'" "CRC-16/ISO-IEC-14443-3-A"; then break; fi if ! CheckExecute "reveng -g test" "$CLIENTBIN -c 'reveng -g abda202c'" "CRC-16/ISO-IEC-14443-3-A"; then break; fi
if ! CheckExecute "reveng -w test" "$CLIENTBIN -c 'reveng -w 8 -s 01020304e3 010204039d'" "CRC-8/SMBUS"; then break; fi if ! CheckExecute "reveng -w test" "$CLIENTBIN -c 'reveng -w 8 -s 01020304e3 010204039d'" "CRC-8/SMBUS"; then break; fi
if ! CheckExecute "mfu pwdgen test" "$CLIENTBIN -c 'hf mfu pwdgen -t'" "Selftest ok"; then break; fi if ! CheckExecute "mfu pwdgen test" "$CLIENTBIN -c 'hf mfu pwdgen --test'" "Selftest ok"; then break; fi
if ! CheckExecute "mfu keygen test" "$CLIENTBIN -c 'hf mfu keygen --uid 11223344556677'" "80 B1 C2 71 D8 A0"; then break; fi if ! CheckExecute "mfu keygen test" "$CLIENTBIN -c 'hf mfu keygen --uid 11223344556677'" "80 B1 C2 71 D8 A0"; then break; fi
if ! CheckExecute "jooki encode test" "$CLIENTBIN -c 'hf jooki encode -t'" "04 28 F4 DA F0 4A 81 \( ok \)"; then break; fi if ! CheckExecute "jooki encode test" "$CLIENTBIN -c 'hf jooki encode --test'" "04 28 F4 DA F0 4A 81 \( ok \)"; then break; fi
if ! CheckExecute "trace load/list 14a" "$CLIENTBIN -c 'trace load -f traces/hf_14a_mfu.trace; trace list -1 -t 14a;'" "READBLOCK\(8\)"; then break; fi if ! CheckExecute "trace load/list 14a" "$CLIENTBIN -c 'trace load -f traces/hf_14a_mfu.trace; trace list -1 -t 14a;'" "READBLOCK\(8\)"; then break; fi
if ! CheckExecute "trace load/list x" "$CLIENTBIN -c 'trace load -f traces/hf_14a_mfu.trace; trace list -x1 -t 14a;'" "0.0101840425"; then break; fi if ! CheckExecute "trace load/list x" "$CLIENTBIN -c 'trace load -f traces/hf_14a_mfu.trace; trace list -x1 -t 14a;'" "0.0101840425"; then break; fi
if ! CheckExecute "nfc decode test - oob" "$CLIENTBIN -c 'nfc decode -d DA2010016170706C69636174696F6E2F766E642E626C7565746F6F74682E65702E6F6F62301000649201B96DFB0709466C65782032'" "Flex 2"; then break; fi if ! CheckExecute "nfc decode test - oob" "$CLIENTBIN -c 'nfc decode -d DA2010016170706C69636174696F6E2F766E642E626C7565746F6F74682E65702E6F6F62301000649201B96DFB0709466C65782032'" "Flex 2"; then break; fi