Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

lcc-win64 dll entrypoint / LoadLibrary problem

89 views
Skip to first unread message

johnco...@gmail.com

unread,
Dec 2, 2019, 6:12:07 PM12/2/19
to
In compiled 64 bit dll, there is no any code on entry point which jumps / calls to DllMain.

I tried also LibMain, and forcing with -entry key. No result.

Btw, it seems -entry key does nothing. With any func name EP in 64 bit dll remains 0x1000. And no changes in code on EP.

In 32 bit dlls all ok. Code on entry point finally jumps to LibMain.

jacobnavia

unread,
Dec 3, 2019, 4:29:02 PM12/3/19
to
Le 03/12/2019 à 00:12, johnco...@gmail.com a écrit :
> In compiled 64 bit dll, there is no any code on entry point which jumps / calls to DllMain.
>

This is normal since when you load the library, the loader calls libMain

> I tried also LibMain, and forcing with -entry key. No result.
>
> Btw, it seems -entry key does nothing. With any func name EP in 64 bit dll remains 0x1000. And no changes in code on EP.
>

-entry sets a field in the library header that tells the loader which
function it should call.

johnco...@gmail.com

unread,
Mar 6, 2020, 11:20:50 AM3/6/20
to
> > In compiled 64 bit dll, there is no any code on entry point which jumps / calls to DllMain.
> >
>
> This is normal since when you load the library, the loader calls libMain
>

The problem that it didn't. LoadLibrary from 64-bit lcc-compiled exe didn't call libMain from 64 bit lcc-compiled dll. Dll is loaded and in memory, but no call. With 32 bit all ok. It seems there is some problem in loader code. When i changed Entry Point to func export address with hex editor, LoadLibrary started to work OK.

lcclnk64 -nounderscores -s -dll -subsystem windows -entry LibMain

declared as

BOOL __declspec(dllexport) LibMain(...
0 new messages