About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>( T7 n2 e  }- ]3 Q
<TBODY>
3 _, y6 j- r' g. x" `1 W) q<TR>7 ]  _6 `* F- J8 g- g. B
<TD><PRE>Method 01
' b8 }3 j$ B( o7 h( D=========
! C; ?+ |* `( o; Y9 _- y8 ]  k+ V8 B. D! E0 N" S
This method of detection of SoftICE (as well as the following one) is" E* W) x$ o& p2 {4 {7 N; [
used by the majority of packers/encryptors found on Internet.0 P8 u( O. P6 v
It seeks the signature of BoundsChecker in SoftICE: T# ?' S1 ]6 w, Z! u

6 e! Q% v, e$ L* ~' U0 v/ B    mov     ebp, 04243484Bh        ; 'BCHK'/ N! L9 g& j& _- `$ O
    mov     ax, 04h# l, ]3 l1 v$ `4 M, A% Q  y7 G0 ]
    int     3       $ Z5 V6 p8 l! @
    cmp     al,4& z6 z# Y4 L9 R7 G
    jnz     SoftICE_Detected" i7 A: T$ h4 C# Q' [! Z
) K# m7 C$ h6 i0 ~6 H# [
___________________________________________________________________________
' T) ^; W, ]) q2 I2 V* Z& [- @7 }& e, Q# h2 g9 _
Method 02
2 Y& P  g! I, {: l# r=========% x  P3 a, V9 y  R* \
$ Z' u) m' n, M2 c. W
Still a method very much used (perhaps the most frequent one).  It is used
' F* m3 L/ |3 M' _1 Y1 oto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
" n1 K- X. S' K" lor execute SoftICE commands...! F. G! h" H) [+ q2 I6 A! b# v
It is also used to crash SoftICE and to force it to execute any commands1 P* N' i& e5 H
(HBOOT...) :-((  
! Q3 \, D2 E  g, a) F: d' I8 B+ A7 |4 d, N4 m# s9 b
Here is a quick description:
0 I/ K- Q! l' W( f1 r' m-AX = 0910h   (Display string in SIce windows)# j! G, Z+ v" Q
-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)
6 v7 F) `3 G) n  {7 M2 M& {% }5 b6 }-AX = 0912h   (Get breakpoint infos)& u: {" |( ^5 |( ]) P
-AX = 0913h   (Set Sice breakpoints)
7 L3 ]' F8 i/ {4 F8 S-AX = 0914h   (Remove SIce breakoints)
8 D9 Q% Q- J5 U" ]# T& B) L
- N1 O" S- k$ N* @! {) vEach time you'll meet this trick, you'll see:; O& q% [* H" h3 _
-SI = 4647h
& V) j$ q  h8 t9 b) t) m# B# _-DI = 4A4Dh5 }, t/ h  `. W9 z2 x) s8 v
Which are the 'magic values' used by SoftIce.
' _' Z$ H* z! oFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.' J8 b3 {: ^: c; u( o; L
9 j+ f4 E1 A& n; N: U; L& O
Here is one example from the file "Haspinst.exe" which is the dongle HASP. P  m  V3 S1 Z' m) k% P
Envelope utility use to protect DOS applications:
9 g& A3 i" Z2 P* S$ r6 ~. m0 y6 Q$ p/ k1 X; F. g9 G
, s, D- ~: V# X( O: y2 V! p' O
4C19:0095   MOV    AX,0911  ; execute command.  Z# v8 M! V" l, O
4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below)./ P3 G  z3 \: I" p
4C19:009A   MOV    SI,4647  ; 1st magic value.
( K& h) C; Z$ O& a4C19:009D   MOV    DI,4A4D  ; 2nd magic value.7 r' V8 {3 `+ h' [" }) d7 P
4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*), T  g; ]1 w; l
4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute
+ r3 _: |' }4 J3 V4C19:00A4   INC    CX
) V$ b) q9 t! b$ J9 Q  o4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute: q" v% W. A( l  N' @2 J
4C19:00A8   JB     0095     ; 6 different commands.
* K9 y+ T+ l% W5 e4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
* [8 X4 G, k4 b3 \  t5 I/ A4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)
! E0 P* U3 I* C$ \) N: s  g2 ^4 \& C' d
The program will execute 6 different SIce commands located at ds:dx, which# C% E1 i. ?4 T- E& m
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
& X6 Z3 c" W( E/ K* i
2 U" g7 H2 ]+ h  N* f3 q' x* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
& [- S- o& T7 L! Y___________________________________________________________________________9 Q9 G! t' ^& e6 W+ K- A5 e1 {  `
* d- e0 J2 o7 M& r( `5 ]4 l
! O: X/ U, W: O
Method 03
0 V$ D- M8 C; I# E! Z$ d5 S=========% h0 o+ K; ]' B% J) E% k0 x) o& A
$ E, Z, F+ ^6 R5 z" ?
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
' a: h! W+ E2 V1 t1 y  V8 _(API Get entry point)
1 X$ d' I5 W4 {4 d$ r        
4 X; P- S8 }" H: I) O$ ?) S8 S$ Y2 {$ L
    xor     di,di
( p7 q$ u2 h9 ^% R3 a    mov     es,di: l" s" T/ r% b' E1 ~
    mov     ax, 1684h      
: C- E  l/ @$ K4 p- \% U% O- v$ P    mov     bx, 0202h       ; VxD ID of winice
7 @) b9 F$ S. m2 u- Q2 c    int     2Fh  s( b7 s' P: z' C
    mov     ax, es          ; ES:DI -&gt; VxD API entry point
, S/ H. `" d& ]! T- ?* r# D) [    add     ax, di
% F# Y  A- l  F8 K! Z% g* H, q. L( @    test    ax,ax: `; I( N- ]+ Z
    jnz     SoftICE_Detected" g% u9 N. R2 ~. U! Q

! u% i9 G, Z' t! F: f___________________________________________________________________________
7 `! f- R5 X# I% F: r3 r4 t: d1 {( d, J* l' O8 }3 q
Method 048 w8 i( i: |: r& ^9 |
=========2 t, c( E2 m( [% W

7 o2 Z8 s3 M0 H  n' Y( NMethod identical to the preceding one except that it seeks the ID of SoftICE: n9 |9 z- G  K- ]# @
GFX VxD.
# i/ u) c5 H- y
4 {/ B5 t% E* _, ~+ A$ }! |    xor     di,di& ^$ y  Z- \/ T' z
    mov     es,di
' J9 }# d: B! s    mov     ax, 1684h      
9 V+ p" H9 c* m7 k    mov     bx, 7a5Fh       ; VxD ID of SIWVID
+ V5 o2 S& @; A5 r& Q    int     2fh
4 _" P; k4 O4 [) H1 B    mov     ax, es          ; ES:DI -&gt; VxD API entry point0 O. y6 i8 p1 g) Z! `4 V9 H
    add     ax, di4 ?" l# d& J5 E8 k: C* i
    test    ax,ax
6 ~) {0 M& u  }* c2 }    jnz     SoftICE_Detected! \$ M  y1 d1 C) S, e/ K# e$ a
' Z; a- q+ P! O0 e4 T9 ?; C, E2 C1 [
__________________________________________________________________________
3 @0 Y' [" g4 E* T, l- [
' d) p5 u( x" E9 O* X  h/ J9 k6 w  K0 w4 U. q
Method 05' z' y: \" C" k( O' e# e
=========
9 T8 v/ H' D) s" H3 p7 Y9 e& F
$ E$ N4 w/ q4 P# Y1 x) ZMethod seeking the 'magic number' 0F386h returned (in ax) by all system
8 l. k) }+ ]7 w3 R% Cdebugger. It calls the int 41h, function 4Fh.
- |0 D2 l5 q4 K: e. ?3 n. lThere are several alternatives.  ) a1 E' ^$ ]6 n: s4 p1 Q8 [' L  O
# [& i/ N4 |! [5 X8 S0 U
The following one is the simplest:8 j; s2 U0 ?6 v: `; g" C% |; ]- M, T
( b$ G' p, Y3 j% C
    mov     ax,4fh6 i, U9 m! k- j; m; C! d
    int     41h9 d  ~6 w( v* V
    cmp     ax, 0F3869 [" R7 a: M0 }# N# i5 J
    jz      SoftICE_detected
* X$ N$ b! r5 l3 m0 z) q
+ Y7 Y$ p, H) o5 ^; E8 V" x) c3 n7 n: p& O7 Q+ L
Next method as well as the following one are 2 examples from Stone's ; f( Q3 e0 q8 u7 R1 w7 b
"stn-wid.zip" (www.cracking.net):
# o9 a4 H* K. v/ s* ^  b% g& O
) u8 R0 b$ y' H    mov     bx, cs. {: i; s1 k' N0 B3 [! A
    lea     dx, int41handler2
% P3 p. t' z* U2 m' u' m/ i    xchg    dx, es:[41h*4]
5 B5 }; ^  n4 D    xchg    bx, es:[41h*4+2]
0 s+ A# ?+ s3 E. P! m: M    mov     ax,4fh- ]5 @5 m4 m- u* s) Q! E7 I
    int     41h) W- F: s+ ?& M$ u2 f
    xchg    dx, es:[41h*4]7 o. W- Z5 M" A8 g6 y- }
    xchg    bx, es:[41h*4+2]
( f2 l# }0 D: z1 k" s    cmp     ax, 0f386h$ B6 q& z- i! y1 s# h# w& K' L
    jz      SoftICE_detected
8 }& x* M' g/ v4 f6 \- f* k; q9 O% b2 F2 F$ T8 N
int41handler2 PROC
+ j1 x! F6 Z/ m9 n1 H    iret$ V0 Z7 A  o6 O
int41handler2 ENDP
, |: C% p2 F* K. s- `  V- r: r  Q& v0 W% H! L. g6 v# \: o- Z
% L, S: j# I# Y$ P) T, \
_________________________________________________________________________
$ b6 G, t% A' n+ T; B  B& f% t
' k& W) [2 ]0 O3 `/ T6 F1 {: w* v1 h. q% b$ q' C
Method 066 z0 H& r2 }0 O) ^% n& E: E
=========
, T/ {& J) O: i
3 d' P/ z7 _# ]. z, r+ j6 O( q, ]3 y4 {5 C
2nd method similar to the preceding one but more difficult to detect:
& R2 N& g5 B. U- Z
- _4 F. o$ s. Z: {
. a9 ^- k' ]0 j, fint41handler PROC
! ?( d/ V! m8 b% t: f* o    mov     cl,al, E) h$ y( z9 M* t6 t
    iret( l6 n# Q& K/ C
int41handler ENDP" Q7 q6 g/ Z( R# q7 H3 Y  I
) m0 ^( a! U' q8 d: _% r$ _  Z

+ o! P+ @9 O0 [7 ?! P) p' C    xor     ax,ax* D5 @  Q3 p" ^
    mov     es,ax
6 u/ }% _. m$ A/ D9 ?" y# o    mov     bx, cs% J9 b, o2 O6 Z# ?( ]1 C3 p
    lea     dx, int41handler2 g; r* P. T$ V: C" R* l$ P
    xchg    dx, es:[41h*4]$ ?/ c2 [6 G9 G( ~
    xchg    bx, es:[41h*4+2]
7 g# a3 ^5 k0 S# T    in      al, 40h
' L" P: V6 G; Y1 }0 E    xor     cx,cx. \; `' i7 p+ s2 ^
    int     41h5 f' t( S$ i, |; Z' [
    xchg    dx, es:[41h*4]
/ ]& r. T4 p2 d/ D5 a    xchg    bx, es:[41h*4+2]* n- S3 G1 f1 e# I2 @4 Y3 `
    cmp     cl,al
4 l/ q* `2 H. P/ Y    jnz     SoftICE_detected" ]* u) Y8 \4 Z1 w- t& d% K/ k3 B
2 H9 Q! i) r% j; _0 k9 j! P" B
_________________________________________________________________________2 Z+ x; s( z; q- @) M& p
/ T8 w5 @3 O. {: L
Method 07/ l+ W8 n/ ~% ?; g. {/ V3 W
=========
+ e4 r+ P7 j  s4 p1 r/ f& n/ [( \: N  s5 ?0 R
Method of detection of the WinICE handler in the int68h (V86)$ {0 n& s0 [# V0 f; _

& b! K2 R$ w# ?! h* Y0 f    mov     ah,43h) A0 g) K$ P  o( |, k
    int     68h; O: N# r3 R0 M# n# J
    cmp     ax,0F386h
( \* R  o% y+ [: t( q9 q    jz      SoftICE_Detected7 a, }; M2 P/ Q; l0 F% I
# ]' _) ~( @7 e+ i1 s
' I* e- `. o8 o3 v* T
=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
8 b9 _% `$ A" A( ]0 G% ~, X   app like this:5 A! P, |9 [  u) Y

. O) W& @1 g8 S8 R1 p   BPX exec_int if ax==68
' y, U' p, Y, b1 w8 H5 n   (function called is located at byte ptr [ebp+1Dh] and client eip is$ h: {; ~$ B4 m, e
   located at [ebp+48h] for 32Bit apps)( y2 K: m( \$ f( s# I
__________________________________________________________________________
+ M- W9 f. P/ }% H3 I' L. F" P" o  c+ O2 j9 w

7 x' m0 K, A" K7 F4 d& oMethod 08
; ~4 ?$ y9 ~  {=========
9 P5 _! U. c  d! E4 \0 h: j! r
9 W3 j9 f, @6 C  Y; J# A& RIt is not a method of detection of SoftICE but a possibility to crash the& _- {9 ^6 V% `
system by intercepting int 01h and int 03h and redirecting them to another6 m+ O  _( e% N5 l/ k/ ]: i
routine.
0 S: E- M- e  J2 ]! T  x$ \It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points4 ]# n3 {. t( F  y
to the new routine to execute (hangs computer...); a( ?* n3 M2 b; g" O# `* F! ~$ y( S7 x
& i) F& [1 z* r  p3 |
    mov     ah, 25h
3 V5 K5 o7 ~7 L2 f" I( S    mov     al, Int_Number (01h or 03h)5 ^: U0 O% I. Z
    mov     dx, offset New_Int_Routine+ N- s. n  Y# l
    int     21h
+ j6 S+ A" r' t0 {% R/ F* O3 Y$ x: p* A% P
__________________________________________________________________________
" n$ ?% i( @4 s5 O, u- X' v( j# q6 k. F
Method 09
* j" x% J' P% W( q4 b0 B, E=========: C% n% W$ B. }9 k, M5 h) A

/ E: \) }' [3 q  fThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
6 ^2 u& `, b$ Operformed in ring0 (VxD or a ring3 app using the VxdCall).
# K- D: f0 r% w2 A1 Y& M3 a! m( FThe Get_DDB service is used to determine whether or not a VxD is installed
9 ]9 {& c3 K. f3 {2 D$ ^for the specified device and returns a Device Description Block (in ecx) for
3 Y7 @, }- H# q, ?% A# d5 Hthat device if it is installed.
8 G; J2 U' {& l& r* l( m7 ^, ?: D; d& _; F  d+ T
   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID
  }; j% b0 z& T! \; t& X- E" Y8 }   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
9 v9 d2 t, z7 A* @5 P& ?% P3 s   VMMCall Get_DDB
7 z' z, ?9 `5 o3 J" k. i) x: u/ x9 h   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed
, w' S' I0 y. ~, q: _5 u
9 x& ?  _2 h* ~: Y2 PNote as well that you can easily detect this method with SoftICE:
8 W5 |! q" n: M5 v4 M! @   bpx Get_DDB if ax==0202 || ax==7a5fh! S( Q2 ^& p0 _7 v' }
8 p" N  r8 k# r2 g/ q
__________________________________________________________________________
7 X. s6 ]% T9 V9 ?) q2 O
) ?5 H. J" n/ j/ T% v1 {5 N3 r8 PMethod 106 [- [' b: V1 P5 ~: _  i+ c6 ]9 w
=========- l3 ^) R0 l( q1 ~% u

7 B4 y+ s  |) D- y5 v2 |, a- ~. w=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with& s3 G: y" p5 O" r- f
  SoftICE while the option is enable!!
2 s1 E3 t3 m( A3 k
, D; V: U. f3 k$ i3 [This trick is very efficient:- D- P! h0 Y- e" ], ?2 D
by checking the Debug Registers, you can detect if SoftICE is loaded9 o! h1 O6 ^! e' p
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
( M7 Z7 B2 c$ l0 p! y- C9 t3 t% ythere are some memory breakpoints set (dr0 to dr3) simply by reading their% f! [# a- Z7 g& d
value (in ring0 only). Values can be manipulated and or changed as well
1 V* g7 W$ b3 W0 l(clearing BPMs for instance)
" N0 f& ]/ t8 X3 t) a9 l, {
9 {; k$ l+ ^( c% `__________________________________________________________________________
. p$ m4 q5 e. b  Z
3 B2 a# v2 N+ G2 W: XMethod 11
4 F" M* x7 D' L+ W( g  g4 d=========
) q4 h$ b( b& H+ l
9 {' d+ ^7 Y5 q6 a4 v! gThis method is most known as 'MeltICE' because it has been freely distributed
& d. }/ _& w7 X9 O  N# K5 J% hvia www.winfiles.com. However it was first used by NuMega people to allow
. j! B3 M/ f* aSymbol Loader to check if SoftICE was active or not (the code is located
# U9 D' A1 M7 ]inside nmtrans.dll).& Y9 W+ r: j; U5 P; m5 g% z7 M

* ^, }# c* g1 I, ^! P* U% dThe way it works is very simple:# v+ {; }  g, w4 Z9 _6 P/ v9 g
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
) t4 L2 C7 [7 J1 l/ s" tWinNT) with the CreateFileA API.. p( H) L' g0 }
0 s: v- `9 |( t
Here is a sample (checking for 'SICE'):
  F: [0 _) Z) |# w! t6 ?7 I: b* [- G( ?' x/ t' Y: F+ \0 N! I) S
BOOL IsSoftIce95Loaded()
) h. I# l# C! b5 p1 A' E{: S# b+ d9 s+ \9 U! B6 {( @
   HANDLE hFile;  ' a7 Q& ~" d1 o
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
- s# l  l+ n6 v, W9 I' X                      FILE_SHARE_READ | FILE_SHARE_WRITE,5 F  N! X3 j$ B1 \0 D
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
% Z% H) f( ~- d3 K8 M  @% P   if( hFile != INVALID_HANDLE_VALUE )5 x: L- L' b6 l5 w) M
   {
+ }8 c% C/ q% z+ S* A& m      CloseHandle(hFile);1 [5 \8 J: c; o
      return TRUE;
: _% i3 V* V* A8 Z( _   }
/ C& i2 I, U: N% r! }/ O5 y   return FALSE;4 D$ X) r+ U) N- d
}2 P- j# Q. q- Q- S1 j6 {
( H  J9 ]5 i' t# `5 N6 V1 }- Y
Although this trick calls the CreateFileA function, don't even expect to be
7 r* t' |$ K" ~1 l3 Q4 v" }7 T0 wable to intercept it by installing a IFS hook: it will not work, no way!
) {+ m% n0 v% p$ A$ h# J0 \In fact, after the call to CreateFileA it will get through VWIN32 0x001F6 N  n+ f7 A) P! q6 }' u
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
: m% H; r$ ^$ yand then browse the DDB list until it find the VxD and its DDB_Control_Proc9 `8 Z6 c: O4 v( C* G" C% F* v  T8 k
field.2 S, ?- B! X" n1 ^
In fact, its purpose is not to load/unload VxDs but only to send a 1 m" Z4 J1 a* ^5 U" E
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)& S, K+ Z2 P7 f* Z- l; R
to the VxD Control_Dispatch proc (how the hell a shareware soft could try# _$ b* T8 x4 h1 }# }5 f
to load/unload a non-dynamically loadable driver such as SoftICE ;-).- G: R5 N9 w" O% y. m
If the VxD is loaded, it will always clear eax and the Carry flag to allow( g* ]- `, `3 f9 G! ]# m4 u
its handle to be opened and then, will be detected.( s' j% n/ t/ x: n; n0 X" u0 v
You can check that simply by hooking Winice.exe control proc entry point
0 t9 \' t/ ?; L- m7 Pwhile running MeltICE.+ [% y6 {$ \! G# C% J

; X; \3 \  S0 M$ h7 x' V% v7 Z" A6 v! |/ i% ]' F, O
  00401067:  push      00402025    ; \\.\SICE4 m# ^0 v/ ?6 d' V; F3 G
  0040106C:  call      CreateFileA
3 B8 N+ S/ `7 {$ K/ d- N5 G: E  00401071:  cmp       eax,-001; i1 C, e; ^) d  C: y! v
  00401074:  je        00401091
: N/ H: P( @" T) O& A& m
- C: @, {4 N0 ]0 W2 s% d
4 [, m! D2 R" ^  N6 j2 JThere could be hundreds of BPX you could use to detect this trick.. y/ C$ v( i& y/ V5 p6 R# U
-The most classical one is:& a8 W/ |" ]3 {" G; W' u: B
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
( J: G3 r! x) @3 X! K0 l$ B: H2 @2 R& B    *(esp-&gt;4+4)=='NTIC'4 _: _8 `' M/ a5 G

4 T" [" r8 w" z9 i-The most exotic ones (could be very slooooow :-(* ^4 v8 m+ l% b& |
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  
" v# M5 a; S5 D; \' Z- j# B( |     ;will break 3 times :-(
9 E3 g" a+ g+ c3 C9 K" \; i
# Y0 p# h) s6 f+ |-or (a bit) faster:
2 W5 j: d0 _6 l- y& H   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
( \+ {7 v) W# K
+ }  F4 E2 p4 r) H  l, z   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  0 a7 k0 O: {4 B& |$ w0 s
     ;will break 3 times :-(' E/ B8 r! i9 ~' J" ^
/ u& q2 n: z& ?7 o2 _( o
-Much faster:
5 W/ T" p. v0 k( Q   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'
/ C. \( G2 k; Z: B% X& K
$ q( m* f3 u  R3 b* CNote also that some programs (like AZPR3.00) use de old 16-bit _lopen* d/ p8 C/ B" }: G/ c0 C
function to do the same job:5 [1 q7 d. d5 y! S2 v0 B7 x( y

. p# h( P( K# ?5 D0 @$ q   push    00                        ; OF_READ
0 I5 s+ p) o) w/ ^% P+ i5 X   mov     eax,[00656634]            ; '\\.\SICE',0- H% S0 \( q6 H
   push    eax: p2 K$ O/ \9 w
   call    KERNEL32!_lopen+ ]. H" P& _" l: U6 L
   inc     eax8 K/ [# d. E$ m8 h1 q' f
   jnz     00650589                  ; detected
" p1 ^; }* M9 L4 j+ B8 W! S   push    00                        ; OF_READ0 _6 P5 I! x, W  K; j& C" @$ {: T' d
   mov     eax,[00656638]            ; '\\.\SICE', H$ `6 w+ h5 E9 T1 l% x! {
   push    eax
2 a7 b+ b0 A  m' w2 }   call    KERNEL32!_lopen9 ]$ j% x  u: y5 m' L' c- x% a
   inc     eax3 z5 E0 E8 o+ g. s, A, H. z
   jz      006505ae                  ; not detected
2 D# l9 @+ O6 X! E: ?
" s* o! m% P2 U  P# g( T9 L- y5 g
! W: L5 x  P+ q2 [, C3 L8 T__________________________________________________________________________  l; i7 z$ W+ I$ \+ z0 X
' A9 U" m' m' J8 t1 n
Method 12
7 o/ J# Q  W; e/ C9 ~=========: `. L' [4 [( Q4 m# Y$ I  v6 e

4 q/ l& H# I2 L: \6 ?: N% MThis trick is similar to int41h/4fh Debugger installation check (code 05, U% W/ _8 N& o1 `
&amp; 06) but very limited because it's only available for Win95/98 (not NT)* N1 }1 {' {! Z9 r
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
6 K+ m5 K* W' g' x' J8 n
. I+ v; v- u" W6 Y( E. j( E   push  0000004fh         ; function 4fh9 r$ z7 b! S3 j0 T% M
   push  002a002ah         ; high word specifies which VxD (VWIN32)! k* C) }5 A$ k& j) \- u8 y0 k$ f* t
                           ; low word specifies which service
7 [$ l) D5 m3 r                             (VWIN32_Int41Dispatch)
4 I. a0 o/ a! I. R* a1 y, M- D   call  Kernel32!ORD_001  ; VxdCall' s* h1 W  G3 W0 b6 V: r
   cmp   ax, 0f386h        ; magic number returned by system debuggers' O. J5 M- s, o* q
   jz    SoftICE_detected% R) C! ^8 M" r, o, I4 j

7 Q( q8 H/ P3 p  @Here again, several ways to detect it:
* v5 v2 F5 V1 n8 }2 \- q  I- ~+ t9 @+ B
    BPINT 41 if ax==4f- z) b: ~* L/ u: `" c
( ^/ ]' W. T$ E7 g
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one3 S# i& D# e  D# R
- f8 e/ P4 ?6 o' _: y3 Z" w4 i
    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
5 D" L  U0 M# c" R8 P2 Z$ f# O2 N1 K( e7 g% R4 b, _: b
    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!
) ^( S, y6 f) m. v
0 P" B5 u/ X. I$ w( J/ v__________________________________________________________________________; W$ {2 C+ n& K/ k4 n0 ]
2 l9 k& J- w: [4 A+ U
Method 13
& A! t2 Y4 v) Z/ `" l=========4 b" u; _% |# e$ S8 X5 G8 y4 K
. u1 B) j- V# V
Not a real method of detection, but a good way to know if SoftICE is
1 e6 ?, \+ M1 K9 w# ~0 e4 T* Q+ Iinstalled on a computer and to locate its installation directory.
, I  a8 I3 e# z2 R0 rIt is used by few softs which access the following registry keys (usually #2) :
4 S! ?; \$ c) ]& @
; O$ M; I+ h$ d-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
  l$ P4 {; L& I  t' Z. W) T9 v\Uninstall\SoftICE
$ W- t2 g3 ]: a5 F8 i0 @-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE' J# J. d: u3 b0 d. s' T
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
0 Z4 p% C/ Z5 `8 R; n1 i, r\App Paths\Loader32.Exe$ b! I( F0 i! I/ }7 N
2 y  N$ B, `8 ^( m$ Q9 ]  o

( B4 P  {5 O; B/ U* wNote that some nasty apps could then erase all files from SoftICE directory, {# P: n1 Q1 _- ?# g5 e( L
(I faced that once :-(
; m' @& ]) S0 S, |
) `; e" E0 J/ U' p% yUseful breakpoint to detect it:
  @, [: j# {, V  s+ i# T$ b. s3 O8 j; k5 V
     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'' ?/ B$ r8 s; M3 r" r' _
/ B+ M+ Q2 n1 g) V& {' [8 g% s% N3 c8 X
__________________________________________________________________________: E! d3 a5 k! u  m. g+ D" n8 d
( u! a& K5 w& P9 U9 a6 R- }* B1 @

7 m7 ?+ Q* K' b+ B3 R4 XMethod 14 % u, ^3 Q) D, b4 N! t* i+ M* f
=========: i: R2 B, ^' e; j- ?6 X8 X0 y- O# J

* l9 E6 a) [, g% \+ s/ n( \A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose% N" F% x6 F: _: k5 B3 Y
is to determines whether a debugger is running on your system (ring0 only).
2 T3 e" q1 y3 K$ z( z3 K4 {# t* I0 \) S+ B
   VMMCall Test_Debug_Installed( k2 v: L1 W$ i/ B+ n( y9 |
   je      not_installed& H& ?4 l& l' U  A/ _/ |

% H) h# x& f8 y) @This service just checks a flag.. k) P9 `+ O6 b. |9 v+ @
</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关注公众号

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

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

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