make style

This commit is contained in:
iceman1001 2021-07-29 15:00:00 +02:00
commit 8472c6ffe7
5 changed files with 213 additions and 81 deletions

View file

@ -30,14 +30,14 @@ Default LF config is set to:
*/ */
static sample_config def_config = { static sample_config def_config = {
.decimation = 1, .decimation = 1,
.bits_per_sample = 8, .bits_per_sample = 8,
.averaging = 1, .averaging = 1,
.divisor = LF_DIVISOR_125, .divisor = LF_DIVISOR_125,
.trigger_threshold = 0, .trigger_threshold = 0,
.samples_to_skip = 0, .samples_to_skip = 0,
.verbose = false, .verbose = false,
}; };
static sample_config config = { 1, 8, 1, LF_DIVISOR_125, 0, 0, true} ; static sample_config config = { 1, 8, 1, LF_DIVISOR_125, 0, 0, true} ;

View file

@ -3718,25 +3718,25 @@ static int CmdHFiClassEncode(const char *Cmd) {
} }
if (bin_len) { if (bin_len) {
memcpy(credential + 8, data, sizeof(data)); memcpy(credential + 8, data, sizeof(data));
} else { } else {
wiegand_message_t packed; wiegand_message_t packed;
memset(&packed, 0, sizeof(wiegand_message_t)); memset(&packed, 0, sizeof(wiegand_message_t));
int format_idx = HIDFindCardFormat((char *)format); int format_idx = HIDFindCardFormat((char *)format);
if (format_idx == -1) { if (format_idx == -1) {
PrintAndLogEx(WARNING, "Unknown format: " _YELLOW_("%s"), format); PrintAndLogEx(WARNING, "Unknown format: " _YELLOW_("%s"), format);
return PM3_EINVARG; return PM3_EINVARG;
} }
if (HIDPack(format_idx, &card, &packed, false) == false) { if (HIDPack(format_idx, &card, &packed, false) == false) {
PrintAndLogEx(WARNING, "The card data could not be encoded in the selected format."); PrintAndLogEx(WARNING, "The card data could not be encoded in the selected format.");
return PM3_ESOFT; return PM3_ESOFT;
} }
add_HID_header(&packed); add_HID_header(&packed);
packed.Bot = BSWAP_32(packed.Bot); packed.Bot = BSWAP_32(packed.Bot);
memcpy(credential + 12, &packed.Bot, sizeof(packed.Bot)); memcpy(credential + 12, &packed.Bot, sizeof(packed.Bot));
} }
// encrypt with transport key // encrypt with transport key

View file

@ -436,7 +436,7 @@ int CmdFlexdemod(const char *Cmd) {
/* /*
* this function will save a copy of the current lf config value, and set config to default values. * this function will save a copy of the current lf config value, and set config to default values.
* *
*/ */
int lf_config_savereset(sample_config *config) { int lf_config_savereset(sample_config *config) {

View file

@ -973,7 +973,7 @@
}, },
"help": { "help": {
"command": "help", "command": "help",
"description": "help use `<command> help` for details of a command prefs { edit client/device preferences... } -------- ----------------------- technology ----------------------- analyse { analyse utils... } data { plot window / data buffer manipulation... } emv { emv iso-14443 / iso-7816... } hf { high frequency commands... } hw { hardware commands... } lf { low frequency commands... } nfc { nfc commands... } reveng { crc calculations from reveng software... } smart { smart card iso-7816 commands... } script { scripting commands... } trace { trace manipulation... } wiegand { wiegand format manipulation... } -------- ----------------------- general ----------------------- clear clear screen hints turn hints on / off msleep add a pause in milliseconds rem add a text line in log file quit exit exit program [=] session log e:\\proxspace\\pm3/.proxmark3/logs/log_20210726.txt --------------------------------------------------------------------------------------- auto available offline: no run lf search / hf search / data plot / data save", "description": "help use `<command> help` for details of a command prefs { edit client/device preferences... } -------- ----------------------- technology ----------------------- analyse { analyse utils... } data { plot window / data buffer manipulation... } emv { emv iso-14443 / iso-7816... } hf { high frequency commands... } hw { hardware commands... } lf { low frequency commands... } nfc { nfc commands... } reveng { crc calculations from reveng software... } smart { smart card iso-7816 commands... } script { scripting commands... } trace { trace manipulation... } wiegand { wiegand format manipulation... } -------- ----------------------- general ----------------------- clear clear screen hints turn hints on / off msleep add a pause in milliseconds rem add a text line in log file quit exit exit program [=] session log /home/iceman/.proxmark3/logs/log_20210729.txt --------------------------------------------------------------------------------------- auto available offline: no run lf search / hf search / data plot / data save",
"notes": [ "notes": [
"auto" "auto"
], ],
@ -2414,9 +2414,10 @@
}, },
"hf iclass encode": { "hf iclass encode": {
"command": "hf iclass encode", "command": "hf iclass encode",
"description": "encode binary wiegand to block 7", "description": "encode binary wiegand to block 7 use either --bin or --wiegand/--fc/--cn",
"notes": [ "notes": [
"hf iclass encode --bin 10001111100000001010100011 --ki 0 -> fc 31 cn 337", "hf iclass encode --bin 10001111100000001010100011 --ki 0 -> fc 31 cn 337",
"hf iclass encode --fc 31 --cn 337 --ki 0 -> fc 31 cn 337",
"hf iclass encode --bin 10001111100000001010100011 --ki 0 --elite -> fc 31 cn 337, writing w elite key" "hf iclass encode --bin 10001111100000001010100011 --ki 0 --elite -> fc 31 cn 337, writing w elite key"
], ],
"offline": true, "offline": true,
@ -2427,9 +2428,12 @@
"--credit key is assumed to be the credit key", "--credit key is assumed to be the credit key",
"--elite elite computations applied to key", "--elite elite computations applied to key",
"--raw no computations applied to key", "--raw no computations applied to key",
"--enckey <hex> 3des transport key, 16 hex bytes" "--enckey <hex> 3des transport key, 16 hex bytes",
"--fc <dec> facility code",
"--cn <dec> card number",
"-w, --wiegand <format> see `wiegand list` for available formats"
], ],
"usage": "hf iclass encode [-h] --bin <bin> --ki <dec> [--credit] [--elite] [--raw] [--enckey <hex>]" "usage": "hf iclass encode [-h] [--bin <bin>] --ki <dec> [--credit] [--elite] [--raw] [--enckey <hex>] [--fc <dec>] [--cn <dec>] [-w <format>]"
}, },
"hf iclass encrypt": { "hf iclass encrypt": {
"command": "hf iclass encrypt", "command": "hf iclass encrypt",
@ -4032,15 +4036,16 @@
"-s, --schann <d40/ev1/ev2> secure channel: d40/ev1/ev2", "-s, --schann <d40/ev1/ev2> secure channel: d40/ev1/ev2",
"--aid <app id hex> application id (3 hex bytes, big endian)", "--aid <app id hex> application id (3 hex bytes, big endian)",
"--fid <file id hex> file id (1 hex byte)", "--fid <file id hex> file id (1 hex byte)",
"--rawdata <file settings hex> file settings (hex > 5 bytes)", "--rawdata <file settings hex> file settings (hex > 5 bytes). have priority over the other settings.",
"--amode <plain/mac/encrypt> file access mode: plain/mac/encrypt", "--amode <plain/mac/encrypt> file access mode: plain/mac/encrypt",
"--rawrights <access rights hex> access rights for file (hex 2 byte) r/w/rw/chg, 0x0 - 0xd key, 0xe free, 0xf denied",
"--rrights <key0/../key13/free/deny> read file access mode: the specified key, free, deny", "--rrights <key0/../key13/free/deny> read file access mode: the specified key, free, deny",
"--wrights <key0/../key13/free/deny> write file access mode: the specified key, free, deny", "--wrights <key0/../key13/free/deny> write file access mode: the specified key, free, deny",
"--rwrights <key0/../key13/free/deny> read/write file access mode: the specified key, free, deny", "--rwrights <key0/../key13/free/deny> read/write file access mode: the specified key, free, deny",
"--chrights <key0/../key13/free/deny> change file settings access mode: the specified key, free, deny", "--chrights <key0/../key13/free/deny> change file settings access mode: the specified key, free, deny",
"--no-auth execute without authentication" "--no-auth execute without authentication"
], ],
"usage": "hf mfdes chfilesettings [-hav] [-n <keyno>] [-t <des/2tdea/3tdea/aes>] [-k <key>] [-f <none/an10922/gallagher>] [-i <kdfi>] [-m <plain/mac/encrypt>] [-c <native/niso/iso>] [-s <d40/ev1/ev2>] [--aid <app id hex>] [--fid <file id hex>] [--rawdata <file settings hex>] [--amode <plain/mac/encrypt>] [--rrights <key0/../key13/free/deny>] [--wrights <key0/../key13/free/deny>] [--rwrights <key0/../key13/free/deny>] [--chrights <key0/../key13/free/deny>] [--no-auth]" "usage": "hf mfdes chfilesettings [-hav] [-n <keyno>] [-t <des/2tdea/3tdea/aes>] [-k <key>] [-f <none/an10922/gallagher>] [-i <kdfi>] [-m <plain/mac/encrypt>] [-c <native/niso/iso>] [-s <d40/ev1/ev2>] [--aid <app id hex>] [--fid <file id hex>] [--rawdata <file settings hex>] [--amode <plain/mac/encrypt>] [--rawrights <access rights hex>] [--rrights <key0/../key13/free/deny>] [--wrights <key0/../key13/free/deny>] [--rwrights <key0/../key13/free/deny>] [--chrights <key0/../key13/free/deny>] [--no-auth]"
}, },
"hf mfdes chk": { "hf mfdes chk": {
"command": "hf mfdes chk", "command": "hf mfdes chk",
@ -4093,19 +4098,30 @@
], ],
"usage": "hf mfdes chkeysettings [-hav] [-n <keyno>] [-t <des/2tdea/3tdea/aes>] [-k <key>] [-f <none/an10922/gallagher>] [-i <kdfi>] [-m <plain/mac/encrypt>] [-c <native/niso/iso>] [-s <d40/ev1/ev2>] [--aid <app id hex>] [-d <key settings hex>]" "usage": "hf mfdes chkeysettings [-hav] [-n <keyno>] [-t <des/2tdea/3tdea/aes>] [-k <key>] [-f <none/an10922/gallagher>] [-i <kdfi>] [-m <plain/mac/encrypt>] [-c <native/niso/iso>] [-s <d40/ev1/ev2>] [--aid <app id hex>] [-d <key settings hex>]"
}, },
"hf mfdes clearfile": { "hf mfdes clearrecfile": {
"command": "hf mfdes clearfile", "command": "hf mfdes clearrecfile",
"description": "clear record file make sure to select aid or authenticate aid before running this command.", "description": "clear record file. master key needs to be provided or flag --no-auth set (depend on cards settings).",
"notes": [ "notes": [
"hf mfdes clearfile -n 01" "hf mfdes clearrecfile --aid 123456 --fid 01 -> clear record file for: app=123456, file=01 with defaults from `default` command"
], ],
"offline": false, "offline": false,
"options": [ "options": [
"-h, --help this help", "-h, --help this help",
"-n, --fileno <dec> file number (0 - 31)", "-a, --apdu show apdu requests and responses",
"-a, --aid <hex> app id to select as hex bytes (3 bytes, big endian)" "-v, --verbose show technical data",
"-n, --keyno <keyno> key number",
"-t, --algo <des/2tdea/3tdea/aes> crypt algo: des, 2tdea, 3tdea, aes",
"-k, --key <key> key for authenticate (hex 8(des), 16(2tdea or aes) or 24(3tdea) bytes)",
"-f, --kdf <none/an10922/gallagher> key derivation function (kdf): none, an10922, gallagher",
"-i, --kdfi <kdfi> kdf input (hex 1-31 bytes)",
"-m, --cmode <plain/mac/encrypt> communicaton mode: plain/mac/encrypt",
"-c, --ccset <native/niso/iso> communicaton command set: native/niso/iso",
"-s, --schann <d40/ev1/ev2> secure channel: d40/ev1/ev2",
"--aid <app id hex> application id (3 hex bytes, big endian)",
"--fid <file id hex> file id for clearing (1 hex byte)",
"--no-auth execute without authentication"
], ],
"usage": "hf mfdes clearfile [-h] [-n <dec>] [-a <hex>]..." "usage": "hf mfdes clearrecfile [-hav] [-n <keyno>] [-t <des/2tdea/3tdea/aes>] [-k <key>] [-f <none/an10922/gallagher>] [-i <kdfi>] [-m <plain/mac/encrypt>] [-c <native/niso/iso>] [-s <d40/ev1/ev2>] [--aid <app id hex>] [--fid <file id hex>] [--no-auth]"
}, },
"hf mfdes createapp": { "hf mfdes createapp": {
"command": "hf mfdes createapp", "command": "hf mfdes createapp",
@ -4209,25 +4225,81 @@
], ],
"usage": "hf mfdes createfile [-hav] [-n <keyno>] [-t <des/2tdea/3tdea/aes>] [-k <key>] [-f <none/an10922/gallagher>] [-i <kdfi>] [-m <plain/mac/encrypt>] [-c <native/niso/iso>] [-s <d40/ev1/ev2>] [--aid <app id hex>] [--fid <file id hex>] [--isofid <iso file id hex>] [--rawtype <file type hex 1b>] [--rawdata <file settings hex>] [--amode <plain/mac/encrypt>] [--rawrights <access rights hex>] [--rrights <key0/../key13/free/deny>] [--wrights <key0/../key13/free/deny>] [--rwrights <key0/../key13/free/deny>] [--chrights <key0/../key13/free/deny>] [--no-auth] [--size <hex>] [--backup]" "usage": "hf mfdes createfile [-hav] [-n <keyno>] [-t <des/2tdea/3tdea/aes>] [-k <key>] [-f <none/an10922/gallagher>] [-i <kdfi>] [-m <plain/mac/encrypt>] [-c <native/niso/iso>] [-s <d40/ev1/ev2>] [--aid <app id hex>] [--fid <file id hex>] [--isofid <iso file id hex>] [--rawtype <file type hex 1b>] [--rawdata <file settings hex>] [--amode <plain/mac/encrypt>] [--rawrights <access rights hex>] [--rrights <key0/../key13/free/deny>] [--wrights <key0/../key13/free/deny>] [--rwrights <key0/../key13/free/deny>] [--chrights <key0/../key13/free/deny>] [--no-auth] [--size <hex>] [--backup]"
}, },
"hf mfdes createrecordfile": { "hf mfdes createmacfile": {
"command": "hf mfdes createrecordfile", "command": "hf mfdes createmacfile",
"description": "create linear / cyclic record file make sure to select aid or authenticate aid before running this command.", "description": "create transaction mac file in the application. application master key needs to be provided or flag --no-auth set (depend on application settings).",
"notes": [ "notes": [
"hf mfdes createrecordfile -f 1122 -n 02 -c 0 -r eeee -s 000010 -m 000005 -a 123456" "--rawrights have priority over the separate rights settings.",
"key/mode/etc of the authentication depends on application settings",
"hf mfdes createmacfile --aid 123456 --fid 01 --mackey --rawrights 1f30 00112233445566778899aabbccddeeff --mackeyver 01 -> create transaction mac file with parameters. rights from default. authentication with defaults from `default` command",
"hf mfdes createmacfile --aid 123456 --fid 01 --amode plain --rrights free --wrights deny --rwrights free --chrights key0 --mackey 00112233445566778899aabbccddeeff -> create file app=123456, file=01, with key, and mentioned rights with defaults from `default` command",
"hf mfdes createmacfile -n 0 -t des -k 0000000000000000 -f none --aid 123456 --fid 01 -> execute with default factory setup. key and keyver == 0x00..00"
], ],
"offline": false, "offline": false,
"options": [ "options": [
"-h, --help this help", "-h, --help this help",
"-n, --fileno <dec> file number (0 - 31)", "-a, --apdu show apdu requests and responses",
"-f, --fileid <hex> iso fid (2 hex bytes, big endian)", "-v, --verbose show technical data",
"-c, --com <dec> communication setting (0 = plain, 1 = plain + mac, 3 = enciphered)", "-n, --keyno <keyno> key number",
"-r, --rights <hex> access rights (2 hex bytes -> rw/chg/r/w, 0x0 - 0xd key, 0xe free, 0xf denied)", "-t, --algo <des/2tdea/3tdea/aes> crypt algo: des, 2tdea, 3tdea, aes",
"-s, --size <hex> record size (3 hex bytes, big endian, 000001 to ffffff)", "-k, --key <key> key for authenticate (hex 8(des), 16(2tdea or aes) or 24(3tdea) bytes)",
"-m, --maxrecord <hex> max. number of records (3 hex bytes, big endian)", "-f, --kdf <none/an10922/gallagher> key derivation function (kdf): none, an10922, gallagher",
"-b, --cyclic create cyclic record file instead of linear record file", "-i, --kdfi <kdfi> kdf input (hex 1-31 bytes)",
"-a, --aid <hex> app id to select as hex bytes (3 bytes, big endian)" "-m, --cmode <plain/mac/encrypt> communicaton mode: plain/mac/encrypt",
"-c, --ccset <native/niso/iso> communicaton command set: native/niso/iso",
"-s, --schann <d40/ev1/ev2> secure channel: d40/ev1/ev2",
"--aid <app id hex> application id (3 hex bytes, big endian)",
"--fid <file id hex> file id (1 hex byte)",
"--amode <plain/mac/encrypt> file access mode: plain/mac/encrypt",
"--rawrights <access rights hex> access rights for file (hex 2 byte) r/w/rw/chg, 0x0 - 0xd key, 0xe free, 0xf denied",
"--rrights <key0/../key13/free/deny> read file access mode: the specified key, free, deny",
"--wrights <key0/../key13/free/deny> write file access mode: the specified key, free, deny",
"--rwrights <key0/../key13/free/deny> read/write file access mode: the specified key, free, deny",
"--chrights <key0/../key13/free/deny> change file settings access mode: the specified key, free, deny",
"--no-auth execute without authentication",
"--mackey <hex> aes-128 key for mac (16 hex bytes, big endian). default 0x00..00",
"--mackeyver <ver hex 1b> aes key version for mac (1 hex byte). default 0x00"
], ],
"usage": "hf mfdes createrecordfile [-hb] [-n <dec>] [-f <hex>]... [-c <dec>] [-r <hex>]... [-s <hex>]... [-m <hex>]... [-a <hex>]..." "usage": "hf mfdes createmacfile [-hav] [-n <keyno>] [-t <des/2tdea/3tdea/aes>] [-k <key>] [-f <none/an10922/gallagher>] [-i <kdfi>] [-m <plain/mac/encrypt>] [-c <native/niso/iso>] [-s <d40/ev1/ev2>] [--aid <app id hex>] [--fid <file id hex>] [--amode <plain/mac/encrypt>] [--rawrights <access rights hex>] [--rrights <key0/../key13/free/deny>] [--wrights <key0/../key13/free/deny>] [--rwrights <key0/../key13/free/deny>] [--chrights <key0/../key13/free/deny>] [--no-auth] [--mackey <hex>] [--mackeyver <ver hex 1b>]"
},
"hf mfdes createrecordfile": {
"command": "hf mfdes createrecordfile",
"description": "create linear/cyclic record file in the application. application master key needs to be provided or flag --no-auth set (depend on application settings).",
"notes": [
"--rawrights have priority over the separate rights settings.",
"key/mode/etc of the authentication depends on application settings",
"hf mfdes createrecordfile --aid 123456 --fid 01 --size 000010 --maxrecord 000010 --cyclic -> create cyclic record file with parameters. rights from default. authentication with defaults from `default` command",
"hf mfdes createrecordfile --aid 123456 --fid 01 --amode plain --rrights free --wrights free --rwrights free --chrights key0 --size 000010 --maxrecord 000010 -> create linear record file app=123456, file=01 and mentioned rights with defaults from `default` command",
"hf mfdes createrecordfile -n 0 -t des -k 0000000000000000 -f none --aid 123456 --fid 01 --size 000010 --maxrecord 000010 -> execute with default factory setup"
],
"offline": false,
"options": [
"-h, --help this help",
"-a, --apdu show apdu requests and responses",
"-v, --verbose show technical data",
"-n, --keyno <keyno> key number",
"-t, --algo <des/2tdea/3tdea/aes> crypt algo: des, 2tdea, 3tdea, aes",
"-k, --key <key> key for authenticate (hex 8(des), 16(2tdea or aes) or 24(3tdea) bytes)",
"-f, --kdf <none/an10922/gallagher> key derivation function (kdf): none, an10922, gallagher",
"-i, --kdfi <kdfi> kdf input (hex 1-31 bytes)",
"-m, --cmode <plain/mac/encrypt> communicaton mode: plain/mac/encrypt",
"-c, --ccset <native/niso/iso> communicaton command set: native/niso/iso",
"-s, --schann <d40/ev1/ev2> secure channel: d40/ev1/ev2",
"--aid <app id hex> application id (3 hex bytes, big endian)",
"--fid <file id hex> file id (1 hex byte)",
"--isofid <iso file id hex> iso file id (2 hex bytes)",
"--amode <plain/mac/encrypt> file access mode: plain/mac/encrypt",
"--rawrights <access rights hex> access rights for file (hex 2 byte) r/w/rw/chg, 0x0 - 0xd key, 0xe free, 0xf denied",
"--rrights <key0/../key13/free/deny> read file access mode: the specified key, free, deny",
"--wrights <key0/../key13/free/deny> write file access mode: the specified key, free, deny",
"--rwrights <key0/../key13/free/deny> read/write file access mode: the specified key, free, deny",
"--chrights <key0/../key13/free/deny> change file settings access mode: the specified key, free, deny",
"--no-auth execute without authentication",
"--size <hex> record size (3 hex bytes, big endian, 000001 to ffffff)",
"--maxrecord <hex> max. number of records (3 hex bytes, big endian)",
"--cyclic create cyclic record file instead of linear record file"
],
"usage": "hf mfdes createrecordfile [-hav] [-n <keyno>] [-t <des/2tdea/3tdea/aes>] [-k <key>] [-f <none/an10922/gallagher>] [-i <kdfi>] [-m <plain/mac/encrypt>] [-c <native/niso/iso>] [-s <d40/ev1/ev2>] [--aid <app id hex>] [--fid <file id hex>] [--isofid <iso file id hex>] [--amode <plain/mac/encrypt>] [--rawrights <access rights hex>] [--rrights <key0/../key13/free/deny>] [--wrights <key0/../key13/free/deny>] [--rwrights <key0/../key13/free/deny>] [--chrights <key0/../key13/free/deny>] [--no-auth] [--size <hex>] [--maxrecord <hex>] [--cyclic]"
}, },
"hf mfdes createvaluefile": { "hf mfdes createvaluefile": {
"command": "hf mfdes createvaluefile", "command": "hf mfdes createvaluefile",
@ -4634,23 +4706,58 @@
], ],
"usage": "hf mfdes list [-h1fcrux] [--dict <file>]..." "usage": "hf mfdes list [-h1fcrux] [--dict <file>]..."
}, },
"hf mfdes read": { "hf mfdes lsfiles": {
"command": "hf mfdes read", "command": "hf mfdes lsfiles",
"description": "read data from file make sure to select aid or authenticate aid before running this command.", "description": "show file list. master key needs to be provided or flag --no-auth set (depend on cards settings).",
"notes": [ "notes": [
"hf mfdes read -n 1 -t 0 -o 000000 -l 000000 -a 123456", "hf mfdes lsfiles --aid 123456 -> show file list for: app=123456 with defaults from `default` command"
"hf mfdes read -n 1 -t 0 -> read all data from standard file, fileno 1"
], ],
"offline": false, "offline": false,
"options": [ "options": [
"-h, --help this help", "-h, --help this help",
"-n, --fileno <dec> file number (0 - 31)", "-a, --apdu show apdu requests and responses",
"-o, --offset <hex> file offset (3 hex bytes, big endian)", "-v, --verbose show technical data",
"-l, --length <hex> length to read (3 hex bytes, big endian -> 000000 = read all data)", "-n, --keyno <keyno> key number",
"-t, --type <dec> file type (0 = standard / backup, 1 = record)", "-t, --algo <des/2tdea/3tdea/aes> crypt algo: des, 2tdea, 3tdea, aes",
"-a, --aid <hex> app id to select (3 hex bytes, big endian)" "-k, --key <key> key for authenticate (hex 8(des), 16(2tdea or aes) or 24(3tdea) bytes)",
"-f, --kdf <none/an10922/gallagher> key derivation function (kdf): none, an10922, gallagher",
"-i, --kdfi <kdfi> kdf input (hex 1-31 bytes)",
"-m, --cmode <plain/mac/encrypt> communicaton mode: plain/mac/encrypt",
"-c, --ccset <native/niso/iso> communicaton command set: native/niso/iso",
"-s, --schann <d40/ev1/ev2> secure channel: d40/ev1/ev2",
"--aid <app id hex> application id (3 hex bytes, big endian)",
"--no-auth execute without authentication"
], ],
"usage": "hf mfdes read [-h] [-n <dec>] [-o <hex>]... [-l <hex>]... [-t <dec>] [-a <hex>]..." "usage": "hf mfdes lsfiles [-hav] [-n <keyno>] [-t <des/2tdea/3tdea/aes>] [-k <key>] [-f <none/an10922/gallagher>] [-i <kdfi>] [-m <plain/mac/encrypt>] [-c <native/niso/iso>] [-s <d40/ev1/ev2>] [--aid <app id hex>] [--no-auth]"
},
"hf mfdes read": {
"command": "hf mfdes read",
"description": "read data from file. key needs to be provided or flag --no-auth set (depend on file settings).",
"notes": [
"hf mfdes read --aid 123456 --fid 01 -> read file: app=123456, file=01, offset=0, all the data. use default channel settings from `default` command",
"hf mfdes read --aid 123456 --fid 01 --type record --offset 000000 --length 000001 -> read one last record from record file. use default channel settings from `default` command"
],
"offline": false,
"options": [
"-h, --help this help",
"-a, --apdu show apdu requests and responses",
"-v, --verbose show technical data",
"-n, --keyno <keyno> key number",
"-t, --algo <des/2tdea/3tdea/aes> crypt algo: des, 2tdea, 3tdea, aes",
"-k, --key <key> key for authenticate (hex 8(des), 16(2tdea or aes) or 24(3tdea) bytes)",
"-f, --kdf <none/an10922/gallagher> key derivation function (kdf): none, an10922, gallagher",
"-i, --kdfi <kdfi> kdf input (hex 1-31 bytes)",
"-m, --cmode <plain/mac/encrypt> communicaton mode: plain/mac/encrypt",
"-c, --ccset <native/niso/iso> communicaton command set: native/niso/iso",
"-s, --schann <d40/ev1/ev2> secure channel: d40/ev1/ev2",
"--aid <app id hex> application id (3 hex bytes, big endian)",
"--fid <file id hex> file id (1 hex byte)",
"--no-auth execute without authentication",
"--type <auto/data/value/record/mac> file type auto/data(standard/backup)/value/record(linear/cyclic)/mac). auto - check file settings and then read. default: auto",
"-o, --offset <hex> file offset (3 hex bytes, big endian). for records - record number (0 - lastest record). default 0",
"-l, --length <hex> length to read (3 hex bytes, big endian -> 000000 = read all data). for records - records count (0 - all). default 0."
],
"usage": "hf mfdes read [-hav] [-n <keyno>] [-t <des/2tdea/3tdea/aes>] [-k <key>] [-f <none/an10922/gallagher>] [-i <kdfi>] [-m <plain/mac/encrypt>] [-c <native/niso/iso>] [-s <d40/ev1/ev2>] [--aid <app id hex>] [--fid <file id hex>] [--no-auth] [--type <auto/data/value/record/mac>] [-o <hex>] [-l <hex>]"
}, },
"hf mfdes selectaid": { "hf mfdes selectaid": {
"command": "hf mfdes selectaid", "command": "hf mfdes selectaid",
@ -4734,20 +4841,42 @@
}, },
"hf mfdes write": { "hf mfdes write": {
"command": "hf mfdes write", "command": "hf mfdes write",
"description": "write data to file make sure to select aid or authenticate aid before running this command.", "description": "write data from file. key needs to be provided or flag --no-auth set (depend on file settings).",
"notes": [ "notes": [
"hf mfdes write -n 01 -t 0 -o 000000 -d 3132333435363738" "hf mfdes write --aid 123456 --fid 01 -d 01020304 -> write file: app=123456, file=01, offset=0, get file type from card. use default channel settings from `default` command",
"hf mfdes write --aid 123456 --fid 01 --type data -d 01020304 --0ffset 000100 -> write data to std file with offset 0x100",
"hf mfdes write --aid 123456 --fid 01 --type data -d 01020304 --commit -> write data to backup file with commit",
"hf mfdes write --aid 123456 --fid 01 --type value -d 00000001 -> increment value file",
"hf mfdes write --aid 123456 --fid 01 --type value -d 00000001 --debit -> decrement value file",
"hf mfdes write --aid 123456 --fid 01 -d 01020304 -> write data to record file with `auto` type",
"hf mfdes write --aid 123456 --fid 01 --type record -d 01020304 -> write data to record file",
"hf mfdes write --aid 123456 --fid 01 --type record -d 01020304 --updaterec 0 -> update record in the record file. record 0 - lastest record.",
"hf mfdes write --aid 123456 --fid 01 --type record --offset 000000 -d 11223344 -> write record to record file. use default channel settings from `default` command"
], ],
"offline": false, "offline": false,
"options": [ "options": [
"-h, --help this help", "-h, --help this help",
"-n, --fileno <dec> file number (0 - 31)", "-a, --apdu show apdu requests and responses",
"-o, --offset <hex> file offset (3 hex bytes, big endian), optional", "-v, --verbose show technical data",
"-d, --data <hex> data to write (hex bytes, 256 bytes max)", "-n, --keyno <keyno> key number",
"-t, --type <dec> file type (0 = standard / backup, 1 = record)", "-t, --algo <des/2tdea/3tdea/aes> crypt algo: des, 2tdea, 3tdea, aes",
"-a, --aid <hex> app id to select as hex bytes (3 bytes, big endian)" "-k, --key <key> key for authenticate (hex 8(des), 16(2tdea or aes) or 24(3tdea) bytes)",
"-f, --kdf <none/an10922/gallagher> key derivation function (kdf): none, an10922, gallagher",
"-i, --kdfi <kdfi> kdf input (hex 1-31 bytes)",
"-m, --cmode <plain/mac/encrypt> communicaton mode: plain/mac/encrypt",
"-c, --ccset <native/niso/iso> communicaton command set: native/niso/iso",
"-s, --schann <d40/ev1/ev2> secure channel: d40/ev1/ev2",
"--aid <app id hex> application id (3 hex bytes, big endian)",
"--fid <file id hex> file id (1 hex byte)",
"--no-auth execute without authentication",
"--type <auto/data/value/record/mac> file type auto/data(standard/backup)/value/record(linear/cyclic)/mac). auto - check file settings and then write. default: auto",
"-o, --offset <hex> file offset (3 hex bytes, big endian). for records - record number (0 - lastest record). default 0",
"-d, --data <hex> data for write (data/record file), credit/debit(value file)",
"--debit use for value file debit operation instead of credit",
"--commit commit needs for backup file only. for the other file types and in the `auto` mode - command set it automatically.",
"--updaterec <record number dec> record number for update record command. updates record instead of write. lastest record - 0"
], ],
"usage": "hf mfdes write [-h] [-n <dec>] [-o <hex>]... [-d <hex>]... [-t <dec>] [-a <hex>]..." "usage": "hf mfdes write [-hav] [-n <keyno>] [-t <des/2tdea/3tdea/aes>] [-k <key>] [-f <none/an10922/gallagher>] [-i <kdfi>] [-m <plain/mac/encrypt>] [-c <native/niso/iso>] [-s <d40/ev1/ev2>] [--aid <app id hex>] [--fid <file id hex>] [--no-auth] [--type <auto/data/value/record/mac>] [-o <hex>] [-d <hex>] [--debit] [--commit] [--updaterec <record number dec>]"
}, },
"hf mfp auth": { "hf mfp auth": {
"command": "hf mfp auth", "command": "hf mfp auth",
@ -5531,8 +5660,8 @@
"command": "hw connect", "command": "hw connect",
"description": "connects to a proxmark3 device via specified serial port. baudrate here is only for physical uart or uart-bt, not for usb-cdc or blue shark add-on", "description": "connects to a proxmark3 device via specified serial port. baudrate here is only for physical uart or uart-bt, not for usb-cdc or blue shark add-on",
"notes": [ "notes": [
"hw connect -p com3", "hw connect -p /dev/ttyacm0",
"hw connect -p com3 -b 115200" "hw connect -p /dev/ttyacm0 -b 115200"
], ],
"offline": true, "offline": true,
"options": [ "options": [
@ -6750,7 +6879,8 @@
"lf config -> shows current config", "lf config -> shows current config",
"lf config -b 8 --125 -> samples at 125 khz, 8 bps", "lf config -b 8 --125 -> samples at 125 khz, 8 bps",
"lf config -b 4 --134 --dec 3 -> samples at 134 khz, averages three samples into one, stored with a resolution of 4 bits per sample", "lf config -b 4 --134 --dec 3 -> samples at 134 khz, averages three samples into one, stored with a resolution of 4 bits per sample",
"lf config --trig 20 -s 10000 -> trigger sampling when above 20, skip 10 000 first samples after triggered" "lf config --trig 20 -s 10000 -> trigger sampling when above 20, skip 10 000 first samples after triggered",
"lf config --reset -> reset back to default values"
], ],
"offline": true, "offline": true,
"options": [ "options": [
@ -9682,8 +9812,8 @@
} }
}, },
"metadata": { "metadata": {
"commands_extracted": 585, "commands_extracted": 587,
"extracted_by": "PM3Help2JSON v1.00", "extracted_by": "PM3Help2JSON v1.00",
"extracted_on": "2021-07-26T14:56:39" "extracted_on": "2021-07-29T12:40:22"
} }
} }

View file

@ -525,17 +525,19 @@ Check column "offline" for their availability.
|`hf mfdes getappnames `|N |`[new]Get Applications list` |`hf mfdes getappnames `|N |`[new]Get Applications list`
|`hf mfdes getfileids `|N |`[new]Get File IDs list` |`hf mfdes getfileids `|N |`[new]Get File IDs list`
|`hf mfdes getfileisoids `|N |`[new]Get File ISO IDs list` |`hf mfdes getfileisoids `|N |`[new]Get File ISO IDs list`
|`hf mfdes getfilesettings`|N |`[new]Get file settings` |`hf mfdes lsfiles `|N |`[new]Show all files list`
|`hf mfdes chfilesettings`|N |`[new]Change file settings` |`hf mfdes dump `|N |`Dump all files`
|`hf mfdes clearfile `|N |`Clear record File`
|`hf mfdes createfile `|N |`[new]Create Standard/Backup File` |`hf mfdes createfile `|N |`[new]Create Standard/Backup File`
|`hf mfdes createvaluefile`|N |`[new]Create Value File` |`hf mfdes createvaluefile`|N |`[new]Create Value File`
|`hf mfdes createrecordfile`|N |`Create Linear/Cyclic Record File` |`hf mfdes createrecordfile`|N |`[new]Create Linear/Cyclic Record File`
|`hf mfdes createmacfile `|N |`[new]Create Transaction MAC File`
|`hf mfdes deletefile `|N |`[new]Delete File` |`hf mfdes deletefile `|N |`[new]Delete File`
|`hf mfdes dump `|N |`Dump all files` |`hf mfdes getfilesettings`|N |`[new]Get file settings`
|`hf mfdes chfilesettings`|N |`[new]Change file settings`
|`hf mfdes read `|N |`[new]Read data from standard/backup/record/value/mac file`
|`hf mfdes write `|N |`[new]Write data to standard/backup/record/value file`
|`hf mfdes value `|N |`[new]Operations with value file (get/credit/limited credit/debit/clear)` |`hf mfdes value `|N |`[new]Operations with value file (get/credit/limited credit/debit/clear)`
|`hf mfdes read `|N |`Read data from standard/backup/record file` |`hf mfdes clearrecfile `|N |`[new]Clear record File`
|`hf mfdes write `|N |`Write data to standard/backup/record file`
|`hf mfdes test `|Y |`Test crypto` |`hf mfdes test `|Y |`Test crypto`