About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
6 _; M) l5 s* k0 [0 ]<TBODY>& G- a0 t. F/ C/ Z) g" Z" L# n! e
<TR>
6 Z, F9 a4 W! u4 e<TD><PRE>Method 01 9 F" {3 Y) C5 t; h; G
=========
- o  A! W( S, ~: [* C; W$ C+ ~7 J4 w- ~
This method of detection of SoftICE (as well as the following one) is! C+ e% u3 a  W' D' r/ s4 J
used by the majority of packers/encryptors found on Internet.1 Q+ o1 O: P0 W
It seeks the signature of BoundsChecker in SoftICE
. C, J5 F9 r5 p
- `+ I$ _# E5 O2 w! f3 o    mov     ebp, 04243484Bh        ; 'BCHK'% |, R2 I3 d* a  ]+ C) V  Q4 x
    mov     ax, 04h' c; W8 Y0 S0 |9 c2 j
    int     3      
) @7 X: l7 R# _5 R: H% e    cmp     al,4
7 q1 ]. O8 d2 L+ s+ M4 g  w    jnz     SoftICE_Detected: r" Y$ O1 Y6 f% T" F3 y

4 s8 G) Q5 d+ S: V' k___________________________________________________________________________
& w9 w% ~  D  A$ Q
) k; d- S+ r) m: [! PMethod 02
: `3 n  r8 f, v: o- \=========
% O- e8 ^- m7 b: e- Y1 b6 z
. h) E, h1 V& KStill a method very much used (perhaps the most frequent one).  It is used
6 J4 e+ V* S& h2 ~' B: |: C5 Zto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
5 C* R9 @! [+ t; Oor execute SoftICE commands...% V$ J3 o) ^6 z" j: k
It is also used to crash SoftICE and to force it to execute any commands
+ N! G3 H/ |, N  q: W- W0 _(HBOOT...) :-((  
9 @0 I- {  N+ a/ }- \
/ |  L2 N( H3 J! x7 y  \Here is a quick description:# x! i' m' ]+ h8 M
-AX = 0910h   (Display string in SIce windows)
- s7 C8 X2 g, ?% K-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)
* S4 Q; j$ `, h% }7 h; ?/ J4 S6 U: d7 o8 Q-AX = 0912h   (Get breakpoint infos)
2 j& h! x  _! t4 Y& \-AX = 0913h   (Set Sice breakpoints)
( V$ F8 k& y: B2 n( m-AX = 0914h   (Remove SIce breakoints)- t: j& ]' Z& K& s/ a

5 J# G! R0 z% j: `& K9 ^7 dEach time you'll meet this trick, you'll see:: t* p/ _3 K+ c5 z
-SI = 4647h% x& c  I* l3 S/ O7 j8 X
-DI = 4A4Dh
) E6 ?2 M- U# m- P8 {& [; N/ RWhich are the 'magic values' used by SoftIce., `" e1 N- R% A
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
$ q0 l( x+ ^* @' K' P) w3 I: R% ^$ L% r, a0 |) T( H8 `5 g8 o$ u1 h5 g
Here is one example from the file "Haspinst.exe" which is the dongle HASP( j0 c) F* w2 {; d" X) H# n. u
Envelope utility use to protect DOS applications:( e: [  d! t' Q
# J, ?; j# v3 @: b
/ l0 S, t/ H' ?* b. M, r. H6 v- w
4C19:0095   MOV    AX,0911  ; execute command.0 z4 a  i! f" b5 p
4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
% q4 S& l- C/ \; A9 S4C19:009A   MOV    SI,4647  ; 1st magic value.
+ i( B. h' E- K! |3 v: v6 \: v- U4C19:009D   MOV    DI,4A4D  ; 2nd magic value.
% a7 ]2 K+ r7 s2 ~% p7 x7 U6 z- g4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)1 L) H$ `6 o' g  |! M7 t* W
4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute  T6 J! V; S0 A4 o$ s, P% U; ]
4C19:00A4   INC    CX
. O$ Y; B& M$ v4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute3 @/ V6 |0 I4 j7 c4 n% D& i
4C19:00A8   JB     0095     ; 6 different commands.
* d9 h$ r$ E- r7 u$ R; c; p4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
+ R0 X  v; \* Q7 k3 C! q! |4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)/ Z9 H$ X& p9 {: y& T
) }2 w  e0 X- O5 B& ~
The program will execute 6 different SIce commands located at ds:dx, which7 F3 V% Y5 @9 O+ _' c& ]/ y
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.! u' M7 ^, c$ z7 U. v2 m' U6 h
0 ]+ [- j. H+ J5 i7 `
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.& w4 Z5 i1 r# a6 C9 f
___________________________________________________________________________
+ \% Z( j9 o( |7 z, w) z& K- Z6 J+ M; v" p  T
& X2 d6 [9 m! M! e" z( W
Method 03
1 U  `: y6 C8 i* w) f=========( Y7 S9 g+ j0 H. |3 M2 i9 J! c' D
/ L4 g; i3 P; C( o
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
9 k9 L5 s. H/ \(API Get entry point)! k* w+ M. ~7 X. B
        
6 s. ?$ n3 O; Y9 H' L( M2 ]) N  T+ ]" M+ }
    xor     di,di
- h: J9 p" Z/ t7 a    mov     es,di
6 e- G6 a; t: l. x' b9 e' E    mov     ax, 1684h      
9 s$ q) j' p, a    mov     bx, 0202h       ; VxD ID of winice4 M7 {, X  K; H" W/ u8 K- b- n" U: F
    int     2Fh5 W+ \* H& `* _8 a
    mov     ax, es          ; ES:DI -&gt; VxD API entry point- {, N& k- W3 T( Z9 E
    add     ax, di+ O, x! b7 d9 n
    test    ax,ax
( |7 }4 o- A; S( R5 D6 c; x    jnz     SoftICE_Detected
& I5 ?: U8 \: m# u/ z* z5 ^$ t! S; ~5 E& z& v6 s. a
___________________________________________________________________________
! I8 _* c1 M+ b2 m, X! f2 O
2 i9 i+ r/ w- S$ R4 X- ]Method 04
  Z2 ]3 L/ P' ]* }& L$ K=========" R& m; h4 ^5 x) {. q
6 S  E% j+ b$ i2 G8 C& E) g0 u
Method identical to the preceding one except that it seeks the ID of SoftICE! A$ ^. o$ H# |! S/ P
GFX VxD.
# v2 ^7 E9 X6 `8 a. R
' E/ z3 U/ m% Q. X" t    xor     di,di
2 h( v8 ]5 V$ a    mov     es,di" c' O, y, |0 c! K2 e8 `
    mov     ax, 1684h       : L% K9 ^& u. v. X2 P4 h1 @
    mov     bx, 7a5Fh       ; VxD ID of SIWVID$ K5 p* D2 ?7 T1 X! r
    int     2fh2 K7 Y, b: X3 s* j$ v
    mov     ax, es          ; ES:DI -&gt; VxD API entry point4 g" A" E3 u( i2 r5 f7 z
    add     ax, di
: g( S- J) y: G. b6 ~" y: _    test    ax,ax
: n& a+ g- F# e3 M& J9 \    jnz     SoftICE_Detected/ N  c. g$ K. e( n1 U2 r: w

! F8 b4 F0 d  ]1 A6 `+ l: X! G3 \__________________________________________________________________________3 [/ d, `, V& S8 j  @

* e& o9 r2 s8 T6 M! Y
. v  r% `' [9 ^/ n3 i! SMethod 05) L0 e3 _3 q( O/ k  Q$ D1 ]; J
=========7 b2 `- v! l0 a/ o3 p7 G' I: C2 T
9 {: ~, \) o/ i+ U
Method seeking the 'magic number' 0F386h returned (in ax) by all system
. y  e  v+ V% s; W4 Rdebugger. It calls the int 41h, function 4Fh.* z& F6 k' B2 d5 W5 A2 X/ W
There are several alternatives.  
& U: q- |* c5 Z% H4 c- r7 F2 c) m2 q2 J' ?; P/ U) W; [
The following one is the simplest:5 b- O# W9 l  N6 }

1 K! }$ A: g8 Q* p1 K    mov     ax,4fh9 S: c0 ?: d+ m+ p# y" R8 q6 M
    int     41h8 G9 P. i5 N" o5 a1 x- x- T$ u
    cmp     ax, 0F386) o/ K" [' P" z
    jz      SoftICE_detected
+ l' }8 w1 S9 n  z
. u4 e5 B$ n) g8 ~, K. m  Q. S' T# b& `% g
Next method as well as the following one are 2 examples from Stone's
! r+ n9 I6 i3 v, ~' _: Z1 O" V"stn-wid.zip" (www.cracking.net):$ c' k, \$ }' ~
1 |8 e! b% Z3 {) @# k; I" q
    mov     bx, cs
" [" ~/ s2 u+ \  x: a, T: K7 k7 b    lea     dx, int41handler2
. Y) c  W$ s; T: B4 ?9 G' W  X    xchg    dx, es:[41h*4]" t. J$ \, g5 E# P, ?6 F
    xchg    bx, es:[41h*4+2]
# X0 |2 Z7 }" y& r0 [    mov     ax,4fh
# \: \- b" z0 ^$ T5 G/ i    int     41h% R+ ?+ e9 x( {
    xchg    dx, es:[41h*4]
) p* i0 m3 a: F. c& I    xchg    bx, es:[41h*4+2]7 \8 [+ p% j6 d: L( z) B
    cmp     ax, 0f386h8 U7 C0 w8 @1 O# C/ S! L6 |7 l
    jz      SoftICE_detected) j- `9 H  Z% L5 Y4 j- w2 Z4 _

% I) K1 P1 Y( }3 ^3 a% Bint41handler2 PROC: M; f. _& g& ^' o: [; W
    iret/ t7 {3 A  A, P% M! T" g9 H
int41handler2 ENDP/ h5 \& \7 Y$ `

1 L1 p; ~! T  L" p+ _& R$ w' l' g: J. e
_________________________________________________________________________* r1 [3 m8 j. I) ?2 j; L4 k

- ~. |& _8 g- k! {0 l3 y* Z: W8 A  H- f! ?% f7 u
Method 06, w: \( f4 o6 G. [  {, L7 u
=========
4 t$ F3 [/ ~" e* c, o
. r9 x! v/ h3 \
& G3 k: v4 ]3 i2nd method similar to the preceding one but more difficult to detect:
2 l/ e, e! A, o5 \) y/ \' j8 E5 \
8 |/ B* c0 v, h) O' S
& z) ?6 f) \5 ^. D" J# [int41handler PROC
4 |5 [) V, d9 x8 f/ o* f3 @5 s    mov     cl,al
. ?* q  R0 h" d7 i    iret/ L; ^9 ?4 U$ C
int41handler ENDP
" d: ], F+ c; W: K& b, G* e
& I6 x; i  ]1 D* f! q# H" D
- m6 T$ X4 C, f6 T5 O% [    xor     ax,ax% M& F5 r; S; t! w; U6 ^0 E8 J
    mov     es,ax! w# D3 n. j3 v( }% ?, Q9 G
    mov     bx, cs
5 L9 y; Y" A  M  L% R5 I" [    lea     dx, int41handler1 l, E( j- Z3 c9 u1 R
    xchg    dx, es:[41h*4]
4 i" y, h' o" w$ V: t; O# p    xchg    bx, es:[41h*4+2]
; }- R; u$ k+ Z% z7 U    in      al, 40h
8 X$ |# [3 V9 K: t* z    xor     cx,cx2 j/ D/ @! Q7 h! i6 d
    int     41h
7 s8 `% H. D$ V# k9 ~5 h5 Q    xchg    dx, es:[41h*4]7 L. i% B7 d% Z' W* G6 f
    xchg    bx, es:[41h*4+2]; j% }2 Q9 R& c8 D/ S& }2 P# R  u
    cmp     cl,al
2 H2 c9 ]4 ?0 ]( ^  F  X$ n; ~' A% w# H    jnz     SoftICE_detected
$ D! b- m2 R6 C' X0 ~4 J  J
) e- _/ ?3 g  j6 ]2 R7 x. ?' @_________________________________________________________________________
9 q  F/ l" L5 B- D
0 O# F) R- m% X$ y) gMethod 07& Q( M- h5 ~" r2 Q# m* U  m$ \
=========0 S/ C  v* p) k* m$ u8 a  e, ]

/ t1 s2 }1 a2 ~# A" K" |Method of detection of the WinICE handler in the int68h (V86)
7 k, h$ N: w/ P2 U; o6 Q3 o
& Q8 @0 ?3 p2 P% f) ?    mov     ah,43h
- W$ M  P0 O1 s% ~2 v7 u    int     68h  Y/ x( q9 j$ W) K
    cmp     ax,0F386h
2 m, h. B" ^8 Q+ {* j0 P    jz      SoftICE_Detected6 h. `% C( M. C6 R+ [
2 n) h$ Q9 U9 o- D  D$ V3 L: z
) F3 S0 V* m( w% P& r( f1 n  G. Q
=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
9 x8 s& y7 b- I9 y   app like this:
7 S- B3 T( }6 g* @& v8 `
3 h; ^6 p% T* a& U  }7 |# F   BPX exec_int if ax==68" }& `6 I- ~  B/ Z8 X% V( J1 \# v" u
   (function called is located at byte ptr [ebp+1Dh] and client eip is; x1 M( v! }: w0 d' Q  r# N
   located at [ebp+48h] for 32Bit apps)
( X$ N: A# J2 ~- @& U__________________________________________________________________________
0 Y$ S# M2 U9 I  i
( _( l( ~" T+ x1 q, M4 d2 q6 y$ m7 x1 w! D& ^9 ]
Method 08
6 F  d6 t. h" N( T4 Y: j& [: n=========
; H$ a9 q* G' S) d" E0 T% S% v
2 i% E$ B9 a" m1 U/ u  e; h: BIt is not a method of detection of SoftICE but a possibility to crash the
8 S# M6 Y$ D: g. o) C" E* lsystem by intercepting int 01h and int 03h and redirecting them to another* b! D% i0 ?' Y( u
routine.
. L- v, F2 s: t! a) `( oIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points2 t9 J2 u# x- V5 |
to the new routine to execute (hangs computer...)9 T/ I9 K% R& b5 n

: {$ a8 @' Y# g: L" j) Q, ~) ~    mov     ah, 25h, w' w0 ]8 ]  a, A5 R- ]
    mov     al, Int_Number (01h or 03h)
! x/ s& Z' k$ q2 C3 w9 G    mov     dx, offset New_Int_Routine
/ _: y2 V6 ?2 b% ~    int     21h5 O0 l% H1 @, j+ h1 a9 W
7 J4 m! i9 c+ U( i7 x- {
__________________________________________________________________________/ W8 X9 v+ P" e, D: C" l

' Y! j8 `1 q- X/ p* U3 wMethod 09
# s: A( `# E8 U& C  G* u: R=========5 ^) P8 B5 w4 C* R) C4 g# D& C

, u, c$ B; G0 o7 OThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only  T* a" \' m- f' y1 o; Z
performed in ring0 (VxD or a ring3 app using the VxdCall)., t# j7 ^8 h1 ~$ l9 S
The Get_DDB service is used to determine whether or not a VxD is installed
- ~; S$ a8 Q  L  [# \for the specified device and returns a Device Description Block (in ecx) for
5 U1 i7 p' |. }5 i; K: [+ {) uthat device if it is installed.
& ]! N* G" @0 K( F
9 s  |# x8 k+ A, e   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID
2 e' Q1 t8 d* P0 ]2 q   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
. H4 B$ m6 {+ i# U0 m1 z6 Z   VMMCall Get_DDB
( ~. o) f; p/ Z" Z9 o6 P  P   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed! v) _* j, Y- K% Q1 T3 y
( x+ R: p+ h: d& M! t
Note as well that you can easily detect this method with SoftICE:$ W1 L- s- c. X: `
   bpx Get_DDB if ax==0202 || ax==7a5fh
0 z8 m9 E6 }0 L$ c* d1 {
" Y/ i% d+ }) }5 g" O__________________________________________________________________________
( ?) h! I7 S: ?! p/ K9 S* w
8 i- }6 A+ O  e) H5 Y1 KMethod 10
% Q. m! ~0 b7 q( T8 j* N3 G=========! c$ ~0 u% g/ _. p$ d
( r. ?3 y0 j  H
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with) U* L' ?: g' w  ~' [9 B
  SoftICE while the option is enable!!9 N7 D6 ^) x# q$ N) f+ ^) }
& N& I( M6 e3 n( h( P% p
This trick is very efficient:
: a1 A7 ~$ K8 U. [+ N3 r8 hby checking the Debug Registers, you can detect if SoftICE is loaded" s( W' R6 S4 Z7 [6 F
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if+ S' P: b1 f9 `9 L- ]
there are some memory breakpoints set (dr0 to dr3) simply by reading their
+ q7 m3 W/ L- @value (in ring0 only). Values can be manipulated and or changed as well
! i9 C: y5 g: e$ L; a(clearing BPMs for instance)0 Y9 r" F$ ?0 k
* g3 J* K+ y! \8 a
__________________________________________________________________________
% B( ?  y4 ^1 ]" R0 \9 H  L6 `1 T
Method 114 i2 l+ d( J. g- j% ^3 V
=========
+ G  P! x* p7 W3 Y3 y. e1 k' D5 N$ w2 A
This method is most known as 'MeltICE' because it has been freely distributed  e4 ^$ ?7 h" B. r, I; V$ y' f# r
via www.winfiles.com. However it was first used by NuMega people to allow
) q" @9 U% {' `5 ~Symbol Loader to check if SoftICE was active or not (the code is located
& ]* h' ~$ `2 I. C% T) dinside nmtrans.dll).
7 z$ J. l( Y1 J" J; o) h$ V9 z8 s: ?8 ~9 H7 v: n) ?8 z
The way it works is very simple:
/ q; X7 i9 C" g5 u% K  R6 J% ?3 j: nIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
, t- k, |) b; @! _+ q; S1 w3 NWinNT) with the CreateFileA API.
; Z7 x/ r  a" f, r: f- B; e' r& q. {7 q: G( Y
Here is a sample (checking for 'SICE'):
* e1 ~6 h2 C$ V) r! R$ E
6 o/ y5 \( b# q8 V# W' m& OBOOL IsSoftIce95Loaded()
& R0 \* H4 T: Z{
4 j8 T+ i( u2 ]6 q3 I0 g   HANDLE hFile;  
5 W+ R: M' f  \. U2 Y- P5 X   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
9 [$ v9 ?  l/ E4 I' ]* F# C6 J0 d8 i                      FILE_SHARE_READ | FILE_SHARE_WRITE,3 V6 Q4 d5 {( ]& B
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);( O/ r6 M. K: _. m& |) H& H, j. Q
   if( hFile != INVALID_HANDLE_VALUE )4 S1 ~. s7 o( ^# `
   {+ B1 S; u2 ?: O( J# b6 |
      CloseHandle(hFile);
% p( K2 l- V: {8 A      return TRUE;' T: B2 @5 h; ]2 P+ X; ]- X7 J( I
   }8 I; l9 u2 ]" e7 F+ y3 F
   return FALSE;- t4 X  `; H) f+ C8 S
}
; c6 @0 n# f4 _) N5 r' i$ L+ o& l: M, z; |% z
Although this trick calls the CreateFileA function, don't even expect to be8 `# @: b1 c, h% }/ Q3 q# @  ?" {
able to intercept it by installing a IFS hook: it will not work, no way!
' B, d4 H" C: Z/ k& Q, j$ }7 LIn fact, after the call to CreateFileA it will get through VWIN32 0x001F9 d. ^. ~+ C6 s$ y8 U5 q* I
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)3 Z# k6 `! w% p
and then browse the DDB list until it find the VxD and its DDB_Control_Proc4 ]/ v  a4 o6 H1 N' [1 X
field./ b2 t; W% t/ s5 L& k; i% K
In fact, its purpose is not to load/unload VxDs but only to send a 0 n) \- T8 h0 S  R. r& S
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
% J: n8 M2 @  |2 r3 A0 Ito the VxD Control_Dispatch proc (how the hell a shareware soft could try
- \$ I7 {! t- K( L8 R7 sto load/unload a non-dynamically loadable driver such as SoftICE ;-).& ?- L' w; q2 z9 g, e5 h
If the VxD is loaded, it will always clear eax and the Carry flag to allow
4 c8 f( j) b  F8 V* j; e( `& Jits handle to be opened and then, will be detected.
( v3 m/ x& X5 J3 J" Z! J, [You can check that simply by hooking Winice.exe control proc entry point) A0 C9 c6 H, s
while running MeltICE.
9 s, [: g; w7 _- n5 f9 j$ {7 a
6 u  |+ S" Z6 ]5 d) f7 q
% a8 A: u; ~7 {- V: w* Y7 m" S  00401067:  push      00402025    ; \\.\SICE
/ u* \% M0 S) n+ s2 s. J  0040106C:  call      CreateFileA) x- L) m3 M, W: ]9 v! I8 h
  00401071:  cmp       eax,-001
. h& C7 f7 Q  t2 T, _/ a, V; R4 V  00401074:  je        00401091
& T' _$ L# @0 u" q' |
1 l# _! f  w( i& i  W" k$ O$ x) \& k/ h+ \; M3 m' y6 j
There could be hundreds of BPX you could use to detect this trick.: C1 l9 _% F3 ^4 ?( o& j
-The most classical one is:
5 L/ b* d) e; u1 a3 c( H  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
- i( b" O/ H0 k) i. w    *(esp-&gt;4+4)=='NTIC'; f* Q9 W/ M7 e; @" C! F, m
! ^- Z. P# |- [. a, d# j$ W6 V
-The most exotic ones (could be very slooooow :-(! o2 `3 W/ w9 B, ~4 ~. e' V
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  ( P6 {! b' A6 V! k9 p3 w
     ;will break 3 times :-(
: D' u7 E' R% Z1 l- C  g" S% l& g1 }; k% b4 `* |+ ]
-or (a bit) faster: $ f: _& b9 H4 g2 @0 N/ I$ C
   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
6 V6 o0 Q& \* t7 n( |( m1 g
- w( _, r: O$ E" V7 _   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  
2 ~. g# \9 p- Z+ A3 U7 C! J; W     ;will break 3 times :-(
0 O$ \  b% K5 s; d4 T* k' ]
7 ^: Q* o2 t2 m7 F-Much faster:2 I% P2 n8 ?5 X6 _
   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'
. Y7 y6 [, V" r4 o2 Z  J# L" U; ]
8 A6 A/ g: v8 E: a: [' M$ [Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
( F( j) O/ j0 t& Q/ A  z$ K, }function to do the same job:# A1 u, m$ _: _8 a" `
& k1 s0 u/ r7 J5 L
   push    00                        ; OF_READ
0 j) m1 Y3 {0 ]   mov     eax,[00656634]            ; '\\.\SICE',0' f; f5 p1 Z; {
   push    eax6 q5 ^+ t9 X6 C
   call    KERNEL32!_lopen1 [4 w3 H! ]1 D$ M% w9 x7 B
   inc     eax
' K+ V6 ?2 _' C( T. ?1 B   jnz     00650589                  ; detected/ g* `6 p4 [# e( J
   push    00                        ; OF_READ
8 v/ u3 ?! C( {$ S) B   mov     eax,[00656638]            ; '\\.\SICE'2 R5 w; _6 V! n0 j8 R& [+ n
   push    eax
4 z! f4 A) J7 X; t) g; ^/ V   call    KERNEL32!_lopen9 t. R2 j2 @* M
   inc     eax5 h6 y- i9 Z4 F( o! N8 B
   jz      006505ae                  ; not detected/ \% F, X# ^" }1 ?8 @
  S$ y0 H+ i, ?; H
4 E4 s, a. x  D* L# h
__________________________________________________________________________
8 \7 k6 R; Q5 r* b3 v* L$ ~) y1 i9 D5 U: T$ S
Method 12* h2 H8 C& |- ^% W" U
=========; S% k% b/ }% y* k
, h# k( v; M6 K0 C* c" \% J
This trick is similar to int41h/4fh Debugger installation check (code 05: \/ S: D5 s) G7 v9 L1 G3 }0 `
&amp; 06) but very limited because it's only available for Win95/98 (not NT)
. X' e: n& q6 R, o+ Jas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
: m/ l5 l' Q  J  N! o# Q1 L
) r9 F3 `* C- X4 e   push  0000004fh         ; function 4fh; b: Z, O& r2 s: z5 \
   push  002a002ah         ; high word specifies which VxD (VWIN32)
5 l" X# A2 z% j: A                           ; low word specifies which service2 |7 \9 r; \0 i7 ~; ^7 A3 H8 Z0 G
                             (VWIN32_Int41Dispatch)
7 Z- D- T' G- h! N; o1 B& w   call  Kernel32!ORD_001  ; VxdCall: H, I% a* t9 j, L" v- B5 ?9 S
   cmp   ax, 0f386h        ; magic number returned by system debuggers9 [3 E" p& O0 v8 c/ ^# t3 ?+ D8 X
   jz    SoftICE_detected
% u1 B; `4 E% S3 K4 i3 G- x8 u2 z$ a. J8 E4 j
Here again, several ways to detect it:# h! y5 b% F$ n' h, ^- Y! z

- h0 u  m& ]" f) ~    BPINT 41 if ax==4f5 V; G. n5 R9 c3 ~5 F8 R. r
- R4 I) W+ g# Q- z
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one! H1 K( [9 D2 r9 [! k

" D) p% P# D  r/ _8 L; D% @    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A6 {6 p! Y% V0 S# ^3 ?3 T
7 H2 e" ]+ C: Q1 P
    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!7 b3 ^# i$ N) x) }0 @
8 r) k) j" I/ d0 _# x3 N& H
__________________________________________________________________________$ K( V9 G! D( S- |) J1 Q
" H, a6 U- ]* ?7 M5 k+ ~
Method 13
8 i( |' r: n9 S4 Q, b) K3 i2 U: ~=========
! `1 K! C/ ?2 m2 W  C
8 R, ~7 e* \3 }1 w$ ]Not a real method of detection, but a good way to know if SoftICE is8 i8 i$ D9 O5 [4 f7 Q$ {5 A4 u
installed on a computer and to locate its installation directory.0 |( C& \6 _5 n) d! s
It is used by few softs which access the following registry keys (usually #2) :
2 |+ Y+ k2 n6 C/ @3 _# L4 c5 t5 V2 [. Y  s
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion. ~2 _4 P" ~! k/ y
\Uninstall\SoftICE) Y! u6 n8 z% o: g: m  o% d& f
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE3 M7 y, d4 N$ C
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion/ ]% h; l/ I; ^( ?6 f
\App Paths\Loader32.Exe
: h# a; r7 v6 v# U4 E3 @3 C& x) K: Y, e/ X* z2 ^
# x; f2 a# A1 k
Note that some nasty apps could then erase all files from SoftICE directory' ?" l# z! s' o  T
(I faced that once :-(
9 ~- {! m  ~2 Q( K' c; o+ y
, W$ X8 y1 n; i# AUseful breakpoint to detect it:+ d5 _& [1 b; t- Q3 h

! ?- u' x2 K" E     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
4 C: z6 E' r+ f: c  @2 t5 d' B# U/ q) |$ m
__________________________________________________________________________0 w; K3 @3 Q( U- f9 p  Y2 i% i5 U
3 W  {6 C! l3 ^
3 u5 v2 t6 {  b( K
Method 14 3 q) d0 g0 _. o6 W
=========! i/ G' R5 \- y4 L$ ]
6 j" q% X7 v9 d* H
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose; {' |( x) U5 L8 {1 O
is to determines whether a debugger is running on your system (ring0 only).
! }, s+ a( _2 B, E# D" P0 q- f
   VMMCall Test_Debug_Installed: Z# ^4 w9 O; |
   je      not_installed  c# `2 f6 Z" ~0 d# M7 T% T, Y
% [2 t! u$ K0 X3 F2 ^
This service just checks a flag.9 S1 T, R0 Z4 b% h3 _2 r
</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关注公众号

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

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

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