diff --git a/CHANGELOG.md b/CHANGELOG.md index 8bc9970cf..d6e416ae9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ All notable changes to this project will be documented in this file. This project uses the changelog in accordance with [keepchangelog](http://keepachangelog.com/). Please use this to write notable changes, which is not the same as git commit log... ## [unreleased][unreleased] + - Fixed `hf mf ndefwrite` - now skips not ndef formatted sectors (@iceman1001) - Fixed `hf mf ndefread` - now skips not ndef formatted sectors correctly (@iceman1001) - Fixed `lf hitag` - keep inside the arrays for key/password/nrar (@iceman1001) - Added `hf mf ndefwrite` - write raw NDEF records to MIFARE Classic tag (@iceman1001) diff --git a/client/src/cmdhfmf.c b/client/src/cmdhfmf.c index e8140a1c1..468922a53 100644 --- a/client/src/cmdhfmf.c +++ b/client/src/cmdhfmf.c @@ -6139,9 +6139,15 @@ int CmdHFMFNDEFWrite(const char *Cmd) { PrintAndLogEx(INPLACE, "%u", block_no); + // find next available block block_no++; if (mfIsSectorTrailer(block_no)) { block_no++; + + // skip sectors which isn't ndef formatted + while ( freemem[mfSectorNum(block_no)] == 0 ) { + block_no++; + } } bytes -= MFBLOCK_SIZE;