However on a VMware Windows Server 2008 R2 Standard server it comes back as not virtual.
Its a Intel Xeon CPU 2.66GHz with the 64bit OS.
There may need to be a small adjustment made to the ASM to cater for 64bit systems , anyone come across this before?
Code:
#COMPILE EXE #DIM ALL FUNCTION PBMAIN () AS LONG STDOUT STR$(funIsVirtual) WAITKEY$ END FUNCTION FUNCTION funIsVirtual() AS LONG ' Function to return whether or not the server is virtual ' try_again: ! db &h0F,&h31 ; rdtsc ! mov ebx, eax ! db &h0F,&h31 ; rdtsc ! SUB eax, ebx ! push eax ! cmp eax, 1 ! jz try_again ! pop eax ! cmp eax, &h0200 ! jb no_vm ! mov eax, 1 ! jmp finish no_vm: ! mov eax, 0 finish: ! mov FUNCTION, eax END FUNCTION
Leave a comment: