IDA Settings

3.3.0 · active · verified Wed Apr 15

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

Install

Imports

Quickstart

This quickstart demonstrates how to import `ida_settings` and retrieve a configuration value for the current plugin using `get_current_plugin_setting`. It also shows how to check for the existence of a setting. This code snippet is designed to be executed within an IDA Pro plugin environment.

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}")

view raw JSON →