找回密码
 注册

QQ登录

只需一步,快速开始

About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
) E/ v6 o* ]: i7 t/ v* o* w<TBODY>
( P6 |7 Q- a& |6 i! ~4 J<TR>' p5 g- J7 Q0 j: L' X; L8 S
<TD><PRE>Method 01 0 I8 D& b( u" d5 X1 @/ m- D
=========
: m# Z, l# f: t: S. U' Z: J! u/ Q+ K4 c# _2 p, `! I9 }  \" Q, E5 G
This method of detection of SoftICE (as well as the following one) is! r7 `/ ?+ W  q2 m+ J+ x
used by the majority of packers/encryptors found on Internet.
  U6 f/ ]. w- f! o2 m% ?It seeks the signature of BoundsChecker in SoftICE. k' l/ ], Y' h( h/ W  C

; e/ r6 U9 l/ W* o5 H8 d7 A0 b$ E    mov     ebp, 04243484Bh        ; 'BCHK'
  T$ v- k6 W& o, l# ]. X    mov     ax, 04h( H, R- h) ?5 o; ?9 |
    int     3      
* S+ N4 y) M$ k4 R0 ~9 R. I    cmp     al,4( b, i- {1 }6 P3 q: u
    jnz     SoftICE_Detected
4 ^0 h2 h4 I9 I4 h7 t( q2 h3 z! S  c! J% E/ @" I1 M: j. l1 ^
___________________________________________________________________________* b& Y  b8 e, Z# }, W
: O4 \4 i+ E$ ~- x+ j
Method 029 l6 V4 k) `! b: X$ r
=========, ~1 o; X% ?  z1 n3 M! G

2 h0 R2 `) b. T7 R; L* yStill a method very much used (perhaps the most frequent one).  It is used' \! ~3 |' E6 ]) @* [
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,+ C; Y3 o9 t) _- L; r
or execute SoftICE commands...
# ~% c) E% U' }* Z* D) CIt is also used to crash SoftICE and to force it to execute any commands$ u/ R! ?4 D/ L! n0 G1 t
(HBOOT...) :-((  2 m8 \& F7 t0 W: u6 K2 a

1 H" r% Y/ g' FHere is a quick description:
3 H  S, z. ~8 y1 r2 p* O+ M; c! k-AX = 0910h   (Display string in SIce windows)
* s8 K3 C# K" a* t) o% F-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)% g' x7 ]/ h. ?" R) k  T
-AX = 0912h   (Get breakpoint infos)" S4 g: D5 v$ E: L7 m7 C2 Y
-AX = 0913h   (Set Sice breakpoints): z* h3 D- d( X3 a# G
-AX = 0914h   (Remove SIce breakoints)2 [4 _' C) r+ G/ P8 M1 P
8 v, N1 L; p- H
Each time you'll meet this trick, you'll see:1 T+ O+ ^/ E7 t1 u2 ^/ A
-SI = 4647h
* C8 |/ a6 `& ?: ]( X+ D, y' o2 v+ V-DI = 4A4Dh
+ F$ x- R2 H* e5 V3 jWhich are the 'magic values' used by SoftIce.
8 G( t  [; e3 Q  A' XFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.' D9 B$ k4 f- _: t

' c, k1 d. q; l5 wHere is one example from the file "Haspinst.exe" which is the dongle HASP
# j. m# ~, @! K; Q& i+ pEnvelope utility use to protect DOS applications:
+ v1 k" _( p, A  R& |
; G& o1 s) w0 E1 N6 s) @9 }
9 u: F( n& T8 }4C19:0095   MOV    AX,0911  ; execute command.
% y. s' x* F  a# H' }$ d, M  v0 ?4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
7 O' Z( c9 O3 J4C19:009A   MOV    SI,4647  ; 1st magic value.  n2 V( ]8 N+ H: U5 B+ T- K) B
4C19:009D   MOV    DI,4A4D  ; 2nd magic value.
, H" O( S' w# X# Z2 v8 o4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
6 A- d: @4 y) n- X" x$ b4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute5 T& R2 H0 O2 l
4C19:00A4   INC    CX
+ \3 L8 t' v* c2 X4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute
/ U3 C( X% G" H3 m4C19:00A8   JB     0095     ; 6 different commands.
7 @% I/ K; x6 _) F2 [$ O1 v1 W, c; O4C19:00AA   JMP    0002     ; Bad_Guy jmp back.7 p+ c. m1 D& l, R
4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)
3 U% f+ o: c; S4 P" Z
7 w0 |3 A) G7 L8 gThe program will execute 6 different SIce commands located at ds:dx, which
5 g( v( _) g' ?6 |1 |" qare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.6 w$ u" D( Q& d* Y9 x) z/ p9 G

& b0 Z, x3 A2 y% T' x* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded./ @* U4 g) K+ z
___________________________________________________________________________3 y' f) I2 F  d4 y
  A2 c, L5 Z: {8 Y2 H8 L
* S! b+ g' [, d! a' ^" f0 u$ y
Method 03; J- h  O+ N- Y% D# k* e; u
=========; u9 e: s: Q% k% s

, @5 `/ {% {% t8 p9 F) gLess used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
) l( c, S) O# s+ l! D(API Get entry point)3 N# F  I# Z' S- A% H8 V, y+ N
        % z! N8 Z1 ?9 l: @3 @

, Q( L9 D/ \, n3 Z0 O1 T. e  N    xor     di,di. @$ R; o# L2 ~$ V- I6 k
    mov     es,di8 ?+ `8 ]" ]9 I$ ?. v
    mov     ax, 1684h      
% N/ {" Y5 M7 \; C  r    mov     bx, 0202h       ; VxD ID of winice. [4 s: t) E! }$ \: V' k
    int     2Fh
# D6 \. P, `9 \5 \    mov     ax, es          ; ES:DI -&gt; VxD API entry point
: ?/ ]' r* `; X- O: D& n1 B7 d/ n    add     ax, di5 f6 I( @3 |: H$ m2 {) J" n
    test    ax,ax, H3 C5 }$ g- @5 b, E1 U! T* ~
    jnz     SoftICE_Detected
6 C9 g3 y, {0 L! h5 i4 H) Z3 f0 M9 I- U
___________________________________________________________________________
5 j# O% F, c7 l4 ]# j9 ]8 A$ n& E1 O5 S; E& B9 @/ a5 `
Method 04
0 ^2 ^# {" J! _# H=========9 F2 I% @, h! L/ t8 w* f4 K

2 t' R( `  U3 A" s- \! p6 SMethod identical to the preceding one except that it seeks the ID of SoftICE
/ F% e9 t- G$ P9 C/ HGFX VxD.9 v9 ]- ]) T. q" s5 ?9 R

' n" ?/ l$ W4 r* c; f, X    xor     di,di
8 n+ K8 u( M6 Y7 m+ u    mov     es,di
1 @( N0 }$ f8 ?0 b, B$ k6 M9 K    mov     ax, 1684h       9 y+ P3 z5 F$ D$ ^) y
    mov     bx, 7a5Fh       ; VxD ID of SIWVID
0 O) j1 `4 q1 g) c+ w1 U, H    int     2fh
( t) h5 F* {  T& ?) Q    mov     ax, es          ; ES:DI -&gt; VxD API entry point& w8 C) U5 L2 @1 |  ]6 M3 n- ]0 P
    add     ax, di( m0 v& e( d1 N; ?/ V7 E1 f% J) i
    test    ax,ax
' y! f5 B' |; x2 U  f8 \5 T    jnz     SoftICE_Detected( `# d4 Y% T  p  P& x) t

% [7 v& L) @: N6 ~5 }  J5 E__________________________________________________________________________+ \% b) P4 H8 X
' B3 M$ c7 N/ s6 ^, {( X0 _( P( e

5 n' B2 }/ x6 [! V- i8 b* w- rMethod 05
( _7 \! f4 j. x; w=========( ~; c, t4 q1 ~3 w
. ~) y& G" T% Q. C  t' ]/ D8 j
Method seeking the 'magic number' 0F386h returned (in ax) by all system3 T8 C, L0 Y. t$ c+ e6 _% w
debugger. It calls the int 41h, function 4Fh.
5 u$ J4 _  s4 J, \" q$ o/ i- wThere are several alternatives.  
' Z. o; Z8 Y4 D: z  C$ [  U' i. j+ e9 _& Y0 X/ m  a. L
The following one is the simplest:/ b1 y6 S% v* q

7 j+ N' }, V% L    mov     ax,4fh) n; g1 s. _- L: q
    int     41h
& ^5 k( `3 T/ w* s) L: Y    cmp     ax, 0F386
- h) A- ~# X0 ^2 ^4 V    jz      SoftICE_detected+ f/ M7 Z" G. {* \7 o6 {0 U* }

* _! h5 C; h, Q7 m! m, X* i! d5 Q  ^- ]9 L6 ]# h. A9 ^! v: N/ z
Next method as well as the following one are 2 examples from Stone's
/ s) d; _% p4 o$ W$ r"stn-wid.zip" (www.cracking.net):4 ]1 N2 t6 Y/ G7 W( |5 g

3 U. q$ v0 X9 {( z# p6 ]4 m    mov     bx, cs0 F0 }! }% |& e& U, h2 v
    lea     dx, int41handler2
$ C6 [! }8 @/ K/ _* F& ]    xchg    dx, es:[41h*4]
* X0 Z* V6 G* a    xchg    bx, es:[41h*4+2]9 y( d* o7 D" j3 @) X; q  z
    mov     ax,4fh; w2 q1 M6 L6 Y" |9 e" Y
    int     41h
3 M. D# Q6 X+ e9 U" m4 I* \4 ^3 d    xchg    dx, es:[41h*4]4 P6 N' M! d- V% ~" V1 [  S
    xchg    bx, es:[41h*4+2]
% `  A1 ]3 g: c6 q- V    cmp     ax, 0f386h/ ?' ?+ t& Q% H) {4 ^
    jz      SoftICE_detected
) j" `, q( E: c5 E4 W" J) J( [% n, L3 n0 i9 P' k
int41handler2 PROC
" c" R6 S0 j; f, i* U4 C2 z8 {! R, ]    iret
. p' c0 g6 k% h3 I- ?int41handler2 ENDP
, }, v  F& B( Q; Q3 F% O% p
) `6 j" Z; d# p( N1 [! g2 Q
2 l: w: Q0 [( m# e8 [_________________________________________________________________________
6 a: x0 X0 {: _* y/ F8 E% ]$ f
% n6 m7 a; k0 Q# `3 V7 S/ n8 E# m" @4 Z/ v$ K6 h" K
Method 06) `. A9 @. r4 R' s0 j2 N: X, {
=========
0 H' M$ d! U4 |0 ?% ~3 I# Q1 R- t: s, T1 I0 `- }; G) ?! K

+ i) y! d, F0 f% ~3 g# }. t2nd method similar to the preceding one but more difficult to detect:* o+ r. t6 g# p1 k! v8 S3 S! ^- j2 l; f
& h$ i& F) |! }2 q' W; G
1 W3 O+ F) V. H0 [% i' U$ G
int41handler PROC
* S( n4 \3 B/ m) J6 H9 Q    mov     cl,al
5 |; A$ b. X5 I; q4 P$ I8 D4 ]3 n    iret
1 S" ?1 B- u) e! T+ W& Aint41handler ENDP
" W9 h2 O( ~; d8 a% G3 G' D6 t; x% ]& h) s7 ]
- U, x1 w' B) l1 s4 o3 Z7 Q( P
    xor     ax,ax. s( U6 t" ~! a4 A
    mov     es,ax7 R5 j1 y0 ]* k1 W0 u/ y1 b0 J
    mov     bx, cs
8 E  w# F, B/ g, d$ T; ?8 R6 q    lea     dx, int41handler9 Q4 F+ s; Y  k5 W3 p" _, J
    xchg    dx, es:[41h*4]( h$ J* P& n5 T
    xchg    bx, es:[41h*4+2]- Z- F6 C; M% y; @+ d- d: b# B
    in      al, 40h3 r  V, O; ^4 ?8 q
    xor     cx,cx
7 W. P. M+ D" q( ?; u    int     41h% l0 l) U  K7 V, y, g# R4 P
    xchg    dx, es:[41h*4]
5 n: ?8 [" S% w5 s( T    xchg    bx, es:[41h*4+2]
! |: d/ I; e  S7 @% V5 [3 C$ [    cmp     cl,al
( l4 Z/ d- h3 i3 d    jnz     SoftICE_detected3 y; u7 ~* @3 ^

1 p( E# c: F4 t6 M3 n5 M& {/ z2 p_________________________________________________________________________$ H' H& K$ r# l/ z
7 y' [! d# M* G8 V+ c
Method 07
& N9 O  n' w1 i% n/ }$ o=========! W' b6 `+ R5 X$ Y% M! E
8 G! q! p- K# P3 w6 F
Method of detection of the WinICE handler in the int68h (V86)
0 j9 U8 j" ^$ @6 J- w& f# p
0 P  f$ C) |9 F4 m% P1 p    mov     ah,43h
+ I+ U% E, Y) O3 k7 p- y& g    int     68h
0 R: G8 q" J2 S9 F4 K  D+ H/ a9 ^    cmp     ax,0F386h: U8 p9 w8 c+ _
    jz      SoftICE_Detected
$ E7 k0 U& `% U6 p! R9 d
0 J- J0 t( K2 D# X( w2 v$ ^. V6 ^6 x9 Q
& J, H: m: u6 V2 w& v/ l4 @0 i=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
8 z8 h' u/ Q: y/ y; x: u+ F" O0 t   app like this:2 L  O4 K. o$ i4 m5 [
+ i+ J# j5 @/ X. j
   BPX exec_int if ax==68
# P: [& b' k8 a9 R0 ?+ d# ]   (function called is located at byte ptr [ebp+1Dh] and client eip is
& L8 l( b2 m" L   located at [ebp+48h] for 32Bit apps)/ H  ]& }' G' c
__________________________________________________________________________) M& R5 _7 h2 D4 Q  a+ S. d) {# M
& P- j$ E& t0 U

1 {: L! p+ q1 h+ ]7 @: xMethod 08
; p( _5 F. l# m% `=========
& l4 N' n* b0 K4 W  M5 P; |( f: r. M& h8 F  i7 q* ?) R
It is not a method of detection of SoftICE but a possibility to crash the
/ m5 a4 {; T% D+ Y0 T# t  N5 wsystem by intercepting int 01h and int 03h and redirecting them to another+ F' Y3 I, u3 C* P+ B' g
routine.
! F: T8 r( l' i4 W8 H) VIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points+ x( V$ ?' f! p3 c" R! y8 c
to the new routine to execute (hangs computer...). u) p3 h" P) K& p) b

  _& j. P; h1 r( G) l2 x, d! C6 x' l    mov     ah, 25h
4 W- H/ O0 f  ^5 o    mov     al, Int_Number (01h or 03h)
/ X' y5 Q7 @+ m    mov     dx, offset New_Int_Routine& j6 x) w% C0 H0 ]
    int     21h8 H. y$ u1 ]1 n  q- e* C5 j; l5 }

' Y: ?: G$ A$ w__________________________________________________________________________$ d. u# ^  U# S4 Y; B- b/ U/ f& _
5 }' x- e+ P$ Q$ m  C' d
Method 09
. F. G$ M) B8 P" z" B=========
5 e) W6 _# T% }
  V/ u4 L4 n3 U+ F8 R2 MThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only* M4 }  T; S- H9 d# o. k- F# l
performed in ring0 (VxD or a ring3 app using the VxdCall).1 o$ F5 s5 d7 j
The Get_DDB service is used to determine whether or not a VxD is installed! `) }8 z  y7 a- s2 o
for the specified device and returns a Device Description Block (in ecx) for
# _( g& t, \# i: ?& O5 u& Wthat device if it is installed., _2 @* G% R/ b4 o: N  e# d

& a; o9 w3 ?, R7 V( l4 B4 w   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID& v  K2 q) C8 {" J' O
   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)( F  S" h4 E4 |% t/ Y
   VMMCall Get_DDB# U' N( p$ x+ [
   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed
& A: ]8 s1 Z) h  y7 O# s
& J+ e- X; f0 w# D$ O$ _2 cNote as well that you can easily detect this method with SoftICE:
# w2 O" l: V3 q' Q   bpx Get_DDB if ax==0202 || ax==7a5fh
5 q$ ]" D" X( N( L, u% r- ]/ J  J  O; d, S6 V9 C
__________________________________________________________________________$ t# c' r! y: R6 Y2 I
5 L  T9 a2 P6 d- U  v# x- q, z1 S
Method 10
8 G8 N" W) _" `: U2 u" s& g9 s=========
9 t# I4 ^& x  K1 q, d2 _' [7 R$ \. [
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with. H/ a1 ~% K( ~* F* s2 a- z* \
  SoftICE while the option is enable!!7 [8 e2 A: C3 r7 z" D# s+ x
0 D& z' B, Q$ p* e
This trick is very efficient:
% I6 @# R) a& S. ~2 F) C" x% xby checking the Debug Registers, you can detect if SoftICE is loaded9 F, l& F4 R* M- }
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
6 ?+ b9 h  |: r' J8 A% {$ [( `6 N$ kthere are some memory breakpoints set (dr0 to dr3) simply by reading their
" U! P7 a% P4 n  T- nvalue (in ring0 only). Values can be manipulated and or changed as well- b( \  ~7 A, k0 e  n
(clearing BPMs for instance)
! N( ]( U9 h6 t: l- N6 Z' k( P. t9 _
. G* U1 S5 g/ ~5 w( h__________________________________________________________________________( h/ Y: \+ Z' O% z3 p  ]
( F0 L$ M" |/ s, L: P9 i) ?6 H
Method 114 y/ A% R% E+ X) @! k
=========0 Q0 F4 Z; P, e: a( m0 ]8 y

  F1 o& R# |; d. z" P1 f& @: uThis method is most known as 'MeltICE' because it has been freely distributed
. L1 m4 q0 C6 {% ~' F. q/ ?via www.winfiles.com. However it was first used by NuMega people to allow) `" I2 s  Q' h8 m8 w& k6 E  \
Symbol Loader to check if SoftICE was active or not (the code is located
- ~  i! ~) F1 d! c, rinside nmtrans.dll)./ x- Z6 q1 @& J, n- q# V9 W1 F
5 M# {' C8 {& ^7 a* a$ i
The way it works is very simple:3 n4 z0 J3 _' {  @
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for( v  D2 L9 Y$ m- Y. E2 L1 G* T
WinNT) with the CreateFileA API.
5 [. ^; y9 M8 I
. A% [$ P" t9 ~  UHere is a sample (checking for 'SICE'):
* x9 E* D# o- c3 |# N! N
, C0 {+ M! f. w6 w9 q2 fBOOL IsSoftIce95Loaded(), J0 c. W2 `& v3 [7 C. D1 `
{" {1 V3 ^" |3 q" h1 R: Q: c( I" E, o
   HANDLE hFile;  
0 S+ [2 L; `: g   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,- b2 e6 p* Z. w
                      FILE_SHARE_READ | FILE_SHARE_WRITE,% K" r2 e1 g* m( b; e7 U
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);5 L8 {+ `1 k7 }4 F2 V  T/ S
   if( hFile != INVALID_HANDLE_VALUE )
- I# ~/ o7 j8 _/ j( \   {' {: n6 u; h9 b- p" z  q3 n8 y+ v) b
      CloseHandle(hFile);, E' e- X- a/ f1 K, z" ^
      return TRUE;: C2 i" u! Q: E4 m3 j4 e
   }
; n6 c/ P  u: i& |7 Y, v+ e' Q   return FALSE;
+ j1 f2 c  O) v7 n( p}
% g. e$ q3 D  k- e+ R
; }, U/ X* D6 G9 t# JAlthough this trick calls the CreateFileA function, don't even expect to be
0 h2 I  k6 N/ p- Q5 u9 p" Z/ s  O1 ]able to intercept it by installing a IFS hook: it will not work, no way!! e7 x0 \& _( g" W5 j& Z8 N
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
' l6 F2 q7 d( Z& d1 ?service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
! {5 ]9 h& h. X- @5 jand then browse the DDB list until it find the VxD and its DDB_Control_Proc
& u. [' v/ w2 x5 y2 q) _0 ]field.! _& ^# g0 k1 J" Y& |% i
In fact, its purpose is not to load/unload VxDs but only to send a ' M0 ?; o9 T$ c
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)) T6 a6 Y, k3 i
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
! \( k. p+ h  g  {2 V1 kto load/unload a non-dynamically loadable driver such as SoftICE ;-).
, K. K) D5 W3 o1 V  sIf the VxD is loaded, it will always clear eax and the Carry flag to allow5 l) I  W2 X1 f- J1 x" [2 e' _
its handle to be opened and then, will be detected.
# N0 ^! t0 g3 E9 e1 m/ |& X# wYou can check that simply by hooking Winice.exe control proc entry point: `* \7 f' Z' |' q
while running MeltICE.; m8 t7 e0 |9 e; U

% H- a1 M7 I7 v, G+ Z! r6 N7 F6 @/ j" r+ n9 S4 j" x3 P; Y. b
  00401067:  push      00402025    ; \\.\SICE
6 u8 w  f4 F* v4 q  _, A  0040106C:  call      CreateFileA8 }. a1 w9 {/ e8 O
  00401071:  cmp       eax,-001
7 [; o8 M1 t; U  00401074:  je        00401091/ p, w& y( R7 g, O4 c' i( l' Y% z) k- B
' [8 }4 S- {% h5 s! L: L  a( D

* @+ }2 n+ @* {# x& z: J. E9 EThere could be hundreds of BPX you could use to detect this trick.8 g( z& M9 `  i
-The most classical one is:, k  w9 @% k; h0 ~3 p6 F& P
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
' K0 S/ k6 {3 O( y. R    *(esp-&gt;4+4)=='NTIC'. O6 o. P0 D* [" \

8 ~0 k* J2 D; k0 e" i% M: Y$ E-The most exotic ones (could be very slooooow :-(. @- r2 T8 v, ?3 d) M
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  4 F3 |: v. \: k
     ;will break 3 times :-(
3 w4 p8 T: u) ~7 t. d  |- Q4 \+ Q$ ^- G: X$ j) L( Q
-or (a bit) faster: " t* T( }! D# k) |
   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
1 {, \7 n! Z% `$ ~8 E. a- f% Y+ I: D' a  t0 @
   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  ) r  [# ^# C2 k" U
     ;will break 3 times :-(
) |6 |9 L7 G  ]) A4 O$ J2 c& |) K
  T" X1 y/ N( K2 I  E-Much faster:9 ~; I% i7 f: v! k4 D: P
   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'% Z: R. q% M/ D/ i9 D' R; @
9 q8 @4 R: @/ E* v
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
8 p0 H& m8 d( Rfunction to do the same job:
# K7 Y$ i. D2 L: |# N8 K  h; [
) C* p5 n6 `7 K6 m4 [: O- S. `# Y( L   push    00                        ; OF_READ
# j; L) n/ m1 d% o5 q" O1 h2 X' F+ a   mov     eax,[00656634]            ; '\\.\SICE',0
* O7 b6 k4 u7 k; `6 w: D, }   push    eax
3 \& M  k5 D! B: w5 c   call    KERNEL32!_lopen# w6 o8 B/ N0 h; P: V  ^  k4 E
   inc     eax
" p/ t; }, u  D6 b& }* s; g. K   jnz     00650589                  ; detected
4 z0 T  g4 V; E& I- j8 w2 W: ~' [   push    00                        ; OF_READ  I! ~1 e4 m; \1 H
   mov     eax,[00656638]            ; '\\.\SICE'
" g* p5 ?/ |' x# I   push    eax5 g0 T' ^. D) s- `$ C
   call    KERNEL32!_lopen
% e+ k3 U, k- L% {. C   inc     eax6 M: b! P& q7 n. X% O, Y
   jz      006505ae                  ; not detected
3 W9 \* A, V" ^5 {% q# t% F; ^0 c$ o* i& w6 u* S

& x7 }* ?: W3 f. m0 g3 k__________________________________________________________________________8 x( S2 A/ ~- M7 T2 W

$ U/ U# c% {4 G: w5 t, ^% v5 cMethod 12
) Z  W. ?' l) z/ x=========; N. T$ X. y4 d6 m

+ T: k: t+ W5 [This trick is similar to int41h/4fh Debugger installation check (code 058 V" ~+ Q, n# R
&amp; 06) but very limited because it's only available for Win95/98 (not NT)
2 ?7 L+ u  y! Z' cas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
; k$ q6 M4 F& y9 n5 m) ^9 S$ f/ o" A% c0 |6 ?" t
   push  0000004fh         ; function 4fh* `1 b) |6 k3 h
   push  002a002ah         ; high word specifies which VxD (VWIN32)
" I4 M$ v# f3 y& x7 M5 g                           ; low word specifies which service2 e1 @& ?' f( G! @2 k6 \. I
                             (VWIN32_Int41Dispatch)8 d3 ]0 r, h1 [. T$ P
   call  Kernel32!ORD_001  ; VxdCall2 }7 Q, ^9 `; M) @2 J$ B5 u
   cmp   ax, 0f386h        ; magic number returned by system debuggers: Q* P, Y+ T* V/ `) m( E$ I
   jz    SoftICE_detected
; b( R& O& z, e) e( v8 c0 H5 i0 T/ K% R! v' M. J
Here again, several ways to detect it:' I6 C* x- V$ r% b) p2 I* H8 h
- _: t% x! e0 s0 k
    BPINT 41 if ax==4f2 G8 I/ f) L/ i2 l8 L; G

5 d& |% g& ?3 L6 Y- n, w1 ~" Y    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one
' L; m; a1 u3 O
* k3 T, ^2 ]9 p! K: D7 I( A    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
: X% V" o& a7 L8 n) U. L3 U- ]/ Y1 @/ w
    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!
3 j- {& f% U: W0 e, @
# {/ @; b2 T. o+ a# z. }8 I__________________________________________________________________________
* e) o0 z! M/ |$ F9 N1 L+ i2 t2 J+ Y7 Z9 ~. P
Method 139 x* C' C$ \* Y' U8 B7 v
=========
: c0 F3 d* V' b3 ^
$ S: j) Y& X" ^) _/ z2 @: cNot a real method of detection, but a good way to know if SoftICE is
8 v2 R& ?5 D0 [installed on a computer and to locate its installation directory.
- P' W+ e* y1 K/ V3 {- y" y  \+ L1 JIt is used by few softs which access the following registry keys (usually #2) :
* T1 ~) a  _$ U) a: S( [0 k
( h5 W/ b- _% \1 ?' E1 t-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
* s  H$ C2 k5 O4 g5 S\Uninstall\SoftICE& J0 ~) }: E$ g) A% T7 E+ _
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE$ h- \7 C+ ~  c
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion) i# w' @9 n/ a  H5 b6 f
\App Paths\Loader32.Exe
/ J  m/ s1 A2 i- v6 k$ v7 k. N
# [$ L4 R8 t+ I& r1 }! o
$ i& `% p+ {" h" M* HNote that some nasty apps could then erase all files from SoftICE directory- U+ n3 g) w$ D+ o
(I faced that once :-(
9 P' a, |  ?7 u/ r, ^: g  u$ U$ ?* a, _- _; a5 p, p
Useful breakpoint to detect it:
" m+ N2 `( Q0 K2 m0 G5 {2 K* ~5 H& ^' F( l$ T4 C+ s
     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
6 J& g; i. D. P! l3 r, Y1 ]
  {4 I+ H. _9 y__________________________________________________________________________
  o* l, R8 G/ P0 i% [: {
/ W8 C9 p1 f# b- F/ f- A
$ ~7 K; o# ^1 F4 n; e+ tMethod 14 * R4 X( v6 [' I0 b$ s
=========
. v* f5 r% _" H; Q# n  m4 a. }
) n8 R) R9 L" a9 j/ u# lA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose) V! `+ ~2 }0 u0 g% a" `
is to determines whether a debugger is running on your system (ring0 only).
$ h) O1 ^/ n) I( C! ~2 ]
* J5 b) z8 n9 @   VMMCall Test_Debug_Installed- K3 F( r1 A2 M
   je      not_installed
9 B8 C8 v& V# b4 k& |( U2 G: u# Q; C6 N& e
This service just checks a flag.4 R) D7 A( U8 i5 g
</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-8-16 09:04

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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