找回密码
 注册

QQ登录

只需一步,快速开始

About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
  O' w; ?$ E, `+ L! u; n<TBODY>1 t/ U0 ^) s& I) D! a
<TR>- s+ Z1 {0 a4 a" A9 U, ^, _
<TD><PRE>Method 01
$ R- X" r. ]- z( J=========
' ?; Z0 n' u: l0 B# ]& i, I3 i
  r. \) A: G0 c2 V9 v$ r! I3 J- pThis method of detection of SoftICE (as well as the following one) is. o/ M8 ^3 f" `
used by the majority of packers/encryptors found on Internet.
% H$ f9 A- [1 f" N1 t, J% K6 q- lIt seeks the signature of BoundsChecker in SoftICE
9 \  K4 E) M. y/ B" q2 E- j
' k: F% b5 [) P* S1 ?3 N    mov     ebp, 04243484Bh        ; 'BCHK'( D3 A: y' t4 z( @- K" i) b9 j
    mov     ax, 04h
/ G- H0 _; \8 @    int     3       ) j4 B+ ^* }* X! P, V: T
    cmp     al,46 u# c7 t3 e# T6 P4 M* x# g6 u
    jnz     SoftICE_Detected. j) R& ^" C& n4 T( S* W6 M
+ I3 }! {! o# i) v% L! `3 w
___________________________________________________________________________3 |' N( m! ?3 i6 _0 E

: K' w3 h# c( o$ g8 L/ z3 a( bMethod 02
' u" A5 u  P6 R0 l=========
1 n$ o- s& q* b" w# n0 w" L. c; U' Q& `, h& s) J! k) x/ c
Still a method very much used (perhaps the most frequent one).  It is used
. N3 f. U  s+ S4 M4 k) d. n9 ?) X; {7 dto get SoftICE 'Back Door commands' which gives infos on Breakpoints,+ w& N, X& K. G7 ], t% C
or execute SoftICE commands...
/ L0 k! F% V: D: \% m- M# U4 ^It is also used to crash SoftICE and to force it to execute any commands
: |; s; r7 C' g(HBOOT...) :-((  
4 A/ o/ f0 e' e* ^! Q
0 S# E, c) {0 V" v/ XHere is a quick description:, `5 ?. Y/ a( Z' t2 B: c
-AX = 0910h   (Display string in SIce windows): _4 ?; [" e' }( K
-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)" Y* G) q! Q' G
-AX = 0912h   (Get breakpoint infos)* Y: |0 H& V/ W0 L
-AX = 0913h   (Set Sice breakpoints)! W$ r$ D! j: M3 A
-AX = 0914h   (Remove SIce breakoints)
* G8 _& V+ W2 B* x
- u0 i! b/ ^0 K5 D5 |6 ^! j5 \6 ~# oEach time you'll meet this trick, you'll see:
% H8 t, Y7 B- T7 a-SI = 4647h4 i  O3 @. A4 I& M2 h
-DI = 4A4Dh' @" t) r( d8 O/ o
Which are the 'magic values' used by SoftIce.
2 Q7 B+ I) e1 uFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
! |3 O" X+ M" x* ]( o% g
" A6 n/ H: M# ~! I5 n  X# ^* A* JHere is one example from the file "Haspinst.exe" which is the dongle HASP
3 L4 @' E$ p% Z3 {+ D1 D# GEnvelope utility use to protect DOS applications:
& t7 g9 {* Z) z4 E; Q: y$ F
6 N2 w$ l' ]  _& j& G0 P6 o3 _
: ~, V( A+ v0 m( e% d4C19:0095   MOV    AX,0911  ; execute command.* x, l5 i' \7 J2 E5 N/ ^
4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).) x, Z! S* y3 X% s
4C19:009A   MOV    SI,4647  ; 1st magic value.
4 f" ^0 p, L1 r: @4C19:009D   MOV    DI,4A4D  ; 2nd magic value.1 N! g% N+ m5 x9 k, ~' V/ s6 M
4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
& b  ^6 d" `6 c4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute
. D) d( O" B* ~+ ^& @6 w4C19:00A4   INC    CX
. C) Y" k% l1 P5 s4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute
! p: ~9 N7 ?2 Y# p! T3 W1 E( h4C19:00A8   JB     0095     ; 6 different commands.1 u$ I, @6 t. }4 O4 T
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
4 g8 Q7 J; P! B/ q4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)
6 ^: F, e4 \( R/ F% l5 I/ B, ]" c7 @- y
The program will execute 6 different SIce commands located at ds:dx, which( P$ G& B: F( i7 e
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
7 c7 ]# G# a! W1 l2 m
1 o  i* X7 r6 ?5 ]6 [4 E4 r* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
* {3 m+ e) H5 p! o9 R6 f8 K7 u: R___________________________________________________________________________3 j+ v, z& K" g: s: s- N- W3 d

( T# i* h0 H. q0 C3 q- [
( c0 Y, P0 f% y9 h0 }- ?' x9 sMethod 03
% `$ s4 ?7 A* s) W7 x=========
$ S" I7 C5 R0 N! @( Y" o$ t/ E3 }3 m* @  B) Y/ S
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h) P2 `9 o; O/ ?1 F8 U4 G) t" s$ P
(API Get entry point)
; H: c4 @# I+ Y; G' G2 x$ w6 ?- ]+ I        9 Y( p; |- @, c5 t/ {1 s; _; d
0 e, a- u6 E$ m  b
    xor     di,di; U5 @* Q+ c' y3 R+ ]5 _
    mov     es,di
" Y& i: s3 S$ d. s, Y% h    mov     ax, 1684h      
7 C& C  E6 u/ H: P! X    mov     bx, 0202h       ; VxD ID of winice
- x+ i' V4 f. k4 f    int     2Fh$ G1 [+ x+ s* _0 p0 a% {1 C
    mov     ax, es          ; ES:DI -&gt; VxD API entry point
* X; j: |) \; a! X    add     ax, di
. K; M) k7 e9 Q; }# h    test    ax,ax
$ }! u1 O7 V9 q0 R    jnz     SoftICE_Detected( z" i; u( [) V8 i5 ^/ h- N

1 K( T  E& n1 B/ v. Z___________________________________________________________________________, m$ T3 R, M, a% l  y

* [/ C% R" O5 a8 |: BMethod 04
; ^8 A1 o2 I+ T=========; m- ^7 M7 p7 n2 x

* f7 |6 M' |7 g2 F& hMethod identical to the preceding one except that it seeks the ID of SoftICE% z! b3 L* d& M1 U( P2 q+ c# j
GFX VxD.' L% C& Z* C7 j
( P  `7 m' m. F* L6 ~+ I2 ?- U
    xor     di,di: h0 @# H3 V2 ]3 x5 @
    mov     es,di
+ h9 j$ s' r, k3 Q+ n9 |    mov     ax, 1684h      
7 I5 |! z5 n7 R2 F    mov     bx, 7a5Fh       ; VxD ID of SIWVID
) _6 |+ M6 Q9 D$ N    int     2fh
4 u: n5 }7 n  }# r1 v# g, c    mov     ax, es          ; ES:DI -&gt; VxD API entry point7 x/ |, n+ Y% |7 X* k' y- n" S, ?9 }6 _
    add     ax, di/ L: D# ~6 ?6 m; r$ q
    test    ax,ax. G  b3 R; `+ `  g& e
    jnz     SoftICE_Detected
+ {+ }, B2 F7 S/ e7 ?0 d7 k
2 \% q( b  Y' |' }6 W__________________________________________________________________________! f. @) r/ [9 h. X

. c" ~7 E; m- V" k1 N4 y
$ s: X" t2 k# d% H8 Y( G2 f3 @' QMethod 053 q7 o( L6 z* b! x* m
=========% w# W6 i( p* a5 Q5 R: D0 m+ [

$ e; o- o+ Q: x( j1 U; m* BMethod seeking the 'magic number' 0F386h returned (in ax) by all system
# m1 ?! Y6 u& W6 P; y/ H6 }3 X& Ddebugger. It calls the int 41h, function 4Fh.
7 M6 h* E0 ]' Q4 |There are several alternatives.  
- e( R1 v! U, k' ?5 O. Y+ P/ x  Y5 q8 T# E5 ~
The following one is the simplest:* I0 L" b+ x" V' A$ j, b) R

; f& R; l2 D" ~$ K    mov     ax,4fh9 y% d6 |* P2 G
    int     41h
( \& k% z* W. ]0 X    cmp     ax, 0F386
, t9 |9 Z$ r. _% _1 H+ S    jz      SoftICE_detected
8 _' j' _0 i) a) H3 i+ O( s
5 h8 x) V$ E' q/ }6 H2 ?5 J& @' W. ?2 K' X$ @' l( B
Next method as well as the following one are 2 examples from Stone's
* f/ @6 R# J' I! n3 Z: i"stn-wid.zip" (www.cracking.net):0 b. s4 z' x1 i/ M: |  O/ A
8 d3 k. y3 o2 F4 H+ E
    mov     bx, cs* j3 W8 d' n  m, _
    lea     dx, int41handler2
% E2 J7 x- o5 d) \    xchg    dx, es:[41h*4]0 U4 c4 e( G9 b$ N
    xchg    bx, es:[41h*4+2]
5 O. J0 o4 t0 w  B) o: B+ m% h    mov     ax,4fh# |0 K  c2 I( ~6 @5 e3 d
    int     41h* E7 f! q% U0 _( n
    xchg    dx, es:[41h*4]- f6 H" O3 @, i' I
    xchg    bx, es:[41h*4+2]
5 U% c. \- S7 f3 |    cmp     ax, 0f386h
0 |) C8 X0 ?% M4 n  f7 ^6 L) u    jz      SoftICE_detected
6 _: H9 D3 Q& p4 V8 A$ b* K# e) ^# X9 F
int41handler2 PROC; b) n# G3 I$ `6 K1 J# k
    iret
9 |4 ~1 [+ P) v% K+ g* m% U. oint41handler2 ENDP
3 x* m( s# }1 f$ K- A$ }8 |2 E
: A& m$ ~7 j# j. J$ q8 _- w6 j( @! D; o5 e4 B
_________________________________________________________________________
* A& i: U, }# W; v5 W/ U1 [; I$ z9 t" F

1 ^: X! z6 ]1 T0 qMethod 065 T3 n& m& k  }+ G& S$ x+ o
=========4 s$ K* b! J$ F( L  k1 d& D. G
& Y7 R6 w' S! @* W. p% p
1 @" g$ n- p) \
2nd method similar to the preceding one but more difficult to detect:- L: P* G) F6 @: |
, }$ A% m" B, }
" z: G' c1 L' x3 B
int41handler PROC
# ]" q6 X: z  E" K+ ?5 _+ M7 J  {/ z    mov     cl,al/ g3 n* w- w6 t# ?
    iret! G+ u* f( Q) ^# h. {
int41handler ENDP3 q8 N/ w7 K* U$ a3 Z

5 G4 G; n1 K& w" h# z& u% h& M
( [+ A% P) m& p: O7 T    xor     ax,ax. @; Q! k& u& A/ m
    mov     es,ax4 X0 ?, l" L2 X& [% F
    mov     bx, cs) L! z7 f2 d- W# I
    lea     dx, int41handler) ^' {- z; ~) p! X
    xchg    dx, es:[41h*4]
1 o" w4 F) d2 T! m5 ~    xchg    bx, es:[41h*4+2]) M) O6 v. U$ H$ L
    in      al, 40h3 H  j/ L) h3 a( x/ [
    xor     cx,cx) K3 W* y7 C% B7 b' Q) v: s6 x
    int     41h0 ?, f' N+ Z! o5 Z
    xchg    dx, es:[41h*4]4 b5 Q8 H3 d" Z0 b" n7 W3 ]
    xchg    bx, es:[41h*4+2]$ l# K: a" J) Q* Z- k
    cmp     cl,al# L7 z* T1 n6 ^( L
    jnz     SoftICE_detected
" [3 f7 }7 e) ]
0 L. t) J5 I2 t3 S; ~& I% p_________________________________________________________________________
: l. k* M. m- x; r9 B  t. q* D+ \
2 ^1 n- }% c8 H4 U% @* S$ f6 X. ]Method 07! Q8 s& D$ @% R; ~; Q
=========
: ]* X, R5 _/ |( J+ K# ]1 x6 z& P2 g, z# N; i; b4 d( {
Method of detection of the WinICE handler in the int68h (V86)
' q2 r' ?* ]6 f+ k
% U# h/ F* ]7 ~& C  x8 j: Q+ M    mov     ah,43h
- Y. i) A' Y  I/ R+ E$ Z$ t! M, l7 ~4 Z    int     68h! S. K5 L* I8 ^( W
    cmp     ax,0F386h  [, `; z6 T+ E  C* u& T
    jz      SoftICE_Detected
  p' \  J* L% N% U3 G, z5 m( \3 }; O  a$ x
6 V& ?- s' @1 N2 R1 i. i
=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
- E* w( p) z1 R9 K+ q( s* j   app like this:
; j: H9 `- X8 j7 R  a
( T" v/ O# d1 O) S, @4 H, I! x+ r0 t   BPX exec_int if ax==68* s1 F0 _# B8 _4 c' f
   (function called is located at byte ptr [ebp+1Dh] and client eip is/ l2 i$ ~( P0 H8 m0 [
   located at [ebp+48h] for 32Bit apps)4 }; N. J; B/ |, s0 ^7 u
__________________________________________________________________________
; m3 o* Z3 P% m+ y! Q( }* R& [$ j) [% l' J# t" z: D

6 _% F+ k! L5 O0 H7 `& W1 iMethod 084 y+ c% X9 x) K$ t/ x
=========: _$ |  d8 W1 q+ w
1 s/ d( O4 s0 O" ~
It is not a method of detection of SoftICE but a possibility to crash the
8 D0 Y8 r5 p. }) i4 w0 Wsystem by intercepting int 01h and int 03h and redirecting them to another
$ F: T: K1 Y- B+ ~  zroutine.: Q/ q' P1 I; z: T
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
$ Y: m. {4 ~' L6 F& \' Tto the new routine to execute (hangs computer...)1 w- Z) R) b' k; O& R
' M' a# S& ?- K# G, Y/ N: F' b  Z4 W: P
    mov     ah, 25h
( R  r3 R3 {/ I  E1 A6 W    mov     al, Int_Number (01h or 03h)# T7 Q% P) d, `, L2 O1 y# e9 }/ i
    mov     dx, offset New_Int_Routine
; J3 j. v( \3 [8 F4 @, H    int     21h7 t6 f; M' G8 K

! D' p6 P; m) ^. s__________________________________________________________________________/ D  {& e1 z7 J  Y

; y. f9 t  m, y9 xMethod 09
: h& g! X3 F8 O" T=========( @2 [* c% B- }

" L- Y. l5 e% y# UThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
5 A! A* A# d1 B4 H5 rperformed in ring0 (VxD or a ring3 app using the VxdCall).3 ?% f, u+ M/ _% D7 C* s2 b
The Get_DDB service is used to determine whether or not a VxD is installed/ S9 |; I( E/ b- d9 I( z2 I& M
for the specified device and returns a Device Description Block (in ecx) for
9 V+ @1 @! X% C* O6 jthat device if it is installed.
5 V* o* V) V: I8 B* b# |% z0 L0 R, S) ?+ t2 C" o! A
   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID
; O; G# Q4 S9 H5 ]5 i   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
1 r( s5 A* j; z2 U# |# D& V   VMMCall Get_DDB# ?9 J$ U. d1 j- i4 z! m+ c
   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed; C7 L  Z1 k7 q
0 X0 ?' \( L) Y  A
Note as well that you can easily detect this method with SoftICE:
2 }( _/ T* |1 Z) @- i   bpx Get_DDB if ax==0202 || ax==7a5fh8 A. Y! v1 k  f1 Q6 W
6 C/ m3 |  k8 n3 L! K1 _6 \9 v8 ]: E
__________________________________________________________________________& \5 \2 Z3 f' Y# ~" W+ ]) {
! U% s2 w  q+ n* h4 ~
Method 10
" o3 i- ^5 q& ]3 l& M=========' c! Z9 g* @% m3 o5 ~, c
9 [/ z; |/ f9 K7 K2 t
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with; f! g( z% p7 S, c0 `2 C# K; X; G
  SoftICE while the option is enable!!
# ~  X& X6 Q; ]6 b* w7 f4 T& G
/ W0 u" q1 z* ?6 gThis trick is very efficient:
" H8 A6 H# Y  h  S! k0 z! Y1 iby checking the Debug Registers, you can detect if SoftICE is loaded1 n/ b  o8 y, z) c) P
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if4 w- c, `# U3 ^! I* B
there are some memory breakpoints set (dr0 to dr3) simply by reading their
2 u! R9 x: j6 a4 `value (in ring0 only). Values can be manipulated and or changed as well. D* g9 z9 q  S
(clearing BPMs for instance)5 r% Q; b- X3 `3 ?8 P

( I6 ^+ @* G1 p& v( M/ K# @__________________________________________________________________________
1 Q3 i6 t) X* {2 J4 u& H" n. s, o, x! O& N5 K6 `) A
Method 11
+ C) a/ a' [& V2 x1 C" V=========4 l2 h) p7 \1 ]* F( c$ _
. K+ i7 ?2 C# `! P
This method is most known as 'MeltICE' because it has been freely distributed% ^& S' C1 g1 h8 c
via www.winfiles.com. However it was first used by NuMega people to allow% t  c9 m6 `( G! s& B
Symbol Loader to check if SoftICE was active or not (the code is located! ^( N7 e# t( x) Q' k$ Z+ `
inside nmtrans.dll).( b0 \/ i2 g: [: Q

4 P7 B* _1 B3 h5 F* {, E) aThe way it works is very simple:
. q9 W) C; A1 P2 wIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for" R. O! w& h3 t1 E7 o) b$ [
WinNT) with the CreateFileA API.- S+ w8 F6 q4 W: ~/ A6 @/ N+ B

( E# _* ?* Y6 j) s) e" [Here is a sample (checking for 'SICE'):0 l' [. ]7 q1 [; v( K- L+ n) A$ C# @
; r- W7 W5 _6 O5 ~$ @7 g. b. _
BOOL IsSoftIce95Loaded()+ o" O8 m8 M* K, H: l7 e. h
{. E- t; _4 r4 g& k6 @
   HANDLE hFile;  % H0 C' b: s- w. @- h. J: G* D
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,( j: O; T/ w! y: n6 D5 E- C2 C+ x
                      FILE_SHARE_READ | FILE_SHARE_WRITE,2 N" y! H9 G. R, f9 ^
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);- \' X! k2 ]+ ^% }& J) }% `) x
   if( hFile != INVALID_HANDLE_VALUE )
! f- N! p+ K! K6 ~% `' p   {, x: Z' _* e; T
      CloseHandle(hFile);
5 i; g$ a, a6 S      return TRUE;8 e9 s- ]9 V2 _' y& R( Q$ Y! ~) J
   }6 A: l/ P8 H, m4 \
   return FALSE;
! ~7 T7 O% l  ?8 P+ D}: k: j- P- g8 p- T+ u1 N

7 V( g/ j8 P/ _6 E% |Although this trick calls the CreateFileA function, don't even expect to be2 C- W% L* @& {7 k; x5 ~
able to intercept it by installing a IFS hook: it will not work, no way!0 }4 E& K% `7 X6 K4 u$ n6 V2 Q
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
: |; O7 K9 W) l9 Q7 P% C! Nservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)# M. {  n% \6 T3 ~, O
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
* g* y9 A, G2 hfield.
, G) F+ P- a4 R$ j5 B6 S7 Y9 {In fact, its purpose is not to load/unload VxDs but only to send a 7 m) Z% Z0 i* q
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
+ s9 R* D: P6 t- d5 Pto the VxD Control_Dispatch proc (how the hell a shareware soft could try
2 ?# F& F9 k/ Z$ n" [/ Oto load/unload a non-dynamically loadable driver such as SoftICE ;-).
4 f" X( n) i" {" r, |If the VxD is loaded, it will always clear eax and the Carry flag to allow
+ d' u* V. M0 a8 l7 f6 oits handle to be opened and then, will be detected.
) Y# f' q$ ?# M0 Z$ p1 `, h1 K( jYou can check that simply by hooking Winice.exe control proc entry point+ X5 Q8 z) b% e8 I4 f- h# z3 j: b+ k
while running MeltICE.
% _+ M- T. ?4 I; N
4 m# L( y! U0 \5 f
  R( S- B* @* N! v( |  00401067:  push      00402025    ; \\.\SICE
) Y, f- {) B$ J/ `" h/ g5 K  0040106C:  call      CreateFileA7 G( Y3 P# Y7 V* ~  J$ `
  00401071:  cmp       eax,-001
; P' r( M" R" N# y' T( t' h  00401074:  je        00401091! j+ Q* [& Z  I+ w
" M* `; K7 _  P! W
" e& b0 ?- y) |( N' t  P
There could be hundreds of BPX you could use to detect this trick.
2 s; c4 Y, J: _' F" L8 S! Z1 S-The most classical one is:' R1 W4 T) J3 p. C/ C
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
3 y" H# O8 K+ S" p/ v1 z( Y    *(esp-&gt;4+4)=='NTIC') \& {# Z4 ~& h' o0 z8 T; s
- N3 \+ K' D1 N
-The most exotic ones (could be very slooooow :-(
$ W9 k0 l$ g: v* b0 }   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  . f0 F% w  j: M; A
     ;will break 3 times :-(
+ T& J$ G2 q" z$ A- D6 n
+ Y$ U" [# j9 P( g# c/ G9 A-or (a bit) faster: 1 T" M( n* v3 c* O) H- p
   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
" e4 l4 y& W# ?" C; h8 C7 ?: L% Q8 U* e; w; z8 o! f
   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  " b+ e1 V" e( j
     ;will break 3 times :-(" j0 y- k, \7 Y3 d7 [

! n6 h& v! i( t-Much faster:
/ b) Y  T; x6 {   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV', l" t* Z8 R" R2 c7 `* ^% |+ ?
4 i) G0 ]8 i# c! _. I& d
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
. S; u7 ]: r2 l9 xfunction to do the same job:
% |, Q( c* V; q+ l# Z- B& ^6 P" u! S
4 o+ @* L: T, b1 ]: A   push    00                        ; OF_READ
/ p1 y: \9 P$ b+ s. P   mov     eax,[00656634]            ; '\\.\SICE',0
3 e7 x5 b) i$ {5 m9 _# r   push    eax
% L0 \# y+ I4 K, }9 C/ D* }7 K$ o6 G   call    KERNEL32!_lopen; A3 r1 |! z7 ?! a# R
   inc     eax
% g$ _6 h2 ~) ?3 W% \   jnz     00650589                  ; detected
  [' w: y) a. p8 F   push    00                        ; OF_READ
8 q* p. L, i' P% O+ Z, E  [   mov     eax,[00656638]            ; '\\.\SICE'+ |; l* t$ d( V9 A$ f. B
   push    eax
/ ]1 T& B- N) T; w$ S  ]- h+ ~   call    KERNEL32!_lopen
5 m: }; f0 i  x( ]4 A9 Y/ D   inc     eax  a$ N4 Q8 L$ e7 a- S
   jz      006505ae                  ; not detected
' V! Z4 d1 m0 D2 a3 k) O
  X& e; M- \' @; o# d  q+ D$ c, t, @
__________________________________________________________________________0 k" f7 H4 f* J- C; P: o$ C

3 Q1 t7 G! y+ SMethod 122 H2 L) M2 `! a1 o) H$ l- |
=========1 v# _1 x8 o4 }8 d) O; t0 j
/ o, S8 J1 _9 i0 V9 V# y5 d* _6 U
This trick is similar to int41h/4fh Debugger installation check (code 05
2 _5 t; L6 i* w1 H, s: W&amp; 06) but very limited because it's only available for Win95/98 (not NT)  X- Q: z2 j9 j
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.5 u% R' q; h* l8 t, z  W: D

8 g, c1 D6 Z4 {6 W   push  0000004fh         ; function 4fh+ l! D3 c! z6 o' k0 }: s& ~
   push  002a002ah         ; high word specifies which VxD (VWIN32)2 T0 e8 F0 f8 T7 I7 _, I$ B
                           ; low word specifies which service( i; I8 m, _# P4 ^: V3 y: K+ T( c
                             (VWIN32_Int41Dispatch)0 K( J" u' e5 }" E: u
   call  Kernel32!ORD_001  ; VxdCall9 ^# J  x, |0 l7 W! t  B7 L, W3 V- p
   cmp   ax, 0f386h        ; magic number returned by system debuggers
& B4 a/ F  A# m' u( P3 P   jz    SoftICE_detected  u, `7 k" Y. w, r: U

$ c1 x# {2 V' x$ VHere again, several ways to detect it:$ I( g, a1 \# F. E9 y* {' }
+ l2 I  e7 @0 \2 ~! D4 j
    BPINT 41 if ax==4f7 G( y1 h6 c+ c0 v" _
7 j, M: M) b$ N& b& p" U/ i* E
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one
$ z1 N' T# j" X1 L" r) l* |
2 P* z8 k5 |6 e+ T; J    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
7 i& {. R/ s2 z5 @% L/ o2 b  E' v! {7 T. W+ S6 u
    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!
1 V9 `% _- e1 e, ~/ n
2 {* t" @$ Q4 N) y" }, W__________________________________________________________________________
7 i# R6 p) d5 ~/ f+ p
3 ~: a2 @; j/ xMethod 13+ k' x- q  e# V( i; K. Q
=========; ~0 M! a- f( w' V8 W) `

/ N6 J* K) s! _/ n& s8 Q: v# BNot a real method of detection, but a good way to know if SoftICE is8 D7 R7 `/ T0 J5 f! |
installed on a computer and to locate its installation directory.7 \  l4 y- O8 \6 s: w
It is used by few softs which access the following registry keys (usually #2) :- a5 y- p& I8 R' N, E2 x
& ~, x6 e2 w/ P3 u+ T& U8 E
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion4 ~6 v, h3 ^3 Z9 z
\Uninstall\SoftICE
; `& m3 s3 k) m3 s5 C-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
3 ~1 H# o- R- I. U' q; W1 k-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion- s2 [! W& S+ c( m& z
\App Paths\Loader32.Exe
; n9 \; E% `6 z, T: B; @" s2 G; s* X) b$ l* B* S! }- b. o5 Y7 m
+ e/ u, g( _. r8 X, u
Note that some nasty apps could then erase all files from SoftICE directory$ U/ }) @7 e& S
(I faced that once :-($ W+ @8 `4 H4 ^5 n6 k
4 B! N( g# _0 h8 u; X
Useful breakpoint to detect it:8 o5 W9 }# K9 T1 B
% T; E) L. n9 _8 x& ?
     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
5 H2 d% ]5 H. T2 W# W
5 k0 t5 s# o) }% ?, s' l__________________________________________________________________________# @  t; Y6 L  N' L
  u' n, C; U. ?. z5 c

& y8 t+ G  G# a9 w. M/ S, Q$ \Method 14 ) {0 ]' Z- u) }9 w
=========
6 I7 K& z; N6 z7 l
7 z! {7 O; K# y. `5 P1 `5 `A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
: I. s  D* x2 t' q+ zis to determines whether a debugger is running on your system (ring0 only).$ G: s( w/ |7 \: R6 Q% ]" |

% `& O. s3 `  E  e+ S4 K! D- q   VMMCall Test_Debug_Installed; M2 u  s0 U- _' K  _
   je      not_installed  h% q1 @. p( A' n" q2 ?& Z0 v
" ?7 V  e# r+ S! q, |
This service just checks a flag.
, U" ~( S7 s8 {- J( u; n</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-7-23 02:58

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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