找回密码
 注册

QQ登录

只需一步,快速开始

About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
& n5 `* a2 A; Z. ?& u<TBODY>4 n6 [" m! N6 A$ o- q7 ~
<TR>
% O- h/ c0 }/ s& _<TD><PRE>Method 01 ( z1 _. i. l2 d8 R9 T  z4 G6 ?
=========
# b" j: C1 U( b2 y- g1 D8 V% s9 Z' ]( A5 M# v2 E1 p8 x7 k; Z
This method of detection of SoftICE (as well as the following one) is
& A$ y: a" L3 _8 p( {& vused by the majority of packers/encryptors found on Internet.
1 x; j- O+ u$ ~) [% z5 RIt seeks the signature of BoundsChecker in SoftICE
% ]5 l( h$ z8 G0 b/ T! h9 K! F9 n! h/ b
    mov     ebp, 04243484Bh        ; 'BCHK'
' ^2 }) T% k# I( k# Q! J+ B    mov     ax, 04h
& Q4 k5 s4 h. O  t/ D7 W6 n    int     3      
4 B* I' s) g* h( l* d5 _: Q$ c    cmp     al,4' ~8 v. V- Q+ k" j9 Z3 ?- x7 P9 p
    jnz     SoftICE_Detected8 v6 P+ T& C; N* p1 Z* a

0 |4 i1 [% b% M___________________________________________________________________________$ ]& T. l; t$ s5 [& E2 |
7 T! O3 v& k: U( G2 d: a
Method 02
( o1 P$ u  h4 I; y& x=========
6 ^2 ^  P# \# x# g' G0 i! b
- Q2 Z/ Y  F8 UStill a method very much used (perhaps the most frequent one).  It is used+ C  ?+ ^8 ~; `& M/ H. f: J. Z3 c
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
" ~0 p$ [4 e/ ^% v% x. uor execute SoftICE commands...
" m, V1 ^* W- F6 g: ]' pIt is also used to crash SoftICE and to force it to execute any commands% q, z# {) f/ R6 h
(HBOOT...) :-((  8 \# G( v2 A6 q

/ l& P1 O, E+ V3 Z- P3 P7 h; u" h; MHere is a quick description:9 n8 n/ d, S& ^& x6 {
-AX = 0910h   (Display string in SIce windows)% M5 L! K* X- {' Y% v  n
-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)
" a, n% I3 p: V: H-AX = 0912h   (Get breakpoint infos)
; Y. e7 W0 Q6 u1 S. a$ k-AX = 0913h   (Set Sice breakpoints)
' b  x" r3 O: K. P3 j; t. ~-AX = 0914h   (Remove SIce breakoints), U6 ?  _2 t4 b2 x5 q

) D; M- z8 [' L- n$ s! [Each time you'll meet this trick, you'll see:. Q- v5 O5 S9 Y6 G5 s/ c2 E
-SI = 4647h4 g2 A4 }! p5 l2 N
-DI = 4A4Dh/ ?. J5 R0 v4 I0 W0 q2 m( ]% ^
Which are the 'magic values' used by SoftIce.' K( }, l9 Z. ?
For more informations, see "Ralf Brown Interrupt list" chapter int 03h., E1 ^: u: k' F7 A

8 T$ `/ T; J3 cHere is one example from the file "Haspinst.exe" which is the dongle HASP
6 I2 c) W' Z# r+ j+ ^  h, C$ X" b0 eEnvelope utility use to protect DOS applications:- O( Y0 Z) z9 o7 Q2 V0 m% H
9 ?& j  l* _# Z

: N9 t9 r( x% d4C19:0095   MOV    AX,0911  ; execute command.
' @' _: n" a0 c4 b5 \( j4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).# O$ v) `3 A( a4 W9 |6 r
4C19:009A   MOV    SI,4647  ; 1st magic value.
! ~1 D! q$ v8 w/ e+ M4C19:009D   MOV    DI,4A4D  ; 2nd magic value.
' y$ ?7 U( L, B4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)% B1 U- C3 |2 r1 _$ O& v0 L
4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute' |2 v; z; E# m& z
4C19:00A4   INC    CX
( V$ Y. Z+ i/ l& @: U8 O4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute
1 T+ D  a; k4 h$ L4 Y' s4C19:00A8   JB     0095     ; 6 different commands.8 `6 ?+ J* m! M) s' b0 R8 _3 d9 k
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
8 U# G3 X9 o. `* M7 J8 q1 }" ^/ A9 O0 B4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)
; @, T) Q9 N. R
' {' z  H2 S( S+ _/ XThe program will execute 6 different SIce commands located at ds:dx, which' E3 h$ h2 K% I5 c& }- ~$ X3 T: b9 a( E
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.9 A4 Y: z2 ~  Q2 L
& f  L! p7 \0 S$ ^( _. h2 T; J
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.0 t+ W. F7 }# q  p9 G7 S
___________________________________________________________________________
; F- T: y- G. O: [# }
! r+ t+ C: P  R1 ?8 O! K2 [" A6 R& c+ K' J9 p4 g
Method 03: _1 v% Q! F2 {* ?# e8 A7 P
=========0 v+ h& C5 U! v8 u

  S( q* u# q- ?' T1 C8 ~' w  a$ NLess used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h3 o: j* C7 `3 q8 y! W6 e
(API Get entry point)
) b( L0 G+ @# J5 j8 M        
, o$ [' `; g7 R
6 s! l0 H. k  ]$ X4 G    xor     di,di
- c" z9 O0 f+ D# l    mov     es,di
5 ^& h7 ]. d9 Q! i: M( N    mov     ax, 1684h      
% H! r" E7 l& b    mov     bx, 0202h       ; VxD ID of winice
8 |: M4 _* }8 c: N1 M" d    int     2Fh
( w7 {9 w( V6 t& s* D. t    mov     ax, es          ; ES:DI -&gt; VxD API entry point
. I. g/ ]% F1 d# X8 \$ i* w    add     ax, di
# s0 G. |- f9 W' B1 _    test    ax,ax3 U1 q- s- L* C2 V) k
    jnz     SoftICE_Detected( }' P: a2 r# ^: _' h
( l6 |5 w7 ^9 V3 N( [
___________________________________________________________________________- u4 z1 _( u1 A

# N, g6 f2 \1 e$ U. d+ rMethod 04, n* b1 A! E3 A/ G* \4 ]& R8 {
=========
. U) A# O2 p9 R+ I& _& _8 l7 n
) j: i* w' d- ]6 ~, z! d% v$ ]Method identical to the preceding one except that it seeks the ID of SoftICE
# L+ K" ~# ^7 E( G6 qGFX VxD.
7 _, g$ e, N: z% M
2 V! p$ g6 ^8 ]! ?: r0 S    xor     di,di) n7 L: g5 z1 h: d+ \, g. t$ ]
    mov     es,di
* M8 u* A) F3 h7 W  r9 Q5 ?+ ~    mov     ax, 1684h       ) f9 k9 l/ b' f3 A( h
    mov     bx, 7a5Fh       ; VxD ID of SIWVID
: n2 c9 |) G" p; p3 ^8 Y" [    int     2fh
( s( @! z5 ^8 N' J% q+ e( y7 Y    mov     ax, es          ; ES:DI -&gt; VxD API entry point
& Q1 b9 L& ]1 B, C# {* T  X6 b" U    add     ax, di
8 @" ?+ d1 C5 m8 _" L6 N  D    test    ax,ax
  E. z$ l3 w+ [    jnz     SoftICE_Detected
, ?, v0 C5 B' B6 p/ z2 {2 c' R* v* u5 f, v
__________________________________________________________________________8 S) B' X* c( t* Q

8 S$ a6 w& Z! E' ]9 Y' F3 Y
3 y6 ]5 i0 M& j* X; }! D) G% RMethod 053 k8 b) p( G, j5 O7 K$ {
=========
) E+ B( }; n2 N( q2 M5 S# @$ q; F, H+ V$ R, i
Method seeking the 'magic number' 0F386h returned (in ax) by all system
; n8 F$ k, R5 I+ p8 G7 l! [debugger. It calls the int 41h, function 4Fh.
3 |" A1 f/ _+ d7 u6 P) Q8 s6 ZThere are several alternatives.  
4 i( T& m, q( j  V* \9 U
# L" Y% }; r6 r4 d; RThe following one is the simplest:
3 e4 x1 q7 G+ d+ b/ P0 E/ r6 b% X$ V
    mov     ax,4fh
2 l. h% q# ]  e. \7 Z6 O/ w) S: u9 j+ p    int     41h+ _- ~) S* j6 f
    cmp     ax, 0F386  Y1 `! o' v- l/ E6 }
    jz      SoftICE_detected+ [: O+ H: v" K& U

3 Z) b- @4 R4 t( R+ k( t- [8 r+ S7 t: r  @6 v) q) ?! k# h4 B- W
Next method as well as the following one are 2 examples from Stone's 6 b  `+ T7 p( M2 e: b" b3 A# v
"stn-wid.zip" (www.cracking.net):
; x9 u6 Z, \0 e" O
8 n# H5 z+ p+ X# R( I    mov     bx, cs
$ n- l2 I3 @' y    lea     dx, int41handler28 u1 P- u- [+ @7 I: n$ {: a
    xchg    dx, es:[41h*4]
5 c: @6 K: s* t+ V0 u    xchg    bx, es:[41h*4+2]
1 r% d6 h* ~0 H    mov     ax,4fh
) N- f- F5 U% `% Q+ ]/ c    int     41h
3 O0 E' ]. Y0 v6 w    xchg    dx, es:[41h*4]
2 U# i2 e' t1 t* N    xchg    bx, es:[41h*4+2]/ b& C* E8 X/ z! f5 a; |& M
    cmp     ax, 0f386h
) h3 I! o+ z0 z    jz      SoftICE_detected' W; Q. h% P6 U1 ]

0 s+ Z( [* ]+ Jint41handler2 PROC
  v9 {1 ~! i7 `. I8 X+ X    iret! o, a8 F5 K/ I
int41handler2 ENDP
1 m! `- e7 M( f6 |
3 j3 _4 C1 ~3 Q* }; U8 s% j( V% q. c; Y+ a
_________________________________________________________________________
. j# [. _# q8 ~9 A0 ?4 P% w4 v, X5 o9 [) |( D
3 l/ ~6 x) {1 T# q& h- u. @
Method 06; L  U" k" w9 g0 N/ o& p6 z, h) W
=========- G7 f% W9 G' _% \
/ o' x& z9 E4 i, X8 Y# S% m( a
9 `% S2 z1 m8 s  H9 ]
2nd method similar to the preceding one but more difficult to detect:
' y4 p. I; W& y' D7 U" O% n% q/ q! f' l, v, h) }
1 J8 i  k3 b- E, v! g
int41handler PROC
3 m& [+ W) l; Q3 l! N2 y  v! o    mov     cl,al, s7 a9 x7 s1 ]8 Z' k; X, }  P
    iret
/ s0 Q3 S7 E0 `: C1 Yint41handler ENDP
1 Y' R4 q7 u% p7 G, ]
* B  N* Z6 {' C4 d
& h+ U' {  y- V    xor     ax,ax
% d, B3 D+ m; y+ P1 L4 _    mov     es,ax
# }* ?' u5 K9 P: Z# A7 p0 K    mov     bx, cs; W1 k, F9 B: U* h) ]
    lea     dx, int41handler
# W, ?! ?0 T+ x    xchg    dx, es:[41h*4]9 h: C- ~( q- o
    xchg    bx, es:[41h*4+2]5 I/ `* e% @7 W6 j) k
    in      al, 40h
" e: U# \+ S0 f9 S) e    xor     cx,cx
0 o8 ?5 V+ T3 ^  f0 H    int     41h4 W: H6 \9 M, W
    xchg    dx, es:[41h*4]
. A  V2 y# T- n" b# x8 p2 W    xchg    bx, es:[41h*4+2]; [. J8 z( x9 V- L  c. U7 H) T
    cmp     cl,al0 J" q2 L% @" \5 r/ B
    jnz     SoftICE_detected7 J" I4 J$ ~4 c& E8 s6 A$ ?

7 B3 i- ]7 v* H5 k_________________________________________________________________________
0 L4 K7 D2 }) Y8 |
) w$ L2 x. [; ?$ A: q, i1 Z8 p4 YMethod 072 o0 S0 G3 }& B( @
=========9 P' D0 N. Q' m- w, H
( _+ u3 q+ Y4 e& G2 N3 S
Method of detection of the WinICE handler in the int68h (V86)1 `  g8 q, r, I7 R) |0 k1 c

- a, q  M$ h% B7 k9 R2 H3 b    mov     ah,43h7 |/ y5 i, Q' ]* o9 J. N3 e
    int     68h
: ]# i0 o, R* v7 [6 |1 {    cmp     ax,0F386h
$ B8 P3 L7 N2 k! `! ^( I% W    jz      SoftICE_Detected
7 \4 b# Y" ^5 i6 d* f" [; }$ Z8 ]0 I4 \! x6 i" `# @
. r4 h0 F% l7 p; W5 n3 [, O1 ~
=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
9 O7 Y; e, U1 Z- Y# O5 X8 {   app like this:
4 O0 ]6 a) ^0 \; U. j, `: j0 h0 B( Q1 i8 B- L; c
   BPX exec_int if ax==68
; ~: N/ [% ~" ^" j8 f   (function called is located at byte ptr [ebp+1Dh] and client eip is4 q4 o& V; [9 c: L. `
   located at [ebp+48h] for 32Bit apps)  m5 m% f* O+ h5 f. G4 N  D
__________________________________________________________________________! L5 |/ i6 g: i/ i; L9 W' E3 S

$ h) j4 s- n. i/ u& l+ r+ V3 ~) Y# i' \' R% B' \2 E
Method 08
4 D6 j# |: {- \5 p=========
) R7 W+ f9 n" x2 L* y' F4 P0 S. ^
It is not a method of detection of SoftICE but a possibility to crash the* Z6 y% @+ t/ B
system by intercepting int 01h and int 03h and redirecting them to another/ P3 N6 u) c- y3 G4 @
routine.
9 Z$ L! h8 i) Q+ ]! }6 qIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
% S! F( H  ~. c' mto the new routine to execute (hangs computer...)/ Y- p; f  @( H6 h& c

0 T" \- Y4 m9 p, {& W2 d8 r    mov     ah, 25h
+ w  @$ o2 k  m1 W7 q: l& Y    mov     al, Int_Number (01h or 03h)' Z% \) g+ Q/ I& g$ A' Z: [0 x
    mov     dx, offset New_Int_Routine7 F: l/ a1 }0 H3 n6 H0 H
    int     21h
9 p2 O2 L5 L/ Z$ P  G: x# h  L4 u5 ?3 P: z0 P: v7 ]7 q! ]; j3 _
__________________________________________________________________________, V% w0 y* m9 `8 F
8 c; T4 @" h. J$ A6 n
Method 09
5 ^2 x# @2 S  s2 \3 _) S=========) y) d; ^/ T1 t8 J3 L3 Z

/ n1 S+ w  e' rThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
* k) \2 @: l% {# H& B+ z, Zperformed in ring0 (VxD or a ring3 app using the VxdCall).* M! d% M2 X& V1 |- D5 x' y
The Get_DDB service is used to determine whether or not a VxD is installed% E0 e) b5 r! u9 g6 N3 G6 ]
for the specified device and returns a Device Description Block (in ecx) for
) Z7 }# u5 i, e, z/ dthat device if it is installed.2 u8 l" k0 G" R+ ~  M/ J1 n8 X3 B

' e/ Y( Y* h+ o( t   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID
$ A- w, Q( o9 G   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
1 P8 c  A8 c0 x# j   VMMCall Get_DDB9 m0 d$ O+ @- K$ [/ G5 z6 V* o3 a! C
   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed: w8 A0 e* b  C
4 j! q$ u$ x( f4 W1 W
Note as well that you can easily detect this method with SoftICE:
) D" g, x. P# C' |   bpx Get_DDB if ax==0202 || ax==7a5fh" x- S7 Y0 t4 B
- m% L# A2 D& G; \% E
__________________________________________________________________________; U# b7 }3 p1 O5 s' E" D' }
, a& ]$ j0 E' ?, E5 K5 S7 }
Method 10
: V( G+ P: B5 Y=========
: v3 _8 u; P  t2 a) d( o+ \+ n2 a* c1 Q& g" ^3 f6 }  f, |3 p
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with6 R1 Y8 r, a2 A2 ^2 L1 x
  SoftICE while the option is enable!!6 Z) R- K0 e" f3 u
& x& Q5 @2 H. E0 H/ H* s
This trick is very efficient:
' `% T2 I$ ]$ h" h( c# Iby checking the Debug Registers, you can detect if SoftICE is loaded
. a3 q& g" n4 u! u+ L9 j(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if1 N) L7 X) @8 `' q1 v- n0 m+ W# q
there are some memory breakpoints set (dr0 to dr3) simply by reading their
$ i& W# a7 L/ h4 d+ Z/ Qvalue (in ring0 only). Values can be manipulated and or changed as well
; a" f4 ]3 g4 d: X" e(clearing BPMs for instance)3 C+ J* z8 K$ I" p% i. v
0 D* k2 F/ b7 u; n# d
__________________________________________________________________________
5 _# p3 Q% f$ |7 l8 R/ b7 e+ d/ P* u: W% K( V3 Z3 ~+ g
Method 11' M; V& m2 [$ a' Y4 e! q3 ?6 j
=========
& N  T) s+ s6 M/ S. K
- E* E$ a1 x: L& N3 j! IThis method is most known as 'MeltICE' because it has been freely distributed4 }/ L7 V+ x. e$ f# |- r! }& I
via www.winfiles.com. However it was first used by NuMega people to allow
* J3 W6 Q6 A7 K, V4 K8 @1 E" wSymbol Loader to check if SoftICE was active or not (the code is located
  C3 p  C8 f3 G" H* f0 |inside nmtrans.dll).3 A- D6 q: s& J8 N+ P

+ w' ?# k$ @) v4 D% GThe way it works is very simple:
- t& a3 G, }/ V% n& y7 AIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
  w8 I) A$ Z+ L3 @- MWinNT) with the CreateFileA API.
4 S4 z# ?- ?. d% d! F, ^: ^' `' e) J1 B# Y- t" M  D/ _1 t
Here is a sample (checking for 'SICE'):, d% ?" R5 V8 }# g) b: Q

% R" T' s, V  j; JBOOL IsSoftIce95Loaded()0 A- k: w  [+ w7 J! |7 q% U" r( x
{2 W# b/ P3 _8 p1 W, U7 g6 C2 w  P
   HANDLE hFile;  & x  i6 _! N6 t% T. O( Q/ `% C0 c8 ]* l
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
, B1 g# X$ W# @) y                      FILE_SHARE_READ | FILE_SHARE_WRITE,7 l: C# b( ~/ N0 r1 M9 ~1 J
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
4 x1 g( g, G# J7 T   if( hFile != INVALID_HANDLE_VALUE )
6 I" Y8 D/ v8 I0 p! d, e4 i   {
! s! d2 J2 h' n) I0 T( E) Y      CloseHandle(hFile);5 _) w% v1 [3 z
      return TRUE;
! m2 Y. I+ T, n; ^4 D+ N* _   }
6 U7 ~; ?$ c( S$ E7 C( n8 d   return FALSE;
5 m' t" m$ B: i8 N/ L" x7 B) k}
8 j+ q/ y1 X- ]) N; |; }. F3 a% ], w. e- `, x5 c
Although this trick calls the CreateFileA function, don't even expect to be
/ I5 N5 I( w* f5 \. i4 Eable to intercept it by installing a IFS hook: it will not work, no way!
# a0 l5 J6 _, k9 ^" MIn fact, after the call to CreateFileA it will get through VWIN32 0x001F! o, ?- b' o7 h+ H  \5 ]5 H
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function). k6 }' V! y. [4 y
and then browse the DDB list until it find the VxD and its DDB_Control_Proc# E# z  [0 w/ V7 o* G' L7 @
field.
  q7 W0 z: F6 zIn fact, its purpose is not to load/unload VxDs but only to send a
! b0 E6 d  G0 R8 N* [W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
7 f/ ~# E2 k  Y1 a' dto the VxD Control_Dispatch proc (how the hell a shareware soft could try
. A2 }$ o! L/ \) U( Mto load/unload a non-dynamically loadable driver such as SoftICE ;-).
( d! U0 ^, `7 ~5 X6 K9 U8 g9 ^& O& H/ rIf the VxD is loaded, it will always clear eax and the Carry flag to allow
5 L( a2 a2 ]9 c5 z+ J% nits handle to be opened and then, will be detected.
6 y) \& }' u8 E7 V4 {8 WYou can check that simply by hooking Winice.exe control proc entry point4 }- x8 U- ~: j- o1 ^( U! n3 C
while running MeltICE.
5 Y$ \+ }7 f: @; X  \
$ S( _  |' h! \! S; {+ n5 Z' A2 m
  00401067:  push      00402025    ; \\.\SICE# K7 i) i7 H, B+ O
  0040106C:  call      CreateFileA
) d& `# i  N+ U, [: |; Q3 F3 G, j  00401071:  cmp       eax,-001
  H4 k& n7 T4 C) w, q: l  00401074:  je        00401091
# c. G* b8 j- ]! c7 J7 p
; b6 q$ F: W2 n, Q* d! l" @9 v* H3 ]" y# a4 a+ U5 M6 ]' \
There could be hundreds of BPX you could use to detect this trick.$ ?" t1 W+ j, K% K# |
-The most classical one is:8 D  e, t' Q% X1 o/ x) R
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||; R8 a2 \1 J3 g( B% i; w, W& ]
    *(esp-&gt;4+4)=='NTIC'
; K1 p6 x  I2 K' K! J3 B$ q: D* O) t5 p/ G) G6 Y, {/ h
-The most exotic ones (could be very slooooow :-(8 e' p8 D5 D, B7 r3 c& L& e
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  
& ?) x3 m, c: u, q     ;will break 3 times :-(
+ j# m% `* n+ y# v8 a* n  i( i0 |7 t1 X1 t# _
-or (a bit) faster: 0 w& D, l' t* f+ T! M' @8 v
   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
- c4 h0 N% A+ v7 |; V: \; j1 `0 m& c2 D( N/ ]# O% }2 q
   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  
5 ~2 g7 @" {: f% h( S) J4 B( Y& V" D" e     ;will break 3 times :-() a' M0 Z) Z! @8 C! u7 N# i1 i$ o

! E3 l# G7 I. ]2 k3 E3 t6 F$ ?9 D-Much faster:
9 x* `. j' @1 f3 L+ y   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'5 K  U5 Z0 f/ [# g/ w+ r' K  t

9 [6 C$ ]4 A6 g' x( ~" g: C3 f+ JNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
: \$ a) f$ Y5 C1 hfunction to do the same job:
7 Q, ]* A, a& y+ o
) w- B- i5 }3 H: L  E3 c6 ]   push    00                        ; OF_READ
( m; ~8 M0 J* U5 m+ z   mov     eax,[00656634]            ; '\\.\SICE',0
5 Q, H1 t& O. q8 R3 o   push    eax" V6 f8 U' _5 q  V6 B, L
   call    KERNEL32!_lopen) i$ L& |# L2 @( ~7 A, J2 v
   inc     eax5 M1 T& B" i7 d- s1 }
   jnz     00650589                  ; detected
, N0 o3 n( R: l1 [, W: F; X7 P   push    00                        ; OF_READ/ |+ K( [' @7 L5 B% ?0 K
   mov     eax,[00656638]            ; '\\.\SICE'* j+ i: [0 `6 y
   push    eax; }" b& C1 P2 g9 D& }. U: p/ W
   call    KERNEL32!_lopen! d8 o, U5 `, k3 Z' \5 S2 c  W4 |1 |
   inc     eax
& z' P) ]9 `; S   jz      006505ae                  ; not detected0 I) W# j$ Z9 N

$ v( a3 ~/ X0 o4 q' N- B/ `8 T8 a0 m7 B/ V. Q5 U4 J4 i: b
__________________________________________________________________________
7 N6 e* P; D4 E% K" b! k
% P% N( O, W& @$ lMethod 12; a8 o0 n1 M. ]
=========
; O5 l* v) z' t# F4 a+ K
, n/ K$ l$ ?& Q7 r6 G! j& hThis trick is similar to int41h/4fh Debugger installation check (code 05; A& ^4 D7 z( k! [0 b" u# a+ ~% \, g
&amp; 06) but very limited because it's only available for Win95/98 (not NT)' q" j8 {  w" U- `# ^
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
# i6 Y) E. K3 K+ a+ V8 p  `8 K6 ]. V8 Q. h
   push  0000004fh         ; function 4fh
# [, F8 R( c+ a; y; V   push  002a002ah         ; high word specifies which VxD (VWIN32)
% d/ I9 M5 c6 z& \                           ; low word specifies which service
  h  X/ W+ Z$ \1 q. V                             (VWIN32_Int41Dispatch)
, h: e- q# ^  d" F* a1 p) E# u% W   call  Kernel32!ORD_001  ; VxdCall$ x; U' d+ K8 z8 Y
   cmp   ax, 0f386h        ; magic number returned by system debuggers
+ ~4 s; N, }0 J. N$ P9 N   jz    SoftICE_detected" d) `( L/ {( Z

$ S0 B2 u) Y) C1 tHere again, several ways to detect it:
* J* D. E* r# F0 j& c9 Q
9 I: _) i+ m) I    BPINT 41 if ax==4f
5 F1 Q' X& d* j
+ k5 y/ b9 ]( `3 d    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one
; g, w6 t% Y) H" q3 H# y3 i1 D7 g( q4 |$ W
    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
% W; \" }1 i2 q
# C0 s5 @) Q! p. L' l# S5 H    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!
, X- J1 e0 x  O. B  B- V7 ]7 e: ~0 q+ `; D2 Y
__________________________________________________________________________6 V- U7 n3 C* h6 j: Z; h5 z9 C( Q0 @
+ M: G7 g7 [' Q* n. m1 W* l/ H
Method 13/ v$ O; R4 H+ f
=========
* R4 W& s5 b- W1 w
8 x5 L) e0 t9 p; O  z$ ENot a real method of detection, but a good way to know if SoftICE is- R4 t6 D: O6 S& v2 [
installed on a computer and to locate its installation directory.# j" i9 I5 M5 I! |
It is used by few softs which access the following registry keys (usually #2) :
% V2 N+ j: [0 W; I' K/ T% o2 t4 @& j+ d
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion: E8 }3 f8 J2 E/ w; E: s
\Uninstall\SoftICE
' `, s' L- [+ v! m/ l0 w: r-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
4 o- B3 n' T; @7 L" Y  V6 w' S* j-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion2 z. W/ ]! R( [) v! c
\App Paths\Loader32.Exe8 A: ^$ |- |( ^* H, v3 w' B

7 Y6 c/ L' M9 v* Z( @8 y" g
% `9 `$ i3 C, L- b2 K* p2 Z; WNote that some nasty apps could then erase all files from SoftICE directory2 {3 \9 S3 b' h) j
(I faced that once :-(
1 G& m, }& ?: g' ]* Q1 k( R. }* _7 P
Useful breakpoint to detect it:$ G8 |6 ]0 t9 [  `6 _* N4 K

+ {) k' Y* o. R' m# N     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'. }- w; Q5 A' q/ V

! H+ w1 P# K1 L1 Q& I: G__________________________________________________________________________1 N; V* \9 d' k( f4 q+ U9 I
7 m, ^5 \1 l* ^0 o; [) F

: \# ]  S/ U  ^' w& WMethod 14 4 c" x  F$ i: ^7 S4 }
=========
! Q* B0 ]9 Y0 ^1 ~$ c1 y5 X
8 d" u% }! a/ l/ N3 sA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose. D- p8 p4 ~( X: f1 `
is to determines whether a debugger is running on your system (ring0 only).
3 h; I( Z3 ?5 j4 z0 ]4 B  C* H. v+ L
   VMMCall Test_Debug_Installed
) A8 M4 ]+ }% p/ `, `9 Y3 R   je      not_installed
, r' c; g9 K7 U
4 \; T( T* j! g$ F- z$ SThis service just checks a flag.
( k: F2 t6 J8 Z9 N. k6 v</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-8-15 08:25

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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