Commit graph

102 commits

Author SHA1 Message Date
Unknown
6fb61d3c1e error handling 2020-06-30 17:19:24 +02:00
Unknown
f2677da74c too many different clone tags, let the user to chose action
too many different clone tags, let the user to chose action
2020-06-30 16:18:47 +02:00
Unknown
0bf4cec661 remove direct write check 2020-06-30 14:52:07 +02:00
Unknown
c8fcaea8ab no need to differentiate routines 2020-06-27 16:17:15 +02:00
Unknown
6921e57fb8 correct typo 2020-06-27 13:33:04 +02:00
Unknown
01bc5693d9 another hardcode value 2020-06-26 19:08:04 +02:00
Unknown
db957aabdf adds write condition check in unlock_card() 2020-06-26 18:29:01 +02:00
Unknown
f7b9b0eafa remove unused stuff for block 0 writing 2020-06-26 13:36:18 +02:00
Unknown
709ef8381f reinit for retrieving new uid after block 0 write 2020-06-26 13:34:50 +02:00
Unknown
3c55b8746b swap 0 block write and other blocks write
when writing to gen2 and possible on gen3, it writes first block 3 wich is the trailing sector before writing to block 0, so the last write to block 0 fails because authenticate to old keyset
2020-06-26 01:50:11 +02:00
Unknown
02f0f6b290 add verbose case
add verbose case
2020-06-26 01:28:57 +02:00
Unknown
7a5e654309 hardcoded values 2020-06-25 23:56:38 +02:00
Unknown
2b21d87e8e add gen2 desc to help
add gen2 desc to help
2020-06-25 23:45:17 +02:00
Unknown
4e922e8194 sends lib log to /dev/null in posix and added option (v) to reactivate
There in an error handling and messaging inside
2020-06-25 23:32:03 +02:00
Unknown
3f4b7a037a add rewrite support for gen2 tags with W command
add rewrite support for gen2 tags with W command
2020-06-25 23:10:06 +02:00
Unknown
dd96571f88 no need to loop, only one block 2020-06-25 19:49:04 +02:00
Unknown
5a87f1f3db Splitting block 0 writing and other block writing, not needed anymore 2020-06-25 19:29:38 +02:00
Adam Laurie
7b6ff73c4b only test DirectWrite write if we need to. only write block 0 if specifically requested to. 2020-06-25 17:45:20 +02:00
Adam Laurie
e560689f60 restore original block count logic and add debuggers for block0 2020-06-25 17:44:20 +02:00
Adam Laurie
a28a537610 partial fix of nfc-mfclassic which only writes first sector of each block and not sector 1,2,3 unles 'unlocked' write - debuggers still in! 2020-06-25 17:43:19 +02:00
Ludovic Rousseau
c8692aa239 Fix compiler warning: no previous prototype
nfc-mfclassic.c:623:6: warning: no previous prototype for ‘is_directwrite’ [-Wmissing-prototypes]
 bool is_directwrite(void)
      ^~~~~~~~~~~~~~
2020-05-22 09:51:14 +02:00
Ludovic Rousseau
91d7c5d32f Fix compiler warning: old-style function definition
nfc-mfclassic.c:623:6: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
 bool is_directwrite()
      ^~~~~~~~~~~~~~
nfc-mfclassic.c: In function ‘is_directwrite’:
nfc-mfclassic.c:623:6: warning: old-style function definition [-Wold-style-definition]
2020-05-22 09:50:26 +02:00
Philippe Teuwen
4525cd1c32 make style 2020-05-21 15:06:17 +02:00
Philippe Teuwen
5a059db901 remove warnings 2020-05-21 14:50:30 +02:00
Adam Laurie
54ba7359ce
Merge branch 'master' into master 2020-04-04 18:15:56 +01:00
Adam Laurie
a85f003d91
Merge pull request #451 from hph86/3_verbose_rats_cmd
Add RATS support indicator to nfc-mfclassic
2020-04-04 17:39:46 +01:00
quantum-x
fbdbe6eff3
Update nfc-mfclassic.c
Adding support for extended Magic cards:
 - DirectWrite cards
 - One Time Write cards

Direct Write cards support modification of B0 directly, without any unlock codes. When we are attempting to detect if a card is 'magic', we will attempt to modify B0 directly as an initial check.

One Time Write cards support modification of B0 directly, one time only. They do not respond to magic commands, but have a fixed UID coming out of the factory. We now detect this UID, and if so, deem the card 'magic'.
2019-08-19 19:07:18 +02:00
Mikolaj Stawiski
793d5adde6 Fixed format warnings. 2018-11-25 13:48:04 +11:00
Hanno Heinrichs
7a0a469c8a add more verbosity to RATS handling 2017-09-17 21:04:33 +02:00
Hanno Heinrichs
df4f9c0fbd fix typo 2017-09-17 21:02:50 +02:00
Hanno Heinrichs
e4ca7f45d2 remove redundant blanks 2017-09-17 21:01:12 +02:00
Philippe Teuwen
024fca9cb7 make style 2017-04-01 00:46:12 +02:00
Simon Yorkston
6c44c20ffc Adding support for 4K magic cards 2017-03-01 18:41:16 +01:00
Philippe Teuwen
04ef5ca902 Reduce variables scopes 2017-02-18 22:20:15 +01:00
Philippe Teuwen
e4df2f3334 astyle 2017-02-18 13:05:59 +01:00
Philippe Teuwen
c5e8adc169 mfclassic: avoid hardcoded offsets & sizes 2017-02-17 11:31:13 +01:00
Philippe Teuwen
295c70911a Restrict MFC Mini detection according to AN10833 2017-02-16 22:31:10 +01:00
Olliver Schinagl
e1a25a8203 nfc-mfclassic: Add option to specify key
The nfc-mfclassic utility will pick a seemingly random (the libnfc
default which seems to be the lowest UID). With the new (u|U) options
it is now possible to force a UID and thus write a specific tag, which
can be very useful if there are more then one tag visible.

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
2016-05-11 09:38:39 +02:00
Olliver Schinagl
898f3a4d2f nfc-mfclassic: check argc < 4 only once
Currently the check on argc is done twice, once in each if branch. This
is silly and we can just check once and fail right away.

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
2016-05-11 09:38:39 +02:00
quantum-x
758cb0cc05 Update nfc-mfclassic.c 2015-11-03 18:52:39 +01:00
quantum-x
c71d7267ac Update nfc-mfclassic.c
Tweaking back the unlocked_read / write_block_zero after magic2 card discovered
2015-11-03 18:48:22 +01:00
quantum-x
20f22b97e7 Updating nesting typo 2015-11-03 18:39:03 +01:00
quantum-x
b5684c1755 Removing typo
Removing typo
2015-11-03 18:33:53 +01:00
quantum-x
87c6053d6f Updating nfc-mfclassic.c
Modifying behavior relating to magic cards.
If a user has a 'magic2' card (IE, direct-write, not a 'fully magic' card) - we'll warn them that they don't need to use the W / R modes, and then proceed with the unlock operation, instead of exiting.
2015-11-03 18:11:51 +01:00
Adam Laurie
b978c45a11 tolerate errors when writing as well as reading 2014-05-25 16:39:47 +01:00
Philippe Teuwen
7a30e35496 nfc-mfclassic: update help & man page 2014-01-28 00:22:33 +01:00
Philippe Teuwen
4817a6e5c9 make style 2013-12-02 22:55:10 +01:00
Philippe Teuwen
b8e0eec91d nfc-mfclassic: initialize always bFormatCard 2013-11-12 00:43:25 +01:00
Adam Laurie
250068462b add format/wipe command to nfc-mfclassic 2013-11-11 22:03:09 +00:00
Philippe Teuwen
61884967ea nfc-mfclassic: verify return of nfc_initiator_select_passive_target()
Problem reported by Coverity:
CID 1090323 (#1 of 1): Unchecked return value (CHECKED_RETURN)
  unchecked_value: No check of the return value of "nfc_initiator_select_passive_target(pnd, nmMifare, nt.nti.nai.abtUid, nt.nti.nai.szUidLen, NULL)".
2013-09-22 02:45:23 +02:00