I'm trying to detect VMWARE OS using the IN instruction to get the VMware version, if in a VMware Guest, then it would can run this privileged instruction. but I failed (cannot run the IN instruction in both the VMware OS and Native OS, and get SIGILL signal,)when I'm using g++ and MinGW to write the code. so I turned to use VC++ 6.0, it worked(ebx was set to 'VMXh').
Is the g++ compiler doing something or other reasons so that the IN instruction failed to be run in the VMware OS?
My host OS is win7 and Guest OS is winxp sp3 with VMware workstation 10.