About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
' f5 L* L7 F( Y<TBODY>
+ D% l5 \& p- G<TR>( w% X7 K; {! b9 Y. l" r2 O
<TD><PRE>Method 01 # T. R  Y- @5 Z
=========
3 o9 x' `0 {% O! B7 c" v! v+ K, U' O8 n- ^2 i
This method of detection of SoftICE (as well as the following one) is, D$ i) U( D7 [
used by the majority of packers/encryptors found on Internet., @5 r7 d; ~$ |  n
It seeks the signature of BoundsChecker in SoftICE
( t4 q+ R0 I  U
; u( j2 E3 o' \    mov     ebp, 04243484Bh        ; 'BCHK'2 P1 P  b& I  D
    mov     ax, 04h. B5 f: p8 Q6 L! O  o3 h8 |' l
    int     3       3 h% e2 m$ `$ }  P
    cmp     al,4
  b6 v: x6 P- g( w7 L- S    jnz     SoftICE_Detected
+ R* t! U# d$ m( N/ i7 n4 P
  F; l2 H; J7 f2 F/ m$ j8 ^+ j: u0 S___________________________________________________________________________
6 g- ~5 B6 d8 h- W2 k) U1 D/ L$ m% o4 r$ \5 I. I7 E% ~9 B% F. t1 _
Method 02
: r% ?. D& d2 g. b3 ]8 b* |=========3 L6 J) T; T. n# d( t9 @+ Y9 A

$ A- z/ s9 m" J5 Q5 J8 r( l$ GStill a method very much used (perhaps the most frequent one).  It is used8 V! G/ K  e' ]$ R2 P
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,6 h% e7 a8 j. m- E1 |  u
or execute SoftICE commands...
  Z, v( \1 U4 @* sIt is also used to crash SoftICE and to force it to execute any commands
9 A. ^( c$ J& r' M(HBOOT...) :-((  . x2 z& U; q3 N3 q9 m( Z' f/ @
/ F! m; a* Y) |, \9 e2 f
Here is a quick description:8 T: y. r5 A  x' \
-AX = 0910h   (Display string in SIce windows)8 n5 Q- r% s7 [: M1 |! Z( k, Y, W! P
-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)9 Q- e5 X4 q0 R( K) a) x; a: i2 _
-AX = 0912h   (Get breakpoint infos)
/ X2 A1 y$ F  s4 x-AX = 0913h   (Set Sice breakpoints)
- d6 J: C) g$ X-AX = 0914h   (Remove SIce breakoints)0 A3 }8 t, n; J
1 [' U7 a5 r; E) H* P5 D2 I( N
Each time you'll meet this trick, you'll see:
- c* C6 v; t: D9 ^# q- p-SI = 4647h
& i" b1 w* `6 G) h" J* |-DI = 4A4Dh% o' W2 L+ v) Y3 L6 V
Which are the 'magic values' used by SoftIce.
- H' M7 k) j* H  i2 s$ S: D1 eFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
1 d3 `, w$ _/ a! |9 l3 J* D" G5 H( }; C! }
Here is one example from the file "Haspinst.exe" which is the dongle HASP) D7 |- C2 `9 T
Envelope utility use to protect DOS applications:# U! W5 y8 F9 L. l* q% [* L
: S* }$ ?' A% v/ W% {. x; @2 n- F

+ ?0 j5 }: s4 U' z- K, F: @4C19:0095   MOV    AX,0911  ; execute command.
! p! M9 _7 a+ i; _4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
6 I; t, h5 i& X% B  ~% A2 K5 K4C19:009A   MOV    SI,4647  ; 1st magic value.6 S5 l- I& W$ F6 I, z+ f# w
4C19:009D   MOV    DI,4A4D  ; 2nd magic value.
' [$ U+ t! w) t2 K4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)" H/ r% }. ]! a6 U3 y$ J
4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute1 p. W0 ?. o3 C+ Q; A9 K) m
4C19:00A4   INC    CX7 v% l; M; u  [, {
4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute3 `; C, O! c, v0 @
4C19:00A8   JB     0095     ; 6 different commands.
3 \, v- k, I  ~+ f4 Y4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
; b1 G6 |! k' O, A: ~/ L4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)
; r5 v( n; g4 X( p# B1 H/ G
% f/ K$ x+ T# G: D, m- k5 l9 K+ CThe program will execute 6 different SIce commands located at ds:dx, which
( ^0 |# D& L3 Q, f/ A5 S' zare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.! n; G- W) n; b1 y; w' J

' Q! G( [9 @2 ?/ O& Q3 |* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
0 a$ h* W2 }# k2 u% L2 A___________________________________________________________________________
. t# C! z. S$ X  v* B: y& o
2 a, o# q( |, h2 o0 Z
' o  `4 x2 J  q0 yMethod 03
' A8 s3 \' u4 S=========
! }. e3 O- b8 L; n
$ j0 h- l# n+ @9 {4 @2 J9 S5 i( D5 XLess used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h4 \' P; `) U+ C% j+ K
(API Get entry point)
$ b4 P8 K! {3 V+ T, }% o) D9 V        ! m: d: G3 u: Z2 z: z& G
1 \' R: F$ N" C0 V) ~, V
    xor     di,di
* h; N9 {/ J5 a* C; n0 w    mov     es,di
5 V+ t# _# h  s/ |    mov     ax, 1684h       # A& T6 I5 d/ J
    mov     bx, 0202h       ; VxD ID of winice; Z! @7 E! g' b9 t: i( F9 L' U7 j9 }7 D
    int     2Fh9 P" g" ]0 S$ {
    mov     ax, es          ; ES:DI -&gt; VxD API entry point8 A, O" c- E6 v4 C& ^$ ^. o: A
    add     ax, di
3 [, U& c+ J" Q: f# j6 n    test    ax,ax$ x4 _2 `& p9 i- [- j2 A
    jnz     SoftICE_Detected* ]' R/ U. c6 P( i8 C2 {' a! d

  ~9 k2 N6 A& r0 q0 Z___________________________________________________________________________
- {7 r5 W8 a# }  D4 Z  w
8 _% D& t0 l7 o( \/ PMethod 042 q  k0 D- z0 Y% N( _# z
=========
' [3 O$ c9 v' y* A
+ w" S! u4 P% ^9 a' SMethod identical to the preceding one except that it seeks the ID of SoftICE+ R) j  Y4 F7 T$ m
GFX VxD.
* f  b& P, L7 z* `$ |, z) H+ c1 h- U/ l& ^8 B- b
    xor     di,di- E  g' G) S2 R7 v
    mov     es,di1 \! h/ J7 W3 X2 g2 g6 X
    mov     ax, 1684h       2 g6 W  n' r+ k$ T8 u
    mov     bx, 7a5Fh       ; VxD ID of SIWVID% N6 H$ a9 u* B" W
    int     2fh) B: y9 l3 s* {- N6 f
    mov     ax, es          ; ES:DI -&gt; VxD API entry point
! `$ ]; V+ j7 J+ m4 U    add     ax, di
) i3 V4 j) F9 f1 }& _# q+ H    test    ax,ax
( r, i% s% b. M  l    jnz     SoftICE_Detected
6 t7 j) [: w3 M& \% ^
6 c+ I- }( v( I' A2 R! t( @__________________________________________________________________________  X- a- }/ ~% g- V5 ?

( H  V' U6 z; d9 t8 L0 C
  u( M7 ?- H# X+ c5 s% Z9 a4 LMethod 055 e  i6 e: t) R' ]! G! M7 i
=========% [) h4 z+ Y+ b, ]! H/ }

( h" ?2 }( E) B6 N$ pMethod seeking the 'magic number' 0F386h returned (in ax) by all system
* z  [& ^; }9 [debugger. It calls the int 41h, function 4Fh.
& m8 m# O+ i( w; k+ }1 cThere are several alternatives.  
9 v6 h1 C  W# M( _+ e3 D# J! y! X( z% [
The following one is the simplest:
5 J' q( d& e2 U; o1 q8 T" R2 A
* w. M# i, ]) I    mov     ax,4fh
& n  H6 n( G2 A2 I    int     41h
& }, r5 E* a+ k8 c' C, L    cmp     ax, 0F386* F+ Y$ j8 G0 T( w
    jz      SoftICE_detected
9 {9 h2 r, d5 [. o% d5 h
- o1 T* p, b0 T4 E+ n/ j- o' Q4 E; k" R$ j. F
Next method as well as the following one are 2 examples from Stone's
& i# J8 Z, g: P" L7 i& }& u" }" n"stn-wid.zip" (www.cracking.net):
* i% |, Y8 m$ K1 F1 _
* d, z% ~8 U& G8 r( {    mov     bx, cs
; ^* y9 w. [8 P& g& J8 Q+ `    lea     dx, int41handler2, _6 `: u$ p, A9 p
    xchg    dx, es:[41h*4]# Z6 |' w) U  Y( D2 H# Z1 Z
    xchg    bx, es:[41h*4+2]$ Y4 k- b7 W' N% k
    mov     ax,4fh0 e1 F* l# T, Q( C' J* w6 L0 |
    int     41h: |0 X, g, l4 J, Q* S5 Z
    xchg    dx, es:[41h*4]; e. F9 J- b3 w5 k& x6 u. Z9 K
    xchg    bx, es:[41h*4+2]# j+ A8 \) z: E* c  u
    cmp     ax, 0f386h9 {& I) P# _5 c8 A( @
    jz      SoftICE_detected
4 G( G" R, P# O# s! U- K- n2 y7 a) R& [
* P/ M7 i  g& S' B8 yint41handler2 PROC0 g- D$ M$ a$ a& r- Z  ?
    iret
# C: V8 F5 ^! a7 _9 Yint41handler2 ENDP
% p5 k! L5 k& _! N5 E0 D2 b* U
8 u6 i/ b  ~7 X8 I
. i. d2 v7 T- i' f, T_________________________________________________________________________' e/ ^! N4 M/ F8 o
# L( e! O2 E9 H" F6 M  C

0 J6 A0 p: T- V( O+ _Method 06
9 Y" r% `5 i+ @=========5 c+ b$ A0 F$ \" B3 I9 S; e% D
2 q/ W# f- z% {" w
9 K( E: @+ u: \, D& o
2nd method similar to the preceding one but more difficult to detect:8 ?& f0 Y5 R' _0 @( w& d: `

0 U5 @; H; _3 @5 b' H, S3 X: _1 o5 I1 m6 f7 ^
int41handler PROC9 g3 O6 B  j+ C% H' n% [. a
    mov     cl,al! ~5 e% m+ a1 F5 v( B- m
    iret& X; _1 h. k# N. J+ ~( ~1 ~( A; B$ P
int41handler ENDP
2 e% M% B3 Y( U7 o' ^! e9 u1 c: [: @

4 J3 [6 I+ @" X  z/ I- p    xor     ax,ax: `: J$ D+ m( `/ F8 {
    mov     es,ax1 l! O+ i% z" H% b
    mov     bx, cs
! v# s, C; i" R# P! D    lea     dx, int41handler
5 g2 E8 a" H! @" K    xchg    dx, es:[41h*4]  O, K" \9 B4 E3 z$ Q
    xchg    bx, es:[41h*4+2]
7 d, `# N& o$ j    in      al, 40h! l% b% i& t: W. ~' e
    xor     cx,cx
* a% V# c; K3 [% W    int     41h
) s3 ~- O/ E0 m, D2 g    xchg    dx, es:[41h*4]
7 P* p2 ?4 y1 V4 W    xchg    bx, es:[41h*4+2]/ G( F, p5 Q4 d7 t2 f6 y, `# R
    cmp     cl,al
/ D# J3 `5 |. o* F( d. r    jnz     SoftICE_detected$ H- |* e7 P1 N/ H) F9 `: T
+ Z* M% G9 v. [7 s
_________________________________________________________________________
3 m) \/ a& d# x; r3 e  p& s* w' m, ?) z7 |- O2 t) x$ o
Method 073 F  S$ l" Q) O+ q9 B' \: V$ I: F; x# q
=========
7 A" B4 h& j) B
$ a% u8 ~& r/ R% gMethod of detection of the WinICE handler in the int68h (V86)
$ a6 @, v' c0 X3 c
$ J6 ]; w# P* S; P2 i    mov     ah,43h
7 X4 w7 p' T+ }3 V0 K$ A* Y2 E. W    int     68h5 S" a8 q  d+ l
    cmp     ax,0F386h
: c( B9 I) B9 @1 [$ z    jz      SoftICE_Detected
- W$ |$ C) A, T% i2 P5 u
: X8 G9 S) ~! i' n4 l$ P) j$ O! Y; c+ s% V( T  b
=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
3 L+ V% s) S+ Z# ~% m- e/ ?+ Q   app like this:
: s& I4 U: j* I/ Y( p( o. T' X- _5 H% Q, A0 U% k1 @
   BPX exec_int if ax==68
' c0 A  j- k7 a( s/ K0 l   (function called is located at byte ptr [ebp+1Dh] and client eip is
/ H9 b9 ~' u. R- H   located at [ebp+48h] for 32Bit apps)! R: v: [$ q+ c* E5 ~/ \
__________________________________________________________________________
6 \2 n3 W6 R4 l$ g% l, r; B* }" O5 t# [9 ?

6 N% C" W2 l* l% G1 u) @2 zMethod 081 i6 ?( N2 q2 a; E1 t# E! N' g
=========0 I3 z" B6 i" i1 M1 A0 N
- h8 i: k1 G3 K0 b# V& z
It is not a method of detection of SoftICE but a possibility to crash the
  V* v; U! b7 A  Ksystem by intercepting int 01h and int 03h and redirecting them to another
; E; r) |! A8 q  Yroutine.9 d. r9 i8 Y5 T. x9 r: p
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
1 e3 _1 p  j$ w: \to the new routine to execute (hangs computer...); o. @( ?( m& D0 Y7 e0 N# Y
1 y4 a( c* h) b; I9 W$ e- l
    mov     ah, 25h
! i0 _! Q1 ?5 }% s; B    mov     al, Int_Number (01h or 03h)
8 i5 s, P- ^0 k; Q    mov     dx, offset New_Int_Routine' j7 }4 P. g! K6 }
    int     21h" {' D6 R1 W9 n5 \0 s

* o, b9 a1 }8 i__________________________________________________________________________
# M; H$ y2 k- ^3 S" F3 I1 f9 u! ]" d2 U0 d, ], T, ]3 a& o  j: T
Method 096 Z1 d% O8 A* W: x6 I
=========2 V4 c+ ?& m( [& T

  ^* U1 i: A- R7 S* i# oThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only; y9 B1 E' _" r+ l; ~
performed in ring0 (VxD or a ring3 app using the VxdCall).9 D$ X' l7 M) [9 t7 U" Z# N
The Get_DDB service is used to determine whether or not a VxD is installed
6 g5 J( d6 I8 X1 p* X) _for the specified device and returns a Device Description Block (in ecx) for" E  l3 S4 W/ j3 s' J; J
that device if it is installed.
4 R& m  [2 `6 y4 n) D, M  ~6 Q% \/ y* W0 N1 B
   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID
* }  S; c2 k  a; Q: j8 W, ]8 |   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
. g0 J0 e$ w2 H" H   VMMCall Get_DDB
9 D+ X% h- K* d/ d9 ?  G" U   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed1 L7 w% i8 ?/ i" p. V: x

* o/ n( L8 `! R" W$ ], W+ u; CNote as well that you can easily detect this method with SoftICE:
9 v4 G, R+ `  P- x; N   bpx Get_DDB if ax==0202 || ax==7a5fh* w- Z  r" M2 ?

7 r, W9 p) ]/ ]2 y4 x6 z__________________________________________________________________________
% a! E: K, l0 J' g
& X2 n0 u  E1 r5 HMethod 102 F: [' x4 q3 w/ p* @; h
=========
5 ]4 u8 k% `0 q: d- q* t2 ?# |4 ]- }
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with: J6 y6 R0 A8 M/ P+ o0 H; m/ S* b
  SoftICE while the option is enable!!2 M1 ~0 K! q( N7 z/ C1 b' T
) W2 V- J& Z6 ~& O: t! d0 b/ E' ?1 ~
This trick is very efficient:
% K; v) @9 |* qby checking the Debug Registers, you can detect if SoftICE is loaded
& D& C9 c2 @/ |- z& }* W(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if0 o* i+ R8 u$ W7 O
there are some memory breakpoints set (dr0 to dr3) simply by reading their: z  N: d# D1 f0 p/ O) p
value (in ring0 only). Values can be manipulated and or changed as well. \' [% a7 _; o: Q1 M% Y
(clearing BPMs for instance)
" H' k# v1 R9 N
  p; Z% p+ q" g+ d, H8 ___________________________________________________________________________
4 E0 R4 I6 W  r$ Q! `1 y
2 r: h7 E/ [6 kMethod 11
9 g5 n, l3 r/ S, q  E5 o( i=========
6 G3 r; J. r; O+ F" M9 H9 N& m  s/ A. V+ Q: i
This method is most known as 'MeltICE' because it has been freely distributed
' M2 r. A$ H, A2 bvia www.winfiles.com. However it was first used by NuMega people to allow% V- c8 N/ ]4 B! ~: i
Symbol Loader to check if SoftICE was active or not (the code is located0 I, I4 ]0 C  ^% q- }
inside nmtrans.dll).
0 J# y% ^. M8 n4 R8 q0 t2 ?1 Q5 H9 s4 l" J
The way it works is very simple:3 {* E" ~1 S- L6 Y
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for4 X9 v! b& p* i' ^/ G" Z. g. I
WinNT) with the CreateFileA API.+ N6 C1 O7 f2 w9 s$ g% A6 _

% e2 q4 t& I0 b# BHere is a sample (checking for 'SICE'):+ |2 a1 ~# A( a& I
7 Z- L' @% v) w! r, a) y
BOOL IsSoftIce95Loaded()0 p# ]( R. G7 C$ o( F  e: I) q
{8 p, L7 a' [3 u6 |5 ~1 }
   HANDLE hFile;  9 C" [# R* w4 S( b- t" v
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
+ |: q' a9 r  z9 G                      FILE_SHARE_READ | FILE_SHARE_WRITE,
: R0 g% P" X! c0 `                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
/ B3 _* n1 ~2 r6 w* f! D   if( hFile != INVALID_HANDLE_VALUE ); h- j4 R2 K" p
   {
  x4 i5 R, o* R( N) N- j8 ]' d0 L9 Q      CloseHandle(hFile);" K" A6 }+ w. k0 A" b
      return TRUE;
. d5 ]4 V. x" U2 B' n( ?9 U2 E" O   }
3 c6 W! E: x: r# E* n* E- W) s) R   return FALSE;5 N! P+ ~, k. o+ K2 [- R7 s2 {7 }6 x1 S
}5 z6 k2 G! D, y# J4 g6 O9 R

. c" H6 o4 C" H/ R% `0 uAlthough this trick calls the CreateFileA function, don't even expect to be
; \" o$ N' r9 J! z3 G  H" table to intercept it by installing a IFS hook: it will not work, no way!) O8 B  W2 O  U, H) o
In fact, after the call to CreateFileA it will get through VWIN32 0x001F' U# }3 S9 m" ^* o
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function): {% A( k9 q8 R1 d- k8 a8 U
and then browse the DDB list until it find the VxD and its DDB_Control_Proc/ J. D; a8 n/ j/ p4 Y5 ?
field.
: d% g9 R0 k% l: P. k: dIn fact, its purpose is not to load/unload VxDs but only to send a
4 L& q3 Z6 f$ H" qW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
, n5 C9 b7 k) ]to the VxD Control_Dispatch proc (how the hell a shareware soft could try
6 X# D* v' F) T6 x* Pto load/unload a non-dynamically loadable driver such as SoftICE ;-).+ h6 K* B4 o4 X& J
If the VxD is loaded, it will always clear eax and the Carry flag to allow
6 S$ f6 C* F: d% o: n- [6 Kits handle to be opened and then, will be detected.4 \7 Q. t  E/ @- l( d. J
You can check that simply by hooking Winice.exe control proc entry point
: f; L: a/ J+ A* O) mwhile running MeltICE.
, e/ ?7 i# J, r4 V/ L- l" T' p4 z- V2 w' U; u$ o8 a

5 f2 ^0 \' A* V$ h  00401067:  push      00402025    ; \\.\SICE6 O# m& G7 M) y
  0040106C:  call      CreateFileA* P/ P; P- b+ X0 z
  00401071:  cmp       eax,-001. a- E) b5 o9 }  L) P9 s& T1 O4 Q
  00401074:  je        00401091
/ X1 X: [( l8 |& g7 z: C( G2 l
8 m+ q+ Y6 J! J# q3 X+ z$ s; j! I' v+ {+ Q+ Y# l' }8 R
There could be hundreds of BPX you could use to detect this trick.! u0 R4 K% j$ Z9 `; p# s
-The most classical one is:
: Y* T2 i! h; a5 O& z  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
8 N. \; C- L7 p0 G7 ^, R    *(esp-&gt;4+4)=='NTIC'
: i' O% H: n) `
- v6 }0 \) a& `-The most exotic ones (could be very slooooow :-(
9 v! ^! _) h! G% h   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  ! I  V* C6 ^% f! `' R3 ]
     ;will break 3 times :-(9 S8 d' d$ S$ \
5 N' v' w! K- G+ X
-or (a bit) faster:
5 n. u; ?+ p, t; b+ |# h   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
& }# u# z  W8 k+ X0 Y4 t
. u* y2 t! X+ X+ ?   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  0 h% Y5 h" I7 x  W1 }0 N
     ;will break 3 times :-(1 U* `5 Z: d# k, o. c7 g, s

9 e0 y* ~  R0 P3 T0 Z* ^: G-Much faster:
4 n  Q2 y. [) p! I   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'
0 }/ b; X9 z. D( I* E9 F9 [
9 }3 \. S% k7 W4 Z  e  Y* aNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
' V8 a7 E, t' r: X# X2 V! Ofunction to do the same job:
0 |3 R* p+ L0 f$ `; ~% ?" m0 O- _4 u; b5 l. C% k
   push    00                        ; OF_READ) N5 T5 b1 Q  }- o% g
   mov     eax,[00656634]            ; '\\.\SICE',0
3 [/ I- \& I1 {8 b, }   push    eax
9 }0 L! i1 ?: V) w   call    KERNEL32!_lopen9 ]; B, a0 T5 U  s& w& p
   inc     eax
; ~. o& ]$ B( u8 R   jnz     00650589                  ; detected
( R% Q* A8 f! @/ K   push    00                        ; OF_READ
8 H" G8 _. w) z- l: o   mov     eax,[00656638]            ; '\\.\SICE'+ f+ B( w  t! ]% ~2 |
   push    eax) L# A3 ]" D; |
   call    KERNEL32!_lopen% n- C, P# y' {7 N
   inc     eax
1 G" h; L2 Q2 b; V  S   jz      006505ae                  ; not detected, B6 E& L$ x9 B7 q( b- T) @
- [. M# |9 R7 s8 O# J# z  W& @
7 a% J3 a, r' ?
__________________________________________________________________________
# e2 p9 t4 `0 t/ U& `
! _' o" G  H% i9 p& rMethod 12
3 I( }. O) c  `  Q) e6 V& q9 |5 J=========
0 y0 Y3 q  q% X; |! Z1 D+ k% m" _8 w6 k( N* b8 {' J
This trick is similar to int41h/4fh Debugger installation check (code 05
2 d, B# A0 a; H&amp; 06) but very limited because it's only available for Win95/98 (not NT)
, W' q9 _0 W9 @2 V% \as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
1 o) ^6 H3 o* c4 t1 e9 l  g7 h& T4 Q; Y
   push  0000004fh         ; function 4fh: a* M6 ?$ z: I7 m& K
   push  002a002ah         ; high word specifies which VxD (VWIN32)! R- X2 T! u5 h2 X3 l0 m
                           ; low word specifies which service! v( o. U( _1 |& Z: D+ f$ x6 h
                             (VWIN32_Int41Dispatch), o: z7 H/ T! B* ~7 z
   call  Kernel32!ORD_001  ; VxdCall
3 p: v2 ?0 o/ _) O3 Y' v4 Y! q   cmp   ax, 0f386h        ; magic number returned by system debuggers, M( n& {' e2 B6 a' k4 Z; ?' H
   jz    SoftICE_detected3 K" t3 R' p$ e% ]
9 a4 K  Q, r. S1 X- @# I" S/ w9 n
Here again, several ways to detect it:0 P3 Z2 u; m& \; a4 T

0 _% D% D( n% G9 {    BPINT 41 if ax==4f
& M7 m8 w. a' S2 [& e+ J
  h! f( t' S, V5 Q1 G" X* T" D3 S    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one
: Q, l/ O, N. t4 D2 I
7 J% p2 B: {% z, L1 C    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A* X, g: h6 b$ O6 |! l) I

6 F1 ]5 [% M: [' e8 }8 A4 ?    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!3 Y2 q7 |8 ~" u0 ~) [# C7 Q

6 H- W0 L7 {) K( R9 D, [6 J( Q__________________________________________________________________________
. S- E  D4 v: `, e2 x# `! n2 U) E8 ^* A
Method 131 b% ~0 a! A: B9 @5 t. @: z1 F
=========; T! Q( j2 G2 p! o" b. T

% J& s* P, n- R* XNot a real method of detection, but a good way to know if SoftICE is
' Q' s( r6 `8 {( kinstalled on a computer and to locate its installation directory.
: x! y. e+ K( I' o: V! u' vIt is used by few softs which access the following registry keys (usually #2) :
  @: a5 T& q7 S3 I% a
" d/ ]" A9 @3 Q; j, G) t-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
1 n( v2 R4 w$ n- D3 ]( i5 O( Q9 Y\Uninstall\SoftICE; ~8 G: Q* |" q* w( r! S" ?5 I  L
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE: D2 A6 n8 q# @1 m
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
" r+ h: H7 z  B6 M4 {\App Paths\Loader32.Exe$ F  |- j% D: y3 r$ y( m: g

" }2 d+ |5 \- V8 R
3 \( w/ w  O) CNote that some nasty apps could then erase all files from SoftICE directory
3 l2 p5 ]$ P! L(I faced that once :-(. v% g, c# F' r1 {1 F" O& c
* M! R; q& {% @" R/ Q5 z4 _
Useful breakpoint to detect it:' R# d+ G5 X; }  K* \, y

- F# K  |9 F7 F2 j- h0 Q3 l     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
) b3 P$ h& W+ D, u+ J- m2 w8 `. f' x4 b+ i+ w' _* H9 x
__________________________________________________________________________
. v, p9 ]* o! d& @* c
) _. ~% O4 o# v; C+ e! v  h( P5 A) D8 y# g5 X) D( o% ~
Method 14
0 m8 R# w) x3 d* ~=========8 b! D8 w+ G- Y+ Z' x( r$ @

% q/ E- U3 I  L7 K6 TA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
# G6 L, }) F" h  }- Xis to determines whether a debugger is running on your system (ring0 only).  G, A5 f! g, X7 ?1 L# B0 T
8 W( |6 a! y1 I9 \+ O1 k0 ^
   VMMCall Test_Debug_Installed
- X- M4 f/ E# P4 Q8 i* x   je      not_installed% N: j- u$ y4 |/ X5 e5 F

: D2 Z" i) N: Q  a. YThis service just checks a flag.. i/ C" M0 T9 K' }2 A
</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关注公众号

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

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

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