About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
# R: U& i1 e( c$ ?7 j. E<TBODY>7 _& z+ }! L. e: |1 E2 D
<TR># a% J! E8 R- @6 D' O5 A4 G) c
<TD><PRE>Method 01 0 C. g; O$ l6 m* f" j* d
=========
1 r" E" b- V0 |% R, C% z# n  R8 o( O6 k  ~7 H
This method of detection of SoftICE (as well as the following one) is
$ D* ]4 e; v% I3 w% @( xused by the majority of packers/encryptors found on Internet.7 r9 L5 d7 F+ F1 k& F8 b- D" K
It seeks the signature of BoundsChecker in SoftICE
; ^2 B. x3 H& X, Q7 P9 L. ~% A, k" P' U7 _; u3 s3 E
    mov     ebp, 04243484Bh        ; 'BCHK'2 R% B0 S4 G0 M  }6 p
    mov     ax, 04h5 g- X9 p* Z+ H- q; h$ ~5 T
    int     3      
' \$ a1 j( F( z0 E- t1 N    cmp     al,4: @5 B5 |  `+ ?* A" H
    jnz     SoftICE_Detected/ v# I$ r  n6 D) `1 x- j* N" V

3 N& ~5 W" [8 O) d) q3 Z5 U2 l___________________________________________________________________________
! [) T- J/ v3 P5 h: y1 ~) N, M. d- n4 S/ `) ]- Q% ~/ L) ^
Method 02" P8 R9 w3 G) ^2 o
=========
& M, }& ~9 R: k/ d- `" ~7 C2 r0 @3 b; m
Still a method very much used (perhaps the most frequent one).  It is used; a# m" L/ r3 I- c
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,- R/ x- Y: g" r% W0 r  U; h, ]
or execute SoftICE commands...5 I8 C; \  |; |4 x
It is also used to crash SoftICE and to force it to execute any commands
# q; f& g- @" c7 s3 G(HBOOT...) :-((  
$ t" S0 D, q$ J% }6 W/ a% \( b1 t% J
Here is a quick description:
1 n, U# W6 x0 @* B; ]-AX = 0910h   (Display string in SIce windows)
% t- _1 K6 ]; n-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx); U; D; F: h. a. D% w8 L/ h0 W" Y& ]
-AX = 0912h   (Get breakpoint infos)  \, J" i: X2 H8 n2 ~$ {, K7 E+ D& B
-AX = 0913h   (Set Sice breakpoints)& j% T$ P: {" f6 o
-AX = 0914h   (Remove SIce breakoints)& c/ _5 M8 C/ g' Z* N1 H% m2 X
4 B) D2 s9 m* E. h/ @
Each time you'll meet this trick, you'll see:
" c2 l1 \3 Y$ G9 B8 [4 Q-SI = 4647h/ X1 ?/ P4 p  S8 p* F* x. ^4 e5 T/ Z
-DI = 4A4Dh
: |5 v" o" O, sWhich are the 'magic values' used by SoftIce.6 c1 Z7 S" u9 X  g2 T" V9 f7 w2 {
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.& @. V; f0 {! ^2 \! i& E

5 E7 ^$ u2 q- ~# \9 JHere is one example from the file "Haspinst.exe" which is the dongle HASP% n% ^2 _3 j5 Q
Envelope utility use to protect DOS applications:
/ N/ Q% K$ c. i# k& _* R* w0 c2 f+ \3 ?) d5 h6 n
6 q& t) n' b/ Y+ |3 J
4C19:0095   MOV    AX,0911  ; execute command.
" @2 a/ t+ N2 p- `& g$ I6 l4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
( S1 H7 B0 \, O6 v, A4C19:009A   MOV    SI,4647  ; 1st magic value.
$ C. d  z4 D, P; O6 h3 r& L8 A4C19:009D   MOV    DI,4A4D  ; 2nd magic value.
( N+ r- w5 D6 I5 a4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
& ~4 M) q' u! J+ I! O& F; X4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute
8 v1 }9 r) I  e9 W5 x8 m8 M# M4C19:00A4   INC    CX# |( \( F+ Q. A) w
4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute
2 n, S* I% b/ h/ K5 s6 b$ I& ]4C19:00A8   JB     0095     ; 6 different commands.& D( p  S* Y. b7 R% H
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.9 m; _' y6 T9 w+ f& o& S( D
4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)8 y- \, l6 B/ d
0 ?+ q/ e, @* Y0 Y
The program will execute 6 different SIce commands located at ds:dx, which' e) z* X) f5 Z  q/ T
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
% T/ Z" m& p( I. R) g
$ z2 g$ F5 f: o* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.5 I+ @0 |2 j! @! [) H4 J/ s/ T
___________________________________________________________________________
& I, K3 Z/ X$ V3 j/ b6 [- M: m7 ^9 @, e) h: a! o
  M2 X5 ?) L- {: i8 h5 I+ X: [
Method 03
! q& ]2 q" R: a8 i; i( p2 c! T7 q=========  U9 D" m2 J* Q# _2 I2 N
1 t' A1 N8 G' ~1 q  }+ I! E# B) W
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h5 w4 d/ \; n- Y# w; V+ {% m
(API Get entry point)
: I* ]/ u/ j# }) d6 j( R        % P& K& s, o: v
+ @& @  J( [4 h, t0 A1 f2 Y
    xor     di,di* {9 m! H. [* j
    mov     es,di" N3 s/ X0 c& z, b& `% x1 H/ f( ?
    mov     ax, 1684h      
9 v7 z$ Q3 [$ Z2 ]5 s    mov     bx, 0202h       ; VxD ID of winice
" {+ x7 s* p; s    int     2Fh
: @6 r8 e2 n' H1 }    mov     ax, es          ; ES:DI -&gt; VxD API entry point
) k5 u/ u% U" W0 D0 j; [    add     ax, di
! M7 ^: O" E  ~; h. q! @& T: ?    test    ax,ax$ K4 g! Z; t% A9 V7 R- y4 {6 t% R4 \! f
    jnz     SoftICE_Detected+ |/ S9 v6 X" c( k  I. e" r( k8 V& J" F
1 u1 v- x$ F2 F% S% e1 Y
___________________________________________________________________________
( l+ R- i. W' P6 D! F2 R9 w6 z' x. {0 z8 ?
Method 04
" N. T' T* r) ~# k% ]4 d=========# Q/ {' o1 k4 w6 e) x

* L( z' p3 V6 J5 M+ VMethod identical to the preceding one except that it seeks the ID of SoftICE6 K& _8 v' \( ]& @( w4 m9 Y
GFX VxD.
+ Z; }/ J4 |# C; y' t
+ ~" _3 g; |1 X6 J& {6 E% t3 _    xor     di,di
" x; g( @8 b: h% B! ?    mov     es,di
3 k" d' F( J: H* i" W& P+ i    mov     ax, 1684h       : w6 _9 P: M2 P% _$ @0 I$ x
    mov     bx, 7a5Fh       ; VxD ID of SIWVID! h6 H1 @$ J4 N+ |- x+ D
    int     2fh+ l' d$ I5 ]% \2 O3 s
    mov     ax, es          ; ES:DI -&gt; VxD API entry point
9 N& _& Z0 U1 k1 C$ y3 ^' B- v8 v    add     ax, di
. g5 m$ J' l) H0 `* |2 x    test    ax,ax
5 |; R' o" Y, P" C/ w8 U    jnz     SoftICE_Detected
' E8 C6 u" D  U
  D6 A! G) R. B( v& |1 R' U__________________________________________________________________________
5 ?3 L: [  H; |
5 e8 g" b  S+ w
  A: k) k/ f- e6 ZMethod 051 j7 Y+ f: m+ f# [# ~( Q% T! o
=========
) D. a* [8 O( Y9 @" L
# V! S5 s' D- Z8 C  R: PMethod seeking the 'magic number' 0F386h returned (in ax) by all system
2 [  _; E. U, zdebugger. It calls the int 41h, function 4Fh.
4 u* K% u, [% f+ u/ W" VThere are several alternatives.  
, U+ g) e4 f+ D9 W, P0 J, {% v( q1 t
+ ]- V% y- m- g' V% SThe following one is the simplest:
) m2 p( _8 ^  v/ y* t
3 o$ B. c  n4 Z9 t    mov     ax,4fh
0 Z+ s  Z$ s" u    int     41h/ Z4 K' l2 _2 ^1 x, S0 |+ x+ ]7 g# R3 I
    cmp     ax, 0F386, G7 w% K& k/ O0 r
    jz      SoftICE_detected; @3 C2 e* T% M6 d% ?  l$ v' x9 Q
. {. Q  q+ \( v7 Q

7 k1 ^7 N6 E$ U1 {3 \; E- U0 CNext method as well as the following one are 2 examples from Stone's
5 q0 R. P4 Q) j- z3 @- E6 i1 u" S"stn-wid.zip" (www.cracking.net):
7 x3 o  V0 A- T& E0 ~" Y  c. w6 u3 `+ B! l3 B. w
    mov     bx, cs
: S) A# }/ V8 ^7 g    lea     dx, int41handler2
7 U: U  J. V6 w1 j6 s. F, E    xchg    dx, es:[41h*4]/ N4 O8 q  X; ]; e6 L2 d; H
    xchg    bx, es:[41h*4+2]
$ \8 [) y9 _* j. _1 }: L- y* E    mov     ax,4fh8 v- t: u2 ?+ ]1 ~, _( z
    int     41h
8 v1 i9 h* T9 }  T- B    xchg    dx, es:[41h*4]
, h$ L+ v/ P! b5 V$ M    xchg    bx, es:[41h*4+2]
) U! a8 {8 z- K- K6 ^1 _/ j: i" H    cmp     ax, 0f386h
1 b" Q7 T8 n+ {, t3 _    jz      SoftICE_detected5 r# [+ I0 v. }& S6 ^
: Z* h; W3 ~$ B6 c
int41handler2 PROC& h# N% [7 `! W  a3 t
    iret
* k: f  G$ r' R, f9 l/ u) @int41handler2 ENDP
& \# f6 e: w4 z/ s6 u. m2 U5 b9 X
/ R1 i$ {1 W& X/ `1 }$ X
_________________________________________________________________________
: i/ m" }1 Y# b. }8 L0 @) Y" H$ t6 \! H. D0 u# Q) e2 }" h

8 }  d8 Q4 z) B* R& e9 {Method 06
: O' U( S3 Y2 I5 [6 C. K=========
8 x1 q% _: `, G% q( e4 o( r; `4 l! z5 l0 J. {

# `. X1 j" e' _/ D# e# [* g2nd method similar to the preceding one but more difficult to detect:
# z. F+ L( p4 I/ e& M' E
3 d: ]0 g  l6 f- i$ @
0 t! H: ?; [- W% q$ G1 Gint41handler PROC
9 u& O% y6 `" P  ^5 P- d    mov     cl,al
6 ~0 R$ I9 T0 g4 F6 t" S& D    iret) N# K( \% z( ~6 l. @9 Q* P
int41handler ENDP0 c7 \- C; N( T1 u) y
/ p' d& z2 ^( }, F# D/ F

7 y  @, t# i0 P2 M0 ?$ h+ P    xor     ax,ax
2 L1 m1 @& G4 ^3 T  r    mov     es,ax; b1 b( ^3 ~( B5 {3 a1 F7 I
    mov     bx, cs
. n7 Z7 ]: L* I, Q! U, I    lea     dx, int41handler
, P7 }" i6 N' A5 n    xchg    dx, es:[41h*4]
3 O3 m2 f  V1 B+ o' \2 l  T2 _. Q    xchg    bx, es:[41h*4+2]$ d6 ?  o' \5 w  y
    in      al, 40h# w1 {7 O1 z; Y3 ?) K& G
    xor     cx,cx$ @! J  |, A: }/ S) T* `
    int     41h* F# G: k% P' Y# ^# R! z
    xchg    dx, es:[41h*4]; ?! o$ q7 q7 c
    xchg    bx, es:[41h*4+2]
, J; T/ M& d6 x3 ~7 E    cmp     cl,al
& z3 J, B7 O5 j6 D    jnz     SoftICE_detected, x9 m5 Z: x0 F* F0 I* k
$ {3 z6 S" u6 X) m; O7 U! \% r
_________________________________________________________________________1 |/ M; J! \; D
! L# e4 o& @, P
Method 07
5 y* V& N; T. i! e3 S=========9 {' B' J, F( f

3 m: l7 K0 p4 D+ UMethod of detection of the WinICE handler in the int68h (V86)
7 n! m5 {6 O0 ^! ?, w* u3 [* b: x& c& y2 x. e* w
    mov     ah,43h4 c8 D: s2 O7 R- v- y+ j1 J
    int     68h
3 M; t( y8 K' U: }- a  X/ A    cmp     ax,0F386h5 v* M' O0 ^5 R+ j5 N8 m
    jz      SoftICE_Detected' V5 i3 \+ f' u# i% [
0 E/ M7 F' k* Q. {
& c+ K2 ^- D1 `+ Y7 t
=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
$ i8 R2 _+ f" k# e* e0 @! h) j   app like this:  U5 ~0 o8 K2 X" y
! }9 \) x# I0 j  v8 Q! \8 y
   BPX exec_int if ax==68
( `# h$ G! y( I- `5 k2 m9 K# O" I  w   (function called is located at byte ptr [ebp+1Dh] and client eip is0 L2 R, @2 B4 K# H
   located at [ebp+48h] for 32Bit apps)
+ U3 I  [; T2 Y' ?__________________________________________________________________________
3 \0 J4 ^: y# {0 o& X* w! [
) G& R' ]; {6 L& L. A3 I, o$ A( P) C, z9 q4 n/ L' G, [- b( |4 p* P8 p4 |
Method 086 r8 X( Z, B; T7 j
=========
8 |4 I- T" X  r3 Q% H
/ u; \4 g  g; R5 H* ^It is not a method of detection of SoftICE but a possibility to crash the
! t; g, h4 j& h* O' Z4 ?2 r7 N$ B  p$ rsystem by intercepting int 01h and int 03h and redirecting them to another
5 t( V4 j! B5 I6 x& K4 U( k% }" e* Uroutine.: o; H% x% ~/ _) Q* b& _* S
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
- I2 S2 [" p( m9 n2 _6 _+ Nto the new routine to execute (hangs computer...)
& o6 U; Y( @0 z+ `: i9 b3 c- ?7 h% e+ G% R1 z* V8 [5 M' c
    mov     ah, 25h
, e: [- P1 _6 C4 N    mov     al, Int_Number (01h or 03h)
: ?1 x7 x( s4 n    mov     dx, offset New_Int_Routine( Y& }4 r! A" \/ P  r) x
    int     21h
$ g) J+ c  D5 n4 o: G" ?+ ^
& G1 t3 m! d( z: X__________________________________________________________________________3 b4 o, A2 _0 T, z5 N3 x

5 t4 j1 G3 ]/ D. E( p3 nMethod 093 P3 Z! ^/ u' w7 Z5 L  T
=========
- E6 E. |8 p* r9 v8 j* Z) x
: k7 ?5 V- T( k) z  v% O8 m& \9 U! cThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
3 F7 k$ t' y% S/ Nperformed in ring0 (VxD or a ring3 app using the VxdCall)./ r# p3 b6 v- H3 {
The Get_DDB service is used to determine whether or not a VxD is installed
  @9 @: B+ D* ], m4 {: zfor the specified device and returns a Device Description Block (in ecx) for  A5 }3 a( c6 W% @
that device if it is installed.
; K, D: }% z; g$ T2 h; F8 X  M# C+ m2 j' P9 T' ^: T+ V- Y
   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID
4 f7 Y9 B' {3 w/ M) v) q! A( r   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
5 M( d  {. f  j9 q4 B2 V6 A4 ~   VMMCall Get_DDB0 @2 n1 d/ W" q; X# Q7 w! ^
   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed$ U, S5 K0 ?% W4 ]$ o( k

- F+ t0 O5 p9 c; e* ~: INote as well that you can easily detect this method with SoftICE:
. f3 [( y/ ^2 `2 l   bpx Get_DDB if ax==0202 || ax==7a5fh' b/ y. w) `- {
% s, T: P) l% b. q) O
__________________________________________________________________________7 l' j9 ]% N9 z
: Z/ Q! y, F; @! w( }( ^
Method 10
# j- O9 V7 k# `=========% W9 y: y# ]6 V  n( `
3 h* b" u! a# ?7 d+ v
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with0 o8 U: }0 B" x  z# ^$ O
  SoftICE while the option is enable!!
/ ~# M" D' s6 W, I9 ?9 O" p8 \" w; g9 R# S$ J% p
This trick is very efficient:
( ^0 W5 {& }: `6 _' Z% `by checking the Debug Registers, you can detect if SoftICE is loaded4 L. N- s! P6 q; u1 T! `# K
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if2 I' T8 o$ J- G0 k+ D
there are some memory breakpoints set (dr0 to dr3) simply by reading their& k. W; j# Y3 z; v4 N
value (in ring0 only). Values can be manipulated and or changed as well( V! e* r$ A3 ]' z# H
(clearing BPMs for instance)
9 u/ p9 Y5 ]& C; q4 g# y
: N( B, w9 K2 j; M9 G- U: O4 o, b__________________________________________________________________________! W6 X' f" J' q) D9 o
  I% W" P/ ~: q/ f/ a  K$ G! j
Method 11' d# l8 O) P9 n6 C, R& W
=========- c6 j. V+ Z' ?/ t. r

& `! v# B; Y% m5 K- NThis method is most known as 'MeltICE' because it has been freely distributed2 b( w% @4 W( ?7 n# \3 E5 i- e' Q
via www.winfiles.com. However it was first used by NuMega people to allow
) z  ?( @4 u; p3 Q# Z5 x, O1 ?0 uSymbol Loader to check if SoftICE was active or not (the code is located
6 \, k9 J0 O3 w2 q9 Sinside nmtrans.dll)./ K# W. `8 ^. P$ G1 J* A- o. K
3 `7 J$ H- D* \5 L$ ^# a
The way it works is very simple:
2 {& S0 |/ n+ h7 L+ e0 U! C7 ^0 _% ZIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
* M* w, F9 N$ l% I# vWinNT) with the CreateFileA API.5 O+ Z& S% F. f4 H% t

7 R; X* F" ~9 R6 U( ~Here is a sample (checking for 'SICE'):
, {0 {+ Y; r5 R4 `, Y+ }0 L9 m  Y, ]/ B& I
BOOL IsSoftIce95Loaded()
. G2 ?7 K9 j3 G  D# c( \4 k& ?6 D: e{
- |% Y$ T& ]; Z7 I   HANDLE hFile;  
' c1 `& y. V  u4 v9 A8 q$ Z3 U8 N   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
3 h2 W! L' v/ ]. p, i                      FILE_SHARE_READ | FILE_SHARE_WRITE,5 G3 v* @+ m( X$ k) J) R
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);% e: y$ n7 \: N$ A* H
   if( hFile != INVALID_HANDLE_VALUE )! S2 v* O& z2 w) a. ]2 u
   {
/ q$ Z: D+ h  g4 y3 V      CloseHandle(hFile);0 g: I6 p2 w2 m2 w, K; f
      return TRUE;
3 F2 O/ R& m: E! \0 V( O   }4 Z  d9 F- b& k# B
   return FALSE;6 H! e: L& R" f& X
}
8 P9 ?' W4 Q5 B) f( i8 _; N( i
* `4 ?1 c) \2 n7 I* m# A  C3 SAlthough this trick calls the CreateFileA function, don't even expect to be
4 ?9 q  |2 q" Z8 E6 qable to intercept it by installing a IFS hook: it will not work, no way!, x1 V' n  P& ^" n0 V! A( ~/ J6 Q
In fact, after the call to CreateFileA it will get through VWIN32 0x001F8 b( D# g) t% j$ J1 r
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
( a: [- v# J+ e! Eand then browse the DDB list until it find the VxD and its DDB_Control_Proc* p! D' \$ @& D3 a2 s
field., O) e. C/ n. R& h4 o* t/ x
In fact, its purpose is not to load/unload VxDs but only to send a
' @4 a4 L' M. kW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
/ t- E7 |/ ]& ^/ d' D( uto the VxD Control_Dispatch proc (how the hell a shareware soft could try" W% w: k8 I5 ^2 [7 C. {3 a) }+ I
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
7 ~8 D5 }, F6 o! w7 EIf the VxD is loaded, it will always clear eax and the Carry flag to allow; O% {2 L, y/ Z. q6 w4 H! w# ?9 r
its handle to be opened and then, will be detected.8 B& _8 I9 R" D+ G
You can check that simply by hooking Winice.exe control proc entry point1 r# r) ]2 b) `6 R$ N' p% F$ m
while running MeltICE.
& r( t- h' I  R) A. o8 n
+ x" w' W: d4 N2 m& k
$ a. h  Z# Z) [% m. g% V  00401067:  push      00402025    ; \\.\SICE
+ B& w- I% |  m/ J$ _0 }  0040106C:  call      CreateFileA
" U8 i) O7 j% N. \8 K6 l  00401071:  cmp       eax,-001- g% @0 Y0 r; l* J1 Q: V
  00401074:  je        00401091
2 H2 S( S) \' r# ~* z
. t* w; N6 y  I6 a( B$ n5 \+ y4 w" U- U7 X
There could be hundreds of BPX you could use to detect this trick.
# }0 M( {6 Y9 b  Y8 `, T-The most classical one is:% l5 E6 e1 `& d7 ]
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
# ?6 Z3 e) t- ^% s5 K    *(esp-&gt;4+4)=='NTIC'
& b$ V, A# J- w7 b% I* g. O( ^! c- r1 P; k: H) _
-The most exotic ones (could be very slooooow :-(6 k6 m: v, [% T. q4 ^7 A* L
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  ; R9 H2 h3 t4 v$ [
     ;will break 3 times :-(
" ?2 P/ B' Q3 |" b1 M* \/ a6 D+ g4 `( o9 d& A
-or (a bit) faster: ) g" _; _' s; G$ U( G
   BPINT 30 if (*edi=='SICE' || *edi=='SIWV'). g: \2 t3 o7 G3 y. y/ v; [9 h5 ~+ k
' Y5 Z- m4 B: V; f& X2 K
   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  . }3 u, u0 D( k  G
     ;will break 3 times :-(
# U1 b& Q; I4 @% N  \) H% h
0 g2 Z  d$ h1 v  K* J-Much faster:+ O" _5 A+ ~6 ?" C4 y2 C
   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'
4 k6 a4 P0 K/ ]; V  Q2 |) Z/ q. A3 f) }; k) c: |1 Q. ~8 D: }7 N0 h
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
. s* }# v5 K9 B; t" ffunction to do the same job:
. B' ^+ H1 J. `  U3 W1 c  C6 R; c- X
   push    00                        ; OF_READ
: `  }* i! t- M3 l, R* c) s   mov     eax,[00656634]            ; '\\.\SICE',0: L: T  D8 Z/ [4 F
   push    eax
# W! o: d) w$ ~) I  b8 @( O8 P( R& x  J   call    KERNEL32!_lopen, @# y5 k) Q  L9 M8 z0 M
   inc     eax+ s+ X* R6 W& @/ l# g- o! ?
   jnz     00650589                  ; detected- c$ q/ u$ R+ A7 K% p% y
   push    00                        ; OF_READ
8 C  N: U7 B% O, ^; ~# ~) f4 t   mov     eax,[00656638]            ; '\\.\SICE', c% J) y7 d& e* X# l! _1 A5 ^
   push    eax7 `/ M8 z$ r2 _% U$ j
   call    KERNEL32!_lopen  e" j! x6 J5 A# |) ]: R& E
   inc     eax
% }5 @6 [- P. z: W2 ?" I   jz      006505ae                  ; not detected/ O) p: A% j) s5 _3 h' h& ?

4 ~$ ^+ S; G/ |% L# x
% y0 v$ @# }) o9 w( j6 q5 v- J  H__________________________________________________________________________
, T' z! m9 _" ^7 c4 z/ z+ i* I4 ^2 G  t
Method 12
& V7 t* s9 B+ s  i) G=========
. u. |. u3 K" x& I: q$ ~
) B) ]3 i/ K% B. K* x; h$ YThis trick is similar to int41h/4fh Debugger installation check (code 05) D4 X! Z' n3 v4 ]7 K
&amp; 06) but very limited because it's only available for Win95/98 (not NT)
# \: T0 Y! b: S6 f. A( P5 X/ Fas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
& H9 j9 S  E) B& b( `( _6 D2 P( U" Q+ g% b! q( e
   push  0000004fh         ; function 4fh
+ r3 Z- j% L# k  A/ z0 z9 h0 S& w   push  002a002ah         ; high word specifies which VxD (VWIN32)
. Q  [7 R! ]# A& i* @' H; o6 K                           ; low word specifies which service
2 R% u( ~/ T5 L, d7 V                             (VWIN32_Int41Dispatch)6 |, F9 {3 G: U, Y) S! q' G+ Q2 l
   call  Kernel32!ORD_001  ; VxdCall
% G- I# _, U: n  |- q   cmp   ax, 0f386h        ; magic number returned by system debuggers
1 ]8 P3 [4 c8 U+ Q7 j   jz    SoftICE_detected
! Z. C* j' p3 K* J% c/ d
# C) h) @5 x; v( k3 fHere again, several ways to detect it:
. V9 ^) D% m5 q0 K7 k  b/ z$ `- z. c0 Y% w4 k! T3 {/ ~
    BPINT 41 if ax==4f# w, ^7 f/ e  b: S+ {2 z

+ G& q: L* g* x6 j9 V    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one; G5 G: X6 U. F9 t' U4 D) C6 k6 Y

5 N  U6 o3 \) c% H    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
$ }8 L0 y( Y0 A# p) _: x7 d. c# ]
    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!
; J  c' p7 q4 H( J- u2 M8 K3 ]) s1 @! K' o# w1 y
__________________________________________________________________________
2 U8 e/ z! L. i$ x! J0 f8 ?) r5 t4 W& W3 \+ R3 C, N7 I0 M
Method 13
: g( l7 P3 _  ^6 U: K6 k  R- h=========
. z% Y2 v6 H2 V9 `2 G" M- U" k1 w
! B0 x  r0 c! t% p; {# R) RNot a real method of detection, but a good way to know if SoftICE is% e- L: d9 ^& V: [4 J( J
installed on a computer and to locate its installation directory.
7 H  m% g: M/ b# pIt is used by few softs which access the following registry keys (usually #2) :7 |0 N/ T) @' F! K) {6 J) x

# O: T* ~; {( k' U-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
5 T: k! S8 w5 J5 l8 @& F" y/ v( [\Uninstall\SoftICE( t( r/ k/ k) ~+ z0 g
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE; O$ F2 K. n5 m2 q, R
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
$ }, A5 U4 S( Y% _- j4 c" _# Z) ?  L5 T\App Paths\Loader32.Exe! J5 m5 R, {% }' D

0 I5 u4 v0 Z8 u9 n4 w  V" J3 [
" F: x. w6 L5 F% o, f$ a! tNote that some nasty apps could then erase all files from SoftICE directory7 Q( V6 V9 z1 \7 h/ C, m1 @/ N) Z* Z- I
(I faced that once :-(
' m6 d3 p4 |0 @& e7 N  h, h& p# L; M& x8 M! q; o
Useful breakpoint to detect it:$ r8 H+ c! J& }; \3 D
$ Q* Q3 n0 A/ P& H, X3 T' ]
     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
: O* t6 l0 h! N) a7 N, E
. h: L* E. h# W: e4 t__________________________________________________________________________
, }$ ~9 y& }$ j; m6 I& m6 S( c. m) p. p% l1 q/ n
* {/ s  b% H" N; \; m
Method 14 # d% o* T$ C3 [
=========! N( X& V( D$ I+ W3 X( ?1 ?; L
, w9 ~" }! @" q: h$ Z+ f, }% h
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
$ f6 e5 O- Q& v+ e4 P2 Fis to determines whether a debugger is running on your system (ring0 only).
- b: u, |. ]& x0 }# R" [+ ^  ~9 _
* [" N. C/ e4 M! _5 g( @$ p& ^   VMMCall Test_Debug_Installed1 e6 }( K% B6 Y, G. a! n
   je      not_installed
) {, y' e. w3 Y' Y" K. Y  U2 e, t0 q6 a5 e: L9 B
This service just checks a flag.0 y7 I8 ?; q: Y: y7 o, M- L
</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关注公众号

相关侵权、举报、投诉及建议等,请发 E-mail:admin@discuz.vip

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.|鲁ICP备19052200号-1

在本版发帖
关注公众号
QQ客服返回顶部