Vm And Bytecode Reverse logo

Vm And Bytecode Reverse

Community
ptn1411
vm-and-bytecode-reverse

Reverse engineer custom virtual machines and proprietary bytecode (dispatcher loops, opcode tables, VM protectors, .pyc/CIL/JVM/Lua bytecode). Activate when the binary is a thin native shell around an interpreter.

Overview

Publisherptn1411
Repositoryskill
Skill namevm-and-bytecode-reverse
Stars
275
Forks
133
Bundled files
3
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 3 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by ptn1411 on GitHub. Read the source before you install it.

Installation

Install the Vm And Bytecode Reverse AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/ptn1411/skill/tree/main/vm-and-bytecode-reverse
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

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
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Vm And Bytecode Reverse in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Vm And Bytecode Reverse on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Vm And Bytecode Reverse is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

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)

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Vm And Bytecode Reverse AI skill do?

Reverse engineer custom virtual machines and proprietary bytecode (dispatcher loops, opcode tables, VM protectors, .pyc/CIL/JVM/Lua bytecode). Activate when the binary is a thin native shell around an interpreter.

Why use Vm And Bytecode Reverse on TypingMind?

Because you install it once and use it with any model. Vm And Bytecode Reverse is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Vm And Bytecode Reverse in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/ptn1411/skill/tree/main/vm-and-bytecode-reverse. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Vm And Bytecode Reverse?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Vm And Bytecode Reverse?

As many as you like. As long as a model supports skills, you can use Vm And Bytecode Reverse with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Vm And Bytecode Reverse AI skill free?

It is published on GitHub by ptn1411. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇