About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
6 ^6 o1 k& Z/ t' l<TBODY>1 V4 J+ U9 \  }' |: I
<TR>
1 b& i- [! \6 m/ {# G<TD><PRE>Method 01
' Y" n+ X3 p* v) X" }' Y=========
7 u7 Q# y7 U, P4 |; K
$ W  J; B& j: g( y/ \& n8 f; tThis method of detection of SoftICE (as well as the following one) is, H0 A2 I  F) r( v6 [4 l; O4 _+ d
used by the majority of packers/encryptors found on Internet.
1 d% o( i# e/ I% v8 Z8 SIt seeks the signature of BoundsChecker in SoftICE
/ O) R! W+ x2 m6 S' D' ]$ \% ~7 k" f9 ^8 X* H/ {
    mov     ebp, 04243484Bh        ; 'BCHK'
  z" K% M: B1 W! @5 [    mov     ax, 04h
1 {( C+ _# F+ v9 f( _    int     3      
/ S! [1 C  O8 {    cmp     al,4
6 u, X. ~6 a) ]5 H- E4 b' G7 c    jnz     SoftICE_Detected# I/ o% Z" }- H, N3 ^$ O
/ b: K) J. D* i% N1 @
___________________________________________________________________________# P- w: y5 h0 k: t% D3 `" I
$ C  |9 P4 I, E- o
Method 02* p' w7 v6 a+ h" h
=========
; E4 C. x- x# F. V+ J' \. N
6 M5 S0 V0 s6 k2 d' [Still a method very much used (perhaps the most frequent one).  It is used
; U6 o# c+ u1 N6 u$ F7 }  Qto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
. u8 C# ]  G) y( g& wor execute SoftICE commands...! n9 [& @1 A! Y3 H# A" W! A( I8 s
It is also used to crash SoftICE and to force it to execute any commands, o0 j4 l% m. A
(HBOOT...) :-((  
( M& d: d6 k" [5 J0 T: g* w& D1 p1 ]5 U. Q8 L% i$ Y
Here is a quick description:$ \3 U$ [' g) X/ L8 b
-AX = 0910h   (Display string in SIce windows): U' O/ B' T9 T# m2 Z
-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)  ~" ^+ i- \1 u( D1 I; z1 t
-AX = 0912h   (Get breakpoint infos)
1 i/ l' T' `$ L9 Q* R-AX = 0913h   (Set Sice breakpoints)
5 b/ \# W  r% C-AX = 0914h   (Remove SIce breakoints)8 e7 d# h1 q( \

& T0 v1 A- V' O# |Each time you'll meet this trick, you'll see:3 P6 {4 Y, V' l! L. M: ~
-SI = 4647h
9 Z) o( j! p# T) U, \-DI = 4A4Dh, n' f- s; h4 \7 x. M- d
Which are the 'magic values' used by SoftIce.
  Z; S% G! ]% j% YFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
( c$ x; E2 ]1 ^4 o0 U( {9 Q/ ~
( t! e# v5 h6 uHere is one example from the file "Haspinst.exe" which is the dongle HASP
0 z& `2 b+ g  h  D2 |Envelope utility use to protect DOS applications:# u1 F: O7 r/ T

4 S$ n* _( t: w3 n7 \9 u( v) Z9 N  e1 z
4C19:0095   MOV    AX,0911  ; execute command.
/ Q7 p  L# Z# c, z7 Z5 @# s4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).- y7 V1 a' z# Z* `
4C19:009A   MOV    SI,4647  ; 1st magic value.' T: z1 t2 {. W! J* {: w
4C19:009D   MOV    DI,4A4D  ; 2nd magic value.4 L. S4 s/ M, [! I
4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)% B; d" h( y. K' x2 ?
4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute/ D% E8 s  K8 [4 K3 b8 M# u6 U% X7 {- n
4C19:00A4   INC    CX% D1 ^. H9 W" L1 {' x' f* h
4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute/ i7 y; [9 o0 I9 g0 R/ \' O% O
4C19:00A8   JB     0095     ; 6 different commands.( i1 H- d, @# D0 {
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
% A2 b2 q2 F" ?- h% L/ A4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)
8 ], \2 u3 v! d  _' Y5 n8 |
& i+ i8 c' T) x% a- Y4 eThe program will execute 6 different SIce commands located at ds:dx, which
6 \  W6 B, f& N0 J% }# u. lare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
  k8 z, [8 ]- k5 d: I$ R
1 D9 @9 X, p* }+ t5 x( G* d" X* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.! J+ e  L$ R3 U# ]' [+ o" d
___________________________________________________________________________
  V% A, c. {" s" X9 C1 |
3 X& u! c0 \  Y& }1 _. H. Q& ^" S
% r) |- T7 F; Z6 nMethod 03
3 M/ Q& b; a% J/ Z=========% V' ?4 P& \: w$ g4 \* ^

7 \* p' N" h* W, h- W' TLess used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
; u( |# S) g1 W$ |& i- a3 J(API Get entry point)
  `/ F6 g3 t2 M; t% P5 C        ! h- v; f! U( x
( I, j! y; ?2 _9 W; q
    xor     di,di* k/ e4 N! k( ?5 W( i
    mov     es,di
. V+ g# K( a! O$ B9 v    mov     ax, 1684h      
! {4 E6 \9 Q* T9 `4 O. o    mov     bx, 0202h       ; VxD ID of winice
; s: z# d4 F* T    int     2Fh
; ?, E' U2 [5 ~: ]    mov     ax, es          ; ES:DI -&gt; VxD API entry point3 Y* a; V0 D& ?5 ~' c$ b! x* B, o) q# y
    add     ax, di$ h  n# b1 A% T6 H( H0 C3 N, o
    test    ax,ax
: d& ], O! O: B/ F4 e5 y    jnz     SoftICE_Detected  u; l; V( S# d8 W9 }3 M- x% [9 z
& s# `" y. h' |: d
___________________________________________________________________________
9 @$ V9 T9 a( ^* M; [* x3 d: W: l5 M! [5 u- X0 j
Method 04
. b% _) w/ d5 b1 A6 w=========
* K  L% \, V; v6 ~$ f! n$ `7 }0 ~( `5 o0 J0 w
Method identical to the preceding one except that it seeks the ID of SoftICE. @5 I& x5 Z1 o- z3 O( [
GFX VxD.+ f) [" Q# c% i

7 \2 Y2 ]% |2 ]    xor     di,di
) v0 y) Q3 B* L  \& R- _) i    mov     es,di4 O* T7 u7 l) ]$ W4 I
    mov     ax, 1684h      
: l% \; A3 a, @    mov     bx, 7a5Fh       ; VxD ID of SIWVID
$ _9 G5 v  m/ V, H  P0 t    int     2fh
0 r( e+ v6 |0 V/ F7 T: o    mov     ax, es          ; ES:DI -&gt; VxD API entry point
: Y6 x, k+ ]# K, |5 [$ K    add     ax, di- W+ \7 d8 w5 P; X
    test    ax,ax
" b* T8 `3 \" j) t2 G  q5 s! ]    jnz     SoftICE_Detected
! S/ ?: w3 \6 L/ I1 g& N9 k
3 P+ ^! p3 C2 s- U% q9 A/ V; s6 }( h__________________________________________________________________________
0 C8 f7 ^3 a8 D& j( R2 }0 s$ l% X1 |9 a
# L1 z) u# s. t/ e
Method 05
  C  m$ x" h* F. B# a7 }" }) ~=========5 d7 Z# q& l+ x* C2 `: @/ G
8 y8 G9 l0 J9 t$ h5 l1 h* Y1 {
Method seeking the 'magic number' 0F386h returned (in ax) by all system
: W/ j0 ]0 X7 z9 w3 z: Sdebugger. It calls the int 41h, function 4Fh.6 i9 D. V% l* l3 ]0 s
There are several alternatives.    P2 N) i) q  I& j2 R+ C' F7 D3 }

6 V1 X, ?( p3 a; _8 dThe following one is the simplest:0 V* B7 n) F# o9 ?% X( ~

# B3 W( |0 f- [6 H    mov     ax,4fh
5 K' M2 A; y+ U/ k0 b; ^. V    int     41h4 v) T( ^8 v! Z  E" f5 }
    cmp     ax, 0F386
, [2 q  S' _+ J; A/ k$ u. J    jz      SoftICE_detected5 B& @$ @+ r# {4 e! {3 u* _- d

0 j: v1 \6 D0 \1 ~$ y; Z
! Z6 O. g5 l; `; ?: nNext method as well as the following one are 2 examples from Stone's
, J. |/ N- m* B"stn-wid.zip" (www.cracking.net):2 `- Z; x/ d/ n
: |# C1 T! f  B3 P
    mov     bx, cs
! u$ Y3 l5 N( I/ i    lea     dx, int41handler2
. o# l! P8 f2 m  Z9 k: R2 @    xchg    dx, es:[41h*4]! @! Z( a7 O% G0 i$ ~
    xchg    bx, es:[41h*4+2]
: g6 ^. H+ M) j  Y+ Z& \  [/ [    mov     ax,4fh- Z/ P: \. v2 y1 `3 P1 Y0 h
    int     41h; a: u2 p) r) [/ F2 P  Z0 O
    xchg    dx, es:[41h*4]4 o8 S- ]6 e. k; ^7 s
    xchg    bx, es:[41h*4+2]
- c9 ^# |* J. S3 l5 Q. i    cmp     ax, 0f386h
9 X6 q  a- E/ S  ?  U/ V    jz      SoftICE_detected
! C7 f6 k+ P; g1 J0 X& u1 h, K7 e- G! L5 `; N+ }- {
int41handler2 PROC
" K0 C6 Z: b2 g    iret
$ G# t' P0 `1 u" E0 r3 Hint41handler2 ENDP
0 b9 ]( N6 {6 Q+ V2 ^
* N6 T4 A" r$ l5 y$ v% t0 Q, z2 g" X- M) `
_________________________________________________________________________
. O4 K2 l+ P* s# M/ Q% a
( j0 z' E1 z$ Z4 Z
1 E# }' M0 g1 B3 MMethod 06
- A$ H4 I+ V1 ?& x- h=========
. f2 f1 i8 G' z0 R! W4 u* b3 e# h5 {* v, V# @( ]% |
+ Y$ C" X7 t& ^( d0 F
2nd method similar to the preceding one but more difficult to detect:
1 m0 z2 B0 k. C8 Q+ }+ l* U7 ^! ~
$ ^0 x+ y& U0 [* q% \9 |+ i" B& T" [. r& m7 y- r) w
int41handler PROC
8 j3 L0 }7 g. F    mov     cl,al
0 ^' F/ r2 [: K    iret
7 {5 z  `1 Z1 Z8 o; _, U: ~5 Hint41handler ENDP
; y! T$ V' A9 j  Q( E  q, s/ O$ L$ ]; `% h' A

) d- E; V6 R6 w* Y' Z& Q" ~9 Q# x    xor     ax,ax
6 a( l4 y9 z! ?    mov     es,ax5 b/ e' U8 |! \3 S
    mov     bx, cs
5 u" I9 n+ Y1 C2 j8 L4 h2 |. |$ C% R    lea     dx, int41handler" ?  u6 ^* w0 }/ W3 N
    xchg    dx, es:[41h*4]) E1 @9 i2 p% v  X6 C
    xchg    bx, es:[41h*4+2]- G* i- p& G( V" V4 e
    in      al, 40h) _1 U, U1 A# t$ K' V
    xor     cx,cx
2 L1 p5 z7 Q$ \* P% |    int     41h
4 V! X' l7 g+ F% i7 A0 t" N% O0 [    xchg    dx, es:[41h*4]
+ Y2 _5 h9 f7 |    xchg    bx, es:[41h*4+2]; l: u/ F$ M& h  p, a
    cmp     cl,al; q: V6 N+ P# n6 h/ g3 e
    jnz     SoftICE_detected8 X. b2 n9 k+ j7 O! f$ A

# `6 V" N, k. t  i_________________________________________________________________________! Z' a! s& b" @, Q

; t4 E3 q' `; ^; }: MMethod 07
: e4 ]* p- F1 Y2 r  ]=========) P8 C5 o' J0 u/ G

' y/ ~( c$ s" F; z# `8 hMethod of detection of the WinICE handler in the int68h (V86), b/ Q! T9 b4 O) f* l, ^4 v6 v

( T( i) [8 g1 O0 ^. N    mov     ah,43h$ d0 Q" {+ ^9 C. @, \) \
    int     68h% i$ Y& G2 b5 f; F4 M* U" @
    cmp     ax,0F386h& X8 r1 C4 u' p7 a
    jz      SoftICE_Detected: D+ _/ n- Z# H! H# @* z
+ Z$ p. B* a- a! D
8 i8 a) i$ v8 G: i3 W9 z
=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit' c; R6 |6 R! N
   app like this:: q7 V1 A# g* b0 N3 L; F7 _
6 y" b6 q3 {- x9 z* }
   BPX exec_int if ax==68
# z- T; {9 @1 V4 F3 {   (function called is located at byte ptr [ebp+1Dh] and client eip is& F+ Q3 q4 e; p$ C1 _, l; f
   located at [ebp+48h] for 32Bit apps)
" Q. z9 B) k# ]__________________________________________________________________________
$ D/ w1 [" j& X! s% r4 d9 |6 `6 d! T4 ]% b& k& _5 n. M

  O  w' P- C; D; OMethod 089 Z/ W4 h: m" G$ }; Q& D. x5 C
=========8 L) X3 N' [: d( r3 [

" }' T4 T' r/ q' W% `  N8 XIt is not a method of detection of SoftICE but a possibility to crash the
# T5 Z1 o$ h; `' Y  r2 w( Bsystem by intercepting int 01h and int 03h and redirecting them to another
  y8 z$ t7 Q" @0 U' y+ broutine.
1 j; M0 Z4 U9 NIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points8 G& I8 R' E5 s
to the new routine to execute (hangs computer...)0 M1 n. ~% E0 ?  t; l

( T6 i# R5 ]9 o' C! ?3 I1 U    mov     ah, 25h! [" r! f/ v7 J# N! }3 P
    mov     al, Int_Number (01h or 03h)
7 U" n& ^) ]4 U) T1 U1 l4 `    mov     dx, offset New_Int_Routine/ _  n$ @) }& [0 ]8 H  f
    int     21h9 c9 D  v9 m( d1 A2 o  A. x
( w: G# b6 D( [) X
__________________________________________________________________________' b% L" f$ |; l, C

8 K# e& H5 }: K9 ~1 h% T4 qMethod 09% j7 Z+ h- i. J, y7 T+ n6 Q% @+ b) r
=========
: H, F; L; _- L6 k$ D, f& y
8 V  z- W+ m! k( V% [This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only! C: \. C9 Q! b0 W% h
performed in ring0 (VxD or a ring3 app using the VxdCall).+ @$ b, B7 g' T# _: X
The Get_DDB service is used to determine whether or not a VxD is installed
. G  v2 n  G1 V" _3 H8 d/ Pfor the specified device and returns a Device Description Block (in ecx) for2 O* }' _; q, _1 q9 F* N! z
that device if it is installed.+ I  }2 E# w4 W" k# l$ M1 M

9 _5 D' A; r, p* ^   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID
* l5 a% x' l( S1 e# X4 H   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-), O+ f7 v2 J/ L# Q8 T
   VMMCall Get_DDB* t1 X9 r! A& g/ _% C) @
   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed
0 [- A- A: w4 p0 S1 E! ]- X5 U6 m3 S% V  ~3 f+ B  r3 g$ m( c# i
Note as well that you can easily detect this method with SoftICE:# _! Y! F, A6 d$ D
   bpx Get_DDB if ax==0202 || ax==7a5fh
: E4 q; s. r+ w$ ]2 D6 R  X, F" |6 Z, i* ?/ @& Q1 o5 Y5 f7 r
__________________________________________________________________________
3 e7 I0 |9 ?) g* L# Z1 h# M' y) K+ }! |% A8 X* l3 d3 B  {7 ?
Method 10
" F! z6 r; f, L=========6 k: R6 @: i) C. ]

0 @% d# h  Q" u=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with* C# ]$ N, q8 {' l: b" z! A
  SoftICE while the option is enable!!3 h% z2 V& O2 _5 g
$ |, [) P* }9 n, r9 b
This trick is very efficient:% z+ \2 T# ^0 C. [2 y, V
by checking the Debug Registers, you can detect if SoftICE is loaded
+ U0 F8 s+ L( a! _" R" K(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
, V: H: J& k$ J8 s* s% ethere are some memory breakpoints set (dr0 to dr3) simply by reading their
/ K1 y8 Z) Z/ b, ~) n# M9 uvalue (in ring0 only). Values can be manipulated and or changed as well
* y  L! v9 X( t; E(clearing BPMs for instance)
% p( C  G. H  N; ~" i3 ^: u4 O3 Q
% }& S0 {) i8 m/ n- x. @7 w__________________________________________________________________________
8 t! F9 R" D+ f6 t# D) u7 C; g3 O6 T4 r3 Y. e9 E3 `
Method 11
  s9 ^2 \: \. D6 f7 M  `5 [=========
) A0 X! D4 z, z& M7 n3 X0 ~1 q) o$ d- ]) N9 \, L
This method is most known as 'MeltICE' because it has been freely distributed
* ]+ G' ~* c# U+ T" B- i- I7 |via www.winfiles.com. However it was first used by NuMega people to allow$ f2 H9 d- r' E5 w0 K/ O7 U0 _
Symbol Loader to check if SoftICE was active or not (the code is located( P8 ~  x. J, j; k* X+ T- h/ o0 \
inside nmtrans.dll).' E: t) m2 f4 p

/ R' g" u& x& K; P. I& @* CThe way it works is very simple:  z  m# O% ~) k' l
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
# V% m. q) R/ s" H, fWinNT) with the CreateFileA API.) Y* A# ]3 ~* x! i) f7 @

& b0 ^! T; ^) a. b3 cHere is a sample (checking for 'SICE'):
/ z. m- C+ U8 |' R/ g
3 z" _+ Z0 t$ |+ y, p6 m% \BOOL IsSoftIce95Loaded()1 Y3 h1 Y2 \' F8 @- ]4 [" K% v+ W
{
! X# f2 v) n# `6 K4 M   HANDLE hFile;  
" P7 p8 g7 H$ |. L: X$ I+ y   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
* b( g- r' o% C) z5 k6 N  l                      FILE_SHARE_READ | FILE_SHARE_WRITE,+ u" Q+ S+ a* D  e: O; Q/ a9 a8 Z
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);6 g3 W7 W% v7 W+ ^- J
   if( hFile != INVALID_HANDLE_VALUE )
. Y: F5 ]: o. J3 L1 W   {& v: Y9 b' u- R: B# e% u
      CloseHandle(hFile);0 v; q) m  [9 w8 X' Z. T- r
      return TRUE;
9 a; C8 H. Y" a) w8 Z! d; w   }, C7 B# _& a0 J; u, k
   return FALSE;
2 T2 v0 H9 M  \' f9 q5 f}
( Q$ R7 \  [4 d: \
: o3 g5 T6 Z: mAlthough this trick calls the CreateFileA function, don't even expect to be
6 ?+ J- J7 q% z/ L( p9 gable to intercept it by installing a IFS hook: it will not work, no way!  u- T5 V; s/ c* A) a
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
$ V) F% I1 X' k- qservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
, b$ {, A9 U& O& l% j+ ^and then browse the DDB list until it find the VxD and its DDB_Control_Proc+ _, {( Z  s# {# ?7 ?0 O
field.
) [" A( O. }( Y; Z+ gIn fact, its purpose is not to load/unload VxDs but only to send a % b# a! [; K$ w/ k0 n
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)7 g, W( F; u( k# ?
to the VxD Control_Dispatch proc (how the hell a shareware soft could try4 _) v( |$ X8 E
to load/unload a non-dynamically loadable driver such as SoftICE ;-).* C: _$ I' Q+ A. @* v; q. Z4 s
If the VxD is loaded, it will always clear eax and the Carry flag to allow+ U% L( K7 K) J, y
its handle to be opened and then, will be detected.& W( g7 ?3 r8 ^8 X8 u, T0 o
You can check that simply by hooking Winice.exe control proc entry point4 v6 b5 ]( u3 i5 J8 m6 r, y
while running MeltICE.
% b: X3 V  O7 B$ \$ X1 i. y) Q( Y7 h7 [3 O0 R4 [  M3 V* G7 R6 w6 j
0 s* X: F6 J2 @: ?( C
  00401067:  push      00402025    ; \\.\SICE
8 k2 m% V7 T: Q( d  0040106C:  call      CreateFileA
; Q! t6 K, d% I) ?$ J% K  00401071:  cmp       eax,-001
+ I5 B" i+ C% ~0 k  00401074:  je        00401091# \' _. M: \# P  P
# C& L. ^- T8 d' ?! X( [

+ T* u2 _* W% x- h2 SThere could be hundreds of BPX you could use to detect this trick.2 C4 ~5 n0 ~' _( W# b
-The most classical one is:, M' }$ V* _2 t  d) Y9 g
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||% [: ?& i( _% l/ O  A+ y
    *(esp-&gt;4+4)=='NTIC'
$ l$ I" a# f" f, o4 Y
# d5 e3 o+ |) j8 C/ x-The most exotic ones (could be very slooooow :-(. ^2 _- {- |9 r* ~: n( S
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  
! H  }0 R/ ]9 K* b' ~3 [( ~     ;will break 3 times :-(8 U- x$ p% q! {) j
5 G- V! Y& |% U
-or (a bit) faster:
2 W- t) ~9 j2 M   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')! M" n$ f4 u9 M9 g) p- \0 K4 e
9 ]: L6 i% H! _1 c9 S; g+ ?
   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  3 e! B& \7 [/ v) q
     ;will break 3 times :-(
7 k: \$ \" Y0 e0 p' Z: M  ?& N# z& x" Q$ p4 n& q; F* \
-Much faster:
% H: C; I- z* p) S- W' B4 H   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'
1 P; C5 _7 Q8 z% P2 D' z% r+ T, Q: c  {" H( t+ D
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen+ \) C  [& ]4 ^- O
function to do the same job:
2 d( k$ _: D, G7 {6 F7 U/ P; [/ a5 ^( t5 R
   push    00                        ; OF_READ
; X- j) N! Y. R3 B   mov     eax,[00656634]            ; '\\.\SICE',0' w- H" \; k$ Z; h6 l. c
   push    eax9 t% k& b0 A: K2 B7 u6 P* ]* {7 e2 Q
   call    KERNEL32!_lopen
$ _0 p$ e- b; K   inc     eax# N3 i" Y- V. f& u  o- p
   jnz     00650589                  ; detected& {3 N$ L+ j* u. a' n; s, \, ], m
   push    00                        ; OF_READ
, f7 B( ?1 Z, K3 s* T   mov     eax,[00656638]            ; '\\.\SICE'
( \/ V6 p! R+ c5 g5 P* m9 r4 C8 h   push    eax) f7 J# W* B9 X; e0 `
   call    KERNEL32!_lopen1 W$ v+ i4 L# S. Z% a/ R; e" a
   inc     eax3 a0 }+ P% v8 Q+ ]8 v0 `& a
   jz      006505ae                  ; not detected
, v5 _! J# d! ]: C/ T  _4 \, @/ i7 @' p- s! [/ c3 X
0 F, ]6 ]7 }  r5 C7 M
__________________________________________________________________________
) N0 P+ |5 Y4 K/ k* c: k7 O
- Y0 E9 k  [/ N. P2 wMethod 12. u: e; M' X+ h+ h+ N
=========
: N. x( C  m8 t7 A" d1 I4 N# F# p
7 l: k7 R0 }. ]1 p: W# U. F2 gThis trick is similar to int41h/4fh Debugger installation check (code 05
0 |/ ?* `) @$ A0 ]- m: D&amp; 06) but very limited because it's only available for Win95/98 (not NT)  v3 `7 S- O1 o; ^+ [6 I, g. j
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.0 ~- ?+ T5 h+ B8 y( z
  O6 R5 E4 H& ?4 |$ i
   push  0000004fh         ; function 4fh/ Z1 z9 g4 k, U, l0 }
   push  002a002ah         ; high word specifies which VxD (VWIN32)$ M$ O5 p& ^" @
                           ; low word specifies which service1 `" I+ G7 Q3 f! G* W( F1 _
                             (VWIN32_Int41Dispatch)* J* ~! P  r& F7 u
   call  Kernel32!ORD_001  ; VxdCall
8 w' S& ]: N, h( ~   cmp   ax, 0f386h        ; magic number returned by system debuggers
) w9 c( [$ D: A2 L, w- ^1 J6 G+ k) x   jz    SoftICE_detected
# y" L. W/ n; O- n; L0 c3 U2 P) S- Y7 x2 Q) R# h
Here again, several ways to detect it:: e# R) Q9 e& H/ _% F1 M8 i, U

$ B7 D7 j" G; w& S' T/ J2 B0 B    BPINT 41 if ax==4f2 E- _8 H' s( N# b3 i3 j+ g: S

( m* `+ \' j/ X    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one
3 V  q6 w/ r, I5 M7 |% A0 W# J
& K7 h. x5 X* [3 |    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
6 ^, a8 w8 ?  M4 P, b$ r4 L8 ^1 ?& s1 z2 [- B* L" j" Q% ^
    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!9 F& t1 O( M+ Q/ }' I$ V  k8 k
9 g6 {# }( @+ H+ ?  @9 U$ A+ O+ K
__________________________________________________________________________2 m9 z' m' r0 }; [  m
: j( L' N& |: @, U* [8 d
Method 13
- J+ L5 w8 o! y; l4 n=========
$ v) o7 l, A+ @' \
1 _. A8 S1 F. B& m& L! q2 {. ONot a real method of detection, but a good way to know if SoftICE is
) x/ j4 h# w8 _1 V5 J  C# Winstalled on a computer and to locate its installation directory.9 H; H0 v6 @; p# N( E: o( M
It is used by few softs which access the following registry keys (usually #2) :0 k! s& Y5 t$ p3 @7 k) x
# Q9 Z6 \7 @5 k" v1 ?2 x8 ?
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion8 Q+ J2 i4 S1 p7 p$ k1 V  q; e
\Uninstall\SoftICE. \8 B5 ]1 U7 G; P" e  I7 o
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE- a+ g1 V8 {$ s4 c% c1 C
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
7 Z. R$ q- r7 ?) }\App Paths\Loader32.Exe
$ `8 C7 f9 b( {2 b! d+ T2 `  X( o- V0 e6 v6 d' D) C* K3 k* H& A+ ?

2 ]/ A+ m/ q9 ?6 R; G$ XNote that some nasty apps could then erase all files from SoftICE directory
8 j, J$ `6 ^: P8 G7 G(I faced that once :-(
! n4 l* ]3 J4 f  X+ K6 X; m
- s& |# t* m: L$ w* l6 _# WUseful breakpoint to detect it:8 e9 J: t; R; c0 }3 p. i: v+ }4 ?

: e3 Z6 \2 a5 C4 Y, q& k* j     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
2 \' z! Z$ F" B( l1 V1 P' V3 Z9 M3 M* E" T1 A" }  O; S' Z( R
__________________________________________________________________________
, ]5 ]/ N0 g8 E" [$ m' s3 Z$ h% U+ u: y2 r

+ B' I; L- n% _Method 14
: X/ r  R( c' {; z=========
3 j! a8 X, n/ O: l; t! f: H6 t) S6 w
2 `6 p9 ^7 K: M+ `5 k/ [A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose& M$ z2 w6 x: C! D
is to determines whether a debugger is running on your system (ring0 only).
2 k4 ]0 \, l8 ?5 u6 B% [
6 i! K# q! L6 n8 \# D. O   VMMCall Test_Debug_Installed3 C; a/ r& }' t: \9 F) A. y& W( N
   je      not_installed
4 N5 B6 i# p) d$ ]6 x; j" k4 J0 J/ ?  k% e
This service just checks a flag.. O  ]/ A0 T8 N0 x9 _/ _; `9 E
</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关注公众号

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

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

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