Exetools  

Go Back   Exetools > General > Source Code

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 05-01-2020, 16:11
TQN TQN is offline
VIP
 
Join Date: Apr 2003
Location: Vietnam
Posts: 358
Rept. Given: 143
Rept. Rcvd 24 Times in 13 Posts
Thanks Given: 196
Thanks Rcvd at 168 Times in 51 Posts
TQN Reputation: 24
Yes, confict/bug in DllEntryPoint function of your Delphi code.
When a thread created, system will call DllEntryPoint function with param DLL_THREAD_ATTACHED
Reply With Quote
The Following User Says Thank You to TQN For This Useful Post:
phroyt (05-03-2020)
  #2  
Old 05-03-2020, 07:51
phroyt phroyt is offline
Friend
 
Join Date: May 2018
Posts: 77
Rept. Given: 0
Rept. Rcvd 8 Times in 4 Posts
Thanks Given: 35
Thanks Rcvd at 106 Times in 40 Posts
phroyt Reputation: 8
Talking

That's the point.

I always thought it worked like this.

But unknown code are sent

Code:
DLLInit: 0x00000001 => DLL_PROCESS_ATTACH
DLLInit: 0x6CBE2728
DLLInit: 0x6D992728
DLLInit: 0x064DBC38
The normal values are:
Code:
  DLL_PROCESS_ATTACH = 1;
  {$EXTERNALSYM DLL_PROCESS_ATTACH}
  DLL_THREAD_ATTACH = 2;
  {$EXTERNALSYM DLL_THREAD_ATTACH}
  DLL_THREAD_DETACH = 3;
  {$EXTERNALSYM DLL_THREAD_DETACH}
  DLL_PROCESS_DETACH = 0;
  {$EXTERNALSYM DLL_PROCESS_DETACH}
The first one (DLL_PROCESS_ATTACH) is called by myself on BEGIN section.

Code:
begin
  //DLLProc := TDLLProc(@DllInit);
  DllInit(DLL_PROCESS_ATTACH);
end.
I tested moving this code to Unit Initialization Section and works like a charm too.

Like you said, probably a DLLProc erratic behavior.

Thanks
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On


Similar Threads
Thread Thread Starter Forum Replies Last Post
OllyDbg is not good at supporting breakpoints in multi-threading environment BlackWhite General Discussion 6 08-10-2017 20:43
Keygenning With Delphi: Useful Delphi Functions and Tips chessgod101 General Discussion 5 01-05-2015 23:02
Delphi Encryption Compendium v3.0 Problem winndy General Discussion 1 02-18-2006 10:12
Modifying Kernel Mode Driver for Hyper Threading aldente General Discussion 8 08-13-2004 10:11


All times are GMT +8. The time now is 19:05.


Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX, chessgod101
( Since 1998 )