About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
7 c" J. |3 ?. _" d' S; R<TBODY>
6 C; N, m' I& n3 D<TR>
; a: b, P  l# x7 C$ N. f8 T<TD><PRE>Method 01
3 c% O' [' j* q7 M=========
: ~8 H: B: o; @0 x0 l
2 F( A- B$ R' C% X  rThis method of detection of SoftICE (as well as the following one) is
, l0 F3 `4 w5 M. [1 Y  kused by the majority of packers/encryptors found on Internet.
: y3 J; y, y: U! [6 ?/ hIt seeks the signature of BoundsChecker in SoftICE  E7 V. d8 C% U+ i+ g' [" b% S! Q

3 W+ o3 B9 A! N+ n. j    mov     ebp, 04243484Bh        ; 'BCHK'
, p! w0 M$ W0 ~0 H" F( [* a1 b* X    mov     ax, 04h
. a) x  ?9 ?! ^1 B2 G    int     3       1 f; G9 J6 F) w, U# v% u; b$ a
    cmp     al,4
: t8 y+ y3 H$ N+ F; ~    jnz     SoftICE_Detected# o9 _& E, T" z0 s6 b" {0 r8 _

4 Z0 V/ {; p, T___________________________________________________________________________
/ j8 t( F3 d. M( w1 a6 Y2 m% P) P# h- T5 x
Method 023 E9 Y# q5 Y4 K' i. k0 |4 }8 h
=========
/ y& c' _6 X3 G# T& Y( e3 F3 w) |. a
Still a method very much used (perhaps the most frequent one).  It is used& s1 A6 q3 K1 t& w
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
: \2 A  W7 r/ g# gor execute SoftICE commands...
0 \$ Z6 V  n% IIt is also used to crash SoftICE and to force it to execute any commands
5 K- i: s7 K3 t( H# P  l(HBOOT...) :-((    `% O* f0 j& V" g# u

0 I& g6 t8 }3 ?7 W" vHere is a quick description:  F) L" k  J6 ^* ~6 z& R
-AX = 0910h   (Display string in SIce windows)
/ i; F& z; A, U6 u8 V) D% [  w-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)& u. s9 P* H' Z% m0 i  l9 B1 W
-AX = 0912h   (Get breakpoint infos)' l) h. A  f9 i2 C3 s# B
-AX = 0913h   (Set Sice breakpoints)+ u( ^7 c* U0 L* w7 m
-AX = 0914h   (Remove SIce breakoints)
# I; {0 \! ]" C0 V
7 j% X) ^) g$ M" t( k: k4 REach time you'll meet this trick, you'll see:
' V7 R; W+ C/ m$ G-SI = 4647h
6 t: Q9 m6 c  _0 ?4 W9 d/ N-DI = 4A4Dh
6 F% `7 M. j3 A" u' X- j' k6 j/ v& kWhich are the 'magic values' used by SoftIce." r, _* f; \# O2 K0 r' L
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
1 o0 P  D8 s/ c1 M: E0 i7 n3 _# f1 l2 s1 B8 x% w6 I
Here is one example from the file "Haspinst.exe" which is the dongle HASP% ?: P9 X$ o* Q  ^" G
Envelope utility use to protect DOS applications:
- C; f5 d9 c, Y: Z: L) Y2 ?! E" l  l8 C4 L
' @' D9 M. U/ T
4C19:0095   MOV    AX,0911  ; execute command.
( x# g! O2 N4 K1 n' [4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).7 i2 D; k8 v2 L2 [. x" ]& s7 N
4C19:009A   MOV    SI,4647  ; 1st magic value.1 D, A0 ~6 i% j) R" `
4C19:009D   MOV    DI,4A4D  ; 2nd magic value.
. y4 A7 m) t+ C) ]4 s4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
% I/ T7 r9 J6 P2 {  {6 n# Q# @* a4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute  A5 O! u5 Y/ Y0 g  ~+ y2 Q4 Z8 C
4C19:00A4   INC    CX
# Q# b; L. s1 }4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute: s! J- m+ ^, o
4C19:00A8   JB     0095     ; 6 different commands.
+ d* |! ^7 H  U2 P7 j$ U: ^8 v4C19:00AA   JMP    0002     ; Bad_Guy jmp back.- p8 {8 N) G. ^+ V4 D2 E& E! U
4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)
9 e2 L% w+ x9 u' d( Z
8 V* k' _2 j# G2 \2 Z; c. ?$ G+ |The program will execute 6 different SIce commands located at ds:dx, which9 W$ G5 G- j1 ]4 T7 L& u
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.! Y' V: p2 u2 I( u! Y% e$ ]/ x

3 k: j3 I/ |$ L% [5 q0 z8 W* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
  A6 T, u, l) q___________________________________________________________________________
2 c' N/ X- ~+ d4 G4 Q
. |) ^! R2 R6 ~- F' }- U
! ]' I/ |. v8 }1 v5 u: E1 ]3 {Method 03, s+ }% z- i. p/ y; \; `
=========
; ~' |* ^( q- g1 z* k9 L/ y3 k$ F* j2 [* C. c* a  b
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
  u' ^; i0 Z9 s1 ]1 {  _(API Get entry point)4 U8 E+ u" x! B" H1 Y% p  e* y
        
; `% ?  P9 T, F7 M
8 O+ d8 D3 w6 |8 {1 ^. j4 u    xor     di,di
  y& Z8 g! u$ Y7 M9 r& I    mov     es,di
9 U5 {; {1 C: g+ @* h# o1 ]6 o    mov     ax, 1684h      
$ ^$ q* k: ~6 c3 `; x% n    mov     bx, 0202h       ; VxD ID of winice7 s& j- k2 y$ d: f, i' E
    int     2Fh
# y, W% y. G4 x# D5 C    mov     ax, es          ; ES:DI -&gt; VxD API entry point
  a8 o+ b% r3 k) X    add     ax, di$ M- p- y( t+ E$ C3 c
    test    ax,ax
6 A/ `# G3 S- s  _% a/ h    jnz     SoftICE_Detected1 t$ G' p/ h; m% ]( F9 F
$ p8 f: X: Z) b0 N1 v
___________________________________________________________________________
5 R* K$ E9 l2 q* I" F1 o. \; h8 q6 u, P  y0 w% R
Method 04
# e* }( S1 G, q. M6 u=========
: f4 ~8 m  X; Q% Q; i
' I5 B9 k$ ?& B4 y( A: MMethod identical to the preceding one except that it seeks the ID of SoftICE
' W0 ^: }+ {9 C* k. NGFX VxD.
! a: D* W3 P( R2 a' j5 \4 D% M, [+ h2 H
    xor     di,di9 @: K; p+ p- Q
    mov     es,di
% r4 W9 @/ z9 _7 }5 f" [! d    mov     ax, 1684h         |9 I& d+ V2 P/ ]& b; Q
    mov     bx, 7a5Fh       ; VxD ID of SIWVID
5 f3 c4 p+ j' D7 c3 J: r    int     2fh, i+ u; \7 K* F5 u- X# \) }
    mov     ax, es          ; ES:DI -&gt; VxD API entry point
, k6 j: I* }1 q0 c. C/ v0 ?    add     ax, di
1 C3 K: |+ G: P! e+ W, y    test    ax,ax3 p# [* K1 D) [- U" d
    jnz     SoftICE_Detected7 B+ \0 P" ?9 ^/ {5 S, W; [
! i3 A/ M/ [4 J/ ~2 ~! f
__________________________________________________________________________
* R: r" `$ q5 h1 l; N
( g& Z) E7 W# g4 d" k
# n) I9 g6 L4 B! b" v: lMethod 05
3 _# @. i* \7 z, i5 V1 m' s! d: B, s=========! {2 m& |. L* e* T- Z+ \7 G

9 L8 U6 @" Z& r/ J2 ~' CMethod seeking the 'magic number' 0F386h returned (in ax) by all system
. |% H, I7 F+ {) A' ]debugger. It calls the int 41h, function 4Fh.
' D7 a1 C' W. Z7 aThere are several alternatives.  6 {9 m& ?/ @- M

/ Q- D6 ]$ i" c9 Q/ `8 VThe following one is the simplest:4 r( R2 k6 J6 f* f
0 E. Z# X' e5 X. P/ A
    mov     ax,4fh4 ~& O& k  O8 @8 D. G' e) G
    int     41h
) R& m0 q( P4 K4 t8 ?& }9 c/ i    cmp     ax, 0F386
$ H  j" b3 y" w% t    jz      SoftICE_detected7 K# q: j- p, S9 W

2 D0 b. R  y4 Y3 {0 \$ N7 x
: V# p$ V% C" M" eNext method as well as the following one are 2 examples from Stone's 1 ]+ e, y  f+ m" I9 u6 L
"stn-wid.zip" (www.cracking.net):3 u2 Z4 j* ]3 [) M+ W
; R6 W9 X7 k1 H! V- Z" _4 c
    mov     bx, cs
4 J3 G, N( L: h% [    lea     dx, int41handler27 z; a! D: r; B
    xchg    dx, es:[41h*4]# W2 K. ]1 t0 Y
    xchg    bx, es:[41h*4+2]% T' x  K& }3 a$ p
    mov     ax,4fh, W/ K, q1 _3 D5 ~9 B" z
    int     41h8 Y% ]" Q& w- {; S; f
    xchg    dx, es:[41h*4]
) Y0 e8 j. N0 q2 c    xchg    bx, es:[41h*4+2]' @" Z8 r9 w" S7 l  X% |
    cmp     ax, 0f386h
* K- H+ R1 c7 g4 T    jz      SoftICE_detected
" Y! V7 R# h2 D. N) a: I$ f) }/ C! ~) |" h8 u0 W- C
int41handler2 PROC3 S4 }% S, e/ |- I' x, j, K
    iret
# h% l: ]/ u1 kint41handler2 ENDP. R7 b' P) U( }9 I; Q7 |

, K0 M' U/ S& N- G  I
, a) m: n  I% c0 _; F_________________________________________________________________________
0 F8 K- I1 `+ {) R  u$ F8 n$ W% [( P- j- I$ _0 Z  l3 B1 Y

  v  L/ c* a/ e( nMethod 066 I; \! Z" `* b: U8 f
=========
# Y+ i  A/ {, C3 u, K: `; z
1 R! s8 }3 x: }( y6 M
6 h: j/ k2 E8 H* _2nd method similar to the preceding one but more difficult to detect:
) _; A! N% S# I! Y0 b/ b2 M3 c% q) q: X3 t$ d, ]' y
, f* [/ L; |- {% S. c3 `
int41handler PROC
3 n- k& |# @5 [' I- a. h' n    mov     cl,al
* ]2 y' _! i' R- t    iret& L0 }7 e: {7 ~( d2 o' s
int41handler ENDP- T  B1 r7 Q% m* j7 B3 W
  ~' g% u6 h) E5 {
3 J. |/ f8 j# N! p
    xor     ax,ax( B7 Y: ~+ [' \* Z; I9 V
    mov     es,ax; u# X& w4 C$ q$ v! P
    mov     bx, cs
  W) O9 f* C1 j+ Y: |    lea     dx, int41handler
+ k# ~8 F# @2 B3 |0 {/ D    xchg    dx, es:[41h*4]
* h/ {3 Z/ ]# O; |: ?# n; ^    xchg    bx, es:[41h*4+2]9 y/ i* Y. W6 _" j9 J. k) ]
    in      al, 40h
0 ^6 i# ~8 J) C+ S% j9 D/ \5 o    xor     cx,cx. }% {% ]- |! k9 M$ d! H0 a6 k
    int     41h
8 o2 _; v) @3 G) N2 _1 s; _  r    xchg    dx, es:[41h*4]
( ~8 _# F" `1 m3 y+ H. x    xchg    bx, es:[41h*4+2]
6 b& K0 e- Z& g! ?    cmp     cl,al5 f/ n7 V) y( y; V0 @7 ]
    jnz     SoftICE_detected3 i( L, n5 q: X

( y4 A. m; A8 M9 r0 b  p, X4 W- e: P2 h_________________________________________________________________________
  h! c$ G  ?0 G3 v% b8 I/ _" {# R( t; ^# ?, m0 j0 ^
Method 07
2 d# Y8 ]" B2 m$ w6 ]=========4 ~" H+ E5 q  e3 w8 f
, }. \1 `% N( i* t
Method of detection of the WinICE handler in the int68h (V86)( ~. q6 z% M- Z0 K5 d
* ^9 I0 x) q; ?* m$ A9 T
    mov     ah,43h/ e4 |- S( G3 f  T1 n1 X6 F, J7 r% W
    int     68h
# ?! p) s- o: K) \' a4 y+ x' `3 z  Y    cmp     ax,0F386h
5 ~" U& `* b1 F6 D7 {2 G/ g    jz      SoftICE_Detected- F/ }/ h5 T: e
: b4 |; L1 s$ [$ R
' t9 m0 `9 R+ d+ Q* b3 G5 N0 L# Z
=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit  c! Z8 @( f  H% Z# w
   app like this:  Z7 U: ^: f5 h- L, U7 \
1 h9 Y0 M3 U* X. c/ d* n
   BPX exec_int if ax==68
4 {& T, C3 P, N  o9 `3 j   (function called is located at byte ptr [ebp+1Dh] and client eip is
1 `' o' t+ I" t8 ^   located at [ebp+48h] for 32Bit apps)
1 E! m& z% ~/ i  B0 x0 o1 O__________________________________________________________________________2 |" Y( }, Z# c+ y  T3 a; ~

  e( `9 ?1 R! s9 x2 v3 J$ R
: s$ N# ^0 q( W% E5 L4 y3 q* F8 b; vMethod 08
; }- j- u  {% e" r=========
, q6 b5 |9 E7 T2 V7 ^& u
! U" }- z2 j/ b7 C% n6 hIt is not a method of detection of SoftICE but a possibility to crash the
  E" a& e" K) N% q2 H' gsystem by intercepting int 01h and int 03h and redirecting them to another
7 H6 A2 r4 N7 F8 ~  Xroutine.9 M# s5 v/ g2 V
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points$ H% M: L- C$ r8 `7 e+ O/ D, Q
to the new routine to execute (hangs computer...)  k) U8 h+ C2 b" M

: Y+ d/ D- w) B/ f( E0 k    mov     ah, 25h
6 v. G' m7 J  ]( [4 i8 s2 O$ M    mov     al, Int_Number (01h or 03h)3 X( x2 {" W/ Q7 z/ w8 M
    mov     dx, offset New_Int_Routine- N- t# o* m# M1 d  `& a
    int     21h' w, V# k% l/ q( X# o
* ^2 M& S1 ^! X% k+ L
__________________________________________________________________________
8 s% |5 K3 w$ G) v1 M- e: L0 j2 p+ v! j
Method 099 Y. R9 W+ V* }1 s/ @1 k! V
=========" d) O- z: @9 q" U9 ~# U+ S
, d/ ~6 V5 J" @
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only6 d. t) s: W& h$ i! ~
performed in ring0 (VxD or a ring3 app using the VxdCall).
  U- d( G' b7 L% i; JThe Get_DDB service is used to determine whether or not a VxD is installed
# G$ `; v! v: w0 F4 x1 `  Tfor the specified device and returns a Device Description Block (in ecx) for4 V7 c( U1 U0 p/ h3 [) m
that device if it is installed.; {; Y7 {0 j, ], u5 M
3 D9 P) O' o  M, C) d; x7 @. i
   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID" p- P( y- ]* R9 a
   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
3 c2 {6 P# d+ x7 r7 _, z   VMMCall Get_DDB1 J' i  S' d7 [5 j; s
   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed# ]% ?" B. \* x: a' B" W

7 T, ^; y* P8 h+ [: s0 bNote as well that you can easily detect this method with SoftICE:
. z+ c! ?* o0 B0 w+ M   bpx Get_DDB if ax==0202 || ax==7a5fh: I4 D/ y) }* {2 p! j9 C

( e8 ?# }' X5 j( l0 S__________________________________________________________________________
1 B+ ]  O3 `' j: w/ C8 S% [. s* {2 l+ T8 b' P! l, A& T' ]# m* N
Method 10
! V; z& [8 E, P, M9 C. ?& [8 ]! V=========
4 Q5 \! q2 z. f0 Z  ^
& }  y, k. y6 l' `& n$ G& l: S8 x=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with! A2 k8 j' p9 _0 t0 f6 [5 u2 F
  SoftICE while the option is enable!!$ g6 a) t. H) r& l1 x

' z* W& y9 t8 V/ |& MThis trick is very efficient:0 O  D- W* J& t) b: I2 N( {
by checking the Debug Registers, you can detect if SoftICE is loaded  ?+ V4 h' J7 A* @0 G8 H( J
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
  o" S* O; _8 n8 l% Athere are some memory breakpoints set (dr0 to dr3) simply by reading their: i) d+ H4 {5 K* I: U) R* o
value (in ring0 only). Values can be manipulated and or changed as well
$ ~% F" v; p9 m! z5 I6 z(clearing BPMs for instance)5 }- j" _& h+ `. f( W7 D# O# U

7 [; Q+ O4 t; ~+ E+ @, w6 Z' H__________________________________________________________________________
" g7 w8 O0 a0 X2 `& r! K
+ K% N% R# s" H* y; yMethod 11
  F6 ]) A; ]( i1 N=========
, P% m5 y7 h+ w2 d- ^5 }, p1 X( T8 y7 m% @/ F8 `4 M; W
This method is most known as 'MeltICE' because it has been freely distributed  q/ t+ J- d& L3 D
via www.winfiles.com. However it was first used by NuMega people to allow
4 z) h2 E/ N* l  C: v; |; N3 oSymbol Loader to check if SoftICE was active or not (the code is located+ P6 l' I7 W1 k" h1 y+ N  ?; G0 z  E
inside nmtrans.dll).7 C2 F' [4 A. ^. b! U8 M) Q# a

1 l4 X: v3 s: k" l# bThe way it works is very simple:
2 _$ N4 Q* B% T9 t7 @It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for2 l0 z6 U' x% Q
WinNT) with the CreateFileA API." B/ w# Y' O$ @" F

2 i4 s$ u( H+ g; e1 AHere is a sample (checking for 'SICE'):8 Z- G; _; \9 E6 e

, O: |% k7 O- |3 k5 t0 u5 M9 wBOOL IsSoftIce95Loaded()
2 _# y2 i& F: U5 v5 B& B- j{
! L6 _- n: j) I6 C  y   HANDLE hFile;  ( V7 a4 [& w& S, T6 D
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
1 v4 f# Y' H) `3 J/ f: R' m1 U                      FILE_SHARE_READ | FILE_SHARE_WRITE,
" I! i9 V! g% n# B+ ]- v; A0 v                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
) Y2 {9 F  @- r& k' |# w   if( hFile != INVALID_HANDLE_VALUE )
4 m& O! Y. R! y( {   {; I: y. G5 v5 j/ b% @0 `7 K% H
      CloseHandle(hFile);% n- L" Z/ S% l% ~! ]
      return TRUE;. f! D6 Q' C/ k' g# D
   }
& H" {2 O" h7 h! G: @' K* D   return FALSE;
- v; r; r3 N7 o2 T$ `2 n}% g* q1 f" l1 J* T. h3 W8 @

( ^& |$ M9 Q7 t3 zAlthough this trick calls the CreateFileA function, don't even expect to be
8 k: s8 W0 s' n, |" [able to intercept it by installing a IFS hook: it will not work, no way!5 Q2 |4 A5 }4 @, o
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
. D4 [5 l6 c+ y7 z7 uservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
' F3 a5 ?! ~5 c* W' v! k) R; }, Oand then browse the DDB list until it find the VxD and its DDB_Control_Proc
: g5 X0 h7 c+ W) H: F% z/ P) f) Rfield.; V" E9 \5 i$ L. W
In fact, its purpose is not to load/unload VxDs but only to send a
- h4 C5 U$ y% ^W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
  L1 @5 R4 T! s6 F+ C8 U6 kto the VxD Control_Dispatch proc (how the hell a shareware soft could try
3 f0 P6 O4 r8 ?3 i( j  V& a! pto load/unload a non-dynamically loadable driver such as SoftICE ;-).
2 f% n6 v2 S" I- ^) @If the VxD is loaded, it will always clear eax and the Carry flag to allow( I3 F- B9 j& A8 H# S2 `
its handle to be opened and then, will be detected.
+ O: D9 H( m: wYou can check that simply by hooking Winice.exe control proc entry point, i( `% v, Z9 q- ~2 p( y9 H
while running MeltICE.
6 j- y, \5 q. o) B- J2 s, q0 _' @) y
* D2 G* C( `# [! k1 E0 N3 p. R) Y0 k9 s& x4 ^! A
  00401067:  push      00402025    ; \\.\SICE0 N5 Y+ a# c4 D
  0040106C:  call      CreateFileA2 e2 E% X. }3 m
  00401071:  cmp       eax,-001( D/ @  c* L' X& H6 y
  00401074:  je        00401091, u# e8 r; m1 R/ x+ N6 j7 t

/ H- j' F& m& @3 B0 J* a1 x$ J5 W9 w# i1 l
There could be hundreds of BPX you could use to detect this trick.
- H& B# g' }, m6 u# L- e* P-The most classical one is:$ X; v' }% F* F: R: {- D' q
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
  a* ], M8 f  W2 ?    *(esp-&gt;4+4)=='NTIC'
0 X6 i$ I  V8 z  F" f
0 a) Z- o' F' f# ]# d-The most exotic ones (could be very slooooow :-(
; p- v; {6 s1 e$ I   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  " U4 K; ~: c6 ^) P( P/ K
     ;will break 3 times :-(, e" c- L2 B6 X. W0 J, I0 X

+ M8 s/ M- q9 w' N-or (a bit) faster:
1 S$ l, m9 b$ a   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
9 }) `- |; o2 w" U
# ^; a+ W* @) U+ q& O   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  
! s3 R" @8 }1 G; i% P     ;will break 3 times :-(- g& C( g2 W) p4 T

! @- \# \$ f' B: w! W' G# V! Z-Much faster:
. @9 @2 n) n0 T) u! ~, B# z   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'
9 x6 N8 M8 `! [# b5 T
3 B+ {: o1 Z8 t) vNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
/ B/ j/ e; w0 P$ z* ~& Tfunction to do the same job:
1 z/ z: N: P7 D3 ^5 f7 Z! m, e9 \+ X! @7 G
   push    00                        ; OF_READ
; `0 C6 p9 G! a4 C& `   mov     eax,[00656634]            ; '\\.\SICE',0# I' }$ r+ f( r5 n) C% N
   push    eax% Z, y$ X7 E+ W9 [, y$ s
   call    KERNEL32!_lopen& A$ U2 w) w+ o2 \' I' e- z
   inc     eax
3 j4 C6 V' g7 @+ {: m! I- J   jnz     00650589                  ; detected
3 E; j+ b1 X: u4 |   push    00                        ; OF_READ
' @2 c! b: |1 H, l- `   mov     eax,[00656638]            ; '\\.\SICE'5 V+ E& ~* t/ e1 @5 q( \
   push    eax
- b0 k9 p; _; B2 l0 ]8 D   call    KERNEL32!_lopen& o$ x$ t+ H, b  W5 [/ j
   inc     eax
" [& F: \. g" M$ ^: y   jz      006505ae                  ; not detected
7 j/ h; o3 q' S. I+ Z" t! e
# m) \3 ?# F& c+ U( F4 _6 h# {9 [* q. `* t
__________________________________________________________________________
4 b# r0 w& F- b* x7 H! x- r: n" C4 L- O: T4 E5 Q
Method 12! q2 x! @7 H% U: l) T' Q
=========- f+ w. D, ]* i% N
# K. _* F: F1 k+ b+ y6 T
This trick is similar to int41h/4fh Debugger installation check (code 051 @" D. Y: g4 P
&amp; 06) but very limited because it's only available for Win95/98 (not NT)# D0 \( V7 d2 r: }
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.$ Z$ m  ?6 D; I  z- W# z( v1 l
/ F- c0 T# ]. `& \  F
   push  0000004fh         ; function 4fh% j% T! l) W! y+ b/ A/ ]6 k0 V
   push  002a002ah         ; high word specifies which VxD (VWIN32)
- l# T/ M, C5 Z& J: m                           ; low word specifies which service3 J' t' P( v2 \& @" K$ B
                             (VWIN32_Int41Dispatch)( ]7 ]- r( q3 d! U4 \
   call  Kernel32!ORD_001  ; VxdCall
5 v/ ^2 z8 B3 ^! y   cmp   ax, 0f386h        ; magic number returned by system debuggers
3 W1 ?! j" C8 d   jz    SoftICE_detected: }7 ]* T9 z. {. h; `1 w4 p3 M

# |+ V0 P1 h/ H) _# y: G8 f4 xHere again, several ways to detect it:: v6 s1 o4 ^2 ?2 t/ m. r

& D0 M% C9 U- y9 [( D% T% T8 ^: e* J0 a    BPINT 41 if ax==4f! E) t1 u( U# F

, @( B6 ^/ p- {0 t* v, G    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one6 _: p4 Y, D. b) Z, d& x. d

, y; @- c+ S% D& N0 M/ B! q    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
3 c. \  S7 K. B( L5 H0 b8 h* L; {; H5 @# G* A0 d- ~$ m
    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!2 w+ @/ z/ I* p9 C- ?/ ]
4 I. ?; l5 j, p  {4 |: W
__________________________________________________________________________
" Z+ L. n; M. O' x0 H( \% |! R2 I5 @* M, E
Method 13
# o8 N9 {8 N' v+ \" l=========# _6 n; p$ b  ?2 A; Q" i5 h

7 ]: H1 K" i! E/ o8 ~; O0 QNot a real method of detection, but a good way to know if SoftICE is
* `; M* q" l  l" {5 |# Jinstalled on a computer and to locate its installation directory.
# T" G( ?- M, {# K* Q3 xIt is used by few softs which access the following registry keys (usually #2) :
8 Q* T! j# A# H* y& X, Y* O2 _6 r' |9 P) g# E
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
% o$ o8 t: Q. j3 w& o' r" ~3 k\Uninstall\SoftICE; F+ }0 x6 ?, b4 _7 t+ g
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
: r& T& o5 e% r+ R8 v+ O-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
, V1 A1 r' ^* h2 q5 z\App Paths\Loader32.Exe
- m5 M; O/ i1 }) A% f1 H% V$ i7 x5 c6 i( o

8 M3 p" D& j/ o( FNote that some nasty apps could then erase all files from SoftICE directory; n4 j$ N  m( f1 ~: l
(I faced that once :-(% V; K# \& O. U; `8 s1 ]2 w
' @6 x& ?+ m8 r; v( u
Useful breakpoint to detect it:" B& D4 P1 K% a* f, J
7 u7 v$ l% Q  \. [5 H/ I
     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE') D% F1 v4 @/ X2 ^9 ]  M0 `
/ D9 m9 J: t8 ]* d. n0 Y" |$ O
__________________________________________________________________________
+ {- }7 [0 m3 P1 J: g' b5 `, ]( C
6 h1 q0 w- k4 X! W' Q; }/ D3 N3 e' K9 f8 y
Method 14 3 |4 w9 Z% m0 b8 ?
=========
: H: r5 a) J, K; O4 G% C' w2 A
8 t/ P* j1 @( f! _4 qA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
6 F2 b& c7 q" lis to determines whether a debugger is running on your system (ring0 only).. u- r: a$ E1 @4 Z: E7 A- ^5 L
- L" @& t- q4 r3 R; P
   VMMCall Test_Debug_Installed- k& p  B1 J' }  m( e9 {6 V* w
   je      not_installed
0 n  f# C6 v" P" H6 \
% ^( a1 w- g+ ]6 rThis service just checks a flag.
& `: L7 P+ B% Z6 {) g# m</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关注公众号

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

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

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