About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
0 y. _' o3 L/ `6 p<TBODY>
: a7 [$ R4 x1 T2 M; x5 k<TR>
4 }& S+ J# d( i: z5 K, H<TD><PRE>Method 01
9 x5 C! L* U0 f  Z' `% v* t3 |8 L9 r=========
- e0 a( @+ w& Y4 |* [& q
, N" K9 f, _' xThis method of detection of SoftICE (as well as the following one) is
9 `' |/ W0 t6 ^* a3 m3 R* Q$ V. Nused by the majority of packers/encryptors found on Internet.
8 K7 P0 I) y% ~( ]5 L7 V' eIt seeks the signature of BoundsChecker in SoftICE/ T+ y% t" [1 K0 J+ ]1 C: ^- \

" N& X5 z4 U6 v8 G( z0 G$ r9 n    mov     ebp, 04243484Bh        ; 'BCHK'0 A* Y! f$ Z2 S: S
    mov     ax, 04h
2 ?) o: y4 g8 s  w  V/ p    int     3      
2 r, Z' h  D4 c, b. _. C5 q    cmp     al,4" d+ G8 [. h7 R$ z+ x
    jnz     SoftICE_Detected
' @# m  w; f5 W! i
7 x4 i' T& V: L# l# p___________________________________________________________________________
. l& Q7 M( h* R. D3 ~" n: z, n( Q) w; v$ L) X9 G3 X6 n- k9 o
Method 02
+ U+ C- p; I0 Y4 p, W=========! H5 u. u0 l7 V/ {$ v% H( }

3 C1 g& m2 c7 BStill a method very much used (perhaps the most frequent one).  It is used
! v1 B  X( c$ U$ m6 q6 S1 Yto get SoftICE 'Back Door commands' which gives infos on Breakpoints," D/ |4 q3 N3 X. N& N
or execute SoftICE commands...
- C7 }% s, v' F7 u% a# PIt is also used to crash SoftICE and to force it to execute any commands
. }( J6 k: j: Y- ^9 I* I(HBOOT...) :-((  " x' [, o6 a  ?; i( R

! t' ]: c' T/ c, B  J( CHere is a quick description:) E7 [: e' d7 n2 |1 \2 f+ z9 |
-AX = 0910h   (Display string in SIce windows)9 W/ A8 Y$ L: \
-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)
) r" b0 F9 X" q4 l1 j- O1 p& }% n4 K, g-AX = 0912h   (Get breakpoint infos)
9 ~. B% C) G( M* v& D, F1 B4 N-AX = 0913h   (Set Sice breakpoints)7 u' t$ `2 t; {: L/ T
-AX = 0914h   (Remove SIce breakoints)
# `* N" t. {0 S9 t& X& ?. s  G/ y7 v; y2 @& o0 m* w
Each time you'll meet this trick, you'll see:
4 {. B0 K) t! W; `" R* Z1 K-SI = 4647h
; u) a" h! Q, V- c-DI = 4A4Dh
- {7 R3 j' u& f  H5 ]Which are the 'magic values' used by SoftIce.6 r  K  F& r9 ]/ t' `# ^
For more informations, see "Ralf Brown Interrupt list" chapter int 03h./ g& E; |3 x+ p% r9 N* h" e

9 _2 z% q% R6 `2 ~& _$ P8 b8 V$ XHere is one example from the file "Haspinst.exe" which is the dongle HASP  r+ E, c+ y$ A2 P) @
Envelope utility use to protect DOS applications:; g8 N2 w7 W# C; \4 N9 I: R/ L
; C2 E. R9 [% r7 c. g: g: G; l

) S3 d: ]" w7 ^2 x1 n4C19:0095   MOV    AX,0911  ; execute command.
- }; J9 Z+ J$ I4 v( T, q" V( E# n% H4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
) e( l. \& _+ M8 f' Q) Y: y% n( v, c# Y4C19:009A   MOV    SI,4647  ; 1st magic value.
& G( ?6 Z3 a  F6 G4C19:009D   MOV    DI,4A4D  ; 2nd magic value.
7 x- Y! V2 K2 U( g$ P. u4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*). f& H) j& t, j9 P- j
4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute
3 P: V0 L# A  n& x5 O* R7 M$ t- E4C19:00A4   INC    CX
$ f) q, |* n) C) R9 e4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute
5 Y% [8 i3 k6 e4C19:00A8   JB     0095     ; 6 different commands.
- _) s1 B2 N6 @) E$ C$ J8 z4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
" y/ w$ X3 A# R; n' w% c4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)* E, \# G8 s- N1 ~; D4 E* }8 h$ O
) V# b0 s, f. r. d% o! W
The program will execute 6 different SIce commands located at ds:dx, which
& c* `" q3 g8 E/ G0 E; t4 m: {; [* care: LDT, IDT, GDT, TSS, RS, and ...HBOOT.8 ~  Y  k, a/ ?# _9 j4 i0 s
2 D1 h) `1 t6 k; p; r- ]
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.3 Z) b# P/ C% S+ n
___________________________________________________________________________) t. w) U9 j+ Z# Q' j6 q

- C6 j' B4 t1 |# c: h
5 w' w* R% d3 L# `6 S5 oMethod 03: U/ a, h0 {' ?) ^4 G5 Q
=========
& c" o9 R7 B; ?7 G5 D2 w! m( _+ E
" \+ M; _: g( S  k/ @, v- p; yLess used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
; q9 \. C/ p) i5 q. f% o& |(API Get entry point)* i+ I3 I" ~2 s! t; p: [
        
8 J: [$ {( m% M( G* G% ~- d- I$ d7 @. o" ]- A7 E
    xor     di,di
7 S+ c6 W' A; J3 W. d' x: l    mov     es,di
' ]4 b) D0 {7 u/ w& @    mov     ax, 1684h      
1 }" ^4 g0 F3 Y/ C( {5 s    mov     bx, 0202h       ; VxD ID of winice4 X8 S* }9 W% U9 d* u! F1 H
    int     2Fh
4 {. L4 e! R4 o0 p    mov     ax, es          ; ES:DI -&gt; VxD API entry point9 U, v6 x% o; V" S* a
    add     ax, di. ~7 W# z" P' ], w" P' R# ~) X
    test    ax,ax% _) q+ V9 n$ Q6 i2 |  Q! S: X" Q8 Y6 e
    jnz     SoftICE_Detected6 c$ p. z" E5 }7 Z% J. h
' O3 G$ @5 d. y8 ?, b
___________________________________________________________________________' i5 a: v+ U, s3 a8 J; i
2 p9 g1 K3 g9 a6 l, U/ }" o) n! u
Method 04
, \% q0 X& p" |8 ]1 |7 k2 \' B=========" A5 ~3 R! [) x& I! h: a

0 `8 k( b6 U4 _Method identical to the preceding one except that it seeks the ID of SoftICE
# Z0 B4 b  L( ^+ X& N5 T/ u4 K3 |GFX VxD., D' [# X9 W9 l% P8 J% u* j' y

' P+ P* [! C; N/ L    xor     di,di
% [6 [1 z1 K% J" P1 @    mov     es,di
: e8 A8 j+ w/ d: r2 u    mov     ax, 1684h       ( C/ ?" b/ {3 e2 y
    mov     bx, 7a5Fh       ; VxD ID of SIWVID
" X# f+ C6 i% Q6 _    int     2fh4 E3 O# P; [8 p# ~0 h3 i$ t
    mov     ax, es          ; ES:DI -&gt; VxD API entry point( E9 e8 _- J, `- T$ X; Y- N2 M6 f
    add     ax, di4 x: a7 p$ r$ U5 |: p% m- ~6 F+ C
    test    ax,ax7 i* _: _3 o/ E6 }% ^0 d4 K
    jnz     SoftICE_Detected) {. q/ e& `: A) R
; [6 h$ U# T0 ~0 u, ]
__________________________________________________________________________
! x, n. n  W: k( `5 D# K% d% g" i- v

: x0 E0 b) M6 L/ hMethod 05
; K' ^: P# f  n* @; W( b( K=========, M  z+ a& {, T! M! w" O

( A' Y" t- p8 z. D! VMethod seeking the 'magic number' 0F386h returned (in ax) by all system
$ F7 V7 z- u! c& |debugger. It calls the int 41h, function 4Fh.
& n0 H: s* |8 e& j$ Q* ~8 r& i$ sThere are several alternatives.  
. y* y. f4 `4 b5 E% J2 W8 s2 f" f& o% P$ T2 J
The following one is the simplest:- m6 Z( f; a/ v" ~0 s6 x
& B# @! c; G8 s3 H- X
    mov     ax,4fh
" `5 X3 D9 S- w4 o( z0 C    int     41h' _0 U6 n. s: D6 a$ w& k2 g
    cmp     ax, 0F386& i' ]6 F$ g$ s: I: b3 F- a( a! J
    jz      SoftICE_detected
. Z; F+ N  M7 w3 d- ^& D& r6 X4 _- Y) z2 n3 _

3 d% J5 b, C9 i& \7 o/ U. bNext method as well as the following one are 2 examples from Stone's / D/ _/ s+ J% G6 |  m8 v) _, s
"stn-wid.zip" (www.cracking.net):9 S- u& H" g. U" R5 a0 a. n$ I

  D% J  Q5 M1 J    mov     bx, cs2 x% r- J0 m# w3 ]; K. [
    lea     dx, int41handler2! E$ b: |; W6 K. o
    xchg    dx, es:[41h*4]
5 P+ k: z7 q/ b8 {( \8 j    xchg    bx, es:[41h*4+2]- z7 r7 H7 Y: c: O- h) U6 ^
    mov     ax,4fh
3 a" ]% T5 w# Q' I    int     41h* B7 P) Q5 u- b+ s
    xchg    dx, es:[41h*4]9 {6 ~0 X! R2 N! D0 X3 r
    xchg    bx, es:[41h*4+2]) c$ N. e, O5 k4 p6 W8 V# U. o' K
    cmp     ax, 0f386h3 K& O# ]% m7 b! U7 |
    jz      SoftICE_detected
0 B, @! E  k$ b! Y$ K' J, r
" m, |- k6 F8 ?% s% Q, c. e# {: iint41handler2 PROC. P) P3 x# t, Z) W: S0 N0 O
    iret
/ [) b+ Q; Z4 [. x2 e4 h$ Cint41handler2 ENDP
" E3 B4 l- n3 l& {0 ^& H  \" e6 ]1 H) C8 M! a
* V: O4 f. f9 W' {
_________________________________________________________________________4 |6 O  ?9 M# v, _

% C9 v: a! B! j- m) {4 P
8 V$ }, P; t/ b9 F4 H4 x- WMethod 06
* {8 c. J- A  P! h8 p=========3 O% W$ q8 E7 g+ g, }
! l( \8 B  x, X' K9 i
; H% S6 H7 u8 C% Q. \5 D
2nd method similar to the preceding one but more difficult to detect:
$ d( X7 Q* q" n6 R5 {
% J; P- ^9 F) U
, ^8 l- V. V; h/ C# Gint41handler PROC# k. R/ e5 V9 W+ q) T
    mov     cl,al
7 _- b# W+ c6 `+ E    iret
7 D3 ~+ m2 q) n) r! }- D' Y  T! bint41handler ENDP1 R1 U$ ?6 i, \0 v

2 Y. K* @& l7 }) u
) F- g9 K) K( f3 K7 e    xor     ax,ax( h8 H% B3 ?7 `
    mov     es,ax' ^$ t9 \9 j4 ~4 `5 g. N
    mov     bx, cs0 Z8 G7 Y2 G; Y: N% \$ _8 l5 w
    lea     dx, int41handler
* a% J6 m- @& ^7 ?: q    xchg    dx, es:[41h*4]
" O) [$ \9 v4 p' l! Z: g! u9 n    xchg    bx, es:[41h*4+2]
. m4 f0 d% u' E+ H* t' |    in      al, 40h
8 [+ C' n; D+ V( d    xor     cx,cx/ X7 x7 m+ _- @1 J& n" V4 D$ R8 L
    int     41h
# o- g' h2 {& ?    xchg    dx, es:[41h*4]
9 L  w! ~1 q( }# O) q! K/ P    xchg    bx, es:[41h*4+2]
7 O( E% s* B' M1 o: u- ^& c0 c    cmp     cl,al& K5 M' [' z2 X# F7 V8 O; m
    jnz     SoftICE_detected
5 I8 P7 v$ s3 M. ~4 t: T
: I& B7 j! W6 K) ~_________________________________________________________________________0 w; z" |; u! l+ V$ Z! s% r
/ Y9 o0 c6 ?' ]- ^! t
Method 070 W) n/ z- h0 ~% V* e
=========6 i6 Z+ F# Z; X$ c+ s. u

0 e7 a$ Z' x9 e- a( t7 S' PMethod of detection of the WinICE handler in the int68h (V86)3 b% i+ P: I5 o6 Y) ]5 G
; g! g4 m% K4 ^
    mov     ah,43h* }( J" ]  [# c
    int     68h
# o, d% A: `/ ]. G4 Y. j    cmp     ax,0F386h4 Z8 N* ]3 K* e7 i" Z5 y0 P! p
    jz      SoftICE_Detected5 h- i2 w% [! S% {
0 j; Z0 @2 w3 s" k, D' m) M/ O

0 T% E3 N( _" w=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit% L* n3 ]% _8 m# B
   app like this:4 x% T6 D" N; ^5 }, C5 c- l6 S- P

' Y! x+ e. S  c7 p   BPX exec_int if ax==68
) X! S3 T0 e- l, ~" x   (function called is located at byte ptr [ebp+1Dh] and client eip is
$ t# c5 X9 K- ?  C6 j, f   located at [ebp+48h] for 32Bit apps)
7 p; c* ?" N. Q5 Y$ c: [5 \__________________________________________________________________________
; Q" Z' F( _( |4 {0 m8 k& Z* M7 S  P; D
1 T2 P9 L, l5 c5 m# L
Method 08
' D) R* @& r$ I/ b8 ?=========4 v+ c/ U' H: P" @7 Q- ^) Q  i2 ^
9 V/ g1 t0 ^) O2 e
It is not a method of detection of SoftICE but a possibility to crash the
( j* K# F  l6 ~' E$ j" J1 [system by intercepting int 01h and int 03h and redirecting them to another) j* }  A  Q3 k' M( i
routine.0 R( w- L+ Q7 H  w
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points# L" o9 L7 `- w
to the new routine to execute (hangs computer...)
0 ]/ n- P( k0 z% K" h& |4 D9 M: \* p$ q. L6 ?
    mov     ah, 25h  ?% |- k  {! p; P
    mov     al, Int_Number (01h or 03h)
& Z4 C4 ?) g5 a- ^: U* G    mov     dx, offset New_Int_Routine
1 s0 c6 @4 @9 r+ ]# R) w    int     21h9 b- F- g  a) @) b
9 d4 f- ?! X/ W) y0 {' h& k: `
__________________________________________________________________________
, e, }  g+ U# W( S+ j0 n. e9 _" N/ x! ]- t' g% t# {. v) O8 q4 `
Method 09
, {5 M! b7 ~% ^; ?8 }=========
  V6 u3 e- @' c; u+ T4 a9 U! C3 @  W  L6 j. Q9 r% v
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only2 w  Z+ V( F1 B& j/ y' [( D- n
performed in ring0 (VxD or a ring3 app using the VxdCall).
0 i9 M% j6 O" Y; P+ yThe Get_DDB service is used to determine whether or not a VxD is installed: w, ?+ E1 ~4 b% m
for the specified device and returns a Device Description Block (in ecx) for
. B" ]% ^4 ^" Jthat device if it is installed.3 g6 I8 ^  `$ M- m

/ C, a: F  x1 k+ J% V  j3 B& t2 i   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID
7 L! Y  w3 f& u% Z# |   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)4 v- \9 g$ O, T! ]6 X
   VMMCall Get_DDB/ r6 ?9 |3 I" n/ S- z: w
   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed" N9 v" h( V  `+ R" C& L
/ A! g+ S! |3 |6 |. a( v0 T# H2 [  U9 A
Note as well that you can easily detect this method with SoftICE:
) r% f& m/ `. `' v1 V# V   bpx Get_DDB if ax==0202 || ax==7a5fh1 q# l! T3 T. r$ P5 a, ]' e
9 P# [! c" ?( T6 C
__________________________________________________________________________
1 _% q9 Z; [3 ?9 |2 C" i
. T& V9 o  ]. ?4 |; [1 h# wMethod 10( m0 o% y9 F+ A9 M. V. r/ ?
=========
2 Z) n; }! v6 M
# |2 w% j* r% e6 X0 x=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with
( R8 @6 O* G  |$ h" M4 B# D  SoftICE while the option is enable!!
* W& ~& a$ H& {& H2 k
3 X6 @: G+ k4 }8 Q0 L; X$ q+ x# F6 A# NThis trick is very efficient:
. i' x) L! t$ _. V" Tby checking the Debug Registers, you can detect if SoftICE is loaded5 G; V( |- z. G0 K  _* b$ Q/ n
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
# I# l2 U, t  \there are some memory breakpoints set (dr0 to dr3) simply by reading their
' P/ }1 }" D; Zvalue (in ring0 only). Values can be manipulated and or changed as well0 e/ g) ^( X8 Q
(clearing BPMs for instance)
- m7 ^; F( R* P' w1 W# G! X7 _. O2 n  Q
__________________________________________________________________________
7 ]4 C& d+ \: O" }& }7 N5 ~$ e
; K& ]; ~5 W) j- S2 _4 hMethod 11
- C. D; h; y$ C" c# u=========
% i7 T5 r! A. {( y! i' |/ c' ^6 O) W  j2 \9 T9 j
This method is most known as 'MeltICE' because it has been freely distributed7 r; ~/ d/ e3 z! m$ I. Z
via www.winfiles.com. However it was first used by NuMega people to allow4 @9 b, {5 u+ S$ Q* I
Symbol Loader to check if SoftICE was active or not (the code is located
0 h4 H  p7 V' q3 Xinside nmtrans.dll).7 y' G6 z' Q% }9 O, B
  m/ a7 @( x0 R( y( y
The way it works is very simple:
# q4 @, \/ I; x- C0 V. w3 OIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
% `' I) W. r4 ~" e, A' L6 Y. @WinNT) with the CreateFileA API.
' Y, r& Q7 _0 X; ?4 K0 E  ?' K' k3 M8 o% v) ^& y
Here is a sample (checking for 'SICE'):0 U3 [, {, _% u
" L' Z7 L$ ^6 r, h
BOOL IsSoftIce95Loaded()
' k7 C" q6 V) I: t' |& L{
; ~+ Y' r/ K1 y   HANDLE hFile;  
$ F, G! I' S4 p  T# r   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
1 m. j8 I- L. G; o                      FILE_SHARE_READ | FILE_SHARE_WRITE,
7 @; G- J. K: H& L8 I                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);' E' F& c( z3 _: J8 c+ m2 _
   if( hFile != INVALID_HANDLE_VALUE )2 K0 C! k# U9 u- l
   {! p. W7 S3 e# f
      CloseHandle(hFile);
% q, z/ s9 u8 Z( x1 ?5 v' h      return TRUE;
5 v3 t/ P7 V+ l' A. p& o+ y   }  m, z) I, {5 J; F$ N, W4 u: B; ]2 v3 v
   return FALSE;* z2 r# \! U: @: Y. X
}; G. `5 r+ V5 f/ A# C9 P  P9 k

. B7 p) A% J9 s/ A  MAlthough this trick calls the CreateFileA function, don't even expect to be, E; e" v* V! A7 G+ x9 b
able to intercept it by installing a IFS hook: it will not work, no way!
2 J" v( M+ ?: ?1 fIn fact, after the call to CreateFileA it will get through VWIN32 0x001F! \5 a" |5 ^# S& k9 s
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
* N) F) S' W6 R0 k2 s! sand then browse the DDB list until it find the VxD and its DDB_Control_Proc
" }+ U+ P* Y9 U8 P( H( e) Pfield.3 T% ^' I  [( q  @: ]
In fact, its purpose is not to load/unload VxDs but only to send a
) t* M) X: y& TW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)5 I; ]' Y$ e7 b% g
to the VxD Control_Dispatch proc (how the hell a shareware soft could try$ q1 ]+ v6 P) H% x6 \: I. E
to load/unload a non-dynamically loadable driver such as SoftICE ;-)." ^- s, q+ m1 c
If the VxD is loaded, it will always clear eax and the Carry flag to allow
: M; \! Q0 x8 K+ {its handle to be opened and then, will be detected.) f9 p) ]; f* I9 A" R3 E* {
You can check that simply by hooking Winice.exe control proc entry point
) j/ }  f+ l! O2 S- X* ~& q+ O0 Bwhile running MeltICE.# N3 U0 d/ ?0 q/ k0 J+ Q* D8 `$ ^& w" C
# r, Z- r" ]3 A1 ]( p$ N
8 R: ?$ y: R# D/ \8 v4 \* l+ S
  00401067:  push      00402025    ; \\.\SICE
2 X1 c3 f: n! t7 L& w  0040106C:  call      CreateFileA; Y; \2 e+ X$ r
  00401071:  cmp       eax,-001. y1 R; S+ L* m" K: S# W% m. p4 g
  00401074:  je        00401091. w+ P" W  m4 T6 D

8 n) m- z. Y0 }9 z
7 B8 f& N5 D) g5 I/ v0 m& |There could be hundreds of BPX you could use to detect this trick.' ], L- |8 ?( c
-The most classical one is:
0 q  i$ i+ K( |6 p; P9 n  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
# p5 g  u$ D9 S3 i: K    *(esp-&gt;4+4)=='NTIC'% m$ S' e2 ~6 ~% |# G

/ u6 d( g/ U) e0 w. o4 q- ]-The most exotic ones (could be very slooooow :-(  w; q! x$ @( b2 E, h
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  9 w5 c8 O3 D( G, T; [
     ;will break 3 times :-(
3 g# }. J. M2 S: ^" V: A. l1 r& t
-or (a bit) faster: $ j7 t4 g. t2 ~: ~
   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
2 q+ @1 [) i9 H5 h0 d# Z; v& a3 U2 O% i+ H, ~7 s  R! f
   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  & W8 n0 \% N( W: u  q# L: M$ f
     ;will break 3 times :-(
6 g4 _; C4 H4 E6 R' @2 x7 n$ ^- \
-Much faster:
+ r% F0 N+ r3 e   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'2 }; m7 W, K8 u8 j

+ E# A  r9 P2 B, ?Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
" E8 v% n( Q) K' ?2 }7 Ifunction to do the same job:
4 f5 Y1 a9 E/ E  [0 \, S! |( P7 ?+ w8 K
   push    00                        ; OF_READ  C% l9 O, i# F" v, L; P
   mov     eax,[00656634]            ; '\\.\SICE',05 u" ~' m6 m) Z. i' x& U
   push    eax+ q8 L$ }# i# P
   call    KERNEL32!_lopen$ V" T4 e. d: X. T% q
   inc     eax
3 n5 W, A/ Z" R   jnz     00650589                  ; detected# K) T( K% l, U
   push    00                        ; OF_READ
+ b; @1 h% o2 N) p2 b% ]/ x9 e   mov     eax,[00656638]            ; '\\.\SICE'0 L. t" q) S# n! ^- w! M6 h5 e
   push    eax
& x  i: f) Q0 M$ w( k+ M9 A, ?   call    KERNEL32!_lopen, j! r- X4 P7 ]/ W: ~+ q; s
   inc     eax
9 ?+ E6 d' d( l) ^! {+ Q, [9 z   jz      006505ae                  ; not detected6 ~, n3 I( j$ \! a% P3 O4 v! `
- P$ v4 ^4 r. K7 l- F) j+ I. M

" _: Y3 ~0 T; d' n$ {* l0 ~__________________________________________________________________________5 x' J) s+ L! G* J  ~+ B

  M+ L' a2 V1 d; ?Method 12+ u3 d& F& a/ z: u  m6 F$ P
=========& o: g% W7 Q7 u3 u* k6 g
. L: h2 @. Q, C# H
This trick is similar to int41h/4fh Debugger installation check (code 05" a3 A) v+ U$ A8 M& E2 f
&amp; 06) but very limited because it's only available for Win95/98 (not NT)
+ o0 p4 d0 F) P# L$ @& `9 D- {) Was it uses the VxDCall backdoor. This detection was found in Bleem Demo." p% c5 a5 P; g, c. Z5 ?# c' r

" \' J9 l* S4 ]3 B   push  0000004fh         ; function 4fh
0 [: I. M7 F* E, A) T* E1 ?   push  002a002ah         ; high word specifies which VxD (VWIN32)$ L, c5 O" q, Y
                           ; low word specifies which service- B% }' x( k' q& g& D
                             (VWIN32_Int41Dispatch)" j6 ~/ A& q) R4 r/ C; c0 B
   call  Kernel32!ORD_001  ; VxdCall, d, r6 \0 o6 {3 D6 D/ b5 t
   cmp   ax, 0f386h        ; magic number returned by system debuggers2 J; @3 T/ {8 f9 |& D9 m
   jz    SoftICE_detected
- y5 l# M# k4 T- G4 G8 g8 I2 `9 U& y1 G' ?9 Z2 E) o, c
Here again, several ways to detect it:
% h  i/ D1 L: f
: z& x; c) }) O2 {% U    BPINT 41 if ax==4f
' I8 W0 z  ]- G# Q& u, s% t
* ?7 D) N- U' C* d' O9 x  t    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one
) n; m3 o% f8 D( F
3 {" m0 m5 T- F" x- W    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A6 t* _, `' L$ |, T- C$ K
" y: X4 Q. L" |  y- r
    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!
) a! d$ }6 o3 d3 E1 U: D/ H
. U% Q- w& R7 u1 x% `& C4 ^4 g. {__________________________________________________________________________
8 U. c) ^) Q. w, y$ n# G+ O9 P$ j3 i* K
Method 13: u! C1 [& Y9 B4 l0 [
=========6 f- a* h  f5 q: d2 e0 C
( _+ W+ T# Z, }9 q3 T4 c
Not a real method of detection, but a good way to know if SoftICE is
# i: c* s! Q9 v+ C' T$ @+ s) finstalled on a computer and to locate its installation directory.8 i6 I4 P6 ^  W
It is used by few softs which access the following registry keys (usually #2) :
. G' R8 F  p0 O* K' g# u& W1 {; h: h, @0 s" A4 O2 T3 l5 o
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
4 ?1 w5 C9 e% p( i\Uninstall\SoftICE
% k1 B" }1 U+ v2 v( K-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE/ j7 S& Q; N" |0 k( R
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion1 x9 z4 |/ ]4 }% Z  I* _  O
\App Paths\Loader32.Exe0 j$ h2 D* _% B5 l
2 i" `  z1 s9 W, c

5 {9 y# D0 k6 \) E7 ZNote that some nasty apps could then erase all files from SoftICE directory
6 [. q( k3 F; j6 y" Q% f(I faced that once :-(% x: a/ ^0 w2 ~. G% p* q: U; w# r
) q! C# i( q; b% C
Useful breakpoint to detect it:* g& y1 R3 F  @+ f2 V) Z
' }3 d' w9 G! [7 ?) ]
     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'" \$ \1 M+ |1 U

% Q% B" g0 J  y- F% T. B# O& R6 u__________________________________________________________________________6 L( L+ N) r* v* C) S) ?

  _) j" V' t' J  p
" y8 _3 q, _* p: ~% y% B$ ?Method 14 3 |7 `* d9 A8 o- S. d
=========
6 [* w; S: U' M) v$ i
8 t2 }0 W8 p" P3 s& H6 tA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
% l' q6 O" B* ?9 m+ w- S$ Wis to determines whether a debugger is running on your system (ring0 only).6 i, w4 q7 T1 Z" r4 ^; M

$ x8 ^) v, U6 W3 O7 @  u   VMMCall Test_Debug_Installed2 d8 c/ V$ q& N/ l% M; p$ q# E
   je      not_installed& F% \2 V7 m+ g! v" h

( _# t" d# s( j3 c$ ]This service just checks a flag.
$ v& Z. X  L" A. B7 o</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关注公众号

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

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

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