diff options
| author | blasty <blasty@local> | 2026-08-07 12:56:27 +0200 |
|---|---|---|
| committer | blasty <blasty@local> | 2026-08-07 12:56:27 +0200 |
| commit | 6e58e9e4ea72771619ded48b0ac2390a58d31cfb (patch) | |
| tree | dbc59219e4c4681e84360ca3a53789fa59096106 /idatui/codemode_client.py | |
| parent | Rebase MISTER EXO's ida-codemode port onto the current tree (diff) | |
| download | ida-tui-6e58e9e4ea72771619ded48b0ac2390a58d31cfb.tar.gz ida-tui-6e58e9e4ea72771619ded48b0ac2390a58d31cfb.tar.xz ida-tui-6e58e9e4ea72771619ded48b0ac2390a58d31cfb.zip | |
codemode: fix DatabaseHandle.open kwarg, and check kwargs against the real signature
ida-codemode is now cloned at ../ida-codemode (0.3.1) and installed into
~/ida-venv, so the adapter can be checked against the library instead of
against assumptions.
First thing it found: connect() passed loading_address=, which
DatabaseHandle.open() does not have. The real parameter is image_base, and it
already wants the natural 16-byte-aligned address we compute, so this is a
rename. Every connect would have died with TypeError on the first call.
The port's own contract test could not catch it: its fake handle takes
**kwargs, so any keyword at all looks accepted. The test now also validates
the keywords we send against inspect.signature(DatabaseHandle.open) when the
library is importable, and skips that one check when it is not.
Offline suite: 302 passed with the library installed, 302 without it.
Diffstat (limited to 'idatui/codemode_client.py')
| -rw-r--r-- | idatui/codemode_client.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/idatui/codemode_client.py b/idatui/codemode_client.py index 77a0227..b43bfca 100644 --- a/idatui/codemode_client.py +++ b/idatui/codemode_client.py @@ -975,7 +975,10 @@ class CodeModeClient: timeout=max(0.1, timeout), output_database=self._output_database, processor=self._processor, - loading_address=self._loading_address, + # DatabaseHandle calls this image_base and wants the + # natural (16-byte aligned) address; it does the + # conversion to IDA's paragraph-based -b itself. + image_base=self._loading_address, file_type=self._file_type, new_database=self._new_database, ) |
