smithery.ai

new-identifier

新しいTEE識別器を追加します。雛形生成からテスト作成、analyzer登録まで自動化。

First seen Mar 21, 2026

Installation

$ npx skills add https://smithery.ai

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from smithery.ai · top by installs.

npx skills add https://smithery.ai

Browse all from smithery.ai

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Skill metadata

Parsed from SKILL.md frontmatter.

Allowed toolsRead, Edit, Write, Bash, Grep, Glob

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 4,352 B
  • docs SUMMARY.md 132 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 1 installs

SKILL.md

新規TEE識別器追加スキル

新しいTEE形式(TEEGRIS、iTrustee等)の識別器を追加する際に使用します。

実行手順

1. TEE情報を確認

ユーザーに以下を確認:

  • TEE名(例: TEEGRIS)
  • マジックバイト(わかれば)
  • ファイル拡張子
  • サンプルファイル(あれば)

2. シグネチャを追加

src/ta_inspector/identifier/signatures.py に追加:

# <TEE_NAME> signatures
<TEE_NAME>_MAGIC = b"XXXX"  # マジックバイト
<TEE_NAME>_EXTENSIONS = [".ext1", ".ext2"]

3. 識別器ファイルを作成

src/ta_inspector/identifier/<tee>.py を作成:

"""<TEE_NAME> Trusted Application identifier."""

from pathlib import Path
from typing import Optional

from .base import BaseIdentifier, TAInfo
from .signatures import <TEE_NAME>_MAGIC, <TEE_NAME>_EXTENSIONS


class <TEE_NAME>Identifier(BaseIdentifier):
    """Identifier for <TEE_NAME> Trusted Applications."""

    def supports(self, file_path: Path) -> bool:
        """Check if file might be a <TEE_NAME> TA."""
        return file_path.suffix.lower() in <TEE_NAME>_EXTENSIONS

    def identify(self, file_path: Path) -> Optional[TAInfo]:
        """Identify if file is a <TEE_NAME> TA."""
        try:
            with open(file_path, "rb") as f:
                magic = f.read(len(<TEE_NAME>_MAGIC))

                if magic != <TEE_NAME>_MAGIC:
                    return None

                # ヘッダー解析
                # TODO: TEE固有のヘッダー構造を解析

                return TAInfo(
                    tee_type="<TEE_NAME>",
                    file_path=file_path,
                    confidence=0.9,
                    uuid=None,
                    is_encrypted=False,
                    is_signed=False,
                    signature_algo=None,
                    header_info={"magic": magic.hex()},
                )
        except Exception:
            return None

4. analyzer.pyに登録

src/ta_inspector/identifier/analyzer.py の init に追加:

from .<tee> import <TEE_NAME>Identifier

class TAAnalyzer:
    def __init__(self):
        self.identifiers = [
            OPTEEIdentifier(),
            QSEEIdentifier(),
            KinibiIdentifier(),
            MTEEIdentifier(),
            <TEE_NAME>Identifier(),  # 追加
        ]

5. テストを作成

tests/testidentifier/test<tee>.py を作成:

import pytest
from pathlib import Path
from ta_inspector.identifier.<tee> import <TEE_NAME>Identifier


class Test<TEE_NAME>Identifier:
    @pytest.fixture
    def identifier(self):
        return <TEE_NAME>Identifier()

    def test_supports_valid_extension(self, identifier):
        assert identifier.supports(Path("test.ext1"))
        assert not identifier.supports(Path("test.txt"))

    def test_identify_valid_ta(self, identifier, tmp_path):
        ta_file = tmp_path / "test.ext1"
        ta_file.write_bytes(b"XXXX" + b"\x00" * 100)

        result = identifier.identify(ta_file)

        assert result is not None
        assert result.tee_type == "<TEE_NAME>"
        assert result.confidence >= 0.8

    def test_identify_invalid_magic(self, identifier, tmp_path):
        ta_file = tmp_path / "test.ext1"
        ta_file.write_bytes(b"ZZZZ" + b"\x00" * 100)

        result = identifier.identify(ta_file)
        assert result is None

6. 確認

# テスト実行
pytest tests/test_identifier/test_<tee>.py -v

# リント・型チェック
ruff check src/ta_inspector/identifier/<tee>.py
mypy src/ta_inspector/identifier/<tee>.py

参考実装

  • [optee.py](src/ta_inspector/identifier/optee.py) - OP-TEE(OTSH magic)
  • [kinibi.py](src/ta_inspector/identifier/kinibi.py) - Kinibi(MCLF magic)
  • [qsee.py](src/ta_inspector/identifier/qsee.py) - QSEE(ELF解析)

チェックリスト

  • signatures.pyにシグネチャ追加
  • 識別器クラスを作成
  • supports() を実装
  • identify() を実装(ヘッダー解析)
  • analyzer.pyに登録
  • テストを作成
  • ruff/mypyでチェック