找回密码
 注册

QQ登录

只需一步,快速开始

About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>) m) g, S! O& d, q. a
<TBODY>
, v3 C9 `9 D2 |/ J* [5 V% H# o: K<TR>. v; @1 E! H0 |+ ~( G* |" D
<TD><PRE>Method 01
7 F3 m5 c. F! N2 j% s8 x=========3 K4 o" R; _, I. P

6 F, I1 G; [+ o( ^1 gThis method of detection of SoftICE (as well as the following one) is
- b- p+ @0 Q5 X0 x  r; A2 vused by the majority of packers/encryptors found on Internet.% H: |- u( l2 A$ s( |9 i( Q0 t9 Z
It seeks the signature of BoundsChecker in SoftICE
) }. E. B9 y1 }3 L% d7 ^* R' i3 @5 K& M9 o& ?/ z$ }' c" Q
    mov     ebp, 04243484Bh        ; 'BCHK'( q$ \; C2 r$ V% H0 ^) z
    mov     ax, 04h
1 r  s0 S- S/ }    int     3         ^# U3 Y! r0 u6 [( g0 ?1 _- P
    cmp     al,4* ^, t: p; _1 X+ T( J; V
    jnz     SoftICE_Detected
1 U, Q/ W6 P# E: X3 a4 S: c( X" W, j6 a3 _# l! N0 @
___________________________________________________________________________# R! w* ~* ^: b1 ?) L, V

. v4 `9 Q1 Y# q+ t3 r3 HMethod 02
6 g0 o( k0 t& Z=========* i. m  e8 \7 N1 W8 P% E" S
/ k8 H8 o% y3 ^8 ~4 N: ?
Still a method very much used (perhaps the most frequent one).  It is used. u: K* m7 \2 l* U) J6 Y9 ]! R
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
0 R. F& n, d' Z* S7 {* o0 F9 ^3 \or execute SoftICE commands...: f& r( `) J3 d! D) H
It is also used to crash SoftICE and to force it to execute any commands
; `$ ~, S5 R& p$ X(HBOOT...) :-((  - j; D" T5 r: |6 n2 o+ t# H
* t4 m7 E5 f- u: Y0 Y+ O' Z; K3 ]
Here is a quick description:
8 ^# _7 T9 K' Q& y) g-AX = 0910h   (Display string in SIce windows)1 T! q5 I$ v7 |) Z6 N( }
-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)
. k6 [# a3 Y3 S$ o. x8 p: P& ?-AX = 0912h   (Get breakpoint infos)
+ v3 p9 {  v3 @* R, V% C* R-AX = 0913h   (Set Sice breakpoints)
- F% b* b) ^0 {! }! [9 E-AX = 0914h   (Remove SIce breakoints)$ V2 V6 _5 Z1 A0 F$ R
& d: v4 w& q# D( M8 {
Each time you'll meet this trick, you'll see:# i1 z; A. e# Z% i2 s
-SI = 4647h
* X6 u( C, G4 V( U3 b-DI = 4A4Dh/ m) \* o1 c$ Y2 Y8 m
Which are the 'magic values' used by SoftIce.3 X: a$ }* x1 s. V, o# a0 h
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
8 i! ^2 R9 R( F# A( y
" ?6 @: V# i  l& E/ F( u* a8 hHere is one example from the file "Haspinst.exe" which is the dongle HASP2 g( h( B* G( C: q6 {1 W4 }
Envelope utility use to protect DOS applications:
- M; @; k* y& X; i) d% W" M$ Y
5 A4 [' F9 l# h! B+ r  p" ~. K" \& |! A5 h6 V, x1 o- q$ _4 ~& Z
4C19:0095   MOV    AX,0911  ; execute command.- s, a2 w! d7 j# A+ ?; F
4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
1 J! Y2 I9 ]2 {4C19:009A   MOV    SI,4647  ; 1st magic value.
9 \7 q/ q8 f: F+ M4C19:009D   MOV    DI,4A4D  ; 2nd magic value.& A$ i) Z. J( j4 M3 h& x
4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)' h" P, n8 b& ~' B9 C
4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute# U( X& P( p* `
4C19:00A4   INC    CX6 v  s3 T% F8 _5 M+ n* I0 ^. T
4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute
3 [4 q: s5 v' Z4 F7 w" n! I4 `4C19:00A8   JB     0095     ; 6 different commands.& Z+ w  n7 F3 c; S" q. p
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.  d+ |8 |* t& k$ t' o" N) p. _) Z
4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)% u" A) Z4 x; {, O: f: O/ ]: v
$ A1 k& w3 r% |/ Z+ ]7 G5 q% Q7 o2 _
The program will execute 6 different SIce commands located at ds:dx, which0 g0 g6 E2 ^" }( Z: Q
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.% o3 m# A8 t5 _1 o; |6 s; R
5 a, k% @1 B/ l3 X9 _7 Q* X) T1 c1 t! ?
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
6 P- X+ J4 y1 q% |+ B___________________________________________________________________________
/ g1 B! ^6 A! S. l2 |6 D5 h- \. _
9 T: ]% ~$ p& z7 @6 h% j* l0 g0 c; B* m7 I
Method 03( p, {4 q7 a3 J9 g7 i0 C" D
=========) k6 s8 a  {- u: k
" y8 a( j4 z; E; C7 [9 P. D3 ]5 \* L
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h, v) B9 n* E! R, h& `; e' P- V; G: S
(API Get entry point)) P, _' e: y! O+ O) F; I" o
        
6 {% p% j, C8 K7 m; N: M4 O, @
# i7 ?, Y* B% q  k    xor     di,di
1 w8 O  D( p% d8 r- t    mov     es,di# l$ Z; y7 Q4 L6 k) p, N
    mov     ax, 1684h       * A/ L9 j8 K2 O+ ]; }$ K
    mov     bx, 0202h       ; VxD ID of winice- k( I- ]6 E$ N; H/ c
    int     2Fh
$ A4 u( }' S! `' D    mov     ax, es          ; ES:DI -&gt; VxD API entry point
% r* l( T% l5 R1 g    add     ax, di
! @; R( H( [' h$ @& {' Q    test    ax,ax
; {" b- ~8 U' v0 @, Q6 j: t    jnz     SoftICE_Detected. d, Y- r- n/ D& I' p8 x! C% [
' z8 z, ~0 L9 {# N
___________________________________________________________________________( u5 c# r$ @5 o3 x) v& W7 V, u

( s) E+ x* ?+ n. E+ aMethod 04
6 M# p" l8 H& Z3 p- l# s- v=========
* L2 R6 ^* r  v" G+ P4 E' H3 j- B* D0 @
Method identical to the preceding one except that it seeks the ID of SoftICE, \/ i5 H8 S  A0 M
GFX VxD.8 {( J1 E+ x6 k7 A" Z
6 @0 y2 l  `, z/ w: f7 L+ U  j
    xor     di,di
$ j0 W3 i, I+ k6 R: E9 Z1 V    mov     es,di
* h! v( x6 Q* f1 a    mov     ax, 1684h       " M/ F2 |- r8 G1 C0 ?2 @
    mov     bx, 7a5Fh       ; VxD ID of SIWVID
" \' n- j8 e' }1 \  @    int     2fh
! m6 b: c' r- U3 z! w3 v    mov     ax, es          ; ES:DI -&gt; VxD API entry point
$ E- O$ ]/ M8 i( v: r3 j; ^) y    add     ax, di
2 q6 w3 c$ X0 Z    test    ax,ax
7 C1 T' \4 x/ L) g5 J    jnz     SoftICE_Detected
% S9 e$ M6 h7 ]5 j; f2 [, \1 x( ?, N' K% O* Q$ X
__________________________________________________________________________
1 k( a% b. g8 r. g6 |7 D, q0 c; M, R$ S  x0 C' q
! z+ [- d, g$ J5 a
Method 05
: h4 j. z8 A9 X; L2 r0 Q=========
9 }/ V# [+ _4 W' J0 }: f# H! e4 p% @9 i  E
Method seeking the 'magic number' 0F386h returned (in ax) by all system% E" d! J/ e% t4 N" s* e
debugger. It calls the int 41h, function 4Fh.
: P9 c4 Q) M6 P; x* bThere are several alternatives.  & x4 L3 x( A* E$ T5 x8 }

+ v$ x* ~: I/ D0 g! vThe following one is the simplest:, {8 D" C' I2 h! B( U9 S6 U
2 p3 j5 B# v/ u2 L  G  w: |
    mov     ax,4fh7 b& {$ p" z2 m
    int     41h
7 D' V$ E4 k+ ]1 F    cmp     ax, 0F386
* p: {5 ^+ }1 U7 Z. K( j9 ?$ y: t    jz      SoftICE_detected; B& J) }$ x* P' N, `
2 T- f: }  ]+ n8 O
1 H+ F* D( ~! Y
Next method as well as the following one are 2 examples from Stone's % K2 V6 t/ z  V. v) j8 f$ y2 k3 Y
"stn-wid.zip" (www.cracking.net):
1 D0 b/ p) Y" m
. e5 L/ P4 c0 [# L$ b3 {0 i    mov     bx, cs
% x0 D( v( y; z* I0 k) I% Q    lea     dx, int41handler2
% H4 }; S- n9 a4 |- M( V    xchg    dx, es:[41h*4]
' b! D, B  v+ Y) |) D1 \* k    xchg    bx, es:[41h*4+2]9 n$ |1 P4 |  M) _2 V- r$ ]
    mov     ax,4fh
- e; ~9 Q% N, A3 t$ m* H: z    int     41h
' S7 v& _2 R: \  O2 \1 `0 C/ c7 t% q8 J    xchg    dx, es:[41h*4]
4 p7 D+ h$ r+ B5 V    xchg    bx, es:[41h*4+2]
; ^: A8 O0 J  f1 V    cmp     ax, 0f386h% O4 W. ?# ~4 K" y( D& ]
    jz      SoftICE_detected
- @5 C( T, Y. @  `# V& V- ^, B% u  @3 h8 P9 ~
int41handler2 PROC1 p, D8 W7 q" H
    iret5 W  d  J  P9 o( I) U5 S
int41handler2 ENDP
5 G  ?6 t: x+ L) B# n! ~
& h! [: y: n9 G) ?  y: y' g8 L: U9 x' w9 w
_________________________________________________________________________; W( }  @! y' w+ J) G) A# \

5 a  U9 ^# c$ h0 r1 |( C# N! }$ ~2 p8 {, M2 d
Method 06
8 E1 f' z7 B! G. r( l  o=========
5 h+ ^& v+ E8 c( a$ n
: K, `5 Z5 d% |5 i  q- v4 ]
% D' a0 n& x0 x' _3 X' c5 L; n2nd method similar to the preceding one but more difficult to detect:
' _' ~, ?, n  n. d. V& r
$ N- {. Z8 K" X, O/ |' g& i: w) ^1 M, m
int41handler PROC9 q. i! T6 S4 q8 X& X6 k
    mov     cl,al
$ q9 i: o+ Y* O( {9 S( L) d    iret
3 x+ n# f! ~8 Oint41handler ENDP, S( t" t0 y% m. H/ q, U
, ~2 o# t5 L1 W* Y% k+ h

1 G6 h- D0 f1 }    xor     ax,ax
, u& n  U; ~* ^' E; D    mov     es,ax, _0 ~3 ?- B. t+ R
    mov     bx, cs9 d! d  E; |( @; F/ N5 t2 s
    lea     dx, int41handler  m: u, ^9 v: t
    xchg    dx, es:[41h*4]8 t4 M- k. N; i8 q: t/ B% |1 ]
    xchg    bx, es:[41h*4+2]
. U: D! j1 J2 F! |) v, D0 `6 F4 ?    in      al, 40h+ C9 |( t" M4 y+ l( r
    xor     cx,cx
+ m4 O9 B( t1 L3 K) O& o" Q0 ~' H    int     41h& `2 l0 b+ q- h# F" `" \
    xchg    dx, es:[41h*4]1 }5 e1 I4 U/ A
    xchg    bx, es:[41h*4+2]
% }. ]$ K. j. I' @    cmp     cl,al
3 y7 k, c; Y+ p& a    jnz     SoftICE_detected1 p8 D) T5 d) ^' @, a

( [* L. a: M; F7 ]6 k_________________________________________________________________________
# J' F$ d* [! H! J3 |% K* @$ x
8 w; j- z, J+ `. T) N4 P0 r: ^Method 07
' Z. n! k3 ?, N- O% u=========
1 Q/ z1 J* q# K6 O, t; Z
9 h; M; W& C% G& k0 @7 y" EMethod of detection of the WinICE handler in the int68h (V86)8 h+ s' k7 A  O5 Y6 p: j  Q6 S5 b
  b$ G- P; G  `
    mov     ah,43h- ?, f/ I# q- [8 h! w
    int     68h
; d7 O- W6 @9 {9 }" n7 C8 A1 l    cmp     ax,0F386h2 V% s5 f2 b, U+ }# n% I
    jz      SoftICE_Detected2 B; H- K+ C% v- Y% ^" M. w
. W) W8 M% _# O. ?0 z

% m8 ^$ c8 |- W+ o/ A=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
2 M1 p+ }1 d9 ~- \5 b) D. ]   app like this:
% N3 p7 F' n! W, \4 y1 m1 ]4 O) p  x8 T( |9 I& o/ E# c3 ]- Y
   BPX exec_int if ax==68' Y8 V* |7 k0 y. \( o7 l% C
   (function called is located at byte ptr [ebp+1Dh] and client eip is% s  m( `6 k! s2 c
   located at [ebp+48h] for 32Bit apps)
  Z8 {* l+ x" r: {__________________________________________________________________________- f2 C6 J' i% ]8 D! b6 @
* Q+ g9 e1 c+ \" Z: k) Z
7 t1 u* u5 t0 d4 g* m
Method 08
! h, b/ R4 W; [=========) ]" v: H+ V' ~# t) H# Q
8 ?: u6 D1 R' G1 J3 K
It is not a method of detection of SoftICE but a possibility to crash the3 z! k6 T( ~9 K! R! ~
system by intercepting int 01h and int 03h and redirecting them to another
' F/ G! ]1 ]6 G; E% x; J! g# M* Droutine.
  Y4 Q# \, T% u  z! t9 S6 I* iIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points. Q; V7 D  _7 h5 o) `# u  y& V
to the new routine to execute (hangs computer...)# w; A0 T' _. J: v9 C* g; n' n9 E
; e0 }; I& l# L7 U. b! j8 Y
    mov     ah, 25h9 x0 K1 a; y2 Y7 j
    mov     al, Int_Number (01h or 03h)
" s% |9 o: a2 I* Y/ a    mov     dx, offset New_Int_Routine) p3 x; |+ |& k  m4 A
    int     21h
9 c7 `" x& K. H% p" O4 H4 h/ r
, ]8 m* W$ W6 Z  `__________________________________________________________________________0 O7 Y9 e5 q; N" T

9 S! D3 o7 w5 B- ?4 M, ~& N( p; Q9 yMethod 09
- j7 Y" N9 g9 k; V  c9 A& ^6 O' ~=========
$ H! n9 p5 S* [; w4 P0 v" v, ^
2 H+ V3 b: l& A0 h) f) tThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only) p! Z7 i2 V, _- J# q
performed in ring0 (VxD or a ring3 app using the VxdCall)./ P5 d9 f9 ]' j2 h
The Get_DDB service is used to determine whether or not a VxD is installed+ E; o9 y& C  ?1 g
for the specified device and returns a Device Description Block (in ecx) for
, E0 J0 }1 I. }5 b7 {that device if it is installed.
" A2 Z( i( K. ~; u5 f* ~2 P7 c/ G) a- O# e% j* ?0 V1 M6 p# R
   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID
  W9 O' j9 f( O7 [( M   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)) j" w# [8 ^" u# X
   VMMCall Get_DDB
0 z& y+ u" V, v# p- ?: {2 ^4 ~4 a2 j   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed
0 q2 V3 }: a: `& ^) o% e+ N$ r+ Y
Note as well that you can easily detect this method with SoftICE:
4 d0 f" k: H7 g" X' ^& D% K   bpx Get_DDB if ax==0202 || ax==7a5fh$ E( O& x6 O# M# N" a/ T, _
/ o9 X0 H- a2 f. b3 ~& L! b% M  z
__________________________________________________________________________5 H' g- U& J& b5 V1 t3 s
) v" s. |  X, M" S3 \+ o+ ]
Method 10
" q2 V+ Y( F# X; A=========
& x7 p$ [# d8 s( F6 E8 ?
- s2 [" w5 F/ E% p9 N0 {2 T=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with: m# n7 F+ m) A! h
  SoftICE while the option is enable!!
# [7 D6 t  h' o/ e% A/ M2 G; ?3 ^! J; {+ A2 o
This trick is very efficient:
1 l4 ]2 F# t) I1 b2 L! Iby checking the Debug Registers, you can detect if SoftICE is loaded
* V- A9 q5 H$ u6 v5 E# x5 }0 E(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if9 r! r+ A0 X2 O
there are some memory breakpoints set (dr0 to dr3) simply by reading their
) Y- f8 N9 \. v5 L5 Hvalue (in ring0 only). Values can be manipulated and or changed as well
) o* O# ?; q- r4 l& L, d1 P(clearing BPMs for instance)
6 m) L7 ^0 c3 r6 X- i! K
2 m) @- Z- |3 R__________________________________________________________________________' j3 ^6 A, g# a7 l" f

  d  t  ~7 i) B0 a/ YMethod 11( k, w3 W4 q  t* Z7 p' \% N4 g+ ^
=========
6 g6 B$ @2 p# N+ B0 g0 x+ d5 X# u% r6 S& ]* u2 ^" _
This method is most known as 'MeltICE' because it has been freely distributed( C9 W" e# U9 D. x. M9 A+ Q. c
via www.winfiles.com. However it was first used by NuMega people to allow
  e4 k1 C" i9 M9 jSymbol Loader to check if SoftICE was active or not (the code is located7 W3 J( n; L. v8 ]) `+ i
inside nmtrans.dll).9 w( n9 V5 l) v

. u# w( B7 O5 KThe way it works is very simple:
9 Q9 e! V$ ~$ N7 s: ?7 YIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
+ G- t8 X0 \* @  k; b$ HWinNT) with the CreateFileA API.
$ b# @3 S$ }2 O. D" O
, \( d% E9 Z1 c  J' f" K1 Q" G6 iHere is a sample (checking for 'SICE'):* _5 x6 T6 H( N' w: @/ m( P! K

& Y$ t1 U  N  I/ G  e: b% _6 mBOOL IsSoftIce95Loaded()3 `/ o% ]1 [( E* |  l0 ^
{
7 O+ E1 H8 I& p. o3 O6 Q   HANDLE hFile;  
+ T2 `. E) |7 h* d; ~   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,8 M. }' }& v% E
                      FILE_SHARE_READ | FILE_SHARE_WRITE,7 H8 c) w- @! r" ~9 g1 ^! T* _9 K% Y
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);. ]$ D" o* z/ r
   if( hFile != INVALID_HANDLE_VALUE ). r8 Q9 s" x! ^! |
   {
+ I4 @* @/ s/ V. r( |! n) t      CloseHandle(hFile);: `, d6 S% e$ ], \
      return TRUE;7 x& E& w/ W  L4 V6 C5 E- ^
   }
0 W$ g+ O2 e/ P. ?   return FALSE;
8 \" Q, N8 `6 g4 J7 H% w+ E}
( e+ J2 A& W0 T8 K- f5 m$ k+ o9 b" ~3 f- w5 n/ U8 {
Although this trick calls the CreateFileA function, don't even expect to be' }/ q  K( H) E9 R3 g9 K
able to intercept it by installing a IFS hook: it will not work, no way!
4 B- e& z4 h( r% y+ NIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
, J) P+ C' k  T1 q  Mservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)2 |* Z( l& G  a# ]
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
) b* ]# e3 z! f' ffield.8 G# Y- W* r% y6 I
In fact, its purpose is not to load/unload VxDs but only to send a
3 a: r0 i7 F5 QW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
4 l0 T0 }, d5 y6 ^7 B) L. Cto the VxD Control_Dispatch proc (how the hell a shareware soft could try  l) Z# I( d) Y2 w$ l$ z" T4 s7 D
to load/unload a non-dynamically loadable driver such as SoftICE ;-).! a) e4 a0 A7 X" Q" i
If the VxD is loaded, it will always clear eax and the Carry flag to allow6 u9 `6 z. b# D8 @
its handle to be opened and then, will be detected.2 ?* o. y6 I( k! z& K: \* c
You can check that simply by hooking Winice.exe control proc entry point
8 p) U' D$ x7 Ewhile running MeltICE.
, x& h8 Y- j/ U6 C! D; \7 o1 ^, N0 H- m  R" e
) T# K  _) ?" e; ]& ^+ O
  00401067:  push      00402025    ; \\.\SICE
/ p- s! l7 Z/ Z1 L  0040106C:  call      CreateFileA
" ~4 b2 R0 j! B7 J5 `  00401071:  cmp       eax,-0010 ~  X3 _. p9 L0 ^
  00401074:  je        00401091
6 ?! r0 i7 S% c* E7 j# n
* F, P  |" M% W) T8 U8 Q# h1 j: X' D: N. B
There could be hundreds of BPX you could use to detect this trick.
9 \6 y$ Y, c' [: ^- G-The most classical one is:& E7 g1 @) J# a' t3 ?3 F
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
% c3 r0 A) r% c; |2 J% _    *(esp-&gt;4+4)=='NTIC'
3 O9 K* s- j) g9 o3 r, f
9 d6 E8 R/ T$ u; ?-The most exotic ones (could be very slooooow :-(
4 L6 s7 V8 I0 f' a6 J. \   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  . c; W# T' b! i- M; }6 P2 z& L/ c
     ;will break 3 times :-(( g4 K2 X$ c: E9 M

5 ~( |% D3 @3 A# A+ m( L-or (a bit) faster:
& a- m9 i$ e6 a$ l, {# x  l   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
8 F, T$ q& D& Z/ T) {- f6 U7 e9 R6 |: ?3 H5 {: y9 @5 a. O+ _' o
   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  7 ?7 }7 t5 y& j2 F" v) n
     ;will break 3 times :-(
  A6 a, H5 e5 {- ^7 q: ?* g1 H
% ?; T" z9 J! b+ w( T-Much faster:( R9 Q1 Y* l' c( ]
   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'
. m# B/ F- M. Q' G, X7 E1 Z* S# s& T4 L8 t
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen- _, r+ N9 ^  }% o
function to do the same job:" c! I) H" q8 ~& x/ Z

/ D8 {  _  R$ D& E+ b. N6 t# d   push    00                        ; OF_READ; H6 B" k3 Z/ d' p+ M/ N
   mov     eax,[00656634]            ; '\\.\SICE',0
% U) o% h! `* \8 g   push    eax8 e) ?1 i. L- `/ W( L; \, Q
   call    KERNEL32!_lopen" W% {7 I) ?9 @! R/ Y* w$ L9 V) m' N
   inc     eax
0 ^1 b9 I2 b# t4 `! V6 R% M7 j) k$ k   jnz     00650589                  ; detected" }9 I! M% M: B
   push    00                        ; OF_READ
2 L; ^* ~( b5 M, P  r) B   mov     eax,[00656638]            ; '\\.\SICE'/ e4 W+ L8 w# H9 e4 L6 N& n
   push    eax" B  T; _, W9 k( M6 w
   call    KERNEL32!_lopen+ p: r( v; s( V
   inc     eax9 y$ E6 i$ ?9 @7 B) E# d
   jz      006505ae                  ; not detected8 j  d- ^' |2 \
% j% f  l$ Y9 g: g6 s% N" r* ~

3 d3 U  c( J2 S/ C7 R) x1 u0 H' R__________________________________________________________________________
' u$ q6 V) p& {# ]) S4 W& G0 ]& R+ R9 Z6 u, M! f' {
Method 12
( e* h) c- o) ^=========% t0 _; `3 @' b! D

- C9 b, P  Z5 Y' gThis trick is similar to int41h/4fh Debugger installation check (code 05
/ b9 {+ _  m6 s/ K&amp; 06) but very limited because it's only available for Win95/98 (not NT)
! B- g. Z7 q# u7 Qas it uses the VxDCall backdoor. This detection was found in Bleem Demo.# m( @: z' C  N% Q# p

5 ^( m" w: k9 D" _2 j/ W   push  0000004fh         ; function 4fh
6 N8 H( I: ?8 q+ H: C+ f   push  002a002ah         ; high word specifies which VxD (VWIN32)
& R. M2 D& B$ Y6 C% S                           ; low word specifies which service
+ l9 D' Y. k" x* S2 p% E                             (VWIN32_Int41Dispatch)
* a# X; Z- ]: P   call  Kernel32!ORD_001  ; VxdCall
6 k# h7 Z8 U; J9 k   cmp   ax, 0f386h        ; magic number returned by system debuggers0 V8 h  v. d( D  l' C; F9 D7 w
   jz    SoftICE_detected9 [9 ?. d" V" L! Q& y4 Q  p

$ k% `, V7 ?4 W& h7 R3 K3 `Here again, several ways to detect it:
6 O2 r3 C, E5 S9 O
* k+ [( C5 x5 u/ z% s    BPINT 41 if ax==4f
. Z3 E+ p. q0 q9 J, A) H: v8 f: @% j! ]+ r2 r% B' X' `6 [
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one" g) z! e+ U( N! h. O" W7 M4 t8 B3 T
; w: I! y, _% S. q7 }
    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
* S3 t9 {4 S/ o0 q% t- S: O8 s  j- X) {1 d( n2 a! x
    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!' \& J; I5 A. l) d" t4 Q% t8 m
' {% y2 s6 U2 k8 K% W$ S1 ^9 s
__________________________________________________________________________9 e0 Z$ q* p/ X* _
3 J' I* K& _/ I! b- I1 _3 W
Method 13- X" ]0 o6 ~" }% m, ~3 C  m
=========" k1 H9 R$ k# ]5 B& K* W5 _

4 O! c: e; }, v1 J& O! F4 hNot a real method of detection, but a good way to know if SoftICE is
$ q4 Q' M$ i' C, k: m" winstalled on a computer and to locate its installation directory.! P$ R% H. R7 y
It is used by few softs which access the following registry keys (usually #2) :  f4 @# s! z5 \
% I& N% _( p% |5 m8 X1 W
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
) J+ \' ^/ M, e5 s, K0 e0 x3 z\Uninstall\SoftICE
8 K) B$ P" I5 W% P3 Y1 y" `! D! V: y-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
1 n8 p% v  D* S; m2 J! \, L-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
# p3 |/ h* y/ H, @\App Paths\Loader32.Exe
/ j' _& L3 p1 y. Y! h# l( w. x  }1 B$ @
9 a, j7 I% J# g, m
Note that some nasty apps could then erase all files from SoftICE directory
) Q$ Z' N2 W* w# E8 n: \9 K3 Q(I faced that once :-(6 N/ L1 C/ ^7 }. h% b* [0 q  b& A0 J

# o7 U2 g- h* Z5 m# dUseful breakpoint to detect it:
5 l/ p- t1 x& p8 Q9 X4 [6 o( p$ I" `- v3 _9 W
     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
: i# f8 d, P5 Z; _6 u$ h
# f( H9 i! d) `, A__________________________________________________________________________; \7 L( `" _' N8 U: \2 z

7 }; R+ p( J( z. U
/ s0 M* S1 W7 v% y+ b: e8 b# g- nMethod 14 ! o% `) L( y; n" z; r
=========
) v% W( q% M, |0 n) J, c
9 [+ G2 s- ^9 @6 u7 {: ^A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose6 ~, w+ u6 E. G! X
is to determines whether a debugger is running on your system (ring0 only).3 x+ J: }  L+ g, N% A& W

1 i8 R6 _9 c6 f2 }) n0 x! }   VMMCall Test_Debug_Installed  ^/ s4 u& D1 N$ t) ~  t
   je      not_installed$ f: H9 H0 ?- A

9 P0 Z4 @9 {8 a6 bThis service just checks a flag.
9 _3 R$ t  \; E) B6 x. B' l</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-6-15 02:03

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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