[GH-ISSUE #3650] [Feature] Construct 2/3 reverse engineering: runtime bundles, event sheets, object behaviors and JavaScript/WASM reconstruction #1369

Open
opened 2026-10-16 21:04:46 +00:00 by bsakaguchi · 0 comments
Owner

Originally created by @matbrgz on GitHub (Oct 14, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/3650

Type: Feature Domain: Game & Engine RE Status: Proposed Ecosystem: REA

Summary

Construct 2 and Construct 3 (by Scirra) are leading 2D game and interactive multimedia development platforms exporting to HTML5, WebAssembly, Electron desktop wrappers, and Cordova/Capacitor mobile packages. Packaged Construct games compile visual event sheets, layout scenes, object behaviors, and third-party plugins into minified JavaScript bundles and data schemas (data.js, c2runtime.js, c3runtime.js).

While REA has specialized Web bundle analysis (#3608), it currently treats Construct games as generic minified JavaScript files, losing the game's higher-level event logic, behavioral rules, layout instances, and plugin communication channels.

This feature proposal introduces dedicated Construct 2 and Construct 3 Reverse Engineering to REA, enabling automated deserialization of project data schemas, reconstruction of event sheets and actions, extraction of object behaviors, and mapping of JavaScript/WASM native bridges.


Technical Capabilities & Architecture

                                    +-----------------------------------------+
                                    | Input: Construct 2/3 Export Directory   |
                                    |        or Package (data.js, c3runtime)  |
                                    +--------------------+--------------------+
                                                         |
                         +-------------------------------+-------------------------------+
                         |                                                               |
                         v                                                               v
           +---------------------------+                                   +---------------------------+
           | Runtime Schema Parser     |                                   | Layout & Instance Model   |
           | (data.js / project.c3proj)|                                   | (Layers, Z-order, Props)  |
           +-------------+-------------+                                   +-------------+-------------+
                         |                                                               |
                         +-------------------------------+-------------------------------+
                                                         |
                                                         v
                                     +---------------------------------------+
                                     | Event Sheet & Script Decompiler       |
                                     | (Conditions, Actions, Sub-events)     |
                                     +-------------------+-------------------+
                                                         |
                         +-------------------------------+-------------------------------+
                         |                                                               |
                         v                                                               v
           +---------------------------+                                   +---------------------------+
           | Behaviors & Plugin Mapping|                                   | Network & WebAssembly     |
           | (Platform, Solid, Physics)|                                   | Bridge Inversion (WASM)   |
           +-------------+-------------+                                   +-------------+-------------+
                                                         |
                                                         v
                                     +---------------------------------------+
                                     | REA Evidence: Event Rule Graph,       |
                                     | Object Dossier & Asset Hierarchy      |
                                     +---------------------------------------+

1. Runtime Project & Schema Ingestion

  • Construct 2 Format (data.js): Parse the JSON data structure holding project properties, global variables, object types, layouts, and event sheets.
  • Construct 3 Format (c3runtime / data.json): Parse modern Construct 3 modular project schemas, handling zipped .c3p files and obfuscated runtime data payloads.
  • Project Settings: Extract viewport size, framerate mode, physics engine choice (Box2D asm.js vs. WebAssembly), and loader configurations.

2. Layouts, Layers & Instance Reconstruction

  • Layout Definitions: Extract room/level dimensions, layer hierarchies, parallax factors, and blend modes.
  • Object Types & Instances:
    • Extract object types (Sprite, TiledBackground, Text, Audio, Particles, Keyboard, Touch, Gamepad).
    • Extract instance coordinates (x, y), angle, scale, opacity, initial visibility, and instance variables.
    • Image and animation sequences: extract sprite sheets, collision polygon vertices, and frame durations.

3. Event Sheet & Rule Inversion

  • Event Tree Decompilation: Reconstruct visual event blocks into human-readable conditional logic:
    • Conditions: Trigger conditions (e.g. On collision with, On key pressed), continuous conditions (e.g. Is overlapping, Compare variable).
    • Actions: State modifications (e.g. Set position, Spawn another object, Play audio, Set variable).
    • Sub-events & Groups: Invert nested sub-events, Else branches, and active/inactive event groups.
  • Script Blocks: Statically extract inline JavaScript / TypeScript code blocks embedded directly within event sheets.

4. Object Behaviors & Plugin Ecosystem

  • Built-in Behaviors: Identify and parameterize standard behaviors: 8Direction, Platform, Solid, Bullet, Pathfinding, Fade, Sine, Pin, Physics.
  • Custom Add-ons & Plugins: Catalog third-party plugins (e.g. analytics, ads, multiplayer WebSocket connectors, backend APIs).
  • WASM Bridge Inversion: Map calls crossing between JavaScript event handlers and compiled WebAssembly physics or encryption engines.

Acceptance Criteria

  1. Introduce analyze_construct_project in REA CLI and MCP contracts, accepting exported game directories or .c3p files.
  2. Accurately deserialize synthetic Construct 2 data.js and Construct 3 project schemas into structured JSON.
  3. Reconstruct layouts, object instances, and animation properties in structured evidence.
  4. Decompile condition-action event sheets into readable logic flowcharts.
  5. Document all configured behaviors and external WebSocket/HTTP endpoints.

  • #3608 [RFC/Feature] React Semantic Reconstruction & Decompiler Engine
  • #3632 [Feature] GameMaker reverse engineering: data.win, GML bytecode
  • #3631 [Feature] Godot reverse engineering: PCK unpacking
Originally created by @matbrgz on GitHub (Oct 14, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/3650 [![Type: Feature](https://img.shields.io/badge/type-feature-blue.svg?style=flat-square)](https://github.com/morluto/rea) [![Domain: Game & Engine RE](https://img.shields.io/badge/domain-game_&_engine_RE-green.svg?style=flat-square)](https://github.com/morluto/rea) [![Status: Proposed](https://img.shields.io/badge/status-proposed-blue.svg?style=flat-square)](https://github.com/morluto/rea) [![Ecosystem: REA](https://img.shields.io/badge/ecosystem-morluto%2Frea-8A2BE2.svg?style=flat-square)](https://github.com/morluto/rea) ## Summary Construct 2 and Construct 3 (by Scirra) are leading 2D game and interactive multimedia development platforms exporting to HTML5, WebAssembly, Electron desktop wrappers, and Cordova/Capacitor mobile packages. Packaged Construct games compile visual event sheets, layout scenes, object behaviors, and third-party plugins into minified JavaScript bundles and data schemas (`data.js`, `c2runtime.js`, `c3runtime.js`). While REA has specialized Web bundle analysis (#3608), it currently treats Construct games as generic minified JavaScript files, losing the game's higher-level event logic, behavioral rules, layout instances, and plugin communication channels. This feature proposal introduces dedicated **Construct 2 and Construct 3 Reverse Engineering** to REA, enabling automated deserialization of project data schemas, reconstruction of event sheets and actions, extraction of object behaviors, and mapping of JavaScript/WASM native bridges. --- ## Technical Capabilities & Architecture ``` +-----------------------------------------+ | Input: Construct 2/3 Export Directory | | or Package (data.js, c3runtime) | +--------------------+--------------------+ | +-------------------------------+-------------------------------+ | | v v +---------------------------+ +---------------------------+ | Runtime Schema Parser | | Layout & Instance Model | | (data.js / project.c3proj)| | (Layers, Z-order, Props) | +-------------+-------------+ +-------------+-------------+ | | +-------------------------------+-------------------------------+ | v +---------------------------------------+ | Event Sheet & Script Decompiler | | (Conditions, Actions, Sub-events) | +-------------------+-------------------+ | +-------------------------------+-------------------------------+ | | v v +---------------------------+ +---------------------------+ | Behaviors & Plugin Mapping| | Network & WebAssembly | | (Platform, Solid, Physics)| | Bridge Inversion (WASM) | +-------------+-------------+ +-------------+-------------+ | v +---------------------------------------+ | REA Evidence: Event Rule Graph, | | Object Dossier & Asset Hierarchy | +---------------------------------------+ ``` ### 1. Runtime Project & Schema Ingestion - **Construct 2 Format (`data.js`):** Parse the JSON data structure holding project properties, global variables, object types, layouts, and event sheets. - **Construct 3 Format (`c3runtime` / `data.json`):** Parse modern Construct 3 modular project schemas, handling zipped `.c3p` files and obfuscated runtime data payloads. - **Project Settings:** Extract viewport size, framerate mode, physics engine choice (Box2D asm.js vs. WebAssembly), and loader configurations. ### 2. Layouts, Layers & Instance Reconstruction - **Layout Definitions:** Extract room/level dimensions, layer hierarchies, parallax factors, and blend modes. - **Object Types & Instances:** - Extract object types (Sprite, TiledBackground, Text, Audio, Particles, Keyboard, Touch, Gamepad). - Extract instance coordinates $(x, y)$, angle, scale, opacity, initial visibility, and instance variables. - Image and animation sequences: extract sprite sheets, collision polygon vertices, and frame durations. ### 3. Event Sheet & Rule Inversion - **Event Tree Decompilation:** Reconstruct visual event blocks into human-readable conditional logic: - **Conditions:** Trigger conditions (e.g. `On collision with`, `On key pressed`), continuous conditions (e.g. `Is overlapping`, `Compare variable`). - **Actions:** State modifications (e.g. `Set position`, `Spawn another object`, `Play audio`, `Set variable`). - **Sub-events & Groups:** Invert nested sub-events, `Else` branches, and active/inactive event groups. - **Script Blocks:** Statically extract inline JavaScript / TypeScript code blocks embedded directly within event sheets. ### 4. Object Behaviors & Plugin Ecosystem - **Built-in Behaviors:** Identify and parameterize standard behaviors: `8Direction`, `Platform`, `Solid`, `Bullet`, `Pathfinding`, `Fade`, `Sine`, `Pin`, `Physics`. - **Custom Add-ons & Plugins:** Catalog third-party plugins (e.g. analytics, ads, multiplayer WebSocket connectors, backend APIs). - **WASM Bridge Inversion:** Map calls crossing between JavaScript event handlers and compiled WebAssembly physics or encryption engines. --- ## Acceptance Criteria 1. Introduce `analyze_construct_project` in REA CLI and MCP contracts, accepting exported game directories or `.c3p` files. 2. Accurately deserialize synthetic Construct 2 `data.js` and Construct 3 project schemas into structured JSON. 3. Reconstruct layouts, object instances, and animation properties in structured evidence. 4. Decompile condition-action event sheets into readable logic flowcharts. 5. Document all configured behaviors and external WebSocket/HTTP endpoints. --- ## Related - #3608 [RFC/Feature] React Semantic Reconstruction & Decompiler Engine - #3632 [Feature] GameMaker reverse engineering: data.win, GML bytecode - #3631 [Feature] Godot reverse engineering: PCK unpacking
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#1369
No description provided.