{
  "added_at": "2026-11-03",
  "additional_evidence_urls": [
    "https://github.com/irelance/jsc-decompile-mozjs-34/blob/44ffa1b0bb5ffc42231fcfcb60c5e6a3bc366062/composer.json",
    "https://github.com/irelance/jsc-decompile-mozjs-34/blob/44ffa1b0bb5ffc42231fcfcb60c5e6a3bc366062/run.php",
    "https://github.com/irelance/jsc-decompile-mozjs-34/blob/44ffa1b0bb5ffc42231fcfcb60c5e6a3bc366062/scan.php",
    "https://github.com/irelance/jsc-decompile-mozjs-34/blob/44ffa1b0bb5ffc42231fcfcb60c5e6a3bc366062/src/Decompile.php",
    "https://github.com/irelance/jsc-decompile-mozjs-34/blob/44ffa1b0bb5ffc42231fcfcb60c5e6a3bc366062/src/Constant.php",
    "https://github.com/irelance/jsc-decompile-mozjs-34/tree/44ffa1b0bb5ffc42231fcfcb60c5e6a3bc366062/src/Xdr"
  ],
  "category": "javascript-electron",
  "description_en": "PHP decoder and decompiler for SpiderMonkey 34 JavaScript bytecode, which the README says may handle .jsc files compiled by cocos2d-x. It parses the XDR-serialized scripts with their atoms, constants, objects, regular expressions and try and scope notes, decodes instructions from a SpiderMonkey 34 opcode table and rebuilds approximate JavaScript for each function context, while a second script prints the decoded operations instead. The author describes it as unfinished and as an example of how a JavaScript virtual machine works.",
  "description_zh": "用 PHP 编写的 SpiderMonkey 34 JavaScript 字节码解码与反编译工具，README 称它可能可以处理 cocos2d-x 编译生成的 .jsc 文件。它解析以 XDR 序列化的脚本及其中的原子（atom）、常量、对象、正则表达式和 try/作用域注记，依据 SpiderMonkey 34 的操作码表解码指令，并为每个函数上下文重建近似的 JavaScript 代码；另一个脚本则改为输出解码后的操作序列。作者称该项目尚未完成，可作为理解 JavaScript 虚拟机工作方式的示例。",
  "entry_url": "https://awesomerea.org/resources/jsc-decompile-mozjs-34/",
  "entry_url_zh": "https://awesomerea.org/zh/resources/jsc-decompile-mozjs-34/",
  "evidence_url": "https://github.com/irelance/jsc-decompile-mozjs-34/blob/44ffa1b0bb5ffc42231fcfcb60c5e6a3bc366062/readme.md",
  "group": "tools",
  "id": "jsc-decompile-mozjs-34",
  "json_url": "https://awesomerea.org/resources/jsc-decompile-mozjs-34/record.json",
  "kind": "tool",
  "markdown_url": "https://awesomerea.org/resources/jsc-decompile-mozjs-34/index.md",
  "markdown_url_zh": "https://awesomerea.org/zh/resources/jsc-decompile-mozjs-34/index.md",
  "name": "jsc-decompile-mozjs-34",
  "name_zh": "jsc-decompile-mozjs-34 SpiderMonkey 字节码反编译器",
  "record_type": "resource",
  "relationship": "foundation",
  "requirements": [
    "No releases; the last commit, on 2021-07-27, fixed global-variable and object-initialization opcodes, and the README says the project may no longer be updated and is not complete. It targets SpiderMonkey 34 bytecode: the README notes that opcodes differ between SpiderMonkey versions, lists the magic values for bytecode versions 33 to 47, and says the tool does not check the magic, so files from nearby versions may partly decode.",
    "Runs on PHP 7.0 or later (the README says it still works on 7.4) after composer install, which only generates the autoloader. php run.php prints reconstructed code for each script context, and php scan.php prints atoms, decoded operations, constants and regular expressions for files that do not decompile. Input .jsc files come from the user; the repository holds no sample files or tests, and the source has no decryption or decompression step, so it reads only plain XDR bytecode.",
    "The README reports a fatal bug when decompiling deeply nested contexts and says output is not runnable, with generated names for local variables that the compiler discarded, so results should be checked against the scan.php operations. There is no license file, and composer.json declares the package proprietary, so the repository grants no reuse terms; recovered scripts remain subject to the rights of the application's owner."
  ],
  "requirements_zh": [
    "没有发布版本；最后一次提交在 2021-07-27，修复了全局变量和对象初始化相关的操作码，README 称项目可能不再更新且尚未完成。它面向 SpiderMonkey 34 的字节码：README 指出不同 SpiderMonkey 版本的操作码各不相同，列出了字节码版本 33 至 47 的魔数，并说明工具不检查魔数，因此相近版本的文件可能部分可解码。",
    "需要 PHP 7.0 或更高版本（README 称在 7.4 上仍可运行），并先执行 composer install，该步骤只生成自动加载文件。php run.php 输出每个脚本上下文重建出的代码；对无法反编译的文件，php scan.php 会输出原子、解码后的操作、常量和正则表达式。输入的 .jsc 文件由使用者提供；仓库不含样例文件或测试，源码中也没有解密或解压步骤，因此只能读取未经处理的 XDR 字节码。",
    "README 报告在反编译深层嵌套的上下文时存在严重缺陷，并称输出无法直接运行，编译器丢弃的局部变量名会以自动生成的名称代替，因此结果应与 scan.php 输出的操作序列对照核实。仓库没有许可证文件，composer.json 将该包声明为 proprietary，因此仓库未授予任何复用条款；恢复出的脚本仍受应用权利人的权利约束。"
  ],
  "targets": [
    "app",
    "game"
  ],
  "url": "https://github.com/irelance/jsc-decompile-mozjs-34",
  "verification": "source-reviewed",
  "verified_at": "2026-10-27"
}
