Posted May 3, 201510 yr I want to write a plugin that can set command line.The executable have some dynamic arguments ,so i decided to write a plugin.I browsed some apis from ollydbg plugin help, couldnot find .Or i missed something .Any hint , so appreciated .Thanks.
May 4, 201510 yr There's no official API for that.You could implement _ODBG_Pluginreset callback function and put the required command line into the appropriate buffer in Olly memory. Then OllyDbg will create process with the command line you wanted.Quick Delphi Code I used to test the idea (requires ImmPlugin.PAS and OllyDbg 1.10 Final):function PluginReset() : integer; cdecl;var target : pointer; source : pchar;begin target := pointer($4D5D88); // this is where the command line is stored in Olly memory source := pchar('Hello world!'); // this is the command line I want to have. CopyMemory(target, source, strlen(source)+1); // +1 to put trailing zero after the commandline result := 0;end;Of course, real plugin code should check the debugged process name, handle more than one Olly version, check for errors, etc, etc..
Create an account or sign in to comment