search
Locate scalar immediates, text matches, or byte patterns in Ghidra programs with scope options for instructions, data, symbols, comments, and decompiled code.
Instructions
Search program content.
Scalar search finds instruction operand scalars/immediates and, if
requested, defined data scalar values. Pass one integer value or multiple
comma/space-separated values such as `0x27,0x67`.
Text search finds substring matches in instruction text, defined data text,
symbol names, comments, and decompiled functions depending on `where`.
`where="decompiled"` searches decompiler C output and returns matching
functions with line excerpts.
Byte search finds raw byte patterns in initialized memory. Queries accept
bytes separated by spaces or commas, or contiguous hex such as
`1d6c7ee1`. `context` controls how many bytes before and after each byte
match are included in the result. When
`include_nearby_function_pointers=true`, byte-search results also include
raw pointer-sized values in the returned context that resolve to function
entry points.
Args:
query: Search query. For scalar search, one or more integer values.
program: Required Ghidra project path or name to target.
kind: Search kind: `scalar`, `text`, or `bytes`.
where: Search scope. Scalar supports `instructions`, `data`, or `all`.
Text also supports `symbols`, `comments`, and `decompiled`. Byte
search currently scans initialized memory.
limit: Maximum matches to return. Use 0 or None for no limit.
case_sensitive: Use case-sensitive matching for text search.
context: Bytes of context before/after byte-search matches.
include_nearby_function_pointers: For byte search, report nearby raw
pointers that resolve to function entry points.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kind | No | scalar | |
| limit | No | ||
| query | Yes | ||
| where | No | instructions | |
| context | No | ||
| program | Yes | ||
| case_sensitive | No | ||
| include_nearby_function_pointers | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |