找回密码
 注册

QQ登录

只需一步,快速开始

About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
8 I7 a. w+ w8 k3 Y8 r5 J) {' ~4 m<TBODY>7 ~+ `+ @/ j# c  T7 p4 J5 @
<TR>
( R& `+ n  z% c* m<TD><PRE>Method 01 3 G8 f) r: _3 d3 ^. d
=========" Q* a* j+ H6 n0 O/ [# `8 y5 h, Y
$ }; O* p/ O. ^) [
This method of detection of SoftICE (as well as the following one) is# ~8 u) F, V; n. _5 q, [* p1 @  ]
used by the majority of packers/encryptors found on Internet., D- b0 R2 @6 ?5 f1 U
It seeks the signature of BoundsChecker in SoftICE- Q) p/ j, q" K

/ E0 \3 l& V3 E    mov     ebp, 04243484Bh        ; 'BCHK'+ Q  q% A# v* X3 E6 @
    mov     ax, 04h
3 ^; J5 l& h2 ^. Z    int     3       $ ~' B2 m" H7 @4 }3 a9 G
    cmp     al,4
$ l5 d9 @& r4 M; n9 q    jnz     SoftICE_Detected6 a4 F; _. K" \+ k

2 n% V! L0 C& d$ o: O' S___________________________________________________________________________
2 H/ x: l- ]6 P, U/ r- Z/ ^
9 ?) P6 o% w! Y9 e3 f% K! D# M8 SMethod 02, f/ U7 @8 t5 @; B
=========+ S/ R; {" ~! s1 C: q4 t8 l
, ]! A, L2 R0 m5 A0 y3 s
Still a method very much used (perhaps the most frequent one).  It is used
3 b3 A; l5 q/ n! @$ c8 Pto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
+ y8 V# F3 l. h2 z% dor execute SoftICE commands...8 n! V" ~3 x: ?1 \' I
It is also used to crash SoftICE and to force it to execute any commands8 }0 U( J, ^, Q  P: r
(HBOOT...) :-((  
3 R- k; V- q9 j$ U/ a1 M( U, Q
) T1 E  ?3 G8 Z6 m& vHere is a quick description:6 K9 ~0 F; E9 m" v0 n8 {- i1 G7 l
-AX = 0910h   (Display string in SIce windows)+ f8 A( Q6 i0 U0 M) N0 C% E
-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)
* f+ T* O+ L1 c; X-AX = 0912h   (Get breakpoint infos)' \! n3 v$ z. X- X
-AX = 0913h   (Set Sice breakpoints)' `9 L* W1 ]7 c& Y, ~. e9 c; i
-AX = 0914h   (Remove SIce breakoints)* d5 T! P) }8 X
3 T3 A! j% @4 b2 {( k7 J3 C
Each time you'll meet this trick, you'll see:
1 M9 C1 w! d' G& a3 ]5 y-SI = 4647h
& x( z% r- w' I7 r-DI = 4A4Dh  ~6 V2 f- j$ I: ]$ O$ m
Which are the 'magic values' used by SoftIce.9 M3 A0 D( W, V1 u% N* i  c
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.& V) r) B- d3 F& }- u% ?, u% ]$ v
/ ?+ D! W3 G4 C( M5 D; F1 q) B, {& X
Here is one example from the file "Haspinst.exe" which is the dongle HASP
5 r7 W, z' F8 f3 `Envelope utility use to protect DOS applications:# B3 i) a- F+ G
& W. e1 w! N+ V

" k# S% D1 K1 u; e4C19:0095   MOV    AX,0911  ; execute command.% `' O, S8 E7 D9 R3 y
4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
. o6 ^3 M4 A) x4 a4C19:009A   MOV    SI,4647  ; 1st magic value.
) [, s6 L! ]( C/ t8 v7 ~) m5 _4C19:009D   MOV    DI,4A4D  ; 2nd magic value.! x/ x8 ?$ d- S6 M, h/ E
4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
/ b7 H9 k1 R, k) H8 L, M$ F4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute
& ?) I% V5 {& [; j) H4C19:00A4   INC    CX( `$ L4 ^4 u# b3 E$ _
4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute
8 J- V! F  _+ o+ l4C19:00A8   JB     0095     ; 6 different commands.
! h: K2 y: j% J# D7 {. w4C19:00AA   JMP    0002     ; Bad_Guy jmp back.! x' ]  E% d% S. v
4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)
0 k3 P2 w! |( m( ?4 I
1 B; p# d+ _5 K% g6 C" WThe program will execute 6 different SIce commands located at ds:dx, which8 V$ G6 O% d- W* K: K! B
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
: J. M, h& Z, @6 B- D6 ~  p5 [0 Y: c' [
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.* |; n4 p7 N4 b- b
___________________________________________________________________________
. a0 W$ \' {( y6 V9 j+ m
: U8 P' G9 {5 o4 C1 w$ Z% Q6 f) U* F8 u& _$ e& \
Method 03
/ |, b! E! G+ T+ \=========
" ?* `6 l( b0 }& d9 {) }
  C- ]/ S- \5 w) {Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
* S, O" o5 D4 l) w" w(API Get entry point)
! l7 J' E- |, ^! u/ o( _        
! H  V" ~, T: L1 x& s; U( h8 j1 g6 T/ C. n
    xor     di,di, E0 S4 I1 r5 r
    mov     es,di! Z4 }; E0 W* ~* W6 e
    mov     ax, 1684h      
/ M+ q$ v5 d% i( c2 {$ L5 b+ r4 u    mov     bx, 0202h       ; VxD ID of winice3 E! {& ~0 Y. y
    int     2Fh* _# [2 U- }( m7 M! U6 h( U  o
    mov     ax, es          ; ES:DI -&gt; VxD API entry point
% n" m2 W' V+ c, {+ Q6 ^    add     ax, di3 n- k' ^# G; [9 ?5 i! f5 s" m3 @
    test    ax,ax
' Y3 H% E5 R# a" D2 ^    jnz     SoftICE_Detected
6 W$ G+ S5 J- C( b! h$ y0 w- E: P4 \
___________________________________________________________________________
& y' n' x) U: h' `
% p8 y5 H6 y- `# u+ qMethod 041 J( g( B+ L! g% Z1 n& I
=========0 X& D& Y6 k) \) S7 U2 d% V
5 `" c5 E. H, W. j7 [0 e
Method identical to the preceding one except that it seeks the ID of SoftICE6 x- ~$ W; [3 L" O# C; t
GFX VxD.
( P9 U& q& p* y1 T& b
  n( o1 P! ?1 F2 {    xor     di,di# [3 k, E1 |* `5 B0 U
    mov     es,di- _8 M' v7 @; Y: S1 u
    mov     ax, 1684h      
' C" R7 n' C3 t5 t/ Q7 v/ F' t    mov     bx, 7a5Fh       ; VxD ID of SIWVID
/ h  o2 `- t1 j- r  }* A    int     2fh
; {- k. I7 L( M, w$ `# a. V% m    mov     ax, es          ; ES:DI -&gt; VxD API entry point
) e+ K! }# p6 q, O5 d, z. m    add     ax, di; z) z/ H8 Z8 D% K" r) ^1 e
    test    ax,ax
* q$ Z  B- _% ]3 u1 S    jnz     SoftICE_Detected
- k/ j0 A$ }& q7 e: t# o; E% O# C& g  Y: p! J0 D3 U
__________________________________________________________________________  ~) h) K" Y+ ~! n* B1 |: v; N

; `7 K- C- z. v- @
$ M8 C2 h( {6 h( jMethod 05
/ z0 d' X. a; i6 `8 g+ J$ g=========' j$ B5 E; h% q$ ~

+ z$ b1 h5 {2 q+ }Method seeking the 'magic number' 0F386h returned (in ax) by all system  j0 Y/ ~/ Y, F* t3 l! s
debugger. It calls the int 41h, function 4Fh.' A7 c( }/ }9 Y
There are several alternatives.  
$ U/ p' i! }/ i" |2 I3 O
/ Q5 q4 O7 w6 W+ b0 b: \( uThe following one is the simplest:  b- p/ I  S1 k" o8 A" ?5 t
! I, @0 @2 n, }7 F& j
    mov     ax,4fh  R- B) e! E4 S1 l
    int     41h9 s' V2 S( R& i1 ?5 T
    cmp     ax, 0F386
6 ?$ ^$ U3 r5 Y# {7 [& `    jz      SoftICE_detected
! T( d) d) B8 h9 K1 b  Y
6 h9 N* O( e6 y5 Y% z/ c
7 e" O8 T5 S" a# t% m7 oNext method as well as the following one are 2 examples from Stone's - S/ e3 E' D& U1 B, U  U$ \4 x& h
"stn-wid.zip" (www.cracking.net):
- q3 H2 M  Z; v: u0 b$ V* N# f" y$ _" I3 R( s$ S
    mov     bx, cs* g: u( h4 L3 W- T
    lea     dx, int41handler2' C5 T; w8 Y7 L/ y
    xchg    dx, es:[41h*4]
9 {# Q# h$ w0 o: E+ G  X" W    xchg    bx, es:[41h*4+2]
  M* M2 q- \$ [1 F, j" \. j5 @    mov     ax,4fh7 v4 x: \, `8 o
    int     41h
6 ?% Z9 d2 |: X# p6 @& E" @# f    xchg    dx, es:[41h*4]
: @# L/ R5 m' ^' V1 d) b. \- ~    xchg    bx, es:[41h*4+2]
) ^8 F0 O# k% p% v# q7 N7 {& V    cmp     ax, 0f386h
# Z9 \! i/ R4 l/ E6 |6 \0 {; u    jz      SoftICE_detected
  {6 ]' _7 @. M# o; K7 s* I. f2 }. v. W/ L0 J
int41handler2 PROC  B- \& K' \/ e' r
    iret! R# G: [1 Q; W0 x" ~4 Q* b
int41handler2 ENDP) x, o9 [: E' K8 }2 q; I' ?6 b( }

6 h, {4 f" ~) F" `+ N$ \; ^
9 i4 _8 x4 ~4 j4 H_________________________________________________________________________
4 u0 A; v- k9 V. n7 g7 J# F5 M  [, b

$ i) n7 D& b# _8 ^4 O+ QMethod 06% R: G' ~6 p& R5 f% M
=========2 G3 I! K0 j' I- \

% ]" m4 M: @( V; o% w8 ^- W
* W! J% A% [( q( s2nd method similar to the preceding one but more difficult to detect:
0 ^0 l4 O% |. t7 P$ j7 D! i3 Q& ^3 s) S8 [* W* ^) [  U
6 `7 f0 z/ Q( o2 ^. K
int41handler PROC
2 h4 ]6 ?3 A: P' p4 w' h    mov     cl,al
2 ]4 U6 n5 `- V    iret
/ L8 I) ]- i' S+ H  \9 f  Bint41handler ENDP
0 z& p6 V& O: g! `$ H  l1 \3 d9 z0 Z

6 A$ C" J2 Z$ H    xor     ax,ax
! ~, F: O% b& Y2 P0 r/ d0 Z8 W1 G    mov     es,ax+ G. l" h; f, B* I( v' b
    mov     bx, cs
0 Q  r  W" h- S; A* S8 g    lea     dx, int41handler/ q" R% H( E' e0 c( a- m3 \
    xchg    dx, es:[41h*4]6 J% e: ^: r0 B7 J1 o; O1 C0 A" Q( m
    xchg    bx, es:[41h*4+2]
; Y+ O8 R! c4 ^! v  ?    in      al, 40h, J: B% r* K  N- G; V6 l
    xor     cx,cx
( c& u. {5 t$ q) `: Y" A6 Z    int     41h
/ I$ j+ a9 r. K) }4 E1 R8 J    xchg    dx, es:[41h*4]. B: C7 v) M  t' T/ R& ^1 R
    xchg    bx, es:[41h*4+2]
- V3 q# {9 r/ g( U    cmp     cl,al
3 D- b( C0 V, `1 O9 i    jnz     SoftICE_detected
" O) h' o4 ]' y2 L; X0 `1 C) I7 F9 h# n" b
_________________________________________________________________________
+ F* K% W0 I9 }# W+ }. N3 P  [: v3 d. `+ A) Z/ y; w, u7 X
Method 07
2 O/ ?' y& _7 s  L2 ~- `=========# u& R+ k! a4 |( S+ H

$ Y' p$ h$ K% B1 F% iMethod of detection of the WinICE handler in the int68h (V86)4 @2 T# \5 D+ q+ S! t
) q+ \8 J  K, @2 ~7 z2 Y4 O
    mov     ah,43h
6 o+ M0 Z2 F( R9 v+ E. P( }    int     68h0 ^) a/ C, z# }9 a
    cmp     ax,0F386h$ f7 A" E4 {& `
    jz      SoftICE_Detected8 r4 L$ k, \. {% ~1 J3 o: F

. e6 a% j! P9 x% b+ }" Q+ V" i7 |3 T9 L
=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
! y' H; c, X0 V* Y9 r1 r   app like this:+ d) N1 ?6 s6 H. v8 [

$ D! `" I. |4 E9 k; G   BPX exec_int if ax==68
$ s5 K: i3 I0 J* r4 A   (function called is located at byte ptr [ebp+1Dh] and client eip is
# k5 E7 I7 W  ^& ^: a% j   located at [ebp+48h] for 32Bit apps)0 S# ^7 [/ X( G9 U* g! [; N5 x
__________________________________________________________________________! y# j' P7 I3 v, Z- N6 _9 N. d
+ p6 m# G! {7 \6 x6 N" u
, u& u5 @: }8 J2 b  c! U0 b2 t
Method 08
+ [- R$ L. D4 q  i: K1 X% |- u=========
" [8 j2 A6 ]$ m. z8 Q
7 o" j- J$ s' l! m9 B$ e1 S, b9 `It is not a method of detection of SoftICE but a possibility to crash the
' w7 x3 G& e2 s) c# s8 S' jsystem by intercepting int 01h and int 03h and redirecting them to another( B: P% W  ^7 j% @( x" Z$ A5 j
routine.
; g$ M/ \0 u, H2 J3 zIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points7 F; @# H8 P$ q: V7 S
to the new routine to execute (hangs computer...)2 s% M" G$ i- ?$ F

4 c- X$ j$ h7 j& l: H    mov     ah, 25h' _: h8 s6 _; n0 I
    mov     al, Int_Number (01h or 03h)
8 O4 r8 s+ D. m* }# D    mov     dx, offset New_Int_Routine" o, K  j( d5 s5 S% Y
    int     21h- U8 B# @* u9 N0 k5 U- h

( `, @& i! R7 F* P__________________________________________________________________________" a% Q+ b% {/ l% _/ n# ^- v! B1 s
& h6 T6 t) K/ v8 B$ N' ]' y
Method 09
- D2 u. T' K/ ^4 I; r) R/ O& T=========
) H8 R! A- y: C3 e! d2 A9 w$ N: r, w' Y/ C
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
, q; o9 D' j1 d$ [performed in ring0 (VxD or a ring3 app using the VxdCall).6 z( i% H) Y: g9 v3 ^7 Z
The Get_DDB service is used to determine whether or not a VxD is installed
6 r* `& j/ ]  Ufor the specified device and returns a Device Description Block (in ecx) for
2 B, N  y5 G" c- l8 `9 c1 {4 g& ?that device if it is installed.$ w# t) ^5 f1 l" e  I2 l2 Q

3 w# S8 Y6 }- H2 y& \0 a0 P+ E   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID9 r9 ]+ G, `+ [2 l. @, ]* Y
   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)! a& `1 a# }7 y( K; A) @9 q
   VMMCall Get_DDB
9 `; a& i' I  g6 ]* z" l   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed; N/ z4 |" M2 c5 d" q

! s8 s  B+ e0 {& ?. v# pNote as well that you can easily detect this method with SoftICE:$ N+ r9 v7 \" h. Q) `  k
   bpx Get_DDB if ax==0202 || ax==7a5fh
# g% D. a7 `1 i' k! x6 I; i7 b: J6 \* w! Z% M2 B3 B$ Q. r
__________________________________________________________________________  _2 t1 a! \% A0 W0 W
6 y- s0 G! w4 k7 @- P+ c. O$ z
Method 10
. M# `4 p+ H' f+ \# h, h8 s2 w. ]=========3 b: P. U9 _) ~9 l9 h8 m5 c

& m0 k8 f+ `9 B- w/ x# o=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with' n7 ~6 K. r3 F+ T; r
  SoftICE while the option is enable!!8 q% u. f  H: P- q  m1 ]9 R3 l

/ s/ J# {3 S) DThis trick is very efficient:
6 e7 R9 `! v9 z- ]by checking the Debug Registers, you can detect if SoftICE is loaded$ m' Z0 |( u0 {0 l. ?+ @
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
# y, A  u3 [4 q) d+ Dthere are some memory breakpoints set (dr0 to dr3) simply by reading their5 b" P; |8 ~) V2 H, q
value (in ring0 only). Values can be manipulated and or changed as well2 E$ t& U  ]0 H2 D4 ^1 `* l! F
(clearing BPMs for instance)
$ x& T9 c, c% G7 X6 t- C, D# O; ^3 @6 Q, d, O& S& i
__________________________________________________________________________
6 J8 h5 e0 q) t# N5 P
" z; i0 R7 }) _2 U6 K' q* e; q9 `Method 11
0 H/ J9 ^3 n& _=========
+ h, ?' W; R6 D0 a4 E+ e! u
1 o" [7 D7 |6 @3 R- |6 \3 k' G+ HThis method is most known as 'MeltICE' because it has been freely distributed
3 y9 E- e0 m) J+ r$ gvia www.winfiles.com. However it was first used by NuMega people to allow* Z( v" d9 R  X; ^! V2 M
Symbol Loader to check if SoftICE was active or not (the code is located3 w: W* E1 O7 }+ G4 O1 L
inside nmtrans.dll).
# O5 T- r3 m: ?" \' z8 ?. E9 g; I- m+ c
The way it works is very simple:& u# g# o* E6 R2 ?4 s
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for9 @7 c0 k8 X6 U4 T
WinNT) with the CreateFileA API./ O' A/ W. W& z. C

9 X9 q1 ]  ]  j6 ?" \4 S: f$ nHere is a sample (checking for 'SICE'):
4 J# {3 N! G3 \, U' U+ w+ N" b% n
1 K7 r% n! o+ e# K  dBOOL IsSoftIce95Loaded()
; p, n3 D! P2 C- O& {{
3 H9 E2 t: j4 _( {   HANDLE hFile;  
# j9 l# o0 V, X6 l7 e$ m   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
3 Q8 |4 E& {+ _# Z- o! H                      FILE_SHARE_READ | FILE_SHARE_WRITE,! X! T; M) D8 Y( L  H9 e- r
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);, B6 m! B  D' z: Y- B
   if( hFile != INVALID_HANDLE_VALUE )
8 [7 w% H* a! ~: J. z% f   {1 J# |/ R6 e1 O1 p
      CloseHandle(hFile);' [1 e" }- z8 t' B
      return TRUE;
; C/ P; s- l2 s# V9 i   }4 H% b9 u% z# C/ }* x
   return FALSE;
' s3 Z' M& ]0 O! ?$ e6 u}/ x" }! |6 J: }. g7 x
% l1 h+ a" ~, ?2 O/ ]
Although this trick calls the CreateFileA function, don't even expect to be
5 |2 t8 W+ t- i, ?* ~able to intercept it by installing a IFS hook: it will not work, no way!! e8 u3 T% T. D8 D$ Q6 B7 }
In fact, after the call to CreateFileA it will get through VWIN32 0x001F' O% ^5 \( ?* S3 O
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
9 Y4 M" \, c) P/ @! tand then browse the DDB list until it find the VxD and its DDB_Control_Proc% c. `- D; h7 b! x7 j+ S9 |
field.
7 z3 }/ a1 c  }* Z+ A4 rIn fact, its purpose is not to load/unload VxDs but only to send a
9 \; @) N$ z. X1 c& d' @3 h# v) ~W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)! {- g/ `; ]6 M- B: v& E
to the VxD Control_Dispatch proc (how the hell a shareware soft could try0 H. K- N* b9 J  R% y- M+ L5 d
to load/unload a non-dynamically loadable driver such as SoftICE ;-).. J8 V9 ]. {/ Z( s  F) V
If the VxD is loaded, it will always clear eax and the Carry flag to allow
2 z+ J- w( j. j- Aits handle to be opened and then, will be detected.: O4 T; W" C& N; E
You can check that simply by hooking Winice.exe control proc entry point
5 d. v$ _) U0 F1 v1 Nwhile running MeltICE.
# E" V+ {% ?% ]+ L% c. ]# ]
1 s& t3 z* V; X6 u$ Y2 k. a9 z. w5 d& S% ^1 P
  00401067:  push      00402025    ; \\.\SICE
) m+ K8 L# `" N. a  o. T  0040106C:  call      CreateFileA
3 G$ S! \+ c6 T% u  C8 I+ ]- R) C  00401071:  cmp       eax,-001
0 D$ D! U% j' Y+ h1 ]  00401074:  je        00401091+ e" q& l( {) d4 [1 x
( a2 C# U. P) m8 Y4 b8 X

4 ]& Q3 H! m! f! c  x6 b0 OThere could be hundreds of BPX you could use to detect this trick., {+ |& _+ J$ B! p7 s4 a, q" [
-The most classical one is:, b6 ^( \3 [6 X0 }; m
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||3 d% J* ]1 M% Z
    *(esp-&gt;4+4)=='NTIC'6 [3 c* L9 w. }; _) E, _! |

, h: H" ~2 b& s-The most exotic ones (could be very slooooow :-(; W8 j8 o8 f- C  H! z
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  " w& S0 `/ p3 f) Z. }6 o
     ;will break 3 times :-(& I- g& ~0 D* i) S9 P1 ~# b
* ^$ k! A0 n/ t$ K. Z3 r
-or (a bit) faster: . T3 r; T" Q7 u) @7 W) q
   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')6 X6 m% H6 j6 K. K

- C+ L* i$ z$ w( }5 P8 _   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  
  e; ^. ?1 p7 o0 q3 y) k! c     ;will break 3 times :-(/ d. e3 B# M' L( B/ \9 E2 Q

3 [) B: T& v$ }% |-Much faster:
9 {  A, v' y; [6 f- `   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'9 t8 l$ k# S- t8 t4 V8 D
; r+ }, P: J2 q; h! d
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
' ?9 ?9 T. D5 ~& x1 N6 Jfunction to do the same job:: a5 M+ a9 o' P. o) c
8 g3 N& [: K: x3 @1 ^
   push    00                        ; OF_READ
: M. b: M" m: ]   mov     eax,[00656634]            ; '\\.\SICE',0
  N/ A: M; e5 o; m  n6 Z) W   push    eax# [/ U- c4 W1 {; b
   call    KERNEL32!_lopen) b& r9 y+ r1 ]* y( m
   inc     eax3 Q( s0 I( N$ z3 t1 p
   jnz     00650589                  ; detected5 c2 `- [' k8 f( z' Y. O
   push    00                        ; OF_READ
+ q+ J  C) P  a6 E+ o   mov     eax,[00656638]            ; '\\.\SICE'
- f; X3 Z. B+ S/ z/ H9 i2 y   push    eax
3 y9 n5 f7 l: M. k) J& _" d   call    KERNEL32!_lopen! ^! `/ J% o: m
   inc     eax
* ?6 H" U. |8 Y" f6 t0 L   jz      006505ae                  ; not detected* G- o) c" m  C# N: Z

. R# O2 v5 e' w; i' M6 ~: |  p/ Z
__________________________________________________________________________
( F& e/ j; n+ j! d% i2 P8 i, F8 K$ Z* m
Method 12/ k, p  v% R+ X" a$ X1 x# X# x
=========
/ a1 Y7 f5 x- E! e$ m- u* C* v; u% z8 D$ H/ ]: H0 t0 [
This trick is similar to int41h/4fh Debugger installation check (code 05, t" j7 J: F: {
&amp; 06) but very limited because it's only available for Win95/98 (not NT)
1 u8 o- n1 b# C7 p$ ?6 U6 ]as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
- r6 R0 d% A# m8 F1 [, A
+ F# V6 n3 F2 F7 L6 K   push  0000004fh         ; function 4fh9 N5 ~5 g3 t! z1 l; g
   push  002a002ah         ; high word specifies which VxD (VWIN32)! \" S  J. P% @9 k2 W2 T
                           ; low word specifies which service) E4 @! e: u3 u* A1 c
                             (VWIN32_Int41Dispatch)
; d+ g# Q7 T8 Q4 W" v9 Y   call  Kernel32!ORD_001  ; VxdCall6 }9 d" D& [# v( T( L1 M% D/ G
   cmp   ax, 0f386h        ; magic number returned by system debuggers
4 p: k9 m  V. d% p2 X8 \# ^   jz    SoftICE_detected
4 t; @6 D; p2 [% v& b0 \
1 z5 S9 D% x+ _# B# c3 d+ Q- AHere again, several ways to detect it:
2 M+ ]7 M: @& [& J0 K# t! k- I: G0 M/ X. k- T) d5 l: v
    BPINT 41 if ax==4f* Y3 Y* y+ e' {+ {' k
" F  Y; s8 G/ @7 W1 r: j# N; T- I) K
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one0 @' k5 |) W9 y: Z8 w
( P, s7 L' G' e  M( P
    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A/ Y0 m6 b2 G! V
, L0 m! f/ ?4 `4 ]* b2 N
    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!9 n! }2 p# K" Q# i7 {; J
, {0 Y- h) B, J$ c9 J0 f
__________________________________________________________________________
! t1 y) Y' t1 V9 l) ^3 u, a6 [; g& g0 e
Method 135 h# D% t! I! {; I; L( t( R/ T
=========
' i5 g) }/ D$ c
# k$ {. }* f' u" z- _, BNot a real method of detection, but a good way to know if SoftICE is( g8 K3 k. _9 Z+ I
installed on a computer and to locate its installation directory.1 D* K% N! e4 E9 s1 ?
It is used by few softs which access the following registry keys (usually #2) :' A  B) m( N3 d. a) K0 M7 b

4 e2 ^8 P- K1 H! \9 P-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
8 \+ y0 n* D- W1 j7 C8 T+ e- h\Uninstall\SoftICE
. y+ @2 M$ K$ b: x# e-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE2 b+ w6 Z' z" Q6 C% M( m
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
% Y/ v6 N- W- ]* X2 ~8 M\App Paths\Loader32.Exe% l# {& l7 S0 d6 V

' Z8 F" G" h6 k: W
3 B+ K% g% b- v7 I4 q5 j6 j0 X) uNote that some nasty apps could then erase all files from SoftICE directory& Z* C; k1 C: S4 d) q3 D
(I faced that once :-(( P" U8 ?4 K3 D3 E
* x: r4 _! `2 W2 W6 K+ b
Useful breakpoint to detect it:
1 x% o7 ?( P7 I( n: L
* y5 y$ A8 I: [: j2 R' c4 F; Q' ^     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
% r6 q6 H, Q0 [+ y/ i/ }8 n0 [0 O) @- V( h! N  `# y2 P
__________________________________________________________________________
$ j6 i1 p' a& {4 p
: b0 l5 a: e" I' S6 ~" `3 w6 ]# b7 h( ~; i  E
Method 14 8 d7 M2 k8 N/ {/ d3 l. D
=========
7 s, C. P* E. T, V& U, Y2 S5 H5 j1 Q$ V
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose6 Z- m) }" q$ @, q6 J8 F* \
is to determines whether a debugger is running on your system (ring0 only).
) j9 l; m# I- F: s% L9 v" v) Y; V( _. x, Q2 P9 a
   VMMCall Test_Debug_Installed
1 {: m4 z% S4 I- D3 k   je      not_installed
/ O' c7 _( a1 X+ Q+ G% f+ U
+ X0 u) P5 ?8 o5 S- n5 {9 I7 [; _This service just checks a flag.! e& z" K/ b( r6 T, c
</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-8-9 00:25

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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