var NtQuerySystemInformation: function (infoClass: DWORD; buffer: Pointer; bufSize: DWORD; returnSize: TPDword): DWORD; stdcall = nil;
function GetDriverInfo: string; var temp, Index, numBytes, numEntries: DWORD; buf: TPDword; driverInfo: ^TDriverInfo; begin if @NtQuerySystemInformation = nil then NtQuerySystemInformation := GetProcAddress(GetModuleHandle('ntdll.dll'), 'NtQuerySystemInformation');
NtQuerySystemInformation(DRIVER_INFORMATION, buf, numBytes * 2, @numBytes); numEntries := buf^; driverInfo := Pointer(DWORD(buf) + 12); Result := ''; for Index := 1 to numEntries do begin Result := Result + #0$D#0$A+'Address: $' + IntToHex(DWORD(driverInfo^.Address), 8) + 'Name: "' + (driverInfo^.Name) + '"'; Inc(driverInfo); end; Delete(Result, 1, 2); FreeMem(buf); end;
procedure TForm1.Button1Click(Sender: TObject); begin ListBox1.Items.Add(GetDriverInfo) end;
// Thanks to Madshi for helping me translate from C++ Code // Original Code (C++) : // NtDriverList v1.0 // Copyright 1998, 1999 Yariv Kaplan // WWW.INTERNALS.COM