novotnyllc / MiFare

MiFare Classic support for UWP and Windows Desktop apps
MIT License
37 stars 29 forks source link

Missing condition/check regarding GetData() #4

Closed f-israel closed 5 years ago

f-israel commented 5 years ago

Guess this shouldn't be that way but trying to dump my card I stumpled over some bug. Easy to replicate: (for shortening here I didn't use await) byte[] rawDataS0B0 = card.GetSector(sector).GetData(0).Result; card.Flush().Wait(); throws Exception "CardWriteException: Unable to write in sector 0, block 0".

Only guessing but every GetData also sets the blocks changed property to true? This would extremly shorten the lifespan. Please check into this. Not sure but could be related to #3

clairernovotny commented 5 years ago

To set expectations, I am not actively working on this project but will accept PR's and get new versions out if there are fixes.

clairernovotny commented 5 years ago

Fixed by #5