Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ldt_trick invalid detection method same results on 2 VM and 2 bare-metal (win+linux) #259

Open
adeliktas opened this issue Mar 17, 2023 · 1 comment

Comments

@adeliktas
Copy link

UCHAR ldtr[5] = "\xef\xbe\xad\xde";
ULONG ldt = 0;

#if defined (ENV32BIT)
_asm sldt ldtr
//asm("sldt %0" : "=g"(ldtr)); //for linux
#endif
ldt = *((unsigned long *)&ldtr[0]);

ldt_base == 0xdead0000 => means bare-metal

kvm/qemu VM and vmware VM and bare-metal-Linux and bare-metal-Windows10(21h2) all return the same results:
vmdetect ldt_trick(32bit)=LDT base: 0xdead0000 //g++ -m32
vmdetect ldt_trick(64bit)=LDT base: 0xdeadbeef

The asm instruction will not be called for 64bit. Changing/Allowing that, returns the same result, as when it's run compiled for 32bit.
Judging from the results, the detection method is invalid.

@adeliktas
Copy link
Author

#214 most likely related

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant