About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
* g8 f! y3 i. |3 ^<TBODY>
! T$ y9 p7 Q7 R, g2 A7 E<TR>
- w- p* g3 z* r8 O<TD><PRE>Method 01
1 v6 z8 }+ b- J3 H& }=========% z( l! G. a# M- e
* D2 u( {* y3 k7 k' m' q( l
This method of detection of SoftICE (as well as the following one) is
8 q2 n7 h0 B$ E( Wused by the majority of packers/encryptors found on Internet.& y! |" j0 ?0 C5 i9 [3 g5 b
It seeks the signature of BoundsChecker in SoftICE
$ P/ u2 ~6 I- ~" [' S$ F9 h6 D# b# D6 _: r+ p0 j( X4 d' b: a& z4 h
    mov     ebp, 04243484Bh        ; 'BCHK'9 ^! y% R' U/ x& f4 Q  B* d% l
    mov     ax, 04h
4 @0 G, }/ X9 \% P4 x    int     3       : B4 f- Y% X4 Z: @
    cmp     al,49 ~& \  c( b/ J$ C& x0 b$ _( S
    jnz     SoftICE_Detected
: d; y7 K# \" }/ m$ o8 X8 K4 o! ]% I" M3 h1 Z# _
___________________________________________________________________________! W& Z$ V! y/ D3 u4 D
' M0 L. X6 z1 z) ~, i' W
Method 026 f+ b2 z* w2 U
=========( b# s* H' f- x0 H+ B

1 G* Q0 Y2 S" U. L+ E+ \% EStill a method very much used (perhaps the most frequent one).  It is used" f8 A* Z1 N* g5 R1 {7 f, ]/ X+ W1 H
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,% t# L$ G" Z  ^# u/ A
or execute SoftICE commands...
9 N1 _8 T( x8 F6 P* KIt is also used to crash SoftICE and to force it to execute any commands
7 [" Y( P  C* V- w(HBOOT...) :-((  
' P) l" A* i  V0 z' K- E6 d% X- T9 Z) N
Here is a quick description:
$ J! t! [+ b9 {-AX = 0910h   (Display string in SIce windows)8 J, J/ s) z* |9 E2 p
-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx); h9 a' {2 ?" f+ I5 p: {% u
-AX = 0912h   (Get breakpoint infos)
9 K9 J/ l* W& B' D  u" Q- U5 d2 Z-AX = 0913h   (Set Sice breakpoints)
- i0 R0 _$ Z' ~  D5 I4 W& G  r-AX = 0914h   (Remove SIce breakoints)
; y4 V; ?" Y% }6 L* I& x9 f0 j/ u! g( Z
Each time you'll meet this trick, you'll see:+ M' t% \4 k0 t- `: E6 B/ H" z
-SI = 4647h
( A' ~$ r, S% s-DI = 4A4Dh- f4 `5 d- t1 Y% Q' ^; r  H
Which are the 'magic values' used by SoftIce.3 ]% I7 }3 p# C7 ?8 z7 _
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
& p7 _- l. V5 l& v6 j+ {' L/ J4 v+ K! T& ]+ t2 M" B7 |; ~0 }
Here is one example from the file "Haspinst.exe" which is the dongle HASP! h" [. ~! g, ?% l6 m) O- ]& F% Q$ o! {+ x
Envelope utility use to protect DOS applications:$ {8 p9 i5 X# ~/ L  {4 x+ X

2 x; L9 t/ A1 U+ _, e! X' m0 Y. @2 v! c7 ]+ ]
4C19:0095   MOV    AX,0911  ; execute command.$ K/ `& f+ s/ F- w" ^/ z6 ^: o
4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
# m6 \# l  Q* W' k/ q8 Q& N4C19:009A   MOV    SI,4647  ; 1st magic value.
' m3 p0 F3 f$ _- o4C19:009D   MOV    DI,4A4D  ; 2nd magic value.
5 ~! s& K* O* p/ b, A; z4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
4 W/ f/ U+ b: M, _4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute
. ~+ u8 z9 n7 P$ |4C19:00A4   INC    CX
1 B; g8 q4 ]) {# L. k0 J7 m: C6 U& d0 `4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute  T: q# p! G) ^/ Y# [" l* m7 P# z
4C19:00A8   JB     0095     ; 6 different commands.
: Q0 ]( M0 q: I$ T4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
, m- W+ h1 g- C1 T4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)/ O: a2 `& I; X' O" B

+ t& U, j+ W+ C& |% Z8 g' N: MThe program will execute 6 different SIce commands located at ds:dx, which6 z  W2 L1 H8 ~3 W; I
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.) N- I9 _/ ?; t+ Z% e& d$ D

9 @6 ~$ l8 p; W1 ?% H! R* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.5 U! T: W. l" K3 T& G$ d
___________________________________________________________________________+ u3 I1 G6 F4 a( G
/ h& x4 p, |7 g4 L, Y; Y# l
. Y3 V. q- M$ h/ C/ S. ?$ I$ K
Method 03
1 L2 y  i; {6 T=========6 \+ Z1 e1 p9 Y) a% O
2 l6 H# F1 i" z" t, G% G! J0 n
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
% Z+ M, Q- b% c/ J2 j(API Get entry point)- }- u6 ?9 b$ ~6 K
        
! c3 w# j1 T  U# P6 ]8 B2 {, p; p. f1 n5 Z: W$ s6 [
    xor     di,di
4 ?1 K3 z# ^7 Q4 d    mov     es,di+ O( i  U# _; c5 }: ]0 z& F
    mov     ax, 1684h      
2 X0 G2 L6 O4 _    mov     bx, 0202h       ; VxD ID of winice1 @3 x5 w+ n; n; V" n  z
    int     2Fh
! Q0 ^9 N1 R" X% Y: K# j. ]    mov     ax, es          ; ES:DI -&gt; VxD API entry point
' G) a- Z# N6 [3 N: C- |    add     ax, di" d7 `) l1 ~' x# u- c
    test    ax,ax
; ^" Y1 O: \3 G" P; N  X2 r' ~0 ]* V    jnz     SoftICE_Detected
/ n1 W) `3 h. p! s( O* `4 c  l8 G% o0 _4 c
___________________________________________________________________________% ]* ~, B$ r0 R4 ]; Z2 k. k
" W4 @( ~% F  l4 W0 q! y  e4 B
Method 04
- A. m1 Y+ w- q; [8 x4 e6 v5 ~=========* M2 ^! I) m. ~2 p  X% w. R

" t, `; H9 @! M: x/ s# J2 fMethod identical to the preceding one except that it seeks the ID of SoftICE  y; f4 R% o  c: ]  r/ Y3 A: l
GFX VxD.
! F4 z% X  P$ m" Y3 R
  ^* V% l+ u: T* x2 L0 ?) ^    xor     di,di9 I2 l3 r' V- b/ F# r
    mov     es,di. I8 ~) y5 g/ n$ w- J
    mov     ax, 1684h      
# M* W6 a4 K- T& J% i" P" r  p0 {0 G    mov     bx, 7a5Fh       ; VxD ID of SIWVID
( }1 s- `1 N9 p( X    int     2fh: c5 O7 b/ A9 f8 e4 T
    mov     ax, es          ; ES:DI -&gt; VxD API entry point
( G* y: B$ k2 G- O$ _    add     ax, di" Y. W$ R5 f* F* K+ x1 y1 L) w
    test    ax,ax0 l0 _# p, S" ]. m1 f
    jnz     SoftICE_Detected
! a/ F0 B" Q; E6 B' O9 ^" Q3 s/ b$ Z3 {
__________________________________________________________________________9 W) h+ R& @5 j" \% K2 g! B

, \# s) |0 `- \* }9 R4 Q* G/ U  ?3 x$ a* j/ J8 M$ N
Method 05
3 I+ e' V; h6 F$ u" h=========  ]/ R) Z# R6 v: Q# O

) j5 ~: u. P: J" n0 |/ y' [5 }9 gMethod seeking the 'magic number' 0F386h returned (in ax) by all system% r" I: b( q+ ?/ e
debugger. It calls the int 41h, function 4Fh.
6 f, |+ L  U5 ~" v& rThere are several alternatives.  
% q. B# }* D, w4 P' r
: x2 W. {) M4 K1 X! YThe following one is the simplest:
, o: M: f6 \( t% e- `, S' A
& N3 y; c( |) J/ Z( y8 {5 M  V0 \    mov     ax,4fh/ [4 g. E3 b5 W5 K& X3 B
    int     41h
# x7 k  o4 u# I" g6 L! X+ c    cmp     ax, 0F386& v7 {# K4 B* I! Q
    jz      SoftICE_detected
5 R( i( H6 j. `3 Z( t, Q- b
! r: X* K9 U: N# J* T
& O& _9 b1 F$ N7 I, ^. PNext method as well as the following one are 2 examples from Stone's $ Q5 K( `7 S1 @; A5 D. P$ _( q% `
"stn-wid.zip" (www.cracking.net):+ B) x& t6 X. H. R7 V

( L* V1 J3 \" a5 N) r    mov     bx, cs
$ N4 q% Q5 J# m: j; f1 @* v2 `    lea     dx, int41handler2: ~% y2 K! ^5 u
    xchg    dx, es:[41h*4]
3 D. q5 ^9 I8 d4 |# p  t5 _8 i    xchg    bx, es:[41h*4+2]3 R+ J$ c! j8 n, i8 h& i
    mov     ax,4fh9 q8 y4 d* X4 L0 x, |  K- ]
    int     41h" [  S, B6 ~$ E+ U2 ]. Z
    xchg    dx, es:[41h*4]2 j$ A8 t7 N* w7 ^) I8 Q
    xchg    bx, es:[41h*4+2]! N0 Y; M# A( l! b3 B% q
    cmp     ax, 0f386h* D  M( F) t- A; A! k, l
    jz      SoftICE_detected% i7 c) E5 C7 n4 c
+ r  e7 z( k+ ^' U
int41handler2 PROC
2 w0 B. o1 ~1 S- t' K/ L    iret5 P+ t' ]3 ^( M- s
int41handler2 ENDP5 ~3 a* u. n/ y: \# t; n( M  w

3 f& @; F9 M6 z1 R! [, Z7 @! R: p" Z- _& s; |9 V3 Y) X0 [
_________________________________________________________________________! T0 F, l/ h& Q; p

# y+ W* {0 i3 K9 P& n) k  s( q4 H6 I8 L% |' e# T
Method 069 `' H6 [# A6 g; Y) ^
=========
. }+ E/ Q0 h5 N: z5 |- J
# Y5 X' `% j6 l
7 M2 y) C0 J7 g: R$ B$ I8 q% }2nd method similar to the preceding one but more difficult to detect:
  m4 ]9 `2 L+ [' {
1 ?8 ?2 f& {! E- _7 q  q% Q
& v8 R9 z5 y6 F, b. Eint41handler PROC
  U/ O- ~, }# i    mov     cl,al! X$ Y: V4 b  C' G
    iret3 {7 @" ^0 g( i0 I9 s8 U
int41handler ENDP  k" |. e0 R( A7 O7 K) K! e
' \/ H' r) Z$ t8 s) e( s

' N# q& A- @- a( }    xor     ax,ax4 v- Y, p  F: s4 F" p
    mov     es,ax# v" l/ [% J* V" [$ I  P5 W
    mov     bx, cs9 T3 t+ i. R3 q6 n
    lea     dx, int41handler
* `; a  i+ b" _  `: J8 i# Q    xchg    dx, es:[41h*4]
" ?5 I. f7 G# K& m! i4 L    xchg    bx, es:[41h*4+2]
. x# M5 ?& K' J7 B) m    in      al, 40h0 O4 Z* [9 l, G& V/ a6 w8 L
    xor     cx,cx6 q: r$ W- W" l* h( c( w0 I
    int     41h
/ [9 B) l! F  T3 }. I% L4 N' j    xchg    dx, es:[41h*4]
$ _8 A9 R9 [2 S7 l/ }/ m& o/ k, F    xchg    bx, es:[41h*4+2]
" g/ I9 Y: G" M7 T* P5 H1 ~7 ]8 }    cmp     cl,al" U6 v! y3 P( U; y$ ~7 ]
    jnz     SoftICE_detected. o5 k* L9 j4 k" e0 U

/ V+ F7 `1 x$ {2 K) s3 a( j% ~_________________________________________________________________________2 \. i1 K9 t2 y# F! }

" d  h3 a1 v# r5 {Method 07& z; ^. p2 T* j% L6 J
=========
' w" Y/ y" e+ A& I3 n  t$ S/ Q. o  u# O9 ~5 G) b
Method of detection of the WinICE handler in the int68h (V86)
( [6 t% N: Q# ^2 \. y' ^& r' P* F
    mov     ah,43h1 J' U5 ]& ^9 }( `5 t" T" w( v
    int     68h
( C' \8 Z$ ~# L6 D    cmp     ax,0F386h
  j) d1 q4 n1 O7 G4 @. F    jz      SoftICE_Detected
0 d# j/ n$ ]% Y; p- P. b7 @2 R3 T5 Q* ~( o7 `6 P! r
5 c  x7 Y2 K4 Q. w7 ~! u9 e
=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
' h0 {" k" s( B$ m/ J. Z/ v   app like this:6 G1 g% F) t9 [) n( p5 l% Z; t: ~

, y$ R+ }: z. q7 E   BPX exec_int if ax==68, s! C' l; Q( D$ i1 \* t
   (function called is located at byte ptr [ebp+1Dh] and client eip is2 m: s% |6 e( d6 q
   located at [ebp+48h] for 32Bit apps)
7 x( }9 [" I! ^) ]! o7 `4 ]1 q__________________________________________________________________________" t+ W5 m) k" K' H4 h* X4 N+ A
; {  ?5 Z4 Q5 K

5 b2 ]) [9 g" W7 W# X" ]Method 08
, |) A9 r6 ^% `) u5 o6 T( r( i=========; y4 V7 y* {6 @
& H- w' \* f2 N1 W$ Q/ k" U
It is not a method of detection of SoftICE but a possibility to crash the
/ t6 P7 K! \" E1 _! F- N8 ?  l+ bsystem by intercepting int 01h and int 03h and redirecting them to another* n9 H' N5 L2 @- P
routine.
/ W3 w9 x% C$ |% M, a; mIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points. }/ R+ o* [3 j3 U! Y0 w
to the new routine to execute (hangs computer...)
" f, a: Y$ x; T# Z/ ?* y4 z' [" T" r! R
    mov     ah, 25h
6 b& t0 e" r% J7 ^4 W% y    mov     al, Int_Number (01h or 03h)
/ t. J3 i( u* b9 q9 n    mov     dx, offset New_Int_Routine6 ]: y; E; [2 i) T
    int     21h
4 Q9 F+ L3 i4 c: g& r# V) ~1 [
' x9 J: L$ ~* n; j) U__________________________________________________________________________
4 p  B3 |; @9 }; _
- W% n) r  ]4 l! J" V! dMethod 09- v$ k' q' L! x/ H" X
=========
& B9 P8 C- o7 ]' T9 ?4 V& V
; r+ h- t% Y3 _3 @4 @0 xThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
+ E+ i' `/ ?" q, A/ fperformed in ring0 (VxD or a ring3 app using the VxdCall).4 T; G* C: r2 R7 d
The Get_DDB service is used to determine whether or not a VxD is installed
: F; i* [. ~1 c8 g  j9 Xfor the specified device and returns a Device Description Block (in ecx) for
( W& w2 R) ?0 ?& S  N4 Uthat device if it is installed.
# @6 |0 c8 p/ i2 e# h4 S7 |
$ @; v+ ~( h- S- I( ?   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID& M6 c+ }0 B4 h, t* }6 q4 F/ t
   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
+ v$ F. A! a2 H+ J% r3 o8 @   VMMCall Get_DDB6 L& ^6 x) B" Q: z
   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed' O  Z; O3 N/ e

3 R& S# ]  R& D- x4 ^4 b6 m# CNote as well that you can easily detect this method with SoftICE:) [" o5 s. b" e  P% L
   bpx Get_DDB if ax==0202 || ax==7a5fh
# K8 E7 A( Q( r  I2 `2 S1 J. o7 k; m* C5 b* _! n# f3 e+ \3 w0 b
__________________________________________________________________________
& m6 k; r, x- r+ ^4 I) o* t; ^! g& Z$ k
Method 10  o* k, a0 r0 L( U, |
=========, K+ \0 Z" z% Z

9 ^& n' ?% ]5 ]# p, Y& o1 t=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with4 z0 e! {' i% {
  SoftICE while the option is enable!!0 L1 x' a7 `7 l/ o; p# e/ i$ ^
. t0 N1 A* T3 I, [1 i
This trick is very efficient:; T, \8 ?1 O( o( l  B7 J+ z7 \
by checking the Debug Registers, you can detect if SoftICE is loaded* F0 l% Z2 T  m  W6 O4 W( b
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if0 P6 f' s7 S. l
there are some memory breakpoints set (dr0 to dr3) simply by reading their& _1 N; g: h0 G
value (in ring0 only). Values can be manipulated and or changed as well
' Y$ \5 h* Q9 J: f' X% O(clearing BPMs for instance)4 A9 x8 F) v  g# W' [: I1 R/ t1 N

4 i" m5 @( z! Z; f0 b9 r0 f__________________________________________________________________________) `# w3 m: R/ R: M4 z* V

' J$ M& b. Y7 uMethod 11
7 ~7 y6 [" c8 A/ m5 L( J=========7 ~# b; G8 G" h. M! k

" {3 `, j3 V' V; b2 [- ~$ oThis method is most known as 'MeltICE' because it has been freely distributed; r+ f# }" c0 a
via www.winfiles.com. However it was first used by NuMega people to allow
# i7 H" |0 x; e  z+ _Symbol Loader to check if SoftICE was active or not (the code is located
4 y0 J' j5 K. \. f* V' zinside nmtrans.dll)." c) z: g$ m8 i3 v. g
5 J* T5 I5 B& U
The way it works is very simple:& F6 T9 W* i# d4 [
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for( y, `. b! l+ K$ h% ^& }% `1 Y
WinNT) with the CreateFileA API.
8 _5 y; x) _) x# n" ~# C+ o! r) r6 R! p
Here is a sample (checking for 'SICE'):) r( W' t$ a- F1 c
1 L: F2 b  G- w% S4 @9 T( b
BOOL IsSoftIce95Loaded()
; a! Q( [3 M0 Z2 G! C6 R{, N6 J: O' p* Q2 T" ~
   HANDLE hFile;  % V( Q9 A' [( T8 J, b& {
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
$ \( H" e! |4 \+ n# b+ S                      FILE_SHARE_READ | FILE_SHARE_WRITE,
2 l) B7 |7 ^! y% r, S! ~                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);3 y: S" ]2 B+ d2 h7 ]. w6 P
   if( hFile != INVALID_HANDLE_VALUE )
# K: A" [6 s, f' u& B. R   {2 J8 L5 I" A2 s+ Y6 U9 d% i
      CloseHandle(hFile);  `0 B* w+ z$ N5 t% u. G, g1 ~9 d! z
      return TRUE;5 [2 o$ ~* a. N2 ?- |  d. U
   }
5 {2 h& e" S9 N; _) o6 _   return FALSE;+ _! n( ?0 K% G4 U' P; K9 g" L& @  p" Z
}
. I8 m- T4 b) ^5 F/ x/ z: r( J* Q8 f& p- n: u) W' Z( r! {& G
Although this trick calls the CreateFileA function, don't even expect to be) D; u9 s5 E1 c  A) n
able to intercept it by installing a IFS hook: it will not work, no way!
7 e( x% b, A( Q7 j. vIn fact, after the call to CreateFileA it will get through VWIN32 0x001F' V  n' b9 a- Z5 [* _6 @
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
9 e8 N+ ?: ~3 O( D3 rand then browse the DDB list until it find the VxD and its DDB_Control_Proc
( p2 J- C. ]/ xfield.
4 M9 c7 c0 q; t  A. u- KIn fact, its purpose is not to load/unload VxDs but only to send a 6 O* g- ?2 M) W# h; U3 h: p8 g& [
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)$ s4 I, `' F: w* C: b6 K4 O3 g
to the VxD Control_Dispatch proc (how the hell a shareware soft could try3 S5 x+ x9 n8 b% @& M( T
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
# E6 d7 `6 T1 ?1 l5 u2 bIf the VxD is loaded, it will always clear eax and the Carry flag to allow( e/ I* P$ v. Q* d
its handle to be opened and then, will be detected.
* P5 N/ G7 m' f, _$ yYou can check that simply by hooking Winice.exe control proc entry point* c% F# n! o2 E$ Y9 [7 N  K5 F+ M
while running MeltICE.6 C8 S0 k' E' y" j. L% S3 x# e6 L" x

6 w, g5 [0 Z& }- Q& S3 V8 ~
3 i% [. s+ s8 k! `8 e: H! d% |, k  00401067:  push      00402025    ; \\.\SICE8 N3 Z/ A5 r) b! X) w
  0040106C:  call      CreateFileA" ^8 k2 `, j' b4 d& {8 V+ u' O
  00401071:  cmp       eax,-001
5 B: a  ^4 N8 b6 P( t6 K  00401074:  je        00401091
; S0 ~7 J3 c% Q% r. L
& @7 X# Z; V8 P. y! M- f' z  D4 E) ?. A0 O4 M7 j& c; `0 o
There could be hundreds of BPX you could use to detect this trick.
; K% A* H8 @1 I. }5 ~9 @-The most classical one is:( n2 ^+ n# r5 u8 u7 K
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
' ?" |6 n1 U; I7 O2 o    *(esp-&gt;4+4)=='NTIC'  g2 k6 N' s9 V  `
$ V* F' ^, |4 v
-The most exotic ones (could be very slooooow :-(" E# W! s* `5 c# ?9 D
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  
) h7 j9 f/ J+ Q5 p- \: V7 ?4 q     ;will break 3 times :-(
( K0 O" m1 e5 y) w2 H  P) S- i5 N  a6 B: d; I3 h
-or (a bit) faster:
6 M1 X$ }) o& ?   BPINT 30 if (*edi=='SICE' || *edi=='SIWV'): C) U# u0 `9 g( h
; M) W0 T) W6 d" _
   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  
  h5 O% O2 M& ]) [     ;will break 3 times :-(& m! [+ f; u8 a$ s4 [& h, K: i

; ^  E$ h0 T! j+ Q" T7 [-Much faster:" ^# h3 n3 J) `5 z2 s# J
   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'
! ~6 `0 O: w* g8 ~, f, ^# b! T1 A' }
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen( x& g2 O+ z. _7 s
function to do the same job:" c  ~+ J( ]( J5 n. @& M7 A8 g
+ b: A' b, i8 c* G' N0 R
   push    00                        ; OF_READ- T) Z% V/ r. W! e+ ]! B9 W7 Q
   mov     eax,[00656634]            ; '\\.\SICE',0  p3 x! n7 S6 U. d0 O
   push    eax
+ c. {1 s- G( E   call    KERNEL32!_lopen
  Y: z3 f9 j8 A& n   inc     eax
) Q: v: _3 I: U- x1 |   jnz     00650589                  ; detected  C- e7 m3 x, N8 N7 c
   push    00                        ; OF_READ4 M$ K- }7 h( d; |
   mov     eax,[00656638]            ; '\\.\SICE'
$ K- g" F; K5 b: v- y0 |. b   push    eax$ l' N+ H9 p/ b* y) v1 O1 f. A# H
   call    KERNEL32!_lopen. _% {7 R1 n8 V* ]7 q8 c/ i
   inc     eax3 |* a/ [8 |- _8 K/ o
   jz      006505ae                  ; not detected
6 k& M! H+ X; s2 ~7 T& }6 A
. I" R8 M) }* {0 ^. x* \5 A9 w6 v- Q2 e3 U# M% Q
__________________________________________________________________________
" D& D; c0 w* U1 A8 X. b/ m) M: r4 T: ~$ H) i: t: |6 T
Method 12, S$ F" j: M; u" O" W
=========( Q8 l- t9 p" Y. s/ A  L

  W1 A% G/ a6 QThis trick is similar to int41h/4fh Debugger installation check (code 05& a  R" e9 |! k
&amp; 06) but very limited because it's only available for Win95/98 (not NT); U+ Y5 F7 a& Q7 a2 Q& Z5 i
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.6 Q6 g' Q/ _( h% _6 r9 {; K
6 x5 ]6 @' M8 l4 h1 s: Y
   push  0000004fh         ; function 4fh* r/ M$ \" c3 P4 S" d* D
   push  002a002ah         ; high word specifies which VxD (VWIN32); N, n# \9 h% a7 l3 p" o
                           ; low word specifies which service3 t- n  I6 f, t- m! [* e) d: ]; L6 H( w
                             (VWIN32_Int41Dispatch)) g) m" h$ x+ J( R/ ?
   call  Kernel32!ORD_001  ; VxdCall
7 ?9 {: k. x9 o, s* }8 M   cmp   ax, 0f386h        ; magic number returned by system debuggers$ F; w3 t9 C9 \* G5 |- p
   jz    SoftICE_detected
* ~; I# N5 H7 K9 r" @
) ?8 O/ g! ?/ H8 ~Here again, several ways to detect it:
) `, m0 b5 k' x; [% C8 @
9 N' P5 y; c: @9 _1 q    BPINT 41 if ax==4f! A3 U2 E$ m6 }) t1 z) ^2 y! e

; J1 h# J  `8 A; J    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one
1 J% Q* `' f  Y( P& l: D! ~1 N: n$ d6 w- k! G
    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
; j8 J' ]- ?; J2 F4 M
9 o# @% U4 J. a9 r    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!; f, l( O" O. A9 p: p9 T
- t; w2 K9 \: g2 _: [6 i. S
__________________________________________________________________________( o/ y1 ?. h7 g) q

) {: |% d' i$ J' ^4 U0 |Method 13
: Y! U' ^' ?/ F# B' {=========
; h% ^% H% R" ]  o/ G6 ?& h6 p# t* m4 O
Not a real method of detection, but a good way to know if SoftICE is
2 Q; m: [* E& A4 N0 Linstalled on a computer and to locate its installation directory.
1 m: f* w/ S3 z5 n1 r8 G3 [' @% iIt is used by few softs which access the following registry keys (usually #2) :
: |  Z0 @; R- M  a5 g1 ^5 `1 `2 A5 F# w. D# m1 a% O* Z2 w
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
! O7 z; m  g! s$ _; g: f\Uninstall\SoftICE5 Z. N0 Y3 d6 ^" ?2 k$ i  i# W" s
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
1 Z2 P% i1 U7 e9 G6 C9 A5 }-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion7 S) @; K8 _- U5 x4 w1 N2 J, y
\App Paths\Loader32.Exe' p% r; z9 m2 U5 B$ M/ y
8 [' B( \9 E. C7 ]
  v7 g% E' W" H: C: V
Note that some nasty apps could then erase all files from SoftICE directory
9 c! S5 t. t( ?( x(I faced that once :-(
: ?% G9 l0 `+ o$ h( f" n! I: [& Q( d# F1 v1 Z3 ?* y' @
Useful breakpoint to detect it:
* [4 q. `; j7 J1 k" @6 G! x
+ w; x# n- i, L$ M     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'5 O8 w# |8 V" C
! r% ]- G+ I1 j. i1 E
__________________________________________________________________________
& n) c! K+ m# U8 q5 N4 g* c* ?9 ^5 e; N$ U# X

4 _. G: s7 Y( C5 E7 I/ J8 |Method 14   P) f* _5 M- i! H2 `" p) @
=========$ L) q; ]2 ?% ?/ u+ Z8 p

% z% C) O: l4 aA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose4 n0 O! z7 w' y" S. @2 Z
is to determines whether a debugger is running on your system (ring0 only).
, s) i# a4 t# g, l3 B+ B" {, g' Q4 B2 S" C' q# |0 z( C
   VMMCall Test_Debug_Installed( h5 d9 N) a% D. Z
   je      not_installed
+ ^  \0 p3 @( d: R6 A! i) P; Q6 y4 |* N& B% |0 [/ E
This service just checks a flag.
( k  ]. Z* D/ }7 E</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关注公众号

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

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

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