![]() |
Ist Anwendung 32 oder 64 Bit
Ich bin ja seit einer Woche stolzer Besitzer eines vier kern 645-Bit Rechners und Windows 7 64-Bit. Jetzt hatte ich mir ein Programm runtergeladen ohne Installer und wollte es in den richtigen Ordner kopieren: "Program Files" oder "Program Files(x86)". Nur hatte ich das Problem, dass ich nicht wusste, ob es eine 32 oder 64 Bit Anwendung ist. OK, es stand nicht dabei, dass es eine 645 Bit Anwendung ist, also könnte man davon ausgehen, dass es sich um eine 32 Bit Anwendung handelt.
Aber ich wüsste gerne mit welcher API Funktion man herausfinden kann, ob eine fremde Anwendung 32 oder 64 Bit ist. Ich wollte mir da dann nämlich ein kleines Programm zu schreiben, mit dem ich herausfinden kann, ob ein anderes Programm eben 32 oder 64 Bit ist. |
AW: Ist Anwendung 32 oder 64 Bit
![]() Siehe auch: ![]() und ![]() //edit: In Deinem Beitrag verstecken sich ein paar 5en zuviel ;-) |
AW: Ist Anwendung 32 oder 64 Bit
Danke.
Unsinn. Ich bin nur schon auf die Zukunft vorbereitet mit dem Rechner. ;) |
AW: Ist Anwendung 32 oder 64 Bit
Oder einfach mal starten, in den Taskmanager schauen
und danach in den Programmeordner verschieben. |
AW: Ist Anwendung 32 oder 64 Bit
@Himitsu: Hey, ich bin Programmierer. ;)
|
AW: Ist Anwendung 32 oder 64 Bit
Vlt. etwas füe die Code-Library
Delphi-Quellcode:
function IsExecutable32Bit(const lpExeFilename: String): Boolean;
const kb32 = 1024 * 32; var Buffer : Array[0..kb32-1] of Byte; // warning: assuming both headers are in there! hFile : DWord; bRead : DWord; bToRead : DWord; pDos : PImageDosHeader; pNt : PImageNtHeaders; begin Result := False; hFile := CreateFile(pChar(lpExeFilename), GENERIC_READ, FILE_SHARE_READ, NIL, OPEN_EXISTING, 0, 0); if hFile <> INVALID_HANDLE_VALUE then try bToRead := GetFileSize(hFile, NIL); if bToRead > kb32 then bToRead := kb32; if not ReadFile(hFile, Buffer, bToRead, bRead, NIL) then Exit; if bRead = bToRead then begin pDos := @Buffer[0]; if pDos.e_magic = IMAGE_DOS_SIGNATURE then begin pNt := PImageNtHeaders(LongInt(pDos) + pDos._lfanew); if pNt.Signature = IMAGE_NT_SIGNATURE then Result := pNt.FileHeader.Machine and IMAGE_FILE_32BIT_MACHINE > 0; end; { else raise Exception.Create('File is not a valid executable.'); } end; { else raise Exception.Create('File is not an executable.'); } finally CloseHandle(hFile); end; end; function IsExecutable64Bit(const lpExeFilename: String): Boolean; // since as of now (march 2012), there only exist 32 and 64 bit executables, // if its not the one, its assumably the other begin Result := not IsExecutable32Bit(lpExeFilename); end; |
AW: Ist Anwendung 32 oder 64 Bit
Hmpf, wenn man es nicht sofort programmiert... :(
|
AW: Ist Anwendung 32 oder 64 Bit
Zitat:
Delphi-Quellcode:
:wall:
Function Is32EXE (aFileName : String) : Boolean;
Begin Result := Pos('Program Files(x86)',aFilename)=0; End; |
AW: Ist Anwendung 32 oder 64 Bit
Und wenn aus irgendwelchen finsteren Quellen doch noch eine 16Bit echse auftaucht?????
Gruß K-H |
AW: Ist Anwendung 32 oder 64 Bit
Zitat:
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 18:00 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