Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Detecting Compatibility Mode/Windows Vista

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
appalsap
Moderator
Reputation: 0

Joined: 27 Apr 2006
Posts: 6753
Location: Pakistan

PostPosted: Sat Mar 31, 2007 5:47 pm    Post subject: Detecting Compatibility Mode/Windows Vista Reply with quote

Normally you would detect the OS using GetVersion or GetVersionEx. However, with "compatibility mode" the return values are faked. This program (can be easily made into a function in your favourite language) uses an alternative method of detecting vista, searching for an address that is only present in windows vista's version of kernel32.dll.

Fasm syntax- http://www.flatassembler.net
Assembles to the minimum legal PE size, 1024 bytes Very Happy

Code:

format PE CONSOLE
include 'include\win32a.inc'

mov ebx, [exit]
push k32
call [GetModuleHandle]
push gp3
push eax
call [GetProcAddress]
test eax, eax
jz .nov
push yes
jmp .end

.nov:
push nos
.end:
call [puts]
call [getch]
xchg ebx, ebp
add esp, 4
ret

yes db 'Windows Vista detected!',0
nos db 'Doesn''t look like vista to me.',0
k32 db 'Kernel32.dll',0
gp3 db 'CreateMutexEx',0

data import
   library kernel32,'Kernel32.dll',\
           msvcrt,'msvcrt.dll'

   import kernel32,\
       GetModuleHandle,'GetModuleHandleA',\
       GetProcAddress,'GetProcAddress'

   import msvcrt,\
       puts,'puts',\
       getch,'_getch',\
       exit,'exit'
end data

_________________
Back to top
View user's profile Send private message
BEO-WULF
Expert Cheater
Reputation: 0

Joined: 27 Jan 2008
Posts: 138
Location: Green Bay, Wisconsin

PostPosted: Sat Feb 02, 2008 1:50 am    Post subject: Reply with quote

kernel.32 was the problem i get it thank you so much Laughing
_________________


4 L1F3 ( + [__] : : ) 4 L1F3
Back to top
View user's profile Send private message Yahoo Messenger
Symbol
I'm a spammer
Reputation: 0

Joined: 18 Apr 2007
Posts: 5094
Location: Israel.

PostPosted: Sat Feb 02, 2008 3:36 am    Post subject: Reply with quote

Wow, 1 april 2007 and no comments...
Very nice.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites