IDA Settings
ida-settings is a Python library (current version 3.3.0) designed for IDA Pro plugins to fetch configuration values from a shared, centralized settings infrastructure. It provides a standardized way for plugins to retrieve and manage user-defined settings within the IDA Pro environment. The library is specifically intended for use within IDA Pro and its plugin ecosystem and does not operate as a standalone utility.
Warnings
- gotcha The `ida-settings` library is designed exclusively for use within the IDA Pro plugin environment. It relies on internal IDA Pro mechanisms to identify the current plugin and access settings, meaning it will not function correctly if run as a standalone Python script outside of IDA Pro.
- gotcha Plugins should interact with settings strictly through the `ida-settings` API (e.g., `get_current_plugin_setting`, `set`, `del`). Direct manipulation of the `ida-config.json` file is discouraged and may lead to breakage in future versions, as cascading settings mechanisms similar to VS Code may be introduced.
- breaking While `ida-settings` is a Python library, its users should be aware that IDA Pro version 9.0 introduced significant breaking changes for plugin compatibility. C++ plugins required rebuilding, and IDAPython usage might require referencing porting guides due to SDK changes. Although not directly breaking `ida-settings`'s API, the broader plugin environment might need updates.
Install
-
pip install ida-settings
Imports
- ida_settings
import ida_settings
Quickstart
import ida_settings
# This code must run within an IDA Pro plugin environment.
# For demonstration purposes, we assume 'openai_key' is a setting
# defined in the current plugin's ida-plugin.json.
try:
# Fetch a setting value
api_key = ida_settings.get_current_plugin_setting("openai_key")
print(f"Retrieved API Key: {api_key}")
# Example of programmatic setting (use with caution, hcli/GUI preferred)
# ida_settings.set_current_plugin_setting("some_feature_enabled", True)
# Check if a setting exists
if ida_settings.has_current_plugin_setting("another_setting"):
print("Another setting exists.")
except KeyError as e:
print(f"Error: Setting not found - {e}. Ensure it's defined in ida-plugin.json.")
except Exception as e:
print(f"An unexpected error occurred: {e}")