X-Git-Url: http://cvs.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/7c5f70dd9f8805967628f429f96fe1159a8bb827..e3ab50cafb66e8d594a4946537594e01882d9242:/client/cmdhfmf.c diff --git a/client/cmdhfmf.c b/client/cmdhfmf.c index f32ae444..6939f653 100644 --- a/client/cmdhfmf.c +++ b/client/cmdhfmf.c @@ -1223,9 +1223,6 @@ int CmdHF14AMfELoad(const char *Cmd) return 1; } -// for (sectorNo = 0; sectorNo < numSectors; sectorNo++) { -// for(blockNo = 0; blockNo < NumBlocksPerSector(sectorNo); blockNo++) { - blockNum = 0; while(!feof(f)){ memset(buf, 0, sizeof(buf)); @@ -1243,6 +1240,7 @@ int CmdHF14AMfELoad(const char *Cmd) if(strlen(buf) && feof(f)) break; PrintAndLog("File content error. Block data must include 32 HEX symbols"); + fclose(f); return 2; } @@ -1252,6 +1250,7 @@ int CmdHF14AMfELoad(const char *Cmd) if (mfEmlSetMem(buf8, blockNum, 1)) { PrintAndLog("Cant set emul block: %3d", blockNum); + fclose(f); return 3; } blockNum++; @@ -1262,7 +1261,6 @@ int CmdHF14AMfELoad(const char *Cmd) if ((blockNum != numBlocks)) { PrintAndLog("File content error. Got %d must be %d blocks.",blockNum, numBlocks); - fclose(f); return 4; } PrintAndLog("Loaded %d blocks from file: %s", blockNum, filename); @@ -1985,9 +1983,6 @@ static command_t CommandTable[] = {"help", CmdHelp, 1, "This help"}, {"dbg", CmdHF14AMfDbg, 0, "Set default debug mode"}, {"rdbl", CmdHF14AMfRdBl, 0, "Read MIFARE classic block"}, - //{"urdbl", CmdHF14AMfURdBl, 0, "Read MIFARE Ultralight block"}, - //{"urdcard", CmdHF14AMfURdCard, 0,"Read MIFARE Ultralight Card"}, - //{"uwrbl", CmdHF14AMfUWrBl, 0,"Write MIFARE Ultralight block"}, {"rdsc", CmdHF14AMfRdSc, 0, "Read MIFARE classic sector"}, {"dump", CmdHF14AMfDump, 0, "Dump MIFARE classic tag to binary file"}, {"restore", CmdHF14AMfRestore, 0, "Restore MIFARE classic binary file to BLANK tag"}, @@ -2005,9 +2000,9 @@ static command_t CommandTable[] = {"ecfill", CmdHF14AMfECFill, 0, "Fill simulator memory with help of keys from simulator"}, {"ekeyprn", CmdHF14AMfEKeyPrn, 0, "Print keys from simulator memory"}, {"csetuid", CmdHF14AMfCSetUID, 0, "Set UID for magic Chinese card"}, - {"csetblk", CmdHF14AMfCSetBlk, 0, "Write block into magic Chinese card"}, - {"cgetblk", CmdHF14AMfCGetBlk, 0, "Read block from magic Chinese card"}, - {"cgetsc", CmdHF14AMfCGetSc, 0, "Read sector from magic Chinese card"}, + {"csetblk", CmdHF14AMfCSetBlk, 0, "Write block - Magic Chinese card"}, + {"cgetblk", CmdHF14AMfCGetBlk, 0, "Read block - Magic Chinese card"}, + {"cgetsc", CmdHF14AMfCGetSc, 0, "Read sector - Magic Chinese card"}, {"cload", CmdHF14AMfCLoad, 0, "Load dump into magic Chinese card"}, {"csave", CmdHF14AMfCSave, 0, "Save dump from magic Chinese card into file or emulator"}, {NULL, NULL, 0, NULL}