Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
According to http:https://www.proxmark.org/forum/viewtopic.php?id=6545 there are many types of block 0 rewritables tags, with standard unlocking commands, with custom unlocking commands, with direct write support, one time write with unlocking commands, one time write with direct writing, one time writing with custom fusing commands and so on. Better to drop the support for these "exotic" tag, that normally came with theirs custom writer software, since is almost impossible to track down every production variation. Support remains of course for genuine tags, those with backdoor commands, direct write tags and their otw variations.
The recognition is almost impossible with all of these production differences from manufacturer to manufacturer.
The is_directwrite function potentially nukes an otw tag. Better to differentiate commands; w for normal writing and W for block 0 writing, trying to unlock and if it fails try to direct write to it. If also fails, the program stops and the user is conscious he can't write block 0 and then goes to normal w write. Tested with genuine and gen2 (direct write) 1k tags.
@AdamLaurie please take a look and test it if you can.