Skip to content

Commit 1fd0153

Browse files
committed
更新 README 文档,修正中文内容为英文翻译,增加脚本格式说明和示例,完善自定义脚本创建步骤及注意事项,确保信息准确易懂。
1 parent 7bb95f3 commit 1fd0153

File tree

1 file changed

+59
-43
lines changed

1 file changed

+59
-43
lines changed

apdu_script/README.md

Lines changed: 59 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,30 @@
33
* @Date: 2025-03-08 00:18:57
44
* @version:
55
* @LastEditors: SpenserCai
6-
* @LastEditTime: 2025-03-08 00:25:50
6+
* @LastEditTime: 2025-03-13 14:54:16
77
* @Description: file content
88
-->
9-
# NFC APDU Runner 预制脚本
9+
# NFC APDU Runner Predefined Scripts
1010

11-
本目录包含了一些预制的 APDU 命令脚本,可以直接用于 NFC APDU Runner 应用程序。
11+
This directory contains predefined APDU command scripts that can be used directly with the NFC APDU Runner application.
1212

13-
## 使用方法
13+
## Usage
1414

15-
1. 将这些脚本文件(`.apduscr` 文件)复制到 Flipper Zero 的以下目录:
15+
1. Copy these script files (`.apduscr` files) to the following directory on your Flipper Zero:
1616
```
1717
/ext/apps_data/nfc_apdu_runner
1818
```
1919

20-
2. 您可以通过以下方式将文件复制到 Flipper Zero
21-
- 使用 qFlipper 应用程序
22-
- 通过 USB 大容量存储模式
23-
- 使用 Flipper Zero 的文件浏览器
20+
2. You can copy the files to your Flipper Zero using:
21+
- qFlipper application
22+
- USB mass storage mode
23+
- Flipper Zero's file browser
2424

25-
3. 复制完成后,启动 NFC APDU Runner 应用程序,选择 "Load Script" 选项,即可看到并选择这些预制脚本。
25+
3. After copying, launch the NFC APDU Runner application, select "Load Script" option, and you'll see and be able to select these predefined scripts.
2626

27-
## 脚本格式说明
27+
## Script Format
2828

29-
APDU 脚本文件(`.apduscr`)是一个结构化的文本文件,格式如下:
29+
APDU script files (`.apduscr`) are structured text files with the following format:
3030

3131
```
3232
Filetype: APDU Script
@@ -35,17 +35,17 @@ CardType: iso14443_4a
3535
Data: ["00A4040007A0000000041010", "00B0000000"]
3636
```
3737

38-
其中:
39-
- `Filetype`: 固定为 "APDU Script"
40-
- `Version`: 脚本版本号,当前为 1
41-
- `CardType`: 卡片类型,可以是以下值之一(不区分大小写):
38+
Where:
39+
- `Filetype`: Always "APDU Script"
40+
- `Version`: Script version number, currently 1
41+
- `CardType`: Card type, can be one of the following (case-insensitive):
4242
- `iso14443_4a`
4343
- `iso14443_4b`
44-
- `Data`: 包含一个或多个 APDU 命令的 JSON 数组,每个命令都是十六进制格式的字符串
44+
- `Data`: JSON array containing one or more APDU commands, each as a hexadecimal string
4545

46-
## 示例
46+
## Example
4747

48-
以下是一个示例脚本文件的内容:
48+
Here's an example script file:
4949

5050
```
5151
Filetype: APDU Script
@@ -54,38 +54,54 @@ CardType: iso14443_4a
5454
Data: ["00A4040007A0000000041010", "00B0000000"]
5555
```
5656

57-
这个脚本将:
58-
1. 选择一个 ISO14443-4A 类型的卡片
59-
2. 发送 SELECT 命令选择支付应用
60-
3. 发送 READ RECORD 命令读取数据
57+
This script will:
58+
1. Select an ISO14443-4A type card
59+
2. Send a SELECT command to select a payment application
60+
3. Send a READ RECORD command to read data
6161

62-
## 本目录中的预制脚本
62+
## Available Scripts
6363

64-
1. **emv_select_ppse.apduscr**: 选择 EMV 支付卡的 PPSE(Proximity Payment System Environment)
65-
2. **read_uid.apduscr**: 读取 ISO14443-3A 卡片的 UID
66-
3. **mifare_desfire_get_version.apduscr**: 获取 Mifare DESFire 卡片的版本信息
64+
The following table lists the predefined scripts available in this directory:
6765

68-
## 自定义脚本
66+
| Script Name | Purpose | Parsing Template |
67+
| ------------------------ | ------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
68+
| get_aid.apduscr | Attempts to select various AIDs (Application Identifiers) to determine which applications are supported by the card | None |
69+
| e_travel_card_sh.apduscr | Reads information from Shanghai electronic transportation cards (NFC emulated transit cards on devices like iPhone) | [E_TRAVEL_CARD_SH.apdufmt](/tools/ResponseDecoder/format/E_TRAVEL_CARD_SH.apdufmt) |
70+
| pboc.apduscr | Reads information from PBOC (China UnionPay) banking cards | [PBOC.apdufmt](/tools/ResponseDecoder/format/PBOC.apdufmt) |
6971

70-
您可以根据自己的需求创建自定义脚本:
72+
## Creating Custom Scripts
7173

72-
1. 使用任何文本编辑器创建一个新的 `.apduscr` 文件
73-
2. 按照上述格式编写脚本内容
74-
3. 将文件保存到 `/ext/apps_data/nfc_apdu_runner` 目录
74+
You can create your own custom scripts:
7575

76-
## 注意事项
76+
1. Use any text editor to create a new `.apduscr` file
77+
2. Write the script content following the format described above
78+
3. Save the file to the `/ext/apps_data/nfc_apdu_runner` directory
7779

78-
- 确保 APDU 命令格式正确,否则可能导致执行失败
79-
- 某些 APDU 命令可能需要特定的卡片类型才能正常工作
80-
- 使用未知或不安全的 APDU 命令可能会对某些卡片造成永久性损坏,请谨慎使用
80+
## Notes
8181

82-
## 常见问题
82+
- Ensure APDU commands are correctly formatted, otherwise execution may fail
83+
- Some APDU commands may require specific card types to work properly
84+
- Using unknown or unsafe APDU commands may cause permanent damage to some cards, use with caution
8385

84-
**Q: 为什么我的脚本无法执行?**
85-
A: 请检查卡片类型是否正确,以及 APDU 命令格式是否正确。
86+
## Parsing Templates
8687

87-
**Q: 我可以在哪里找到更多的 APDU 命令?**
88-
A: 您可以参考相关卡片的技术规范或在线资源。
88+
For some scripts, parsing templates (`.apdufmt` files) are available in the `/tools/ResponseDecoder/format/` directory. These templates define how to interpret and display the response data from the card.
8989

90-
**Q: 执行脚本后,我可以在哪里查看结果?**
91-
A: 执行完成后,应用程序会自动显示每个命令的响应结果。
90+
To use a parsing template:
91+
1. Run the script using NFC APDU Runner
92+
2. Save the response file (`.apdures`)
93+
3. Use the ResponseDecoder tool with the appropriate template:
94+
```
95+
./response_decoder --hex "response_file.apdures" --format "template_name.apdufmt"
96+
```
97+
98+
## FAQ
99+
100+
**Q: Why can't my script execute?**
101+
A: Check if the card type is correct and if the APDU command format is valid.
102+
103+
**Q: Where can I find more APDU commands?**
104+
A: You can refer to the technical specifications of relevant cards or online resources.
105+
106+
**Q: Where can I view the results after executing a script?**
107+
A: After execution, the application will automatically display the response result for each command.

0 commit comments

Comments
 (0)