Permalink
Browse files

Doc update for the specification language

  • Loading branch information...
1 parent 5f6e8cc commit 6736c0e485c3d9728b9d870b79ca3f0581aa6731 @4ZM committed Feb 18, 2012
Showing with 41 additions and 12 deletions.
  1. +24 −2 README
  2. +17 −10 mfc-spec.txt
View
@@ -66,7 +66,29 @@ clear the dictionary use 'dict clear'.
Other commands
--------------
-
Quit the mfterm program by issuing the 'quit' command.
-Help is available by writing 'help'
+Help is available by writing 'help'
+
+
+Specification Files
+-------------------
+A specification file defines names for parts of the tag data. See the
+file mfc-spec.txt for a sample specification.
+
+Specification files are loaded with the command 'spec load'. They can
+be cleared with 'spec clear'. To display the data structure loaded use
+the command 'spec'.
+
+Once a specification has been loaded, it can be used to access the
+data in the tag by using a specification path. In the sample
+specification, the path: '.sector_0.block_0.atqa', when entered in the
+terminal, will display the two bytes of data starting with byte 6.
+
+WARNING:
+--------
+The mfterm software is neither thoroughly tested nor widely used. It
+likely contains a number of serious bugs that can be exploited to
+compromise your computer. Do NOT run the mfterm software as a
+privileged user (e.g. root), and ONLY load tag, dictionary and
+specification files that you get from people you trust.
View
@@ -15,25 +15,32 @@
# You should have received a copy of the GNU General Public License
# along with rkfterm. If not, see <http://www.gnu.org/licenses/>.
-# Types Byte Bit Addr
-# Bit fields must be byte alligned
-# nested named types are not allowed
+# About the specification language:
+#
+# The primitive types in the specification language are Byte and Bit
+# and arrays of such. All other types need to be defined.
+#
+# Every specification must include the root type '.'
+
+
+# The root type is specified by its type name '.'
. {
- Sector0 sectors_0
+ Sector0 sector_0 # The types usesed here are defined below
Sector1k[15] sectors_1k
Sector4k[12] sectors_4k
}
+# The type Sector_0 represents the first sector.
Sector0 {
- {
- Byte[4] uid # serial
- Byte cd # serial bytes xor:ed with check byte (cb) should be 0
- Bit[4] - # Not used
- Bit[4] sak # HOW TO HANDLE ALIGNMENT?
+ { # This is an anonymous inner type. The type doesn't have a name.
+ Byte[4] uid # Unique ID
+ Byte cd # Check Byte; uid bytes xor:ed with cb should be 0
+ Bit[4] - # Not used. Use '-' as a name in theese cases
+ Bit[4] sak
Byte[2] atqa
Byte[8] manufacturer_data
- } block0
+ } block_0
Block[2] blocks
SectorTrailer trailer
}

0 comments on commit 6736c0e

Please sign in to comment.