Posted December 20, 201113 yr Hey every one, I'm experiencing a coding problem with ollydbg. When i call an animation function from main plugin thread, it works. (of course it will work ). and here is a piece of correctly working code: void ODBG_Pluginaction(int Origin, int Action, void* pItem) { if(Origin == PM_DISASM) { switch(Action) { case 0:Go(Getcputhreadid(), 0, STEP_OVER, false, true); break; } }} but if i call the same function from a thread it doesn't work (and here's a non working code): DWORD WINAPI ThreadFunc(LPVOID dd) { Go(Getcputhreadid(), 0, STEP_OVER, false, true); return TRUE;}void ODBG_Pluginaction(int Origin, int Action, void* pItem) {DWORD id = 0; if(Origin == PM_DISASM) { switch(Action) { case 0:CreateThread(0, 0, ThreadFunc, 0, 0, &id); break; } }} I tried to suspend debugee threads before animating -> no luck; I tried to use WaitForSingleObject after creating an event that I unset immediatly after calling animation function and set it from main plugin thread -> no luck (the example is a bit complexe) Any help would be welcome, Thank you.
December 20, 201113 yr I don't know what 'Go(...)' actually does, but maybe it fires a 'SendMessage'somewhere, while it should use a 'PostMessage' from another (non-ui- !) threadjust to prevent deadlocks. Just a guess..
December 20, 201113 yr HiWhy want to use a Thread?Ollyscript or Olly Maschine use not a Treadadd in your codeAnimate(ANIMATE_IN);inline void CVM::DoAnimateInto(){ Animate(ANIMATE_IN); Go(Getcputhreadid(), 0, STEP_IN, 0, 1); ReturnToOD();}ANIMATE_IN was only an exampleANIMATE_OFF No animationANIMATE_IN Animate intoANIMATE_OVER Animate overANIMATE_RET Execute till RETANIMATE_SKPRET Execute till RET, then skip RET instructionANIMATE_USER Execute till user codeANIMATE_TRIN Run trace inANIMATE_TROVER Run trace overANIMATE_STOP Gracefully stop animationOllyMaschine source can you found herehttp://www.luocong.com/om/ Edited December 20, 201113 yr by ragdog
December 20, 201113 yr Author @ufo: YOU'RE RIGHTthanks for the clue, I'll digg a bit in this direction Edited December 20, 201113 yr by Zool@nder
Create an account or sign in to comment