diff options
| author | blasty <blasty@local> | 2026-07-25 21:19:26 +0200 |
|---|---|---|
| committer | blasty <blasty@local> | 2026-07-25 21:19:26 +0200 |
| commit | b79d1028b0365b02e8d7d515087482e2ee249d6a (patch) | |
| tree | 6a1bcb869aba26260018e48d505735afcd17dbdd /idatui | |
| parent | highlight: bring pseudocode onto the measured palette (diff) | |
| download | ida-tui-b79d1028b0365b02e8d7d515087482e2ee249d6a.tar.gz ida-tui-b79d1028b0365b02e8d7d515087482e2ee249d6a.tar.xz ida-tui-b79d1028b0365b02e8d7d515087482e2ee249d6a.zip | |
palette: match case-insensitively in BOTH directions
Ctrl+N found nothing on libcrypto. Typing "PEM_read_bio" returned 0 of 10093
functions while the backend resolved the very same name to 0x1d6290.
_fuzzy lowercased the NAME but not the QUERY, then walked the query's characters
through the lowered name. One capital letter and the subsequence walk fails at
the first character, so the match is not merely worse — it is None, and the
palette shows nothing at all.
Invisible on the test binary because C symbols there are lowercase (main, strlen,
error) and every existing palette check typed a lowercase query. Fatal on any
library that capitalises: OpenSSL, most SDKs, Windows binaries. The paging index
was the obvious suspect and was innocent — all_loaded() had all 10093.
Verified on a live libcrypto pane: "PEM_read_bio" now returns 34 hits, exact
match ranked first.
tests: the palette scenario now types "MAIN" and expects "main". Confirmed it
fails without the fix (results=[]) and passes with it. 193/0.
Diffstat (limited to 'idatui')
| -rw-r--r-- | idatui/app.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/idatui/app.py b/idatui/app.py index 4bba7df..eacdbe8 100644 --- a/idatui/app.py +++ b/idatui/app.py @@ -2048,9 +2048,15 @@ def _fuzzy(name: str, q: str): if not name: # defensive: never assume a symbol has a name return None nl = name.lower() + # Case-insensitive means BOTH sides: the name was lowered but the query + # wasn't, so a single capital could never match and any query containing one + # returned nothing at all. Invisible on lowercase C symbols (main, strlen), + # fatal on libraries that capitalise — "PEM_read_bio" found 0 of 10093 + # functions in libcrypto while the backend resolved it fine. + ql = q.lower() pos: list[int] = [] i = 0 - for ch in q: + for ch in ql: j = nl.find(ch, i) if j < 0: return None @@ -2058,9 +2064,9 @@ def _fuzzy(name: str, q: str): i = j + 1 span = pos[-1] - pos[0] score = -(span * 2.0) - pos[0] - len(name) * 0.01 - if q in nl: + if ql in nl: score += 50.0 - if nl.startswith(q): + if nl.startswith(ql): score += 100.0 return (score, tuple(pos)) |
