About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>. @6 \9 i; [# F3 U+ p! Q
<TBODY>0 f* @9 M, z5 n
<TR>% b# ]/ i2 i2 R- A1 I
<TD><PRE>Method 01
9 P3 B1 q5 }4 c# ~2 J=========
0 z0 s0 [7 ]) z$ `1 w+ a* G1 n; m9 U# H2 }) ~( ]4 {7 O8 r
This method of detection of SoftICE (as well as the following one) is9 _, R4 J* T) a2 `; O1 k* a
used by the majority of packers/encryptors found on Internet.$ Q0 u/ m+ {$ ~3 |3 W/ E3 O; f
It seeks the signature of BoundsChecker in SoftICE
; Y, w9 D& W# i/ m4 A, _' d8 d, c( Z! f3 c
    mov     ebp, 04243484Bh        ; 'BCHK'5 O5 K+ y. {( @5 k: T) l
    mov     ax, 04h
( e7 D! [2 X$ B$ {3 D  ~+ e( u    int     3      
+ P" v% T6 {4 q! o- x1 L    cmp     al,42 n0 G+ Z, N  m) U
    jnz     SoftICE_Detected
# J1 w. K! p4 o6 k2 g, h3 K3 B$ k! Z8 e) P/ u; C6 a0 ?# P
___________________________________________________________________________0 g8 }2 h- U8 X
' Z. {8 p$ X& g3 W
Method 02
9 @5 O7 M1 I- j7 }+ U=========
, \" q) f- ^5 c9 O  S
1 ]( b! j) s% x4 @$ O& x& @/ W, XStill a method very much used (perhaps the most frequent one).  It is used! U+ Y( `, H) R, l$ b& F& w; ^# h1 f+ M
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,( ^  p  f, d% c: T
or execute SoftICE commands...
/ [6 F* l# V) ~- A( l* IIt is also used to crash SoftICE and to force it to execute any commands9 \4 _+ ?8 f+ v8 h7 E: Q$ W) Z' y: b
(HBOOT...) :-((  
" s2 f/ G* V& f. N
0 ^: B0 |; }! b) WHere is a quick description:
5 j6 ^: q. [3 ~-AX = 0910h   (Display string in SIce windows)
% X) y* q- ?5 e8 G+ |-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)
" R# @6 W. b3 q$ D. a5 Q-AX = 0912h   (Get breakpoint infos)
  f4 X* c8 U2 q; F5 O9 B/ k-AX = 0913h   (Set Sice breakpoints)
0 A" t8 p. l0 A/ f* p-AX = 0914h   (Remove SIce breakoints)
' W0 T* f/ B* i/ r& y) ?8 _8 B5 W. K1 a
Each time you'll meet this trick, you'll see:9 r  [2 [9 {# w8 y
-SI = 4647h* O8 s" Y1 w' }: k0 B2 I% {
-DI = 4A4Dh
1 U$ M4 _& j( I+ bWhich are the 'magic values' used by SoftIce.
( J. ?# p5 ?. p. p* B& |! PFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
/ k3 F7 s4 I4 M( a' j3 m: c
5 L/ O7 W6 M& i9 d4 t# @! i; GHere is one example from the file "Haspinst.exe" which is the dongle HASP+ u! G3 B: w/ i6 y' Z
Envelope utility use to protect DOS applications:7 }" c. u+ r5 ~0 O" j
, X5 t# D9 s( A
6 v* q- u# r1 `  }0 G- t: r
4C19:0095   MOV    AX,0911  ; execute command.. b- d5 S0 j9 e# ~
4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
' J, o. m. o2 C% p/ c4C19:009A   MOV    SI,4647  ; 1st magic value.
# L+ j! r7 j2 Z$ {7 @4C19:009D   MOV    DI,4A4D  ; 2nd magic value.0 H2 W! V& p  k# b7 O, `
4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*), Q7 e, L- v! a4 J
4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute
  j6 j1 j6 I0 p- m. [, w& ?, n4C19:00A4   INC    CX  z, B( q6 k! {* V3 v# h. A
4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute
6 p' c# p' Y" H, {3 A. \4C19:00A8   JB     0095     ; 6 different commands.. ?' M7 I! [5 {- S: n9 F
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.& t9 r" v: d! G8 l' p
4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)0 T' K' l( x- X, h4 X; Y0 z

! y2 b& ^+ r8 E2 PThe program will execute 6 different SIce commands located at ds:dx, which3 x( f2 |. ~! U# c1 R9 |, O, W
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.& |( h0 |6 D  U. ?& x, a1 X" n

9 e7 `0 w- G4 T* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.6 T- Z# _8 Q9 E  g  C; ^2 Z2 {3 U
___________________________________________________________________________# |6 ^$ k& a. |: \( p& p
: }" U/ P( T  {

; k0 G) Q# _. lMethod 03
: o  H) K/ ^+ J0 C1 `' P7 Z=========
# ^  R# s. v  Y% D5 @  _! |
$ @' Q  K9 G# J- j9 t3 e* WLess used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h; k& J( i7 X' R( S
(API Get entry point)$ U8 t" [4 K( {
        8 p$ d1 L" b' S) [
2 z! c: e$ }* B/ s
    xor     di,di4 _0 x- _* L2 U& v% P8 C3 l2 _
    mov     es,di/ {6 s$ i  N% s9 e( ]3 s
    mov     ax, 1684h      
" r8 W& s& w/ Z% I0 N5 d& t    mov     bx, 0202h       ; VxD ID of winice
8 y8 s; h9 n. J1 Z, X& }: t    int     2Fh3 J0 ^" t$ Z! W, l
    mov     ax, es          ; ES:DI -&gt; VxD API entry point/ O! E* n/ z- a# N1 h/ x* D
    add     ax, di4 p) ^# U7 |0 s
    test    ax,ax5 q' ]. U5 l  V4 U+ W! w' s
    jnz     SoftICE_Detected& U1 m5 ]0 I3 w) }: M' i

6 k& i4 [+ @6 Q___________________________________________________________________________* q* I7 R8 p/ R/ M
0 R4 `% ^$ `6 b- R( @
Method 04
9 [) v2 k" y3 N" c/ |=========0 c6 x+ ~# n8 F5 @

: ^6 B) W. |4 I- GMethod identical to the preceding one except that it seeks the ID of SoftICE7 X8 h8 J; \  ]5 _2 w) ?
GFX VxD.
- {" y+ k: c$ ^
2 E( j1 W9 R+ ^    xor     di,di3 V& T0 a: G5 q# N7 a) U
    mov     es,di0 v' @! O6 \( T: h; N
    mov     ax, 1684h       6 q) U" L% D1 w% X3 Q8 r
    mov     bx, 7a5Fh       ; VxD ID of SIWVID$ D* ~* \% |: V- Y9 T* E
    int     2fh
7 Q# V7 M% w; r: H/ M, F  B    mov     ax, es          ; ES:DI -&gt; VxD API entry point7 Z4 Y8 x/ }$ o9 G
    add     ax, di
1 f0 w' s& c0 n9 ?) b    test    ax,ax& v9 T" J! Y; j# k, T
    jnz     SoftICE_Detected, a$ J5 @) F# {! {
! s. m2 t+ h7 H& V7 C5 x4 l& D
__________________________________________________________________________
2 w9 T+ I$ l0 K1 P
: i% L/ m  }  P- w0 E# L- Y7 h/ e
: i& q+ W) ]! z' F- ^: O+ m* y3 _Method 05; Q- u% X9 p7 v, d8 W
=========
# `" X( Z8 h9 d) I6 w# ~& d) [1 P3 F) b% O- n
Method seeking the 'magic number' 0F386h returned (in ax) by all system" ]* f: V, J0 w9 Z6 m
debugger. It calls the int 41h, function 4Fh.
1 |/ [8 m% Q, x" `9 }4 u' K7 OThere are several alternatives.  - L! M4 ?4 v& U! E3 ?1 d

4 [- A$ G# [3 o- ]The following one is the simplest:# s6 F$ {$ Y( |' b: q! ^1 K

1 ]1 z! f+ Q) f) k! V; H    mov     ax,4fh
1 a7 o$ S, D' r! X" v3 V: Z    int     41h
* f4 R. F! R0 G0 M: l9 l    cmp     ax, 0F386$ T+ l" \9 y# r1 D
    jz      SoftICE_detected
* p7 m9 P/ G7 d% X5 j
4 U9 S: ^$ O3 m, g8 u, C7 t" ~% {: d0 j/ F- q+ ?6 ^% H$ x
Next method as well as the following one are 2 examples from Stone's - o3 i: D9 Z- K% b" p  i: X
"stn-wid.zip" (www.cracking.net):
/ L$ G4 D8 D1 i. E) @3 J/ Z/ S6 R2 M: u1 ]
    mov     bx, cs
1 t0 N( D; X3 a    lea     dx, int41handler29 b( f  \3 P+ u5 Y* }) A6 j3 e
    xchg    dx, es:[41h*4]; l$ n3 ~& w7 d9 a2 }- Y
    xchg    bx, es:[41h*4+2]  Y1 F" d( G% M
    mov     ax,4fh) f+ S7 r' s0 [9 ^/ ]3 ^
    int     41h: L% |( U: T5 d# L4 \1 {* ^% K
    xchg    dx, es:[41h*4]0 E2 a& Y7 {7 n0 s4 A4 ]% S
    xchg    bx, es:[41h*4+2]5 z% `9 u( p" G1 K( x
    cmp     ax, 0f386h& Q0 Y5 u* |# w9 g9 S2 A
    jz      SoftICE_detected# o* Y* J# F- o4 v4 j( }" N

! I$ P. k: H$ t& I' l' qint41handler2 PROC
5 D7 S% W; W' r( _/ ~0 e0 ?& j- t8 a    iret- F8 U7 r& r  R9 A
int41handler2 ENDP' s% n/ }, \5 ?/ y) d2 N: z' @
& i# @3 G3 B) M9 m
, s, }9 `- @$ K
_________________________________________________________________________
9 D4 t& J" K$ v/ {5 n
* U4 }4 I0 @1 u
+ B: f: G+ G4 m/ t# u6 iMethod 06
* y  z: m6 t1 ?* f=========
& `( U3 W, _$ w4 E7 V" J
" c* T$ ~' }) e! @0 f4 m" i7 }& d7 r" g# E
2nd method similar to the preceding one but more difficult to detect:" N! ^. m! ?8 N3 L( m

- }0 _% ^* g' p! O, ^! D+ \9 x+ Z) e$ ~
int41handler PROC) m. S4 G& u. l* d' u* @3 V
    mov     cl,al# Z: y; v; Z1 \# ]: T
    iret" O& L- M' W( h! J" s) m. W
int41handler ENDP7 V  [  \9 }% k! q# g* `
8 b3 F  f# W! k9 |
( g6 Z( p. y9 X! [2 f1 ~
    xor     ax,ax
* v5 G" a' W; Z. R$ H$ b- B7 w2 q    mov     es,ax
4 }2 O8 N1 x9 W. j  `& [7 t    mov     bx, cs- ]- X# x5 C$ H' x( {
    lea     dx, int41handler
/ \* A! ?& W' q$ p2 f' i/ p0 f    xchg    dx, es:[41h*4]
* N: H. |2 K  H    xchg    bx, es:[41h*4+2]# g1 P, p  ~8 X2 [3 D+ y
    in      al, 40h
# \3 v1 `, N: S$ h- f% K    xor     cx,cx* p% U4 u, \! M9 m7 a( w
    int     41h
1 E7 @4 U' n1 I0 e9 f5 V  |    xchg    dx, es:[41h*4]3 S. a( y/ C  p. P& H
    xchg    bx, es:[41h*4+2]+ q! Y/ _! T. o% ]# O/ z8 ?
    cmp     cl,al
# _$ h! Z; e3 a5 x7 q- @    jnz     SoftICE_detected" P, v% E9 ~2 e8 P$ G5 P" e& X4 \
. q, B8 L" \7 S  @. J
_________________________________________________________________________1 x4 O! p* V  q; Y) T( k

2 {1 k1 u6 b) L7 {1 [Method 07
5 k3 A3 c% K, e$ g/ m( D=========3 ~% H1 h7 ~% r, ~
1 J$ R% U$ Y" i% v
Method of detection of the WinICE handler in the int68h (V86)
8 G* G% ?) J2 P9 n* }5 L
$ c4 q  J' D* ?6 ?1 h1 g+ P& [    mov     ah,43h1 }; s! J" O6 B' I& P
    int     68h
$ C7 u6 e( ]' _7 w( C" _6 y+ v8 a    cmp     ax,0F386h: M; K( E' {) Q  G: w" d) I
    jz      SoftICE_Detected: q  w+ i( {+ v. y9 _; `* z
/ L; @# o4 }$ `% b. C
" K& V4 H' N+ [
=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit! v! ~& d$ B! N/ I9 P( z
   app like this:! ~9 K; `+ v+ q5 m! J+ Z/ Y2 b

9 ~# P6 d, ?9 K1 f8 J5 f   BPX exec_int if ax==681 g6 y/ `1 }$ S; x
   (function called is located at byte ptr [ebp+1Dh] and client eip is4 l' |( U0 L# J4 _2 Y: f9 e
   located at [ebp+48h] for 32Bit apps)! _4 W/ G5 j6 W
__________________________________________________________________________* G5 T* D- {* o/ B# Y4 I
( _( d  n% v! D, K/ `
& o6 P  {) M! J4 ]
Method 080 w  [6 O; ?" ?' w" O7 i
=========
. [3 O7 {3 T# S' |+ F& \! ?2 h
. U5 g; A# t9 `" h' j/ h: E1 oIt is not a method of detection of SoftICE but a possibility to crash the
; ?( H) h, F6 [system by intercepting int 01h and int 03h and redirecting them to another9 [) A4 K9 C$ E. P' R7 T; S( K
routine.) E' q+ b5 E) s6 C( n
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points9 m9 _( |, C+ V& \# D) A" y
to the new routine to execute (hangs computer...)
6 t- w5 X5 D: E: J
/ B2 H' w- H) X0 n    mov     ah, 25h
' Z* _$ L; @% S* ^- P8 f' q    mov     al, Int_Number (01h or 03h)
8 P* Q% `5 Z9 R8 C    mov     dx, offset New_Int_Routine% V. f" X& G4 f1 g8 j( p5 [
    int     21h
1 i( E' x/ Y& e$ l
9 }) x! Z# G  c6 Z__________________________________________________________________________
6 Q  W* s& R' N/ r8 g$ D9 S0 g- \( T/ `% y0 y3 t9 T1 |' t: p
Method 09% y  e6 D8 n" h1 ^
=========
/ d) o9 h6 g% v
4 [1 h& w6 W0 @, |This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only# R5 ~$ K3 x& X8 p
performed in ring0 (VxD or a ring3 app using the VxdCall).
& Q/ s- M9 O6 i, M5 Y9 |The Get_DDB service is used to determine whether or not a VxD is installed0 ?' F) m1 c+ ^
for the specified device and returns a Device Description Block (in ecx) for
. m' w! B6 l& }3 ]% S3 k9 pthat device if it is installed.
& t+ C. M: A% ]9 s
5 T, T4 ]0 D9 s0 Z- [1 e   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID5 ^! X( e8 m2 w8 d, _' B, D
   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
1 c) r& D1 e+ T9 l   VMMCall Get_DDB. V/ K. F# K5 C! d8 `1 [0 p2 ?
   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed" T& S/ x" W/ a. y) g3 Q
( q( z5 T" h  i# q) ^4 J. ^5 f. {
Note as well that you can easily detect this method with SoftICE:
6 t' F5 W" n* G) \" i3 X- F8 t   bpx Get_DDB if ax==0202 || ax==7a5fh" L( ?  m$ v7 @/ G

0 e5 [1 Y8 k$ ?4 J* H% H__________________________________________________________________________, C- e" {0 a" `6 x6 j- t
# t" [. Y2 U) \8 x0 Y, ]
Method 10
5 i% j! n4 y- y- W% _( U4 @1 p/ M/ G=========
5 H5 n. E9 {/ ?7 B( z9 Z5 i1 S: @/ J$ H0 o4 x
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with
. v" z$ i* q& A. u  SoftICE while the option is enable!!; z* z. Q3 l# N* J
- c- f9 L! l4 p: W) `
This trick is very efficient:
# B" d- n# \) m# I" |, g( {by checking the Debug Registers, you can detect if SoftICE is loaded
/ \, P! l) S: c(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if, S! \  `$ z. O$ ]$ s& U: F1 b
there are some memory breakpoints set (dr0 to dr3) simply by reading their8 ?2 F' N7 }9 O* u0 ]% q" h
value (in ring0 only). Values can be manipulated and or changed as well1 L5 P9 f; J) e2 `& `) v; Z9 P' t1 G
(clearing BPMs for instance)1 o; d' V. X( X
1 C0 ]! s- Q. ^& f4 t0 M
__________________________________________________________________________
; i2 X9 i+ K& Y5 q. V. j' W7 m$ E: M, _$ H- G1 N* [% `$ |
Method 119 R2 A* W: z2 R8 V
=========  K" V. a  M$ ]

& H6 h" E7 K0 B% I" |" Y5 f/ ZThis method is most known as 'MeltICE' because it has been freely distributed3 f) @3 D: i3 ]! F3 q
via www.winfiles.com. However it was first used by NuMega people to allow
: B. X  F' X6 k2 [+ z7 LSymbol Loader to check if SoftICE was active or not (the code is located0 O8 I1 H7 H- v6 t9 ]
inside nmtrans.dll).. [. K  T" C& v" ?

4 {2 P, l" B8 z' C* p% v. w5 R: ^/ @The way it works is very simple:
! ~. H- U4 q; c% V6 I2 ZIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
- P" J- ~' o/ c8 B: w# tWinNT) with the CreateFileA API.
9 q9 a& r9 t9 C6 L7 [
: u' R4 e+ v$ X" F9 @, o; ^  [. NHere is a sample (checking for 'SICE'):
0 p# Z0 A) g/ l$ j3 n
  P5 i: r) l' |7 C1 T1 U  l7 uBOOL IsSoftIce95Loaded()
6 m/ W) x0 _! c" i{
7 z' m- w! L" E/ U+ E   HANDLE hFile;  ! M, Q, U/ ^/ [0 G
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
$ o% f: D+ d5 Z9 G3 T) i" M                      FILE_SHARE_READ | FILE_SHARE_WRITE,( Y5 ?1 _8 O* P' W: i: W2 g
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);. [2 L; |  {& h! T4 d9 L
   if( hFile != INVALID_HANDLE_VALUE )
# L9 [1 u% M- D, k   {% m6 k$ j! n" d! D
      CloseHandle(hFile);3 K2 J+ r) {4 l, x
      return TRUE;1 {/ _4 V' T! c4 m7 [& c% r
   }
/ P% f9 ?0 v$ C8 ~1 Y1 d6 M   return FALSE;
9 l# B. ^6 M* M2 ?}
2 e8 c* v% H* E' X0 ?
/ `3 S  `( W' X% U3 Y) [+ HAlthough this trick calls the CreateFileA function, don't even expect to be3 o: I1 t% v: b: A: x2 l
able to intercept it by installing a IFS hook: it will not work, no way!* |3 f& f2 ?8 P4 y1 U' B. i
In fact, after the call to CreateFileA it will get through VWIN32 0x001F! [( x7 C7 ^0 u7 `% a7 X
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)- J3 k* v) G& e9 J9 Q
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
/ h: ]% o4 p# [% M9 M% t1 K% pfield.
7 M# W1 a( C' [5 j. o. q3 N  PIn fact, its purpose is not to load/unload VxDs but only to send a * e. T+ Y) v/ _9 q: Q7 J% r# n
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
4 H4 S- s2 _3 @) nto the VxD Control_Dispatch proc (how the hell a shareware soft could try
( G4 _/ w& _# Hto load/unload a non-dynamically loadable driver such as SoftICE ;-).
! o; s0 g. k/ ^& H# @4 ]( NIf the VxD is loaded, it will always clear eax and the Carry flag to allow
7 e% ]7 ]6 T" K. ?its handle to be opened and then, will be detected.6 w5 |! Y& V7 m$ R5 J2 _6 J
You can check that simply by hooking Winice.exe control proc entry point
7 @9 M2 ^0 y5 N( pwhile running MeltICE.
% y) l/ K1 J$ @2 @( N7 p, V$ M; f; C: t+ P' N: t! b

+ t% Z2 a+ y. @( c* _" R, e% q: M% H  00401067:  push      00402025    ; \\.\SICE
4 P( k1 C) h- ]! }/ Y  0040106C:  call      CreateFileA3 l1 n9 Q. N4 @
  00401071:  cmp       eax,-001
2 q* n' X* J  I; n. ]1 p, P" _  00401074:  je        00401091" l) w6 J* T1 x( l* X
, b% h8 J" O, s. D4 @

! J9 l$ K) v* AThere could be hundreds of BPX you could use to detect this trick.
& G- X! J. n9 [. z* _-The most classical one is:1 i- I. H: }' Z
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
1 f3 M- j( E1 G5 C/ @    *(esp-&gt;4+4)=='NTIC'5 z4 P) m3 E0 m- k4 x

' C' `1 U6 b! j6 R( H/ \* ]# k-The most exotic ones (could be very slooooow :-(
( p) x4 v  q8 c" @8 C: y   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  5 U1 u6 v2 S5 o7 u% }" k& {
     ;will break 3 times :-(5 H  x+ R" S. p+ _

+ ^1 ?) r8 m  _5 v8 d9 P  j-or (a bit) faster:
0 A* I- \1 |: O9 a1 n4 \$ o0 ?   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
# N2 L* ?0 l3 Q6 c- U& y- Y' o6 f* Q7 @0 \  d& f0 D
   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  / a  }5 s8 P$ @9 ?. N  a( z4 W
     ;will break 3 times :-(6 t( N& C: F1 h& K+ ]' P
6 J9 O3 u& A  t& u
-Much faster:1 L+ Z* P1 F6 y3 [( Y5 ^  F9 S
   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'
  S3 y3 c( y5 |% U$ J$ e+ k) o1 s. U8 v+ {$ r
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
, d0 l9 [' m& M. j- ?" zfunction to do the same job:6 ~! M% T; q0 U7 p

' b. u7 a7 @9 U7 n% e7 |5 x& p   push    00                        ; OF_READ
6 i" k0 z) K2 t7 n! F   mov     eax,[00656634]            ; '\\.\SICE',0
. f/ l! e$ @2 g- Y* T$ `  f2 l# j   push    eax. v" b9 G6 F, b0 P8 W
   call    KERNEL32!_lopen
5 c5 h4 t6 Q" ^! B   inc     eax' J$ n" p5 P" o0 v
   jnz     00650589                  ; detected
* s' i  a1 m) H0 q   push    00                        ; OF_READ
" K' J1 v/ z; W   mov     eax,[00656638]            ; '\\.\SICE'
8 C* O" y# f: L5 v7 h' U   push    eax/ f0 V  k: S3 P# F, @4 `& w
   call    KERNEL32!_lopen
' i% Y* B5 s, d- d2 Y   inc     eax8 }' r3 I* u. d) O1 p! D
   jz      006505ae                  ; not detected. N0 |+ e! V/ W6 R2 N: D+ \
5 t# u. W, G( h+ v8 ^0 J% B+ c
" W8 L9 \  c$ y
__________________________________________________________________________
/ u8 |8 p! }9 F, k# h; H  d( w3 x
4 t* e/ P5 i. d6 |, i6 p! IMethod 12' R' u* @' C/ L" z- g' J6 G
=========% W0 g: `7 Y# r- m$ a1 _; D% v
( T6 A5 {! }& J$ R  `
This trick is similar to int41h/4fh Debugger installation check (code 050 y* S& K2 l/ D4 R1 D
&amp; 06) but very limited because it's only available for Win95/98 (not NT)
; r3 Y" I% j0 Vas it uses the VxDCall backdoor. This detection was found in Bleem Demo.9 f0 T2 `3 X- B) n( h- \# d

7 D, F& e( B7 g$ i* [   push  0000004fh         ; function 4fh5 W9 C+ m4 P, e
   push  002a002ah         ; high word specifies which VxD (VWIN32)" }! X) s2 N7 `5 K( g0 N
                           ; low word specifies which service
4 C! }9 C1 d; O                             (VWIN32_Int41Dispatch)
! K3 j3 b4 O9 B* W+ r7 k" |7 C   call  Kernel32!ORD_001  ; VxdCall/ z9 `2 K1 E& l8 s6 G" C
   cmp   ax, 0f386h        ; magic number returned by system debuggers
$ j" ~7 V( I. N: h. b   jz    SoftICE_detected
% n0 r# o# P# c; F  f8 o( S( e/ I0 i6 n, h2 g3 n. a
Here again, several ways to detect it:
& n4 q) |0 k, n* a! x2 `
# Q7 L- o! C0 p6 n9 s$ I    BPINT 41 if ax==4f* g( L9 W( f9 N1 D
9 I3 |$ h# Y7 Q% C: q
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one8 J. E9 p& \- @! z( V
& |5 h' P) a( f7 G; f4 ?
    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
4 k- \6 p2 B" v* ^: }
$ o% d, l8 l/ q" T$ e7 d3 p    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!) P( W# p% C3 o1 I1 i

( j  m; \1 a4 _9 p7 Z* C# R9 V__________________________________________________________________________
5 e/ F, q1 L" C0 d. P2 l& B  f* z- j3 P
Method 13
1 M- |* Y- Y. ^8 V$ C1 g  h=========
- ^8 f& i# g: @. R
1 E" w4 b7 K1 l4 I' i* MNot a real method of detection, but a good way to know if SoftICE is
  A) x$ D/ ?' e$ b8 i8 |' y3 F% H( tinstalled on a computer and to locate its installation directory.
# U# _+ v6 r. k+ L0 @, c. N2 \It is used by few softs which access the following registry keys (usually #2) :
! l% y- {. ], }, ~' H
5 ~* M+ I" s! H2 c-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
8 z# U: R; q: \9 P9 I+ X2 f: H  e\Uninstall\SoftICE
/ e4 b8 e5 p8 t5 b9 ]4 `! Y-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE, C* ?& |3 m" d3 U6 `/ D" l$ w  {. @7 L
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
8 U' u3 q- Y9 X% {/ V\App Paths\Loader32.Exe
( i* |1 O5 q6 U2 Y" G4 o2 N; O
3 ?6 w7 x4 K; E* f2 F2 m0 Q+ Q+ @* @7 k: f  m
Note that some nasty apps could then erase all files from SoftICE directory& x% z! s' d; y6 H3 E$ x
(I faced that once :-(2 ~. `6 i" f4 r/ `& ]

/ L/ ^% a9 q. ^: X3 LUseful breakpoint to detect it:
7 X8 r, c/ b/ |/ S6 J- a9 y* k/ G) x: }7 u0 `3 m0 @$ t
     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
) b% T" C* l( ]8 a" A, i
- ?5 b( d  d) |2 X9 D# x; X__________________________________________________________________________
" v) i3 P: ~' W0 ^+ ^  h
+ ?0 A% |! L1 X4 |5 m& Z! ~* c" _2 z6 m' d) s* k" {3 z
Method 14
$ l8 b8 d+ D8 f7 l9 e4 r. n=========
$ k- Y7 c: @6 k! n. E
( R3 o2 f. M% |" E# iA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose; Z: b5 w1 P3 t' F' n. u& c% [
is to determines whether a debugger is running on your system (ring0 only).! ~$ h/ G# v- O2 t

0 x% A7 U6 S( U2 S: }: X# N! V1 c   VMMCall Test_Debug_Installed
6 u" Y+ {& D8 I2 D  @   je      not_installed
& P# V$ b) i0 e& {( y- _) ^( I! M. K# O1 C# D/ t
This service just checks a flag./ }( H$ c4 j$ o1 s0 }' i9 V2 E  n
</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关注公众号

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

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

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