コンテンツにスキップ

2026 年のウェブアセンブリ逆コンパイル:ウェブの新バイナリを読む

· 13 min read · default
reverse-engineeringwebassemblywasmmalware-analysissecuritybinary-analysis

コンピューティング史のほとんど、「ウェブ上のバイナリ」は JavaScript — 人間が読める text でした。devtools で開いて理解できるもの。WebAssembly がそれを変えた。Wasm はコンパクトバイナリ命令フォーマット。ブラウザで near-native 速度で実行。ますますエッジ・プラグイン・サーバーレスランタイム・wasm サンドボックスを埋め込むアプリケーションで実行。パフォーマンス・可搬性で成功になり、また現実を作った。セキュリティ作業誰か用:出荷ロジックの成長シェア到着ユーザーへは読める source ではなく不透明バイナリ blob。その blob が暗号化マイナー webpage に密輸・難読化ライセンスチェック・JavaScript フォーカス検出を回避するマルウェアのとき、誰かはそれを逆コンパイルする必要。2026 年でその「誰か」はますますセキュリティアナリスト。ツール成熟度が要求に会うようになった。

このガイドは WebAssembly 逆コンパイルへの実践的導入。wasm を native バイナリから異なるもの説明・open-source ツールチェーン歩く — WebAssembly Binary Toolkit(WABT)diswasm decompiler、Binaryenwasm-tools — そして unknown .wasm ファイルから理解への何をするかワークフローをレイアウト。ゴールは intimidating に見える format を demystify ですが、重要方法で、native code より分析可能。

wasm を異なるもの

効果的に wasm 逆コンパイルするために、native RE tools が built-for x86・ARM バイナリから異なることを理解する。違いは両方向を切る — 一部は wasm easier に分析、他はハード。

最初定義特性は wasm は stack machine。register machine ではない。Native code は fixed CPU registers セット操作。wasm instructions は operand stack にプッシュとポップ。最初に unfamiliar だが、structured・predictable でもあり、register allocation を理由すること不要。2 番目、より helpful、特性は wasm が structured control flow を有する。Native code は arbitrary jumps を使う。decompilers はペインスタッキング reconstruct をループ・conditionals に。wasm は explicit blockloopif constructs が format に built-in。Control-flow graph が sense で既に recovered — native decompilation の最難しい部分は大きく与えられたあなたに。3 番目特性は clean module structure:wasm module を well-defined sections に organized(types、imports、functions、code、data、exports)。常に知っている関数どこに、モジュールは何をホストから import・expose。

その import/export structure は analyst 向け最も価値あるもの。Wasm module は外側の world に単独では何もできない — syscalls を持たない。重要なすること(network access、DOM manipulation、file I/O)は imported host functions を呼び出すことで起こり、それら imports は明示的に module にリスト。Import section 読むことはモジュールの機能を tell 単独命令分析前に:network reach できるもの import しなければ、データは exfiltrate できない。fetch・crypto のための関数を import ならば、ここはルック。これは capability insight の upfront レベルでそれ rare あなたは native binaries。

より難しい side:wasm は symbol names デフォルト strip(functions は func[42] になる)、types は handful numeric primitives に制限。higher-level structure は lost。toolchains・obfuscators は dense・machine-generated code を生成。でも structured control flow・explicit module layout は compensate より。これが wasm decompilation が typically native decompilation より tractable と思われた理由。

ツールチェーン

Open-source wasm RE ツールチェーンは small・focused・complementary。単一ツール何もすべてしない。標準ワークフロー一緒にいくつか使う。それぞれが何であるか知ることは役立つ。

WABT、WebAssembly Binary Toolkit、foundation。Binary .wasm format と human-readable .wat(WebAssembly Text)format の相互変換で wasm2wat。Sections ダンプ・code ディスアセンブル wasm-objdumpで。検証。そして重要に RE — C ライク decompilation を生成 wasm-decompile で。WABT は first thing reach for:バイナリを readable に turn・module structure show。--generate-names オプション synthesizes unnamed functions の names で出力 far easier をフォロー。

diswasm は readability へのステップ go further。Wasm bytecode を higher-level pseudocode に decompile。faithful-but-low-level WAT より that wasm2wat produce。WABT show you exactly モジュール say。diswasm try show you what it means。recovering structured code read more like normal program。quick triage 時ロジック理解のため、この higher-level view valuable。

Binaryen は compiler-grade toolchain。RE への relevance slightly indirect でも real。wasm-opt tool が実行 optimization・transformation passes モジュール上。そしてそれら passes の several — constant folding・dead-code elimination・local simplification — happen to clean up ノイズ compilers・obfuscators leave。実践トリックは confusing module 実行 simplification passes を通り、then decompile cleaner result。Binaryen の wasm-dis も disassemble・wasm-reduce は shrink module を behavior 確認が interest する minimal piece に。

wasm-tools、Rust low-level toolkit、周回事物 validation・parsing・mutation・support newer wasm proposals(components・GC・threads)。Programmatically inspect・mutate module が必要なとき — またはバイナリが features older tools reject を使うとき — wasm-tools modern・actively-maintained オプション。一緒にこれら 4 つは RE lifecycle をカバー:read へ WABT・diswasm。simplify へ Binaryen。validate・mutate へ wasm-tools。

実践的分析ワークフロー

Unknown .wasm ファイル直面 — say、疑わしい webpage から pulled — repeatable ワークフロー get 理解 fast。以下の sequence は experienced アナリスト converge。

Capabilities から始める、not code。Single instruction 読む前。dump imports・exports:wasm-objdump -x module.wasm(または import/export sections specifically)。Imports tell モジュールできることは — host functions call できるもの — exports tell entry points。surrounding JavaScript 実際に invokes 関数。これは frame everything:モジュールは math functions only import が very different threat than one importing fetch・crypto primitives。多くの analyses effectively here end。なぜなら capability list 既に answer question("can't reach network だから exfiltrate anything でない")。

次は、名前でディスアセンブルwasm2wat --generate-names module.wasm。これは faithful structure と synthesized names 与える。let you section layout see。data section(often strings・URLs・embedded constants を含む grep worth)。全体的形。Grep data section・WAT telltale strings のための — domains・API paths・crypto constants・error messages — which frequently reveal intent without deep code reading。

Then、特定ロジック理解する必要なら、readability のため decompile:run wasm-decompile(WABT)or diswasm を pseudocode get で。output dense・obfuscated なら、simplify first Binaryen(wasm-opt --precompute --simplify-locals --vacuum)with cleaned module decompile。Focus reading exported functions・whatever calls interesting imports — rare need to read whole module。Finally、truly stubborn sample のため、wasm-reduce minimal module を isolate できる behavior repro。shrinking surface you have to comprehend。

このcapability-first、then-structure、then-logic progression は mirror good native RE practice だが exploit wasm の advantages:explicit imports で capability step make unusually informative・structured control flow で decompilation step make unusually clean。

Wasm マルウェア・evasion

重要は理解 why アナリスト increasingly need these skills。これは shape what look for。攻撃者は concrete reasons のため wasm adopt。最も確立は cryptomining:wasm の near-native speed make ideal victims ブラウザでマイニング暗号通貨。drive-by miners が ship ブラウザの hashing loops を wasm として years。より broadly、wasm offer degree of evasion:decade learning security ecosystem analyze・detect malicious JavaScript less mature inspect wasm での decade。moving logic wasm module へは slip past tooling・human reviewers read のみ JavaScript。Obfuscated logic — licensing checks・anti-analysis routines・key derivation — より hard to lift wasm バイナリから out readable JS。そのため some vendors・some malware use wasm specifically resist reverse engineering を。

Defensive implication は「reviewed JavaScript」もはや sufficient assurance でない web-delivered code のため。Page が wasm module を ship なら、そのモジュール attack surface の part。deserve above capability-first analysis。Good news、reiterating theme、explicit import structure wasm は make at least capability question quick answer — determine できる module can do something dangerous ずっと faster obfuscated native binary の場合より。Asymmetry favor defenders willing learn toolchain。

Bridging wasm into traditional RE tools

Question quickly come up experienced reversers のため is whether use existing tools — Ghidra・IDA・Binary Ninja — wasm 上 rather learn whole separate toolchain。2026 の answer は qualified yes。重要理解トレードオフ。Community plugins bring wasm support major RE platforms に:WebAssembly processor/loader modules Ghidra その他のため。load you .wasm・use familiar graph view・cross-references・decompiler workflow you already know。Analyst deeply fluent 1 つこれら環境での。familiar outweigh dedicated wasm tools advantages できた。

トレードオフは maturity・fit。Dedicated wasm toolchain — WABT・diswasm・Binaryen — build wasm actual structure around・tend produce cleaner・more idiomatic results wasm specifically のため。General RE platforms adapt model design native code へ stack machine へ。lossy・awkward になれるedges。Pragmatic approach many アナリスト settle on は use both:lightweight wasm CLI tools fast capability-first triage のため(dump imports・disassemble・grep strings・get quick pseudocode)。そして、sample warrant deep manual analysis ならば、load it platform choice へ heavier reversing work で all its navigation・annotation features。

これは also ここで RE fundamentals carry over。Reversing wasm は wholly separate discipline ではない — core skills reading disassembly・following control・data flow・identifying interesting functions callers・callees から・reasoning binary does を transfer directly。Change surface details:stack machine instead registers。structured control flow instead raw jumps。host imports instead syscalls。Experienced reverser pick up wasm quickly precisely because hard-won intuitions still apply。wasm-specific tooling just remove friction。Reassuring transferability anyone hesitant invest — extend existing skills。not start over。

ボトムライン

WebAssembly become modern web first-class binary format。これは reading it now security skill ではなく curiosity。Wasm is genuinely different native code — stack machine structured control flow。clean module sections。most usefully、explicit host imports reveal module の capabilities 読み code 前に。Open-source ツールチェーン match need:WABT disassemble・decompile へ。diswasm higher-level pseudocode へ。Binaryen simplify away obfuscation へ。wasm-tools validate・manipulate へ。Work capability-first — imports・exports before instructions。then disassemble with names。then decompile parts matter。simplifying needed。Do そして web の新しいバイナリは opaque blob から just another thing stop being becomes 読める。

参考リソース

ツール

背景・分析

関連 1337skills チートシート