找回密码
 注册

QQ登录

只需一步,快速开始

About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>3 W7 A1 ?* O  z  C1 P: w  x
<TBODY>' q2 F8 \4 s$ g- H7 H# M9 S9 w
<TR>
* m( ]. z4 }; }1 o0 d5 e4 F$ H<TD><PRE>Method 01 ' N! s6 _/ L7 ?0 c- k0 w- Z# I8 w
=========
8 d6 V2 x  p) p$ R4 C6 j: G$ N8 x2 o3 e. C( n5 E. V
This method of detection of SoftICE (as well as the following one) is
: @: K+ \+ U- T# g1 `6 _, ~8 n' Gused by the majority of packers/encryptors found on Internet.
; J1 r' r! u# y+ h# lIt seeks the signature of BoundsChecker in SoftICE
- ^! f- _4 Q8 d# N7 L( C7 g- [& \# F6 F
    mov     ebp, 04243484Bh        ; 'BCHK'
2 T) N; }1 J* u    mov     ax, 04h" ~2 O2 c# {' v
    int     3       1 P7 q# F* d$ f* g. V' N. V
    cmp     al,4
. T( w* I* h0 Z. @    jnz     SoftICE_Detected
& |* ?6 u" B8 z! H1 C7 Y6 Y) T
+ w$ v8 g: e$ E: H" }  F___________________________________________________________________________2 k. w2 }( ~+ V, \) z4 T

4 |+ L+ d) j2 N  |- tMethod 026 F; }9 i3 Y$ z. }. n9 Y! Q1 x2 f, w8 W
=========0 ?7 X0 C0 u) M) W5 o
. T( h& j2 [, @! o
Still a method very much used (perhaps the most frequent one).  It is used7 R$ s- Q3 J, Y! N/ k, j4 k8 W
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,1 e& ?* ?; {! V" f- o
or execute SoftICE commands...( ^7 a5 f$ [& {, |& L9 Q+ X! n
It is also used to crash SoftICE and to force it to execute any commands
. B5 Y$ m. s8 A# x(HBOOT...) :-((  
6 A, {/ X* f; @) K+ u* }. |
9 u" n! h: C" t7 A! o$ o. tHere is a quick description:6 J1 Y2 t& r) \' A) G0 S
-AX = 0910h   (Display string in SIce windows)
* j! W' t- w/ N/ ^-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)
' b9 b7 u* E0 S# R- v) q( L-AX = 0912h   (Get breakpoint infos)& C- \2 m( b. [+ x, K4 M3 C* x+ [4 U& O
-AX = 0913h   (Set Sice breakpoints)
: w7 _7 G3 d+ I2 f& l5 p# B0 c4 u-AX = 0914h   (Remove SIce breakoints): D5 U: {) I& T0 s4 z4 |) {

) T$ k, Y* ]) @0 j; xEach time you'll meet this trick, you'll see:
+ j# e2 t6 c* x% {/ j1 v- `+ P-SI = 4647h* k  Z, z5 U2 i1 I* z& U
-DI = 4A4Dh
8 I( x" q0 {4 `9 m8 Z7 |Which are the 'magic values' used by SoftIce., ^2 }' s" F" J+ k7 M( m# A
For more informations, see "Ralf Brown Interrupt list" chapter int 03h." a# f% d* g& g( L: ?
4 S: L% ?6 n7 s6 H- O  D& H+ ^* l
Here is one example from the file "Haspinst.exe" which is the dongle HASP/ r- b3 W% _! ^: }" X- l* h
Envelope utility use to protect DOS applications:2 ]3 O( K# B5 b. i1 O) D; w4 i

% C5 D1 Y3 F! S# _. c
/ \) ]* u: A9 a. ]9 Z: W6 a( R4C19:0095   MOV    AX,0911  ; execute command.
+ T+ j0 m7 v! ^; H9 c# v6 X4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).6 ]0 m+ @5 X- H# L
4C19:009A   MOV    SI,4647  ; 1st magic value.# f  h/ q& E4 K9 S8 ~& }
4C19:009D   MOV    DI,4A4D  ; 2nd magic value.
- W0 U2 b/ |4 j0 X/ f( I! \$ @4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)$ a# X6 Y; y; o! x- Y& m
4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute
% e5 f( X( ?9 d9 e7 S% r4C19:00A4   INC    CX5 q; ]# T1 x. @& q/ R  \0 a
4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute
# x' Z7 Y$ ^; l# n0 v* g4C19:00A8   JB     0095     ; 6 different commands.$ S" h% \2 b# Z- n
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.& R* _/ t- l( T/ u
4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)# B+ T0 t, t7 X* c4 F9 Z
: p, F5 s% S- ?( F# {
The program will execute 6 different SIce commands located at ds:dx, which
' J7 R3 N* ^6 m5 o( }are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
  o  _% z: y* R  q
# L% y& G. |, n1 z$ R+ z8 J" T* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
8 h" _+ N( ~9 d5 p2 o8 P& j5 T( [___________________________________________________________________________: t, O8 ~6 E% v+ J  F
1 Y+ Z' c7 i# ~* R! `
0 W+ h% x5 M6 b/ |+ s1 Z) ?1 f# u2 u
Method 03; F* I& m# }. p  S3 V& ]  m' O2 ?* P
=========
. j( S, f& ?4 T6 ~9 S$ i$ T! e- X4 x, x$ O  B& x) t: T6 C* L
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
, \2 i% ?' Y% ]8 t(API Get entry point)) z% e- X7 A; h7 O: X5 _
        . y5 d9 c7 C! a$ K7 S' r/ S# o
/ ]" ^: \2 Q' v! M7 s; z2 t/ ?% |
    xor     di,di: K- d- L: S  a% j( a0 L/ u( k
    mov     es,di
6 u- B. m7 D4 U0 D6 j/ [    mov     ax, 1684h       $ i+ S" \  k) g; [+ d. c
    mov     bx, 0202h       ; VxD ID of winice
5 G3 Q3 z6 {- g, T: |4 \) C0 ~    int     2Fh! Z" {7 b, Z/ _: r* B" C1 {
    mov     ax, es          ; ES:DI -&gt; VxD API entry point
$ `1 r, Z! R2 @3 y2 w2 B    add     ax, di2 |# K1 f  W9 w7 G7 Y
    test    ax,ax1 I! Q( f4 q- \5 I2 r
    jnz     SoftICE_Detected' Q) P  j2 d$ g& ^
! ^8 s, U2 A8 W% j7 ]
___________________________________________________________________________
9 p; y" ?. R5 C# a! P
8 w0 g8 k3 z9 ]5 e/ g2 wMethod 04
0 ?# V1 A# G2 F8 H) l% `=========& f5 G' o7 f2 n% n5 V

# f3 h( g' s6 W9 H/ i6 kMethod identical to the preceding one except that it seeks the ID of SoftICE
1 I2 i5 t7 H' o  M* y, XGFX VxD.
8 d3 m$ p% H: x+ X! S3 V, N' C+ i+ H# ]* R) v& x. v
    xor     di,di' e6 P6 K7 ]3 B0 w
    mov     es,di) e% S# l' }/ k  |
    mov     ax, 1684h       ' O; ~7 K' N0 r2 ?; q
    mov     bx, 7a5Fh       ; VxD ID of SIWVID3 h" }% q& n3 n% r% |
    int     2fh$ x) Y8 d* R+ C
    mov     ax, es          ; ES:DI -&gt; VxD API entry point9 W8 c* E- R* x- [; i8 n0 ^6 }6 }
    add     ax, di
" u0 d. V7 i, j7 y$ u0 y    test    ax,ax0 h$ C8 x, |: m2 h% k
    jnz     SoftICE_Detected
& l% t6 b" N. T: S, w) x$ l* b2 p. o/ B
__________________________________________________________________________
8 O0 f) C' b& h1 R5 T1 v
1 g& c8 b! u" |! i' R
% y  o) n+ V* \; E* V2 ?Method 05
, F$ t, U5 @' u& r" i. N=========. x6 K) U: _3 S! ~4 L
* ~- O3 K3 k( _8 Q8 z
Method seeking the 'magic number' 0F386h returned (in ax) by all system6 P* d, O& _' o3 x$ k+ L0 K3 v7 _
debugger. It calls the int 41h, function 4Fh.
+ ]( L7 T  G8 wThere are several alternatives.  
) e7 ^* Z8 `! L% J- r8 x/ i; P6 _! R
The following one is the simplest:
2 o% h4 |- O9 B
0 H$ s  n* l3 p; E  ]    mov     ax,4fh
0 D7 m( `" p  \3 d( ~    int     41h
, `! v7 v4 U/ U4 c  n1 Y    cmp     ax, 0F386
6 D$ d% M7 y) O# k& @; E; H$ V    jz      SoftICE_detected
' _& q& p8 M8 P- y4 i+ t0 Y' Z# e, f

! X% \1 h( u" ]; QNext method as well as the following one are 2 examples from Stone's $ q- Y1 e1 Z1 a5 j& C7 b
"stn-wid.zip" (www.cracking.net):$ {* H* ~, Q: Q

+ S( q5 V) ]' {1 H0 _5 e6 C    mov     bx, cs
2 `. M) n9 l: f6 i  p' V9 |    lea     dx, int41handler23 R, J' B  o& }4 ~) C7 @' ?
    xchg    dx, es:[41h*4]
' ?5 \5 g8 j. }" ~6 P    xchg    bx, es:[41h*4+2]4 \8 E5 q6 F. M4 q5 X) P6 c4 N
    mov     ax,4fh
2 w' `  [) ~$ D9 \; g    int     41h
9 [% W( b3 o* h% F+ v2 y8 Q    xchg    dx, es:[41h*4]& s8 ^" O' A1 r* D
    xchg    bx, es:[41h*4+2]
/ m! ]. k' B8 Q: u) u% I" m. C    cmp     ax, 0f386h
6 M, g# L  K+ O- A3 w% ]8 K    jz      SoftICE_detected/ F# u; X& d! o# J* H% j1 }

' D4 E0 T3 D7 Vint41handler2 PROC
' w' q. I& A4 g/ a  {    iret) j1 s+ \; t# Y& d0 s% M' m
int41handler2 ENDP
+ V  z: P9 }# W, A9 s& ~5 u
; |' `6 F9 s8 W* Q9 f+ R; m/ D1 Q5 |1 O" G2 b5 a# @8 P
_________________________________________________________________________
9 N$ v! J* i4 X# U' O6 k! e
+ M! y& L% H( T- ~' J* D. m
. z/ j4 i" g9 Z5 f& O* Y/ H; }, |) ~Method 061 \8 [4 J( E1 Z& g% m+ Q
=========0 J$ q+ m( J7 V8 z- t9 _

$ N9 \- Y; a, n$ ^) w0 h- Z& a: N6 Z' J2 y7 A
2nd method similar to the preceding one but more difficult to detect:+ A* Y+ e. m' Z% `7 s# k9 p

" Q# P. Q; ?' w, `+ _9 B1 M- m! ]- r$ r7 f0 _) u
int41handler PROC  T& q. W! u  O# }
    mov     cl,al4 B9 T& O" J( b- A) R
    iret
$ `6 q( S9 W( E' W% J5 mint41handler ENDP, A, Y" Z, c: f2 x
5 w' S! ]6 [7 j( B! Z8 w
2 S) C2 M6 z$ @/ a, \# u
    xor     ax,ax) P+ v4 i% Z  I4 P
    mov     es,ax
% v" o5 d% d  X, ~. s    mov     bx, cs
, J/ s% K7 Y' V! J- w6 k+ F, @9 F    lea     dx, int41handler
) y5 I& |" J- K8 a: Y% ^8 f$ v! S    xchg    dx, es:[41h*4]
, x: h! [( |! p. J* F) Z( L    xchg    bx, es:[41h*4+2]
4 u2 C; v+ N" E' H; h# e/ ]/ T3 D    in      al, 40h
0 w8 y7 H1 E* m# g7 h    xor     cx,cx" F) Q4 B$ e3 Z. N3 U* t0 }+ L
    int     41h. s6 @( O# I9 N+ h) o: ^
    xchg    dx, es:[41h*4]
8 u3 s7 m# u' M2 `    xchg    bx, es:[41h*4+2]  C: S2 r5 v8 ]. P$ e  e
    cmp     cl,al
' w8 L' o! T$ z' y& O9 c! ^' g    jnz     SoftICE_detected! g8 p; r8 B1 A0 z
6 y; f  P5 t1 Z6 i6 ~
_________________________________________________________________________1 t* o" N8 r: C7 E% M( _

8 ^$ S, r4 S" W" n& L# r+ XMethod 07- t0 n" a3 C! K) w7 D7 b
=========2 v. b  ]& T/ c0 Q2 i, R, w

. R7 a- Q' H  J6 l  u* ~Method of detection of the WinICE handler in the int68h (V86)# t! C) T! t( ]/ J+ L* w0 w
( e% M0 a. V: p' O
    mov     ah,43h$ D) r$ F$ M$ b( v2 L
    int     68h; @" Z: d9 P4 V5 q
    cmp     ax,0F386h8 L. Q- q& ~: t) F4 \
    jz      SoftICE_Detected
. X" {* {5 p0 s# r1 _. r$ s0 {% c& u+ f/ ]9 @2 q' |$ H

* L4 D' |3 Z7 ?1 \3 ]=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit$ ^' P  W- B8 ~% I. D' _$ K
   app like this:6 S% s. Z! `- f  Y$ s9 j

1 n/ t0 `# w9 w! k6 G   BPX exec_int if ax==68
  A% `. E( d" e- J$ `   (function called is located at byte ptr [ebp+1Dh] and client eip is
7 H7 C% M5 r- h0 t) K: }   located at [ebp+48h] for 32Bit apps)0 \4 `: \8 [2 y1 c! L6 S) m* \+ E
__________________________________________________________________________
; ]1 H/ b$ e) i6 p( V' l- s' [6 H8 U- X3 D4 I7 V
2 @" e# B' u" q& r$ f
Method 08
( D/ ~1 `, D& T/ a3 U1 H3 i=========9 s0 X- @3 k% d& y3 r0 D
5 T+ h' k9 l* _$ |# |* O$ i  z
It is not a method of detection of SoftICE but a possibility to crash the
7 |3 m/ D& k+ {# Asystem by intercepting int 01h and int 03h and redirecting them to another
6 [) S: Y7 f  ^9 o0 Lroutine.( K+ O+ f$ a+ t; U9 {, I
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
/ ^! W% Q' E; b& m! U1 Uto the new routine to execute (hangs computer...)  z, P! p# K6 X# C/ {" t
' ^2 I, s. n. n$ d
    mov     ah, 25h
& Z7 j- y2 M" Y  _    mov     al, Int_Number (01h or 03h)# ?: b3 O8 E4 ~& \, r
    mov     dx, offset New_Int_Routine
1 y# p$ n; K& i4 q! L$ E    int     21h7 J8 w* Y2 l) C1 n

+ T; n% [& B, X: J% D5 F0 x__________________________________________________________________________
+ |& e7 q' \9 x3 i' E4 F
1 x6 X4 z& K; {7 D4 ]4 j0 l' B7 uMethod 097 O0 Z3 p' x4 _1 h- A
=========
: L0 ?8 Y* u( _" M" O3 [- |
: H( N  Z6 k# |- z- k: B4 zThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only+ i$ B6 @" W6 F+ W9 k/ ~" M& n
performed in ring0 (VxD or a ring3 app using the VxdCall).0 @! C( i9 e- a$ V
The Get_DDB service is used to determine whether or not a VxD is installed, n. `& u. o" j; {( a; P8 m
for the specified device and returns a Device Description Block (in ecx) for0 f) @+ x* B2 H4 Y5 i9 _9 w
that device if it is installed.3 d) @" \  N/ H" q

  T1 Q  Z* Z, V7 |   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID2 F6 M" Q. V8 p) E7 O
   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
9 H/ I3 B/ ^; x) ^- y5 Z# u   VMMCall Get_DDB
* u& ]$ O' F' X+ [   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed
- v6 O! a1 U7 e' b( X7 S& X5 s/ V
Note as well that you can easily detect this method with SoftICE:
" k1 t0 h; K: [  W   bpx Get_DDB if ax==0202 || ax==7a5fh1 f9 v  c0 C4 X+ g5 G" t

8 s  ~5 x* P& ~8 H& e2 @* k__________________________________________________________________________
# x/ E; ]0 B. X& |8 ], i) J8 X6 o2 j7 d* ]6 T2 Y) l
Method 10
- c; k6 Q, y2 w& G* a2 J' H( O=========
+ h% M: x( u$ F
2 K* L$ `5 P7 Z=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with
; |5 |) [1 ]: l5 F6 s5 p  SoftICE while the option is enable!!
% `  L9 ?) W$ G+ K  j9 u: Q8 R; |/ a
This trick is very efficient:7 W: B! ?$ K9 \8 }
by checking the Debug Registers, you can detect if SoftICE is loaded  x! j; M" d5 h' r3 \& \
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if/ w3 M  L" i# V0 b0 C+ J
there are some memory breakpoints set (dr0 to dr3) simply by reading their
% P$ [6 E0 P. ovalue (in ring0 only). Values can be manipulated and or changed as well; l& h8 L# o  [$ i$ ~4 ~4 ]
(clearing BPMs for instance)- q6 ?. X7 k5 j0 X0 M+ C
/ |5 F3 E5 T, b( J  D
__________________________________________________________________________
7 k) m- d4 x  w5 E9 k
0 |: n! [  A7 S, b9 ?7 nMethod 11
$ v) z3 w4 G6 w  P=========
. h& n2 y/ T7 s$ V
3 z% g' M0 e% n7 w' JThis method is most known as 'MeltICE' because it has been freely distributed
3 h; i3 o( T7 ^9 @5 N* rvia www.winfiles.com. However it was first used by NuMega people to allow
8 a; |' Q  f. e2 s$ iSymbol Loader to check if SoftICE was active or not (the code is located5 U: ^7 P) \! W
inside nmtrans.dll).
( a6 H* B  l7 k1 c
5 _9 I0 g1 V1 C& s0 g2 `The way it works is very simple:
& M( j# G1 V/ }It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
5 l' g! @" `, h8 U( hWinNT) with the CreateFileA API., O8 Y8 l; H) e) H2 \- ]

5 f) P) d/ v" THere is a sample (checking for 'SICE'):
) _! o, L+ D8 c8 i
9 y! T! |, ]$ X* d# t  c6 U( bBOOL IsSoftIce95Loaded()
; R! I0 s5 ^! K0 q" n' H2 S{
% K% D4 O. _+ z: b& U0 T   HANDLE hFile;  ! S. D4 V& |* ~& u& @4 w
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
8 k1 U8 j3 v3 B1 t, r* ~6 T                      FILE_SHARE_READ | FILE_SHARE_WRITE,* O: i' Z; n* c, x( `
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);6 z8 @" `4 |: U8 ?' L; D5 E  {
   if( hFile != INVALID_HANDLE_VALUE )0 Y9 Z% {- z0 `) z* l
   {" _- z9 i" @7 U$ O( p6 [! s
      CloseHandle(hFile);/ |) {% W; P4 Y" g7 W
      return TRUE;
0 m) @! K9 @5 t   }# C0 w# W& I# P
   return FALSE;
& w/ l& }/ w& |  F; ]}7 A3 t3 M+ H2 A4 C) A

: I4 G% j: `6 {0 f+ v5 iAlthough this trick calls the CreateFileA function, don't even expect to be; t& L; O4 q3 R; D7 i" Z
able to intercept it by installing a IFS hook: it will not work, no way!
$ E  Z% S, G6 \8 P0 ^6 a. ?' ?In fact, after the call to CreateFileA it will get through VWIN32 0x001F& X: D9 m" `8 M
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)7 ?0 `/ J, B/ N
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
) V8 e& n0 J0 E* g) T4 rfield.
* X4 C! N, h4 A2 d6 ?2 BIn fact, its purpose is not to load/unload VxDs but only to send a . ?& C( I( W7 G/ @4 L. v
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
$ ?6 L: ^- R( {! M! Eto the VxD Control_Dispatch proc (how the hell a shareware soft could try
3 G% Y1 ~  V# {7 V+ }4 A+ zto load/unload a non-dynamically loadable driver such as SoftICE ;-).6 j$ U) x7 b# a$ X  V% y, j
If the VxD is loaded, it will always clear eax and the Carry flag to allow
0 L5 W6 O) v4 R! b; pits handle to be opened and then, will be detected.
* ]6 J# [4 R4 L$ X% ZYou can check that simply by hooking Winice.exe control proc entry point. g) |# L8 v6 t8 v& S5 W. B
while running MeltICE.
! Q$ `/ T: f' @' o
  ^. P$ K% L6 v& _6 _  u3 t
4 k, V+ O; a- q  00401067:  push      00402025    ; \\.\SICE4 }) H8 o* w- Y5 g$ v0 ]& ?: _
  0040106C:  call      CreateFileA% V% Z# ]$ o0 G
  00401071:  cmp       eax,-001
% J( u+ z5 ]- E- |( b- x1 p: }  00401074:  je        00401091
. f8 Y/ B& x: j+ {2 C; ?4 i# j2 V. b+ D; T! O8 Q* i7 i6 {
0 V8 O8 B0 i. e$ c: N1 B
There could be hundreds of BPX you could use to detect this trick.
+ B: b5 y8 b. o/ w) U-The most classical one is:/ P- Z0 D* I: ^$ p
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||1 t1 `' p+ ^( Y# e
    *(esp-&gt;4+4)=='NTIC'
+ C5 m$ h  t8 u) C+ D
0 t# K* G: {* d+ ~% f3 `-The most exotic ones (could be very slooooow :-(. @& C3 u6 h! S) o( q  N
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  
" j" B& \& v+ X* o2 L     ;will break 3 times :-(
! H0 }. m# `2 B" h# J* j  h1 j& q' F+ i1 x+ e2 W; n2 \
-or (a bit) faster:
. F6 i4 }' Q7 A2 `) ]   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
0 N: c( f! \+ J  u2 X
' f0 @# g+ c/ D+ w. l   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  
( Q- W8 j$ Z; s' T5 ]     ;will break 3 times :-(
( i' n6 R+ ?5 \3 K8 C
3 U4 V$ w0 V: W- R( j* k) {! p-Much faster:
1 w5 f" ?; C! |% ~$ n. y   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'
& ]! ]3 y8 W7 D$ |% t& U. X6 t4 _' P' G
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
% l( B: [2 o4 h* I3 Hfunction to do the same job:
! x/ o% X# B: p( c& W2 w6 B2 r& l7 f( T5 Z5 k& Q
   push    00                        ; OF_READ
; q7 Q" d5 ]% t( y* U7 E   mov     eax,[00656634]            ; '\\.\SICE',0
7 O% c. n( R6 N3 |! }$ |   push    eax
$ O# S! X) O$ z   call    KERNEL32!_lopen7 H  Q6 D3 Q! B0 G& L4 t
   inc     eax: {4 n* v* }0 Y6 X, |; Y
   jnz     00650589                  ; detected! S( r# _2 o7 ]' b3 M' [. c
   push    00                        ; OF_READ
+ W8 l; [( y- @   mov     eax,[00656638]            ; '\\.\SICE'# X( ^2 o; s" e' I. P9 T
   push    eax
& n7 d; e& }" F& o  x   call    KERNEL32!_lopen
+ e* b8 N2 @! N) u7 L& U# z! s   inc     eax3 n) Y9 O- R8 t) @4 S
   jz      006505ae                  ; not detected
" S( C4 @$ H9 p4 j. Q
% f) [5 \2 u% ?" \# h  }" K9 g9 g% U
/ B6 p& q7 E6 `9 |__________________________________________________________________________& ~2 O4 p. q$ m; e7 b7 [! k1 C5 k; J

: l& v4 @/ K1 w5 V( fMethod 125 t! }, H- T2 S9 u" a. C$ H
=========
5 B$ j5 k) A5 y: i1 ]5 `6 n" b8 y* b" k
6 {1 F% {* d; OThis trick is similar to int41h/4fh Debugger installation check (code 05
" V- C, C2 s6 x+ g6 u&amp; 06) but very limited because it's only available for Win95/98 (not NT)
9 ^; u- z0 d6 {9 xas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
1 ]6 R; q# R% h! m. H" y% C/ K# E) z1 k2 s/ P1 E
   push  0000004fh         ; function 4fh
4 ~7 l+ K5 Z/ Q. j3 Q" L; X9 F$ t) `   push  002a002ah         ; high word specifies which VxD (VWIN32)
9 E: ~. q$ q& ~2 G) R                           ; low word specifies which service6 A) ~. L& k4 k) H$ p1 k" c
                             (VWIN32_Int41Dispatch)7 X7 r+ u  y. U
   call  Kernel32!ORD_001  ; VxdCall
) X9 k$ G( D( J, ]& O0 |   cmp   ax, 0f386h        ; magic number returned by system debuggers1 @) n% X& t  f+ o+ F, t. d; z
   jz    SoftICE_detected
" L1 v, B1 z8 ~& X( H4 }) @5 @* F$ z: ?8 Y
Here again, several ways to detect it:- b' _9 d5 B0 z) e! n: D

9 f4 y0 _; K# W. p- a    BPINT 41 if ax==4f+ _: S* v4 m1 e$ M! U, a; L
2 p7 M3 H7 u3 E/ G; s
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one8 ~, \4 Q; _+ D& G

5 a1 s  c1 O9 N0 t5 S: ?0 e: e    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
7 {9 T5 q. U$ I) n1 i* B
3 [! S- _7 A$ z9 G) f    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!6 c' e$ I0 |& u1 T7 f; w3 n+ X$ g

- n" v7 S# W/ O7 p__________________________________________________________________________
" V6 R9 k  J1 [( r, M* i- }9 R9 z' B" v& X# c) n4 r! ^
Method 13
/ c% H( t/ y+ f* S2 e5 J' v=========0 m; F3 W6 |" m0 O; n( s* b. H* e- f
# S1 b4 i, P+ H: y2 e0 x* F: V' g2 g
Not a real method of detection, but a good way to know if SoftICE is
1 }$ X. u: N( e+ Ginstalled on a computer and to locate its installation directory.
5 R8 ]" T# n  f  yIt is used by few softs which access the following registry keys (usually #2) :: u4 n2 ~+ U' R; K. U8 m

- O* X- S$ K* a  I4 o-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
) q$ k; j- w1 d9 }  E\Uninstall\SoftICE+ N; X0 f9 t8 t# [+ |
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE3 G! X# ?" \, w) O9 S
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion* `6 g+ J5 X" u' Y* u' i+ W
\App Paths\Loader32.Exe
" J2 p9 i. {9 \- j! a
# J4 e4 ^! y; ^% J" F3 r' o3 N  z* a. F" F
Note that some nasty apps could then erase all files from SoftICE directory: f8 n+ M" r7 P0 |7 R( s/ r
(I faced that once :-($ Z5 S7 m7 }  ^' _
! X/ t$ M! \. |* q( o
Useful breakpoint to detect it:
: x9 ?% R2 ]) \
4 W/ H% W$ s) U     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'7 ~2 g$ o' p7 W3 [. M
. i8 E+ W, |4 i8 I( p8 T- |
__________________________________________________________________________
9 v3 y0 w' d: R) x# T' L
. k( F6 l$ N/ b) L6 F1 M: Z5 r
0 g' u) p5 h" ~& yMethod 14
  z' \  Z* _" c, J  u=========
6 |- f8 |+ E6 _1 t) F
* H2 p- _. T7 \" @A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose; r# f# p% I* X% g& z4 H
is to determines whether a debugger is running on your system (ring0 only).
+ @7 C. y: X: D
0 k, p! e3 _, e$ a; R   VMMCall Test_Debug_Installed
  y  I8 O2 {/ P# l! g! F2 z! a- s   je      not_installed: X/ H% M6 o% u

* H2 c5 i3 a( n8 p# zThis service just checks a flag.; ^, N% ~5 a) k2 L2 m
</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-8-5 20:03

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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