找回密码
 注册

QQ登录

只需一步,快速开始

About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
3 p. x( h* o/ a<TBODY>- s# F  V5 [5 D! m
<TR>
$ S0 P6 p9 c$ Y5 ^9 w<TD><PRE>Method 01
% c1 q2 s- z/ z7 u, [=========. F2 S( t* y; [2 @2 Q

; }  ]9 T) r/ d: D. @# j$ ~1 LThis method of detection of SoftICE (as well as the following one) is9 e1 X7 K$ _2 w$ C6 N' ~
used by the majority of packers/encryptors found on Internet.
* t3 h* I8 q/ C6 z2 F. yIt seeks the signature of BoundsChecker in SoftICE
+ V6 k% [! f' J( r% v) P
# l1 k6 d  f% A1 _! A    mov     ebp, 04243484Bh        ; 'BCHK'  f+ i4 p6 l# |. Z+ R+ K0 K
    mov     ax, 04h
4 u9 P# c6 E6 z    int     3      
; u- W5 i2 V( @    cmp     al,4
$ `. B% L% G+ ]. p    jnz     SoftICE_Detected$ |" ?% ^8 q* F2 ?& w/ }0 {8 Q
* ?% ~! T- B3 B6 b0 E
___________________________________________________________________________
" x2 C& Z/ [* m/ J* Y3 ]0 x) P8 x1 `$ G4 r/ J- K* m# \
Method 02
, J- ^' ~- @" x- C1 k# s=========8 J  E/ ^- R: t% g4 T

, x; B: Q% {/ w/ D3 h; D" qStill a method very much used (perhaps the most frequent one).  It is used
3 M5 ~4 }$ S8 A) U7 E' }) b- }  Tto get SoftICE 'Back Door commands' which gives infos on Breakpoints,- i$ A' P" L: `
or execute SoftICE commands...
/ Y5 b/ k1 y' a3 c, wIt is also used to crash SoftICE and to force it to execute any commands! Y5 x6 f% p$ Y2 M8 L: E: N
(HBOOT...) :-((  7 u) g6 w; V0 U; Z

/ v; }. W+ y" b  S) RHere is a quick description:, j" ]* W( q  j9 V; s9 g
-AX = 0910h   (Display string in SIce windows)& L) p1 j8 a" m" M" D2 g3 }( T
-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)1 H1 x. |1 o3 d1 \2 Y+ u
-AX = 0912h   (Get breakpoint infos)0 d; H; O5 c" @" [7 w" i
-AX = 0913h   (Set Sice breakpoints)$ h, L! m2 z& ~- s& A- W
-AX = 0914h   (Remove SIce breakoints)
2 p/ J* k5 R' ^2 y% e  d" R2 N0 t* R3 I
Each time you'll meet this trick, you'll see:! I/ ]3 m  ^/ b. z. A6 |/ T
-SI = 4647h
  s9 S$ V3 X# f8 ~6 T/ y- F-DI = 4A4Dh  H' B- D: {! B+ X! S8 W
Which are the 'magic values' used by SoftIce.
1 b" |* d9 M! r. l3 @/ q- u) dFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.1 J5 Y+ F" {% I& l5 f
: B7 \$ `0 B4 Y: v# q5 B7 ?' }$ L3 }
Here is one example from the file "Haspinst.exe" which is the dongle HASP
3 A7 z$ i, N) u$ g8 a* aEnvelope utility use to protect DOS applications:
7 C* ~/ r$ [2 a( N" p7 D$ C" C. k. i. n% Q' @

: R: Q3 s: J1 Y" y4C19:0095   MOV    AX,0911  ; execute command.
9 R* d  P& Z& Q4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
; m  h3 ?8 f4 k# z* V& J: _0 S4C19:009A   MOV    SI,4647  ; 1st magic value.
5 x/ J  m, A; z7 ^6 ^# }4C19:009D   MOV    DI,4A4D  ; 2nd magic value.' T$ n. ]& ~4 M. v
4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)( ]0 g. h, i3 p& v
4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute2 `$ s0 m2 v- d! b1 C& l+ U
4C19:00A4   INC    CX- Z* S- b) ^: u7 }
4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute
* i% I2 @5 Z+ D/ b: U4C19:00A8   JB     0095     ; 6 different commands.
4 z: i7 l# ]0 ?4 t4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
" [" O: }9 z' i( p: L" c4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)5 E' ^9 L/ E2 e8 T" |7 z
. E1 d+ e' e! v
The program will execute 6 different SIce commands located at ds:dx, which
4 |9 c8 G1 j; Z" H+ _2 ~/ V9 k+ c0 Fare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
7 u1 c, Q1 C% {; o; U6 ?
  |( G' {3 p8 w( f0 e8 Z* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.4 K9 k. t& X- |3 ^6 @0 X: l
___________________________________________________________________________
9 n) [; n! A# p. }# a: X
# x  ?) {# S* [) V- i4 x* X1 ~' l
4 `9 w6 P9 u7 S9 k, ?Method 03, M5 a4 X3 G0 F$ G) _' Z0 }8 B
=========6 z6 V6 u8 f. t( ^% @

/ r) @) d; k: KLess used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
8 {( w2 R8 {5 A9 }) X, N(API Get entry point)1 P+ t: ^7 x' J, r) l
        
7 M' g) \& W" G1 o
1 w- z2 i4 B% V; n! ?7 U    xor     di,di
+ m* P6 s+ r: {- E) u    mov     es,di
% S2 z. [2 C2 `- @5 H1 T    mov     ax, 1684h      
* I9 {. L+ Z: ]# p    mov     bx, 0202h       ; VxD ID of winice! ?, t3 B. g7 L1 i
    int     2Fh# ?3 a0 F+ m" J2 Z) f
    mov     ax, es          ; ES:DI -&gt; VxD API entry point
! }# Q+ p6 b5 A5 e& ]    add     ax, di7 [4 y/ C" q4 O, r+ G; V7 s' H
    test    ax,ax
8 q2 M# p; ^+ z4 H: Y8 ^    jnz     SoftICE_Detected
9 p- u; P% v' h7 u/ f6 w& Y9 ~& u6 v- s) ^" A
___________________________________________________________________________
! R2 w  S- W$ |3 Q7 f7 b
4 a) R/ F- k* f! {) o5 dMethod 04( l  h5 {* N) H: A
=========+ v" N! J5 A7 W6 B0 [

" E4 q/ X! b; j2 p) `Method identical to the preceding one except that it seeks the ID of SoftICE
' D8 d; f. ?4 l5 W# }, bGFX VxD.
$ u1 R+ q6 b2 V+ E6 o
3 o$ b% I  q6 j* k! W    xor     di,di
4 [5 B+ c4 d  a    mov     es,di
5 e1 V3 U$ W) U- h9 }/ |; `8 R    mov     ax, 1684h      
8 }  H8 y  u! j0 y8 @    mov     bx, 7a5Fh       ; VxD ID of SIWVID
/ R; P1 G5 E' t. N  t' Z& f% S    int     2fh
6 }  n1 `8 w: L, t/ X/ k    mov     ax, es          ; ES:DI -&gt; VxD API entry point, W* B+ \  i% J
    add     ax, di
: P) g8 n+ D7 V- p8 _5 d    test    ax,ax0 \) b+ D9 `8 i3 S& w8 O" [; Q, ?
    jnz     SoftICE_Detected
1 T6 I! P. K( n% F9 m4 m- e7 w& k( G3 O$ `% t' @; J# b. z
__________________________________________________________________________
# Y5 u5 z. k' b/ `$ I  K" j- o4 w6 X# m% |

  I. l3 J3 L! D1 G" C4 SMethod 050 t, @1 Q0 T/ ?% X
=========" `7 E, b. K; Q

8 m. e3 I% T8 ]! I( aMethod seeking the 'magic number' 0F386h returned (in ax) by all system$ \- L8 }3 O& w+ W! n% z* L
debugger. It calls the int 41h, function 4Fh.8 D+ s4 ^6 H8 \1 x/ |, m
There are several alternatives.  % H( r* ]' ~2 `) d
% _) _! v; F0 z$ c
The following one is the simplest:
3 j3 w$ Q5 }/ t' {* E# p" M% f, j" ~# h1 {' o% G. P7 K
    mov     ax,4fh
. d( p5 K, h: Y" }    int     41h& `5 M0 C5 R6 i  V) F& h
    cmp     ax, 0F386
; k) I5 P" W1 G/ ]* J. w7 k    jz      SoftICE_detected0 n* L7 ?2 O7 x; F. R* P$ |" l/ X

! V$ h+ z  R4 y8 Y$ _+ m. R2 c# {( Q) }
: n' P- x" W$ b* ~9 @9 Y& CNext method as well as the following one are 2 examples from Stone's
. @& N  Q& W/ p1 i& D9 I"stn-wid.zip" (www.cracking.net):7 `; b4 H6 h& p! I7 u, k0 _, S, n

8 D2 Y& E8 c: {! x  P0 U( Y    mov     bx, cs
3 J+ g0 [. s0 ?: o( B    lea     dx, int41handler2
' J, I/ @& `' c# S    xchg    dx, es:[41h*4]9 ]' R4 j* @9 X4 {' M/ ?" ]
    xchg    bx, es:[41h*4+2]% |$ N: F! k; I9 w0 f2 ~
    mov     ax,4fh5 N9 w9 p0 U( X5 Y& `- A2 b
    int     41h
9 `1 H, J( d& \+ C% ^: b    xchg    dx, es:[41h*4]
& a7 p2 ]- Z! ?- P! @9 T: q    xchg    bx, es:[41h*4+2]5 x9 T% M3 {/ \% F1 w  X
    cmp     ax, 0f386h
9 U+ J! S& O* n1 h) E* c2 l# V" w    jz      SoftICE_detected
- c  K; ]* G: |& V5 P" `9 S  S6 l* z( z4 t5 R# W: t
int41handler2 PROC' G) @; g: A1 |/ s3 z$ E" h
    iret
, r7 S& U2 c0 V+ U0 U7 D$ ?. Sint41handler2 ENDP
: V9 E# I- X$ z: c" z1 m" U! z5 a* u% D; Q

* i# ?" ~- Z9 h_________________________________________________________________________
2 O; O# x5 x8 u/ d7 g- C! J0 l2 s8 A* g( L" ~4 y: {7 n2 ~
, x" ]2 b1 p4 V. h0 _1 n, e
Method 068 g9 h( I3 F4 W3 x( U. e
=========
$ M8 ]5 f! z) r) R5 s& _+ k! c, ?, U+ o) I1 C

9 k! P  }% @' j+ ^4 C7 I2nd method similar to the preceding one but more difficult to detect:. C' N1 _# [0 P6 R2 `- U* G% @; R# [
+ Y0 i  ~% s+ x7 |- F3 f) p
7 e3 S  R% A* Q" w, ~8 P3 |$ ]
int41handler PROC/ S$ e, `- |4 g4 q: P# N2 V
    mov     cl,al
6 d6 M# f5 e$ b2 y% n    iret
# L+ e6 k* T7 G8 a9 aint41handler ENDP
% s, u$ ]& V5 F7 D2 X- b7 J& w" R9 W* P! A: S7 ^% \! Q+ |! ~2 H

. K1 r; K( G9 Z9 X2 k1 {9 _    xor     ax,ax7 F  Z1 g2 _5 s! D
    mov     es,ax+ \; t$ h0 N' n- t& r0 ~8 t
    mov     bx, cs
+ X/ l: i' y: C3 Q    lea     dx, int41handler7 h/ G/ j; b4 H/ y' E& ?  s
    xchg    dx, es:[41h*4]: A: s/ j1 n; ]- F- a
    xchg    bx, es:[41h*4+2]
1 R0 S" `- M8 F  s1 ?. _! g/ L' L    in      al, 40h
/ m5 C3 a( y1 }    xor     cx,cx9 k3 \" G% D( y2 a+ G
    int     41h
1 Q% l- ?# F, ^. f. F$ D( [* O    xchg    dx, es:[41h*4]; ~: |4 q9 X) E4 z
    xchg    bx, es:[41h*4+2]
3 s, n" X: _# Q# d6 k6 g    cmp     cl,al6 z% B' u$ P$ g, }
    jnz     SoftICE_detected
9 ?6 i3 |: n' G  a( \5 j1 S/ [# e) o5 w) {$ t8 @( f2 J
_________________________________________________________________________* z+ G, a: M5 r: S
* ~5 _2 v3 O( D. `0 k
Method 079 }  H& E! C; |7 F' e$ g
=========
' y" u! w8 Q. y  s
8 p+ F* z6 i/ O: N0 I# V, d  r3 H4 FMethod of detection of the WinICE handler in the int68h (V86)
5 V* H* W- L1 B$ j! s& Y
/ k8 y0 d' E$ i    mov     ah,43h
& c" s# G# A8 i    int     68h
3 G9 x8 J! {+ D' X) |7 k9 e/ P    cmp     ax,0F386h2 p: p& O/ U' I) N# u
    jz      SoftICE_Detected
, s5 N, N. ~) M7 G5 ?' g4 |- ^3 f2 o5 [" w4 }) K- c8 L

. W  H( B. m/ U7 M7 H5 L=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit, K. z* X8 j2 p
   app like this:% j4 M8 P' x- Q- b6 o8 D
  y# F2 w9 i' v; \  p
   BPX exec_int if ax==68% u4 Z* V. Y. n1 Z  o
   (function called is located at byte ptr [ebp+1Dh] and client eip is7 c# J4 [4 L+ C( l0 K
   located at [ebp+48h] for 32Bit apps)! Q( T5 W2 R& A9 C) m) w
__________________________________________________________________________
" u9 x; N9 u5 ~4 v% S: w8 @3 S9 I& ]8 o
1 \! j& i. [2 C; N+ t8 t0 V
Method 08
7 Q5 y' i& w6 m) G7 e=========( \# H5 K3 Q+ M/ u

5 |1 }  E( O- U) T0 s& wIt is not a method of detection of SoftICE but a possibility to crash the
$ b/ C; N4 x: H& vsystem by intercepting int 01h and int 03h and redirecting them to another1 E* t: h  }" [
routine.7 K. E2 I$ ~/ G% q* ]
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
2 m+ e; R, Z3 p$ {; R6 Bto the new routine to execute (hangs computer...)2 c( ^# G. E/ I( [* U. ?

6 I& m$ G3 ^) r. S9 l2 d    mov     ah, 25h
' J( P* ^8 f0 ]    mov     al, Int_Number (01h or 03h)
# {" c8 u/ N* g# p6 a, F    mov     dx, offset New_Int_Routine
' ]6 N2 v6 m' Y4 w3 i( Z    int     21h
) k3 b/ y# W% S5 v! F$ X% C
* B% i5 b, F% v) A* M+ Q__________________________________________________________________________
$ l! v% ?" Q% W) @# F9 c/ Y. \) \5 L) t$ v& E/ Y5 N3 O( B0 y
Method 09$ L3 h+ R& _  W3 @- t7 {+ Y+ G
=========
- Z* F. i% X/ x* k
' Z3 _% a% X* f6 tThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only8 h& J! q. b- Q
performed in ring0 (VxD or a ring3 app using the VxdCall).
- |2 M& c2 _: ]" }The Get_DDB service is used to determine whether or not a VxD is installed2 t3 e, g4 j; R# E$ l+ N
for the specified device and returns a Device Description Block (in ecx) for# B' U+ X2 M) `9 Z8 `2 n
that device if it is installed.
5 Q9 p# h9 R1 Z, N( P* w( n6 U8 J, g5 n' M- e! \# G
   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID4 B. g3 O' @5 A. B9 ~% h! u  x4 z
   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
. U2 |2 Z# m- Z6 A1 N6 q   VMMCall Get_DDB4 }/ z3 b/ j' b. K$ i' @
   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed
8 b4 \; q& n) v/ e
: t  S! S# C( O6 M$ Q5 e4 y1 q9 XNote as well that you can easily detect this method with SoftICE:# i0 T3 V' V2 o, k8 @1 b1 V) p; J7 Q
   bpx Get_DDB if ax==0202 || ax==7a5fh: u  P0 V4 X, ?' @: k( O% s+ a
" M; I2 g- I7 L% D' ?5 X( n
__________________________________________________________________________
0 w2 a9 [- {! ~. R. S% ]) g$ o2 E+ m, x, _" Z) ^  G; R5 X& P
Method 105 r! _% g' S* h! K1 o- E
=========+ `/ h. G/ W: q, a/ t& B  f4 c- `
$ d1 ]' A# x) _
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with+ z0 K& t. i  G- A
  SoftICE while the option is enable!!: z* z5 A& P1 E  k* @' D4 c

* V" [: C( p6 B1 f: yThis trick is very efficient:
% [3 v2 o. F  m& f; Q: l* e4 ?7 bby checking the Debug Registers, you can detect if SoftICE is loaded
) s7 p1 Q/ `* d0 Y$ D9 B(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if) z9 H8 ^6 G. ^+ I+ l! Y5 ?) e
there are some memory breakpoints set (dr0 to dr3) simply by reading their
& C& J0 z: G" wvalue (in ring0 only). Values can be manipulated and or changed as well6 J! N5 h6 T9 E! N
(clearing BPMs for instance)
! \" `/ R) T. w7 ]" i! w7 I
7 v5 q0 U! f" t( i4 W  ^) a__________________________________________________________________________( ~0 a9 ^- ?. q/ P% n5 R
% \  e: b; A& l
Method 110 |& f. `* Z7 ^) z! f0 `' e! S
=========
& L* y( Y/ G3 c2 w) I4 X: I# O2 L* K
+ T. [5 Y2 v' w5 d* G4 }8 ?# PThis method is most known as 'MeltICE' because it has been freely distributed1 ?" y8 ~9 K" s) P; c: m* ?+ K
via www.winfiles.com. However it was first used by NuMega people to allow
7 u9 y8 i. e$ Y3 J$ DSymbol Loader to check if SoftICE was active or not (the code is located1 _, K$ F! F  v* j- {
inside nmtrans.dll).
4 z0 t9 c2 }, p6 D6 Z3 n; ]7 a( o  w
The way it works is very simple:( K  d- q1 d* N8 c) _" b
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for! T6 k4 g$ i2 R+ A0 U
WinNT) with the CreateFileA API.$ s* Z9 W+ }/ B# J  Q, \6 q

% ~8 y9 b8 A3 h1 F# W% zHere is a sample (checking for 'SICE'):
! l& s; r( `  B6 X3 h$ ]* n* ~9 ?/ Z" a- W. a. [% {3 v4 M+ C7 D# S
BOOL IsSoftIce95Loaded()
2 s' [  [" `) D1 ]4 F0 u  V{& U3 Q9 i  f% B! s; {$ A/ z7 `* g, g$ T8 D
   HANDLE hFile;  " \1 {' C2 T5 N4 @$ c8 D/ k3 S
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
% \2 W/ K6 F  l, ?0 M                      FILE_SHARE_READ | FILE_SHARE_WRITE,5 k+ V' z0 W1 o9 a
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);6 W* A& @* X2 u; `- N  U
   if( hFile != INVALID_HANDLE_VALUE ): x2 u* N* |/ ^' T: C
   {
4 t; x  Y1 Z) k      CloseHandle(hFile);
6 d- |7 n6 p: D/ C% e% E, `      return TRUE;
7 c: _8 O# j5 j$ m& K# i; u0 w) k   }4 W: O! a. x3 {$ ?+ T) ?, V
   return FALSE;
1 c1 K9 j) B; y( o% Z7 Q& _}
" R: T/ Q! V7 ]- U! ]9 j8 e/ a8 y  a1 r( r" F
Although this trick calls the CreateFileA function, don't even expect to be4 B4 e4 n7 U0 p6 S4 g
able to intercept it by installing a IFS hook: it will not work, no way!
' d) T7 z2 Z0 X. d% I. k; }% HIn fact, after the call to CreateFileA it will get through VWIN32 0x001F# i; c! r; g2 o6 k6 G
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)" K3 \$ d# |% J9 g* ], Z. m
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
, p( u: H" l) c' R0 D& Mfield.4 `% [5 ^. E$ F
In fact, its purpose is not to load/unload VxDs but only to send a 6 Y& j* r& s8 f! ]2 Q& {/ N
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
; i) V- J  C' ~- `, pto the VxD Control_Dispatch proc (how the hell a shareware soft could try; r7 x# y: F4 L6 Q# V6 x2 I: V
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
4 o) v% f- z" E' C1 F% tIf the VxD is loaded, it will always clear eax and the Carry flag to allow0 d  c  M4 z) f3 u( `
its handle to be opened and then, will be detected.
( g" c% c, @/ J" ]& R& k# G# GYou can check that simply by hooking Winice.exe control proc entry point
: _8 R* x' |$ L, Lwhile running MeltICE./ D( s# a& A0 _1 J0 L' V  I, @
# f7 t9 n( \- b" l* S2 }2 r
% c: U1 X3 a+ [7 ?# {
  00401067:  push      00402025    ; \\.\SICE+ h+ L* w) Q5 V, U* h# y9 {# ]
  0040106C:  call      CreateFileA% ?* f1 Z% N" \) }
  00401071:  cmp       eax,-001
7 q- g* d8 I% j% ~  00401074:  je        00401091
/ ?/ n  ?7 U- L& |# r9 k- I3 t/ y, N4 Y5 ~

6 _7 M% x; t9 @5 B, kThere could be hundreds of BPX you could use to detect this trick.
/ S2 s8 O* L3 q) M0 x7 V5 J-The most classical one is:
5 d: v! F4 t7 L- v8 L  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
. A, e7 M, {0 h+ d6 g0 a    *(esp-&gt;4+4)=='NTIC'
$ c0 u7 P( P2 [7 D8 N  J+ ~3 n3 P9 }, P- M! B
-The most exotic ones (could be very slooooow :-(" L- x2 r% Y$ r* S. V: H# n  e
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  
# D3 o* f- M3 C0 b1 P     ;will break 3 times :-(9 @7 X6 h* Q% \6 D8 d/ t
( H: Q6 z+ c2 `; S
-or (a bit) faster:
1 |; N1 B4 S: `# x   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')* O& M8 K. h2 L1 i: f

  ~6 d8 O7 P/ n- p2 Q   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  : p  r! f0 a& R! f) i. d
     ;will break 3 times :-(
" I2 L6 k4 s1 ~0 C3 I9 l
, O/ w. p& D* ?5 C* D& h! z( l1 [" X-Much faster:
6 Y( W( v* J" d1 {0 ]   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'
- I, x8 Q& g# G2 R! Y5 o3 i  `" a) Y6 ?+ c
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
% W0 B! ^$ S5 U# D1 S& Jfunction to do the same job:: L& u( ]" O3 F* T4 a- d
2 h" q2 ]6 L2 k% ^, c
   push    00                        ; OF_READ3 H( u  L2 @6 M% b! D8 l9 n$ y  r
   mov     eax,[00656634]            ; '\\.\SICE',0
3 g0 R5 F) z# Q& i$ K! p5 f4 Z4 j   push    eax- ?/ D' q! A5 y' _
   call    KERNEL32!_lopen
: p+ t4 P. r/ \' ~  Q" s   inc     eax1 q3 B( r, }4 s0 a) h0 \- f  h
   jnz     00650589                  ; detected2 O2 y8 M  D& @. j& I6 f; ]+ v8 \
   push    00                        ; OF_READ0 g& W( D# e9 \$ Y, M% M9 L* A
   mov     eax,[00656638]            ; '\\.\SICE'
- ?( U* l* }& y7 f, o5 M   push    eax
  e& I( |0 b2 @   call    KERNEL32!_lopen
& S: n7 Q* R& Y' A7 O   inc     eax
& x0 ?1 d3 E5 j2 S, @3 m   jz      006505ae                  ; not detected
6 e1 G' g- k& }" l( a. @- t# r
1 ^! y" y1 w  u1 k8 r! S% z, _- j$ w7 {& H; O% ~
__________________________________________________________________________' F0 T& G  e2 `9 h5 v- E

6 u# a+ h1 z7 p1 t: i# rMethod 12! K. l( D7 M- n: \
=========, n% t, c: J4 i/ Z2 L

; Z4 I, O  R: ^3 \+ L& T- [* ?4 c0 ~This trick is similar to int41h/4fh Debugger installation check (code 05
' p7 ?! n1 q) q5 d! K&amp; 06) but very limited because it's only available for Win95/98 (not NT)6 H2 @9 C2 G4 y8 D8 i# ~) R; l
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.+ N& Q: s+ b; Z  Y

$ ^4 v2 S+ }/ b/ M$ v  ?/ ~: K   push  0000004fh         ; function 4fh5 E  f# I9 g$ Y
   push  002a002ah         ; high word specifies which VxD (VWIN32)
3 }) f0 M' f4 z# g1 o, y' K                           ; low word specifies which service* M$ f* w0 B1 b, ?" e  i- l
                             (VWIN32_Int41Dispatch)
0 M$ J6 |0 O1 G! G7 {   call  Kernel32!ORD_001  ; VxdCall
: }' Y! H5 i4 V9 k   cmp   ax, 0f386h        ; magic number returned by system debuggers! ~3 V2 L& b6 i9 C7 Z
   jz    SoftICE_detected! X5 f9 B3 p" \& B0 j

+ y2 J1 h9 G# [6 k8 y# e- KHere again, several ways to detect it:  o* _. k3 K+ q" T% Q. P4 u

4 ?/ l/ B, q% u5 s7 T" Z  E    BPINT 41 if ax==4f
! c  V6 ?1 x5 S: d4 W9 C: t* [0 p8 z# Z4 ~$ C& }& H- K$ v7 R
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one
! `  `8 K" v. t$ o1 ]! J( _/ b4 a" R0 {+ e) K: d
    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A/ E" f# D; Q# |, |5 `# j6 Y
$ h' s! c/ u- s& z) n
    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!
2 i- l) C: _8 R* K3 S% v: M' A7 `+ }; o
__________________________________________________________________________
8 r' H1 f. F8 Q. W6 L: n
- S! o7 Z1 r1 d7 B8 F. c  F+ c1 w$ kMethod 13
0 p, S0 v7 G% G8 K5 z+ x=========
* U2 T1 V- S* q, W& V5 E. F
7 [" ]1 E# r9 n, zNot a real method of detection, but a good way to know if SoftICE is
5 t' u% q2 I( X3 s' T0 ^0 U% [( einstalled on a computer and to locate its installation directory.
9 [! A3 Z+ ^8 I' N* B  h& O" qIt is used by few softs which access the following registry keys (usually #2) :* `: s  S- d3 z& K, ~( }4 l
0 R7 ~" z; q& S0 d; d3 w' B! x# K
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion: C: \& Y: V$ K2 Z  \5 `5 F3 r
\Uninstall\SoftICE2 I9 j3 ^! G$ l6 D1 L) F
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
" [, ]1 b6 e. m8 k7 M-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion6 ?, g" V% i  `+ }' {" n
\App Paths\Loader32.Exe
: f: `: x6 X' n& P
( ]. y# \8 ^5 e
( D/ C5 _6 D& }6 w8 H8 e( o& vNote that some nasty apps could then erase all files from SoftICE directory
8 n- P. L) k- J  o% y(I faced that once :-(
( D& I5 G- B" k- t( I" K
6 T, o% V5 R- S  h) Y! kUseful breakpoint to detect it:
2 Q& a/ Q" d4 A( V( {
% s1 q7 ~) S, \* X4 L' Y     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'$ l! ~; g' D; p6 U+ V. f* e% v
  U+ m) w9 `; ?& R+ h
__________________________________________________________________________' B/ S3 x% G; F- Q
7 X; C0 a: Y5 p( R2 T- a9 L8 {+ o  b" W

% k( Q4 W) B% J$ x3 V8 ]Method 14
/ Y, M( u5 }6 Z=========2 {2 n5 H! f! Q- a2 R  s

$ T: _! q1 g' H  G2 {( E: O1 ~A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose8 i7 ^  v& k/ ?
is to determines whether a debugger is running on your system (ring0 only).
* }7 s' B+ O. ^- p
. l, j9 U* K3 c# p4 c- X" A   VMMCall Test_Debug_Installed9 J- @4 ?; I! C, J. \
   je      not_installed
! O! g9 ?" K# [, S# _/ o% j
  l5 D" B" ?& g! E5 b& ?This service just checks a flag.
1 |" u& ?# S1 U</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-8-6 03:55

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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