About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>6 G8 C9 v+ v$ p% e( Z5 w- M
<TBODY>5 Y/ N% t5 x% B4 J0 d5 d; t8 W
<TR>
" ?% L, j2 D& X# t<TD><PRE>Method 01
: M* Z9 C4 |2 O- p=========
5 G+ ^# c8 O) u7 V) H3 @5 y; f3 m5 H% S4 z* ?, Z6 G
This method of detection of SoftICE (as well as the following one) is
4 v( R, v3 o! W: L2 vused by the majority of packers/encryptors found on Internet.' A) b& q* |8 u1 W- A5 @+ m/ u4 f
It seeks the signature of BoundsChecker in SoftICE+ j6 l8 l0 \1 P) E
. Q' e6 m2 J0 A/ [. ~
    mov     ebp, 04243484Bh        ; 'BCHK'
0 b+ c! v+ x$ q4 m/ d    mov     ax, 04h
, R) W( x' @  H    int     3      
+ d& {" m- r" g/ n" h    cmp     al,4+ I" x0 t; ]# z  f+ W$ g
    jnz     SoftICE_Detected
" a6 f* k0 {0 [( O9 |2 H* l+ B- R! |: ^" T
___________________________________________________________________________
& {/ t% U' [3 J% @# u
* `0 L% e9 s7 T( E$ y7 h2 eMethod 026 i" H5 j) G. m
=========' D* v! V2 r& a1 p( i* j
" S0 Q, r; T4 a: j' c, O
Still a method very much used (perhaps the most frequent one).  It is used6 w4 t- _. G$ n# F) H, Y0 m
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
" z0 x$ f! K' C7 u- gor execute SoftICE commands...
. [$ h4 @# J1 N; RIt is also used to crash SoftICE and to force it to execute any commands
" D3 y9 G8 U  p! N1 T(HBOOT...) :-((  
9 c% X8 K& O1 ~; Z; D: x
" `/ ~. i" f; m' PHere is a quick description:/ e- N$ |, Z. Y8 o5 M2 n
-AX = 0910h   (Display string in SIce windows)
& ^2 E) m6 c$ Y+ v$ i0 n! f; Z-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)
4 d; N" M9 s# `6 n: V% h6 m-AX = 0912h   (Get breakpoint infos)/ ?0 ^- \- n9 x: `1 `( R4 j! `
-AX = 0913h   (Set Sice breakpoints)4 S% F: e5 h3 u* g- j) w4 i
-AX = 0914h   (Remove SIce breakoints)
' |5 F! s2 D) A: T. ]$ R9 h" G+ H% E3 ?; u, s
Each time you'll meet this trick, you'll see:
( ~! Y* M6 s# _) V-SI = 4647h, ?  u. v# X6 U+ E4 S6 j
-DI = 4A4Dh
: I- Q2 D$ N5 v2 V  G& h8 wWhich are the 'magic values' used by SoftIce.
* Y7 A5 I3 }$ w2 X' M( c0 p5 u6 Z3 ~For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
% K! ]6 ^# h4 s! R, w6 l( m2 f
/ H! S- r: h1 DHere is one example from the file "Haspinst.exe" which is the dongle HASP- i2 a& H" g3 d6 x
Envelope utility use to protect DOS applications:/ U+ R+ l0 Y( o7 [# f( O5 W

$ \+ a9 B4 N- E- e8 G8 u; e3 M6 G+ z$ y- ]
4C19:0095   MOV    AX,0911  ; execute command.
  S! G6 ^8 {9 B6 G3 J# ?$ H4 e4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
1 Z  @% M- e0 a3 b9 A4C19:009A   MOV    SI,4647  ; 1st magic value.
+ ~; d/ u+ w# H* t* O4C19:009D   MOV    DI,4A4D  ; 2nd magic value.; q; k% y2 a5 s
4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
( Y( d0 s5 W" n8 R+ v4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute: ~3 H0 G0 {- E% {' C7 i
4C19:00A4   INC    CX6 H- s( A. A! X% _: S3 `7 e
4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute: O* f; m: D0 `2 M
4C19:00A8   JB     0095     ; 6 different commands.7 T) Z" j) W! q% G3 g
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
; J; c" I& {! s. {4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)
5 T2 U, U" x" c" e/ m7 |8 A: I7 L3 E% g
The program will execute 6 different SIce commands located at ds:dx, which+ l7 s/ N9 b9 B7 ?
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.2 f- J" `3 B3 M8 j$ C8 j
, W8 F* s" @3 Y, J9 ~. f
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.5 J/ z& C3 e$ y% [8 ~' i; a0 \
___________________________________________________________________________
0 E- e4 o8 T2 q, o# P/ O+ E% M% P. b; `5 Q9 F8 r. j

9 E* v# a& l% t4 i9 O# [/ l* _Method 03
/ l, L1 ~- K+ @0 b2 L, s0 G0 k. _=========6 C; {! M1 Q2 M* `6 j
- X6 r. V/ @& E2 [& z
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
' a0 V/ k  \8 K$ q(API Get entry point)4 A6 n3 h% U0 ]6 ~0 J& t9 J
        ' |$ b8 Y/ \( u: K2 Z) @/ `

; l( Y8 _% Q5 m9 X    xor     di,di/ U/ i6 S- {+ d9 J
    mov     es,di
4 m8 l; B( r. u) ]( r    mov     ax, 1684h       # }+ G8 ^6 g2 s/ j
    mov     bx, 0202h       ; VxD ID of winice
4 g+ V4 s7 h: G6 R1 O+ e7 K    int     2Fh
! E5 P3 ~% {& h) L8 U* {/ q$ C    mov     ax, es          ; ES:DI -&gt; VxD API entry point
% C5 m- F6 ^$ y% t* d5 a    add     ax, di
  O' Q# A  q3 N) n    test    ax,ax" l, i# v) `1 B) w" w! H
    jnz     SoftICE_Detected
, {, R5 F: Z$ }' m* t, n! K
% @) u7 d8 R! \5 Q* x; f- Y___________________________________________________________________________: W  }2 u7 E1 W2 i8 q8 q9 o+ w- b

7 q' P+ s  G! t; n- RMethod 04# V% M& _' h0 ~/ i
=========8 i: s2 A6 O' P9 U( V: \1 t
: @8 O6 `' \' \$ x; _4 S
Method identical to the preceding one except that it seeks the ID of SoftICE/ s3 V0 E" w* {8 l  M
GFX VxD.
$ y' W0 t- G: ^5 r# P8 S' E# c
    xor     di,di8 {# s9 w9 A$ \' h8 c5 _. Y
    mov     es,di* _( d9 j$ k2 I) T
    mov     ax, 1684h       & y0 X' |; F2 @! \
    mov     bx, 7a5Fh       ; VxD ID of SIWVID
( R4 |; Q5 j# V, k    int     2fh4 G( d: W3 S( V' K& u- e
    mov     ax, es          ; ES:DI -&gt; VxD API entry point
6 a$ i- u2 U$ C+ l/ O& @    add     ax, di
0 \( P& n1 z$ w  H: o    test    ax,ax
- H" B; j; W* }, }* M( }    jnz     SoftICE_Detected7 L+ x3 l7 C/ f# L& t* a! ^

" K# R3 G# _% g__________________________________________________________________________
3 J- q  r/ h) r; O
( g. ^8 C" r8 i) `/ l, R, M" g& D" K5 N2 T& ^- F
Method 05
8 Y* |4 r5 D) U9 H" A/ ?. {" |=========
, P6 k: D0 V. h! q7 A7 e* X/ b( Q. T# R; a3 c% Y
Method seeking the 'magic number' 0F386h returned (in ax) by all system
6 o# k6 Q. m0 T) p0 H7 \1 R4 Zdebugger. It calls the int 41h, function 4Fh.! t9 ^) y9 _) }9 {: T/ W; Z! i! U
There are several alternatives.  + R; t8 k) f( ^8 _" _! h+ @& R" I

8 p7 h7 ~; A4 M: pThe following one is the simplest:
2 |' N* O9 o* t8 w; U& C1 u
, }) z6 x! M0 ]" }    mov     ax,4fh
; }/ u7 h3 t  g. `& r+ I    int     41h' C+ P5 D# |& ^4 {
    cmp     ax, 0F3869 @2 U% P7 F; \) O  i
    jz      SoftICE_detected+ }7 U$ R/ v. K/ k# y4 f

$ Q0 y& C& p1 x2 l% U1 k, p' D* n# A6 N% ?8 @2 Y5 g" F0 G& t8 ^
Next method as well as the following one are 2 examples from Stone's 8 _1 U0 w- X; Y0 F
"stn-wid.zip" (www.cracking.net):' ]5 d/ h0 |  Q

8 H1 \+ c' F6 t; u: r    mov     bx, cs$ h0 P$ ]. [% ?1 f0 m
    lea     dx, int41handler2/ f, n' v1 \, _
    xchg    dx, es:[41h*4]
2 s" r+ Q7 y4 K% R+ f6 b    xchg    bx, es:[41h*4+2]5 G- w! B" b. x: [) o& m
    mov     ax,4fh
* T. l) x3 U  B8 h, Z* P    int     41h
$ P( d2 B& S" S$ k! r7 v7 P0 \    xchg    dx, es:[41h*4]0 o& n6 F2 Q8 ?7 N0 ?% Y
    xchg    bx, es:[41h*4+2]3 {8 G8 y1 g: r$ w( x/ L3 G+ E6 y( b
    cmp     ax, 0f386h; B* g' b5 W/ u! ^; Y( x9 n: K
    jz      SoftICE_detected" a- B5 `# w1 Q  r

. M" E  p/ i# J! ^0 u/ x: [int41handler2 PROC% I) K4 i, n# F1 L! U+ G" c( a0 A
    iret
1 p0 H$ K6 {& A/ C! Z' ]: jint41handler2 ENDP  P  {7 p) M6 }8 ?7 C# j

3 `5 V( O% q* Y( X  ?( Y* D6 k
( W7 u2 y- ]3 h5 m1 j7 b! ?_________________________________________________________________________' Q" l, g+ ]0 ?1 p# V
1 G6 c' E- u, ]- r% Y) W

) L) T: e6 q/ s- [( i1 dMethod 06
, S8 w. u/ b! @- |: V8 M7 n- K=========% Y4 _& Q! u% j, i2 Y
5 F" L5 T# h% J

- f% a( M+ v( i3 c2nd method similar to the preceding one but more difficult to detect:
2 y! [" |' P+ a0 C& G5 }
+ G* [, b7 \$ r  ?( M
" d. t' V' n5 d4 t$ l) l7 |int41handler PROC! e7 B* X: M! l+ x5 M9 j6 x  i
    mov     cl,al2 X. m9 V  y0 L6 }! y9 W7 W: d
    iret
5 x4 B+ ~0 u/ d1 g( ~$ F: f* P+ Mint41handler ENDP
+ T7 v2 B7 a$ g1 k7 |3 v7 F  q2 T5 b* f, x. Q% R- G
+ J+ _- y; q: `0 b* S( `( |. k. _
    xor     ax,ax
+ g$ a3 o/ ?0 ~9 p) c- z    mov     es,ax
2 {7 b# I5 r# E' E" [    mov     bx, cs
$ N1 g6 x, j) a7 j; r* ]/ J& |    lea     dx, int41handler
3 p( x+ P! \+ E, F! g  F8 l    xchg    dx, es:[41h*4]
1 X) V/ j- S( }. p& k    xchg    bx, es:[41h*4+2]
) D5 e9 W$ t" f: G9 }    in      al, 40h
' W5 E/ \1 s6 R( z9 L    xor     cx,cx) R) ]' f% r+ W0 o/ }- n
    int     41h7 x' ^/ H  i2 @
    xchg    dx, es:[41h*4]4 y1 S8 ^8 e8 R3 M6 E& V
    xchg    bx, es:[41h*4+2]: _: T) u# S4 p0 p# R# k  I
    cmp     cl,al
1 A4 u" Z# G* ?2 q: O" W0 _    jnz     SoftICE_detected
% N; C7 e# M- p* l; _7 A  q. D% q4 ^! v8 F- _- G) j
_________________________________________________________________________, D( w. s1 D. I

# m2 f6 n) H3 [2 ]( v' rMethod 07
' D: ^- |) O* S7 ^$ s=========8 T8 ]+ L& R3 G6 n
4 L* J9 [: }: y
Method of detection of the WinICE handler in the int68h (V86)8 W1 E" N( H, [' z$ y; u
. _" N% i- M5 ?! V% ]* C, x# T
    mov     ah,43h0 L1 m! t! \. j3 B0 v4 k
    int     68h
9 Z: b8 v1 J( S; Q3 |, j; u    cmp     ax,0F386h
5 d4 f) z: V) D: G    jz      SoftICE_Detected
5 P: v8 N: K5 j7 |. |) m5 O
& r- g0 g) N3 g. P3 _7 ^' p
& ~) l. L9 f8 T7 |- D6 c; e; l=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit2 w1 W! d. K: [- _6 |) ]
   app like this:8 {2 H7 E. d) L/ O/ ?2 Y+ K, l
. S! q2 r+ v# d; T0 x
   BPX exec_int if ax==686 Q: p8 f5 T7 q5 G
   (function called is located at byte ptr [ebp+1Dh] and client eip is- O4 [6 }/ w. U2 d6 W% d
   located at [ebp+48h] for 32Bit apps)
' T6 C) g8 Y7 \* ?__________________________________________________________________________
' {4 |" {3 e7 w1 t! c7 ?
# p* y; @1 Q1 v1 N& D, M$ t( }0 s  ^- T- m( f
Method 08
. X9 s8 J, w: U* Q9 [=========
1 n  }) `  P8 @$ f, S  r; Y  b2 d- D4 A5 n5 R
It is not a method of detection of SoftICE but a possibility to crash the
8 v' r! K; C/ g' ]  msystem by intercepting int 01h and int 03h and redirecting them to another
) O  a. T' U7 g3 R, f- hroutine.2 T: w: Y" d; Z; y: c/ c
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points" D' i! t4 H/ r; N# n
to the new routine to execute (hangs computer...)
: q4 J- D5 L3 O: |7 ?( g" j
7 E( S4 b( v+ p    mov     ah, 25h4 ~& Z! t  s2 P7 g6 T4 @4 c
    mov     al, Int_Number (01h or 03h)! X! }* J) Q5 ?3 y4 d) j2 e
    mov     dx, offset New_Int_Routine
/ B  x9 c- b. N, p6 F8 J7 \# {    int     21h
0 ~1 h# }$ ^9 J; E0 B. R
' s$ J0 |( o' p& {' Y# p__________________________________________________________________________0 t) X$ @: ~* i9 {3 J$ X: e

5 h# x" ?- B2 c0 e# p) Z0 M' EMethod 09
8 A0 w9 F7 b5 c. H4 B" ]  e=========5 w( u$ F$ [( V6 ~. y) U+ A

6 r5 L1 ]9 `* YThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
- g: M! ?4 n& R" l2 ~/ m8 \performed in ring0 (VxD or a ring3 app using the VxdCall).
4 H* s& }2 S8 VThe Get_DDB service is used to determine whether or not a VxD is installed
* F% ~1 Z2 c* J9 D9 K( \: U2 z% z( qfor the specified device and returns a Device Description Block (in ecx) for6 b; x5 Q4 t7 r1 {/ L
that device if it is installed.
6 a+ q, \; w3 ^8 c' A) m$ Y  f& G; z/ O, w: v- `" T$ }
   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID& S" T% U! |3 ^6 ^- w
   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)8 V5 j" e; j# w5 e
   VMMCall Get_DDB
3 {! P( G# N: M: O' O6 m1 |! f; j! z   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed5 H: W! l( D; x7 }: d

- Q5 z% z9 h- P& l* t5 CNote as well that you can easily detect this method with SoftICE:
1 o9 i4 K: W2 K   bpx Get_DDB if ax==0202 || ax==7a5fh
2 z  v/ E8 w8 q1 g
8 o$ q3 \0 I/ A__________________________________________________________________________
% u* r: M- z7 ^2 ^  y
+ J" x. E! `$ ZMethod 10! a/ B- {0 k3 u& a" e7 P0 x
=========5 Y* J( h* I5 v% r! m
' o1 E( y9 ]7 X5 K! y. y
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with
& a) X) d$ V" y$ T, G  SoftICE while the option is enable!!/ C8 ~: V; D2 c' X6 I

5 q( V5 o9 p' `1 ]( eThis trick is very efficient:+ u0 w! K6 e! y- M' [0 d. F
by checking the Debug Registers, you can detect if SoftICE is loaded7 ~: V9 @2 q6 Z# c; x
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
2 E0 Q) o) Y* k% Ethere are some memory breakpoints set (dr0 to dr3) simply by reading their% I% h1 ~4 }* K0 _; j6 V; C
value (in ring0 only). Values can be manipulated and or changed as well
& l2 A6 P' U; `; g5 s(clearing BPMs for instance)
1 R4 [" O3 U2 R# N4 J7 A6 j! f. \  O( r# ~' O
__________________________________________________________________________! X- o2 V; X( s" {# n5 s  R! o

% S# L1 V6 Q4 _Method 11
: B4 c: a% G& t. r=========8 ~+ L3 x* A3 G+ X7 P8 M) ]

; ]4 ~# z/ s- q- ]' ]This method is most known as 'MeltICE' because it has been freely distributed8 ^( G8 z- M  ~7 L: Q
via www.winfiles.com. However it was first used by NuMega people to allow- m9 T! W. l9 f% q4 i
Symbol Loader to check if SoftICE was active or not (the code is located' r5 H+ L4 b3 l1 ?$ |" X. B
inside nmtrans.dll).
! X& }/ ~5 N. H7 Y5 q/ G; h) Y
; S$ n- a8 p* {8 fThe way it works is very simple:8 E: K, E$ o& d5 F
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for! {7 {7 b' s9 h( F( b5 I' |
WinNT) with the CreateFileA API.8 c. L" F; x: ]/ o& ~

  j" B( m$ p$ V+ o/ m; nHere is a sample (checking for 'SICE'):8 U  P8 v2 x" T5 Y  z0 Z

. S! h- b. Y$ zBOOL IsSoftIce95Loaded()
+ S- v# \9 T- H" S" V- L' @+ C{8 ^7 X! y; S5 D. a: Z0 z( Y
   HANDLE hFile;  - @" S0 o# _5 J2 Q! a* _2 }
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,( B1 c2 k( H" Q) W8 B' g# f! Z
                      FILE_SHARE_READ | FILE_SHARE_WRITE,, z& C, \0 K5 D; V" c: L6 H. R2 o
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
$ r0 A8 U$ `4 I% [: _   if( hFile != INVALID_HANDLE_VALUE )
' Y% Q. g3 G/ ], U8 a   {% i1 f5 m6 F9 B/ p7 M
      CloseHandle(hFile);% n# b& U& h5 A3 I2 v
      return TRUE;
' Q/ c; \# ?7 X   }# x; N) u1 P# Z# E/ F0 Z& b
   return FALSE;# n$ v5 |0 p0 Z
}4 L0 T% U6 M$ z* S/ ^& s- }

4 h7 ?0 f! [: r# V# ^5 lAlthough this trick calls the CreateFileA function, don't even expect to be# `5 ~( i# n7 a6 d6 V
able to intercept it by installing a IFS hook: it will not work, no way!# s5 y. {' l/ @) q
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
* y8 w& }2 A4 U( Vservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
( [  w& r! I$ n3 Band then browse the DDB list until it find the VxD and its DDB_Control_Proc
* B1 r- [( ?7 H& A9 ?% g$ Sfield.
4 }) X8 C- ]9 i$ F# B* pIn fact, its purpose is not to load/unload VxDs but only to send a ! O  x+ h0 B8 L7 M" a
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)+ G  T: M; O% h* Z# \
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
5 l6 b6 |6 M) l( @! S& hto load/unload a non-dynamically loadable driver such as SoftICE ;-).3 D  R( k' u# b$ E3 g
If the VxD is loaded, it will always clear eax and the Carry flag to allow
/ S) d0 f% {0 @0 U2 Lits handle to be opened and then, will be detected.
3 [" Z2 K( \# yYou can check that simply by hooking Winice.exe control proc entry point5 |6 n, F# u2 Z: ]
while running MeltICE./ Z$ x7 u& |8 D. B9 ^

8 G+ N% S0 _  ?+ j; ~3 Z$ |* z  }& r* ^. g, q8 w3 R" v7 T: s
  00401067:  push      00402025    ; \\.\SICE2 Q; f5 A8 b7 U1 @: {" K
  0040106C:  call      CreateFileA
4 a5 m& n: b- {5 w* d' S  00401071:  cmp       eax,-001. K! W. {- W  ^5 q; k
  00401074:  je        00401091
* q8 `' h* l0 ?/ Q) \/ R
& [; y# f3 q- g- A, A0 ^5 O& G
& Z" g. J" k) [) f+ E1 LThere could be hundreds of BPX you could use to detect this trick.! k" N! ~( U) b: R( @/ o* Q# K, _- F
-The most classical one is:
3 Q* L: a- i# q& j; F  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||; O. a( g8 X0 e7 D! p
    *(esp-&gt;4+4)=='NTIC'0 E! ]3 r& C% D7 d; z7 o3 H

# R. M3 B9 C& N3 B" ?6 g6 a  A-The most exotic ones (could be very slooooow :-(6 \0 d, q6 F# r7 ]  Y$ h1 a, o
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  
- K2 T5 U% U2 B' S     ;will break 3 times :-(
2 A- k! p/ L2 L7 e) w1 _
* }, M3 v  o8 V7 t4 V-or (a bit) faster: & m2 W. `+ \, B3 c
   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')( u2 `- d( `7 B

" q4 ~1 L& x9 x   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  3 }4 e) j( _3 N. B  }; x' q
     ;will break 3 times :-(, O" n! |$ n2 B5 t% z

, F; a5 x2 B) |2 E$ l-Much faster:
/ C7 u" a( Q3 O/ M# V; I) S   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'
' @* m8 u  `2 \8 W" n* b% g+ A
' z# {3 z$ {, z" Z8 e+ E, ^' A- dNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
& @: i# r7 {+ a0 i4 T" O, V7 pfunction to do the same job:
! U: h7 d$ H; b' I7 {- c
6 W2 ?( W1 b  w3 R5 q   push    00                        ; OF_READ
6 k6 a6 ^, M5 n7 d- V& {! X! F, g   mov     eax,[00656634]            ; '\\.\SICE',0
. U' y+ {- g: k2 `3 }   push    eax6 I$ `/ v7 U* g' A
   call    KERNEL32!_lopen
$ W& y, U4 H. _* j   inc     eax# t' \9 v5 h% N, Z
   jnz     00650589                  ; detected4 Z- h; W" L7 W# Q" v; _# {
   push    00                        ; OF_READ
/ z, |; V9 O! y1 y0 N; ^" g   mov     eax,[00656638]            ; '\\.\SICE'
6 p' H# Q' v' N# n. j   push    eax$ f- `0 W$ B$ H" y0 i6 p; r: Q- g
   call    KERNEL32!_lopen
" j; v5 K3 G0 `# G' I) [2 r+ }   inc     eax
( _% a8 `" Y9 F1 A! ]' L3 T* z   jz      006505ae                  ; not detected
. ]5 I( D* A* I' [) e  s+ H) O, J* T% [9 q! l* |0 {8 z
4 ?4 J! W7 S" h8 r4 D8 }
__________________________________________________________________________" b6 z) h% B0 I/ J1 L; e

) g4 |  `( G8 C  m: C1 o0 b7 QMethod 12
, ]& I7 O$ ^+ F% ]  N# i=========) m  E# x# d2 k  d2 p

9 @1 q& ~* P6 p2 F' X$ n. @: MThis trick is similar to int41h/4fh Debugger installation check (code 05/ y" T" {, b4 y( ~5 x1 h
&amp; 06) but very limited because it's only available for Win95/98 (not NT)2 m% X2 @0 C1 H% w( N- S4 Z  z  _' D
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.. k) c! v* K" ~; n4 E# ~" h6 q
6 z; U4 k1 D6 m" v: e' ?. B
   push  0000004fh         ; function 4fh
2 b5 w* u: m% [4 N# F8 p   push  002a002ah         ; high word specifies which VxD (VWIN32)3 t( L/ K% L. E, e2 B
                           ; low word specifies which service
+ L* e9 I. k- j1 G" m                             (VWIN32_Int41Dispatch)) F) s' c4 Q3 \  x# J4 v
   call  Kernel32!ORD_001  ; VxdCall1 H% K5 j5 y  j' W* ^
   cmp   ax, 0f386h        ; magic number returned by system debuggers
  A% l8 @, {3 c2 I1 G& Z7 c   jz    SoftICE_detected
4 q+ p# f8 j4 M
5 R: n  L% e. t' w, C& D5 J9 BHere again, several ways to detect it:# {, ~( s2 {0 D8 ?  V, I6 n1 V
+ O" k; v! A7 X+ e  s4 s
    BPINT 41 if ax==4f8 N- }7 g. _. A& _7 Z! B3 t+ _+ _

: w, ?0 ?4 a" f% M    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one  |* {1 O3 }( Z
1 k, g: ~0 l8 N! V. s' Q9 W; r
    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
- b, c1 p$ H3 K4 Z( Q' Y& L. t; d: T
    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!
4 X+ o4 _! B/ }/ D' X) Y, W
# y( t8 r* a7 t__________________________________________________________________________
7 J( Q0 ]6 E6 i, q  P. R/ o! C/ W9 Q+ k- g, r
Method 13+ h! h8 x9 M9 [% Y
=========
* s8 z8 w0 k& T) r0 w( w! r9 d2 G7 }$ c6 _! J
Not a real method of detection, but a good way to know if SoftICE is
. G. e, ~: Q+ Q3 r% U7 m  @installed on a computer and to locate its installation directory.
5 F5 F6 W' K1 E# b9 c3 l* qIt is used by few softs which access the following registry keys (usually #2) :* {5 y5 Y4 _  ^" Y# M

( m7 M2 x' F' l7 X- i4 l-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
/ `* s" \% P7 l8 @5 v) l" `* O\Uninstall\SoftICE
0 a; p' s0 n/ ?+ u& B-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE3 u5 k6 B1 S! l2 W  E
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion/ d& x9 O% U* \( h
\App Paths\Loader32.Exe4 x7 L- B/ c9 R% X% c0 F
; N. D9 r3 Z4 [7 t* |) y
9 S; T4 k" N4 p
Note that some nasty apps could then erase all files from SoftICE directory
4 ?9 P; n- n2 D$ L9 Z! z* C- e7 ~(I faced that once :-($ A% k& D* R" R- L, K
& A2 k  O, _! j- K" E7 ^+ s+ ], p# i
Useful breakpoint to detect it:: |0 K8 ~; q; A8 `

2 n, c9 ?1 ?% z0 o5 y: ?; ]. |     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
* z- U% o0 l* w% A3 o7 L  |; B$ D% v  [, c7 }
__________________________________________________________________________' e& h- C6 ^9 o5 V; d' g! l4 Y; H
8 Y) G3 p# [0 `5 ]& I  Y

5 P- x! m0 \: G8 u  vMethod 14 . H6 ]8 h0 J4 ]8 |$ V% _
=========; m7 s6 [/ e) o9 [

1 }2 x. H) e8 y" I4 C( {5 f7 tA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose8 A; o+ g2 ?" M; O
is to determines whether a debugger is running on your system (ring0 only).' c- x9 p) p' E. }" ?2 q

+ f; I( o) X8 j7 X7 n   VMMCall Test_Debug_Installed  \4 J0 n. ?) ]/ p
   je      not_installed
/ \2 ^4 Z& h' H! l1 [; @2 e
8 u# i' g  N( X* R' K& lThis service just checks a flag.5 ^3 V$ l& R% Q' \9 @& D
</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关注公众号

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

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

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