About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
% }& [5 b" b6 N<TBODY>
/ d: l, l3 z# n# }: u<TR>
1 @  f) C' i! O' _, I1 V<TD><PRE>Method 01
( p  `) {% {+ b% s=========6 d) M7 e6 o; a$ b
- B% `) n, g$ o2 U- R5 X5 k2 y9 ^
This method of detection of SoftICE (as well as the following one) is% a9 U5 h0 O4 l& ~+ v& W6 ]# F  n
used by the majority of packers/encryptors found on Internet., L& w! d) k9 W
It seeks the signature of BoundsChecker in SoftICE
. R4 }! ]3 D& e1 ~4 \: i8 f
5 E- N. G' G. r) H2 i% `% F4 t. H# |    mov     ebp, 04243484Bh        ; 'BCHK'5 o' p( w. x$ f- z8 w
    mov     ax, 04h
$ i, E3 P2 Q- U6 w    int     3      
4 H% w, R: Q0 |( u' y6 W1 Y    cmp     al,4$ [8 Y3 I6 q& U+ ^+ }; ^& I
    jnz     SoftICE_Detected9 U6 z7 b, [- l  o' t# G" P! N

8 r) M- o; o8 P0 Y6 f3 h" j___________________________________________________________________________
5 r9 T! C6 M7 Q7 j, Q. K, q" e% m' q
Method 022 [5 {/ J& G7 P- i8 `) Y8 Q% Q; z" b
=========
9 y' s( J. U( q, i2 F3 A* H# b
4 v; V: `+ r$ g. ^2 LStill a method very much used (perhaps the most frequent one).  It is used
6 w( z+ @6 w/ ?- d) _to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
+ ?1 r& I1 J6 t" ?or execute SoftICE commands...5 e/ f; t( K: L/ z9 a
It is also used to crash SoftICE and to force it to execute any commands/ a: d+ y3 V( `% k: b, {' K! W
(HBOOT...) :-((  
5 S% L$ J4 N' p/ O: m' h% R/ n/ p/ d$ _
Here is a quick description:6 k8 l' O: G) K7 t/ q5 P
-AX = 0910h   (Display string in SIce windows)2 [/ h- m) }' o4 \& A2 y( ~
-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)
1 T( d: ]9 I4 B-AX = 0912h   (Get breakpoint infos)
8 d3 i6 r# S; L0 h-AX = 0913h   (Set Sice breakpoints)
/ R0 O) x9 D8 u6 |2 B5 h- x-AX = 0914h   (Remove SIce breakoints)
& m6 b' q; W( J; d6 P( C- `$ ^% B% Y0 A9 C2 n' |. s8 M
Each time you'll meet this trick, you'll see:
' Q0 X. p/ v. W3 [-SI = 4647h
* }% Q- `" p' O4 H$ I( U* a-DI = 4A4Dh  |. M: A( i/ u
Which are the 'magic values' used by SoftIce.
. E6 F  S3 Y/ T" X& V) m# \For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
' }4 W7 o% f3 ?0 T7 X, l- n' y/ [4 K! z1 [0 _
Here is one example from the file "Haspinst.exe" which is the dongle HASP
( I0 R' |3 F6 A# V4 i" @Envelope utility use to protect DOS applications:
  l" M8 a8 D% P  @7 C4 F! `8 d8 P, v4 w5 u$ r# A9 g

1 _7 Y+ x3 A, h4C19:0095   MOV    AX,0911  ; execute command.6 G0 S# p9 S1 P) u8 \; v* X/ P
4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
( \7 t6 l$ ^: A& y# A4C19:009A   MOV    SI,4647  ; 1st magic value.  {% P4 L4 Y6 T# W8 o- M: Z
4C19:009D   MOV    DI,4A4D  ; 2nd magic value.
- s1 d9 b9 Z( D( e4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)1 i( M% I* I: W2 g
4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute
; T! E& ]) z6 ?. d! a, w4C19:00A4   INC    CX  K; m/ B8 W7 F0 Z
4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute2 o% m: K- E* R1 I4 O6 L
4C19:00A8   JB     0095     ; 6 different commands.4 o" q$ z  [* ~1 B, o" y# D
4C19:00AA   JMP    0002     ; Bad_Guy jmp back., D! a  ?3 u2 D; U' P% V. D7 o! }
4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)& S- S, A% s# Q' G: E7 s

  R* s( |& V+ NThe program will execute 6 different SIce commands located at ds:dx, which, i& X$ \) y; D
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.  b3 j* H- l! }9 v" \) `2 \
! p) r; T6 j. t  F, K: e3 W
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
1 a2 N, {) Y, m0 F& x___________________________________________________________________________
) t  A6 s  D9 Z( y8 J8 x) d1 v( l  P5 W  r8 r6 p+ I' m% S
# b0 W2 t: V4 J6 Z3 @
Method 03
2 K2 z5 L( ~2 H( f=========. H; ?0 @# T7 w* a6 _4 M/ H
' A; q9 c. \* P2 f" u
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
  W; s  q. [- s9 j+ H1 @0 ?) B(API Get entry point)
, w3 P( k+ f4 s2 `        * K, L- j1 `& l8 r
1 n5 Y# o! h# {& ]9 M
    xor     di,di4 J, Z# R% `% H
    mov     es,di
5 m2 N! q& V" v- ]    mov     ax, 1684h       , x" c# U  X  @/ }2 y) ]
    mov     bx, 0202h       ; VxD ID of winice
0 o) r$ L! q% i: B5 C" M7 P' I    int     2Fh
, l* B% `6 k3 N, P2 q: h; `- |/ Z" @    mov     ax, es          ; ES:DI -&gt; VxD API entry point
- N, L; s3 E( m- y2 h, _    add     ax, di
+ A7 N; C6 ?% ^- Y    test    ax,ax2 X0 Q! x; J) x& |& B
    jnz     SoftICE_Detected
3 q9 a' y  b7 p' v  \' L+ E) K, Y9 k1 {% w  }" x
___________________________________________________________________________3 ]2 O2 |9 h1 N+ r9 Z+ w

" E1 F/ e$ c, d% o" }. X! q, @Method 04
- r4 G& G: Y& u$ M( A8 E! B=========
' ^# f; F7 ?" Y0 ~  V( ?2 j
- m; y2 R6 F5 A1 _7 h* t, _4 xMethod identical to the preceding one except that it seeks the ID of SoftICE
# @9 j2 P0 \; M* s# ^- c! h# zGFX VxD.% _! `1 b' C1 k. V

+ y$ J. g  Q% @6 d% r# m5 Y    xor     di,di
" F+ E( ]. q0 S& {; Q    mov     es,di* E7 A$ ^6 K3 \' E
    mov     ax, 1684h      
/ O+ K$ B2 t% `8 w1 k. u    mov     bx, 7a5Fh       ; VxD ID of SIWVID. d: p1 N. ~4 ?
    int     2fh
- B; U  }8 Q5 Y- K6 l3 p+ `    mov     ax, es          ; ES:DI -&gt; VxD API entry point9 W  l! H$ m  [& [, ^: N& {
    add     ax, di
6 \4 ~4 t8 N0 {( \0 `    test    ax,ax2 O! w7 p- l, F
    jnz     SoftICE_Detected
6 n" E' @2 x0 S$ s' i( \& h' K3 q* b$ ?" a: o; Z
__________________________________________________________________________
* i  J3 C1 H: D' c3 ^( O2 A# D8 s$ Y9 `0 N+ W) _6 _

. y2 u" y& ~1 ?" v5 P3 h# kMethod 05
7 @" f+ v" w! S3 ~6 B& m) ^=========2 j0 X3 B3 z0 ~0 s0 a8 d$ S! R6 B- z! x, j. R

( {$ M0 H  O: yMethod seeking the 'magic number' 0F386h returned (in ax) by all system& @$ w# Z, D+ J; s4 q
debugger. It calls the int 41h, function 4Fh.
2 c" C; a! n) hThere are several alternatives.  
. u) h- T. H" r6 @: O; p" Z
4 @7 ?( J& y. f: H7 ^The following one is the simplest:
8 j: i; v9 r5 Y# y! p2 p
- a0 s7 d* B- |# I) L    mov     ax,4fh
3 R1 {) f1 K4 h8 D    int     41h: M! n/ H) B5 ?3 d, b- [
    cmp     ax, 0F386
- `2 \  H$ ], p: z1 u    jz      SoftICE_detected
: d; m0 L3 A3 d9 O2 [8 @( U; J$ L, z' H& k' \$ g
/ e! S) b: l% n1 H5 Q5 {
Next method as well as the following one are 2 examples from Stone's % K2 l3 M% C7 ]
"stn-wid.zip" (www.cracking.net):
9 j% E+ h, X  A4 f! ]" Q) L: o- e3 t! h' f. d6 E' W6 U
    mov     bx, cs
5 g) I4 a+ k! O6 E    lea     dx, int41handler2
5 d7 x6 p8 s3 l& I- I    xchg    dx, es:[41h*4]6 F" t6 _( j( |3 j- M  S
    xchg    bx, es:[41h*4+2]9 P" e* Y# @8 X& }" o: o
    mov     ax,4fh: ?2 p( ?1 ?5 q" r& D9 H% R" n
    int     41h2 R+ z" A" s6 K3 ^  ?" f
    xchg    dx, es:[41h*4]: G: o9 A+ f2 w9 y5 J# ?4 i
    xchg    bx, es:[41h*4+2]
: |9 ^9 j1 @( r, G; k# ^7 W+ J    cmp     ax, 0f386h
8 S0 E# o$ L) H, B' S, Z    jz      SoftICE_detected
3 H# N* o2 ]7 V! j8 U
3 {% V" g" M5 T6 n8 T' H! tint41handler2 PROC$ {: j* s4 L, L' c! s) }
    iret! J4 t1 F  k9 v" n/ h
int41handler2 ENDP4 k1 r) Y7 U8 W$ v7 g/ V# f8 D  g

& Z* _" C4 w7 f( O$ o  a0 `8 i$ o# u0 |
_________________________________________________________________________
& J" y& U5 ]! r! E) H6 n
3 v' B& A0 `# b5 {3 A3 H2 I1 w+ q* S- C. |1 h! C& e1 h" z3 X& P; u
Method 062 z! w4 d; v4 ]6 m! S' d
=========
7 c  X: H) r( l: u2 e; K) S8 A* I- [2 ~0 a' v( {5 Q

0 P- o6 V" g  d# T- g: t9 o2nd method similar to the preceding one but more difficult to detect:2 i' Q' R$ [- n. O
$ ?( H# k4 G6 F5 w
9 }- a# m1 u7 T8 J) h  s! Z* Y
int41handler PROC& ?1 b7 P  S+ {7 g5 G
    mov     cl,al' b7 |2 ?0 \0 i, T* [
    iret
+ C, A8 s* a4 b9 M. C6 zint41handler ENDP, I( _# i3 s2 N; b5 w

7 m* E# P* J2 y+ l- {, m, t0 f: j5 D7 Y+ h6 o" b3 b( w  o% `
    xor     ax,ax; S7 H" y( ]" K# h
    mov     es,ax: F7 I! ~" P8 O# H" @+ b
    mov     bx, cs$ f* \+ v( e% a; Q# V! a, v  Y
    lea     dx, int41handler7 z6 x) |/ p% Y, D
    xchg    dx, es:[41h*4]' ~- l3 @# Q2 T! L% T5 ]" ]
    xchg    bx, es:[41h*4+2]
# \- c' n* I7 j8 T9 F9 u    in      al, 40h0 a. ]6 c( ^% b) r
    xor     cx,cx
' f' o: e2 Z$ Q9 y9 k% I    int     41h4 \% u9 ^; j7 S9 }8 G; h
    xchg    dx, es:[41h*4]! P; e& L6 m+ k. w* H$ i. k
    xchg    bx, es:[41h*4+2]
7 e2 _/ s- K1 S* v4 v4 K1 g    cmp     cl,al
8 _2 ~% s; l) N    jnz     SoftICE_detected
( ?& n" s2 ~5 C1 j& u. L6 Q0 e6 a& S& ~0 z( `# z, Y
_________________________________________________________________________2 J  ]0 F. x4 C" b: ?0 A
4 U9 C; m, f! j  j, @( S
Method 07. L" d5 L: G$ X$ a  b: F
=========" p. `6 U7 k5 O( H

6 v5 w+ y% V1 r+ F. MMethod of detection of the WinICE handler in the int68h (V86)! F6 `- |9 J( {

& E3 t% w' E- f    mov     ah,43h
3 I2 y9 F' X" f; m( G  l. r) W    int     68h
+ r* t& b8 O6 u9 Q" N3 L8 S    cmp     ax,0F386h
3 Y9 B; F; b6 y' X4 U& V# o2 f    jz      SoftICE_Detected
9 ]6 V6 n+ I( a) V1 M, @- M* `, y4 |! F3 a& B7 U% \
$ P) w) _/ b- z: I. a0 S
=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit( v- u1 O+ N+ U( n5 s: P. t
   app like this:
7 w6 y6 F/ G  }; K9 _* h4 S+ Q) ^2 z5 K% ^$ F  C8 f3 |+ A8 {
   BPX exec_int if ax==68- n, `* c; Q3 O: i; Z
   (function called is located at byte ptr [ebp+1Dh] and client eip is; G3 i1 i* U8 v6 Q& Y. J# [
   located at [ebp+48h] for 32Bit apps)9 R) f  g, E( u
__________________________________________________________________________) _) e! N. Q6 C- r0 k$ @
' D4 h# p1 V- `7 i) D8 r

, T; c% v+ Q+ K% o) HMethod 08! u( y- \9 Z0 p7 I
=========
5 d; |( K0 J2 F. X/ \. `
7 R9 d4 i% X3 q# b: x# Y5 l/ sIt is not a method of detection of SoftICE but a possibility to crash the) k2 ]; Q* t9 Z7 L
system by intercepting int 01h and int 03h and redirecting them to another) H- F; A/ }) x9 [1 a* M
routine.
, y, J0 c$ A2 Q: |% pIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points# P1 \( d5 l% j, O
to the new routine to execute (hangs computer...)% r" n* N4 ?0 @' A
8 V9 c: ~$ {' w+ }! m
    mov     ah, 25h' x( A; F2 y+ e1 t. {4 ^. j
    mov     al, Int_Number (01h or 03h)1 U) m" `5 M5 V; v0 c- M- P+ t
    mov     dx, offset New_Int_Routine
/ m  D; Q0 K  c. _    int     21h- i5 E$ c0 V& Y# b
& r& S4 ^0 f, s, S
__________________________________________________________________________
, J( c2 e9 x5 ~, B4 U: l) j3 a; y+ V8 e) Y; Q
Method 09- p8 _* E3 v7 {# f. [8 P. ~
=========5 `5 l: R$ U. j" x2 _! u9 h

8 E9 l. U1 `  r2 U& g& X7 AThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
% T+ F9 O; c1 C3 l0 [performed in ring0 (VxD or a ring3 app using the VxdCall).
' w, `' ~" k; B2 }/ j3 ^The Get_DDB service is used to determine whether or not a VxD is installed& a0 R* s) n4 s  G9 d
for the specified device and returns a Device Description Block (in ecx) for4 ?' \4 l( f& d' }* A, B5 t" W- B
that device if it is installed.+ Z) r& t. k# x
4 W$ `6 z# R. m, _
   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID: }+ N% S: S( {7 Y
   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)# h) i1 o" K  u4 r
   VMMCall Get_DDB
- U; M% O! g$ i- Z- h   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed: W! o' `; N2 Z) ?( D

3 m! d/ S7 H( o& h7 r/ t' h5 fNote as well that you can easily detect this method with SoftICE:
: Q4 _, O' {; `4 L7 {   bpx Get_DDB if ax==0202 || ax==7a5fh7 P! u/ M* d4 o. f8 Z) p

! p0 n5 D5 |9 |__________________________________________________________________________% |* t: W2 A( z& m# ?
5 K7 Q/ I6 v+ _3 U' m
Method 10
$ h5 G! K+ q, j; b) f=========) `7 o1 F  T2 v) S; w- T: r7 g8 j

- P" O1 p/ U. {0 A/ r=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with
: [9 l7 m" T+ G( b  B* b  SoftICE while the option is enable!!$ ]4 C- d, P5 o+ {, X! }& B
0 }2 [/ {5 N5 d
This trick is very efficient:
0 J9 X" E5 r  j# P6 e7 W% kby checking the Debug Registers, you can detect if SoftICE is loaded
0 N/ j/ f2 Y2 p5 N4 C+ d. t$ N3 C(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if) i- u4 @/ v+ Z+ W$ l
there are some memory breakpoints set (dr0 to dr3) simply by reading their) J4 Q! m4 X3 d3 I8 ]3 |3 P
value (in ring0 only). Values can be manipulated and or changed as well# X3 T, h9 B4 G9 Y
(clearing BPMs for instance)- p3 g0 T+ o* ^" ~, R: y$ {

: F; P0 Z, P0 V9 T__________________________________________________________________________
4 i1 m+ N+ _9 @5 Q' N+ n. _! I1 u; s6 N
Method 11( W- ~/ D, z2 i! i$ _2 r7 N9 z' V
=========
2 @0 n4 o  U) }: h- E$ A! h. F: f. Y& b! h
This method is most known as 'MeltICE' because it has been freely distributed
1 ~  \9 m# @& R0 l1 R# Cvia www.winfiles.com. However it was first used by NuMega people to allow
$ B3 o: A# A0 \' KSymbol Loader to check if SoftICE was active or not (the code is located
/ K5 V4 C$ R6 j1 y8 Cinside nmtrans.dll).
5 p% f5 G: J! ^. H" D
' q: g8 v2 k5 P- LThe way it works is very simple:
) ^' U+ D6 n8 E* a0 lIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for$ G0 Q. H2 d$ V, p( i
WinNT) with the CreateFileA API.
& Q* k0 ]2 B1 J! q& u5 [% h+ K1 l2 y/ A% u2 I
Here is a sample (checking for 'SICE'):! l, B; ]& C3 s" e/ j% x" j

) x. |" F8 Z, o8 v" BBOOL IsSoftIce95Loaded()- r( U( Z9 \/ G
{
: u& p, N! \0 K5 p7 w: ]- C   HANDLE hFile;  
. y& [7 T% E2 F' P7 \% S5 y   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
0 ]' H, d3 X, x. a+ T                      FILE_SHARE_READ | FILE_SHARE_WRITE,
4 X8 g7 h. Y% d( R* K0 }' N4 ?, e                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
: r) u/ }& h, D+ A, W" F( l   if( hFile != INVALID_HANDLE_VALUE )3 n: \: y$ ^1 ^5 u( c8 F9 Q
   {
$ k+ N( m0 V0 ?$ U  a( s      CloseHandle(hFile);
3 T7 r1 ~* P6 v5 ^" i      return TRUE;* `0 s' ?2 ^! x: O! `& f" o5 X
   }
" j8 ?& S5 u: Y( Z! ]) p' m   return FALSE;
, Z* W& J  V& Y, m* U* D" F2 F2 j# v}
' c( X0 @& N; p, a' Q% U" M  q4 w* I, O" d; ^; G2 l! ]
Although this trick calls the CreateFileA function, don't even expect to be: [# {: ?1 [) O5 s4 A" `. w
able to intercept it by installing a IFS hook: it will not work, no way!( s# C3 I  x/ G5 m* b  u
In fact, after the call to CreateFileA it will get through VWIN32 0x001F! `. x0 O+ G% S
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)) A& B4 P' Q6 @6 w( J
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
) U' _# D( G$ X5 }  U2 Qfield.
- f! N) r0 I2 }$ \. m' DIn fact, its purpose is not to load/unload VxDs but only to send a ' W6 E8 I' x+ [' f2 r8 h! p
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
) S0 `1 B: h: S$ e# z, Xto the VxD Control_Dispatch proc (how the hell a shareware soft could try. |! P! O4 A9 v) P$ d! e2 W& ^
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
. J. H3 B  f1 V4 G$ }$ KIf the VxD is loaded, it will always clear eax and the Carry flag to allow& T9 o( [' j# b( R- U
its handle to be opened and then, will be detected.
* j$ F) p, N. f% BYou can check that simply by hooking Winice.exe control proc entry point* T/ D2 E! K* k: D8 b. u
while running MeltICE.
# e# p' @- n+ x
0 A% D1 X4 k: L, d) f6 W) h  t6 E5 k0 _- h7 Z
  00401067:  push      00402025    ; \\.\SICE1 s- O* t% ^$ Z4 F2 L" Q
  0040106C:  call      CreateFileA  b6 K1 D3 [8 W( D
  00401071:  cmp       eax,-001
# Q" ?6 ?- s* `  00401074:  je        004010911 }# T/ r% ]5 }& l5 Y5 x/ u
& Z. I7 a. P0 Y

3 J+ e  G+ _  |, {! M# \There could be hundreds of BPX you could use to detect this trick.
/ A2 Z9 M) t* P3 S-The most classical one is:
4 d( Y! j1 b. s  e+ \/ D  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||# b# R- n# k2 |; H
    *(esp-&gt;4+4)=='NTIC': \5 l) S; B, T" d# p% ~

! s& N3 E. l3 V! P9 L0 }-The most exotic ones (could be very slooooow :-(! Q4 p" s$ N. U" d- b
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  
8 V- r7 b/ A' x. {3 {: W1 ^     ;will break 3 times :-(. p7 U. @5 A, e  ]) W, \
5 B& k4 D# b7 e7 R5 ]1 B
-or (a bit) faster:
  d) C, X& B: u' d6 ~   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
2 {  P. w! @4 G5 v) R% b( |- ~' L6 W$ ]& }" F
   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  
; P0 J( C3 A4 s6 ^/ T/ P6 ~     ;will break 3 times :-(
: w3 _- P$ j/ X- g' ?: M' \* u/ N8 P
-Much faster:* Z/ m3 {$ K9 G% h7 i3 {
   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'6 A4 K9 `5 \% r' I

( T( O% x) x' X8 X7 X9 @6 }# d: TNote also that some programs (like AZPR3.00) use de old 16-bit _lopen+ ]' j( c% v' N. v- L1 I
function to do the same job:, _1 `7 @% |9 J' P1 S1 h  ?

8 C5 H' T6 U! r8 }$ V- |   push    00                        ; OF_READ+ Q) B* K, [0 Q$ L7 r
   mov     eax,[00656634]            ; '\\.\SICE',0* }% V+ }/ K! F8 _
   push    eax
0 m( w* V) T- Z! D6 h1 e) H6 _   call    KERNEL32!_lopen! l2 f; N: ?! c, I: S' w& p
   inc     eax
4 ^& H' o/ W# w3 j   jnz     00650589                  ; detected
( w  @# h9 d' S# q2 {9 H   push    00                        ; OF_READ! I3 W% q8 G+ P0 {" U
   mov     eax,[00656638]            ; '\\.\SICE', B5 b: L! I5 P: V: F6 Q% H. \
   push    eax
% K  G4 a% X6 j   call    KERNEL32!_lopen( I/ a' ?& w2 C! Q) M! j
   inc     eax
4 n  c7 S" k" ]. T$ b( I2 H   jz      006505ae                  ; not detected* A$ X8 y/ [; i' R3 Z

8 |* v0 r  t+ |' E. \; ]9 f8 s
; y$ V; r. O$ L; u0 U__________________________________________________________________________
9 A8 K. Y. ~0 U6 T( y5 W5 u2 @' d0 A6 ~4 B, ^' Y1 V
Method 12$ B! T3 @  G5 J% ]+ t3 ?
=========
$ V" Z2 y, @+ z4 M
* V: z8 U3 n8 D, z3 s* ^6 l% |This trick is similar to int41h/4fh Debugger installation check (code 05
5 `2 a9 {7 g* a/ T: i&amp; 06) but very limited because it's only available for Win95/98 (not NT)4 B* |4 d: ^6 E+ |# A
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.' ~) M% N0 L+ }

# ~9 z% j0 X/ j- `9 ]% A   push  0000004fh         ; function 4fh
! \2 G: C9 k: E3 q" O   push  002a002ah         ; high word specifies which VxD (VWIN32)$ ]6 |; f0 W2 l, S3 j) `9 H0 B4 ~
                           ; low word specifies which service
) E' O; M- Q+ e* q7 @1 r3 d4 i                             (VWIN32_Int41Dispatch)
' j% Y2 G5 d/ Z) U! z+ m" Z$ B   call  Kernel32!ORD_001  ; VxdCall
: W- C- m: l2 ]   cmp   ax, 0f386h        ; magic number returned by system debuggers9 G" O3 E+ Y2 C- t
   jz    SoftICE_detected% Q) L& l! L5 G' }! v5 N1 o
5 T$ l2 [  T4 Q" `
Here again, several ways to detect it:: }' R  G- M- T) ^9 W/ }/ h2 C4 @! G
( }3 T  j* l# H
    BPINT 41 if ax==4f2 ]2 c5 v! O1 V$ I7 J, `- `8 |
8 L) L$ O7 t& Q, a. C1 U  w
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one: `% H" m' e! ]0 A9 l

6 }3 R( o7 P2 _1 {$ ?) t3 J    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A+ w" C$ F' P, [1 f  P

: E5 W1 S7 Q5 e' _8 y    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!: a' x9 m4 y( k* \1 A

$ H0 @1 S( m& {8 }+ ~__________________________________________________________________________- m2 y' B6 q/ U2 x
( ^& C& H# [7 C: t
Method 13: j8 ^7 ?& Q" I7 @2 q( F
=========1 V+ A+ Q) ], Y4 _( J5 Z

9 |! y  [$ g; K# G. ]Not a real method of detection, but a good way to know if SoftICE is
' {5 z; `  C- [. qinstalled on a computer and to locate its installation directory.
* n7 r% `1 N" C3 n& p' \3 d) aIt is used by few softs which access the following registry keys (usually #2) :
8 p' m0 w# l! ?
$ A( K1 x  B2 D- S8 J6 R) b-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion) N& q5 Z) m: f1 m
\Uninstall\SoftICE. Q7 `2 `+ B2 o2 A# E( c9 P
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
: v5 ~7 _. ~1 R. d  |-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
6 r9 |6 O# A3 L  c+ D* w9 ?\App Paths\Loader32.Exe$ b8 }5 `, D5 j0 u; P
$ q! p3 {" k' B

  |7 g6 Y9 b. VNote that some nasty apps could then erase all files from SoftICE directory
% Y' A0 R; ], Q) u; Q  C. _( P(I faced that once :-(8 w& O% h' r0 Q0 b4 ~
. S3 b# r! T; o! S( I+ l) g( m
Useful breakpoint to detect it:8 }2 h: n' U" }! [6 Q6 J/ |

) o5 N8 G+ R# M5 w     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'6 I4 }; J  e) o( g. T, `- ~, K

4 K' V3 j8 B: B6 G# y7 S__________________________________________________________________________
& W# W0 O, {& b! \1 S4 [" n/ ]. ~1 ]' ~, a! p2 }- R. H
" ^7 F0 ~1 o" t1 w. Z
Method 14
5 f% M) ^  v$ ]8 w) F=========
6 r9 U3 L! B$ |; k
) N. c" O5 ?7 n! n# e( U# U( O3 cA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose' H, r- S  {+ Q) s( C" r- r
is to determines whether a debugger is running on your system (ring0 only).2 r  [" W* r$ F2 X/ y+ F
  s1 I7 ^( D5 ~) `" J+ ^
   VMMCall Test_Debug_Installed# k- u1 q" |; @$ F3 _1 v1 I, N
   je      not_installed5 c1 n3 i+ j$ p* z% s5 t
! H' V7 u( i$ g( k! |; P9 R5 ~9 O) y" C1 \
This service just checks a flag.
0 U1 X! z, w. A9 }3 m</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关注公众号

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

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

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