Good Morning,
Suppose we are monitoring the execution of "Test.exe" which loads "TestDll.dll" at runtime.
How to check if this Executable is already loaded this Dll?
and, how to get the "Module Handle" of this Dll?
Any help will be much appreciated.
How to check if an Executable loaded certain Dll at runtime?
Re: How to check if an Executable loaded certain Dll at runtime?
Via command line:
Include this call into your program.
Code: Select all
C:\>tasklist /m /fi "services eq Winmgmt"
Image Name PID Modules
========================= ======== ============================================
svchost.exe 872 ntdll.dll, kernel32.dll, KERNELBASE.dll,
msvcrt.dll, sechost.dll, RPCRT4.dll,
ole32.dll, GDI32.dll, USER32.dll, LPK.dll,
USP10.dll, IMM32.DLL, MSCTF.dll,...
Good morning, that's a nice tnetennba!
PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
Re: How to check if an Executable loaded certain Dll at runtime?
I mean thru PureBasic!jacdelad wrote: Sat Jan 06, 2024 12:51 am Via command line:Include this call into your program.Code: Select all
C:\>tasklist /m /fi "services eq Winmgmt" Image Name PID Modules ========================= ======== ============================================ svchost.exe 872 ntdll.dll, kernel32.dll, KERNELBASE.dll, msvcrt.dll, sechost.dll, RPCRT4.dll, ole32.dll, GDI32.dll, USER32.dll, LPK.dll, USP10.dll, IMM32.DLL, MSCTF.dll,...
Re: How to check if an Executable loaded certain Dll at runtime?
Code: Select all
If OpenLibrary(#Library , Filename$)
Debug "already loaded"
Debug LibraryID(#Library)
EndIf
Re: How to check if an Executable loaded certain Dll at runtime?
Dear AZJIO:AZJIO wrote: Sat Jan 06, 2024 11:07 amCode: Select all
If OpenLibrary(#Library , Filename$) Debug "already loaded" Debug LibraryID(#Library) EndIf
YOU ARE MY HERO!
Thank you very much..
Re: How to check if an Executable loaded certain Dll at runtime?
What?
This sounds absolutely like your program monitors a different program and wants to know whether this different program has loaded a certain dll...Maya wrote: Sat Jan 06, 2024 12:06 am Suppose we are monitoring the execution of "Test.exe" which loads "TestDll.dll" at runtime.
Good morning, that's a nice tnetennba!
PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
Re: How to check if an Executable loaded certain Dll at runtime?
So what?This sounds absolutely like your program monitors a different program and wants to know whether this different program has loaded a certain dll...
-
- Addict
- Posts: 2344
- Joined: Mon Jun 02, 2003 9:16 am
- Location: Germany
- Contact:
Re: How to check if an Executable loaded certain Dll at runtime?
OpenLibrary is inside the current process. Not in the monitored one as in the problem description. Also it is actively loading the DLL. It doesn't check whether the DLL has been loaded, it loads the DLL. If the process would never touch the DLL you wouldn't know because you loaded it.PoorMan wrote: Wed Jan 17, 2024 6:56 amSo what?This sounds absolutely like your program monitors a different program and wants to know whether this different program has loaded a certain dll...
bye,
Daniel
Daniel