About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500># E" O1 R& f% N5 {9 [) O5 l, g
<TBODY>
6 {: u; J+ E! D& [<TR>* }* F$ f7 o9 g1 X3 G8 t3 l
<TD><PRE>Method 01 $ Z8 J4 o" c# s' V$ C; ~$ u6 O* M. j% G
=========
- {/ l* Z  u2 V/ @) T) @& M% P0 y  v0 v- J& Y4 N7 r$ G( G3 b
This method of detection of SoftICE (as well as the following one) is
. r$ |# S8 k, o: cused by the majority of packers/encryptors found on Internet.6 R2 O% t( `& Q4 T
It seeks the signature of BoundsChecker in SoftICE: m# p5 {! ?1 C- x& n

0 N5 D( l6 [( \/ W$ O8 p    mov     ebp, 04243484Bh        ; 'BCHK'1 F* P6 ~/ X, \& _
    mov     ax, 04h
0 g# v' m4 s9 Q6 x3 C8 ]0 L    int     3       5 U/ V3 T4 F# n! D+ e7 g, h6 V& j
    cmp     al,4& t! i/ q! A5 w/ H$ f! g
    jnz     SoftICE_Detected, H, a8 Z; }* j; }4 @

/ t* \: j/ z, ], j( o___________________________________________________________________________! s$ m7 M' {3 K5 E% J

( ]! a8 e, @, c0 gMethod 02: q% L6 d0 z* r
=========) a+ z7 Z1 ^$ o3 t4 X) `7 B

3 v. @( _+ ?! f. rStill a method very much used (perhaps the most frequent one).  It is used  {% n: q' m* |# B( |" L$ ~- q( d( a
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,7 a" f+ j4 C1 E: k- c
or execute SoftICE commands...
/ P3 W* a8 Q% I4 |# A- O8 C! |* N6 bIt is also used to crash SoftICE and to force it to execute any commands0 W0 j4 c4 b+ K
(HBOOT...) :-((  
+ i7 E$ _5 y! x( [0 ^7 f' J9 m  p+ o+ o+ E! E7 Z6 S& E5 G8 ?- b; G  ]
Here is a quick description:
# D& G8 K0 Q$ z  z- a+ Z) t-AX = 0910h   (Display string in SIce windows)
4 R, D, q- ^. H8 p0 v4 v1 R/ T-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)
" \% b+ ?: `% Y9 A: ^% g. p/ K-AX = 0912h   (Get breakpoint infos): d* S; }; Y1 P# s% k% g
-AX = 0913h   (Set Sice breakpoints)
" V1 k: O: m1 H3 O9 Q-AX = 0914h   (Remove SIce breakoints)
7 v/ X( L! {$ D0 A  @7 X- E2 I* G0 J; e% C) B3 j! m, i1 t
Each time you'll meet this trick, you'll see:- C8 }! R  ^5 B% A5 D
-SI = 4647h
) ]4 D- P" L( g9 M5 o& ?$ O  C7 k-DI = 4A4Dh- b7 ~% n' k3 ?5 ^$ d( x; S, l
Which are the 'magic values' used by SoftIce.! F5 C& {( ]* o7 Y! o) @3 K
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.+ \7 R% s; Q: Q. _  c# Q# h5 p
" O8 X3 i. _* H' y
Here is one example from the file "Haspinst.exe" which is the dongle HASP* Q1 V  C. B. D; x" I) j- l
Envelope utility use to protect DOS applications:% k& j6 @3 D0 q0 p: J9 N4 M$ C
" r$ |6 k9 @  ?1 N1 O* [

4 ^2 u0 Z+ |2 Z# i& W8 j2 m4C19:0095   MOV    AX,0911  ; execute command.
+ h- D9 z  Y$ ?: j# n4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).. C9 D/ M: M: v2 z8 Z, X* Q* w8 p2 d
4C19:009A   MOV    SI,4647  ; 1st magic value.
: D5 b& B, c9 m9 I1 X4C19:009D   MOV    DI,4A4D  ; 2nd magic value.% L  C& F! x" v2 o6 X# Q, q
4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*), V& u3 i, s; [: V" s
4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute7 i% V3 t8 {' m+ z$ u
4C19:00A4   INC    CX
( `: g* e7 ]  x! F4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute$ g" E& n$ L5 H$ A6 T: d$ k  u
4C19:00A8   JB     0095     ; 6 different commands." \8 o7 e' `5 b$ b
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.0 B; h2 R# I8 a# L9 Q/ r
4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)7 F* H% h" J# m) D) B. C
$ `9 M- q7 ^- F* s" t- l
The program will execute 6 different SIce commands located at ds:dx, which# p" S9 ~7 G9 y. J2 ]5 B- Z. O/ u- f
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.% u; [' [. j; S! i

2 s0 ?: p; W6 w0 d2 T* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
! p: E( c5 i: u___________________________________________________________________________' o1 P: f, ?+ H

' G5 B% h5 Z9 n' Y+ }# ^6 s3 W" q1 g3 U7 J* a+ o4 z
Method 03  L7 ]" a5 T) h7 L
=========
; \+ H4 i) b5 Q6 l9 d% Q1 ]1 ^
8 X5 u6 p* B! kLess used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h6 Y( j* p. y; `* l; G: |
(API Get entry point)
7 C4 i7 o: ]1 G3 {        
0 h( z. `8 }0 _
5 U4 y- v* ~  Z- U; c# x    xor     di,di
$ }! e) w2 F6 r& y7 t    mov     es,di8 U' }& }) N) P
    mov     ax, 1684h      
) D" ]- X. _* K4 x& O* g    mov     bx, 0202h       ; VxD ID of winice, ]! ?# D5 v% l& L7 Z
    int     2Fh  Q7 ^% v. I+ `, y
    mov     ax, es          ; ES:DI -&gt; VxD API entry point' ?& @  ]9 Y$ n: y8 F
    add     ax, di5 ^1 a. r3 u! K! D4 h2 V
    test    ax,ax
& A$ d! S3 U1 H1 `3 m    jnz     SoftICE_Detected/ p; A' Z# W2 ?8 Y1 B9 T0 [* u% O

/ c/ O) v5 Z5 R___________________________________________________________________________  s$ k) p. _) k& l4 _; p% A
" K+ G3 w( u5 p& I" i/ I/ X
Method 046 z) t1 c; D. ?+ W$ \
=========
+ \, o- h/ V7 Y2 \" e0 k! _$ Y2 O6 p0 }9 x! @
Method identical to the preceding one except that it seeks the ID of SoftICE
* `/ }& N: P0 ?! \1 N( xGFX VxD.2 ^9 T9 G  u& h1 A
% C! W  \% P6 M# e3 m5 o
    xor     di,di# Z/ h) `  a- L$ P
    mov     es,di- a/ d% f& q$ e/ t
    mov     ax, 1684h      
1 n5 [3 r! A( Z8 o! Q    mov     bx, 7a5Fh       ; VxD ID of SIWVID
& m: s; h8 ]2 F5 F( {  a, u    int     2fh
) f# k+ C8 ?4 o1 c% `5 O8 }* H8 G    mov     ax, es          ; ES:DI -&gt; VxD API entry point
8 X% B: \3 S7 U; u7 M    add     ax, di
' s$ o0 ]. t6 c    test    ax,ax
# @% \8 u. Z) p5 A- E  O  @    jnz     SoftICE_Detected
0 n* q( w2 z+ s# W/ B9 D$ ?& Z6 l7 E9 A3 z" V
__________________________________________________________________________
& }" }% m1 O) x2 b7 E
5 y. Y! C* i9 J+ ^( u  U$ \2 u& d+ x+ p2 W" L" q
Method 053 i$ k& Z* d3 Z& G& H' l
=========* v# z' H; h+ p

/ M9 w! C" b1 VMethod seeking the 'magic number' 0F386h returned (in ax) by all system
3 p6 H9 E8 K& _/ K, Y" D4 k4 Vdebugger. It calls the int 41h, function 4Fh.% S9 c/ ^# ?- C) l' ]* A- A% o8 e
There are several alternatives.  ) r1 K  ^" h0 O4 Y: J  \  |
9 a9 p6 X, x  R# W% D
The following one is the simplest:
; z7 j' e4 o# c$ h1 l% }/ M# D& O
# F: q$ f9 m- C4 H! k% ?' s* i    mov     ax,4fh
3 ?5 |5 T2 _+ d8 _8 {- {) y    int     41h
/ T# L# ?3 o# I9 }- [* [% l9 j' R    cmp     ax, 0F386- n+ {# ?6 N' \' y9 B
    jz      SoftICE_detected+ \: u# k4 y4 F( w4 P
, ]  }' `, e- E7 Z# Q2 }3 w6 y

8 L( C  D8 Z3 {6 A1 m5 ANext method as well as the following one are 2 examples from Stone's
) L7 I8 S# D% h; l+ E; E2 {% g/ s"stn-wid.zip" (www.cracking.net):$ T: ]( N3 t* l
- u4 `. J% M  ^* v4 d+ J7 Q- a4 j- W4 ^
    mov     bx, cs
2 X- e( n; n4 t    lea     dx, int41handler2
1 M3 i$ }' e* u" ]    xchg    dx, es:[41h*4]# W) i: ?, q- e' N5 P) B1 A
    xchg    bx, es:[41h*4+2]* a' q6 {' S5 a% t1 ^: o- b
    mov     ax,4fh
& ?7 r/ W6 I4 \& `% \# d/ B1 `    int     41h3 p9 F/ [* N) i5 H7 o2 V
    xchg    dx, es:[41h*4]! ?" g( S( g( O/ {# P+ b" t
    xchg    bx, es:[41h*4+2]) W0 Y7 A' ~1 Y
    cmp     ax, 0f386h5 I6 d) X! T! t( f- x5 Z3 v" R
    jz      SoftICE_detected9 g. [1 F# m4 d, ^4 S" C
+ Y6 U: D  e0 }2 w1 i
int41handler2 PROC
; K9 z! w# ^9 a  f7 f    iret
) L/ I+ ]# q# \; i% r& n/ ?int41handler2 ENDP
* N5 d+ S0 m* K6 O- I9 b+ c: G( E
$ I  U; ]+ z) }4 i& T, s
& U7 U6 `% o5 f. b9 i_________________________________________________________________________5 d: U4 J7 E/ |
( O& h8 y4 C' C) l+ y( N0 @# F
4 U3 q' Q0 [' {
Method 06
3 n$ |' F- p9 R  J=========8 b( s1 w5 x" ?, ^) A" N9 d

% i# x' [# r) [1 u
. M) q9 u  O$ I% a2nd method similar to the preceding one but more difficult to detect:; G  @- S. f  B1 i0 [

1 f. `3 ]' Z+ ^3 X8 k4 V
! d5 G2 E8 {7 E' w. R8 gint41handler PROC" K) M; v+ H  C$ \* J; b
    mov     cl,al
( q0 z# J; J; R2 m3 E. `    iret
0 X  X* ~  s- w1 W6 Yint41handler ENDP
' P, d7 r  J6 S1 @  R
! L9 d* k: T4 v4 d) p7 S8 F! r& c) [
    xor     ax,ax" ~% v7 {' W5 X' a" j) \1 l
    mov     es,ax
' V3 U3 l1 ~+ M  R  b8 ~    mov     bx, cs. H- h2 p$ Z; p& b
    lea     dx, int41handler
2 ]! j0 x. [- l! _; X" F    xchg    dx, es:[41h*4]
' e2 P6 g% f. p( K% @    xchg    bx, es:[41h*4+2]
6 K' }' C/ ?+ c2 r    in      al, 40h0 t& M1 T6 e1 A7 m; j; ~
    xor     cx,cx
( K0 g  r. o! C2 {    int     41h& o7 F6 T/ {/ I4 H8 i# T" ^
    xchg    dx, es:[41h*4]
5 M! q1 [3 }/ T9 d9 o1 e" Q1 V' u    xchg    bx, es:[41h*4+2]
! [- J' D" Y: Z( T6 N# h    cmp     cl,al
0 [% B- v( M- c1 \    jnz     SoftICE_detected
; i" M" ~2 u3 ^5 @$ C) Q" ?+ d6 h3 W  G  D
_________________________________________________________________________, f4 Z4 B) x8 q* w9 u1 l6 F

3 i$ w# C2 }# P) p( l2 g0 eMethod 07
% e7 h% ^+ J/ [=========; \3 i0 Q) O: v1 f/ V' z; Q
" _8 c( i, f, d( _0 v, h
Method of detection of the WinICE handler in the int68h (V86)% G0 [) i- Y/ `  |

& S' B3 I2 [9 m! f( L    mov     ah,43h
# z, p# A5 `6 f1 |: l$ ]    int     68h
  W6 K; ~6 M/ ^* M1 _! _! f    cmp     ax,0F386h
) x+ d+ u6 B1 q# [* l4 Y, W    jz      SoftICE_Detected5 v# i! c( ]# z+ E$ O

. i4 h+ M# m6 h
# N% r: T6 p+ _& b) y=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit8 S7 ~: |9 L6 s; m. u1 Q9 n
   app like this:9 H" k4 @2 h9 ~

" t! K2 Z% L( s$ ~   BPX exec_int if ax==68# V0 M2 h9 M. f& \# D
   (function called is located at byte ptr [ebp+1Dh] and client eip is! C: s' A3 |+ o( i, k
   located at [ebp+48h] for 32Bit apps)) `7 s" K% u4 q9 A( }
__________________________________________________________________________' `' g. j4 @( \5 g3 ]; m

3 K: M5 k. s4 N. T( A+ q; f, l8 t8 i% ^4 X5 Z/ V1 n) T
Method 08
& {# M/ k; N' A# b=========3 P5 z3 X1 a, d4 M8 h
3 u* q$ A! z. u# c% P( \5 ]# i
It is not a method of detection of SoftICE but a possibility to crash the3 x' y& W0 ?( y) b
system by intercepting int 01h and int 03h and redirecting them to another
, X. P; N& D: U' ^2 \. Nroutine.5 v* I. T$ h, s' P3 Y
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
  s9 y7 ]0 t, ato the new routine to execute (hangs computer...): E9 y; G( H$ R- k% `3 \  Y

. V8 R1 M1 P  X. g8 A    mov     ah, 25h
! ^# R& q$ `& r5 T& K! j    mov     al, Int_Number (01h or 03h)$ G" H: z$ N: L' M0 y
    mov     dx, offset New_Int_Routine
$ s5 R' W( u( @1 h( P    int     21h0 }6 a0 _9 ]: p4 w* a
- j6 j( H! `" H* O
__________________________________________________________________________
' w, o/ P+ {- W0 H" M$ Y+ ]/ y# D  ~# I' A8 F5 C4 y: a
Method 09
& y) V- |/ X5 j& N& N=========
' j! \) o; b3 Y& k
  T2 B2 o2 {/ @+ N0 P; dThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
. X; J! H) {$ {% H' N% V0 Jperformed in ring0 (VxD or a ring3 app using the VxdCall).
* ]2 N  \8 i7 n. T) uThe Get_DDB service is used to determine whether or not a VxD is installed
( J9 D, e# n: O. \$ q2 @4 hfor the specified device and returns a Device Description Block (in ecx) for! `' {; C/ J* G0 F0 }2 N/ Z$ `
that device if it is installed.0 h. Z& B  y* U. Z! h

# g1 i6 K& G/ Z" V( b4 v# k   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID
; c2 |( N0 N6 y/ x- S   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
  t5 s3 V! b0 q1 M+ z   VMMCall Get_DDB6 H+ a, Y* @) @( E: }- K
   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed# N" \4 y5 I- Q' }/ w
1 ^4 N4 F/ N/ V$ p* l
Note as well that you can easily detect this method with SoftICE:! r' S0 K& @! f/ r# f- G
   bpx Get_DDB if ax==0202 || ax==7a5fh
2 K! Q. S4 h$ B0 u' m4 \$ P
) K# M) L0 x/ d* Z: v" z0 H__________________________________________________________________________
. m# Y2 O1 z4 e" |: c  L& |" r) X6 Y4 ?& H, T
Method 10
' ~2 P/ @+ G6 m: N3 ~=========
8 J, k% `4 u* u1 O, u3 C2 J" a. x& y& j$ z
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with9 I. A/ p1 e2 {7 j- V* i  o
  SoftICE while the option is enable!!! E% _( e! c9 F$ Z: c* m  b2 K6 ~

  H5 R5 P' ^* H/ `This trick is very efficient:
5 A, K6 w5 y; E4 A$ V9 D1 Q6 wby checking the Debug Registers, you can detect if SoftICE is loaded
! ^/ Z. |; L& j* M(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
: \9 I( h* i) \  j+ y2 Qthere are some memory breakpoints set (dr0 to dr3) simply by reading their
% S. i: T; [6 O) s+ C4 Rvalue (in ring0 only). Values can be manipulated and or changed as well* W3 _+ ~+ @2 K" d5 o9 @1 w
(clearing BPMs for instance)' D: [3 [0 k5 o3 H* b* W, m

( A. N) g+ C8 K+ I! V2 c7 i__________________________________________________________________________! Q- p5 ^: t" v& Q: a9 `

$ |0 c  A, D1 K. [5 x2 `Method 11! M6 u3 G! H0 f* e: d3 I  T/ E: K
=========
* s& D1 v) E" Y
/ z" x' H3 I- bThis method is most known as 'MeltICE' because it has been freely distributed+ `$ o+ ~; H- q
via www.winfiles.com. However it was first used by NuMega people to allow
0 V6 F# l2 y: |6 hSymbol Loader to check if SoftICE was active or not (the code is located
4 l/ D9 v3 \8 minside nmtrans.dll).
, A( B5 n( j5 [) _6 l4 X; M) `  i/ {  V* n5 ~. @5 E% [% ?
The way it works is very simple:
: _' l8 v1 R/ l) |. P$ u6 EIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for, c- D0 h4 T( _2 a
WinNT) with the CreateFileA API.
5 J2 P! U7 t* B
5 D5 w) J. W* a8 x% p+ `Here is a sample (checking for 'SICE'):
, Q, I# O* ^4 H! j+ S$ b4 T- k& F% Z+ I0 T* c& E
BOOL IsSoftIce95Loaded()9 i7 U0 L- b: w% B$ @. I& k
{
# @- _' E8 `6 R& P4 [# `& {3 A" F& z   HANDLE hFile;  ! X! ]8 T7 e6 N. S" f7 t
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
  T% w" p, f! X" }                      FILE_SHARE_READ | FILE_SHARE_WRITE,
7 g: D  L- \" ^6 Y, w  Y/ |                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
8 @( ?; d! w& X% o( V# O   if( hFile != INVALID_HANDLE_VALUE )
; \6 B% @% {- r$ a   {- U8 H6 a) x- M" ]/ @
      CloseHandle(hFile);( l; P. t% [# E8 L( P8 l
      return TRUE;
$ `3 z& k9 z/ s1 G( H& w# v   }( \5 t, w- n- e- @' i; @" L* e
   return FALSE;: n& l( }6 d2 O! ^, s1 T
}
! O6 M2 |% Z+ y: o& r7 y
5 p9 {  N+ E- `( r4 W# r8 O( H* iAlthough this trick calls the CreateFileA function, don't even expect to be8 t9 N7 C3 m4 g5 J8 @( X) x, @2 S
able to intercept it by installing a IFS hook: it will not work, no way!
/ }: W% W9 @, m/ BIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
! j' D8 z' \* o) Qservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
) f: Q3 W9 B  a* y/ _and then browse the DDB list until it find the VxD and its DDB_Control_Proc
; a' o& W6 B) |! C( u3 J2 z! yfield./ H* j$ Q; A' C6 E7 K! h
In fact, its purpose is not to load/unload VxDs but only to send a
# u% t, `3 \2 P$ x, L  o" U% u& kW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)$ y3 a5 Z7 Z, t% G- H1 C( H% Q
to the VxD Control_Dispatch proc (how the hell a shareware soft could try' C5 {& c4 ]- W
to load/unload a non-dynamically loadable driver such as SoftICE ;-).1 s; a) G% }, @
If the VxD is loaded, it will always clear eax and the Carry flag to allow7 g/ w! y4 R& ]# t
its handle to be opened and then, will be detected.5 q8 K! J; V. O( {9 u0 C9 F
You can check that simply by hooking Winice.exe control proc entry point
+ E2 d% q1 y/ d9 Q' j- cwhile running MeltICE.
  P  [. w9 I; O/ T0 h! p; H) U/ c8 `" h% A$ L* r2 K
8 v; j6 G; c" [" l
  00401067:  push      00402025    ; \\.\SICE, x9 ~: y, K- H- u0 J/ G/ z9 X
  0040106C:  call      CreateFileA; G  i( y' [  P/ b7 \7 l
  00401071:  cmp       eax,-001' ~+ {: B5 |  d* Z4 A( O3 r: h
  00401074:  je        00401091
& l* t4 y* f. V" e/ O) P; ~; a& k

3 {' z# {1 f+ J2 I) R" GThere could be hundreds of BPX you could use to detect this trick.
$ X# G7 q/ |, t-The most classical one is:
) Q6 W+ X4 y# M  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
$ L, A0 j- p; O/ v" D    *(esp-&gt;4+4)=='NTIC'+ ^7 f/ S2 f  x# @" c  A  j7 E1 C
9 @" V3 ?& E$ @8 p6 }0 d7 A
-The most exotic ones (could be very slooooow :-($ e% G  J6 }2 m# s
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  
5 Z' ]; S: l* Q- I1 ?     ;will break 3 times :-(& j* F( e# L& K5 b& S$ o* c

. G& P8 D7 m2 [' p" r& t-or (a bit) faster:
4 i: n/ q) y; M: r   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')( i" R- Z! [& c+ A3 T

- O1 n4 Q  B# E+ @, `   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  2 U1 T4 @7 O9 P
     ;will break 3 times :-(
% N$ r9 ?4 r! z) i% s4 K5 H+ ^( V. y
-Much faster:/ I* ~" j& Q1 g5 H! j
   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'6 ^7 M4 @- u' e8 Y, M. z
. ~) ^: @( T5 s- @3 y: P
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
$ s& G/ j$ P3 V2 ?. p# f+ Xfunction to do the same job:
7 F+ O3 B7 D" h8 r% e( P4 x( e. L  h. i0 a/ P
   push    00                        ; OF_READ. U- K( P) ^5 U5 ^0 l$ C$ ^$ w
   mov     eax,[00656634]            ; '\\.\SICE',0
1 i! ^( D0 H& D1 k1 o' ]   push    eax2 v4 J& g, C: c5 f
   call    KERNEL32!_lopen" e  {; G* R; P6 \! S2 V+ [
   inc     eax
! ?+ C% r& E$ U  W# c& a- V+ ?+ I   jnz     00650589                  ; detected
$ {! v3 U2 z  ^1 e, S, i( `, o$ p   push    00                        ; OF_READ; U/ U$ w; ~+ K
   mov     eax,[00656638]            ; '\\.\SICE'
. k$ }9 m) t& i9 \# k   push    eax
7 a, |2 \2 _  S  ~; m9 M4 g   call    KERNEL32!_lopen$ }$ f& o% I* N
   inc     eax' x% l% n6 ?* [% ]: R, E$ O; N
   jz      006505ae                  ; not detected
1 h) Z, b9 E7 `, S8 x( L- c# r* }- ^
0 z" {5 P1 l. \6 O! u2 W
- _6 o! B. t6 o2 @( T__________________________________________________________________________: L7 s+ N; Z: E0 ]* Z( p

+ Z" H, {' B9 FMethod 12
! j. _0 y6 A. l  c% S7 h; A' W=========$ i! i$ h8 C) \0 @! s

9 M( W% K& s3 M5 N  [+ ZThis trick is similar to int41h/4fh Debugger installation check (code 05  j& |+ Y/ L- Y) F3 S+ ]. B
&amp; 06) but very limited because it's only available for Win95/98 (not NT)& a6 L. E$ ?2 S; d7 v, I: M( P
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.3 Z! h' V  L2 W& y$ M  {+ j. A8 [
' ]8 m) K( P" X2 [3 _
   push  0000004fh         ; function 4fh& e5 s9 N6 R/ p( l1 j/ E
   push  002a002ah         ; high word specifies which VxD (VWIN32)5 V, k& }/ T" p" L9 {* _
                           ; low word specifies which service1 g7 Q5 t# N3 m
                             (VWIN32_Int41Dispatch)9 v6 y3 o3 t+ z3 y
   call  Kernel32!ORD_001  ; VxdCall4 M, m% i" |1 ^( J  h
   cmp   ax, 0f386h        ; magic number returned by system debuggers
0 K% }& ~* m$ F$ z   jz    SoftICE_detected
& ~( Q9 A) O, Y- w
' v( {* I9 H+ G. Q0 RHere again, several ways to detect it:3 m+ ~' t# ]9 N0 \7 b

0 C) K1 W# x2 S8 j: H    BPINT 41 if ax==4f  m5 ]4 {; _" P- `* J2 Y3 u9 D; {

& ?5 F$ A( L, Y" ]# t7 k# x9 L    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one
( q5 t- ^3 }* Z3 e: E) P' [& p; s
0 G+ u7 M0 v: f- z0 [    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A7 U8 E0 a4 F7 K7 t8 P6 Q
1 ?/ I3 i0 U' K4 }# j2 _1 e" y
    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!
0 i" f$ Q% D2 D& u
8 g, u% d0 a) G7 m+ x7 p4 H__________________________________________________________________________) ]  b; q/ V+ q3 D

, t: j9 U* b  k/ @& T; U  ]' V; wMethod 13; _& ], m- a3 L4 ?7 y2 H2 p7 {$ W; m$ S
=========
  c. T0 s9 D5 k6 |) x
- Q& |" ~5 C$ K/ BNot a real method of detection, but a good way to know if SoftICE is
+ f+ s, `0 }& f5 }, m, F1 V/ g: Finstalled on a computer and to locate its installation directory.
1 _: c0 ^3 N, ?0 j1 dIt is used by few softs which access the following registry keys (usually #2) :
9 L# V# U* ]! E( n
$ M3 S+ G. ]& b7 l. T-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion1 t8 ]1 {- Z9 R* k2 t1 u
\Uninstall\SoftICE
, {# M: K* j4 M7 Q( _-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
4 h1 S( c+ Y* E, x-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion& Z$ m0 _: U* P
\App Paths\Loader32.Exe
0 X+ t* T- b& t$ K% m7 v& U. u# y4 }* |8 R! q1 y* O
7 H, C; @3 Z7 F
Note that some nasty apps could then erase all files from SoftICE directory
1 ?7 n5 l$ P% u; o0 z) J9 E(I faced that once :-(, O' j5 P8 d/ D) w

8 a  E6 ~- _6 q" g6 |6 H" WUseful breakpoint to detect it:8 B& M$ Y" K8 N7 b

' T, X1 t' @# z     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'- n! k7 @; A- X3 S% @
# ]9 W- R7 G5 p/ e: \3 t3 L  f- i
__________________________________________________________________________# K5 O: W- t- m5 {% M: s( l* |# ~

6 x7 o  W0 L/ w1 Q' g# n$ t0 k+ U$ T# ^/ T& V; Q% c: d4 f
Method 14
- G, A) n% G- I# A+ Z=========
) d  j/ e8 @9 U8 ?. x! c' \! e2 p. O; V+ S* @% t
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose8 ]( U* h2 u# m5 a5 I
is to determines whether a debugger is running on your system (ring0 only).* t% b; l8 [1 `1 ]1 Q! Q- S
& p  F% H2 q6 ~- O0 Y" @
   VMMCall Test_Debug_Installed
9 w  O5 m( S6 q0 k2 ^2 d1 N   je      not_installed- U$ R0 T) g. t6 {2 i3 ?: r! \

  @# p% N/ I, ~" r' Y. _% {2 y2 H$ o3 oThis service just checks a flag.
7 ]4 V9 g0 Z# U. u" c</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关注公众号

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

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

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