aboutsummaryrefslogtreecommitdiffstats
path: root/server/patch_server.py
diff options
context:
space:
mode:
authorblasty <blasty@local>2026-07-23 01:34:48 +0200
committerblasty <blasty@local>2026-07-23 01:34:48 +0200
commit7a47d42230d49f052b5599bb0b8f25cf71174436 (patch)
treedef9082289291714ba64272fd47f9c0f0b6625dd /server/patch_server.py
parentapp: listing 'n' names the address (can name a bare/undefined byte) (diff)
downloadida-tui-7a47d42230d49f052b5599bb0b8f25cf71174436.tar.gz
ida-tui-7a47d42230d49f052b5599bb0b8f25cf71174436.tar.xz
ida-tui-7a47d42230d49f052b5599bb0b8f25cf71174436.zip
perf: derive segment map from file_regions, not survey_binary (hex open ~3400x)
The slow hex load wasn't the byte reads (read_raw fixed those) -- it was opening the pane at all: hex_model -> image_range -> sections called survey_binary, which computes function counts/strings/stats and takes ~24s on libcrypto, blocking the first hex open (and section_of/segment_bounds/ region_label in the listing). sections/file_regions/image_range now share one cheap _segments source backed by the injected file_regions tool (a plain segment walk, ~7ms), which gains a name field so it fully replaces survey_binary for the segment map. Falls back to survey_binary only if the tool is missing. Measured (libcrypto): segment map 24240ms -> 7.1ms (~3400x); hex open goes from ~24s to ~11ms. Correctness verified (names, section_of/segment_bounds/ file_offset); hex+listing scenarios 24/0, full suite 123/1 flaky. Needs a supervisor restart.
Diffstat (limited to 'server/patch_server.py')
-rw-r--r--server/patch_server.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/server/patch_server.py b/server/patch_server.py
index 4764367..4b2661f 100644
--- a/server/patch_server.py
+++ b/server/patch_server.py
@@ -175,7 +175,12 @@ def file_regions() -> dict:
fo = -1
if fo < 0 or fo >= (1 << 48):
fo = -1
- out.append({"start": hex(seg.start_ea), "end": hex(seg.end_ea), "file_off": fo})
+ try:
+ nm = ida_segment.get_segm_name(seg) or ""
+ except Exception:
+ nm = ""
+ out.append({"start": hex(seg.start_ea), "end": hex(seg.end_ea),
+ "file_off": fo, "name": nm})
seg = ida_segment.get_next_seg(seg.start_ea)
return {"regions": out}