diff --git a/frontend/help-ru.html b/frontend/help-ru.html index 61c0960..89b6a3e 100644 --- a/frontend/help-ru.html +++ b/frontend/help-ru.html @@ -42,16 +42,17 @@

2. Вкладка C-APDU

-

Построение командных APDU (C-APDU). Четыре подвкладки охватывают разные поколения карт и наборы команд.

+

Построение командных APDU (C-APDU). Пять подвкладок охватывают разные поколения карт и наборы команд: SIM RFM, USIM RFM, Expanded Script, RAM/GP и C-APDU Parser.

2.1 SIM RFM

CLA = A0 (GSM 11.11 / TS 151 011, ISO 7816-4). Удалённое управление файлами классических SIM-карт.

+

Команды собираются в виде цепочки: нажмите кнопку + Command, чтобы добавить строку, заполните её поля — предпросмотр цепочки (над кнопкой упаковки) обновится автоматически. Добавьте строку GET RESPONSE, чтобы получить данные после SELECT. Кнопка Pack into Secured packet упаковывает всю цепочку в пакет SCP80.

- + @@ -60,7 +61,11 @@ - + + + + +
КомандаINSОписание
SELECTA4Выбор EF/DF по FID, пути, DF name или цепочке
SELECTA4Выбор EF/DF по FID, пути, AID или цепочке
UPDATE RECORDDCОбновление записи
UPDATE BINARYD6Обновление бинарных данных
READ RECORDB2Чтение записи
ACTIVATE FILE44Активация файла
DEACTIVATE FILE04Деактивация файла
VERIFY PIN20Проверка PIN1 или PIN2
CHANGE PIN24Смена PIN1 или PIN2
CHANGE PIN24Смена PIN1 или PIN2
DISABLE PIN26Отключение PIN
ENABLE PIN28Включение PIN
UNBLOCK PIN2CРазблокировка PIN с помощью PUK
GET RESPONSEC0Получение данных, на которые указывает предшествующий 61XX/9FXX

Методы SELECT

@@ -72,20 +77,18 @@ По FID0000FID (4 hex) По полному пути от MF0800Полный путь от MF По DF name / AID0400AID - Цепочка ADF RFM0000FID через запятую + Цепочка0000FID через запятую; токен C0 (или C0:NN) вставляет GET RESPONSE -

Опции

- -

В правой колонке — панель конвертации (IMSI, MSISDN, ICCID, SPN, PLMN, nibble swap). См. §2.5.

+

Для record-команд режим P2: Absolute (04), Next (02) или Previous (03). Если за Case 4 командой сразу следует строка GET RESPONSE, сборщик цепочки автоматически убирает её байт Le (ETSI TS 102 226 §5.1.1). В правой колонке — панель конвертации (IMSI, MSISDN, ICCID, SPN, PLMN, nibble swap). См. §2.5.

2.2 USIM RFM

-

CLA = 00 (ETSI TS 102 221). Те же команды, что и SIM, но SELECT использует P1=09, P2=0C (выбор по FID из текущего каталога).

+

CLA = 00 (ETSI TS 102 221). Тот же сборщик цепочки и набор команд, что и SIM. Отличия:

+

2.3 Expanded Script

Построение формата Expanded Remote Application data по ETSI TS 102 226 §5.2.1.

@@ -137,7 +140,7 @@

2.4 RAM/GP

-

CLA = 80 (GlobalPlatform Card Specification v2.3.1). Команды удалённого управления приложениями.

+

CLA = 80 (GlobalPlatform Card Specification v2.3.1). Команды удалённого управления приложениями. Строятся тем же сборщиком цепочки, что и SIM/USIM.

@@ -145,21 +148,22 @@ - - - - - + + + + + - + - + +
КомандаINSP1Описание
INSTALL [for load]E602Регистрация загружаемого файла
INSTALL [for install]E60CУстановка приложения или SD
INSTALL [make selectable]E610Сделать приложение выбираемым
INSTALL [registry update]E601Обновление реестра
INSTALL [extradition]E604Перемещение между SD
LOADE800Загрузка кода
DELETEE400/80Удаление приложения или SD
INSTALL [make selectable]E608Сделать приложение выбираемым
INSTALL [registry update]E640Обновление реестра
INSTALL [extradition]E610Перемещение между SD
LOADE880Загрузка блока кода (P1=80 последний блок, номер блока в P2)
DELETEE400Удаление приложения или SD (P2=00 только AID / 80 AID + связанные объекты)
GET STATUSF280/40/20/10Статус карты
GET DATACAtagЧтение объектов данных
STORE DATAE200/40/80/C0Запись данных
STORE DATAE200/40/80/C0/E0Запись данных
SET STATUSF080/40/60Управление жизненным циклом
EXTERNAL AUTHENTICATE8200Аутентификация SCP
INTERNAL AUTHENTICATE8800Challenge-response
INTERNAL AUTHENTICATE8800Challenge-response
GET RESPONSEC000Получение данных после 61XX (Le настраивается)

Привилегии (INSTALL [for install])

-

Тег C7 в поле данных INSTALL, три байта привилегий (таблицы 11-7/8/9 спецификации GP):

+

Три байта привилегий (таблицы 11-7/8/9 спецификации GP), кодируются как length-value поле внутри данных INSTALL:

@@ -199,6 +203,9 @@
  • Nibble swap — поменять пары полубайтов hex-строки чётной длины.
  • +

    2.6 C-APDU Parser

    +

    Вставка raw APDU hex и отображение сворачиваемого дерева. Автоматически определяет контейнер: Expanded Script (начало AA или AE80, декодируется по ETSI TS 102 226 §5.2.1) или Compact C-APDU chain (последовательность C-APDU ISO 7816). Каждый узел показывает метку, hex и краткое описание; родительские узлы раскрываются в подэлементы. +

    3. Вкладка SCP80

    @@ -275,25 +282,18 @@

    4. Вкладка Response parser

    -

    Второй переключатель вкладки SCP80. Хранит предустановки карт локально в браузере (localStorage), чтобы представление Secured Packet могло автоматически подставлять ключи и параметры.

    -
    БитБайт 1Байт 2Байт 3
    - - - - - - - - - - -
    ПолеОписание
    NameПонятная метка
    ICCIDОпциональный идентификатор карты
    KIc / KIDИндикаторы ключа и алгоритма (например, 15 = индекс 1, 3DES-CBC2; x2 = AES)
    SPI1 / SPI2Security Parameter Indicators
    TARToolkit Application Reference
    CounterСчётчик повторов (5 байт)
    KIc key / KID key16/24/32 hex-символа (ключи 8/16/24 байта 3DES) или 32/48/64 hex-символа (ключи 16/24/32 байта AES)
    -

    Export as JSON / Import JSON from clipboard для обмена предустановками. Выбранная предустановка автоматически заполняет форму Secured Packet.

    +

    Декодирует raw-ответ команды: выберите отправленную команду, введите SW (например, 9000) и hex данных ответа, затем нажмите Decode.

    +

    5. Вкладка Card reader (pySim)

    -

    Подключение к локальному pysim-otaman-server для работы с картой. Подвкладки: File manager, Custom files, pySim command line, Raw APDU и Proactive UICC.

    +

    Подключение к локальному pysim-otaman-server для работы с картой. Подвкладки: File manager, Custom files, Profiler, pySim command line, Raw APDU и Proactive UICC.

    5.1 File manager

    2.4 RAM/GP

    -

    CLA = 80 (GlobalPlatform Card Specification v2.3.1). Remote Application Management commands for card content management.

    +

    CLA = 80 (GlobalPlatform Card Specification v2.3.1). Remote Application Management commands for card content management. Built with the same chain builder as SIM/USIM: add rows, fill fields, and the chain preview updates automatically.

    @@ -145,21 +148,22 @@ - - - - - + + + + + - + - + +
    CommandINSP1Description
    INSTALL [for load]E602Register a load file for loading
    INSTALL [for install]E60CInstall an application or SD
    INSTALL [make selectable]E610Make an application selectable
    INSTALL [registry update]E601Update registry entries
    INSTALL [extradition]E604Extradition between SDs
    LOADE800Load executable code blocks
    DELETEE400/80Delete application or SD
    INSTALL [make selectable]E608Make an application selectable
    INSTALL [registry update]E640Update registry entries
    INSTALL [extradition]E610Extradition between SDs
    LOADE880Load executable code block (P1=80 last block, block number in P2)
    DELETEE400Delete application or SD (P2=00 AID only / 80 AID + related objects)
    GET STATUSF280/40/20/10Get card status
    GET DATACAtagRead card data objects
    STORE DATAE200/40/80/C0Store data (key, certificate, …)
    STORE DATAE200/40/80/C0/E0Store data (key, certificate, …)
    SET STATUSF080/40/60Lifecycle state management
    EXTERNAL AUTHENTICATE8200SCP host authentication
    INTERNAL AUTHENTICATE8800Card challenge-response
    INTERNAL AUTHENTICATE8800Card challenge-response
    GET RESPONSEC000Fetch data after a 61XX status (Le configurable)

    Privileges (INSTALL [for install])

    -

    Tag C7 in the INSTALL data field, built from 3 privilege bytes (GP spec Tables 11-7/8/9):

    +

    Three privilege bytes (GP spec Tables 11-7/8/9), encoded as a length-value field inside the INSTALL data:

    @@ -199,6 +203,9 @@
  • Nibble swap — swap nibble pairs of an even-length hex string.
  • +

    2.6 C-APDU Parser

    +

    Pastes raw APDU hex and renders a collapsible tree. It auto-detects the container: an Expanded Script (leading AA or AE80, decoded per ETSI TS 102 226 §5.2.1) or a Compact C-APDU chain (a sequence of ISO 7816 C-APDUs). Each node shows its label, hex and a short description; parent nodes expand to reveal their sub-elements. +

    3. SCP80 tab

    @@ -286,7 +293,7 @@

    5. Card reader (pySim) tab

    -

    Connects to a local pysim-otaman-server for live card operations. Sub-tabs: File manager, Custom files, pySim command line, Raw APDU, and Proactive UICC.

    +

    Connects to a local pysim-otaman-server for live card operations. Sub-tabs: File manager, Custom files, Profiler, pySim command line, Raw APDU, and Proactive UICC.

    5.1 File manager

      @@ -305,9 +312,12 @@

      Send an arbitrary APDU and view the raw response.

      5.5 Proactive UICC

      -

      Interacts with the Card Application Toolkit session: subscribed events, the proactive command log, the PROVIDE LOCAL INFORMATION data dictionary, and STATUS polling.

      +

      Interacts with the Card Application Toolkit session: the STK menu, subscribed events, the proactive command log, the PROVIDE LOCAL INFORMATION data dictionary, and STATUS polling.

      -

      5.5.1 Subscribed events (SET UP EVENT LIST)

      +

      5.5.1 STK menu

      +

      When the card has issued a SET UP MENU command, a “STK menu” block appears at the top of this view with an emerald STK: <title> button that opens the menu overlay (same as the card’s STK menu browser). If the card has not set up a menu, the block shows “No menu set by the card” instead. The menu state is refreshed each time the view is opened.

      + +

      5.5.2 Subscribed events (SET UP EVENT LIST)

      The events the card monitors. Each event has a Send button that opens a form specific to the event type:

      • No-data events (User Activity, Idle Screen, Data Available, …) — one-click notification
      • @@ -317,10 +327,10 @@

      Sending an event uses ENVELOPE(Event Download) per TS 102 223 / TS 131 111.

      -

      5.5.2 Proactive command log

      +

      5.5.3 Proactive command log

      Chronological list of fetched proactive commands. Each row shows the elapsed time, type code, name, and a decoded qualifier (for commands that have one). Commands with response data show a Response: line with the TERMINAL RESPONSE bytes (boilerplate TLVs stripped); PROVIDE LOCAL INFORMATION responses are decoded using the PLI data dictionary decoders.

      -

      5.5.3 PROVIDE LOCAL INFORMATION data dictionary

      +

      5.5.4 PROVIDE LOCAL INFORMATION data dictionary

      Editable hex values for all 22 PLI qualifiers (TS 102 223 §8.6 + TS 131 111). Ten qualifiers have inline decode/encode forms:

      • 00 Location Info (MCC, MNC, LAC/TAC, Cell ID)
      • @@ -330,10 +340,30 @@

      Values persist server-side until restart. When the card issues PLI, the server injects the dictionary values into the TERMINAL RESPONSE.

      -

      5.5.4 STATUS polling

      +

      5.5.5 STATUS polling

      A Send STATUS button issues a manual STATUS (F2). A Polling toggle enables background polling: after a configurable idle interval (server CLI --poll-interval, 1–255 s, default 30 s) the server sends STATUS and handles any pending proactive command. Polling stops and card state resets if the card is removed.

      -

      5.6 Usage scenarios

      +

      5.6 Profiler

      +

      Verifies that a card matches a named profile — an ordered set of rules describing the expected file system and (optionally) file contents. Profiles are stored in localStorage.

      +

      Profile list

      +
        +
      • New profile — creates an empty ruleset after prompting for a name.
      • +
      • Profile from card — scans the equipped card and generates one rule per existing file (see below), then opens the editor.
      • +
      • Import profile — loads a ruleset from a JSON file (the name is stored inside the JSON).
      • +
      • Each profile row shows its name and creation time, with Edit, Check, Export (download JSON), and Delete actions.
      • +
      +

      Filesystem rules

      +

      Rules run sequentially. A filesystem rule is defined by:

      +
        +
      • Path — starts with MF (e.g. MF/7F10/6F3A) or an ADF AID (e.g. A0000000871002/6F07).
      • +
      • File attributes — file type, size, record length and record count, taken from the FCI template (any may be left unset).
      • +
      • Contents (optional) — Exact hex equality, or Mask where ? is a per-nibble wildcard (a mask with no ? is a prefix match, e.g. 0891 for the IMSI MCC/MNC). Record files store a per-record list.
      • +
      +

      Check runs every rule against the equipped card and shows a live progress line plus a pass/fail report (existence, each FCI attribute, and the content match).

      +

      “Profile from card” scan options

      +

      The scan dialog asks for a profile name and offers an “Ignore contents of” checklist (all checked by default) of frequently-overwritten files whose contents are skipped: EF.LOCI, EF.PSLOCI, EF.EPSLOCI, EF.5GS3GPPLOCI, EF.Keys, EF.KeysPS, EF.SMS, EF.Kc, EF.KcGPRS, EF.LOCIGPRS, EF.CBMID, EF.SMSS. Rules are created only for files that actually exist on the card (an FCI template is returned); missing files are skipped. Custom files from the Custom files sub-tab are included under the same existence check.

      + +

      5.7 Usage scenarios

      Scenario A — Working with files not in pySim’s model (Custom files)

    BitByte 1Byte 2Byte 3