找回密码
 注册

QQ登录

只需一步,快速开始

About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
# ?% _  L# S1 f9 C) Z( q<TBODY>
/ x# j2 t" T) ~<TR>; C: d* I+ s" n0 p' R+ o
<TD><PRE>Method 01
2 b4 w3 l+ o' x8 _  R6 }' ?# n=========, i3 a! q  a+ Z$ f. Q, N
* P& f& K. L* m3 ^3 q. l$ ^
This method of detection of SoftICE (as well as the following one) is
, U- x) c2 V* A1 f) bused by the majority of packers/encryptors found on Internet.
% O  i8 @! {0 [# l2 jIt seeks the signature of BoundsChecker in SoftICE
  L  R' S9 A# ]* f( H9 v1 B% `1 L" r8 f
    mov     ebp, 04243484Bh        ; 'BCHK'6 q  d3 I' ]& H7 G" }
    mov     ax, 04h) [* H. f1 O! l2 l" J0 q
    int     3      
7 G0 m0 V# r* T! G: A, ~6 P    cmp     al,41 ?8 \& a1 _0 D5 }  s
    jnz     SoftICE_Detected
, D6 Z8 \% m% B& Q7 p, M% a+ |
$ K* t4 X8 u$ N9 E# s___________________________________________________________________________* [3 b- }) A1 k- I) c1 Z( x

2 H" M! ~7 d- C- b% W& B5 a4 E. vMethod 02
% H* s6 t7 e4 F5 m( C; S=========
# z" q0 D0 h% G3 z, B7 x* A3 l* k* I# }: {  _, W
Still a method very much used (perhaps the most frequent one).  It is used. G/ k% K+ R: H1 y. O$ C/ G
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
; X0 Y) V5 `' b+ F) c4 x2 G3 \or execute SoftICE commands...
6 K4 |$ |* h( r4 Q5 rIt is also used to crash SoftICE and to force it to execute any commands
8 F1 h& k0 h8 E* |  D(HBOOT...) :-((  
2 p7 b5 T6 T& p$ n0 t
  X/ t$ Q5 }. eHere is a quick description:! }, W% P6 }* W1 f! z
-AX = 0910h   (Display string in SIce windows)3 t: B2 {6 V9 H3 b
-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)* R' A  Q2 I1 Q( w9 m  a
-AX = 0912h   (Get breakpoint infos)2 q( [! b* U- M0 M1 h8 u
-AX = 0913h   (Set Sice breakpoints)7 I7 F" J: L# P- F8 c
-AX = 0914h   (Remove SIce breakoints)
- [7 H$ J6 w2 U5 s1 C. W9 Y8 _9 G% @1 r2 K
Each time you'll meet this trick, you'll see:
3 Z+ d6 [/ S) m-SI = 4647h
/ f/ K; D$ M# U, `0 S-DI = 4A4Dh
. e) R' u* @4 wWhich are the 'magic values' used by SoftIce.& x% l3 [% y! I; j$ [
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
1 E9 M1 _9 Z- H; I' G" X, q! r
2 q4 l8 A. O& c/ F' KHere is one example from the file "Haspinst.exe" which is the dongle HASP
4 a, A3 ]2 v5 a  s) Q" ~0 ~Envelope utility use to protect DOS applications:; N8 Z9 g6 n* W" T  o' |" W1 o

6 J4 ?" j) L# i9 r& u" Z, |7 T2 w, \9 h6 \! R
4C19:0095   MOV    AX,0911  ; execute command.' a1 K: m! c. g$ ^# ?8 _* h. p
4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
( ]8 l9 ~) o# J! [4C19:009A   MOV    SI,4647  ; 1st magic value.: B1 l  z$ F1 K* W( U
4C19:009D   MOV    DI,4A4D  ; 2nd magic value.1 U, z( c+ \  b# _; T+ V3 l
4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)) C- H/ Q' d4 E6 j
4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute
( _0 g* ]" ?# w+ q# u0 H4C19:00A4   INC    CX
  W& r: s( m* G( T) [* o. X4 {' ~4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute
5 N. Q# Q/ F3 \" @) \, I' }4C19:00A8   JB     0095     ; 6 different commands.% c5 g9 }6 d3 D. f8 ^
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.6 R* h7 f& n: V: {5 w) d% P; A% _
4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)& O! E7 k0 F% O. ?* y  _3 Q6 o9 W
3 W/ T3 A9 h0 s; y" y1 |( _/ a
The program will execute 6 different SIce commands located at ds:dx, which
3 |- L! J, I1 \6 n4 c' e- _are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.: L4 p4 X6 G) H; A3 D$ R4 e+ [
; m% a, d' O# P) l1 L( [
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
0 l. s  f  H; ~) i___________________________________________________________________________
6 W* S2 l) _/ N% c( M+ j& p3 H' ^  @  G) o5 h9 L
) {, h: ]4 S0 T( ~
Method 03
( ^6 H2 X4 J/ K2 R2 M/ A0 E=========  ?( Q# J' G  `% q' _3 p6 ]

/ y/ o( S, M' X3 yLess used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h( z) E; h) C* G3 f5 `$ G% R
(API Get entry point)# V& |' |8 i( R- R0 {
        : X$ {  ]4 `! ?; P

1 d3 c$ G( B$ H. o0 e    xor     di,di
9 O6 }8 o6 c, v1 T. B    mov     es,di
1 k/ i4 j& i0 p3 @& M( w    mov     ax, 1684h       & m4 I1 ?  e4 @! c7 {& q- k5 k
    mov     bx, 0202h       ; VxD ID of winice
* {& D/ \! D1 j6 g0 M, H! J    int     2Fh
- W: u% b5 r2 N  F" x9 N, K    mov     ax, es          ; ES:DI -&gt; VxD API entry point2 {+ Z+ x7 E! \! U; h* H4 x" h
    add     ax, di
2 |/ z& g) L" v. w    test    ax,ax9 F: [# m8 o8 U
    jnz     SoftICE_Detected
+ F( J* p. d1 a0 V/ F* c/ j) q
% r$ A. {# l. P3 p9 |9 L___________________________________________________________________________- U0 d3 e' L/ {

! {1 R3 A. S5 R4 V$ SMethod 04% i* E- [; B2 ]& T- S
=========
( @  u* T% s* |! D! T, ?
6 Y# h) R0 ^  tMethod identical to the preceding one except that it seeks the ID of SoftICE. @1 I. \+ l) S3 P1 G2 U2 V
GFX VxD.
* q1 e( E7 l! c& `; r+ v* n* y
; U5 J% z8 K) Y: |+ U9 @    xor     di,di
. _1 ?8 a& Z3 u0 f- B# ^    mov     es,di
- V! u# C- ~% M' T2 r! z# `4 ]" n' n* ^    mov     ax, 1684h      
8 y; Y7 F1 H0 X2 R% e1 [6 r    mov     bx, 7a5Fh       ; VxD ID of SIWVID
2 e/ ?# j1 f. |& R. q2 G; o+ \6 [    int     2fh; N1 r  m. ?: a* {; _0 t
    mov     ax, es          ; ES:DI -&gt; VxD API entry point
' V! a# _! i3 _3 b    add     ax, di
2 H7 {- D# ?; x! A/ ]# q! [    test    ax,ax
. C3 i# d5 j5 N+ K2 ^& b2 a    jnz     SoftICE_Detected! G0 c3 N) X0 o# |  n
" ]4 W) s3 W' U) d
__________________________________________________________________________
6 E! ?, h. k; G; N* d8 R/ g9 i2 r: K4 y. w2 s0 w7 S, X3 a
7 e+ o# [0 Y) u; h: {9 Z( o
Method 05
/ m2 L$ l$ S7 h9 T6 T+ y( f8 C& p7 ~: T=========
& D, _, T/ @# t/ [7 e: |4 p. \) u7 H& L3 @+ V# W! c
Method seeking the 'magic number' 0F386h returned (in ax) by all system& O. ~2 q" k6 I6 X; ^# T
debugger. It calls the int 41h, function 4Fh.  Q1 M) Z- d5 j) O7 o6 G( z; _9 \8 m
There are several alternatives.  1 @( R! G4 [1 P
6 M( i! C/ {/ X
The following one is the simplest:
! M, K2 }( ?2 \# k9 V! [7 ^$ `
; h  c6 q9 ]7 v# k    mov     ax,4fh
, B) q1 J& }) z9 p6 ]5 C  x    int     41h
# M+ R6 w! b: m$ A. Y    cmp     ax, 0F386
  ^1 A+ s  g) F! B! {6 G    jz      SoftICE_detected/ a" l2 ~$ \7 n6 d1 ?4 f# n
5 u$ Q% M% ^% \+ {1 X
' n0 G( X& c- B9 A% v* x
Next method as well as the following one are 2 examples from Stone's
+ o% F8 z( ?" D"stn-wid.zip" (www.cracking.net):
" E- H  `) R( r
  q! T1 Q' b1 M3 k1 S' x2 M$ ]    mov     bx, cs
3 w, b3 [* y* v! i8 V: M    lea     dx, int41handler2
, M9 X8 f, |  R5 E% L. o% B    xchg    dx, es:[41h*4]
  U5 @/ q0 E, D+ S% q2 [    xchg    bx, es:[41h*4+2]. T. V4 y$ d5 A
    mov     ax,4fh( S$ E  J9 J2 u) C% v
    int     41h
- Y3 E" v& d' o    xchg    dx, es:[41h*4]
) o/ I2 ~6 h' _    xchg    bx, es:[41h*4+2]0 }7 s7 s6 Q/ q' @+ g
    cmp     ax, 0f386h
6 U6 j/ o1 I2 L4 c9 v! N1 i    jz      SoftICE_detected
+ p7 s0 s& e% ]4 Y$ R* |0 X: D. d3 B* w; `- d
int41handler2 PROC/ n& B& Z  p: U! B" G
    iret
1 z. ]) }  N( B1 @int41handler2 ENDP" t: L$ x( V+ n# `. E% `
2 T: a- `3 k4 G
( P7 U# s8 X1 ]8 `
_________________________________________________________________________
$ Y/ a: l" c# f" R0 f8 E8 v' c+ H0 @8 y
& U2 f: _+ ?6 \/ N
Method 06- W2 f% ^" w: T0 V0 X7 X
=========1 Z3 E) M7 b6 ]6 t0 d

( K$ _% K* r' B4 Z! e5 ]& K( m* A" P! p1 l1 C+ G% L
2nd method similar to the preceding one but more difficult to detect:
' b' U7 R+ i* ^2 Z
9 |( j' h. m0 A) [4 A
5 c) d2 B2 c" x. ?, Y: ~int41handler PROC
/ w% r" @- _! t* ^    mov     cl,al
3 |( a( K6 l9 S) v    iret) \4 o- U  n+ y% ]" d, Y+ S  [
int41handler ENDP
( _& l6 a, m5 i! j! k4 Z, K& d
8 a5 w' m# X, Z3 A
- @6 \- u7 i( C1 q% }    xor     ax,ax
9 ?" u5 O: e' G) ]% j  U0 i0 t2 h    mov     es,ax1 Y8 ~; i/ [5 B9 S& U
    mov     bx, cs
% T. r* |4 ?$ Z$ U8 a3 Y    lea     dx, int41handler) R2 f# Z& \2 w5 @) U; V
    xchg    dx, es:[41h*4]! Y& G1 r- @) D: Y/ p
    xchg    bx, es:[41h*4+2]
: H% K- ~; K9 u  Q" S    in      al, 40h3 ?/ O- A0 _6 t; H0 n
    xor     cx,cx$ [- o+ F! R+ D4 V
    int     41h
3 d5 s8 c6 l& j5 M    xchg    dx, es:[41h*4]% t+ C6 D) h% V1 z% ^3 Q8 L
    xchg    bx, es:[41h*4+2]4 s6 f$ m4 Q$ O$ q! U' l0 g/ P
    cmp     cl,al
" x5 V. @. T1 ?    jnz     SoftICE_detected
: m. f% G6 f6 W3 n5 g1 Y/ S7 C( B* T. N1 d" z3 a* O5 q$ m
_________________________________________________________________________
6 ~& L# F( T: u9 J1 Y2 h1 _* C9 B" G) q/ M  r- \
Method 07
7 E; M' h0 U( [=========
8 ~+ s. D6 \/ k9 o
+ l+ m/ X6 V7 i5 \Method of detection of the WinICE handler in the int68h (V86): M8 D# P3 _4 f. t: p

& O' C7 G7 C# y7 e. F    mov     ah,43h, U/ ^( R9 }) k6 U, N
    int     68h
. C# [( H1 J4 }' p    cmp     ax,0F386h
2 @) [3 |: X! o: s5 n; C9 e% K    jz      SoftICE_Detected
7 V. T/ |2 C2 i5 q2 N9 U0 R
3 F9 K0 _- p. ?1 c% C7 S2 I( F: T* o9 i1 j  z/ Q0 S
=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit$ S3 ?( Q0 }5 t- Z5 j2 r
   app like this:
# r9 B/ ~8 }' n6 R
: a; a# w4 s' i6 [4 H/ x   BPX exec_int if ax==68
  ]" p% a6 d  e1 a5 R/ y   (function called is located at byte ptr [ebp+1Dh] and client eip is1 K5 Y  r. ?- z
   located at [ebp+48h] for 32Bit apps)
' J9 z, }$ c" w' u__________________________________________________________________________+ o% g9 O. T+ z3 D& h4 `

. T+ O% o7 H- Z
& K& X( t6 E2 @6 iMethod 085 |4 Y8 H8 S) a0 ?' m  D( D
=========# f, U7 Y# G7 s" i) M: V) `

+ H9 s+ B# `: T+ E9 w" sIt is not a method of detection of SoftICE but a possibility to crash the0 s: r( k- `: _6 G2 k2 s2 q( r
system by intercepting int 01h and int 03h and redirecting them to another
% p$ _0 d( x. Croutine.
' a: n: Z' T8 t. G; pIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
6 n7 p5 P; o5 Y* U0 rto the new routine to execute (hangs computer...): r' I# V5 }* @5 T  A
5 Z  C/ j/ f& ~8 e
    mov     ah, 25h
4 C3 f" t  q0 X( y    mov     al, Int_Number (01h or 03h)
. H! f' [- r6 s) l2 M. I    mov     dx, offset New_Int_Routine7 I/ d+ L/ J# ?3 Q
    int     21h0 s5 `7 j$ t/ g" i, M
2 S, Y  V4 v/ \, L  J/ [" @
__________________________________________________________________________/ t) M8 i" L3 I8 I( @# L) I( R+ M; c

+ @" T3 T! a3 RMethod 09
2 `# D7 Y* L/ X3 W: |, V- L4 [=========
# I4 ~4 n: e7 r( K1 i" e1 P. |" F8 _
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
& `" g' }2 U1 u, O; operformed in ring0 (VxD or a ring3 app using the VxdCall).
' }  g( ]1 B" t8 u8 b  E6 UThe Get_DDB service is used to determine whether or not a VxD is installed( u$ b% G. r4 Y% F9 C2 T  g
for the specified device and returns a Device Description Block (in ecx) for' R4 e9 A, w* ?; O( O* T3 I
that device if it is installed.' f/ k% P$ P- X  \$ C2 L
& T8 q+ Q# O1 J
   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID
- p, W; N3 D6 V- A   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)' H# f, b% i4 R# b. N- l
   VMMCall Get_DDB8 ?4 ?2 \1 T: ?5 \, q- v
   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed
# E# K6 N  W0 k! G
/ m3 \5 n6 G6 `- o) iNote as well that you can easily detect this method with SoftICE:
8 R0 v3 J# [1 H# m   bpx Get_DDB if ax==0202 || ax==7a5fh! |1 \8 K0 l3 Y! A8 A

) Q* q/ w% P  s+ o__________________________________________________________________________
; I, H5 c  M$ U% t% H0 p
: Y  ^+ L& H; h/ WMethod 109 R! h$ P& e' W  s9 r
=========6 f( n# T" p! M6 @+ R& R

3 V  {7 _1 z$ K- p=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with
8 ?+ `2 @% ^$ m1 r4 j  SoftICE while the option is enable!!/ ~2 W* w  r# X8 n7 Y

- \6 w5 ^. ~9 L6 \& _2 |This trick is very efficient:* X, W, V+ \$ {4 Y) Y  ~; K
by checking the Debug Registers, you can detect if SoftICE is loaded; `8 Q$ n4 h: K$ a! i8 _
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if  ~* A: w4 H7 r3 p* h5 ^
there are some memory breakpoints set (dr0 to dr3) simply by reading their
" u' h2 [' i) n/ @) s/ L. o. B9 o9 kvalue (in ring0 only). Values can be manipulated and or changed as well
' q& R% y0 G9 p' d/ `(clearing BPMs for instance)
& ~; f6 [  s+ Y1 r: H4 K, g" |0 }7 k% y" ?+ f, |3 {6 l
__________________________________________________________________________
3 t: W+ v" b1 s; O+ ?& A  R  H/ P( g, Z2 O4 Q
Method 11
7 Q+ r  d8 \3 N7 v) V=========9 Z4 |% u! |) J/ R8 ?/ O" c( T$ S  g, x4 }

/ \) k+ j4 t/ Q' |, hThis method is most known as 'MeltICE' because it has been freely distributed
2 a! o. M+ U) j( j9 ?8 k& @via www.winfiles.com. However it was first used by NuMega people to allow% T9 j. B! _% i+ @3 A" G9 q$ I
Symbol Loader to check if SoftICE was active or not (the code is located8 I6 a( o- A/ q4 o1 x
inside nmtrans.dll).
# K7 i+ p9 l- ~, n7 a" ~8 f4 _6 V; H
The way it works is very simple:
1 \5 A( S0 `7 A. i0 J* ?, o* kIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
% Q1 ?/ u* N* P: }$ J+ o' QWinNT) with the CreateFileA API.  W7 _( b4 Q/ |" @# v
: `7 g/ H  y# |. r- G! |1 t' y1 a! m
Here is a sample (checking for 'SICE'):
0 {' Q: }& [1 S3 n7 t
/ D% p8 H* b0 M% ?7 QBOOL IsSoftIce95Loaded()  I0 @# t4 C, Y9 v1 g( H4 K7 t
{
& D3 Q! w, o. t. W& w# N   HANDLE hFile;  3 f  ?8 T( m6 m6 w
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,, k1 v1 z. A* a# P$ F2 [5 H
                      FILE_SHARE_READ | FILE_SHARE_WRITE,
/ b# b( g* L9 O. ~                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
; I7 d: H3 g3 S9 n1 E6 ?   if( hFile != INVALID_HANDLE_VALUE ), W$ k0 b9 e) _9 R2 T, k
   {
2 c! r6 a3 D0 v      CloseHandle(hFile);
+ l+ d* _& H% n( [+ l      return TRUE;, y/ V" |# r" Q, I1 K6 |* S
   }
* k9 m/ Z9 a! o2 C* O- I   return FALSE;( H( t+ A; L; J/ I' |
}
8 D2 `$ I1 q& `* ]' L# W5 D" n) O$ U- Z; V! B
Although this trick calls the CreateFileA function, don't even expect to be( ^2 t' ~# |0 e" ]/ I7 }
able to intercept it by installing a IFS hook: it will not work, no way!
8 C  O- R4 p7 w$ u8 |! ZIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
; p  f0 v" y; h2 r) s) eservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)4 l6 k/ i) M1 k/ m6 F
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
0 G' _4 H6 i/ f  u5 @2 U8 a, Sfield." T% K% z. y4 J" ^7 U: g0 z9 @
In fact, its purpose is not to load/unload VxDs but only to send a 2 ^& u& j# Q& a& l
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)" f/ W9 q" c$ X- ^$ @  ]
to the VxD Control_Dispatch proc (how the hell a shareware soft could try1 h3 i* A! k: x4 W
to load/unload a non-dynamically loadable driver such as SoftICE ;-).# b! I' R4 R4 e8 ~6 D  C. K
If the VxD is loaded, it will always clear eax and the Carry flag to allow+ ~( e  Y' f: N6 i' X
its handle to be opened and then, will be detected.9 K, h  R  Z- ]  |# c& W4 C: s
You can check that simply by hooking Winice.exe control proc entry point1 p# T. m- q" K# G5 E3 L
while running MeltICE.& w& a% H; s, K6 `/ V

- O$ F& W% W1 Y9 }5 a
' G3 Y. A: b- H. O# ^$ a  00401067:  push      00402025    ; \\.\SICE$ h; q. f+ t1 |1 z/ G
  0040106C:  call      CreateFileA- Y" y: u2 Q. B9 y
  00401071:  cmp       eax,-001, l1 `) g* f( X4 Z+ J+ g& O
  00401074:  je        00401091
  w: S: l& r' L! L
0 R" Z9 K; a0 Z) r  |% m0 x8 }. `) Q
" ~8 _3 s9 }+ M) o5 {9 DThere could be hundreds of BPX you could use to detect this trick.
8 p4 r, O+ k4 D& d7 ^-The most classical one is:# j+ |" [' D- A  o6 e" q
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||' W% |0 c" K2 x/ D, S8 p0 F
    *(esp-&gt;4+4)=='NTIC'2 Y# l* o$ [0 O7 Q( X

; o, J; _- K% J5 w1 ?+ n- `) W-The most exotic ones (could be very slooooow :-(4 e# z: p, V8 w- T
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  , P# V3 r$ `6 ]0 R" k
     ;will break 3 times :-(# D3 L  }3 E( e" p5 X

4 c9 }4 D' R. k* X-or (a bit) faster:
3 Q1 m: P! L3 I3 c/ P# K   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
# M" J! D. {, C3 a/ p5 Z9 r  Z7 [! [) o; @
   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  , I7 V- f/ [; i, s+ \6 r2 t
     ;will break 3 times :-(
: E9 T  z$ [) Y
( M# }- G' D. I. z1 x) D1 ~-Much faster:! f1 P7 C6 \/ x4 x# J
   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'
% S' V% v8 g3 C" U/ |/ }* B- H9 b- ]" a/ l# f, ~
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen6 v6 z% x$ w! S
function to do the same job:( s8 W' ^: S% J  u, I: O

' [! I7 y4 _9 B1 H- G   push    00                        ; OF_READ- ^! R( Y0 u/ x1 f5 C
   mov     eax,[00656634]            ; '\\.\SICE',03 H& ?5 a7 {9 F/ V
   push    eax0 e5 z" U% D$ v; a) ?, @
   call    KERNEL32!_lopen
. W" g# [1 ~/ n# v. m* [   inc     eax
& \6 ^# a  ]/ f2 I3 v4 E   jnz     00650589                  ; detected5 b0 v4 y6 N! C, ^# n" M, u  B
   push    00                        ; OF_READ
6 ~  h/ j' q9 r3 V# w   mov     eax,[00656638]            ; '\\.\SICE'
, Y4 Z! r- e) n! m1 T& m8 ~   push    eax3 M% c5 Y3 c+ e" V. _2 n2 M
   call    KERNEL32!_lopen2 g* G, l/ v# d" J9 R
   inc     eax
, ~9 ?1 p4 l8 I/ f. \   jz      006505ae                  ; not detected
! O; c9 ~$ H/ M  t
& @+ \! |. t) a3 _( o3 S, g
* J; f. E9 F+ {, r+ s__________________________________________________________________________2 H8 r( p# h# N  B0 L  a. ]/ x: y
6 h$ z7 E7 s. C. {: Y/ _  z
Method 12
3 R7 @1 s# v  f5 G+ |# p. h# x" Y6 a=========
/ r: P, h  x* `7 a# H! J, Q( q
- d) {; u! g: Y$ Y+ D7 xThis trick is similar to int41h/4fh Debugger installation check (code 055 Y% C) t3 y. S" I
&amp; 06) but very limited because it's only available for Win95/98 (not NT)
( x2 _$ q- V) _7 D6 x: j: Kas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
* W) N" P; f9 m, I( C
9 q+ L" i( g' d- e' T   push  0000004fh         ; function 4fh# |  Y( T; ]* t8 H) ~
   push  002a002ah         ; high word specifies which VxD (VWIN32), T5 F& F: f8 O/ V1 t, ]9 ^
                           ; low word specifies which service# @, }! x# ~; R7 H8 {/ i
                             (VWIN32_Int41Dispatch)
" z6 n, ?+ o+ e: |/ j   call  Kernel32!ORD_001  ; VxdCall& p' h+ @5 b% G- D, v, M( t
   cmp   ax, 0f386h        ; magic number returned by system debuggers
; v8 x1 F4 r0 Z6 q3 V   jz    SoftICE_detected
$ r! H! N1 Q5 D0 j- Y  t. I& D1 s" f* Z1 s& u* b
Here again, several ways to detect it:
" G$ q& M" R8 `4 v. }, t( K! E
' J1 L' x* Z* i9 d* l( I; a    BPINT 41 if ax==4f
# a& s$ e; X* \% N3 [# p$ T9 ~' m+ i9 [
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one, @% ]3 s" W, v0 B  C& [

  n  s- e3 r% C- {) @$ Y; ^    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
# n4 g3 A$ F" I" ?$ @( C! ?- c- u& j* K0 G+ z& I
    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!% E4 Y1 a! h* i
+ O: F+ F/ W; K7 g; J7 H5 s! \1 Z
__________________________________________________________________________! W3 C, a- S1 w. C( n/ ^$ M& w8 U9 Z
- M( v; ]6 {2 ^! Q4 j! Y
Method 13
. b; m% \1 J) L3 s- ^) @% p=========. w  O; J( H/ z. [
. R6 a2 j% k' |; k
Not a real method of detection, but a good way to know if SoftICE is
, m: R1 S3 ~' Q: V: n5 W' Y5 D. r4 _; Jinstalled on a computer and to locate its installation directory.
# q9 O7 q+ g+ R5 XIt is used by few softs which access the following registry keys (usually #2) :
$ L' }/ k/ ]* B2 e5 P% W7 J
  N7 j+ Z3 @/ \) }5 n7 C-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
- ^: G: @2 N8 X* n\Uninstall\SoftICE  Y4 a  _) L. G0 _% ?9 O7 i% y
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
  S$ Y' U. V/ t/ _-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion( I5 h, C5 Q4 U
\App Paths\Loader32.Exe% j0 C  l- k1 ]$ w- z8 _

& Y2 ?& f4 n$ d& d
7 k. E2 D' L; b: o0 F% kNote that some nasty apps could then erase all files from SoftICE directory
) h9 l% m; j4 F, f; ~, V+ k4 r(I faced that once :-(* T. U- b( y# z9 X; A  V% |
1 l( A5 {5 B6 b. h, c$ f. ^4 \
Useful breakpoint to detect it:/ c; e$ D! L# [# s2 W

, i# U! N8 T  a2 q6 Z- C     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
+ e+ {9 E, G0 ~3 C" x
; ?2 H2 t( K4 T/ ~& L__________________________________________________________________________
2 }* r% b2 X! j) ~2 F) N. M0 D! K3 W' {
; u6 [6 H  I" U; I/ y- f* s- K% Z* w1 {5 j
Method 14   n* r0 X0 S0 X5 I( J
=========
0 @: H7 I5 v, M8 a8 I2 Z9 {+ N+ Z
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose$ ~- Y7 Z2 k% |& E5 T
is to determines whether a debugger is running on your system (ring0 only)." [4 O5 o* y" n) Q/ P: P- `

  Q: ?% E( r$ h! {: k- F   VMMCall Test_Debug_Installed  m4 r5 e6 T) j/ v  ?; a5 |, @
   je      not_installed
) B( X) }1 [% R7 l2 n# U  ?3 M8 Y" U
This service just checks a flag.
& F8 ?6 u) _1 t</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-2-4 20:20

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

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