kgh0701 Posted May 3, 2015 Posted May 3, 2015 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.
kao Posted May 4, 2015 Posted May 4, 2015 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.. 1
kgh0701 Posted May 4, 2015 Author Posted May 4, 2015 thanks for your answer . i will try it . regards~
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now