找回密码
 注册

QQ登录

只需一步,快速开始

About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>% A( E( k7 v, m9 W6 D! e- r
<TBODY>) P2 y) C4 r' M  R! Z0 E
<TR>
3 H. P6 _" q7 o" s- f) j9 w<TD><PRE>Method 01
1 U# O5 k+ e: q0 F8 y=========  k) F. T/ @  Z3 ^* J, l- g8 K
9 t$ D" D7 Y! |, E
This method of detection of SoftICE (as well as the following one) is! G3 `) P, B/ V
used by the majority of packers/encryptors found on Internet.
4 ~" O! s+ [7 W3 i; FIt seeks the signature of BoundsChecker in SoftICE0 Q1 x0 U- R/ S. s" q. V9 j
0 T# ~$ x/ w; E( e
    mov     ebp, 04243484Bh        ; 'BCHK'
, V& b6 S. c' [; J    mov     ax, 04h
( j1 U0 X/ [  B( A& Q: t9 b; q9 p    int     3      
, U+ H) u8 F! C# G    cmp     al,4
; `1 u: |7 U2 n6 c" _    jnz     SoftICE_Detected
$ A4 Z0 u( E( T; k: S. n
' z2 e6 n3 r! m8 z2 a3 M1 u/ b___________________________________________________________________________8 @2 L, R# Y3 R+ x& d" c

: a- _* j8 |4 e4 t  r5 A8 [" x2 DMethod 02# J5 d$ c2 w7 h, n) z
=========# t& w/ _7 C, l( o0 l* S
( p% m+ o5 O2 c
Still a method very much used (perhaps the most frequent one).  It is used2 G4 @" M9 S! B! {# C8 ^7 B
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,/ P: G9 @. w- z0 `3 y( M: B6 U& T
or execute SoftICE commands...
* T( T' D+ T7 q' oIt is also used to crash SoftICE and to force it to execute any commands
2 b' ?8 x! k; K5 a) w(HBOOT...) :-((  
3 A8 J9 H1 s% {& U! k) w( j% b6 \# o0 |4 J! |) G
Here is a quick description:9 H9 q/ [1 k) {1 d+ {
-AX = 0910h   (Display string in SIce windows)
3 L& l- X* {  m; c6 h6 |  K  O/ _-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)
: s, ]8 i5 i9 a$ u-AX = 0912h   (Get breakpoint infos)& Z4 Q$ Q% L- a. z3 k0 t
-AX = 0913h   (Set Sice breakpoints)) ]$ p( N5 D9 E, T) A4 F% N8 M$ I
-AX = 0914h   (Remove SIce breakoints), J* N( Q- i' _6 F7 `3 K  b

7 R, T; Y) J6 _' @- E& C0 {# ]Each time you'll meet this trick, you'll see:
, H) I% S  b) Z' `& ?3 }! }-SI = 4647h8 z$ T" j5 [* h* K0 r1 j8 O
-DI = 4A4Dh
8 J8 J" j6 `! XWhich are the 'magic values' used by SoftIce.4 e! n, _0 G- J3 @) y; l* S
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.' o4 c3 x+ W  y- M4 x6 f

0 v% C7 y( g6 V0 J# Q( h' CHere is one example from the file "Haspinst.exe" which is the dongle HASP4 y9 J! v: j* E( ^: u- F
Envelope utility use to protect DOS applications:4 k2 @2 \3 Y8 m! F/ ~

7 T& P5 J- u# m) `9 T" C7 O/ _- K' T; W- m- f4 o6 a
4C19:0095   MOV    AX,0911  ; execute command.
% @# U; C, v& Q) [+ r4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below)./ c6 L& R, X+ ~, z/ L
4C19:009A   MOV    SI,4647  ; 1st magic value.
6 N% |6 t' o* ^0 C4C19:009D   MOV    DI,4A4D  ; 2nd magic value.. z+ q' r- W1 A& S6 A6 n7 }& t* e
4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
" Q5 r( d. w0 k) y; G/ T4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute- y0 ]& A/ }+ [8 K; r, Q
4C19:00A4   INC    CX
! g% m* `( g# r% D3 U4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute, v: c$ G. ?7 p! n$ z. ^
4C19:00A8   JB     0095     ; 6 different commands.; f$ K  z" g" o
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
, _; }( O5 P4 }! i: \7 N& }4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)  s: d7 b5 h/ r# N& |7 o1 \' o3 P
5 r5 B! I) t3 ~( W
The program will execute 6 different SIce commands located at ds:dx, which0 s, o" W/ u5 k; ^6 S6 X/ R+ u* B
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
- e! h, ?& J- F/ b, F$ H# v
; _" n, X# W+ o0 E4 j7 v* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
7 v* e+ X2 ~  C* K___________________________________________________________________________( G) z2 Q2 o2 u3 ?! h  f
2 J& Q) p' g* n! G: j5 ^

  X! j! G0 {2 ]Method 03
; P$ t8 ]+ r/ y: d  s=========6 F) \9 K2 X) I
# C; T' X2 g, z% c3 z3 p) c; y# D
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h% V: x. q0 B3 ~3 N* E+ Z' {7 z! a
(API Get entry point)
( D  _1 N7 g# \) L0 r0 L        
& |; ~! B+ p7 D( J& u* Q, U  W" K, a$ C' h# P, p
    xor     di,di
& a; P. ]5 C& V8 f& H2 S" L. j    mov     es,di* D& @7 `% D- a  \) L0 c
    mov     ax, 1684h       ( ~0 H- H; h6 I; C" @3 `
    mov     bx, 0202h       ; VxD ID of winice' R+ Y: _: C6 ]- B0 D8 O
    int     2Fh# W! F6 N# o4 w  d  j5 j) e, A! j
    mov     ax, es          ; ES:DI -&gt; VxD API entry point3 W5 M, {  W1 J9 V+ c. k5 w
    add     ax, di* m+ I7 ^1 T' p: O8 q( l& a0 G, U
    test    ax,ax
" d- J4 S. \7 V( k$ E0 Q# F- x    jnz     SoftICE_Detected
) @( z! {. T. x  i, R: [
4 e% F, f  i* v5 m- J, d- B___________________________________________________________________________
9 J2 c- g% C! a! l; N. Z7 H1 W' w! B5 H# Z) Q  q8 n. v
Method 04
( q6 m/ N' h3 `' K/ i0 L=========
& g# t  g; W" v! y- o
+ f5 V6 M& N; W" lMethod identical to the preceding one except that it seeks the ID of SoftICE3 |; T1 U, n7 q  @! t$ S( @
GFX VxD.& i8 S5 {6 d. Y" X9 N; u/ T

# z5 C& Y3 V' g& D    xor     di,di
: c1 Y9 j2 i& ~0 o    mov     es,di
( d& L; P+ E1 G( O, [+ X% |! F& c    mov     ax, 1684h       4 W6 T$ t5 v; Q( ^
    mov     bx, 7a5Fh       ; VxD ID of SIWVID% W: Y, \. N( |/ d
    int     2fh! Z. O$ I+ R8 X7 \
    mov     ax, es          ; ES:DI -&gt; VxD API entry point2 L& b: }% o! S( `2 n! i9 ^' W
    add     ax, di: K9 [7 \# `9 [! p: r/ _( Y( c
    test    ax,ax3 M% f- g4 n( j1 _' @$ a! z
    jnz     SoftICE_Detected
: A; c# }" y% b& [/ B! t. ~" C: W+ i& J' T/ T( h& w' U
__________________________________________________________________________
& _# K# q0 z4 C- M0 P  F) R1 Q0 ]+ e/ \: t% L( M6 }9 k* M. J# e7 z3 q' [

8 r( Q' s1 y/ `. L9 b& ^Method 05
" u. Y0 [9 }) ]( r& {. l# J=========
/ V+ G( V* X7 ]+ ?8 |
# B, w! v  `) r: R4 q  TMethod seeking the 'magic number' 0F386h returned (in ax) by all system$ H$ [* u) m+ \2 I- {1 C
debugger. It calls the int 41h, function 4Fh.
/ b3 r) i" `$ b8 NThere are several alternatives.  
2 X+ q& N! E/ E
9 D& J9 ]' j6 j$ C" _& P( {! tThe following one is the simplest:
$ X) V: _, F; r' L
, q. F: Y! s6 L    mov     ax,4fh. c  `7 v- v2 c! o
    int     41h
( r! i( G. K% [8 t  c: E    cmp     ax, 0F386
$ m( T+ p" h% y4 p# u    jz      SoftICE_detected
3 A1 W: E1 @- e, z$ ~4 {$ G/ }- E6 e$ e1 E$ j0 O9 j6 X

1 |9 _# ^% a1 I3 H1 s9 t( K* qNext method as well as the following one are 2 examples from Stone's * u0 K, q/ L: t- ?: x
"stn-wid.zip" (www.cracking.net):* A1 M0 D& q$ `8 |9 U
% W8 x0 P: a7 p# N: Q$ l' q6 W
    mov     bx, cs
5 u3 A0 D2 p$ W' {  t; K    lea     dx, int41handler2
/ p8 {& `0 m" ^+ y* b, i    xchg    dx, es:[41h*4]
, ?! a# A& X" G    xchg    bx, es:[41h*4+2]: y+ R% d, U4 |, i& X0 V0 r7 L
    mov     ax,4fh
0 d2 k" w; o6 ^" N5 m    int     41h
8 n3 h. A, a/ ^0 J8 k    xchg    dx, es:[41h*4], i9 t( b6 }" s
    xchg    bx, es:[41h*4+2]3 \5 l$ P# U0 t* q
    cmp     ax, 0f386h- ^: W7 F3 S7 [( E
    jz      SoftICE_detected% A9 V, U8 N: `% G0 @0 j/ ?2 k

& T% F( J( R! T& }9 V- Tint41handler2 PROC; v$ Q+ l2 `0 E/ I0 t# r; }3 }5 m
    iret+ Z) I; e. ]% x; c* _
int41handler2 ENDP! f, W! J% `  _, ^8 ]+ G
+ I- N: `. l& ?( N: V1 C# q$ S

' k  A$ b+ V( E_________________________________________________________________________
5 \# H# Q' Z3 Q# d3 O! l% Z
1 V/ [: r: f' p% d. ?" y8 L0 z4 r+ A3 p0 T
Method 06
+ Z8 I) p$ h5 |# |; U3 H2 H! X1 O=========
) g: E6 c# W5 e0 _3 v# M8 O* Q* F! l  [  _4 m& L& o: a
8 ^7 ]! Y! t' }
2nd method similar to the preceding one but more difficult to detect:* V% s3 f9 e+ r

7 J9 d7 K7 K2 A# C' n) h5 J& M0 M
2 C3 g5 L5 ^) E. ^int41handler PROC+ o3 x1 y; x" O7 [% k
    mov     cl,al
  ^9 {! p6 G) s# {* K    iret
' A( S  d4 k6 O3 i; {3 e' |7 |- V/ oint41handler ENDP
3 m' ~0 ^" ~, d" k# Z9 s) W( `$ o6 S1 Q" q- Z) U3 @

: [6 r! ^3 P# H+ W$ Q    xor     ax,ax9 o* n1 @# E! z" C6 ^' Q
    mov     es,ax
# X& P2 E/ c- O9 `! d2 z    mov     bx, cs
( ^% _+ Y5 S7 ^6 m' p, B    lea     dx, int41handler
+ A9 b" t! {4 X! K0 K6 s    xchg    dx, es:[41h*4]
8 o* Y6 ]( l. o  A    xchg    bx, es:[41h*4+2]( q" n% @. i, `, N1 b8 n; g2 b
    in      al, 40h+ k. a1 K4 W# q3 p
    xor     cx,cx
3 T" T( }7 x- q3 @    int     41h
0 d4 L: f4 D; Y" W; @" p1 L    xchg    dx, es:[41h*4]
$ ^) X& J/ ?* {: J' X    xchg    bx, es:[41h*4+2]
7 M" T5 B/ w$ ?. d3 @5 i! G7 d    cmp     cl,al/ x/ B& k6 @  v! y2 A+ w
    jnz     SoftICE_detected7 N' ^+ D0 K; H+ O7 I

: `/ l& f4 B' |  b/ i6 J% U_________________________________________________________________________" s! V7 s8 ]5 x0 {# \- J
- G. _! \: W6 E- S. n
Method 07
0 H/ p7 H: N0 ?5 E( x% P0 i=========
9 `# O1 p) K% f6 @! @3 c5 Q8 Q( s0 F, S5 l( `0 N  G) _. P
Method of detection of the WinICE handler in the int68h (V86)
: d0 c; }: n" Q2 d- K' _- c  J- a9 i7 e
    mov     ah,43h
5 g# F) V* @) c# s1 U! W" T    int     68h3 `- V# J7 f4 E4 S+ |
    cmp     ax,0F386h/ @0 j' D1 w1 |% h% H7 X2 @/ y
    jz      SoftICE_Detected
; o) C, m; }( E- D' B. I6 ^4 y' H4 o, \/ `8 H: H6 h; N9 D5 [7 k
6 _3 Z% |: n1 \- M
=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit8 J7 s% b7 \( }, [$ q9 M! H
   app like this:* C! e! H4 ], l. j
" [; l' L( V- l( e8 f* J( p) w. ?
   BPX exec_int if ax==683 j5 H+ r. t! ^& o4 I8 Y
   (function called is located at byte ptr [ebp+1Dh] and client eip is
; O9 b2 ?5 Y( j& W4 B. ]; c( X5 x# j  h; ~   located at [ebp+48h] for 32Bit apps)% f( N/ t% Q- `+ [; q0 F, Q9 e+ G
__________________________________________________________________________
# m  [3 K+ f: |$ g. H1 A2 l+ x% w9 ^( w" a1 O  |

% s! z  j4 P! E- `6 AMethod 08( j, Y+ L' d- X  K
=========/ S6 n# i) g0 H/ f
8 G; I' V, C% y* N: M7 Z! d
It is not a method of detection of SoftICE but a possibility to crash the
, o3 ~# w0 j/ }/ W# G' Q9 ^system by intercepting int 01h and int 03h and redirecting them to another5 A$ @+ ^$ ^: S
routine.
2 Q* T8 H* r4 p: Q1 Y1 z8 ]It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
0 I7 |6 d0 l! @! Q; v6 B( fto the new routine to execute (hangs computer...)0 r& ?+ H8 i' Y/ C3 b+ J' L

! r9 I" k9 `7 ^$ `    mov     ah, 25h
1 P7 x+ T; n. k2 l    mov     al, Int_Number (01h or 03h)6 r, G' D+ Z8 g/ u; h+ S+ c# Q
    mov     dx, offset New_Int_Routine
2 h  S: s4 \2 ], n0 I! c& i, z    int     21h
4 \+ E: K: W" m, {5 K1 L# M
/ M4 m) h5 e9 X1 }+ f__________________________________________________________________________9 g* |9 ~! I" |+ Z* I, A0 K  O

3 n) M* ~. i  h6 H3 M+ N* d- |Method 09
: {: D  `/ {7 \! b, r=========9 `5 C+ _% |3 w# H4 e9 O1 [, J
7 H& i& W' E- b% p/ V2 s
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
/ ^* R; f8 y# u* @performed in ring0 (VxD or a ring3 app using the VxdCall).
$ V: B( t. U5 c% N, P7 a4 uThe Get_DDB service is used to determine whether or not a VxD is installed# K+ ?9 J1 z4 H7 c& |1 Y
for the specified device and returns a Device Description Block (in ecx) for
4 }: W! g0 M+ e2 Y1 T% K4 L; l4 ethat device if it is installed." g7 O2 X) v1 b$ {+ w: E

: l  T3 l' [% j* X# ^   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID
$ \' O5 I( P& |3 J+ W   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)8 W) G3 e! L5 a! r
   VMMCall Get_DDB
& `" |! w) L- ?0 x( I   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed
( H$ x$ _( ^7 n, }9 X6 |6 O# I0 J+ M5 k& R" _5 P
Note as well that you can easily detect this method with SoftICE:7 B, D, U  ?5 t3 `  p7 M- l
   bpx Get_DDB if ax==0202 || ax==7a5fh
) D# q3 ]9 ~( }, M% l# `; H9 }
" f/ g! x- N$ G& `3 B1 F, Q__________________________________________________________________________# S% d5 ~# C8 U$ l9 J" x, u
) H* C1 |! ^- h, ]! I
Method 10
3 Y( }9 k. W0 w0 V8 H2 m: z' j=========
" ~. t( X  B8 _" H# H- O
4 T. h! }6 R' D& T" w. \=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with
( K: b5 k8 U2 K7 l4 Q  e  SoftICE while the option is enable!!
/ z7 E9 q# \  W0 {6 s! d9 {6 o- N0 y: I8 z2 O' @: G) y5 X
This trick is very efficient:8 r- ]( F/ [) [9 n' f# T) W  h
by checking the Debug Registers, you can detect if SoftICE is loaded
+ Z& M& E4 k; z& c9 G" _(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if! Q( }1 H3 U+ Y5 z1 R2 m( ~
there are some memory breakpoints set (dr0 to dr3) simply by reading their
' r4 E. h  J7 f: B. |0 lvalue (in ring0 only). Values can be manipulated and or changed as well
: s! ?: A! f% V+ [/ ?$ C; E0 ?(clearing BPMs for instance). X% g' y9 q* Z- H2 T
% W% J) C5 R9 v  F: x+ V) n
__________________________________________________________________________
* h: p! F1 ^& {8 I
* R$ a0 K1 S" qMethod 11
4 K( t: p/ ~7 {/ I: k) m$ F=========7 Y, c% |7 Z. b4 @/ P# f6 s
, X; P# w& G2 Y
This method is most known as 'MeltICE' because it has been freely distributed( @: P- h4 I: h* x8 \& u, S
via www.winfiles.com. However it was first used by NuMega people to allow' n+ C% a$ h1 j, i; `6 _  i  N
Symbol Loader to check if SoftICE was active or not (the code is located0 I. T1 @- ]+ z  ^
inside nmtrans.dll).  z9 d7 `+ n3 \/ M( L) N+ G

8 g1 S* M( a! SThe way it works is very simple:2 c; ?! m! v) G6 Q- P0 |3 e
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
8 O4 D- O1 a, U4 ?/ o( mWinNT) with the CreateFileA API.# e7 C# h. Q8 N
7 U1 x$ {$ M% i" A. Y. w6 N
Here is a sample (checking for 'SICE'):6 T' d' x8 ?6 j; e

4 u! b. ?5 |1 D( c2 a! Y5 B/ rBOOL IsSoftIce95Loaded()# A8 m8 }6 x0 f" ~' ~
{  t$ o8 S/ T( u2 ?4 g/ d  W
   HANDLE hFile;  
* }+ p. h! c. g/ q   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,; p% I4 N# i5 O! Y8 h' u: s1 R
                      FILE_SHARE_READ | FILE_SHARE_WRITE,9 I( E1 @: \3 Y1 V
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
6 A, A- O# C7 G0 Y   if( hFile != INVALID_HANDLE_VALUE )1 X5 X) s  q$ J
   {2 u9 V8 J4 Y) ~8 o& \
      CloseHandle(hFile);
  Y: Q$ b3 y* q( e1 I1 `# ~, X      return TRUE;
& m" S! {6 W6 i* V   }
/ d7 W! Y+ d6 R. V- n/ [; S6 c6 X! }   return FALSE;
; V$ Y  p& I' p/ a+ @9 a}. b5 W- y0 ?! q* z
( k4 z, j; i$ U& ^
Although this trick calls the CreateFileA function, don't even expect to be
+ G0 V6 Q0 k+ |+ yable to intercept it by installing a IFS hook: it will not work, no way!9 O2 d5 D5 b' a0 a
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
' o" g- c7 X2 G1 y" Iservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function); F1 {$ ^" @& c' u
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
7 @' N0 f( [  Q; Pfield.
, k5 K2 ]( O) z. wIn fact, its purpose is not to load/unload VxDs but only to send a : Y' c, Q+ }! x" M* z. X
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
: @4 ?/ P1 _0 Q. i; Z1 Eto the VxD Control_Dispatch proc (how the hell a shareware soft could try0 b- S. e/ P1 ?9 F0 h9 k2 r' f6 }
to load/unload a non-dynamically loadable driver such as SoftICE ;-).1 i- ?/ w0 N% B: v/ `
If the VxD is loaded, it will always clear eax and the Carry flag to allow
- G0 t5 K" [9 H% B! Z* R6 v* jits handle to be opened and then, will be detected.
; a1 T# x! o0 u4 G. U& pYou can check that simply by hooking Winice.exe control proc entry point
* p% C0 j" R" G8 Twhile running MeltICE.
- ~/ G; p$ @" G5 Y2 J
% ~7 ?, ?+ T2 T3 I2 x% P$ J/ z/ X. c
  00401067:  push      00402025    ; \\.\SICE
6 ^) [5 t( h9 }. Z7 Y) k  0040106C:  call      CreateFileA
# z/ \3 i4 s. q( \. M6 p& v/ V4 ?  00401071:  cmp       eax,-001
5 H' G- F* b+ n: x/ E  00401074:  je        00401091
# S+ q4 b" ]7 T* k
3 u/ ^! C6 |" s+ `% }$ X$ K
+ z& `0 Q# r1 T# B- o' p" FThere could be hundreds of BPX you could use to detect this trick.
$ N! p3 @! H" a4 U-The most classical one is:
) f' }4 O' y0 F  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||  \! F1 f  l. }  B8 J( L% s
    *(esp-&gt;4+4)=='NTIC'
7 o. M. q- j( s9 c' _: k' \  ~- ?$ F# \
-The most exotic ones (could be very slooooow :-(8 q0 t2 k) `+ F; s# i
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  
; V& U3 q" j2 }1 C     ;will break 3 times :-(
# A5 V% L/ P2 C. E: B$ N" @9 J  C+ X3 C4 H# b) z2 F
-or (a bit) faster:
& s$ ?4 s8 r- a) k% c4 a$ A# _   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
0 E) t1 d0 n$ ?8 m" k
/ Y. N. i+ f5 J1 ^4 s- T   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  
9 W# _3 s/ x) m" y7 V     ;will break 3 times :-(+ l9 P0 M* l  A2 f2 r2 z

/ r2 |) S4 V& C% g( m7 @% V6 z& @" N-Much faster:; \  _- A& y' h( D
   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'
3 q, a. Q3 F( H1 ~; H4 C- e# y
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
  R+ I6 o, H6 B7 W2 dfunction to do the same job:
8 O  O( R4 v. d( Y( n
0 O1 k( f% r' B4 W$ x. N   push    00                        ; OF_READ
! u0 ^0 [5 ]; Q1 o   mov     eax,[00656634]            ; '\\.\SICE',0
# O2 P1 Y: h# `+ y; A  D! W   push    eax
+ R* x9 ~- s; S7 _6 v4 u   call    KERNEL32!_lopen
  ^  X$ B0 {# \" D1 r8 [   inc     eax
: X7 L2 u$ A6 @/ p& T   jnz     00650589                  ; detected- I0 D1 ~2 d4 k7 Z; E  _
   push    00                        ; OF_READ6 i% f2 o2 f" ?7 |. G% V
   mov     eax,[00656638]            ; '\\.\SICE', z  X( A7 i: W3 X9 Y
   push    eax3 ?# ?' J$ E/ W" p; z# k2 j1 \
   call    KERNEL32!_lopen1 k" l: Y0 m9 N* S/ H! z
   inc     eax
. D- o( T2 s, |0 Y8 g& n7 \8 u   jz      006505ae                  ; not detected% L. E" A2 T3 Q/ j, H. l
/ W" X, B6 S+ z

* @/ r' b, c+ N  _& q, C/ h( S__________________________________________________________________________  b- [5 t9 M/ ]- s7 P* c

$ x  c) i7 G2 w6 r( YMethod 12/ s5 |" E7 p" l9 n: \9 r+ }! r
=========9 h' T- J8 X/ E8 S) M( @0 _- y9 ~, k7 g
- w- b- z  D6 }- q7 k  }
This trick is similar to int41h/4fh Debugger installation check (code 05, o% [$ i: d4 w/ G2 K. n
&amp; 06) but very limited because it's only available for Win95/98 (not NT)
% t% e9 C. r2 @! V# R+ ~3 kas it uses the VxDCall backdoor. This detection was found in Bleem Demo.& D+ o9 V. S$ Y! M2 U

' c3 F4 ]$ u4 B8 \   push  0000004fh         ; function 4fh1 W- `2 v+ G3 v4 u: I* {/ H# k
   push  002a002ah         ; high word specifies which VxD (VWIN32)* Q4 x4 a( X+ ^0 z. S
                           ; low word specifies which service
8 b' P  L7 V% l' S0 Q+ D                             (VWIN32_Int41Dispatch)( I9 _( F( n1 k2 W2 w
   call  Kernel32!ORD_001  ; VxdCall6 V: V4 [1 O9 E( ]% ]% E( _
   cmp   ax, 0f386h        ; magic number returned by system debuggers) w' O+ h. G' Q4 Q. ^
   jz    SoftICE_detected3 d2 G$ [) H* b' g& z( K

+ I2 A1 E/ S+ k- t0 g0 }Here again, several ways to detect it:- Z  ?& c0 F0 o$ B/ v5 S" X

: F, K* p7 B, L" @    BPINT 41 if ax==4f
  t4 n! G7 m7 K6 L
: J( K, a! E+ Y; ^0 {, [$ b# s    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one
" Q4 K  |$ Z( x& x4 p. Q: K/ Z9 K, l3 W
    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A% g7 k% K+ M9 I2 Y, `8 `0 E

0 ]) ~$ p* m6 a- Q# e    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!
7 ]0 z% W6 q& k' z) s9 x- S: T- Y( ?; p/ ~6 B& u! d
__________________________________________________________________________  c4 j, d# W2 N5 v7 Q- p
) N  P: c2 h5 y& \- P9 {8 O
Method 13) Y$ Y8 p6 s2 Q) a" s$ {
=========
; R9 A, U! E" `/ @' d" N% O
; `6 c. H) c+ _, u' ?% O) DNot a real method of detection, but a good way to know if SoftICE is
$ ]5 e  w" |  e7 }5 g4 Binstalled on a computer and to locate its installation directory.
$ P. o" U1 d: I- |$ M6 F& |It is used by few softs which access the following registry keys (usually #2) :
5 X3 j% S. X1 @# T2 T
0 o$ @4 C: Y- `) x9 X7 {0 v-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion. A  H$ l$ L) T" y; t
\Uninstall\SoftICE
7 z0 ]' v0 a% e% G( w-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
1 v# `- C& s4 V-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion9 z# a3 {6 g, {& G* X! M( O8 q
\App Paths\Loader32.Exe. J2 j, i1 u) l2 h/ |

8 k3 _* m! {8 A# R2 v. w+ u. Z2 o
Note that some nasty apps could then erase all files from SoftICE directory; a6 [; k- `" \, B9 s
(I faced that once :-(
( G9 l" v) e( G5 c
' U/ q% y' p0 kUseful breakpoint to detect it:
9 A# _) F" {8 s# D& _  `% b7 }3 ]% K: i6 i3 S1 E  b
     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
/ C- Z2 ~% n# P/ H8 b! x/ H
4 A- y, r+ @4 N' R3 ^1 c! W: E/ o__________________________________________________________________________
! P7 ~6 a) _# G+ o5 D0 s8 B
: e  F) P) T3 E& a8 n) c
" [/ `# U% M; }/ ]Method 14
. K( k& `& n+ Q. \=========
# Z0 a2 P$ e5 O0 J( V  B) |# a" {
* w3 j8 x' Q% UA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
/ Q5 ]; T4 z) t$ j; K. bis to determines whether a debugger is running on your system (ring0 only).
/ }5 o1 T' g% P2 x) S" T
) s$ B( c4 T+ p8 X; V   VMMCall Test_Debug_Installed
% e9 M9 n# o" B7 T0 e   je      not_installed) i& Z- C0 v2 \2 u. _- [  S
  }8 I$ X( T  `/ p' F& w# ?
This service just checks a flag.2 |6 w# }7 Q; _7 t" J0 e
</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|本地广告联系: QQ:905790666 TEL:13176190456|Archiver|手机版|小黑屋|汶上信息港 ( 鲁ICP备19052200号-1 )

GMT+8, 2026-8-12 08:32

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表