+//-----------------------------------------------------------------------------\r
+// Copyright (C) 2011 Merlok\r
+//\r
+// This code is licensed to you under the terms of the GNU GPL, version 2 or,\r
+// at your option, any later version. See the LICENSE.txt file for the text of\r
+// the license.\r
+//-----------------------------------------------------------------------------\r
+// High frequency MIFARE commands\r
+//-----------------------------------------------------------------------------\r
+\r
+#include "cmdhfmf.h"\r
+\r
+static int CmdHelp(const char *Cmd);\r
+\r
+\r
+int CmdHF14AMifare(const char *Cmd)\r
+{\r
+ uint32_t uid = 0;\r
+ uint32_t nt = 0;\r
+ uint64_t par_list = 0, ks_list = 0, r_key = 0;\r
+ uint8_t isOK = 0;\r
+ uint8_t keyBlock[6] = {0,0,0,0,0,0};\r
+ \r
+ if (param_getchar(Cmd, 0) && param_gethex(Cmd, 0, keyBlock, 8)) {\r
+ PrintAndLog("Nt must include 8 HEX symbols");\r
+ return 1;\r
+ }\r
+ \r
+ UsbCommand c = {CMD_READER_MIFARE, {(uint32_t)bytes_to_num(keyBlock, 4), 0, 0}};\r
+ SendCommand(&c);\r
+ \r
+ //flush queue\r
+ while (ukbhit()) getchar();\r
+\r
+ // message\r
+ printf("-------------------------------------------------------------------------\n");\r
+ printf("Executing command. It may take up to 30 min.\n");\r
+ printf("Press the key on proxmark3 device to abort proxmark3.\n");\r
+ printf("Press the key on the proxmark3 device to abort both proxmark3 and client.\n");\r
+ printf("-------------------------------------------------------------------------\n");\r
+ \r
+ // wait cycle\r
+ while (true) {\r
+ printf(".");\r
+ if (ukbhit()) {\r
+ getchar();\r
+ printf("\naborted via keyboard!\n");\r
+ break;\r
+ }\r
+ \r
+ UsbCommand * resp = WaitForResponseTimeout(CMD_ACK, 2000);\r
+ if (resp != NULL) {\r
+ isOK = resp->arg[0] & 0xff;\r
+ \r
+ uid = (uint32_t)bytes_to_num(resp->d.asBytes + 0, 4);\r
+ nt = (uint32_t)bytes_to_num(resp->d.asBytes + 4, 4);\r
+ par_list = bytes_to_num(resp->d.asBytes + 8, 8);\r
+ ks_list = bytes_to_num(resp->d.asBytes + 16, 8);\r
+ \r
+ printf("\n\n");\r
+ PrintAndLog("isOk:%02x", isOK);\r
+ if (!isOK) PrintAndLog("Proxmark can't get statistic info. Execution aborted.\n");\r
+ break;\r
+ }\r
+ } \r
+ printf("\n");\r
+ \r
+ // error\r
+ if (isOK != 1) return 1;\r
+ \r
+ // execute original function from util nonce2key\r
+ if (nonce2key(uid, nt, par_list, ks_list, &r_key)) return 2;\r
+ printf("------------------------------------------------------------------\n");\r
+ PrintAndLog("Key found:%012llx \n", r_key);\r
+\r
+ num_to_bytes(r_key, 6, keyBlock);\r
+ isOK = mfCheckKeys(0, 0, 1, keyBlock, &r_key);\r
+ if (!isOK) \r
+ PrintAndLog("Found valid key:%012llx", r_key);\r
+ else\r
+ PrintAndLog("Found invalid key. ( Nt=%08x", nt); \r
+ \r
+ \r
+ return 0;\r
+}\r
+\r
+int CmdHF14AMfWrBl(const char *Cmd)\r
+{\r
+ uint8_t blockNo = 0;\r
+ uint8_t keyType = 0;\r
+ uint8_t key[6] = {0, 0, 0, 0, 0, 0};\r
+ uint8_t bldata[16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};\r
+ \r
+ char cmdp = 0x00;\r
+\r
+ if (strlen(Cmd)<3) {\r
+ PrintAndLog("Usage: hf mf wrbl <block number> <key A/B> <key (12 hex symbols)> <block data (32 hex symbols)>");\r
+ PrintAndLog(" sample: hf mf wrbl 0 A FFFFFFFFFFFF 000102030405060708090A0B0C0D0E0F");\r
+ return 0;\r
+ } \r
+\r
+ blockNo = param_get8(Cmd, 0);\r
+ cmdp = param_getchar(Cmd, 1);\r
+ if (cmdp == 0x00) {\r
+ PrintAndLog("Key type must be A or B");\r
+ return 1;\r
+ }\r
+ if (cmdp != 'A' && cmdp != 'a') keyType = 1;\r
+ if (param_gethex(Cmd, 2, key, 12)) {\r
+ PrintAndLog("Key must include 12 HEX symbols");\r
+ return 1;\r
+ }\r
+ if (param_gethex(Cmd, 3, bldata, 32)) {\r
+ PrintAndLog("Block data must include 32 HEX symbols");\r
+ return 1;\r
+ }\r
+ PrintAndLog("--block no:%02x key type:%02x key:%s", blockNo, keyType, sprint_hex(key, 6));\r
+ PrintAndLog("--data: %s", sprint_hex(bldata, 16));\r
+ \r
+ UsbCommand c = {CMD_MIFARE_WRITEBL, {blockNo, keyType, 0}};\r
+ memcpy(c.d.asBytes, key, 6);\r
+ memcpy(c.d.asBytes + 10, bldata, 16);\r
+ SendCommand(&c);\r
+ UsbCommand * resp = WaitForResponseTimeout(CMD_ACK, 1500);\r
+\r
+ if (resp != NULL) {\r
+ uint8_t isOK = resp->arg[0] & 0xff;\r
+\r
+ PrintAndLog("isOk:%02x", isOK);\r
+ } else {\r
+ PrintAndLog("Command execute timeout");\r
+ }\r
+\r
+ return 0;\r
+}\r
+\r
+int CmdHF14AMfRdBl(const char *Cmd)\r
+{\r
+ uint8_t blockNo = 0;\r
+ uint8_t keyType = 0;\r
+ uint8_t key[6] = {0, 0, 0, 0, 0, 0};\r
+ \r
+ char cmdp = 0x00;\r
+\r
+\r
+ if (strlen(Cmd)<3) {\r
+ PrintAndLog("Usage: hf mf rdbl <block number> <key A/B> <key (12 hex symbols)>");\r
+ PrintAndLog(" sample: hf mf rdbl 0 A FFFFFFFFFFFF ");\r
+ return 0;\r
+ } \r
+ \r
+ blockNo = param_get8(Cmd, 0);\r
+ cmdp = param_getchar(Cmd, 1);\r
+ if (cmdp == 0x00) {\r
+ PrintAndLog("Key type must be A or B");\r
+ return 1;\r
+ }\r
+ if (cmdp != 'A' && cmdp != 'a') keyType = 1;\r
+ if (param_gethex(Cmd, 2, key, 12)) {\r
+ PrintAndLog("Key must include 12 HEX symbols");\r
+ return 1;\r
+ }\r
+ PrintAndLog("--block no:%02x key type:%02x key:%s ", blockNo, keyType, sprint_hex(key, 6));\r
+ \r
+ UsbCommand c = {CMD_MIFARE_READBL, {blockNo, keyType, 0}};\r
+ memcpy(c.d.asBytes, key, 6);\r
+ SendCommand(&c);\r
+ UsbCommand * resp = WaitForResponseTimeout(CMD_ACK, 1500);\r
+\r
+ if (resp != NULL) {\r
+ uint8_t isOK = resp->arg[0] & 0xff;\r
+ uint8_t * data = resp->d.asBytes;\r
+\r
+ if (isOK)\r
+ PrintAndLog("isOk:%02x data:%s", isOK, sprint_hex(data, 16));\r
+ else\r
+ PrintAndLog("isOk:%02x", isOK);\r
+ } else {\r
+ PrintAndLog("Command execute timeout");\r
+ }\r
+\r
+ return 0;\r
+}\r
+\r
+int CmdHF14AMfRdSc(const char *Cmd)\r
+{\r
+ int i;\r
+ uint8_t sectorNo = 0;\r
+ uint8_t keyType = 0;\r
+ uint8_t key[6] = {0, 0, 0, 0, 0, 0};\r
+ \r
+ uint8_t isOK = 0;\r
+ uint8_t * data = NULL;\r
+\r
+ char cmdp = 0x00;\r
+\r
+ if (strlen(Cmd)<3) {\r
+ PrintAndLog("Usage: hf mf rdsc <sector number> <key A/B> <key (12 hex symbols)>");\r
+ PrintAndLog(" sample: hf mf rdsc 0 A FFFFFFFFFFFF ");\r
+ return 0;\r
+ } \r
+ \r
+ sectorNo = param_get8(Cmd, 0);\r
+ if (sectorNo > 63) {\r
+ PrintAndLog("Sector number must be less than 64");\r
+ return 1;\r
+ }\r
+ cmdp = param_getchar(Cmd, 1);\r
+ if (cmdp == 0x00) {\r
+ PrintAndLog("Key type must be A or B");\r
+ return 1;\r
+ }\r
+ if (cmdp != 'A' && cmdp != 'a') keyType = 1;\r
+ if (param_gethex(Cmd, 2, key, 12)) {\r
+ PrintAndLog("Key must include 12 HEX symbols");\r
+ return 1;\r
+ }\r
+ PrintAndLog("--sector no:%02x key type:%02x key:%s ", sectorNo, keyType, sprint_hex(key, 6));\r
+ \r
+ UsbCommand c = {CMD_MIFARE_READSC, {sectorNo, keyType, 0}};\r
+ memcpy(c.d.asBytes, key, 6);\r
+ SendCommand(&c);\r
+ UsbCommand * resp = WaitForResponseTimeout(CMD_ACK, 1500);\r
+ PrintAndLog(" ");\r
+\r
+ if (resp != NULL) {\r
+ isOK = resp->arg[0] & 0xff;\r
+ data = resp->d.asBytes;\r
+\r
+ PrintAndLog("isOk:%02x", isOK);\r
+ if (isOK) \r
+ for (i = 0; i < 2; i++) {\r
+ PrintAndLog("data:%s", sprint_hex(data + i * 16, 16));\r
+ }\r
+ } else {\r
+ PrintAndLog("Command1 execute timeout");\r
+ }\r
+\r
+ // response2\r
+ resp = WaitForResponseTimeout(CMD_ACK, 500);\r
+ PrintAndLog(" ");\r
+\r
+ if (resp != NULL) {\r
+ isOK = resp->arg[0] & 0xff;\r
+ data = resp->d.asBytes;\r
+\r
+ if (isOK) \r
+ for (i = 0; i < 2; i++) {\r
+ PrintAndLog("data:%s", sprint_hex(data + i * 16, 16));\r
+ }\r
+ } else {\r
+ PrintAndLog("Command2 execute timeout");\r
+ }\r
+ \r
+ return 0;\r
+}\r
+\r
+int CmdHF14AMfNested(const char *Cmd)\r
+{\r
+ int i, j, res, iterations;\r
+ sector * e_sector = NULL;\r
+ uint8_t blockNo = 0;\r
+ uint8_t keyType = 0;\r
+ uint8_t trgBlockNo = 0;\r
+ uint8_t trgKeyType = 0;\r
+ uint8_t blDiff = 0;\r
+ int SectorsCnt = 0;\r
+ uint8_t key[6] = {0, 0, 0, 0, 0, 0};\r
+ uint8_t keyBlock[16 * 6];\r
+ uint64_t key64 = 0;\r
+ \r
+ char cmdp, ctmp;\r
+\r
+ if (strlen(Cmd)<3) {\r
+ PrintAndLog("Usage:");\r
+ PrintAndLog(" all sectors: hf mf nested <card memory> <block number> <key A/B> <key (12 hex symbols)>");\r
+ PrintAndLog(" one sector: hf mf nested o <block number> <key A/B> <key (12 hex symbols)>");\r
+ PrintAndLog(" <target block number> <target key A/B>");\r
+ PrintAndLog("card memory - 0 - MINI(320 bytes), 1 - 1K, 2 - 2K, 4 - 4K, <other> - 1K");\r
+ PrintAndLog(" ");\r
+ PrintAndLog(" sample1: hf mf nested 1 0 A FFFFFFFFFFFF ");\r
+ PrintAndLog(" sample2: hf mf nested o 0 A FFFFFFFFFFFF 4 A");\r
+ return 0;\r
+ } \r
+ \r
+ cmdp = param_getchar(Cmd, 0);\r
+ blockNo = param_get8(Cmd, 1);\r
+ ctmp = param_getchar(Cmd, 2);\r
+ if (ctmp == 0x00) {\r
+ PrintAndLog("Key type must be A or B");\r
+ return 1;\r
+ }\r
+ if (ctmp != 'A' && ctmp != 'a') keyType = 1;\r
+ if (param_gethex(Cmd, 3, key, 12)) {\r
+ PrintAndLog("Key must include 12 HEX symbols");\r
+ return 1;\r
+ }\r
+ \r
+ if (cmdp =='o' || cmdp == 'O') {\r
+ cmdp = 'o';\r
+ trgBlockNo = param_get8(Cmd, 4);\r
+ ctmp = param_getchar(Cmd, 5);\r
+ if (ctmp == 0x00) {\r
+ PrintAndLog("Target key type must be A or B");\r
+ return 1;\r
+ }\r
+ if (ctmp != 'A' && ctmp != 'a') trgKeyType = 1;\r
+ } else {\r
+ switch (cmdp) {\r
+ case '0': SectorsCnt = 05; break;\r
+ case '1': SectorsCnt = 16; break;\r
+ case '2': SectorsCnt = 32; break;\r
+ case '4': SectorsCnt = 64; break;\r
+ default: SectorsCnt = 16;\r
+ }\r
+ }\r
+ \r
+ PrintAndLog("--block no:%02x key type:%02x key:%s ", blockNo, keyType, sprint_hex(key, 6));\r
+ if (cmdp == 'o')\r
+ PrintAndLog("--target block no:%02x target key type:%02x ", trgBlockNo, trgKeyType);\r
+\r
+ if (cmdp == 'o') {\r
+ if (mfnested(blockNo, keyType, key, trgBlockNo, trgKeyType, keyBlock)) {\r
+ PrintAndLog("Nested error.");\r
+ return 2;\r
+ }\r
+\r
+ for (i = 0; i < 16; i++) {\r
+ PrintAndLog("cnt=%d key= %s", i, sprint_hex(keyBlock + i * 6, 6));\r
+ }\r
+ \r
+ // test keys\r
+ res = mfCheckKeys(trgBlockNo, trgKeyType, 8, keyBlock, &key64);\r
+ if (res)\r
+ res = mfCheckKeys(trgBlockNo, trgKeyType, 8, &keyBlock[6 * 8], &key64);\r
+ if (!res)\r
+ PrintAndLog("Found valid key:%012llx", key64);\r
+ else\r
+ PrintAndLog("No valid key found");\r
+ } else // ------------------------------------ multiple sectors working\r
+ {\r
+ blDiff = blockNo % 4;\r
+ PrintAndLog("Block shift=%d", blDiff);\r
+ e_sector = calloc(SectorsCnt, sizeof(sector));\r
+ if (e_sector == NULL) return 1;\r
+ \r
+ //test current key 4 sectors\r
+ memcpy(keyBlock, key, 6);\r
+ num_to_bytes(0xa0a1a2a3a4a5, 6, (uint8_t*)(keyBlock + 1 * 6));\r
+ num_to_bytes(0xb0b1b2b3b4b5, 6, (uint8_t*)(keyBlock + 2 * 6));\r
+ num_to_bytes(0xffffffffffff, 6, (uint8_t*)(keyBlock + 3 * 6));\r
+ num_to_bytes(0x000000000000, 6, (uint8_t*)(keyBlock + 4 * 6));\r
+ num_to_bytes(0xaabbccddeeff, 6, (uint8_t*)(keyBlock + 5 * 6));\r
+\r
+ PrintAndLog("Testing known keys. Sector count=%d", SectorsCnt);\r
+ for (i = 0; i < SectorsCnt; i++) {\r
+ for (j = 0; j < 2; j++) {\r
+ if (e_sector[i].foundKey[j]) continue;\r
+ \r
+ res = mfCheckKeys(i * 4 + blDiff, j, 6, keyBlock, &key64);\r
+ \r
+ if (!res) {\r
+ e_sector[i].Key[j] = key64;\r
+ e_sector[i].foundKey[j] = 1;\r
+ }\r
+ }\r
+ } \r
+ \r
+ \r
+ // nested sectors\r
+ iterations = 0;\r
+ PrintAndLog("nested...");\r
+ for (i = 0; i < NESTED_SECTOR_RETRY; i++) {\r
+ for (trgBlockNo = blDiff; trgBlockNo < SectorsCnt * 4; trgBlockNo = trgBlockNo + 4) \r
+ for (trgKeyType = 0; trgKeyType < 2; trgKeyType++) { \r
+ if (e_sector[trgBlockNo / 4].foundKey[trgKeyType]) continue;\r
+ if (mfnested(blockNo, keyType, key, trgBlockNo, trgKeyType, keyBlock)) continue;\r
+ \r
+ iterations++;\r
+ \r
+ //try keys from nested\r
+ res = mfCheckKeys(trgBlockNo, trgKeyType, 8, keyBlock, &key64);\r
+ if (res)\r
+ res = mfCheckKeys(trgBlockNo, trgKeyType, 8, &keyBlock[6 * 8], &key64);\r
+ if (!res) {\r
+ PrintAndLog("Found valid key:%012llx", key64); \r
+ e_sector[trgBlockNo / 4].foundKey[trgKeyType] = 1;\r
+ e_sector[trgBlockNo / 4].Key[trgKeyType] = key64;\r
+ }\r
+ }\r
+ }\r
+\r
+ PrintAndLog("Iterations count: %d", iterations);\r
+ //print them\r
+ PrintAndLog("|---|----------------|---|----------------|---|");\r
+ PrintAndLog("|sec|key A |res|key B |res|");\r
+ PrintAndLog("|---|----------------|---|----------------|---|");\r
+ for (i = 0; i < SectorsCnt; i++) {\r
+ PrintAndLog("|%03d| %012llx | %d | %012llx | %d |", i, \r
+ e_sector[i].Key[0], e_sector[i].foundKey[0], e_sector[i].Key[1], e_sector[i].foundKey[1]);\r
+ }\r
+ PrintAndLog("|---|----------------|---|----------------|---|");\r
+ \r
+ free(e_sector);\r
+ }\r
+\r
+ return 0;\r
+}\r
+\r
+int CmdHF14AMfChk(const char *Cmd)\r
+{\r
+ int i, res;\r
+ int keycnt = 0;\r
+ char ctmp = 0x00;\r
+ uint8_t blockNo = 0;\r
+ uint8_t keyType = 0;\r
+ uint8_t keyBlock[8 * 6];\r
+ uint64_t key64 = 0;\r
+\r
+ memset(keyBlock, 0x00, sizeof(keyBlock));\r
+\r
+ if (strlen(Cmd)<3) {\r
+ PrintAndLog("Usage: hf mf chk <block number> <key A/B> [<key (12 hex symbols)>]");\r
+ PrintAndLog(" sample: hf mf chk 0 A FFFFFFFFFFFF a0a1a2a3a4a5 b01b2b3b4b5 ");\r
+ return 0;\r
+ } \r
+ \r
+ blockNo = param_get8(Cmd, 0);\r
+ ctmp = param_getchar(Cmd, 1);\r
+ if (ctmp == 0x00) {\r
+ PrintAndLog("Key type must be A or B");\r
+ return 1;\r
+ }\r
+ if (ctmp != 'A' && ctmp != 'a') keyType = 1;\r
+ \r
+ for (i = 0; i < 6; i++) {\r
+ if (!isxdigit(param_getchar(Cmd, 2 + i))) break;\r
+\r
+ if (param_gethex(Cmd, 2 + i, keyBlock + 6 * i, 12)) {\r
+ PrintAndLog("Key[%d] must include 12 HEX symbols", i);\r
+ return 1;\r
+ }\r
+ keycnt = i + 1;\r
+ }\r
+ \r
+ if (keycnt == 0) {\r
+ PrintAndLog("There is must be at least one key");\r
+ return 1;\r
+ }\r
+\r
+ PrintAndLog("--block no:%02x key type:%02x key count:%d ", blockNo, keyType, keycnt);\r
+ \r
+ res = mfCheckKeys(blockNo, keyType, keycnt, keyBlock, &key64);\r
+ if (res !=1) {\r
+ if (!res)\r
+ PrintAndLog("isOk:%02x valid key:%012llx", 1, key64);\r
+ else\r
+ PrintAndLog("isOk:%02x", 0);\r
+ } else {\r
+ PrintAndLog("Command execute timeout");\r
+ }\r
+\r
+ return 0;\r
+}\r
+\r
+int CmdHF14AMf1kSim(const char *Cmd)\r
+{\r
+ uint8_t uid[4] = {0, 0, 0, 0};\r
+ \r
+ if (param_getchar(Cmd, 0) == 'h') {\r
+ PrintAndLog("Usage: hf mf sim <uid (8 hex symbols)>");\r
+ PrintAndLog(" sample: hf mf sim 0a0a0a0a ");\r
+ return 0;\r
+ } \r
+ \r
+ if (param_getchar(Cmd, 0) && param_gethex(Cmd, 0, uid, 8)) {\r
+ PrintAndLog("UID must include 8 HEX symbols");\r
+ return 1;\r
+ }\r
+ PrintAndLog(" uid:%s ", sprint_hex(uid, 4));\r
+ \r
+ UsbCommand c = {CMD_SIMULATE_MIFARE_CARD, {0, 0, 0}};\r
+ memcpy(c.d.asBytes, uid, 4);\r
+ SendCommand(&c);\r
+\r
+ return 0;\r
+}\r
+\r
+int CmdHF14AMfDbg(const char *Cmd)\r
+{\r
+ if (strlen(Cmd) < 1) {\r
+ PrintAndLog("Usage: hf mf dbg <debug level>");\r
+ PrintAndLog(" 0 - no debug messages");\r
+ PrintAndLog(" 1 - error messages");\r
+ PrintAndLog(" 2 - all messages");\r
+ PrintAndLog(" 4 - extended debug mode");\r
+ return 0;\r
+ } \r
+\r
+ PrintAndLog("No code here (");\r
+ return 0;\r
+}\r
+\r
+int CmdHF14AMfEGet(const char *Cmd)\r
+{\r
+ PrintAndLog("No code here (");\r
+ return 0;\r
+}\r
+\r
+int CmdHF14AMfESet(const char *Cmd)\r
+{\r
+ PrintAndLog("No code here (");\r
+ return 0;\r
+}\r
+\r
+int CmdHF14AMfELoad(const char *Cmd)\r
+{\r
+ PrintAndLog("No code here (");\r
+ return 0;\r
+}\r
+\r
+int CmdHF14AMfESave(const char *Cmd)\r
+{\r
+ PrintAndLog("No code here (");\r
+ return 0;\r
+}\r
+\r
+static command_t CommandTable[] = \r
+{\r
+ {"help", CmdHelp, 1, "This help"},\r
+ {"dbg", CmdHF14AMfDbg, 0, "Set default debug mode"},\r
+ {"rdbl", CmdHF14AMfRdBl, 0, "Read MIFARE classic block"},\r
+ {"rdsc", CmdHF14AMfRdSc, 0, "Read MIFARE classic sector"},\r
+ {"wrbl", CmdHF14AMfWrBl, 0, "Write MIFARE classic block"},\r
+ {"chk", CmdHF14AMfChk, 0, "Test block up to 8 keys"},\r
+ {"mifare", CmdHF14AMifare, 0, "Read parity error messages. param - <used card nonce>"},\r
+ {"nested", CmdHF14AMfNested, 0, "Test nested authentication"},\r
+ {"sim", CmdHF14AMf1kSim, 0, "Simulate MIFARE 1k card"},\r
+ {"eget", CmdHF14AMfEGet, 0, "Set simulator memory block"},\r
+ {"eset", CmdHF14AMfESet, 0, "Get simulator memory block"},\r
+ {"eload", CmdHF14AMfELoad, 0, "Load from file emul dump"},\r
+ {"esave", CmdHF14AMfESave, 0, "Save to file emul dump"},\r
+ {NULL, NULL, 0, NULL}\r
+};\r
+\r
+int CmdHFMF(const char *Cmd)\r
+{\r
+ // flush\r
+ while (WaitForResponseTimeout(CMD_ACK, 500) != NULL) ;\r
+\r
+ CmdsParse(CommandTable, Cmd);\r
+ return 0;\r
+}\r
+\r
+int CmdHelp(const char *Cmd)\r
+{\r
+ CmdsHelp(CommandTable);\r
+ return 0;\r
+}\r