tjs2dec

Crates.iotjs2dec
lib.rstjs2dec
version0.3.0
created_at2025-12-21 05:49:16.881405+00
updated_at2025-12-22 01:24:52.41499+00
descriptionA krkr2 and krkrz tjs2 bytecode decompiler written in Rust
homepage
repositoryhttps://github.com/xmoezzz/tjs2Decompiler
max_upload_size
id1997521
size337,091
xmoe (xmoezzz)

documentation

README

tjs2dec

A minimal, strict TJS2 (Kirikiri2 / Kirikiri-Z) bytecode loader and disassembler written in Rust. This tool allows you to inspect, analyze, and decompile compiled TJS2 script files (.tjs).

Features

  • Disassemble: Convert binary bytecode into human-readable assembly mnemonics.
  • SSA&HLIR: Generate Static Single Assignment (SSA) form or High-Level Intermediate Representation (HLIR) for deep code analysis.
  • Decompilation: Attempt to reconstruct high-level TJS2 source code.
  • TJS Emitting: Generate an executable TJS script that replays the low-level bytecode logic.

Installation

cargo build --release

The binary will be located at ./target/release/tjs2dec.


Usage

tjs2dec provides several subcommands depending on the level of detail you need.

1. Disassemble Bytecode

To see the raw instructions and constant pools:

tjs2dec disasm Action.tjs

2. High-Level Decompilation

To attempt to recover the original TJS2 source code:

tjs2dec tjs Action.tjs

3. SSA and HLIR Analysis

To dump the Static Single Assignment form (useful for understanding data flow):

tjs2dec ssa Action.tjs

To dump the High-Level IR (HLIR):

tjs2dec ssa --hlir Action.tjs

4. Emit Executable TJS

To create a low-level TJS program that mimics the behavior of the bytecode:

tjs2dec emit-tjs Action.tjs


License

MPL-2.0 License


Commit count: 0

cargo fmt