找回密码
 注册

QQ登录

只需一步,快速开始

About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
$ f- \$ f! x; A2 ?' Z  Z/ l<TBODY>
; T3 {: S$ p" L5 Z) H! c<TR>' ?! J/ a6 n( V
<TD><PRE>Method 01 7 X4 h/ A7 b3 u* @7 Q, M
=========2 @4 c' Z- l8 f
# s# s3 g0 c2 n0 C* q- g% X. J, ~9 R
This method of detection of SoftICE (as well as the following one) is
' ~( `1 H1 L8 S0 jused by the majority of packers/encryptors found on Internet.1 [, m( E  `& g% R# n1 i6 n
It seeks the signature of BoundsChecker in SoftICE" v5 d" L1 ?) C. h: [
7 ~1 \! }! J6 _. a% E
    mov     ebp, 04243484Bh        ; 'BCHK'& x: U. Y9 e& r* C, U% x0 W
    mov     ax, 04h
, m' t4 l1 S  [( d    int     3       - o3 C4 `' x" C  R! k
    cmp     al,4
/ E6 J! g8 H( s% }9 q    jnz     SoftICE_Detected
  n6 C9 t# O6 X( U3 @( i- x8 g4 G8 J3 ?+ r: j  z9 ~$ \& t# H% R! n0 H
___________________________________________________________________________
6 G# U6 |5 S( b5 \# y. M5 u1 z; ?
7 n0 {0 Z( g9 vMethod 02
* }' M. ?. x" A* b3 Q* Y=========
. `1 I3 v7 j3 g) K! B8 ^
7 J4 F# ^" R. m0 _4 }, qStill a method very much used (perhaps the most frequent one).  It is used8 e0 n) |" \$ E6 K9 B& G$ c8 A
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,, b) L' X9 V8 N3 P+ g- [, u
or execute SoftICE commands...
$ w* w0 u5 E; i( pIt is also used to crash SoftICE and to force it to execute any commands/ Z0 k: C* M/ @9 c- q4 S
(HBOOT...) :-((  7 X7 O, o$ E' q8 A9 W9 e. `3 Y
1 Q0 W9 U2 K3 f) V5 s- q' U
Here is a quick description:, I3 @# Y" |$ S5 v9 Z6 N
-AX = 0910h   (Display string in SIce windows)3 K& j% N9 T/ W& Z- M; \
-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)
+ _! e! q% S9 `; B/ y7 ~-AX = 0912h   (Get breakpoint infos)$ T& y: E# {# t* C* S/ {  Q0 |* e/ b
-AX = 0913h   (Set Sice breakpoints)
( s- t& D5 p- x. ?7 M+ m) U* O-AX = 0914h   (Remove SIce breakoints)/ E5 V( F6 e) L6 b4 p

4 m* N3 y( X: v8 MEach time you'll meet this trick, you'll see:' |, o- p3 o2 i) X* h8 b7 g! P
-SI = 4647h  a- I$ f- ^3 n1 E! n
-DI = 4A4Dh6 A; s6 S: b' U! z2 _. X- r
Which are the 'magic values' used by SoftIce.
( T3 F5 t2 {8 uFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.4 R9 W) U- P- @& S. r! s, O
. T2 `. ~& b& {" m8 Y/ B$ T" i
Here is one example from the file "Haspinst.exe" which is the dongle HASP
" {; B$ W2 C4 Q$ w% d% [Envelope utility use to protect DOS applications:% U# \& _7 R2 N2 `, s

6 K" i$ k1 w/ o' m+ H" G( s" [( ~' ~* u) `) m, P9 r
4C19:0095   MOV    AX,0911  ; execute command.( S  U- \' g% G1 C0 _: }( m/ w4 f
4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).! M7 R: y& L3 K* o& H% F  X' P
4C19:009A   MOV    SI,4647  ; 1st magic value.
9 o  [8 o  I/ ]* d' _( B' ?6 \2 o- I8 g4C19:009D   MOV    DI,4A4D  ; 2nd magic value.) K$ a$ C( |3 g! y( l* C& S1 S) |
4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
9 \0 j6 k8 X% f+ q' r4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute
5 {) v, b2 s# G, ^9 H4C19:00A4   INC    CX
2 U: Q2 v0 p0 ]$ u9 H; J" f4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute" S1 R. A4 z* ~7 D5 F
4C19:00A8   JB     0095     ; 6 different commands.0 b5 F1 o$ E7 }% [9 b  `/ M6 J
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.# ]8 f+ m0 J% U: W
4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)
9 e" ?" ~: }6 }( ^/ \$ _
" X5 a' S% A  q3 e' F8 u/ P' ^3 V7 MThe program will execute 6 different SIce commands located at ds:dx, which; G  Q6 b. @3 _2 }1 `% B
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT." }* l4 y3 s) o

; s$ Q8 x$ P7 R* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.% y) f- _: K* g
___________________________________________________________________________6 ~- M9 {: b5 Z4 l/ t0 N

& }. o# j8 l2 I. B* c( ?
4 ^3 |5 ?% m( }' U, b( EMethod 03: m2 K- d$ M' \' i  Z  q5 ^" |; N8 k+ d
=========! h7 O9 O8 |- I$ o( k9 A+ [

9 z0 t$ [, Z9 {( L7 lLess used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
. g& v- C* ?: P7 V- J& x- S+ P(API Get entry point)/ u: j6 @1 @% u6 F; M  I) ?
        8 ]% e) c+ s  z: g
) e& Q% z- t+ k$ b
    xor     di,di
1 E% k# @0 T2 ~3 l    mov     es,di# q$ D/ S5 I3 g' \/ p1 W" _
    mov     ax, 1684h      
- W- `7 m2 i  W& y( u+ x+ I    mov     bx, 0202h       ; VxD ID of winice) P. Q- \6 C( J6 X2 a4 f
    int     2Fh
( I0 b% }7 Z$ D  B- v$ A- W    mov     ax, es          ; ES:DI -&gt; VxD API entry point
! m  T0 b; N: @9 N    add     ax, di
0 w" [' h3 ?! x; I    test    ax,ax
8 `+ A4 H# R# g# s    jnz     SoftICE_Detected" K% A8 B$ D0 L

; H: q: \! q& I+ ~" O1 L( B___________________________________________________________________________
7 k+ l: Y! G: u" {7 K0 U
7 y$ }+ x8 {6 P4 H* U8 ^: c+ |* E' hMethod 04
3 a. c( m( ^  D$ ~, Z3 H) Z=========% y) `. u" I, G) s- p7 E# i

; V& l# H& ^& ]Method identical to the preceding one except that it seeks the ID of SoftICE
% M, b5 n  i' i( ^2 b" pGFX VxD.
# c) z1 {; X5 Y! [' N' G
) w  g0 f# l& w2 r    xor     di,di6 D9 {- |6 }+ K" X( d% o
    mov     es,di
" F' e2 z" T) P# m  h9 J- e; W    mov     ax, 1684h      
4 c3 S$ Y% O' l' S    mov     bx, 7a5Fh       ; VxD ID of SIWVID
% v# w7 H$ q( a* I    int     2fh, i: ]# c+ v6 ^! `! k' j8 n
    mov     ax, es          ; ES:DI -&gt; VxD API entry point* t; [5 |8 o" Z; p5 [% @% Q: o: \
    add     ax, di! }# m1 M5 C( t  T( r7 l0 {
    test    ax,ax
: q4 b- `( B2 [3 n4 B    jnz     SoftICE_Detected
# f' L$ I- y. j& R
& M0 I% \5 w/ C: ?7 ?$ m  I: {% N__________________________________________________________________________; Y# r8 c+ C# {% N" ]8 p

' E# ?6 k) K2 E2 g" B
5 D) H: h6 P7 Y) U! m" }# HMethod 05
. a7 G4 \3 {6 h=========
/ f* D- ^5 `/ p( [; \& K
4 d% |2 N; s/ O( HMethod seeking the 'magic number' 0F386h returned (in ax) by all system! t4 S: e$ }* H. |% }; N
debugger. It calls the int 41h, function 4Fh.9 ?5 K: Q7 Q0 W8 Y/ t3 B" M
There are several alternatives.  
, L1 m9 G7 m" ]# N( P, [/ d$ T! j8 {( o- b( R( R, {
The following one is the simplest:0 t6 U! D9 j% ]) n, _4 b4 i
  W+ |5 }/ y. I- j7 y$ O
    mov     ax,4fh
! S9 @; B" C" o( Q    int     41h: g- J1 m- @# e2 r3 M6 x0 }  p+ p
    cmp     ax, 0F386
, t: @$ p4 j3 X  y    jz      SoftICE_detected- ?' U8 v0 C. `! ?

0 |4 O# F+ j( x- r5 g- @3 u1 O# M7 T3 i- v2 j" u' U! J
Next method as well as the following one are 2 examples from Stone's
  ~- Z, n1 h  ], }; V  G2 @: y2 h7 C/ B"stn-wid.zip" (www.cracking.net):
! G0 n) b5 K( E6 p9 W- o- J' a6 J9 Y, D
    mov     bx, cs
3 \. C/ j3 q; {  c% r    lea     dx, int41handler2. F" Q, ^2 H3 u0 p, h
    xchg    dx, es:[41h*4]
5 d4 [" l3 r; Y    xchg    bx, es:[41h*4+2]" ?8 W/ z* F5 K- Y( r
    mov     ax,4fh
7 j' n, ~' ~7 h1 P- s& U/ B    int     41h
, A9 s+ f3 _# B2 W4 F0 y5 {. D    xchg    dx, es:[41h*4]6 U) Q8 u- o4 T8 e
    xchg    bx, es:[41h*4+2]- _8 x# T$ S. x7 _! h* c
    cmp     ax, 0f386h! y! W4 e# }0 a
    jz      SoftICE_detected
5 Y- |: S/ C9 S' u1 C( J
9 v6 P8 G7 P1 d6 w1 x9 T- f* Rint41handler2 PROC
  S1 i: `2 M9 y& y; n    iret
3 R  c5 M, \* E% h. o- f- Q0 q9 ~int41handler2 ENDP, r" a5 ^0 m( Q5 d
8 k9 l/ p3 \, O1 O

$ D- a* l3 q. ^' a_________________________________________________________________________, R, Q7 M# j  {# |8 U( Q( L
7 p/ j9 ^5 O. Z

( {( t* Z1 R; K. }Method 06
6 m# B) ?" G! ?2 N=========2 I8 X7 W; r( d% j  w* ]
+ g: N/ p# |6 b( J8 H) n

' T* n% _! K- \+ N0 `2nd method similar to the preceding one but more difficult to detect:
4 v! O! r0 ^  x2 _
4 i% p7 o$ T& c" i: z3 U3 K  i* B5 R9 L# C  H, M, ?
int41handler PROC
! @8 ?# R) A/ f. G' n/ j( p    mov     cl,al6 ^+ D* ^; e- J) W. Y! m
    iret
5 R& Y0 z, p4 L( h9 \# b2 gint41handler ENDP
; n5 O, m6 r( M2 s1 f: y5 P& i9 q6 ^, q( s( S8 M

& g/ ]9 ^; }+ C    xor     ax,ax/ Y9 Y0 A% v' r5 R7 a0 H- y
    mov     es,ax5 r* u8 i+ |3 e( }
    mov     bx, cs- ^# ?/ K9 ^; l, k
    lea     dx, int41handler
6 V' w* v7 H* }/ L7 |    xchg    dx, es:[41h*4]3 l: ?# w  F. }# h: q
    xchg    bx, es:[41h*4+2]
0 q8 {+ t& A( @7 K! E    in      al, 40h
6 ^- F3 ^; g0 r5 i) A+ ^. N( A( U    xor     cx,cx0 ]/ V# _6 @. ~0 k
    int     41h
: O0 I3 K6 @1 j- V+ x. k- a    xchg    dx, es:[41h*4]
, M5 O7 @- p& q5 R9 M2 x% o    xchg    bx, es:[41h*4+2]- j; h  R+ _( b& [, ^
    cmp     cl,al" x# F! `* e) I8 m; c6 b( i- Y
    jnz     SoftICE_detected0 z5 O2 m5 H9 s3 N

( d, s6 H2 W2 q9 T_________________________________________________________________________1 H, c% `5 Q" Y, n- ]. }3 G" W% Y

" a3 G1 m4 k3 h3 UMethod 07" ]' t! y" d; m
=========
: ]: i1 O: H0 F4 G" ~) w/ v# I9 V" X) Y
Method of detection of the WinICE handler in the int68h (V86)7 T3 r0 q3 H% M, U8 i( B! _: u5 d

6 A$ l% P! H9 R% v& w$ p    mov     ah,43h
1 [2 R9 P3 q3 v3 G% F% }$ f1 ?    int     68h+ Q0 Q; j% d8 Y6 _& V
    cmp     ax,0F386h5 @' f; ?: k2 Z; e0 _
    jz      SoftICE_Detected: N% g) ?5 Q% x4 h4 Y2 s  Y: h8 v
3 A0 F9 Q: g# @+ L- Z+ d& r1 A2 S

8 }/ H' I/ z! x% v0 E5 w* I- q=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit& l6 o5 _5 k* R, d. [
   app like this:% r& P% H1 b) ~% \

% s- {4 y: z: ]   BPX exec_int if ax==68& i' |6 g  l% X9 W6 S+ o, u
   (function called is located at byte ptr [ebp+1Dh] and client eip is7 ?, C# o3 ^" U$ j0 `6 V
   located at [ebp+48h] for 32Bit apps)
" q( D, K- B- F( {2 s3 c__________________________________________________________________________" S* E% Z4 o/ _: w) I' d* \4 z6 K
' n7 @  D  @5 \( o

- H* H8 |8 N- _; D3 o0 hMethod 08% ]7 X# `  G, Y2 F& x# x
=========# {; h2 N  I( _4 ~: S0 k' u, \
4 d6 J5 I" f3 D7 m1 _: H  f: C  P
It is not a method of detection of SoftICE but a possibility to crash the
) t% h. H5 h% m( s6 tsystem by intercepting int 01h and int 03h and redirecting them to another
0 j0 a) ]; t) ^2 y7 ]1 ~routine.
! N" r4 o$ U+ U4 b8 MIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points% @; }" k# Y" d/ H1 K# ?
to the new routine to execute (hangs computer...)4 B) `, {1 }! c6 B9 T! g3 {6 q

$ z" W- s3 p% c# P$ J/ [+ x9 ^    mov     ah, 25h
& \& Z# G" e+ V" Z; G4 w5 ?' L    mov     al, Int_Number (01h or 03h)
0 {" t. B) }1 g7 w: Y    mov     dx, offset New_Int_Routine
( b; x& K7 P9 ~; C" _3 B    int     21h
  b4 J  C' H; f! ]; {  k
( E- a$ C+ z- w* w, S5 t& ]__________________________________________________________________________
1 p- u" k7 j3 k2 S2 [& @3 g0 J. b0 n- l% g/ s) b3 ^* b& q* z
Method 097 G- }$ U6 J" T5 f1 b
=========
& _% t9 j2 d$ x5 N8 D) r/ Z/ r- {) G2 O" E
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only' y7 U" ~. Y3 p4 q/ l" p/ f
performed in ring0 (VxD or a ring3 app using the VxdCall).; z3 w- {6 m; b- T0 H. s
The Get_DDB service is used to determine whether or not a VxD is installed
; {5 y' \; J8 }# |9 m+ |( U6 Nfor the specified device and returns a Device Description Block (in ecx) for) c7 k! G( j9 H4 A5 |
that device if it is installed.
# ]3 Y! t0 \: s# d
+ J% `* g3 H4 q" [+ G! t   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID2 c* W1 Z# J. ^4 O5 A3 B$ @
   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
- V" x- A4 g: x1 Y   VMMCall Get_DDB
" K, v  x; S2 t- ~* }   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed
( U' T3 n, Z% j1 j0 f
" ~: b, e9 P( K2 F7 I% D9 ENote as well that you can easily detect this method with SoftICE:* G" V6 r9 a+ l8 `; N. k# R+ N
   bpx Get_DDB if ax==0202 || ax==7a5fh6 X  L! `% D2 l8 E- s4 q8 {2 r: i

2 @! y5 g' Z& {; Q; K__________________________________________________________________________4 k* d) Q, W+ M+ k1 d! p/ Z
* P% l7 p- d$ K- \# u* N
Method 10- W5 i, k+ H+ K% I' v( _
=========; u: g5 z/ ]0 t* U0 A, i

2 j. D0 Y1 l* L1 I=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with. G% _- x/ @/ l. c$ _: W
  SoftICE while the option is enable!!
4 z% C$ K7 H8 X: Y6 C
: ^6 B: q" s. A1 h( F3 JThis trick is very efficient:2 }, g3 K  M0 }7 N" S# j
by checking the Debug Registers, you can detect if SoftICE is loaded
) |1 S; `+ z) M! x(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
+ C/ U8 O) ?/ ?; @! V* dthere are some memory breakpoints set (dr0 to dr3) simply by reading their/ H  I' x$ u8 n
value (in ring0 only). Values can be manipulated and or changed as well$ L7 Y5 P, x5 J9 Q
(clearing BPMs for instance): N1 ]4 M5 O: h/ N7 E( W

8 a' j, p6 s( K0 m2 z# Z__________________________________________________________________________; Z+ Q% ?( Y: M! Q
3 a% g# {6 \+ s: r
Method 116 T& G9 K1 W7 v$ L! j
=========
+ E, I/ _4 q2 ~& o, ^, [9 f6 {5 ^& B7 \3 c
This method is most known as 'MeltICE' because it has been freely distributed
0 Z# H" W, B: k5 o" Gvia www.winfiles.com. However it was first used by NuMega people to allow2 k* _+ V5 M7 m9 b  Q9 r7 f
Symbol Loader to check if SoftICE was active or not (the code is located9 _' u, a3 Q0 u
inside nmtrans.dll).
5 o% I+ _  V7 M1 I
! `4 ?8 t, z1 S  w* rThe way it works is very simple:- S6 p. X' F/ C6 r3 r" i6 X
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
, V) c3 P$ |* n, n$ ~/ H' B  rWinNT) with the CreateFileA API.
7 D5 M1 r% {: m9 z- v( i$ D- C8 g- R0 S3 g' Z( [) q1 u8 o6 ]
Here is a sample (checking for 'SICE'):$ Z7 f! g$ d2 R5 L
  J7 g5 k$ D8 B) F6 r4 R
BOOL IsSoftIce95Loaded()
2 x$ r, f6 S* `" D) `{
) L* t! F6 g; `   HANDLE hFile;  2 m' d3 Q  y  F1 @" i( Z) S
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
1 D. [% p% V( ^( W" ~  j7 c. V3 D/ Q                      FILE_SHARE_READ | FILE_SHARE_WRITE,( K$ O( n7 R$ g
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);* z3 c$ Y' n( D- K" X& B
   if( hFile != INVALID_HANDLE_VALUE )6 J% V6 p' n5 e' S* y- z
   {$ x/ v1 [1 J8 x
      CloseHandle(hFile);& X& D+ ~! [2 R; U1 S3 C
      return TRUE;9 z* M1 F3 E% M" d
   }
% ^" f- `! {. l+ v" c& n! h   return FALSE;) c. S8 [& }1 w& V. K
}
% {6 {5 T: O! x- @; e) f
; L9 n4 R- \) m% ~Although this trick calls the CreateFileA function, don't even expect to be$ C7 d; s3 s9 v, B% x2 `4 P
able to intercept it by installing a IFS hook: it will not work, no way!2 [) Y) o; i1 o& l  M- J7 m3 w+ ^) I
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
4 t4 U  V; X1 `  Q8 Z# |; kservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
: h, K& B. n8 n  p8 U2 `, band then browse the DDB list until it find the VxD and its DDB_Control_Proc4 v3 I; a) J$ N" P% q& f4 k
field./ _6 t# J* ^, x/ _4 O$ g$ i3 }
In fact, its purpose is not to load/unload VxDs but only to send a / W; J* S6 t: n# s: Q2 B
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
/ [. p: ^$ ?3 {0 Ito the VxD Control_Dispatch proc (how the hell a shareware soft could try$ W- Q8 U* P' @) T$ R4 @
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
0 I0 L% h, O2 L3 G: oIf the VxD is loaded, it will always clear eax and the Carry flag to allow: S$ D7 p" O& o5 u6 ^' f
its handle to be opened and then, will be detected." \! c0 Z; O* R9 }7 q
You can check that simply by hooking Winice.exe control proc entry point3 O8 H2 p& }' u
while running MeltICE.
' r, E  M9 M: D' u  S7 R4 Q$ Z7 }* N! W! R7 {! o/ `0 J
" n8 ~+ W) ?* h0 e
  00401067:  push      00402025    ; \\.\SICE& C. Z- I9 t& g7 O. N4 d; P5 F
  0040106C:  call      CreateFileA
2 j7 y1 j: O/ G  00401071:  cmp       eax,-0015 T# R$ v% s+ W0 {' c+ ^
  00401074:  je        00401091' N4 }  N2 f0 h( I+ W
% D5 E; A2 X1 i  T2 m/ T" y
  S6 [6 l0 {) x; n
There could be hundreds of BPX you could use to detect this trick.: ^- v* R  T6 o/ s4 w  G6 k
-The most classical one is:
# ?3 T3 f5 \/ Q; S/ W, [$ j9 C: M  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||% C& |- l+ b, \+ ]  A
    *(esp-&gt;4+4)=='NTIC'% q  v* `' D6 ]9 @; ?
8 c1 O* }% V( O7 d
-The most exotic ones (could be very slooooow :-(/ B( N- d* N. `
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  ' d3 x8 r; e$ I" f) V  @9 K
     ;will break 3 times :-(
3 r/ n4 {5 H+ ~3 X. d* a
7 K  B- \: E# U. B: ?-or (a bit) faster:
; ]4 Y& p( S- X1 t/ K   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
: S0 q4 E) b: w& O1 m  \$ a, o: r7 P8 p% x# l
   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  # S) z- T% h$ }$ |0 c
     ;will break 3 times :-(
. Q" I6 q" B( j; w. c, x/ |
: {8 b7 u4 E1 B! j/ V8 v3 `-Much faster:
4 @. J( V# E$ K) @" p   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'
4 W: T4 Z) s8 j# d; j) ~# h
: j; g: R& z6 c- c4 e7 j& m2 l  `1 E- `Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
- Q/ }( u( L  `function to do the same job:
4 y) g; Y. K2 k+ S1 o5 W* D) }) W5 q/ T8 k: ^0 j9 }& X
   push    00                        ; OF_READ
; a* s6 H' D9 F   mov     eax,[00656634]            ; '\\.\SICE',0
+ B# q2 [% S! R# C' g! y   push    eax
. e5 q, N) ], K$ H1 f4 g   call    KERNEL32!_lopen+ h$ e0 T) T0 g% L! K' v6 r
   inc     eax
& W  {; N: r0 b: x   jnz     00650589                  ; detected
/ ~. i1 o7 S% k- H- {6 c/ r   push    00                        ; OF_READ" W, `4 U+ R; J' n$ [  Q
   mov     eax,[00656638]            ; '\\.\SICE'
" S* p5 j  h( J! ?- {   push    eax
' Y/ x. f, K! ]- q  b. @   call    KERNEL32!_lopen
7 T, A5 g! G3 ?8 Y, y   inc     eax
0 c+ m( D- ]- m: k: J   jz      006505ae                  ; not detected
6 F8 z" z! z! U
& m. ^0 |4 d4 q' X3 a& ?
. o. V' f: c4 f, w! D__________________________________________________________________________% z' T2 V( h/ Y) x$ I( k2 p

2 E4 A3 W2 D! t; O+ M# `; p; fMethod 12, b& O9 U4 u3 K! v) U
=========2 q$ e( \  w. G3 b8 m% U$ A2 x

: ~) o! `6 |1 Y+ b% U6 rThis trick is similar to int41h/4fh Debugger installation check (code 05
( W+ S) U6 v6 s' s* X& Q. E&amp; 06) but very limited because it's only available for Win95/98 (not NT)
* a+ d8 M9 F; O: has it uses the VxDCall backdoor. This detection was found in Bleem Demo.( @+ H/ O& p* e; g
  a0 n! \# X. V9 B. t/ t
   push  0000004fh         ; function 4fh3 z7 p8 K. i. n" T. B6 s
   push  002a002ah         ; high word specifies which VxD (VWIN32)
) u+ X! r' P+ W2 }4 R; H$ C                           ; low word specifies which service# z! K* s! p* A- S# f
                             (VWIN32_Int41Dispatch)' S4 j( `9 v9 A  m+ ], O! u1 S
   call  Kernel32!ORD_001  ; VxdCall5 |3 _. L7 i' A6 k# H) v7 D
   cmp   ax, 0f386h        ; magic number returned by system debuggers+ T. l; I! |: X
   jz    SoftICE_detected
9 K$ U$ u, N7 n1 u+ ]/ ~
5 [2 @' X3 c) B3 jHere again, several ways to detect it:* x! a, H7 t3 L6 K4 z- X

, A8 Z* x+ F* Q$ k0 t1 o    BPINT 41 if ax==4f, ~6 t. G) C+ O) r$ E4 J6 B5 N
, F! f0 D1 c4 T: ~
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one
& s5 P& j9 [9 U  E3 S" Q7 ~: G( ~: j: A) m) B2 D' I6 M. Y/ |( S5 ^" l
    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
; L7 K7 ]# `& x8 i% P* N- @0 ?, b1 m$ w
    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!7 \* P: j/ [1 ]2 t) ?
" ~/ {& ]' k5 R+ [* J
__________________________________________________________________________
  V" b  h0 l, v/ g# j! R. a. C: H- E! `
Method 13) a. R4 Y: o5 k/ a3 ~$ K- s7 v# p
=========9 Q8 j, u3 Z" a- C$ k# j! Y

! X# Z1 u; F2 eNot a real method of detection, but a good way to know if SoftICE is
/ U+ s* k& n; a% k/ H4 E3 A5 winstalled on a computer and to locate its installation directory.3 O6 Y3 D" {; e  Z9 W" q
It is used by few softs which access the following registry keys (usually #2) :
6 M' ^* _- j3 q4 J: u5 G+ n0 h7 ^/ m4 a9 n" L. Y( c
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion4 ^- _+ p, K9 ]7 f" q
\Uninstall\SoftICE: F; d/ `/ E: F) Z- V
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE, Z1 t5 O& L3 |% S  q
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion9 [3 {) C# T8 c" r8 u
\App Paths\Loader32.Exe0 w- L/ F7 i9 @& B$ P
8 N% R" ^" e3 r

; [& p# y# t* y$ }$ @+ r! ~Note that some nasty apps could then erase all files from SoftICE directory
. J: ]# P# N! c4 Y8 K(I faced that once :-(  t, [: r1 @6 o2 s

* _8 _" l1 r+ _3 \! J5 ]Useful breakpoint to detect it:
3 O( ]. K) P( H* ], I- a8 K& d9 v( m2 @/ |! p+ g) e7 g) [+ [* I
     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
8 A$ N  U6 q6 N' r/ G! h  o
4 u, F' j/ U: L3 V$ w+ \- P__________________________________________________________________________
" T: q1 ]  s; c. M- \% ~$ r) y6 f5 e3 j. f1 E4 Q9 m/ v

/ @; ?+ o  ~+ V& r) b3 Y) KMethod 14 % Y6 J( m* X  b# e
=========
6 c- e1 ?) ?" `4 y( ]7 ^
- ^0 S3 B6 W8 IA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose- N' K; @3 b2 q) O% J, }5 M
is to determines whether a debugger is running on your system (ring0 only).
# A5 y# j8 @# F5 a
; A8 G0 e. k( p# [   VMMCall Test_Debug_Installed- Y1 ?% d! `" C4 L
   je      not_installed/ t( Y- t3 x! z3 `+ u/ U, h. _

+ q. L9 \6 Y: V* `7 s# J+ \This service just checks a flag." `8 h1 v1 a4 A9 W3 c
</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-7-23 15:21

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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