mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-20 05:13:46 -07:00
make style
This commit is contained in:
parent
91af65353a
commit
2441b24124
7 changed files with 114 additions and 102 deletions
|
@ -5759,7 +5759,7 @@ static int DesfileReadFileAndPrint(DesfireContext *dctx, uint8_t fnum, int filet
|
||||||
DesfireSetCommMode(dctx, commMode);
|
DesfireSetCommMode(dctx, commMode);
|
||||||
|
|
||||||
if (res == PM3_SUCCESS) {
|
if (res == PM3_SUCCESS) {
|
||||||
switch(fsettings.fileType) {
|
switch (fsettings.fileType) {
|
||||||
case 0x00:
|
case 0x00:
|
||||||
case 0x01: {
|
case 0x01: {
|
||||||
filetype = RFTData;
|
filetype = RFTData;
|
||||||
|
@ -5791,9 +5791,9 @@ static int DesfileReadFileAndPrint(DesfireContext *dctx, uint8_t fnum, int filet
|
||||||
|
|
||||||
if (verbose)
|
if (verbose)
|
||||||
PrintAndLogEx(INFO, "Got file type: %s. Option: %s. comm mode: %s",
|
PrintAndLogEx(INFO, "Got file type: %s. Option: %s. comm mode: %s",
|
||||||
GetDesfireFileType(fsettings.fileType),
|
GetDesfireFileType(fsettings.fileType),
|
||||||
CLIGetOptionListStr(DesfireReadFileTypeOpts, filetype),
|
CLIGetOptionListStr(DesfireReadFileTypeOpts, filetype),
|
||||||
CLIGetOptionListStr(DesfireCommunicationModeOpts, fsettings.commMode));
|
CLIGetOptionListStr(DesfireCommunicationModeOpts, fsettings.commMode));
|
||||||
} else {
|
} else {
|
||||||
PrintAndLogEx(WARNING, "GetFileSettings error. Can't get file type.");
|
PrintAndLogEx(WARNING, "GetFileSettings error. Can't get file type.");
|
||||||
}
|
}
|
||||||
|
@ -6118,7 +6118,7 @@ static int CmdHF14ADesWriteData(const char *Cmd) {
|
||||||
DesfireSetCommMode(&dctx, commMode);
|
DesfireSetCommMode(&dctx, commMode);
|
||||||
|
|
||||||
if (res == PM3_SUCCESS) {
|
if (res == PM3_SUCCESS) {
|
||||||
switch(fsettings.fileType) {
|
switch (fsettings.fileType) {
|
||||||
case 0x00:
|
case 0x00:
|
||||||
case 0x01: {
|
case 0x01: {
|
||||||
op = RFTData;
|
op = RFTData;
|
||||||
|
@ -6155,9 +6155,9 @@ static int CmdHF14ADesWriteData(const char *Cmd) {
|
||||||
|
|
||||||
if (verbose)
|
if (verbose)
|
||||||
PrintAndLogEx(INFO, "Got file type: %s. Option: %s. comm mode: %s",
|
PrintAndLogEx(INFO, "Got file type: %s. Option: %s. comm mode: %s",
|
||||||
GetDesfireFileType(fsettings.fileType),
|
GetDesfireFileType(fsettings.fileType),
|
||||||
CLIGetOptionListStr(DesfireReadFileTypeOpts, op),
|
CLIGetOptionListStr(DesfireReadFileTypeOpts, op),
|
||||||
CLIGetOptionListStr(DesfireCommunicationModeOpts, fsettings.commMode));
|
CLIGetOptionListStr(DesfireCommunicationModeOpts, fsettings.commMode));
|
||||||
} else {
|
} else {
|
||||||
PrintAndLogEx(WARNING, "GetFileSettings error. Can't get file type.");
|
PrintAndLogEx(WARNING, "GetFileSettings error. Can't get file type.");
|
||||||
}
|
}
|
||||||
|
|
|
@ -391,7 +391,7 @@ static int DesfireExchangeNative(bool activate_field, DesfireContext *ctx, uint8
|
||||||
size_t len = 0;
|
size_t len = 0;
|
||||||
// tx chaining
|
// tx chaining
|
||||||
size_t sentdatalen = 0;
|
size_t sentdatalen = 0;
|
||||||
while(cdatalen >= sentdatalen) {
|
while (cdatalen >= sentdatalen) {
|
||||||
if (cdatalen - sentdatalen > DESFIRE_TX_FRAME_MAX_LEN)
|
if (cdatalen - sentdatalen > DESFIRE_TX_FRAME_MAX_LEN)
|
||||||
len = DESFIRE_TX_FRAME_MAX_LEN;
|
len = DESFIRE_TX_FRAME_MAX_LEN;
|
||||||
else
|
else
|
||||||
|
@ -498,7 +498,7 @@ static int DesfireExchangeISO(bool activate_field, DesfireContext *ctx, uint8_t
|
||||||
int res = 0;
|
int res = 0;
|
||||||
// tx chaining
|
// tx chaining
|
||||||
size_t sentdatalen = 0;
|
size_t sentdatalen = 0;
|
||||||
while(datalen >= sentdatalen) {
|
while (datalen >= sentdatalen) {
|
||||||
if (datalen - sentdatalen > DESFIRE_TX_FRAME_MAX_LEN)
|
if (datalen - sentdatalen > DESFIRE_TX_FRAME_MAX_LEN)
|
||||||
apdu.Lc = DESFIRE_TX_FRAME_MAX_LEN;
|
apdu.Lc = DESFIRE_TX_FRAME_MAX_LEN;
|
||||||
else
|
else
|
||||||
|
@ -1542,13 +1542,13 @@ void DesfirePrintFileSettingsOneLine(FileSettingsS *fsettings) {
|
||||||
}
|
}
|
||||||
case 0x02: {
|
case 0x02: {
|
||||||
PrintAndLogEx(NORMAL, "[%d .. %d] lim cred: 0x%02x (%d [0x%x]) " NOLF,
|
PrintAndLogEx(NORMAL, "[%d .. %d] lim cred: 0x%02x (%d [0x%x]) " NOLF,
|
||||||
fsettings->lowerLimit, fsettings->upperLimit, fsettings->limitedCredit, fsettings->value, fsettings->value);
|
fsettings->lowerLimit, fsettings->upperLimit, fsettings->limitedCredit, fsettings->value, fsettings->value);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 0x03:
|
case 0x03:
|
||||||
case 0x04: {
|
case 0x04: {
|
||||||
PrintAndLogEx(NORMAL, "%d/%d record size: %d [0x%x]b " NOLF,
|
PrintAndLogEx(NORMAL, "%d/%d record size: %d [0x%x]b " NOLF,
|
||||||
fsettings->curRecordCount, fsettings->maxRecordCount, fsettings->recordSize, fsettings->recordSize);
|
fsettings->curRecordCount, fsettings->maxRecordCount, fsettings->recordSize, fsettings->recordSize);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 0x05: {
|
case 0x05: {
|
||||||
|
@ -1561,10 +1561,10 @@ void DesfirePrintFileSettingsOneLine(FileSettingsS *fsettings) {
|
||||||
}
|
}
|
||||||
|
|
||||||
PrintAndLogEx(NORMAL, "(%s %s %s %s)",
|
PrintAndLogEx(NORMAL, "(%s %s %s %s)",
|
||||||
GetDesfireAccessRightStr(fsettings->rAccess),
|
GetDesfireAccessRightStr(fsettings->rAccess),
|
||||||
GetDesfireAccessRightStr(fsettings->wAccess),
|
GetDesfireAccessRightStr(fsettings->wAccess),
|
||||||
GetDesfireAccessRightStr(fsettings->rwAccess),
|
GetDesfireAccessRightStr(fsettings->rwAccess),
|
||||||
GetDesfireAccessRightStr(fsettings->chAccess));
|
GetDesfireAccessRightStr(fsettings->chAccess));
|
||||||
}
|
}
|
||||||
|
|
||||||
void DesfirePrintFileSettingsExtended(FileSettingsS *fsettings) {
|
void DesfirePrintFileSettingsExtended(FileSettingsS *fsettings) {
|
||||||
|
@ -1603,11 +1603,11 @@ void DesfirePrintFileSettingsExtended(FileSettingsS *fsettings) {
|
||||||
}
|
}
|
||||||
|
|
||||||
PrintAndLogEx(SUCCESS, "Access rights : %04x (r: %s w: %s rw: %s change: %s)",
|
PrintAndLogEx(SUCCESS, "Access rights : %04x (r: %s w: %s rw: %s change: %s)",
|
||||||
fsettings->rawAccessRights,
|
fsettings->rawAccessRights,
|
||||||
GetDesfireAccessRightStr(fsettings->rAccess),
|
GetDesfireAccessRightStr(fsettings->rAccess),
|
||||||
GetDesfireAccessRightStr(fsettings->wAccess),
|
GetDesfireAccessRightStr(fsettings->wAccess),
|
||||||
GetDesfireAccessRightStr(fsettings->rwAccess),
|
GetDesfireAccessRightStr(fsettings->rwAccess),
|
||||||
GetDesfireAccessRightStr(fsettings->chAccess));
|
GetDesfireAccessRightStr(fsettings->chAccess));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -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 /home/iceman/.proxmark3/logs/log_20210729.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 e:\\proxspace\\pm3/.proxmark3/logs/log_20210729.txt --------------------------------------------------------------------------------------- auto available offline: no run lf search / hf search / data plot / data save",
|
||||||
"notes": [
|
"notes": [
|
||||||
"auto"
|
"auto"
|
||||||
],
|
],
|
||||||
|
@ -4390,15 +4390,27 @@
|
||||||
},
|
},
|
||||||
"hf mfdes dump": {
|
"hf mfdes dump": {
|
||||||
"command": "hf mfdes dump",
|
"command": "hf mfdes dump",
|
||||||
"description": "tries to dump all files on a desfire tag",
|
"description": "for each application show fil list and then file content. key needs to be provided for authentication or flag --no-auth set (depend on cards settings).",
|
||||||
"notes": [
|
"notes": [
|
||||||
"hf mfdes dump"
|
"hf mfdes dump --aid 123456 -> show file dump for: app=123456 with channel defaults from `default` command"
|
||||||
],
|
],
|
||||||
"offline": false,
|
"offline": false,
|
||||||
"options": [
|
"options": [
|
||||||
"-h, --help this help"
|
"-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)",
|
||||||
|
"--no-auth execute without authentication"
|
||||||
],
|
],
|
||||||
"usage": "hf mfdes dump [-h]"
|
"usage": "hf mfdes dump [-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 enum": {
|
"hf mfdes enum": {
|
||||||
"command": "hf mfdes enum",
|
"command": "hf mfdes enum",
|
||||||
|
@ -5660,8 +5672,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 /dev/ttyacm0",
|
"hw connect -p com3",
|
||||||
"hw connect -p /dev/ttyacm0 -b 115200"
|
"hw connect -p com3 -b 115200"
|
||||||
],
|
],
|
||||||
"offline": true,
|
"offline": true,
|
||||||
"options": [
|
"options": [
|
||||||
|
@ -9814,6 +9826,6 @@
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"commands_extracted": 587,
|
"commands_extracted": 587,
|
||||||
"extracted_by": "PM3Help2JSON v1.00",
|
"extracted_by": "PM3Help2JSON v1.00",
|
||||||
"extracted_on": "2021-07-29T12:40:22"
|
"extracted_on": "2021-07-29T15:18:59"
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -526,7 +526,7 @@ Check column "offline" for their availability.
|
||||||
|`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 lsfiles `|N |`[new]Show all files list`
|
|`hf mfdes lsfiles `|N |`[new]Show all files list`
|
||||||
|`hf mfdes dump `|N |`Dump all files`
|
|`hf mfdes dump `|N |`[new]Dump all files`
|
||||||
|`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 |`[new]Create Linear/Cyclic Record File`
|
|`hf mfdes createrecordfile`|N |`[new]Create Linear/Cyclic Record File`
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue