About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>/ w5 g0 ^. i3 P3 ]& \
<TBODY>
0 O9 Q- T1 x9 y) a/ J<TR>/ e3 t, c8 D/ D& \1 i) `
<TD><PRE>Method 01
1 X. U, H) d) d0 _0 }. E8 l=========
+ |% n- I& [! h( X5 K
3 J( E6 A7 F4 ~; ?) Y/ Y: DThis method of detection of SoftICE (as well as the following one) is
7 s% B( z) ^4 Z4 ^1 A6 N! K; L$ aused by the majority of packers/encryptors found on Internet.: q# s, [  h8 |8 ?2 F
It seeks the signature of BoundsChecker in SoftICE
: m" J% J1 W. [/ p4 r3 u. f% w3 t4 `: k/ R- I0 }/ {% e
    mov     ebp, 04243484Bh        ; 'BCHK'+ K  @! \5 G& V+ w- S; ?: u9 O
    mov     ax, 04h5 |7 \4 j: F8 @; U% a
    int     3       8 ?' {2 g* U4 }# D1 ^
    cmp     al,4! A# ~9 I% L. E7 G" h. G  G
    jnz     SoftICE_Detected
9 e* Y" ^5 t' K0 ^) t" r: w" C3 k& ^0 A0 z* q: v
___________________________________________________________________________
% T3 @5 i/ r8 _" \0 K8 S# N0 ^+ t. R! M( ]% j+ u1 h5 _
Method 02
. e; G  J% P0 Z, l; j! C=========; Q7 i) v7 h) G4 y
  F* Q8 i) w2 n0 V/ v( U. q
Still a method very much used (perhaps the most frequent one).  It is used
' N3 S2 e# T4 S' Lto get SoftICE 'Back Door commands' which gives infos on Breakpoints,( O- P, Z$ T% j  Z
or execute SoftICE commands...
: h' d- [  |5 I" \" w/ pIt is also used to crash SoftICE and to force it to execute any commands2 }  u5 D8 d( ^( {4 t
(HBOOT...) :-((  
, s& y: r  P7 I8 ^" c) R) u0 C3 n! s+ y- s/ o& f; K" v9 \5 M
Here is a quick description:: S7 ?% \' @' z' H9 S' ]
-AX = 0910h   (Display string in SIce windows)
$ n" m! H; W7 [1 y" `5 Z/ S-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)
$ A! B' o, e7 h0 l7 @-AX = 0912h   (Get breakpoint infos)
" w9 C# D2 A) Y0 i-AX = 0913h   (Set Sice breakpoints)
3 W; r+ W; Z- I) Y, O) y-AX = 0914h   (Remove SIce breakoints)
# f7 H  I) n# u: u7 T0 Z3 ]
0 N4 n. t1 }, o% e8 b% _Each time you'll meet this trick, you'll see:  l& a/ X3 `& Z6 F- [: x( K
-SI = 4647h
3 f6 m" T) b( f-DI = 4A4Dh7 M: A- p; S4 v: w: {* [( s
Which are the 'magic values' used by SoftIce.
6 N, M- m% @  H& |  {; u) p* ?For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
/ ~1 ~0 B% Q# B4 S- a, X! A
. `; U+ Z% U+ L% Z5 C, h5 c1 zHere is one example from the file "Haspinst.exe" which is the dongle HASP* {* h5 _" H, n
Envelope utility use to protect DOS applications:' c3 J+ Q0 L, R" h9 Z) ~0 K+ k

' C2 Z  v* i* \$ T# q( ~+ k* u  z% Q; R* H' J; K' H! s+ T
4C19:0095   MOV    AX,0911  ; execute command.: g- L2 y0 k$ \+ R: e6 j) M
4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below)." I6 L: d, x* {, s" \" q. a' K9 Z0 ]2 l
4C19:009A   MOV    SI,4647  ; 1st magic value.4 Y" g+ ~( w, u( j& g0 y
4C19:009D   MOV    DI,4A4D  ; 2nd magic value.. o$ |$ _3 Z# a! N+ r6 @( D5 k
4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
5 Q/ q8 d$ Q" T. S4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute& P+ P) i& c4 v# r
4C19:00A4   INC    CX
- [' {1 X- X" ?4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute7 I! \& C5 x9 J3 H: a  t! ~
4C19:00A8   JB     0095     ; 6 different commands.# ~! m  l% G; r# A$ x7 l
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
2 Q2 b- u+ {  Q3 d1 u, o4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)
- Z  s4 t9 G# I* o7 V+ a8 D/ M4 h" t8 Y" g$ Z! u
The program will execute 6 different SIce commands located at ds:dx, which
8 O* i5 a, e' {+ J  \% sare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
/ \; S$ w* v; w4 d
4 ]% Q& p) ^8 r9 M* r+ W* [' U* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
$ _& C  c8 t4 s4 y- K( e! h& G5 \___________________________________________________________________________
: I. A, h, w2 x: K% ~; l  P/ l# U; c

4 |1 b! i. R  x! W0 S! |7 }4 [$ S* t1 yMethod 03, a# ]' D6 |" P0 @. S5 c
=========
3 x7 S: d0 Z4 k# w$ r/ e4 N& G; s0 @  Y- G
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h4 ]# f; m: P. S* Z8 V) E3 T
(API Get entry point)9 A' b) M6 H5 H3 R( o% H( E" \! n
        
; E/ Z8 c/ l0 A
' q. A$ O- J/ i. p/ M5 x- |    xor     di,di
- q- @, l. |- G3 V    mov     es,di5 E1 |9 W/ [$ U8 d& H; w$ e( ~
    mov     ax, 1684h       ! z, ^( L- r( R# b% K2 N
    mov     bx, 0202h       ; VxD ID of winice. P' q, }" O, ~8 Z/ N
    int     2Fh
, @' W7 I3 ^! p6 _    mov     ax, es          ; ES:DI -&gt; VxD API entry point2 |) s$ T0 Y% a) D# i- Z
    add     ax, di
9 D3 ~) E' S% _+ B    test    ax,ax
) I3 R* }9 W6 a    jnz     SoftICE_Detected
( A' F# B/ K' R; W2 @8 _, @$ t  @' D
___________________________________________________________________________
0 w( T$ N/ b7 P7 \8 y% i9 |8 x" r5 ]  m5 N' G/ \2 p6 `' D
Method 045 H* z1 |8 ^4 K6 X+ T
=========. e* p- z6 N6 P; O% H' O' V

! Z. M( p* V2 z" IMethod identical to the preceding one except that it seeks the ID of SoftICE1 J1 O5 s/ E" }: t
GFX VxD./ c1 a0 l5 w0 ]
1 A. \* D% @* {6 w* l; f
    xor     di,di
& g) v. t( T3 r  z' f$ P" r. i% ^    mov     es,di% q9 }. O3 b+ R5 A. t, b' V* u8 C
    mov     ax, 1684h      
, Y/ n$ H9 s- k/ R6 c    mov     bx, 7a5Fh       ; VxD ID of SIWVID
% _) [) P5 `& w8 ]# K1 m/ o4 m3 X    int     2fh( L' E& l2 N+ o/ n; b/ U' ~
    mov     ax, es          ; ES:DI -&gt; VxD API entry point. H2 W) i3 e8 G( z
    add     ax, di! u) F4 S% H- p% I! B' c0 T
    test    ax,ax, g5 K  j+ C: H
    jnz     SoftICE_Detected3 q6 L- X$ e3 G+ t
$ Q6 r3 k7 l& C1 d  s
__________________________________________________________________________
% j9 i: W) b4 Q, \1 {6 _! v0 @) C: U- n

6 Z  _' s5 x; F& c. j4 z( TMethod 055 u$ x. L' x8 K' f
=========8 V9 K, I+ R: ?
* g! u1 P4 A3 h2 t) q
Method seeking the 'magic number' 0F386h returned (in ax) by all system* A1 h: @) r$ V' Y7 L
debugger. It calls the int 41h, function 4Fh.
0 X" h1 R* Y" Y6 m5 vThere are several alternatives.  6 f" M/ Y& S" R3 |' s

0 q  X  h0 O) Y# }6 x. LThe following one is the simplest:& p4 `2 a% l( K2 j
" I2 N% a: f% G* J
    mov     ax,4fh# e- R" c- r+ e: T
    int     41h
4 k, _- O: E  d( X    cmp     ax, 0F386
( O; z$ C4 u; {( l2 l    jz      SoftICE_detected
0 o' d; E- s6 G8 B% d, H+ c, `7 T: R. h6 @4 ]
% t# S- O  G( j' t; j1 L8 |
Next method as well as the following one are 2 examples from Stone's
2 n6 p1 n! g1 j" b"stn-wid.zip" (www.cracking.net):7 a& @2 s+ G! a/ Z& U: F6 K

# R& n$ i/ s( S4 B. R, V, F    mov     bx, cs) R& @% L0 ]1 D& o
    lea     dx, int41handler2& I' {/ [( u1 H; ?
    xchg    dx, es:[41h*4]
% M" b7 y- b" L; L4 U( Y3 g. o    xchg    bx, es:[41h*4+2]
2 ?3 V2 z0 y. \9 n2 I/ Z0 n    mov     ax,4fh$ O0 ?! [% @7 h7 ?- ~" n1 `5 ^# L
    int     41h
6 O3 T, i6 _' U, T3 l& k    xchg    dx, es:[41h*4]
9 H2 Y5 ]; @$ W) n    xchg    bx, es:[41h*4+2]
" r! m7 j0 x0 f. g+ `8 H2 K    cmp     ax, 0f386h
8 I) _1 r4 D- e+ ?2 ?# {    jz      SoftICE_detected
; r  g# [( o0 }  H; {
; C* y1 N, u" Q+ Oint41handler2 PROC
9 m2 I* w% w8 x8 Z0 z" U    iret4 {6 W/ _: `$ |$ Z& U  U% S# E4 i) ]
int41handler2 ENDP- Q; Z1 @5 {( w$ s
( q' [: S' \6 ?
9 ?5 k5 f, i( |4 K6 L
_________________________________________________________________________
3 A# }& L/ X: V2 A/ m4 a
8 M; s! @% n6 [
& ?2 u2 X# ?& J2 {7 ^' qMethod 064 U2 h$ G6 t' c1 O1 H$ J
=========
# o- f% @/ |3 ~) H6 Y9 X* z
& M) Z7 Y+ x1 r( I7 u3 j9 y" s7 W# |3 g; l. y7 _
2nd method similar to the preceding one but more difficult to detect:0 x& s  d% y. e) G% ~  l; b
8 w$ n0 D- A  w9 H6 E4 D2 a& t
) L" B# }, N: f4 k3 ]
int41handler PROC
6 N6 o- ]) X4 U. c+ R    mov     cl,al
7 j* A2 d, X( e! y- ?# f    iret
5 b1 V2 h4 Y8 Y0 zint41handler ENDP( l6 u) O0 o/ A4 p" z7 B  y1 h
. [& x; u+ H9 ~5 W$ ?

! q9 [* V# a( Z; _7 m    xor     ax,ax: @, n) D4 {( P) y/ `
    mov     es,ax/ Z4 L7 F/ _. w0 ^% p
    mov     bx, cs9 }9 f' |$ U5 p9 P5 r
    lea     dx, int41handler; V. |6 C5 g, Y2 w( o. R' h- ~
    xchg    dx, es:[41h*4]
9 g, H2 Q' f7 ^' a& `    xchg    bx, es:[41h*4+2]' F5 _  V) Q$ l3 _' D
    in      al, 40h/ N+ c# c: r9 S7 G5 x4 U
    xor     cx,cx  ?+ W5 K2 }- L/ Z5 r/ p# e+ M
    int     41h
$ q2 d/ Q) u) Y5 u0 \    xchg    dx, es:[41h*4]
& A4 C. K6 \& q. J: O    xchg    bx, es:[41h*4+2]
: d( y: y. Z, i    cmp     cl,al
' Q0 c, k* y# b  K. U" V( C& n* }    jnz     SoftICE_detected
9 m! h- `7 |) e( }! d* x6 B, I: h5 Q1 H; [/ r6 J
_________________________________________________________________________
# ?9 \9 B. {. w) F' X* V7 \" ?3 q" f% P
Method 07
  g! |! D( w, L, T=========6 s+ j2 i- {0 U9 U& W8 R
1 w# ~, b6 r. V
Method of detection of the WinICE handler in the int68h (V86)2 W8 c' ~  n8 J+ I: U

3 D) w2 W  Y: T    mov     ah,43h
+ d0 C* j3 N: q- e: O    int     68h
# M, H7 U  ?7 C& O, s    cmp     ax,0F386h
. V  w8 @( p7 s: _. y) y' e    jz      SoftICE_Detected
5 y/ [, Q& Z; K+ G: @7 a! ?( F% D

5 _& p* p, [. T( i; ^=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
' R$ I( f9 K6 `; i   app like this:
7 }) b+ e- [7 j
! J- V. A, [3 [& ^( c9 n- T) g$ F   BPX exec_int if ax==682 R! U! o) k" D4 a
   (function called is located at byte ptr [ebp+1Dh] and client eip is* S8 {4 ], j4 |& b0 Z, h
   located at [ebp+48h] for 32Bit apps)0 X) D/ I3 |3 o9 b; l7 I
__________________________________________________________________________& u; O2 Y: B3 o. E0 O) y6 t
! ?% W4 {3 b' x2 a
5 g) @5 c+ K) v) \- f0 N
Method 08
! x) _8 W: o/ d6 j=========
) U8 `" t3 U+ }/ F& e8 `# `( {3 m% g6 a2 P
It is not a method of detection of SoftICE but a possibility to crash the( f) H, |8 d2 m* ~$ [- d
system by intercepting int 01h and int 03h and redirecting them to another
. I! l$ e2 ?3 J, w7 X; C/ troutine.
$ \1 x: z( e) w% xIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points' \4 X9 l" V- S3 y0 W
to the new routine to execute (hangs computer...)( q) a+ M$ x7 k& ~- j
$ a7 R! ]2 y( S. l
    mov     ah, 25h$ m7 W3 g+ X( y0 F2 A; V4 O* P" D
    mov     al, Int_Number (01h or 03h)+ I* J  p5 A; a1 G! f; c
    mov     dx, offset New_Int_Routine4 a0 R- i% A- v
    int     21h
6 q, a# r4 E$ @0 x# Q& @; K  V" [
8 C, N. q9 c& a5 m& i6 U__________________________________________________________________________% A/ }0 U; g  x* _( p5 J% J

- _$ d! ^7 E0 w2 ?% T1 I9 m+ j9 AMethod 09
$ h  M$ h. y: `+ e3 P=========9 G) B6 i; O( F4 N( Z# o

, F. o& O- f8 B9 ]. cThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
9 t. l, v2 V# q5 cperformed in ring0 (VxD or a ring3 app using the VxdCall).2 c$ s: p8 c# S, y/ f& A
The Get_DDB service is used to determine whether or not a VxD is installed5 D# k7 Q* V- N; \
for the specified device and returns a Device Description Block (in ecx) for# B  f% A' t/ F4 C: @+ @  f& t
that device if it is installed.; X& J% u3 u% z
! S& v  o& T7 O& F9 y
   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID
& V) @2 W  z2 C   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
8 i; z+ Q4 {9 Y# x   VMMCall Get_DDB
. l/ C& [( Z- Q- f2 T' ^   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed/ D. B$ i8 J& Q

8 R4 |0 B/ I" ?  d% h" QNote as well that you can easily detect this method with SoftICE:2 W5 A9 U( D, c0 o
   bpx Get_DDB if ax==0202 || ax==7a5fh& O4 d2 `  s0 E- `
, Q* i, T) R* S1 C& _8 Y5 l" D
__________________________________________________________________________
( y- m8 b4 K, T% P4 A: E3 [! r/ h$ v- r+ O1 M0 A/ ]
Method 10& E. X) y4 z5 F" |3 b
=========
5 f1 d  A& v+ R7 _+ s% |) P( V
" x5 h8 e: {" S& w( j=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with6 K& q* Q$ c' d& ]5 U
  SoftICE while the option is enable!!
- H+ K# q, \# {& B! o
: u7 J7 X* l0 x: IThis trick is very efficient:
  S/ Y1 {  q+ ^0 T- Q. Qby checking the Debug Registers, you can detect if SoftICE is loaded6 O# J3 ^' A  O( \
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if' S. v+ D8 d9 J( o. T
there are some memory breakpoints set (dr0 to dr3) simply by reading their
3 r" P2 U; ~# ?% a3 F. O6 H6 ?& Z  F( yvalue (in ring0 only). Values can be manipulated and or changed as well
) s$ X1 f# c+ Z! s4 e(clearing BPMs for instance)+ j5 O! q- n! r

* N/ G% F, q& ]; s5 T* d* C__________________________________________________________________________1 f& A5 j- ?+ X
2 {  A+ C! u, u
Method 114 G7 {- s& q0 S  E0 `
=========
( x  h: ~2 s0 B$ a( H9 N, M
5 F/ m+ D6 u4 T  Y# T& HThis method is most known as 'MeltICE' because it has been freely distributed
' H! p, ^) h& B$ P6 e7 lvia www.winfiles.com. However it was first used by NuMega people to allow
# t: w. S2 x$ aSymbol Loader to check if SoftICE was active or not (the code is located
# Z7 e7 ~+ m, l8 Minside nmtrans.dll).) m" s6 r3 h+ x9 E' E
/ ~4 f! Q  H0 C$ @7 T2 e! n3 ?5 ]
The way it works is very simple:
# K: n( ]8 R1 b+ B3 OIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
7 r; ?" G* S+ R$ B$ n& n8 v3 @, GWinNT) with the CreateFileA API.% Y+ ]8 m3 n5 r( Y" L. G5 f

5 s- D# r0 |5 p9 M. j# u2 D* dHere is a sample (checking for 'SICE'):
3 P" E9 {' o1 ]- F5 v3 g4 i( |* A, X, I" ~7 v. @
BOOL IsSoftIce95Loaded()& @  N* n3 h, R
{! q+ U1 A% ?" B" U8 P
   HANDLE hFile;  9 I, {9 }9 \- P# h7 J
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,, `% i: ?2 ?7 V: K" ~" Z* y' |
                      FILE_SHARE_READ | FILE_SHARE_WRITE,7 V1 P, i+ O1 c7 Z+ r; l
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);0 t( o' z8 T: E0 c* Z" ?
   if( hFile != INVALID_HANDLE_VALUE )6 d* A) a3 a" C6 ~
   {
( h& I9 p" @  ?$ o      CloseHandle(hFile);5 [+ A2 j8 \4 e# z( c5 I/ E2 v( X5 V
      return TRUE;
! y0 m" w8 n% O   }
4 N' b0 E& _/ p3 B, P   return FALSE;; C; K/ U9 O+ B: B
}" ^) C8 K5 I+ ], k

$ n4 Z" @; X6 X% `5 N; xAlthough this trick calls the CreateFileA function, don't even expect to be
& S+ J) z1 ~* \* h5 F* {able to intercept it by installing a IFS hook: it will not work, no way!& S* Z# Z7 N2 y- \* }
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
4 u/ i9 L& @; h8 s% o6 x% {9 S2 Gservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)& W, j# L" X+ U) F
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
/ F0 s! x6 q' f+ v1 Afield.0 \' ^# Y1 q% i: o0 O, V- d/ _
In fact, its purpose is not to load/unload VxDs but only to send a - Z; x9 V% K: g" W9 K
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
, {! Q' V/ C; A6 p4 ato the VxD Control_Dispatch proc (how the hell a shareware soft could try, \/ z) j; ~/ N! c9 `' H
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
  L( S7 O1 c9 z( I  EIf the VxD is loaded, it will always clear eax and the Carry flag to allow5 Y, D' a- m5 j3 ^: d' Z- }
its handle to be opened and then, will be detected.
$ T0 p" h6 J: h, L1 E: Q0 CYou can check that simply by hooking Winice.exe control proc entry point# N9 c1 F, O: H" G! }( u* O- ?
while running MeltICE.5 ~# n  s, U; l- f% k9 P( ^

8 {9 q: w- P& A, x* p9 n/ \; b
  00401067:  push      00402025    ; \\.\SICE$ }% x* K- J* I* o3 ^) ?
  0040106C:  call      CreateFileA8 b- t% O% ?! }" |
  00401071:  cmp       eax,-001
0 O- Q4 ~, ^" J$ j. |. ~/ Y; R$ }8 w  00401074:  je        00401091
- i3 G( y0 r% a$ B- t, O3 D8 t
% y: h; q" M* z# b8 u8 C+ _, P: U- q7 e; ]- `% d* A! @
There could be hundreds of BPX you could use to detect this trick.
2 N# r4 z+ l* N6 U-The most classical one is:5 f7 l0 Y( X& x9 j3 j: G
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||6 i, ]9 u# J) W9 b$ Q
    *(esp-&gt;4+4)=='NTIC'
. k% ]$ x' S6 e' P; K8 Z8 w1 h: v
7 X3 X/ e. a, ]  i0 [4 l' k-The most exotic ones (could be very slooooow :-(
, s6 S: C- l5 z" z( W. m$ ?   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  
4 q6 }) ^% P8 F) h0 Q  z     ;will break 3 times :-(
4 T4 \7 O  {6 \& n
. h" L. o- [# N! H-or (a bit) faster: ; w3 X4 M8 [& G& R
   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')$ \  u/ I- M& l; P  g% v

. f- C: j7 W, Y6 r7 n5 W( h. C   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  9 }1 Q% O2 l% E) t# r
     ;will break 3 times :-(( J" q- h. z# O% `/ F3 L  |- W1 C

( d4 C/ f8 e) R$ x% F9 w/ [-Much faster:2 G& h# o2 j% t! i% H8 a
   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'3 ^7 B) A5 ]% M; _4 |3 Q" j& l
, [) v5 P) v0 M' c. e9 }! e! Y
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
( I1 z# V- q- ~' H/ m7 u6 jfunction to do the same job:* E0 M5 x: h& |8 J, C2 e
4 s: q- R) r# h" L# q: e, a0 U
   push    00                        ; OF_READ
' o$ P. F8 j+ G- G  T   mov     eax,[00656634]            ; '\\.\SICE',0
4 K' e0 B- P% V   push    eax
1 i/ A: O$ K+ n   call    KERNEL32!_lopen
% j. q0 c. _0 n   inc     eax
) f% f/ o0 _$ l4 i4 h, W3 k   jnz     00650589                  ; detected
$ z" y. F4 K( ^" ?   push    00                        ; OF_READ
  y, B& k! W- t$ H2 ~7 m/ e& E% x   mov     eax,[00656638]            ; '\\.\SICE'" p. u: S; N8 c. e4 w
   push    eax
* P# E/ S: \5 ~2 A  U8 \   call    KERNEL32!_lopen
- i4 k6 F0 }) F/ s. d8 W   inc     eax: c. b% \+ A, t) J2 m2 c" o: _
   jz      006505ae                  ; not detected
0 B9 W0 R* n( k& u; k
# [% b& x4 o: `" X; {/ ~/ Q5 N! g$ x% h
__________________________________________________________________________6 S' P) M) Q2 _. a1 V6 s

, P4 ?) L% L; ?1 |9 A2 `8 TMethod 12
0 b8 \, \  {3 p0 W9 l0 e( v  G5 N=========
* I. `- n/ U' m- \( f! e% H
2 F' l3 b! u6 y( jThis trick is similar to int41h/4fh Debugger installation check (code 05) I/ z. \' ^) Z4 V* f
&amp; 06) but very limited because it's only available for Win95/98 (not NT)
, K" i& ]+ i, e7 W1 `1 Nas it uses the VxDCall backdoor. This detection was found in Bleem Demo.* E7 e5 A. a6 z

# M$ l: _, g8 d& _+ ~   push  0000004fh         ; function 4fh
' k% ]9 O4 b$ K, s: w2 n   push  002a002ah         ; high word specifies which VxD (VWIN32)! z7 `9 ^! D( ?* f5 _
                           ; low word specifies which service' t- m6 s" Q  t6 d& P
                             (VWIN32_Int41Dispatch)
6 E! T8 `6 x1 r3 N6 M   call  Kernel32!ORD_001  ; VxdCall! E' i1 E4 m( K/ U* {# c- \* X* m
   cmp   ax, 0f386h        ; magic number returned by system debuggers4 |* S7 C1 a7 m/ y4 S7 H
   jz    SoftICE_detected  C" x3 S& X1 D! f1 r  I) l

6 B. g4 \- m2 A3 _7 t1 CHere again, several ways to detect it:
! V- {2 T1 I1 R) i
4 T' d. \8 _8 v6 ?9 J    BPINT 41 if ax==4f9 |2 E8 L- x& l" J

' D1 g1 o; R) `9 x- e    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one
& z* W8 u( _' W7 G
0 c# v2 _. @% q" C+ q    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
, U) w4 |+ W2 |4 o  B) _
% u: H$ h/ H2 M  a7 E    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!
2 ?$ J) L1 c9 E1 V! w. |% X/ p  k5 ^! s0 H, ~" l. M6 w% p8 F
__________________________________________________________________________
0 |4 ^6 H1 x" T! z, f" N9 I% r* z3 H8 Q9 c" F
Method 13
4 c$ Y6 m( k! Y( n, q0 x=========  Q& S- N& {1 r9 a% g

0 G; a0 j. o+ ]% v" NNot a real method of detection, but a good way to know if SoftICE is# E$ w2 g1 ?1 N  }
installed on a computer and to locate its installation directory." V3 L0 j' X. l/ d2 r/ Z* q) {
It is used by few softs which access the following registry keys (usually #2) :
+ ^7 ^5 d; ]2 Z& e* y: P" p/ L) z' h2 V0 N6 q  k- Q
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
1 \0 a3 P* m' b  M4 m: F\Uninstall\SoftICE6 F9 X1 y3 d' T4 @0 r
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
& q3 I- _0 }# S' A& {2 {-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
4 @4 Q( }! \/ d6 [. |; t\App Paths\Loader32.Exe$ g9 c6 z9 V' g- d4 ], U9 c% v% d- H

0 i! w# i4 Y4 e" O  g: @6 I
' _" @9 C5 t% p" ^+ nNote that some nasty apps could then erase all files from SoftICE directory; p3 Q5 Z1 E/ X" n3 O6 c
(I faced that once :-(! ?, u& K, P3 {; w4 e7 F
  @) z0 o7 o, Z- }) m$ r/ e
Useful breakpoint to detect it:
( R5 _7 D  l% V
% c7 R! o6 i, W+ \3 e6 a' C     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
( {% V# P8 |' R! H/ k& }' ]% m2 W# w# R2 z4 @+ e* @
__________________________________________________________________________
% h5 V3 [  d" h- X7 _- p2 F; Z7 K1 M
9 k5 S# J. s; P7 k9 N5 g( ^
Method 14
7 |, s1 W6 @/ B+ U6 X, M# F5 o2 _=========. b# H& c' m5 T" g  T0 o' [  ^

, z! _( o1 {) i% e' sA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose6 y- w; i2 X# P. N
is to determines whether a debugger is running on your system (ring0 only).
% J# P- t8 a+ }; M% _1 Y7 r9 l! Y& `+ `& ?( n+ x8 c! [
   VMMCall Test_Debug_Installed: K, ~& U) T) \) T8 d6 f' `. A
   je      not_installed( B/ ~2 X! u' \2 U% D9 Q& o

6 I: K- [' N$ c( ]! |) e" {This service just checks a flag.: l9 ~6 |. ^' O  y# F+ ?3 j
</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关注公众号

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

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

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