From 7c81f02308f120c5f4b34f1bd4f28639fb07f9d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D1=82=D0=BE=D0=BD=20=D0=A2=D1=80=D0=BE=D1=88?= =?UTF-8?q?=D0=B8=D0=BD?= Date: Mon, 28 Sep 2026 22:51:20 +0300 Subject: [PATCH] feat: Explore expanded (E3) listing fallback + details pass + format display (v3.6.25) The E3 parsers existed since the vendor-trace work; what was missing was issuing the query. Per GP 11.4.2.2 the compact listing format (P2.b2=0) is deprecated and a card may reject it, while the expanded form (P2=02 + the tag list 4F 9F70 C5 C4 CC CE EA) returns the richer registry data. - ramExpandedQueryApdu(p1): the reference trace bytes (80F2 02 0C 4F005C084F9F70C5C4CCCEEA 00), pinned in a test. - Explore: when the compact pass for a P1 yields nothing, the query is retried in the expanded format and the result becomes the listing (the compact error only surfaces if the retry also fails); the new "Query expanded registry details (E3)" checkbox runs the expanded pass on top of a working compact listing and merges the expanded-only fields (privileges, ELF AID C4, SD AID CC, module lists) into the entries. - The detected RAM command format (v3.6.24 ram_format) is now shown in the Explore result + explorer view, the delete verdict and the plain-send message. - Tests parse the real trace payloads (NC ISD, ET application, NP ELF E3 templates); help EN/RU updated. 656 frontend / 504 Python green; version 3.6.25; sw simple-v298. --- frontend/help-ru.html | 2 +- frontend/help.html | 2 +- frontend/index.html | 70 ++++++++++++++++++++++++++++++----- frontend/sw.js | 2 +- frontend/tests/ram.test.js | 37 +++++++++++++++++- pyproject.toml | 2 +- pysim_simple_server/server.py | 2 +- 7 files changed, 101 insertions(+), 16 deletions(-) diff --git a/frontend/help-ru.html b/frontend/help-ru.html index 53109b8..1bc961d 100644 --- a/frontend/help-ru.html +++ b/frontend/help-ru.html @@ -320,7 +320,7 @@ - +
ОперацияОписание
Обзор карты (все данные GP)Запрос GET STATUS для ISD, приложений, ELF и модулей ELF, а также GET DATA FF21 для информации о памяти. Результаты отображаются в обзоре с кнопками Удалить для каждого элемента.
Обзор карты (все данные GP)Запрос GET STATUS для ISD, приложений, ELF и модулей ELF, а также GET DATA FF21 для информации о памяти. Если карта отвергает компактный формат листинга (P2.b2=0, устаревший по GP), запросы повторяются в расширенном формате E3; флажок Запрашивать расширенные данные реестра (E3) дополнительно запрашивает их и объединяет расширенные поля (привилегии, связи ELF/SD, списки модулей). Результаты отображаются в обзоре с кнопками Удалить для каждого элемента и определённым форматом команд RAM.
Установка пакета (.cap файл)Отправка .cap файла на карту через сервер: INSTALL[for load] → LOAD ×N → INSTALL[for install (+make selectable)]. Load-файл делится на LOAD APDU размера размер блока LOAD (1–240 байт полезной нагрузки, по умолчанию 240); каждый защищённый пакет доставляется одним SMS или, если он больше, конкатенированной SMS-PP загрузкой до 5 сегментов, так что большой .cap просто занимает несколько SMS. Сразу после выбора файл проверяется и в форме показывается оценка требований к памяти: требование NVRAM (образ кода + постоянные данные, сумма в стиле C6+C8 из GP Card Spec) и оценка RAM. Там же показаны библиотеки, с которыми слинкован CAP (его компонент Import: имя библиотеки, AID и минимальная версия ≥ x.y — имена стандартных библиотек и семейства подставляются, а где известно, даётся подсказка о версии Java Card), идентификаторы пакета и апплетов и разбивка по компонентам (размеры и доли в порядке load-файла) — всё сгруппировано по разделам Package, Requires, Memory и Components. Повреждённый файл не проходит анализ, и Execute остаётся недоступной до успешного анализа.
diff --git a/frontend/help.html b/frontend/help.html index 2a52742..98e4d60 100644 --- a/frontend/help.html +++ b/frontend/help.html @@ -319,7 +319,7 @@ - +
OperationDescription
Explore Card (all GP data)Queries GET STATUS for ISD, Applications, ELFs, and ELF Modules, plus GET DATA FF21 for memory info. Results appear in an explorer view with per-item Delete buttons.
Explore Card (all GP data)Queries GET STATUS for ISD, Applications, ELFs, and ELF Modules, plus GET DATA FF21 for memory info. If a card rejects the compact listing (P2.b2=0, deprecated by GP) the queries are retried in the expanded E3 form; the Query expanded registry details (E3) checkbox also requests it as an extra pass and merges the expanded-only fields (privileges, ELF/SD associations, module lists). Results appear in an explorer view with per-item Delete buttons and the detected RAM command format.
Install Package (.cap file)Sends a .cap file to the card via the server: INSTALL[for load] → LOAD ×N → INSTALL[for install (+make selectable)]. The load file is split into LOAD APDUs of the LOAD block size (1–240 bytes of payload, 240 by default); each secured packet is delivered as a single SMS or, when larger, as a concatenated SMS-PP download of up to 5 segments, so a large .cap simply takes several SMS. As soon as the file is selected it is validated and its memory requirements are estimated in the form: the NVRAM requirement (the code image + persistent data, the GlobalPlatform Card Spec C6+C8 style total) and the RAM estimate. The same box reports the libraries the CAP is linked against (its Import component: library name, AID and the minimum version ≥ x.y, with standard names and families resolved and a Java Card SDK hint where known), the package/applet identity and the component breakdown (sizes and shares in load-file order) — grouped under the Package, Requires, Memory and Components headings. A corrupt or wrong-format file fails the analysis, and Execute stays disabled until a successful analysis.
diff --git a/frontend/index.html b/frontend/index.html index f2e893f..0b4be14 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -703,6 +703,8 @@ + +