Functionsのロゴ

Functions

組織
allthingsida
functions

Complete idasql SQL function reference catalog. Use when looking up function signatures, parameters, or usage examples.

概要

公開者allthingsida
リポジトリidasql-skills
スキル名functions
スター
50
フォーク
10
同梱ファイル
1
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 1個の同梱ファイル

    モデルが作業中に読み取れるスクリプト、テンプレート、参考資料です。ファイルは読み取り専用で、実行されることはありません。

  • オープンソース

    allthingsidaがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキルFunctionsをTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/allthingsida/idasql-skills/tree/main/plugins/idasql/skills/functions
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/allthingsida/idasql-skills.git /tmp/idasql-skills
mkdir -p .claude/skills
cp -r /tmp/idasql-skills/plugins/idasql/skills/functions .claude/skills/functions
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでFunctionsを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあると、モデルが自動的にFunctionsを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Functionsは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、未使用のスキルにはコストがかかりません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

This skill is a comprehensive catalog of every idasql SQL function. Use it to look up any function signature, parameters, and usage.


Disassembly

FunctionDescription
disasm_at(addr)Canonical listing line for containing head (works for code/data)
disasm_at(addr, n)Canonical listing line with +/- n neighboring heads
disasm(addr)Single disassembly line at address
disasm(addr, n)Next N instructions from address (count-based, not boundary-aware)
disasm_range(start, end)All disassembly lines in address range [start, end)
disasm_func(addr)Full disassembly of the function containing address: every chunk, entry first, with a ; ---------- tail chunk <start>-<end> (of <name>) ---------- line before each tail
make_code(addr)Create instruction at address (returns 1 if already code or created)
make_code_range(start, end)Create instructions in [start, end), returns number created
sql
SELECT disasm_at(0x401000);
SELECT disasm_at(0x401000, 2);
SELECT disasm_func(addr) FROM funcs WHERE name = '_main';
SELECT disasm_range(0x401000, 0x401100);
SELECT disasm(0x401000);
SELECT disasm(0x401000, 5);
SELECT make_code(0x401000);
SELECT make_code_range(0x401000, 0x401100);

Function creation is table-driven (not a SQL function):

sql
INSERT INTO funcs (addr) VALUES (0x401000);

Byte Access and Patching

Byte reads, bulk reads, and patching all go through the bytes table. load_file_bytes(...) writes a host file's bytes into the IDB at a given range; it returns 1 on success, 0 on failure.

FunctionDescription
load_file_bytes(path, file_offset, addr, size[, patchable])Write host file bytes into IDB memory at the target range
blob_concat(value)built-in aggregate — concatenate byte values into one BLOB
sql
-- Read 16 bytes as uppercase hex
SELECT hex(blob_concat(value))
FROM (SELECT value FROM bytes WHERE start_addr = 0x401000 AND n = 16 ORDER BY addr);

-- Read 64 bytes as a BLOB (its byte length; bind the raw BLOB itself, or wrap in
-- hex() for a text-safe transport)
SELECT length(blob_concat(value)) AS blob_len
FROM (SELECT value FROM bytes WHERE start_addr = 0x401000 AND n = 64 ORDER BY addr);

-- Patch 1 byte and 4 LE bytes
UPDATE bytes SET value = 0x90 WHERE addr = 0x401000;
UPDATE bytes SET dword = 0x90909090 WHERE addr = 0x401000;
SELECT value AS current, original_value AS original FROM bytes WHERE addr = 0x401000;
DELETE FROM bytes WHERE addr = 0x401000;                   -- revert

For composable row-shaped reads use the bytes table directly: SELECT addr, value FROM bytes WHERE addr >= :start AND addr < :end ORDER BY addr. Use heads for item size/type metadata.


Binary Search

Use the byte_search table for raw bytes/opcodes. It is table-shaped so results can be filtered, joined, grouped, and limited directly.

ColumnDescription
addrMatch address
matched_hexMatched bytes rendered as hex text
matched_bytesMatched bytes as a BLOB
sizeMatch size in bytes
patternHidden required input: IDA byte pattern
start_addrHidden optional inclusive lower bound
end_addrHidden optional exclusive upper bound
max_resultsHidden optional generator cap

Pattern syntax (IDA native):

  • "48 8B 05" - Exact bytes (hex, space-separated)
  • "48 ? 05" or "48 ?? 05" - ? = any byte wildcard (whole byte only)
  • "(01 02 03)" - Alternatives (match any of these bytes)
sql
SELECT addr, matched_hex, size
FROM byte_search
WHERE pattern = '48 8B ? 00'
LIMIT 10;

SELECT printf('0x%llX', addr) AS addr
FROM byte_search
WHERE pattern = 'CC CC CC'
ORDER BY byte_search.addr
LIMIT 1;

Optimization Pattern:

sql
-- Count unique functions containing RDTSC (opcode: 0F 31)
SELECT COUNT(DISTINCT fa.func_addr) as count
FROM byte_search b
JOIN func_at(b.addr) fa
WHERE b.pattern = '0F 31';

Names & Functions

Use table lookups for address and containing-function metadata. Resolve symbol names to integer EAs before using these patterns.

Functions are not always contiguous: a function can own tail chunks outside its entry chunk, and one tail can belong to several functions. funcs.end_addr ends the entry chunk only, so never check containment with an addr..end_addr range. func_at(addr) is a table-valued function returning func_addr, name, chunk_start, chunk_end, is_tail: one row per owning function, no rows outside any function. Column details: the disassembly skill.

PatternDescription
SELECT name FROM names WHERE addr = :addr LIMIT 1Name at address
SELECT name FROM func_at(:addr)Function(s) containing address (tail chunks included; one row per owner)
SELECT func_addr FROM func_at(:addr)Entry address of the containing function(s)
SELECT chunk_start, chunk_end, is_tail FROM func_at(:addr)The chunk containing the address
(SELECT name FROM func_at(x.from_addr) LIMIT 1)Containing function as a correlated scalar
(SELECT name FROM funcs WHERE addr = :func)Name of a function whose entry you already have (func_addr, from_func)
EXISTS (SELECT 1 FROM func_at(:addr) WHERE func_addr = f.addr)Does function f contain the address?
SELECT chunk_count, size FROM funcs WHERE addr = :funcChunk count and total size (all chunks)
SELECT * FROM function_chunks WHERE func_addr = :funcEvery chunk of a function
sql
SELECT name, is_tail FROM func_at(0x401000);
SELECT printf('0x%X', chunk_start) AS start_hex, printf('0x%X', chunk_end) AS end_hex, is_tail
FROM function_chunks WHERE func_addr = 0x401000 ORDER BY is_tail, chunk_start;

Function count and index lookup are table-driven:

sql
SELECT COUNT(*) AS function_count FROM funcs;
SELECT addr FROM funcs WHERE rowid = 0;

Cross-References

Cross-reference edge queries are table-driven:

sql
SELECT from_addr, to_addr, type, is_code, from_func
FROM xrefs
WHERE to_addr = 0x401000;

SELECT from_addr, to_addr, type, is_code, from_func
FROM xrefs
WHERE from_addr = 0x401000;

SELECT from_addr, to_addr, type, is_code, from_func
FROM xrefs
WHERE from_func = 0x401000;

Navigation

Use heads ordering for defined-item navigation and SQLite formatting functions for display strings. Address equality/range filters are optimized; ORDER BY addr or ORDER BY addr DESC is consumed for next/previous-item lookups.

sql
SELECT addr
FROM heads
WHERE addr > 0x401000
ORDER BY addr
LIMIT 1;

SELECT addr
FROM heads
WHERE addr < 0x401000
ORDER BY addr DESC
LIMIT 1;

SELECT printf('0x%llx', addr) AS address_hex
FROM heads
LIMIT 10;

Segment lookup is table-driven:

sql
SELECT name
FROM segments
WHERE 0x401000 >= start_addr
  AND 0x401000 < end_addr
LIMIT 1;

Comments

Read comments through the comments table:

sql
SELECT COALESCE(NULLIF(comment, ''), NULLIF(rpt_comment, '')) AS comment
FROM comments
WHERE addr = 0x401000
LIMIT 1;

Write comments through the table:

sql
INSERT INTO comments(addr, comment) VALUES (0x401000, 'regular comment');
INSERT INTO comments(addr, rpt_comment) VALUES (0x401000, 'repeatable comment');
-- Replace an existing comment in place
UPDATE comments SET comment = 'revised comment' WHERE addr = 0x401000;
-- Remove a comment
DELETE FROM comments WHERE addr = 0x401000;

Note: INSERT at an address that already has a comment replaces it (one comment per slot per EA). UPDATE is equivalent.


Modification

SurfaceDescription
applied_types(addr, decl, ordinal, type_name)Read/apply/replace/clear C declarations at addresses
parse_decls(text)Import C declarations (struct/union/enum/typedef) into local types

Preferred SQL write surface for function metadata:

  • UPDATE funcs SET name = '...', prototype = '...', folder_path = 'idasql/review/annotated' WHERE addr = ...
  • INSERT INTO names(addr, name) VALUES (..., '...') or UPDATE names SET name = '...' WHERE addr = ...
  • prototype maps to applied_types behavior and invalidates decompiler cache.
  • folder_path moves functions in IDA's Function window tree; create/rename/delete empty folders through dirtree_folders.
  • For per-call indirect-call typing, update disasm_calls.callee_type.

Python Execution

FunctionDescription
idapython_snippet(code[, sandbox])Execute Python snippet and return captured output text
idapython_file(path[, sandbox])Execute Python file and return captured output text

Runtime guard:

sql
UPDATE runtime_settings SET value='1' WHERE key='enable_idapython';
sql
SELECT idapython_snippet('print("hello from idapython")');
SELECT idapython_file('C:/temp/script.py');
SELECT idapython_snippet('counter = globals().get("counter", 0) + 1; print(counter)', 'alpha');

Context Awareness (Plugin UI)

FunctionDescription
get_ui_context_json()Return current UI/widget/context JSON for context-aware prompts (registered everywhere; live UI in the GUI plugin, a source:"cli" stub under idalib/CLI)
sql
SELECT get_ui_context_json();

Deep Links (IDA 9.4 builds)

FunctionDescription
ida_open_link(uri)Open an ida:// link in IDA: in the GUI plugin, in-process; elsewhere, in the running IDA 9.4 that has the database open. Returns 1 or an error with the reason. Gated by enable_deep_link_navigation (ON in the plugin, OFF in the CLI). Never launches IDA
sql
-- In the GUI plugin this navigates; under the idasql CLI it returns an error until
-- enable_deep_link_navigation is on and an IDA 9.4 has the database open.
SELECT ida_open_link(dl.uri) FROM deep_links dl
WHERE dl.resource = 'functions' AND dl.addr = 0x401130 AND dl.view = 'pseudocode';

Links themselves come from the deep_links table, not from a function: see the deep-links skill.


Item Analysis

Use heads for item classification, size, and raw flags:

sql
SELECT addr, size, type, flags, disasm
FROM heads
WHERE addr = 0x401000;

Instruction Details

Use instructions and instruction_operands for decoded instruction facts. instruction_operands exposes one row per non-void operand.

sql
SELECT addr, itype, mnemonic
FROM instructions
WHERE func_addr = 0x401000
LIMIT 10;

SELECT operand_index, text, type_code, type_name, value
FROM instruction_operands
WHERE addr = 0x401000
ORDER BY operand_index;

SELECT i.addr, i.itype, i.mnemonic, i.size, o.operand_index, o.text, o.type_name, o.value
FROM instructions i
LEFT JOIN instruction_operands o
  ON o.addr = i.addr AND o.addr = 0x401000
WHERE i.addr = 0x401000
ORDER BY o.operand_index;

Decompilation

Hex-Rays required. Every function in this section (decompile, microcode_error, call_arg_addrs, the set_union_selection* / get_union_selection* families, call_arg_item, ctree_item_at, and the set_numform* / get_numform* families) is only registered when the Hex-Rays decompiler is available. On a build/runtime without Hex-Rays they are absent and calling one returns no such function. Probe with SELECT decompile(<addr>) before relying on them.

FunctionDescription
decompile(addr)PREFERRED — Full pseudocode with line prefixes
decompile(addr, 1)Force re-decompilation (use after writes/renames)
microcode_error(func_addr[, maturity])Why Hex-Rays cannot lift a function (at a rung; default lvars), NULL when it lifts. Such a function has no microcode rows
call_arg_addrs(call_addr)JSON array of persisted argument-loader instruction EAs
set_union_selection(func_addr, addr, path)Set/clear union selection path at EA
set_union_selection_item(func_addr, item_id, path)Set/clear union selection path by ctree.item_id
set_union_selection_addr_arg(func_addr, addr, arg_idx, path[, callee])PREFERRED call-arg targeting helper
call_arg_item(func_addr, addr, arg_idx[, callee])Resolve call-arg coordinate to explicit arg_item_id
ctree_item_at(func_addr, addr[, op_name[, nth]])Resolve generic expression coordinate to ctree.item_id
set_union_selection_addr_expr(func_addr, addr, path[, op_name[, nth]])Set/clear union selection via expression coordinate
get_union_selection(func_addr, addr)Read union selection path JSON at EA
get_union_selection_item(func_addr, item_id)Read union selection path JSON by ctree.item_id
get_union_selection_addr_arg(func_addr, addr, arg_idx[, callee])Read union selection JSON via call-arg coordinate
get_union_selection_addr_expr(func_addr, addr[, op_name[, nth]])Read union selection JSON via expression coordinate
set_numform(func_addr, addr, opnum, spec)Set/clear numform by EA + operand index
get_numform(func_addr, addr, opnum)Read numform JSON by EA + operand index
set_numform_item(func_addr, item_id, opnum, spec)Set/clear numform by ctree item id
get_numform_item(func_addr, item_id, opnum)Read numform JSON by ctree item id
set_numform_addr_arg(func_addr, addr, arg_idx, opnum, spec[, callee])Set/clear numform via call-arg coordinate
get_numform_addr_arg(func_addr, addr, arg_idx, opnum[, callee])Read numform JSON via call-arg coordinate
set_numform_addr_expr(func_addr, addr, opnum, spec[, op_name[, nth]])Set/clear numform via expression coordinate
get_numform_addr_expr(func_addr, addr, opnum[, op_name[, nth]])Read numform JSON via expression coordinate

Decompiler local and label mutation is table-driven:

  • List locals with SELECT idx, name, type, comment, size, is_arg, is_result, stkoff, mreg FROM ctree_lvars WHERE func_addr = ... ORDER BY idx.
  • Rename or comment locals with UPDATE ctree_lvars SET name = ... or comment = ... using func_addr plus a selected idx.
  • Rename labels with UPDATE ctree_labels SET name = ... WHERE func_addr = ... AND label_num = ....

File Generation

FunctionDescription
gen_listing(path)Generate a full-database listing file (LST)
sql
SELECT gen_listing('C:/tmp/full.lst');

Graph Generation

FunctionDescription
gen_cfg_dot(addr)Generate CFG as DOT graph string
gen_cfg_dot_file(addr, path)Write CFG DOT to file
gen_schema_dot()Generate database schema as DOT
sql
SELECT gen_cfg_dot(0x401000);
SELECT gen_schema_dot();

Database Persistence

FunctionDescription
save_database()Persist the current IDA database file; returns 1 on success, 0 on failure
sql
-- Save once after a batch of SQL edits
SELECT save_database();

Use this in long-lived HTTP/MCP/plugin sessions when writes should persist. Prefer save_database() over an IDAPython save snippet; it exercises idasql's own persistence surface. save_database() can be costly on large databases, so batch edits and save at an intentional boundary.


Entity Search (grep)

Canonical workflow guidance lives in ../grep/SKILL.md.

SurfaceDescription
grep tableStructured rows for composable SQL search
sql
SELECT name, kind, addr FROM grep WHERE pattern = 'sub%' LIMIT 10;
SELECT name, kind, addr FROM grep WHERE pattern = 'init' LIMIT 50 OFFSET 0;

String List Functions

FunctionDescription
rebuild_strings()Rebuild with ASCII + UTF-16, minlen 5 (default)
rebuild_strings(minlen)Rebuild with custom minimum length
rebuild_strings(minlen, types)Rebuild with custom length and type mask

Type mask: 1=ASCII, 2=UTF-16, 4=UTF-32, 3=ASCII+UTF-16 (default), 7=all. Use COUNT(*) FROM strings for the current string-list count without materializing string rows.

sql
SELECT COUNT(*) AS strings FROM strings;
SELECT rebuild_strings();
SELECT rebuild_strings(4);
SELECT rebuild_strings(5, 7);

See Also

  • connect — front-door catalog and routing matrix; use when picking a skill, not a function.
  • The relevant per-topic skill for any function (data for bytes/strings, decompiler for decompile(), disassembly for disasm_*, types for parse_decls, debugger for patching helpers).

同梱ファイル

スキルが読み込まれている間、モデルは必要に応じてこれらを読み取ります。読み取り可能なファイルとして提供され、実行されることはありません。

よくある質問

AIスキル「Functions」では何ができますか?

Complete idasql SQL function reference catalog. Use when looking up function signatures, parameters, or usage examples.

TypingMindでFunctionsを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Functionsはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにFunctionsをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/allthingsida/idasql-skills/tree/main/plugins/idasql/skills/functionsを貼り付けてください。TypingMindがSKILL.mdを読み込み、関連ファイルをまとめて、チャットごとに有効にできるスキルとしてインストールします。

Functionsを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストが合致したときにこのスキルを読み込めます。

Functionsは何個のAIモデルで使えますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもFunctionsを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Functions」は無料ですか?

allthingsidaがGitHubで公開しています。ライセンス条件はリポジトリでご確認ください。支払いが必要なのは、利用したトークンに対する、ご自身が契約するAIプロバイダーへの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇