About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
" E+ g& F! p3 i) ~1 [$ m<TBODY>2 S# }3 s4 ~" R+ v" z7 D8 v
<TR>
$ C- @* x! a& ?% A' ^<TD><PRE>Method 01
: U! ~+ d7 s" V! H7 t9 O=========
) h) X+ Z; }$ q  k8 c1 a' N% [; a
4 ~+ u6 \9 N9 k' C+ QThis method of detection of SoftICE (as well as the following one) is
9 L9 ?5 \+ P' p0 w6 `used by the majority of packers/encryptors found on Internet.
& g& Y( m2 W' {1 \2 O4 ^It seeks the signature of BoundsChecker in SoftICE
6 a) s# r2 r, d0 y9 f: z
& }- v$ }4 W- y8 R    mov     ebp, 04243484Bh        ; 'BCHK'
, l7 A. w& j! S8 d: g2 \; q    mov     ax, 04h2 V( O7 p' M$ P
    int     3       : L6 [! g- s3 x" n2 S7 p9 L
    cmp     al,4
; |& n0 c# R8 w5 x7 i1 K4 Q    jnz     SoftICE_Detected6 Q' t' [7 p7 b! k2 b
0 O: w/ j% y5 m  Q
___________________________________________________________________________0 l+ [  o' f4 s5 W) e

. T4 \# c! }3 u# j7 OMethod 02
- N; ?- E2 \! |# B=========. H- v" W) E, W/ m

% U2 P) S! v8 x# q- sStill a method very much used (perhaps the most frequent one).  It is used
- e/ \: E! C8 t2 x3 d; uto get SoftICE 'Back Door commands' which gives infos on Breakpoints,: E9 c$ `/ w# ^$ p4 V9 V& M
or execute SoftICE commands...
# I$ G: l! w5 @% |& \It is also used to crash SoftICE and to force it to execute any commands
$ u3 O0 O) I1 O3 p) K- B1 k(HBOOT...) :-((  
# l8 n3 ~% X# V' C) M/ `( T' x
7 _0 m1 y2 ^' S$ }' a1 \  g; w1 @Here is a quick description:# k4 A9 h* g( ^+ Y. ~" b% s
-AX = 0910h   (Display string in SIce windows)
2 p5 t: O4 q3 p-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)) e# S; W4 y6 l# ~, Q4 e
-AX = 0912h   (Get breakpoint infos)- S- s- r( r) @  }
-AX = 0913h   (Set Sice breakpoints)5 V4 x, ?0 f- ?
-AX = 0914h   (Remove SIce breakoints)* X7 U5 F( n6 l1 @0 ?2 X* N9 z1 t

+ q+ k( O/ Z/ x5 u; z% x- R% SEach time you'll meet this trick, you'll see:
* Z! B2 ~( v. A5 G+ p8 e-SI = 4647h
8 B. X3 h( M* W& ~5 A! |: X-DI = 4A4Dh
/ @1 Z8 U2 |  ^+ WWhich are the 'magic values' used by SoftIce.1 z/ L/ Z# Q( e
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.7 t9 F- v% u% P# K5 i" O, L

2 [3 g5 O2 |3 }1 @2 L( ^Here is one example from the file "Haspinst.exe" which is the dongle HASP
0 Q- _# Z" j0 h( J+ @8 O1 ?  K6 wEnvelope utility use to protect DOS applications:
; R; c) k8 v) \: Z7 R
/ v. W- D* l- r0 T5 K9 `6 U# Z* b
& S/ H1 G) _5 ]0 y4C19:0095   MOV    AX,0911  ; execute command.1 i2 r- M% F# N/ s
4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
" [, I  |* d7 g4 D4C19:009A   MOV    SI,4647  ; 1st magic value.
% p/ H$ P: p1 K# p' U0 t4C19:009D   MOV    DI,4A4D  ; 2nd magic value.
2 H0 H# L) Z4 D9 C' q0 {% D4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
% `8 o9 {5 O  x/ m, e8 |8 b4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute
% N1 j! o' W8 k1 A: F6 ?. S4C19:00A4   INC    CX# b. f) P% t1 v$ p& ]1 U
4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute  U# s1 C$ j- R' C
4C19:00A8   JB     0095     ; 6 different commands.
6 c  t, H7 @6 B& }; j2 {4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
" Z* ~! W0 Y3 A2 P% N4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)
1 {4 m& v2 E% |* _& V
( O" {6 M" d, K1 XThe program will execute 6 different SIce commands located at ds:dx, which4 ^( {: g# o4 j! v+ n% a! w
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
& g" i7 v( P* {( O3 B# ^& i
4 ?$ c' f7 v# W& R" m' [. @! q* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
+ b- t1 o. |5 G$ q* |9 l___________________________________________________________________________
; A4 o- x# X6 o1 x
% Z8 z$ `) _1 ^5 L7 M3 v5 M* N! [/ e* f* c
Method 039 ]7 F  x) |8 K
=========( g. E1 Y' M( E" S2 L- Q

8 H1 ~: v2 u  q' o, FLess used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h' ~4 Z* n) o3 @% H& y
(API Get entry point)
/ W, `! n% [4 X* f' e+ O; R! x        / F0 V. a+ _5 j, O0 |% i2 J

/ X5 P  g1 \# X& P6 m( Y0 K2 c    xor     di,di1 b6 J) O9 y! s! Y- u5 p
    mov     es,di
, B% n3 C1 I' h    mov     ax, 1684h       8 v) \, s6 {8 k0 S9 I2 W/ H, u
    mov     bx, 0202h       ; VxD ID of winice
7 x9 {6 M3 ]5 X    int     2Fh
/ V- t0 j7 c1 O, D6 G9 K! s" C    mov     ax, es          ; ES:DI -&gt; VxD API entry point7 B( Y% T- z: u! i
    add     ax, di1 {. b" ?8 w% b% Z8 m% t
    test    ax,ax
8 n/ Y( y) Y+ @. m    jnz     SoftICE_Detected+ ^- q: E9 S' D& r: \

9 `+ o/ ?: g3 r___________________________________________________________________________& ^. Q% q9 R; ], @3 o
: ?* Y& B' B4 L* |3 x1 [, |$ P! A
Method 04
2 Y7 j/ l- C! t4 G=========" ^/ u9 a! |9 D' w9 ]
1 v$ Y8 g7 m7 ]1 [
Method identical to the preceding one except that it seeks the ID of SoftICE8 `2 w$ a1 x% O1 P1 t
GFX VxD.9 D  y* h) h# y$ R! T+ I& U
  b% }0 j, _7 _# P, L! E
    xor     di,di, p8 X9 d2 U6 Z8 A; K
    mov     es,di6 }8 e: P% Y" T4 S4 o  F5 ?
    mov     ax, 1684h      
) @( i  a. J& [( D: P( l" y    mov     bx, 7a5Fh       ; VxD ID of SIWVID' \; x. E  E# I
    int     2fh* v- e7 y+ h5 Y8 Z, J
    mov     ax, es          ; ES:DI -&gt; VxD API entry point! a1 C5 q/ R* @1 G
    add     ax, di
( u5 U; B1 P" `% H+ T    test    ax,ax: d6 m- O( o) ?1 G# N. I+ f+ B
    jnz     SoftICE_Detected
% o8 T9 ]( W$ T2 Y' h; F( T5 |3 I# }$ T' v7 Z$ X" J) y
__________________________________________________________________________
* V" b* m) W& L& f5 y, g5 o2 R; E. \$ g. W. H
) s9 ?2 ?& f7 `4 s
Method 05
. B" k  B9 z: v4 R; r=========
% R; E& `( S! I4 g2 ^: ^5 C& u
/ w* R8 }5 i1 d+ U8 CMethod seeking the 'magic number' 0F386h returned (in ax) by all system+ x4 f6 `1 S0 ^7 `+ ^
debugger. It calls the int 41h, function 4Fh.
6 z' {& c, M2 }+ ?# {3 h9 F  g5 {There are several alternatives.  
: b7 ~% i+ V. ?8 |, q4 s9 U, q2 u! x5 |8 U
The following one is the simplest:  f$ x5 D  _# D' D

9 X4 b/ i& B% u3 K4 X+ E+ X    mov     ax,4fh, l1 }' B/ M/ B  f) _$ L
    int     41h
2 ]$ m0 B7 Y0 ~4 X* p    cmp     ax, 0F3864 Z- J0 K! B7 q
    jz      SoftICE_detected
' r7 U+ F& ]% c- q8 e
/ o# h* y) C2 I- n8 s! S& v1 y! u: b
9 s" u7 O. `  y; x  D& sNext method as well as the following one are 2 examples from Stone's
2 Q0 B+ N' x$ @9 K6 l# ]; }+ F"stn-wid.zip" (www.cracking.net):
, _+ O  W4 N/ w/ q" e& ?# l+ I# d. j! Z$ l% E& t* \0 F  t+ d
    mov     bx, cs
( \2 d2 N# R! p    lea     dx, int41handler2
. ~/ Y9 c  ?1 O5 r    xchg    dx, es:[41h*4]
" x8 H/ y# R6 f* j( j5 G! v" R) z    xchg    bx, es:[41h*4+2]
9 G/ |, z4 s$ u9 i    mov     ax,4fh
( t; ^8 w( G9 r; E- t    int     41h. j& \' X( r- I! a, m! f: y
    xchg    dx, es:[41h*4]# s- P, k7 G2 r/ T
    xchg    bx, es:[41h*4+2]
9 l  w* v' p0 C' D, Q    cmp     ax, 0f386h0 q9 d7 ~2 \2 @" u9 q1 e* I3 z
    jz      SoftICE_detected
& f' _0 j0 ~. o1 f8 \3 k, S# Q5 K
int41handler2 PROC' N: D9 b0 e2 y
    iret: Q$ Y7 ?' o. L9 Q6 f6 Q( i
int41handler2 ENDP
: L  P9 t. I% ^5 Y
0 z3 R% _4 X( y& E9 h, S
$ Y$ ?3 m6 }7 M0 T. r% j; h) {_________________________________________________________________________
+ |' d3 U- o. M( W" ^1 V2 s8 I7 ]4 \% {) h: a  v

* |+ [- Z, j& ?0 `Method 063 W$ t" P5 ?& X& v
=========
& Z/ [: ^: u0 {- f$ K3 y6 w4 p$ h" A( I2 Y' m: ^% Y

$ u) m# c. O8 `* K, w# U/ @; t7 j2nd method similar to the preceding one but more difficult to detect:
3 ]2 }( q8 d7 e& w8 u5 A
8 m: a: V1 v& b. q4 v3 J
' t" k* k! x& y+ x) i4 nint41handler PROC
. ?! X' c) j3 Q" x$ z  c    mov     cl,al
% c+ h- G2 Y/ b6 N5 {    iret
! q( m* F$ b/ P0 Q" s2 N0 F  T4 mint41handler ENDP3 m; m0 S- Q- A1 n. j, W

) A" L3 o- S# e7 h" V4 s
! s& p' b3 P3 M3 ^# r2 X0 z    xor     ax,ax
& Y" h1 F! w( c4 z: f    mov     es,ax$ c3 [! f! [/ P, N
    mov     bx, cs5 O$ P* p5 _( ~, z
    lea     dx, int41handler
2 _  E# c# i3 J1 y; y4 l% z    xchg    dx, es:[41h*4]
' ^9 k  n8 k9 ]  J1 h- d    xchg    bx, es:[41h*4+2]
# j4 Y# b8 r7 q$ j% \( D    in      al, 40h
6 ^& d# V/ e) m4 k0 z( x    xor     cx,cx+ g* e! V) Z7 V: D8 h2 Z1 H" e+ c
    int     41h. b. f& A: G' X9 `5 W5 t) Q
    xchg    dx, es:[41h*4]
/ z- b" O% b* j    xchg    bx, es:[41h*4+2]' i$ B9 R6 L/ h1 k; q5 d
    cmp     cl,al$ W' x+ K1 E0 E( f" s$ {; V9 E% a$ p
    jnz     SoftICE_detected! @1 _/ ~4 N8 j% u8 \. j* e

( {! [, v' u0 z_________________________________________________________________________
* X8 z/ H) \; V6 r- k! a1 L8 ^7 _/ d( _4 j5 ~7 r3 M6 {1 e
Method 07
1 l7 X" U+ ?# o8 X=========, E. P+ {2 i6 ^# i4 i) j5 `
- C5 f6 U, U3 x% M! e# L
Method of detection of the WinICE handler in the int68h (V86)- A) L, q' W3 J$ g
$ U, j. B# U' c) j- P1 y8 j* k
    mov     ah,43h. e' \9 g' b, A7 b
    int     68h( T. t7 ?" R/ a4 V9 P
    cmp     ax,0F386h
, i, f7 r, h- k* Z& _    jz      SoftICE_Detected1 D* g8 f, w4 R, D: u- o& C( |# S* g
+ F% l( a2 F( @4 T
* A6 Y* r% Y: u' H0 S
=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit9 X3 q0 Z" H" v. y# \- v
   app like this:
" [9 E; O0 I4 d4 v6 Z% ^8 e  K5 p+ }9 R. K, ]& p% K
   BPX exec_int if ax==688 d# |7 {1 s) g$ w
   (function called is located at byte ptr [ebp+1Dh] and client eip is
: y# s" Y4 b1 V% u3 K* y   located at [ebp+48h] for 32Bit apps); k; _4 N0 y+ r$ P2 p" y, D
__________________________________________________________________________
) l: e+ |& o1 s# |% Z- K9 c
0 D4 n. e+ L7 G# u3 A2 y- z/ p  v" i8 f4 {7 _' Z
Method 08# j6 U; i& O( d: ?8 b! s
=========+ d$ n4 i0 k  q. s
  q3 c( ^  o( B! y: G' s! X+ N. Y
It is not a method of detection of SoftICE but a possibility to crash the$ g! t3 n* |% h
system by intercepting int 01h and int 03h and redirecting them to another
3 ?( C$ m# `; m7 ?' O, [routine.
! B9 Y/ w- g; ?' s; J; f  n+ ^It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points5 o4 H) s& O8 r( O
to the new routine to execute (hangs computer...)
( D2 Q' ]$ D; c# ^1 W, `: f! [. d' H" L4 j! f% |
    mov     ah, 25h
8 z$ @2 e0 _) l: [" ^" @1 V    mov     al, Int_Number (01h or 03h)6 v5 {0 u9 L) X* J
    mov     dx, offset New_Int_Routine
2 s' _0 R8 ], E7 s; d+ X# e    int     21h, r, Y2 o. J! @& s

' j5 A5 p( C( _/ B0 S& y1 a  O' J8 u__________________________________________________________________________
' c, k8 k2 H6 y# L# M
& d) L3 b% W& k8 I" mMethod 09  g  N+ p7 D  A5 {) ]6 ?
=========$ W: j' L3 b' s9 F! G" c

) |4 ?# f0 e% O# ZThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
% ^1 T2 {( m1 {; R! }2 r/ Q3 M- T# Lperformed in ring0 (VxD or a ring3 app using the VxdCall).
4 g8 R* a, u( {. s' P! X8 WThe Get_DDB service is used to determine whether or not a VxD is installed
8 ]% q- y  O% Y# |for the specified device and returns a Device Description Block (in ecx) for2 l% t0 V. @5 v+ o& ]# Y3 L
that device if it is installed.
; M) F. J$ |6 l+ j/ G1 k+ P. L% @+ {# A' f6 @
   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID8 z' h1 v$ t3 Z: Q+ k
   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
. D+ F  p/ c8 w3 L  b   VMMCall Get_DDB3 f" j- a. H% B# s
   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed% p7 D; B3 F: M' Y
3 }8 m) q0 d! M( d! Q* y
Note as well that you can easily detect this method with SoftICE:
1 {6 {" F. Y& _. J   bpx Get_DDB if ax==0202 || ax==7a5fh
: M2 A' F  u" I, e" M9 w; Q, W4 `+ z9 N& }6 @* J8 Z4 p9 C% m
__________________________________________________________________________1 _' s3 y* T6 H- o8 O

' c7 D/ S5 u4 o9 f6 R" UMethod 105 K: R" y8 b/ b) `
=========
# q# r+ n- s: I% r/ k9 D8 o# r/ ?  X
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with% x3 r6 q/ j. k, e7 C
  SoftICE while the option is enable!!" k. H8 y4 V4 ]8 r2 f2 W# h

& z5 x9 u, i# \' PThis trick is very efficient:8 d1 |0 s' n0 h! ]0 T, _3 S& I
by checking the Debug Registers, you can detect if SoftICE is loaded
- [4 Y) M, G& L  |, g(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if7 `4 j& b) I; L* o4 ?- u
there are some memory breakpoints set (dr0 to dr3) simply by reading their
" y9 Y2 U2 P! e5 [# X  }6 M3 Jvalue (in ring0 only). Values can be manipulated and or changed as well- W7 [& q( ^1 P4 h
(clearing BPMs for instance)
( _+ I  y7 }& J% ]% L1 B( Y$ @
# ?- K) @& B6 }__________________________________________________________________________6 T% e! O" V4 K# P2 D* k$ N9 q

# \  g5 b7 b) m' z6 n8 uMethod 11$ G/ h) J0 q) O4 s
=========2 \6 d' |, U# P7 n. R

  i/ Z8 ~( p7 j. pThis method is most known as 'MeltICE' because it has been freely distributed( f  J& N0 Z1 ^. j
via www.winfiles.com. However it was first used by NuMega people to allow
+ U5 a2 o5 q0 Y, m* WSymbol Loader to check if SoftICE was active or not (the code is located
" b( @( q1 m1 ~+ ?2 E8 Rinside nmtrans.dll).
/ D# h. g" Y) }7 ~4 s
1 {( d6 k& C( O* o- X+ U( }7 z( AThe way it works is very simple:
4 S, l% s% f& m+ U3 Z9 ^9 jIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
* j5 g% F7 k/ C9 cWinNT) with the CreateFileA API.
' p$ o6 |& e; Y' u1 }- I% T  }: \8 o
Here is a sample (checking for 'SICE'):
6 t7 p8 @6 B: z, N4 Q, p
# B9 |0 d" u7 M+ t; }BOOL IsSoftIce95Loaded()& K- M% `, u7 E3 m% [9 k8 P2 H
{
8 ?, M" n) f7 D2 |" u   HANDLE hFile;  
: m. P2 t  t# `3 T   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,' W, i! n: j4 Q: K: i& x! o7 {
                      FILE_SHARE_READ | FILE_SHARE_WRITE,
9 }# F) j& C; Y% Q( j" J                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);- x+ x7 L2 z( S( @8 p
   if( hFile != INVALID_HANDLE_VALUE )+ b$ ?* s$ e6 @: `
   {( {2 v9 ]  h) r. N5 }1 i0 r- D
      CloseHandle(hFile);) |6 |7 W/ i: ?$ `- }' w8 {
      return TRUE;
. i+ o+ G6 b, F1 z   }
5 }0 c0 P" W" n4 W   return FALSE;0 _3 ?, V0 j& {9 _- q
}% L) z- I+ J+ F

2 a- m- t0 R6 A2 RAlthough this trick calls the CreateFileA function, don't even expect to be- d6 U! B7 ^. ~9 p5 @
able to intercept it by installing a IFS hook: it will not work, no way!  ~6 c8 ]0 k  V& b
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
% X5 C* J) d/ e/ \1 R6 Qservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)/ s8 n  ]$ `1 k8 a; C
and then browse the DDB list until it find the VxD and its DDB_Control_Proc4 [. v& k( {* ^* m, `
field.
  d/ q& ]& V) U4 P2 g# N( mIn fact, its purpose is not to load/unload VxDs but only to send a - h* ?" m4 Q* [; G4 V
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)* |3 q/ V2 z* L) `1 t+ h
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
$ X% U$ h( _0 a. L6 x. x# f5 hto load/unload a non-dynamically loadable driver such as SoftICE ;-).
; p& j$ Q% K, ]6 `/ A8 nIf the VxD is loaded, it will always clear eax and the Carry flag to allow2 J. e+ ^9 ]6 X& B6 o% {& s
its handle to be opened and then, will be detected.
  R  X, `( ], j, }3 ~You can check that simply by hooking Winice.exe control proc entry point; H- W2 k, N& S, x! c: y2 d6 p: ?
while running MeltICE.7 w" A8 Y6 O6 e" o, v& V9 T

% S7 N7 ], V1 ?5 a7 M6 R2 V) d) Q! Y  q% @
  00401067:  push      00402025    ; \\.\SICE
8 g* V: r4 [/ v& Y5 z3 K  0040106C:  call      CreateFileA, \/ J9 W% ]" F/ p  M" C" b1 z
  00401071:  cmp       eax,-001
7 W8 C) \2 j/ p& E7 |  00401074:  je        00401091; H% ?  s7 u  O; ?

. }  Y% ?8 S3 h: M+ Y! w2 r) `% P4 S& w' F
There could be hundreds of BPX you could use to detect this trick.$ C# ]5 o, j/ }
-The most classical one is:# k0 X9 u* F( ]  M1 Q
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||8 H) H! M! U* E9 D# _" b1 \6 Y
    *(esp-&gt;4+4)=='NTIC'- ?# i, ?5 l, k5 ~8 Y
" a0 R4 ?4 S; D: h  J! S
-The most exotic ones (could be very slooooow :-($ B+ O: U) X. O8 f4 l: L
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  - A, X  `2 Z- o6 ^. T) C+ B+ r7 B
     ;will break 3 times :-(
0 B- w, S/ J( ~4 p% S; N" M# d9 D  C
-or (a bit) faster:
. l! v; {7 ^. l& d) s   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')! R7 q& z9 x2 T! G) i' v8 V
2 x! {" s4 m2 J5 ?
   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  
$ {1 k8 D1 e  G0 a3 k( f     ;will break 3 times :-(
0 R, M' J2 I) b6 e! R  s: X7 R
  c/ T9 t8 o. D$ k, E-Much faster:
/ n# O5 q. S& F  j8 v# S2 s   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'; ^) T% y% I- @8 F% ~( g" ]

. m# q5 `" f: g- d; P5 s  ?5 CNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
2 l- x% f% ]% p* L* W) yfunction to do the same job:/ p; Q# t6 L$ M8 }* \3 U- @9 p

$ C& z' z% W6 N$ {   push    00                        ; OF_READ0 Q  k- m& F' |1 I2 z/ Z" p
   mov     eax,[00656634]            ; '\\.\SICE',0
: I  S( w- f% w   push    eax% ]: P, _! V$ P+ u" g
   call    KERNEL32!_lopen+ Z! {  p; l+ a9 @
   inc     eax
: @  H1 |6 N) S; N+ m2 `# C4 N   jnz     00650589                  ; detected+ _) @, A* G7 `4 A; l: A
   push    00                        ; OF_READ' R- v1 M6 m$ w! [/ g. ~. j
   mov     eax,[00656638]            ; '\\.\SICE'
+ D  M! _, ?& _, f   push    eax' i6 N& T! Z1 q; E( }. q
   call    KERNEL32!_lopen5 m; T  E4 M- o& E+ X( Q
   inc     eax+ K- G' }8 h/ j+ f
   jz      006505ae                  ; not detected
+ x; N8 q; ]" q" K& `$ c1 o
9 U5 ~* k! D5 e  V4 q
- _( m; \; s2 [, k8 m__________________________________________________________________________$ v$ S" T+ u3 E# C; j
1 \+ q% @3 Z, l# I# n8 g8 A. B5 o" C
Method 12
, ?, L( x& K7 b: `* b/ _7 j=========
" ^" O% x( j8 b6 U) I  u+ k
( Q) P2 C6 B8 |7 yThis trick is similar to int41h/4fh Debugger installation check (code 05  Q% `9 q1 Q, \; ~
&amp; 06) but very limited because it's only available for Win95/98 (not NT)5 S2 A1 {2 M& Y/ ^' e
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
( N( r  [, E8 Y( X7 q+ M3 N( R5 n+ \2 o- b5 Y; v- K; g0 K
   push  0000004fh         ; function 4fh1 r3 s1 @; o% D5 ~
   push  002a002ah         ; high word specifies which VxD (VWIN32)
( O- K. N) ^2 f2 X7 f                           ; low word specifies which service
3 N, O3 W- ]: }6 L, `6 N5 B                             (VWIN32_Int41Dispatch); f6 q* O% w8 `
   call  Kernel32!ORD_001  ; VxdCall2 j! M! n( a0 C' ^, Z
   cmp   ax, 0f386h        ; magic number returned by system debuggers
1 ^; ~8 ]) p: B7 s- I- i7 O   jz    SoftICE_detected4 b, u% F! N4 S

, B* T! D4 E9 j5 t5 Q' {% yHere again, several ways to detect it:
; g* W4 v1 k& S9 ^& H& m8 {8 b/ T1 w' s& R$ P6 E; T
    BPINT 41 if ax==4f
( P0 i4 y3 u$ I8 r: c
$ t! m9 ^$ X% X* i    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one
2 U) T9 f# r2 a: g
8 G4 K- T- F3 G/ L) |, U! a' p    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
' \) R9 t& b6 u' l
. G" o* B& u8 r6 w    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!& z3 V% p4 k9 ~
3 A& U3 U8 u$ y7 Y0 v
__________________________________________________________________________+ o  f* `1 k/ h% z8 W7 n8 T0 ]
* l% X! |7 o/ W1 a
Method 13
2 d0 \4 }1 r" F1 u8 K=========6 m! j+ `3 f% U/ ~8 A% i; `
* d0 q  F/ K/ l& s5 H1 D
Not a real method of detection, but a good way to know if SoftICE is* l) @6 y' D* k1 J, q
installed on a computer and to locate its installation directory.
4 V: W0 R3 s% B% R3 ?6 w8 kIt is used by few softs which access the following registry keys (usually #2) :& a1 O  Z' y0 U4 G

' A- N# B2 \5 g9 X' {- @9 \-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
8 ], j3 n4 P, R4 ~\Uninstall\SoftICE
4 x: d9 [& ]3 k" `$ i; p7 a-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
4 {: Y9 U6 T# L: N, m( h-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion  t& Z9 E$ ?& N+ T+ `
\App Paths\Loader32.Exe
  A, F- y, s% v3 ^6 {9 H. a1 F0 Y& Z1 H! c0 _, v4 @  K7 u
# O; x0 ^' S: \3 ^2 l% G, c. C
Note that some nasty apps could then erase all files from SoftICE directory0 y+ {2 e5 B* {; H- D: x" U9 \4 T
(I faced that once :-(
: j: ^  P+ J  f$ j/ I+ _7 e1 Q7 C/ z% o
Useful breakpoint to detect it:
7 Y; G/ F7 x# v" O) f' k' e5 i/ X: T1 \. ?. b
     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
: ]1 s7 D2 j0 n8 U: d- @. P7 s# S) O) H; o" J/ _
__________________________________________________________________________
, H  G/ H' S5 O& m& ~- g2 W  Q3 ^" m7 x
% S5 [4 e( v1 {5 D, X+ u
Method 14 : c3 \0 S' u* u! ^
=========
/ r/ ]9 a6 b: m  ~
' x) F5 J9 ]( DA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
' P. j* X) u& i$ s+ _# uis to determines whether a debugger is running on your system (ring0 only).' T: i: L( D/ ~2 B
+ w: [" }- v' ]" v% N/ z* o1 M
   VMMCall Test_Debug_Installed1 n- y! h+ @7 f, [1 k" o
   je      not_installed. V" R) y5 \$ {9 Q& r+ h
9 C' h) k: r$ O' Q
This service just checks a flag., O+ A8 I' }& S- B' X
</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关注公众号

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

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

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