About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
; D5 e/ a7 P+ Q( T<TBODY>5 Q+ f( w* B! @  d" b5 z. d( n
<TR>
" a; n6 C* B3 k' y5 p: f- f1 K2 A<TD><PRE>Method 01 $ M4 ^/ u1 j. l9 Q. |/ w! I
=========6 y( S/ f5 x+ o& Y$ C$ v
3 v+ b' P. M/ Q" K9 [' I, ]
This method of detection of SoftICE (as well as the following one) is0 r6 f9 A* Q$ i
used by the majority of packers/encryptors found on Internet.' W3 b7 [- A1 n# q+ @
It seeks the signature of BoundsChecker in SoftICE
! ^+ C1 u% A, g
+ P  C3 p& O& [! r: i    mov     ebp, 04243484Bh        ; 'BCHK'
" _7 v2 M* y- m; b, f, X; S    mov     ax, 04h
! L! u2 E1 E9 N) a: s" a    int     3      
3 P" C' e9 D' F8 F! d6 ]    cmp     al,4
( M3 b8 j% m( T, m  s6 _    jnz     SoftICE_Detected
; Q) O. v8 P0 {( v" I) Z) ~3 C/ f) X" f' Q: X& j
___________________________________________________________________________$ Y6 \6 `; [; O) ]: Z5 c6 V, I0 s
1 M& r( Y! S9 |. u1 s
Method 02: A+ ^( c  J( }4 @4 S7 \. W
=========
! D( I( F$ M0 ?4 e5 M& D9 `3 b0 y* F- T" I7 p; F
Still a method very much used (perhaps the most frequent one).  It is used3 r* k' F$ l" x) w8 l& l' o5 j
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,6 y  `  a" r$ s& m. t
or execute SoftICE commands...
% C( n+ l5 j7 G9 N5 u$ x4 YIt is also used to crash SoftICE and to force it to execute any commands% b0 M' n% V$ f( ~% q7 j
(HBOOT...) :-((  3 `) }' Q$ Z9 O% i$ ~; D# N% @
  e# \6 z7 ^5 W+ H; z, r2 l6 |
Here is a quick description:
: V" y) O: P, o6 Q-AX = 0910h   (Display string in SIce windows)
# ]8 ~( E- w' `-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)) H7 B1 R2 Q/ x! s
-AX = 0912h   (Get breakpoint infos)
2 P& A7 Z7 B1 @8 ]: q! V! o-AX = 0913h   (Set Sice breakpoints)
/ M2 J: I. N$ C) W1 K-AX = 0914h   (Remove SIce breakoints)" A' u8 B& U- y' a
! M( T" |8 D/ ^6 m$ M( O
Each time you'll meet this trick, you'll see:5 f7 h8 r1 A2 X. i
-SI = 4647h
% z) Z- i: A' H/ p' d-DI = 4A4Dh4 O6 a, V! P5 ^% M3 {+ w
Which are the 'magic values' used by SoftIce.; h8 D' c$ |: p6 _+ w/ ~
For more informations, see "Ralf Brown Interrupt list" chapter int 03h./ o- m7 A) q. U. t

6 x5 |- r0 j# q& N8 NHere is one example from the file "Haspinst.exe" which is the dongle HASP2 S8 b9 C! M( o. ], r+ u8 [
Envelope utility use to protect DOS applications:
( U8 [! D+ C, O5 j& {; B
5 v% y/ p  R! J9 E  i
% C$ M7 {+ D# D8 o3 E$ m4C19:0095   MOV    AX,0911  ; execute command.0 `4 \! Q8 Z' M+ c4 V3 C
4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
: W' c" z+ o$ k0 W+ e( K4C19:009A   MOV    SI,4647  ; 1st magic value.
( V, b! e7 l' V' O  q4C19:009D   MOV    DI,4A4D  ; 2nd magic value.
! [$ X1 A& y9 L( g: F' P4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
* |# ]# P8 R. H1 W: u4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute
; G/ {! B0 L+ l* I2 c9 i+ N8 B4C19:00A4   INC    CX  Y5 `6 s& a- {
4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute9 E# {2 P* J$ X8 p
4C19:00A8   JB     0095     ; 6 different commands.! w, E0 P0 A) S( m
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.! D: p+ V1 e+ A. i& |
4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)' G& X9 y* Y9 U; f

. T, U6 Y4 K! Q/ K- IThe program will execute 6 different SIce commands located at ds:dx, which$ m- ~/ z8 a5 N8 H) \
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
1 A7 F5 v$ G2 q( d6 I0 B" r+ p9 ]3 Q; H0 H1 U# |5 t) [% A6 u5 @. s) y
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.- t1 c) y' M  Y& ~
___________________________________________________________________________
( K1 _" ]" t2 E
9 l# f9 X( i) d2 m4 b
6 y' \+ [, G( \/ c* Z7 v1 QMethod 03
$ Y# f# A4 y  ]# e! D' V+ W. T=========
8 H+ I& J; E4 z( m- x' _6 a, {* p" `& L2 _' d2 X5 p
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h3 b" W0 l3 @3 @; v. M
(API Get entry point)
5 q7 f6 r1 F, b. j1 F+ Y        9 E  G% H% t( h  p( f2 i! q$ l

7 V. x' [2 |; P6 I    xor     di,di6 d& l; r3 O2 _/ u9 K# z  [
    mov     es,di
4 v4 `' P- t* I3 N- |    mov     ax, 1684h       2 O4 G# }3 A+ d9 p% W  Y
    mov     bx, 0202h       ; VxD ID of winice: o! G* M9 Y$ J) _
    int     2Fh! k5 z1 N: d' c/ Y
    mov     ax, es          ; ES:DI -&gt; VxD API entry point2 n* q+ h$ c% _5 M! y' C: c
    add     ax, di. f) i4 H5 M7 G* M; F& W
    test    ax,ax. s5 r0 `! L- y0 B
    jnz     SoftICE_Detected/ N- \1 g4 f6 b# E  f  t

: ?) C8 [/ `% c3 r  K- I8 q___________________________________________________________________________
3 [- D- s2 K! s( \3 D! _- v0 S  h0 a. ^, N4 [4 d4 j7 B( z1 F
Method 04( h$ d' ~: ]/ M( w* M
=========$ u, r& \1 W6 o  {5 }

! v2 I% J. I4 O! P9 |( RMethod identical to the preceding one except that it seeks the ID of SoftICE0 |+ O: X: R( ^( b' J% A/ g
GFX VxD.
0 U" {0 `- z: G3 g" p+ j& f7 V% c* s1 A( @- q! F/ I
    xor     di,di6 q1 B7 q2 l6 s. F+ v, o; b
    mov     es,di9 w3 |) J8 t+ A# @% W3 p6 h
    mov     ax, 1684h      
& L) u1 v& _/ H& p& v+ @    mov     bx, 7a5Fh       ; VxD ID of SIWVID
) L+ ]5 e. e# z( B8 G" f    int     2fh. _; H  m9 ^+ s' p2 e1 B
    mov     ax, es          ; ES:DI -&gt; VxD API entry point
: D/ M/ _, a8 D: A! j3 ]6 I    add     ax, di$ m, k2 r) `0 f5 W" c1 L: A* H
    test    ax,ax
4 }9 t$ H4 q. I: C+ T1 C  u    jnz     SoftICE_Detected! V7 r" [2 h  ?

( `& U+ b+ P2 g3 ^3 o__________________________________________________________________________, B5 b, ?4 Y3 d1 a

, A+ J9 i# N( u% D! O* N: O# z/ P  _0 b) L! ]- B# X) n3 L
Method 05
3 b- c$ Q  F' N; e$ T/ j4 \% X0 j=========
3 C3 D/ V; q. l$ a4 M9 [" |* W6 W" o8 {5 |
Method seeking the 'magic number' 0F386h returned (in ax) by all system0 R7 I* l2 F  ]9 H
debugger. It calls the int 41h, function 4Fh.
' V1 W! T! S) o3 v8 }There are several alternatives.  
4 w! o1 E7 x* Z& h1 z4 i  ?( I
% B, ~8 ^  [8 O6 Q: |- a4 rThe following one is the simplest:( |# ]: T7 m( M3 U- o6 a
: Y4 E; X' b) e& l& e  u: I
    mov     ax,4fh
) W; y2 N* ?4 k9 V) m$ J2 R    int     41h
. E  n. D3 ?5 H+ r; a2 A: q    cmp     ax, 0F3860 k% y% o; z$ w5 Z+ Z& c  @9 V" f
    jz      SoftICE_detected
# P5 {( d# w7 |
( y# Z6 M, E8 o7 [& {3 G3 y+ @' i* o+ k, A
Next method as well as the following one are 2 examples from Stone's
. a+ L% N, H( }/ S! s3 Q"stn-wid.zip" (www.cracking.net):
+ C1 @/ v/ s* c9 `* Y' ^! Z9 I+ E: `5 ]: B6 s1 c  ^
    mov     bx, cs
9 x; `) Z' @! \/ q1 Y7 |5 [3 p    lea     dx, int41handler22 O) }, z% L9 j
    xchg    dx, es:[41h*4]# [7 I) u* S7 z, x9 Y
    xchg    bx, es:[41h*4+2]
- T  ?3 p* l" ?7 s3 V    mov     ax,4fh' {( H, g2 {- F, S
    int     41h
7 N' C8 v! n; ?# h! t- n2 f3 O    xchg    dx, es:[41h*4]
& @7 b2 y+ G  U8 p    xchg    bx, es:[41h*4+2]
4 N8 W( K! o9 U3 W: {- i    cmp     ax, 0f386h7 o3 i' F( `  H7 f% T- Q
    jz      SoftICE_detected
3 d1 G2 Z5 l6 Z  O3 x. W/ S& y5 z* M5 U9 p* Y; ~
int41handler2 PROC
2 ]5 `8 w8 r3 h: D5 R6 |5 _    iret
7 b, M1 y3 [* z: v% l* N) d1 N+ Eint41handler2 ENDP, v5 n* m+ c) ]0 ^2 e

' {* u% I* Z* _  Y7 f
/ Z0 k) k6 p/ S* B6 R+ H_________________________________________________________________________
6 }9 O" i4 z9 z0 e) V  b3 e8 ]; x  n! }, F, m
  G0 f; @" R# r! v  Z4 K/ h6 k2 {
Method 06
: Q% K3 ?: i" ^3 e) W=========
& }# _7 u8 b& Q4 l% w2 Q
% l; Q  D( u2 ?0 ]% Y; V; r* O. L
2nd method similar to the preceding one but more difficult to detect:
8 [- Y5 M! L8 S4 V) \7 _9 l
$ o& c0 e  ~" \# ]8 Z  v
- f: w, c0 V  {% l3 {int41handler PROC; Q/ D* q, r# X
    mov     cl,al
4 Y' N0 w; |! ^6 c4 t( _    iret" @& U" [, ~; @/ _
int41handler ENDP
, V; h6 l* }2 _1 x2 j+ \8 p8 M* m; [5 V5 E1 Q  D
7 h2 A# t8 G  ^. l: l3 `. b" l
    xor     ax,ax
  p" k4 b- ]! l6 f7 H    mov     es,ax
- s" J. B. o1 Z7 j1 U+ U/ }% d    mov     bx, cs8 f9 i4 v( G: S) O. a
    lea     dx, int41handler
, T! z9 j" {; p8 b6 v/ ^2 Q$ I    xchg    dx, es:[41h*4]3 ~- b  W2 u: e( G( O( E6 o
    xchg    bx, es:[41h*4+2]
4 o8 N; t5 j. T( J7 C  c& J5 ]    in      al, 40h
7 q& ?) S: u& ?6 j: w7 x    xor     cx,cx' q8 Q3 |6 W( h0 n3 x; r( F
    int     41h$ T! R  s+ u' R7 X! r* o% m5 C' j
    xchg    dx, es:[41h*4]
; |+ W) c- Y7 j2 d    xchg    bx, es:[41h*4+2]9 D  ?7 k0 |3 a2 ^
    cmp     cl,al
3 ~2 H/ ~. q0 q+ O    jnz     SoftICE_detected
0 x6 z6 U7 o9 S& {5 j  b% _) t8 O  I; B
_________________________________________________________________________
/ K* f( r% F! D
5 N8 c% {7 h7 X& N- b1 ]Method 07
* C: y: @, W' C3 _7 m/ u8 Q=========
, ?9 G2 B6 k4 w0 T& {) Z; J% {; ^7 c$ G1 i3 @4 Q* ]+ G1 {
Method of detection of the WinICE handler in the int68h (V86)
! W0 o& W. i- j, @$ t  g: p  |3 V9 E* x- _2 F( [/ F
    mov     ah,43h) d# }- x" e0 k0 C( i4 y4 \1 P
    int     68h- [# P) k+ B0 l* I* Z; m
    cmp     ax,0F386h
9 e$ ]- [+ o5 L- b    jz      SoftICE_Detected
' G: H) y3 L% f, W. V, ~! u4 T' c% U! o% S7 v1 p

- a* y& R% e7 ?+ f5 T5 e=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit% X/ ]% s" b2 ]) ^9 G, ?1 Z2 Q
   app like this:
$ ^# X/ o1 s! C* d" B
# ^9 ?  m5 v( ?   BPX exec_int if ax==682 S1 V0 x. ^; A' b0 ]
   (function called is located at byte ptr [ebp+1Dh] and client eip is
! E* r' B' u2 I2 C   located at [ebp+48h] for 32Bit apps), L( Q* l4 a/ x
__________________________________________________________________________
* y7 _5 D5 A5 N, z  `* n* X$ x) r6 g. U& \6 D/ h
* y3 _2 |/ S2 D
Method 08
( j( i, A7 W3 w9 L=========2 r+ Y% x5 h# g
9 k7 b5 _; e4 V) |' Y
It is not a method of detection of SoftICE but a possibility to crash the
+ j- V; u9 y. Z/ v1 Wsystem by intercepting int 01h and int 03h and redirecting them to another
9 {! ^% [* H  l3 z' F4 mroutine.; d! q5 v+ \1 O  I2 d6 U  x% b0 i' Z& @
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
  }; L7 b$ q5 M6 l6 P  s1 B1 fto the new routine to execute (hangs computer...)0 a7 k1 \' {$ H8 q, l% _$ Q
1 m4 [0 `9 y  _  r
    mov     ah, 25h
4 U2 o) a$ {, y' z    mov     al, Int_Number (01h or 03h); J' h' q$ ?4 D
    mov     dx, offset New_Int_Routine
% v1 C9 T& I+ |. }    int     21h# ?! C& N- `4 M; f6 f" o, n
, A  K9 z# d  `. m5 ~3 ~
__________________________________________________________________________. u" k! y" V# u. ]  g

6 b8 K; S; |# y$ M5 AMethod 09
; G. e$ w* O8 e0 z=========9 x, P+ i4 b) I* Q- h, p$ C

# n6 t) _* v" g6 w2 G" uThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
  g" j4 l/ I8 qperformed in ring0 (VxD or a ring3 app using the VxdCall).
3 v, |' J- P! ]- d4 b) BThe Get_DDB service is used to determine whether or not a VxD is installed
) p# I* t' J, |; a# \) q0 w2 {for the specified device and returns a Device Description Block (in ecx) for" L0 S. |( n3 y$ o& `
that device if it is installed.! F% C% m5 _! j* K6 N& E3 t

5 ~6 g1 l( W3 y( o   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID
; s, w& D8 l2 A, W& n) L   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)+ p1 o! B, W1 w. I3 Y
   VMMCall Get_DDB; k# c3 Z( G. p
   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed0 W$ A( s+ B, M. P& A
4 N% o/ v' B7 o( B" c3 S5 a5 X& l
Note as well that you can easily detect this method with SoftICE:$ ?* S. X" F3 b" u
   bpx Get_DDB if ax==0202 || ax==7a5fh
7 c. ^) B* T5 k: M6 w  m+ R; h, ?1 K6 K0 R0 c+ I  l
__________________________________________________________________________
" \3 q* {- R  z  @2 r: P, N' m# M& O9 D
Method 10
2 P& B9 d* t2 X4 e) T1 U=========" c5 d# f- d: O- T( [

6 f8 `5 N* [  h2 Q& e=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with0 b5 I# A4 g, }1 U% u
  SoftICE while the option is enable!!; M% \# g: |1 D3 z+ q9 w0 I# H

- K( g" ~! T$ b; y' LThis trick is very efficient:
' I8 \3 T2 E; r4 z: g% y5 Lby checking the Debug Registers, you can detect if SoftICE is loaded% k0 I7 H# E: j  `$ p6 h& L
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if% l- A) ^' u+ F2 O1 `  P
there are some memory breakpoints set (dr0 to dr3) simply by reading their
6 o( d2 m2 _3 p( S* Lvalue (in ring0 only). Values can be manipulated and or changed as well
. p2 a! p4 [! ?8 ?' W# W(clearing BPMs for instance)
5 v6 i; S; {' }1 w9 n7 q
8 C0 I/ S+ _8 K) F8 d__________________________________________________________________________2 }: I* |" N: j1 y# T
: O8 R2 Y$ Q9 P$ R
Method 11
# A) j* l  u/ [& ~5 _=========
% t9 l4 }8 d5 }5 u' T' ^3 V
  l: ], K" j( W8 JThis method is most known as 'MeltICE' because it has been freely distributed
  u: j; n( M, \6 w' Pvia www.winfiles.com. However it was first used by NuMega people to allow9 Y7 w5 e3 m( w1 U' J  w
Symbol Loader to check if SoftICE was active or not (the code is located! c) U1 R3 ?) E
inside nmtrans.dll).# ~- w9 k# {6 F8 @4 |' M9 i5 ^* M
1 Y5 ]6 n, c8 B( v1 N0 W% f2 k
The way it works is very simple:
0 l% J. V% V" w& @It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
; ?- w1 r. z8 AWinNT) with the CreateFileA API.( i4 C3 P/ G! d

$ K$ ]1 q* B; |$ Q8 o9 b2 @Here is a sample (checking for 'SICE'):) y" a' `. M7 ?0 {
9 m5 x$ i, E4 B* s! ^6 B* o% |8 b
BOOL IsSoftIce95Loaded()
. ?! O% h8 j, a, w8 s8 f{, Y3 i9 w- J; W8 s1 p8 Z, T
   HANDLE hFile;  
# q4 }/ m% W, S) _. I. B/ v   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,6 r9 d. P# q! r1 ]
                      FILE_SHARE_READ | FILE_SHARE_WRITE,
" a' W1 `3 J( C+ |                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
9 \) g. c  v# o" h5 A( O   if( hFile != INVALID_HANDLE_VALUE )" E* o# B! G& m3 C( k
   {
/ l* i' O1 Z4 H' c5 ]      CloseHandle(hFile);/ V2 C& y  X% K% H; Z# Z  j
      return TRUE;
% ]& \9 r' p7 U$ m; @   }" p( e4 @: {" Q
   return FALSE;. v8 P( I* r) `9 _) g! c: I* \
}; h; k3 V9 G  ^$ X! v. m. y
1 n" s" A. J+ j
Although this trick calls the CreateFileA function, don't even expect to be
/ Z2 N8 T) Q; n/ S' \/ Dable to intercept it by installing a IFS hook: it will not work, no way!
0 D* \- t" v4 {* V9 e- o$ J9 gIn fact, after the call to CreateFileA it will get through VWIN32 0x001F% V3 E* S/ X5 m: ^# d
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
% {/ O% c" h. m5 U6 zand then browse the DDB list until it find the VxD and its DDB_Control_Proc
! @: J/ ]' v$ `- rfield.$ i3 G7 l+ ^, W; a. s
In fact, its purpose is not to load/unload VxDs but only to send a ( e! F1 D6 L- e  E1 F3 ]
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)3 Z. r" f; o9 L/ |, j; U
to the VxD Control_Dispatch proc (how the hell a shareware soft could try/ Y4 X( d: k* ^3 D3 z
to load/unload a non-dynamically loadable driver such as SoftICE ;-).7 b% C/ }  d' I- i" p  I
If the VxD is loaded, it will always clear eax and the Carry flag to allow6 ~" A6 W. [5 I/ l! F2 N! k
its handle to be opened and then, will be detected.( k. u+ }2 C: W
You can check that simply by hooking Winice.exe control proc entry point
1 q  V5 X, _$ C. @. nwhile running MeltICE.
! j; F* I4 ]  f8 |
6 ]# L' L" Z4 s3 H+ f1 l( n1 q
( j$ J3 e# m+ N- D  00401067:  push      00402025    ; \\.\SICE, h% S4 T* h; L
  0040106C:  call      CreateFileA9 Z) s! i4 X% S6 s1 y
  00401071:  cmp       eax,-001
7 u3 U8 R3 l3 B# ^9 |+ N" \  00401074:  je        00401091
5 \- r6 k$ h8 \$ E" Q" E/ f0 h" K; K& A! K3 p# \+ W

" I7 U2 f6 M' K, ~1 j6 E' XThere could be hundreds of BPX you could use to detect this trick.
* f0 d; U, }+ @4 o7 x- P( Z- o% U" I-The most classical one is:
, a1 f' r5 p5 `3 W: T7 w8 {  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
% o( D- ]3 _( p, R    *(esp-&gt;4+4)=='NTIC'
* U) [/ V# G3 f0 U  D! p
3 G5 X5 Q. q1 \( l/ v6 s) J-The most exotic ones (could be very slooooow :-(
6 s& q" c4 ~1 H% h% [   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  
; t# }% G; ~% K% X! t     ;will break 3 times :-(
. j% T. f2 X, u) ?1 f1 _) s) |' T3 j4 J  G4 q7 p, t
-or (a bit) faster:
2 Q4 T9 ~  v+ o! s   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')& C1 q' v, e% P- d# Q' B5 {

/ N) v: Q' f/ Z. E5 h9 w   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  
; }6 l! G0 b) n( |" h# {/ f     ;will break 3 times :-(/ B3 R6 ^8 K3 H

: ]: X' g% R. f0 \1 S-Much faster:
) ]  \* u* u% w+ Z; o* X1 {/ F7 w   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'
+ w7 X2 r) d1 ?
8 R8 e. _: |+ S+ M  HNote also that some programs (like AZPR3.00) use de old 16-bit _lopen* T" Q  ?# Q0 m9 c, E4 c/ s. B
function to do the same job:1 V* y- K0 [( A
8 B3 _- T0 N9 _5 F7 R. M
   push    00                        ; OF_READ
) |& N: ]: G! }; i- Y   mov     eax,[00656634]            ; '\\.\SICE',0
: I* M% G4 e; d: U1 `   push    eax
5 e# q! a. _" s8 Y   call    KERNEL32!_lopen
5 X* b$ `* A5 I6 ?   inc     eax/ s9 T) S- b1 P1 F
   jnz     00650589                  ; detected
9 W+ i; f: d8 z4 d, w   push    00                        ; OF_READ8 T" z% k. n  U+ [- M0 N
   mov     eax,[00656638]            ; '\\.\SICE'
7 C5 C+ }! d# `, j" W   push    eax0 P5 _/ c" j: Y0 A: V. {) S
   call    KERNEL32!_lopen
' b: Y/ j  \& d( T9 Y   inc     eax- o7 \+ v: s, G1 O
   jz      006505ae                  ; not detected
* t5 {2 R$ z/ h: w/ f& v  h4 S& }4 p
: d0 ]7 V4 \9 N" E2 ^
__________________________________________________________________________/ i3 n6 d0 y0 h1 T

% A, U2 T+ u4 _9 [. e/ |Method 12* T$ N- C* i) q+ G; T+ Y
=========
% B' W& [  g4 v) a) r4 [
3 k# R4 h' p8 O0 jThis trick is similar to int41h/4fh Debugger installation check (code 05! x/ _3 x# B$ C% E- R. a- h0 s
&amp; 06) but very limited because it's only available for Win95/98 (not NT)
7 S9 D  r4 j  @3 t6 a$ Gas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
) F& u+ v' E2 K+ [; Y9 D6 P0 X7 {! R) O7 m, y4 t; B& @
   push  0000004fh         ; function 4fh
/ r( K, j6 S+ X# v0 _6 T   push  002a002ah         ; high word specifies which VxD (VWIN32)
- T6 \) C: {' B) W/ Q0 B' i                           ; low word specifies which service
8 U/ @' @4 `* _  F) l                             (VWIN32_Int41Dispatch)- Z- y% P7 J) Z* D
   call  Kernel32!ORD_001  ; VxdCall2 N* ?/ L& [' s$ Q% P0 P+ D9 @
   cmp   ax, 0f386h        ; magic number returned by system debuggers
4 U' }6 k5 i( d$ A  N   jz    SoftICE_detected
" O; K5 q9 z) f+ r: n0 b
+ E* M: A% R2 A: V7 ^/ [Here again, several ways to detect it:
+ u' E4 A7 f: c6 b1 ^* k2 s/ d: O# [: a
    BPINT 41 if ax==4f
1 F7 I* r6 X1 ^6 y: r
2 A7 f/ ?: ]* c    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one
( k3 U5 P8 L7 E) d  e# n( R
4 Q6 f% L  l& f4 B    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
0 m9 A. y8 k9 S9 z2 J
) R5 \, N& _6 M/ q: v6 A0 X7 K6 _    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!2 ]3 k. {( s: _9 H+ i7 i
3 @' A% E  b" a1 t! V' G; U
__________________________________________________________________________
; ]: \2 H4 W  U# a& G$ h
+ Y1 o2 k; P0 D$ ~( eMethod 13
: b: K. p$ P$ y4 ^, q=========
7 g& s9 w$ z  ]4 y/ L4 K9 s# a5 T5 ^6 v& D0 e  y3 Y
Not a real method of detection, but a good way to know if SoftICE is# d( H1 G. p* g% y
installed on a computer and to locate its installation directory.
. p# h/ {; i$ }" @0 u, T& H5 NIt is used by few softs which access the following registry keys (usually #2) :
* a) g/ p$ U# m/ p. r
; V4 f3 v  V% V: b- }+ ]5 u$ D  _-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
1 b4 G( @7 G3 k\Uninstall\SoftICE
0 \* w/ R, i' ^" _; }$ v$ D8 ^-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
0 N2 z/ @: @2 z) s2 K3 \-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
0 Q1 i6 T# D- _\App Paths\Loader32.Exe
2 O1 U1 r! F4 o7 q7 K: z2 f: x
- E' h3 M. j. a# H2 E" n& V. e" |* A: X# q
Note that some nasty apps could then erase all files from SoftICE directory3 Z: c5 q! _) \1 Q3 e; F2 W, n( X
(I faced that once :-(
+ o9 A& q1 v# y3 C
7 A" f' \1 [* V) g2 V# j; H, C7 SUseful breakpoint to detect it:' X0 n" j- e: O7 a* C5 V
4 _1 C8 |, [- Z; Q2 L6 D
     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
2 D  E* p6 J" B  @
( R6 Z+ w) X: {0 P& N__________________________________________________________________________
9 O+ p0 _4 a, f; p7 }4 A2 c$ Q, m0 C" n3 j2 f3 [. j
) s$ n! Z! u2 n+ v; l5 b/ T
Method 14 : `5 f3 D% g$ c6 i  q) Q! Y
=========6 i& W( M( V5 z5 A  `5 [+ g8 O: y

5 }8 w  ?+ `6 z; ]A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
2 _' I- E4 h8 qis to determines whether a debugger is running on your system (ring0 only).
* E: z, W+ l$ W5 r. r+ I% Z4 O. c/ a2 Z( H# J3 P0 {9 U
   VMMCall Test_Debug_Installed- B! g6 _- u4 b; ~* M. E
   je      not_installed
$ F  @- w; W8 w
( G5 [3 C- c0 rThis service just checks a flag.
6 b5 V* Q) }; ?7 A</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关注公众号

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

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

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