IDA plugins are compiled, more powerful IDC scripts that are capable of performing more complex tasks than just using scripts. Compared with writing IDC scripts, python appears to be lighter and more powerful. IDAPython, as an IDA plugin, has most of the features of the IDA SDK, and can help us write python scripts that realize all the features of the IDC scripting language.
This article will start with a simple example showing how to write and install an IDA plugin using python.
1、Write plug-in files
from idaapi import * class myIdaPlugin(plugin_t): flags=0 wanted_name="my ida plugin" wanted_hotkey="F1" comment="my ida plugin" help="Something helpful" def init(self): msg("Ida plugin init called.\n") return PLUGIN_OK def term(self): msg("Ida plugin term called.\n") def run(self,arg): warning("Ida plugin run(%d) called.\n"%arg) def PLUGIN_ENTRY(): return myIdaPlugin()
2, the file will be placed in the IDADIR/plugins directory, modify IDADIR/plugins/file, the value of the plug_name set to IDA menu bar display menu, plugin_file value is set to the full name of the file, remember to bring the extension, otherwise it is the system's default .plw or .p64, save and then restart IDA can be.
The above example of writing the first IDA plugin in python is all that I have shared with you.