From idasql
Searches named IDA entities like functions, labels, structs, enums, members by pattern or prefix. Use to find symbols before pivoting to xrefs, decompiler, or types.
npx claudepluginhub allthingsida/idasql-skills --plugin idasqlThis skill is limited to using the following tools:
`grep` is IDASQL's entity-search surface. Use it to discover named functions, labels, segments, structs, enums, and members before pivoting into xrefs, decompiler, or type work.
Find and list functions in binaries by name, address, regex, or byte pattern. Use for binary analysis, locating specific functions, or enumerating matches.
Searches the Codescope knowledge graph for functions, methods, or symbols matching a name pattern. Displays results in a table grouped by file with counts. Use to locate code symbols by name.
Share bugs, ideas, or general feedback.
grep is IDASQL's entity-search surface. Use it to discover named functions, labels, segments, structs, enums, and members before pivoting into xrefs, decompiler, or type work.
Use this skill when user asks to:
sub_, EH, Zw, CreateFile, or maingrep table or grep() JSON outputRoute to:
xrefs after locating a candidate callee/import/function and needing callers/callees/referencesdecompiler after choosing a candidate function to inspect semanticallytypes when the hit is a struct/enum/member you need to inspect or edit-- 1) Start with a structured search while you learn the result shape
SELECT name, kind, address
FROM grep
WHERE pattern = 'main'
ORDER BY kind, name
LIMIT 20;
-- 2) Narrow immediately when the result set is noisy
SELECT name, ordinal, full_name
FROM grep
WHERE pattern = 'EH%' AND kind = 'struct'
ORDER BY name;
-- 3) Use JSON when you want a quick paged payload
SELECT grep('sub_%', 10, 0);
SELECT grep('sub_%', 10, 10);
Interpretation guidance:
grep table first when you want to filter, sort, join, or group.grep() when you want one JSON cell for quick paging or downstream parsing.Use grep table when you need:
WHERE kind = ...ORDER BY, GROUP BY, JOINUse grep() when you need:
json_each(...) parsing inside one statementgrep() accepts grep(pattern [, limit [, offset]]).
Defaults:
limit = 50offset = 0Both surfaces expose the same entity fields:
namekindaddressordinalparent_namefull_nameCommon kind values:
functionlabelsegmentstructunionenummemberenum_member% matches any substring._ matches a single character.* is accepted and normalized to %.grep and [] from grep().search_bytes().Examples:
-- Contains-match
SELECT name, kind
FROM grep
WHERE pattern = 'main'
LIMIT 20;
-- Prefix wildcard
SELECT name, kind, address
FROM grep
WHERE pattern = 'sub_%'
ORDER BY name
LIMIT 20;
-- Shell-style star is accepted too
SELECT name, kind
FROM grep
WHERE pattern = 'Zw*'
LIMIT 20;
SELECT name, address
FROM grep
WHERE pattern = 'main%' AND kind = 'function'
ORDER BY name;
SELECT module, name, address
FROM imports
WHERE name LIKE 'CreateFile%'
ORDER BY module, name;
SELECT name, kind, ordinal, full_name
FROM grep
WHERE pattern = 'EH%' AND kind IN ('struct', 'enum')
ORDER BY kind, name;
SELECT name, parent_name, ordinal
FROM grep
WHERE pattern = 'flag%' AND kind = 'member'
ORDER BY parent_name, name
LIMIT 30;
SELECT g.name, f.size, f.prototype
FROM grep g
JOIN funcs f ON f.address = g.address
WHERE g.pattern = 'sub_%' AND g.kind = 'function'
ORDER BY f.size DESC
LIMIT 20;
grep()SELECT
json_extract(value, '$.name') AS name,
json_extract(value, '$.kind') AS kind,
printf('0x%llX', json_extract(value, '$.address')) AS addr
FROM json_each(grep('init', 10, 0))
WHERE json_extract(value, '$.kind') = 'function';
SELECT caller_name, printf('0x%X', caller_addr) AS from_addr
FROM callers
WHERE func_addr = (
SELECT address
FROM imports
WHERE name = 'CreateFileW'
ORDER BY name
LIMIT 1
);
grep / grep() for named entities discovered by IDA.strings when you need literal string contents.search_bytes() when you need raw bytes or opcode patterns.xrefs after discovery when the real question is "who references this?"kind = ..., tighten the prefix, or switch from plain text to a more specific wildcard pattern.imports if the target may only exist as an imported API.grep is the wrong surface; pivot to strings, decompiler tables, or other domain tables.search_bytes() instead of grep.