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
Post a Comment