{
  "added_at": "2026-11-03",
  "additional_evidence_urls": [
    "https://github.com/tihmstar/img4tool/blob/bb2d63494c58993f5c8ce2ed7df207ab1063587b/img4tool/main.cpp#L44-L199",
    "https://github.com/tihmstar/img4tool/blob/bb2d63494c58993f5c8ce2ed7df207ab1063587b/img4tool/img4tool.cpp",
    "https://github.com/tihmstar/img4tool/blob/bb2d63494c58993f5c8ce2ed7df207ab1063587b/img4tool/lzssdec.c#L1-L8",
    "https://github.com/tihmstar/img4tool/blob/bb2d63494c58993f5c8ce2ed7df207ab1063587b/configure.ac",
    "https://github.com/tihmstar/img4tool/blob/bb2d63494c58993f5c8ce2ed7df207ab1063587b/.github/workflows/main.yml",
    "https://github.com/tihmstar/img4tool/blob/bb2d63494c58993f5c8ce2ed7df207ab1063587b/LICENSE",
    "https://github.com/tihmstar/img4tool/releases/tag/218"
  ],
  "category": "firmware",
  "description_en": "tihmstar's command-line tool and C++ library for Apple's IMG4 firmware container format. It prints the ASN.1 contents of IMG4 files, IM4P payload containers and IM4M signing manifests, including payload types, descriptions and key bags, and extracts IM4P or IM4M parts from IMG4 or SHSH files and payloads from IM4P files, decompressing LZSS or BVX2 (LZFSE) data and decrypting it when given an IV and key. It can also check an IM4M ticket or a signed IMG4 against a BuildManifest, convert IM4M files to SHSH, and build or rename containers for restore tooling.",
  "description_zh": "tihmstar 开发的命令行工具和 C++ 库，用于处理 Apple 的 IMG4 固件容器格式。它可以打印 IMG4 文件、IM4P 载荷容器和 IM4M 签名清单的 ASN.1 内容，包括载荷类型、描述和密钥包（KBAG）；也可从 IMG4 或 SHSH 文件中提取 IM4P 或 IM4M、从 IM4P 中提取载荷，自动解压 LZSS 或 BVX2（LZFSE）压缩数据，并在提供 IV 和密钥时解密。此外，它能根据 BuildManifest 校验 IM4M 票据或已签名的 IMG4，把 IM4M 转换为 SHSH，并为恢复工具构建或重命名容器。",
  "entry_url": "https://awesomerea.org/resources/img4tool/",
  "entry_url_zh": "https://awesomerea.org/zh/resources/img4tool/",
  "evidence_url": "https://github.com/tihmstar/img4tool/blob/bb2d63494c58993f5c8ce2ed7df207ab1063587b/README.md",
  "group": "tools",
  "id": "img4tool",
  "json_url": "https://awesomerea.org/resources/img4tool/record.json",
  "kind": "tool",
  "markdown_url": "https://awesomerea.org/resources/img4tool/index.md",
  "markdown_url_zh": "https://awesomerea.org/zh/resources/img4tool/index.md",
  "name": "img4tool",
  "name_zh": "img4tool Apple IMG4 容器工具",
  "record_type": "resource",
  "relationship": "foundation",
  "requirements": [
    "Latest release at review: build 218, published 2026-01-29, which provides the CI's macOS and Ubuntu buildroot archives rather than packaged installers. The reviewed master commit (merged 2026-08-20) is two commits ahead of it, merging a fix to the generator argument. The version number is the repository's commit count.",
    "Source builds use autoconf, automake, libtool and pkg-config with a C++11 compiler and require tihmstar's libgeneral. libplist-2.0 (for SHSH reading, verification and conversion) and a crypto backend (OpenSSL, or CommonCrypto on macOS) for decryption and payload hash checks are optional; without one, decryption fails and verification warns that it cannot check payload hashes. BVX2 support needs Apple's libcompression or liblzfse, and an optional libfwkeyfetch build adds a key-lookup option.",
    "Input files are the user's own IMG4, IM4P, IM4M or SHSH files and BuildManifests. The repository is source only and commits no Apple firmware, tickets or keys, and decrypting a payload requires an IV and key that the user supplies. The bundled LZSS decoder (lzssdec.c) is adapted, per its header, from Jonathan Levin's joker code.",
    "LGPL-3.0 license. Container creation, renaming and the IM4R generator option exist for restore workflows."
  ],
  "requirements_zh": [
    "审阅时最新版本为 build 218，发布于 2026-01-29，提供的是 CI 生成的 macOS 和 Ubuntu buildroot 压缩包，而非打包好的安装程序。所审阅的 master 提交（2026-08-20 合并）比它多两个提交，合并了一项 generator 参数修复。版本号即仓库的提交总数。",
    "从源码构建需要 autoconf、automake、libtool、pkg-config 和支持 C++11 的编译器，并依赖 tihmstar 的 libgeneral。libplist-2.0（用于读取 SHSH、校验和格式转换）以及用于解密和载荷哈希校验的加密后端（OpenSSL，macOS 上也可用 CommonCrypto）均为可选依赖；缺少加密后端时无法解密，校验也会提示无法检查载荷哈希。BVX2 支持需要 Apple 的 libcompression 或 liblzfse；可选的 libfwkeyfetch 构建会增加一个密钥查询选项。",
    "输入文件为使用者自有的 IMG4、IM4P、IM4M 或 SHSH 文件以及 BuildManifest。仓库只有源码，没有提交任何 Apple 固件、票据或密钥；解密载荷所需的 IV 和密钥须由使用者自行提供。按文件头说明，附带的 LZSS 解码器（lzssdec.c）改编自 Jonathan Levin 的 joker 代码。",
    "采用 LGPL-3.0 许可。容器创建、重命名和 IM4R generator 选项服务于恢复流程。"
  ],
  "targets": [
    "firmware"
  ],
  "url": "https://github.com/tihmstar/img4tool",
  "verification": "source-reviewed",
  "verified_at": "2026-10-27"
}
