About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>3 V5 q$ P' G4 ~" k! i- O+ Q( k, e
<TBODY>
6 i- p. r, W1 E% |! D<TR>" l. [. G9 U% V- @( l
<TD><PRE>Method 01
! t) G: }+ f! |=========
% [8 H$ ^6 [% p; Y! W0 Y! F
: I& t4 z, v3 Z) ]This method of detection of SoftICE (as well as the following one) is$ G& F, m7 t, L* k
used by the majority of packers/encryptors found on Internet.
# _. ?$ r) m  G5 Y6 ?0 A5 OIt seeks the signature of BoundsChecker in SoftICE
; Y. P5 S' _: R6 Z9 o& l, [
% C/ F2 F# w4 l) e: ?    mov     ebp, 04243484Bh        ; 'BCHK'
1 n4 w+ }4 z! J1 G) R    mov     ax, 04h" A2 {" E& j. q, |
    int     3       * S  s8 a% ?# C/ Y! _
    cmp     al,4
7 p1 k* O& A: U0 w/ j& p    jnz     SoftICE_Detected
  M- L4 P6 e8 v6 T# B5 F) U
$ w, ]4 D* v. D___________________________________________________________________________. t. i& |* g2 X% f
: j, I- L/ G/ E6 l7 {
Method 02# c* B" u- G1 w1 T# y
=========7 i2 E4 E. t4 L; ^; K

2 T& c1 T* p; K/ F3 K) |Still a method very much used (perhaps the most frequent one).  It is used
3 g% j7 d2 i3 U8 yto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
+ g" Y( H# H5 O& ?( Uor execute SoftICE commands...
, c) n1 N1 A: ]6 n9 ~It is also used to crash SoftICE and to force it to execute any commands
9 I5 \4 o0 F! k7 ~: A; Z! X5 i(HBOOT...) :-((  
$ V  }' c; P5 t8 e0 O
9 d" i# s: e% F9 N  e, Z' F& DHere is a quick description:7 [+ t5 L$ T" i
-AX = 0910h   (Display string in SIce windows)( N) G' O! w& U" B
-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)) D$ A! d7 \4 v  e! o9 T0 v
-AX = 0912h   (Get breakpoint infos)
' h9 g9 p! ^7 N1 W+ q( C-AX = 0913h   (Set Sice breakpoints)
( B0 T" Y7 P+ c( F5 a* v) X8 v-AX = 0914h   (Remove SIce breakoints)! ~0 {& G8 Y+ p4 {
, I- [9 n5 ?( H. v8 K2 ~3 H: }8 D
Each time you'll meet this trick, you'll see:- t2 X% ]+ G. I4 s! U
-SI = 4647h
% Q- `! O" e& i, M! T3 ?1 p4 U; b-DI = 4A4Dh+ S4 a; d$ d. ]. o6 Q; q4 n8 T
Which are the 'magic values' used by SoftIce.( I$ Y  q+ j# J( d/ Q) [- ~
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
5 f+ q* L  _9 ~5 j. B8 I% _% m/ W
# {8 o8 O8 T3 n3 r) S: A4 GHere is one example from the file "Haspinst.exe" which is the dongle HASP
/ M% ]: h. w! {8 _; p* _Envelope utility use to protect DOS applications:
6 k( i' o% r( G  d9 ^9 l9 Q8 O5 F& u/ |) N9 Z

+ l8 \- o* g9 }; y# {. `! i4C19:0095   MOV    AX,0911  ; execute command.8 {# y' t8 L/ r
4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
" R! F7 C' F7 v' I" e7 t6 E: m2 u2 P" P4C19:009A   MOV    SI,4647  ; 1st magic value." e/ L7 m  a9 y
4C19:009D   MOV    DI,4A4D  ; 2nd magic value.' Y/ e9 e7 B* U1 ]7 d& ?, t/ e
4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
4 |% g: n7 M' B1 {$ r4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute
: f( f! I, b' r6 f# \0 i4C19:00A4   INC    CX6 \: C! z; }* E# S
4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute
+ h9 \! U# h, S+ w3 v4C19:00A8   JB     0095     ; 6 different commands.
1 n0 E- }2 l4 B7 I) z7 e1 Y4C19:00AA   JMP    0002     ; Bad_Guy jmp back.! o% }0 h2 m' a: a2 v' J" A
4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)
+ p- x' D, J/ w1 x
/ I( f- o1 e( Q9 H' OThe program will execute 6 different SIce commands located at ds:dx, which7 Q1 a( X1 S) l) P( z9 ^
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
' F$ r! Q  x, i8 \! |( r) }1 x0 e
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
* g" q! R, V6 D. _5 ~___________________________________________________________________________5 i* h' A$ {5 X9 z# U; y4 ^) \$ b5 S

1 D( ~- Z& F! k! n% C% L! L% ^0 b8 W0 u3 k
Method 03
6 v0 y6 ]; }! C% p  A) W$ `* R/ q! C=========& s! @5 T4 [  N" ]. W
' g* ^7 o; X" d& }7 b
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
4 p6 j" m! Z* S2 Z* p; }1 Q4 D(API Get entry point)  U5 _1 g6 B5 N6 L2 R0 `
        # K$ H  _: Q" G/ j7 Y
% E! J2 j) M! j2 ~
    xor     di,di
! {- }2 w4 ?5 N3 M! b  X    mov     es,di
3 ^7 G3 I& s. u' Q; B    mov     ax, 1684h       : M- ^* P8 V3 {4 u
    mov     bx, 0202h       ; VxD ID of winice9 t2 C; q) J; m& s. r% c1 r
    int     2Fh4 _3 P- P! S* q, i5 g
    mov     ax, es          ; ES:DI -&gt; VxD API entry point& Z; ?5 X. P. l0 E2 M. U9 ?5 G
    add     ax, di9 s$ i( }, T& {
    test    ax,ax
! C' x. J% a. `# w& t    jnz     SoftICE_Detected
, v5 W$ Z$ m' d$ A7 j3 V1 {  ~
/ R- o6 R: V* |___________________________________________________________________________3 A2 \! R* ]/ _3 ~
/ Q. T0 n1 B8 Q& G
Method 04
  b5 J8 g: P8 l% Z3 ~1 B& d; z, a=========
# O0 i5 n" ]: d) R( k9 K8 ~) }3 z" m  n5 `  I3 t
Method identical to the preceding one except that it seeks the ID of SoftICE
5 X) v; V/ I  J8 ?7 mGFX VxD.- {' h1 U- u2 w: f2 v% [" A$ Z

. b& w4 u4 |8 [/ l7 U8 ]    xor     di,di
* c* V$ s+ c3 }, B: T5 f7 C1 @    mov     es,di
6 [6 I% k! U. ~$ y    mov     ax, 1684h      
( {# Q. ?0 D7 D' L6 a/ T7 U% o    mov     bx, 7a5Fh       ; VxD ID of SIWVID/ R; L7 Q2 D/ O
    int     2fh
2 d& s5 x5 R- }& s: U    mov     ax, es          ; ES:DI -&gt; VxD API entry point
. q( P8 f$ f1 [% J; y+ N    add     ax, di
: t5 y# q4 C3 d7 r. B    test    ax,ax6 V& m. l' m% }3 t& F
    jnz     SoftICE_Detected+ Q) G6 T" Q' |, p' h1 Z

( e# J1 J5 w$ }* G__________________________________________________________________________
3 S" h  e, h4 c6 L, t: f; y* M9 P$ \& S
& L: j1 E! F) y& q4 ~. O; k# }
Method 05; e, Y! `1 W0 g, b1 N( K
=========: x5 H5 O) d" _& c% n1 y
# P9 t  P' X4 w
Method seeking the 'magic number' 0F386h returned (in ax) by all system$ b( k  Z' K9 N: |
debugger. It calls the int 41h, function 4Fh.8 ^) G9 d' Y7 r! J5 I; d: [9 f
There are several alternatives.  % G# }3 k! }3 x7 x2 L

" e% x( m# n* n* _% S5 _The following one is the simplest:
" o1 N9 P3 u! z+ g# M8 F. c' H" K+ @( H3 M% j' y* \0 u
    mov     ax,4fh! I' t" @" e  w$ b( e$ @$ g
    int     41h
: s! n4 i5 K1 {9 K. H# |# k    cmp     ax, 0F386
  B& T! {, [- ~    jz      SoftICE_detected' k( Z" X5 u- P# U: o$ J/ {, L
1 o( J, L  @2 U$ \& Z; x) n# \' l

# e4 o& u! V% nNext method as well as the following one are 2 examples from Stone's 5 f8 D+ g+ J* s# [% Q  C2 l
"stn-wid.zip" (www.cracking.net):7 K5 u$ y7 W3 v* F  _/ i
7 s. V1 G, E' V# [
    mov     bx, cs5 X* _7 v" D; J: u' Y
    lea     dx, int41handler2
' X: a1 `" W, Y0 T+ ]+ F    xchg    dx, es:[41h*4]/ b; i2 ^6 t% g# f
    xchg    bx, es:[41h*4+2]# ~  v8 Z/ ~& A
    mov     ax,4fh/ ]6 W( f0 C% H, V* X
    int     41h# N% Q7 l! |( q" o8 C
    xchg    dx, es:[41h*4]/ Z; N7 y% e7 \! `, |* M5 d8 k; `
    xchg    bx, es:[41h*4+2]
9 N1 l! o6 X8 l) w, `3 R1 k9 ?% E/ A7 E    cmp     ax, 0f386h
6 `% I2 c" n  V+ n+ R    jz      SoftICE_detected
: x5 v- {' `* f! s. p, g
0 ]0 n$ Z9 ]. L# D6 B6 Pint41handler2 PROC
2 r8 c( e0 z+ r, d* @" u: E. @2 t1 \' q    iret
  d  g; y" f( p' w* A/ rint41handler2 ENDP
6 k2 Z  x( `, X+ w- Z$ f1 G" u
/ P/ d& l. a# f
1 E. U6 n) o' U( [, @) H_________________________________________________________________________
9 J/ u% _2 G3 \' Q1 J4 \! b8 F0 m# r% ~  f+ l$ K6 y# z

6 i/ t' N( u5 x( n8 u, P6 ~( bMethod 069 ~( U; d( g% d* z2 p
=========  }" x+ D) i% E! o3 P
9 c& X1 G; l7 ]3 h% s
. ?4 Q- ?# ]( @8 X
2nd method similar to the preceding one but more difficult to detect:5 S9 _1 y, i& g
! A1 w9 g0 u6 J$ K( F( V

& u4 N  n) ~3 v( A) oint41handler PROC+ D# Y: \+ }( v
    mov     cl,al
' M( Y" X! v  z3 [- p; ]8 u    iret
- `2 q- H9 }' J: D, Q$ O1 zint41handler ENDP
6 ]- d9 |( d- K2 x+ R' z+ D5 _0 @+ P; `. P+ m3 S
: G3 o; q0 M1 |1 b& A; Y- U
    xor     ax,ax
. Y/ ^' W' v! n& u$ b    mov     es,ax
2 \& Y8 k- a4 z! {2 P/ a4 j1 k. F* M! B    mov     bx, cs9 f5 Q% ?* k' K* g, D- Z2 w! ~5 y
    lea     dx, int41handler: a5 G- a/ w& T, \: h' j+ n
    xchg    dx, es:[41h*4]& X# ^+ d5 ^5 K. ~6 @
    xchg    bx, es:[41h*4+2]  J0 G) Z' ?, R9 _  W' R" n
    in      al, 40h$ f2 ]. k+ A4 x  y: Y8 V/ x2 b
    xor     cx,cx
. x. t5 p5 e8 R    int     41h# n8 V% z0 k1 e/ z
    xchg    dx, es:[41h*4]/ {7 n5 ~  ]. M" f( U7 p
    xchg    bx, es:[41h*4+2]
  t1 M; n2 s+ V8 b# w    cmp     cl,al2 ~0 n! m' y0 s( C
    jnz     SoftICE_detected
5 t# U8 _' L/ o: l# ?' ]' n9 W4 G2 L5 a
' A4 N0 q5 V$ E8 P2 i( ?: C( [' |_________________________________________________________________________# J( h0 [: {- O+ ]. K4 z6 ~
0 U- s/ ~, q, D6 I2 [
Method 07! ~- {% N/ F' _
=========& ^6 T! W( k( v# n3 _0 r9 R

( N8 |9 ^+ Y5 L% K  JMethod of detection of the WinICE handler in the int68h (V86)
* a+ M1 k/ k, C. V
# @" j. y3 d' Q3 D2 O    mov     ah,43h- ]" ?3 `# n& U* A' `
    int     68h; }) H7 ^/ R% ?9 S& a4 [
    cmp     ax,0F386h6 f7 k- H- o2 V0 q
    jz      SoftICE_Detected2 k, ^& K/ f7 {

4 N* z- T5 i$ r; S& R( `: Y( P2 C& I
4 y8 c0 q) E- U2 u& p, X=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
/ ?$ e. c: x3 ~5 W$ l) v   app like this:' ]: a& {" k& j5 j

( R2 ~5 @. k3 T5 H   BPX exec_int if ax==68' D8 h5 z" \) A( |1 v
   (function called is located at byte ptr [ebp+1Dh] and client eip is
, z' e; J/ X- M   located at [ebp+48h] for 32Bit apps)" y* i9 P; n9 k1 F+ O
__________________________________________________________________________1 x; D/ e' {' X

9 r8 X1 n8 ^! g1 U4 m. ~+ n& n$ q4 ^2 A: z7 C
Method 08
. g# U6 B: R, E! N/ ~$ [=========% C$ P+ U, _1 _+ ], L- W5 Z

, P! N# j$ ~' Z4 f, w) g7 bIt is not a method of detection of SoftICE but a possibility to crash the# Z; U% H/ ]/ U- g6 d
system by intercepting int 01h and int 03h and redirecting them to another! [  ^9 \0 g  J; v
routine.. R4 ]( V7 v% a
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
$ a' T, w8 F* Q' Q0 t, vto the new routine to execute (hangs computer...)) N" N+ D" _  k
% a& ]' [* B% @* W" S/ C; l
    mov     ah, 25h
& v1 E) X: O( g& [9 f+ V7 C    mov     al, Int_Number (01h or 03h)
) f2 o$ E6 l% ?# u; d    mov     dx, offset New_Int_Routine
8 N/ }5 z8 {4 k2 M5 z2 B& n+ k    int     21h; b% x* O+ Q" O' X& o9 ^; G& L3 |  t! [, U
" X" n) \1 S' G6 e- j2 y5 H2 N
__________________________________________________________________________7 A3 w0 F) F; F6 V  w7 S
8 q: ?. g5 Y2 h
Method 09
$ ~" V! s! V: H1 E; n=========
% c! o4 t3 a* ]9 [# P4 k
, i9 n3 K' Y* s9 {+ ]) _1 `This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only* z. Z) F6 X8 C7 M7 `$ R
performed in ring0 (VxD or a ring3 app using the VxdCall).
- x3 M) f/ h4 Y- ]- H. q+ r1 @9 @! Y$ BThe Get_DDB service is used to determine whether or not a VxD is installed
* c! l: t9 q. R" V' b- V* Qfor the specified device and returns a Device Description Block (in ecx) for
6 h* L. A: c% kthat device if it is installed.
$ ]8 ?  E& r, `4 @) H) o0 n% a; i/ N% i; }
   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID
8 l8 x' U2 I: C8 U   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)2 J  C5 P/ m+ p. n
   VMMCall Get_DDB
0 A& b6 ?2 G% Y/ N/ m+ @% V   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed" c8 Q& h0 c# L' r

) z9 I0 v5 K8 W' N8 SNote as well that you can easily detect this method with SoftICE:: Q7 w# ]$ l; |* Z
   bpx Get_DDB if ax==0202 || ax==7a5fh. b4 B' w8 X/ e0 y  G& N. h

/ n- p& N1 I% Y- F. C__________________________________________________________________________
! d2 x8 _: {1 [3 `6 ]# `$ I
6 H# [) I! J8 m* zMethod 10
2 z+ `9 H' p" _( w! ]* F7 M=========
4 r* W1 u' V6 Q7 T* t4 J+ F% [% q  E8 K5 G) ~7 J
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with6 R7 b* N. \7 `
  SoftICE while the option is enable!!
# h. m7 f( Y2 s4 a% y% Q5 y  s! p4 i2 I' a9 T+ i4 J. o
This trick is very efficient:2 L2 ?( w( Z+ p" H
by checking the Debug Registers, you can detect if SoftICE is loaded
4 [% Y+ o8 s& ~, K(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
) q2 b( Y! l# x9 p: ythere are some memory breakpoints set (dr0 to dr3) simply by reading their
5 ~" M, i5 G9 D# a9 c4 B3 M1 Uvalue (in ring0 only). Values can be manipulated and or changed as well) n7 g  |- w# s! T; v% Q! I
(clearing BPMs for instance)
% ?: K9 F& H4 n6 l7 G& F8 s. l# ~) g  Y
__________________________________________________________________________
5 J- n0 {; f7 a: F( O; ?2 ~! B1 [2 M& j8 r; L# y- ]- m8 V
Method 11! N0 F) |7 |% ~+ Q4 l5 I
=========
; Q* Y3 W) ^6 ^8 z
3 ]" z  P$ j6 p1 {( S, ~This method is most known as 'MeltICE' because it has been freely distributed
4 M+ _( \: c5 H7 p" P# c+ mvia www.winfiles.com. However it was first used by NuMega people to allow
( H- d' S( P# j5 n3 i- LSymbol Loader to check if SoftICE was active or not (the code is located
6 u% K1 L4 s* ninside nmtrans.dll).$ W' w' H% P) [- {: Z0 r
' T+ a- g4 e* x2 d, T- |
The way it works is very simple:
1 A  w5 p/ ]6 e) pIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
$ {, A6 s2 I% V" j0 _WinNT) with the CreateFileA API.
& m% N% R7 _- `) b) }; _+ B
0 v  P7 \& l, h6 vHere is a sample (checking for 'SICE'):
4 m" v0 x7 V5 v; f/ @2 ~' K: {0 ?9 ]8 Q% W& o
BOOL IsSoftIce95Loaded()8 G9 B! j- Y% R: D) r5 m& `
{
# q( p1 o4 v. ]  c# ]1 U" l   HANDLE hFile;  / R: F" m+ _  ^1 |  ]/ Y) K
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
6 P! K# M" O' ~0 D, O$ t7 _                      FILE_SHARE_READ | FILE_SHARE_WRITE,- E* \0 }3 L* ?. B  q
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);( {( m( }# V& z4 f8 R0 B
   if( hFile != INVALID_HANDLE_VALUE )/ R) p0 a# E% h7 o
   {2 F! T* I1 Z7 f  K+ w
      CloseHandle(hFile);
) ~# i, Y: N" V/ Y* g      return TRUE;' t/ ^" D' M! }
   }% r6 B/ B( z4 o
   return FALSE;. \! w, F1 W5 n
}" n7 Y# y, U4 a( q

9 S! n( \8 I; x6 vAlthough this trick calls the CreateFileA function, don't even expect to be
! F0 a& J. o5 r+ U* w% G. h6 J9 Rable to intercept it by installing a IFS hook: it will not work, no way!  c- d/ ]6 n: j+ d( H
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
2 r' Q2 Q8 U2 A% @, |7 Wservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
, o! B6 S9 h* D3 Y: O- R6 C# jand then browse the DDB list until it find the VxD and its DDB_Control_Proc  G9 p: u4 m& `7 }$ x1 n3 K
field.
6 c7 e+ J% a' @/ T2 u) mIn fact, its purpose is not to load/unload VxDs but only to send a & j% U# r9 z2 i6 u- G
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
  i7 r6 W% H9 Hto the VxD Control_Dispatch proc (how the hell a shareware soft could try; h9 \8 l- K! w; D7 P2 a4 p2 v- s, _
to load/unload a non-dynamically loadable driver such as SoftICE ;-).7 b9 m6 Z6 V1 p7 ^/ l
If the VxD is loaded, it will always clear eax and the Carry flag to allow! c1 j$ Q0 |. d7 ?& k9 I) y& [
its handle to be opened and then, will be detected.* c4 G" R8 q# X  r) ^+ a' X+ z
You can check that simply by hooking Winice.exe control proc entry point! T9 N1 e, N& P6 R
while running MeltICE.2 m7 f3 }0 ?  Q+ P  y) F* o0 D/ e

; r; P' u  m8 L( ]
' K9 G: ^3 Z" n. q  w2 C* [7 C  00401067:  push      00402025    ; \\.\SICE
) r: W0 m4 [8 x; G5 f  0040106C:  call      CreateFileA
1 S( f# {% k5 [, Z, D  00401071:  cmp       eax,-001
9 k/ t/ j3 f$ r. e2 z  00401074:  je        00401091
5 t6 s/ F* @- @% O
# r9 B; @( c, `  _0 k+ r' Q8 c, w$ E+ k% K/ I6 [6 V9 N/ C
There could be hundreds of BPX you could use to detect this trick.& H9 C0 k+ E6 Z# O) }: L& }6 D
-The most classical one is:
" ~$ \9 R+ o' I9 K  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
3 Q% V5 j: T. s$ X; o5 k2 M    *(esp-&gt;4+4)=='NTIC'  [6 |9 C, X$ y0 W

  n4 {$ x2 P8 e: L4 O-The most exotic ones (could be very slooooow :-(# E( i! X) I4 |+ y6 ~6 i
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  - U1 J& W  O$ V7 ?6 n
     ;will break 3 times :-(
8 O! Y+ Y; [8 \. E0 i+ B: U5 Z0 c0 ?8 I8 H: p
-or (a bit) faster: * G" e' n/ l" j1 S( F4 q* [
   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')' ^8 C( Q7 N3 K* H

; F) j) Q+ W8 w1 J$ _2 T   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  3 P$ e& y+ |. ?& C0 }' V" V
     ;will break 3 times :-(
4 ^! ~4 R) |% ~  x4 D5 @! ], M; c1 Y  G, M; D9 o9 L1 D# s
-Much faster:0 I: n0 Z, d5 x$ n
   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'
, V; H& J# @# i: H: c6 i
( v$ H2 y( R: g( \Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
) K; o( s# K: i1 ?2 c% a7 }function to do the same job:
- R/ _  {# G; B6 q/ R9 U* k) T( m4 Z* W
   push    00                        ; OF_READ0 o5 [, F" O8 M: }% R( f% j
   mov     eax,[00656634]            ; '\\.\SICE',0
$ N+ {' R! \* U& S   push    eax
$ A' \7 L2 V8 j, z  p1 [3 E  v   call    KERNEL32!_lopen
! i8 l5 a; |# A5 l   inc     eax
, p3 X: s9 u7 T' Y! }  W, p   jnz     00650589                  ; detected$ T$ N7 F. t3 h; Q+ f1 t2 F
   push    00                        ; OF_READ
$ b: {+ U' x+ e9 }+ W. w/ ?* x) ~   mov     eax,[00656638]            ; '\\.\SICE'! i; O# e2 k9 \+ S1 o' p0 q6 l8 A7 R
   push    eax8 h4 X' _1 c  [9 ^8 [
   call    KERNEL32!_lopen
2 S* u- q* A8 b% L   inc     eax
' o. p  {+ B( k   jz      006505ae                  ; not detected* u0 r; j, Z: B7 R$ `
; }7 G6 \6 t1 W: U0 V$ U
. O  N( e; o5 G5 k4 o
__________________________________________________________________________  E3 I* K, p! r6 t9 p9 L" t7 F
5 w+ F& G# o; {( \+ X
Method 127 U4 J8 Z: I9 e# b5 t9 T" Z. ?
=========
0 V' n9 O" I2 l9 n' r6 l4 W2 u: x% r
3 a3 F: |) j6 q4 c, [This trick is similar to int41h/4fh Debugger installation check (code 056 f# _% [- w, x  t% n4 D3 F
&amp; 06) but very limited because it's only available for Win95/98 (not NT)
  `/ e# O, o( w/ c( ^$ Yas it uses the VxDCall backdoor. This detection was found in Bleem Demo.0 P6 H. o( n0 `% I
. A7 ]2 E6 f3 S* H' A
   push  0000004fh         ; function 4fh
! m2 }) |! _$ z! v( V! @8 I   push  002a002ah         ; high word specifies which VxD (VWIN32)+ \9 ~" k8 |# \! b+ i: p
                           ; low word specifies which service% U' X1 l1 d8 g7 U7 R3 n
                             (VWIN32_Int41Dispatch)! r4 e( V* c1 R6 w
   call  Kernel32!ORD_001  ; VxdCall
) r' F  p; i2 {+ G. m   cmp   ax, 0f386h        ; magic number returned by system debuggers
# h  i% P; P2 z   jz    SoftICE_detected
' r! y5 l" r0 `+ W, ~( b
: ^+ ?0 E0 i# p! Z1 O9 ^; THere again, several ways to detect it:& m4 l( H2 q/ b, b
- V5 Q7 p* S, Z0 g. }5 D# ?3 i
    BPINT 41 if ax==4f& }* }6 V' V& s6 z

" R& D5 l% U0 W    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one, V9 u: w; O! U# P
2 U: h( l" S" k! o$ y- @7 g1 C
    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
) g5 `. R$ @9 O0 q8 @3 x5 `( S  D7 J' n+ E: m9 J! {
    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!1 Q' i. n) S% b4 Y+ M  h" C! Z

* F* d3 w8 t5 H2 j__________________________________________________________________________6 I& e& k% j  \. Z
, |9 S8 G) I! t& Z  V
Method 13( y; ]$ _9 o) j, }9 P
=========
$ n5 D/ ^) ?4 t  _0 L  L, t5 g# d  _! [. \
Not a real method of detection, but a good way to know if SoftICE is
5 B) w, ~( a8 D$ X4 B3 u- Xinstalled on a computer and to locate its installation directory.
' [- F, r7 e) I" W$ T2 yIt is used by few softs which access the following registry keys (usually #2) :
4 E( i* C0 i' z5 |3 a) u
- h- s- i0 \5 ]-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion3 b  i9 W5 x* U+ }
\Uninstall\SoftICE
$ f# p/ {1 z, z& C7 t-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE4 t& A7 ~5 J8 C, }& V1 ^
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion5 l" E) y7 J; @
\App Paths\Loader32.Exe( C! {/ R9 h: M5 _8 A1 C. W5 e. c

6 q: n( u- C9 J& r9 _- f: O3 I9 @7 O5 l1 m) o0 {
Note that some nasty apps could then erase all files from SoftICE directory2 S7 {3 s. `  e
(I faced that once :-(: T' A6 ~: A3 m& }' B& u$ p" n

6 V6 F0 q/ X8 K# r- z! C! d- HUseful breakpoint to detect it:
% ~# ~1 T2 x$ y$ j) h; s
. E: I. V+ u: j) F4 F! u7 u& |9 Z     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'+ @' Y; ]2 e% @' ]; _+ Z* C5 ^  r
$ W; z" s% V& [8 \; a7 H& W
__________________________________________________________________________4 M" k1 c' o) |+ o" x' s$ E
- \) j/ p! x8 ~1 U9 N$ ~/ K
) |+ g3 X/ _9 \" h$ _$ Z% N
Method 14
& m' z0 U1 T# f=========
% h3 h, c% \+ [: b8 a% ~
  R2 Q6 e0 ]0 j3 S# h* {3 TA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose3 Q' }: `! v* Z
is to determines whether a debugger is running on your system (ring0 only).
( ?+ s7 }$ [6 l9 \& \
" j/ J; s0 Z  ~  I1 _   VMMCall Test_Debug_Installed; h* @  W6 O% K9 p
   je      not_installed
  P& j5 d3 F0 W% o0 Q0 j$ u4 ]
1 W5 l4 u5 ?( H/ n$ k( q$ IThis service just checks a flag.
  m: L- |1 K6 n0 n, d</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关注公众号

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

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

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