#13353

[Feature] Push search_procedures and regex search_strings predicates into IDA and Hopper bridges instead of paging full inventories

Openmorlutoopened 3d ago

Before submitting

  • I searched the open and closed issues and pull requests for a related proposal.
  • I understand the contribution scope must be reviewed before integration; open questions are welcome here.
  • This request does not include credentials, private samples, or sensitive target data.

Area

Native analysis or decompilation

Current limitation

Source inspection on origin/main (d0929f9aa2) shows that several IDA and Hopper search/read operations still pull full inventories into Node instead of filtering or matching on the provider side (reasoning below is source-derived; no runtime IDA/Hopper benchmark was executed):

  1. IDA search_procedures pages the full function table (src/ida/IdaOperationRunner.ts:580-585, 155-169): unconditionally calls this.functions(), paging 100 items per list_funcs RPC and parsing every function through idaFunctionSchema.parse before filtering in Node.
  2. IDA regex search_strings and address-filtered list_strings do not push down predicates (src/ida/IdaOperationRunner.ts:587-601, 313-341): candidatePattern is only derived for query?.mode === "literal" (line 593). Regex search_strings and list_strings with address call find_regex with (?s).* / [\s\S]* (line 326) paging 100 rows per RPC over the entire string table before filtering in Node / RegexMatcher. (Similarly, assembly() and modern pseudocode() hardcode 100-item / 100-line RPC pages.)
  3. Hopper regex search transfers the full string/procedure inventory into Node (src/hopper/HopperRegexSearch.ts:122-158): calls list_strings or list_procedures across the bridge, maps rows.map((item) => item.value), and copies all values into a RegexMatcher worker.

Use cases

Large stripped or C++ binaries in IDA Pro or Hopper where string/procedure counts reach tens or hundreds of thousands and callers only query a targeted subset.

Desired outcome and success criteria

  • Push safe regex/substring candidate filters or point lookups (search_procedures, portable regex search_strings patterns, and list_strings by address) down to IDA MCP / hopper_bridge.py where upstream semantics guarantee zero false negatives, falling back to full inventory only when REA's Unicode/regex semantics require Node-side verification.
  • Evaluate larger safe RPC page sizes (or streaming/indexed lookups) while preserving existing pagination truncation and AnalysisProtocolError guarantees.

Expected interaction with targets

  • Read existing files or captured data

Verification available so far

  • Idea only; I need help defining checks

Verification details (optional)

Source-derived audit only at d0929f9aa2; live IDA Pro and Hopper MCP latency/RPC counts remain unmeasured here.

Alternatives considered

PR #13291 pushed search_strings literal candidates into IDA (idaLiteralSearchPattern); #13276, #13277, and #13301 track related IDA point-lookups, Hopper caller indexes, and RegexMatcher shared-memory IPC, but do not specifically address IdaOperationRunner search_procedures / regex search_strings / list_strings(address) fallback to (?s).* or Hopper regex inventory transfer in HopperRegexSearch.ts.

Possible direction

  • When query.mode === "regex" uses a safe portable subset (or extracts a literal pre-filter), pass a candidate pattern to IDA find_regex / Hopper bridge instead of (?s).*.
  • Add a Hopper bridge / IDA bridge procedure-name pre-filter or suffix-index option and larger explicit RPC page limits within transport budgets.

References

  • Related issues/PRs: #13276, #13277, #13292, #13301, merged PR #13291

Activity

0

No activity yet.