About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
) l, {1 m" B" a: }- K/ {<TBODY>  C8 ]2 G. k4 c
<TR>; |& |# F- b4 _  W, M# {: {9 q
<TD><PRE>Method 01 & N4 x, ~. O2 E5 i7 d0 a* b# d
=========. o' g0 @% S# k( X! {+ I' h

* b6 M/ u4 H0 V( V3 ~, \3 _$ PThis method of detection of SoftICE (as well as the following one) is6 U5 `# w) K4 J1 Y) ^# U/ T2 K1 m
used by the majority of packers/encryptors found on Internet.
) c0 {) g* Z) p( w& SIt seeks the signature of BoundsChecker in SoftICE
! q0 `  n7 e  y0 I: x) \5 f- o: `4 K2 j' V2 d
    mov     ebp, 04243484Bh        ; 'BCHK'
6 M' K* A7 ~# c/ w- }    mov     ax, 04h
. g% t/ r8 F7 @& G3 c+ z6 ~) w    int     3      
/ ]' ]& x! j1 |; W, I. f. W    cmp     al,4
5 G  N- |) S8 o) i5 [    jnz     SoftICE_Detected
; B; |# ^( _& D" r5 G: o4 v) k9 }* l4 T3 O0 {
___________________________________________________________________________
# a- M. B: n7 Q- S* b) \4 P: X9 i% R. F& q+ v+ Q& w0 K% e9 l; m4 u' }
Method 028 d/ M) ~7 d4 i
=========0 r% _! G# y6 P% q+ _
# q% ]8 N7 V' b' \9 k# e
Still a method very much used (perhaps the most frequent one).  It is used$ B& s$ S5 q! v) W4 S- W
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
" \2 {6 A2 p+ c  B1 [or execute SoftICE commands...
9 y+ n9 z: U4 k* {It is also used to crash SoftICE and to force it to execute any commands
  A* O1 ?) S4 H& r(HBOOT...) :-((  " ?, T# a9 D+ W6 i
4 l# D7 K0 M/ g& j! k. i6 v
Here is a quick description:( D) }0 ?) q3 K) K! ]8 g+ |% N
-AX = 0910h   (Display string in SIce windows)! |6 ?+ y# y; x& v
-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)
) Y1 q) f$ v$ x4 D* [* @  U, _: S-AX = 0912h   (Get breakpoint infos)
2 B: L/ M1 K6 ]: l. Q8 z1 ~-AX = 0913h   (Set Sice breakpoints)
# L( f8 _8 A8 H; |& m-AX = 0914h   (Remove SIce breakoints)
6 C+ Q: r  E* g5 R. J" a
: d+ Y+ C6 ^! X8 z9 @Each time you'll meet this trick, you'll see:
+ _: @" X$ I; v-SI = 4647h
/ b4 m' o& O0 R) o% V6 D' Y, ~4 _  I-DI = 4A4Dh
1 J- X9 n0 \8 |. V) GWhich are the 'magic values' used by SoftIce.- x. b' b! j6 l$ ?1 |
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
! N& t$ m, p4 w0 h# N  e* v( f8 S& M9 h3 d9 d
Here is one example from the file "Haspinst.exe" which is the dongle HASP
0 Z# d2 @5 X6 {9 z4 TEnvelope utility use to protect DOS applications:' R1 ~% G$ X3 \

3 [7 w  M' F6 Y$ V, e9 w7 n/ V" T* Z( I- l1 G+ ^
4C19:0095   MOV    AX,0911  ; execute command.
( ~+ h  M' W5 ~: Q% v, V8 D4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
4 f3 f5 o( q4 c% `9 U0 v4C19:009A   MOV    SI,4647  ; 1st magic value.
0 l3 P$ P9 ^7 G4C19:009D   MOV    DI,4A4D  ; 2nd magic value.
: a: E. ~, ]$ ^  X9 y& L# k& T4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
: E, [! O# |4 Q' K4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute! {5 t: W, Z: u' {$ P3 s4 O
4C19:00A4   INC    CX
' ]( B. y3 O' A+ {2 d$ O4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute; f, Q" C$ v, N$ h1 ?8 \) o/ w
4C19:00A8   JB     0095     ; 6 different commands.7 O# I& F2 B; p$ ]3 T5 [; n
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
- P: G: D* N" Z9 z4 G% T4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)' h' f$ Q9 v" w$ }6 c0 ^

9 x5 h1 \1 b; h" D7 `The program will execute 6 different SIce commands located at ds:dx, which
6 v9 [$ v+ h- Vare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.# [8 H0 b6 n5 M  j
' D1 S5 q! r$ L5 A: Z+ W: U$ {# `
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
+ G+ \  ~# |2 ]0 E& U8 n8 ^( B2 T___________________________________________________________________________- l9 J, Q, w4 w- V$ C  I5 i( a. Z" J

; ^/ S! i1 Z6 c( M! x' j# i
1 ]; S1 ^" i6 Z' V1 mMethod 03% p1 ]; y$ g  O
=========. s9 B0 X0 W. t7 m) S$ _

- L$ b' y) ~* ^Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
# a7 I7 I$ v. u. K8 g( n( N5 _0 V0 I(API Get entry point)
, B+ @: g9 f+ w1 I. p" N( U% j        6 Z; ^  ]7 c  B
) s& n. T; G  {( @% ]$ ?. P
    xor     di,di8 e5 p6 m  h( D( n/ ?7 u4 J' q% d) R
    mov     es,di$ T2 C1 O& S1 v: H6 [1 j  ?
    mov     ax, 1684h      
$ \4 B( X9 |6 N    mov     bx, 0202h       ; VxD ID of winice0 z& {$ r8 |8 |. P! i
    int     2Fh' F% u: v2 K& g7 h  s  g
    mov     ax, es          ; ES:DI -&gt; VxD API entry point; N% |* j# s# p6 I+ {
    add     ax, di% K( Z' y3 s) v$ G6 O' N
    test    ax,ax3 x, P- Q. [8 d
    jnz     SoftICE_Detected+ h3 ~: \( O& Q. i. `* ^  X1 t; x! O1 Z

) L* [( K1 J: c) H' l$ U/ ?; h___________________________________________________________________________
* m9 o9 [$ I+ u! H. f3 p, M. s  |$ _+ y7 P) i. I2 w% b
Method 04
( F* b" o0 ]' }6 b9 I7 c=========
( X! k7 p1 |- X5 }0 @! X
* L' W; m8 ?* l: s. U' {Method identical to the preceding one except that it seeks the ID of SoftICE
4 P2 D" y& |0 EGFX VxD.3 `- X1 h- n& m% ~* H4 c
6 m% ^6 n3 r4 O+ T0 n1 n
    xor     di,di/ H1 q1 F+ s  M; F0 ^
    mov     es,di  m1 z; o7 Z, O' }
    mov     ax, 1684h      
$ g' C& J  w) _7 z2 @- I, x    mov     bx, 7a5Fh       ; VxD ID of SIWVID
; f2 A6 |, y; E! Q% e    int     2fh
/ k) f/ L! z3 P9 y9 C    mov     ax, es          ; ES:DI -&gt; VxD API entry point
3 M5 a- l* d+ J5 i    add     ax, di0 n2 x+ d6 }6 X7 H
    test    ax,ax( ^' Q3 w/ D8 c
    jnz     SoftICE_Detected
, J5 _" t- D. h& |' J, L$ X* q" [) @, L
__________________________________________________________________________  }7 D; s% a0 u* h1 ]. H) L4 t+ m2 C
1 S+ {  K- F$ M; R( c) n
" [& a' @; X2 A
Method 05
  E' p8 f$ `+ [2 V9 Q, b1 r: m& S=========
% ?+ L* q9 F% ]4 \2 f' L+ f6 @' i3 c
Method seeking the 'magic number' 0F386h returned (in ax) by all system3 S3 R5 T6 h: Y7 l4 d
debugger. It calls the int 41h, function 4Fh.
5 s' D0 T3 z9 X' ~There are several alternatives.  
) L. n( j( r* i) g6 G6 L9 z4 C) j8 {7 s) m# c# h
The following one is the simplest:& S6 Q' x5 p) D* N* \0 p  [) ~, ?% q

/ d0 u% L3 G: |! W3 F. Z- J    mov     ax,4fh5 _4 O: z- Y  D( s! ~- r, w* z8 ?$ w, L
    int     41h
1 I6 x' l, Z0 O0 q# M% I& n    cmp     ax, 0F386. _# y7 P7 h/ g, E6 r
    jz      SoftICE_detected
4 b3 u1 D# Q4 L. v
$ Q8 T; N0 X! U4 ~
: j$ V/ y8 L) f( k3 p0 O  wNext method as well as the following one are 2 examples from Stone's
% e; T: J# B  a8 v+ |"stn-wid.zip" (www.cracking.net):
) R0 }% B2 S5 u) e/ S! H" c, e( p) Z( f5 s3 H. ]" _: k
    mov     bx, cs
+ A2 J( U/ @" l2 _" }  w/ Z    lea     dx, int41handler2
7 H, q  Z5 i, Y% E' [& U- l. e    xchg    dx, es:[41h*4]
$ j) p" [+ f; e! N- }  H$ g# H    xchg    bx, es:[41h*4+2]
& n- o% t- X/ w7 h  |* l+ K; n    mov     ax,4fh
+ \$ j  k0 O5 q* y8 b' J    int     41h
' d' a) g' S3 Y0 J& Z- B: S! U    xchg    dx, es:[41h*4]
2 |2 |2 W4 c( C, M# y: s. Z    xchg    bx, es:[41h*4+2]- \* e" N5 z+ q; y. r2 e2 d
    cmp     ax, 0f386h9 z4 `$ ~5 g4 x; Y# D! _9 Y
    jz      SoftICE_detected5 n1 A0 e9 F8 J+ T( P7 B
- X4 {" ^- S& y5 B! i8 d
int41handler2 PROC& T- Y: \- f1 ?9 a6 F. t
    iret' q1 U$ B% p1 C3 }* @
int41handler2 ENDP
7 v6 l, Q) A( l! E4 Q& k' |# ^9 ~4 J2 {$ T, v+ c, s

3 z$ n% p* A# z8 p_________________________________________________________________________9 J* K0 b7 ~. m. Z) m, i7 T
$ {8 |! T% `* \$ C. P" s

6 v3 x' I+ P, T, A- g- nMethod 06, w* O" B; W. T2 m0 @% o, k
=========
% Y3 o* _0 A; C+ Y
- Z: o% v! ^% m# v: Q
+ R. w0 O' C4 l0 i2nd method similar to the preceding one but more difficult to detect:
( L' N  U; A3 a3 d. G/ `9 a0 t: S! j& l/ c" S7 p1 }8 E/ _
/ X# G3 p2 N9 t- F8 ]/ N  B
int41handler PROC( E+ e3 s' I1 f, `
    mov     cl,al5 d6 {8 \4 A" E& V! x7 \$ O
    iret+ q0 x9 M0 _. z
int41handler ENDP' Y6 X, r7 y- ]2 f/ o
$ H# E6 \/ w- C- k4 |/ A

" }( P) U6 p+ n9 E0 J& x    xor     ax,ax
* m4 Y! r' i2 e4 l3 {  _" P    mov     es,ax. V; V2 v3 y' n: U
    mov     bx, cs
  b: [( r: X  n  C+ A- j    lea     dx, int41handler7 F9 M- L. k1 ?: X, ^: p
    xchg    dx, es:[41h*4]
3 G: ~# j6 a+ l" i% ^    xchg    bx, es:[41h*4+2]  I: \3 K. ^. \, _
    in      al, 40h
4 e! q4 J+ c5 {* N0 p    xor     cx,cx" |, F$ d: x$ C, I. ?, [9 M1 C3 n+ g3 d
    int     41h
, }# o* @3 h6 `8 z    xchg    dx, es:[41h*4]
4 u  }* m* F9 B. h) a    xchg    bx, es:[41h*4+2]6 [5 ^5 I& |( ?. C8 r
    cmp     cl,al% o8 y( e4 I, z4 V; W& G- k
    jnz     SoftICE_detected
+ \; P/ n( R, |) d0 j. V' E- G  T( [% A. S
_________________________________________________________________________
( @. S. J8 B5 `' C# y
& G5 ~. H# J  d% p7 U! R0 YMethod 07
4 y# z: X; e% X" d/ M. R2 b1 R=========
: F3 Q  A) R6 y0 u9 O( m8 p0 Z6 E
Method of detection of the WinICE handler in the int68h (V86)
% y% w# p8 R& s9 T! b
2 m8 p, r6 K/ [8 {" t3 {    mov     ah,43h
& i' d* u, Q  |" |7 `    int     68h3 J1 [6 m/ \2 Y% i  `
    cmp     ax,0F386h+ u! A' r) v( X" I  M
    jz      SoftICE_Detected
: h0 s8 `/ T; g4 m8 K$ |  S7 r' W9 V- q2 U. i: c5 O
2 U0 {! l  i, a$ a
=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit1 b/ A) Y' v+ e
   app like this:" _& X8 N' p( k0 u4 P& u
; v- F9 f/ l- D" `$ ^" T
   BPX exec_int if ax==68% f- s  R' Q" H7 ^1 J3 w
   (function called is located at byte ptr [ebp+1Dh] and client eip is
  l0 W8 w- y5 c* ?   located at [ebp+48h] for 32Bit apps)
6 r/ r3 w5 H4 Z; l__________________________________________________________________________/ u/ u+ p7 f& k+ v  }8 y

6 s: D5 s0 D. W' u$ n+ E/ s, x9 Z9 E' X
Method 08
5 _5 J" L1 A$ E7 D" D=========0 C# i  s  R0 [
% E: u1 E: Q8 B! Z/ l
It is not a method of detection of SoftICE but a possibility to crash the
6 W  d1 s. ^& z4 H" [/ Rsystem by intercepting int 01h and int 03h and redirecting them to another
1 a' u" }6 ?) j# r1 j' f  |- Oroutine.; S0 v0 t( ^- |6 Y; _* {
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points! d  P9 a. a8 k
to the new routine to execute (hangs computer...)
% @# B- s: w" k5 D9 X" V/ i) {( Y; D2 s/ Q: r: B, C" m
    mov     ah, 25h
+ n$ W! B# Q3 _! g  h    mov     al, Int_Number (01h or 03h)) m. v8 k3 S6 U% J3 |& k9 g1 C$ D
    mov     dx, offset New_Int_Routine
* h3 y! w- P* j: I$ F0 p, L- D( A# V    int     21h
  K7 ?9 L+ ]; G# Z7 h* I
" D2 Q/ L& s$ r5 Q  `__________________________________________________________________________4 i$ c8 X9 [# j. P8 x

& p1 H& A2 U9 f* s* rMethod 09- z+ w- b3 _3 s' i
=========( d7 T, c8 v" Q8 _0 h
# y( ]* }& @7 Z; C8 h
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only9 W! V+ E' G% c
performed in ring0 (VxD or a ring3 app using the VxdCall).
, m0 V# e7 @) }0 R/ Y, T! k* X: Y6 dThe Get_DDB service is used to determine whether or not a VxD is installed9 g* z# ~6 h. O5 f6 _) h
for the specified device and returns a Device Description Block (in ecx) for2 M/ n, T! @) ^. o, Y2 e8 ~
that device if it is installed.
+ M8 {7 A/ s( c! ^2 c; a) y- u  P8 X0 x$ a, N0 G) }, Y
   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID5 N  R, Y+ T: c+ Z) A" T
   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
0 W! g( I6 x: t! W   VMMCall Get_DDB' g: m: G5 Q$ O7 o) l/ ]4 l% i; [9 G6 U
   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed
3 p& B. o- a5 o. ~: E- a7 O! A: e$ h. o: m3 |
Note as well that you can easily detect this method with SoftICE:' R# i5 B, o2 `2 k/ k
   bpx Get_DDB if ax==0202 || ax==7a5fh4 D7 Z3 H4 B& F5 N
- d# Y9 O5 O8 f& `+ K" U8 E  X
__________________________________________________________________________
( {6 J8 d5 P, r
2 Z' d/ X- D0 ZMethod 106 u( H# x% O4 h' q
=========: T2 \0 t6 O3 n0 }7 o
( {: s+ I$ x$ \; S- e* s4 W. K: j' w
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with
9 J1 r- r. Z' S8 v3 k  SoftICE while the option is enable!!
& ~+ D. v% r2 _/ Z0 Z1 `2 I& j  X5 |9 n
This trick is very efficient:! c, _, C* U2 w9 T6 W
by checking the Debug Registers, you can detect if SoftICE is loaded0 ^* W8 y+ t$ ]' D  y3 N* _1 K
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
' x! Q+ P8 W% k; P2 W) M8 s) Hthere are some memory breakpoints set (dr0 to dr3) simply by reading their
5 \7 C4 w8 p& w) jvalue (in ring0 only). Values can be manipulated and or changed as well
3 g* w" k/ O3 y5 [(clearing BPMs for instance)
9 v: M) z9 ]) }9 v% j2 ]: ]! k, m  s7 u! O4 X
__________________________________________________________________________9 _+ `3 ?% i/ _! f, p9 @( l

+ x" k+ R8 n8 g! Y2 O  M3 RMethod 11
9 u6 B  ?6 a$ l- B' X! W* P- b=========
" s8 K) s0 n1 M: R% J$ [# ~; t  c; a( O
This method is most known as 'MeltICE' because it has been freely distributed0 u1 z  o. v% d1 `- x: m9 x
via www.winfiles.com. However it was first used by NuMega people to allow
9 n$ U8 p, S6 ~2 {- D+ tSymbol Loader to check if SoftICE was active or not (the code is located
& _7 N$ P/ L3 Minside nmtrans.dll)., M; W$ @1 F- M8 ~( R: x$ y" @
& B- t7 h' n8 r- B
The way it works is very simple:
/ O  w4 c1 Z- L- AIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
/ m7 u& _' z9 I0 P1 s, S9 BWinNT) with the CreateFileA API.
' g- A9 H+ T7 b) c, a( C
7 z1 D% L: ~9 fHere is a sample (checking for 'SICE'):8 D, w$ u4 b4 F3 q' j/ V

5 ~/ x% L1 q1 ?6 U( GBOOL IsSoftIce95Loaded(): D/ \  f6 V4 z, q+ o
{
, g7 h; g+ A: v2 @   HANDLE hFile;  
  H+ E9 J" }8 x2 c8 T   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
8 b1 E4 Q+ g; P6 N& v$ \$ J" d                      FILE_SHARE_READ | FILE_SHARE_WRITE,1 ]/ C7 v: s2 g8 y( ~6 n. f4 k
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
* n' |! u5 `- V2 P   if( hFile != INVALID_HANDLE_VALUE )
# _! |% J  b. G   {
, ~. B3 B7 M$ @' N  ~3 ?      CloseHandle(hFile);
- }, [2 c" h5 L: N      return TRUE;
) W1 P3 m0 a) y' `) l8 r   }
2 F& {3 f) K8 s& X- `0 _4 m   return FALSE;: {: M3 n0 [3 n& v" e
}
* C" b" c4 J& ^- D$ X8 O( m9 k; A! r  [0 q/ u8 @% p, C4 W$ H
Although this trick calls the CreateFileA function, don't even expect to be! u8 b) J9 V( x
able to intercept it by installing a IFS hook: it will not work, no way!
6 E# B# z3 i& t' O8 K& E$ RIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
7 v  f' Z6 z7 }! E' U/ E( D) sservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
$ B7 A3 f  S' Y* A, X2 Sand then browse the DDB list until it find the VxD and its DDB_Control_Proc
5 k1 n( ?% X8 t  M# ]: \, W' Pfield.
8 n% W) S* e" z  @: xIn fact, its purpose is not to load/unload VxDs but only to send a " r, q. z7 Q" L& v! i
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
8 q, j+ O8 J, J1 Eto the VxD Control_Dispatch proc (how the hell a shareware soft could try8 f* q9 \5 M! s
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
, a3 @, B. s0 G* z# iIf the VxD is loaded, it will always clear eax and the Carry flag to allow3 I9 @( F8 Y1 G1 m. E  A3 O
its handle to be opened and then, will be detected.
3 d6 Z' @! T0 f; l8 N/ u+ A0 vYou can check that simply by hooking Winice.exe control proc entry point
) e( m) R0 ?. K0 Q2 I: jwhile running MeltICE.$ x4 a& v% ]2 y; Q; e1 F- `3 M/ i
' P1 J; u9 n# a: a3 L, Z' ^
; y1 ^# I3 k0 n# a
  00401067:  push      00402025    ; \\.\SICE
0 F6 u9 ?7 ~9 B, S0 Z) p/ P7 y: u" L; X  0040106C:  call      CreateFileA
" |! L1 J% f( s3 s9 P0 A  00401071:  cmp       eax,-001% `5 Q  b9 j" T# U4 v5 [
  00401074:  je        00401091( X# q; L3 [% W! ~6 m8 L1 F! O

8 O4 F6 ~+ d$ C+ p  w. K) n
$ i) W8 k: k2 p+ o+ U% y% T& yThere could be hundreds of BPX you could use to detect this trick.. r" ]2 c! b  t5 e$ g
-The most classical one is:
6 I; G+ S" Z8 ^  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
; i0 O/ g$ ~  D! d& X; o    *(esp-&gt;4+4)=='NTIC'
2 h% V+ r! d& W) \( {# U! v. v" A4 ?( p! C- D, o
-The most exotic ones (could be very slooooow :-(5 S: e6 o1 i/ T9 B# Q! t
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  
3 q' K- R2 h7 W: G% u     ;will break 3 times :-(
8 x" |/ k/ Z3 H8 }. K& \1 I7 q: @" F, K$ A, n
-or (a bit) faster:
2 ?4 I% e( f' @5 d4 w) |8 T% e+ {   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
+ c/ X$ T+ g+ Z) S/ H: v+ l: e+ n) i
   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  6 [  Q. ]1 F& _* N3 N/ o8 f
     ;will break 3 times :-(3 }0 q( m, V* U# z
( ]) }1 p6 q1 P; _( s4 r
-Much faster:
: }* u! r4 E; @. U. E   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'6 J* D( B) [8 y3 z6 r

$ |% R9 |# z5 S5 d- ?Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
9 d  R7 s: X( V7 c3 `! ufunction to do the same job:3 ]. A! W& e& h5 T  ?8 a8 _
5 \( p; }# T7 c
   push    00                        ; OF_READ
# n5 `; Q& A! H! @6 s   mov     eax,[00656634]            ; '\\.\SICE',0! I, Q# V, i1 h" s1 ^
   push    eax; ~- R4 ?8 ~, w$ m4 C3 I! T
   call    KERNEL32!_lopen
$ y4 D* @1 L3 \1 t* S2 [/ V   inc     eax
. H$ Z, N4 {- X0 V' T# q- i   jnz     00650589                  ; detected
; Y9 o- x- g( v, b$ l9 ?. [- {   push    00                        ; OF_READ- C# Y! G1 ~5 {' \/ O! T
   mov     eax,[00656638]            ; '\\.\SICE'
9 }0 W6 }( I# Q) _5 \) y   push    eax
5 a# F/ B4 @' v; I! D! ?4 x   call    KERNEL32!_lopen
, k% Y+ b' s* G   inc     eax
6 p4 [* f4 c5 l' g( C/ I& K   jz      006505ae                  ; not detected
) e- M' Y/ p$ I  O4 n. }' \. ~& ]' d! X, ?! i* H8 A/ U9 s
$ h' o5 |$ w4 F4 ~! x
__________________________________________________________________________
' g: L+ n& X) w# U- w# x; _( |* I* i6 C: q) ^/ _1 i7 d3 A4 ?% I
Method 12
1 _, i- t' U7 N/ y* M; _0 S=========
* t+ K( u" o% [& V0 R# j7 i" d1 V6 ^! z. r1 p+ y' p* s
This trick is similar to int41h/4fh Debugger installation check (code 05% ^3 c. N. w' ~
&amp; 06) but very limited because it's only available for Win95/98 (not NT)
) ~. \. S: H! X" Fas it uses the VxDCall backdoor. This detection was found in Bleem Demo.; ?6 e, V! ^( Q2 J! \
. g8 H0 k9 e5 M7 @
   push  0000004fh         ; function 4fh* Z& s  l! [+ P  G$ j; U
   push  002a002ah         ; high word specifies which VxD (VWIN32)" `. q$ x! S# @4 c( N
                           ; low word specifies which service
$ |" A( z% V3 E8 t  p* O! S0 G                             (VWIN32_Int41Dispatch)4 G- T# F& c$ _3 q6 s+ j. v. ~8 Q. Y
   call  Kernel32!ORD_001  ; VxdCall( p$ r/ R* u% z* h7 R
   cmp   ax, 0f386h        ; magic number returned by system debuggers) z2 r5 N, u% K* i: H- F
   jz    SoftICE_detected
$ o' R& j. [, u4 g+ s& L1 V  L5 b( m5 j) [
Here again, several ways to detect it:3 e! U5 O! Q6 s

+ v0 l( |2 s* J9 n3 @& o0 k    BPINT 41 if ax==4f( ~# F- X0 @+ @" s+ ]

2 X& l3 K) s. y    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one9 ?3 V) W0 z4 H$ G

! _: V7 H; }* U$ }4 j5 t. B6 i    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A) ?5 s1 B1 }, f& P! D

* m, U( G) H- ~; m1 ~( \/ \% A    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!
/ }* F7 ?- N2 x. X  S
% ~5 n) n' A) q8 t__________________________________________________________________________- l* @0 s& t. H6 R' u% ^1 U6 m
6 ]; z6 T, g  e0 P6 `
Method 13
- O& M0 V+ S. ~=========
5 s/ v& G; S- i8 `) h1 u1 p+ n4 ?# F1 U0 @- }7 s  U
Not a real method of detection, but a good way to know if SoftICE is2 Z" y5 f; M* \! U, v2 X
installed on a computer and to locate its installation directory.
" b6 X! N! w5 u) b/ _- `It is used by few softs which access the following registry keys (usually #2) :* E7 _3 K8 j" R/ R4 V

# ~/ Y! Y! S! G. f; t4 h, A-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion5 g0 b& ?7 y0 Q
\Uninstall\SoftICE
( }, N, P( N4 U5 q1 e7 J* d-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE+ K- x+ T: U$ j! ^
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
5 J" l" Y7 |6 z" V* y  V7 Z$ D\App Paths\Loader32.Exe
! a; C7 s* p( e9 g# `
8 y' O# z7 _! d: a
* }7 ^/ d: n& r# ?+ ANote that some nasty apps could then erase all files from SoftICE directory
5 b/ A3 w: t% Q, A(I faced that once :-(" b$ p2 g0 l  n' K

" r6 X6 U- W8 Z3 a$ t9 qUseful breakpoint to detect it:" {$ I: H& P0 I4 _) t

4 h& y' \! f0 T" Z+ _1 @( W& u3 i     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'- ?8 `: F* R6 D* W! y4 e+ I

9 X& c9 c# a+ V7 B0 b% K, H4 t3 F" [__________________________________________________________________________8 @! H; I' e  K9 R, R5 t
, |5 c. s: E2 M8 R
' E. e! Q4 M8 l
Method 14
4 f! z3 m/ ^' \0 f0 g=========
8 X. A! v  B6 W* ?
  H. W9 x: g5 \A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose& @( G- C$ [% R% I
is to determines whether a debugger is running on your system (ring0 only).  O6 W! ~% T* r- m% B
7 \( o, w3 q$ j$ w1 z
   VMMCall Test_Debug_Installed
0 Z" L" I) t0 ?4 }5 \! h# F   je      not_installed
3 H/ i8 |& {0 K$ g( C9 I( m$ Y9 S/ o2 \+ N4 [
This service just checks a flag.
  i+ H& ^2 O% [; }, G! r</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关注公众号

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

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

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