Modifications

Sauter à la navigation Sauter à la recherche
10 117 octets ajoutés ,  9 septembre 2015 à 11:19
Ligne 296 : Ligne 296 :  
=== Terminator TLV ===
 
=== Terminator TLV ===
 
The Terminator TLV is the last TLV block in the data area, and consist of a single byte: 0x0FE (see the TLV Block Type table above). This TLV Block in mandatory.
 
The Terminator TLV is the last TLV block in the data area, and consist of a single byte: 0x0FE (see the TLV Block Type table above). This TLV Block in mandatory.
 +
 +
== Dump mémoire d'une Mifare Classic NDEF ==
 +
Voici le dump mémoire d'une carte Mifare classique ayant un enregistrement NDEF
 +
 +
<nowiki>[                      Début du mémoire                            ]
 +
------------------------Secteur 0-------------------------
 +
Block 0  3E 39 AB 7F D3 88 04 00 47 41 16 57 4D 10 34 08  >9«Ó?..GA.WM.4.
 +
Block 1  14 01 03 E1 03 E1 03 E1 03 E1 03 E1 03 E1 03 E1  ...á.á.á.á.á.á.á
 +
Block 2  03 E1 03 E1 03 E1 03 E1 03 E1 03 E1 03 E1 03 E1  .á.á.á.á.á.á.á.á
 +
Block 3  00 00 00 00 00 00 78 77 88 C1 00 00 00 00 00 00  ......xw?Á......
 +
------------------------Secteur 1-------------------------
 +
Block 4  00 00 03 11 D1 01 0D 55 01 61 64 61 66 72 75 69  ....Ñ..U.adafrui
 +
Block 5  74 2E 63 6F 6D FE 00 00 00 00 00 00 00 00 00 00  t.comþ..........
 +
Block 6  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
 +
Block 7  00 00 00 00 00 00 7F 07 88 40 00 00 00 00 00 00  .......?@......
 +
------------------------Secteur 2-------------------------
 +
Block 8  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
 +
Block 9  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
 +
Block 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
 +
Block 11 00 00 00 00 00 00 7F 07 88 40 00 00 00 00 00 00  .......?@......
 +
------------------------Secteur 3-------------------------
 +
Block 12 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
 +
Block 13 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
 +
Block 14 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
 +
Block 15 00 00 00 00 00 00 7F 07 88 40 00 00 00 00 00 00  .......?@......
 +
------------------------Secteur 4-------------------------
 +
Block 16 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
 +
Block 17 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
 +
Block 18 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
 +
Block 19 00 00 00 00 00 00 7F 07 88 40 00 00 00 00 00 00  .......?@......
 +
------------------------Secteur 5-------------------------
 +
Block 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
 +
Block 21 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
 +
Block 22 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
 +
Block 23 00 00 00 00 00 00 7F 07 88 40 00 00 00 00 00 00  .......?@......
 +
------------------------Secteur 6-------------------------
 +
Block 24 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
 +
Block 25 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
 +
Block 26 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
 +
Block 27 00 00 00 00 00 00 7F 07 88 40 00 00 00 00 00 00  .......?@......
 +
------------------------Secteur 7-------------------------
 +
Block 28 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
 +
Block 29 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
 +
Block 30 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
 +
Block 31 00 00 00 00 00 00 7F 07 88 40 00 00 00 00 00 00  .......?@......
 +
------------------------Secteur 8-------------------------
 +
Block 32 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
 +
Block 33 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
 +
Block 34 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
 +
Block 35 00 00 00 00 00 00 7F 07 88 40 00 00 00 00 00 00  .......?@......
 +
------------------------Secteur 9-------------------------
 +
Block 36 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
 +
Block 37 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
 +
Block 38 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
 +
Block 39 00 00 00 00 00 00 7F 07 88 40 00 00 00 00 00 00  .......?@......
 +
------------------------Secteur 10-------------------------
 +
Block 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
 +
Block 41 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
 +
Block 42 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
 +
Block 43 00 00 00 00 00 00 7F 07 88 40 00 00 00 00 00 00  .......?@......
 +
------------------------Secteur 11-------------------------
 +
Block 44 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
 +
Block 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
 +
Block 46 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
 +
Block 47 00 00 00 00 00 00 7F 07 88 40 00 00 00 00 00 00  .......?@......
 +
------------------------Secteur 12-------------------------
 +
Block 48 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
 +
Block 49 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
 +
Block 50 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
 +
Block 51 00 00 00 00 00 00 7F 07 88 40 00 00 00 00 00 00  .......?@......
 +
------------------------Secteur 13-------------------------
 +
Block 52 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
 +
Block 53 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
 +
Block 54 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
 +
Block 55 00 00 00 00 00 00 7F 07 88 40 00 00 00 00 00 00  .......?@......
 +
------------------------Secteur 14-------------------------
 +
Block 56 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
 +
Block 57 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
 +
Block 58 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
 +
Block 59 00 00 00 00 00 00 7F 07 88 40 00 00 00 00 00 00  .......?@......
 +
------------------------Secteur 15-------------------------
 +
Block 60 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
 +
Block 61 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
 +
Block 62 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
 +
Block 63 00 00 00 00 00 00 7F 07 88 40 00 00 00 00 00 00  .......?@......
 +
[                        Fin du dump mémoire                              ]</nowiki>
 +
 +
L'exemple ci-dessus contient deux enregistrements, tout deux localisé dans le secteur 1 (le secteur 0 contenant le MAD).
 +
 +
Voici comment les données sont organisées:
 +
 +
=== Enregistrement 1 ===
 +
The first record on the card can be identified by looking at the first byte of block 4 in sector 1.
 +
 +
<nowiki>Block  00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15  Char Value
 +
-----  -----------------------------------------------  ------------
 +
04    00 00                                            ..</nowiki>
 +
 +
Every record on the Mifare card starts with the '''TLV Block''' (described above), and the first byte of the TLV Block (the Tag Field) indicates that this is a '''NULL Block type (value 0x00)'''. The second byte is the Length Field, and is 0. Since there is no payload for this record (Length = 0), the third byte of the TLV block is not present (the Value Field).
 +
 +
This record was likely inserted when the card was first formatted to ensure that at least one record is present.
 +
 +
=== Enregistrement 2 ===
 +
The second record on the card starts at byte 0x02 of block 4 and continues into block 5.
 +
 +
<nowiki>Block  00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15  Char Value
 +
-----  -----------------------------------------------  ------------
 +
04          03 11 D1 01 0D 55 01 61 64 61 66 72 75 69  Ñ..U.adafrui
 +
05    74 2E 63 6F 6D                                  t.com</nowiki>
 +
 +
Starting with les données du '''bloc TLV''' in the first two bytes, we can determine the following:
 +
 +
<nowiki>Byte(s)  Value  Description
 +
-------  -----  -----------
 +
04:02    0x03    Field Type (0x03 = NDEF Message)
 +
04:03    0x11    Length Field (17 bytes)</nowiki>
 +
 +
This indicates to us that the record contains an '''NDEF Message''' (value 0x03), and that the message is 17 bytes long (0x11 in hexadecimal = 17 in decimal value). This means that our NDEF message is contained in the next 17 bytes (04:04..05:04). The NDEF record can then be analysed as follows:
 +
 +
<nowiki>Byte(s)      Value  Description
 +
-------      -----  -----------
 +
04:04        0xD1  This byte is the **NDEF Record Header**, and indicates that this is
 +
                    an NFC Forum Well Known Record (0x01 in the first 3 bits),
 +
                    and that this is the first and last record (MB=1, ME=1),
 +
                    and that this is a short record (SR = 1) meaning the payload
 +
                    length is less than or equal to 255 chars (len=one byte).
 +
                    TNF = 0x01 (NFC Forum Well Known Type)
 +
                    IL  = 0    (No ID present, meaning there is no ID Length or ID Field either)
 +
                    SR  = 1    (Short Record)
 +
                    CF  = 0    (Record is not 'chunked')
 +
                    ME  = 1    (End of message)
 +
                    MB  = 1    (Beginning of message)
 +
04:05        0x01  This byte is the **Type Length** for the Record Type Indicator
 +
                    (see above for more information), which is 1 byte (0x55/'U' below)
 +
04:06        0x0D  This is the payload length (13 bytes)
 +
04:07        0x55  Record Type Indicator (0x55 or 'U' = URI Record)
 +
04:08        0x01  This is the **start of the record payload**, which contains the
 +
                    URI Identifier ("http://www.") since this is a URI Well-Defined
 +
                    Record Type (see Well-Defined Records above).  This will be
 +
                    prepended to the rest of the URI that follows in the rest of the
 +
                    message payload
 +
04:09..05:04  ...    The remainder of the URI ("adafruit.com"), which combined with the
 +
                    pre-pended value from byte 04:08 yields: http://www.adafruit.com</nowiki>
 +
 +
=== TLV Terminator ===
 +
 +
<nowiki>Block  00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15  Char Value
 +
-----  -----------------------------------------------  ------------
 +
05                    FE                                þ</nowiki>
 +
 +
The final byte (block 5, byte 5), with the value 0xFE, is the '''TLV Terminator''' and indicates that this is the end of the TLV Block.
    
{{traduction}}
 
{{traduction}}
29 917

modifications

Menu de navigation