ollydbg 1.10 package comes along with two default plugins
1)bookmark plugin
2)commandline plugin
you can invoke commandline plugin in ollydbg with alt+f1 shortcut
this command line plugin has this callback implemented
// OllyDbg calls this optional function each time the execution is paused on
// breakpoint with attached list of commands, separately for each command.
// Function must return 1 if command is processed (in this case it will not
// be passed to other plugins) and 0 otherwise.
extc int _export cdecl ODBG_Plugincmd(int reason,t_reg *reg,char *cmd) {
char answer[TEXTLEN];
// Command-line plugin accepts only commands that start with point (.)
if (cmd==NULL || cmd[0]!=‘.’ || cmd[1]==‘\0’)
so if you pass .bp [[esp+4]+0xb8] in the dialog box which pops up on
shift+f4 (notice dot in front)
ollydbg will automatically set a bp on kernel32!BaseProcessStartThunk()
for example windbgs .apply_dbp (apply data breakpoint command ) does
something similar
on context Switch _ on createprocess
setting a bp like this in ollydbg is equivalent to this in windbg
syntax without the pc 3 at the end
0:000> bu ntdll!ZwContinue “bu @@C++(((ntdll!_CONTEXT *)@@masm(
(poi(@esp+4) )))->Eip) "bl;pc 3";g;”
0:000> bl
0 e 7c90d05e 0001 (0001) 0:**** ntdll!NtContinue “bu
@@C++(((ntdll!_CONTEXT *)@@masm( (poi(@esp+4) )))->Eip) "bl;pc
3";g;”
0:000> g
ModLoad: 76390000 763ad000 C:\WINDOWS\system32\IMM32.DLL
0 e 7c90d05e 0001 (0001) 0:**** ntdll!NtContinue “bu
@@C++(((ntdll!_CONTEXT *)@@masm( (poi(@esp+4) )))->Eip) "bl;pc
3";g;”
1 e 7c810705 0001 (0001) 0:**** kernel32!BaseProcessStartThunk “bl;pc 3”
kernel32!BaseProcessStart+0x7:
7c81705b e876b4feff call kernel32!_SEH_prolog (7c8024d6)
kernel32!BaseProcessStart+0x1a:
7c81706e ff15b013807c call dword ptr
[kernel32!_imp__NtSetInformationThread (7c8013b0)]
ds:0023:7c8013b0={ntdll!ZwSetInformationThread (7c90dcae)}
kernel32!BaseProcessStart+0x20:
7c817074 ff5508 call dword ptr [ebp+8]
ss:0023:0006fff8={windbg!wmainCRTStartup (01058c77)}
On 8/1/12, xxxxx@aol.com wrote:
> raj r writes:
>
> “use shift+f4 (conditonal log bp ) and pause this command to plugin
> when paused on…”
>
> Could you please explain what plugin you are talking about?
>
> —
> WINDBG is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>