diff --git a/client/src/cmdnfc.c b/client/src/cmdnfc.c index aed87f069..7afb8a718 100644 --- a/client/src/cmdnfc.c +++ b/client/src/cmdnfc.c @@ -138,6 +138,7 @@ static int CmdNFCType1Help(const char *Cmd); static command_t CommandNFCType1Table[] = { {"--------", CmdNFCType1Help, AlwaysAvailable, "-------------- " _CYAN_("NFC Forum Tag Type 1") " ---------------"}, +// {"format", CmdNFCType1Format, IfPm3Iso14443a, "format ISO-14443-a tag as NFC Tag"}, {"read", CmdNFCType1Read, IfPm3Iso14443a, "read NFC Forum Tag Type 1"}, // {"write", CmdNFCType1Write, IfPm3Iso14443a, "write NFC Forum Tag Type 1"}, {"--------", CmdNFCType1Help, AlwaysAvailable, "--------------------- " _CYAN_("General") " ---------------------"}, @@ -165,6 +166,7 @@ static int CmdNFCType2Help(const char *Cmd); static command_t CommandNFCType2Table[] = { {"--------", CmdNFCType2Help, AlwaysAvailable, "-------------- " _CYAN_("NFC Forum Tag Type 2") " ---------------"}, +// {"format", CmdNFCType2Format, IfPm3Iso14443a, "format ISO-14443-a tag as NFC Tag"}, {"read", CmdNFCType2Read, IfPm3Iso14443a, "read NFC Forum Tag Type 2"}, // {"write", CmdNFCType2Write, IfPm3Iso14443a, "write NFC Forum Tag Type 2"}, {"--------", CmdNFCType2Help, AlwaysAvailable, "--------------------- " _CYAN_("General") " ---------------------"}, @@ -193,8 +195,9 @@ static int CmdNFCType3Help(const char *Cmd); static command_t CommandNFCType3Table[] = { {"--------", CmdNFCType3Help, AlwaysAvailable, "-------------- " _CYAN_("NFC Forum Tag Type 3") " ---------------"}, +// {"format", CmdNFCType3Format, IfPm3Felica, "format FeliCa tag as NFC Tag"}, {"read", CmdNFCType3Read, IfPm3Felica, "read NFC Forum Tag Type 3"}, - {"write", CmdNFCType3Write, IfPm3Felica, "write NFC Forum Tag Type 3"}, +// {"write", CmdNFCType3Write, IfPm3Felica, "write NFC Forum Tag Type 3"}, {"--------", CmdNFCType3Help, AlwaysAvailable, "--------------------- " _CYAN_("General") " ---------------------"}, {"help", CmdNFCType3Help, AlwaysAvailable, "This help"}, {NULL, NULL, NULL, NULL} @@ -225,6 +228,7 @@ static int CmdNFCType4AHelp(const char *Cmd); static command_t CommandNFCType4ATable[] = { {"--------", CmdNFCType4AHelp, AlwaysAvailable, "--------- " _CYAN_("NFC Forum Tag Type 4 ISO14443A") " ----------"}, +// {"format", CmdNFCType4AFormat, IfPm3Iso14443a, "format ISO-14443-a tag as NFC Tag"}, {"read", CmdNFCType4ARead, IfPm3Iso14443a, "read NFC Forum Tag Type 4 A"}, // {"write", CmdNFCType4AWrite, IfPm3Iso14443a, "write NFC Forum Tag Type 4 A"}, // {"mfdesread", CmdNFCMFDESRead, IfPm3Iso14443a, "read NDEF from MIFARE DESfire"}, // hf mfdes ndefread @@ -256,6 +260,7 @@ static int CmdNFCType4BHelp(const char *Cmd); static command_t CommandNFCType4BTable[] = { {"--------", CmdNFCType4BHelp, AlwaysAvailable, "--------- " _CYAN_("NFC Forum Tag Type 4 ISO14443B") " -------------"}, +// {"format", CmdNFCType4BFormat, IfPm3Iso14443b, "format ISO-14443-b tag as NFC Tag"}, {"read", CmdNFCType4BRead, IfPm3Iso14443b, "read NFC Forum Tag Type 4 B"}, // {"write", CmdNFCType4BWrite, IfPm3Iso14443b, "write NFC Forum Tag Type 4 B"}, {"--------", CmdNFCType4BHelp, AlwaysAvailable, "--------------------- " _CYAN_("General") " ---------------------"}, @@ -284,8 +289,9 @@ static int CmdNFCType5Help(const char *Cmd); static command_t CommandNFCType5Table[] = { {"--------", CmdNFCType5Help, AlwaysAvailable, "-------------- " _CYAN_("NFC Forum Tag Type 5") " ---------------"}, +// {"format", CmdNFCType5Format, IfPm3Iso15693, "format ISO-15693 tag as NFC Tag"}, {"read", CmdNFCType5Read, IfPm3Iso15693, "read NFC Forum Tag Type 5"}, - {"write", CmdNFCType5Write, IfPm3Iso15693, "write NFC Forum Tag Type 5"}, +// {"write", CmdNFCType5Write, IfPm3Iso15693, "write NFC Forum Tag Type 5"}, {"--------", CmdNFCType5Help, AlwaysAvailable, "--------------------- " _CYAN_("General") " ---------------------"}, {"help", CmdNFCType5Help, AlwaysAvailable, "This help"}, {NULL, NULL, NULL, NULL} @@ -311,6 +317,11 @@ static int CmdNFCMFCFormat(const char *Cmd) { return CmdHFMFNDEFFormat(Cmd); } +static int CmdNFCMFCWrite(const char *Cmd) { + return CmdHFMFNDEFWrite(Cmd); +} + + static int CmdNFCMFPRead(const char *Cmd) { return CmdHFMFPNDEFRead(Cmd); } @@ -320,9 +331,9 @@ static int CmdNFCMFHelp(const char *Cmd); static command_t CommandMFTable[] = { {"--------", CmdNFCMFHelp, AlwaysAvailable, "--------- " _CYAN_("NFC Type MIFARE Classic/Plus Tag") " --------"}, - {"cread", CmdNFCMFCRead, IfPm3Iso14443a, "read NFC Type MIFARE Classic Tag"}, -// {"cwrite", CmdNFCMFCWrite, IfPm3Iso14443a, "write NFC Type MIFARE Classic Tag"}, {"cformat", CmdNFCMFCFormat, IfPm3Iso14443a, "format MIFARE Classic Tag as NFC Tag"}, + {"cread", CmdNFCMFCRead, IfPm3Iso14443a, "read NFC Type MIFARE Classic Tag"}, + {"cwrite", CmdNFCMFCWrite, IfPm3Iso14443a, "write NFC Type MIFARE Classic Tag"}, {"pread", CmdNFCMFPRead, IfPm3Iso14443a, "read NFC Type MIFARE Plus Tag"}, {"--------", CmdNFCMFHelp, AlwaysAvailable, "--------------------- " _CYAN_("General") " ---------------------"}, {"help", CmdNFCMFHelp, AlwaysAvailable, "This help"}, @@ -391,6 +402,7 @@ static command_t CommandTable[] = { {"--------", CmdHelp, AlwaysAvailable, "--------------------- " _CYAN_("General") " ---------------------"}, {"help", CmdHelp, AlwaysAvailable, "This help"}, {"decode", CmdNfcDecode, AlwaysAvailable, "Decode NDEF records"}, +// {"encode", CmdNfcEncode, AlwaysAvailable, "Encode NDEF records"}, {NULL, NULL, NULL, NULL} }; diff --git a/client/src/pm3line_vocabulory.h b/client/src/pm3line_vocabulory.h index 9dc5c84a7..da7ccffd1 100644 --- a/client/src/pm3line_vocabulory.h +++ b/client/src/pm3line_vocabulory.h @@ -718,8 +718,9 @@ const static vocabulory_t vocabulory[] = { { 1, "nfc type4a help" }, { 0, "nfc type4b read" }, { 1, "nfc type4b help" }, - { 0, "nfc mf cread" }, { 0, "nfc mf cformat" }, + { 0, "nfc mf cread" }, + { 0, "nfc mf cwrite" }, { 0, "nfc mf pread" }, { 1, "nfc mf help" }, { 0, "nfc barcode read" }, diff --git a/doc/commands.json b/doc/commands.json index 39064b73d..d31d40d8c 100644 --- a/doc/commands.json +++ b/doc/commands.json @@ -10568,6 +10568,28 @@ ], "usage": "hf mf ndefread [-hvb] [--aid ] [-k ] [-f ]" }, + "nfc mf cwrite": { + "command": "nfc mf cwrite", + "description": "Write raw NDEF hex bytes to tag. This commands assumes tag already been NFC/NDEF formatted.", + "notes": [ + "hf mf ndefwrite -d 0300FE -> write empty record to tag", + "hf mf ndefwrite -f myfilename", + "hf mf ndefwrite -d 033fd1023a53709101195405656e2d55534963656d616e2054776974746572206c696e6b5101195502747769747465722e636f6d2f686572726d616e6e31303031" + ], + "offline": false, + "options": [ + "-h, --help This help", + "-d raw NDEF hex bytes", + "-f, --file write raw NDEF file to tag", + "-p fix NDEF record headers / terminator block if missing", + "--mini MIFARE Classic Mini / S20", + "--1k MIFARE Classic 1k / S50 (def)", + "--2k MIFARE Classic/Plus 2k", + "--4k MIFARE Classic 4k / S70", + "-v, --verbose verbose output" + ], + "usage": "hf mf ndefwrite [-hpv] [-d ] [-f ] [--mini] [--1k] [--2k] [--4k]" + }, "nfc mf help": { "command": "nfc mf help", "description": "-------- --------- NFC Type MIFARE Classic/Plus Tag -------- -------- --------------------- General --------------------- help This help", @@ -11398,8 +11420,8 @@ } }, "metadata": { - "commands_extracted": 721, + "commands_extracted": 722, "extracted_by": "PM3Help2JSON v1.00", - "extracted_on": "2022-10-23T00:39:16" + "extracted_on": "2022-10-23T01:18:01" } } \ No newline at end of file diff --git a/doc/commands.md b/doc/commands.md index bbf1aa317..e8f272b7f 100644 --- a/doc/commands.md +++ b/doc/commands.md @@ -1305,8 +1305,9 @@ Check column "offline" for their availability. |command |offline |description |------- |------- |----------- -|`nfc mf cread `|N |`read NFC Type MIFARE Classic Tag` |`nfc mf cformat `|N |`format MIFARE Classic Tag as NFC Tag` +|`nfc mf cread `|N |`read NFC Type MIFARE Classic Tag` +|`nfc mf cwrite `|N |`write NFC Type MIFARE Classic Tag` |`nfc mf pread `|N |`read NFC Type MIFARE Plus Tag` |`nfc mf help `|Y |`This help`