Vm And Bytecode Reverseのロゴ

Vm And Bytecode Reverse

コミュニティ
ptn1411
vm-and-bytecode-reverse

カスタム仮想マシンや独自のバイトコード(ディスパッチャーループ、オペコードテーブル、VMプロテクター、.pyc/CIL/JVM/Luaバイトコード)をリバースエンジニアリングします。バイナリがインタープリターを包む薄いネイティブシェルの場合に使用します。

Add to TypingMind

概要

公開者ptn1411
リポジトリskill
スキル名vm-and-bytecode-reverse
スター
275
フォーク
133
同梱ファイル
3
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 3個の同梱ファイル

    モデルが作業中に読み取れるスクリプト、テンプレート、参考資料です。ファイルは読み取り専用で、実行されることはありません。

  • オープンソース

    ptn1411がGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「Vm And Bytecode Reverse」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/ptn1411/skill/tree/main/vm-and-bytecode-reverse
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/ptn1411/skill.git /tmp/skill
mkdir -p .claude/skills
cp -r /tmp/skill/vm-and-bytecode-reverse .claude/skills/vm-and-bytecode-reverse
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでVm And Bytecode Reverseを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にVm And Bytecode Reverseを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Vm And Bytecode Reverseは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

VM & Bytecode Reverse Engineering

Upstream reference: yaklang/hack-skills/vm-and-bytecode-reverse — facts/tables distilled from ctf-wiki. Final user-facing summary in Vietnamese.

0. Authorization & routing

Operates under MASTER_POLICY.md §1-§2.

Sibling skillWhen
binary-identifierFirst — confirm whether you are looking at native code or VM-driven
anti-debugging-techniquesMany commercial VMs ship anti-debug inside the dispatcher
symbolic-execution-toolsSymbolically run handlers to recover constraints
nuitka-decryptorSpecifically for Nuitka-compiled Python (XOR+B64 layer over .pyd)
javascript-deobfuscatorCustom JS VMs (jsvmp, obfuscator.io)

1. Recognition signatures (in IDA / Ghidra / Binary Ninja)

Pattern in disassemblyDispatcher styleFirst move
while(1) { switch(byte[pc++]) { case 0: ... } }switch-basedEnumerate cases → opcode table
Indirect call via [table + idx*8]table-based (jump table)Dump the table, label handlers
Long if/else chain on opif-chainSame as switch
push/pop dominate, single operand streamstack VMMap push/pop/arith opcodes first
reg[k] = … arithmetic on a small arrayregister VMDetermine reg count + width
pc = code[pc]; goto *handlers[op]threaded codeOne handler per opcode, ends with goto-next

Signature of a VM in any binary: a tight loop containing one fetch (opcode = mem[pc++]), one decode (table or switch), and one set of small handlers reading from and writing to the same context structure.

2. Reconstructing the ISA

StepAction
1Locate the dispatcher loop — it dominates execution time, easy to spot in a profiler / coverage trace
2Identify the VM context: bytecode pointer, PC, stack/regs, memory area. Often a single struct
3Walk every case/handler. Annotate operand widths (pc++ once = 1 byte operand, four times = 32-bit)
4Build an opcode table: { opcode → mnemonic, operand_layout, semantics }
5Write a disassembler that consumes the bytecode blob and prints mnemonics
6(Optional) Write a lifter that emits semantically equivalent C / Python / LLVM IR per handler
7(Optional) Re-host: emulate the VM in Python so you can fuzz, brute, symbolize

3. Disassembler skeleton (Python, stack-VM example)

python
# Generic single-byte-opcode + variable operand
OPCODES = {
    0x00: ('nop',  0),
    0x01: ('push', 4),     # push imm32
    0x02: ('pop',  0),
    0x03: ('add',  0),
    0x04: ('sub',  0),
    0x05: ('jz',   2),     # short branch
    0x06: ('call', 2),
    0xFF: ('halt', 0),
}

def disasm(blob: bytes, base: int = 0) -> list[str]:
    pc, out = 0, []
    while pc < len(blob):
        op = blob[pc]
        mnem, oplen = OPCODES.get(op, (f'db {op:#04x}', 0))
        operand = int.from_bytes(blob[pc+1:pc+1+oplen], 'little') if oplen else None
        out.append(f'{base+pc:08x}: {mnem}' + (f' {operand:#x}' if operand is not None else ''))
        pc += 1 + oplen
    return out

4. Common interpreter targets and their tooling

TargetFormatDecompiler / disassemblerNotes
CPython.pycdecompile3, uncompyle6 (≤3.8), pycdc (3.9+)Magic header bytes encode version
PyInstallerbundled .pycpyinstxtractor then decompile3/pycdcstruct.tuple header strip
Nuitkanative .pyd/.exenone direct — use nuitka-decryptor for XOR-encrypted variantsCompiled to C, not classical bytecode
.NETPE/CILdnSpyEx, ilspy, dotPeekStrong decompilation; watch for ConfuserEx
JVM.class/.jarcfr, procyon, jadx-cliStrings often obfuscated, control flow flattened
Android Dexclasses.dexjadx, apktoolSmali for surgical patches
Lua 5.x.luacluadec, unluacHeader magic \x1bLua
WASM.wasmwabt (wasm2wat), wasm-decompileStack-VM with structured control flow
V8 snapshot.bin/.jscV8 ssa decompiler (limited)Largely opaque; usually reverse via tracing
EVM (Ethereum)bytecode hexpanoramix, heimdall-rs, ethervm.ioStack VM, 256-bit words
Custom CTF VMproprietarywrite your own (§3)Most common

5. VM protectors (commercial)

ProtectorWhat it doesApproach
VMProtectLifts hot blocks into a stack VM with randomized handler set per buildMatch handler patterns across builds; VMPDump / vmp-decompiler recover handlers; trace with Intel PIN
ThemidaSeveral VM "engines"; mixes with code mutation and anti-debugTools fragile per-version; usually trace + handler clustering
Code VirtualizerOlder Oreans VMSimilar approach to Themida
VMware ThinApp / IonCube / SourceGuardianDomain-specific VMs around PHP/PythonLook for vendor-specific decoders first

Heuristic: VM protectors push lots of context onto the stack at function entry (vctx), then the rest of the function is one giant unrolled dispatcher. Handler count is the fingerprint — collect 20-30 handlers and cluster by operand-pattern to map them to the abstract VM ISA.

6. Maze / interpreter-style CTF tricks

  • 2D grid + step opcodes → extract the grid, run BFS/DFS for the shortest legal path.
  • "Brainfuck-like" tape VMs: the input is the program; build a meta-disassembler around the tape opcodes.
  • Crackme that hashes input through a VM: re-implement the VM in Python, then either brute-force per-byte if state is byte-local, or feed it to angr (see symbolic-execution-tools).

7. Methodology

  1. Confirm it really is a VM (single loop dominates, opcode-shaped switch/table).
  2. Extract the bytecode blob (often a .rodata array, sometimes encrypted — decrypt first).
  3. Walk every handler; build the opcode dictionary.
  4. Implement a disassembler; sanity-check by disassembling a known block.
  5. (If needed) implement an emulator for fuzzing/symbolic execution.
  6. Hand off the recovered semantics to binary-patcher (patch handler) or symbolic-execution-tools (solve constraints).

8. Final report (Vietnamese)

🧠 VM/Bytecode RE hoàn tất:
  🏛️ Kiến trúc VM   : <stack | register | threaded | maze>
  📜 Số opcode     : <COUNT>
  📚 Bảng opcode   : opcodes.json (mnemonic, operand_layout, semantics)
  🛠️ Disassembler  : disasm.py — verify trên block test
  🧪 Emulator      : (tùy chọn) emu.py
  ▶ Tiếp           : symbolic-execution-tools (giải input) hoặc binary-patcher (vá handler)

同梱ファイル

スキルが読み込まれている間、モデルは必要に応じてこれらを読み取ります。読み取り可能なファイルとして提供され、実行されることはありません。

よくある質問

AIスキル「Vm And Bytecode Reverse」では何ができますか?

カスタム仮想マシンや独自のバイトコード(ディスパッチャーループ、オペコードテーブル、VMプロテクター、.pyc/CIL/JVM/Luaバイトコード)をリバースエンジニアリングします。バイナリがインタープリターを包む薄いネイティブシェルの場合に使用します。

TypingMindでVm And Bytecode Reverseを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Vm And Bytecode Reverseはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにVm And Bytecode Reverseをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/ptn1411/skill/tree/main/vm-and-bytecode-reverseを貼り付けてください。TypingMindがSKILL.mdを読み込み、関連ファイルをまとめて、チャットごとに有効にできるスキルとしてインストールします。

Vm And Bytecode Reverseを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

Vm And Bytecode Reverseで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもVm And Bytecode Reverseを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Vm And Bytecode Reverse」は無料ですか?

ptn1411がGitHubで公開しています。ライセンス条件はリポジトリでご確認ください。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇