开发者

Run a thread within DLL initialization routine (Win32 assembler)

开发者 https://www.devze.com 2023-04-12 23:21 出处:网络
I need to create (and run!) a thread within (and not outside) the initialization procedure of a specific dll (LoadLibrary).

I need to create (and run!) a thread within (and not outside) the initialization procedure of a specific dll (LoadLibrary).

But...

"During process startup and DLL initialization routines, new threads can be created, but they do not begin execution until DLL initialization is done for the process." (http://msdn.microsoft.com/en-us/library/windows/desktop/ms682453%28v=vs.85%29.aspx). And this is exatly what happen.

My qustion is: there is a workaround for this?

I'm run my application in a debugger (OllyDbg). And I'm not using any compiler.


my code:

PUSH 214D8开发者_如何学C4DD // thread id address out
PUSH 0  
PUSH 0
PUSH 214D84CD // my function address to run in the thread
PUSH 0
PUSH 0
CALL DWORD PTR DS:[4EBD1204]  // KERNEL32.CreateThread

many thanks, Riccardo

0

精彩评论

暂无评论...
验证码 换一张
取 消