c++ - how does this code work for detecting XP OS? -


int _tmain(int argc, _tchar* argv[]) {     uint *ptr = (uint*) ((((uint)&ptr) & 0x00ff0000) | 0xfe0c);     if (*ptr) printf("higher xp\n"); // it's amazing!!!!     else printf("xp\n");     return 0; } 

i found trick in following article:

http://spareclockcycles.org/2012/02/14/stack-necromancy-defeating-debuggers-by-raising-the-dead/

but can't figure out common knowledge , convention behind trick. comment.

i don't understand background, sets pointer address calculated stackpointer (at 0xfe0c). reads value @ address, , either 0 (xp) or non-zero (not xp).

i doubt reliable way determine this. correct way determine version of windows use [getversion][1]


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -