file in abyss
フォーマット一覧へ戻る

Executable

WASM WebAssembly Binary

WebAssemblyのバイナリ形式。\\0asmの4バイトに続いてバージョン番号が入ります。

Extensions .wasm
MIME application/wasm

マジックナンバー

ファイルを解析
オフセット 0 WASM magic and version 1
00 61 73 6D 01 00 00 00
.asm....

構造

  1. Magic
  2. Version
  3. Sections

注意点

  • WASMは実行可能コードなので、サンプルは意図と内容を明示するべきです。

判定コード例

SIGNATURE = bytes.fromhex("0061736d01000000")
OFFSET = 0

def is_wasm(path: str) -> bool:
    with open(path, "rb") as f:
        f.seek(OFFSET)
        head = f.read(len(SIGNATURE))
    return head == SIGNATURE

実践的な使い方

ユースケース

WebAssembly Binary は実行ファイル、バイナリモジュール、配布物、アップロード制限の識別に使われます。実行せずにヘッダや構造を検査してください。

よくある判定ミス

  • .wasm という拡張子だけではファイルの中身を保証できません。アップロードや変換の処理では、拡張子・MIMEタイプ・先頭バイト・形式固有の構造チェックを組み合わせるべきです。
  • WebAssembly Binary は 00 61 73 6D 01 00 00 00 のようなシグネチャで始まりますが、関連するコンテナや破損ファイルでは追加の検証が必要になる場合があります。

セキュリティ上の注意

実行形式は実行せず、検査目的のみでダウンロードしてください。解析は隔離環境で行い、拡張子チェック・MIMEチェック・実行権限を分離してください。

サンプルの活用

11 個のサンプルで、先頭バイト判定・パーサのエラー・アップロード上限・ダウンロード挙動をテストできます。

サンプルファイル

11 / 11 files
Sample Traits Size Source / license / SHA-256
Exe

Empty WASM Module

Empty WASM Module is a WebAssembly Binary sample generated for file format testing. It can be used to test downloads, parsers, previews, and file type detection.

empty.wasm
Type Sample
Small file
8 B
Generated CC0 1.0
SHA-256 93a44bbb96c751218e4c00d479e4c14358122a389acca16205b1e4d0dc5f9476
Download
Exe

Blue Sky WASM

Blue Sky WASM is a WebAssembly Binary sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

01-blue-sky.wasm
Type Sample
Small file
189 B
SHA-256 bbca15cf7ea4349eb53712512e56e6358efe1f0420f1c8ba0966e125811d4cd8
Download
Exe

Flower Garden WASM

Flower Garden WASM is a WebAssembly Binary sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

02-flower-garden.wasm
Type Sample
Small file
277 B
SHA-256 03691c2ac37a32e591e278c32754f090e1a14633fefccf8adfe1eb5fbbab71e4
Download
Exe

Navy Blue Sky WASM

Navy Blue Sky WASM is a WebAssembly Binary sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

03-navy-blue-sky.wasm
Type Sample
Small file
291 B
SHA-256 007dbf2c46e952cc15c81254b6a9a69d1418f4d0e33e2032f37335c8307423e4
Download
Exe

Nature of the Sky WASM

Nature of the Sky WASM is a WebAssembly Binary sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

04-nature-sky.wasm
Type Sample
Small file
327 B
SHA-256 3ada2eabf427fc9fc21cf1713a821a1d1e4193d74b624b8b7321078f22918a9f
Download
Exe

Sky Landscape WASM

Sky Landscape WASM is a WebAssembly Binary sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

05-sky-landscape.wasm
Type Sample
Small file
425 B
SHA-256 2dbb097173a291c69ba274c3b7657578487c7ffdc7e9d46d3b74215b2a0876ee
Download
Exe

Starry Sky WASM

Starry Sky WASM is a WebAssembly Binary sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

06-starry-sky.wasm
Type Sample
Small file
331 B
SHA-256 0ed0619787a21029e139ff45f99b80f31374eab5dc8f1ffccaf9b2f187829e4e
Download
Exe

Blue Night Sky WASM

Blue Night Sky WASM is a WebAssembly Binary sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

07-blue-night-sky.wasm
Type Sample
Small file
423 B
SHA-256 2e6576e9a84e7ced5e8481ac7a3f065023aff2a67991a39364bbbf64f01273ea
Download
Exe

Hibiscus Flower WASM

Hibiscus Flower WASM is a WebAssembly Binary sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

08-hibiscus-flower.wasm
Type Sample
Small file
592 B
SHA-256 7b55237415e60f07e1385274ba7ab0e43f39126351d1440626a8c00f3766477f
Download
Exe

Arctic Sky WASM

Arctic Sky WASM is a WebAssembly Binary sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

09-arctic-sky.wasm
Type Sample
Small file
498 B
SHA-256 bce4c5240caa389f39154830232787b121e0500c9ffea6da63b55354a17e7f18
Download
Exe

NASA Blue Marble WASM

NASA Blue Marble WASM is a WebAssembly Binary sample based on NASA Image and Video Library. It can be used to test downloads, parsers, previews, and file type detection.

nasa-blue-marble-2012-east.wasm
Type Sample
1.0 KB
SHA-256 97fd8605fa0f628a25a17081d28123f0d20716d3fb568de0e7cadc854ece9887
Download

よくある質問

WebAssembly Binary のマジックナンバー(ファイルシグネチャ)は?

WebAssembly Binary ファイルはバイトシグネチャ 00 61 73 6D 01 00 00 00 (".asm....") で始まります。拡張子に頼らず、この先頭バイトを読み取って形式を判定してください。

WebAssembly Binary のMIMEタイプは?

WebAssembly Binary のMIMEタイプは application/wasm です。

WebAssembly Binary の拡張子は?

WebAssembly Binary ファイルは .wasm 拡張子を使います。拡張子は慣習にすぎず中身を保証しないため、シグネチャや構造のチェックと組み合わせてください。

関連フォーマット