![]() |
Windows Version inkl. Win 11 ermitteln
Hallo kennt jemand eine function die sauber die Windows Version zurück gibt.
Danke für jeden Tipp im voraus. |
AW: Windows Version inkl. Win 11 ermitteln
|
AW: Windows Version inkl. Win 11 ermitteln
Hi,
Zitat:
Delphi-Quellcode:
As for build number is little more trickier and while it is backward compatible, there is no guarantee it will work in future, but you can access the build number by reading NtBuildNumber, whcih changed its index in the past.
type
TWinVersion = record Major: Cardinal; Minor: Cardinal; end; function GetWinVersion: TWinVersion; const // Address of USER_SHARED_DATA (KUSER_SHARED_DATA) is always at FS/GS:[0x7FFE0000] KUSER_SHARED_DATA = $7FFE0000; begin // NtMajorVersion is at offset $26C, NtMinorVersion at $270 // https://www.geoffchappell.com/studies/windows/km/ntoskrnl/inc/api/ntexapi_x/kuser_shared_data/index.htm Result.Major := PCardinal(KUSER_SHARED_DATA + $26C)^; Result.Minor := PCardinal(KUSER_SHARED_DATA + $270)^; end; Zitat:
|
AW: Windows Version inkl. Win 11 ermitteln
Nice :)
|
AW: Windows Version inkl. Win 11 ermitteln
Feste Speicheradresse?
Zum Glück ist ASLR in aktuellen Delphis nicht aktiv. Halt nee, ist es. :stupid: |
AW: Windows Version inkl. Win 11 ermitteln
Zitat:
![]() ![]() In case you afraid of ASLR, which doesn't have a connection to non executable loading address as it is read-only page for general information, then have a look at this ![]() meaning for User space the address and that page will stay the same, and for Driver/Kernel space where it is read+write it might be change address on boot when KASLR is enabled. |
AW: Windows Version inkl. Win 11 ermitteln
Es gibt eine fertige Unit auf
![]() |
AW: Windows Version inkl. Win 11 ermitteln
Hallo habe hier etwas gefunden - WMI
Delphi-Quellcode:
Ausgabe:
Uses System.Win.ComObj, WinApi.ActiveX;
function WMI_Get_Betriebssystem(const Mit_Version: Boolean = False): String; const wbemFlagForwardOnly = $00000020; var FSWbemLocator: OLEVariant; FWMIService: OLEVariant; FWbemObjectSet: OLEVariant; FWbemObject: OLEVariant; iEnum: IEnumvariant; iValue: Cardinal; begin Result := '?'; try FSWbemLocator := CreateOleObject('WbemScripting.SWbemLocator'); FWMIService := FSWbemLocator.ConnectServer('localhost', 'root\CIMV2', '', ''); FWbemObjectSet := FWMIService.ExecQuery('SELECT Name, Version FROM Win32_OperatingSystem', 'WQL', wbemFlagForwardOnly); iEnum := IUnknown(FWbemObjectSet._NewEnum) as IEnumvariant; if iEnum.Next(1, FWbemObject, iValue) = 0 then begin Result := String(FWbemObject.Name); if Pos('|', Result) > 0 then Result := Copy(Result, 1, Pos('|', Result) - 1); if Pos('Microsoft ', Result) > 0 then Try Result := Trim(Copy(Result, Pos('Microsoft ', Result) + 10, 40)); except end; if Mit_Version then Result := Result + ' [ ' + String(FWbemObject.Version) + ' ]'; FWbemObject := Unassigned; end; except try Result := WMI_Get_Betriebssystem; except Result := '?'; end; end; end; procedure TForm2.Button1Click(Sender: TObject); begin try CoInitialize(nil); try Memo1.Lines.Add(WMI_Get_Betriebssystem(False)); finally CoUninitialize; end; except on E:EOleException do Writeln(Format('EOleException %s %x', [E.Message,E.ErrorCode])); on E:Exception do Writeln(E.Classname, ':', E.Message); end; // Ausgabe: Windows 11 Pro try CoInitialize(nil); try Memo1.Lines.Add(WMI_Get_Betriebssystem(True)); finally CoUninitialize; end; except on E:EOleException do Writeln(Format('EOleException %s %x', [E.Message,E.ErrorCode])); on E:Exception do Writeln(E.Classname, ':', E.Message); end; // Ausgabe: Windows 11 Pro [ 10.0.26100 ] end; Windows 11 Pro Windows 11 Pro [ 10.0.26100 ] |
AW: Windows Version inkl. Win 11 ermitteln
Liste der Anhänge anzeigen (Anzahl: 1)
Diese Unit beinhaltet alles was man braucht. Hab ich mal irgendwo gefunden und nutze die schon ewig zum ermitteln von Systeminformationen.
Vielleicht ist das ja auch was für Euch... |
AW: Windows Version inkl. Win 11 ermitteln
Zitat:
![]() |
Alle Zeitangaben in WEZ +1. Es ist jetzt 05:03 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz