Jump to content
Setting up an AI agent? ReverseEngineering.wiki skill (works from the command line, no configuration): https://reverseengineering.wiki/skill/rewiki/SKILL.md · setup for every client, including MCP: https://reverseengineering.wiki/llms.txt · REWiki:Connect

Library:QuickJS

From ReverseEngineering.wiki
Library
Developer Fabrice Bellard, Charlie Gordon; quickjs-ng contributors
License MIT
Website https://github.com/quickjs-ng/quickjs
On this wiki Facts · Code · Notes · Topics

QuickJS is Fabrice Bellard's small embeddable JavaScript engine (MIT) and quickjs-ng its actively maintained fork; a compiled bytecode format is written by qjsc and JS_WriteObject.

Identification

  • API names: JS_NewRuntime, JS_NewContext, JS_Eval, JS_EvalFunction, JS_WriteObject, JS_ReadObject, JS_NewCFunction2, and from quickjs-libc js_std_init_handlers, js_module_loader.
  • quickjs-ng defines QJS_VERSION_MAJOR/MINOR/PATCH in quickjs.h (0.17.0 at the pinned commit).
  • Error strings: invalid version (%d expected=%d), checksum error (ng), unreasonable atom count: %u.
  • Executables made with qjsc embed the compiled module as a C byte array and call JS_ReadObject then JS_EvalFunction.
  • Bytecode header byte: see Format:QuickJS bytecode; it differs between the original and the fork and between releases.

Reversing

The opcode list is quickjs-opcode.h; opcode numbers shift between releases, so match the version first. Strings, class names and function names survive in the atom table unless the bytecode was stripped (JS_WRITE_OBJ_STRIP_SOURCE / STRIP_DEBUG).

Code & repositories

  • https://github.com/quickjs-ng/quickjs @ 081d50c2792c16763f0e4a62ee4fdfb902b15a67 · license: MIT
    quickjs-ng fork. Useful without running: quickjs.c (BCTagEnum, JS_WriteObject/JS_ReadObject near line 38470), quickjs-opcode.h, qjsc.c.
    Tested on: source read, not run: source read, not run · checked 2026-10-18; last activity 2026-10-18; Note: the latest release ships binaries; the wiki links only the source, never the binaries

See also

Library:Lua, Library:Squirrel.