找回密码
 注册

QQ登录

只需一步,快速开始

About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
! x: }" a* @* p1 A$ M<TBODY>( l* @' M5 E+ K" J  R  R7 V7 P
<TR>0 u( p* F7 p4 p2 d, B5 s6 y( N
<TD><PRE>Method 01 1 n9 g6 ?$ c7 i* }$ P) J  g
=========
* g  q# ^5 U) t$ o4 y  m; w: G3 M  E" l4 x/ r6 u
This method of detection of SoftICE (as well as the following one) is1 C9 h$ d# M* r3 L% o2 M2 J
used by the majority of packers/encryptors found on Internet.
, Z5 o4 x" g' F8 vIt seeks the signature of BoundsChecker in SoftICE6 l8 V7 r- q& {* @  S. s
& S2 ^5 t) {2 t. I! R' q7 U
    mov     ebp, 04243484Bh        ; 'BCHK'- K' f, @$ @( E' P
    mov     ax, 04h. ~: r+ D. P8 {7 |
    int     3       7 G$ o# I% a( q! o, M
    cmp     al,4
9 g$ M. A0 O, n/ C" M4 w  H9 H* N    jnz     SoftICE_Detected- {; s/ u( ~* q

( {9 x! r, K/ u___________________________________________________________________________9 C( h- F8 J! w! `! s, b

% k0 o8 A# T1 i. g- ^- jMethod 02
. F' Q! D7 b5 A8 w; B=========5 `8 k: k' G0 N" x9 m% y" b
5 D' Y$ m) ]  i9 q" {/ r. c
Still a method very much used (perhaps the most frequent one).  It is used
% F. b- s2 H9 h+ @) wto get SoftICE 'Back Door commands' which gives infos on Breakpoints,# Q* d. d' ^5 K' L
or execute SoftICE commands...
! z0 W, x/ L$ d6 A! S$ W/ P; l7 y; }It is also used to crash SoftICE and to force it to execute any commands
/ W9 |, p- C0 h1 o1 A( g+ t5 V(HBOOT...) :-((  
% U5 z. k8 N4 Y: y' V2 A( v- ^) \
! x: z7 h6 w- T2 BHere is a quick description:8 c: ~5 E5 Y) r  t. k* e  s  V
-AX = 0910h   (Display string in SIce windows)
# L: k" d, u; _% m' T6 T/ B2 s- T' ]-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)
+ _& C0 \; U- G# A. H9 n-AX = 0912h   (Get breakpoint infos)
+ f0 c5 ?- V% X4 i-AX = 0913h   (Set Sice breakpoints). {/ N. E- w+ o0 r
-AX = 0914h   (Remove SIce breakoints)
( `/ I& Y/ W- J& e; [7 n+ l. `7 O1 \) @
Each time you'll meet this trick, you'll see:
  R3 N' f: }0 c-SI = 4647h
, O4 r2 [$ Z' A+ o" G* {4 f-DI = 4A4Dh
- @7 s  K1 I: L- JWhich are the 'magic values' used by SoftIce.
$ q3 r* q. B9 k* JFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.$ ^# A- F, ^" w+ e8 A1 ^

1 F% ^: z1 t3 }, ?; zHere is one example from the file "Haspinst.exe" which is the dongle HASP
# C  K# O' a5 f" l& s$ q4 eEnvelope utility use to protect DOS applications:2 l6 ^- ^+ @( j
# Y/ l& [* g( k3 U" O1 a

. L% M) R/ T& Z) ?4C19:0095   MOV    AX,0911  ; execute command.6 N: d8 _2 |$ i( ]- H) |- l
4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below)., I& A( _$ S$ c
4C19:009A   MOV    SI,4647  ; 1st magic value.5 u, Q$ B: f+ C: D
4C19:009D   MOV    DI,4A4D  ; 2nd magic value.% ]- N' Q$ t4 U2 y1 f. Y' N
4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)( {+ [  x& D1 i  H
4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute% p+ D+ ~! K1 e9 G; O
4C19:00A4   INC    CX. S  u) ]; g3 y  L) i0 ]
4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute
6 |' A( k5 b4 R6 h! I4C19:00A8   JB     0095     ; 6 different commands.# D& c% n+ r2 J" @
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.% r4 e5 Q, D+ W3 L# \
4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)( {7 }' S( D- n- w/ H4 j/ \1 J( K: {
: I, v1 e- {8 h5 ?' y, I
The program will execute 6 different SIce commands located at ds:dx, which2 n7 O! U/ w% u+ r
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.+ C* v" s6 F5 t0 R, K
8 D* _. ^4 R' }: }& @
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.3 P8 l) ~" ?" r* J9 |* [4 m7 k
___________________________________________________________________________
: g* ^; ^% a4 A* n  x& E" D$ I/ F. d
1 m/ O, E! G$ |1 w  C
Method 03" `/ Q+ \6 Y0 S/ m9 l% ]
=========+ X6 B1 O0 w% d" f

6 g$ @& Y- A& C+ {2 `Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h3 ~! L) N6 B- _- q$ h
(API Get entry point)! @" f7 W/ l/ n* t' p
        
; `# U+ a+ t! k. ^* N
5 g/ l$ C0 @) E* k3 o% g    xor     di,di* S/ i5 Q% O! ~! A
    mov     es,di
4 K5 U, ^! j# K/ Q, l    mov     ax, 1684h      
$ L2 E+ i7 z5 {: S1 D( q    mov     bx, 0202h       ; VxD ID of winice
/ N8 l" X5 [" c" |7 v( g% e    int     2Fh
: Y0 u. F- J1 d6 k6 t9 v: v/ k    mov     ax, es          ; ES:DI -&gt; VxD API entry point( g# A/ i) Y( A
    add     ax, di" C& D- V/ m, [4 V4 w. }; m! c
    test    ax,ax5 p6 P2 E6 `- t( _, ?
    jnz     SoftICE_Detected
" q& Y  O# n0 o$ }9 B1 X1 d! D: _: E
___________________________________________________________________________
. M+ Q- |0 A( R! k* z$ m7 [' _
5 f* K6 C- e) SMethod 04( g0 C) K3 s2 }, t3 p
=========# u6 ~5 `/ o- o3 V5 N/ X; K

2 l9 `: k! e" Y2 U- D& B: {Method identical to the preceding one except that it seeks the ID of SoftICE: L4 |$ j7 t# L7 K$ Z* L' Z5 q8 ]9 q
GFX VxD.
7 \9 U7 P' q- d7 j# _, W
0 D5 Y/ c! n) F# f: j- J    xor     di,di
8 H1 m6 s& E& I$ Y  _6 `" f    mov     es,di5 f3 h' q( z3 o. C
    mov     ax, 1684h      
0 H1 R/ x1 s7 x; [2 v    mov     bx, 7a5Fh       ; VxD ID of SIWVID
5 ^, D* Z. p5 T) U2 X* t    int     2fh
$ D5 }# l( e$ c( d( R" w. c) e    mov     ax, es          ; ES:DI -&gt; VxD API entry point4 y4 T+ E; M3 n- u
    add     ax, di3 d  V* G+ B* j' c4 ?& F1 h& r
    test    ax,ax
, f! O. U2 w+ i; R    jnz     SoftICE_Detected: `  I" n# V( m4 ~9 m  y1 |6 r7 _
* Q3 u7 E7 U) |+ @. H& |6 f; U2 I
__________________________________________________________________________
& G2 Z2 h# `0 S" D; P/ \
* W3 z" G$ o" _9 p& t" o
- q; @: s* l0 E$ L1 v1 L/ xMethod 056 Q9 z+ s# J9 Y) }
=========) \- k4 ~- x3 ]% D/ {" o
# h; n& N3 `& u
Method seeking the 'magic number' 0F386h returned (in ax) by all system9 Q( D8 w- k* I: f# t) Y
debugger. It calls the int 41h, function 4Fh.
, U6 I9 Z6 H# j+ T* y# Z* zThere are several alternatives.  
7 y7 U% V& x  H9 G
" Y5 f* c' D- r3 D6 ~! |  YThe following one is the simplest:
+ @" K& Q" Y8 _3 h* q7 h: [. V4 _  y3 ^- Z1 s3 n8 c4 J
    mov     ax,4fh3 j% H* @7 L9 L4 d- o/ O, ~* {/ T
    int     41h
! L  J. S4 p0 S. e    cmp     ax, 0F386- e& O+ h& T7 i) `
    jz      SoftICE_detected/ j% C2 y# R6 `& k* s  B( g

  F1 `3 \( a. G# L3 @! f' v6 L& I
) O# O6 O; a, D+ t. dNext method as well as the following one are 2 examples from Stone's # @0 _/ H* x9 N
"stn-wid.zip" (www.cracking.net):. g1 Z& n# {+ U# e- F! ^

  A; p& z8 }( g+ ~8 _/ ^    mov     bx, cs
+ a0 I1 c0 I# S# m' ~2 f+ G5 g: E    lea     dx, int41handler2
4 o6 N! J& M% e! J9 }! L% N+ z# o    xchg    dx, es:[41h*4]
0 e7 @6 P/ t/ e% ~' `    xchg    bx, es:[41h*4+2]
' g0 K" ?# d; j/ q  E9 p4 u$ @0 B    mov     ax,4fh( Q. Y$ F& _  x3 K
    int     41h
3 e% J8 E$ ?- s1 y    xchg    dx, es:[41h*4]
1 S: N6 X$ b8 v) F* r0 P1 _: Z    xchg    bx, es:[41h*4+2]1 Z  X3 j, g) Z/ W
    cmp     ax, 0f386h
3 u# c% A6 H, H( t0 W9 t    jz      SoftICE_detected
0 x6 K* x0 J0 s6 U% x4 Z7 d" H5 a) `/ T% f
int41handler2 PROC
+ l3 S7 I( C1 g+ _, L    iret0 `: k9 Z: a( v( {$ D
int41handler2 ENDP2 P- @: L" i* f+ m$ @: @  _% u% e

) ]* D. T8 w2 t1 n3 v! W' C5 r5 o/ k  O* e1 m
_________________________________________________________________________' b* b2 M9 g, H+ X4 A

) t+ o' T. M2 C% Q- |- u
8 @5 o3 ~  ]7 f/ n4 u( ]Method 06
8 `4 [( w0 J' V3 u=========( b* \4 q1 E# g( x
: a3 g! E- U" v

' \, p" ?( M, w  v3 i2nd method similar to the preceding one but more difficult to detect:
( B; O* E9 n) M  n1 z! c: H
% R' t- o; @  ]) C! U! r, E% d" K9 d9 T! W, {, F
int41handler PROC
/ w. f2 s1 ]. F/ `' X3 Q( Y    mov     cl,al1 t$ j9 X5 Y8 k5 g0 s! f
    iret
3 {# p7 I/ o# M' ?int41handler ENDP+ n' d& i8 E1 b# @3 o
3 G+ y8 ^( h9 ^% n. q

) P" d/ y6 }  b; V/ v    xor     ax,ax
2 n' I% q/ ?/ u5 L) D* n: J2 ?    mov     es,ax7 J% ?3 K- ^1 R
    mov     bx, cs
/ i; l7 j/ i. z    lea     dx, int41handler/ {* z# W/ P: W  @& i9 u; f
    xchg    dx, es:[41h*4]
9 y% R* W% m! K) ]    xchg    bx, es:[41h*4+2]
; d4 b, z( a! [! T    in      al, 40h5 A+ o4 @$ ~! j6 z# @7 B/ n6 O2 C
    xor     cx,cx! R) d" k( F% Q8 Q* D# ?7 s- N
    int     41h
0 }; H. s" ]0 D# p    xchg    dx, es:[41h*4]
: ?) @3 k5 }7 o6 q& F0 w3 @/ Z7 ~    xchg    bx, es:[41h*4+2]) B2 w; u0 \* z# [3 e) u% j( j& g
    cmp     cl,al8 R8 H8 L2 L5 y1 s$ v  S
    jnz     SoftICE_detected
% U" w( ?+ q: V8 O) A, q8 e, a2 R# w6 v  e
_________________________________________________________________________
" ?# |; B4 x. z2 ~* N- C# p4 ?0 J& m' U! D* i& Y
Method 07
$ J: \! R3 v. J( j" H  G* A! x2 Z=========
, H' T5 }0 p. Z! i
  B9 W% i. f; r$ ^' @; tMethod of detection of the WinICE handler in the int68h (V86)3 b% O+ b* A- R, C

2 w4 R. B9 v. O    mov     ah,43h
2 q+ G+ `  {6 ~! a; I    int     68h
3 i* T# E( s& q8 {    cmp     ax,0F386h
; z3 M9 b, e+ k    jz      SoftICE_Detected. [: ]3 [3 ]& Q0 q$ m

! Z8 [; @5 }% U; L" j& z; [9 w  N
1 e8 s' G3 u3 P( V$ M+ n' L7 c- e" j=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit& P1 g& L( E. Z% q9 W! k
   app like this:" J3 t, L6 R! K, f
1 e2 ]/ y0 ?7 m. a
   BPX exec_int if ax==68) S0 P! G% [) Z
   (function called is located at byte ptr [ebp+1Dh] and client eip is
4 P9 E: y; `4 B& L1 C   located at [ebp+48h] for 32Bit apps)
' U) `* ?" [% Q' l__________________________________________________________________________
' f# C7 j4 S( |2 n* r7 O/ t1 a& c$ f9 H6 C2 e
) \. |8 R% F$ B. C& c& e
Method 08
& w3 n5 j7 N8 q6 |8 i0 m' ~=========
+ \( b. t* [5 E( R$ r) Q+ |. @* ?* g. T
It is not a method of detection of SoftICE but a possibility to crash the
" s; J9 ?9 F5 M# o( Asystem by intercepting int 01h and int 03h and redirecting them to another$ D. k4 s' Z4 D! R. k0 A
routine.
9 c, V0 h. E5 N% x; DIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points8 Y* o. |. v2 F7 L1 q
to the new routine to execute (hangs computer...)" y2 h; j/ G' M) n
4 y' J: ^; E3 `( K% S- a
    mov     ah, 25h
- |" S' s! Q" o! u    mov     al, Int_Number (01h or 03h)7 u0 t! j4 s! R
    mov     dx, offset New_Int_Routine
7 F5 S; k6 k2 l, K/ b9 s5 ?" i    int     21h
* b. S" i/ a" G9 N. r6 ~$ G5 _; d/ A; M4 X' M  U0 I$ M5 a
__________________________________________________________________________; G4 G7 `" A  N: B; _
, }! x. J# b3 D; @1 J
Method 09
9 O; G) p. g2 ]7 q( A7 T=========. v' G% N! O9 T. P* {
5 R- W, @, K% K/ x) n) M
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only# u) I, {- c0 [$ q3 T7 j- ^  v) s2 s
performed in ring0 (VxD or a ring3 app using the VxdCall).
" x5 V$ L3 `/ g, cThe Get_DDB service is used to determine whether or not a VxD is installed
' M6 Z+ d6 ^& R" Bfor the specified device and returns a Device Description Block (in ecx) for8 B1 c. Y: ~4 ^6 h8 _4 B7 I
that device if it is installed.4 I1 e6 ~& X( v) S; x& u/ D4 T& s
2 @$ }) Z8 q& u+ d9 F
   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID
1 a* \. B* j% a+ J& |' v! I   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
7 m* O$ a: d  ?( p   VMMCall Get_DDB9 z# @3 s+ \6 m/ e% E
   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed
- q. }# L5 z9 B! p! K. N% S% L/ W: T9 b. ^) T
Note as well that you can easily detect this method with SoftICE:) O! K" {; g7 x$ a! A% d  z
   bpx Get_DDB if ax==0202 || ax==7a5fh
% G% J; t6 y! ?
& m, I) ?1 J+ @' E0 J+ ]__________________________________________________________________________
/ Q- g: d: ]% t. a( m0 x: n% }6 f* Z
Method 10# q# B7 P2 ]- R8 e/ j( {' e
=========
9 ^) {- k7 z& U7 ~
7 ]% a- E+ h, s9 S$ ^: D+ W=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with
" B6 g  h, `0 C3 ^  SoftICE while the option is enable!!
7 A: Y. N) Q" o  T' q! a- [2 r
! f# }& [2 B8 ~; d- e/ hThis trick is very efficient:
! |, {! M) e4 @6 Yby checking the Debug Registers, you can detect if SoftICE is loaded. n4 S4 a6 s) R& V7 J7 d, q( X+ c
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if+ y8 d$ E- k) q- c* P1 E( e
there are some memory breakpoints set (dr0 to dr3) simply by reading their) q4 L0 w* f* R# e
value (in ring0 only). Values can be manipulated and or changed as well; j: H7 ]$ A- O' v
(clearing BPMs for instance)
5 ?& B& D2 W) \0 j# v
2 |6 k# `+ n& V! `- Y/ ]% i__________________________________________________________________________
$ Y+ a( G( |0 R1 {. ~- F1 k0 M6 D1 p5 {* y! C* H" S0 c
Method 11& N/ j4 J$ a3 [8 s
=========
) s# O* n) P' o! ]; H5 n' |5 w4 H/ O) g( M
This method is most known as 'MeltICE' because it has been freely distributed
3 H7 ?5 U+ X5 J4 o+ Dvia www.winfiles.com. However it was first used by NuMega people to allow" Y( l  Z! O" @7 ?
Symbol Loader to check if SoftICE was active or not (the code is located6 z) \/ d+ n9 v$ x, J
inside nmtrans.dll).
" ^- H' C, n- ?+ L1 v* M0 G# b# ?4 ?+ r1 x- ^2 L/ P+ Q/ @3 X
The way it works is very simple:( O' a) Z. Y+ P
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
5 N5 t$ Y; M, W6 v$ SWinNT) with the CreateFileA API.9 f( ]' h% p' l6 S3 K
+ e4 s: J9 ]& c' c
Here is a sample (checking for 'SICE'):
5 w# F1 k# }  p8 X. w* Y; `3 E$ C/ L" e
BOOL IsSoftIce95Loaded()
8 T, L' ]: V) f2 ~# T6 N1 r{
; x3 i5 Q7 Z4 {) r: [6 Y   HANDLE hFile;  / o* c. Q" i4 ~" ~: V" K* @3 V
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,& ?0 i3 ~: M1 K' w
                      FILE_SHARE_READ | FILE_SHARE_WRITE,0 g5 i2 p7 o4 v, j, o
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);' s2 X/ f6 ?0 E7 L5 }
   if( hFile != INVALID_HANDLE_VALUE )
0 W+ L9 P* R/ x: Y: F- M" g* O   {" V0 e- d& L9 c* E! m) o+ z
      CloseHandle(hFile);2 H& a9 c) q+ c/ }6 g7 u
      return TRUE;7 t( ?1 L$ b- Z" K, }) Q) b$ n6 T
   }
/ D& i% {7 K9 l! u8 C5 M   return FALSE;2 _5 s, Z+ x# U( O/ \+ P* b
}
0 c9 }- C/ W+ S2 i  \2 R* z7 N6 _3 v- ]9 I4 V
Although this trick calls the CreateFileA function, don't even expect to be
4 H! Y( O1 q% `3 ]2 k! \' u$ zable to intercept it by installing a IFS hook: it will not work, no way!
/ P0 o5 Q/ H0 F( o( iIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
1 _& O( n( @0 j5 u6 c/ iservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
& G+ J+ r1 b+ y' u' t7 R  @+ uand then browse the DDB list until it find the VxD and its DDB_Control_Proc
" d& k; D0 P# {; pfield.7 P+ Q, v' u/ G% p
In fact, its purpose is not to load/unload VxDs but only to send a
: M& ]: G8 d! h3 AW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)9 p0 [* `" \  J" J' [# K
to the VxD Control_Dispatch proc (how the hell a shareware soft could try* h  J) ^( `1 s" K+ f: e$ d  }0 j3 A' ?
to load/unload a non-dynamically loadable driver such as SoftICE ;-).0 a5 T/ D7 {! Q4 T# p6 W  d
If the VxD is loaded, it will always clear eax and the Carry flag to allow. F$ I# R0 z5 z
its handle to be opened and then, will be detected.+ w. P$ n1 F& M7 {' ^
You can check that simply by hooking Winice.exe control proc entry point6 I% [# b( p. ^* x
while running MeltICE.
* W+ r! o, r& v- M! L5 O* U9 E% B, M$ R  H2 [, d6 ?& K/ h
$ T4 g& U6 ?' c& K+ b( L, I: S9 u
  00401067:  push      00402025    ; \\.\SICE
9 Y7 a5 |4 \) l8 @  V  0040106C:  call      CreateFileA
2 v  j* `9 D. d8 B# x  00401071:  cmp       eax,-001; {$ [; l  B8 y2 G8 X9 U
  00401074:  je        00401091  ~' W* O$ R8 R  K' j
3 V" c, o$ b+ v

! \' N. E7 ]" Q, t7 e4 KThere could be hundreds of BPX you could use to detect this trick.! a0 {0 L8 E% }' ]
-The most classical one is:
+ g6 a9 ~- P3 m5 _. y$ o' K6 Y  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||* C0 a1 R! }$ P1 I
    *(esp-&gt;4+4)=='NTIC'  _6 D( b- F4 d  v0 Z

8 N9 A* m7 P; h1 p$ C3 n-The most exotic ones (could be very slooooow :-(
/ \  b# z: H9 A/ a) J  m; @; C; z   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  ! x" t( k+ d5 u
     ;will break 3 times :-(
3 d+ ~5 |" @7 F; `3 D7 I. U! o& m% z  r1 u
-or (a bit) faster:
! N7 X; [7 |/ Z' c  g! p8 b   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')* @; [, |; ]$ A; ^
7 p4 W3 Z' Q; F( O7 s
   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  
$ A) ^  L! j! l  r) R0 A9 D     ;will break 3 times :-(- `, @4 q- E# _' j) Z" _
  q& @4 t& v' \, g; c. K
-Much faster:% \. F' G  c/ i4 c( E, F- r
   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'
* B* V, j2 ^5 E4 T8 @' s, Z3 z8 @, K3 W$ c5 \: n; D
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
% J( {# J9 }1 h) }% `7 B4 X- F8 Nfunction to do the same job:
" M0 b- e; Q2 v$ b" m) }; a9 v0 Y
/ k7 |, B. m. p# _* a0 G7 o% Z   push    00                        ; OF_READ8 d5 N' ]( I) g3 J0 `8 [! m
   mov     eax,[00656634]            ; '\\.\SICE',0
' b- _/ y6 T9 o   push    eax
  v6 J, [7 W7 c5 j   call    KERNEL32!_lopen
. c2 I. {8 }4 n8 e/ b4 U) a& P   inc     eax* R9 V+ B( n9 l' o: W
   jnz     00650589                  ; detected+ r5 S+ c" D; L  s9 y
   push    00                        ; OF_READ  N7 n4 r3 {8 _8 i, m3 Y
   mov     eax,[00656638]            ; '\\.\SICE'7 M: T: B( D2 U; B4 L7 b' |
   push    eax
7 B) {& v' H( v/ Z- {) ]3 E   call    KERNEL32!_lopen& c4 Z$ I# _$ d" b
   inc     eax$ j- V+ Y& b* r6 S' s# c
   jz      006505ae                  ; not detected
- ?0 l# d' |0 q! t
4 w# S% Z6 [8 o, [+ n3 I- z* t! N3 w5 e! I9 u; |0 `1 h5 y
__________________________________________________________________________! i5 R" E- n; q% ^  w. x/ J: k; Y
" e' J% `: p- M9 N0 J% R. m
Method 12
; w: \7 \# q* l4 D. t=========4 o4 F7 B+ ^, T% g
' `% I) o% ^! G# l
This trick is similar to int41h/4fh Debugger installation check (code 05' Z2 \9 v  R5 m& Y
&amp; 06) but very limited because it's only available for Win95/98 (not NT)
; t) z  D& i) Y/ f9 x2 tas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
% M4 p4 v$ {8 P; \9 Z! D" ]+ M8 ^; n6 l- H" F- \" |! w
   push  0000004fh         ; function 4fh
6 o- M( _4 p$ Z6 \: d6 T: O! ?   push  002a002ah         ; high word specifies which VxD (VWIN32)
" z& _: E" M" v1 f. O- X1 Z8 W                           ; low word specifies which service
" B/ h2 X- ]' x* i9 n                             (VWIN32_Int41Dispatch)% C* ^2 I1 n9 l5 ]
   call  Kernel32!ORD_001  ; VxdCall
5 {- l9 ^. f0 N+ l   cmp   ax, 0f386h        ; magic number returned by system debuggers
) r  L9 |! [$ c: b. N0 s) Y9 }; E   jz    SoftICE_detected% G7 }) @) w) [

3 p) ^2 \( `# U7 m( z- E# UHere again, several ways to detect it:& U/ S7 B( G# {
/ R% n9 O( r. \" w- _* a6 R
    BPINT 41 if ax==4f
! C# y8 O2 G, k% _  ]+ @/ L2 j' j" k+ g
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one
' U# x# i4 W+ D/ ?9 n3 P( v& D* l& X# y. [8 G5 k& `# n
    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
# O5 j: u: ^9 p! T% T- u/ G% }: O" h, r0 |2 M9 T- U
    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!! K: S; J1 b3 Q8 N

% p/ g& U4 `4 D# G__________________________________________________________________________9 P3 o9 {% G( N2 u4 @% G

2 [. t. Q; P. E. A) ~) VMethod 13. N& t* t3 ^7 |2 P* I
=========, M! O4 J. D' M5 R: b( }, m0 D: D

7 p) |  O8 _) W' n7 nNot a real method of detection, but a good way to know if SoftICE is' }, p9 o$ m8 V0 N+ F
installed on a computer and to locate its installation directory.
7 \% i5 \9 x7 K" n: fIt is used by few softs which access the following registry keys (usually #2) :
( W$ {2 ?  p. E7 D
8 D" H: W8 R. i; V-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion7 f: ~: |- ~% ~5 f
\Uninstall\SoftICE
8 W$ K* u" M7 d! x-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE' w7 n/ e  j4 f- J4 g, L
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
( r$ Z! t  W' O& T# a6 X6 @\App Paths\Loader32.Exe. Y& p! W, ^" d0 u& q; R9 ^0 s, [
( \$ j% r7 {2 p9 l% |

" S7 V' x& E0 [! K+ B) ~# n  ^Note that some nasty apps could then erase all files from SoftICE directory
( k/ v/ U1 e# _  j4 ^! b* U(I faced that once :-(
0 O8 u$ w5 t1 w1 F
; T5 g, O+ C9 g" v2 WUseful breakpoint to detect it:
5 p; Z  M$ ~3 V" ]+ J; B& Q! c  X. H" B' |
     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
# O* b. E$ w8 M4 N$ \' b
. K; ^/ T! H. ~- ?__________________________________________________________________________
; P. p5 X6 p5 a' y& f3 G4 Y# N! O7 m
- {: N% E* C9 `* t6 l
Method 14
) K  _* d% O" f- S( q, O( c7 P=========) N1 U4 v- E% H6 y; W( l( ~
1 H$ Q* }- d2 Y, N
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose0 c1 n& }  W6 V7 D
is to determines whether a debugger is running on your system (ring0 only).& N' k" T4 q: |' A
" a- L; u- t( r, I* I) f
   VMMCall Test_Debug_Installed
5 I* P3 I( k# X5 l4 A9 g7 ]: }* m   je      not_installed
+ f0 N' a% o" {% [6 [. {2 [  r( x! K. f
This service just checks a flag.
$ q! d1 }4 z3 Y0 H! P* h) N</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|本地广告联系: QQ:905790666 TEL:13176190456|Archiver|手机版|小黑屋|汶上信息港 ( 鲁ICP备19052200号-1 )

GMT+8, 2026-7-22 19:03

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表