-
Notifications
You must be signed in to change notification settings - Fork 447
Failure to write to data block 4 #566
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Starting with the unused card, the complete sequence of events is:
Note that writing without UID (
|
poking @quantum-x, if I understand well the code involved is theirs |
Same problem here, can't write gen 2 CUID magic card (the ones with the block 0 directly writable, and no magic command) with same error message. However I can write "normally" (lowercase w) to the tag, and of course, the block 0 remains untouched. And the card works with and Android phone and MIFARE Classic Tool app. |
I have the exact same tags that the ones linked by @fxcoudert, and the same problem. I bypassed it by forcing Here is my patch: diff --git a/utils/nfc-mfclassic.c b/utils/nfc-mfclassic.c
index ba07b6f..8b29b65 100644
--- a/utils/nfc-mfclassic.c
+++ b/utils/nfc-mfclassic.c
@@ -70,7 +70,7 @@ static bool bUseKeyFile;
static bool bForceKeyFile;
static bool bTolerateFailures;
static bool bFormatCard;
-static bool magic2 = false;
+static bool magic2 = true;
static bool magic3 = false;
static bool unlocked = false;
static bool bForceSizeMismatch; (While it works around the problem, it is not a solution. It will break compatibility with gen1 magic tags, which will not be unlocked, and normal mifare tags, wich will fail to write block 0) Hacking a little more the source to get some info around the magic detection, it seems that
I gone far beyond my understanding of the subject. From now, I'll let people who have a clue of what all this mean do their magic. Hope it helps. Thank you for maintaining libnfc! |
I've faced with the same issue and it seems it tries to write gen3 fob, which new family of the fobs. With the master build, some of related commits to gen3 is not at 1.8.0. So master build resolve this issue. See #608 @fxcoudert try to build from master and try to write again |
@vkravets i confirm that the issue is resolved when built from master branch. |
interesting.I've faced the same problem.Then I write with -f once,then write normally.
|
I'm encountering the same issue. I found that a quick (but ugly) fix to make libnfc 1.8.0 compatible with gen 2 CUID card (direct write card) is to apply the following patch:
|
I am using
libnfc
master (with patch from #561), on an ACS / ACR122U reader, and trying to write to a card with rewritable UID. The write fails with:The cards I am trying to write to are these with rewritable UID, I believe they are gen B / second generation: https://www.amazon.fr/Lot-badges-Rfid-Mif-13-56Mhz/dp/B07GD5BQ1T
Verbose output:
The text was updated successfully, but these errors were encountered: