now skips non ndef formmated sectors

This commit is contained in:
iceman1001 2022-10-23 02:17:49 +02:00
parent ac29a893cf
commit 69fd1ac889
2 changed files with 7 additions and 0 deletions

View file

@ -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... 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] ## [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 `hf mf ndefread` - now skips not ndef formatted sectors correctly (@iceman1001)
- Fixed `lf hitag` - keep inside the arrays for key/password/nrar (@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) - Added `hf mf ndefwrite` - write raw NDEF records to MIFARE Classic tag (@iceman1001)

View file

@ -6139,9 +6139,15 @@ int CmdHFMFNDEFWrite(const char *Cmd) {
PrintAndLogEx(INPLACE, "%u", block_no); PrintAndLogEx(INPLACE, "%u", block_no);
// find next available block
block_no++; block_no++;
if (mfIsSectorTrailer(block_no)) { if (mfIsSectorTrailer(block_no)) {
block_no++; block_no++;
// skip sectors which isn't ndef formatted
while ( freemem[mfSectorNum(block_no)] == 0 ) {
block_no++;
}
} }
bytes -= MFBLOCK_SIZE; bytes -= MFBLOCK_SIZE;