About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
7 A& K0 H% z, F6 p* k6 R1 E<TBODY>4 d" S5 ^6 M2 J+ \
<TR>
- Q  b% g6 K4 z7 \/ c<TD><PRE>Method 01
. y" y8 m- K+ T: x  E=========7 i' [0 `& p- l( k
7 m3 Z- M# h- K. B
This method of detection of SoftICE (as well as the following one) is
0 F# S( |2 |/ w8 Sused by the majority of packers/encryptors found on Internet.
0 S2 ~4 t2 q4 }( b; vIt seeks the signature of BoundsChecker in SoftICE
9 p6 G' u% s2 P1 e- l- U$ P2 L3 S1 ]
6 O# b6 u6 X, Q9 t" U    mov     ebp, 04243484Bh        ; 'BCHK'
6 R  U9 S! y4 l6 I; I- V% i    mov     ax, 04h7 D2 F1 p: E! _1 r
    int     3       & T+ t# E! b; Z, R7 }! @
    cmp     al,4
# C& D) q- }% r' T    jnz     SoftICE_Detected
9 w$ F5 G) {: Z. T, ~9 I# q# z. T' ~: @& `3 C' g/ a
___________________________________________________________________________
8 J* D: N5 g# o- `; M
% ~6 A: A0 z  c( m' s4 g) cMethod 02) s6 y/ ?+ u1 J6 ~1 e6 X1 \( L
=========
- V* I& g3 q, @9 h3 r
0 w1 B8 v2 _" Y6 v0 l( y+ Y; VStill a method very much used (perhaps the most frequent one).  It is used
) X# X) f5 C# @" Dto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
7 [( N# ?  I5 E) \. R' Yor execute SoftICE commands...5 u2 x4 a2 w* f! ~- V  b1 P
It is also used to crash SoftICE and to force it to execute any commands' c0 j: F) v& F4 N
(HBOOT...) :-((  9 z  q9 M/ f" q# O1 C+ @
! _8 g1 y* D1 \: F
Here is a quick description:
1 I* {' W  ?8 i3 D9 o5 a5 L4 i-AX = 0910h   (Display string in SIce windows)
. Y5 `: l8 N; X' F-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)3 w/ N! ~9 C$ W  q6 g) @
-AX = 0912h   (Get breakpoint infos)
  c% _4 x' O& \4 ]3 ~9 N* `-AX = 0913h   (Set Sice breakpoints)
- d% ^8 p* o1 ~-AX = 0914h   (Remove SIce breakoints)
# T1 n: o+ z; P. k3 ~- _8 _1 l- P% |  D" J4 K
Each time you'll meet this trick, you'll see:
( e2 u' R. N7 y1 x* P-SI = 4647h
4 I( O7 s3 a( f; H1 I-DI = 4A4Dh
% d5 A/ ]5 _7 J/ CWhich are the 'magic values' used by SoftIce.
# K+ L+ U9 F4 E* D9 ~3 uFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
' p) `4 I1 d. x: H: M3 S( J: o- e! ~6 v1 D0 _7 H3 O4 x
Here is one example from the file "Haspinst.exe" which is the dongle HASP, t' x1 M+ K* N  H4 }2 A
Envelope utility use to protect DOS applications:( V( M+ l. Q& q: p; N  V2 R+ [3 I
) d% Q; Q5 q' ], b& ^" o

( {/ s; ]* r  |: e4C19:0095   MOV    AX,0911  ; execute command.
; d1 }- Q1 O3 r" \; ?+ D. y4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
/ V  ~# H+ v! V4C19:009A   MOV    SI,4647  ; 1st magic value.' r" N2 C% `- ?. P( C# |
4C19:009D   MOV    DI,4A4D  ; 2nd magic value.4 t; L, a% a5 e7 O  `2 \
4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)8 j  M) J+ _$ Z
4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute! E5 o. `4 U$ C2 z9 L
4C19:00A4   INC    CX+ m' Q9 b* g+ `& s: S
4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute  f& Q' u4 l7 V! l) Z+ @2 l8 u
4C19:00A8   JB     0095     ; 6 different commands.
1 H  y9 o( l7 ~' S4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
2 ~1 W9 z2 m1 X9 t( }# B" y4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)
# \, A1 n3 ~/ @7 J+ l8 `- \) b+ T$ j2 I7 K, Y
The program will execute 6 different SIce commands located at ds:dx, which* |& F0 z; N& W" E) @$ K
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.% p0 I) E( v+ j( p  i( D6 s) `

' J! N) b% A9 ^4 \" q; Z2 e- S1 D* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
* I) t3 G9 x7 I___________________________________________________________________________
3 j  B/ Y; h8 p
* D+ W( h, t) ]3 i# J% i$ i( V, G; ~! _. ]( [- P" v
Method 03
- c7 `% ^+ x. a+ F* d7 _: q/ g=========8 T9 R* K" y" n6 e+ a

  q. \. F. [# g7 OLess used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h# R: v* b# u- C# H; c, }
(API Get entry point)
/ W0 q% c9 d$ [2 c; D        
0 F1 H8 _( ]8 F
' ~+ {9 h6 r0 s+ A6 W( I& c/ X, e' A    xor     di,di& q" F  n3 y/ \" J2 V
    mov     es,di
8 u& w4 @8 g6 [( j- R9 W    mov     ax, 1684h      
- H# k2 Y, \. Z6 u8 y    mov     bx, 0202h       ; VxD ID of winice$ {/ G1 M% S7 A1 c4 ]  U8 P
    int     2Fh
/ m. H- a9 ~" l4 I' b9 Z    mov     ax, es          ; ES:DI -&gt; VxD API entry point6 \- v$ p. {' x7 u
    add     ax, di
# _) ?! X( r. r    test    ax,ax
2 A2 X/ y, H3 b% E: L' c% {    jnz     SoftICE_Detected
. G$ h: d5 K; M) A) N0 e
2 z/ k5 ?* F1 A6 k& w5 y7 Z8 E+ Z___________________________________________________________________________
: X( h; p2 c' \. a3 f. G, u, H: K0 v
Method 046 k9 \3 G$ X: H/ [6 A: u( [4 k
=========
( P7 V) J, g: g! a  ^) y% M
: k2 t$ J  D* FMethod identical to the preceding one except that it seeks the ID of SoftICE
$ P4 S2 a; X+ d9 r: x- E+ y4 ?GFX VxD.' V3 N: i  f1 T: Q# C" d6 m

+ I$ t- F# [; M, q    xor     di,di
- M9 |' M8 v+ L/ a    mov     es,di. m( {, ?2 r2 @% R
    mov     ax, 1684h       : w1 R0 @9 y: T3 R
    mov     bx, 7a5Fh       ; VxD ID of SIWVID* P& k) c7 i: F( w+ r
    int     2fh* J7 V- i0 F. o" q* }8 z
    mov     ax, es          ; ES:DI -&gt; VxD API entry point% e( }. h1 x/ H# g
    add     ax, di) u2 A) d0 C9 I) a
    test    ax,ax2 F! T$ P5 M8 }* ]
    jnz     SoftICE_Detected8 L2 ]6 S. \2 X' L3 y  \  O
, I  G/ }/ u" w! v) l* l( G
__________________________________________________________________________) V. c1 b5 G$ m

$ t) Y& U, b" i1 e+ C  h+ {. Q  `
Method 05
  p5 u7 L" |9 w=========
. ^% m7 t/ H+ M# t* n7 i, O. T0 V6 G
# D- \* t* g  i* j7 G0 v" L& DMethod seeking the 'magic number' 0F386h returned (in ax) by all system: X. M6 G' r$ g1 D
debugger. It calls the int 41h, function 4Fh.7 W9 I9 m4 S) T  Y3 f9 a1 P
There are several alternatives.  # K7 t8 ?2 R. q: n/ d; k# v

( G  v% t3 Y. u7 B- C  Q: iThe following one is the simplest:- H' X* B6 ?3 u5 ?' o
$ W3 F! c! L0 T6 G& I3 r
    mov     ax,4fh
/ r0 \$ J. X! f( U0 f/ X  R/ ?. n    int     41h
' ?8 Y: N: n; U  x& u& D    cmp     ax, 0F386+ `; C1 ?( _: E, _- ]* l
    jz      SoftICE_detected! ?. A! c/ k7 {6 p1 ^- H
# j5 p9 ~5 s) Z5 H3 G* z1 `6 a( j1 [

( \0 U$ j4 [; B( \. ANext method as well as the following one are 2 examples from Stone's
* H3 v% n; T" e) `% z+ `0 t* b, S"stn-wid.zip" (www.cracking.net):! t" T) |  \2 h: E% E* M% p
# P1 K7 C4 k" |+ o4 F+ d6 h, U" s0 e
    mov     bx, cs  Z; W8 M% R4 Y9 g
    lea     dx, int41handler2
3 M7 y. O3 I) ?" Y' f    xchg    dx, es:[41h*4]
$ A5 |/ }; A" j+ L; H1 Z3 z    xchg    bx, es:[41h*4+2]
# V: ?6 w! ~" L    mov     ax,4fh- ^. e6 E) n. S, ]$ b' E
    int     41h
( C2 |5 |  q8 r+ |$ P1 A( Z    xchg    dx, es:[41h*4]* l$ W6 q* k5 \
    xchg    bx, es:[41h*4+2]
# V, g/ Y5 p9 a1 E+ C  o    cmp     ax, 0f386h4 J7 v2 y8 S1 ]- ?, G. U. r
    jz      SoftICE_detected
; C1 Y# O4 f. p0 i/ e& d9 S% b4 |( n7 \1 X! u3 X9 a
int41handler2 PROC
$ L4 N* j, w* p6 i$ ?7 e* Z    iret
# Z1 _: F& g& nint41handler2 ENDP
! ]# q" m. q9 n6 @- M$ Z  c
  {& ^+ Y0 M' b3 @
- @7 f" t" y2 Z, ]# t+ H8 M( U_________________________________________________________________________7 S0 U, j0 A1 i3 J$ d& P( z: J' n
2 v# l. G* o  ~4 e6 q9 I- o

9 D0 h7 o) d% c5 y0 j6 YMethod 06
6 Z& X# N' @8 f" c) F=========- N/ m2 m& L2 t/ q( Y9 s$ n

  o  Y  P% W6 s. {  a+ x0 h, D
: q8 R9 e& T) b% T2nd method similar to the preceding one but more difficult to detect:  p2 T% v, k% }
/ H4 [  {8 z1 T( z: k- w' |
1 j% E: w0 ~- l) Q% ~7 H
int41handler PROC
* ?9 M1 g0 P- w5 B4 F( r! {7 w    mov     cl,al" `8 J" P- P/ ~8 z" Q
    iret3 z6 t, s% j! M& u5 O( {
int41handler ENDP0 Z! q3 Q4 |0 Y8 e. A
; b6 p1 X" N8 Q3 I

+ R. I/ `0 C9 V# p) d    xor     ax,ax
7 J2 x' U3 g. `1 \! q    mov     es,ax8 f! b/ D4 x, |- @4 |) ]; A+ p9 R
    mov     bx, cs$ S4 q! Y" Y4 G, w
    lea     dx, int41handler, p9 J3 s& k4 ^  ~! Y7 S% E0 G
    xchg    dx, es:[41h*4]
7 w) A, D5 V: C0 [2 K    xchg    bx, es:[41h*4+2]' F9 V$ w$ C3 D9 i0 D
    in      al, 40h: K3 }  q% ^7 q, i7 ?6 l
    xor     cx,cx
# d7 `0 R$ y' k5 t    int     41h. [3 x: D2 M) {  y
    xchg    dx, es:[41h*4]
  m2 S0 O  D( _( {    xchg    bx, es:[41h*4+2]7 n$ X$ f3 W+ Z7 o
    cmp     cl,al
" h  X; f8 v1 q" h0 S0 ^    jnz     SoftICE_detected
5 {& l& Z0 H  K0 y( d8 E5 R
' I: N0 U- i, W/ i_________________________________________________________________________
" }5 z* F" ^. u
7 D8 u0 L# Z4 Q8 i9 VMethod 07
1 [* S7 W! S: d" r" F3 n" r=========
% i% o$ t) @. z) W  a' |
. l& y9 e8 A: A7 Y* rMethod of detection of the WinICE handler in the int68h (V86)9 ^/ f# b. R, x5 v

' E) @. G9 {: A9 U4 A9 g    mov     ah,43h
8 U+ n" m* a, j% `* l2 j( g    int     68h2 C, r2 d5 n# L8 r9 m
    cmp     ax,0F386h& T# J3 _+ e$ p4 F8 l
    jz      SoftICE_Detected8 {* M1 t/ x5 n, B( g# h
6 g( n, |5 T; n0 B- `
1 c( J( O& [4 g! i, r5 f/ u
=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
+ a! O/ @0 k* u   app like this:
8 v1 K1 F# q$ G7 ]1 W$ z* c7 ~% B8 Y2 `& \/ P& V$ F4 X0 F  Z9 h/ r
   BPX exec_int if ax==68. J! e2 e& q- O1 s, x/ p
   (function called is located at byte ptr [ebp+1Dh] and client eip is
& Y) }- h  \) x1 _8 G: P, e   located at [ebp+48h] for 32Bit apps)" q) `9 x: i, u6 l
__________________________________________________________________________2 Y( t8 A+ b6 S3 W) H
9 S4 j2 c  \/ L/ u# G5 f; d( k, N

7 F7 P  a, s0 i4 v5 I4 x& lMethod 086 n: _( o1 p, f  ^' V
=========  N6 h% H" z  z: I' Q5 ^
  X" d- {/ ~' a3 \: P/ W0 x( x
It is not a method of detection of SoftICE but a possibility to crash the3 b5 z3 F/ G- m$ J" ~8 S
system by intercepting int 01h and int 03h and redirecting them to another
( I$ J5 r" I7 z; s8 f: V( ?$ Y/ ~% I8 w5 jroutine., I( i- W. f( u5 b2 q+ i5 M* N
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
2 \) w" m8 Z0 b7 _* fto the new routine to execute (hangs computer...)
+ w2 @  h- l3 J: }" c6 F  G
3 V: Y9 r1 S# T) L: I    mov     ah, 25h  W9 r+ r$ T. L. e) g( O5 Y' E8 r
    mov     al, Int_Number (01h or 03h)
1 O* ^  ^# f/ H; W/ U  l$ r    mov     dx, offset New_Int_Routine' {( c  @' Y. i# T  ?
    int     21h( `/ ?# Q! U* c% y6 V4 p
: G5 g7 J, n+ U! d& {+ ^8 F
__________________________________________________________________________. {$ q7 A' t+ p
* F3 Q6 v/ i, A4 b6 X
Method 09
: b. i$ E. w/ W3 H. |& M=========; G. W6 D% m" c6 p
/ ~( p" l" S- _1 R, `
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
4 g' B8 I( w+ d% ?3 Hperformed in ring0 (VxD or a ring3 app using the VxdCall).
) J3 r" Q3 n0 I" F6 t( WThe Get_DDB service is used to determine whether or not a VxD is installed1 h5 ]7 r) L% s; H
for the specified device and returns a Device Description Block (in ecx) for
) y+ \+ o5 Z' V5 x+ H- Sthat device if it is installed.
2 r+ y+ D! Z+ t8 L  t# E! W; O4 }; f' ^' l+ d- G" s, `* Y
   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID5 j6 V  S( Z# P$ ]* @. b) r; N$ X* m# p
   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-), {/ Y4 p% }) D- K
   VMMCall Get_DDB
- I! d' P- z  g( }9 Z) ~" ~   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed
8 h- t6 Q9 B* M: e) n& P4 }, o- e# s5 i- u9 v: h; I- f/ B: i- e/ d5 `" H
Note as well that you can easily detect this method with SoftICE:/ d, w8 B# ?4 c2 `
   bpx Get_DDB if ax==0202 || ax==7a5fh
; P6 T. k# n" L3 a
; e) S( h. b0 f$ \__________________________________________________________________________: P) e/ D5 i; U8 T6 B+ e

$ z8 W" g8 O+ _% F  q- V8 l2 TMethod 10
0 c" \: T6 w# T=========: X# k$ D. }1 k; j+ s
/ A7 {0 ~, V4 p" `5 z
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with  I" w2 l! u# @4 e0 \
  SoftICE while the option is enable!!; Y* ]- x# d3 a$ R) D' D
6 N8 p# g6 n# {$ e1 h
This trick is very efficient:
" k2 z8 b# }* n* z& @by checking the Debug Registers, you can detect if SoftICE is loaded5 Y. x; t  n% r: _0 l4 l
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if2 e/ _8 f, Z8 e) _. n
there are some memory breakpoints set (dr0 to dr3) simply by reading their8 e5 o* C3 ?* \" @: p
value (in ring0 only). Values can be manipulated and or changed as well8 C$ o/ Y- E$ L3 ^
(clearing BPMs for instance)# Y1 ^2 m& }7 V
- j, N* `+ @8 u
__________________________________________________________________________: A6 ~0 E7 _2 n; x4 c5 h5 h
  b/ a+ [7 t) V8 R, Y
Method 11
( E) b. D& Z; p4 v=========
8 }( [* X0 l2 J, Y9 W% f5 b9 @% y6 V# {: B; m
This method is most known as 'MeltICE' because it has been freely distributed
" B4 d- v, G, ivia www.winfiles.com. However it was first used by NuMega people to allow1 k$ A3 V6 B0 P; j5 y
Symbol Loader to check if SoftICE was active or not (the code is located* H4 R7 V3 r  R: G6 p5 [) g
inside nmtrans.dll).
& e- F% ^' S0 U- k( |8 c& e) E8 F, C7 y1 H) N
The way it works is very simple:* g$ O% @7 a3 p
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
( c& K0 J1 c  H, nWinNT) with the CreateFileA API.2 Q0 T9 L9 J8 c% R( q+ {

9 E' V3 j  S' n$ T. `  g% y) W/ q+ E( I$ @Here is a sample (checking for 'SICE'):; H' P" B8 B1 s4 [5 C9 o$ _

5 |0 H- }- B, B: o: {* SBOOL IsSoftIce95Loaded()
/ G2 Q: k( V5 P1 W- I1 ~{$ P0 n4 Q5 g  s$ j. o* k) K
   HANDLE hFile;  8 _0 i  v9 z( L- s) o8 h# ^: N; r
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,+ P) [8 }0 x+ |* V4 h
                      FILE_SHARE_READ | FILE_SHARE_WRITE,( y- }8 C( j$ @7 d( S& c( D
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);% R4 S9 k! R* ^. h7 W1 Q/ o9 U
   if( hFile != INVALID_HANDLE_VALUE )
3 {" y& i  j+ y   {
( W: ]$ {* h- U      CloseHandle(hFile);4 W: _5 V. \7 l
      return TRUE;
% r* l& C0 w& d   }
" r( k5 Z7 X# Z; m/ H9 j/ ]   return FALSE;  N( O7 V. e, R& |
}
3 l3 Y( N  S3 o. h6 G" P2 G! T) Y0 l5 X" x1 A! ~' T, K! L" r
Although this trick calls the CreateFileA function, don't even expect to be& P2 p) p* \1 A9 n1 @% L/ Z
able to intercept it by installing a IFS hook: it will not work, no way!
6 e# U( f. F# y0 M; T) ZIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
2 d8 ~( W" Z7 ]7 U5 E* R6 R, s* zservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)1 Y  j/ U4 q) Y6 ^+ f1 n
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
5 j2 y2 U& Z/ y1 `field.
- D8 ~( s2 q8 d" i& S/ H" Z; z  E" [In fact, its purpose is not to load/unload VxDs but only to send a
& ]: Y4 W3 v7 y7 K) R7 @* tW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)7 g! A$ T3 T9 J9 C! I
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
" h7 ]9 B) p2 k  I2 T' C2 ~: ^2 A3 hto load/unload a non-dynamically loadable driver such as SoftICE ;-).  c6 X: L& t/ k
If the VxD is loaded, it will always clear eax and the Carry flag to allow
8 _& z# N4 e' t5 T7 Hits handle to be opened and then, will be detected.
' v7 b, Z& s8 o; g' [9 ]0 ?5 B: KYou can check that simply by hooking Winice.exe control proc entry point  Z' U+ Y. C# m0 l* N% p" T6 P
while running MeltICE.% R! ~4 z2 m. H9 q) Z3 s, x
. w' }* |% X/ R  s

* @  G7 [) n7 q8 V  00401067:  push      00402025    ; \\.\SICE
; }. y9 v' b- S  ?8 C+ O  0040106C:  call      CreateFileA
3 Q, g5 o5 @9 X/ A: j0 V) [: ~  00401071:  cmp       eax,-001
2 W, e: N. b: P+ m3 I  00401074:  je        004010913 ^) }: I! o- j( [4 Z  r

' j) m- }0 e# M$ N$ H( B8 T; P! ^$ s8 E" y. d
There could be hundreds of BPX you could use to detect this trick.2 l+ J7 S/ K" l$ I$ c* C) }6 S( |
-The most classical one is:! X: ^1 H' |, K) a2 P* I3 M
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
/ E+ k( l: g& _, B" N    *(esp-&gt;4+4)=='NTIC'
  f+ x9 J4 A/ f  q) I, \
" m# ?" `, N, u/ n! i7 j) Y-The most exotic ones (could be very slooooow :-(" B$ Z' k% y7 o0 i
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  
2 @" g6 n, n: A( _9 `     ;will break 3 times :-(! }7 H: z% P6 ~% b3 y# a3 S3 ?3 Q

8 c" _8 I- X0 h0 {+ C-or (a bit) faster:
  F( X% K0 E* S1 c' a   BPINT 30 if (*edi=='SICE' || *edi=='SIWV'); |8 @) H* `  M+ x
& O& d  V- W7 A/ H! J/ j- ^' J$ C
   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  " [" }8 y  Z! T; J; t
     ;will break 3 times :-(
# e- E  O# p* P* _) Y0 r& B) Q$ |2 Y7 P0 d
-Much faster:1 D  x$ G, Q5 r  k+ a' ^
   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'
% _' C: Q/ \3 H1 n8 r7 l, T" y
/ L' N" c; p" sNote also that some programs (like AZPR3.00) use de old 16-bit _lopen) ^$ H7 n, t) N" S
function to do the same job:
; R" e3 k! |$ s6 n' S
! I6 X8 N& I: I3 ~& V: \   push    00                        ; OF_READ1 f% D6 m5 S% U% x" j
   mov     eax,[00656634]            ; '\\.\SICE',0
: g! U$ y. i& k, f' {, B1 m   push    eax7 \% G- X! I2 x) D& b
   call    KERNEL32!_lopen
6 i- b- E5 b7 H# G   inc     eax9 U0 J+ |; z" I) g/ X6 `
   jnz     00650589                  ; detected
4 g1 K5 @3 |0 @7 c   push    00                        ; OF_READ
# O3 n# Q7 q8 T) I( G- t   mov     eax,[00656638]            ; '\\.\SICE'
: c2 l0 `3 x  c' ?" P   push    eax
* E! h; \) y* ?8 b1 n. `   call    KERNEL32!_lopen) d1 g( J. t8 z0 z! g9 Q6 `
   inc     eax
, _9 [6 b) R4 ?6 ~4 Q   jz      006505ae                  ; not detected  ]7 v; `9 v6 W, k

' L4 b$ J+ U! f2 S
& \8 J# R* W; N5 p  l5 s__________________________________________________________________________" W+ C9 f9 D$ t( f/ h+ w

- M0 f. m( J$ ^$ Z' ?Method 12
$ Q/ L  D/ T" P6 E1 L/ E=========: Y9 z. z4 X" f0 Z& R

& P6 |5 I: V. l3 ]) ?! j. MThis trick is similar to int41h/4fh Debugger installation check (code 05# |5 k+ I5 C% G1 o$ e4 E/ L
&amp; 06) but very limited because it's only available for Win95/98 (not NT)' T* u! i( I7 a- v6 R& G8 U
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.& }. [2 b0 l- P& n5 B
% n% K7 y% C. a& e9 [
   push  0000004fh         ; function 4fh
9 `  q& @; U6 C( s" K   push  002a002ah         ; high word specifies which VxD (VWIN32)
/ x3 ?1 F) ]! a: P                           ; low word specifies which service: Z! @( ]) u! _0 }. T
                             (VWIN32_Int41Dispatch)3 u) K8 @& L0 u( C+ q
   call  Kernel32!ORD_001  ; VxdCall7 s1 R; `" L$ w$ d
   cmp   ax, 0f386h        ; magic number returned by system debuggers) q- R/ [* F  S# S% g$ h6 a2 [6 o9 z  P* p
   jz    SoftICE_detected
4 @$ p% q  W& J1 @$ E
  |, F! D3 c7 n2 v$ rHere again, several ways to detect it:* {+ @/ Q, ?* n9 F; Z
& n3 O# R7 U% v. B8 C  k) W0 z
    BPINT 41 if ax==4f* B; v( w0 o- l$ U/ t+ e

% N) Q9 H& a; n; ?    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one
: F+ ?% w% N6 L8 W# x- k/ _- P. h$ R
    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A- J' p6 C9 |  k

6 f8 j6 d7 k, `% [8 a+ J! B    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!
4 O; W$ q- r. ~- u% r' A0 F7 l& \0 O: J+ V9 c* ~  \" c
__________________________________________________________________________  `# }* E/ s$ F/ T: T
, j2 `9 v* d  V/ w9 t7 u
Method 13! O& i" \, Z: Z) J& a" I" j
=========
" c8 T8 a. ?2 I0 k- ~9 Z( a8 s7 J6 g) J- }5 X
Not a real method of detection, but a good way to know if SoftICE is
$ ?; \* p9 ~; a" p( D/ W" yinstalled on a computer and to locate its installation directory.; ]4 |. X& l& c7 p: `7 F; M
It is used by few softs which access the following registry keys (usually #2) :1 E4 m$ \5 i0 z$ C
2 I4 f. w* k: @# P! p  O
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
! |$ Q0 C" V2 j  w) r4 G: J\Uninstall\SoftICE4 ], M. F8 ?' i% x3 {) R
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
) {2 s  b7 e2 w1 ?  ~$ `-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
4 L; d+ b. W0 A# I, F\App Paths\Loader32.Exe
: T# ]9 S; N- t$ s/ q3 V; h) O3 i+ s. s# T6 v5 ^
% R9 w0 l" W7 c6 ~1 G" k% J. N
Note that some nasty apps could then erase all files from SoftICE directory7 L, H0 C/ H) \9 G- M5 M# g) E
(I faced that once :-(" o  D* V6 o  t7 F$ u9 [

, a' u$ z1 o# ~: O0 y0 [/ `0 KUseful breakpoint to detect it:1 B6 c& s, S# s# F

1 x7 g) D5 K# r- w$ u4 R9 |     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
3 s3 t! C8 s: @, Y7 N2 P  b" W, `/ t: _1 K7 @% L% [) J  Z
__________________________________________________________________________6 H7 T$ }) }# z- s2 W. S, Q8 ^% ^

/ ^- u$ X6 X+ b$ E2 P9 {$ u% d* d# \3 _2 Q% ^( ~
Method 14 " O/ x; T! u6 R. b. n+ b% A
=========
( ^5 o  K) E4 n5 H. d0 E
8 s* v8 F! w# V& k& ^A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
: @# S  ^1 U8 f8 p7 h' Ois to determines whether a debugger is running on your system (ring0 only).
' t5 v# }0 p+ b: L! Q1 H0 I& d9 R4 R3 ]* P
   VMMCall Test_Debug_Installed+ u# e- |; ^" Y
   je      not_installed' m& Q) n3 U8 f% _

- w) t, J/ N# j  HThis service just checks a flag.. j6 y0 ^% w" R: |: ^
</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关注公众号

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

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

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