找回密码
 注册

QQ登录

只需一步,快速开始

About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>9 ]& K5 e% O5 T
<TBODY>/ K6 [  B8 I7 U3 d9 O0 p
<TR>7 [) r2 a5 V+ g6 ?$ p
<TD><PRE>Method 01
5 r+ \' O3 ^! `7 N% F* G5 \2 b  C=========
: j) Y" J# b+ V, r" e4 [& o8 \0 L+ K% O8 r9 B4 }' ]' w3 x/ @
This method of detection of SoftICE (as well as the following one) is
: t# O' v: v! k2 Aused by the majority of packers/encryptors found on Internet.2 ]1 p0 ?$ p# j- ]4 t
It seeks the signature of BoundsChecker in SoftICE6 i6 d  s# N+ f6 A' r0 [% \! [* X( L
7 U# N4 l2 s2 a. ?6 t
    mov     ebp, 04243484Bh        ; 'BCHK'
0 s1 v3 A) Z" [- F6 ~7 E0 ]2 h    mov     ax, 04h
6 y7 O0 _) f- M1 f: U    int     3      
1 d( T; K- j  ^( p! d    cmp     al,4- n. f/ V  J: g+ p6 P5 ]* C7 [3 \
    jnz     SoftICE_Detected) ]; u1 F, V" d+ r! V6 A. ^2 W/ O

' w) `8 [% D9 P' o: d___________________________________________________________________________+ E# N. `9 [" R: b8 H# _; `

" X, y9 `; S( h+ O1 NMethod 022 I% x* x& Z9 b% O& R1 |( Q
=========  C4 `' s, `$ |9 T* i" J4 U
* g4 L$ u0 t/ I
Still a method very much used (perhaps the most frequent one).  It is used
: ]! {) y. G- t& w# \& lto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
7 [! D2 u- y% b/ W  P; f3 M" wor execute SoftICE commands..." a# V! k3 _- s, E% `7 G
It is also used to crash SoftICE and to force it to execute any commands) j  ~# i4 m1 Y5 [
(HBOOT...) :-((  
- ]9 e, N. L: z( E: x1 N  F) l' k; a# O" h7 W$ q
Here is a quick description:6 Y7 z6 N! Z7 o8 ?3 F( i( P
-AX = 0910h   (Display string in SIce windows)
. E" i  T3 w$ [( j, U-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)$ x- m8 V: B8 ~3 y3 q% q
-AX = 0912h   (Get breakpoint infos)
8 C7 s% U9 S6 Y, ~+ j-AX = 0913h   (Set Sice breakpoints)3 P# ]# B0 l$ k: e, b1 ^
-AX = 0914h   (Remove SIce breakoints). P5 E  z. A" j$ @# c
2 D( H9 u  I! j4 H
Each time you'll meet this trick, you'll see:
, S# A6 t9 S: O-SI = 4647h* T/ K1 k3 A( L! Q) J- o. a
-DI = 4A4Dh8 S' {  z+ I  ~% C8 E
Which are the 'magic values' used by SoftIce.
9 q% z; l& T$ D1 A! @6 l  _For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
# B2 ?4 M0 @; P9 d8 _/ B6 t+ S& `4 X5 @! z" F
Here is one example from the file "Haspinst.exe" which is the dongle HASP
! i' b0 y' e, M0 q7 n9 N: {Envelope utility use to protect DOS applications:
) n9 W$ E& E! A, a6 T4 X+ W: W& |# u. [

2 e( {$ @6 ^9 m: @3 _1 l4C19:0095   MOV    AX,0911  ; execute command.
% _& c5 t$ t0 K/ G5 `3 P  R4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).9 B8 F( |; {/ \* }! u7 o
4C19:009A   MOV    SI,4647  ; 1st magic value.2 Q. o8 G; n  ^% m
4C19:009D   MOV    DI,4A4D  ; 2nd magic value.
3 @8 m7 o- S! ]6 N5 T6 Y4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)' V6 x9 _# V- ]0 g. W' u
4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute
. O& a+ k% E( `4 c4C19:00A4   INC    CX
( p: P+ |% ~3 z; G8 l4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute- }/ `% G( {% _3 Y
4C19:00A8   JB     0095     ; 6 different commands., B" F, g' D1 N% H8 h3 k4 T2 t
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.! W' D2 r  K: q& W
4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)
+ s: @# Z6 T  r, I6 |0 V
2 a; c" k9 X. I8 nThe program will execute 6 different SIce commands located at ds:dx, which
7 p9 n% z, {3 M% D' qare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.1 O7 s' \! s  Y/ L, n9 n) o1 r9 z

3 b2 W8 y  Z! b# R* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
- F2 i4 W# `6 C( b/ h" a0 X___________________________________________________________________________) v- ?* a  }6 |+ Q# p4 Y0 J& o

6 a& u/ e& W( z) u; f- m& Y
& p) ~* D, z; R8 m  d5 ^* x. b3 {Method 03: t2 |4 O! A" P+ p
=========
7 D( v* Y" k# c5 Q0 w) m. r- ?. B
1 R9 A7 n/ W6 q2 D5 NLess used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
% K. v# j6 B' k1 X. p(API Get entry point)$ [6 r# |/ q7 N  d
        
0 ^. W5 L, c" K3 M3 R) k
, {+ |% P' |0 n1 c2 p    xor     di,di
) n" Z. s* v6 G# j; H/ {    mov     es,di; i+ O7 C6 Z6 O" h, x5 M
    mov     ax, 1684h       : r+ }3 t; ?2 p6 S
    mov     bx, 0202h       ; VxD ID of winice
( h$ p9 e6 c% O8 H- R8 H# |& B, a    int     2Fh
6 ]' T, c" F* V: J+ S$ T& o  r    mov     ax, es          ; ES:DI -&gt; VxD API entry point) ~8 N5 [, ^( q5 g% O* d. n. k+ ~7 b
    add     ax, di
- c3 M5 g$ [; O) k5 u' \' e0 j    test    ax,ax
4 }4 M- f5 e# L    jnz     SoftICE_Detected0 @% x8 \! M' t) B

: J6 ?/ T" Y3 Q3 O% U___________________________________________________________________________; g- W' ^3 Q6 D

) V7 a) F6 A1 \Method 04- _  f( q+ C" z) i5 B1 [" o0 W
=========
. I8 Z2 y$ ~2 W$ ]1 G1 c6 b- P& |! v: k! P! I
Method identical to the preceding one except that it seeks the ID of SoftICE
6 {$ n) |7 i& O, d# I5 `! U" `GFX VxD." s/ y- c* M5 N" t# P
4 C9 F# V, h5 A$ n
    xor     di,di
- r, K: g1 i; ^1 {2 G    mov     es,di" p" c0 x8 r& g2 I  H, n
    mov     ax, 1684h      
, t7 Z% [0 L2 }) W! B# @& w! l% |    mov     bx, 7a5Fh       ; VxD ID of SIWVID8 `7 h( i! T. `) l# }
    int     2fh
( q4 k. ~7 d) y# \/ k* Z* G4 L    mov     ax, es          ; ES:DI -&gt; VxD API entry point
5 h, A! K, h9 d4 k    add     ax, di
' t! F6 U+ {' t" o2 t* E: j    test    ax,ax
: N3 P" T9 \, g6 m: S6 K3 c1 m% p  ]    jnz     SoftICE_Detected1 w. ~; d* f; F3 M+ c5 z

  Y: J$ ^6 Q. S# {2 [, E, K__________________________________________________________________________
! P( i* i2 w  B) E( H+ p
$ c9 |5 Z' e9 I# q& W( v
' \' O5 e9 K* lMethod 05
) G# R# O) i. T1 q* \1 t=========
. o% ]: j8 O6 x8 `* Y" b4 C* ^- |
Method seeking the 'magic number' 0F386h returned (in ax) by all system% h. N  }' l* k9 `+ I& R1 H& `2 n3 x
debugger. It calls the int 41h, function 4Fh.
$ S2 ^  ~$ T; I4 T3 d0 \There are several alternatives.  9 l- \9 y$ L& a% M5 C
8 W5 f& W; z0 Y/ s) s+ Y+ s
The following one is the simplest:
& Y" L3 J: S5 J& j) G+ a7 \( y
; ]; s: C* G: ]5 h    mov     ax,4fh
. b3 t; K$ k: c3 P7 j    int     41h
$ Z0 F) H* F( R& y9 Y# ?    cmp     ax, 0F386
( i7 U  T2 O# ^  w6 m    jz      SoftICE_detected6 U1 G; y5 `$ I7 o9 i5 J* Z
: Z% }0 O, S* M

6 c1 |: p: F4 x0 [: D; M2 ?& U; u$ fNext method as well as the following one are 2 examples from Stone's
7 q. T  i% o( b+ ~$ S"stn-wid.zip" (www.cracking.net):+ [8 ]! \; L, k& U1 |' @' o, ?
- u6 o* o6 j+ t
    mov     bx, cs& y  p9 Y4 o* ~0 |
    lea     dx, int41handler2% k+ T% E1 w" S1 \+ u) p
    xchg    dx, es:[41h*4]
. X6 A( X6 ?% A, C+ T    xchg    bx, es:[41h*4+2]
9 U2 k, j: ^( P6 D9 i; E  b3 v    mov     ax,4fh7 J' h7 a; v& D' j# A% Q
    int     41h
0 `5 r8 s' J4 f# b& g- A) c    xchg    dx, es:[41h*4]
: B5 b/ W! |  E6 b2 h    xchg    bx, es:[41h*4+2]: o+ k1 }) O% O# f; S- a% q8 T# h
    cmp     ax, 0f386h) B& B, |" S% \% ~! M: Z* Y
    jz      SoftICE_detected% i$ _3 x( X" @

" m2 I1 c; B- N& o. o7 f; q% Cint41handler2 PROC
- r% I  U6 L' {9 l5 _+ h, L: Q    iret
/ ]3 F% a: |5 f( D( r/ {int41handler2 ENDP
( V9 \5 E1 r* E2 G+ p" V  c3 Z2 C: U. a# J# C) P
' c( u% o1 s& F+ q- z# t
_________________________________________________________________________
6 ~) |  A# x0 L+ q! h. E; x  w. ^, g. U

" W/ \8 o5 i. h" F, b% t# NMethod 06
" n3 Q& r' m8 g! P, O% j: c! r=========- U3 U7 D* |) Q1 F) e

& v- {0 i7 T) s1 V, \0 M
4 u% }/ o  i: X2nd method similar to the preceding one but more difficult to detect:
2 f, m2 p) d; r
% n8 H2 L0 R/ }6 Z3 a7 E: A# Z3 U1 h% l) U7 o) e' M
int41handler PROC0 L6 _0 T& S& B6 H9 w
    mov     cl,al
' D( [6 Q0 B7 t. d* u. x    iret, t1 j  c) V1 U
int41handler ENDP
- E3 T4 f, K% z) ~, X* P. c2 n, J6 c5 S) F- N: e* {

; Q1 T9 k2 j7 v5 U    xor     ax,ax
2 L  `1 }8 b' |: w4 T5 j5 l6 _4 |    mov     es,ax
8 U( u# S* v# h+ F) P    mov     bx, cs
8 d# I% d3 M3 ?2 h$ L    lea     dx, int41handler
) Y$ I* C8 j( z! N$ v    xchg    dx, es:[41h*4]0 \4 o6 ?. J3 l2 y& g
    xchg    bx, es:[41h*4+2]7 X+ B0 R, p5 _4 ]+ t) o
    in      al, 40h
5 y  M$ E3 S' l( O3 W    xor     cx,cx
2 c3 j3 s% V7 r+ ~    int     41h
- n  R1 y/ [% G  k8 |    xchg    dx, es:[41h*4]# A9 v, G7 a/ ?% t
    xchg    bx, es:[41h*4+2]! A' V0 ~# @& o+ i$ Z, I' V
    cmp     cl,al" _8 U5 o' N! ]! D! n, w8 Z, e0 S
    jnz     SoftICE_detected- I) x8 ~. h) u7 H/ V9 L9 v2 ~
8 |' t) R3 t$ Q. m) c8 i
_________________________________________________________________________
  T3 X" s8 p) X, e; X1 ]* A# e0 J. t9 }
Method 07" r" Q( S8 j, v- j! q3 Q
=========
9 }" ?6 c4 t/ {7 D4 M8 u
, `; h1 f' v- E! q4 fMethod of detection of the WinICE handler in the int68h (V86)
9 K8 E; \  `! C: ^* V7 h2 l- S( e  S3 U/ q. c
    mov     ah,43h
; P' t1 F7 D& C    int     68h$ X, k! s- _+ X- I  }' t
    cmp     ax,0F386h( K6 r  d. c# X' v' T
    jz      SoftICE_Detected
. ]( u4 p9 R# k; I/ h7 M# o! N
$ s. m) G1 ~- ?# [
=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
( ?7 X- N6 o- P9 P/ Z   app like this:/ @4 m* Z" M/ w$ q+ J

) z: W  e3 w- r; g; v( m0 b$ Z3 A   BPX exec_int if ax==68
9 A9 e6 D: }2 m6 n   (function called is located at byte ptr [ebp+1Dh] and client eip is
0 K; G  K6 \# k4 l   located at [ebp+48h] for 32Bit apps)$ Q) O6 n# v; m5 L4 f4 A1 n
__________________________________________________________________________5 n& Y. J" r. P: U' y8 ^6 ?
) |' J  z7 i1 Z  D

1 }: N8 f9 z" I" m" j+ g7 d, `Method 08
( r2 h. p& V+ o; A=========- G5 U# c) H' r7 p; @  q
' \4 ]) s, Z0 l( e4 I
It is not a method of detection of SoftICE but a possibility to crash the) T9 r1 _- `( J0 h
system by intercepting int 01h and int 03h and redirecting them to another
5 E8 m7 U, z8 A9 ~4 Froutine.. G6 t! [: H0 M5 |- E: z! D
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points/ b" Q# D( [! O# n9 t9 R% a
to the new routine to execute (hangs computer...)
: ?9 g' C/ b, y" O- i: Y3 c! q$ u* g' W
    mov     ah, 25h: r- P9 E' m* T2 L% x5 @$ Y
    mov     al, Int_Number (01h or 03h)( K$ a# }* g: N- ?8 \! o0 m
    mov     dx, offset New_Int_Routine
+ P% V0 u3 n) X# V5 c    int     21h' Y# G- ^/ u9 _( P$ k

# z2 }( W$ M) F0 }1 e( l2 d4 X2 Z__________________________________________________________________________( m1 j/ e( {7 c5 L  M
+ k- w( k$ G; L; _8 P
Method 09
' H" y8 `2 `; c3 o: h6 Q  }=========
% J$ ^+ A/ J2 l+ K: h* l1 D7 L3 x( A0 t
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
/ O* _3 o/ H2 V* q& G+ \performed in ring0 (VxD or a ring3 app using the VxdCall).0 `9 U2 e- V" `& V# o1 a# Y& H: s
The Get_DDB service is used to determine whether or not a VxD is installed! {0 o* O' N6 `7 q, O
for the specified device and returns a Device Description Block (in ecx) for
) K- X9 z( q) H- N6 rthat device if it is installed.# v  a8 c5 K0 E

4 S1 k4 i* b' r2 D7 Z; N0 u' ]   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID3 J' p: d0 }& E; U8 }. n# ~8 ?
   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
% r8 c( w; l. o1 |   VMMCall Get_DDB
1 ?5 \* P1 }, ]   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed
4 q0 _% g; x( E$ Z7 e  @' p9 }$ w% t: N+ F, b/ a4 h' W: t
Note as well that you can easily detect this method with SoftICE:
0 y- V, B) K) @0 ^; [7 J  u   bpx Get_DDB if ax==0202 || ax==7a5fh' j/ k+ |: B5 b+ z* _! I& i! B6 e
* @, T. D" a6 p" y
__________________________________________________________________________
6 _7 o, m+ q% Z- A) R" e7 i4 T& Y
7 B' D+ P0 J& c) MMethod 10- ?; f; P4 j  V
=========
8 u3 {5 ^  k0 \2 [5 Y; q2 s1 `6 H! F; s1 T
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with! q  M- I- q* e
  SoftICE while the option is enable!!6 P  E% B, |9 w, D9 {: P
0 P- F5 z$ j$ q! ^0 M0 ?, @
This trick is very efficient:
6 K% o% H0 H' L: J/ Y& Vby checking the Debug Registers, you can detect if SoftICE is loaded
# `; F6 h/ L& g' t) [3 t3 t(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if, @3 N" G8 j# z2 M; G2 g( @; p
there are some memory breakpoints set (dr0 to dr3) simply by reading their
) y" B$ u6 ?$ [$ G4 e+ {value (in ring0 only). Values can be manipulated and or changed as well
! y/ o  D  ]0 l(clearing BPMs for instance)' Q4 r% }8 L3 ^" e# @; M/ m6 _

& `" X" B0 n$ c' N__________________________________________________________________________
2 W) y, O8 A/ S2 A% y
- A( T3 w% d( OMethod 11
# z0 j* p1 P9 `- c- D" h2 v& O6 o=========
' a! L( i3 u8 D+ Z; S* B9 X( Q( K7 d+ ~% |2 _3 ^% ?  R
This method is most known as 'MeltICE' because it has been freely distributed) ]9 x6 s! K5 v' z8 d
via www.winfiles.com. However it was first used by NuMega people to allow
, h# ?7 l* i0 o9 J( gSymbol Loader to check if SoftICE was active or not (the code is located
; @: |7 ?4 }7 Minside nmtrans.dll).
6 p+ n: @& ]! t% w
# n/ d  p: m% J) t9 c7 l" EThe way it works is very simple:
" K/ `3 W7 G* n' W* e5 O6 o. SIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
7 A* r# E# `$ Z0 h6 T: @( G$ CWinNT) with the CreateFileA API.
4 M$ m/ ^1 b5 S# u- a# \, C7 X. j3 B3 K( b+ R+ T
Here is a sample (checking for 'SICE'):
1 M' h2 D- i5 \2 r) B- u/ ~( d/ ]7 M) I
BOOL IsSoftIce95Loaded()  A( b. x! j1 ?0 e2 \6 z
{
3 s. l, O1 I8 o* v4 v- A   HANDLE hFile;  " n* c+ \' r+ e4 c& |; [
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,- N# A$ j& A$ s: y3 Y# i/ i7 K1 s) k
                      FILE_SHARE_READ | FILE_SHARE_WRITE,: Y8 `1 P+ V% R. c/ I
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
; M' I) C! ^- D( `1 Z! j   if( hFile != INVALID_HANDLE_VALUE )
. I. R. K% a8 n4 }9 \* i$ F   {
0 t* H1 u8 l2 C+ A, Q4 |3 z      CloseHandle(hFile);9 M, a0 v  N8 q( q& I" \* W* {1 N
      return TRUE;
( k$ }+ U- T4 R2 c0 N   }
3 A# e. d% `7 X4 \- n: i   return FALSE;
. R( D9 L# X3 h2 |2 [}. V$ Q! ]# [8 {) q( G5 D

" Y% @. ~7 O+ r/ a' ^Although this trick calls the CreateFileA function, don't even expect to be7 o7 m8 G. l2 G* i' d3 R
able to intercept it by installing a IFS hook: it will not work, no way!
$ L" [. h! ?2 g! `In fact, after the call to CreateFileA it will get through VWIN32 0x001F
- d3 D9 I! y8 X* Tservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
/ ]! @9 b% w) l+ z4 n8 I% Oand then browse the DDB list until it find the VxD and its DDB_Control_Proc( g2 o+ X/ c7 L1 `
field.: {6 |% P) O! }2 \8 {) V' w8 s
In fact, its purpose is not to load/unload VxDs but only to send a
. n, C8 Q( F$ m- `+ \W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)5 Q2 b' D  y0 E2 Z$ Q% _( X# D
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
! o3 C' C* g2 S' a* Y/ P  y1 |  f" X, G* ito load/unload a non-dynamically loadable driver such as SoftICE ;-).
9 N; S: |9 O2 Z" d7 y) }If the VxD is loaded, it will always clear eax and the Carry flag to allow" n& |  |) d$ U0 L1 ?& l
its handle to be opened and then, will be detected.9 W9 S0 q. b6 J1 `
You can check that simply by hooking Winice.exe control proc entry point
+ O4 L( a; ~3 ]$ k( _while running MeltICE.
0 l8 b8 Q' d1 e* u' s' y1 `% m" o! G9 R0 H. P3 [8 a9 r/ W  t! W3 @
% ~1 \6 w) k$ A0 Z
  00401067:  push      00402025    ; \\.\SICE
( J4 q6 D, S& z" o  0040106C:  call      CreateFileA( \: @0 I" t8 C! ~8 n9 M- A
  00401071:  cmp       eax,-001
$ G$ M* ^* ]  o0 I- C! d  00401074:  je        00401091- a/ U2 P* j. r* \+ n/ Y
1 D4 |, P3 k' e# w

9 H" l4 O( r1 k, R/ Y# M: m4 v, FThere could be hundreds of BPX you could use to detect this trick.2 S% i1 b# ]  v9 y! \7 }. }
-The most classical one is:
, j; A* d( P+ M# n+ x% Q* J( @  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||% Q( V( p( X! ~
    *(esp-&gt;4+4)=='NTIC'- H+ i9 @! O$ z
: b$ X  U* v' x  L3 T
-The most exotic ones (could be very slooooow :-(3 I8 k, M, F0 X0 k! c. m; U/ h7 s# f3 R
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  ! w6 [# u3 w  x+ p% P- U' N4 G$ N
     ;will break 3 times :-(
+ k  o( |- B& x7 {' Y- }
8 ]. `8 f1 B1 \$ `" [2 Q* y-or (a bit) faster: % T4 I% s8 T: ^3 [+ L
   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
5 q1 ~0 v/ U3 N
+ ?6 f0 ^6 r, C! O6 a   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  
. L( J* s+ g: A) v* X& k     ;will break 3 times :-() _- |$ t+ ^: A" B7 _4 y

3 J- o& i% Q2 ?-Much faster:
" H- l8 r$ O7 H: L+ G) J) S" n   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'& c$ p! K4 X! ]" j( M6 m! b

, `  O% M+ \. Q0 t- y3 XNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
& M2 @& k- a1 j0 h1 H' ufunction to do the same job:
6 R' ~) ~2 A2 b9 ]8 q9 q
/ P8 P7 Q2 S8 P% c* V$ d8 [   push    00                        ; OF_READ
5 H- M- i. |! g- X6 B8 }' ?   mov     eax,[00656634]            ; '\\.\SICE',0. ]6 {+ N  x$ s2 y6 k
   push    eax0 G5 H2 n; M6 G% ~( E1 N
   call    KERNEL32!_lopen
' o( ^% @2 C2 ~# j  ?   inc     eax
' \4 p* h2 c9 p/ K/ Q   jnz     00650589                  ; detected, m# _& O* h! s1 J
   push    00                        ; OF_READ
2 f4 U5 n& A- u( O; y% ?( b   mov     eax,[00656638]            ; '\\.\SICE'
8 t6 g7 X, d) r   push    eax& J& v0 j" r0 ~( O2 \: k8 @: B/ v
   call    KERNEL32!_lopen3 x6 @8 r9 }6 A$ T. s% b4 C  D
   inc     eax
: f: F2 n' l, q1 x1 C4 L4 [   jz      006505ae                  ; not detected" c& Z0 o* V+ q4 D1 ?3 x, V: H$ ^
. k" M% R' ^) Y! w4 I

" t0 z, z1 [1 v/ w; Q+ C__________________________________________________________________________. B; D$ ~+ e/ k& W7 C3 X
' c5 x7 o8 p. H* C* d% c
Method 12- h5 U/ e* y$ p: H3 }" R: s
=========
6 _3 X+ [5 H8 }7 f) V* ^2 L3 m. K
" w4 v4 f* [; S" nThis trick is similar to int41h/4fh Debugger installation check (code 05
- Q! b; g# r' k  }9 q. g&amp; 06) but very limited because it's only available for Win95/98 (not NT)" @" ?# o3 x. z
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.0 Y, F; u5 ?+ Q0 t. j
4 I9 N6 B& H% N# M1 P
   push  0000004fh         ; function 4fh+ l# I- H1 b% @- l5 X1 {% K
   push  002a002ah         ; high word specifies which VxD (VWIN32)$ F) x9 T2 \: ~2 [( f2 L& p6 A5 C4 H  P
                           ; low word specifies which service
& ]* N: d$ K2 m, D/ t                             (VWIN32_Int41Dispatch)5 D* S" y& t: z1 }8 f. @, g4 W! d( N
   call  Kernel32!ORD_001  ; VxdCall, j1 c+ L5 R' W9 \1 I9 q
   cmp   ax, 0f386h        ; magic number returned by system debuggers6 |: T# [1 I0 m
   jz    SoftICE_detected
# t* {0 u& `8 @, z" k, o. T
% U6 D$ A& @8 E1 e% S0 mHere again, several ways to detect it:( a  I* B& D9 ?! C+ J$ I0 n
, ]& k* w0 G, l4 a2 F
    BPINT 41 if ax==4f
* A$ m5 E, ?: U: l- \0 H. M$ |5 m0 m% C. Z/ S7 @
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one
8 R8 Y/ A; ^' D6 Q" Q, \3 q$ ?0 R  D  x1 f# m" R$ r
    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
: |, X; g. n  Y- m" a3 o
% M# o# m/ D- F/ a5 {+ V; s    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!# L* R* Z7 M$ c1 n6 h; R9 z
% ^; f" W2 ^9 U# Q
__________________________________________________________________________+ k# r7 b+ b* O7 m5 G! G" }, X
7 @" h7 e3 D* [' w8 u; q5 T
Method 13- J; a0 _' B& T8 l3 \8 Y6 r9 J
=========
2 C0 L4 n4 K; }+ I) G4 U0 D( I' t! f% ~; h6 @  ]. P) c* T6 o- O; U
Not a real method of detection, but a good way to know if SoftICE is
4 O0 Y6 @: d7 n+ N) Uinstalled on a computer and to locate its installation directory.
5 O8 r( h/ R6 O8 g' E, Z4 IIt is used by few softs which access the following registry keys (usually #2) :) m( H; Z% n; z3 v; f) `2 ~
. h* _; v: k5 f1 q' \3 {' J5 y% v# S
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
0 F0 U6 i4 U) p* [4 \3 `# F\Uninstall\SoftICE1 G6 s( j+ _; \3 q1 Z
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE- k0 @# d& }3 H- Y6 {
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion' Q) n% H# v, K1 T) P  M% T: i3 `% z
\App Paths\Loader32.Exe# F7 m; B' J# l6 V0 o3 I

0 o$ e; D% |$ H+ w) Z$ `- _0 _: Z! ]
# B: b2 Y! T1 W5 Y0 b: L3 L! h' zNote that some nasty apps could then erase all files from SoftICE directory9 ~2 ]3 R( j  |- x
(I faced that once :-(
* Y, z) x" v, @3 J$ h
6 Q# ]0 A. v- U4 J( z& a# m3 P; YUseful breakpoint to detect it:4 y; r; ]$ Z$ r" W! N" t

& G; W$ g( b/ g. J     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'+ G3 \  ^  K9 n3 J- g4 W! J

; e! `3 x' U; D7 [" P, G6 a__________________________________________________________________________8 ?! A9 F' G5 q  L
: [1 ^7 U2 x" n# X5 f, d  |
; }% ]! A& D, E5 }0 R, y
Method 14 $ Z4 E2 k3 P6 o% g' V
=========# g3 E5 g+ h) B; A" H' v
; u# j& X, P5 j
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
/ Y4 P7 ^) Q6 i8 `' Z9 F2 eis to determines whether a debugger is running on your system (ring0 only).
' i5 L* x7 u+ C! R9 h% n  x% X* K$ \' `9 }/ Z# C. i0 J/ z* e- H1 d
   VMMCall Test_Debug_Installed( h: f- B& M9 g, \6 Q
   je      not_installed3 R) x4 H3 K5 _5 P) d
. E. v% @$ _  @( V  P% u7 T5 s+ t
This service just checks a flag.
' w0 H! k# \5 d8 n! p7 Q</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-8-13 01:18

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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