找回密码
 注册

QQ登录

只需一步,快速开始

About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>! c3 z) `" q2 m' O
<TBODY>
: p- a; D) e  E/ f<TR>
4 Z( D6 m' F  {) U. _<TD><PRE>Method 01 3 d( w3 G' E+ x
=========
0 _. J2 m: G& y2 h. x+ z, j6 V! f" ~
This method of detection of SoftICE (as well as the following one) is
# B! n6 S6 B% n0 m# i" s8 Jused by the majority of packers/encryptors found on Internet.) [0 q  o( V# U3 m% y
It seeks the signature of BoundsChecker in SoftICE
" U7 \5 p  }7 V' j! x
+ ?( e3 ]! n/ x2 J& K( x# b7 n  C6 j    mov     ebp, 04243484Bh        ; 'BCHK'
4 ]9 k: d# O9 g+ M4 v    mov     ax, 04h
" e6 ]5 b- B) y/ F: @8 b2 [    int     3       ( P3 W  E1 o" k
    cmp     al,4
& w+ e, u  S: {5 J    jnz     SoftICE_Detected
1 V: w$ z: s& n3 Z/ g
( F* Y2 A1 z% U# b___________________________________________________________________________% U( g8 R6 ~; y. T- P
3 q5 \( z# P  s7 G$ {6 T/ S. l( |9 a
Method 02
$ p1 d% k& W; y% K7 |=========- i* d0 P2 [9 V7 J( o6 d
  a1 ]0 T! ?: _, C3 j
Still a method very much used (perhaps the most frequent one).  It is used6 F3 E( w0 @" y
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,; t, @. l6 L( i( I
or execute SoftICE commands...2 ^1 h, `- X" L- M+ g* V) r
It is also used to crash SoftICE and to force it to execute any commands* m0 z- X6 k2 Z. A" T+ Z& }; K
(HBOOT...) :-((  % f: b! C! `7 i3 H
- S- r+ n7 a, |
Here is a quick description:
- S& C+ Y5 ^0 f4 ~4 L" f3 Q-AX = 0910h   (Display string in SIce windows)
3 ^* A0 [. v. m! G' Q2 ~; q/ h% Z8 Z-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)
/ e$ f+ q: y8 S  f* G-AX = 0912h   (Get breakpoint infos)
! s5 p4 Y' r) h& k1 f# U-AX = 0913h   (Set Sice breakpoints)8 O! S. U5 C8 Z% F# P1 g/ J- m
-AX = 0914h   (Remove SIce breakoints)
0 Y: v4 X, E$ N" A% J0 y+ M' h: e$ g- d; b
Each time you'll meet this trick, you'll see:8 Y; _! K. r! G0 J7 g$ G
-SI = 4647h
* q; T- X) V1 Y8 q: ?) K- i% E-DI = 4A4Dh# n" a0 ?- Q1 V
Which are the 'magic values' used by SoftIce.0 e1 H$ Z% m/ H( N  N
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.; N. U# s4 G* J/ [; u' k7 ~

: p6 L# n! U% }Here is one example from the file "Haspinst.exe" which is the dongle HASP
( O6 V( P; H- v+ T1 a$ cEnvelope utility use to protect DOS applications:" I6 W+ m# D% F* I( U2 n, ^
5 D$ q! B- X7 ^, |0 A$ ~

5 \. W1 R7 a* w/ [% @4 C" u$ f2 n# E4C19:0095   MOV    AX,0911  ; execute command.
5 J/ ?5 |: ?$ O* n8 l4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
& w; X9 Z5 T0 G. q5 m4 b+ F4C19:009A   MOV    SI,4647  ; 1st magic value., |5 e- I# F( U" q7 U
4C19:009D   MOV    DI,4A4D  ; 2nd magic value.
- l% R  ?* `2 n4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
0 v" s6 Y$ d1 g1 \* v- A% C, f1 e6 q/ z4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute& y$ W) u9 c) g# _
4C19:00A4   INC    CX3 W+ g  P3 `4 Z8 r6 ~5 @$ X
4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute$ k( M* p, ^; m7 v# ^. U' N# H
4C19:00A8   JB     0095     ; 6 different commands.
/ z1 R0 K9 T' _, u0 v4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
6 ^3 _( @, P5 J: c4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)9 }4 X  j6 M/ d: f9 H
& O8 {- F7 Y0 S1 c/ n/ F
The program will execute 6 different SIce commands located at ds:dx, which7 j, h8 E& m2 x; \2 e, ^, G, Z9 |8 |  S/ `8 P
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.9 X9 O6 N4 C8 ~* @& [; O3 `

2 n* \1 x- |8 K/ \& f! o* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
3 K: _5 @8 Q5 v1 m4 Q___________________________________________________________________________4 [9 N. u) o( }  D9 d* A1 D( B

" p$ K" H& Q9 q* O9 C; {. }
; J+ j% i% v- l. C+ H- @- l% AMethod 03$ Y! [- ~# q& i3 Q: A
=========: `7 q, \$ t: @6 a  j% {

; z1 ]2 [& g, rLess used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h9 l9 W  N9 v' o. o% [9 b
(API Get entry point). L  H1 k* d$ I$ e7 S
        
* Q! W& @' |9 S6 \$ X* \5 ~
- Z6 ?/ V$ u& t, R% p    xor     di,di
0 K2 t0 g) j0 S( p& N$ F' V5 J; v    mov     es,di: u/ Q& h$ p0 i1 T$ O) p& U/ j% S
    mov     ax, 1684h       9 L$ C0 I/ s# l
    mov     bx, 0202h       ; VxD ID of winice, N8 R. O/ a3 @( y7 H7 j* O1 C% A* Q
    int     2Fh9 ]" T* N, n; ?1 i" O: X. u0 D2 p
    mov     ax, es          ; ES:DI -&gt; VxD API entry point2 D4 ?0 u/ C& G$ A9 J
    add     ax, di
- L7 R5 J7 x, V    test    ax,ax
" z1 x2 Q) J8 z% Q' p    jnz     SoftICE_Detected
2 C: x3 `" O2 |) @/ G" }* y2 ^3 F  c* H) @" m0 [# [" `
___________________________________________________________________________- p0 E! K9 y- q6 K: b  `

' z- r4 u. ^; _0 d% E6 B- J" U. G+ XMethod 04
6 l9 M+ W  v5 l5 T=========
/ }; y6 @% @8 F. z& @) k
: B% X/ A/ R% ~Method identical to the preceding one except that it seeks the ID of SoftICE
: y; m1 c! s: ?) n' nGFX VxD.
1 ^4 ~+ |1 l( L* ]9 ~1 k! T
1 u) i3 g  X7 S    xor     di,di1 A0 N3 A% }: P/ s
    mov     es,di. y$ [, }3 C" J& m2 v& T0 c
    mov     ax, 1684h       ) f+ c$ a# @- n2 o- ~* d  y+ f. L
    mov     bx, 7a5Fh       ; VxD ID of SIWVID
+ U8 F6 y% E  D# x( J    int     2fh
5 m8 @5 h: y' F* K    mov     ax, es          ; ES:DI -&gt; VxD API entry point
7 S! p. D3 |' f% D- P    add     ax, di, r$ P& t  O$ t
    test    ax,ax
; F/ d0 k( d0 `. E( y    jnz     SoftICE_Detected" @% D: g/ Y2 m- U: i
. q9 I& t1 N: d9 r% a
__________________________________________________________________________
; H# A& z3 f& g" I
( \! \7 |7 H, d5 G4 p; q0 p  {
, W7 n0 [7 z; d7 ]Method 05
) V% X( c+ U( L- b=========: Y9 W+ u, k! k& m( P

2 B# ~! L$ q' d) \0 Z+ aMethod seeking the 'magic number' 0F386h returned (in ax) by all system
  @- V0 y: I- H) O) |- W$ qdebugger. It calls the int 41h, function 4Fh.% n* C7 J. z) m9 [; h" F
There are several alternatives.  4 p8 ^/ |- b8 e3 t# i8 A7 @

9 q4 v! v4 `: H7 x4 MThe following one is the simplest:! c+ ^# }+ s" x$ _. i& @
5 k% K6 Q' Y% L" s7 _4 e
    mov     ax,4fh
, z1 W: t( H. `2 T' L" l2 v    int     41h
* i- d" B( X. A/ @- @5 f    cmp     ax, 0F386' R/ U4 u* I7 K, @3 I1 N7 s
    jz      SoftICE_detected
# H% b! B+ {( R, d8 Z1 k: `8 |' r: A* z

& u: _1 N) g. d( H- d2 uNext method as well as the following one are 2 examples from Stone's
) A3 v7 A+ m2 ^# w, d" k; ~; }"stn-wid.zip" (www.cracking.net):
: q0 J6 F8 X! a; h6 v  g5 v& Z0 X# G
    mov     bx, cs9 C8 P% d, ?$ o. ^. |
    lea     dx, int41handler2
6 C/ X5 @, S1 F' b2 [    xchg    dx, es:[41h*4]8 s" m+ Q. _' u8 N" [  \- |
    xchg    bx, es:[41h*4+2]
& C: D' ^- b4 j  c( X& s& G    mov     ax,4fh
5 d/ }" G8 w1 F9 f    int     41h
& H, ?8 }& A5 D# p    xchg    dx, es:[41h*4]
* `* _/ t9 v8 f    xchg    bx, es:[41h*4+2]
5 L6 x6 g: L  ]8 o& {0 C    cmp     ax, 0f386h8 x& [) M( j9 k, {2 r
    jz      SoftICE_detected* w6 {9 m. {4 _( @9 k# Q7 _: F  C
- t6 t. n- Q3 g0 W: k
int41handler2 PROC  N4 O3 d3 j3 O
    iret; h2 n" @7 S+ ?4 N
int41handler2 ENDP
' Y( C1 a$ ]9 g' n
3 l, R3 Z9 v8 }' n/ @8 ]) E
( m( J2 m$ }5 o_________________________________________________________________________
$ J" T3 Q) {7 `/ w* L6 ^' R3 P3 U$ l: k6 E$ l  h
8 N# w' z* d1 t1 X  T9 l' Z
Method 06
) d9 J9 T4 r/ |) w7 z& d" a=========% \+ [$ S4 \; n& F6 ~$ o( _% U

# {# ?, y5 p9 O, \9 T7 ]; r8 j
! t( [( m4 O7 o( @4 y3 Y9 X2nd method similar to the preceding one but more difficult to detect:
' `! _: t! T$ o4 B. q+ P! f) D2 P2 m

+ S1 r; G. b+ s5 v) s* Uint41handler PROC8 B; G4 G( |6 ~1 r  Q( b9 U' V
    mov     cl,al
6 n5 |- _% Z1 L$ z; k* V& Z    iret
: G. f$ g# [) N# t8 rint41handler ENDP# \" [' X: B0 m6 I; u& w- _. b

7 }3 e- Q6 d+ {* {: }% B3 L2 ?# f& B$ W5 D1 p, c6 k
    xor     ax,ax; {( ~9 E* M1 i8 ^7 E7 M9 W! D
    mov     es,ax' L) o! M# ^% z$ F- _6 L# |* }
    mov     bx, cs
4 G: e$ H+ Z  u6 O9 \) ]5 t    lea     dx, int41handler# o. d# ~, R9 K* G* u; |5 Q
    xchg    dx, es:[41h*4]* D4 G6 |5 n$ L+ [' m7 M, \$ a' B7 T& O
    xchg    bx, es:[41h*4+2]0 Q. J6 Z/ j1 Z$ J
    in      al, 40h5 f* Y; L5 D: }/ }
    xor     cx,cx
- i0 h! ^2 Z0 D# X% }    int     41h
' H3 f' a3 j8 G* K    xchg    dx, es:[41h*4]
$ K: d; A: `" J1 D    xchg    bx, es:[41h*4+2]  H3 _1 k  x6 d' ]
    cmp     cl,al6 h5 |/ x/ z5 Y# r
    jnz     SoftICE_detected
7 B" V* f) R, A  J" q7 p3 j# |2 g/ `
_________________________________________________________________________( F" K; q: f+ y! ]9 k* Y% @6 n
( {7 ]- V. S. X+ G9 u! q# G, @
Method 07$ |0 a  W- Y+ V. M
=========
3 w* X# ~/ X/ e1 _; G2 S4 R$ N, n; ~4 U8 i. d6 L( D+ I9 H5 b
Method of detection of the WinICE handler in the int68h (V86)
* a: G3 H$ a; J" n$ x6 y9 _. X' g# o/ e1 T: P
    mov     ah,43h
3 Q) u. Q7 B; R" c5 E- k    int     68h
# u1 @0 S: I& F: v" T    cmp     ax,0F386h/ G2 E; \. L" o6 s: i8 J( w
    jz      SoftICE_Detected
6 n$ n0 i+ ~. ^! r0 \
5 T$ C9 Z  Q) ^6 |
, h# e" [8 O7 Y  C( k5 D=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
2 B; i# q4 O2 Y! u1 r   app like this:8 ~. {- i- M# `! @; c( }
* J! `  O& }$ @
   BPX exec_int if ax==68
7 ^' _; w& }# K! ~% g8 M   (function called is located at byte ptr [ebp+1Dh] and client eip is
; L! W# z" u, T8 m8 P9 i& ]' J: ^   located at [ebp+48h] for 32Bit apps)
9 [& f( f- |) I- g% L; N__________________________________________________________________________
5 V0 i  u7 ?! b) t# n% c! ^% z# ^
2 Q9 K* k- y2 U* B/ ?" l* \- g0 l. _
Method 08
0 H% P$ w# n& [( D; Z9 k=========
  z4 u$ Y/ U9 t8 S$ @: K% V( T! l' h
It is not a method of detection of SoftICE but a possibility to crash the- r8 B5 `7 k7 r( }
system by intercepting int 01h and int 03h and redirecting them to another- d$ k4 N8 G- y, k% ^8 E' m
routine.9 u$ u1 B1 u' z4 H  R
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
. H* i6 j% A5 ~9 a* Y$ D$ g. w0 Xto the new routine to execute (hangs computer...)
; I* J" |8 k/ Y/ Z
5 V* O) O" O# O% g3 O' [    mov     ah, 25h. Z( l5 }5 ]% W; M- Q
    mov     al, Int_Number (01h or 03h)3 g7 K# s& t% i& k! t$ O' V
    mov     dx, offset New_Int_Routine0 F1 }& R! D6 T6 v1 E. G" W3 G" W
    int     21h" s2 B: A! a$ h+ E- o" C0 _- I

9 s% {% p. h/ Y! E% s__________________________________________________________________________
& T, c, u# |) U2 I& O1 o
% X- n& ~, B" @. j* d( GMethod 09
. l. w% J3 T4 w  W=========
3 u& Y1 C) a. T8 j+ A. l; f- u6 \0 E0 m
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only5 k) [9 T* X& c4 m5 m0 F; z
performed in ring0 (VxD or a ring3 app using the VxdCall).- }! K7 c0 o8 h* i! h4 l9 _6 k- Z
The Get_DDB service is used to determine whether or not a VxD is installed
5 a: e( @* C2 i/ ]for the specified device and returns a Device Description Block (in ecx) for5 E" }$ T  ^* z; N( L6 Q7 A3 ]! W
that device if it is installed.+ }4 H# b0 b4 \5 c' ]9 K

4 c' S5 |/ Q& I   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID
4 `1 [/ }  M0 t' n* Y  c3 r   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
" ]% e, R8 F0 u1 q$ y   VMMCall Get_DDB; Y  v; ?3 Z5 N2 e! X2 C
   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed
* u" t- J& X5 r# n" M, s. m. v
Note as well that you can easily detect this method with SoftICE:
' Q6 c. B& u4 w' [9 {# x/ R   bpx Get_DDB if ax==0202 || ax==7a5fh3 ?+ C5 l) o4 {& x

) b4 [, S, Y. j$ m1 P$ E5 H2 F2 |__________________________________________________________________________
8 s# x# n: H% p' z: q/ P% o$ g# q7 ^& V
Method 10  v- m2 x" {7 ^, s
=========' T9 u8 g2 L3 O- P6 L
% `' _- P6 A! v* r, I9 B3 _  g5 `
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with2 Z" T. T, I9 z) X7 Y# v
  SoftICE while the option is enable!!
0 a9 F3 K; C2 B, ]; K' S
  p% [0 ^! K$ D  a2 Z; _+ ^! _. S; eThis trick is very efficient:. Z# E0 q$ Z) g
by checking the Debug Registers, you can detect if SoftICE is loaded
' W, \4 Z0 }; O+ p( K* o(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if9 s: O1 W# [8 g: y: Q% X
there are some memory breakpoints set (dr0 to dr3) simply by reading their
! r6 f( Z; P  k3 @0 ?value (in ring0 only). Values can be manipulated and or changed as well
# X: T5 b5 |( m(clearing BPMs for instance), t) Z9 ^* w6 I: c$ S# J
/ d5 b7 `1 w6 _6 ?: x( D
__________________________________________________________________________+ @$ X# V6 ~. _4 u7 L
- D% i  w* x7 D/ Q/ I& T' d, c
Method 11
- c% i1 _4 @/ z+ j=========7 v1 Q( a! p' g+ u. F; U0 c5 B( T/ Q& `

- @- W) H& z5 C! s: Y9 j) FThis method is most known as 'MeltICE' because it has been freely distributed
( u6 b0 b/ C  E# m$ K. Z) cvia www.winfiles.com. However it was first used by NuMega people to allow
, l7 O* k0 l6 K: i! c6 dSymbol Loader to check if SoftICE was active or not (the code is located5 b& g0 _3 Z2 h/ ~4 H  G
inside nmtrans.dll)./ E3 S& @& x7 P
. ^9 Z2 N' s1 r- x- i. h
The way it works is very simple:
- l9 Z2 n0 U+ O0 SIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for/ s% [" G7 }& R' @7 O9 h
WinNT) with the CreateFileA API.+ ?( O5 H$ }0 p* j0 d$ S

. ~/ i) L( W5 X8 k4 rHere is a sample (checking for 'SICE'):) @( s: n: m( o( z8 q* I

& M8 a4 d% G$ B, R. F1 l! C1 L  iBOOL IsSoftIce95Loaded()0 u9 [& J) p- @3 }
{. @8 B& W' d& t4 [' V
   HANDLE hFile;  
' U! s- k; w. Z9 F1 Z0 V; @   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
4 h8 O" l% X& H  {: W. ?1 O                      FILE_SHARE_READ | FILE_SHARE_WRITE,
. W; q/ Y2 W0 n4 S% z7 l3 Y' @                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);$ O* r4 T* Y9 j( k
   if( hFile != INVALID_HANDLE_VALUE )
5 `; b: m# I9 \  P9 I0 N& D   {
: N" z* f. a% k1 F) G/ `4 c; _7 b7 [      CloseHandle(hFile);
8 l; O, T5 E* @9 w      return TRUE;: q2 m( E. I7 D# `) V
   }
2 q3 ^1 y$ e; V$ _, R   return FALSE;
7 Z  c+ @8 V4 X0 U& ?}
2 l. c6 @- v* b- k/ D% n* ~" K0 ?! A2 E4 n% T. t( _' y
Although this trick calls the CreateFileA function, don't even expect to be0 Q1 N: G7 U! X8 j' Q8 [
able to intercept it by installing a IFS hook: it will not work, no way!8 p: Q( u" w6 F+ {: `4 r
In fact, after the call to CreateFileA it will get through VWIN32 0x001F9 O: i% V- v0 p" R( f: [
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)7 Z, C/ G" l& L" T* A% m* u
and then browse the DDB list until it find the VxD and its DDB_Control_Proc% a4 N+ F0 ?& S! b/ U
field.
/ t) O! Y3 s5 k- |0 S. ZIn fact, its purpose is not to load/unload VxDs but only to send a
7 o' t8 {; u4 K' k1 WW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)4 {; O3 ^* R6 S5 L
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
! p3 J- m+ P# w% V" `8 Pto load/unload a non-dynamically loadable driver such as SoftICE ;-).
% F3 B: [3 L$ Z* p% M7 {If the VxD is loaded, it will always clear eax and the Carry flag to allow: G( m2 n, K! t, ~* M! O% S
its handle to be opened and then, will be detected.
8 }: [, Q, Q- g5 E$ a2 E( X. RYou can check that simply by hooking Winice.exe control proc entry point
9 E; a' b5 G0 i! Zwhile running MeltICE.
1 e' v5 x' q( Y$ u+ n
) r. p( I9 }0 |5 S& }2 {: `' V9 J6 h- a+ J4 z& f' x
  00401067:  push      00402025    ; \\.\SICE
* g8 L6 r& ]: Q  0040106C:  call      CreateFileA
* e  o0 F% n  |# \  00401071:  cmp       eax,-001
0 Y2 ~" ~: `- `" {4 M  00401074:  je        00401091, Y# Y& W5 k( T% _' t3 F! Z

5 h$ {, V' q+ d6 N8 S" `. D1 J0 [  _3 O7 p; g; c
There could be hundreds of BPX you could use to detect this trick.
; z8 E  c4 b6 R: a8 m3 @  r$ q-The most classical one is:  V& R# j! Z$ G4 w6 W1 [" `
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
1 O  F- Q% E5 ?( T; N' C    *(esp-&gt;4+4)=='NTIC'
% p/ l9 ]. b' R* P- _- J5 J4 L* V& g( q, y1 k
-The most exotic ones (could be very slooooow :-(
, t- E' H3 Q1 g   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  , R! ~+ f+ v. {: \0 j6 ~8 X
     ;will break 3 times :-(8 U$ }4 Q5 U  {0 Q* b  e

0 L. {2 X7 O; t4 O  k/ P-or (a bit) faster: 7 r  L, V0 M& f3 ~% q% U. F+ i
   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
6 b, q; N2 b/ _1 j  F/ g0 n* b8 D# s  m; `
   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  
# S" R! q, r. o     ;will break 3 times :-(
# C" y! j0 O' J1 }% W& M/ j4 E, g) u% f" V
-Much faster:
: c9 ?( `  f; T. k   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'- U& z5 J4 E5 [3 g" u: }% P: b
! J$ [/ z8 E  I& G2 L  t2 ?
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen) y+ v; K) y! C2 q, |1 q# _
function to do the same job:( |/ {. [* j& H8 z: X
7 I- c- m/ X0 |; m+ v
   push    00                        ; OF_READ
8 v* M& J5 m8 m; K1 O8 }   mov     eax,[00656634]            ; '\\.\SICE',0
- b2 f3 R! |  M4 R# s( K  e8 P   push    eax
- V! C; v) }, e' t+ T6 |   call    KERNEL32!_lopen
8 O6 X# b$ a3 x; A. C6 W   inc     eax
1 F: D. L$ y3 N& S3 U7 J   jnz     00650589                  ; detected0 |6 L: ]4 b- J. K% b
   push    00                        ; OF_READ
$ H# L, i* }5 S  N; y, {   mov     eax,[00656638]            ; '\\.\SICE'
, n$ R% s& B3 _7 `. j   push    eax
1 h  j  R& Q' F" d) t" f* F   call    KERNEL32!_lopen
3 A" L/ i( A" e4 A) ^; E8 v% g   inc     eax# D6 d. w. o% p7 V
   jz      006505ae                  ; not detected) n2 w# `+ r8 v7 Z/ D7 \

( N' }  o, c7 Q2 W) ~% V- P- M- Q' y
__________________________________________________________________________
. V; \) ~, \' R! U# n" R  R* v* E% F* i/ r
Method 12- K" `: i" i0 t. H6 S
=========
2 _5 T6 n: v/ T. m7 n5 \
" [  J- C( n9 r2 zThis trick is similar to int41h/4fh Debugger installation check (code 052 U8 }) t8 T. G( G8 {
&amp; 06) but very limited because it's only available for Win95/98 (not NT)
. M6 O& D. a- U4 }2 Eas it uses the VxDCall backdoor. This detection was found in Bleem Demo.- e+ K* B) v3 W+ y& r( l  Q

9 P0 P3 h8 ]* A3 A7 L/ Q0 u/ W   push  0000004fh         ; function 4fh" _9 f4 E: D* m/ k
   push  002a002ah         ; high word specifies which VxD (VWIN32)( ]$ _; k9 t+ K4 u- y+ E8 p
                           ; low word specifies which service8 L' Q, L' d% l- s. D
                             (VWIN32_Int41Dispatch)
' k3 u% K1 A& g   call  Kernel32!ORD_001  ; VxdCall
$ W: X2 W  h9 D8 \   cmp   ax, 0f386h        ; magic number returned by system debuggers
' a* |3 ~2 _2 U: ~. p   jz    SoftICE_detected; e* Z3 }8 A) F+ J# Q1 X  b# d2 t
# J8 K& U3 F3 @) a; B
Here again, several ways to detect it:) Y4 Q7 N5 J7 x) t. Z, h# A

5 f3 C8 _1 L/ e2 k6 R. _) Q9 u    BPINT 41 if ax==4f# s% Z+ Q; E$ w, Q
$ T! \0 u0 ^) j
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one
8 j6 V+ w* T# T" _; W, i# M
7 m" Q; L' s# x* \7 {    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
) I9 h, z# c3 p5 a* S" ?/ @6 e- n9 K" f( K
    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!" M- J# ~# H! W- R8 I4 B
3 L. c9 P6 w' `% H. n% Q% U. c2 c
__________________________________________________________________________8 c. G# {  x  [9 i% l2 D

! V  z8 D6 s2 w& v8 HMethod 13# d) V1 G% H/ [( _# o; G
=========9 ]4 f  q7 J; D; ?( ~

4 I) D" Z- b+ e. M6 g# jNot a real method of detection, but a good way to know if SoftICE is
4 X4 C' ^5 W. n9 ~6 z& N3 U: S+ Iinstalled on a computer and to locate its installation directory.
% F4 `& e! j$ g: Q% HIt is used by few softs which access the following registry keys (usually #2) :
$ I3 b1 c7 H) [  N5 g
$ U1 o" C0 |  f: `/ z7 P-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
. u4 x& ]5 ]+ H. D1 T6 M5 _\Uninstall\SoftICE; {2 ?) a% j0 F- Q
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
' L# u7 ^# C6 j+ B-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion5 ^. v7 o) z1 d7 n+ u2 B
\App Paths\Loader32.Exe
4 ^' w5 [7 f4 m4 M6 k$ h9 m) P/ g9 c! ]' s. u: G; Z0 c; Y6 S

8 P  u& H3 d6 j4 `: Y: F5 LNote that some nasty apps could then erase all files from SoftICE directory
# v" y1 P. Q( }3 ^; ?2 W( \(I faced that once :-(
4 P7 U! r: y' ^' |8 _9 X% t# k# O0 @9 c0 z  w( I# h
Useful breakpoint to detect it:5 }% Z; o- |& V$ T

6 Y6 C  u6 r" y3 I9 |0 O- j; ?     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'/ D2 Z: p( Q; a

! [. W: j4 ]0 G" z- W0 ]__________________________________________________________________________
7 P! ~$ O1 O2 M' ?; l
& e8 [" C. G& n1 Q1 }8 a; S, l; }9 o- ^* |+ b
Method 14
: I( D  T  N% M' `2 E8 [/ ?% Q5 W* M=========
5 O' r7 \" y, @8 q3 |) R$ U
9 G6 z  M: H) k/ z  VA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose# v( [; Y" j# D8 `& {7 w; q
is to determines whether a debugger is running on your system (ring0 only).
, p. \2 u( B$ b/ h  P& w+ `' `7 m% |6 ]* K- i  d3 ~7 p2 [# h
   VMMCall Test_Debug_Installed
9 {+ P; ?8 @  O' f   je      not_installed4 ~' N: w. k7 c* n+ J1 u+ A! A

& ?5 M; J$ R; {' c9 R$ a; BThis service just checks a flag.
, @& X" B$ ^5 h9 }% f</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-8-16 11:28

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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