找回密码
 注册

QQ登录

只需一步,快速开始

About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
- F6 _/ e- ?) Z1 z3 e9 a: Y<TBODY>
0 w& C* k* p& U- E. M<TR>
" F" ?( p: R; u, W<TD><PRE>Method 01
2 r% P; Y! a% C+ [8 \6 q=========
4 ]/ f- Q6 Z( ~5 I) r8 \# G4 J8 v' A+ E# u* [: n
This method of detection of SoftICE (as well as the following one) is
+ h. \0 Y1 H8 sused by the majority of packers/encryptors found on Internet.
" \+ Q6 |+ a4 x' P6 GIt seeks the signature of BoundsChecker in SoftICE2 c2 F3 E+ ^% V" C$ h

+ b/ D/ o) P: d/ {: T9 v% |; ^    mov     ebp, 04243484Bh        ; 'BCHK'
$ y% x6 g. z# l6 a2 c    mov     ax, 04h
; S, f0 l9 \' a) c. k+ u    int     3      
% J, J: I8 m( a% Z" W2 X    cmp     al,4
9 ^) [% M, ~  d* b& R, A9 T    jnz     SoftICE_Detected
; I9 Q9 Z# N8 C: N. x+ y8 o0 y! [- p% B5 m
___________________________________________________________________________0 X% s* Z! M0 N* U( K/ \! \0 A

0 J0 w1 d8 A+ T( o9 s+ ^2 V& WMethod 02
+ t% V* v7 X# l, }  q5 s=========" W/ K( F7 h" H  W3 a1 W

5 N2 p' K5 ^7 z: W5 r( G0 YStill a method very much used (perhaps the most frequent one).  It is used; i- @% n6 l, N0 E! {; Z
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
- Y" S/ {* V- a3 P7 sor execute SoftICE commands...
! s; `* w; q% p. B/ }9 VIt is also used to crash SoftICE and to force it to execute any commands
) p# s, [) O8 `$ ~; h- u8 ?1 o- i(HBOOT...) :-((  
5 ]  t7 i. S5 }# e, W' Q8 @" T% r& }8 V1 m: Z+ k; U7 A# W
Here is a quick description:. e) S0 m0 V+ b3 g- {8 q! H
-AX = 0910h   (Display string in SIce windows)1 S  g: Q( k- h2 n( U( C
-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)
# G! Q: g; \$ }8 l# ^-AX = 0912h   (Get breakpoint infos); j& j4 N$ V: ?& `3 e
-AX = 0913h   (Set Sice breakpoints)
5 x4 l# S  y9 z* T-AX = 0914h   (Remove SIce breakoints)
5 }  |  |# P2 R* K4 Z1 m3 ^, C" t! w
Each time you'll meet this trick, you'll see:! N" x  R; U- N: t; N
-SI = 4647h
: J6 S& m4 Q5 f% i3 F6 ^-DI = 4A4Dh
1 H  M2 v6 t( `5 ?4 s* X+ ZWhich are the 'magic values' used by SoftIce.6 t+ y- E! W$ T, J- G2 i5 O
For more informations, see "Ralf Brown Interrupt list" chapter int 03h./ b- |! t9 A3 {3 B2 E

% F6 Y, X9 `; a6 N0 FHere is one example from the file "Haspinst.exe" which is the dongle HASP
. l) g' @: n: M( lEnvelope utility use to protect DOS applications:5 k  z$ [  u- W; X- j  w

* i5 @! n; e, X3 [) R
7 h( F  Z2 a! Q) Q- [4C19:0095   MOV    AX,0911  ; execute command.
% Y+ v) [8 S4 W1 j8 N+ H4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
, E' M3 b9 g8 |$ P5 N! N4C19:009A   MOV    SI,4647  ; 1st magic value.
: e' [) C& n' B# K4C19:009D   MOV    DI,4A4D  ; 2nd magic value.
) n/ ]0 c$ H! s( e4 n4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)* V. D; v8 O. a( m$ a6 H1 Y- c
4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute
, o: y7 D- v9 p0 i4C19:00A4   INC    CX! t2 z) q3 J7 o6 c: d
4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute+ o3 I! d2 h8 `$ g8 ^$ L. t* @% n# x2 d
4C19:00A8   JB     0095     ; 6 different commands.
, N( F# _+ T2 g4C19:00AA   JMP    0002     ; Bad_Guy jmp back./ @5 c' s' J+ G- m  q* q
4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)
' f' t8 i# F. J0 u0 K: Z7 o0 z' E( G, F; Z: H1 o( n- d& L2 E; s# j5 s
The program will execute 6 different SIce commands located at ds:dx, which0 `4 U8 |; D) ?/ b
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
3 D8 l1 f9 s$ T+ u& K
6 M3 |6 Q/ C' S2 j' y1 M$ i* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
$ k0 f1 L  z3 \7 e1 J___________________________________________________________________________
: v* _5 B- v/ E) a
( q5 q$ c: u4 f
/ ?6 U) a) z7 j/ oMethod 03
9 T7 T$ u3 U) x& a- z* F=========6 {6 h+ G" @2 X* k( K' b: F; g; T

& E8 ~" _( V7 SLess used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h7 l2 p! c$ B( `. M) T
(API Get entry point)& Q, a, H4 K7 Y# L9 \: @
        8 i% [2 O6 V+ Q1 m. D+ i7 i3 w
0 c7 M# _) O* f9 ?7 N
    xor     di,di* F. X  p0 e- K, Q9 E$ {
    mov     es,di0 o8 `' @5 Y& c' c, \) [! F
    mov     ax, 1684h         _% E7 |8 I: e% q+ a# W
    mov     bx, 0202h       ; VxD ID of winice
& i/ H% J& E% Q( s/ Z    int     2Fh# }8 v' z7 Z8 G" Z: p& Y
    mov     ax, es          ; ES:DI -&gt; VxD API entry point: t3 q2 j. C( h% S% S  ~
    add     ax, di
: L! H/ w7 D9 Q9 M    test    ax,ax
. p7 v9 c$ b+ ]. Z$ T- K6 m    jnz     SoftICE_Detected" w; e0 l  N$ ~) G, ^' h
3 a8 ?, [& P# V$ G; p% A- u9 a
___________________________________________________________________________
4 E/ h. k4 l2 U( T
8 B* ~4 u1 i& ]* E  |Method 04  T" w& T5 k- T7 ^4 z7 d# R: V4 h" u
=========( S8 D  J# B; H2 @; p" m% I* H6 C+ k+ w

" I, ?% M; Z0 z0 n) L1 AMethod identical to the preceding one except that it seeks the ID of SoftICE8 s0 V+ |% y0 u
GFX VxD.8 _. G. J, d7 Z6 v1 |1 T

+ |4 x7 Q- W) `  s2 y5 i    xor     di,di
) ~1 A* ]8 H# c/ g    mov     es,di" D1 a7 z- e1 V9 u9 ]& M: B/ p
    mov     ax, 1684h      
( l" R' w: C, \# N    mov     bx, 7a5Fh       ; VxD ID of SIWVID, Q" |/ D% Y! z, l$ K4 c, Z: W% L
    int     2fh  C- g& M3 y+ H' R
    mov     ax, es          ; ES:DI -&gt; VxD API entry point
( D# e! r# x' Z6 N* `, v8 @  q6 M    add     ax, di8 L  ]8 [9 x. K4 }+ w- @
    test    ax,ax2 e" l7 |$ w) F8 R8 c6 }; U
    jnz     SoftICE_Detected& P$ M. J; v6 e. m7 T0 v. b$ Y% {
$ |1 A/ d$ D7 w7 ^: d7 C
__________________________________________________________________________7 ^1 G: o7 D) C" }! W$ L
* [5 M' L. V$ u5 v# c5 i
5 @7 e/ J5 J; R- F2 M9 Y3 o$ _
Method 05. c% }" \/ {8 ]
=========$ q% b8 F4 N! m, G1 r
9 o& h& T  a& s# |7 x
Method seeking the 'magic number' 0F386h returned (in ax) by all system9 y) |4 m9 k, \) R* w2 P5 J
debugger. It calls the int 41h, function 4Fh.2 b4 D. l7 D5 O- }$ ^
There are several alternatives.  
& I! R% s, q! x. _7 K2 A% L) D7 o+ S7 w' Q% W% G
The following one is the simplest:: h" B* u, ~' g, n% E
2 b1 i% @- _* z/ d' a; h; N8 ~2 C
    mov     ax,4fh
' h4 h+ d4 F) [4 T3 u: R/ O0 ~    int     41h
- V" g' s& u. t) B    cmp     ax, 0F386& ~: D, {" B: Q! L" w: U6 t
    jz      SoftICE_detected" P$ F6 C" A$ T8 q# Z

* g* U: r) Q, {% e# {* c9 q% f2 w/ {% l1 n4 Y- E" a& ?" L
Next method as well as the following one are 2 examples from Stone's % N. {1 i9 `! g# S+ b
"stn-wid.zip" (www.cracking.net):1 R4 Y' O, a4 M# N3 t$ x

% m5 T- k& {- t; l- K    mov     bx, cs
% l, b- W' M% x: i4 E9 T    lea     dx, int41handler2
$ \* D- M) e# `1 Z4 B    xchg    dx, es:[41h*4]
% B/ l6 M( {# |8 e  B    xchg    bx, es:[41h*4+2]  {% x2 z4 d8 ~  V. e. T
    mov     ax,4fh
- a& n! M- z& c& ]- u    int     41h
$ m, t- Y8 b: D7 k# _  b    xchg    dx, es:[41h*4]
# h4 i1 l! a- k; g- t; D6 F6 h- ]    xchg    bx, es:[41h*4+2]8 `) N9 x  D" v0 a$ F
    cmp     ax, 0f386h+ ?! L$ g% h2 `1 c
    jz      SoftICE_detected
1 q7 U6 N0 D4 c# N
2 q9 A) U: r+ N7 @; Vint41handler2 PROC: m6 P; o* T) Y6 t7 K+ S1 p
    iret( @9 v1 V. X8 k3 h! [. ^4 N
int41handler2 ENDP! o) K8 V1 ?) {% i% ^; |2 |
3 _) i: V. O& f' s
* L& B# h$ m8 J+ v0 ~
_________________________________________________________________________
. [- N, G* y  C- A! \: b$ t8 R( p0 n9 M! ]+ H

6 P" b' \5 w: ^( A* ~. @Method 06- L2 T3 s9 p8 g0 s
=========! r( ^6 F/ {( @' d

0 S+ O& K  I# s3 O, N$ b- Z/ |1 v1 y  Q" H9 s1 L& w7 r
2nd method similar to the preceding one but more difficult to detect:8 @: H+ ], t- B: W4 H7 U: S* R# }( x
! D- p6 |# |5 Z# Q9 t; w
, B! O: x1 [, F  y. V
int41handler PROC( j8 `! u& R% @! L. R
    mov     cl,al
  y; M6 h3 H. \/ u# _    iret
' z4 ^" v- F  S' }1 `) H( Rint41handler ENDP; }" Q3 `+ I& _+ ^, `
3 I( O# n- c$ ?

* [* p# ^# @, u& e6 e% ]) x  |    xor     ax,ax( Q5 \4 g2 F: `; k2 e* t3 e, [
    mov     es,ax& U6 y1 ]  @2 @' v! @$ Q2 \8 h
    mov     bx, cs) C# p/ @2 F% S" m3 ?& B/ ]
    lea     dx, int41handler
6 ?( g; S% V' {  Y3 B, s    xchg    dx, es:[41h*4]8 i5 X' w8 ^' J1 B; a5 U( Z* m
    xchg    bx, es:[41h*4+2]. s2 }0 w- J8 [
    in      al, 40h) Z& a) v9 t) E6 j* i
    xor     cx,cx
1 q3 W/ C& W) P1 v/ Z% x    int     41h4 c, w+ C0 r% k  h/ }  x- F
    xchg    dx, es:[41h*4]% T, V7 o7 O/ w) J0 Q. `
    xchg    bx, es:[41h*4+2]  M2 R" i3 d6 }
    cmp     cl,al: W* X. T3 }( E  q% j! G% m
    jnz     SoftICE_detected
$ R! E1 O. J3 x$ V& g- E4 ^: K9 U  c: _  n* p
_________________________________________________________________________2 ^8 j- u+ |4 v6 W2 \

$ p0 {; ^# s) V! w( O* m8 mMethod 07
+ X& u8 Y) g9 e  b- Y) N=========4 q' Z$ _- b/ Y  w5 t
4 E; N# `5 {5 d7 ^2 Y7 j
Method of detection of the WinICE handler in the int68h (V86)
, L) L* K/ J% a! G
' B5 }+ @6 u" u' X+ m$ ^7 Y5 W! B    mov     ah,43h! t/ \9 r" Z# [! [; Y' k
    int     68h
- L$ B9 g5 h' m2 p6 v    cmp     ax,0F386h7 X5 l9 ?2 h3 ~% Q9 M/ L
    jz      SoftICE_Detected) l+ @3 N3 ?) b: c) H. e
# y; {8 |$ r! w  y8 H1 y; k

8 i- k! G! W+ }! }' w  [% y3 [=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit0 ^0 b) A& b2 w; Y1 F8 ~
   app like this:
4 E  l  x/ E) Z) S
7 E- r7 L. c+ X   BPX exec_int if ax==68
+ Q9 r" h* M: I. w5 c9 d   (function called is located at byte ptr [ebp+1Dh] and client eip is, ~- ]8 [8 r- ~8 O- {! _
   located at [ebp+48h] for 32Bit apps)0 \$ A! \/ ^6 ]+ I/ V
__________________________________________________________________________" e5 c! F8 ]% C( M0 p' _

! l9 P" i, d! J) M! f6 d5 P& ]
5 N2 U7 m' D, C1 ?Method 08. |3 J) Q' O) I' W2 L/ F
=========
2 J" J( m  q) W9 o3 Z: \) M+ \0 _$ c, u2 G/ o3 J, p9 [
It is not a method of detection of SoftICE but a possibility to crash the
( L, l% _  _, R( y, w) }system by intercepting int 01h and int 03h and redirecting them to another
4 {% ]9 @  I5 E8 d. ^( w. aroutine.
7 G9 i2 a9 T. h6 E( FIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points$ J- b9 \* k1 I5 u" q$ [9 p2 H
to the new routine to execute (hangs computer...), P5 f( F# K5 @) l
5 u& }1 ^6 L% W8 ^  E/ G! u7 s( G
    mov     ah, 25h
5 w" v+ v- S; U$ G    mov     al, Int_Number (01h or 03h)
5 r' n6 g8 C( p9 ^' |    mov     dx, offset New_Int_Routine
: o2 f8 `4 d9 r2 y% n8 ]* O    int     21h
* k8 E0 b1 ^- v8 X4 d" r! z8 o4 Z7 F+ A" P
__________________________________________________________________________, \) A. P% _9 x8 g4 K9 p+ R% Q" J- _. m

: M, [1 c% l- t* FMethod 09& ^: w  c! B3 o' a- \/ r
=========
8 R* l, Z: r5 F- l1 m; u9 P8 l9 S! |% u6 a0 }1 B7 Q# n2 D" C) D
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
+ B4 g& i9 z) ^3 v/ \; ~performed in ring0 (VxD or a ring3 app using the VxdCall).
$ F% v2 N# y) B: T/ A+ K- Y3 CThe Get_DDB service is used to determine whether or not a VxD is installed
; b9 F7 a% ~  |+ Q* qfor the specified device and returns a Device Description Block (in ecx) for0 l8 E* h( ?% d( ^' k5 U1 z
that device if it is installed.
& `( Q! i5 Z$ s# I+ T
; ?" y; D; F( k& d# o+ e   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID
& S0 }7 Q, p, T- x* a   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
" V) L1 w. S$ g1 E3 y# A) O   VMMCall Get_DDB. }% D& I4 L% W  O6 I$ o
   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed  w3 ]' S9 ]) ?7 M6 G- P

$ C% h: s- \9 e& p- p. c6 F  uNote as well that you can easily detect this method with SoftICE:9 ]% }" B+ w" B7 l9 g' z- J2 l
   bpx Get_DDB if ax==0202 || ax==7a5fh
. ?$ S  a9 G, z
7 o' H! K" ]/ `__________________________________________________________________________
, l4 T4 D: Y; K) U( s9 ?" b( t- v# R6 `$ s2 t
Method 10
% y: Y; Z( c2 q# C! e' B) Y! b=========
6 M7 J( z4 c# _+ |3 ?
5 s3 |( x2 \% q% P8 }=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with
" t$ A( N0 b! k0 ~. s  SoftICE while the option is enable!!$ c- R6 _) v$ v. b

* J+ S+ H8 b2 dThis trick is very efficient:
3 Z; N/ s( a% B" `by checking the Debug Registers, you can detect if SoftICE is loaded
0 l9 ?( B4 Z' g9 d: w/ e(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
1 C, E% d( c5 Y2 I& g: p* I9 Nthere are some memory breakpoints set (dr0 to dr3) simply by reading their+ a0 @: D) S! G
value (in ring0 only). Values can be manipulated and or changed as well
" \3 h  [5 K  Y8 Z9 r$ [(clearing BPMs for instance)
' U5 x# f4 b8 |; B/ _3 F
! h  P; I# `4 `" G2 N9 J__________________________________________________________________________/ D9 z  C! t: x& |+ Z3 o: u
: n. p. _/ M8 x
Method 11
" f2 o' d0 |1 S3 M; E' i. n=========
( N# a( N* ?8 l0 m, H* @* y2 C
: |0 o- \' i. l( U: H2 z  mThis method is most known as 'MeltICE' because it has been freely distributed
2 |! ^& I% {3 v. G( Q$ Bvia www.winfiles.com. However it was first used by NuMega people to allow, Z7 i$ l$ y2 I2 A
Symbol Loader to check if SoftICE was active or not (the code is located& W9 M) u) N: W
inside nmtrans.dll).
, c- ?) `) ~- k0 V' ?# @1 k% e1 A% }! z" d" A) X
The way it works is very simple:
# z$ o! b6 I; ?" L+ E7 U* [, YIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
* T, f6 c) C. w' n  g9 b8 EWinNT) with the CreateFileA API.
9 u) E, r5 o8 P# g6 Z) h
$ c8 g, S) W* Q* HHere is a sample (checking for 'SICE'):
: w/ ?/ J% p' C7 H, E: Z/ B% _  N% E. t' @( F
BOOL IsSoftIce95Loaded()
! i" v4 \. ?0 v/ a8 C. C4 ~0 Q{. h4 k* @6 L( f
   HANDLE hFile;  & Y7 L0 E$ {- f/ A/ v/ ^
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,$ j5 ]4 ~# x( Y
                      FILE_SHARE_READ | FILE_SHARE_WRITE,
# j/ B! [( a8 Q* K7 h                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
" U2 p& o# g3 ]- f6 Z. b   if( hFile != INVALID_HANDLE_VALUE )
* S1 `% o0 q/ b6 b/ h, J; ~5 c   {
+ J! L# u* }3 M! G* _      CloseHandle(hFile);
8 q6 f, I+ {+ m      return TRUE;
: W9 Y- c/ f; t' c( Q   }
- ]4 o" s& H( ]   return FALSE;
8 s, O+ X/ t0 C( `* w9 ^( K8 e}
. k( p3 m! Z4 e
. g, |3 z/ D  A1 Y. XAlthough this trick calls the CreateFileA function, don't even expect to be
& u0 g9 X- @5 G# X: P6 aable to intercept it by installing a IFS hook: it will not work, no way!
" K6 A: N1 k; [. ^In fact, after the call to CreateFileA it will get through VWIN32 0x001F
+ `0 m; v9 I9 A# {4 @2 wservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
: n5 F2 \. ~) l, g! |and then browse the DDB list until it find the VxD and its DDB_Control_Proc
% x2 c; x. S2 |8 j+ H0 Q( T5 f$ gfield.
( I" h0 ~6 ^0 m4 G" T+ g; n. L) ?In fact, its purpose is not to load/unload VxDs but only to send a
  Z: n: ^! ^1 O) w* c3 Y# NW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)5 y' S8 A  v: D: |% G+ l
to the VxD Control_Dispatch proc (how the hell a shareware soft could try! E. p, A* S) f* b2 [+ ^
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
3 F/ g4 ?5 [( j2 tIf the VxD is loaded, it will always clear eax and the Carry flag to allow
  ]0 ~! S) M* w* ], Z: [0 O0 Tits handle to be opened and then, will be detected.
  I5 L% d  y; D$ fYou can check that simply by hooking Winice.exe control proc entry point
+ X5 ^7 w' }4 U: awhile running MeltICE.
) U, z) C7 G5 c( Q: `& ^( o9 I# r: h
: H8 \- `8 W/ Y  k3 A" d4 X0 n6 A7 F4 F
+ l2 R# r% X  K  00401067:  push      00402025    ; \\.\SICE
, s. o9 F8 o) g0 U! ^: j  0040106C:  call      CreateFileA
; u3 V" u% X  @- o! Z/ t% ?) Y  00401071:  cmp       eax,-001
, v( z' s& [7 u" f+ e  00401074:  je        00401091
8 A0 `9 o: c1 |# K. ^0 F# Q% ~! s  u2 a# N/ v6 k5 m: v+ o

; M% D! j) x& X2 U, MThere could be hundreds of BPX you could use to detect this trick., ?2 o0 x- R3 l$ m' d* ~1 v
-The most classical one is:3 X: Q5 P% Z0 x- |) j
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||8 m6 d0 Z7 S7 f. ?/ ]# B
    *(esp-&gt;4+4)=='NTIC'
7 ]+ F: P9 D1 q6 s) \% J% |- G4 d5 @9 X
-The most exotic ones (could be very slooooow :-(; ]* m  B, w( A/ [& c! |) k( f
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  
5 K. S! X4 t6 z: x' ^1 ^4 k. q) H     ;will break 3 times :-(
6 h: w* t1 i: [! ?" r6 i" z+ e  `4 a% J6 U1 _
-or (a bit) faster: 1 |; z4 n& e- Q" G% j
   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
7 Z. l4 ?, T) }8 b5 [7 V: g4 s$ T
9 O7 A  H: Q: i, t& g. a$ [   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  ; @8 P- A; {0 K; c; g8 I) \# H
     ;will break 3 times :-(
' z! V+ \1 D3 h2 R' S+ g; X0 }* T; w; X5 O
-Much faster:
( \% c% r% l) K' \! y2 v- h" ?! R   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'8 G1 C0 _- e1 D+ M, t. N+ N
3 l' B+ c1 q' y
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen! @" r- T& x! u' L: t6 T+ Z
function to do the same job:
  _$ `- D, x, m* f% g) i4 V, `
; ~. Y' C  q' T5 y& f; {7 k   push    00                        ; OF_READ$ M5 Z4 m! E+ r( e
   mov     eax,[00656634]            ; '\\.\SICE',02 e1 {' E* V# M, G! u; P
   push    eax  w; A" ~, I( H
   call    KERNEL32!_lopen/ p* z& Q7 F9 {. M! q4 x& U$ Z
   inc     eax
. p- H9 h0 V- C: b9 E$ \6 C# Y9 \   jnz     00650589                  ; detected
5 P  b( M& u: ^0 Q   push    00                        ; OF_READ
* ^( z9 r2 B: I8 x+ ]   mov     eax,[00656638]            ; '\\.\SICE'* U) l5 f' Z6 }' }4 V- k% P
   push    eax+ j2 h5 [. O+ C) L# q3 o  I
   call    KERNEL32!_lopen
, L7 S- u  z+ s+ q- f   inc     eax- Q2 V" W7 T8 Y
   jz      006505ae                  ; not detected- T$ g+ d% K7 i+ f
' v& U2 r( A  Z6 E' b& V, l. g3 T
% z2 r/ l$ Q  `, x2 Y
__________________________________________________________________________( v* j+ M4 i! W: R1 n

& w% _, C# ?4 u; \8 _. c; C2 ^8 rMethod 12: f7 n8 L+ \2 y1 t1 B' L* v: F
=========! b9 N! b  J' F, n  N

+ N) k7 M5 f4 i! t4 ~& dThis trick is similar to int41h/4fh Debugger installation check (code 051 h0 M2 ]/ g  }" q0 i: i
&amp; 06) but very limited because it's only available for Win95/98 (not NT)' q& F" a; {2 e& t4 I/ s% S& H
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
( j6 o8 o8 I7 d2 p( r' F9 R7 I/ j5 L( }
   push  0000004fh         ; function 4fh' \9 ^1 B& W. H6 y7 y
   push  002a002ah         ; high word specifies which VxD (VWIN32)
  p* k1 W/ M5 s2 {; q                           ; low word specifies which service
6 U2 L3 \7 o- m0 {6 I                             (VWIN32_Int41Dispatch)
1 [* Y. |% g3 g8 h2 K+ @: v( o   call  Kernel32!ORD_001  ; VxdCall: R' {% `- Z9 g6 c1 M  r- i
   cmp   ax, 0f386h        ; magic number returned by system debuggers
. n4 T* Q  V9 }4 n   jz    SoftICE_detected+ k4 Z+ ]: p! h3 G( O# c& w$ Y
% [* j2 r7 w5 a8 s" n
Here again, several ways to detect it:
: {! x3 C9 H2 r2 O& ]# e0 c8 u3 I7 X# f. m/ Y0 X
    BPINT 41 if ax==4f2 P2 J: l! C6 x9 Q

- e0 [- h& S; u# N4 [- u) L    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one$ T  x" t/ d6 x

9 z9 j1 {# w; Q3 V5 V    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
; m2 ?0 I* G6 A4 }- i6 k# |7 l3 h1 T. w, B, K0 Y2 S% C
    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!& M& }4 P, B( M
- a9 {$ M# R! _/ J% A
__________________________________________________________________________2 D4 \& Q) U* G7 J5 `
1 t' P: h- e1 j( T6 n9 ~5 {
Method 13
. y8 H  |1 Z2 E; Z=========
+ f5 {! E! ]3 T$ a
- @, h( S% a/ c/ I# @Not a real method of detection, but a good way to know if SoftICE is
8 h* I6 o' R4 y+ y- I( finstalled on a computer and to locate its installation directory.
2 M& }; s' U( E% ]+ }3 f  }It is used by few softs which access the following registry keys (usually #2) :
) M0 N8 ?6 `2 X0 p7 Z" T- O( v5 x5 w2 a  \
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion3 h: g* s: N5 G3 M0 a) U2 m
\Uninstall\SoftICE/ ?+ e/ V; O+ T! B. d% ?# U
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE  Z$ O; ^: ^% z! t
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
! {* n; t/ g4 O: K\App Paths\Loader32.Exe
2 K2 w! C6 W$ {, O+ t" n/ t( ~7 J0 i+ A/ k; m
+ B- j5 a( J, b7 P, T! l! ]
Note that some nasty apps could then erase all files from SoftICE directory
: H2 X* {# c1 Z' j(I faced that once :-(3 K5 f! e! U  u
2 o1 [, w' C0 l+ n6 G. B7 w- V
Useful breakpoint to detect it:. v9 a2 z# a( Y$ s& V

- z; G: B# A& [     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
3 T3 w: J7 n( N! k; k5 k) W* ^, k+ E/ y7 o$ ]$ w0 O
__________________________________________________________________________
# A' }: S) D3 [. G  J( m* d5 V" }4 D6 ?1 z* j% k# _2 x

4 P0 s4 D0 A8 I! vMethod 14
) ^& z9 S- S: L( g=========
, H( o, {: v' o2 W
$ `- R* ]1 ^- UA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
7 W; ]/ w; v* G& Z7 _* B6 ^$ ris to determines whether a debugger is running on your system (ring0 only).
8 b3 Q' D& j& L* R* H
4 K1 W0 t5 O( d1 H* t( h+ Y   VMMCall Test_Debug_Installed
/ H* I7 k9 n+ y, B' p   je      not_installed# t* _& d! M- O5 I0 q' {; {
' Z6 E. W( p1 d
This service just checks a flag.
; |4 Q/ K7 ?) \  H  d1 R0 F</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-8-12 03:31

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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