About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>  R# t+ d5 r7 }/ D( E4 A1 R4 A, j
<TBODY>
1 H" a  o, p9 ~8 ?( Q; I8 |<TR>
: [. [* A1 z" |( b8 T! L<TD><PRE>Method 01 2 \8 E% |0 a5 @  ~; Q/ S, x' k$ h+ m0 D
=========2 q) j: @- b; n$ @4 r* p2 `+ \
) h3 U; y" M  s3 A0 L8 V
This method of detection of SoftICE (as well as the following one) is- Q6 R: ?2 v* w: ^! i' T
used by the majority of packers/encryptors found on Internet.
. r" U9 p. W& x4 W/ y4 |$ f$ `It seeks the signature of BoundsChecker in SoftICE; X. G6 G8 d* s
% F! ?$ d7 W/ B9 s5 A* c# S
    mov     ebp, 04243484Bh        ; 'BCHK'% a' v0 q7 ^5 X# x- [& ]2 \
    mov     ax, 04h
9 e/ S* Y. ]1 s( b    int     3      
/ u, I1 J0 b( w3 c3 ^( K    cmp     al,43 ~7 r5 c8 j3 w
    jnz     SoftICE_Detected9 \3 W* g4 o5 b" Z0 M

6 h0 W, T! o8 j" F5 G+ J1 q) F___________________________________________________________________________  W: W" U+ i9 `- R# I
; O6 \" M8 V! y6 @7 `9 b, s* p+ F
Method 02
9 a( J! j# z" H5 H  E. \$ g=========, P3 r/ l$ Q: S6 Z6 h6 q. Z
# {! h, L0 [2 W- @; Z; _
Still a method very much used (perhaps the most frequent one).  It is used% L$ w2 F% E6 ^. Y9 c
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,( K& @6 C, n! }* _+ L9 E
or execute SoftICE commands...
+ T$ {# y8 n2 d) [* L& @( v* sIt is also used to crash SoftICE and to force it to execute any commands. |; h6 q3 i3 q+ O
(HBOOT...) :-((  
3 S9 J# P9 t$ t9 X0 g# R8 [8 G1 L: o/ r# \
Here is a quick description:
% L% J9 L8 y1 p4 o6 p0 Y* e-AX = 0910h   (Display string in SIce windows): }. F" l2 U4 L
-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)" N! n7 y' c1 n/ V8 c
-AX = 0912h   (Get breakpoint infos)6 t! _- v3 }9 c) P+ C. R. @4 x
-AX = 0913h   (Set Sice breakpoints)
/ s+ e# o3 ?: s-AX = 0914h   (Remove SIce breakoints). a  g4 O' [) Y4 [$ \7 o7 I' z4 m  _
# f- Q9 y4 Q# o* T& T- S! y
Each time you'll meet this trick, you'll see:
1 L2 [# m) n5 R- H) o" Q7 D, i-SI = 4647h
7 S2 R. S7 i" W-DI = 4A4Dh
% U. K5 t- N5 _! DWhich are the 'magic values' used by SoftIce.1 k1 c; x& M5 x, Q- S; w. u, L- z, [* W
For more informations, see "Ralf Brown Interrupt list" chapter int 03h." @& A- a6 I4 q4 `8 f

* z. ]; K. W5 |& z0 ]) NHere is one example from the file "Haspinst.exe" which is the dongle HASP: `2 e0 Q& J2 O  ]
Envelope utility use to protect DOS applications:
: ^) X- G' K& m, B/ J% E# v) B5 p6 ^  M, P# a$ S6 g: x3 L% I
# A6 ]1 [  B+ F0 ?2 P) H5 a' x
4C19:0095   MOV    AX,0911  ; execute command.
5 w/ Z2 P& ?7 V, A  U0 ~3 Q4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).2 f* q1 N) f% Q( s' l* M  t( W' Y
4C19:009A   MOV    SI,4647  ; 1st magic value.
( Q: U3 M3 D: u: V3 Y2 g6 m4C19:009D   MOV    DI,4A4D  ; 2nd magic value.0 ^* n/ M! N7 y- }4 q; ~6 d" u# W
4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
8 z' B& n( F, c7 y% G* F4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute
1 M$ A. e' t- ]' A# k4C19:00A4   INC    CX
0 d' d1 ~' B# ]5 T4 M" d4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute  Z/ w9 Z! z& q4 T. H0 P/ T
4C19:00A8   JB     0095     ; 6 different commands.( u5 m0 `  I) p' M3 I/ F
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
4 [- o  k) \) t/ R# ?0 M4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)
! E" x" |: o8 M% S/ u. K) ?
) ^2 N2 l) U8 ]+ h: _The program will execute 6 different SIce commands located at ds:dx, which
: b2 S9 E# M8 P: W3 W# D4 H* Bare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
$ o* |. W5 m. O: a/ c; N" Q" y3 g( E* U5 R( O) |( P1 V# b( U
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
+ s4 @1 P) D  E0 P' d7 t4 y) k___________________________________________________________________________
7 d0 R  h; |: H+ A  A* D+ O5 R

7 w# D4 N  W0 }3 I1 qMethod 033 K2 w5 a. X6 d$ V4 j4 g( U. u% R
=========; c$ R7 {0 V) W/ m( i
( r$ F6 V, n( _& X" Z/ C0 r/ Z
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
5 H2 T/ M- l- j; @(API Get entry point)
$ p; l' P, `+ a/ d1 V" C        
: A6 b) @- D4 [# R5 X( {% {
& B" ^) h* m9 A$ Y( e1 V% M    xor     di,di0 l# X' {/ G8 [; _% }8 N- F# X- p
    mov     es,di
8 h/ r8 A3 }& [0 K: T    mov     ax, 1684h      
8 E8 f/ Q2 f  O5 N7 H0 A6 W    mov     bx, 0202h       ; VxD ID of winice
/ t3 r* S) K" d5 X    int     2Fh
/ v+ \8 K( n( n    mov     ax, es          ; ES:DI -&gt; VxD API entry point
5 \- `% D* V' W9 _& w    add     ax, di
% L, _; g, R3 [4 V+ I3 f# @    test    ax,ax1 K( q3 z) m  \& Y
    jnz     SoftICE_Detected7 D' ?% T8 |8 g0 e. t
+ [& R2 F* ~! F' o! s
___________________________________________________________________________
2 h" c- ?+ i' g+ N- k7 K0 c) b: p7 r' O% J
Method 04: V: d1 I$ H. u, Q( R
=========
5 t! R( P# _$ T0 J# a) g* n8 o" P. o4 d0 P( s0 T$ @3 p! s# a
Method identical to the preceding one except that it seeks the ID of SoftICE
5 f: Z; [; G; E! dGFX VxD.
. g1 h( {) \/ J3 f- G5 `* @8 Q
; L6 |1 a: K9 s# R" u    xor     di,di7 z; i! d- e: Z2 d
    mov     es,di
1 M+ o# y# T1 h    mov     ax, 1684h       5 V( C6 @7 |4 W! S
    mov     bx, 7a5Fh       ; VxD ID of SIWVID. i/ J1 z2 e& C- V, P8 m; d
    int     2fh$ u$ Y) B1 f! m# ?/ \( G) ?" U
    mov     ax, es          ; ES:DI -&gt; VxD API entry point, C. P: n" E1 r- l, o3 O, R
    add     ax, di6 R' C' m4 V2 T* D+ F* Q
    test    ax,ax: d# H9 G' q& u2 g! r1 r* w
    jnz     SoftICE_Detected
, u7 Y6 r: E& X  v
$ t  e6 }( a4 x# h__________________________________________________________________________
; b, G0 F+ A6 ~; k# T8 M. @
9 |* e; M8 e! O
' J# T/ ~$ d2 v1 |8 T6 SMethod 05
* r, U9 b% I/ r' P! Q" B$ a=========
  t. q7 Q" U  C: z# D: N8 H5 b" `
1 B3 O  n' Q1 y( ?) K- `, nMethod seeking the 'magic number' 0F386h returned (in ax) by all system& E/ r8 I( L1 e/ B$ F( d3 W
debugger. It calls the int 41h, function 4Fh.) y- J7 c: u! j+ q  q* @! p$ B. g
There are several alternatives.  
! g$ O3 @/ W3 |- r) O6 I  R' G! y# ?. e7 o( W. I7 x" q9 S
The following one is the simplest:
1 S: h0 g$ h2 F+ _
$ x4 G6 x, @( d) {7 Q0 v: x    mov     ax,4fh! M. W, g, T; d3 B
    int     41h! A; o8 J2 F# a8 R1 f- r# P
    cmp     ax, 0F386
8 j0 u5 r, L2 H' c* I4 y* z7 @    jz      SoftICE_detected' i2 N; v9 _% z
" Y5 F5 d) y: x
7 J2 f, B* Q4 }! N
Next method as well as the following one are 2 examples from Stone's $ R  p8 ~9 u9 Q- e( C# \; R4 G
"stn-wid.zip" (www.cracking.net):. l0 @, v& D/ L7 V9 l2 R

1 O6 A8 h; W) a    mov     bx, cs- A* R% W2 A1 \8 P" g
    lea     dx, int41handler2- n! D8 m) u% R1 |
    xchg    dx, es:[41h*4]
  }+ o2 O" X( ^. a, o% E- {$ s    xchg    bx, es:[41h*4+2]
/ l/ k7 V4 E. U8 V: o5 f5 _. c) \  O) N    mov     ax,4fh  j1 M2 s/ b: ?  T4 x
    int     41h
" ~) y' ~8 T, m( k    xchg    dx, es:[41h*4]
0 T) t0 w$ t7 a" B* v; s5 m    xchg    bx, es:[41h*4+2]1 w5 b! d! e2 \; k  x
    cmp     ax, 0f386h  R* e3 P; Y: o5 }: P
    jz      SoftICE_detected
" @! }% R) n) K% n1 o' k# Q, m4 \9 X4 a8 j, h3 w- r' Z
int41handler2 PROC
, o, M! O/ O' {' y    iret
& N2 O9 w) ?" u3 Nint41handler2 ENDP/ |2 H$ j, ^3 Z( S  Q
$ s) a  z; v- h! t8 V, q
. n( ^  T1 \! |4 Y* p$ V3 Z9 J
_________________________________________________________________________& x& ]! x6 q; c3 q

0 E, L8 ]) t; b4 l3 A& O! u+ r% c  j5 S/ R2 O/ M
Method 06
( S: q1 ?7 c8 b2 Q' R=========
+ ~6 X. ?2 J/ R  K" P
8 H5 {- x/ \5 n4 B. I( k- k$ H' _& b& F* I$ C# j( u: V8 D& ]
2nd method similar to the preceding one but more difficult to detect:
0 L1 t. e& X3 ?; K' n3 {% y
  {0 Y' o. ^2 I, r; }! U3 f+ h4 |7 p& ^6 V6 l/ K% x# ^8 q4 x
int41handler PROC
) q1 G5 z7 ^3 e    mov     cl,al8 K& X" i+ }( \2 d. i8 B
    iret6 U- _# \" `9 D0 {- B
int41handler ENDP
& f8 h' X2 i- g1 d. m1 ~* ?2 t, i- V5 P0 ]+ Q

  t7 O. P' Z$ Y) @- {8 q    xor     ax,ax
2 \: s  {$ S5 G4 U! k    mov     es,ax
, `& w6 V2 l7 \, V6 z    mov     bx, cs
) I8 E; b# D  O1 A) W" \) ?+ d    lea     dx, int41handler
+ p2 \8 t% R, G- V: n    xchg    dx, es:[41h*4]5 u; q( a* Y/ d: Q7 y3 X
    xchg    bx, es:[41h*4+2]' W3 M2 u  E% M& L" i5 R  o& T
    in      al, 40h
$ B$ H7 R! z* V    xor     cx,cx  H+ l/ O( A) f% C( _
    int     41h7 A  b+ P" E7 g
    xchg    dx, es:[41h*4]
% h. F. P, F( l% h: c    xchg    bx, es:[41h*4+2]
% T5 X: q) G; ^. g2 T! K& K    cmp     cl,al( u* u% C$ |# |+ A3 H: |5 E
    jnz     SoftICE_detected
3 X& f& x) D! q# `& o5 J% E& z. e1 _3 `" Z  h
_________________________________________________________________________
* T+ b# X1 h  a0 k" v0 Z: ?( i, b, Z1 l- j
Method 07# N/ w$ D7 m9 H' x
=========
5 ~2 x. u+ Y( [3 H! L& t4 j. d% J2 K4 N' O, W. y* e3 t6 D
Method of detection of the WinICE handler in the int68h (V86)
& a, M1 x+ `" [, J5 T6 Z; U5 Q: F9 R' l8 n; ]6 Q  {- l
    mov     ah,43h- j  t# W6 v# L3 D$ |% W
    int     68h0 m; W3 h' q7 a- }; [
    cmp     ax,0F386h
& A: i8 v/ u$ W: s5 i4 M, N    jz      SoftICE_Detected
8 L# d# w2 z; R
6 g7 Z8 t" T  ]1 G# o! j5 Y  F
2 J9 @" L3 r- E6 O8 O9 ]$ u  W: U, I=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
) G+ H) x* d: z( A+ |+ C- R   app like this:5 c1 x" \, x8 M3 E- K

$ z- D4 {5 \/ `   BPX exec_int if ax==68# J. V8 z  P: ?# i3 [6 F5 u
   (function called is located at byte ptr [ebp+1Dh] and client eip is; t: ^8 Q+ J: g
   located at [ebp+48h] for 32Bit apps)6 ~5 s2 V/ I9 U" }$ J/ m
__________________________________________________________________________
" m6 @/ {4 J' f& T8 i2 K& H, N. b& |" g7 n, A# L% H0 @9 R5 C& k# b

; O9 F, r$ E# d: _Method 08( M4 u3 Y' s* |4 F
=========2 n& i3 c' P: \2 D: q! @/ X

+ H  ~) p4 {& {! Z! ]2 HIt is not a method of detection of SoftICE but a possibility to crash the: H- q4 A; |( A& N, U+ `" Y
system by intercepting int 01h and int 03h and redirecting them to another
. p: d3 b: ~2 m$ xroutine.% U- |" q  k' ~7 f2 |, C
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
0 c: b2 V0 V# R3 wto the new routine to execute (hangs computer...)
, l- Q! h. Q" R; U5 W. K, D# L, e# Q+ p; W" d3 u
    mov     ah, 25h) o0 F8 w  s4 ~- b7 J/ h
    mov     al, Int_Number (01h or 03h)
7 H. x' I+ ~2 E+ |/ m$ a    mov     dx, offset New_Int_Routine; V5 f6 P- h& }, s" d  |5 R# O. e; A
    int     21h  h: O& U6 o, B" Y, k
7 o: S0 U% \2 i
__________________________________________________________________________0 [6 U! }& z$ _' w1 Y0 y
; W! {2 v: u! N- s( q3 W3 r- ?6 Q
Method 095 g* ^" L; ]) b/ e
=========
# B% k% Q1 |. [- \# B' Q4 x
5 V& r( b6 m7 M3 CThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
) o& T1 W0 r5 G" m2 c, ?8 e5 a' Sperformed in ring0 (VxD or a ring3 app using the VxdCall).; t, S5 {  O0 f8 f$ m0 }
The Get_DDB service is used to determine whether or not a VxD is installed
& f6 B3 `2 j8 H% }1 |for the specified device and returns a Device Description Block (in ecx) for
, t2 d* C" s% ^, Xthat device if it is installed.
2 K$ h( [; o; u" h2 B
& u! c& M/ g' O( h" k: P6 q7 M* G0 z- b   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID, K. w! |& f: i  ^4 ~' s. Q
   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
: r+ K+ i5 c! u) `* K& A: \, S% o; O   VMMCall Get_DDB
: y8 z. S) U! A/ _( n' Y   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed
' `* f" d: U; [( `" R% G$ Z# {; Z6 v9 e# \
Note as well that you can easily detect this method with SoftICE:' U1 V1 l* |; k% o
   bpx Get_DDB if ax==0202 || ax==7a5fh" q* b  d' o% a4 D! T. O

8 ]& D2 h  X2 t4 H. }5 R__________________________________________________________________________
+ Q: n. q) g! e  F7 b; D
5 n* |+ m! k5 ~# W/ x, [Method 109 p8 X) ?" o% w
=========
3 T+ L9 Y$ Q* }. s* G0 M
0 O; F3 r3 m& a! ^$ G6 X: {% _* K! P, N=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with
7 y/ `- E& d, D1 w+ D8 l' [  SoftICE while the option is enable!!
+ R2 ^5 K( J' J1 Z6 l  T. Z
5 ^8 d" e" C/ u) d5 |This trick is very efficient:
$ w& l9 A! X* ^  Dby checking the Debug Registers, you can detect if SoftICE is loaded
+ p: {$ u! x; B0 z+ @7 ^3 \(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
/ ^; w  i% n) ~there are some memory breakpoints set (dr0 to dr3) simply by reading their6 k0 B5 e/ F5 y& ]$ m4 }$ p
value (in ring0 only). Values can be manipulated and or changed as well
" g, c8 G+ A! J: B0 \6 P7 p(clearing BPMs for instance)( O- w( D9 G4 B0 l$ X! K% ~' b& |

0 |& u8 _; @( `& c8 _- Q( u__________________________________________________________________________3 B; E2 V3 [# Y+ o( {+ Z
/ k" F8 F% S0 d2 A9 I0 A. T- K
Method 116 V0 U( k" o- \( @% ^3 X
=========
1 d7 l. a0 D9 ?& x$ E1 P3 o% ~' Q9 R* Y1 q- V# ~* e) x
This method is most known as 'MeltICE' because it has been freely distributed7 f/ `1 U/ w' p' G3 `* d
via www.winfiles.com. However it was first used by NuMega people to allow# k) Q  w. e# ?" y' L7 I; C- q
Symbol Loader to check if SoftICE was active or not (the code is located* \2 c: C6 Z- Q# H
inside nmtrans.dll).
  u) o, C) ~  ~5 S8 M+ a
* g7 R) P) D1 C2 vThe way it works is very simple:2 E, n- e. P, [& e; y4 z+ m( W& p: F
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
8 m: t4 K: H. B) c1 G" NWinNT) with the CreateFileA API.& Q! ~7 S& A* f' N

# |. z  B  v4 x. g* p  `Here is a sample (checking for 'SICE'):
" b) i) S  `3 j( |8 s6 x/ b. z6 h8 {) G2 q
* M( v, W+ X& l) o4 ^. M  [BOOL IsSoftIce95Loaded()
% O5 \2 p" Y: s: o& D" X9 K+ e4 f{
' {" m: b6 F% G3 G+ r- [   HANDLE hFile;  % M6 h! Y$ @2 \+ q/ p. l: n3 U
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,+ N  l% w( f/ E' y3 Q
                      FILE_SHARE_READ | FILE_SHARE_WRITE,  h) d. ?9 }/ t
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);$ R4 s/ l. F: ]* W9 f& x
   if( hFile != INVALID_HANDLE_VALUE )
$ U" Q/ z+ w6 L5 g   {
6 [; K8 q9 Q- J8 ^1 ?% ]3 T6 j      CloseHandle(hFile);
9 ?4 y- k7 v9 y3 t* e      return TRUE;" t) c$ k) z5 `0 B, e
   }$ b3 t! \3 u. r9 W. a
   return FALSE;$ Z$ X! G2 G% u% l- o- k, R. h
}
  s9 e! y, w0 ~; h1 p, x, q- M' Q0 x1 n' u4 P4 U$ B
Although this trick calls the CreateFileA function, don't even expect to be
5 z% e' F4 X) ?9 Yable to intercept it by installing a IFS hook: it will not work, no way!& X- _9 a$ s6 M" M4 G) I
In fact, after the call to CreateFileA it will get through VWIN32 0x001F0 b$ D. X3 h1 \- t/ z) j
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
* h9 o8 ~' p3 Z& B, h6 Land then browse the DDB list until it find the VxD and its DDB_Control_Proc% P" \. J* E! ]4 g4 ^$ N
field., o& I5 S+ Q! K
In fact, its purpose is not to load/unload VxDs but only to send a
! W9 \7 R; d% f5 ]; q0 `W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE); ]8 q! V- ?9 t" ?
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
$ D) M- N# _. n; ~* }" Tto load/unload a non-dynamically loadable driver such as SoftICE ;-).- J7 t. F, w5 t8 q) z- ?( I
If the VxD is loaded, it will always clear eax and the Carry flag to allow2 z9 t, N/ ]0 n9 L7 F
its handle to be opened and then, will be detected.
  U1 t( m6 g. D$ l/ Q9 mYou can check that simply by hooking Winice.exe control proc entry point
, G+ X. _$ g/ k+ I8 Twhile running MeltICE.
' Z% y- T$ l" a% l$ }, [1 s- q5 d/ F4 M/ E& q+ K) |; E
6 W8 k7 m$ b- y
  00401067:  push      00402025    ; \\.\SICE
9 v( N5 i& w% d  0040106C:  call      CreateFileA
6 z% k" Z' b9 U  00401071:  cmp       eax,-001) f! R1 s7 ^8 s
  00401074:  je        00401091
$ j* k6 V( O/ }, B9 I) s  M' Q: l2 v. b  u
  d  Z" d7 B. h, I
There could be hundreds of BPX you could use to detect this trick.
% N7 q) I( v5 S-The most classical one is:* |9 @3 E/ a1 f" n; }
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
; X- _* Z# o9 |; s$ g; J! H! E2 ~% U2 p    *(esp-&gt;4+4)=='NTIC'
8 |5 V/ I& b5 m3 Q/ s8 B  y# B1 x# w2 L% E$ \+ z; K; F
-The most exotic ones (could be very slooooow :-(! P# q; o% B$ T! y2 d
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  
+ l) f% I! R* m# F4 }' z1 ~     ;will break 3 times :-(4 I& H9 b) Z/ u+ o( h7 M1 R4 V. V
( Q8 q$ }3 d% I0 ^, [- Y5 M1 S3 G5 v
-or (a bit) faster:
9 U+ @" b) @& _4 ~9 W# L   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')7 c2 S. J9 N& O0 L4 o' |# i) U
3 y8 U, p6 \1 s2 @( m) O( ~. Z
   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  3 k+ R3 S9 S" L2 o. U: I9 N
     ;will break 3 times :-(
( y9 F/ [% V4 `+ D4 T/ M3 n. i8 I- U
-Much faster:$ G2 S. `5 A1 c, `, D! i3 ~2 d
   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'3 Y! e/ N0 f8 `1 D  T

, Z9 m1 p. C: f% a0 m* kNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
* L0 ?+ D- A5 L! \- m) `function to do the same job:) e: |3 `& `, y
* J& Z& k( U) q0 B% F
   push    00                        ; OF_READ) D. f& W+ z8 Y6 Q: L! Q* J
   mov     eax,[00656634]            ; '\\.\SICE',07 f: s- p7 t% z# Z
   push    eax5 g/ c- S3 W( P( E6 z7 f
   call    KERNEL32!_lopen
; o& h) B" T, S4 ^! ~+ P   inc     eax
" _$ g  s, c, c8 \6 E   jnz     00650589                  ; detected
2 O5 I  \8 |/ d' \$ n+ ~   push    00                        ; OF_READ
1 K/ F4 ~# D4 G9 t+ x5 F   mov     eax,[00656638]            ; '\\.\SICE'6 f) F& q/ w* x% m. m4 h
   push    eax
4 b5 h0 `: g; R8 X/ t, k& m7 S+ J: N   call    KERNEL32!_lopen6 y5 `9 u* o7 ]: ~) n
   inc     eax
6 h7 E3 ^/ a9 [" |9 m; D$ ^9 I   jz      006505ae                  ; not detected$ @) U/ N+ C& D3 L, m+ Y

& ?8 Y0 }; J6 U3 F( t. R# M9 B4 k; q
__________________________________________________________________________
7 K* b# X+ w3 I# r7 V' L
/ B& u4 s9 B% g" g8 B! QMethod 12+ N2 ~5 n2 T1 s: I/ G
=========. [! Z" j4 u6 W- w+ Y( A  y6 q

# d! x* E% T. }" M9 c; X, g: YThis trick is similar to int41h/4fh Debugger installation check (code 05
2 D, l2 Z- D& K+ J! S7 O% ]&amp; 06) but very limited because it's only available for Win95/98 (not NT)+ K2 g, F7 u4 L7 I
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
* ?4 ^6 L: }8 f0 m) w- W7 ~: W6 P. y! _" y
   push  0000004fh         ; function 4fh8 o. [7 f( w6 [  m, n7 \, C
   push  002a002ah         ; high word specifies which VxD (VWIN32)
" [6 P; [( t& E5 \                           ; low word specifies which service% h: `7 F7 L' v
                             (VWIN32_Int41Dispatch)
# A2 `* J3 v6 \& [  H   call  Kernel32!ORD_001  ; VxdCall
% I( `6 t7 y3 U4 z   cmp   ax, 0f386h        ; magic number returned by system debuggers
# d7 C! H/ X7 p5 \- m& ~' m" I   jz    SoftICE_detected
% V/ \+ R0 n: x# n# ]
1 R) L8 A. C$ a' nHere again, several ways to detect it:
5 L+ L) Z5 b0 ]( S: I' `( f5 Z7 s7 I+ K: D/ R
    BPINT 41 if ax==4f/ d9 ~9 z( l" ]

" b; a7 Q* }9 n  U- n. B    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one
( s, s' J5 d0 }
. \) U# g* I% {8 w    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A6 C0 r5 q. X- x1 z/ d" {+ B

" W/ s1 [9 o. R3 r    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!
# N/ X6 b: Y* [" h) c! d
) W2 N# r7 I6 v: T+ G__________________________________________________________________________
+ d4 l9 i' y7 W& r; W% u+ i5 y9 d* W" a/ e
Method 13
) y* }6 w  ^" O: Y2 i0 u. i=========
+ V3 k* R3 |0 z- x
' T% E- i" I/ {9 u: ?8 z5 iNot a real method of detection, but a good way to know if SoftICE is& E) |# v9 f) t* d) c/ ~; Q6 Q
installed on a computer and to locate its installation directory.
  w% q* O6 a3 A4 F+ R1 CIt is used by few softs which access the following registry keys (usually #2) :, r/ O5 C8 Q7 G9 m; t
, ^9 Z& u/ R1 j- s' [5 x
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
5 t# b9 O& D5 {8 Q4 S$ S2 Z\Uninstall\SoftICE; p7 Y" l) i; ^. G) j; r" L( n& `
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
) |1 o+ ~* l# s-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
2 \4 Q. V. U0 X+ J\App Paths\Loader32.Exe
7 e% s' n  x( b; \& m' }
  o' d$ V& s6 E9 R# U7 h. \
/ K) M  {/ ^# ~* }Note that some nasty apps could then erase all files from SoftICE directory
! I8 J. y6 w# v. m(I faced that once :-(7 p# C8 A( p+ Q! x- E6 b6 H
0 R. p' B+ H6 z
Useful breakpoint to detect it:
( [/ P) @: b" \- c; C
) x; S! T+ c: R     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
# R& |' h( s/ Z& \1 O: D( ^4 B$ T# h. Q2 C2 k& d" @7 _3 N
__________________________________________________________________________7 h. o+ z$ h! Y3 B* r

* l! e) j* u  [+ D  A( P! d9 h9 H9 }) F  {
Method 14 8 k/ z$ n& _4 a% A
=========
: A5 D  S" |' b. K& K& A+ M  ?& |
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose- k- j4 o& ]& `: Q  c( Y
is to determines whether a debugger is running on your system (ring0 only).2 W9 O0 G/ }4 T) W4 {% u% v

) c  ?; R% I9 I/ C/ v' b   VMMCall Test_Debug_Installed- Q" J9 n$ ?  L  u
   je      not_installed
( A$ J8 c3 r! S  ^" b( W- N3 A& i% Z
This service just checks a flag.3 p. `4 d7 G$ T8 G; S- ]: S
</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关注公众号

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

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

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