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

Executable

ELF Executable and Linkable Format

Linuxなどで使われる実行ファイル・オブジェクトファイル形式。7F 45 4C 46から始まります。

Extensions .elf, .so, .o
MIME application/x-elf

マジックナンバー

ファイルを解析
オフセット 0 ELF magic
7F 45 4C 46
.ELF

構造

  1. ELF header
  2. Program headers
  3. Sections
  4. Section headers

注意点

  • 配布するサンプルは実行不能な説明用ファイルや明確な無害サンプルに限定するのが安全です。

判定コード例

SIGNATURE = bytes.fromhex("7f454c46")
OFFSET = 0

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

実践的な使い方

ユースケース

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

よくある判定ミス

  • .elf / .so / .o という拡張子だけではファイルの中身を保証できません。アップロードや変換の処理では、拡張子・MIMEタイプ・先頭バイト・形式固有の構造チェックを組み合わせるべきです。
  • Executable and Linkable Format は 7F 45 4C 46 のようなシグネチャで始まりますが、関連するコンテナや破損ファイルでは追加の検証が必要になる場合があります。

セキュリティ上の注意

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

サンプルの活用

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

サンプルファイル

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

ELF Header Only

ELF Header Only is a Executable and Linkable Format sample generated for file format testing. It can be used to test downloads, parsers, previews, and file type detection.

header-only.elf
Type Sample
Small file
64 B
Generated CC0 1.0
SHA-256 f89a3ad9cfe884bc2c04d36974fa49f9cf69d546896fd6d05e1459b5ba923117
Download
Exe

Blue Sky ELF

Blue Sky ELF is a Executable and Linkable Format sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

01-blue-sky.elf
Type Sample
Small file
228 B
SHA-256 33d1bd8b7b68e5860a9808088017318e9d779d853b1c13f3a024656b78ae9984
Download
Exe

Flower Garden ELF

Flower Garden ELF is a Executable and Linkable Format sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

02-flower-garden.elf
Type Sample
Small file
316 B
SHA-256 61de85ea51f6a030cc93a76c23024271eaee7d64b7e94b5e8d99d8777bb4c330
Download
Exe

Navy Blue Sky ELF

Navy Blue Sky ELF is a Executable and Linkable Format sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

03-navy-blue-sky.elf
Type Sample
Small file
330 B
SHA-256 ce37bb7a1cf27ef7edec7b09300f34aa58f621d135f6d5c40fabee28ef9d3cbc
Download
Exe

Nature of the Sky ELF

Nature of the Sky ELF is a Executable and Linkable Format sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

04-nature-sky.elf
Type Sample
Small file
366 B
SHA-256 8cae3fc75763219223f29e59061f917da0759ec98ae7c8c58740104ff96b97b4
Download
Exe

Sky Landscape ELF

Sky Landscape ELF is a Executable and Linkable Format sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

05-sky-landscape.elf
Type Sample
Small file
464 B
SHA-256 5f7267b7c5d4dcf4bb4a0409822491122c352604626aea3fbfcf4cf38f42d4dd
Download
Exe

Starry Sky ELF

Starry Sky ELF is a Executable and Linkable Format sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

06-starry-sky.elf
Type Sample
Small file
370 B
SHA-256 2f29360810b11615c5c4463edf4557f6061a65c07f8c4b9945e36eb69e88ecc1
Download
Exe

Blue Night Sky ELF

Blue Night Sky ELF is a Executable and Linkable Format sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

07-blue-night-sky.elf
Type Sample
Small file
462 B
SHA-256 02d4e352fa8c3a23968d73cea83c821d6c90ae9dd91a4b0ecff467c887177ea9
Download
Exe

Hibiscus Flower ELF

Hibiscus Flower ELF is a Executable and Linkable Format sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

08-hibiscus-flower.elf
Type Sample
Small file
631 B
SHA-256 562b2bd2bdd21ddef9f73bd62d12f9b4beb3fc4819ed2d00a238e81b2a8703c3
Download
Exe

Arctic Sky ELF

Arctic Sky ELF is a Executable and Linkable Format sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

09-arctic-sky.elf
Type Sample
Small file
537 B
SHA-256 774efa9bc2275d012d0f52794ec3e33033db2e1131d6850b79e013c610fa470c
Download
Exe

NASA Blue Marble ELF

NASA Blue Marble ELF is a Executable and Linkable Format 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.elf
Type Sample
1.1 KB
SHA-256 fbf2a14ae155f8399a9dd2e031a346f0949d42adbb5e474dfbb5ae2c58d64f9b
Download

よくある質問

Executable and Linkable Format のマジックナンバー(ファイルシグネチャ)は?

Executable and Linkable Format ファイルはバイトシグネチャ 7F 45 4C 46 (".ELF") で始まります。拡張子に頼らず、この先頭バイトを読み取って形式を判定してください。

Executable and Linkable Format のMIMEタイプは?

Executable and Linkable Format のMIMEタイプは application/x-elf です。

Executable and Linkable Format の拡張子は?

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

関連フォーマット