Skills

Dsl Vm Reverse

Reverse JavaScript-based custom DSL/VM interpreters, non-standard WASM-like runtimes...

Install

npx skills add zhaoxuya520/reverse-skill --skill dsl-vm-reverse -g -a claude-code -y
Category
Engineering
Updated
1mo ago
License
MIT
Context cost
Mediumabout 2,205 tokens
Runs scripts
No, instructions only

What it does

Reverse JavaScript-based custom DSL/VM interpreters, non-standard WASM-like runtimes, and risk-control engines. Use when analyzing IIFE or switch-based opcode dispatchers, extracting instruction tables, recovering bytecode semantics, capturing VM state at runtime, or reconstructing execution flow.

🔄 DSL 自定义虚拟机逆向(DSL VM Reverse Engineering)

ACTION REQUIRED(读完后立刻执行)

  1. NOW: 确认当前任务是自定义 JS opcode VM / 风控引擎,不是标准 WASM 或普通 webpack
  2. NOW: case-init 直到 scope.md 就绪;离线样本用 offline / lab
  3. ACT: 从「3. 通用逆向工作流」Phase 1 做文件分类,不要停在目录

用于逆向基于 JavaScript 实现的自定义 WASM 虚拟机/风控引擎


目录


1. 适用范围

当目标文件符合以下 任意特征 时使用本 skill:

#特征说明
1IIFE 开头 + 大量单字母变量名!function(){var U=void 0,y=parseInt,E0=Function,...}
2包含 DG() 或类似函数含 switch-case 循环解释器主循环,d[7]&31 解码 opcode
3大文件(500KB+)但零字节占比 < 1%非标准 WASM,纯 JS
4包含 C[number] 常量表引用C[9][xxx] 函数表/字符串表
5单行压缩代码583KB 单行,混淆变量名

排除规则

条件非本 skill转至
文件以 \x00asm 开头标准 WASM 二进制reverse-engineering/languages.md
文件以 Uint8Array([0,97,115,109]) 含 WASM 魔术字WASM 嵌入式提取 .wasm 后转 IDA/Ghidra
标准 Webpack 打包(function(e,t,n){...})普通 JSjs-reverse/
零字节占比 > 20%WASM 二进制reverse-engineering/languages.md

2. DSL VM 识别特征

代码特征

// 特征 1: IIFE 入口,单字母变量映射数字常量
!function(){
    var U=void 0, y=parseInt, E0=Function, AN=Uint8Array;
    var E=15, l=10, m=12, x=16, S=13, $=11;
    // 数字常量映射为变量名,替代原始数字
    ...
}

// 特征 2: 解释器主循环 DG()
function DG(C, d, ...) {
    var d = [];  // 数组模拟 WASM stack/locals
    for (d[7] = x; d[7] !== U;) {
        var aE = d[7] & 31;         // 低 5 位 = opcode
        var O = d[7] >> 5 & 31;      // 高 5 位 = sub-operation
        switch (aE) {
            case 0: /* ... */ d[7] = 612; break;
            case 1: /* ... */
            // ... N 个 case
        }
    }
}

// 特征 3: 常量表 C[9] 存储函数索引和字符串
// C[9][0] = ["pc"]      → 函数参数描述
// C[9][667] = "string"  → 字符串常量
// C[9][x] = number      → 函数索引
Read the whole SKILL.md on GitHub

More in Engineering