About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
! P4 w- g0 A( t0 A<TBODY>
+ o! a: i7 J0 B3 K<TR>
% i7 c2 D- d* f: j. x9 l<TD><PRE>Method 01
6 v8 e, c6 [2 Q+ z' y' s6 p=========
% b: X: ?7 P' |9 Y6 A" m2 F& i2 O- ~1 E  G
This method of detection of SoftICE (as well as the following one) is1 x  t. S" o1 E
used by the majority of packers/encryptors found on Internet., t/ M) J  E2 S. O8 t) r0 x5 @
It seeks the signature of BoundsChecker in SoftICE
5 t0 h! L3 m7 J6 G3 [! u# k" Y: k# B; N% r+ R) e  v% n$ Z" C, {
    mov     ebp, 04243484Bh        ; 'BCHK'6 h( z. K. ^5 s1 P0 A- Z; B
    mov     ax, 04h
* H4 I' f; e( _5 J    int     3      
% X! @: P$ V9 ~; C  H6 H7 n    cmp     al,4
9 k# `# z& M& C8 g6 T$ q+ k( j    jnz     SoftICE_Detected5 J! q$ k, R6 O  s( k0 r

7 O5 N, l+ N6 ~1 M; o2 f. Y2 d0 q' {___________________________________________________________________________6 l1 R  C! n# D) S

5 {% H; Z) {4 F1 R& NMethod 02
7 `6 A" W% ?2 Z$ k7 L=========1 H' r, K4 [; q' r. w

4 Q" d$ a! U* \& i9 p) }Still a method very much used (perhaps the most frequent one).  It is used
% Y4 [/ T( X4 p* D/ @4 @! nto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
; z- N/ c: S1 c/ p, r. ~( uor execute SoftICE commands..., }1 B' W; E! U
It is also used to crash SoftICE and to force it to execute any commands2 T& d5 o6 x* w( M1 t& o
(HBOOT...) :-((  
* Z/ M' \" b& P, p5 Z" g
& y  E" m2 k- ]. [) s' fHere is a quick description:
# b/ R0 Q0 M* n, j-AX = 0910h   (Display string in SIce windows)2 |8 I( ^. W3 D* Q2 ?3 ~$ O
-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)' R5 i+ S; n  C- ?2 K% [& O. y$ J& c
-AX = 0912h   (Get breakpoint infos)6 f  Q! \- L) O- l$ b
-AX = 0913h   (Set Sice breakpoints)8 {$ S$ U- e0 _4 K
-AX = 0914h   (Remove SIce breakoints)
. B% S$ Q% V6 S. z
& a5 D/ O# E+ ^: ~; e6 tEach time you'll meet this trick, you'll see:
& ~4 R  ~' \. H8 ]-SI = 4647h( e# |* V, o- K  ^3 I2 c
-DI = 4A4Dh
) R+ L- b' F2 Z2 |5 X  _6 uWhich are the 'magic values' used by SoftIce.
, C$ y; {4 C( e! P+ n0 k4 UFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
3 G  A  F- `+ b( O1 C6 _* b
2 a' |3 Y0 F: z( y& m- NHere is one example from the file "Haspinst.exe" which is the dongle HASP
; [5 [- D. {  V* Q4 |Envelope utility use to protect DOS applications:0 k2 C9 F* |" t. y

1 r! y9 G. l' k# C! h( Q
2 W: j" e7 ^" D4C19:0095   MOV    AX,0911  ; execute command.; y2 g3 W9 n2 ^
4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below)." J) l% H+ v5 o. `+ C8 w
4C19:009A   MOV    SI,4647  ; 1st magic value.% A# H3 q; U8 o2 }) w; n
4C19:009D   MOV    DI,4A4D  ; 2nd magic value.
4 {6 ~$ ~( {! a. W% J! f9 v  G4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)( e/ z! G0 B7 X; m: T3 d
4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute; @1 C- A, b* ]5 G0 K, Z$ Z
4C19:00A4   INC    CX
6 [& s2 ]  D* B9 @6 @4 I4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute1 m5 Y2 \% U4 \8 m) i1 D. j+ |( C
4C19:00A8   JB     0095     ; 6 different commands.
: k; g0 M6 m* g; p4 I* R2 c) K4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
9 q. B" d6 `7 t  M4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)
9 o0 N+ _* A5 C- Z9 F6 |. Z* B* |
" h# Y! n3 p. yThe program will execute 6 different SIce commands located at ds:dx, which
2 F5 [. u" V- E* n- ]# u% [are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.1 i* \$ Q) e+ \- @+ a2 e; ?
5 n; b5 K6 a! a% O; T" C8 A, x/ E7 @
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
* j9 Y4 v( B5 i  c9 j; }0 q___________________________________________________________________________( A4 r8 r4 l4 b& K5 H6 \" H
8 F5 D( }; D6 v0 H' @

; M% y) [  d! H9 zMethod 03) g' G3 A9 Y# L% V  n! X
=========9 D) j( U0 e& D; n
# z1 S$ i( ^* T) G
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h. ], b: j0 b. V1 h0 ]4 r) |2 G
(API Get entry point)' @  O6 k/ \8 h0 L' E& u- [1 Z1 z
        
+ f9 P0 `9 f7 e2 `
4 K/ u3 F" c0 \( u  \    xor     di,di
# R+ i' `2 {5 [, y/ q' K    mov     es,di
; ^+ g0 L; S+ j    mov     ax, 1684h         p1 K; b. S$ ~# z
    mov     bx, 0202h       ; VxD ID of winice
' l3 O0 N0 J' ^, i- v& R+ O0 o    int     2Fh7 j  [% S: i7 o$ }( w6 i: v
    mov     ax, es          ; ES:DI -&gt; VxD API entry point( |4 h( V+ H( y3 ?: C2 g
    add     ax, di
# p9 c& @' F5 V2 ]    test    ax,ax- y2 B, Y( S: M
    jnz     SoftICE_Detected; w' _5 I, Y1 L4 X" L

' f" f3 g2 P& n; r___________________________________________________________________________
5 _/ p) X; Y6 u; Y3 y
; a5 D) w4 e3 z* M: lMethod 04
( {7 A2 @+ B+ |# W$ T=========
: d8 o2 W+ a8 T0 J, j3 ?) k+ z+ Q
Method identical to the preceding one except that it seeks the ID of SoftICE
0 _% m- \2 n$ Y/ O2 vGFX VxD.
' x9 d) H+ [) U/ K( {' U. w7 A9 i
7 z0 k! t& z$ q2 e" I- d    xor     di,di; D. ^  X( G$ O2 e
    mov     es,di# L2 `" ~. O) @6 V& |
    mov     ax, 1684h       + b& {) c" v! a
    mov     bx, 7a5Fh       ; VxD ID of SIWVID* R# l, w  Y; J' Z
    int     2fh
9 J* F  |' u# |    mov     ax, es          ; ES:DI -&gt; VxD API entry point
5 o+ Q* ]6 j3 w5 G0 t* `  p& a    add     ax, di
; Q% X- u) ]4 E3 B/ \4 x    test    ax,ax- U, z. m! A* o% T$ H+ |0 i/ I# w
    jnz     SoftICE_Detected4 \. N7 ~4 v( f

8 q+ D: n8 v6 s__________________________________________________________________________0 [# ]/ T2 o! a

9 w7 ~" [' y. r
# o1 A3 Z) ^- Q( C0 FMethod 051 P  g. {' B" h2 f
=========2 {7 T9 u- g6 X; G$ Y

5 A7 D9 Y/ d" E; q5 T& {Method seeking the 'magic number' 0F386h returned (in ax) by all system$ ^9 @! ]' V( S- h; b* R1 T
debugger. It calls the int 41h, function 4Fh.7 X" a! K/ U" J( @& p+ ?
There are several alternatives.    o6 T/ M7 q4 I3 T3 h

1 b* }% U8 \  g! Y; B- lThe following one is the simplest:
+ Y9 ]+ |3 {5 r$ c7 g
5 L$ o; y' B& S- v" `) d9 }( X) x    mov     ax,4fh! b( \9 d- g( X; f. f
    int     41h
7 S' r6 \" B6 s/ n: k& M/ t" {    cmp     ax, 0F386
# ?/ u: Q0 C3 X6 V6 r1 i  Q5 j    jz      SoftICE_detected6 I: }5 `4 R% ~7 g5 O
5 T# I7 @0 r! d) _. z
5 y2 a, M% y6 J1 u( I
Next method as well as the following one are 2 examples from Stone's 9 {. L! d3 x. J# ]8 @
"stn-wid.zip" (www.cracking.net):
6 i/ A% L# J" s( a4 C$ }2 l( t, H1 A  U4 \, m  p
    mov     bx, cs
0 P) C, a0 a8 r; g! V  r    lea     dx, int41handler2, G0 a" e9 G7 J) b
    xchg    dx, es:[41h*4]
4 |5 m3 F0 W1 S& ?    xchg    bx, es:[41h*4+2], a% h! b! z% y( z9 Y$ T, {) I1 [
    mov     ax,4fh
0 P/ U0 |4 u* U( F+ R) H; \! Z    int     41h
7 P' n/ l2 S2 N3 G* Z5 n$ y( [. I    xchg    dx, es:[41h*4]
: q' K# }* ^0 V3 K    xchg    bx, es:[41h*4+2]
' h' y2 m$ [: v1 V  y$ V    cmp     ax, 0f386h
. a6 ]; T5 ?6 l- ^6 _4 g2 M) y    jz      SoftICE_detected2 V- ^$ X- _$ i1 j% P% f

) Z2 Y, }: _# n) G- `! ]9 n9 Cint41handler2 PROC
+ Q3 n: Y0 z- O6 R+ O. p/ H    iret
) u! x7 Z8 a7 w/ aint41handler2 ENDP" G5 f5 m! ^3 n0 ?

7 j3 `& C+ V7 v6 A/ q0 B' o/ e+ {. v" E7 `0 C, k( G/ Q* J
_________________________________________________________________________
0 Q  \6 \7 r3 u) x5 a8 D& r% p6 J, [, B: z; @3 F8 [7 t

  g5 r* [5 @. E+ L9 BMethod 06+ x! S) D- ~! m
=========
' w9 b0 s5 |8 f% ?# t) o- I6 M$ @9 Q' D' v7 k" U

- G- S5 C) h9 |- E2 F2nd method similar to the preceding one but more difficult to detect:
2 h- s( {4 C3 c- O# K; Q
4 i3 ^1 T# S$ ~! `* t; W  N( }, |7 \0 M: a  l
int41handler PROC( i, W+ n  f+ k7 y
    mov     cl,al% S* X% T5 \% B
    iret9 n( U( B$ \. K5 O, h" E
int41handler ENDP
0 @# a0 v3 l  {9 U+ |: I: r. L4 k
# G5 k! N4 t" d3 ^; m- `/ }
: s& T( d4 a: V7 o% U- B3 n8 i    xor     ax,ax
/ V5 \/ f6 J( Q  M    mov     es,ax. F/ e+ X) }4 i. D7 L
    mov     bx, cs2 D! X! r' j" z" y# A
    lea     dx, int41handler
# \* b9 W* P9 `/ M0 ~8 o1 s    xchg    dx, es:[41h*4]
$ q3 r$ }; u  ^1 D/ Z/ h    xchg    bx, es:[41h*4+2]
! e& ^: n. a+ c7 i0 r# p7 g6 H6 C    in      al, 40h
  c" V+ D; \# c9 Z- c0 B    xor     cx,cx6 b' ^/ ^6 c: r7 t: G
    int     41h- p! p6 S& V+ b; w. U
    xchg    dx, es:[41h*4]. o* ?8 e% q) Q. c4 M) s
    xchg    bx, es:[41h*4+2]; F, z. x9 j6 I5 X8 t3 [
    cmp     cl,al
) b5 z  R/ Z6 F6 {    jnz     SoftICE_detected5 \0 t, \9 ?1 i: N

! i9 H- ?2 M) V$ Y6 L_________________________________________________________________________
& |$ o5 n$ V9 ~. d" w
: |7 H! I2 L2 |+ eMethod 07
# N  W1 _# l3 s1 X=========8 p- I1 f' \! x; C7 v

% O) q, ?$ i2 K& \& V2 J' aMethod of detection of the WinICE handler in the int68h (V86)
$ _* v) ?; A& A4 V  f: O8 T) T: m
    mov     ah,43h1 u1 g0 U  s3 g* ]5 U. v
    int     68h  x: x# N' z; i9 q# U5 A0 A
    cmp     ax,0F386h' t$ w+ ?# f; j% X+ O9 V: v, b% Y
    jz      SoftICE_Detected' n3 I: i& Y" b! _7 `" |
, u( @" g& {# }- n

2 w) a5 E& l+ L2 E7 z: K! e=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit% ?/ ^$ }4 P" C* S4 q5 o
   app like this:- U6 R4 i7 N1 A, @- b% O& ^
3 a0 p5 K5 o; G+ ]* B
   BPX exec_int if ax==68
" @1 M1 Q2 p2 J& V5 T- E( s' _   (function called is located at byte ptr [ebp+1Dh] and client eip is' P0 u" A1 F( O" e' w7 b
   located at [ebp+48h] for 32Bit apps)7 W1 T1 E6 l; f9 o8 C
__________________________________________________________________________5 r" X7 l' t+ l- L8 f

% w1 W) U& m; R& r) G, S
$ k2 ^9 I; q! U; @% t$ [Method 08' d+ |) N  ?2 ]: X% _
=========
$ A- t9 R/ z& B& x& R% k
6 @1 m4 Q; P. }! @  rIt is not a method of detection of SoftICE but a possibility to crash the
& v5 l9 P- Y# q9 N% Ksystem by intercepting int 01h and int 03h and redirecting them to another" ]/ P0 H& `, j* @
routine.2 _. A- e$ |0 r. j) r
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points' h" J+ o; N3 l+ _4 e" Q7 z
to the new routine to execute (hangs computer...)
+ f' t) R- \6 ?/ B
2 M0 j) ]4 r: z6 ], P+ z" F    mov     ah, 25h
4 X5 n6 E' @, Q* k9 D* t+ l; g' n    mov     al, Int_Number (01h or 03h)' O7 k  L* K5 H, m* J0 G! s
    mov     dx, offset New_Int_Routine! R& ~* }6 ~) {6 P
    int     21h
5 A+ h/ D9 V7 ~/ G+ h( S3 t( o  }5 y! N/ D$ g+ N
__________________________________________________________________________
9 s/ W$ b5 V8 J; r
6 X% r, r4 A9 pMethod 096 D3 r* t( B7 J
=========
; O, v. S9 T) M- M4 H0 H* T7 o& i$ i
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
) V# ~" k1 v' `; m, Gperformed in ring0 (VxD or a ring3 app using the VxdCall).5 s' s3 Y# o# S# Y
The Get_DDB service is used to determine whether or not a VxD is installed9 Y# ?. B( [5 B' ?
for the specified device and returns a Device Description Block (in ecx) for" c: u% V- f3 L& X- {
that device if it is installed.9 W0 N0 ~! W4 b& E4 y+ b" a' s

1 H5 n) q8 G: }8 S" e   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID
5 N0 f4 L3 R) E9 e4 j   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
+ M/ v0 z& |: g/ A   VMMCall Get_DDB
% X2 J# O( V% o   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed6 I; B5 r! K& Z6 d0 ?1 N0 p
* k! p0 U! N" {5 Q/ w6 x
Note as well that you can easily detect this method with SoftICE:9 P! N: R7 H* K; D
   bpx Get_DDB if ax==0202 || ax==7a5fh
, z4 l$ E8 ~- I% H* C7 _! p5 q& M5 i! R0 `) l
__________________________________________________________________________
( @9 y3 J( Z' q( h9 u( e. l0 x8 E. ^
Method 10
+ S, K/ l1 U+ t$ P1 A=========9 O3 Y# y& A. f1 {' b  f& T9 H" G
) k: o- n# H8 B2 a  ^
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with
; h0 O" X" z2 {5 Y" ?8 P+ B  SoftICE while the option is enable!!
/ ]8 B% }/ ~) H4 F: e. {$ {4 y4 v# z( |8 x
This trick is very efficient:: }8 z5 [2 g% B  P! b! S3 ~5 j
by checking the Debug Registers, you can detect if SoftICE is loaded7 {( e; @/ p1 E$ p
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if1 W. D1 X3 Z. d0 ]5 A' V
there are some memory breakpoints set (dr0 to dr3) simply by reading their5 W' C2 F( I% e2 p
value (in ring0 only). Values can be manipulated and or changed as well
7 i$ W# m' p: `/ _(clearing BPMs for instance)
0 h8 j3 p$ z- j# [$ i$ Z0 X7 Z
5 h, m  Q3 d2 r( p__________________________________________________________________________/ Y" e1 u% l1 k0 e% {/ i! ]
( s, S  i: A# g" t# y
Method 11
1 H, v0 Y* P  |# ?7 W% @! p=========6 p2 l6 }9 g' j0 A: A
: C$ b' u  R5 ~: Y/ E
This method is most known as 'MeltICE' because it has been freely distributed
# z- ~& f" K3 Z5 l2 d. ~$ w& kvia www.winfiles.com. However it was first used by NuMega people to allow  d- c" G6 a  V9 ~' x
Symbol Loader to check if SoftICE was active or not (the code is located$ y: J, v4 A2 l: p$ a* p* I1 L; F1 a
inside nmtrans.dll).) }3 u/ ~7 {9 E' w0 B/ R# i" I
5 `$ @; t+ p' ~
The way it works is very simple:
) B, V; J) T+ V* @3 f8 dIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for" n" m! U4 p! m7 t
WinNT) with the CreateFileA API.7 Q* J8 t0 T6 D5 c2 J" w

3 N# K, Z$ r" \; WHere is a sample (checking for 'SICE'):
/ G5 A& Z* ~! E6 n5 A* D# y" l6 f: l+ ]3 S3 ?, r: G' }
BOOL IsSoftIce95Loaded()% y/ |" g$ {1 Y0 \! P
{
9 U; s/ n" b6 V2 K2 {. H( J   HANDLE hFile;  
" {0 T; h' ?6 ~) X5 G( v3 _5 |9 y: `   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
( N' X  u4 l: a& m' B/ W                      FILE_SHARE_READ | FILE_SHARE_WRITE,
- P) Q/ P/ E0 C6 B8 V                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);( Z' \* W! x! y; j  G
   if( hFile != INVALID_HANDLE_VALUE )# R# o% L# N) t1 ~' \! t
   {
% R% `' v1 n- L# i4 l5 N0 b- W      CloseHandle(hFile);4 L! ~/ y* R' F/ P" x* l. ?
      return TRUE;
+ N7 b3 p( e" t2 a0 w   }
+ I+ U& Z: h2 G0 M1 q   return FALSE;
+ Q" g# P! w; ~}
( H7 W7 u$ J+ D* j( [. Z, @& v& r) n/ u  T  u6 C% g! v1 K
Although this trick calls the CreateFileA function, don't even expect to be
& \% d. f- d9 p* {1 P9 Xable to intercept it by installing a IFS hook: it will not work, no way!
/ k* [# Z2 Z% P2 {7 }9 wIn fact, after the call to CreateFileA it will get through VWIN32 0x001F+ f. @" D5 `0 Q
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
3 o$ G" ?4 k6 i, _( L$ D6 hand then browse the DDB list until it find the VxD and its DDB_Control_Proc
( H, T) g, x0 }, H2 Qfield.
2 N7 i& B! U" c0 z! f" D& Z4 bIn fact, its purpose is not to load/unload VxDs but only to send a
" a4 `& ^* ^' n5 l, \/ R4 YW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
" M; l! m0 y7 n) i( d- c7 Zto the VxD Control_Dispatch proc (how the hell a shareware soft could try1 E+ |1 S1 k& ?* U! M0 N; v; [
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
- {: D$ P! K- i+ M- l5 QIf the VxD is loaded, it will always clear eax and the Carry flag to allow
! i* m! B& \3 d6 G  jits handle to be opened and then, will be detected.7 z8 l# R! p4 T- Q# G
You can check that simply by hooking Winice.exe control proc entry point' e& ~' g3 C5 j$ i( L
while running MeltICE.1 e/ r+ Q' C2 W& j9 r) G2 H
, ?- S/ s  O: V+ g
% o( u# L5 A9 e4 f; P
  00401067:  push      00402025    ; \\.\SICE3 g2 O+ I! t; k9 Z$ G
  0040106C:  call      CreateFileA
: O' ]! K& ]1 `9 Q8 g) E! \& Y0 S8 R1 L  00401071:  cmp       eax,-0012 h' `/ r8 d# t% Z$ Z4 z/ F+ s
  00401074:  je        00401091
* d% H" ^4 t% g2 D" h2 e6 t. O1 ?/ J& C  |" b1 C) ^, j9 Y. Y6 b
* }$ w6 O; e3 |" L0 s; q: W0 B
There could be hundreds of BPX you could use to detect this trick.
0 _4 H( R9 _. r! R-The most classical one is:' g- A& j9 ^' j- C; v# a6 m
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
" k7 _- n- g/ [" \, |    *(esp-&gt;4+4)=='NTIC'. E) Y+ i8 n1 i7 X8 u; m2 x/ B

1 T9 r3 X* e% _" U3 e; T* t& @7 S9 b-The most exotic ones (could be very slooooow :-(
1 `9 b/ j) k6 g$ f   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  0 n6 K9 [3 P' m! C" j
     ;will break 3 times :-(
# H3 Y" d  B3 T9 I2 b; l+ G. ?
-or (a bit) faster: 6 I; b8 k5 s- P% z# J5 _
   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')5 L2 Y* i% _" ]$ _6 n2 i" \4 l/ F4 p
- {* U* [% d0 a+ s0 c, S
   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  1 J  C6 X. A8 h
     ;will break 3 times :-(
4 |: @( E9 i  m1 j8 N
  G+ T" d5 \$ t; B' V" ]. ]  E-Much faster:
4 h; I# W8 a4 x7 z* i  _% y  p   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'9 x+ h' ?& U* ?

4 N# P, G0 u  v# y9 r( g: aNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
4 i7 r( X( n5 M; H  |+ ?function to do the same job:6 ~+ i6 S" a# |' d5 f, J9 b

( z- [+ O$ z* Z9 M- J   push    00                        ; OF_READ7 r3 a$ V" }% R5 b( I& u5 L, K
   mov     eax,[00656634]            ; '\\.\SICE',03 K$ [1 }9 e" J. f) S% R
   push    eax& [" @& j6 M, R
   call    KERNEL32!_lopen4 ]. y* e' f0 j- w
   inc     eax: \' [: b$ a; v7 p7 J  O7 X4 W
   jnz     00650589                  ; detected4 h& [6 H  L  h" ]; S' ]% D
   push    00                        ; OF_READ5 Z% w7 l& ?' B7 m5 n" n
   mov     eax,[00656638]            ; '\\.\SICE'6 x" x& O* b! A7 D; a# |1 b$ ~
   push    eax
& ?' Z+ `' R+ U   call    KERNEL32!_lopen
. c' k/ E6 E7 R: O- j   inc     eax
4 U. g7 C) d, Z* b% G( B   jz      006505ae                  ; not detected
- j. G; Y' r6 ?( ~/ b# y2 Q# \9 y( b5 Q2 O

& G- c# ]  U" G' G__________________________________________________________________________
1 r# g( h$ n5 o4 W+ {2 C, r# i' ~7 K& ^
Method 12
9 S- X& W# S# _' a( N- C=========3 u- t# Z  B" a. G1 X
6 F) F; F0 T. |' |1 E: N5 e: ^
This trick is similar to int41h/4fh Debugger installation check (code 05
' M. [4 j& s* b* d  Y) S+ O&amp; 06) but very limited because it's only available for Win95/98 (not NT)
  b: T6 F7 R7 U! y2 Yas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
( d5 \, [+ d; w+ `" q: o0 _* v- P2 y
7 b" T1 x$ |% W( ~   push  0000004fh         ; function 4fh! W0 H; _' i/ f$ @6 c
   push  002a002ah         ; high word specifies which VxD (VWIN32)9 A2 \: P9 ~1 F$ z% y! z+ M7 z
                           ; low word specifies which service* |* V  H0 i# u
                             (VWIN32_Int41Dispatch)
/ u; F8 B7 P8 J. s# b  ~6 p   call  Kernel32!ORD_001  ; VxdCall
1 B; ~- W" E, R' i3 E# l   cmp   ax, 0f386h        ; magic number returned by system debuggers3 w3 M( p% h' f
   jz    SoftICE_detected: I3 M# n. d: Q3 H6 j; g+ Y5 P

/ N! _1 O  U* z' ?Here again, several ways to detect it:
/ x1 j1 O/ N/ x  }
. [- D6 b; L, G' i- D3 [    BPINT 41 if ax==4f
( c$ T: l  }& B1 b7 T: V1 ~: p- X& _) E9 l
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one
8 o0 a$ B6 {1 O
. K3 R! a, m' W1 L8 Z    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
7 M: Z3 u9 I7 ^+ H' D& {, N, `7 ~/ R) w+ _
    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!& n8 D: u7 N( b. L( r- n" K
% C9 f' L4 q9 G) s0 Q5 D6 o
__________________________________________________________________________& W; P  H8 I0 e% {4 L+ y$ p
/ b$ P& Y7 w- L- U- C2 q9 U
Method 13& f, a" d  c1 N* c! S
=========$ d7 J7 c2 `( ~( ?+ X

3 I2 U5 J2 I8 `# o* BNot a real method of detection, but a good way to know if SoftICE is
1 l( d; W$ x! W8 ?! v4 I' V9 E% H  Yinstalled on a computer and to locate its installation directory.
5 R4 x) r; m" H6 \5 OIt is used by few softs which access the following registry keys (usually #2) :
; r4 r' `$ V5 a# i, k: s9 ~
7 w$ d" @2 O! q6 U-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion! }* Y$ K; @- ?4 U; W9 Q8 o
\Uninstall\SoftICE
0 }! X+ {& n* ]-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE/ T  ?" v4 U, I! t3 Q, S
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion1 y2 @5 w( S$ N2 i" T$ N  p$ b7 \
\App Paths\Loader32.Exe! z1 u$ G6 `3 O% H2 n: w1 v

4 p- s! L& j/ i& {
( a6 v8 v: x" T  ?. gNote that some nasty apps could then erase all files from SoftICE directory
; \6 n0 Q/ J" X+ e1 r/ r7 D' z(I faced that once :-(, c9 M+ ~7 `3 e7 R6 D$ v1 Y6 Q7 T

* c8 _& I( S% o6 ~* P! d0 KUseful breakpoint to detect it:' U. m" K9 K# U, Z

! F  \& c' K3 s" j: W; _! |0 x, J     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
. W- L" Y6 `6 T* ]1 c+ ?7 H; l  I( _% n5 V$ q2 `7 |
__________________________________________________________________________( h3 M3 B. m0 Q9 W( w
& |, T, O* N2 j8 d" v
% y  Z8 M  f) Z& z: K  S
Method 14
8 W; q3 [: c6 `=========3 j2 Z, ?3 U' ~, @4 r5 H1 C2 f
- d0 b" L( H; L1 g3 X, J( [
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose8 r1 B, V% c! m6 Z& G8 P' n& u
is to determines whether a debugger is running on your system (ring0 only)., N6 T' p2 G; |8 c8 M. o" V, T7 L" i

5 s3 T: s/ p6 q& u5 |   VMMCall Test_Debug_Installed+ H5 V4 O/ u# E$ [. U' p% g; m
   je      not_installed* ?- h% w3 M' O( ]- m7 U7 V

/ s; ]& y+ M' Y' E6 g! zThis service just checks a flag.1 b. X4 }: \0 {- I2 J& o
</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关注公众号

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

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

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