About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>/ g  |, z' ?0 f) x0 U9 w% |
<TBODY>' s0 O$ y4 I4 I
<TR>$ d8 |( J2 O5 ]0 w) f4 Y
<TD><PRE>Method 01
7 b, g. t5 [, Q; c+ a2 a=========" k. t+ |4 j3 G0 o

! w3 o  s; b0 }& AThis method of detection of SoftICE (as well as the following one) is/ u% ~" e' H7 }& k. L
used by the majority of packers/encryptors found on Internet.
6 W4 B5 c+ u& |# j2 i* {It seeks the signature of BoundsChecker in SoftICE" Y( _8 \2 \( Z$ m  M/ t8 y
" H; D1 d( h& W  j7 n9 v; R, h2 ]
    mov     ebp, 04243484Bh        ; 'BCHK'
/ d+ H5 W$ y: n- I" ]3 P; y    mov     ax, 04h5 E. `( I8 _- l+ m- A( P$ T
    int     3       9 [2 ?+ t' G" O1 p
    cmp     al,4
, ^  N4 a. `6 p& V5 ?6 d: x/ Q    jnz     SoftICE_Detected
1 g+ q0 q* D2 k+ f" z3 [! V! I' e0 U) _: r; ]
___________________________________________________________________________( e1 r+ [4 i( _- N1 Z& q" N  v
+ }# K8 v  q" _5 f( k4 s: J
Method 02
* N- l4 ?! C8 x( W( }. ^# ]+ x=========
5 `0 m  N! y( n, R4 G6 M4 `8 k/ Y$ z# H& {* y7 Y$ a
Still a method very much used (perhaps the most frequent one).  It is used
* j# \$ Q' Y+ J0 @6 j+ C2 C) wto get SoftICE 'Back Door commands' which gives infos on Breakpoints,1 X; Q% o# z/ U# B
or execute SoftICE commands...
2 x# X( ?0 T, m; z% I$ J1 ]" ZIt is also used to crash SoftICE and to force it to execute any commands
' X0 g4 E3 P7 C- z0 a(HBOOT...) :-((  
5 w* x9 \, w8 R% ]& ^1 ~" T8 A
& Q5 x0 Z0 O( WHere is a quick description:
1 X; ^+ V; _% r# [-AX = 0910h   (Display string in SIce windows)8 p8 q$ [! v5 X' ]* b+ Q) B
-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)' D) \2 z. y& Z! C7 ^* _
-AX = 0912h   (Get breakpoint infos)6 v' s8 e  S. L) ^9 L7 `/ y- @
-AX = 0913h   (Set Sice breakpoints)
* s+ Z+ r* Z9 e- d+ A-AX = 0914h   (Remove SIce breakoints)
: H+ J8 U6 w& K2 V& S: f2 Q+ \, K7 d  ]; c6 {' g% R
Each time you'll meet this trick, you'll see:8 ]: O. V* ]5 k1 k
-SI = 4647h
4 H7 y0 h- b3 u' n/ V; [% ^: M-DI = 4A4Dh
: X$ w) }. Y* p) |Which are the 'magic values' used by SoftIce.
/ ?8 y# Q) S2 i# Q0 b5 iFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.9 Y3 g' @: E2 a1 G5 f( M5 M
2 Z9 z, ^9 R3 M/ t- y3 H
Here is one example from the file "Haspinst.exe" which is the dongle HASP
* F4 U3 B* U3 N0 g3 ^$ EEnvelope utility use to protect DOS applications:
# `1 z- t! i. I3 C) l( r; @% L4 c# W8 U0 P" c+ {/ S4 e4 J

  i: k- o5 U" b4C19:0095   MOV    AX,0911  ; execute command.: ^( E- [* B' @6 b7 C3 T
4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
; R: j4 U" m  ]8 J+ N3 W4C19:009A   MOV    SI,4647  ; 1st magic value.
  q" o9 A+ B  m: l+ v1 i4C19:009D   MOV    DI,4A4D  ; 2nd magic value., ~2 `! B, g. A* b0 N6 v
4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
6 p( F/ I; y! z0 Y4 {2 K8 g, g5 C4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute0 R* C, H  ?( V# p# `0 z- @
4C19:00A4   INC    CX
- ?% z7 ~  k9 X9 f/ X3 n. [( ~& k4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute
) W6 w6 y8 y& o7 _; X/ T# U  M' T4C19:00A8   JB     0095     ; 6 different commands.8 q6 S1 |+ k- p( N6 }
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.) x5 J9 H! @' W8 E9 Q/ E1 D! s
4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)
( d) [/ m% }3 C* W1 R5 S2 A( J! a0 A, p
# y# n  `0 O4 m9 T/ h5 E, F# `The program will execute 6 different SIce commands located at ds:dx, which
$ K* F! d! [& z) h. I1 a# Bare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.0 X1 J: x$ m$ ^) o+ B
% R3 ^3 l1 E* b) W% Z
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
# ]5 i; Q# W1 }- ^2 o4 n___________________________________________________________________________
: ]- m7 v) J1 A/ G- V& ~
4 B+ k* m4 ~, Y: v. |' d5 c& f* G. D# ~4 M
Method 03  j8 B$ |1 K3 T; r
=========
. W, k* r5 u( L) U  [" J( h5 v5 N% s! a6 v* L6 {7 {
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
4 _6 F( b7 B9 Z& q  ^$ l(API Get entry point)# f8 j: ~( b7 H' ]  I8 O
        
+ F, H% m" w9 l4 l- Y3 m
+ ]7 `9 y' B7 Q1 ^1 h    xor     di,di
0 i1 o; b/ T" J# A, \$ N: @    mov     es,di  T: H* x8 X% Z$ A  ~* o) R# C
    mov     ax, 1684h      
4 T3 U9 `" I" n6 k$ d/ T    mov     bx, 0202h       ; VxD ID of winice
5 R. ~+ `4 e+ k( R5 x/ |' x    int     2Fh) }1 H% l; G( O( p- W
    mov     ax, es          ; ES:DI -&gt; VxD API entry point
. c3 X, \) J% }6 W& w" v    add     ax, di
. ^3 H* u* O7 j; C# V, p, s4 J3 a    test    ax,ax
* A4 j0 c( |9 u9 e% V+ W. n    jnz     SoftICE_Detected
9 p8 K+ p1 [/ L7 W' y9 a3 U1 ]( ^: ?
+ f& N' ^; w" @" g; L' {8 P8 ~___________________________________________________________________________1 ?. `# t9 d) C6 w0 a" g4 {0 U
. n: A, B* i. ?/ b( x
Method 042 m5 u8 H: y! ^
=========6 I$ s) T: `6 v: y7 P( C" A' y

- a* Q; U& \. @# u- @. {Method identical to the preceding one except that it seeks the ID of SoftICE2 r, V- h4 D0 I
GFX VxD.3 q# s' k6 o! F
$ z6 b) M: |9 _
    xor     di,di
: P4 g$ T6 X# B3 D& Z" k. c7 L    mov     es,di
# Z6 R3 y7 O8 ^7 }    mov     ax, 1684h       8 |& y; _; N( G) p
    mov     bx, 7a5Fh       ; VxD ID of SIWVID
! W" ?6 `; s% r# W, E4 u    int     2fh* p6 T, T( d2 P! C
    mov     ax, es          ; ES:DI -&gt; VxD API entry point8 J1 Y( J$ N/ O* K* Q9 @) p
    add     ax, di
( |3 f2 A( p& j9 c    test    ax,ax
' e3 R7 e. u1 D+ _    jnz     SoftICE_Detected: @# s, J; G3 M' c7 X3 p: g

3 a' g8 [+ v1 H' Y/ R8 G__________________________________________________________________________7 {4 A* E" n' ]8 @" @3 v

* p6 x& S# L0 Y& e8 R+ t
, T3 U" U" ]- k  `3 j. dMethod 05! m& {7 b+ r5 m3 ~; k& m
=========
7 w) w6 U4 e3 ^( ?! M& s* p; h3 c( {0 F
Method seeking the 'magic number' 0F386h returned (in ax) by all system9 g2 ]! J5 E5 [) s- c3 E
debugger. It calls the int 41h, function 4Fh.% u* r" w6 S( M$ a7 @  m
There are several alternatives.  
- _* P4 U, ]' m( z" g. w8 K- q$ A# C, g: g) @
The following one is the simplest:
6 h3 w& }* s  @. j5 i- k: W  L
7 ]7 d5 D/ l7 X1 e4 T7 @    mov     ax,4fh1 D( R' o6 D$ E1 |0 o/ s
    int     41h' h+ G& v: a+ r6 y/ @0 ~
    cmp     ax, 0F386; l! f$ c8 L' y+ J$ Q* s
    jz      SoftICE_detected& L1 `, {3 V; ^5 T# U, R) D

7 U4 j4 a2 T) J6 C& S' l& }/ h
; T  @' h! P  H8 P4 v" ]  Z9 SNext method as well as the following one are 2 examples from Stone's ) \# L$ i* n* o. J; B+ |
"stn-wid.zip" (www.cracking.net):
3 a' g8 @3 S. H9 C$ i9 m1 e6 g0 C3 l4 i) q( x. K7 y
    mov     bx, cs
- D6 v2 b3 F6 A0 [6 F: o' y9 M    lea     dx, int41handler2
) ]# g6 p& Q# _4 H7 R5 o9 L    xchg    dx, es:[41h*4]8 W. Y& E6 [, N' w
    xchg    bx, es:[41h*4+2]. r( `: e- B, g9 U" X+ D, z
    mov     ax,4fh
' h( z0 `3 L6 ^/ V    int     41h
" ~& P  `9 `4 o    xchg    dx, es:[41h*4]
3 d" {% _% |1 E' s! R( I' z9 }# I    xchg    bx, es:[41h*4+2]% ^2 g( C7 n6 Y5 k
    cmp     ax, 0f386h5 l2 A% C/ c, z( V4 a4 h& c* p
    jz      SoftICE_detected
3 b2 j; v# R7 s: H# d6 V+ ?! I, U5 Y" P2 `' b; x% X$ W8 _5 i5 T
int41handler2 PROC
0 ~. G4 m# S* d) E8 [8 O. Y+ ~    iret
) I6 r8 }# z/ q/ ]0 E3 Qint41handler2 ENDP7 @( E$ J+ r" s$ J

, g& }0 @) N1 F
+ O& A: @. V' \# H- K- m_________________________________________________________________________
$ C+ p3 g# w  [+ u" G1 R9 h8 w3 M# Q4 S1 w1 a$ ]4 a& `
  f4 ]9 L* l7 ~2 ], a6 |9 y
Method 06
/ `5 i# v+ R* r9 M) ~5 }8 X( w$ V# |=========: ?2 M0 @% m) r9 i6 |1 M
8 r% t7 u% J. d2 z
' T4 |$ w& k, ~' y! c
2nd method similar to the preceding one but more difficult to detect:
( s& o$ \% A; R# u
. V! m* h3 i: J
  c& k0 ~: L  W4 cint41handler PROC! i- y9 o- U0 R; Z9 t6 R
    mov     cl,al4 X" s% S3 t8 u+ K9 \4 Z
    iret
/ F( q  V- K, F8 m* @int41handler ENDP5 k/ @$ e3 R/ q$ P* ~" D

' o" {. Y) w4 H3 }( B" B# F, e# B5 o7 v/ A
    xor     ax,ax
: m2 g. ]+ D4 V1 P' l, Z4 {+ Y& I% `    mov     es,ax: v  N7 W# k9 y# P( Q1 i
    mov     bx, cs1 q2 |- M  [/ K0 L- r, ]" _# b) f
    lea     dx, int41handler
6 ^' F; [$ u( l+ k6 O' h    xchg    dx, es:[41h*4]
+ G% t6 a- k; o    xchg    bx, es:[41h*4+2]
3 I- o' R9 p  }; o3 x- X    in      al, 40h; D1 _" _& Y& c# f' w4 k; B* ]( Y
    xor     cx,cx
7 ]( `: p! u$ j+ e. P" K1 o    int     41h0 ]: |0 K/ x& A/ o* T. ?# V& B4 Y8 f
    xchg    dx, es:[41h*4]- B, T2 Z% D0 Z0 u, k9 `
    xchg    bx, es:[41h*4+2]
; H! ~1 o+ E1 Y, g% O; k    cmp     cl,al
3 V" J) ~( q* m3 @! s    jnz     SoftICE_detected6 C- i  `+ S6 M5 ^# l! c4 c3 u

  n/ [5 f6 j* o4 n$ ^_________________________________________________________________________% Y1 s' `% L+ Z# G
- A3 ?" w! p+ U$ g  S
Method 07- c. ~  U2 j$ ]1 `) h7 G+ i
=========
9 D/ h! m8 S2 ?9 N& r+ b' V6 T* ^* f! h3 V4 T+ M5 \8 x
Method of detection of the WinICE handler in the int68h (V86)
: D" ~9 q% b$ M" [! ?, @
; n( C5 I" @! @% s+ T# K    mov     ah,43h9 y( a  f- [1 L  @0 L
    int     68h
% {% f+ m" x# x" I  I% W+ q5 d    cmp     ax,0F386h3 L( |* ]$ W; B
    jz      SoftICE_Detected
2 b4 M2 N* w$ J/ p$ {1 m3 ~& y* s) }; _. f; ]8 {. t9 }/ _
7 o; ~' V* o" m1 @5 B* S
=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
; F! y4 s# _" _. a8 q8 K   app like this:
  Q. \# s2 O9 a9 N. P& c" v
6 h2 `% x; H- K6 a, T   BPX exec_int if ax==68( R2 W: W3 }% X5 {! h" K' I
   (function called is located at byte ptr [ebp+1Dh] and client eip is  {& Z% S8 T' Z
   located at [ebp+48h] for 32Bit apps)$ |- P8 A8 K/ K/ {! D" n; r
__________________________________________________________________________7 x+ Y$ D" @% e
5 G0 {( l' A' `
1 S( @9 t5 J) E. {& D* `# X: N
Method 08' l9 N7 a" I, M* |6 [$ j( e9 P. U; y- X
=========' r) E) P3 ~6 a+ W* b  d
1 O- y! D+ r7 f+ T! N$ W& \5 ]
It is not a method of detection of SoftICE but a possibility to crash the* N$ \+ j2 b6 b
system by intercepting int 01h and int 03h and redirecting them to another
; A  U1 s0 q1 l* q+ K, ?8 g5 |* Oroutine.! `9 B" U( \( P' N+ ^/ j! s. r
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
8 ~% K1 B  v' D/ B- q. eto the new routine to execute (hangs computer...)
6 M7 T7 z( Y" E& R8 L
8 w% f: l# Z" [4 h' ~( r6 p1 R2 e& w! x    mov     ah, 25h! l0 L+ e$ C2 U0 y7 z: q9 \
    mov     al, Int_Number (01h or 03h)
+ k4 L9 A" H0 V4 P8 d( b1 C! \    mov     dx, offset New_Int_Routine
& {4 x7 ~/ i  d3 _% t! z    int     21h
8 C* A. n) q( w* d. A7 L( a; }5 [
) R6 F  m# V) {; u  g__________________________________________________________________________8 F% i" u& e. h% u

0 Z- L) ~  L2 u# M* hMethod 09) c3 ]7 X  L- D2 v2 _. j* F/ p: u
=========+ J+ S$ e7 C" o/ t* _3 ^

) w. x2 g! y, U! |$ JThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only8 y6 {# @2 y+ S) D& @% D
performed in ring0 (VxD or a ring3 app using the VxdCall)." H! s/ `. x  ?9 `
The Get_DDB service is used to determine whether or not a VxD is installed4 s% r4 U  i+ j2 V+ ]% n
for the specified device and returns a Device Description Block (in ecx) for; f6 z) J8 ~* j
that device if it is installed.  C5 {6 [  l- R, W4 q
- D0 f/ C% O0 t8 ^( F5 Y% |# P" s1 O
   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID, y* ~; m5 J+ J. L4 F
   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)/ |/ {; U$ `' T" l; E& N) _
   VMMCall Get_DDB+ r, x: k- l9 n6 [$ T, h
   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed3 f2 y* p; |7 K1 X. `3 I

  I; A8 Q( g6 }: K9 t6 jNote as well that you can easily detect this method with SoftICE:: k( P! F& ~* Z7 o
   bpx Get_DDB if ax==0202 || ax==7a5fh3 L8 G7 e! `7 b8 m4 A6 J2 e

2 C' R2 S: K7 ^! n% n__________________________________________________________________________* ~8 C. l4 t) i
& [+ T/ C* e, G+ J* E1 k4 O' R
Method 10
, o4 g! D6 _$ e=========
% @) ~; t8 n* M% d& _9 q$ U& _$ {0 n) z
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with. ]1 v+ P' q& V/ W% u' w( S% V; k, M
  SoftICE while the option is enable!!# `( f. F5 m& _# G& P' q0 k/ a( x
" f5 `- e2 Y8 A
This trick is very efficient:: A( z# v0 B" v
by checking the Debug Registers, you can detect if SoftICE is loaded
4 M6 E! I* r& r6 U2 @(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
. N7 W' J% J* qthere are some memory breakpoints set (dr0 to dr3) simply by reading their
0 Q) }7 z& J' T0 a( T: M9 v4 Gvalue (in ring0 only). Values can be manipulated and or changed as well
1 W4 b) {% c, i# ?: x(clearing BPMs for instance)
! @& ^1 K" j+ j+ |9 u; H6 k& [' J
__________________________________________________________________________
: A1 G" t6 R9 W" ~: m% E3 g
6 w/ Q- v9 K7 C' BMethod 11, C. u3 _9 A' |6 C& R
=========4 o$ j( c5 e# N; x! c: O+ W" }

- W( A* a2 n2 WThis method is most known as 'MeltICE' because it has been freely distributed
0 }  G: P: o! lvia www.winfiles.com. However it was first used by NuMega people to allow
( q  Y: ^" p$ M$ A: v. a# y3 j/ C% CSymbol Loader to check if SoftICE was active or not (the code is located2 c! A& Q& z; X$ Z* d
inside nmtrans.dll).
% V$ B* X  \2 P9 b" i9 D
# n8 M4 t* v0 R5 G* ~9 UThe way it works is very simple:7 Z" F# d, g% W+ |1 ?3 c) n
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for3 H% O* D6 H- v( ^
WinNT) with the CreateFileA API./ b6 {& n" Z/ i, j( m" X

7 B; W% v+ Q0 U! n) T) U4 K# B. QHere is a sample (checking for 'SICE'):
$ i4 |6 ~: q. J6 s$ S4 `/ P3 x. S; N; V( n
BOOL IsSoftIce95Loaded()
7 Z) z- f* t% _* {) o( l. a{: h5 {4 D% n( K0 P
   HANDLE hFile;  
0 j# @$ J3 {! m   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,, z/ {; q' ~5 o: c
                      FILE_SHARE_READ | FILE_SHARE_WRITE,
) Z  W7 X, X' V! S- O                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);5 B3 R( m; Z; J# W  B3 S) U4 ^
   if( hFile != INVALID_HANDLE_VALUE )
( D0 T- w1 N9 U. H% O, \) m   {
# w. E- E; A' ~6 u; n5 p      CloseHandle(hFile);
4 v# Z6 C% b5 J& d/ M      return TRUE;  w0 D5 T9 }4 z/ L  }% R; v& J
   }
- `; e, |: Z+ R1 z, M   return FALSE;
, i$ _7 D# G( t( b2 B}& t- r0 \. |0 T+ r3 y
* i- M3 y' }+ `/ L$ u; P. w
Although this trick calls the CreateFileA function, don't even expect to be
5 U5 v7 P3 Q, h4 c3 d" _3 N( {0 K3 dable to intercept it by installing a IFS hook: it will not work, no way!
$ K2 c- Y3 `% ^' L$ V0 [In fact, after the call to CreateFileA it will get through VWIN32 0x001F
4 {' h1 I# U0 W4 p8 c/ `! Uservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
7 @( |. A4 ~/ x8 N! T( {, Z; ?and then browse the DDB list until it find the VxD and its DDB_Control_Proc) \; x& n5 `! a& S0 |' Y: S' l
field.* T1 Y0 i1 v7 |$ l1 F
In fact, its purpose is not to load/unload VxDs but only to send a
1 A1 M" J# i6 x; k4 k/ BW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
) C4 n8 A$ w- w0 P+ nto the VxD Control_Dispatch proc (how the hell a shareware soft could try" N6 Y) `7 L3 f7 }
to load/unload a non-dynamically loadable driver such as SoftICE ;-).# m. j, H2 A6 E) d% D
If the VxD is loaded, it will always clear eax and the Carry flag to allow6 Z& v1 C& J0 M* z
its handle to be opened and then, will be detected.
8 V- l# i; O: l+ U  HYou can check that simply by hooking Winice.exe control proc entry point
/ [0 h. v& |/ E. t* j4 ywhile running MeltICE.
; G/ E1 k( R. a* N. R6 D) J  ^* v. k8 p' Q
6 x1 h2 L8 l' R* h
  00401067:  push      00402025    ; \\.\SICE+ _$ u& _. g$ O) ~2 ^
  0040106C:  call      CreateFileA1 Q" `  l- H' ?$ E! B9 K( t
  00401071:  cmp       eax,-0017 l7 p: M0 c/ O; g/ ~8 ~
  00401074:  je        00401091
' _" y% Q! V& Q1 ]0 |0 i2 M
; h; L& v: n" w2 f/ R; Y5 p. t7 b; z, U8 a- ]" `
There could be hundreds of BPX you could use to detect this trick.
( m- g' ?' h8 }; _8 T3 Z-The most classical one is:
# E" G" \, ~7 @0 U  d  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||2 Y& B6 w! ?) d! V$ ~4 r
    *(esp-&gt;4+4)=='NTIC'" @8 I* P+ U* |2 a6 F
! A7 D& U( S" q4 x4 [  }
-The most exotic ones (could be very slooooow :-(
7 y5 N& O' a: B0 U8 G" S8 e5 D" F   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')    l) j. [( |) b' C( U6 d
     ;will break 3 times :-(# x6 V' ^  J% M

, c/ O9 J: v3 U7 ]5 K-or (a bit) faster:
, c  n4 m: m% }1 T   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
# A" A4 e7 ~' `; n- |$ z, S# x& @& w) G% l: {1 R
   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  
# O8 g" Y7 b8 I4 J7 T" Q) t# ~     ;will break 3 times :-(7 Q# Z* T5 b* S% ?
; m! f4 L* G, L3 l
-Much faster:
5 Q  m0 n; d0 @2 |6 g+ J   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'
5 Q# m/ C5 [" W( f. Y5 {
! J) X! j+ }; ?1 v: A& g* dNote also that some programs (like AZPR3.00) use de old 16-bit _lopen- I. n  g1 q1 n/ Q7 D
function to do the same job:0 J( o* D& Y/ r
1 [/ H) Z. Z. K- q( e9 z; v$ x
   push    00                        ; OF_READ, b3 W& p8 n% H! _3 U9 V$ u2 }
   mov     eax,[00656634]            ; '\\.\SICE',0
( F! ]3 b! |: S; ]0 c& S# D   push    eax
8 h" c; ]9 r- w) b2 B4 a   call    KERNEL32!_lopen
$ `* A& v& P/ o4 H   inc     eax
, u  K" B- B/ x  I   jnz     00650589                  ; detected& ?% U# ]1 U0 h- @4 ?, Z
   push    00                        ; OF_READ
  y- a, W0 t% [; P' F   mov     eax,[00656638]            ; '\\.\SICE'
* V6 R  Q2 z1 K+ Z# O   push    eax
# y7 u/ [6 L2 v$ {$ F8 g   call    KERNEL32!_lopen, F/ N$ H; `' o# {3 P
   inc     eax
! @( `/ ^. t% d% e' O; O" @   jz      006505ae                  ; not detected. {( j, d: H. b$ F- o
6 \0 T+ ?* _; F. f1 E2 {, p

4 |6 k; w2 M" ^2 l6 b( Z2 R__________________________________________________________________________
7 Q) H( {4 P+ z3 |# `
3 A: D% Q! r# ~9 |" Q: {% [Method 12
* x9 S4 f- C8 G: u=========% E, A* L% l0 N: I; V
6 v! ^% v9 }/ @7 q' r4 Z
This trick is similar to int41h/4fh Debugger installation check (code 05( Y1 X3 \2 D' q4 ]0 _" {, A' B, Z/ A1 g8 ~
&amp; 06) but very limited because it's only available for Win95/98 (not NT)# ]/ }5 L! \) p! H) t' t
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.! g4 E; L  I$ u) [7 A
, _- Q4 N) R3 m8 t) n# H7 w* Q" V
   push  0000004fh         ; function 4fh
) f, Z2 T: T! O* i! _   push  002a002ah         ; high word specifies which VxD (VWIN32). U' _! v1 N" w5 u( L( i) y
                           ; low word specifies which service
+ I& O- L# _4 x# u* i1 J4 |                             (VWIN32_Int41Dispatch)
# F) t4 f. u3 `5 `" _# D5 V   call  Kernel32!ORD_001  ; VxdCall
! j2 Z- k6 ^/ W9 v7 B   cmp   ax, 0f386h        ; magic number returned by system debuggers9 C5 e, b/ D% s5 D
   jz    SoftICE_detected
) L; c# k5 f5 b/ L3 Y7 o$ q* |# `* f& \/ |
Here again, several ways to detect it:' D+ ^# p6 I! q/ I

+ M. N) c1 Z3 c% j% R! f    BPINT 41 if ax==4f
  m7 O) d' m0 Q6 b) d
4 T+ v. t6 V/ D" U) ?! d3 ?    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one
5 ~7 V0 j0 g; J3 N
9 e4 q8 G9 o* p    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
( _  p9 L7 ?) y' d/ x
- M8 H/ ~. s9 T# S# U( a    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!$ [, p" P3 T2 X7 \

- s6 b$ ^  Z; s5 d__________________________________________________________________________" `- x! U- c# C
/ y% w! h  r% G. ^$ I3 @3 U+ n) t
Method 13
0 X- n7 k' N# F- U# f6 @=========. |8 y7 K7 t# g% L2 F: q

- m  n9 P3 B: K# X' p+ B) E! G4 fNot a real method of detection, but a good way to know if SoftICE is8 W& `3 C. G  `* x* U& _' w, }
installed on a computer and to locate its installation directory.
" X* ^- k& I5 a5 V. AIt is used by few softs which access the following registry keys (usually #2) :- X; Z! v, N1 v/ M1 w$ H+ x
6 t. x$ t& @8 |0 l9 J" [
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
4 o; t/ n5 i$ m0 Y* B\Uninstall\SoftICE3 ~1 p$ ^; w, p2 ?* q. u
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE% o+ T5 u- H* F3 g" [; N1 H
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
# P& R3 T- m" d! m\App Paths\Loader32.Exe
0 |& k( {" h3 ~, a7 a3 c# t6 ^
% I3 m3 U2 W; X" y+ k0 S9 B) H# G- P
Note that some nasty apps could then erase all files from SoftICE directory
. O* f& `7 a" I8 M) C6 G) @+ d(I faced that once :-(
: ~5 n% ?; Y* k7 a# H6 I6 L8 b* L6 {" v
5 h* W% `: {, TUseful breakpoint to detect it:
# b: [  a: P. t! C! S
  J4 h( ~  x' p- o4 y$ w( w     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
' @, l  K" D2 [- [8 a
, a$ W+ ~+ N$ M9 |__________________________________________________________________________) V5 P6 p6 Y9 t: b

5 @  h9 O5 {2 H& S* Y- o& K2 z* W
Method 14
1 x( E4 n. Y+ S* j) r5 K" t=========: k) y9 m7 H% B; t0 I

, X4 ~' P6 a: n# c, y7 }! aA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
+ W' k( t" z" h8 }. Gis to determines whether a debugger is running on your system (ring0 only).
4 O+ R' a( m& s' l: Z+ l# m- b: X& `; \* k
   VMMCall Test_Debug_Installed, q% Z, h; ?7 z5 g
   je      not_installed
5 ]) d" `" ?* g6 a7 s1 |: l5 M/ f) |: G  ]$ v
This service just checks a flag.
5 u; ^% k$ z+ v</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关注公众号

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

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

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