Pure Python IDA Pro theme toolkit with widget inspector, stylesheet editor, and VS Code theme converter
Project description
ida-themr ๐จ
A pure Python IDA Pro theme toolkit that helps make theming IDA Pro easier. Transform your reversing environment with ease! ๐
Overview ๐
ida-themr is a powerful toolkit designed to build maintainable IDA Pro color schemes.
Beyond theme conversion, ida-themr also simplifies CSS theme files by resolving variable references and functions, making themes easier to maintain and debug. There is a dearth of information regarding how to make themes etc and I am hoping to consolidate it here for others to benefit! ๐ ๏ธ
Screenshots
Here are some pictures demonstrating some of IDA theming toolkit's functionality:
Widget Inspector
Chrome DevTools like element inspector written completely in Python without any external dependencies:
QT Style Switcher
Allows you to save the Qt style based on your operating system (i.e. Fusion, windowsvista, windows):
Also a Dark Mode toggler that will go through and set os-dark-theme="true" on every property to toggle Dark Mode. Allows you to save the settings and toggle Dark Mode when IDA starts up.
Stylesheet Editor + QSS Processor
A very rudimentary way to fiddle with the generated stylesheet from IDA Pro and a way to edit the QSS stylesheet w/ some basic helper functions for maintainable themes:
Features
- Theme Conversion: Convert individual VS Code themes to IDA Pro effortlessly. ๐ญ
- Batch Processing: Convert all installed VS Code extension themes in one go. ๐ฆ
- Intelligent Color Mapping: Maps colors between VS Code and IDA Pro using theme keys and nearest-color matching with HSL adjustments. ๐
- Theme Semantics Preservation: Maintains the visual intent of the original theme during conversion. ๐ผ๏ธ
- Variable Resolution: Replaces
${variable}references with their defined values in CSS files. ๐ - Function Simplification: Converts complex functions like
@lighten()to base colors for clarity. ๐งน - Error Logging: Provides warnings for undefined variables or malformed function calls. โ ๏ธ
- Custom Output: Generates new theme files in a specified output directory for easy integration. ๐
- Well-Tested: Comprehensive unit tests ensure reliability and accuracy in color conversion and CSS processing. โ
Installation ๐ฅ
Via HCLI (Recommended for IDA Pro 9.0+)
The easiest way to install ida-themr is through IDA's built-in plugin manager:
# From IDA Pro's HCLI
ida-hcli plugin install ida-themr
Or download from GitHub releases and install manually:
ida-hcli plugin install path/to/ida-themr-X.X.X.zip
Via pip
# Install from PyPI
pip install ida-themr
# Or install from source
pip install -e .
Manual Installation
Get started with ida-themr manually in just a few steps! ๐
-
Clone the Repository:
git clone https://github.com/mahmoudimus/ida-themr.git cd ida-themr
-
Copy to IDA Pro plugins directory:
Copy the
src/directory contents to your IDA plugins directory:- Linux/macOS:
~/.idapro/plugins/ - Windows:
%APPDATA%\Hex-Rays\IDA Pro\plugins\
- Linux/macOS:
-
No Additional Dependencies Needed:
ida-themris a pure Python tool with no external dependencies beyond the standard library. You're ready to go! ๐
Usage ๐ฅ๏ธ
Two ways to us it:
Cli + IDA Plugin.
Copy the folders in src and put them in your idaapi.get_user_idadir() directory.
Cli
Included a simple algorithm to port vscode themes to IDA Pro based on a reference IDA Pro template by parsing VS Code theme files (JSONC format), mapping colors to an existing IDA Pro theme, and generating compatible CSS files for IDA Pro.
How It Works ๐ ๏ธ
- Extracting colors from both source (VS Code) and target (IDA Pro) themes.
- Building mappings to associate colors with theme elements.
- Using Euclidean distance in RGB space to find the closest color matches when direct matches aren't available.
- Applying a three-way adjustment in HSL space to fine-tune colors to maintain relative contrast and brightness. We compare the saturation and lightness of the source and destination colors, then adjust the remapped color's saturation and lightness by a fraction of the difference to maintain relative contrast and brightness.
- Replacing colors in a template CSS file for IDA Pro with the remapped colors.
- Generating the final theme files.
Supports
- Color Parsing: Supports CSS hex formats (
#RGB,#RGBA,#RRGGBB,#RRGGBBAA) and converts them to normalized RGB/RGBA values. ๐จ - Theme Mapping: Uses theme keys to match colors directly or falls back to nearest-color matching with Euclidean distance and HSL adjustments. ๐
- CSS Processing: Resolves variables and simplifies functions in CSS, ensuring clean and maintainable output. ๐งโ๐ป
- Output Generation: Creates new theme directories with remapped CSS files ready for IDA Pro. ๐ค
IDA supports some SASS directives
@def@lighten@darken@importtheme@ifdef/@ifndef-> optional@else->@endif
Convert a Single Theme ๐ฏ
To convert a specific VS Code theme to IDA Pro:
python3 src/ida_themr.py /path/to/vscode/theme.json /path/to/output/directory
Batch Convert All Installed Themes ๐
To convert all themes from your VS Code extensions directory:
python3 src/ida_themr.py "*" /path/to/output/directory
Note: If the VS Code extensions directory isn't automatically detected, set the --ext-root flag or the VSCODE_DATA environment variable to point to your VS Code data directory. ๐
python3 src/ida_themr.py "*" /path/to/output/directory --ext-root /path/to/vscode/extensions
Applying the Theme to IDA Pro ๐๏ธ
- Locate the generated theme folder in your output directory (named after the theme). ๐
- Copy the
theme.cssfile from the folder to your IDA Pro themes directory (usually found in IDA's installation directory underthemes/). ๐ - Restart IDA Pro, and select the new theme from the options menu under
View > Themes. ๐
Examples ๐ธ
Before Conversion ๐
Here's a sample CSS snippet with variables and functions from a VS Code theme:
@def color-primary #ff5733;
@def color-background @lighten(#ff5733, 20);
.button {
color: ${color-primary};
background-color: ${color-background};
}
After Conversion ๐จ
After processing with ida-themr, the CSS is simplified and colors are remapped for IDA Pro:
.button {
color: #ff5733;
background-color: #ff5733; /* simplified */
}
Testing ๐งช
ida-themr is thoroughly tested to ensure reliability. The test suite covers color conversion, JSONC parsing, HSL adjustments, variable expansion, and more. To run the tests:
python3 tests.py
You'll see detailed output confirming the functionality of each component. โ
Contributing ๐ค
We welcome contributions to ida-themr! Whether it's bug fixes, new features, or documentation improvements, your help is appreciated. Here's how to contribute:
- Fork the Repository and clone it locally. ๐ด
- Make Your Changes in a new branch. ๐ฟ
- Run Tests to ensure everything works (
python3 tests.py). ๐งช - Submit a Pull Request with a clear description of your changes. ๐ฌ
Please follow the coding style and include tests for new functionality. Let's make ida-themr even better together! ๐ช
License ๐
This project is licensed under the MIT License - see the LICENSE file for details. ๐
Contact ๐ง
Have questions, suggestions, or need support? Open an issue on GitHub or reach out to mahmoudimus. I'm happy to help! ๐
Acknowledgments ๐
@SmugNugg for the idea about resolving inlined css functions. @can1357 for his IdaThemer from which this is shamelessly ported and enhanced.
Happy theming with ida-themr! Let's make IDA Pro as colorful as your imagination! ๐จ๐
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ida_themr-0.1.0.tar.gz.
File metadata
- Download URL: ida_themr-0.1.0.tar.gz
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7653c09e3b16e9a303b5298898339050873ce79441eb8e76f75a3351786193a8
|
|
| MD5 |
c2a18fe4805ac75732d0cb14e7da7da2
|
|
| BLAKE2b-256 |
958f3b6be78e7eb011ef87cb149fb7bfa737e94d10c832126b231de6d898488e
|
Provenance
The following attestation bundles were made for ida_themr-0.1.0.tar.gz:
Publisher:
release.yml on mahmoudimus/ida-themr
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ida_themr-0.1.0.tar.gz -
Subject digest:
7653c09e3b16e9a303b5298898339050873ce79441eb8e76f75a3351786193a8 - Sigstore transparency entry: 721341535
- Sigstore integration time:
-
Permalink:
mahmoudimus/ida-themr@0e26f0022a2bc414223e658e389127aa8e901974 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/mahmoudimus
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@0e26f0022a2bc414223e658e389127aa8e901974 -
Trigger Event:
push
-
Statement type:
File details
Details for the file ida_themr-0.1.0-py3-none-any.whl.
File metadata
- Download URL: ida_themr-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d95752058ddd06a3769c4a310b59390286f3f05a04426d6d230c8291dab4dc72
|
|
| MD5 |
1485ca52269ac4f6ce281c62e946c1a1
|
|
| BLAKE2b-256 |
e6ba719d678e79aa1a1bd6f25cac38f97b25f438c71fc981ad33b319d668302f
|
Provenance
The following attestation bundles were made for ida_themr-0.1.0-py3-none-any.whl:
Publisher:
release.yml on mahmoudimus/ida-themr
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ida_themr-0.1.0-py3-none-any.whl -
Subject digest:
d95752058ddd06a3769c4a310b59390286f3f05a04426d6d230c8291dab4dc72 - Sigstore transparency entry: 721341540
- Sigstore integration time:
-
Permalink:
mahmoudimus/ida-themr@0e26f0022a2bc414223e658e389127aa8e901974 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/mahmoudimus
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@0e26f0022a2bc414223e658e389127aa8e901974 -
Trigger Event:
push
-
Statement type: