DllMain not called in CreateRemoteThread

Marco Atzeri marco.atzeri@gmail.com
Sat Feb 8 05:40:00 GMT 2020


please bottom post on this mailing list

Am 08.02.2020 um 01:12 schrieb Olivia Nelson:
> Sorry, I made a mistake. I've updated the title ..
> 
> To summarize:
> 
> 1. I can load the DLL compiled with cygwin with LoadLibraryA,
>       but not remotely with CreateRemoteThread.
> 2. The same DLL compiled with msvc works with both LoadLibraryA and
> CreateRemoteThread
> 
> Answer to Joost:
> constructor and destructor are called with LoadLibraryA, but not with
> CreateRemoteThread either
> 
> Answer to Marco
> 1. I can't use mingw, it does not provide sys/XXX.h, e,g socket
> 2. I copied cygwin1.dll to system32, and it works outside cygwin environment
> 
> Here's a implementation of the DLL injector in C#:
> https://codingvision.net/miscellaneous/c-inject-a-dll-into-a-process-w-createremotethread
> 

Which of the sys/XXX.h are you looking for ?

$ cygcheck -l mingw64-x86_64-headers | grep "/sys/"
/usr/x86_64-w64-mingw32/sys-root/mingw/include/sec_api/sys/timeb_s.h
/usr/x86_64-w64-mingw32/sys-root/mingw/include/sys/cdefs.h
/usr/x86_64-w64-mingw32/sys-root/mingw/include/sys/fcntl.h
/usr/x86_64-w64-mingw32/sys-root/mingw/include/sys/file.h
/usr/x86_64-w64-mingw32/sys-root/mingw/include/sys/locking.h
/usr/x86_64-w64-mingw32/sys-root/mingw/include/sys/param.h
/usr/x86_64-w64-mingw32/sys-root/mingw/include/sys/stat.h
/usr/x86_64-w64-mingw32/sys-root/mingw/include/sys/time.h
/usr/x86_64-w64-mingw32/sys-root/mingw/include/sys/timeb.h
/usr/x86_64-w64-mingw32/sys-root/mingw/include/sys/types.h
/usr/x86_64-w64-mingw32/sys-root/mingw/include/sys/unistd.h
/usr/x86_64-w64-mingw32/sys-root/mingw/include/sys/utime.h

for what I know the Windows program use winsock2.h and winsock.h
for their own socket interface

$ cygcheck -l mingw64-x86_64-headers | grep "sock"
/usr/x86_64-w64-mingw32/sys-root/mingw/include/hvsocket.h
/usr/x86_64-w64-mingw32/sys-root/mingw/include/mswsock.h
/usr/x86_64-w64-mingw32/sys-root/mingw/include/psdk_inc/_socket_types.h
/usr/x86_64-w64-mingw32/sys-root/mingw/include/winsock.h
/usr/x86_64-w64-mingw32/sys-root/mingw/include/winsock2.h


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple



More information about the Cygwin mailing list