Skip to content

Instantly share code, notes, and snippets.

@auycro
Last active August 29, 2015 14:04
Show Gist options
  • Save auycro/a9b42445c94c79a12f5b to your computer and use it in GitHub Desktop.
Save auycro/a9b42445c94c79a12f5b to your computer and use it in GitHub Desktop.
DLL Check
//http://stackoverflow.com/questions/21180094/how-to-get-a-list-of-used-dlls
//http://msdn.microsoft.com/en-us/library/windows/desktop/ms683201(v=vs.85).aspx
//http://delphi.wikia.com/wiki/Dynamic_Link_Library_(DLL)
uses
SysUtils,
Windows,
TlHelp32;
{$R *.res}
{$APPTYPE CONSOLE}
var
Handle: THandle;
ModuleEntry: TModuleEntry32;
begin
Handle := CreateToolHelp32SnapShot(TH32CS_SNAPMODULE, 0);
Win32Check(Handle<>0);
try
ModuleEntry.dwSize := Sizeof(ModuleEntry);
Win32Check(Module32First(Handle, ModuleEntry));
repeat
Writeln(ModuleEntry.szModule);
until not Module32Next(Handle, ModuleEntry);
finally
CloseHandle(Handle);
end;
Readln;
end.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment