Commit graph

223 commits

Author SHA1 Message Date
Stean
f93169feb4 Add undocumented option -s to nfc-relay-picc man page 2018-11-04 21:30:35 +01:00
Stean
c52cdb10c8 Add undocumented option -s to usage listing 2018-11-04 21:22:46 +01:00
Markus Werle
4ae4cc86f8
Merge pull request #450 from hph86/2_fix_typo
Fix typo in nfc-mfclassic
2018-10-02 12:32:45 +02:00
Adam Laurie
25ee3a2f76 Add OTP/Capability Bytes handling to NTAG 2018-09-18 11:14:08 +01:00
Adam Laurie
3ba065f00b Remove redundant EV1 types and rely on NTAG types instead 2018-09-17 21:40:48 +01:00
Adam Laurie
40b54a10d7 Fix NTAG OTP and LOCK BYTES (Dynamic LOCK also applies to MF0UL21). Fix MF0UL21 sizing issue. 2018-09-17 16:58:49 +01:00
Adam Laurie
4c914e67e5 Fix handling of NTAG OTP and LOCK bytes 2018-09-17 14:37:09 +01:00
Adam Laurie
62f27c1c58 Add support for Ultralight NTAG213/215/216 2018-09-15 16:19:35 +01: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
00700bc66d Make Travis happy 2017-05-17 15:56:41 +02:00
Philippe Teuwen
dcdbff0705 New NFC modulation type NMT_BARCODE 2017-05-17 13:58:16 +02:00
Philippe Teuwen
e41a42cf96 nfc-mfultralight: avoid compilation warning 2017-04-01 01:03:41 +02:00
Philippe Teuwen
024fca9cb7 make style 2017-04-01 00:46:12 +02:00
Philippe Teuwen
3ec9ecf800 nfc-mfultralight: fix support for MF0UL21 2017-04-01 00:25:14 +02:00
Philippe Teuwen
560f6a6413 nfc-mfultralight: better parameters checks 2017-03-31 23:21:17 +02:00
Adam Laurie
a9f3e3a2ac allow partial writes. tidy up usage. 2017-03-23 18:19:59 +00:00
Adam Laurie
963eb074ec vary expected dump size based on tag type 2017-03-23 16:42:10 +00:00
Adam Laurie
c04dd91e98 read extra mf-ul EV1 blocks 2017-03-23 16:04:02 +00:00
Adam Laurie
fe04b85678 show EV1 auth PACK (tag/reader trust secret) 2017-03-23 12:03:34 +00:00
Adam Laurie
3f8bb59f1e show EV1 storage size 2017-03-23 11:05:00 +00:00
Adam Laurie
ca96e50e9b add EV1 password auth to nfc-mfultralight 2017-03-22 23:05:48 +00:00
Simon Yorkston
6c44c20ffc Adding support for 4K magic cards 2017-03-01 18:41:16 +01:00
Philippe Teuwen
c51caf424a nfc-mfultralight: fix failed read reporting and add failed pages count 2017-02-27 17:22:42 +01:00
Philippe Teuwen
04ef5ca902 Reduce variables scopes 2017-02-18 22:20:15 +01:00
Philippe Teuwen
c815c7a059 nfc-mfultralight: remove dead assignment
nfc-mfultralight.c:274:7: warning: Value stored to 'bFailure' is never read
      bFailure = false;
      ^          ~~~~~
2017-02-18 17:17:53 +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
d808802b16 typos 2017-02-17 10:11:34 +01:00
Philippe Teuwen
b86b7efb10 Fix number of blocks written
A strange move changed the way written pages are bound in commit ed62b01a.
As a result the last 3 blocks weren't written anymore.
2017-02-17 09:56:35 +01:00
Philippe Teuwen
295c70911a Restrict MFC Mini detection according to AN10833 2017-02-16 22:31:10 +01:00
Olliver Schinagl
a4bc1b9f6c nfc-mfultralight: also set failure state on uid write error
Currently, we return false, and after turning set the bFailure state.
This is of course not possible.

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
2016-05-13 14:44:07 +02:00
Olliver Schinagl
ed62b01a0f nfc-mfultralight: write uiBlocks, as we read
We use a variable, uiBlocks, to determine how many blocks to read/write.
Reading is actually done via a hardcoded 0xF value however.

Additionally, make uiblocks a const, as we use it as a constant and
change the page variable to uint32_t for consistency sake.

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
2016-05-13 14:44:07 +02:00
Olliver Schinagl
4b8871fd8f nfc-mfultralight: Remove whitespaces
Clean up some stray unintended whitespaces. This patch does not
introduce any binary changes.

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
2016-05-11 09:38:39 +02:00
Olliver Schinagl
ecd0e59b5c nfc-mfultralight: Add option to specify UID
When several tags are in range, nfc-mfultralight uses the lowest ID it
finds by default. This patch adds some code from nfc-list that lists the
tags in range whenever an operation is performed (r/w). Further more it
adds the --with-uid <UID> option to force reading/writing of a specific
tag.

The UID can be up to 10 bytes long and can be optionally separated by
colons or hyphens (MAC address style).

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
2016-05-11 09:38:39 +02:00
Olliver Schinagl
7b1ff70a52 nfc-mfultralight: Show help when no arguments are supplied
For some reason, 0cece94778 changed the argc count check to only show
the help if argc is 0. Obviously, argc is never zero, as the first
argument in argv is always the binary itself. Revert that and show usage
if there is no arguments supplied to the binary.

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
2016-05-11 09:38:39 +02: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
Simon Yorkston
e37de54e18 Updated to remove bugs
- For cards that aren’t magic, system will refuse to attempt writing
to block 0  / 1

 - Tested on Gen 1 & Gen 2 cards:

Gen 1
$ ./nfc-mfultralight w ul-test.dmp --full
NFC device: SCM Micro / SCL3711-NFC&RW opened
Found MIFARE Ultralight card with UID: 044e075ad42184
Writing 16 pages |................|
Done, 16 of 16 pages written (0 pages skipped).

Gen 2
$ ./nfc-mfultralight w ul-test.dmp --full
NFC device: SCM Micro / SCL3711-NFC&RW opened
Found MIFARE Ultralight card with UID: 044e075ad42184
Writing 16 pages |................|
Done, 16 of 16 pages written (0 pages skipped).

Non-magic
$ ./nfc-mfultralight w ul-test.dmp --full
NFC device: SCM Micro / SCL3711-NFC&RW opened
Found MIFARE Ultralight card with UID: 044e075ad42184
Writing 16 pages |
Unable to unlock card - are you sure the card is magic?
$
2016-04-09 03:42:01 +10:00
Simon Yorkston
8de7ce3899 Adding support for UL Gen 2 Badges 2016-04-09 01:32:14 +10:00
Romuald Conty
42d455c4e7 Merge pull request #325 from quantum-x/master
Extends nfc-mfultralight functionality (Magic cards, unattended mode)
2015-11-19 00:02:04 +01:00
Simon Yorkston
619b476028 Cleaned non-magic exit 2015-11-18 23:11:59 +01:00
Simon Yorkston
0cece94778 Adds --check-magic flag to nfc-mfultralight 2015-11-18 23:03:36 +01:00
Simon Yorkston
3aa2d46588 Added automatic mode to nfc-mfultralight 2015-11-18 08:56:48 +01: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
Romuald Conty
33ce39ff71 nfc-relay-picc: fix wrong open mode for file descriptor
Fixes #280
2015-04-30 14:33:59 +02:00