Compilation
To compile your own plugin, you need some C or C++ compiler (together with linker and run-time libraries). Plugin interface (file plugin.h) is compatible at least with following compilers:
Plugin Development Kit includes source code for two fully functional sample plugins: bookmark, that allows to set up to 10 bookmarks in debugged application, and command line, that implements command line interface. Plugins are well documented. You can use them as a template for your own plugins. They are freeware, i.e. your rights to modify and re-use their source code are not limited in any way.
Following compiler settings are required for correct communication between plugin and OllyDbg. For compilers listed above, plugin.h forces or checks some of these rules:
Use static run-time libraries linked directly into your plugin, otherwise differences between versions of run-time DLLs will make OllyDbg unstable. Do not split your plugin unnecessarily into several DLLs. If you need data files that are not modifiable by user, try to place this data directly into your plugin as a resource.
To link your plugin to OllyDbg, you also need import library ollydbg.lib. Some compilers (Borland) include utility called implib that scans executable file (in our case, ollydbg.exe) and produces a special kind of library with a list of all exported functions. Some other products, like MSVC, can generate import library from the definition file (ollydbg.def). Similar products from other vendors are also available. For details, please consult documentation.
And, last but not least, don't waste resources! Don't export unused
callback functions and make your program fast! OllyDbg in current
version
supports up to 32 plugins. If each of them will take only 50 ms to
reject
a global shortcut, then 50 ms for window-specific shortcut... you DO
understand
what I mean, don't you?
Contents of plug110.zip
Plugin kit archive contains following files:
Root directory:
To build sample DLLs with BC 5.5, please do the following:
1. Copy files bookmark.c, cmdexec.c, command.c, plugin.h, bc55\bookmark.mak, bc55\cmdline.mak, bc55\ollydbg.lib to same directory;
2. Assuming that your BC 5.5 compiler is installed to c:\bc55, issue following commands:
BCB projects must contain main C++ program with the same name as project and extention .cpp. For this reason, bookmark plugin created with Builder is called sample.dll. Of course, this has no influence on its functionality.
To build sample.dll, please do the following:
1. Copy files bookmark.c, plugin.h, bc55\sample.bpr, bc55\sample.cpp and bc55\ollydbg.lib to the same directory;
2. Open sample.bpr in Builder and make project.
To build cmdline.dll, please do the following:
1. Copy files cmdexec.c, command.c, plugin.h, bc55\cmdline.bpr, bc55\cmdline.cpp and bc55\ollydbg.lib to the same directory;
2. Open cmdline.bpr in Builder and make project.
Making sample plugins with VC 5.0 from the command line
To build sample DLLs with VC 5.0, please do the following:
1. Copy files bookmark.c, cmdexec.c, command.c, plugin.h, vc50\bookmark.mak, vc50\cmdline.mak and vc50\ollydbg.lib to the same directory;
2. In .mak files, edit lines
3. Assuming that your VC compiler, cl.exe, and make utility, nmake.exe, reside in c:\vc\bin, execute following commands:
To build bookmark.dll:
1. Copy files bookmark.c, plugin.h, vc50\bookmark.dsp, vc50\bookmark.dsw and vc50\ollydbg.lib to the same directory;
2. Open project bookmark in Visual Studio and make it.
To build cmdline.dll:
1. Copy files cmdexec.c, command.c, plugin.h, vc50\cmdline.dsp, vc50\cmdline.dsw and vc50\ollydbg.lib to the same directory;
2. Open project cmdline in Visual Studio and make it.