About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>, c! e+ h9 v9 D0 l
<TBODY>- j* T- i) ], Z( \. g  t2 q1 ~
<TR>
& k5 B0 y; s: p8 L7 l8 k( A. C<TD><PRE>Method 01
6 E1 z" v0 c3 g/ {/ Z, t* c, c=========% V& o+ w; z) G0 x. W- S
) B' B% B& u1 e
This method of detection of SoftICE (as well as the following one) is( U0 d. [2 D8 V' k0 F' G" e( ~: {
used by the majority of packers/encryptors found on Internet.
$ n: w1 {9 t* c+ L) ?It seeks the signature of BoundsChecker in SoftICE9 M$ k; Z8 X* ~. k7 T  F. R# e1 h

, d1 V- k) f4 f% m- P8 a    mov     ebp, 04243484Bh        ; 'BCHK'/ x1 Y9 z% u7 c% C9 I2 U/ J1 T
    mov     ax, 04h
  b( l, M. i9 B; }! z" G    int     3      
" U) Q# x1 t( d    cmp     al,4
; Q* n$ C, @: u) z    jnz     SoftICE_Detected
# T7 i' @! f- _' y3 I) h" U# k3 L6 q- n; U& v8 _3 R
___________________________________________________________________________& h6 S- g0 ~- N9 F' Q/ C# R0 m

( K0 |+ ~  E: dMethod 02
9 x$ H1 ~- k8 O% s=========
$ D  S+ H. b2 S; b+ [6 Q+ V) [! K# m0 P( n% z9 p# v
Still a method very much used (perhaps the most frequent one).  It is used- L! Z9 |( d1 T3 I6 l
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
7 c; E, f7 f5 k; Sor execute SoftICE commands...
  F/ U2 K6 L" g0 W' F; |It is also used to crash SoftICE and to force it to execute any commands
1 h! V7 A: \! J& ~; ]8 k' \8 u/ Y(HBOOT...) :-((  
+ v- h+ D9 T9 s# @( o3 o/ d
& K' m* t; M) K' CHere is a quick description:
/ `; s" D# d9 {$ [% p! x% R+ Z- }-AX = 0910h   (Display string in SIce windows)
6 _- M, S+ x# @-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)/ q( K: B5 j+ |  ?7 P& @' x
-AX = 0912h   (Get breakpoint infos)
) c8 k8 i: S7 s# }$ f; Q; d-AX = 0913h   (Set Sice breakpoints)% s. F6 ^9 K( I7 B
-AX = 0914h   (Remove SIce breakoints)
: F& f0 M+ s# L, `7 `3 v& k3 _5 ~4 f1 |+ \) b' c
Each time you'll meet this trick, you'll see:
6 g5 i! \+ m/ P0 l-SI = 4647h- a) s) e7 I6 Z$ i- L- A! b5 R- w
-DI = 4A4Dh
! Y- ]0 H; t7 |1 `Which are the 'magic values' used by SoftIce.) b1 u0 `4 Z. {1 L4 e
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
5 i: R/ W( i) g  [! m4 Q. a. A' q% ]; l3 g7 z# t
Here is one example from the file "Haspinst.exe" which is the dongle HASP0 P* o2 O8 o" H6 @7 c6 K
Envelope utility use to protect DOS applications:
  y0 k4 Q* V, R% S
4 C8 a- a/ |. s4 {' q/ C1 m! V7 \$ e5 [- I, M! X
4C19:0095   MOV    AX,0911  ; execute command.& m+ I; W7 @# y" B6 I- s
4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).1 S+ Z# Y0 h' ]- o, y+ o9 G. I
4C19:009A   MOV    SI,4647  ; 1st magic value.3 A. p- x9 B4 Q. W6 k
4C19:009D   MOV    DI,4A4D  ; 2nd magic value.
' }; G  f2 n5 ]( h6 t$ D4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)2 [  s4 |+ D3 \* m; Z! ^" r
4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute! Y/ g, J" x7 Y, J; y0 M# E) A
4C19:00A4   INC    CX6 ~2 X  K  t* Z0 A& K- y
4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute1 {9 W! P- D5 z4 h
4C19:00A8   JB     0095     ; 6 different commands.
  n. T2 H& ~& @* v  E4C19:00AA   JMP    0002     ; Bad_Guy jmp back.4 `6 D) b5 n, X4 A$ I* C
4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)
) O/ F  k7 X3 ~& n1 U- K/ i) u1 j/ e1 _% ?8 J
The program will execute 6 different SIce commands located at ds:dx, which
; Z- e" j; `2 |1 T5 Zare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
. r: w" i7 @+ e# Q8 z) O$ m; f* ?/ d+ T4 P: |* d  f  l$ ^
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.( O, \3 T: B7 C' g! c
___________________________________________________________________________
" c9 z/ z' A3 V* V: B1 S4 _- ?1 n7 j/ e- ~3 e
0 Y( P0 E: C( E' O7 L& {2 L1 r9 L
Method 034 F% J) F, m" S
=========
5 F# B  T$ R2 V0 a+ h" d  Z
9 ]! N, w. r0 h- ^: f( i) uLess used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h1 W" b' j4 s+ V% q: A7 K3 d
(API Get entry point)3 o" C4 q# j. }
        & \( M6 O( `5 @6 U) A% \

! k6 `% J8 |7 [+ K. k) C6 E2 [    xor     di,di; `7 S' Z, n5 S) _, N, u$ b
    mov     es,di
  h" z! a1 r2 z4 ~2 P/ d    mov     ax, 1684h       - ~) ~( f! L3 G9 R* I5 S  o$ h: ~
    mov     bx, 0202h       ; VxD ID of winice
  a6 J: g, e, N9 Y- ~8 C  o0 U    int     2Fh
# l7 ]: j. h& ~2 K2 C* h    mov     ax, es          ; ES:DI -&gt; VxD API entry point
! o/ P, W' Y0 v, ^    add     ax, di! s6 f) Q4 }' ~! |0 Z
    test    ax,ax
5 r  E/ g5 L  Y& b4 m    jnz     SoftICE_Detected
* Q4 m( D- h% z, H1 @/ M. Q+ ^4 F0 t. ^" |5 D+ h' p9 ?) p
___________________________________________________________________________
1 o. H. \( l7 Z+ o) [9 i' y; c1 r: K
Method 04
" P6 D1 J" p. x6 q=========, M; c; o2 g% w- t6 T  W
, [+ o- J/ U7 _- M6 J9 }  R- V
Method identical to the preceding one except that it seeks the ID of SoftICE6 a! }+ U$ ~1 Y- p
GFX VxD.
) E: c: M6 L% a
! x5 y) y3 Y$ r6 Y* x2 ?: U    xor     di,di& {/ f. e; p* z, r! ~* l* Q
    mov     es,di- _' x  ^4 c& z3 G1 y" }8 _5 W
    mov     ax, 1684h      
  \4 i% @  B1 ^1 A* s9 h: X- h6 |    mov     bx, 7a5Fh       ; VxD ID of SIWVID
* G, `$ k# v: }* ]0 h, o    int     2fh
9 t5 k/ r3 S5 f( e- E) T5 `" o    mov     ax, es          ; ES:DI -&gt; VxD API entry point5 h" T# p+ S# l
    add     ax, di8 v" f, j0 Z4 b( T
    test    ax,ax) D* m" K" N6 ?  d- D
    jnz     SoftICE_Detected7 l; m8 V  q' _/ S6 g5 W

( T) A8 h) Z. g& o__________________________________________________________________________
" c( Z4 j8 C) x! T4 j% G* T! x( ]9 F; Q- d$ i2 G9 s
% S" j' A0 V& n, `3 d; E* p& T
Method 055 d0 _: B1 N3 O( W8 N' f+ v
=========  u/ Y! [; D; |( f6 n  w

% x. R& J4 }7 U9 P* BMethod seeking the 'magic number' 0F386h returned (in ax) by all system
# i: [: [; _9 ]debugger. It calls the int 41h, function 4Fh.' u' a) U' d) N# N6 S5 l6 S
There are several alternatives.  + u& g6 _: O, R; T/ S
& ^6 C$ x  d, f
The following one is the simplest:
% d0 X/ I: @2 W7 l6 f
+ X( }" o( v+ L! A    mov     ax,4fh* z- q; Q. J8 I& }: f# \
    int     41h
( b  I% d; u% ^    cmp     ax, 0F3868 U. Q' F9 c: b8 j0 b5 v6 J
    jz      SoftICE_detected5 r' V7 f9 v4 ~- ]# U, s- g

, F. \; B: k: d7 M: K. M8 C
% X+ @) }( C6 r9 L% G1 TNext method as well as the following one are 2 examples from Stone's
; n: Q+ @3 J) J& {4 u; S* t! ?* S$ h"stn-wid.zip" (www.cracking.net):
* {6 [1 `! R  \4 f* W/ W* L  B+ p3 M9 c% B' l0 F0 @/ G1 g
    mov     bx, cs9 a. M4 u: _( |8 L; w
    lea     dx, int41handler2
" m6 O, c1 ]! L% r: `  h    xchg    dx, es:[41h*4]
4 ^$ |% C) T4 J: z# A4 i& I    xchg    bx, es:[41h*4+2]
; h$ _0 N8 f9 g1 v  |$ O7 u    mov     ax,4fh
( x% b( t! U0 s    int     41h
/ X3 E( O% X) i3 e0 y1 ]    xchg    dx, es:[41h*4]
; J0 d6 F$ `# d. ^    xchg    bx, es:[41h*4+2]
( H# \2 D+ {5 ?0 a    cmp     ax, 0f386h4 |% R; j$ k+ b7 \
    jz      SoftICE_detected
" i) i6 D2 N9 V( N: C" n- I2 c  w7 F2 ?' z) _
int41handler2 PROC
* J" N( z3 n- X% U    iret% {: S) ]- M- Y7 {
int41handler2 ENDP
% b0 N! x' A$ U( |+ S! A( R, S/ [9 {+ m0 s& J
  a1 S, S" h, r# E# Z/ P! a/ I
_________________________________________________________________________) Z) h$ P6 z: I7 j% q+ T* N8 T
3 y$ T* e* @) i

' v( t$ j! d, lMethod 06
. h6 R; c9 W, E9 @5 A3 E& O=========6 B! e. y9 J) n& f
4 t( w) i# K+ u+ F
" `2 ]$ P4 H: q  j% g- _
2nd method similar to the preceding one but more difficult to detect:1 V# O7 A8 B. @1 C

  L/ ?: W+ U! I' k  v/ m9 M0 z4 g# Z# ^' R
int41handler PROC
# y2 \9 t! c1 K7 s7 h: o    mov     cl,al
+ q( V- q0 X/ E+ S$ ?; }) ~    iret
5 k7 I/ K1 m& kint41handler ENDP
  w2 j" B: Y3 ?6 s5 e2 |, A6 B2 S7 E% z, q# A/ Y. s

* \' E& N3 P: ?5 X  G5 W    xor     ax,ax
* l  j/ p5 e3 s! c  b3 j    mov     es,ax; A- A8 m( {0 M" u
    mov     bx, cs# i. M* W, @& P! q
    lea     dx, int41handler' j' S/ m$ e1 h
    xchg    dx, es:[41h*4]
) y8 U$ e1 b* `  @$ h/ r    xchg    bx, es:[41h*4+2]0 |5 l7 Z+ q! {
    in      al, 40h
4 J# {2 b1 |: B* N* T9 t    xor     cx,cx  [  f- E3 W: s
    int     41h
0 ^! P5 [% t$ G" O, A    xchg    dx, es:[41h*4]
8 j( t5 V4 _% y5 |6 `: `. H    xchg    bx, es:[41h*4+2]  S7 i4 S2 [* d2 z2 D* i
    cmp     cl,al
$ N2 t" }1 N' f3 v! {    jnz     SoftICE_detected# o5 ]8 w4 z. \; ?% [# c

- r9 I) |. Z( ?_________________________________________________________________________# q, O. h: r. `' C% q2 d

0 \. N" b2 z! q% z5 h4 R! OMethod 07/ V, v9 v7 y% ?, w  _  C
=========
5 D; n6 K8 ?% o7 \0 J& V8 \! ?) N- _0 w& {
Method of detection of the WinICE handler in the int68h (V86)9 B9 ]0 x: l- G& K
0 B* G9 e! p4 ^+ ^" [9 Q$ s( ?
    mov     ah,43h" r1 o1 H# ]* w% A1 G; L6 O5 t- J
    int     68h1 Z9 [8 t2 _& t5 @$ f) T
    cmp     ax,0F386h, }& h' x5 t: @; e
    jz      SoftICE_Detected
. S( l% H' h. h6 J  ]( G3 M5 q# j+ W, b. y
* [0 E  R. d1 B$ d3 I: |3 z
=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
: A7 C+ P* E  @( T- V- h   app like this:
! g4 @' B" |4 i8 v3 c( x' a+ w9 P  V% Q+ z& x3 e$ r9 _% S" ~2 h! l
   BPX exec_int if ax==68
9 z/ b: o7 @5 m( f7 g   (function called is located at byte ptr [ebp+1Dh] and client eip is
; {+ `+ w+ c9 b. ^" Y1 a9 \   located at [ebp+48h] for 32Bit apps)$ J$ c) i' r9 ~, g6 _5 o# r1 l7 o
__________________________________________________________________________
( x/ ~! @2 d( ~: ?; L0 P" E# |; A7 h7 p3 Q. X
2 r" n) z; ^- T) R' {6 ^
Method 088 P6 i' l! R' @8 u$ y8 a
=========
# T) ]4 _1 Q. Z5 r5 f. K9 A
2 H1 G6 `) I$ V3 b* D2 CIt is not a method of detection of SoftICE but a possibility to crash the) [8 z6 j8 q, b8 `, |4 h+ ^6 |
system by intercepting int 01h and int 03h and redirecting them to another& H- z9 q8 z; v, C7 Y
routine.  Z  e/ L& v1 s6 d
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
! X: f, O: p* Lto the new routine to execute (hangs computer...)
- y/ h/ z; `, x# B
& ?1 L1 N9 a* {. ^/ {    mov     ah, 25h$ S" q& L$ z: S
    mov     al, Int_Number (01h or 03h)4 P4 b' Y: O5 }: i/ c  x
    mov     dx, offset New_Int_Routine1 L# t0 E1 y, h0 P: {4 W
    int     21h
. _6 J- U# F9 [/ k1 y) T" b" W5 [, U8 G
__________________________________________________________________________
  N. G/ M$ b* V' J
1 R3 x9 M. L7 [2 X/ ?4 |; p; v( m3 jMethod 09
! K; Y" G1 E% v! Q=========- I, d& Q1 L+ {
" c, d0 M# s' H6 c& H4 @
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only1 M5 g& L, A  z" D
performed in ring0 (VxD or a ring3 app using the VxdCall).* L( X7 {* z" l  A
The Get_DDB service is used to determine whether or not a VxD is installed
8 z6 L7 x  q2 a" D( ^1 Nfor the specified device and returns a Device Description Block (in ecx) for
$ m0 `5 i3 H. i4 w+ z% K& Ithat device if it is installed.9 o8 q8 a0 ?7 ^& ^
6 O5 [7 p& Y# x  W, ]0 j' C
   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID
- h) Q. ?+ N9 K   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)2 ^2 u" C, V- Y) I( L) r+ H
   VMMCall Get_DDB' v% L5 n. j+ u% B9 t
   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed6 _0 z" ]% I. a8 @" E5 u& w2 `# y
8 A# w/ V" w( D4 F
Note as well that you can easily detect this method with SoftICE:+ ?% B) E$ D, g5 s+ t
   bpx Get_DDB if ax==0202 || ax==7a5fh4 i5 f. Q3 `1 Z8 R

6 e& k1 W. A4 F: \; v3 f7 |2 a__________________________________________________________________________0 q) r3 g( a# t1 Y+ i2 {5 }6 A
* P0 \6 q1 l0 h  ]! B( v; h
Method 10
: s+ Y, P& Z! B' S$ v% m' _=========1 ~( c3 }+ n6 S$ l8 @, u& S

3 i: _* @( x, ?=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with
( `6 y5 n$ O, ~9 s1 J  ^  SoftICE while the option is enable!!
. l; M) k. a; [& U
. U. R6 W) X# U1 v# d& ?This trick is very efficient:, ^& N* g6 B* b/ x! {
by checking the Debug Registers, you can detect if SoftICE is loaded
3 K2 P/ h5 M3 [& S- ^# z* p(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
) u9 H$ y+ I& U/ m9 |! I" Kthere are some memory breakpoints set (dr0 to dr3) simply by reading their
5 g+ M! h8 b" \value (in ring0 only). Values can be manipulated and or changed as well1 ^2 s. E7 f( g% q
(clearing BPMs for instance)8 S, G; {! X! b  k$ ?
9 w, w6 i' Z- e( X# s! C& ~: b' T
__________________________________________________________________________; ^7 X  F6 V. I: k. ~, `+ d

/ f# o' A, ?. o' N& H* ^Method 111 B& H8 H6 f, G3 k* j: l
=========
( A( k7 x4 j! M9 k% H; T: G/ ?7 Y8 o; n( n
This method is most known as 'MeltICE' because it has been freely distributed/ I$ q6 X( n4 J; s7 v; {
via www.winfiles.com. However it was first used by NuMega people to allow% S  m. H; j, Q: e- {: h8 z
Symbol Loader to check if SoftICE was active or not (the code is located' E) l5 j! L* y4 [2 U+ c8 r5 z
inside nmtrans.dll).$ z- |$ ]: ?, O% w7 X

6 B1 X' z# r$ ?' }" f+ O( d9 |The way it works is very simple:
6 E4 K- q+ j7 x: l, c- t2 ]It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for- f) u0 O2 ?# Z: D. I
WinNT) with the CreateFileA API.
6 i' _1 [  @) A, K# T. s5 B! y! r# p0 ^
Here is a sample (checking for 'SICE'):
$ t! h! A' p: Q9 j. W( v
: ?) a. ^/ s$ }BOOL IsSoftIce95Loaded()
# U7 e1 {% I2 k{0 G  [" r+ h1 J  D# ^* x
   HANDLE hFile;  
2 J1 `' K: G. p" M* X+ ~   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
) ?8 W4 T  ~9 @( |& I7 p% J                      FILE_SHARE_READ | FILE_SHARE_WRITE,
0 L) `  N. k" r" A' K5 k                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);* [% |- s) V: i* h& ?) r4 t
   if( hFile != INVALID_HANDLE_VALUE )
4 X! M1 I& w. l" C: q$ d   {7 B) B5 I; C+ }" }5 g* f( c- P
      CloseHandle(hFile);2 |. e  V9 D9 p! L: [
      return TRUE;6 V- W+ T3 _; t5 p9 I
   }
% b( Y1 X4 k+ s6 q* m7 X* `   return FALSE;& S3 S2 P, |) z, J1 w8 J# L
}
9 A1 Q( ]3 X# \/ G; `7 V5 S# _! H4 b' R8 R7 P+ ]
Although this trick calls the CreateFileA function, don't even expect to be
6 F7 w+ w" [1 yable to intercept it by installing a IFS hook: it will not work, no way!$ M6 S: G" Y' q. c" T
In fact, after the call to CreateFileA it will get through VWIN32 0x001F( W* D# G- N3 m& B8 r& o, c
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)9 {5 _, c$ c5 C7 v. [$ ]
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
( H7 N2 z; m* |2 n; Pfield.
/ [/ u1 w+ Q5 \7 O$ Y+ }In fact, its purpose is not to load/unload VxDs but only to send a % N5 E+ ^4 x* H% L- k0 p
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)5 x& j0 k' i& b7 _: `8 H5 _! [
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
" o# }# r8 M4 |/ T! ]5 ]$ F1 yto load/unload a non-dynamically loadable driver such as SoftICE ;-).. }) ~0 L. F( G) c% L) F- N
If the VxD is loaded, it will always clear eax and the Carry flag to allow0 n( E8 g4 f  z! Y% j& B" s6 b
its handle to be opened and then, will be detected.
6 V. d! J' R' U. u. }. {5 _: KYou can check that simply by hooking Winice.exe control proc entry point* H9 d% t8 v  a9 R- R+ B& g
while running MeltICE.. U7 p) M8 z/ P: S$ K

$ D- X1 S" K  x3 r& q
( o, k! i" s, o# ?  T' v$ F  00401067:  push      00402025    ; \\.\SICE  P) w3 G+ Y3 a1 S" t
  0040106C:  call      CreateFileA5 p9 U5 `+ b. Q/ M) E! L
  00401071:  cmp       eax,-001
& D$ \" O- d: Y) ]& |4 n3 g  00401074:  je        00401091! U' [+ e+ F$ R
* c* m0 a1 \6 Q" g3 `
3 e4 Y" }3 _* g6 X; `% D. {/ u! ]
There could be hundreds of BPX you could use to detect this trick.+ _# }; i1 O- B9 q- N' z
-The most classical one is:
( N+ N7 B4 m4 ?) f& W$ i# q  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
6 t6 _! X; m8 O* o- v9 p    *(esp-&gt;4+4)=='NTIC'5 j( P7 f( l" c; p2 E2 p4 t, j" }
+ I8 F* F$ w1 k  ?9 I7 R5 U
-The most exotic ones (could be very slooooow :-(& S. i: c6 h& ^$ D! @5 F  }- w+ b
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  8 h- ?1 e8 _( d; I- X  h; v$ s
     ;will break 3 times :-(
: P+ k+ y: C1 u2 v- y/ Z. X# O2 z6 u0 L9 |) ]
-or (a bit) faster: ! j4 o) Z1 |: G* K" [0 k
   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')& k  e( ]/ H7 Z. O7 p2 K: N
$ ?# L2 p+ ^4 d% R1 x- w' @
   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  4 j' _  a! ~" I1 S8 v- G7 M* S
     ;will break 3 times :-(
+ X: C7 ?. [) _$ R9 {" N/ S- ^2 \' b& X; V
-Much faster:- Q: K& z! x, X) G, Z) Q
   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'- X8 T8 D0 f" M+ b
) }0 C7 l, B, `, o
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
: W. Q6 r7 {0 Mfunction to do the same job:( m# D. Y$ r( l8 j" `7 f( g

* [0 X; L/ S6 u! r   push    00                        ; OF_READ
' p; S& u  }* e   mov     eax,[00656634]            ; '\\.\SICE',0# C% o) F; S+ \# x3 a( \
   push    eax
, n. A1 t' j: L! g1 f2 T   call    KERNEL32!_lopen# w0 v6 Y# z9 k7 r8 L9 ^5 o
   inc     eax
; r9 D9 q/ A( a, i3 F   jnz     00650589                  ; detected8 K% R' Y' j0 i  Z9 q6 c
   push    00                        ; OF_READ( Y: v& C6 D4 @1 I/ c- W! \
   mov     eax,[00656638]            ; '\\.\SICE'7 }2 l8 C- Z+ n6 G. E( `& c* w! P: q
   push    eax
. E) S% }9 N  }; k   call    KERNEL32!_lopen& I/ J  V" f$ a* Z+ M  x+ z% j& ~8 Z
   inc     eax. S" O! D( l( v. ]8 q$ I0 u+ `
   jz      006505ae                  ; not detected3 C2 ?* D' w; u! V6 n7 S

+ `8 g' |- h6 u: m6 g6 _/ S! I) L$ ?4 j9 p, F1 u' t2 ]
__________________________________________________________________________
) S& j2 S7 J0 }1 s" D% |* A- V( x& a" s- w
Method 12* G0 [$ J( Q- d3 y% Y
=========
' X: F3 s. v, B# L' |% O  M; }) I- x3 e- C% P- a
This trick is similar to int41h/4fh Debugger installation check (code 05! U! D4 ~. S) p" i
&amp; 06) but very limited because it's only available for Win95/98 (not NT): g: {, M! e. {# q  F( [  X# s: q
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.. T% @# z9 y0 }" G8 i% \" h7 {+ C/ y7 w
" A- A, ^2 `' X  }) C
   push  0000004fh         ; function 4fh4 j) d8 Q. O5 e
   push  002a002ah         ; high word specifies which VxD (VWIN32)
3 C6 s5 e0 L5 z5 u) V$ K                           ; low word specifies which service* e( ~0 c5 a1 J% E) E6 ?
                             (VWIN32_Int41Dispatch)% x" Z& w* Y/ I: r( f! A2 A7 c- D
   call  Kernel32!ORD_001  ; VxdCall
# F) H! |7 H* @, l. T" g# T   cmp   ax, 0f386h        ; magic number returned by system debuggers" e( A' R$ `  e& J: \
   jz    SoftICE_detected3 E/ M8 d# [9 e& K! |

* h& o7 l$ y( W9 B4 W+ B& _Here again, several ways to detect it:1 [0 `- J$ F2 C

2 I  ~6 C& z) e4 @    BPINT 41 if ax==4f
# a6 j' I$ h# V8 A+ }0 ~8 i) i( Z" C5 O
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one
' f* w  b: s; u5 a5 l4 m4 ~: c1 u! `; F! `' S3 |
    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
# S  u; L) @/ `. @6 b& C2 o! W% O) z6 y# ^8 ^/ p& G
    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!* @5 W" G5 g; y

/ c. R2 F& r  H) G; E: \1 U__________________________________________________________________________
; J2 i# @2 x9 l' c) t+ y! ?$ [' ^9 N4 B. ]
Method 13
! [* F& f$ R8 S) L=========, q% Y8 C) Y- c9 I

) X+ N- |5 I1 S9 k% j" pNot a real method of detection, but a good way to know if SoftICE is) ~7 s& d  |& k2 s* c' E! D/ i* ~
installed on a computer and to locate its installation directory.
+ l0 P# @8 Q( P5 p/ d+ ~& zIt is used by few softs which access the following registry keys (usually #2) :! f% s9 o8 G1 W+ A( v
# `5 y% m0 c  u4 c* p; p9 G* _) V
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion# x+ _3 k( V% |* t, g
\Uninstall\SoftICE
4 r% x. J# j: ]+ _-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
$ R- ?8 m% D$ z, h-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion. W) E9 x! N( t% t; r, f$ _( g3 c
\App Paths\Loader32.Exe
6 A0 D0 G, X  G  \# Z
5 ^  ]; H  a" v( [0 S8 W$ B$ Q
5 [: L; p7 m1 l& vNote that some nasty apps could then erase all files from SoftICE directory2 c, l! `0 K# ~8 I
(I faced that once :-(
* _6 O. u3 K% I3 O  b6 V0 E/ q" S1 Q) {
Useful breakpoint to detect it:: m3 _2 E9 L& s0 m

" P7 V1 V& J2 y( H     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'* v9 x7 T. {: r; @; w" e! H
8 d7 C% {' R- I6 u3 o3 i
__________________________________________________________________________, {+ |3 [! u. P1 r! ?) n" D4 s- J
' _  o5 f# N( {8 I
3 R9 O2 o- o/ q; Y9 |; ^
Method 14
2 L2 ?( [% U/ ~* m" R% R=========
+ G% z3 `1 x. J2 ?% ~# H( t
  W: }3 ~' x* X+ N9 Q; `A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose) m8 [& o8 j  [, A
is to determines whether a debugger is running on your system (ring0 only).  H0 ]0 W/ T) ]8 R/ V# B7 H  {
# _6 [2 [8 f) d( U$ r5 C% J* ~
   VMMCall Test_Debug_Installed
2 ?- {1 e. l, @6 P   je      not_installed
( Q8 a; K+ \7 f/ @! E; f0 g5 T9 p" A7 f+ }8 A. R
This service just checks a flag.
" c& g' Q& E, D4 `/ q  l: Z) U</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关注公众号

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

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

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