Exetools  

Go Back   Exetools > General > General Discussion

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 01-16-2005, 06:15
jemos
 
Posts: n/a
test ds,4

Anyone knows what it does?

mov ax,ds
test ax,4

it might be a NT\9x detection or... sice detection..

ds in ring3 (NT) = 23h = 100011b
4=100b

thanks in advance
Reply With Quote
  #2  
Old 01-16-2005, 11:16
A.V
 
Posts: n/a
yes, it's seems to be a 9x/NT detection, cos at 98 ds is 167h = 101100111b
Reply With Quote
  #3  
Old 01-16-2005, 13:27
omidgl omidgl is offline
Friend
 
Join Date: Jul 2004
Posts: 86
Rept. Given: 10
Rept. Rcvd 4 Times in 3 Posts
Thanks Given: 0
Thanks Rcvd at 5 Times in 5 Posts
omidgl Reputation: 4
Lightbulb

I've tested that in win 98,ME,2000,XP,2003. and it seems that it's a vay to detect NT/9x family.
I think that it's because of some differences between 9x and NT family in Data-Section alignment rules.
Very interesting...
Regards
OMID

Last edited by omidgl; 01-16-2005 at 14:36.
Reply With Quote
  #4  
Old 01-16-2005, 18:54
Mkz Mkz is offline
Friend
 
Join Date: Jan 2002
Posts: 98
Rept. Given: 0
Rept. Rcvd 2 Times in 2 Posts
Thanks Given: 5
Thanks Rcvd at 25 Times in 17 Posts
Mkz Reputation: 2
That bit is not related to alignment, but with the place where the selector points to.
The DS segment register (and others) are divided in 3 fields. The lower 2 bits are the RPL - Request Privilege Level, which map to ring 0 or 3 in Windows; the next bit is the TI - Table Index, and indicates if the segment (remainging bits to the left) are defined in the GDT (0) or in the LDT (1).
Probably, Win9x uses LDT for application segment selectors, while NT+ always use GDT.
You can find more info on this topic on http://www.acm.uiuc.edu/sigops/roll_your_own/i386/regs.html#segments or google for more.
Reply With Quote
  #5  
Old 01-16-2005, 23:23
jemos
 
Posts: n/a
Wink

ok, thanks for the infos
I think I saw some snippet like this in some y0da's source code
and it was to detect 9x\NT thats why I assumed it could be the same...
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
you can test this britedream General Discussion 1 04-16-2004 23:24


All times are GMT +8. The time now is 23:07.


Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX, chessgod101
( Since 1998 )