找回密码
 注册

QQ登录

只需一步,快速开始

About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>1 s( m* @) J! i$ f  _
<TBODY>& c1 ]3 v+ G, e7 c
<TR>( ~% E) d; T6 [. C6 O" A& H* \  i
<TD><PRE>Method 01 ! n( P6 P& m2 C  k2 S4 g
=========$ a4 d# u! K4 M% u- m" u& j

0 b8 k: \: U6 c7 s4 P# V+ L* {4 JThis method of detection of SoftICE (as well as the following one) is! |4 I! \( d, |4 [3 k
used by the majority of packers/encryptors found on Internet.
5 e, I% j0 c# S4 C1 B0 uIt seeks the signature of BoundsChecker in SoftICE! `+ Z: n0 p1 G/ M4 Z9 t$ P
% x, `) }& z/ p
    mov     ebp, 04243484Bh        ; 'BCHK'
+ j$ p# n/ z7 O1 ]) x6 j6 D9 D, A    mov     ax, 04h( y2 }& _0 _3 S. k8 y
    int     3      
, i/ [/ B7 F/ k$ W7 ^% j    cmp     al,4
, y( @2 z! F" q0 t. k    jnz     SoftICE_Detected* l/ i6 z6 I  `/ ~! a
1 I. i7 T8 I( V
___________________________________________________________________________: S' u- W+ [; W

, N" p; Z* ~" j  p" [8 k( Z6 {Method 029 w6 S2 O( @/ |8 a! }' a; m
=========( F; T8 r- y, J$ b( t# d- h

5 |- l: D4 N5 q" j9 ^/ XStill a method very much used (perhaps the most frequent one).  It is used0 I/ N/ l% N( a7 j, a) w; R/ @2 A) O" j
to get SoftICE 'Back Door commands' which gives infos on Breakpoints," M* M/ ]/ x/ [* ]" P1 j9 z
or execute SoftICE commands...
% c& j/ p) o; Z/ s% GIt is also used to crash SoftICE and to force it to execute any commands9 L1 h) ?$ k. v; y" ?
(HBOOT...) :-((  
! L, q7 i! x/ C
) g: q- h1 D3 A; JHere is a quick description:7 p& ?# s& M( j1 L' J; i
-AX = 0910h   (Display string in SIce windows)# z8 X- r9 I" S0 B
-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)
: n2 |* X% }& t-AX = 0912h   (Get breakpoint infos), M' l' a% [/ \6 v( W
-AX = 0913h   (Set Sice breakpoints)
1 K6 Y+ {  H& I; g$ J-AX = 0914h   (Remove SIce breakoints)" A: V$ r* y9 }4 F0 v" z. N

7 s# g: e. e) t7 b! k: [Each time you'll meet this trick, you'll see:6 r9 L; S) r' ^8 ~
-SI = 4647h
) E" H: B+ Y# y9 j-DI = 4A4Dh
  |' a1 L& R- a  t. G& n# hWhich are the 'magic values' used by SoftIce.5 i& i3 _4 v4 n' G6 w1 q
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.* P) U/ C$ _: D; o

: o' B; J1 e) _0 H. U" ~' ZHere is one example from the file "Haspinst.exe" which is the dongle HASP
# o5 L0 {$ |. C2 i8 E' o, gEnvelope utility use to protect DOS applications:* U2 a2 ?8 Z, }; Y7 l
. Q/ h2 E; O; X# s
' ]$ \! b1 u1 y6 D3 D7 @
4C19:0095   MOV    AX,0911  ; execute command.
: C6 o/ S9 {6 z5 z+ }( e4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
" d- l" W, l' n$ w4C19:009A   MOV    SI,4647  ; 1st magic value.
) x( T4 W7 y' O. m  d! ~4C19:009D   MOV    DI,4A4D  ; 2nd magic value.7 q0 F/ K/ }5 T5 s; V2 `9 h
4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)4 C: ~6 a' t. A& d$ @& ~/ N/ k
4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute
: E' B5 g' x7 S" R2 a% s1 |% F4C19:00A4   INC    CX
  z, F! D7 L8 ]4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute6 u3 g6 M0 D4 f8 f
4C19:00A8   JB     0095     ; 6 different commands.
+ q# _5 A" G9 a( u4C19:00AA   JMP    0002     ; Bad_Guy jmp back.' [2 p. v5 ~  f: F4 g
4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)
' a6 D1 ^0 x' c+ Z- [
5 @9 k6 |3 U4 \6 Z8 x/ i6 g2 jThe program will execute 6 different SIce commands located at ds:dx, which% h0 {" s: Q9 r
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
3 l" U/ C, W' B: o( w, B. L
9 {) P; O) P8 F* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
5 x$ T& f  R. D6 r( @___________________________________________________________________________
. J& P- H) @' S) g8 g$ k+ k7 z$ H' J3 g( y( o
  {+ y3 I  m  S) _! j2 e9 W
Method 03
1 a( F# _# r4 x  M2 C& M=========7 R% F6 {: ]6 q3 o1 T7 Y+ w' n9 r

3 h6 Z# @& m1 r! C( [  FLess used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h( U" R9 V7 e" z3 F0 K
(API Get entry point)% [. C2 n' i  x* v
        " l. w/ p1 Z! h
( }% j& p% D6 y, g' ]; [
    xor     di,di( ^9 ]7 X0 ]1 {# W, f! ~
    mov     es,di
8 i: o& |) |* m" g6 U" x    mov     ax, 1684h      
# `6 z8 J9 M  O7 J& o) l1 G3 O    mov     bx, 0202h       ; VxD ID of winice1 [" p6 \9 y8 x0 N, |
    int     2Fh
! w" J; Z( _& `  m. L; m    mov     ax, es          ; ES:DI -&gt; VxD API entry point, I2 T  h, L; J: q7 I; c5 g
    add     ax, di% u4 e$ r" |4 F& h& P/ Z+ C  @+ |# \
    test    ax,ax
, ]8 u, C9 q  W0 l: d    jnz     SoftICE_Detected
, o, k" L3 w6 V4 D
1 A: A: T1 F- M) @! L. H0 {___________________________________________________________________________
8 F$ m5 O4 z# C7 O' ^1 k/ V
& C* _! B1 p# L/ _Method 04( \9 y# K. Y5 B& V
=========( X. q. h0 G  `$ k, _
4 a# s" C0 P; J6 J) N
Method identical to the preceding one except that it seeks the ID of SoftICE$ A$ p% G0 o3 @8 c' ^7 C
GFX VxD.
4 H! M  N/ E' s! [" k
& z5 h5 K/ f. l0 H' j* g5 E+ B    xor     di,di, l8 X& L( d: U8 d2 u$ L
    mov     es,di
3 c. Z0 m3 g6 V5 C( w, U# x    mov     ax, 1684h      
  Q( x* z" U9 L% ^- k4 _    mov     bx, 7a5Fh       ; VxD ID of SIWVID5 t5 ]2 q7 T1 e. v
    int     2fh
, v7 m; l  F& w7 k8 @/ d4 |9 m    mov     ax, es          ; ES:DI -&gt; VxD API entry point
+ ?: _) l2 x; v1 t, }; [    add     ax, di
. w* u/ J  \' n0 m$ e0 ?: O$ l    test    ax,ax) p' m8 z4 |9 k+ D! c
    jnz     SoftICE_Detected* V% Z2 g, B' o8 j+ G5 t

$ d) L4 Q$ z6 ^# s7 t$ m5 p4 X__________________________________________________________________________4 @% y7 ~5 u& T2 l* P3 P7 \
( `; _1 U( L, h

1 }3 ^# n! Z4 R4 }* vMethod 05; i4 j4 |1 \& Y2 ~; \
=========
/ ]6 t8 y* J7 _
9 s. I" y  t3 `: D1 p* `Method seeking the 'magic number' 0F386h returned (in ax) by all system
4 i, b" F& M8 F! gdebugger. It calls the int 41h, function 4Fh.
: P* U  C, Y6 X: j6 gThere are several alternatives.  , L' S- V7 f1 D  k2 P

# A2 e; ^6 R  z7 [The following one is the simplest:
" Q) x1 z& g+ k/ h& W# `, j& \" b/ v1 f, ?% {' F* _
    mov     ax,4fh' r. V  N; H* d5 I, J  {' ?4 B. ?
    int     41h( H0 r& H* F; v1 V' f7 K3 R; ?
    cmp     ax, 0F3867 Z" T+ H2 _: \; B5 n5 p+ Q; H) h
    jz      SoftICE_detected
. h% T/ S0 s- X& R" J# `# g; K* M5 d& Y

7 f, U1 p1 W/ M3 [5 {& ^Next method as well as the following one are 2 examples from Stone's
9 a1 T1 s6 ^* S"stn-wid.zip" (www.cracking.net):6 R8 ^3 i7 t7 A" O4 [4 L
& n) Z' ?: [  ]) I8 i
    mov     bx, cs7 Y0 @' x: N* T0 u- Q
    lea     dx, int41handler2
5 u& B& g. k& k) Y    xchg    dx, es:[41h*4]
) Z* Q9 o' j$ B6 c    xchg    bx, es:[41h*4+2]
0 p* n( [+ b8 y; E$ N6 a6 t    mov     ax,4fh( ~, e" }, Z" r( ?0 {
    int     41h  _6 g# E$ e$ @, D; n
    xchg    dx, es:[41h*4]0 d+ m# ^* ^3 u0 [5 S
    xchg    bx, es:[41h*4+2]
: n+ K6 N, b" ~( O( t3 ~    cmp     ax, 0f386h1 s2 v) [; d3 ?/ ^7 U* A: y$ I
    jz      SoftICE_detected9 K/ O/ {2 U2 L" ~# Z( B
6 w2 J7 p  G5 Z
int41handler2 PROC
- p% a0 [' K2 ?% f3 [    iret# q1 I" b' f4 N9 B3 g
int41handler2 ENDP! Y- @0 ^5 m4 K+ W: I
  }& r0 Q/ E% C8 ?. [

# h% q: F5 i8 J2 K$ L6 @( `: N_________________________________________________________________________
9 J7 t. _: f6 J  F- W7 [4 _6 {, Z  A; Y" U- s
" ?& d1 O' Z! I5 K/ I/ `& |6 g
Method 06& V8 R5 t1 Z5 _9 p) }; B: h2 j
=========
* o5 b2 `  Q2 E+ J: |0 ~+ W! j8 s  Z; B

2 S  J2 g# [6 O0 C2nd method similar to the preceding one but more difficult to detect:
4 z( U; Z' m  O5 a+ y/ N% s' E
# Q' f! y0 U/ y8 I1 Y! p- V
8 e- F- v; Z: Q/ R" nint41handler PROC
; h' o$ l' n$ S; |3 i( N1 O    mov     cl,al! h0 t# L8 I" C4 T
    iret
( g1 d0 h, e7 c; Tint41handler ENDP' {8 s) _+ y7 `9 g

# h) O* J( _, I4 z6 w) r) V8 U6 O
4 W+ x. N: }, D7 D    xor     ax,ax
: X$ c1 i2 Y5 P7 z/ E3 u    mov     es,ax/ y* ?- i/ L8 s% m7 c- H
    mov     bx, cs
. L. p4 p7 s& O, |+ w    lea     dx, int41handler" i  [# @: K2 x- n
    xchg    dx, es:[41h*4]7 q. b* k# O" W. e0 x
    xchg    bx, es:[41h*4+2]# s) P6 ^  N4 M$ o) S' O
    in      al, 40h* t: c- E) v% c3 }" Q* I$ q8 h
    xor     cx,cx9 B" ^- D; m  D% W# x
    int     41h
5 C" v' T5 E+ s% Q    xchg    dx, es:[41h*4]
0 C( R1 p+ G) E1 T6 @' f    xchg    bx, es:[41h*4+2]
1 \" N3 m9 h7 Q5 @4 l% X, M    cmp     cl,al
! v0 D$ g" N$ x  D  [    jnz     SoftICE_detected
- h$ b+ z% X" l5 [6 y) b: C! A6 C/ E3 D
_________________________________________________________________________- F  R+ ?8 i$ s; Z+ o, p

5 s- M. t/ l# J: b4 |+ p6 }( u3 ^Method 07! S, U- c& _' ]+ d9 M. i% {& u
=========: t, H! ~3 ]4 o. ~. E" y9 q% f
* z2 S6 \8 G9 J4 b$ r' \
Method of detection of the WinICE handler in the int68h (V86)1 Q! e8 C7 i; m* [

4 a& s8 x" O( H7 k6 z8 j# k3 H& b    mov     ah,43h1 a  @/ W5 ?% o9 h+ |, I
    int     68h' ?. P. u6 K7 f% b1 R: y
    cmp     ax,0F386h6 A2 H; a2 L5 w$ T) Q! V
    jz      SoftICE_Detected, |# l1 i4 I5 U- v) ~' C* e
+ E, \: a: F; r5 ?

5 h0 p; [4 \" Z: [5 F* g=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
- U8 l3 F2 C0 B   app like this:+ ?: Y. z* e( a

' p6 ~! @; V& F4 Z: F: [   BPX exec_int if ax==68
2 o  K, y! T# [8 v   (function called is located at byte ptr [ebp+1Dh] and client eip is! v2 B& {  v* U1 i
   located at [ebp+48h] for 32Bit apps)% S8 x: M# f8 U: q! q
__________________________________________________________________________
% c6 k+ Y3 b6 b4 B4 X
2 _* D$ ^# q% y$ \, C) E
) Z  b8 n& Y9 t$ M( QMethod 08
0 w7 g% R& p6 Z- a=========; n- h. f, I5 @; w# ~6 W/ X

, R2 S% g/ ?8 _) O# ~$ r2 _. _It is not a method of detection of SoftICE but a possibility to crash the
6 k% ?- i/ y$ A3 |1 ?system by intercepting int 01h and int 03h and redirecting them to another! e1 g2 A( A9 w+ [
routine.5 O* }: @; b. a/ f' L
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
9 U2 w, U. f6 k2 A4 ato the new routine to execute (hangs computer...)
' D+ i, Z* ~4 R( A& N4 f( n% Q9 Z8 d: k9 u/ C
    mov     ah, 25h
' X5 A1 ^9 M& B* j! U8 U' V    mov     al, Int_Number (01h or 03h)
% H& ^0 X6 C* N+ `, [9 O* U    mov     dx, offset New_Int_Routine0 J' d! g1 I, J: ?% i
    int     21h
9 P- a! s" j8 a% p9 d- y
4 X  F, X- k/ I. @, ]* ?2 T__________________________________________________________________________
$ E/ o" ]6 C! q5 x# O
& q: ?; }" m" g; VMethod 09
0 C6 n2 C- C' B" a+ Z2 l=========
+ x. H4 M2 e  r* e) l& s: J  X9 O$ a6 _# H
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only* _- |/ G6 G8 S" h- b
performed in ring0 (VxD or a ring3 app using the VxdCall).
) |9 ]4 U. I( q9 u# q* i. Y6 cThe Get_DDB service is used to determine whether or not a VxD is installed4 \8 E! G( ?0 Z+ ?
for the specified device and returns a Device Description Block (in ecx) for4 o1 N" ~0 x$ W, i, h
that device if it is installed.
5 k% v3 \" I/ ]; R* S: c- W) p+ v
# F! r7 \. f; c. \2 _- Q7 O   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID* _" q, l9 o$ Z4 Y
   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)+ y; s0 W8 E9 d/ J3 ]* b
   VMMCall Get_DDB+ ?' J) u& A$ ], I# ?1 A2 @$ d5 a
   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed* q$ G: A, u( C4 q
7 E; M" \9 j) Z0 l9 B$ d
Note as well that you can easily detect this method with SoftICE:( d: O* Y, F" [/ z- Q, U
   bpx Get_DDB if ax==0202 || ax==7a5fh" Z' C3 W' P7 T, h- {9 @

! g" H, F& g4 i1 k" W- j6 j__________________________________________________________________________, A# A# X) i6 [  J& B

. J" C/ Y) b+ S$ mMethod 10  p' b% ]- w6 R# ]6 {1 d
=========
& C0 |- A3 K8 T9 Q' X0 d# j+ \! U, I0 n4 f7 b7 }. ]. I5 M
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with
# `1 w) ?9 {3 c  SoftICE while the option is enable!!
' z9 F. s3 B0 i" U8 v" ^  `# U1 G6 l/ @7 _( J
This trick is very efficient:
7 q7 p/ \7 S6 r7 ?  H' q7 Uby checking the Debug Registers, you can detect if SoftICE is loaded' p# t% Q% X' L' R! W% C% U, C& l# w
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
1 F* p' \" m3 m" T) wthere are some memory breakpoints set (dr0 to dr3) simply by reading their
+ ^' l  B( B# C8 {" W$ ]value (in ring0 only). Values can be manipulated and or changed as well
' O0 E- {9 E: k, W(clearing BPMs for instance)- A5 J/ `7 w+ e$ h

7 {" H# G. I  ~0 n__________________________________________________________________________
# j: N6 p: j8 m' X% Q- c( K
" G. w, a! c- H% s, q: g8 l/ pMethod 11
& g4 {5 g5 o" z5 _=========; \, [( z# d+ t3 Y0 F
+ x* w# B. K- L! W! O" k' X6 P' Q
This method is most known as 'MeltICE' because it has been freely distributed/ [; |3 \5 G, u! t
via www.winfiles.com. However it was first used by NuMega people to allow) x0 J/ Z8 n6 y( E
Symbol Loader to check if SoftICE was active or not (the code is located& Z2 Z" q$ i, h  D8 r( r) g& `$ l
inside nmtrans.dll).. Y  U# _% J7 W* l& B/ \% ~7 L( M" T3 s

& D9 k8 \: A. D* \; S! rThe way it works is very simple:- L4 c/ k5 a* x' s4 q* Y4 N# ?5 p
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
: q( U  g' J4 A/ b: sWinNT) with the CreateFileA API.0 ^0 l' ?0 k, r: W$ H

9 J8 o! `5 u6 T) ^* U- mHere is a sample (checking for 'SICE'):- A( M4 @. F( T1 D

$ w+ c  D2 _3 n  @. y) qBOOL IsSoftIce95Loaded()
2 H; |4 F, i  w4 h4 B; \{
& G$ w0 L+ B3 p' `! L5 l   HANDLE hFile;  7 v2 j- J1 g8 `- V5 d# I$ V( ~
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
0 M% _0 b5 t, T2 X# S& l                      FILE_SHARE_READ | FILE_SHARE_WRITE,
" g1 F8 r/ ~5 b7 p                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);3 i6 u. B# d; ~7 e7 @; E
   if( hFile != INVALID_HANDLE_VALUE )
% V. q- W! k7 L+ }7 I- ~; @   {
  r/ F, b" b6 S2 D# G      CloseHandle(hFile);, }( s" M& Z% o
      return TRUE;; }1 q$ k/ w  u& o
   }
% G  d  E, @2 O6 [1 G, y5 f3 _   return FALSE;
6 x1 p+ h6 a* u, F' k6 U}$ k. b& j( e' k7 n: Q4 {
9 |, ^; c' L' o4 K
Although this trick calls the CreateFileA function, don't even expect to be! Y+ m1 h+ p6 o, [0 z
able to intercept it by installing a IFS hook: it will not work, no way!
. q. W0 {1 ~2 b" iIn fact, after the call to CreateFileA it will get through VWIN32 0x001F6 U6 l/ _, J* j5 i# d
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)5 M0 K! B  A$ W$ [' K% x
and then browse the DDB list until it find the VxD and its DDB_Control_Proc, p" `+ W* R7 u2 A! S
field.% {8 B7 s$ p2 F5 o
In fact, its purpose is not to load/unload VxDs but only to send a 3 b! |+ l2 }; o1 g+ x, s9 j
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)! P5 ^2 s9 j2 ]; E# @5 C+ g
to the VxD Control_Dispatch proc (how the hell a shareware soft could try5 y6 X2 O5 x# E. Y
to load/unload a non-dynamically loadable driver such as SoftICE ;-)." ^# s) Y- I% N( d( [) R: A1 H
If the VxD is loaded, it will always clear eax and the Carry flag to allow
* U/ b" x4 G$ C. Y( |7 kits handle to be opened and then, will be detected.
, q3 K. t4 g- G& rYou can check that simply by hooking Winice.exe control proc entry point
$ U; \/ j* d3 l$ q' Z- Xwhile running MeltICE.
8 l2 n( e1 s$ v  u
  p- o* O: S6 T! _0 Z+ r
9 a- g& u* K* j: ]  00401067:  push      00402025    ; \\.\SICE
1 O. G6 f6 i1 I: G! i7 J  0040106C:  call      CreateFileA
3 X  b/ n: F9 K- _1 P  00401071:  cmp       eax,-001
1 |. Y) ?9 m- _- T7 C/ d0 b  00401074:  je        004010911 i9 z7 ?6 y& \, R$ c1 r" M5 I6 N

, V: {" C8 D6 D. ~  c6 k3 r7 z9 A+ b: p
There could be hundreds of BPX you could use to detect this trick.
6 w1 K' X8 h9 D" \% P; a, @-The most classical one is:/ A% Y+ n4 y3 _: h$ ^3 ~' N' @
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
( @/ L" M8 b% t) W$ U! H    *(esp-&gt;4+4)=='NTIC'9 ~, J* }2 O+ r

1 g4 X4 G& Y" k0 D- M-The most exotic ones (could be very slooooow :-(* |9 i/ D0 z1 ^8 R4 x+ L( N
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  5 q+ `* B# [: N: o( T
     ;will break 3 times :-(- p! ^% C" h8 ?; O' }7 I

& L' b, r5 K) C1 H  n-or (a bit) faster: 9 C. j9 D' A3 l" V* P& F# y
   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
! Y. q! m- d8 E2 t3 A5 V+ e1 C8 s) T$ r' p* R! M0 ^2 y
   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  5 k- M  S, a) b% ?5 d  F
     ;will break 3 times :-(
# R0 w2 r# z8 b' a" ^
$ o7 o4 e+ G  O-Much faster:6 D4 E9 ^! t/ |. Y
   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'
) i2 Y$ K$ L8 e' W3 a6 i9 _& G9 b7 [9 z: N: w
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
3 G% D& f, W8 }$ K0 C  Gfunction to do the same job:
$ a2 s' R: N8 a
! x8 Y7 I: p4 ~% q. Y   push    00                        ; OF_READ
9 v, K. D( I/ Q- P  \7 p8 t1 U   mov     eax,[00656634]            ; '\\.\SICE',0
4 r0 F2 E0 E9 u2 W   push    eax+ s1 f* C" m& d% T( j( j! ]( ]5 T
   call    KERNEL32!_lopen
5 G+ Q2 x! m# j* t& @0 I4 T   inc     eax
, i; S0 Z8 F* F/ s+ q   jnz     00650589                  ; detected  h8 C' B! x* k  \. R* T
   push    00                        ; OF_READ
8 q$ J0 M! ~% i3 b% ]   mov     eax,[00656638]            ; '\\.\SICE'
9 c+ T$ [% S4 K$ w( y& @- y  _   push    eax
# R& R9 _& {1 @* y# M  [   call    KERNEL32!_lopen/ _( i% j1 U- U' Z$ B
   inc     eax
  O. m; O$ ]. V   jz      006505ae                  ; not detected
9 B* e$ F3 x! `, ?; k! Q
. s7 C7 Z5 f9 X: E. u
# U7 I# Z7 k- G" j, p__________________________________________________________________________
1 h- B! e4 `, G# l, O, n8 }9 X7 |" L& G$ J9 X- Z6 Z0 G) f
Method 12
3 r, N. t% q8 d7 t=========3 F9 s! P- }$ h. e8 q0 C0 Z

* p/ S4 P9 c+ X$ @* J0 ]This trick is similar to int41h/4fh Debugger installation check (code 05
# X0 b* }( p$ S: O&amp; 06) but very limited because it's only available for Win95/98 (not NT)
! D: E1 I( [) U) z2 J2 w; has it uses the VxDCall backdoor. This detection was found in Bleem Demo.
5 M" W5 g5 h: C& Z) I" f' D% P' F+ h7 Y& H
   push  0000004fh         ; function 4fh# `# f$ n) B/ S. M7 E" ?6 U
   push  002a002ah         ; high word specifies which VxD (VWIN32)
) w/ ?4 b* c& M" P                           ; low word specifies which service; G# H/ ]: J) _, z4 P# D9 \% @3 u
                             (VWIN32_Int41Dispatch)3 R( \; ?5 z. m% h& S7 s# V
   call  Kernel32!ORD_001  ; VxdCall- f& p( g% Z, x) x# \
   cmp   ax, 0f386h        ; magic number returned by system debuggers( L- n/ C& H# M8 G9 V
   jz    SoftICE_detected
, V3 I' g# g$ o, f8 E6 R; v/ ~/ m  ?
Here again, several ways to detect it:4 }3 s  }3 Y& Q( o; D9 Q4 H
5 o  I. _) c4 t: C2 L- N
    BPINT 41 if ax==4f+ w: e$ N, ^, U! h  ^9 p8 j
7 C6 _, Z* a0 @3 ]4 o
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one
) A: {7 Z$ B5 H# d# `0 [! x
" s. H5 e; w4 ~  O5 w& q2 Z/ k! j( }    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
4 v7 k: i5 D3 F: h* a) n7 O5 i" ?' y9 p3 b) b* }! x- w
    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!
$ y/ Q6 s3 w1 W) t- D; Y$ {  j
6 @% {- }" Y# U# z__________________________________________________________________________# S3 X" Z: b' Y  q" \7 c

# R  L7 b0 e2 v3 S5 fMethod 131 j9 H) D9 @0 r# b1 m) O7 ]: `
=========
8 y  ^% G0 v4 w) Z5 m5 a2 V% }2 `! z" P
1 y/ B) x3 b9 s0 MNot a real method of detection, but a good way to know if SoftICE is! D9 U& M7 u6 w. Y; q4 j
installed on a computer and to locate its installation directory.
2 N% Q9 O& ]  z  {8 }It is used by few softs which access the following registry keys (usually #2) :
: ?* V' f8 J2 H4 a
6 t! R1 ~4 ~0 g- e-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion3 i* Y# N+ h: C, t* v! E4 P6 x
\Uninstall\SoftICE
* O3 w8 S& `1 S, C" p-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE/ }4 }3 h1 g- m( G
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion% B# I' ?% S; {8 f* ^
\App Paths\Loader32.Exe
. d( f6 f  x' M+ O2 \- U
' m" M& ]5 Q% L' D, V" M3 {* A* P, `6 W7 n" C5 u' r
Note that some nasty apps could then erase all files from SoftICE directory
* a( A  T" z$ F* h- W9 X% J8 j, e(I faced that once :-(
6 d! @! N( V' }, U* @
0 {' H; ]: v& q3 BUseful breakpoint to detect it:
, s/ Q1 q# Q- S% W: H& x+ Z0 F3 |% I
     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'! [# A: T; f" H: t

; N2 j) A0 \- d8 T5 L" [__________________________________________________________________________/ r( ?7 j6 ^7 _1 u- t9 R
; g* b+ V& r: h' Z# {4 A9 F. d
! `. K$ d- V9 x* n* ]! m
Method 14
+ g# G& H: @/ ?3 l" @=========. P, T1 \& p. ]% p

( F+ o$ F& ]; G  AA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
6 h+ d( @7 o# Gis to determines whether a debugger is running on your system (ring0 only).
# ~# e! B: C+ o5 O2 C* U* `, L9 Q1 E2 R
   VMMCall Test_Debug_Installed! ]- D3 a4 {* H/ t3 k
   je      not_installed
3 l& }# b+ f* T( y: _; Z2 R5 f* d- y3 p' n4 A) d
This service just checks a flag., q' J/ g1 L9 W8 p" S; y
</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-7-27 13:00

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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