Jump to content
Tuts 4 You

Problem To animate olly debugee from thread function


Zool@nder

Recommended Posts

Posted

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 smile.png). 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.

Posted

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- !) thread

just to prevent deadlocks. Just a guess..

Posted (edited)

Hi

Why want to use a Thread?

Ollyscript or Olly Maschine use not a Tread

add in your code

Animate(ANIMATE_IN);

inline void CVM::DoAnimateInto()
{
Animate(ANIMATE_IN);
Go(Getcputhreadid(), 0, STEP_IN, 0, 1);
ReturnToOD();
}

ANIMATE_IN was only an example

ANIMATE_OFF No animation

ANIMATE_IN Animate into

ANIMATE_OVER Animate over

ANIMATE_RET Execute till RET

ANIMATE_SKPRET Execute till RET, then skip RET instruction

ANIMATE_USER Execute till user code

ANIMATE_TRIN Run trace in

ANIMATE_TROVER Run trace over

ANIMATE_STOP Gracefully stop animation

OllyMaschine source can you found here

http://www.luocong.com/om/

Edited by ragdog
Posted (edited)

@ufo: YOU'RE RIGHT

thanks for the clue, I'll digg a bit in this direction

Edited by Zool@nder

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...