Skip to content

Implement caching for IDA module imports - #41

Open
brinlyau wants to merge 1 commit into
MeroZemory:mainfrom
brinlyau:patch-1
Open

Implement caching for IDA module imports#41
brinlyau wants to merge 1 commit into
MeroZemory:mainfrom
brinlyau:patch-1

Conversation

@brinlyau

Copy link
Copy Markdown

py_eval rebuilds its execution globals for every call, repeatedly probing optional IDA modules that may not exist in the active IDA version. Each failed probe emitted the same warning to stderr, producing noisy responses and unnecessary token usage.

Cache successful imports and expected ImportError results at module scope. Missing optional modules remain bound to None, preserving existing behaviour, but subsequent evaluations no longer retry or report the same failure.

Tested on IDA 8.5 on Mac (sorry I don't have newer IDA than that) - feel free to amend this commit if you have a better way of doing this :)

py_eval rebuilds its execution globals for every call, repeatedly probing optional IDA modules that may not exist in the active IDA version. Each failed probe emitted the same warning to stderr, producing noisy responses and unnecessary token usage.

Cache successful imports and expected ImportError results at module scope. Missing optional modules remain bound to None, preserving existing behaviour, but subsequent evaluations no longer retry or report the same failure.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant