找回密码
 注册

QQ登录

只需一步,快速开始

About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>. f: c- w  i& n7 J  b
<TBODY>
, e% O6 x! _! l2 y! k" i* r  T<TR>
9 _: ~" H+ y# x& t<TD><PRE>Method 01 ) N* I9 M$ u$ o$ @5 v' `! z
=========3 I+ B4 E; r- S- K. E  G! |

% q% i8 D$ |9 K1 M9 q$ mThis method of detection of SoftICE (as well as the following one) is
3 R; @2 }# T3 u; m8 t# Uused by the majority of packers/encryptors found on Internet.4 V# S/ K, c( V! k" A. R
It seeks the signature of BoundsChecker in SoftICE% l& M' C# ?& n
/ r/ v- u/ V  E; D1 D6 N
    mov     ebp, 04243484Bh        ; 'BCHK', v! X# U1 ?: t' i$ W8 X& U
    mov     ax, 04h
, g. u1 M( v' [$ z) t6 d    int     3       ) j: D% d0 f8 r* r8 K
    cmp     al,4
- Z; c! i: X( J) u( |; r9 U    jnz     SoftICE_Detected6 h" q% x8 S1 w' s9 C
0 ~; S! e5 ^  k7 ]  U, _- Z, M
___________________________________________________________________________2 Z* S3 C# }; s9 [  B
3 d8 Q# e# V& t' X
Method 02
; v1 v8 ^. i2 _9 `7 I8 ~, a=========
2 V3 B/ \( S  w( Q8 w) }+ T' w3 H# Y+ R
Still a method very much used (perhaps the most frequent one).  It is used8 ]4 @6 F4 R. n( c
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,9 S6 e7 v5 ]4 L
or execute SoftICE commands...
8 ^5 t- X* V! |. U, t; M) }It is also used to crash SoftICE and to force it to execute any commands
2 y: e- U" m) v5 U- V(HBOOT...) :-((  # S" n, P8 c+ `! A1 F/ f- ^7 |
8 F3 q; s' F; N7 Z: Q3 e( y2 O5 T
Here is a quick description:
+ a2 [9 I0 F. M  w. G0 e6 X-AX = 0910h   (Display string in SIce windows)
! ?1 N* A  c# {( t+ B-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)4 v! ?9 L( y& j, W! ?9 g% e; I# p
-AX = 0912h   (Get breakpoint infos)
: G/ J1 |( \9 J5 f2 Y-AX = 0913h   (Set Sice breakpoints)6 g$ D( S2 |7 F6 S
-AX = 0914h   (Remove SIce breakoints)/ f7 K& r" B& ?$ l* t

. H% }0 H0 V1 z5 a6 J5 B* TEach time you'll meet this trick, you'll see:
8 _+ Z) I9 E$ I9 Z-SI = 4647h  x7 [( E, }% _, D! y% ?0 {" H* ^
-DI = 4A4Dh$ T& \& M8 \9 W6 q6 C# B3 Z
Which are the 'magic values' used by SoftIce.2 T4 W6 `5 s* q2 `) B2 J" E& e
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
- }7 D; T) @6 }$ G$ A: V# ?& ]6 H
; J9 z1 m6 i; X/ y0 q/ o% VHere is one example from the file "Haspinst.exe" which is the dongle HASP
( f3 I; \2 A. s% i* {' pEnvelope utility use to protect DOS applications:7 c7 d, e  r* l+ e
7 K5 `! E) w( I7 W7 P$ P$ H0 {

$ R  {2 P  _4 S0 b4C19:0095   MOV    AX,0911  ; execute command.
6 H! [# _0 g* W: k4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
$ u, C' e& E! U3 r4C19:009A   MOV    SI,4647  ; 1st magic value.
. Q. \0 Y+ Q! I5 H5 \: o; m4C19:009D   MOV    DI,4A4D  ; 2nd magic value.9 A5 k& t& R1 T
4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
0 V9 c2 U1 Y8 _/ B- e5 D0 }4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute
: S# Q% ~/ k3 \( V+ p2 Y& d4C19:00A4   INC    CX% Y. q8 H. [! ]/ r/ b' o/ Q, j
4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute
% @7 B; t2 Y% N- i- K4 X4C19:00A8   JB     0095     ; 6 different commands.
" b$ N6 F5 V3 X. @4C19:00AA   JMP    0002     ; Bad_Guy jmp back.# ]7 W5 h% I: O
4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)
, B5 P7 L) H5 d6 ^/ D" x
! o( U. k& I: [9 C8 YThe program will execute 6 different SIce commands located at ds:dx, which
0 Y+ H+ D0 v, C9 mare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.( @: {% C( F* H9 l$ o: k
; R/ f3 s8 K# V- r/ q
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.% x) h# p1 q0 {: h  k' T
___________________________________________________________________________
& K5 u  V% o  x; B) X( |9 r, G, X  U* b

* d+ K/ I+ t, M' kMethod 03+ O/ d- ]( X; `2 X! a# G# I. z
=========: {, V/ f; m9 a# U5 i% M

  _& D( ?, y& U5 t5 x$ qLess used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
8 f' k$ @6 z6 P& r(API Get entry point)+ u- c* T2 ?% F8 `1 q* ~5 q5 e
        
) l( l4 J; I2 u4 j: Q
& g, ]  s& U1 i  ?    xor     di,di
6 g+ G1 G; {# l+ _    mov     es,di! q2 W' f/ h2 m6 R0 N! B8 V
    mov     ax, 1684h      
3 D1 D8 D+ k: @+ h. v" m    mov     bx, 0202h       ; VxD ID of winice
; i  G, o  G! p2 G- E/ ]    int     2Fh* H6 _8 X4 x; C' O( X9 R
    mov     ax, es          ; ES:DI -&gt; VxD API entry point+ V! Y. L1 R9 p: k, e7 B2 H. u/ e
    add     ax, di7 C9 L) Z( `# e' f" e+ O
    test    ax,ax
# ~( f0 f8 e' T    jnz     SoftICE_Detected9 r9 X, Z% D" ?$ R

6 U' i# l% L5 a/ ]" g$ I___________________________________________________________________________( [  y5 v8 V* I  C0 f  w5 v

: R# y, g( `% n8 mMethod 04
. N. B/ a' q% y5 h, ]- W4 k=========- ~% D( v$ \4 s2 t' L4 R+ o0 i" L
/ F6 N+ j1 c( l4 x3 }& C6 d/ j
Method identical to the preceding one except that it seeks the ID of SoftICE
' o7 W6 @& A% P6 y; l8 Z% a) H) I( JGFX VxD.( q. e2 ]$ X4 p4 e7 v
0 s4 M& }: r) z1 L; l0 L# x
    xor     di,di
/ V6 U. R& H5 K4 O! }* Z    mov     es,di* X6 [* }. k. ]: A( }- _
    mov     ax, 1684h       . ?# Q/ v% C9 F  \8 R, `1 D& k
    mov     bx, 7a5Fh       ; VxD ID of SIWVID
' r5 \- h  `/ ^" ]$ o  H    int     2fh; Y1 j2 `" j, A& U' L
    mov     ax, es          ; ES:DI -&gt; VxD API entry point* J$ g3 P3 D/ d
    add     ax, di
. K8 G! x& E: r+ l    test    ax,ax
5 _# u1 g1 \* {    jnz     SoftICE_Detected
; ~% p- X3 v; N9 e1 A! Y9 K5 Y5 |* l% P+ |: h
__________________________________________________________________________  X; m2 l: s) s+ R  M# }9 Y! P; S* }* d

3 Y1 F! M5 J3 W4 J
) b6 ^) r5 H$ AMethod 05* r" I& z: b. p" M# R$ v
=========1 C* a3 p( h* T! r( t, L+ w5 N

/ E/ A# C  l" L, T$ zMethod seeking the 'magic number' 0F386h returned (in ax) by all system
7 V, \% C8 p% D- ?4 X( P  Qdebugger. It calls the int 41h, function 4Fh.
' w( Q! ]) X* b6 }9 PThere are several alternatives.  ) L7 K1 Z) i9 z
1 |2 ~+ E2 R4 {) F" F
The following one is the simplest:
- P+ |1 Z( B% m# ^$ Z( B" o: w+ \$ {0 P
    mov     ax,4fh6 O- N, n0 E# b( H& Y. ?
    int     41h
' M$ c  t6 T; E( @) W( N" n    cmp     ax, 0F386
3 |  G' Y& i2 B& m9 G/ J3 g    jz      SoftICE_detected
' y1 }& g6 B- J9 {/ Z+ Y$ V! I& R

  r" m6 S$ k. P4 W7 t" zNext method as well as the following one are 2 examples from Stone's 0 I3 [3 m2 L6 }9 g8 P
"stn-wid.zip" (www.cracking.net):
) n+ }3 P. w9 L9 o" n) k8 C+ Q
4 Y: L3 x6 x% f    mov     bx, cs1 Z4 J& W" b/ F& h2 A
    lea     dx, int41handler2) l; u$ U. |4 u6 z
    xchg    dx, es:[41h*4]  j! j9 Y) V$ B# ~3 b$ B/ E8 s
    xchg    bx, es:[41h*4+2]" T* p) |" b  l/ C) c
    mov     ax,4fh/ M9 K; g) p$ e; d
    int     41h8 V6 w- U+ B* f& j8 [
    xchg    dx, es:[41h*4]9 e5 V2 `2 @* G' p1 W
    xchg    bx, es:[41h*4+2]# @! f7 I% [- l4 w' W' h% r, _
    cmp     ax, 0f386h& j: E$ h9 s, u
    jz      SoftICE_detected4 O& j7 r6 Z! z: d4 e
4 _$ g& K5 ^- b3 z0 Q4 L
int41handler2 PROC
$ F  h% w4 d  d7 P# d! p1 i    iret$ ^5 I+ ^' [+ m4 W* P" n# V' X
int41handler2 ENDP; g, O. m; s. z, U5 e
2 o% s' r& |+ Y3 h6 k

2 U! B: q0 p$ \, o  g_________________________________________________________________________" Z! X/ ]0 ?1 P5 D1 ~  y) L1 P$ |% m
9 }8 ~8 a/ }9 m! M
. Y$ U* x9 I, G
Method 06# Q/ n4 J) |2 F9 `% O
=========0 E2 @1 M" @8 M- |1 V5 r. O

, y: g/ E9 M: C0 v8 m' r( x+ [) z- D# U7 @' y5 F$ a
2nd method similar to the preceding one but more difficult to detect:
- p: k9 U1 b* ~
- }: X1 h4 H0 d8 `
8 s. ]0 Q; J7 m3 nint41handler PROC7 `* U# L3 X6 l' e" w  W/ k
    mov     cl,al
9 H  c3 \- b& k0 J' m    iret
- Z, f8 O' C: uint41handler ENDP
! K8 i7 [! n* Y! _( _! F6 O; P
" T1 p1 S2 l, C, {6 J- ^3 R0 X1 x0 h/ G
    xor     ax,ax" a: H6 @4 R9 d+ Z/ V
    mov     es,ax0 F: r. E' _( W. [( e" ^2 M  u% i( v
    mov     bx, cs; R$ g7 O  ~) d
    lea     dx, int41handler: o+ U# ?# O, S& N6 I
    xchg    dx, es:[41h*4]
+ c- `8 ~; \+ ]) G, R! _# s    xchg    bx, es:[41h*4+2]
/ E& ?$ F! L3 Q- ~, _1 T3 s( i. O    in      al, 40h
# g% s1 t& `% \' s; S    xor     cx,cx* Z9 C9 y/ x, Q) D5 R
    int     41h
$ `2 d3 B; h2 T9 [, O    xchg    dx, es:[41h*4]6 z/ D  F2 H! `! v3 n
    xchg    bx, es:[41h*4+2]3 \' _0 _& o+ _& m" b
    cmp     cl,al
0 Z/ M' J7 N! d  n7 G1 @' E( W    jnz     SoftICE_detected
) k/ S4 `( u" @& z1 E7 V
! i& p4 P& n+ t6 m4 W4 z& V/ f8 ]0 Q_________________________________________________________________________! r: T. ]7 _+ h7 N5 D- d. }; Y

' ~, ]- F* S. TMethod 07
% Z0 E' d, E  W=========
1 X. E/ O8 m5 h& S1 u# `$ q: E. |7 B0 c( y" }/ q& |
Method of detection of the WinICE handler in the int68h (V86). @4 N- l& w9 ]$ z0 g! x) Y

' Y6 @4 O2 ]5 I    mov     ah,43h
4 Q3 f% e, \, D- t  b  v$ d    int     68h
- `, I3 q% K6 v& K    cmp     ax,0F386h0 I" e5 _$ w- i
    jz      SoftICE_Detected8 S" n5 g. W' t( ]8 T+ _9 A
& M! r( h5 |# t: ]
" h9 Y4 C# t* s9 A7 p' I1 Q
=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
( m  g- _% j8 Z6 K   app like this:
0 Y. ]: n1 J0 `3 T1 {: @5 t* R; U7 w( ?  m$ s
   BPX exec_int if ax==684 o, N( b* c) {  ]5 ^4 C  U4 v
   (function called is located at byte ptr [ebp+1Dh] and client eip is/ ]# a" i6 s6 b$ ]9 N6 ]% h
   located at [ebp+48h] for 32Bit apps)
/ ~0 I; U7 W) b' U' g% E3 ]1 r# u; \__________________________________________________________________________
, A, y) T, g( G* V% _9 m  Y6 `* T5 _0 h$ p4 h. G  D& U( d5 a0 w

) ~$ O- P, M8 ~4 _1 d' U6 L# g8 PMethod 08! `+ ?" P3 g, a. P' w
=========/ _3 ]- }" G% l: q

+ p/ D' s. r! V0 W- lIt is not a method of detection of SoftICE but a possibility to crash the
. _- \5 {' w8 r: X  zsystem by intercepting int 01h and int 03h and redirecting them to another& p. s' I0 F/ k( R8 K0 E
routine.
, q# O7 B! v& |" c' e( O4 h4 V, bIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
' v" p" J7 ^- i% l" uto the new routine to execute (hangs computer...)
1 X' v) l& `: |5 Q0 U# W
( ~' v: x3 S5 n7 G+ V/ g    mov     ah, 25h1 i3 X" U: {' ]$ Y8 h% U
    mov     al, Int_Number (01h or 03h)
2 L* D. x6 r% e& @1 w5 X5 e- i$ G    mov     dx, offset New_Int_Routine
$ @, A: P- }, `% v# x7 n1 y; Q0 `    int     21h
6 Q* {0 @* ?# t$ C" h# o7 t, M, z5 A8 l
__________________________________________________________________________
% e+ R' R* A* I8 g8 }
) n$ i3 J1 c& G+ Q' MMethod 09" g% t; w0 E5 i6 {& q
=========$ l# E; N5 t* W7 L& x. S
% ^# s( Y, Z7 X) G7 y' U+ ?
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
3 \- O) i8 q1 l+ x/ r2 h  f8 ~performed in ring0 (VxD or a ring3 app using the VxdCall).
) C4 }- G$ S( w' U- fThe Get_DDB service is used to determine whether or not a VxD is installed
' R+ h3 J; e6 s. A- x( f! ]; \for the specified device and returns a Device Description Block (in ecx) for
6 X$ v% \6 V) s9 y! J" Pthat device if it is installed.# X. [9 I' q) X% _
$ J# k) S3 h( C/ U! y
   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID
3 [; \! l* f$ x   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
1 J+ C8 s: `, h1 O: b& _   VMMCall Get_DDB5 s6 S1 J# `) P
   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed
4 o* m' V8 V9 l3 i! W9 H( f+ V" F6 U+ ^. m
Note as well that you can easily detect this method with SoftICE:
8 g# M9 g. f/ I1 y   bpx Get_DDB if ax==0202 || ax==7a5fh1 d# i0 D" k! [) X! m+ S4 j
* N( _3 h7 M& G" ~
__________________________________________________________________________
& y0 v; R; K* O+ y2 {5 j4 J7 q3 c
Method 10
* V+ k" [' l, ^- j7 ~+ b! T: _=========# f" ~- ~( W5 V7 e4 o% j  X

/ H5 K9 D0 H& u' L: w% P=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with: o, E3 U" t9 {/ ?6 e/ ^
  SoftICE while the option is enable!!
, J" n: w4 a6 H/ e$ c5 S3 s5 p- T3 m! r1 Q; |$ w9 O: L
This trick is very efficient:2 B! G! o& x) @9 E. P' U
by checking the Debug Registers, you can detect if SoftICE is loaded
- p. n- U. |  T# K  M) v(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if- W2 ?" r. \8 e9 n" Y: W
there are some memory breakpoints set (dr0 to dr3) simply by reading their
" i+ ^8 B. U3 ^+ z5 e" gvalue (in ring0 only). Values can be manipulated and or changed as well
% h" f. O2 \& Y/ s' ^(clearing BPMs for instance)
8 E0 y% ]6 u9 b6 B8 m, A
  i' P6 k4 n4 |# a0 k* c__________________________________________________________________________, ]1 L4 |# b% C/ D
, t0 r& {; |9 b
Method 11) o" T- k; R; O- }$ t2 X- T* y
=========" }+ L0 l# L4 p) ^
' Y3 {# F3 ?: z
This method is most known as 'MeltICE' because it has been freely distributed8 h/ N: [1 m4 m6 S6 \, \1 m
via www.winfiles.com. However it was first used by NuMega people to allow8 x7 W/ u/ D8 U$ t# J
Symbol Loader to check if SoftICE was active or not (the code is located) O% I- _! T, ?, v+ X3 q8 T5 C
inside nmtrans.dll).
, @! j( z) _2 C7 J/ r  a+ }3 v# [2 A9 d
The way it works is very simple:
4 P( K9 S4 i/ P+ _2 P& ?It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
/ t3 {; I$ c, W$ A8 P* S9 EWinNT) with the CreateFileA API.
+ \7 [' ~* L3 f. o5 q6 g9 v: o- U4 c# b8 D2 `. i* n+ P
Here is a sample (checking for 'SICE'):
8 x) k+ o1 g; `4 T: v- v* R4 l; v
BOOL IsSoftIce95Loaded()9 T( u/ W/ j& w' s& ]3 B
{2 V- B  R$ R/ M3 M; A
   HANDLE hFile;  4 r* w5 `  ?! V/ I% h
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
7 J6 a/ _  K# ], p6 f2 \, A: S. Z1 Q                      FILE_SHARE_READ | FILE_SHARE_WRITE,, V+ ~1 i6 K8 q( X: w9 D7 ~5 }& k* \
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
4 r) \. }) o# {+ E! v0 n$ B   if( hFile != INVALID_HANDLE_VALUE )6 d+ b, b0 X( W
   {
" ]/ \2 i7 n) t      CloseHandle(hFile);$ C; @- Y5 d; G2 t
      return TRUE;" k" B# \' _1 n8 }4 Q/ E' L, k: t/ ?
   }  Z4 C5 d& l  X1 [4 g9 |8 H0 V# w
   return FALSE;
! b) c0 e1 l$ _}
8 u9 R: V: g. I1 L8 Y
$ {% q4 ~+ I8 NAlthough this trick calls the CreateFileA function, don't even expect to be
4 d' A. ?& ~+ R! _& G! m( Mable to intercept it by installing a IFS hook: it will not work, no way!. z- Y' o( e3 t; k$ |$ v& i
In fact, after the call to CreateFileA it will get through VWIN32 0x001F/ R* i6 Q0 Q4 H( U& t! W9 V% g
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)8 r3 j4 `! A9 n- z8 D, I
and then browse the DDB list until it find the VxD and its DDB_Control_Proc6 R9 z5 o" W: M0 {: g5 V
field.; e; w2 j1 G7 C. U6 n+ q
In fact, its purpose is not to load/unload VxDs but only to send a & V( C/ i1 f3 j  e1 K5 r+ v0 v8 {
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE). U8 e5 I* t3 d
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
& l! S  Y1 `% g8 x6 Y  Z8 a: Wto load/unload a non-dynamically loadable driver such as SoftICE ;-).3 E5 }4 q  r7 R2 A$ T& v
If the VxD is loaded, it will always clear eax and the Carry flag to allow- e" m/ V& v( u* P2 c' a/ ?% X
its handle to be opened and then, will be detected.! ?& g' r% q8 X6 t/ }3 a
You can check that simply by hooking Winice.exe control proc entry point
3 @, g0 |. C) i3 S+ o; owhile running MeltICE.
; }+ k& U, @1 a# q+ F$ F0 i6 n+ |$ F( h; M/ T3 T6 @, A  I
  l7 m& U8 D( F1 ]+ r  T
  00401067:  push      00402025    ; \\.\SICE
) _/ s0 B7 @$ J0 Q  0040106C:  call      CreateFileA, W* y1 r0 w* K8 A" m, t: O1 l
  00401071:  cmp       eax,-001
/ g: }: y, D6 ?3 Z" C( J  00401074:  je        00401091
5 G6 ^6 c7 z- u- {- e9 Z0 c$ s
+ m+ E& Y; X* }2 S  _9 C1 o
& a6 ?& g9 n5 `, T) Z, w" l$ qThere could be hundreds of BPX you could use to detect this trick.$ [) o6 `$ s9 @$ k( g
-The most classical one is:
7 }+ w- m! H% ]8 Z2 ~8 n  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||6 V6 y/ u) `! j: I  u9 A0 ~1 m
    *(esp-&gt;4+4)=='NTIC'
5 N7 o/ p( S9 B; w' j3 \/ ~. ^/ Z6 G& w: E. U$ v
-The most exotic ones (could be very slooooow :-(/ T; Z1 \& y; m4 b4 H" d$ ^4 N
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  0 t- c; b, N' w) `- b' N
     ;will break 3 times :-($ ~4 F' O3 }/ A9 z; z4 h9 D
  y/ Z; F' i4 J6 r/ e- A
-or (a bit) faster: ' t, X0 @3 J! J5 W
   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')3 I+ v4 B( H4 R" z0 s8 D+ _/ C

) ?5 u( z- s5 I+ |* F" L! j& m   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  
  s4 _( o! l2 V, U     ;will break 3 times :-(
; s& u! `7 I0 f( _0 L) P1 ~/ g& M4 L% c. t# e0 F5 i
-Much faster:$ {: \" Y; \/ J! h
   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'# D7 [0 {2 q- Z3 q% ]$ h9 z

( Y* j0 H: |+ K& g5 q* QNote also that some programs (like AZPR3.00) use de old 16-bit _lopen+ q  \; P2 M- Y+ |4 Z3 [5 Y& K
function to do the same job:
# w7 E" H( S% H& g# I" N
. @  \% u( p6 J# v3 U   push    00                        ; OF_READ" l+ R& t$ Q% B8 ^% K6 S5 E; e( x
   mov     eax,[00656634]            ; '\\.\SICE',0
, C4 c! m& z( [' I* R) ~   push    eax
; Q* g" ]/ X6 _8 j' T   call    KERNEL32!_lopen
9 W3 x: q6 p1 x9 z) U   inc     eax0 u5 V0 O  `( X& a. O" a. `% X6 F
   jnz     00650589                  ; detected
* I6 v" M% Y2 J  O7 |   push    00                        ; OF_READ
5 Z6 f2 H+ p: ]8 `   mov     eax,[00656638]            ; '\\.\SICE'
  W1 [" x2 T% P   push    eax
  L/ T& j( ?/ x- h0 J   call    KERNEL32!_lopen
/ z( w# i9 G3 u: w+ n) g% ^* H   inc     eax
! e0 `7 y7 x7 U, v2 p; S0 O   jz      006505ae                  ; not detected
% y  c1 U3 N" D8 D( W; p$ I) t" X% A) y: N
5 a5 Y5 Q+ i( t
__________________________________________________________________________
. \$ {1 [  _4 U, [- `7 F3 E
0 v, {/ ]% g! j$ k- O" j- {Method 12
. {0 m- \$ F0 E- {, Z3 c=========
' x& {# ?! y) A, t$ r5 `/ c  i( Q  n) K  T2 O2 U9 O2 h
This trick is similar to int41h/4fh Debugger installation check (code 05
* U0 u! {& c  A6 T. ]1 \&amp; 06) but very limited because it's only available for Win95/98 (not NT)
' b" n2 {/ B1 R& \as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
) e' F% Y6 h( q+ @7 `- a
" l. S# _2 C; t5 K+ T0 i   push  0000004fh         ; function 4fh
9 n- |# \3 L) `0 b+ G. T   push  002a002ah         ; high word specifies which VxD (VWIN32)& J/ e+ {. W# o8 C" i! \9 P. u
                           ; low word specifies which service
9 L1 Q! X& S% P7 E                             (VWIN32_Int41Dispatch)) b/ D' m( U8 _
   call  Kernel32!ORD_001  ; VxdCall
8 E" L5 A! A$ h+ `1 q   cmp   ax, 0f386h        ; magic number returned by system debuggers) B9 D9 c3 O  `- X1 g. g% {* X1 K
   jz    SoftICE_detected' I: [+ c# {/ g, j. ~9 i, @1 ^5 _
7 i+ L: M6 ^/ @7 k- d( p
Here again, several ways to detect it:  f) m' H' D" D, a- q3 L) H& V
% z; r1 w7 |# r
    BPINT 41 if ax==4f
3 P+ i3 z; S* K+ o  c+ B3 N" Z7 o' ?( f7 ]2 N% B
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one1 t9 H! s: i: V$ K3 i
' o" Y+ M' {8 k+ G& i5 f/ G8 ~1 n
    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A' P% S! c) `5 K: H0 {  I

0 f5 t  c7 V6 L& A" H; `    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!
  M) v1 h: N! ~9 f" k: y
* G2 H  j% g' e7 ]__________________________________________________________________________9 E$ N# S# i, s% C( p. f6 b- d3 s
+ d! T* R. g% y& R0 r
Method 13
" l( r+ u7 V& h- Z% f4 A) {8 }- Y+ d=========" T0 C8 k7 b+ J" `( ?1 `5 w
+ V9 X' l2 I8 o8 ~: r& y
Not a real method of detection, but a good way to know if SoftICE is' t2 e7 g8 t& b6 j; Q
installed on a computer and to locate its installation directory.# K" G2 \% m. {7 K* V. e- y  L
It is used by few softs which access the following registry keys (usually #2) :
: o1 `0 ?& j9 U! a& r+ ^$ p4 }. G$ |/ ^- [( T* C  B
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
6 _8 c( ?8 F+ ~8 A( P6 r' e\Uninstall\SoftICE
* i! l0 t/ X& I3 T5 }1 u-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
3 D6 f6 a' u5 B* e4 p6 v, c6 J-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
, b/ j9 S" [1 T1 c, C\App Paths\Loader32.Exe; v& B, C& ]+ X5 o

' m: X4 i; A* F/ o, S: K4 I- S: z4 F% ~8 ]8 n. V. V' H
Note that some nasty apps could then erase all files from SoftICE directory
( ^, h6 Q  J; a  ^& w0 T8 G2 z! k  |(I faced that once :-(
$ ?& [0 h$ N7 u& e* q' }) s$ c, `* C) |8 Z. }; B( M
Useful breakpoint to detect it:( d6 h6 X/ d" [) F3 j# l
4 ^% F( J, O7 A- g9 w3 X7 z
     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
9 J* }: q2 w" K9 b
: r2 z# l8 w. r$ u1 h8 A" p__________________________________________________________________________
% ?* G( o/ D! z* m5 W/ n/ u% \' p# C0 o: s+ m4 M  g( J
0 ]6 ?$ k% H9 J
Method 14 ; q5 S: D5 K+ ]
=========  j* l/ D, b. H0 k

3 L+ v2 t. o4 ~: n3 eA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose. r- X4 Y7 l  X9 |) z9 N) a/ r
is to determines whether a debugger is running on your system (ring0 only).* I6 E, X# L  L& b  ?, R& x! q
( ]% z+ N% r5 h( W
   VMMCall Test_Debug_Installed5 r& D2 E$ w) V* H  C6 |" }
   je      not_installed  w' `; `# m6 [8 D9 z0 F; v* K9 p
% \' _3 S0 r( i; `- E: i
This service just checks a flag.
; g" O- y& D; L# u8 z</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-8-1 10:32

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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