IDA provides a limited ability to configure plug-ins via settings in <IDADIR>/plugins/plugins.cfg. Settings in plugins.cfg can be used to specify the following information about a plug-in:
An alternate menu description for the plug-in. This value overrides the plug-in’s wanted_name
data member.
A nonstandard location or file extension for the plug-in. By default IDA searches for plug-ins in <IDADIR>/plugins and expects plug-ins to have a default, platform-specific file extension.
An alternate or additional hotkey used to activate the plug-in. This value overrides the plug-in’s wanted_hotkey
data member.
An integer value to be passed to the plug-in’s PLUGIN.run
function each time the plug-in is activated.
An optional DEBUG
flag for use with debugger plug-ins. Debugger plug-ins are discussed in Chapter 24.
The syntax of a valid plug-in configuration line is described in plugins.cfg. A few examples of plug-in configuration lines are shown here:
; Semicolons introduce comments. A plugin configuration line consists ; of three required components and two optional components ; plugin_name plugin_file hotkey [integer run arg] [DEBUG] The_IdaBook_Plugin idabook_plugin Alt-F2 1 IdaBook_Plugin_Alt idabook_plugin Alt-F3 2
The wanted_name
and wanted_hotkey
data members for a plug-in are chosen by the plug-in’s author and compiled into the plug-in. It is entirely possible that two plug-ins developed by different authors may have identical names or identical hotkey associations. Within plugin.cfg, the plugin_name
field specifies the text (which overrides PLUGIN.wanted_name
) to be added to the Edit ▸ Plugins menu. It is possible to assign several names—and therefore several menu items—to a single plug-in. Underscore characters in the plugin_name
field are replaced with space characters before the name is added to the Edit ▸ Plugins menu.
The plugin_file
field specifies the name of the compiled plug-in module file to which the current configuration line applies. If a full path is specified, IDA loads the plug-in from the specified path. If no path is specified, IDA looks for the plug-in in <IDADIR>/plugins. If no file extension is specified, then IDA assumes a default plug-in extension for the current platform. If a file extension is specified, IDA searches for an exact match to the plug-in filename.
The hotkey
field specifies the hotkey that should be used to activate the plug-in. This field overrides the value of PLUGIN.wanted_hotkey
and can be used to resolve conflicting hotkey assignments when two plug-ins have been built that use the same hotkey for activation. Alternatively, assigning more than one hotkey to a plug-in offers the ability to activate a plug-in in more than one way. In such cases, it is useful to specify unique integer arguments for PLUGIN.run
depending on which hotkey was used to activate a plug-in. When you pass different integer values to PLUGIN.run
, IDA makes it possible for a plug-in to determine exactly how it was activated. This capability is useful when a plug-in implements more than one behavior and each behavior is selected based on how the plug-in is activated. In the preceding configuration example, IDA passes the integer value 2 to idabook_plugin
’s PLUGIN.run
function whenever the plug-in is activated via the alt-F3 hotkey sequence.
3.137.223.190