diff options
| author | blasty <blasty@local> | 2026-07-09 11:45:45 +0200 |
|---|---|---|
| committer | blasty <blasty@local> | 2026-07-09 11:45:45 +0200 |
| commit | 5bfcfa8f01d6f0e0d7535639eaa341fcce9fd9b8 (patch) | |
| tree | 9794c017a5d1ba9f112ff1f37c40cff737836b0a /tests/smoke_client.py | |
| parent | stress paging on 10k-func binary; document scale constraints (diff) | |
| download | ida-tui-5bfcfa8f01d6f0e0d7535639eaa341fcce9fd9b8.tar.gz ida-tui-5bfcfa8f01d6f0e0d7535639eaa341fcce9fd9b8.tar.xz ida-tui-5bfcfa8f01d6f0e0d7535639eaa341fcce9fd9b8.zip | |
domain/paging layer: FunctionIndex, block-cached DisasmModel, decompile, resolve
- Program: model registry + small prefetch pool; cache invalidation hooks
- FunctionIndex: lazy pagination (advance by len, clamp page=500), filter globs,
viewport windows; full 10,092-func enumerate matches survey in ~3.1s
- DisasmModel: block-cached windowed disasm (256/block), forward+back prefetch,
cached instruction totals; deep window revisit 196ms -> 0ms (cache proven)
- Decompilation: truncation-aware, hard-failure surfaced as data (monster funcs)
- resolve(): int/hex/symbol via lookup_funcs (string-array query shape)
- tests/test_domain.py: 17/17 on both ls (~290 funcs) and libcrypto (10k+52k-insn)
- smoke_client no longer assumes 'main' exists (works on libraries)
- doc: idle_ttl worker self-exit finding ("not reachable" needs re-open)
Diffstat (limited to 'tests/smoke_client.py')
| -rw-r--r-- | tests/smoke_client.py | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/tests/smoke_client.py b/tests/smoke_client.py index 647b589..5466284 100644 --- a/tests/smoke_client.py +++ b/tests/smoke_client.py @@ -26,6 +26,13 @@ from idatui.client import ( # noqa: E402 PASS, FAIL = 0, 0 +def _query_data(payload): + res = payload.get("result", payload) if isinstance(payload, dict) else payload + if isinstance(res, list): + res = res[0] if res else {} + return res.get("data", []) if isinstance(res, dict) else [] + + def check(name, cond, detail=""): global PASS, FAIL if cond: @@ -82,8 +89,11 @@ def main(argv): check("health is dict", isinstance(h, dict), type(h).__name__) funcs = ida.call("list_funcs", queries=[{"count": 5}]) check("list_funcs shape", isinstance(funcs, (list, dict)), type(funcs).__name__) - dis = ida.call("disasm", addr="main", max_instructions=10) - lines = dis.get("asm", {}).get("lines") if isinstance(dis, dict) else None + # Pick a real function (don't assume 'main' exists — libraries have none). + some = ida.call("list_funcs", queries=[{"filter": "sub_*", "count": 1}]) + target = _query_data(some)[0]["addr"] + dis = ida.call("disasm", addr=target, max_instructions=10) + lines = (dis.get("asm") or {}).get("lines") if isinstance(dis, dict) else None check("disasm main has lines", bool(lines), str(dis)[:120]) check("disasm line carries addr", bool(lines and "addr" in lines[0]), str(lines[0]) if lines else "no lines") @@ -136,7 +146,7 @@ def main(argv): print("[concurrency]") def worker(i): - return ida.call("disasm", addr="main", max_instructions=5) + return ida.call("disasm", addr=target, max_instructions=5) with concurrent.futures.ThreadPoolExecutor(max_workers=8) as ex: results = list(ex.map(worker, range(40))) |
