Код (Text): format PE GUI 4.0 DLL on 'STUB' entry DllEntryPoint include '%fasminc%\win32a.inc' macro .code { section '.code' code readable executable } macro .data { section '.data' data readable writeable } macro .CODE { .code } macro .DATA { .data } ;inline ea_t get_screen_ea(void) { ea_t ea; callui(ui_screenea, &ea); return ea; } ;typedef ulong ea_t; // effective address PLUGIN_KEEP = 2 ; Plugin agrees to work with the current database ; and wants to stay in the memory IDP_INTERFACE_VERSION = 70 ; для IDA 4.7 .CODE ;BOOL WINAPI DllEntryPoint(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) DllEntryPoint: mov eax, 1 retn (4*3) proc get_screen_ea .ea dd ? enter mov eax,[_callui] lea edx,[.ea] push edx push 10 call DWORD [eax] add esp,4*2 mov eax,[.ea] return endp ;--------------------------------------------------------------------- ----- ; ; Initialize. ; ; IDA will call this function only once. ; If this function returns PLUGIN_SKIP, IDA will never load it again. ; If this function returns PLUGIN_OK, IDA will unload the plugin but ; remember that the plugin agreed to work with the database. ; The plugin will be loaded again if the user invokes it by ; pressing the hotkey or selecting it from the menu. ; After the second load the plugin will stay on memory. ; If this function returns PLUGIN_KEEP, IDA will keep the plugin ; in the memory. In this case the initialization function can hook ; into the processor module and user interface notification points. ; See the hook_to_notification_point() function. ; ; In this example we check the input file format and make the decision. ; You may or may not check any other conditions to decide what you do: ; whether you agree to work with the database or not. ; ;int idaapi init(void) init: mov eax, PLUGIN_KEEP retn ;--------------------------------------------------------------------- ----- ; Terminate. ; Usually this callback is empty. ; The plugin should unhook from the notification lists if ; hook_to_notification_point() was used. ; ; IDA will call this function when the user asks to exit. ; This function won't be called in the case of emergency exits. ;void idaapi term(void) term: retn ;--------------------------------------------------------------------- ----- ; ; The plugin method ; ; This is the main function of plugin. ; ; It will be called when the user selects the plugin. ; ; arg - the input argument, it can be specified in ; plugins.cfg file. The default is zero. ; ; ;void idaapi run(int arg) run: call get_screen_ea invoke ua_code, eax retn 4 .DATA ;--------------------------------------------------------------------- ----- ;char comment[] = "This is a sample plugin. It does nothing useful"; comment db 'Sample plugin on fasm',0 ;char help[] = ; "A sample plugin module\n" ; "\n" ; "This module shows you how to create plugin modules.\n" ; "\n" ; "It does nothing useful - just prints a message that is was called\n" ; "and shows the current address.\n"; help db 0 ;--------------------------------------------------------------------- ----- ; This is the preferred name of the plugin module in the menu system ; The preferred name may be overriden in plugins.cfg file ;char wanted_name[] = "Sample plugin"; wanted_name db 'Plugin on fasm',0 ; This is the preferred hotkey for the plugin module ; The preferred hotkey may be overriden in plugins.cfg file ; Note: IDA won't tell you if the hotkey is not correct ; It will just disable the hotkey. ;char wanted_hotkey[] = "Alt-0"; wanted_hotkey db 'F11',0 ;--------------------------------------------------------------------- ----- ; ; PLUGIN DESCRIPTION BLOCK ; ;--------------------------------------------------------------------- ----- PLUGIN dd IDP_INTERFACE_VERSION, 0, init, term, run, comment, help, wanted_name, wanted_hotkey section '.idata' import data readable library ida,'IDA.WLL' import ida,\ _callui,168,\ ua_code,1022 section '.edata' export data readable export 'My_plugin.plw',\ PLUGIN,'PLUGIN' section '.reloc' fixups data discardable в аттаче inc файл со всеми функциями для IDA 4.7 904962683__import.inc
infern0 вручную, по мере необходимости в той или иной структуре, так же как с функцией get_screen_ea в этом примере с функциями конечно проще, perl - рулит