About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>4 d! r2 j* A, c
<TBODY>+ C4 h, e6 x' |7 p. e6 N
<TR>6 b  t/ d0 I4 l) M" p
<TD><PRE>Method 01
) _7 }5 e/ n% e1 c=========; e# S, c( O$ L/ ?7 R: O- L" j6 x

  p7 s( \: m5 A9 T! P- _This method of detection of SoftICE (as well as the following one) is
3 q1 L+ H7 p3 S' ~- M) V0 \) v, hused by the majority of packers/encryptors found on Internet., w; L" D" M5 ?9 n2 ?
It seeks the signature of BoundsChecker in SoftICE. K; D# `# Q# n2 x9 u( Y: P

3 ~! E+ z# L  h5 k  s    mov     ebp, 04243484Bh        ; 'BCHK'
# E- {8 [* T$ Z  q    mov     ax, 04h
) T; `2 `  p6 l* s    int     3      
# Q$ C' D- x) [6 @    cmp     al,47 U8 c2 V" N8 I; G- o4 B
    jnz     SoftICE_Detected
& ]  n0 G/ Q- p' C+ p1 a+ f* }) i* t! k/ y
___________________________________________________________________________, f5 O/ _1 s" X. R

7 V. z/ v4 q. J- }( v0 L% CMethod 026 Z. |& _9 _2 f1 T1 t  W
=========
' ^9 {* f, Y. V0 t! k2 M5 M$ E
! k) v9 e$ y8 u; {Still a method very much used (perhaps the most frequent one).  It is used
. \( t5 l6 j! p* M3 k# Kto get SoftICE 'Back Door commands' which gives infos on Breakpoints,8 n' ~( w2 t0 B' {' {4 W9 L
or execute SoftICE commands...7 N7 F  B8 }4 j& }
It is also used to crash SoftICE and to force it to execute any commands5 a7 ], @, e, [2 s* g
(HBOOT...) :-((  
# Z  n" d8 y" h8 P' k$ N" v3 b- N' c( v! I( \! u
Here is a quick description:! c' n  ~4 o+ w2 `7 Q9 [
-AX = 0910h   (Display string in SIce windows)# I7 }3 P9 i& L2 B2 |
-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)! d7 t( N4 l2 q" z9 h# S; s* v3 ^& @
-AX = 0912h   (Get breakpoint infos)
( M1 {1 u' u# Y# M-AX = 0913h   (Set Sice breakpoints)7 j( p. X/ H; l5 G
-AX = 0914h   (Remove SIce breakoints)1 n7 T% Z9 I) {3 H& q9 s

/ i& u( F* z% ]; mEach time you'll meet this trick, you'll see:
, v. b$ z! D4 ^- O5 O-SI = 4647h
! l2 b3 r4 X2 }4 ^-DI = 4A4Dh
" p8 r2 }4 I& a) }$ [/ KWhich are the 'magic values' used by SoftIce.
) n+ D2 }0 _. E  ZFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
; i! k1 x3 Z5 ~6 r( b. J/ r; k0 F1 q; b4 V% X
Here is one example from the file "Haspinst.exe" which is the dongle HASP
$ m" H1 T- X1 Y: B# `! p( c3 ^" yEnvelope utility use to protect DOS applications:
/ x' G4 u- f( N* R2 ~# O% ?$ p) |- w7 n" h

. j: j6 h; `7 l9 C) L( V4C19:0095   MOV    AX,0911  ; execute command.
" ?9 @' B; X. {# G' M5 c4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
& I5 u& L! ^: _! p: B9 h4C19:009A   MOV    SI,4647  ; 1st magic value.9 T8 R- x& U+ m- _, i; r
4C19:009D   MOV    DI,4A4D  ; 2nd magic value.( ?/ W, r+ q; D3 _
4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
8 U. c% y7 y2 Z' d4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute
4 o+ z1 S  ]7 S) L0 j4C19:00A4   INC    CX
' s1 ~( Q6 }7 M: u  w4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute; ~+ `& R' N6 V
4C19:00A8   JB     0095     ; 6 different commands.5 v: Y- @( z: m. A$ X( V' ^
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.2 Z+ a( E4 `: R( U
4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)1 O) V) C% I; |5 V+ R+ p0 c% Z

. L. _  t  J  U) ~3 D2 e7 OThe program will execute 6 different SIce commands located at ds:dx, which
3 t$ D: z3 d, tare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
: F5 T: Y! [/ K$ Y9 i2 E) ]  @4 L0 I9 @  B
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.% d5 j0 S' ?/ @4 ~& }3 T: U
___________________________________________________________________________  m( W, N* R6 @9 Y0 y
+ w% t( p9 F# Q5 ?! Z
# \# M' D6 q3 T0 r2 j3 ]5 B0 @
Method 03- U8 f* K4 ?1 t5 t) B
=========+ Z) z5 J1 C- M2 ?
" z: g: z# z$ u) W  e$ D9 q- v
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h  `& B: I: B3 P0 l' Z
(API Get entry point)
9 H$ M  Z8 A1 I4 z% b5 C2 |        
0 a% f- u+ P. f; u  J7 {$ ?
. [5 ]4 P# r2 M  U/ w/ i    xor     di,di
& `' m) i' D3 Q* Y    mov     es,di: U& P6 G3 N  [3 d
    mov     ax, 1684h       - U( {: M9 D4 F$ k4 f" |
    mov     bx, 0202h       ; VxD ID of winice+ g. T; ?! {4 \  r* _# E) x
    int     2Fh9 s4 K( R8 f& P/ f& N
    mov     ax, es          ; ES:DI -&gt; VxD API entry point& F2 _+ S/ L1 \1 n
    add     ax, di) E" v+ ?: o1 s3 t, h
    test    ax,ax( F' a0 o6 q: H5 h2 g9 t
    jnz     SoftICE_Detected5 @: |! ?& q7 L$ R  k: ]/ o9 ^1 ?

* j; {1 ]4 x6 z1 A1 T___________________________________________________________________________
& C3 a+ }2 }9 ]9 v9 K4 K3 I7 j! ?- W) `
Method 04
+ i8 a# d. J& R=========4 e4 s% L; H2 ?2 g

- y0 M, k& X6 y, t8 v6 g3 d# }, vMethod identical to the preceding one except that it seeks the ID of SoftICE# d% o4 v* r1 W) \1 [  f" N$ U
GFX VxD.
8 R5 \4 n- U( Y0 J; v7 Z/ \- C2 s, d7 l/ _9 }! _( \/ o
    xor     di,di
% v5 p$ [7 p; p5 }2 [1 W6 L    mov     es,di8 z, _# E( z0 w& A' A& o
    mov     ax, 1684h      
1 h. w! W0 n8 q  k/ f3 e6 [: o: _    mov     bx, 7a5Fh       ; VxD ID of SIWVID, }: B+ Y) P* @) J  A# l- x
    int     2fh
; q) Q3 `1 V, w2 j/ P5 ^    mov     ax, es          ; ES:DI -&gt; VxD API entry point
) m* A! O) _; e" O; q  w    add     ax, di
$ Q5 m+ D" h4 K7 f$ I8 n    test    ax,ax5 N2 m$ ^5 G) k, E( {2 o
    jnz     SoftICE_Detected* w8 M4 Z: w& p0 |/ r* R7 H

$ O3 O& _: {3 @__________________________________________________________________________
; D+ @- |( ]2 Z/ m# X$ z/ a5 }8 P; ~1 F1 n. R* h
4 c( a5 b1 P2 R: G3 ]9 g
Method 051 [) ~. r# X3 q9 G/ X% \( i
=========
" @* t( z1 W5 @, ~
* ~4 Q4 u) Q: \6 t5 yMethod seeking the 'magic number' 0F386h returned (in ax) by all system
6 c: ?: L# J9 R7 }* U) k1 q( Jdebugger. It calls the int 41h, function 4Fh.
0 C( y3 m9 W3 {( T- ], ZThere are several alternatives.  
! u( P" u3 I" F$ v" S! y2 m5 j( t# X4 S+ Z0 _, o
The following one is the simplest:. [9 L9 l4 _) S& c! z* o- C& a4 K3 U
) r9 K$ g" m: W" O
    mov     ax,4fh' |% f. j3 J5 c
    int     41h7 l& [. P" ~  a6 P9 s  {0 E
    cmp     ax, 0F386
0 _- E1 w0 F0 O; J  S    jz      SoftICE_detected
/ T: t( N! C+ L9 ]9 O+ c' U7 P
/ V! B: ^" i- m$ O6 O" U! {( u1 Z. B7 D/ c! L' c+ L. l
Next method as well as the following one are 2 examples from Stone's
" ?7 m+ j1 i1 V! S  f5 O) e"stn-wid.zip" (www.cracking.net):& V2 S) Z3 A) `8 A* y% ]: P

+ g7 l" _+ j! Z# X    mov     bx, cs4 |: C& N% _- z9 ^: l
    lea     dx, int41handler2
  h" X; E' p; ?  R    xchg    dx, es:[41h*4]2 B" i; B; t: G. ?
    xchg    bx, es:[41h*4+2]
3 y& C* I6 N! @! o: l' n    mov     ax,4fh
/ Z. G+ I$ ~3 X# ?  E: @    int     41h( j$ C, \% T+ k9 A2 R" K( ?
    xchg    dx, es:[41h*4]
  }7 j0 ]; R1 j$ n/ j    xchg    bx, es:[41h*4+2]
6 E  b1 Z. `: a+ T6 T    cmp     ax, 0f386h
3 u  ^0 \, B2 }    jz      SoftICE_detected( a( N$ Q7 h: l+ i: M4 H" X
8 L. u& N- h3 U6 P% k  B. T  ~- C
int41handler2 PROC/ j* `' N: b8 T3 I+ |/ I
    iret
( C$ P+ E+ f0 w* dint41handler2 ENDP
( \# L/ m) t' V# y) h
! o+ l  @' g1 D/ @& P. ^; u* h* F  m! o
_________________________________________________________________________
( B5 \& ~% a3 }/ T1 v  n
9 F9 g, E* ]! z3 J1 T3 I! i' y
1 a/ r1 v0 t' \' X8 `: _% ZMethod 06
. R0 q8 J( [& f  B. U  d8 U- |0 p=========
9 M* U/ y- b6 Y, t% m' a# \) f1 R7 d7 P/ ^# T* L& l) L
$ w7 d& ?) M5 Z: v" E
2nd method similar to the preceding one but more difficult to detect:0 G; ?" t1 M3 ]
5 F% O/ B5 h9 p8 Q  K7 x

! U, w, t' d. \int41handler PROC
3 s8 A& `( E; h, q5 x    mov     cl,al6 |+ @- G. ^9 |! `
    iret
& A. v4 [5 A- ~. p% l/ Bint41handler ENDP
. Y* n/ a  q; k" ^. h6 X5 z9 W3 S8 |, k! O& g
/ {8 {1 J, F6 l* ]3 D
    xor     ax,ax' _/ A! p+ _+ ^1 y9 G
    mov     es,ax
; H$ L2 T/ {  _    mov     bx, cs
9 B: l% z- y# v: r    lea     dx, int41handler
: Y2 J& e3 f6 Q    xchg    dx, es:[41h*4]
3 u( g3 @( w, S8 k    xchg    bx, es:[41h*4+2]
% C* U) n$ R; n) F! W3 p' N    in      al, 40h6 i' z# O0 I) {! W/ S! T% t
    xor     cx,cx
0 S: X! a0 l6 `8 W$ l7 T2 N    int     41h. G6 c; h2 C, O# \
    xchg    dx, es:[41h*4]0 G( a3 {7 S: n1 N
    xchg    bx, es:[41h*4+2]
# o- k1 L2 |* j8 c  d  g2 E, c    cmp     cl,al
+ s0 t  L8 r9 z6 l! l. x    jnz     SoftICE_detected
+ z- A3 J- e# O% R% V
' {8 Q! |% C: k& F_________________________________________________________________________3 @8 G3 e7 i" ?& T) k+ o) m% l
, \8 q+ P) s) H8 |
Method 07
# G( a) m$ R# M; m$ ]7 G( C=========. o: v/ u# n1 ?2 C( C

4 ?5 O* R1 ?+ F' W3 SMethod of detection of the WinICE handler in the int68h (V86)/ f+ {  o! Z) }5 y" U# T% \; H

/ t. `( j# d4 B" M    mov     ah,43h+ c8 H" k. L: n# B5 I. O0 W* L
    int     68h
, F7 U" h' i6 J2 r+ T    cmp     ax,0F386h* D8 I7 k/ a# g4 P& _2 G, h
    jz      SoftICE_Detected' W4 K+ R4 D0 m+ ~, s, z( {
8 U. g# r  N+ C% \2 U0 D
7 `1 p1 Y$ d5 Q$ S
=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
/ f* t2 f0 y6 \; a  b/ G/ l   app like this:5 P* n2 t: V7 {5 g& G" `- g
2 X) W' ]+ M$ p. h! j
   BPX exec_int if ax==689 x& I/ a! N3 |" T) d2 t/ c( q' ^; R
   (function called is located at byte ptr [ebp+1Dh] and client eip is
  s  j+ r4 j$ t2 c4 A   located at [ebp+48h] for 32Bit apps)! ~* S" c! C& J& E. {* ?
__________________________________________________________________________
! a* Q6 \% X- W' A5 s7 k
, ~" T4 C* a! K1 s" t$ S* B6 \; d8 ^
* s  S; y" ~5 RMethod 087 G8 \# U: G' d* H. @# ~
=========& V1 `0 E4 u" z  \
! y# L% V. T1 v( F/ A6 ]$ C
It is not a method of detection of SoftICE but a possibility to crash the/ y. \2 S2 F& T) l" S
system by intercepting int 01h and int 03h and redirecting them to another' s4 U/ N, Z8 V
routine.
* `. E# ?8 z9 J- L, ?- }It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points8 g, J( w7 R5 F- t9 C6 y
to the new routine to execute (hangs computer...)
! W4 |) A8 C( h# T3 N+ }3 e3 z
# L, R  m! a2 o9 [    mov     ah, 25h
# [; L, \( H# A4 l: k; h, F; |    mov     al, Int_Number (01h or 03h)1 M" B* E+ U. R# x1 D7 O
    mov     dx, offset New_Int_Routine( s% I  N7 C- v+ H1 ~+ A$ b
    int     21h
! C5 g$ {+ d$ ~5 K8 X$ c+ B$ A8 `' ?
__________________________________________________________________________
* a' z) K; [) b" y6 @; p4 W/ C
, C. s7 G; r# CMethod 09% E) M  q/ c, l( H- ^* G% K
=========
$ M# Y. y% c- f- \& Q' n( ?! D, h" o) C- |
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only, \9 C) _( v& y, l0 a! I: |
performed in ring0 (VxD or a ring3 app using the VxdCall).0 X7 K& A1 @' d7 l( k4 k
The Get_DDB service is used to determine whether or not a VxD is installed. x4 [  T0 n3 J$ H$ B/ S
for the specified device and returns a Device Description Block (in ecx) for( D3 N; w; k/ y+ {1 _6 p1 G6 a
that device if it is installed.  G( g- B( N: }/ T- g0 v( b

3 g/ h+ t. W% q8 l7 }   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID
# V: Z: O1 y/ o+ c0 V. p   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
4 O* E7 J2 A  t' q+ l   VMMCall Get_DDB
7 z0 x9 K$ \* u8 f! ?0 a4 ~' r   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed
( g1 i* L/ t  H5 R  P6 y$ w  }) r7 P$ Q- L6 T
Note as well that you can easily detect this method with SoftICE:
# t2 J; c  y2 \6 `$ s2 N   bpx Get_DDB if ax==0202 || ax==7a5fh
4 c- q6 I2 {  @5 g* z8 B% w0 _; c0 W* Q! P
__________________________________________________________________________
' I5 ^8 I1 \: b0 a( K0 Z/ |6 @0 a9 h0 T4 D- C# e
Method 10
1 A# `# e1 n" f) N' ?1 E=========8 e' W7 C" C/ \% Q; g! Y9 J

% m7 |2 @3 t/ I2 s" Z=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with
. Y+ w" f; W. Z2 u% P) }  SoftICE while the option is enable!!
$ _: C6 R, u2 `# ?, `/ z8 e# z$ N3 [; U
This trick is very efficient:5 r' N. j+ P2 a) Y* C8 F
by checking the Debug Registers, you can detect if SoftICE is loaded' z! x, M/ k6 ~/ w( n
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
7 @3 @# B4 `9 Q2 Y7 _8 D) c* {5 Bthere are some memory breakpoints set (dr0 to dr3) simply by reading their0 G' D- f3 q, M* H, `
value (in ring0 only). Values can be manipulated and or changed as well. N1 Y3 X' X1 |* N: u5 D2 U
(clearing BPMs for instance)
) c. R4 s+ C1 @( _( V
4 p8 \* U  X' u, I- ?__________________________________________________________________________. W# \: x/ `0 D' t; [9 [- W6 E

% ~) O$ S8 K$ _! U; O" FMethod 113 b5 p$ F7 c5 n+ X3 Z  {3 V
=========( Y, m1 N- i3 F# z9 |* p
9 Z. j9 ~0 f# x) U6 M
This method is most known as 'MeltICE' because it has been freely distributed) {  |4 L) F$ F
via www.winfiles.com. However it was first used by NuMega people to allow" F- b; O( J' @+ I$ s& B0 a, s
Symbol Loader to check if SoftICE was active or not (the code is located4 |$ d  T- }% u, A  Y5 \' C8 m5 n$ \
inside nmtrans.dll).% M* d; S/ [# D. K
# ?4 Y8 i& W2 t
The way it works is very simple:, X5 G# n9 S- {* Q
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
) Q5 W; X: p$ \; X+ d* O8 L8 vWinNT) with the CreateFileA API.5 @2 q2 |, @7 t7 ^
7 O2 I4 O( G/ l
Here is a sample (checking for 'SICE'):7 t' c0 `6 z/ r3 a8 @0 Q" }
) D% Y' L+ Y+ k
BOOL IsSoftIce95Loaded()
% r0 Q4 f1 g5 d  ~8 c4 w1 @{! e- @4 p" x# v$ r+ [' u# \* P. L. O( a
   HANDLE hFile;  
. T7 ]0 _8 E/ E   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,3 S* E9 K  F) E8 e. m$ j
                      FILE_SHARE_READ | FILE_SHARE_WRITE,3 |$ @* Z' L7 L
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
: b. J! V( O- D   if( hFile != INVALID_HANDLE_VALUE )
( T* l& s1 z6 u0 l, _6 i. F/ o   {6 j- J9 F& N( |- n3 U
      CloseHandle(hFile);
9 i) ^5 ]1 a. |/ ~. F      return TRUE;* S5 k  h4 P/ S6 Y: f/ n2 K
   }
' }/ p, Q, C* m3 {2 h: M7 g6 c   return FALSE;
# m8 O$ S+ z6 D}% |# F5 H8 t; n* S

* E' L- M  {( x% b0 U1 HAlthough this trick calls the CreateFileA function, don't even expect to be* M4 D/ |! r4 X* Y5 y
able to intercept it by installing a IFS hook: it will not work, no way!$ H: L7 O, h/ r4 R$ F
In fact, after the call to CreateFileA it will get through VWIN32 0x001F! f3 A% ?, y. A% V0 R5 v" i+ r  E/ Q5 x
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
) z$ Z5 x; p- q, Eand then browse the DDB list until it find the VxD and its DDB_Control_Proc
; t6 z% a0 J2 j3 n/ cfield.; m6 k! R+ b4 O' h% F
In fact, its purpose is not to load/unload VxDs but only to send a 1 ]3 E8 x2 S# m9 {' g4 a( ?
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE): a+ _' g! k. |8 t9 V
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
  N+ _3 q: U- ^! ~to load/unload a non-dynamically loadable driver such as SoftICE ;-).
# P* e3 _0 }$ p& V# [: UIf the VxD is loaded, it will always clear eax and the Carry flag to allow
. N9 Q% i) [3 d, ^5 N# @its handle to be opened and then, will be detected.& \+ h9 \: R* i
You can check that simply by hooking Winice.exe control proc entry point
9 w! I) y) R7 e2 V) Y7 i, s5 Lwhile running MeltICE., c3 Y+ D' y! |2 D
# l9 b6 h7 g- d: ~4 G
8 N( a$ p! N# L+ S3 d7 ?% q7 t
  00401067:  push      00402025    ; \\.\SICE
' |* v. [$ s# y) u  0040106C:  call      CreateFileA
' M" L0 P& i0 K8 q0 w- P  00401071:  cmp       eax,-001
1 M6 h& V' ^3 p3 W: v1 I  00401074:  je        004010916 d  r: E( V, E) v2 `

: {+ W2 O: p7 v7 ]+ D2 Q) L& t! r  F4 J7 s" {3 V( o
There could be hundreds of BPX you could use to detect this trick.
5 y8 x# K" m7 Q/ N) x: k. C-The most classical one is:
6 }) r1 x0 E+ J" c6 x  G; i  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
8 G: F" E. Z! q5 o; d7 E) c! F    *(esp-&gt;4+4)=='NTIC': l* c0 K4 D( Y( Y3 K0 p

8 J  W* E" |! C: ?, [-The most exotic ones (could be very slooooow :-(1 E( g- q# ^0 {# L( n% x
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  
& b  Z3 C  I; v3 g' s4 Q: }1 ~: I. M' |$ s     ;will break 3 times :-(
& s* _- `6 l" L. s
* g! z  Q, ^& ]) ?-or (a bit) faster: # ~( b2 I0 s, Y# `" V: x. t
   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
) _) p& P9 o: W; t# W' M* y: v  a6 \
   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  7 t) r* l! u6 G  S- N9 Q0 n6 Z# ^
     ;will break 3 times :-(% I# z8 v2 `! b- I; z5 \& Q6 H4 h3 w

8 V9 u" b5 r  p. q-Much faster:
! P- ]$ ^9 h1 Z5 o; n% L   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'0 J$ M( S5 F  N6 f' b; ?. B5 O: }

( r, n3 }6 K% S. Z6 u- q  {3 ENote also that some programs (like AZPR3.00) use de old 16-bit _lopen! G3 M) t5 b' x& l0 \
function to do the same job:
! i8 [: w) _. K0 G. Q8 H* d" O5 D, p" W
   push    00                        ; OF_READ3 G. _- k0 r% k: d" z
   mov     eax,[00656634]            ; '\\.\SICE',0
' x) H, Y! n2 V5 E0 z  ~7 r" x   push    eax" ?: \% X0 T/ v
   call    KERNEL32!_lopen6 [& f( K" c; Y+ P! E
   inc     eax
# K, [* q4 |: b0 D/ C9 T4 Y( U   jnz     00650589                  ; detected5 r8 f7 j! u0 m% y$ x
   push    00                        ; OF_READ  c; s" C7 ?: o8 J2 g* I3 @
   mov     eax,[00656638]            ; '\\.\SICE', {0 [5 K0 F! c% r! i4 Y- s- n
   push    eax
1 |9 j4 c3 {, u, o   call    KERNEL32!_lopen
/ g, i- K  B  ?   inc     eax
, m% G4 g, _1 Q; O4 p% z$ n   jz      006505ae                  ; not detected8 I( i3 E2 f  A% P6 H: X0 [. s
* `5 X) S, i3 e* B. P9 @

& \1 l" [8 J; r__________________________________________________________________________
6 w# x% o  `8 {! F! \, O
9 `; ]0 @- O( j* ^6 ZMethod 12
* G( P, c7 U' t# c2 W=========- e4 {& L  e  r) u+ @) Z0 q$ N
$ J5 a, K8 B5 g# h
This trick is similar to int41h/4fh Debugger installation check (code 05
# a# q2 ^3 }. l. O& Y% ]! H$ X&amp; 06) but very limited because it's only available for Win95/98 (not NT)
# ]% J$ m9 |# W/ bas it uses the VxDCall backdoor. This detection was found in Bleem Demo.: ^4 |$ N" o! \. H4 T8 W4 B
" _4 W2 j" d. V# J  k( O& B
   push  0000004fh         ; function 4fh3 x5 B8 ^% K- g. V6 a
   push  002a002ah         ; high word specifies which VxD (VWIN32)8 x0 c2 R. ^1 V4 {. f% p
                           ; low word specifies which service0 p3 [  d$ R4 x
                             (VWIN32_Int41Dispatch)
' z  [! _% y) S) K2 E   call  Kernel32!ORD_001  ; VxdCall# Y4 _9 X  P$ I. X! I% E
   cmp   ax, 0f386h        ; magic number returned by system debuggers1 `5 F  K9 q  N2 G1 h& z: c( F
   jz    SoftICE_detected; q3 ~7 r$ M5 o6 }0 {& ?
2 `6 C4 q2 h5 i. H9 X1 e7 L9 G
Here again, several ways to detect it:
( G8 m+ @: A% A0 S5 _" Y" b! Z: \, n" h' f- l
    BPINT 41 if ax==4f, ^- }) p& l8 i

8 D- Y$ G: ?% a0 J$ o5 f0 H    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one
! }1 }' n3 l1 D& k2 v& u. [: ~* ]. v! g, u; B$ Q  G
    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
1 W8 L7 z0 g4 q# }$ m: |& f
7 C/ B' d. d! \* [, D; M. J    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!  e! `* j$ F- I1 X3 R0 v
2 E. Y" T6 H, D, t
__________________________________________________________________________& ~8 z* u, {; T8 y2 @
! [+ Z5 a; V$ o
Method 13+ w& b* s' @  X3 p8 D# v. f
=========
2 \+ h+ c+ m, T5 U6 {8 r! ]+ Q' W* G4 D2 t1 d& Y
Not a real method of detection, but a good way to know if SoftICE is
# i8 [0 v1 w6 t8 @* L" Uinstalled on a computer and to locate its installation directory.4 ]) N- A$ e# K/ Z
It is used by few softs which access the following registry keys (usually #2) :
. I3 ~9 n, `7 Z  l) U, y" }! y4 w6 c2 F$ \' ]2 y
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion3 M& r5 I6 V" S' Y) r, n7 C" \9 [' v& l9 f
\Uninstall\SoftICE
( e3 G2 z# z+ ^$ _$ D-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE. g7 r% T" H3 r+ f
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion/ f0 ?7 }: m% x5 H8 i: k
\App Paths\Loader32.Exe
' `+ J8 A# e2 H$ I) l; {: X' e. Q
! k& L: v$ b( J/ c* P4 u8 A0 f( ?, P. i" _: h7 {9 A" m& ]4 C
Note that some nasty apps could then erase all files from SoftICE directory  {( \& u4 z0 h
(I faced that once :-(+ j; g) i0 l+ Z" I; J/ v
8 Q0 c; O  h: A7 \2 q
Useful breakpoint to detect it:: `/ l! ?% b$ b8 `

8 y3 a) j. S  Q# @/ \' `     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'# a4 |" _& F$ n8 a( p( [
5 J- }+ a. h) h8 T. H/ r4 c0 E$ g
__________________________________________________________________________
$ [$ H; e% u1 D5 o
  Q. {9 \- q: U
4 b5 y' [, F: T8 }Method 14
  u- ^$ g$ R" G=========
3 @" C5 x5 G% y: f+ H5 Q: Q6 Z" ~3 N5 c  C6 x& k# q# {
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose/ [- ]( B0 B2 a7 z
is to determines whether a debugger is running on your system (ring0 only).
% f: R2 ]9 f+ U! _* h. u
5 I. b  y) z8 J2 @8 N   VMMCall Test_Debug_Installed
! z8 x) \. E7 i3 }/ j5 L   je      not_installed
( [) C% C0 R3 D  q
- W# ?, W2 B9 U& \This service just checks a flag.' o2 z% ^, [2 N6 l9 a2 N
</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关注公众号

相关侵权、举报、投诉及建议等,请发 E-mail:admin@discuz.vip

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.|鲁ICP备19052200号-1

在本版发帖
关注公众号
QQ客服返回顶部