找回密码
 注册

QQ登录

只需一步,快速开始

About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>* K3 h& n# s: C
<TBODY>5 z9 D  ]" ]/ i& u0 n. o4 \
<TR>
+ f" `4 Y( d# B2 d<TD><PRE>Method 01 . e  Z7 ~1 I, u6 [
=========
7 ]4 w( i) n3 a' U
- r7 B' k4 h) `5 `, r: \; o# HThis method of detection of SoftICE (as well as the following one) is
1 v7 E' y3 x- F& |% qused by the majority of packers/encryptors found on Internet.
# h6 Z* Q2 k2 \It seeks the signature of BoundsChecker in SoftICE
! V% u+ G6 U" b
+ ~0 D6 F3 y; V: D0 T' P, s    mov     ebp, 04243484Bh        ; 'BCHK'3 j1 d6 C- U" |- p& k. \/ O
    mov     ax, 04h! t, X" r  ?2 I2 o0 k
    int     3      
# @; o$ i# Y4 F/ w- f    cmp     al,40 i$ Z% c6 q+ L5 R2 r; _" q( h
    jnz     SoftICE_Detected
; _7 w- I1 ]5 b; v: j" [( @" l4 N( |6 k0 N, X/ I
___________________________________________________________________________
; z, c5 B- H% a$ s$ c6 x7 ?$ r) l: h) v) O/ N5 @
Method 02+ j1 a* P1 I. L$ O. X6 D
=========' L9 a: v+ \; B: s8 {5 `; Q$ _
5 B: D1 u/ b9 J# Q0 \
Still a method very much used (perhaps the most frequent one).  It is used4 x' P# }* O- Q" Y6 e; ~
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
* S. I4 ?! v! }! m+ P2 eor execute SoftICE commands...
' J* o! w$ n6 `7 n6 GIt is also used to crash SoftICE and to force it to execute any commands0 I+ Y7 J6 C& E; ^" r
(HBOOT...) :-((  % M* O0 f- ^  ?( S3 [

) R; d/ U$ F7 ^Here is a quick description:3 Q. |. s  N: l% X
-AX = 0910h   (Display string in SIce windows)( Z" x6 ]6 ?( T0 t! s# Y4 l
-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)2 c$ }7 F) H& g& j
-AX = 0912h   (Get breakpoint infos)
* s+ z  D* I& O, a0 \8 }5 O-AX = 0913h   (Set Sice breakpoints)
: J; E* x/ {' x8 `! u2 H/ V-AX = 0914h   (Remove SIce breakoints)
) B1 j( Y  I9 Q$ ]: _4 N! x) ?
6 b4 w1 R2 ]0 |Each time you'll meet this trick, you'll see:
8 `8 O" K% W9 \. c- a. c" d-SI = 4647h/ r" M2 P' G% j: s
-DI = 4A4Dh3 }. Q% I1 N# ]+ u! |
Which are the 'magic values' used by SoftIce.
' H3 o1 S6 F( j* ^  t/ KFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.# B$ \* u6 m' `# K2 o

. s' t5 P" @$ i  t: s7 r8 pHere is one example from the file "Haspinst.exe" which is the dongle HASP9 P' O% k; g! y  f) W) _' v2 {
Envelope utility use to protect DOS applications:
0 C; E8 x" _9 y2 T7 I
: \, ?" k; o2 E9 I8 m
  X: T4 P* n* u9 z4C19:0095   MOV    AX,0911  ; execute command.
( Z; F9 W3 x3 r" `' v* _+ I) @4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
4 J0 o! X8 w# G6 H4C19:009A   MOV    SI,4647  ; 1st magic value./ u- l3 d7 A6 O( C7 c' i
4C19:009D   MOV    DI,4A4D  ; 2nd magic value." b( X) ~) q/ X; X9 _
4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*): b) O& D( _9 A6 z' O% o3 r& Q: {! ^
4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute
9 W" [0 Q; n9 S4 m! [4C19:00A4   INC    CX4 h0 P/ k3 y( u5 d1 n. W  ]
4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute
6 P! [) D- }( E, J6 Q9 [7 ^4C19:00A8   JB     0095     ; 6 different commands.
3 v& y9 w: e* y0 H9 r% P- ?5 w4C19:00AA   JMP    0002     ; Bad_Guy jmp back.5 X8 g+ j4 W! a4 S7 A8 ^1 {
4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)/ w8 ~' ]: U+ u( i/ x3 l! o3 N
3 k% W; p7 Q1 g$ U
The program will execute 6 different SIce commands located at ds:dx, which+ F7 R" x" R) q0 q* E3 p4 F/ Z
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
. q$ C2 C& d5 W4 a9 m' o8 ?: p. ^$ k  i
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
* n! c7 C3 e7 d___________________________________________________________________________
2 s2 d, e  j3 E9 ]; s* G7 C4 c( A2 ~4 \: P# a& z$ [

1 s. U# ^, Y! u% }& V, tMethod 03% ]5 O& Q" @1 j5 c& F. y0 |4 G! {
=========
5 Z0 [- h, S1 \5 g6 x3 D# {! J$ i: W+ ?8 l* Y
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
) r! H: M4 F( w/ k(API Get entry point)* ^8 a# Y) {' n, G+ I1 K
        ; \) Z9 G! }4 H. \3 d1 O  L, [

, V; h1 q9 B( q/ f0 A: u+ B    xor     di,di/ o* @/ t$ I  X% T. i9 W% [* p0 w
    mov     es,di
8 G) b2 L1 m$ Z) N3 N    mov     ax, 1684h       ) r3 h8 N# A6 f" o9 e
    mov     bx, 0202h       ; VxD ID of winice
# P  F; t2 e, ~5 U# V( P  W    int     2Fh( _. m& m& O$ L/ `. l, Z) [3 f
    mov     ax, es          ; ES:DI -&gt; VxD API entry point: \4 C* |- Z+ g* J# L" ^/ p
    add     ax, di7 }. F! S" C+ P" |7 i8 u9 N
    test    ax,ax9 @% i9 c- L7 l0 {! f4 s
    jnz     SoftICE_Detected9 u; _8 G$ U* p& h3 T

8 w8 Z: d- g7 |- I6 I/ s___________________________________________________________________________/ i  Q1 P, A" `! e6 r' Y: g

# l) q- t& T, ^8 b/ ~% z) bMethod 04
, S/ W# b) `! \# o- R* d+ `, t=========6 M, c3 _$ z6 E0 R) W. q% [
) W& ^8 K( }, |8 Y0 V
Method identical to the preceding one except that it seeks the ID of SoftICE. @2 ~- A# e% r3 J# S3 d, P
GFX VxD.2 L3 B4 P0 H0 ~. F6 e' `
$ e9 e) M$ q! G) a* d. ~. T
    xor     di,di& {# {7 f5 V3 @6 h
    mov     es,di0 ^( ~( x) x# x6 D" m6 z: H. K* f8 w
    mov     ax, 1684h      
- P  E- t5 }/ ~2 M# p" n: t    mov     bx, 7a5Fh       ; VxD ID of SIWVID
$ Z1 h: E  V/ n+ d4 m/ ^8 c    int     2fh
1 l% p  }3 _( u5 ?7 r! e    mov     ax, es          ; ES:DI -&gt; VxD API entry point# |+ N, ]9 ~0 n- j
    add     ax, di
; i1 n% O7 z  f$ @- ~. f    test    ax,ax- w( o- _: V8 x
    jnz     SoftICE_Detected
, k6 }& f# H9 a; _& _6 b! p& h8 K1 N% b$ l6 B
__________________________________________________________________________- a6 C) P" s5 Z9 Q+ L

: A7 r: _+ N/ k2 N
4 P6 l$ Y# T6 BMethod 05+ o2 F  B( ^3 @  |
=========9 f- c4 a5 Y0 C; }# o

; }$ ?- ~# x* B) p; G" y/ F/ _Method seeking the 'magic number' 0F386h returned (in ax) by all system2 A# U0 i* t4 O' c; w% n$ Y
debugger. It calls the int 41h, function 4Fh.; u; g; k2 f, A9 f# T  j7 h- ~0 b/ x
There are several alternatives.  5 }4 J9 ~7 |: A2 a- a& w

  L) s& q; r$ M( [. S+ W4 @  uThe following one is the simplest:
, C# A- P! k2 ~) m9 q( r! C6 h7 A! Y
    mov     ax,4fh3 e# j) ?7 F7 i. Y( L
    int     41h
  Q' M; q0 H# A- `8 K/ n0 d/ [    cmp     ax, 0F386
( P  ]) `" S1 I0 W    jz      SoftICE_detected
8 x3 B6 H4 N# l9 r+ Y! I' b2 h: Z: U5 N) x3 y
: s# F' c4 W9 {) E( n. f2 J! P/ g
Next method as well as the following one are 2 examples from Stone's . S, x: z* c! e$ e- X; G) z
"stn-wid.zip" (www.cracking.net):8 p+ A* ]0 i8 l9 \; W9 L# w  I. d

) Q3 I3 m* |, p! j9 j1 B7 C4 G    mov     bx, cs
- Q) @$ t5 O; a: i9 E& D- w) F    lea     dx, int41handler25 v; D1 Z/ \  ^, Z
    xchg    dx, es:[41h*4]/ h0 r$ F, n* ]! h; Y( _
    xchg    bx, es:[41h*4+2]  Q9 _: s; v% K3 v. g  q( P
    mov     ax,4fh0 V/ X. Q0 b) ?6 z6 ]
    int     41h
* d& t( ]: u& O4 M4 r+ `/ i/ n    xchg    dx, es:[41h*4]0 z* e/ `6 F+ _/ }6 \  E3 T
    xchg    bx, es:[41h*4+2]' s9 l; d$ j- ~9 H' L+ w* ~4 n
    cmp     ax, 0f386h* ~5 n( V1 o( B) L  S+ v
    jz      SoftICE_detected
) w8 g/ h2 b' q# I3 u# J5 p
+ v; Z9 {* ?) E' vint41handler2 PROC
: p2 g. N. A4 U! o: X# I7 o    iret1 R- }% C/ u+ Q: j
int41handler2 ENDP
0 d4 w- n7 v; a0 e
, H$ k* z7 |+ z2 S7 K$ z; u( ^% k+ a+ g- j" z
_________________________________________________________________________
3 q7 n$ y0 x: c$ u; R# b, p/ N+ ?- Q8 r) Y+ g
/ H; F; o+ p+ K$ u/ ~+ \6 c0 s7 r
Method 06
: L* y" h  G$ W' U/ p" Z+ }=========
# e) L$ E/ P" z, n6 m" E* Y% l/ D/ f. I+ t

/ E9 r. j- p) H' p; q+ k1 F1 A! N2nd method similar to the preceding one but more difficult to detect:
) D, _; l: e: `6 e2 |5 H+ v) W" J, i. Z1 X/ x: `- G% e
; o; D6 n; F9 P: b/ h( _, N
int41handler PROC
" \* L" f& H( d9 @; Z    mov     cl,al
8 H. r8 ?3 {0 e& s1 `    iret& s9 l; S9 p- T# z) F5 U6 o- y3 ~
int41handler ENDP
+ r2 n" a  s3 g7 ?% s7 d" T7 z8 h. s" f+ \* N
7 W" v: K% w4 C3 B8 j
    xor     ax,ax
  J" T% A6 |8 r9 t! h. q    mov     es,ax! O. P5 q9 v; P4 y& O3 J5 ]' D, F
    mov     bx, cs
: A; l# O5 [4 ]1 W, }* V    lea     dx, int41handler% E& _6 M, E3 S- V5 _
    xchg    dx, es:[41h*4]
& P/ Z3 `# x: b0 {1 C4 u- e    xchg    bx, es:[41h*4+2]4 u& k7 E% Y4 A6 D
    in      al, 40h  [9 q# O0 ?9 h2 `1 `; {
    xor     cx,cx
% `6 J1 f1 ~* `6 E! ^    int     41h7 t5 q% k( t8 n- K
    xchg    dx, es:[41h*4]
7 Y8 c) W* F9 T# s    xchg    bx, es:[41h*4+2]2 e; x7 B1 j% `; N. x4 R  r  g' {
    cmp     cl,al) O, r, P; v+ j6 @; R! t
    jnz     SoftICE_detected8 `, ?4 q0 @. m5 t6 k4 B
9 k) ?$ _/ g3 g) I
_________________________________________________________________________
5 y4 D" Q+ e8 @$ F5 Y  {" p# ]& U! q6 D7 z/ S% j) a
Method 074 j& G" ~. b; W; o/ _: o5 z
=========9 c- F; Q8 m9 f0 ]6 y3 p- l! }4 ~! l
+ x! d7 q4 ]( M" T5 `+ B
Method of detection of the WinICE handler in the int68h (V86)( y' o: c9 J7 L: M' }1 T0 Y
, g2 u' o1 F2 n' i% H4 z- d
    mov     ah,43h7 l9 l- U1 ]9 ^" x) g9 K
    int     68h) T0 s' f+ w- _! i- `: {
    cmp     ax,0F386h' w" Q1 H) L- D
    jz      SoftICE_Detected1 a( t# [* M3 A% E7 l; o" S
' O8 O- s2 M- D# M

6 h; E# M+ @. f* x0 r=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit4 Y' U4 v4 ^0 u: [- E0 @) R
   app like this:
$ B- _; ?1 [9 M( ^
+ |; \) _0 w1 C% Z0 S/ i5 \8 X/ l4 Q   BPX exec_int if ax==68; R' Y! e4 G0 f- M$ e
   (function called is located at byte ptr [ebp+1Dh] and client eip is* Q) L! A7 r& n" X: X9 \
   located at [ebp+48h] for 32Bit apps)
# c+ A3 I  y& e* B__________________________________________________________________________
8 y) T! ~2 V2 \  X/ w/ d, ?* M; p4 T. _/ O  J

1 D5 S4 _  ~% {! Z6 H$ L) pMethod 089 S' J" g0 m* R& p# \& p: l! y
=========! |: a) Z: r6 i. ]: E7 |; {

3 A) s  ]- c( q6 d# J% \! R+ HIt is not a method of detection of SoftICE but a possibility to crash the, ?( u2 K4 @1 g
system by intercepting int 01h and int 03h and redirecting them to another5 ^7 H! Y! j0 d: Z
routine.5 o( i% {; v! r  t! l  H/ e
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points. D+ I0 Q* Q& _3 p+ P, i; @
to the new routine to execute (hangs computer...)% _9 l+ D( h$ K
- b, L3 D- ?8 _, h9 i8 [! `" t+ c
    mov     ah, 25h
4 v# a8 Z% a: J& J    mov     al, Int_Number (01h or 03h). Q" m, g/ t: z; [
    mov     dx, offset New_Int_Routine
' T2 \5 F3 Z/ \9 l2 _& g    int     21h
/ w3 `- {( b& l& l9 Q. E
) ?" i* f  E+ `__________________________________________________________________________
% B  P6 q, ^+ v, U
, v+ V5 o8 W1 c7 j* R$ IMethod 09
, Z; x8 o8 P& G! f- _2 E=========* I' M* i' t2 t* J- Z. z
( T$ @$ }! {0 `5 z  I
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
: f. y( R9 ~" L' sperformed in ring0 (VxD or a ring3 app using the VxdCall).2 X; z) S$ r! [7 ~/ |
The Get_DDB service is used to determine whether or not a VxD is installed
0 I$ s* w" v2 Z' v' ofor the specified device and returns a Device Description Block (in ecx) for  c' @% E1 j, [5 J3 n
that device if it is installed.1 ?* N. v1 z" [% q! o% S2 p; c1 R% G
8 |8 y" z. j. V9 b( H! c
   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID) e8 Q/ y+ z( P
   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)8 U+ P# b; e8 y
   VMMCall Get_DDB
& L/ m# J" F. c   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed
5 S1 j& @- A$ h9 R# |# J) g6 x; P( k9 R, l' G$ X$ r! `
Note as well that you can easily detect this method with SoftICE:- }! i* p2 H$ [# `" o+ l
   bpx Get_DDB if ax==0202 || ax==7a5fh
8 `% K2 |3 t8 o% H  b! J* B: T
9 m/ ~. _0 W$ ]2 T2 `/ d; Z" u__________________________________________________________________________
: w  R" S9 n5 G' n  i8 s: r: ^: O/ `* H& j7 {( W3 N
Method 10# x: [3 M/ S6 r9 p" r/ x
=========* E" ]) k, e6 m4 ^+ w
" L9 b( j( a8 ]5 ~, k/ S
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with  U2 ^3 j: v$ c2 v5 B
  SoftICE while the option is enable!!
0 q. p4 p/ V' [& [" e1 J/ V/ S3 p* s; D- L. g
This trick is very efficient:
3 W& H  l4 h/ ~. o+ I5 q; F( ]/ jby checking the Debug Registers, you can detect if SoftICE is loaded, ]6 W, Z" s4 s" @* ]7 N+ O
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if3 o4 z& D% A" [  ?  Z
there are some memory breakpoints set (dr0 to dr3) simply by reading their
+ o4 g+ A; R/ s  B- w6 R' R, }1 Avalue (in ring0 only). Values can be manipulated and or changed as well
# t6 d$ i$ s4 u  D+ c; w(clearing BPMs for instance)
) z! Y$ w! H* o8 [4 ]7 F8 d7 ]& X8 w+ B1 r# R& {2 s2 R7 q
__________________________________________________________________________4 L" R" t8 h$ W2 q

, N' I* n: q& L2 n9 v8 YMethod 11
# z3 H: S4 _, a: n# X, T; X=========* S$ W9 m9 n! c! n; I7 j

1 b- i4 _: l) Z1 sThis method is most known as 'MeltICE' because it has been freely distributed1 u- A0 f9 A0 r4 r6 i. }; a9 d
via www.winfiles.com. However it was first used by NuMega people to allow
! F. K  d$ v; `- s3 xSymbol Loader to check if SoftICE was active or not (the code is located7 W- A8 M- _& Y4 }
inside nmtrans.dll).
1 [; ^1 P+ X; q( @! s; c/ [1 H7 c' A- z1 K& O% E
The way it works is very simple:! E) ]4 c# T9 q8 F7 F
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
/ M: ^* r7 t/ \; ], VWinNT) with the CreateFileA API.% h% I* [4 W0 t: N

+ N9 d9 C# S, Q- Z* C4 VHere is a sample (checking for 'SICE'):7 m- w& P0 a& o7 @/ s7 R

9 x  x, p9 @9 b4 U  rBOOL IsSoftIce95Loaded()% b* S' V3 Z1 A/ K) ^
{
+ H0 X1 l' [- B, y3 m/ C; H   HANDLE hFile;  
7 J% T7 ~  I: @; c   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE," y8 o3 ^, h+ Q
                      FILE_SHARE_READ | FILE_SHARE_WRITE,1 M/ Q+ T& Z, \. O- ?3 c; J
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);8 x, \4 Z2 I; S+ I- F7 P, u; ~
   if( hFile != INVALID_HANDLE_VALUE )* ^: R+ f4 q6 V3 j$ f+ d. I
   {2 M" r7 m" a3 j! H
      CloseHandle(hFile);
) O: J& L1 @3 c8 R  x- Q) \4 j3 N      return TRUE;2 }( J  m9 l+ I6 J, k
   }
  ~0 L4 G  \# \$ t" \   return FALSE;1 T# s8 p& X' R$ I  Y
}6 ], M8 I5 n) K8 _6 N2 W
! J6 f. k. x& `& q" P( z
Although this trick calls the CreateFileA function, don't even expect to be: x) A4 l" b* a( _0 Q
able to intercept it by installing a IFS hook: it will not work, no way!
: ^2 O$ x- h" ~% F0 z% bIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
& n/ w% }: t8 D# Zservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
) G+ t3 o5 h+ ^1 Z% Aand then browse the DDB list until it find the VxD and its DDB_Control_Proc! C3 @- W8 S4 }) p8 j: X1 a3 A
field.
/ L( r5 F% V# |" {+ {0 MIn fact, its purpose is not to load/unload VxDs but only to send a
) d' u/ d$ Q4 |* G: V" J" BW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)3 |" ~' Z8 m7 D; O8 g5 N% ~
to the VxD Control_Dispatch proc (how the hell a shareware soft could try+ G2 c+ k! X$ j& n7 B! g) N4 ]
to load/unload a non-dynamically loadable driver such as SoftICE ;-).  k  q$ B- ^9 x  W0 o
If the VxD is loaded, it will always clear eax and the Carry flag to allow
. M4 D' B0 o# W* Aits handle to be opened and then, will be detected.' d3 B5 J) l3 g# `
You can check that simply by hooking Winice.exe control proc entry point
6 {8 h, Y& p7 c: rwhile running MeltICE.
) ~% P3 a5 K8 [+ T! T
6 f% v0 n" I% m# i0 @3 |  r3 e; |8 V8 G; o: _& {
  00401067:  push      00402025    ; \\.\SICE+ O) k& B. _2 `0 {3 ^
  0040106C:  call      CreateFileA
5 x+ [8 H& k/ [$ c1 U  00401071:  cmp       eax,-001
8 \! O! a( Z, Z  00401074:  je        00401091
2 [! ?* d' V- a: u/ q% F4 l
' Z3 f# ^6 p" f6 ?+ |9 \5 p" C+ q6 r# ]" q4 T% e* G$ M; m
There could be hundreds of BPX you could use to detect this trick./ d6 `% G$ |# r2 G% L) Z
-The most classical one is:: x$ ^2 N4 `  v4 |5 ^
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||& ]3 h$ J/ _& S' m. x
    *(esp-&gt;4+4)=='NTIC'
9 F9 z. I6 H5 y' N2 p: ]4 q: I' x/ I5 h. y2 w8 g
-The most exotic ones (could be very slooooow :-(
  T& F: R( L( A% t5 h   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  / Z. |2 J4 M4 m
     ;will break 3 times :-(
. M7 w( q: y: a  H
9 m4 N6 Z# ^) c! [; G-or (a bit) faster: * F5 h3 g1 `# `, C2 @3 q& X& l
   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
8 D4 [, M" {2 ^6 z
- ?- N5 @. ?  w   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  : f. A. P, B5 s! I  Z$ K+ ?
     ;will break 3 times :-(% m8 y; F; L6 N; C) Y1 q- V

1 @3 j9 s* H' K, i-Much faster:
( W( K- z& G5 j5 v9 }; h+ m   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'+ b. f# G8 C0 H! F3 x
* o; K9 n1 J% W" G0 U
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen& u/ ^4 p* r5 g8 n& w, Z; h4 h! U* O7 G
function to do the same job:
5 ]2 f% }  T" t" J; s$ Y: H$ Z: Q) H+ Y" \7 a% O7 @" ^7 a5 S8 q
   push    00                        ; OF_READ
' p9 X4 M9 ^) x3 [   mov     eax,[00656634]            ; '\\.\SICE',0: |( g6 y" A# V
   push    eax
8 ?; b# K8 W: v" Y   call    KERNEL32!_lopen
1 l% |5 r: V. e. y; Z   inc     eax- O1 {# T0 {8 I& D) P" a
   jnz     00650589                  ; detected
1 a- F% |  ]( W$ M* o) t5 b: G5 H   push    00                        ; OF_READ
+ H  c) h0 C5 j4 G   mov     eax,[00656638]            ; '\\.\SICE'% p" K: }7 d1 h" J: z, K
   push    eax
' ?; R) [% Y3 A$ e) X, D; `" ^$ r   call    KERNEL32!_lopen
+ L  M; V. ^8 y6 O   inc     eax
, b+ `! o3 o5 V$ _   jz      006505ae                  ; not detected. p# F$ p2 I/ l

. _, }$ r# p6 M- f% ]2 M* c7 u& _2 o. m; H
__________________________________________________________________________4 j. o0 |+ c9 ?# J: M, W9 s% h
7 a. w- M  V3 u+ N7 X& x) j. _
Method 12) J* N% f" W6 U* c. k
=========
- E; f( {# Z8 z8 u) p, R" T' A( s! G( S9 P
This trick is similar to int41h/4fh Debugger installation check (code 05  ]* }& H' r) c* J( h' d( q
&amp; 06) but very limited because it's only available for Win95/98 (not NT)
2 e. A& N6 h0 I9 u' P+ tas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
& w+ v7 r4 R' C4 `+ G6 z3 N- E( E
" J1 a# y3 V- [, i: |   push  0000004fh         ; function 4fh% ?  j3 \% {/ k7 g; ]3 f1 K& P
   push  002a002ah         ; high word specifies which VxD (VWIN32)
9 x( C: u/ R3 x8 c  B0 E' V                           ; low word specifies which service
- C7 I4 B2 n$ ^  J% F, s3 K6 P  [, b                             (VWIN32_Int41Dispatch)
+ j# ~: g9 o0 V+ s7 i0 ~0 v0 V$ }0 R   call  Kernel32!ORD_001  ; VxdCall. n! V6 E4 ~3 h& s, M1 e) ~
   cmp   ax, 0f386h        ; magic number returned by system debuggers
6 B$ S; K/ q8 b0 W3 i9 W   jz    SoftICE_detected
" T1 [4 \, n. S( [7 l
$ x- ^  ~6 G" _9 P( m# c/ S" uHere again, several ways to detect it:
: d- Q+ z& l. |" t7 v) g
& O+ n+ M  F% o; Q2 t    BPINT 41 if ax==4f) ?/ [" k8 l. V3 ?. a: c5 ^! B

4 F% [3 m8 ?+ ^% u( T    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one
0 M/ t" e! Y$ Y  M+ `0 b  h5 f( _. J) ?! K# N
    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
5 v# N6 c5 Z) I+ l$ n( b3 h1 n6 c3 y+ J
    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!1 ^6 q3 d$ Z9 _6 Q3 i& t

$ M/ k& C* |4 p1 U1 W" t0 P__________________________________________________________________________3 s1 x" R6 _. u; m8 p% ]

- b' U0 {. B/ v  m, gMethod 137 X8 a; a# b( }2 l& I( I
=========
9 ^& _; n% B9 ~
6 `8 `  z  J0 `+ G0 T  d0 ?Not a real method of detection, but a good way to know if SoftICE is
! ]! j* P( V9 Linstalled on a computer and to locate its installation directory.
7 Y" j# j0 N% x# K* ?, LIt is used by few softs which access the following registry keys (usually #2) :
8 B3 h% a! p; K3 b
6 G* G! f' n' G1 d-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
8 U9 ?3 L! x) ?- p\Uninstall\SoftICE: Q3 X0 y9 [# s. U/ Z9 ~* U( i# \
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE: h# w& e1 V" W
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
1 R: N0 a- i  h0 W* Q\App Paths\Loader32.Exe! W" Y& x5 d9 }! N( d* B. K
( `, t( R8 u! q

' c, j0 t! X% D- @Note that some nasty apps could then erase all files from SoftICE directory; M* W& D, C/ K( g! E) A/ I+ O, ^1 A: ~
(I faced that once :-(
0 _& {$ _; P; G2 G+ c
9 a5 A1 H, {8 B9 X' RUseful breakpoint to detect it:
! P$ I+ O/ I' C7 [7 Y. y- L# ]" m; S
     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
- E* G; n' j! i; G% V( o" w- V' V( E5 v
__________________________________________________________________________) |' A8 f& q$ ]4 D, }# p
7 {+ ^4 |% a4 j5 R

# v8 l. S+ O8 o" ~( vMethod 14
- }- A) q0 h8 d8 Y6 o! F=========+ w, P* Z1 J$ O1 M

2 u# g$ \- t8 v0 u! u) w# H" _A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose1 j7 z7 a+ a5 u
is to determines whether a debugger is running on your system (ring0 only).
4 r2 e8 J; m" ]# e- x. x. }
. p$ X* I+ @* X   VMMCall Test_Debug_Installed" j; n' x- I9 z* x$ p" }' F" V% g
   je      not_installed3 B/ c+ E% W9 @* ^* d/ b+ G( I
9 e" c! K2 Y+ m+ E
This service just checks a flag.
; t* x6 P+ b. E. y& P$ h</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|本地广告联系: QQ:905790666 TEL:13176190456|Archiver|手机版|小黑屋|汶上信息港 ( 鲁ICP备19052200号-1 )

GMT+8, 2026-8-20 04:23

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表