About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>/ W0 H0 T& r$ }1 n7 h' O
<TBODY>7 p% G7 E) I. m+ y7 C. n
<TR>
0 u. J. X% R) c  f<TD><PRE>Method 01   r; i/ C0 n, v+ V
=========( P& D% i' |/ z& m' K

8 R& x' O8 \: R( b+ PThis method of detection of SoftICE (as well as the following one) is
# X: t+ u1 i0 w. u& Dused by the majority of packers/encryptors found on Internet.
! p5 p3 O- ]! K6 B, `# qIt seeks the signature of BoundsChecker in SoftICE
5 l3 @" H/ R% `3 ]( |8 a/ q0 N* @+ u# j9 Q
    mov     ebp, 04243484Bh        ; 'BCHK'
, E# j+ Q5 M4 C* A$ d    mov     ax, 04h
# K: E8 Q: S% ]; l  [( u; S    int     3       ; X3 h& _8 u% j
    cmp     al,4
3 i" |  ~2 C0 B  e; T. U0 J    jnz     SoftICE_Detected9 E  G5 H7 A2 L
/ Y1 t6 l  {1 F+ Z& ]. U' B9 h
___________________________________________________________________________
; r; \" F1 T" R* O' |4 p
9 g/ G  K. _- h. ^4 }/ FMethod 02
4 K; X* ~" N: D- e" ^=========& s+ s  ^- N+ R1 S& v( Q0 I+ R
9 n7 C7 s) ]5 {* l
Still a method very much used (perhaps the most frequent one).  It is used- u6 H, a8 R, T; d$ F+ I- e
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
4 h* j% d9 W4 q/ {or execute SoftICE commands...: I) e$ t6 {: p8 T. g, ?
It is also used to crash SoftICE and to force it to execute any commands3 E3 [# j8 s4 A
(HBOOT...) :-((  . }7 _( O: W& [6 m8 X; b
* @2 j. l& W/ a( _$ |& `
Here is a quick description:
, t* m4 g2 ]4 {6 |" _1 _! B( i. Z* C1 l-AX = 0910h   (Display string in SIce windows)
0 U' ]1 v( G6 U8 `% ^2 ]-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)
8 w& V' q9 v: S) Q! T-AX = 0912h   (Get breakpoint infos)
" o8 S; c1 H4 \# y, w-AX = 0913h   (Set Sice breakpoints)+ V3 x1 v. L9 q' D/ J, U* f4 I
-AX = 0914h   (Remove SIce breakoints)! r. ?) P9 {5 d6 H

# W  h9 Y; L  bEach time you'll meet this trick, you'll see:3 I& Y6 U7 ]* C' U0 Q6 X+ e5 n
-SI = 4647h
1 k1 M8 j; a7 i( G- {8 O. h' y-DI = 4A4Dh
+ O) }' Z& R+ H, NWhich are the 'magic values' used by SoftIce.
" U/ j9 ^2 x5 b& R/ LFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.1 t* F" j1 {+ n' k

3 d/ G2 s* A/ ^% o" T) EHere is one example from the file "Haspinst.exe" which is the dongle HASP
3 C4 `/ i) k" I/ `Envelope utility use to protect DOS applications:; ]% b/ M% `5 r! {- y
0 `  T1 T  r% g4 q: r6 j2 l/ }
8 v. Z! X, v/ A! `1 Z# o
4C19:0095   MOV    AX,0911  ; execute command.+ D2 Q( ]4 `6 [' S0 U
4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).4 g0 v. i: W; s/ G7 X
4C19:009A   MOV    SI,4647  ; 1st magic value.
; m1 l" y, m# Y- o$ C. k4C19:009D   MOV    DI,4A4D  ; 2nd magic value.
- @" s9 H* E( r4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
% o, R5 |5 ^% U! e4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute4 y( e6 p$ T. D" R
4C19:00A4   INC    CX
$ l9 `! V) Y/ h8 H' t' ?4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute
3 m0 _0 m5 }7 w4C19:00A8   JB     0095     ; 6 different commands., S/ b& g, u4 h8 I3 F/ o
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.- k8 O4 a! m0 e6 [
4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)
6 C+ c1 m" H2 ?/ o% a* M* z' T0 o% r8 `7 R1 d
The program will execute 6 different SIce commands located at ds:dx, which% W; V+ i+ D3 W3 E% v
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.' @, y# i% U# M; e( H" ]
) b; [" h0 ]- I
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.% m8 T9 v3 W& a. X- p# Y3 U
___________________________________________________________________________
" }7 S8 u+ L% {0 M  T$ D. z1 F% {/ z% K

1 x% m3 z5 d, hMethod 030 @% g& ^' m9 M
=========
; v) J1 ^- g- x( `) S" O* o8 K7 V9 L5 P& l7 n/ n3 D. Z9 u1 p/ M3 p  b
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
. h) z9 L$ X8 u6 W(API Get entry point)/ y- u' H+ u8 s0 I; v4 ?
        ' Q. X+ A5 U$ d/ P2 X; R: @3 i. B

8 o" i6 u/ j& S    xor     di,di& ?! f$ K6 [% p; V& C
    mov     es,di
# c: f: Y: e2 k    mov     ax, 1684h       * k( J8 E, |% G
    mov     bx, 0202h       ; VxD ID of winice
) @0 l) _( C* a6 E: h    int     2Fh
" c) c  R. \/ c+ w* n$ Z1 C4 g4 s    mov     ax, es          ; ES:DI -&gt; VxD API entry point. L  r8 U) v# l/ K& S+ h
    add     ax, di" J6 N8 \2 ?( M# i
    test    ax,ax
7 `) y1 ~+ u2 m; V  O    jnz     SoftICE_Detected
5 x8 D6 v! P! M8 L/ Q% e: S1 J* _  a2 k4 j, d
___________________________________________________________________________
' d! W1 ^- d* W1 M! ~3 O* O$ i- _- F& @- B3 O
Method 04# ]3 ]6 u  |9 q5 K& Q9 ?# v
=========2 b+ C2 y+ o, [, B" }% E

8 W/ A, y& m" e; w2 g0 TMethod identical to the preceding one except that it seeks the ID of SoftICE
' s9 q5 n3 O# {  m* MGFX VxD.
' W6 n& ?) Y# }& l3 w+ Q, a5 ^& f
5 e, Y+ ]3 \6 x+ W; o% _! @6 Z    xor     di,di* L0 M' Q/ n7 p: S( k
    mov     es,di
  E- l- d2 p0 T3 w    mov     ax, 1684h         }/ d; x9 q# R% Q! Q1 k2 _% r
    mov     bx, 7a5Fh       ; VxD ID of SIWVID
! B1 Q- K: W/ n9 ^. a    int     2fh
' s( k1 q2 q9 a2 v, {5 f    mov     ax, es          ; ES:DI -&gt; VxD API entry point
( y9 \( [3 C; M% L3 f3 i3 ^    add     ax, di
, b& {- `8 Q' B! G' g    test    ax,ax- l( e5 n6 _! G  E% @# ]1 a' w
    jnz     SoftICE_Detected
$ J2 U6 x7 T8 ^) ?* g* q1 O5 ?/ E: N0 ?$ e6 V# x% T) g3 M
__________________________________________________________________________! ^8 o9 h& D) M

; A+ Q4 ]0 e$ p4 o) K8 ^& ?1 L
1 E" h! n8 _7 V( HMethod 05
2 Q2 w" i9 T% h, F4 I* W=========, E4 O$ Q- B. K' n6 d9 f

$ Z$ [( G  o6 T# j, `! z3 oMethod seeking the 'magic number' 0F386h returned (in ax) by all system
1 K8 p* U9 o) D: ?0 a. g7 E& fdebugger. It calls the int 41h, function 4Fh.' h% h: @" i9 y  ^  L2 r! }; d
There are several alternatives.  3 H$ S+ ~( n. q9 F# P: l
8 C6 N) Y+ \8 t# Y
The following one is the simplest:. \$ v5 }2 y& u9 m: N
  |; D$ }1 S  d
    mov     ax,4fh
+ |3 R! t2 t- z1 k4 J    int     41h
/ @: S" e- Z8 Q( b( e9 [- m    cmp     ax, 0F3862 z" y% ?0 {$ h1 M! h
    jz      SoftICE_detected
1 r8 P, s& C+ [% J
, @9 z& @  l0 R. t3 _  Q  @! ~% K3 T2 E- u, A- s' l
Next method as well as the following one are 2 examples from Stone's
  e4 K8 k* J( A0 @" ~"stn-wid.zip" (www.cracking.net):, H! k4 I% `5 ~4 D& [
. V# E/ z' \) _
    mov     bx, cs7 V5 u1 h# D& v* {0 a/ {. j" z
    lea     dx, int41handler2
# U2 R% T% c1 r' C" M& D3 B, |8 O    xchg    dx, es:[41h*4]) e' L( }) t$ R; J3 N3 g: L
    xchg    bx, es:[41h*4+2]
1 P$ d, M! i/ q% z6 [0 j    mov     ax,4fh. n  {, p0 Z9 O; ]% [
    int     41h! `3 i/ `* @6 }+ G$ V
    xchg    dx, es:[41h*4]
% f! \5 u2 j) j+ ]  m    xchg    bx, es:[41h*4+2]
) f# H2 f. N4 ]) R0 U& x    cmp     ax, 0f386h9 [2 I/ Q7 f0 J! Y: h# k, d+ P
    jz      SoftICE_detected
" D# y0 p0 c+ h
& S6 F8 }2 @, e" W  F+ C# Fint41handler2 PROC( q" j5 d3 @) J9 {& c( J
    iret
9 a. S- E1 f- c$ Dint41handler2 ENDP
7 M+ W6 ~# t9 M5 c8 ^3 H( n8 V" z
; U2 C& J2 S0 V, Q9 p+ q/ c1 F6 i+ u
_________________________________________________________________________
; L& s  r1 }& q1 r% Q# E8 x- u. R1 Y1 P& z

$ O- ^) J" N) |Method 06; Y- z- C/ A1 U! A" \- [/ j
=========
* a/ A' e" p% @# S6 `* L) a  y3 D6 q! }9 H5 P

  `9 d$ K5 l% ^: v2nd method similar to the preceding one but more difficult to detect:
" S) x) Y/ Z% L. X3 R7 ^9 |1 S1 m  F, J2 {5 J% _) ]3 M; a4 p

1 ^8 b1 a% u2 d0 F& R' R7 o# d* ]int41handler PROC
0 o2 X. i6 [. P6 [$ i    mov     cl,al
5 T1 R6 |% `% L    iret
" ^2 @1 t; p. {& D4 \int41handler ENDP" Q% h1 r6 Q: Z1 z

( [* B1 E3 v; J8 K+ Y8 O6 s" q, W- |
. a& x- u6 k7 @8 O& g' b; h    xor     ax,ax
0 ]; r4 w) g' p3 {* W* z' g    mov     es,ax
3 o% l9 o& c: J+ s9 K+ B    mov     bx, cs
& i+ o* z8 C3 a; d    lea     dx, int41handler7 D* O) R1 C. w9 I% n* T- N
    xchg    dx, es:[41h*4]
) C" R4 x" U# `+ Q" x4 S    xchg    bx, es:[41h*4+2]. R; Y3 o7 p% k* K( n# z- N8 P
    in      al, 40h# _( m' ]  x" @) T% v/ W
    xor     cx,cx& F5 J4 \, E* w/ R* x
    int     41h( n7 F6 U/ Q: J0 b. q; t' D
    xchg    dx, es:[41h*4]  J' |9 f  X/ m& r* _
    xchg    bx, es:[41h*4+2]
; G, c* b; F; G$ D$ l7 S    cmp     cl,al
1 E5 s: e  o) E) a& ^4 @# r4 c1 K: s    jnz     SoftICE_detected: F% F7 h8 Y* @
: m+ d, D! _$ [+ D" ?0 L
_________________________________________________________________________
" `  h3 d/ Y8 z5 j2 {8 n# |4 I6 k
: Z2 x$ r: ?' w9 f& D4 AMethod 07
4 H- w% e# U1 Q/ h3 L! {' t! {; t=========
5 o2 Q7 q5 ^7 L& V6 e4 K1 p- ~3 s- }, x5 h0 T
Method of detection of the WinICE handler in the int68h (V86)% p8 z) k/ J$ f$ h% R  f# w/ F
1 B/ K* Y3 y0 d$ |. r" ~8 L3 Y
    mov     ah,43h
1 u, ~0 H( t( g    int     68h1 K3 v* V  ~9 {
    cmp     ax,0F386h
6 N+ c) J9 L' e2 m3 i) j6 E& B) o    jz      SoftICE_Detected2 p: K* d: [8 k. ?+ @  O; ^

/ H, Q) i+ S! Q) b3 z1 i) T
! h! f/ s3 y6 E=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit: R2 O3 i$ s+ v9 [! D
   app like this:
$ h( I/ R, E0 n0 B& [7 r* ~1 ~1 A: {6 x+ O6 K
   BPX exec_int if ax==685 q% b- s# P5 ]# {+ z( }
   (function called is located at byte ptr [ebp+1Dh] and client eip is$ p8 w+ I6 Q& s
   located at [ebp+48h] for 32Bit apps)
5 t9 E# c7 s* ?# C8 G__________________________________________________________________________
& y+ ]4 J) g" F& x: ^% ~1 c5 K( c* p& l. d8 `/ b4 B; t  O
; V: n9 s) e$ _; X" p1 h
Method 08
" p0 ?5 _7 _4 O0 \! H7 ?& `& @! P=========. ]4 i, ~& Q) T  I

4 z! n7 C3 O7 |% n- x- ^It is not a method of detection of SoftICE but a possibility to crash the7 W( b* {3 B" Y5 W
system by intercepting int 01h and int 03h and redirecting them to another
7 B; K. c2 g) _* I) u1 uroutine.
4 F( K7 W+ X$ }" j: Y# t' e1 wIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points3 X6 d: z7 I! i6 w8 ]
to the new routine to execute (hangs computer...)
* T. V+ H1 b- K2 T* m7 R2 l1 V! U/ N2 _! f
    mov     ah, 25h4 ^9 |3 o3 v  \; l( n9 [+ e
    mov     al, Int_Number (01h or 03h)
( Q( s1 H5 @( J; R    mov     dx, offset New_Int_Routine
6 H' E* v6 Z# o- d7 I+ _    int     21h
5 |& u  j. y; N; O+ r0 l' f$ j5 Q/ l# f8 b, Y! z7 l7 P
__________________________________________________________________________8 J5 c: ~8 M  S; ]2 H7 o9 ?

$ ~# s0 n2 T  u* A5 }6 T7 @Method 093 D" [& O  U( p
=========
7 D+ T: R3 B2 B% B. M
+ H& t- m5 g2 vThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only" r0 Y1 e" |7 b) D
performed in ring0 (VxD or a ring3 app using the VxdCall).
( O& u8 K, i6 _$ R8 f: V# W0 D/ `The Get_DDB service is used to determine whether or not a VxD is installed
  t) h' {  q/ a; w& t, q4 Mfor the specified device and returns a Device Description Block (in ecx) for
( y4 p9 \5 y( ]that device if it is installed.
, L, c+ t! J0 X4 j: C. }9 K9 |. H+ U/ e. s& v/ G( Z' n6 P$ v! L/ Y
   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID
) x) C7 z, J) O  t   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
& B$ H8 D: `' q: A. l, G   VMMCall Get_DDB
+ \  F% M  |6 `- ]   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed/ P/ x4 g9 h' J1 }

, t: R% C/ X- h5 q" SNote as well that you can easily detect this method with SoftICE:
, x6 ~0 W, U7 @   bpx Get_DDB if ax==0202 || ax==7a5fh
# G1 G1 q8 h, T  w, S9 {9 @2 w; k6 P% c
__________________________________________________________________________
. H; Y0 t" C: w; z; K# J
' l) S4 s* T0 zMethod 10
0 f/ |! M3 D. ]: ?5 D3 X$ C=========
& B; G2 Q+ v3 a5 Z. Y
6 [2 @' L/ v% l7 }5 k2 U" K=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with. q" p. J$ ~7 ^& `1 r
  SoftICE while the option is enable!!
1 i  X  V; t( h* i
9 C1 b. C3 G: j& T) t, |7 ZThis trick is very efficient:! `. a, E) t/ o" }! c/ ~! Q0 i2 l
by checking the Debug Registers, you can detect if SoftICE is loaded' R1 ]( M' k" @$ e0 \1 D
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if5 W* J2 j0 d8 k8 ?
there are some memory breakpoints set (dr0 to dr3) simply by reading their
4 @6 Y* K0 L0 v; @) b; ?4 [# B- vvalue (in ring0 only). Values can be manipulated and or changed as well
) T! j- x+ S( J(clearing BPMs for instance)
* [' c) k" f2 w2 P5 i; p* z! I  {( B- N  c/ G% F; n7 o5 O
__________________________________________________________________________
! r: V3 Y% E& \1 A2 E$ K3 B! c# K
. C  n: c1 n8 l  h7 M* k2 }Method 11" d2 w1 l, ^7 G: J$ Y
=========
6 g9 a7 j8 y( h+ {; g0 P7 Q$ ?! M' y; L, l* g% {$ T
This method is most known as 'MeltICE' because it has been freely distributed
6 g- `, d7 T( n* I" Uvia www.winfiles.com. However it was first used by NuMega people to allow
1 s' f9 E: M$ g* g2 I+ ]* uSymbol Loader to check if SoftICE was active or not (the code is located2 u  l8 I' ?; ^
inside nmtrans.dll).
! ?. N- e. S+ K8 V3 b2 c7 u
% s1 ^# R9 [% SThe way it works is very simple:
/ h( y6 z' \4 W$ e! zIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
3 d% Z, G$ J/ P- b- ~& j" Y6 lWinNT) with the CreateFileA API.# t  Q: ]# E2 T$ R& l3 t) z

4 o9 I1 e( Y/ Q, EHere is a sample (checking for 'SICE'):
& D2 l7 X$ `! ^4 J- A( f+ ~7 L" f% I
BOOL IsSoftIce95Loaded()- O* o: ~& @$ V1 w2 ]
{$ Z9 a/ Y4 j+ o  @# ^7 i6 s/ k4 u
   HANDLE hFile;  % @3 @/ ^$ A" c2 P) v
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
" k- o5 D" C0 I: Z0 i( t                      FILE_SHARE_READ | FILE_SHARE_WRITE,
. \8 M4 e# Y6 s: {6 S* X0 q. d                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
+ Q0 b0 i* x3 O6 M   if( hFile != INVALID_HANDLE_VALUE )0 j( L* d( C" N- V1 T$ w
   {
- z, a+ `) i/ O2 ^# `  v7 o1 n. n      CloseHandle(hFile);
5 S# x4 d, V. Y0 R      return TRUE;
6 f) N( S" \! M  X& M2 ?   }
( E- H5 N, a- C. D   return FALSE;6 h5 w7 R  i# Y3 {+ a- A, d
}1 h1 y0 a7 ^) V1 z( H
# `, _  R7 C+ V& b! k5 ?
Although this trick calls the CreateFileA function, don't even expect to be( s* s7 r( o3 i1 l
able to intercept it by installing a IFS hook: it will not work, no way!7 J; S9 `2 I/ p# L3 Q8 C
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
: q8 ]: `) p. ?/ e  O+ Rservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function). X' H( V, u8 ^" j# s& e1 I$ U
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
, v9 j5 h" l" b# w" \field.
( [4 x' [; J" j/ u# GIn fact, its purpose is not to load/unload VxDs but only to send a & p* C( I2 R# Q
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)/ K% V# S8 x- w. v: e
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
! l- S5 U6 M5 ]# K* xto load/unload a non-dynamically loadable driver such as SoftICE ;-).
. n# R: R# x. ~If the VxD is loaded, it will always clear eax and the Carry flag to allow! X6 G, s" P$ h1 p0 o
its handle to be opened and then, will be detected.
( N8 {+ N( x2 X* m/ l. yYou can check that simply by hooking Winice.exe control proc entry point6 [) C) ]; g* g: s: P
while running MeltICE.- R7 z+ X9 p+ ]$ x* e! O
8 a/ ?9 X& s5 a8 I2 X' e
3 ?5 ~9 R& W- O% E" d' N$ o
  00401067:  push      00402025    ; \\.\SICE) S7 ~; E! I' T
  0040106C:  call      CreateFileA0 X5 q  D( u9 [" d* n
  00401071:  cmp       eax,-001
% L) u$ N- {/ q# x- g/ z: ]! t- R7 g4 T  00401074:  je        004010913 ?& R5 |# ]3 y
9 }& y* ~! V* m( Y; M$ T
2 f0 B# V. N8 v& _; q8 f& I
There could be hundreds of BPX you could use to detect this trick.
" D. ~* T: Y: [0 v7 n3 `- V-The most classical one is:; @3 x* Q& M2 ?0 @! v% t
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||- A* }" M6 M% b' ?
    *(esp-&gt;4+4)=='NTIC'
8 I& m/ r& X: U4 [% Z
* j7 r$ w: P( P, D$ o( s; S-The most exotic ones (could be very slooooow :-(  `2 i7 f+ c  X) |1 n  v( X, \3 C
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  
, F5 g( ^+ A% B' \     ;will break 3 times :-(
2 J  I# s% [/ n% i1 b( A" Z1 l* Q% L  z/ a) ~4 @. e9 q/ N
-or (a bit) faster:
6 x+ s( P5 E& b8 z   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')/ ~5 t2 S: D4 G7 Q+ B9 M

" O$ \; J+ q1 X   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  3 w5 h3 p7 V4 |$ W4 y3 [: u6 N
     ;will break 3 times :-(
  s& P- I# B' ]/ W  \$ @2 V' l* d& j% \
-Much faster:) ^1 v  Z8 F  p
   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'- [5 e$ f  Y. G2 {" g% i
0 q* x' l- O2 @: y# }
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen$ `; P0 B% V- q/ R
function to do the same job:
3 I' x. N9 R3 Z9 C) [  g
) N  y. Y6 _5 e1 z   push    00                        ; OF_READ6 o$ a8 V/ {+ c
   mov     eax,[00656634]            ; '\\.\SICE',0
) r; E. Q+ A: o& L   push    eax
/ y% k& v( n2 @& z  X% c6 O   call    KERNEL32!_lopen
* t0 t1 U" q9 V2 g   inc     eax$ c6 z+ Q) R* f  q% S7 q- Q
   jnz     00650589                  ; detected
( {6 \8 V8 G1 _" {   push    00                        ; OF_READ
8 W7 |# l, }. `+ M" B. n8 w  Z: ^   mov     eax,[00656638]            ; '\\.\SICE'; v. G. h) i4 ]; V
   push    eax
7 G& w+ c% f7 E   call    KERNEL32!_lopen
3 b4 X) n! @; j8 h" G/ l   inc     eax
: u( n: b$ l1 S* G   jz      006505ae                  ; not detected+ P! W. G" ]. D7 h
* i  P$ ^5 ~& _, |
2 {0 Q( |0 t6 O
__________________________________________________________________________
0 Y9 S9 O3 \$ U; e1 v7 b9 J9 L4 p5 ?4 U* a# E' M' ^! k2 V
Method 12
; A* \$ [  i/ n; ?5 H: a=========3 s% {  `, I1 T3 J# O! q/ @) ?; v9 _
; N, r: A& w2 D" E. I) [
This trick is similar to int41h/4fh Debugger installation check (code 05- j4 U2 F% W  F2 F) q
&amp; 06) but very limited because it's only available for Win95/98 (not NT)- a* C. {; _# b$ L3 J  c
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.2 j3 c6 G: ~9 |0 j( K& B* p' T

4 z4 U2 x  b# r1 ?* Q3 x  `$ m   push  0000004fh         ; function 4fh
; d0 t  Q2 s- H; b$ f! v3 p, O, r3 \   push  002a002ah         ; high word specifies which VxD (VWIN32)/ H9 s* @: v5 E% E9 f
                           ; low word specifies which service! N' [) f$ C  `! A
                             (VWIN32_Int41Dispatch)
4 X0 i7 C* b6 _6 J) _5 r   call  Kernel32!ORD_001  ; VxdCall
! E) F0 j' B- ~1 F+ i   cmp   ax, 0f386h        ; magic number returned by system debuggers
0 G: ^1 N+ C: I8 ~( M% x   jz    SoftICE_detected6 ^, E  Y- D- F+ V: t

9 M) N" B7 E# D+ l. N7 P/ LHere again, several ways to detect it:
. Z3 U1 h& b' y: p$ a
( M- h' m  q) }# H    BPINT 41 if ax==4f+ ]/ T7 c& G& @2 D

% ?2 g! s$ B% n    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one1 D3 m6 g, V0 B9 E) x4 \
+ W0 ]; _7 v" k
    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
, O: X! D5 J& r& U$ G: d! _" Y1 o. H9 A% c% V4 B" b9 Y
    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!
# B8 m% J! P2 `# [, V% J2 W
/ W$ P, v# v' v0 l( X0 c__________________________________________________________________________
9 J" o% _" m" z3 Q' r' [1 O+ V, ]- q0 [) S4 g5 F
Method 13
! _. _) |" r. d7 t=========& q, y. c2 o  Y! Y( Z* x' s
% M+ `0 C! [; i) k4 `
Not a real method of detection, but a good way to know if SoftICE is
4 k- ~. V7 ]% _/ r& Z: F/ n' Finstalled on a computer and to locate its installation directory.
9 v' u! X% h! T7 G  H2 DIt is used by few softs which access the following registry keys (usually #2) :
( |9 c) F7 h& \' `' q! b  h2 s. b, \' F& N
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion8 F, A) \8 P- v/ I+ P
\Uninstall\SoftICE
* C& p) V1 \" t-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE# E( U! [5 ^8 A3 a5 M( Z# [
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
6 h2 F8 k. M5 h1 ?$ y9 b\App Paths\Loader32.Exe
, r0 i, j  t! J1 u: h/ |6 ~1 Z- h- E+ n, D

: \  v" q2 P( x5 y3 gNote that some nasty apps could then erase all files from SoftICE directory  s6 k7 o  w# ?3 v
(I faced that once :-(/ m. J+ w% v* e+ J) X$ u  u

% ~$ I- i( c' U: m5 i( i' HUseful breakpoint to detect it:& O# h3 L4 u+ P$ F4 b& o; J

4 L4 U+ v  }$ I# v) E( B     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'1 i1 o/ x6 W* |2 }: Z& m

$ {6 W2 c7 r3 A! c3 P3 ___________________________________________________________________________' K  P# s( |# T, o* t! \0 r

3 y' \, n/ H2 v$ C. Y2 @9 P; K5 u
& v; u. i! J# d8 FMethod 14 - T4 a% O7 P3 x4 j. z1 O1 u
=========: `) Q# [  ]( K

/ \4 F7 G, `6 u4 F3 r/ v# I' _A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose% k- J) f; n  i  |. J
is to determines whether a debugger is running on your system (ring0 only).3 M7 i! [  a; ^6 C$ Q) `$ p0 W: L7 u

, m% |0 Y8 }: S) i   VMMCall Test_Debug_Installed* s$ Q. M) _- W2 [
   je      not_installed; F/ W: o& k2 p7 v: S6 a0 [+ Q$ Z* n
. T1 C9 s8 m: F4 Y: j$ a4 B* ~8 N
This service just checks a flag.
7 Z8 s* N- ]) W</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关注公众号

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

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

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