SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 581 | Next

Shon Harris, Allen Harper, Chris Eagle, and Jonathan Ness

"Gray Hat Hacking, Second Edition"


NOTE Wanted_hotkey is just that, the hot key you want to use. IDA makes no
guarantee that your wanted_hotkey will be available, as more than one plug-in
may request the same hotkey sequence. In such cases, the first plug-in that IDA
loads will be granted its wanted_hotkey, while subsequent plug-ins that request
the same hotkey will only be able to be activated by using the Edit | Plugins menu.
#include
#include
#include
int idaapi my_init(void) { //idaapi marks this as stdcall
//Keep this plugin regardless of processor type
return PLUGIN_KEEP; //refer to loader.hpp for valid return values
}
void idaapi my_run(int arg) { //idaapi marks this as stdcall
//This is where we should do something interesting
static int count = 0;
//The msg function is equivalent to IDC's Message
msg("Plugin activated %d time(s)\n", ++count);
}
char comment[] = "This is a simple plugin. It doesn't do much.";
char help[] =
"A simple plugin\n\n"
"That demonstrates the basics of setting up a plugin.\n\n"
"It doesn't do a thing other than print a message.\n";
char name[] = "GrayHat plugin";
char hotkey[] = "Alt-1";
plugin_t PLUGIN = {
IDP_INTERFACE_VERSION, 0, my_init, NULL, my_run,
comment, help, name, hotkey
};
The IDA SDK includes source code, along with make files and Visual Studio workspace
files for several sample plug-ins.


Pages:
569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593