找回密码
 注册

QQ登录

只需一步,快速开始

About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>3 m; ^0 v1 _" X$ e" Q: D* k
<TBODY>
# x8 J- [" U; y( d<TR>4 K5 y7 c+ j4 J6 l4 ~1 E
<TD><PRE>Method 01
% M3 h" u4 E3 g% {) ?9 Y) i% i4 S=========& A: S' k' g% H) c1 R7 Z" z) _
. `; A9 Z2 k3 E. u- b% J
This method of detection of SoftICE (as well as the following one) is
' a6 B  w2 L1 n. jused by the majority of packers/encryptors found on Internet.
& B  {& \: J8 ]# Q4 fIt seeks the signature of BoundsChecker in SoftICE1 L. H9 _3 p" V1 ^# ?( s
; N3 W3 n* j4 ^. F
    mov     ebp, 04243484Bh        ; 'BCHK'* S6 Y6 K" j! x. @# r9 d( e
    mov     ax, 04h7 V; v3 L4 l. i% t( X, Y. ]
    int     3      
* V4 z6 F( y- i: C    cmp     al,4
& I; {1 u) a/ @4 B, @% {& l    jnz     SoftICE_Detected
# ]* {; J! z; i9 B1 S. ~) T' Y7 e" u4 T3 l" B
___________________________________________________________________________
: V$ b/ X5 K9 c8 Q- i7 m% N! I4 I2 ?; k
Method 02
5 T( c( |" Q% [( c=========* l3 E( Q2 E) @' _; S

& \) z' M/ r4 W/ H- y" tStill a method very much used (perhaps the most frequent one).  It is used( l- @1 I# P0 H. z* Y* X
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,1 W* S& o3 o2 Z
or execute SoftICE commands...- a0 K# y  w3 s
It is also used to crash SoftICE and to force it to execute any commands/ A; H9 o6 J7 e' K1 F
(HBOOT...) :-((  
9 H, }6 p8 D# d8 t/ g7 J7 g$ b8 j4 n( Y, o
Here is a quick description:
* W- l% Q6 Y9 W  [$ S/ l9 Q1 F-AX = 0910h   (Display string in SIce windows)
% \) Y8 I( V5 \+ Q* x1 d( I-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)- ~3 d/ i8 R, z: A
-AX = 0912h   (Get breakpoint infos)& e2 A( \4 U( ~0 V. A0 g$ L& v1 _
-AX = 0913h   (Set Sice breakpoints)6 y9 P3 j2 T3 B* \' n: K; [
-AX = 0914h   (Remove SIce breakoints)3 j4 C  Y% W% j$ r& [

4 k# E/ I; z/ o+ r8 bEach time you'll meet this trick, you'll see:; L( c- |- t1 K% _! m
-SI = 4647h
8 j1 v* p7 i/ F9 n' y-DI = 4A4Dh% p% s, X, s5 h' u8 j
Which are the 'magic values' used by SoftIce.3 s6 n  c$ Y6 w2 E1 Y, Y1 F
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.' m* K) b$ y' P; g! o% c

( L# a  s$ p- M2 YHere is one example from the file "Haspinst.exe" which is the dongle HASP& i( }/ O1 q+ ]& D6 p  _
Envelope utility use to protect DOS applications:
4 n) Z: f. ?  q8 {$ D2 C% ^/ f$ A
8 q" X) l% D5 D; S& Q9 N1 [
4C19:0095   MOV    AX,0911  ; execute command.% y' u5 }7 h" n& k( R" `
4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).1 k% N" B+ g* f2 |# s
4C19:009A   MOV    SI,4647  ; 1st magic value.0 Q6 k' p" \# _; f  q
4C19:009D   MOV    DI,4A4D  ; 2nd magic value.
6 ?: K/ a1 _- a+ ~) j2 G# U4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)- O, c$ J$ B6 Q- s
4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute4 @' ]  e) H2 |8 Q6 M  N7 k& V* W9 D
4C19:00A4   INC    CX
) L% w2 k  z- _' I  p; U( g4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute
* t; M) D0 Y8 r' p- m/ U* L+ ]2 f* m5 L4C19:00A8   JB     0095     ; 6 different commands.; a7 m( b) c1 d) j; \) {) |5 t, N
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.6 k1 u( ~6 H. v& n! z' w
4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :). ^2 p* ~8 t' ?- e2 `' M. w( m- o! ^

( w7 ]( ~& @/ v& m# e8 q  R. ?4 [The program will execute 6 different SIce commands located at ds:dx, which! _2 j. k  Z# I2 P
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
" D' D9 s+ g% e8 N3 c5 m% ]
, r: Y& X2 `6 B2 [8 h1 j6 ^* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.: C( Z- ]  k, D% m! i) s3 \
___________________________________________________________________________  V1 W/ ]* A0 H% T* ]
0 s+ b) s/ {# `( Y- d
' q& {% ~; f2 A- ?
Method 03) W+ X' h8 E6 _$ V; {
=========8 \' ~1 E+ k* M; Y; O

; s6 p9 L; H1 m9 WLess used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h. A  d9 }& M8 y/ v1 f
(API Get entry point)+ w! B8 z4 l/ b0 w7 e# A* e- ]" H4 g
        6 ]9 H8 ~6 A. {. H* O5 ^# i7 H
1 N( J+ \, i! M* K9 s& X" _, S
    xor     di,di. Y7 g+ A7 ^" l3 N, G. n- h
    mov     es,di! G$ w5 r& I) e7 b4 h
    mov     ax, 1684h       ( A" ?6 W; o5 W' K3 a( T! Y6 A
    mov     bx, 0202h       ; VxD ID of winice6 G9 l( J! U- K  d; e, e' J8 T
    int     2Fh! \" g" x& C5 y6 F9 A
    mov     ax, es          ; ES:DI -&gt; VxD API entry point/ i- I2 ]- h3 @. Y. w1 p5 g; k
    add     ax, di! u! O! }- R/ {; L3 M
    test    ax,ax4 h- [' `! P9 p9 ]
    jnz     SoftICE_Detected) H, F& D- s! d) Z6 p$ D

% z% G( R/ H' ]5 b___________________________________________________________________________
7 W" P: d. T7 ?
$ B' ], u! {( I" z, LMethod 04# ]! ~1 t1 f6 \2 B1 s7 F% G5 [
=========
  i3 C/ D! C! y7 `
3 g( i9 g% w9 d. C# W3 d: ]4 N8 bMethod identical to the preceding one except that it seeks the ID of SoftICE$ T! k; X/ c- @. a$ |# t) g
GFX VxD.7 N7 R; q7 O9 b" q2 [( m0 a/ \
, U' @# N: g" L) L! P; e2 o# y
    xor     di,di, B8 S" z  l/ R, ^/ H+ [! P
    mov     es,di
1 ^2 h5 q+ M# P, a: n8 r    mov     ax, 1684h       8 {2 S6 ^1 \, ^* I' p
    mov     bx, 7a5Fh       ; VxD ID of SIWVID9 M. s2 q9 R2 y$ E
    int     2fh6 u) l7 q3 e' m* p. D3 o( g) q
    mov     ax, es          ; ES:DI -&gt; VxD API entry point
  A& j* d& u# Y; R9 [) ^8 n7 s" N    add     ax, di, y7 c" P1 s8 y* ?& f- B# D
    test    ax,ax3 r% ]/ M; q" v2 i0 i% s
    jnz     SoftICE_Detected) s& x5 c, P  Z: _; H, R8 B

7 ^7 p& f0 ~& z# O__________________________________________________________________________8 j) {! }' l" P& V5 S2 L
$ [$ q4 y4 [6 ?0 R
) G) i2 H3 `# I. X- ], u' e: R
Method 05. w3 q& O/ D2 }
=========
0 i9 g8 ]2 \5 P  `9 w8 e& T' ?6 X2 g$ p, F& H  l
Method seeking the 'magic number' 0F386h returned (in ax) by all system# ]" v# _& X& G" w! Y2 p
debugger. It calls the int 41h, function 4Fh.
1 C- |+ Q0 ?# d' Q8 S8 l- b% WThere are several alternatives.  $ G0 l7 m# u. x1 z7 X; O0 B9 i

. l! ?6 B9 p1 v. V+ b0 l2 eThe following one is the simplest:' a4 X) K- _/ d: v& O

7 r1 ^. z, M1 q8 T( T  t3 s    mov     ax,4fh
% B; b1 m: U; [4 u( T6 h0 v7 t    int     41h% K# `$ F* G6 u6 k+ K
    cmp     ax, 0F3863 [1 I* y: U8 {- }& Y
    jz      SoftICE_detected
% n6 C9 J# b2 I- Z
5 z8 ]( a& f9 A5 ~* i2 I' g0 t- f6 P
Next method as well as the following one are 2 examples from Stone's 9 W# p  C3 S( \; z
"stn-wid.zip" (www.cracking.net):- O* S; w: S  q
/ O' {8 x" g8 d; Z9 D- F7 i/ N
    mov     bx, cs
9 n' ?* O* }6 y  `" O( B    lea     dx, int41handler2% S  }! p1 l- |2 S8 a2 @' m
    xchg    dx, es:[41h*4]: x9 I& \' |* W3 ^/ @( d
    xchg    bx, es:[41h*4+2]/ X, U9 ?- g$ ?# H1 K
    mov     ax,4fh
6 d7 v2 ]- \+ H    int     41h
+ ~" l& K! f& k1 f. ?0 g    xchg    dx, es:[41h*4]' x' f4 V) w0 b& p$ c9 [
    xchg    bx, es:[41h*4+2]
2 Z  `* K/ S1 N+ X% n0 `6 g: j    cmp     ax, 0f386h
/ w- j# J1 h; k" o8 l% m3 i# D    jz      SoftICE_detected
; g3 _1 p4 X# ?, F0 q; e4 ]; E0 V
int41handler2 PROC+ G: }( t/ m3 p" r! @
    iret1 ^: _7 g, d* q% W2 [
int41handler2 ENDP
' ]( P, f2 k' E2 ~) g! R* l4 R3 v2 F5 L

  \& }; K6 e3 `& O% Z/ v_________________________________________________________________________
3 y; A3 M" p2 _* f3 C4 e& B
6 F3 {1 x# b# o+ E( D2 T5 Z- I- f- B) |
Method 06
  Y. C" h5 Y# O9 L  N=========# v% w- t% v' W3 r& Q( Z

9 Q$ ?& c! g' ]' V4 U4 }. z, o* W+ J. T
2nd method similar to the preceding one but more difficult to detect:
0 B. E. z4 i7 @3 d- {; Q
: M; V2 c' O0 E; O/ a" f( h% s" R- ]
int41handler PROC
- _! _! i- ]/ }8 i, ]) J    mov     cl,al! W* l: }4 s+ Y4 N$ m2 ], b( }
    iret. n9 r4 w8 ^' G; w+ P- p$ p, j
int41handler ENDP
! B3 C" v  b- s7 p: M* k$ M6 l8 E) F1 Z' t' J  f; @. h4 {

0 \! k+ M8 ]& L2 e9 t    xor     ax,ax
. G( |) v) e  m5 N" d    mov     es,ax
6 P+ G* l$ O$ l9 }. S) g    mov     bx, cs, o& l4 a- I! y6 c* u2 |/ w  `' ~+ O
    lea     dx, int41handler
& J, ~( y/ n7 O/ D2 B0 w* P    xchg    dx, es:[41h*4]4 t- a+ q' V  N# Y7 L% I" s
    xchg    bx, es:[41h*4+2]3 c$ D  Z. P+ u8 R/ q) s$ G
    in      al, 40h1 l( h/ m2 \7 k# Z8 \! G
    xor     cx,cx  {; P& U8 O9 v$ K
    int     41h
5 t& E" B3 F, S6 n; G    xchg    dx, es:[41h*4]
7 ^9 r' r$ M5 c' e! R    xchg    bx, es:[41h*4+2]+ k7 {! `0 q- R' o0 ?
    cmp     cl,al
2 J% C% ^/ I) E6 \: s0 O    jnz     SoftICE_detected
, ^! c5 j! U8 m
" t& |$ L. R+ P7 f6 \: y/ K_________________________________________________________________________
% B2 |3 b! d6 W- o6 ^6 ?: d) F+ H  z/ h/ _
Method 07
. [( ]( a# Z# M=========. l) B- w8 ^( I& F: h% K

  @# J6 n0 e# ^6 C) _Method of detection of the WinICE handler in the int68h (V86)
" I) R+ t; l# C  {7 V) o' p0 ?) ^2 X3 c1 u* j$ h2 c/ J
    mov     ah,43h
' o3 R( b5 K% u0 J7 V0 L0 Z    int     68h8 A" ^3 W6 S3 I2 l! a# h, K
    cmp     ax,0F386h& @; H+ W! D' u" K; a& d2 L6 Q
    jz      SoftICE_Detected0 e" R5 K) j( `- u- A$ o2 C8 z

: ?/ i; S! F) M. O. s9 j" c) n$ g) U. p+ O  X' C
=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit% W! N* M7 k2 m( ]( ^: t0 p; S6 }9 V
   app like this:
! ^# g3 @& }! B* J' d/ c% H( C; k8 x' C  `7 i/ ~5 l* o
   BPX exec_int if ax==688 G6 k, P. [4 H( R- J  `! R
   (function called is located at byte ptr [ebp+1Dh] and client eip is9 q- T, y4 v% p. e( B' l6 ]+ l; p
   located at [ebp+48h] for 32Bit apps)
8 R! z+ n% X' Y__________________________________________________________________________
& }  R9 G, v: j- G, e; E9 \; X- J* t( D4 j
0 h4 ^4 a! q, b% n0 }4 H
Method 08" i; Z0 N& V/ j. d
=========' S. p7 X7 I6 s3 a
, P, k8 O( i' H3 c3 O$ T' \3 U2 l
It is not a method of detection of SoftICE but a possibility to crash the3 U* M% O& z3 a; f8 _3 \
system by intercepting int 01h and int 03h and redirecting them to another
) o. D/ }8 ~4 g' L0 i  C8 B  e0 Jroutine.2 K6 k4 B6 Z6 Z/ J& x, F
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points3 u5 n( g( r: x+ ~6 A9 k4 b+ g
to the new routine to execute (hangs computer...)
: \" _6 b8 L4 B/ |9 {1 E) ^
4 s6 s8 ^+ [  Q    mov     ah, 25h
' E5 l" D% O/ B1 b+ z. _6 N    mov     al, Int_Number (01h or 03h)
4 u8 C6 P+ k3 O    mov     dx, offset New_Int_Routine# g! _+ k" p! \. r, g" T/ r: p
    int     21h
; q* k: U5 k( t/ ~; d6 G
  P% e9 {( c: I& I( |__________________________________________________________________________
  g- t9 I- N7 R
9 U- `) \, R( pMethod 09
/ Z' N% |  @$ r5 F: b6 n=========
' q: [8 d2 l; P' u' b- p
! G4 S7 u- N/ w* X+ j7 W2 FThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
& c/ H9 M/ a8 r6 Yperformed in ring0 (VxD or a ring3 app using the VxdCall).' h5 R  \* \8 p9 C/ o( j  s
The Get_DDB service is used to determine whether or not a VxD is installed
+ X' ~7 F- \4 bfor the specified device and returns a Device Description Block (in ecx) for% t" n2 K% k# `" P8 a2 T
that device if it is installed.
) V7 C% S: G" g. ?
( d3 S. U) H: u/ [& c# v   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID
' u8 E! ~: z+ q5 ?% ?   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)# ~5 j3 K1 `0 g5 {& R% @! K5 y/ z1 H
   VMMCall Get_DDB* W3 K1 z# ]! O# \1 L8 e8 U
   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed
$ z- w, g: z* H0 |# B
6 A3 b" o9 E- W/ j( _7 V; PNote as well that you can easily detect this method with SoftICE:
$ B7 _( k% M9 K9 g* c   bpx Get_DDB if ax==0202 || ax==7a5fh
) s: s' q! z* V- |3 V0 h
/ b2 }! ]2 n# W6 Q: T0 Q, }: E" y8 P# z__________________________________________________________________________
9 |$ U: B% g' G5 a6 \) [( |# p( t! I2 Z3 g& V3 j. @  f/ Z8 ?
Method 10
; u/ L: z$ U4 B& b=========
# ]+ L2 a8 ^& G3 O4 V) g$ E6 r* l
! s7 Y' I. U/ ^) d! _' S=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with
! t5 i! V  j( z! P1 F' X& Y  SoftICE while the option is enable!!
9 p' T/ a0 P$ s6 C  O) N' g2 A- `5 z
This trick is very efficient:4 {3 p2 J3 K% {# `2 Q0 _7 M8 d  r
by checking the Debug Registers, you can detect if SoftICE is loaded
7 o, V, r- a+ n: \8 ]$ }4 `(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
/ A0 ^7 D  z" k; O9 u7 tthere are some memory breakpoints set (dr0 to dr3) simply by reading their
/ }* c% s7 [7 K) i4 Svalue (in ring0 only). Values can be manipulated and or changed as well; P; J5 h+ k% [: W8 D! w. n4 f
(clearing BPMs for instance)
# L/ v, {9 @: F3 U3 A* x& r& K
: m: @1 `# Z& R# g4 i- @% ?6 \__________________________________________________________________________* ?& a! J$ d* u( b. F, x$ P2 R( m
! t1 f( a5 @. L) v. L4 f- D* `
Method 11& ~* f, f, X4 ~4 u  @2 Y
=========
' `( S: k# K: U  w( y# _! M
% W. U6 F# {/ a6 E# Q; L: h, XThis method is most known as 'MeltICE' because it has been freely distributed# o8 p4 p6 v/ ]" @% n3 o
via www.winfiles.com. However it was first used by NuMega people to allow
, A5 D# I4 M8 U) c! M( v0 MSymbol Loader to check if SoftICE was active or not (the code is located
: C( E: g/ K) f; E. ninside nmtrans.dll).( I, Q* @9 }/ p% X* T: y% w( D* |
/ i- A" ?1 E1 Z  V; H& y
The way it works is very simple:& j; I$ M0 b$ k6 E; e9 {4 c
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
, [  h8 S. h7 U7 L; u# oWinNT) with the CreateFileA API.
6 V& J- s+ P& e
1 }3 ?5 q, ^3 P! [+ F6 T+ b: [Here is a sample (checking for 'SICE'):
5 T  ~( d9 N  x5 r% g* W1 V4 w! ^
5 n0 d' ^- {4 T# I& F" ^+ cBOOL IsSoftIce95Loaded()0 L% H1 i3 v8 T/ Q1 Z! @6 w9 j
{) u/ U6 n8 I0 d4 f/ @; G. t$ a' f
   HANDLE hFile;  $ V* w. n+ q; ?
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
: _* A& l( c; H1 D6 z! g                      FILE_SHARE_READ | FILE_SHARE_WRITE,
( f/ x/ ~- `  }+ ]5 \: M! a                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);8 S1 ~/ k# j  j  s
   if( hFile != INVALID_HANDLE_VALUE )
# |% R+ d5 r/ n: x2 I/ s4 d) K   {
. o/ p3 J0 e- F1 S- Q      CloseHandle(hFile);
6 N' g& x7 o  k/ l      return TRUE;0 k% l1 M0 |4 I- C9 r* y0 C
   }
4 @7 L0 C! @. ]) I7 @! q) l! ?/ a   return FALSE;
" K5 r5 U! D* b* V5 U* m" K}
5 I$ i& ]7 \  n( w
/ S# }/ z) ^9 p& PAlthough this trick calls the CreateFileA function, don't even expect to be
# R+ Y5 r+ n, b+ y* iable to intercept it by installing a IFS hook: it will not work, no way!; U' c6 H- b5 a4 P7 p
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
/ w$ [3 E' @2 X$ d1 ?# aservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)1 u9 {8 J* ?1 I6 y; f
and then browse the DDB list until it find the VxD and its DDB_Control_Proc6 e  D4 z8 H1 h- j" m6 B2 O( b$ @$ f
field.0 t# ?- \- e3 X) l- f8 P' u
In fact, its purpose is not to load/unload VxDs but only to send a
2 n% x& Q$ |. e5 tW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
, V  b7 u1 D; Z; ?2 o2 ato the VxD Control_Dispatch proc (how the hell a shareware soft could try
% R' U; _1 T2 g& `to load/unload a non-dynamically loadable driver such as SoftICE ;-).. T; R% t2 l4 s. y# d. G/ l& b  R
If the VxD is loaded, it will always clear eax and the Carry flag to allow- V# v& c& x% y- Q1 q: r8 C1 P
its handle to be opened and then, will be detected.7 t6 U* `- l9 f: T' x
You can check that simply by hooking Winice.exe control proc entry point
$ ?! [1 G9 X6 N4 u& O! m* a* w& uwhile running MeltICE./ Z. p- X, C; [! Z6 s

6 n2 X1 a+ m6 e. w# M; \' m0 h* W, v6 y# c2 _  o- X
  00401067:  push      00402025    ; \\.\SICE
4 E9 A! j% V6 B' \  0040106C:  call      CreateFileA
! F3 i6 @( H8 _# n  00401071:  cmp       eax,-001! ?2 S. k% [1 q; t  A
  00401074:  je        00401091- r$ ^& k% r, _0 _  n

: {4 A8 f9 \# @4 J( X" S5 P$ V1 c# |3 y" o" g: p6 r
There could be hundreds of BPX you could use to detect this trick.# R7 K! W7 f: n( u3 Q
-The most classical one is:/ I: D$ T# z3 E- o0 F. E
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||. W- u# \1 }0 l8 J+ t, g
    *(esp-&gt;4+4)=='NTIC'- F/ h3 y  P' c& z
7 K( k- d9 L( ?) o+ N
-The most exotic ones (could be very slooooow :-(
) i" i) x$ D7 W- e   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  ( v! s! `% \5 v1 V0 r
     ;will break 3 times :-(
3 s/ |5 E, F8 M4 A$ P
0 @$ s6 i- y( \8 D-or (a bit) faster: , O% c6 S4 E( S& r' j) E. p
   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
+ U  W; v; M% [, X3 s
6 c: u% G& m. Q   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  - H& I/ o9 f6 q+ G7 z6 f- z
     ;will break 3 times :-(
. X: C. p8 l$ a, C4 ?! U# D# ~) r) L
-Much faster:6 u( Y. z( R( J  c  ?
   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'# r3 v% E: k- q9 T, M, n9 l# R- m

) M' w* Z" y2 C+ B9 nNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
6 N8 l) Y2 r9 T. N2 j- o: dfunction to do the same job:2 v& b3 J4 a, d8 H

+ `0 e( P1 ]5 N3 J   push    00                        ; OF_READ- t/ N  e. Y5 j) A5 _# [$ j0 i* a
   mov     eax,[00656634]            ; '\\.\SICE',03 q/ S- Z. j7 S- r0 N2 f9 t
   push    eax5 ~* z& ]2 T% f0 R/ c: r
   call    KERNEL32!_lopen/ Z5 M0 A8 k9 Z$ q, {8 q
   inc     eax, u. i  U8 g9 s* M$ ]! V/ I
   jnz     00650589                  ; detected
5 n1 _5 S9 V8 ~9 \. j2 g8 [   push    00                        ; OF_READ
" N# c6 Q; p, V: e   mov     eax,[00656638]            ; '\\.\SICE'
& ], b9 G# h4 G! t   push    eax: K# k% E% j' B8 B
   call    KERNEL32!_lopen) n* X6 {) t, ], e
   inc     eax9 V- r7 J) y! r( t* d0 T
   jz      006505ae                  ; not detected) \# @! W# q8 W, {) H2 F

5 n- x0 h& a: o% v7 j6 J5 }9 r- y' N: V/ ~# b
__________________________________________________________________________- X+ h7 U6 J& e- T; A) M0 g3 h% T

1 E4 E/ a8 j/ |) c! }# NMethod 12; I" ~% I; E/ \6 R/ l
=========
; s* ~: h) y2 i+ T
; N+ t$ i$ H6 D7 k$ j/ q  oThis trick is similar to int41h/4fh Debugger installation check (code 050 y; T* |% G3 `
&amp; 06) but very limited because it's only available for Win95/98 (not NT)) s$ b) Z4 G8 \" ^& N7 P, `/ e
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
0 R( \  y4 w3 U  Q3 S6 p! _1 T( g; @+ S; y9 E; [" j& j5 Y
   push  0000004fh         ; function 4fh
2 g- k0 i  j7 ?, d   push  002a002ah         ; high word specifies which VxD (VWIN32)
9 N) }, S4 F( V, C8 I                           ; low word specifies which service
  s% u; v3 R/ Q$ L' |. j8 h                             (VWIN32_Int41Dispatch)
, t: B& s/ Y. |# q8 g: Z- g   call  Kernel32!ORD_001  ; VxdCall' c! U5 ~) Q, u2 q5 v' |
   cmp   ax, 0f386h        ; magic number returned by system debuggers
% S5 n, C. C* j9 C! x   jz    SoftICE_detected  v! [* h6 ~/ a+ K( i9 i( u- Q5 o1 T

5 {- q* S2 P5 CHere again, several ways to detect it:& c$ U0 c8 L4 y) ^

/ S& i8 U# {$ \% f, }9 B. W8 R    BPINT 41 if ax==4f  t3 b! V/ P1 t) B
* |7 G" g7 C3 O  v9 e! t. R. N0 ]. R
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one
* g, C! F+ z( t% m
/ m: {- t2 y. x& b% Y2 k1 b0 j    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
% i. ]6 Z) F2 a$ J1 `
6 ~9 k' ?2 j! L; L" r  I    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!* Q0 A. z) x8 Y

) X/ n" H0 h4 L' u__________________________________________________________________________
" V& |8 w3 B2 K% E) d9 e5 T7 Q/ _- l( b+ {
Method 13
3 Z2 K, j! f4 w2 _, X: O* v=========" b9 t$ E( A6 j" ^; w/ m2 ]& u5 s9 A) j
) @9 [  M8 _" A
Not a real method of detection, but a good way to know if SoftICE is# A% e% K" w+ G0 Q
installed on a computer and to locate its installation directory.9 E' u3 C% q/ o0 D: l
It is used by few softs which access the following registry keys (usually #2) :! Y3 r: k# }* P$ R- W/ v6 W
. |, y. Y/ ?1 c' N& P+ }3 y, ~0 w
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
$ w: ?2 J) `$ b\Uninstall\SoftICE
7 i2 ^. C# s9 \9 F+ [% @( }! @-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
1 e& j! B8 ~# Y/ r" K/ F$ n# b-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
! H' W& K% ?- u5 q9 R7 g, U' J, j& N$ Y\App Paths\Loader32.Exe
  K# d0 ^4 W! g+ w
$ R% ?$ T1 x& H1 u3 g3 c1 I" X
5 F. y6 j5 u0 K$ H/ }: BNote that some nasty apps could then erase all files from SoftICE directory
0 i0 f" I/ z- N% r(I faced that once :-(( |$ |9 e" p$ ?( ^7 M& R/ j

. D5 `% ^4 S- A9 X7 AUseful breakpoint to detect it:0 e  V+ d( Q& O/ L& g, s7 X0 Q

' ?$ O- \9 _0 H& K' b0 A3 C     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
% t' P' G: e; O$ C* a" |. k( J" A7 y2 a1 g6 J% f; r; R
__________________________________________________________________________! j% X# h' m6 Q# L4 j) {% {

0 G  G/ X* g# z, u9 J5 O  N/ s2 c
1 \$ K  B  P4 U  |; LMethod 14
; }7 q. N, F  p) @' Y( u( A=========
. |6 X  W& w. W" d; Z  k
& z/ M5 L! ?/ `8 E% j7 g1 D5 [A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose7 x3 W5 n; x' O/ C* m
is to determines whether a debugger is running on your system (ring0 only).9 R$ n0 g1 r" X8 R8 m. e: I1 u
1 M% T  z7 I" ?  Y, f1 u% [% E! S
   VMMCall Test_Debug_Installed
' x, j2 u9 @/ T! R   je      not_installed
4 i+ x3 c. F; G2 b- v: D5 W  u& F  x# J5 p7 C
This service just checks a flag., i7 d  U) I0 D. D  Y+ k
</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-7-28 13:37

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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