comparison doc/Low-level-commands @ 75:f661ad7eb126

doc/Low-level-commands: document started
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 16 Feb 2021 15:35:05 +0000
parents
children 5f3b16fd4321
comparison
equal deleted inserted replaced
74:8562d8508cf2 75:f661ad7eb126
1 fc-simtool is a tool built from the bottom up: at the foundation there is a set
2 of low-level commands that provide raw access to the actual SIM protocol APDU
3 commands, these low-level commands can be used to do everything that the SIM
4 protocol allows, and all higher-level commands merely provide user-friendly
5 utilities for the most common particular use cases. This document describes
6 these low-level commands. Readers of this document are expected to know the
7 SIM interface protocol as defined in GSM TS 11.11 and its successor 3GPP TS
8 51.011.
9
10 Exploring and reading commands
11 ==============================
12
13 atr
14
15 This command displays the ATR (Answer To Reset) byte string which the SIM sent
16 to the reader when it powered up.
17
18 select File_ID
19
20 This fc-simtool command sends a SELECT command to the SIM, follows up with a
21 GET RESPONSE command as expected in the T=0 protocol, and provides some human-
22 readable parsing of the most important fields in the SIM response structure.
23 If a correctly formed response was received from the SIM and this response
24 structure indicates that a record-based EF has been selected, the indicated
25 record length is saved in an internal variable used by readrec and update-rec
26 commands.
27
28 The file ID can be specified either in hexadecimal (exactly 4 hex digits, *no*
29 0x prefix) or as a symbolic name. fc-simtool knows the following symbolic
30 names:
31
32 * MF
33 * DF_GSM, DF_DCS1800 and DF_TELECOM
34 * "gsm" and "telecom" as shorthand names for DF_GSM and DF_TELECOM
35 * Some of the most classic EFs, but not all
36
37 Important note: regardless of whether you specify the file ID in raw hex or
38 symbolically, this low-level select command will send only one SELECT command
39 to the SIM. Per the SIM protocol, in order to successfully select an EF, you
40 have to be in the right directory first, i.e., select MF, DF_GSM or DF_TELECOM
41 as appropriate before the EF of interest. Our low-level select command does
42 NOT do this extra step on its own, you have to do it explicitly, even if you
43 use symbolic names for EFs.
44
45 sim-resp
46
47 This command displays in raw hex the content of the internal buffer that holds
48 the last response received from the SIM. This internal buffer is filled by the
49 GET RESPONSE command that follows up after SELECT or RUN GSM ALGORITHM, and by
50 the READ BINARY or READ RECORD commands, whether they are invoked directly as
51 low-level commands (select, readbin, readrec or a38) or internally as part of
52 higher-level fc-simtool commands.
53
54 readbin offset len
55 readrec record-index [len]
56
57 readef
58 savebin
59
60 Writing commands
61 ================
62
63 update-bin
64 update-bin-imm
65 update-rec
66
67 restore-file
68
69 GSM authentication testing
70 ==========================
71
72 a38