Help us improve
Share bugs, ideas, or general feedback.
From cocos-reverse-engineering
Reverse engineer Cocos Creator 2.x/3.x game builds: detect engine version, decrypt XXTEA-encrypted .jsc scripts, recover settings/metadata, and rebuild editable Cocos project (scenes, prefabs, sprites, audio, animations).
npx claudepluginhub crain99/cocos-reverse-engineering-skill --plugin cocos-reverse-engineeringHow this skill is triggered — by the user, by Claude, or both
Slash command
/cocos-reverse-engineering:cocos-reverse-engineeringThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Recover the editable project (scripts + scenes + assets + meta) from a compiled Cocos Creator build. Supports **Cocos Creator 2.3.x / 2.4.x** (the `src/project.js` + `res/` layout and the `main.js` + `assets/` layout) and **Cocos Creator 3.x** (the `assets/main/` bundle layout with `config.json` + `import/` + `native/` + `cocos-js/`). Handles XXTEA-encrypted `.jsc` scripts via auto key extraction.
references/asset-recovery-patterns.mdreferences/cc-reverse-usage.mdreferences/cocos2x-format.mdreferences/cocos3x-format.mdreferences/jsc-decryption.mdreferences/setup-guide.mdscripts/check-deps.shscripts/detect-project.shscripts/find-assets.shscripts/find-jsc-key.shscripts/install-dep.shscripts/unpack-cocos.shFetches up-to-date library and framework documentation via Context7 MCP for setup questions, API references, and code examples.
Share bugs, ideas, or general feedback.
Recover the editable project (scripts + scenes + assets + meta) from a compiled Cocos Creator build. Supports Cocos Creator 2.3.x / 2.4.x (the src/project.js + res/ layout and the main.js + assets/ layout) and Cocos Creator 3.x (the assets/main/ bundle layout with config.json + import/ + native/ + cocos-js/). Handles XXTEA-encrypted .jsc scripts via auto key extraction.
The workflow is driven by cc-reverse, a Node.js CLI that this skill wraps and extends with engine detection and decryption helpers.
This skill requires Node.js 16+ and the cc-reverse CLI installed. Run the dependency checker to verify:
bash ${CLAUDE_PLUGIN_ROOT}/skills/cocos-reverse-engineering/scripts/check-deps.sh
If anything is missing, follow ${CLAUDE_PLUGIN_ROOT}/skills/cocos-reverse-engineering/references/setup-guide.md, or let the install helper handle it:
bash ${CLAUDE_PLUGIN_ROOT}/skills/cocos-reverse-engineering/scripts/install-dep.sh cc-reverse
bash ${CLAUDE_PLUGIN_ROOT}/skills/cocos-reverse-engineering/scripts/check-deps.sh
The output contains machine-readable lines:
INSTALL_REQUIRED:<dep> — must be installed before proceeding (node, cc-reverse).INSTALL_OPTIONAL:<dep> — nice-to-have (7z, unzip, ffmpeg for audio format conversion).If required dependencies are missing (exit code 1), install them:
bash ${CLAUDE_PLUGIN_ROOT}/skills/cocos-reverse-engineering/scripts/install-dep.sh <dep>
Re-run the check until everything passes. Do not proceed to Phase 2 until all required dependencies are OK.
Cocos Creator ships three distinct build layouts. Before anything else, identify which one you're looking at — the rest of the workflow branches on this.
Action: Run the detector script.
bash ${CLAUDE_PLUGIN_ROOT}/skills/cocos-reverse-engineering/scripts/detect-project.sh <path-to-build>
It prints ENGINE=<version> (2.3.x, 2.4.x, or 3.x), followed by key paths (settings, bundles, script entry, asset roots, native dirs) and a list of encryption markers. Machine-readable keys:
ENGINE= — detected engine series.ENCRYPTED=yes|no — are .jsc files present?BUNDLES=<csv> — detected bundle names (3.x only; main,internal,resources,<subpackages>).WEB_MOBILE=yes|no — is this the web-mobile build (has index.html)?The detector looks at:
src/settings.js + src/project.js + res/ → 2.3.xmain.js + settings.js + assets/ + optional subpackages/ → 2.4.xindex.html + data/ + assets/main/config.json + cocos-js/ + application.js + src/settings.json → 3.xindex.html at the root also work — treat the build dir as the root.unzip/7z).See ${CLAUDE_PLUGIN_ROOT}/skills/cocos-reverse-engineering/references/cocos2x-format.md and cocos3x-format.md for detailed layout maps.
If Phase 2 reported ENCRYPTED=yes, recover the XXTEA key and decrypt before the main reverse pass.
Action: Try auto-extraction first; fall back to manual key if the user has one.
bash ${CLAUDE_PLUGIN_ROOT}/skills/cocos-reverse-engineering/scripts/find-jsc-key.sh <path-to-build>
This greps main.js, src/main.js, application.js, and cocos-js/ for known key patterns:
xxteaKey = "…" / encryptKey = "…" / XXTEA_KEY = "…"key: "<16+ hex>" (Cocos 2.x default is a UUID-shaped string)src/settings.json → assets.encrypted and application.js for the xxteaKey variable[0x61, 0x62, ...]) — the script normalises these back to a stringExpected output: one or more KEY=<value> lines. If the key is obvious, cc-reverse will find it automatically too; the script is for confirmation and for the cases where cocos-engine ships it as a byte array.
If no key is found, ask the user — don't guess. Unauthorized decryption of encrypted game assets may be restricted by the software's licence.
Reference: ${CLAUDE_PLUGIN_ROOT}/skills/cocos-reverse-engineering/references/jsc-decryption.md.
Drive cc-reverse to rebuild the project.
Action: Run the unpack wrapper, passing the key if one was found.
bash ${CLAUDE_PLUGIN_ROOT}/skills/cocos-reverse-engineering/scripts/unpack-cocos.sh [OPTIONS] <path-to-build>
Options:
-o <dir> — output directory (default: <build-name>-extracted).-k <key> — XXTEA key (if Phase 3 produced one).--version-hint 2.3.x|2.4.x|3.x — force engine version when auto-detection fails.--bundle <name> — 3.x only; unpack a specific bundle (main, internal, resources, subpackage name). Default: all bundles.--assets-only — skip the script pass, only recover assets.--scripts-only — skip the asset pass, only recover scripts.--verbose — show per-file progress.The wrapper runs cc-reverse under the hood and then:
assets/ tree into the output directory.project.json / package.json at the root so the result opens in Cocos Creator.RECOVERY_REPORT.md listing engine version, bundle count, script count, and any assets that failed to decode.For 3.x projects, each bundle is unpacked into its own subdir (assets/main/, assets/resources/, …) — matching the editor's folder layout when a project is re-imported.
See ${CLAUDE_PLUGIN_ROOT}/skills/cocos-reverse-engineering/references/cc-reverse-usage.md for the full CLI reference and troubleshooting matrix.
With the project recovered, navigate and document what's inside.
Actions:
Read the entry point(s):
assets/Scripts/<main scene>.ts (game bootstrap) and the first entry under scenes in settings.assets/main/ scripts (bundled application) plus scene/ for .scene files. Look at application.js / settings.json for the launch scene UUID.Survey the asset tree:
bash ${CLAUDE_PLUGIN_ROOT}/skills/cocos-reverse-engineering/scripts/find-assets.sh <output>/assets
Prints counts of each asset kind (Scene, Prefab, SpriteFrame, AudioClip, AnimationClip, Spine, DragonBones, Material, Mesh, EffectAsset, …) plus total size and any unrecognised file types.
Map scene → prefab → component dependencies. The .fire/.scene files reference prefabs and components by UUID; the recovered meta files list each asset's UUID. Trace from the scene root down.
Identify third-party SDKs. Cocos games commonly bundle analytics/ads SDKs (AppLovin, Unity Ads, Bugly, GameAnalytics). These usually sit in assets/Scripts/ as large .ts files with recognisable API names.
See ${CLAUDE_PLUGIN_ROOT}/skills/cocos-reverse-engineering/references/asset-recovery-patterns.md for library-specific search patterns and the asset documentation template.
At the end of the workflow, deliver:
assets/, project.json, per-asset .meta)..ts/.js files grouped by package prefix, with SDK dependencies called out.${CLAUDE_PLUGIN_ROOT}/skills/cocos-reverse-engineering/references/setup-guide.md — installing Node, cc-reverse, and optional tools.${CLAUDE_PLUGIN_ROOT}/skills/cocos-reverse-engineering/references/cc-reverse-usage.md — cc-reverse CLI reference and cc-reverse.config.js options.${CLAUDE_PLUGIN_ROOT}/skills/cocos-reverse-engineering/references/cocos2x-format.md — 2.3.x and 2.4.x build layout, CCSettings, compressed-type array format, res/ tree.${CLAUDE_PLUGIN_ROOT}/skills/cocos-reverse-engineering/references/cocos3x-format.md — 3.x build layout, bundle config.json schema, import//native/ paths, CCON and packed formats.${CLAUDE_PLUGIN_ROOT}/skills/cocos-reverse-engineering/references/jsc-decryption.md — XXTEA key locations, byte-array keys, gzip post-processing, why decryption sometimes fails.${CLAUDE_PLUGIN_ROOT}/skills/cocos-reverse-engineering/references/asset-recovery-patterns.md — grep patterns for scenes, prefabs, sprite frames, Spine, DragonBones, and the per-asset documentation template.