flat assembler
Message board for the users of flat assembler.
Index
> Windows > problem with SetTimer api in dll |
Author |
|
l_inc 05 Jun 2014, 20:56
john_25
Quote: if nothing's wrong then why it doesn't sets the timer? Who said, it does not? It does. But I assume there's nobody, who's willing to process WM_TIMER for you. _________________ Faith is a superposition of knowledge and fallacy |
|||
05 Jun 2014, 20:56 |
|
john_25 05 Jun 2014, 21:08
so you mean i can't set another timer via dll injection inside another process?
|
|||
05 Jun 2014, 21:08 |
|
l_inc 05 Jun 2014, 21:17
john_25
I mean, you can, and the timer will post WM_TIMER messages to the thread's message queue. But this other process must be kind enough to take the messages from the message queue of the thread, that called LoadLibrary on your dll, and call the default handling procedure for these messages, so that the handling procedure calls your TimerProc. Otherwise the callback just won't be called. In some cases of dll injection (such as the one with CreateRemoteThread) the thread exits right after calling LoadLibrary. If this is your case, it doesn't make any sense to hope, that your callback will ever be called. _________________ Faith is a superposition of knowledge and fallacy |
|||
05 Jun 2014, 21:17 |
|
typedef 06 Jun 2014, 01:50
SetTimer requires a message loop to be active somewhere within the process.
|
|||
06 Jun 2014, 01:50 |
|
revolution 06 Jun 2014, 03:34
It might be easier to create a thread and use Sleep but there is a risk that the process might use ret instead of ExitProcess and leave you with a zombie process.
|
|||
06 Jun 2014, 03:34 |
|
l_inc 06 Jun 2014, 11:45
revolution
I would not take such little hackers products into account. Nearly every legitimate program terminates by calling ExitProcess. ret is a bad practice anyway just because some API calls may allow themselves to create additional threads (such as GetOpenFileName). But periodical checking for presence of other threads in a process is also trivial. _________________ Faith is a superposition of knowledge and fallacy |
|||
06 Jun 2014, 11:45 |
|
revolution 06 Jun 2014, 11:59
l_inc wrote: But periodical checking for presence of other threads in a process is also trivial. |
|||
06 Jun 2014, 11:59 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.