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.wasmExecutable
WebAssemblyのバイナリ形式。\\0asmの4バイトに続いてバージョン番号が入ります。
00 61 73 6D 01 00 00 00 .asm....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 == SIGNATUREconst SIGNATURE = [0x00, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00];
const OFFSET = 0;
// bytes: a Uint8Array / Buffer holding the start of the file
export function isWasm(bytes) {
return SIGNATURE.every((byte, i) => bytes[OFFSET + i] === byte);
}package fileid
import "bytes"
var iswasmSignature = []byte{0x00, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00}
const iswasmOffset = 0
func IsWasm(b []byte) bool {
end := iswasmOffset + len(iswasmSignature)
if len(b) < end {
return false
}
return bytes.Equal(b[iswasmOffset:end], iswasmSignature)
}const SIGNATURE: &[u8] = &[0x00, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00];
const OFFSET: usize = 0;
fn is_wasm(bytes: &[u8]) -> bool {
bytes.get(OFFSET..OFFSET + SIGNATURE.len()) == Some(SIGNATURE)
}<?php
$signature = "\x00\x61\x73\x6d\x01\x00\x00\x00";
$offset = 0;
function is_wasm(string $bytes): bool {
global $signature, $offset;
return substr($bytes, $offset, strlen($signature)) === $signature;
}WebAssembly Binary は実行ファイル、バイナリモジュール、配布物、アップロード制限の識別に使われます。実行せずにヘッダや構造を検査してください。
実行形式は実行せず、検査目的のみでダウンロードしてください。解析は隔離環境で行い、拡張子チェック・MIMEチェック・実行権限を分離してください。
11 個のサンプルで、先頭バイト判定・パーサのエラー・アップロード上限・ダウンロード挙動をテストできます。
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.wasmBlue 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.wasmbbca15cf7ea4349eb53712512e56e6358efe1f0420f1c8ba0966e125811d4cd8Flower 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.wasm03691c2ac37a32e591e278c32754f090e1a14633fefccf8adfe1eb5fbbab71e4Navy 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.wasm007dbf2c46e952cc15c81254b6a9a69d1418f4d0e33e2032f37335c8307423e4Nature 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.wasm3ada2eabf427fc9fc21cf1713a821a1d1e4193d74b624b8b7321078f22918a9fSky 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.wasm2dbb097173a291c69ba274c3b7657578487c7ffdc7e9d46d3b74215b2a0876eeStarry 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.wasm0ed0619787a21029e139ff45f99b80f31374eab5dc8f1ffccaf9b2f187829e4eBlue 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.wasm2e6576e9a84e7ced5e8481ac7a3f065023aff2a67991a39364bbbf64f01273eaHibiscus 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.wasm7b55237415e60f07e1385274ba7ab0e43f39126351d1440626a8c00f3766477fArctic 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.wasmbce4c5240caa389f39154830232787b121e0500c9ffea6da63b55354a17e7f18NASA 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.wasm97fd8605fa0f628a25a17081d28123f0d20716d3fb568de0e7cadc854ece9887WebAssembly Binary ファイルはバイトシグネチャ 00 61 73 6D 01 00 00 00 (".asm....") で始まります。拡張子に頼らず、この先頭バイトを読み取って形式を判定してください。
WebAssembly Binary のMIMEタイプは application/wasm です。
WebAssembly Binary ファイルは .wasm 拡張子を使います。拡張子は慣習にすぎず中身を保証しないため、シグネチャや構造のチェックと組み合わせてください。