IDA Colors
Parser for color tags in IDA.
Usage
$ uv run ida-colors <path-to-idb>
...
"LDR X8, [X19,#0x10]"
Insn("LDR")
Opnd1(Reg("X8"))
Opnd2(Symbol("["), Reg("X19"), Symbol(",#"), Number("0x10"), Symbol("]"))
...
The CLI needs IDA 9+ and the ida extra (idapro). The parser itself has no dependencies.
Development
$ uv run ruff check && uv run ruff format --check
$ uv run ty check
$ uv run pytest
tests/test_ida_constants.py checks the constants copied from IDA against a local IDA install, and is
skipped when idapro can't load one.
Why?
IDA's disassembly isn't just the decoded instruction. Between decode_insn and the line you see, the processor module's
printer applies a lot of heuristics and user annotations: offsets, stack variables, struct offsets, enums, chars,
@PAGE/@PAGEOFF pairs, hidden implicit operands. The printed line is the only place where all of that comes together,
and IDA marks it up with color tags. Parsing the tags gets you what IDA decided, without reimplementing its printer for
every processor.
The textbook alternative, decode_insn and op_t.type (o_imm, o_mem, o_displ, ...), tells you what the bytes
encode, not what they mean:
| Instruction | decode_insn says |
IDA prints |
|---|---|---|
PowerPC addis r30, r30, (off_11FA38 - loc_1923C)@ha |
o_imm, value 0x10 |
the high half of an address difference |
RISC-V auipc t2, %pcrel_hi(off_C8380) |
o_imm, value 0xbc |
a PC-relative reference to off_C8380 |
ARM64 ADRP X16, #qword_11FFF8@PAGE |
o_imm, value 0x11f000 |
a reference to qword_11FFF8 |
SPARC add %fp, arg_727, %l1 |
o_imm, value 0x727 |
the stack argument arg_727 |
x86-64 mov [rbp+var_30], rax |
o_displ, value 0xffffffffffffffd0 |
the stack variable var_30 |
x86-64 lea rdi, ds:1[rdx*2] |
o_mem, address 0x1 |
a plain number |
RISC-V nop |
one operand, o_imm |
no operands |
PowerPC mflr r0 |
two operands, the second o_idpspec0 |
one operand |
x86-64 mul rcx |
two operands, implicit rax first |
one operand, tagged as operand 2 |
Metadata
Release files for ida-colors 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ida_colors-0.0.2.tar.gz | 7.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ida_colors-0.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 16.3 kB
Release files / ida_colors-0.0.2.tar.gz
| Download URL | ida_colors-0.0.2.tar.gz |
|---|---|
| Size | 7.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
32bab2cb1b02d13127c7f0292dfbb7c8e9ca8da5bafadc1713eb03222e27a8a4
|
|
BLAKE2b-256 checksum How to use checksums |
f6a44ff1eabbf145cb934be57db89772101b9a81f53742a7965ee0275307d631
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.18 {"installer":{"name":"uv","version":"0.12.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / ida_colors-0.0.2-py3-none-any.whl
| Download URL | ida_colors-0.0.2-py3-none-any.whl |
|---|---|
| Size | 9.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c2a4863baa60f53a515dbb0c17cd71cfcd3ba85b2e406fdfbcb9f1f26f985945
|
|
BLAKE2b-256 checksum How to use checksums |
23e51955b17be2fa8949206e0a8d167f8cda809103af19335e535e2f605d4eca
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.18 {"installer":{"name":"uv","version":"0.12.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|