About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
6 K: c1 A' j( N& d<TBODY>
; P, M* T0 D' v& b' y<TR>! W! Y" h2 \; h) _8 ], {
<TD><PRE>Method 01
& S5 X, A3 B! D) H) k=========; I; g9 f, K- D' R3 ?. P6 y
2 f% i  c9 B' [+ C* v7 @, q& {
This method of detection of SoftICE (as well as the following one) is
5 {4 D, T: K8 G9 _! ~used by the majority of packers/encryptors found on Internet.
$ f" V  N/ J8 z' _; KIt seeks the signature of BoundsChecker in SoftICE; t) [. Q- X3 l& n
& E; B8 R/ P; s) H
    mov     ebp, 04243484Bh        ; 'BCHK'  r) V8 A' A/ w  G
    mov     ax, 04h
. V1 ?( C  f. ~1 O5 X    int     3      
' j4 V8 s5 d( l+ o4 }2 Y" \    cmp     al,4. L7 g" ~) O$ B9 i8 B/ S- P
    jnz     SoftICE_Detected0 j5 W/ \4 N% o# u9 S/ H4 {0 D2 V

5 z9 k6 w+ C8 I5 D& w; u4 N___________________________________________________________________________% F. U) N0 w+ W

/ }* E; p$ ?7 f+ b6 yMethod 02
* s! }2 a$ N  u6 \=========
; L) @" ?8 p/ n7 P1 @/ e
7 Y2 t! O% a- L+ _$ B" lStill a method very much used (perhaps the most frequent one).  It is used6 @; V; x0 B& m- e, u
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,7 g$ I- u- L$ m* y' L
or execute SoftICE commands...! w9 Z2 J/ w0 F
It is also used to crash SoftICE and to force it to execute any commands
) Z/ o2 [- i5 g4 y  m(HBOOT...) :-((  
. O% L8 f1 J( b( T6 m9 {7 `
8 ?+ |2 w# o( E" g9 YHere is a quick description:/ o5 c3 n' z( L5 a
-AX = 0910h   (Display string in SIce windows)6 r4 j# L8 l# X0 j4 w
-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)' V4 C2 Q; R! v+ V" W
-AX = 0912h   (Get breakpoint infos)  ^9 j) [% c% m. F+ f- E2 K
-AX = 0913h   (Set Sice breakpoints)
) X% j# @, f4 i/ I0 J& y6 e-AX = 0914h   (Remove SIce breakoints)$ g2 U/ {# y0 ], \# M  k9 X
' o! ^% t, K! R" S9 ]
Each time you'll meet this trick, you'll see:6 T( g! D, k! h. b1 }- P: o8 s
-SI = 4647h
  I# _+ h- Q! q5 D8 S* k-DI = 4A4Dh
1 N, ]. H2 e+ D8 R9 Z& U" f0 ]2 NWhich are the 'magic values' used by SoftIce.
! t( J% ~$ E$ M+ q' v% [, gFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.1 Q8 ?( i% Q. f/ a- P
; n( z6 ?5 d# S' C; _$ ^; s* t
Here is one example from the file "Haspinst.exe" which is the dongle HASP
* @7 |2 y: s- D* mEnvelope utility use to protect DOS applications:
$ s0 U  W* B: v1 U1 {) m$ ]6 {8 @4 N$ h3 L, h1 }$ g# T

' R: e6 a/ ?7 R  E) a! r" _4C19:0095   MOV    AX,0911  ; execute command.. l1 d6 D4 B# _" D1 O( r
4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
# ?/ ?- c2 H' T6 B/ E$ {2 _4C19:009A   MOV    SI,4647  ; 1st magic value.
, v4 V3 L7 D. n4C19:009D   MOV    DI,4A4D  ; 2nd magic value.
: K3 p3 f5 W8 P) J2 g8 T4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)* l, U# e; s; h: A4 z& X
4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute
5 M7 K, M/ w( N& G) q4C19:00A4   INC    CX! W  G) k! K# g0 L& x# z  G
4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute) v' y2 ~, f; ]
4C19:00A8   JB     0095     ; 6 different commands.
* F4 k+ K7 B) c/ P. P4C19:00AA   JMP    0002     ; Bad_Guy jmp back.$ |1 W( a2 d' b8 [4 S. o2 _+ a
4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)4 e* S6 F5 e7 c! {' v& z

: t! |; X5 o$ x6 }The program will execute 6 different SIce commands located at ds:dx, which
; F& o1 K$ \! v9 g7 V' uare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
' u' n. S9 G* _' H3 n' H% o- ?1 l0 Y( N6 ^+ i
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.1 _$ {+ h; P4 c. B
___________________________________________________________________________9 X* s0 J0 x+ W) v/ X& o# T! f

: i" o3 P6 G4 C& @6 R5 R5 c  N4 R  R/ Q# C  l7 A
Method 03: J  l  V3 x: ~8 \4 u
=========
0 e0 e0 h& g( {1 j+ Y  s; X
  c! z! T; [5 [+ |3 l3 o3 CLess used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h& F+ v: B1 G  X$ k( R
(API Get entry point)
0 P: Z8 @/ B" [2 c7 G3 _2 V        ( y6 }  c0 I4 `; k# T" T- J
+ O, T1 O, j( D# {! ]0 {
    xor     di,di& Y; P" T+ F6 b, l. |
    mov     es,di
3 @! o! ~: Y* `9 H. B    mov     ax, 1684h      
9 E3 U8 n+ g3 `6 A0 n! B    mov     bx, 0202h       ; VxD ID of winice! C- M8 ?- m' {0 h) y9 ]/ V( ?+ T
    int     2Fh
8 C- c* W1 R9 V/ Y7 x  z5 ?    mov     ax, es          ; ES:DI -&gt; VxD API entry point
* Q$ C: h  X: [9 k4 E    add     ax, di
0 U; b$ E2 u7 r' D% C$ [, [    test    ax,ax
' O+ Y- }5 |; \( @# Z3 ]( j/ d/ s, J    jnz     SoftICE_Detected6 [* M" ^  T" C+ k4 W- R& E

( M; J/ B  E$ K) Q! @___________________________________________________________________________
$ g5 S1 P$ E+ V) F+ r8 C  X1 H- j2 L( B  u8 K
Method 04' Y' j) W% x" v, y% \" P$ @, I
=========
. I4 J3 V; K6 v  p$ i9 @
" }4 L( x. P4 \, u4 [6 |& bMethod identical to the preceding one except that it seeks the ID of SoftICE' A+ d: z/ d5 y3 ~) l( m$ N! k
GFX VxD.5 z+ a0 U! [" y
; {/ b3 }6 t; {7 {
    xor     di,di
1 N( N+ W* h. b    mov     es,di
) x7 S, ]# n  I4 {& V% C: B3 y    mov     ax, 1684h       / Q( J0 E$ `) x; J4 E
    mov     bx, 7a5Fh       ; VxD ID of SIWVID, y, ?  a8 \6 T; {. R5 _+ m3 q
    int     2fh0 s# C2 N. Z6 ?  A2 b- p
    mov     ax, es          ; ES:DI -&gt; VxD API entry point; L2 n/ m1 d5 w% i
    add     ax, di
6 |6 U# f" c/ U( y9 }5 Z    test    ax,ax
6 o8 Z8 I* w( S, [    jnz     SoftICE_Detected: ]* |8 |  _# u" B
7 `8 E( f  ~% ^) g) o7 X
__________________________________________________________________________" `2 Y8 v- N, _* e$ r* G- O
+ e! y% v+ \4 Q- d* h& E
* k! R2 [! U# R1 y; D) k( a+ I
Method 05
+ S2 \9 g- G; f) I2 X=========# e' Z0 `/ x- D. t9 `, q
0 L! M) I3 y- o1 Z$ C! U& a
Method seeking the 'magic number' 0F386h returned (in ax) by all system
' E, v! A) Y9 G: [# Ndebugger. It calls the int 41h, function 4Fh.
. D& E" p# E# U" A3 u4 _There are several alternatives.  
0 s7 |0 I) x' U  f  K( T9 M% O; w6 g; s8 y- z
The following one is the simplest:
1 T0 H' n* z; Y' Z+ {2 d( l/ C' t8 N! y7 [  ?2 L$ |- x5 [
    mov     ax,4fh
3 _7 T% w$ u1 _+ d; e. ^    int     41h* ]# i- e/ @5 O
    cmp     ax, 0F386
+ d8 o) |3 r( ?9 q0 O; @9 F. ~    jz      SoftICE_detected9 T# F" t5 k$ n9 z
) u8 h" ^$ O5 I2 v

; d7 `2 o7 W9 K2 {/ p$ nNext method as well as the following one are 2 examples from Stone's
. A# f" e6 }! p) T"stn-wid.zip" (www.cracking.net):3 E: X2 c6 c8 Q4 n: v5 t) Q
# P# u  d# W) [0 I6 k2 [
    mov     bx, cs
8 }- ^$ V/ ~' C8 P    lea     dx, int41handler2) L5 ~- |, u0 _- M9 F" H
    xchg    dx, es:[41h*4]
. X3 y8 R/ Q' A; _: X/ n    xchg    bx, es:[41h*4+2]9 U' n1 o# z+ p3 q1 @3 }
    mov     ax,4fh
1 a* S6 \2 Y0 N. ~6 h8 b8 C# n    int     41h# {( I2 N- A' @) _7 g& Q
    xchg    dx, es:[41h*4]# M9 Q$ u4 i' u4 i* J8 A0 @
    xchg    bx, es:[41h*4+2]
$ L$ B" N0 P. E- j7 |: K( l    cmp     ax, 0f386h6 J' p1 {* f0 F
    jz      SoftICE_detected9 H- \+ _4 @* m  {. r+ A

4 X. K: `8 ^3 `, ?5 i' {% l/ Iint41handler2 PROC
) [: {0 e- U! v    iret+ W, q$ `$ W0 N* ^
int41handler2 ENDP
' Y4 j, b' z  L
# h' U3 j# N0 v& b- ]/ I$ W9 ]4 ]' ~) ]' D/ x7 W
_________________________________________________________________________+ F# t. c, P3 R) R
) J( _* h, X8 a+ `

/ `. s5 x2 O" ]+ h( d, xMethod 060 C5 t- a) A- S7 I5 H/ ^
=========
' f9 Z- }* @* W8 S* @4 r9 s2 N" J" v& M( k. w5 ?

* `  @  ~+ d4 T) ~! q2nd method similar to the preceding one but more difficult to detect:+ E0 l$ _: \+ A' _; N5 A0 B

. C# `4 t  n1 }/ T( s+ `; w" N: P8 p/ E3 M- I+ p
int41handler PROC4 |: Z! w+ \1 O" w" _9 I
    mov     cl,al/ S6 G( t2 N9 x4 o  M  L) _
    iret. A- r& I+ ^% x$ {& j
int41handler ENDP
( ~  E3 _# Q3 g3 \( k) |
8 D; Z, U- s  L* R7 \) h0 Q8 r" D, G$ t- O  v4 j% x8 }* b2 m0 w
    xor     ax,ax: ~9 G# P0 ~! s3 Q
    mov     es,ax
$ [5 L) {" H! t/ W. `$ p0 R    mov     bx, cs
3 x: F5 J7 P8 U3 a  d+ l    lea     dx, int41handler. u. Y2 Z" @; C! P
    xchg    dx, es:[41h*4]
  S% f" }8 x; t8 V0 @    xchg    bx, es:[41h*4+2]
6 @% w5 @* E+ z$ K) b' A* `( Z  J6 r    in      al, 40h3 d: ^# ]5 _# D
    xor     cx,cx) f8 \8 Y$ k. H
    int     41h
5 B1 v- u( X9 k4 ~    xchg    dx, es:[41h*4]
; f2 Z" M9 b  h4 }    xchg    bx, es:[41h*4+2]8 q6 j; j1 @2 ^1 J% S! c( {
    cmp     cl,al
; u4 Q" R+ o5 m8 u4 g' [0 D5 r    jnz     SoftICE_detected- ]0 b: M6 u% m' o$ K$ r1 G* q7 K
* T* M- J& a6 W( N) x8 \- y. u
_________________________________________________________________________+ ^5 |3 C% A) Z  x' S

! J; B" f8 F' |! ^+ U4 F1 P1 XMethod 07
5 U: x$ S/ |+ @=========0 }6 n8 a" d, X6 x6 L/ ^+ y

( G* r/ F% |7 f- \Method of detection of the WinICE handler in the int68h (V86)
0 x1 J' H5 A. v2 S- |2 F' Z6 l
) s6 R8 V0 |4 r9 x: K' I2 R' B( a5 D- F    mov     ah,43h
, \5 Y' y! @$ k    int     68h
2 q6 ?& }# u" M" M& R' T    cmp     ax,0F386h
9 l; U! q! f4 K/ t    jz      SoftICE_Detected
, x. }2 j3 M; s* ^) q- n2 F, ]; m- [; G% r. |3 t8 a8 e! m

" `* @/ z) M% K, P* f* z5 ~( S; z=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
2 S! I, @1 N+ e$ s8 z   app like this:6 [/ S+ `) h) V: O

$ P! p. ]* u7 c. L, I/ m   BPX exec_int if ax==680 t" K+ g) k( a1 Y  G- U" s3 S
   (function called is located at byte ptr [ebp+1Dh] and client eip is2 `! h4 j9 f- Q4 B; w+ |
   located at [ebp+48h] for 32Bit apps)
+ p% q  z0 T0 j__________________________________________________________________________
+ h* G2 K5 b) Y5 V" p! ^4 t
0 V; d0 k! ^& N3 ~, ^0 o$ G
  g/ G' p$ V9 AMethod 08
9 H4 u+ k6 p5 ]6 I2 {; n/ I=========
% d1 [6 R# E+ d/ G* }+ m# P2 J% ~' G- [: x3 v
It is not a method of detection of SoftICE but a possibility to crash the0 B$ f( S/ h5 f: J3 x9 s0 Z) i$ C7 K
system by intercepting int 01h and int 03h and redirecting them to another
8 U' ]  V4 x  ~1 h$ U5 uroutine.  j9 ?( v. A9 ?: M- n( V6 t
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
) Q0 i1 g7 S1 B$ L/ k" y) w2 Mto the new routine to execute (hangs computer...)
4 j* l; K) y8 e" J& E0 E+ e* F5 e* o% o1 W" u
    mov     ah, 25h& P1 l0 w' W, `6 s# {; c2 B
    mov     al, Int_Number (01h or 03h)
1 B, H/ s6 |- x( u) {    mov     dx, offset New_Int_Routine
5 N8 Y9 m4 x- @9 G& z6 |3 @    int     21h
1 ]3 ~: |! {+ u, K. ^1 W' J. \6 a5 ~9 Z' b' G7 f, S
__________________________________________________________________________4 l( c% x; c% {# g$ u5 B0 C
# b. S3 o* @. y, x  {
Method 091 P* h3 m+ c  c1 i6 o6 W7 c
=========1 ]9 {( J% e- F4 Q0 ^- F
7 b/ t1 F9 b. _# o/ W
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only5 S1 P) |8 u* k$ N" n
performed in ring0 (VxD or a ring3 app using the VxdCall).( ]4 ^8 U+ T2 V7 b" x; G6 P
The Get_DDB service is used to determine whether or not a VxD is installed  T* A& U+ u6 d" F* R; U" T
for the specified device and returns a Device Description Block (in ecx) for# A+ i3 I5 N7 T$ j% y
that device if it is installed.
! ], S  x+ G* H! b* P" r% B% O* }, v1 ]& l. N) e- T
   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID
: r: s( ?3 S1 V% r2 r  e   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
/ i7 ?* {, \  u7 n   VMMCall Get_DDB
- n: X( z  H/ @6 d   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed7 ?2 s4 X! t8 f/ t; s$ f) y
  h' b) p! G, o1 X7 Q% D6 u3 C
Note as well that you can easily detect this method with SoftICE:
% g2 ~& r) Z- N+ y  f   bpx Get_DDB if ax==0202 || ax==7a5fh6 M9 _+ \  P5 s( X

, O& \, e6 C, X* @0 G__________________________________________________________________________: P; ~5 b0 _1 a  c0 b5 n

. p$ Q5 @% h( J8 w5 Y3 o' @9 cMethod 10
: Y* o0 _8 D" h( m6 r" [; a=========  e5 j3 [4 w% {+ Y( P  |5 d9 Q
: o. n. ?. R. d* s& t! v- h
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with
; _' w+ y9 r' j  k" J1 K# J, `3 x" a  SoftICE while the option is enable!!3 f/ F" B( _) ^7 V: T
2 C* s! }: \& [% V" D4 ~- b" ~
This trick is very efficient:
! E, C9 k2 Z' \4 q) c! n$ Yby checking the Debug Registers, you can detect if SoftICE is loaded
5 @4 T' G1 H( P& f- t  d(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
+ p8 w' j' i# g2 ?: O& q( r+ Fthere are some memory breakpoints set (dr0 to dr3) simply by reading their& |% Z' [, |6 W; k+ a$ o
value (in ring0 only). Values can be manipulated and or changed as well9 f. l$ ~  D( J4 O' u- e$ p
(clearing BPMs for instance)/ ^: N6 P' j3 E" b" T

. D) E3 Z  N4 u6 d7 o8 m# K# `__________________________________________________________________________
4 k' ]; T# s6 @% D7 Z' s9 s2 A. W/ U% A
Method 11
1 R5 u) j0 c, s) h=========
; g  K6 L. K' _1 Y9 b$ b! D" F; J* I. A1 ?! A3 A
This method is most known as 'MeltICE' because it has been freely distributed* a0 a2 `4 U+ H- B
via www.winfiles.com. However it was first used by NuMega people to allow
  ~4 k9 u. J, O3 T7 m. E( YSymbol Loader to check if SoftICE was active or not (the code is located
$ O: ?/ u; B; `* P% ninside nmtrans.dll).
; C, J) h3 z% ], K+ W! I
0 q2 t; T. G/ r, ^6 ]The way it works is very simple:: `3 v9 p" Y7 Y
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for( c8 ^! ~) w' f5 b, E( \( y
WinNT) with the CreateFileA API." Y9 ~' g$ \; r+ _# q' V$ k+ o, w$ k

$ Q7 G( t, i9 Q4 N) f1 |Here is a sample (checking for 'SICE'):
4 }$ `4 P, ]7 F/ K% o
& s: h' a* W7 D' K4 d) c) J' h5 ]BOOL IsSoftIce95Loaded()# ~+ u% U0 P5 z" k3 _# N
{
: s) t, J. M; l( [* I7 \   HANDLE hFile;  % j; ]5 x: [. y, S
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
' r4 j9 f3 j1 W1 b" l& T                      FILE_SHARE_READ | FILE_SHARE_WRITE,
3 Q4 K) f1 d3 G3 d7 q) `. X+ ^+ _/ C' l* f                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);; e8 v- h; W% h# o- B/ s+ c# Y
   if( hFile != INVALID_HANDLE_VALUE )! H8 o/ n! G( e0 {5 I8 @
   {
* b$ d" Z! t- G) |9 `" L& d, B- r% K2 @      CloseHandle(hFile);: a3 m  ]) F' s. N$ n6 m4 ]% K: q
      return TRUE;
! E* H; J% q7 x! j   }
. d) E0 Q3 l" L6 }) l# V3 F# f   return FALSE;
+ p- U8 y4 ~6 f0 W' s! P) d}' a+ W0 K' S5 d7 C2 k1 {
; Z7 _7 `, v+ L. }5 B' t4 M# b- C
Although this trick calls the CreateFileA function, don't even expect to be- {; h5 P- y& d; W4 c
able to intercept it by installing a IFS hook: it will not work, no way!
# m( P# [) N: }! J7 d* b9 c8 ?In fact, after the call to CreateFileA it will get through VWIN32 0x001F
4 X! E+ F. A5 N8 c3 L5 \service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)$ x3 E1 n; p! z, E: k" o7 X
and then browse the DDB list until it find the VxD and its DDB_Control_Proc7 l; K  H3 o8 f& K
field.& e+ b5 O& V  ^
In fact, its purpose is not to load/unload VxDs but only to send a
% }' n. F' |. |# LW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)7 h; N' d7 H: N4 d4 B. @" p
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
- [+ G* W* C9 [% oto load/unload a non-dynamically loadable driver such as SoftICE ;-).4 ]  x( y% f! I& B
If the VxD is loaded, it will always clear eax and the Carry flag to allow% @* J) |# k. Q0 s2 g
its handle to be opened and then, will be detected.
  ^7 O* T1 ]3 k& qYou can check that simply by hooking Winice.exe control proc entry point  ?/ j( l& d# u1 T0 k! i
while running MeltICE.  A! u8 z) j/ |; ], m- P- S0 N5 t
% j5 }2 e6 t  ^

% T& r  u- I, c, J; _% Z  00401067:  push      00402025    ; \\.\SICE
. Q/ j' A4 o1 C0 B8 h( P) t  0040106C:  call      CreateFileA
+ Q7 ^) l& Z( b& Y8 |1 ~/ z; z  B  00401071:  cmp       eax,-001
1 [* w- B+ ^( _  00401074:  je        004010912 V5 H7 X. y& ^) b) f

5 B! ^/ M- T  Y6 s, A$ v! W
. r% p: q1 u9 [6 z8 ]) MThere could be hundreds of BPX you could use to detect this trick.
2 J: f! C; a+ Y4 s  w! s-The most classical one is:/ u6 T3 k& W. u7 x: J# n
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
. ~% |# v: i  s; e% V& Q$ o    *(esp-&gt;4+4)=='NTIC'& I  d; ?6 Y0 Q7 C  `7 c$ u+ L

" Q: C+ R' Z) s3 q0 V! O3 W/ |  R, B-The most exotic ones (could be very slooooow :-(
% ?) z, Z2 g( V   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')    Y! p7 {9 M$ M/ i7 Q, ]
     ;will break 3 times :-(
6 s0 U: N) G, P2 o
  ~  G; v/ V2 i2 h+ ]-or (a bit) faster:
  h1 ~( I# R1 q5 J: ]0 o; j   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
! {# N& z0 k9 W4 a; ]0 {3 ?; F
! r4 w" w8 Q1 d, ^   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  0 U+ P" q* f* ^' C  D: d" p2 C: V. ~
     ;will break 3 times :-(
! c& N2 M9 D+ G7 B
* _1 B0 n, T; b$ ^/ z-Much faster:. `7 l% ~  {) P2 D9 _5 D
   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'
* z) I& ^$ ~8 I- b
2 g( D5 E* I# Y) ]& i. S; y: X/ ^Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
: h/ Q+ M1 H0 M7 wfunction to do the same job:
8 P6 U; ]  @$ y& }! R
5 w, ?: w2 |2 C% h. u8 A5 U   push    00                        ; OF_READ
4 x2 w; b) C4 H/ ]" z5 b' h   mov     eax,[00656634]            ; '\\.\SICE',0) ~, o$ R9 B; Y. p/ R) w, M% F" b
   push    eax5 W( g- ^0 u3 l/ _3 A
   call    KERNEL32!_lopen
- O7 n, R  w! [$ Z   inc     eax
/ Q' Z" ?6 F2 B) S8 @7 G   jnz     00650589                  ; detected2 L3 ?% A+ {$ ~( n
   push    00                        ; OF_READ
$ n6 k# L9 ^% U( b' v6 @. N4 w4 w1 x; |   mov     eax,[00656638]            ; '\\.\SICE'
1 A7 h! v; W" f" V   push    eax
' d' V+ n, R( w4 r* }9 s% y1 @   call    KERNEL32!_lopen
+ s. G2 q( h7 {! D7 T   inc     eax4 C. I2 S8 h3 `2 H
   jz      006505ae                  ; not detected
/ `3 A5 v% j% T; f: o2 ~. O6 M" G, [
' k7 w  Y/ @" u2 S
__________________________________________________________________________
% L# h: z. C; E& b! r5 g4 I2 T: r5 B* W% Y: U9 p
Method 12: ~8 [' H& b# @1 i8 b4 S
=========
, I3 Y+ O9 b) i7 i+ d+ K4 m$ _
  T; k. t+ Y: P& D3 r+ V3 z' g$ TThis trick is similar to int41h/4fh Debugger installation check (code 05' Y. N1 T' N3 Y* Q8 h6 f' K% ]; v5 s
&amp; 06) but very limited because it's only available for Win95/98 (not NT)! `1 F/ r4 ^2 U; R* x5 N+ ^
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
" \3 \' T$ K7 w( e. q  G
) E8 ?, d; ]9 J- s4 O9 h: Y) a  |   push  0000004fh         ; function 4fh$ z+ p, R- d% T1 a9 p
   push  002a002ah         ; high word specifies which VxD (VWIN32)+ {  o  c% ~$ C# f
                           ; low word specifies which service" O) I' o" m/ q( {. \! V6 {
                             (VWIN32_Int41Dispatch)5 K! c( F: U2 \* z8 \
   call  Kernel32!ORD_001  ; VxdCall* d$ ^* ]! v. D! e& C; p
   cmp   ax, 0f386h        ; magic number returned by system debuggers% ]1 n3 {% u) L. F6 s$ M& m
   jz    SoftICE_detected
3 K. }/ G% X& l$ c+ }; ^1 ~8 k+ j/ k( u! t% W3 ?
Here again, several ways to detect it:# r; h0 b: X. p& Y' m: ?

: A! j: r3 s8 q5 g3 O/ o$ |* r    BPINT 41 if ax==4f
5 G2 U8 N; D/ Y  l5 ~. N' y
- K; \) Q9 b: e7 V" q9 D0 y    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one6 q% D: X! b- n1 g% j, M4 n

- j! F7 a4 y$ F: P7 t, L' g    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A9 L0 U6 @# L3 w+ C

0 y1 X. F: ?8 u1 B    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!8 @/ \! ?& y& \
- [3 C" x; V, m( }. C
__________________________________________________________________________
7 z+ r: G5 G0 v0 D% \: @7 x; x5 n) v( ~0 p
Method 13  E, a" ?3 G" r2 {6 M
=========
7 S8 A- r0 c) S+ C% b& e' B3 g; d$ R4 y  \2 q$ ~
Not a real method of detection, but a good way to know if SoftICE is. ]; o8 f/ T9 {& _  y# u
installed on a computer and to locate its installation directory.
5 q. I, M% j1 z. xIt is used by few softs which access the following registry keys (usually #2) :
7 I: S' r. r! e; z5 T' c$ t0 [/ M. F  L8 w# Z6 f6 G6 h4 n4 U
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion% `0 Q( R: N, n, B) }6 Y$ Q
\Uninstall\SoftICE
( v! @, m" i3 G$ w6 J-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
: ~7 _% h* o, D5 ^0 R-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
. T1 |; L$ |7 t8 c# u$ L\App Paths\Loader32.Exe
' @$ t' t/ q3 z; T  j( ]$ B& m/ ?' q% [2 G5 {

  C( O! f( }1 ANote that some nasty apps could then erase all files from SoftICE directory* @8 k5 `9 e3 ?* U" S
(I faced that once :-(
& D/ ^7 k9 Z& Y1 Q' r: E8 r" f1 \: {0 u. p) F* G# l
Useful breakpoint to detect it:
4 r9 e' j% u3 Y! `  @/ v
' i$ Q( f1 L  O- ?& v, X2 |     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
: U0 e; x3 y6 B1 f! }5 S
1 x; r% ]( A' h) U& K& [: P__________________________________________________________________________$ p% I7 X) _7 {2 \' Z

0 a1 E) I$ j3 H
3 [! i! `$ V% _2 H& V0 o0 YMethod 14 ' ~( N  N4 ]  t
=========5 P% V+ y$ `4 X) a" \. u

' m" N- b  p4 R: n; i) \A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose" y3 @" d4 V4 b' H+ H  J+ c/ b6 R% Y0 i
is to determines whether a debugger is running on your system (ring0 only).
0 d* x2 b& [, Z( ^) I  u$ ]
' P  q" c4 W; l, J& z   VMMCall Test_Debug_Installed9 u, Q3 E" u/ T2 S0 j* D
   je      not_installed: d% ^$ ?, u$ @
; {" d3 T! |8 G( {' h
This service just checks a flag.
9 `  q! C5 Y% p</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关注公众号

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

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

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