找回密码
 注册

QQ登录

只需一步,快速开始

About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
  T1 X4 G$ X# ?  o! i  r8 L<TBODY>8 i8 D* w- d4 O. _
<TR>
/ P+ j0 b& Z  I# k. [<TD><PRE>Method 01
; ~( _/ M$ {5 z8 f% G, ?/ |=========8 S+ M; L9 h) a' F

4 R* e4 v/ h/ R: v' g2 s" i0 j4 nThis method of detection of SoftICE (as well as the following one) is8 E6 e4 }5 s% U
used by the majority of packers/encryptors found on Internet.  R$ Y7 d0 [$ t: M+ W
It seeks the signature of BoundsChecker in SoftICE
, L$ s; B2 G% t; n+ Y+ o6 G8 M3 `
    mov     ebp, 04243484Bh        ; 'BCHK'( C: v' h$ ?: f6 f
    mov     ax, 04h
1 E: d9 H2 _/ o' K0 l0 l) ?    int     3      
" D+ {4 ^8 D7 o* A+ `    cmp     al,4
" K0 r# e9 g* e& H# T- x  t. }    jnz     SoftICE_Detected, q0 M. J  u% J

* L- @# ^2 O' {1 _  Y  T% q0 t- c0 y2 y___________________________________________________________________________
* N, K: C2 C" ]% ^
7 M* E4 X+ c! s7 |2 O6 T2 i% XMethod 02- r5 D* X) d0 D/ |) m( J
=========
1 U: X0 F- H+ [7 L, i
$ k0 `1 @9 r) u3 Q0 M# ?Still a method very much used (perhaps the most frequent one).  It is used
0 H/ A  J1 ?6 G: b: V; eto get SoftICE 'Back Door commands' which gives infos on Breakpoints,9 o+ P  ?6 d' Q: Z* h+ X# [/ [
or execute SoftICE commands...
& o6 h8 _9 A( r5 y. s( B( fIt is also used to crash SoftICE and to force it to execute any commands, z) U6 j/ b* ]# E
(HBOOT...) :-((  , C7 n  c: e6 V& d

& Q1 r8 G3 `& l% d8 ^  W9 `) @- gHere is a quick description:( c- ^) z& U0 Q* G4 k# e2 a0 I3 J
-AX = 0910h   (Display string in SIce windows)3 Z. m, o! c7 Q' {6 {
-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)
( a+ j8 W4 _1 ~' E. K-AX = 0912h   (Get breakpoint infos)6 B+ a6 k' J. o4 h- o' H( [
-AX = 0913h   (Set Sice breakpoints)
) Q  g' a) z1 ?0 C( [-AX = 0914h   (Remove SIce breakoints). D! d0 P0 _7 A0 ~6 c

. F4 @. Z/ E* U) TEach time you'll meet this trick, you'll see:% Y' Y) [" s8 X2 o0 K4 q# y1 U, u* G
-SI = 4647h
8 f0 s! b# ]; s) v" _-DI = 4A4Dh
& ^% f4 F8 d6 P( f2 w! Z. iWhich are the 'magic values' used by SoftIce.
5 Y: h' K; O4 i' f- iFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.) D% ]) F; p" J6 y9 e

2 _' r# k# a0 Y( s1 vHere is one example from the file "Haspinst.exe" which is the dongle HASP! }# F! a  J( }5 Y- u8 h
Envelope utility use to protect DOS applications:
3 s2 g9 {" ]0 T. Z; _3 K, q
; C  M( F6 z5 ~* {' ~/ ~; V7 ?/ U2 L8 [* p
4C19:0095   MOV    AX,0911  ; execute command.1 y- y8 s+ S8 w$ o+ |
4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
; Y  G. \/ u7 m* s4C19:009A   MOV    SI,4647  ; 1st magic value.
# Z3 `1 ]# Y8 D$ P" h4C19:009D   MOV    DI,4A4D  ; 2nd magic value.
+ O; o+ |2 T, G' [4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
( c9 e! b/ k  z, a- \1 g4 k5 v4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute
9 M8 P/ ^0 N' f4C19:00A4   INC    CX9 Y5 M4 g1 }: E* H8 k1 H6 e
4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute
- d; c6 }9 q7 P/ q1 q4 w8 v0 O+ O4C19:00A8   JB     0095     ; 6 different commands.
6 U; K& h9 D# J( j4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
; L+ ^$ [' q7 {4 Z4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)
* D: A1 D; ^1 R& `& Y
8 H; f8 j( K  c: S- ?The program will execute 6 different SIce commands located at ds:dx, which
5 n$ L4 z2 u8 l5 g: _, N- x" E) pare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
) x9 f2 A% p( @' B2 ~, e# \+ w! Y0 h" W- [6 ^1 K/ g) e% `1 D
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
  M0 W7 N3 I* `0 h* m/ G___________________________________________________________________________" M) G8 A/ ~& |) G

( y: w1 M! Z3 m1 Z/ l7 [
  S- y/ t1 a5 O6 Z9 b. xMethod 03
8 T7 [9 B, e) @. v7 J=========
9 k( {6 V- P; h$ m( q' q. p: \! h- _9 R0 |$ y
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
8 b1 r$ [# M5 q. Y) O% ?(API Get entry point)4 ^$ V- h5 Z- |, F0 s
        3 j( J' C. g. g

/ {- a8 n! |# {# q1 }    xor     di,di
/ E9 l. r. f8 t    mov     es,di
. |2 N/ H% ~0 }9 H' c: S    mov     ax, 1684h       5 y) d6 M. b4 H( N; x% d
    mov     bx, 0202h       ; VxD ID of winice7 k7 j) Y$ W2 e& w1 v5 L, H
    int     2Fh: J: P2 v. M" c/ h# x8 u5 R9 U
    mov     ax, es          ; ES:DI -&gt; VxD API entry point
5 O7 Z, J" p% r8 x6 K# h( \    add     ax, di
7 T, D% C1 e3 @) d. ^    test    ax,ax7 o% g( l1 D9 O' ^# d& @* J1 X
    jnz     SoftICE_Detected
6 k1 {! l! g5 ^- y3 [9 [& W/ u3 ^: g/ ?
___________________________________________________________________________
/ z: P  s3 o% k4 ^" Y5 E! P
$ ^% O7 C& u+ G# L, H" R9 S! \Method 04* w' C& D0 `, e; ?( b2 {
=========
% i! Z$ y/ c6 S* J  C- r" I  @1 H6 ~
Method identical to the preceding one except that it seeks the ID of SoftICE2 |" q. U+ M: C. o1 ^
GFX VxD." `7 W/ Q; G+ i7 ^' t8 x( {1 y3 @- L
3 F8 p. R4 X  J
    xor     di,di
% X# x5 w* _+ t9 n8 }# G* ?1 k    mov     es,di
7 F" A0 ?2 E/ h8 L  Y6 W/ j    mov     ax, 1684h      
+ w! R& t5 F5 f8 j* c; D$ Q    mov     bx, 7a5Fh       ; VxD ID of SIWVID. N( R3 z8 d( \1 m% I" N+ g
    int     2fh
" i" r$ U/ G6 B! h$ _    mov     ax, es          ; ES:DI -&gt; VxD API entry point
* z: e  c$ l" n! P    add     ax, di# q1 S% w. p/ |2 ]4 U% _
    test    ax,ax
8 Z$ p1 q- L' p5 H! b! U# A    jnz     SoftICE_Detected
" K; A8 \1 t) u
% o: j$ G6 T5 C, Q5 r__________________________________________________________________________/ ]  g- p1 c% u+ K$ d
5 A: v7 F  u9 I4 D7 M6 w. z3 w
3 u6 k9 Y- y* }# w9 K- e2 I, e
Method 05. S* j+ _& I6 C
=========
$ u# O; m# H& q  ~
* y+ ~, L$ y$ p( _  Q5 {Method seeking the 'magic number' 0F386h returned (in ax) by all system/ Q1 m3 t" U. ?3 l, b7 z# `
debugger. It calls the int 41h, function 4Fh.
& W/ i7 f% s: |; E- S2 jThere are several alternatives.  3 {0 ]% j; Z9 d/ X% S2 c3 y5 w

) v6 R' I' t$ ~) E- _+ TThe following one is the simplest:9 k4 }5 D' I- F/ [% [+ c: Z

. U2 f0 Y( o, w! V3 T    mov     ax,4fh
) [$ C$ x, e5 w" {/ D8 u/ W    int     41h
# [+ J8 P9 j' n& `  }3 U    cmp     ax, 0F386
% r% U" a; x4 X# q7 K    jz      SoftICE_detected
8 k7 Q# p/ {1 I- F! A
7 r7 j/ Z4 Y9 w8 K
  ^& z  i; V. y& u5 H  ]Next method as well as the following one are 2 examples from Stone's % y8 e" u* \- _! U9 e6 e  j
"stn-wid.zip" (www.cracking.net):
* A9 o! |" d# \! G5 T$ C/ @
0 l6 ~/ F0 ~, h0 _9 |6 Y5 o    mov     bx, cs
6 R5 {  E( G7 D# ]( b    lea     dx, int41handler2( h1 Z5 h; T6 e! }
    xchg    dx, es:[41h*4]1 M, }% ^+ O( N+ K9 R2 E% M3 I
    xchg    bx, es:[41h*4+2]
4 l4 }7 O! `! i    mov     ax,4fh
0 s( v2 I; t7 Y, j1 N; L- I    int     41h
7 A- e/ q9 Y8 ^! ?# w: `9 ?; l    xchg    dx, es:[41h*4]: C/ H/ E6 {" C, k! {, i) i/ i
    xchg    bx, es:[41h*4+2]5 n. G. f2 z, t  p
    cmp     ax, 0f386h
$ Z  O/ A; R$ O6 r) x8 P  M% v    jz      SoftICE_detected) p8 b9 o: s: u7 m: l4 t; A

/ R0 ^2 w3 Z) s* K! ]int41handler2 PROC
1 X; ~5 O1 G7 [6 \+ w2 a' T0 Z    iret
) l  l  }) X- {int41handler2 ENDP
& O8 i; v. m' J9 ?8 ?" \/ F3 Z" J3 _$ \6 O
3 N8 W$ P9 l: |8 F/ C: ^
- ?& Z6 \& K  e8 `_________________________________________________________________________$ B% z! C+ k( \5 z
/ F. _. b$ D1 C) d4 M  a% o
6 j/ y8 T% a3 G/ N' L; X
Method 06
3 S$ w2 c& R/ ?5 k3 y& k=========* S' Y: r. ~- j/ X, G  W
# }9 N$ y6 R6 z- T' w* ]! G
. e0 x: W! [6 q  u, @, q
2nd method similar to the preceding one but more difficult to detect:
0 s* e* s" A5 v' P. Z+ L8 @" X( A3 [9 }) U" t
5 Q" w1 g9 ^, \6 H4 Y) u3 a0 z
int41handler PROC4 v2 R! j) e: D) y( }3 {
    mov     cl,al
9 ^1 ]0 }! W2 q, i5 r    iret* S! Z) C7 b4 R; \2 V3 Y1 P
int41handler ENDP
& t1 I% r. n1 k! X, n. J* V/ |% @& c: q" `) }
0 z' g9 a) _1 ]: _, e% l
    xor     ax,ax, R4 V. G7 }/ E# }( C6 z+ p. m
    mov     es,ax
0 S6 z% O+ R! G& U, c  p    mov     bx, cs) @- x: }- L" z1 z7 u( a6 |9 {
    lea     dx, int41handler
! I) x" Q8 o2 ?5 l9 M( t    xchg    dx, es:[41h*4]" c2 q8 F) q' E" @" n) [8 r9 q  i
    xchg    bx, es:[41h*4+2]7 `" a* X3 o/ y5 F7 _, F  n
    in      al, 40h
/ p+ ^- \* v. y  Z    xor     cx,cx0 e1 z9 Y+ \+ s& z: [' ~
    int     41h
& K$ z( N* P# \9 A% R; `" ^    xchg    dx, es:[41h*4]. ~0 G- @& ^: z- v) P# g, b$ J
    xchg    bx, es:[41h*4+2]
( \8 {' }+ J& X1 g    cmp     cl,al5 t' d2 a9 B( G8 u$ n, U% t1 r# y
    jnz     SoftICE_detected
  c! g1 w( {  O1 L9 u; x" e
) U+ c5 n. i- U_________________________________________________________________________
+ ~, y8 ~9 }" S. z1 L) B3 v3 ?2 F" S9 s
Method 07* N/ i' R) Y7 B% O
=========! y4 K) \  F- l2 T9 c$ Y) u/ {
' F5 ^# _8 o8 Y0 e
Method of detection of the WinICE handler in the int68h (V86)
) o* H+ V) E" J& S- }8 d, s% d0 ]/ Q
    mov     ah,43h
' R4 ^+ n! M( A) B1 @% e; c    int     68h
7 m  I  s. ]+ n    cmp     ax,0F386h# h( U+ z. u7 k1 |8 w% {
    jz      SoftICE_Detected5 f" V  p8 z$ G/ _

2 y/ s- w$ Z' c9 c  h
; W" z$ l4 U, Z6 h% l" z' r" ^* z=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit5 h, I4 u9 Z( H4 [+ {
   app like this:
# r& g, R# G9 n/ e
; Y$ \6 c6 l% ~& t/ S* f   BPX exec_int if ax==684 D  \& O. g) ]  k7 e7 O+ h
   (function called is located at byte ptr [ebp+1Dh] and client eip is
+ f* `8 s* X# _/ K   located at [ebp+48h] for 32Bit apps)9 g+ c0 S( o* A! D+ d2 |
__________________________________________________________________________
1 s- {  x* x5 U6 H
& s% b) G3 ^, Z( h* U
- C: j9 h+ ^4 m  W/ A( j5 p$ fMethod 080 [1 \, L; C4 J! y; b' s8 L
=========0 o% A+ W3 w. [( f  w1 f9 v7 p7 t

/ z; x3 u' n: X# v) Q5 @+ X: B" YIt is not a method of detection of SoftICE but a possibility to crash the1 c" k5 \" R3 ~5 O
system by intercepting int 01h and int 03h and redirecting them to another
& t/ N/ j# }2 B' d, }5 `, Z1 groutine.) a1 ~; w  t4 V
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points) y4 z7 S1 T* W
to the new routine to execute (hangs computer...)
/ ]' C6 x9 ]3 i  h+ D, f( [+ I& D4 ~4 V) B7 n' a
    mov     ah, 25h7 j6 a% [3 v2 k, t% u, s
    mov     al, Int_Number (01h or 03h)+ w# `  {0 M- m8 {! s; E
    mov     dx, offset New_Int_Routine
  R( {1 r" b9 {3 u    int     21h" C: n6 s& z8 s# X' q; j8 h( r! u. b

. r6 X! t$ d1 N/ f2 r3 s__________________________________________________________________________
0 }" q5 m8 ]" W$ A* u/ I
' X9 T6 x/ q6 ^Method 092 ]% o3 O5 f" P2 E3 m
=========6 r/ N1 v( a. z+ N. c8 F
/ v' A  x" i3 T
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
  A; ^+ T# g8 x5 z  Z. w; aperformed in ring0 (VxD or a ring3 app using the VxdCall).5 G4 |: _$ {3 k! a5 L
The Get_DDB service is used to determine whether or not a VxD is installed
& |+ W" j" o! d' I1 K/ r: y( bfor the specified device and returns a Device Description Block (in ecx) for+ w8 M7 S' `5 A8 B" r" Q
that device if it is installed.; n9 t; n! F& ~
& G$ h. ^9 H& u/ ^& n' C4 z3 E4 p
   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID( i1 M" n6 ]  s" K
   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)8 Y% F; B) ^+ [  |& s  ~
   VMMCall Get_DDB$ x9 |1 L: J2 ]+ F
   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed
8 N" @) O! z: I5 G# [9 Q
/ p9 K, Q6 v8 ]- Q" ~Note as well that you can easily detect this method with SoftICE:
# L* g  X7 b8 F2 B0 `   bpx Get_DDB if ax==0202 || ax==7a5fh
3 g2 Y! R# F0 _9 E0 P: }: t, D* O. E8 c! B. b: [0 E3 V
__________________________________________________________________________8 i" y" Q: u5 }3 ?; u7 R

1 u; O- ?+ m# Q4 jMethod 10
, H0 m" V- A/ y; ]0 X9 j3 P=========. B5 J1 t# N& B& k, K

8 O  o- k# E' X6 b6 x) a6 g9 N# i=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with: h5 d0 j& A  |0 u
  SoftICE while the option is enable!!
1 O2 F. z$ h/ J% E: O( c" i) r1 j
- N7 M( s  l4 o6 r6 I. v6 NThis trick is very efficient:
, j8 v6 H+ Z5 i/ z. {by checking the Debug Registers, you can detect if SoftICE is loaded
! `; N/ s: J" m/ Z& n6 ]# s(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if! }, S4 R) [2 |
there are some memory breakpoints set (dr0 to dr3) simply by reading their
- x+ R9 B; N4 z' o3 |value (in ring0 only). Values can be manipulated and or changed as well8 u3 V, N! C3 A. B+ O
(clearing BPMs for instance)
6 l8 O# u9 o, c! [" }: W% H: z( R- d* I' _% Y- C8 a4 V
__________________________________________________________________________# E8 d9 g- y5 y$ x7 }

5 a0 v6 p- D8 H* fMethod 11
/ s, J* R" w8 r! x=========
$ D$ S5 A. w' A+ U* b
' Q6 Z! Z$ H2 M% ~2 n( b1 A" m3 aThis method is most known as 'MeltICE' because it has been freely distributed
4 r5 \3 s: P0 G2 ^via www.winfiles.com. However it was first used by NuMega people to allow
6 I! Y$ A" d  h6 L* g/ hSymbol Loader to check if SoftICE was active or not (the code is located; C; U3 q. I+ `) k; P  a7 H; n7 `
inside nmtrans.dll).
1 B; z' F4 {8 N6 F3 s8 p& I! P: H8 V$ a4 X3 T! N
The way it works is very simple:
( S9 O3 U3 W% T* f2 ^& VIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for# z5 ^( y5 ~/ z( V( V3 P  y
WinNT) with the CreateFileA API.& T+ W+ [, u+ B3 T8 ~' C5 l5 _; j" L2 ~
% A1 D: a; ?+ d1 K. t; f3 n* q
Here is a sample (checking for 'SICE'):
0 m3 I6 B: m" R0 U& H2 w) H: t4 d! F0 ^1 @( p8 U2 s& |
BOOL IsSoftIce95Loaded()3 l: J6 B- W2 Z0 j
{$ H: ~4 a/ O; d4 a( e
   HANDLE hFile;  2 m4 _2 Y2 i1 w1 M  P" t  q/ g
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
) e' a( d; Y0 G0 }: O7 B, E  e                      FILE_SHARE_READ | FILE_SHARE_WRITE,
2 m- t% B0 K% v: h2 C4 c                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);7 B) f+ o1 D0 Y% w# o. D8 ]
   if( hFile != INVALID_HANDLE_VALUE )% X. j. g2 X4 Z/ P
   {9 x8 d3 L- m- ]/ h$ V* y( n
      CloseHandle(hFile);0 }8 m: D8 ?2 M0 d+ u
      return TRUE;7 x0 n# Y  A+ @0 g- l2 d4 d# I; D
   }" j- c9 t9 p3 ~; a
   return FALSE;5 C3 C2 b0 s$ y  ?& V) \4 Y8 {3 K
}2 V* ~; j! n$ ]; d4 C  C

* p# m" L3 V& l* ~1 bAlthough this trick calls the CreateFileA function, don't even expect to be
) Z* G/ D. z* U( P3 ^5 kable to intercept it by installing a IFS hook: it will not work, no way!  ~/ o/ U* `; t. m" V# d0 i
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
- V+ x3 I' w. xservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)- d- n. {, R6 v8 S5 X  u- M
and then browse the DDB list until it find the VxD and its DDB_Control_Proc* r- N+ d1 z1 g/ m
field.
5 r, [6 s. I( Y8 M3 qIn fact, its purpose is not to load/unload VxDs but only to send a + E& \! Z: l6 v& w& q/ u
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)# {; z( K" ^8 G( q8 J3 M9 O+ g0 L
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
: N* l4 X: A3 Z) o- v+ }8 h' yto load/unload a non-dynamically loadable driver such as SoftICE ;-)./ F- }; I+ s" _: T1 |. X
If the VxD is loaded, it will always clear eax and the Carry flag to allow
) w' f' E! U- Z" f; P$ J. K' f& Rits handle to be opened and then, will be detected.
8 I& L! w5 J1 T, z# K% bYou can check that simply by hooking Winice.exe control proc entry point
. D( S. m; f( L* V% {% owhile running MeltICE.
3 u# A4 y! L' m. d- \5 |/ i% b1 T# C$ _$ E# I' K5 @
9 `& ]6 N9 n8 X9 n9 e
  00401067:  push      00402025    ; \\.\SICE' z( d- _4 [' L  m
  0040106C:  call      CreateFileA: N7 h  k6 {! R1 E( `. A
  00401071:  cmp       eax,-001% m2 q2 J) z) ~9 G, C+ h
  00401074:  je        004010918 t6 T+ r* t- S3 s& G
- e3 ~0 o3 ~4 F3 Q# _

' Q& M' q/ c0 l4 f; x& _: VThere could be hundreds of BPX you could use to detect this trick.
# K( q# U( i$ q3 u( `1 O9 C* K-The most classical one is:
3 Z" b* h/ |# ]0 }8 i$ h8 p  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
3 C# T$ @: a9 ^7 X# f$ B/ r2 f+ \1 j    *(esp-&gt;4+4)=='NTIC'
% t) y! r- X  u1 e0 ]( {# ?' X& z5 \
-The most exotic ones (could be very slooooow :-(
) C( `. h# m% J+ B   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  1 `! \  J% T5 m
     ;will break 3 times :-(( E5 Q$ P7 H* \9 u$ S# A

7 S8 U5 o' \; A-or (a bit) faster:
5 h+ G% R- \$ P3 ~& o0 W# g' L   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')& H. ~1 P# I( s
& C6 }( u: Z0 h# s) r# p: q
   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  
& B, E& F4 K5 X; e     ;will break 3 times :-($ v/ |2 `6 s$ E4 z* b7 R& {
; E; g  V' I; {  n3 J0 Q9 c
-Much faster:4 E  N$ g+ I6 c5 F/ Z$ w
   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'6 G( k8 a) U* W& g# S3 C8 O
9 I" m0 M) {: ]6 W8 g
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen. H! K# o4 m3 ]* S5 b
function to do the same job:
: ^* `2 Y2 y( _* D6 m  M& W% k, a1 i* G$ _# y1 E, j# p0 L  ?
   push    00                        ; OF_READ6 D9 |. i" Q: q; X) P% j
   mov     eax,[00656634]            ; '\\.\SICE',0! b5 q, C; `$ E- N: m
   push    eax
4 M6 a' {5 V; ~: b   call    KERNEL32!_lopen: ~8 t+ V1 _5 G/ @
   inc     eax
0 r" V' h. c( ~0 H4 ]( P   jnz     00650589                  ; detected
. S+ _* o9 E3 @+ k   push    00                        ; OF_READ+ m7 e- F1 N+ U9 ?' U
   mov     eax,[00656638]            ; '\\.\SICE'; F* t2 `& g% U. Y7 s* a. v. |$ n
   push    eax
% y& s8 b# S0 r& P& R+ w   call    KERNEL32!_lopen+ U' k3 v" U* v3 a
   inc     eax
4 O% F7 ^( n7 J, V# r% x  a   jz      006505ae                  ; not detected
" p! |/ z9 N* _; p$ h' j! A# C- t1 j' I" a% X6 V
/ u  {3 f+ Q( q+ P" i
__________________________________________________________________________
  L3 b5 U# W- O3 k1 s) \& \1 D8 y4 Q- K2 S& P2 f5 W$ F
Method 12( k5 B9 Z' O% r' K
=========% Y. s( k3 P' v+ }+ A2 U; }: Z- F
) s# t( q# ]2 z7 s* m! I
This trick is similar to int41h/4fh Debugger installation check (code 05% u5 Y" I4 z6 Y- S5 ~6 U
&amp; 06) but very limited because it's only available for Win95/98 (not NT); B: w1 v/ K$ w: Z8 \, S' n. G
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.1 T$ O, I5 \/ _7 |; `1 y6 b. s8 {
# L6 M! J6 Q& d7 q; q- F' ^
   push  0000004fh         ; function 4fh4 S9 _9 }) Y. H9 I4 D
   push  002a002ah         ; high word specifies which VxD (VWIN32)
  Z  a( i8 V  Z                           ; low word specifies which service; @  @3 `4 Q8 c6 ~* z6 u
                             (VWIN32_Int41Dispatch)% X9 d8 j; `( F( ^% }8 N
   call  Kernel32!ORD_001  ; VxdCall
8 w- B) x; ]7 r5 T   cmp   ax, 0f386h        ; magic number returned by system debuggers
* A2 Z+ E. z! C2 o7 p   jz    SoftICE_detected) ]3 ~( K( g8 R: C8 @
2 H. |2 D) D# I* A  i
Here again, several ways to detect it:1 y  o  g5 w- H# I. U' l8 M

1 x% J5 d; g% @4 }* w    BPINT 41 if ax==4f( m  c9 @4 u' |3 ~- d
: k" c* {" _8 }
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one
9 u2 `$ P# n9 }- S, n3 [& k1 \0 @8 x: d
    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
1 K7 E5 Q1 t1 U  }9 g4 R3 T
6 _* {. z$ x# F# z    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!/ T% O0 ]% E9 f

$ [7 b2 _3 ~4 x7 y) {  e__________________________________________________________________________9 G' Y. u+ D; U0 W; i) T
7 q- ~0 C7 o$ o( {5 E
Method 13
/ k& i% A1 M$ r) Q+ n. K4 @=========
- E# q1 n! [* }3 i* {& l9 s, g1 f( m" l5 p/ o- w5 L& T9 m
Not a real method of detection, but a good way to know if SoftICE is/ i, }& i8 x+ h* d8 {5 [
installed on a computer and to locate its installation directory.
. R) `2 U7 K( f. i: X. ~; F& wIt is used by few softs which access the following registry keys (usually #2) :2 g7 P' v( x8 U) x
! G' T& F* f/ ^1 M
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
  V/ V( d/ Y. m; m, e& f3 Y4 F\Uninstall\SoftICE7 l; \; I3 U5 w/ _; J. H1 t, [. S
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE; t) K; j3 H; c( z
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
" N2 u) f/ q1 l' C0 z/ `; b7 M\App Paths\Loader32.Exe
" r* ?1 A1 }) r% B% `! c' U" v) x- t

$ o, M/ ]" X) x) R  [: c2 b7 M8 GNote that some nasty apps could then erase all files from SoftICE directory* T' h/ N. T' g) G7 Y1 t; [7 C% E
(I faced that once :-(
3 I2 W; n( V' l- Y3 ]6 X
. x/ v  a% Y* a  U* C9 ~5 tUseful breakpoint to detect it:
5 Y, r! T/ \& ^. m" ]4 `: C1 h! ^8 R
     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
+ }; k% N8 a! V) e
# B% ?( [& B- O7 X7 r__________________________________________________________________________) o% J8 Z/ c' M! z
# b* J* y; f+ L+ l

8 j% _$ M, X* F) x5 I0 P5 r0 e& dMethod 14
) P% ~! C* h9 u0 I9 w4 d' L=========
6 @% a, I* q, X' X; M- c0 z% t3 ^7 ~  T7 i7 a: J
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose4 U( m9 W( i, k- S) D
is to determines whether a debugger is running on your system (ring0 only).* q) U  ]; W8 x6 u) v7 C
9 I  A: w1 V2 G, T
   VMMCall Test_Debug_Installed
2 }9 A6 s* {. X$ P5 a   je      not_installed
' V6 f4 Z( Q; ~% z% q- E, D6 T
. r  ~$ _2 h: P; ]This service just checks a flag.
2 ^  z5 t4 \7 c! _</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|本地广告联系: QQ:905790666 TEL:13176190456|Archiver|手机版|小黑屋|汶上信息港 ( 鲁ICP备19052200号-1 )

GMT+8, 2026-8-4 22:59

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表