Windows Assembly / CPUID
Author | __Thanat0s__ |
Platform | Windows |
Language | Assembly |
Technique | CPUID |
Description:
This assembly code is using the CPUID instruction to check if the current processor is an Intel CPU. It moves the value 0 into the EAX register and then executes the CPUID instruction. It compares the value in the EDX register with a specific hexadecimal value to determine if the processor is an Intel CPU. If the comparison is true, it jumps to a specific label, otherwise, it exits the function. The preprocessor directive %ifdef NOSB_INTELONLY check if the symbol NOSB_INTELONLY is defined before the compilation, if it is defined, the code block following this directive will be included in the final executable.
Code
%ifdef NOSB_INTELONLY
mov eax,0
cpuid
cmp edx,0x49656E69
je _isintel
ret
_isintel:
%endif
Created
January 16, 2023
Last Revised
April 22, 2024