Tool

jsc-decompile-mozjs-34

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.

Targets
App · Game
Category
JavaScript and Electron tools
Relationship
Foundation tool
Sources reviewed

Requirements & limits

  • 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. Nothing was run and no bytecode was decompiled; the reviewed sources establish no REA connection.

About this entry

The description was reviewed against primary sources. This does not establish runtime testing, security auditing or verified compatibility.

Report an outdated entry Suggest a translation fix

Primary sources

  1. readme.md GitHub · irelance/jsc-decompile-mozjs-34 · Revision 44ffa1b
  2. composer.json GitHub · irelance/jsc-decompile-mozjs-34 · Revision 44ffa1b
  3. run.php GitHub · irelance/jsc-decompile-mozjs-34 · Revision 44ffa1b
  4. scan.php GitHub · irelance/jsc-decompile-mozjs-34 · Revision 44ffa1b
  5. src/Decompile.php GitHub · irelance/jsc-decompile-mozjs-34 · Revision 44ffa1b
  6. src/Constant.php GitHub · irelance/jsc-decompile-mozjs-34 · Revision 44ffa1b
  7. src/Xdr GitHub · irelance/jsc-decompile-mozjs-34 · Revision 44ffa1b

More in Apps

All 136 entries in Apps