• lcc-win64 dll entrypoint / LoadLibrary problem

    From johnconrad400@gmail.com@21:1/5 to All on Mon Dec 2 15:12:06 2019
    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From jacobnavia@21:1/5 to All on Tue Dec 3 22:28:58 2019
    Le 03/12/2019 à 00:12, johnconrad400@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.

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


    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From johnconrad400@gmail.com@21:1/5 to All on Fri Mar 6 08:20:49 2020
    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(...

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)