TYPE
TImageFileMachine = USHORT;
TIsWow64Process2 = FUNCTION(Handle : THandle ; VAR ProcessMachine,NativeMachine : TImageFileMachine) : LongBool; stdcall;
CONST
IMAGE_FILE_MACHINE_ARM64 = $AA64;
FUNCTION IsARM : BOOLEAN;
VAR
F : TIsWow64Process2;
P,N : TImageFileMachine;
BEGIN
@F:=GetProcAddress(GetModuleHandle('kernel32.dll'),'IsWow64Process2');
IF NOT Assigned(F) THEN
Result:=FALSE
ELSE IF NOT F(GetCurrentProcess,P,N) THEN
Result:=FALSE
ELSE
Result:=(N=IMAGE_FILE_MACHINE_ARM64)
END;
1条答案
按热度按时间kcugc4gi1#
雷米上面的建议很好,但是如果你想检测一个x86/x64程序是否在ARM Windows上运行,我认为你可以这样做(未经测试,因为我没有访问ARM Windows):