找回密码
 注册

QQ登录

只需一步,快速开始

About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
4 L: f; a) Q& w<TBODY>9 E# J& }0 {* Q
<TR>
+ }6 s+ Z) O; s3 E/ R2 r<TD><PRE>Method 01
8 X- t2 s( |, F8 C=========
- C5 W6 l2 Q% |% q  Z, v! j" X) o5 Z3 o3 k& w) Q3 G
This method of detection of SoftICE (as well as the following one) is: u& U! ?, x: G3 c8 x: }
used by the majority of packers/encryptors found on Internet.4 k9 g2 V. T' p5 _8 L
It seeks the signature of BoundsChecker in SoftICE
+ n6 p( j! J! h+ X5 b1 Z6 k. S, o9 K# R
    mov     ebp, 04243484Bh        ; 'BCHK'( N; ^6 E, ~' ]' r2 p
    mov     ax, 04h5 ^) Q+ {5 }, l9 g' i8 k5 Q; L
    int     3       1 G0 Q5 P& ^* q9 L! S9 V
    cmp     al,4
$ z5 y1 Y8 J+ Q    jnz     SoftICE_Detected- E0 p5 ?. K8 a& z5 a7 R1 B
2 E5 F7 n+ @. D1 p" r* O% P
___________________________________________________________________________6 x! q2 K. ]" i8 r; `5 I
- W% Z! U2 q  Q1 z$ w( q, O
Method 02
$ M3 L: Z- x; K$ P3 S3 M=========
7 m8 m5 @# e  i" H# O" h- a5 D. c  m, W
Still a method very much used (perhaps the most frequent one).  It is used
) I/ i8 Z; a! N" sto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
* @  V9 |6 w  O! G6 zor execute SoftICE commands...
0 z; `8 b/ m! {; m# f; dIt is also used to crash SoftICE and to force it to execute any commands
$ z3 g" ]0 ^& T$ M6 f(HBOOT...) :-((  4 g1 F. C9 V. Z% P
4 u- @+ j" @: I' x1 S8 T2 [
Here is a quick description:; ?* ~% c5 Z) S# w* Y6 q. j
-AX = 0910h   (Display string in SIce windows)
! U) b$ V3 t' V7 q/ L9 d-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)9 P; ]4 w  w9 w7 I  A' I  b8 F( }% A
-AX = 0912h   (Get breakpoint infos)
" F( C0 a( \$ H4 p-AX = 0913h   (Set Sice breakpoints)) [# C+ b+ [3 t% t; s. @0 ?" J- n
-AX = 0914h   (Remove SIce breakoints)
1 ]2 b& ~4 X3 B/ q) Y6 ~: P: C  p; K; t. O# @( d. I0 @
Each time you'll meet this trick, you'll see:* @* {3 Z2 Z8 v: F! f
-SI = 4647h
6 ?3 i6 u" B$ n& j/ _-DI = 4A4Dh& ?7 a( ?9 W9 H- x; o$ J5 B: l
Which are the 'magic values' used by SoftIce.5 k4 t: {  ]+ P6 B
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.# d4 v2 l* v  A. L: [4 l1 ^" R
5 I8 a$ j; Y$ n, t
Here is one example from the file "Haspinst.exe" which is the dongle HASP
7 _6 P. b, t& i+ u. T( ]- e9 rEnvelope utility use to protect DOS applications:
% u8 o  r4 O  E; M0 l
1 D/ z: e3 e. M, f
1 V$ ~7 Z( e. x/ v4C19:0095   MOV    AX,0911  ; execute command.
4 {! K. E4 i' i( _( W- K4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
# a7 R+ i- |! F1 B7 [4C19:009A   MOV    SI,4647  ; 1st magic value., Y8 x+ t" Z7 L" X* ?( c" v
4C19:009D   MOV    DI,4A4D  ; 2nd magic value./ J# F2 R2 I: `; V5 a0 z7 b3 c
4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
1 \. ?# C  J6 L4 ?( j+ k4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute
# {# T# [9 f+ \+ ?; D8 {1 j4C19:00A4   INC    CX
. C$ Y) D6 Z. e- h, B4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute
$ T  P  S) L+ l5 l0 C4C19:00A8   JB     0095     ; 6 different commands.' `; S5 L+ l; J" B% Z- J1 E
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
( S8 s) D/ B1 B0 R- U9 [% @/ `6 u% d8 x4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)
3 c) J% h1 _' A/ ?- ^* L+ m0 p7 F
The program will execute 6 different SIce commands located at ds:dx, which' W& h. Z5 A7 @  i  b/ j
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.3 O$ q, P; B# ]& Y
7 T5 Y9 }1 J5 |- l. t7 M- n- s
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
# X8 P% c. c4 {. ]5 B, @___________________________________________________________________________9 `. g; k# n, z2 I* i
8 _  f$ b' ?8 P2 M5 n
8 K; Y0 U" _) `9 |# b
Method 03
+ h6 n1 W7 @8 j& n; k1 d( ]=========
4 M+ E6 |2 K+ H! M+ W1 o! g) w" H' E' Z
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
4 y3 i8 ^1 M2 L8 B6 n1 T(API Get entry point)8 y3 x- b6 K* z  P& r
        / m" d0 j7 V& }5 l

1 V8 r1 Y# d" Y1 k* r2 c    xor     di,di
1 ?7 G) L# h# U& W3 |! H    mov     es,di$ w4 X1 H5 G: o3 ^. f$ Q; h3 U
    mov     ax, 1684h      
8 R9 Y% S- G: k  K' Y/ P+ }    mov     bx, 0202h       ; VxD ID of winice
# m# p) P9 u; K/ P7 W' I    int     2Fh
- I3 |5 m1 e% i7 t# N6 _6 T    mov     ax, es          ; ES:DI -&gt; VxD API entry point
+ {9 k& }% V4 z% n5 I    add     ax, di
. j/ p% ]. C! ~4 ^$ d    test    ax,ax" F7 B$ {! l7 P7 X  A' b2 c6 U
    jnz     SoftICE_Detected
  ^6 I3 ]# z7 ~  Q
, R8 Y& G9 Y2 ~5 j$ V8 F, T___________________________________________________________________________
: d9 L  ^3 S; j
; u5 {- D* T% V7 h0 \, JMethod 04
. e$ h; B# [. O6 @, l9 Z& t=========
* z: K  M6 f$ a" U; n/ B& l2 |5 U1 h+ B9 P
Method identical to the preceding one except that it seeks the ID of SoftICE
& P) B3 r/ \& Q( nGFX VxD.; h) V1 a% i9 n2 b3 ~* b
" [& a: L0 `% Q) M% o
    xor     di,di9 u, l. |* Z5 S8 p4 C1 i
    mov     es,di5 ?2 s2 R/ L5 C4 U9 j
    mov     ax, 1684h      
! x: k; i! w! x; F, V+ _- V: O. X0 [    mov     bx, 7a5Fh       ; VxD ID of SIWVID! W' S3 Q! \! `: J
    int     2fh
2 r' J) K3 B! a    mov     ax, es          ; ES:DI -&gt; VxD API entry point7 n: N9 W7 G' j+ t- Z7 s
    add     ax, di
( P2 N  M+ K' \2 M  L* d; y/ Q- _    test    ax,ax- y9 j; ]* j  F7 ~. T- j
    jnz     SoftICE_Detected- L0 x( L' e6 s, A- Y6 ]7 N

% h* b1 B5 D( X; A__________________________________________________________________________9 ~: n& L6 X' \7 u1 B3 M

1 Z% F  p% b- H' [9 J6 x& U/ l; u' n- W) c2 M: c) j! C
Method 053 |+ ?0 Z/ e" t4 X" C
=========
8 t' d. v, o4 o& ~5 v1 X# j; X+ C9 Z) j' @
Method seeking the 'magic number' 0F386h returned (in ax) by all system! P" r7 z+ ~1 e" i6 Q4 `" A) S
debugger. It calls the int 41h, function 4Fh.9 \! O0 M8 N/ s8 e& ~
There are several alternatives.    D" F1 W9 B: ^) O4 G( d' m

4 T3 ?" U* S& e' x! j# T; F. HThe following one is the simplest:+ u1 d* U# Y; v; L
1 {9 K. E0 `( Z
    mov     ax,4fh
" b0 _3 I" L* i- [0 I6 W9 f9 u$ W/ v# G    int     41h
0 x& P+ ?' u; J. s9 Z    cmp     ax, 0F386
% ]# V) o. s2 D5 F( r6 a    jz      SoftICE_detected) q8 [) c: F! ^: F) B4 p1 m/ [* _4 H
' o/ m6 s/ J- o$ R3 d& A

1 }/ l5 U. g/ V; }" }  G" jNext method as well as the following one are 2 examples from Stone's 4 {! u* e% F! n  |# M* P7 \
"stn-wid.zip" (www.cracking.net):
0 S2 d- F0 A" `; h4 w( f/ D
* x) A/ q8 G- p% z5 I1 [" D( U    mov     bx, cs$ D& @8 g) I' C/ L3 J
    lea     dx, int41handler28 b2 q4 k: m+ G+ J0 I
    xchg    dx, es:[41h*4]
1 d% u# c) o$ g1 _& d: e" P. m    xchg    bx, es:[41h*4+2]
$ q+ D2 I# T+ v5 p    mov     ax,4fh, C$ M% S1 F+ P6 N( C: o4 r
    int     41h
' Z! j& f! F! d, j- b, q    xchg    dx, es:[41h*4]
+ w5 i, m8 }5 L7 p# E  d    xchg    bx, es:[41h*4+2]
( m6 q- A' Y5 O6 L  M  x    cmp     ax, 0f386h
5 I4 W5 G* l' @0 M- ]    jz      SoftICE_detected
; O0 F  j. a1 Z/ f9 [: \
& {9 O9 |& |) h& w; n" bint41handler2 PROC  m5 c. l5 ]+ h% D1 X& T
    iret+ C& x* @7 H9 \
int41handler2 ENDP
1 Y: [; ~1 S4 N6 t1 D! K& |: U% H0 V1 G( e6 r: W/ c

! k7 j% `$ T' j* v0 g_________________________________________________________________________
. m+ A) [# ~1 t' [  f0 [' a
4 w0 J, K& d5 B4 j  o
! v4 \: l) h: R" H7 wMethod 06
3 Q( L" z; {1 r- u' C=========
3 E# O' |! p; d: z0 Y3 z
, A( R3 k- g" ?- z  l# |1 D+ U5 A9 U" _; x! Z" w
2nd method similar to the preceding one but more difficult to detect:: e$ s" a' t3 I" e6 @: B

% X0 u8 K  M, h+ r6 O" X8 V) _7 U/ B* I) I* z( ?- m/ N. t. [) T
int41handler PROC
8 P0 B1 M- h/ v! `    mov     cl,al1 e2 v* F. H+ y/ O& u+ R5 T7 L
    iret/ t6 K* O  K, x
int41handler ENDP
9 Y, U" N2 R% ?/ `- _4 [
3 h3 |% p. a# e' c! u7 S8 G8 D- A2 |- K% b3 |, }  P
    xor     ax,ax- X8 u" P/ J% M: M- i# H* N" B( o; q
    mov     es,ax0 V$ A- w1 @7 j. @1 n, s6 A, ~
    mov     bx, cs$ S1 A/ k$ t0 S  @. N7 A/ y
    lea     dx, int41handler
' [& q, C3 p4 O" _5 t8 L1 ^    xchg    dx, es:[41h*4]
6 x9 B5 x- t/ S/ ]7 o- }/ N    xchg    bx, es:[41h*4+2]
! y. n, s# C: T! i4 c( b' l% N    in      al, 40h' d1 ?6 }1 }# l' O
    xor     cx,cx0 I6 e7 b3 D- |7 J4 L' A* e
    int     41h
+ y, M9 ^) `* X    xchg    dx, es:[41h*4]$ ?- f  h1 T5 C8 y4 L+ d
    xchg    bx, es:[41h*4+2]
( }6 W0 e. P% {+ c/ K) O: v8 B9 \9 l    cmp     cl,al& B: ?. z0 [8 U
    jnz     SoftICE_detected
/ _" @0 p; R5 P+ k3 J$ x! ~. W! ?8 g( w
_________________________________________________________________________
) p+ |: C( k* a; Q5 k% V1 C( O1 U- w* d
Method 07' k4 _+ _1 B. ]+ P; |. I* f
=========4 D" X" D$ _/ D7 J/ y

7 Q- @6 e, S& [% e$ Y; T; M! UMethod of detection of the WinICE handler in the int68h (V86)9 M" o- S; V  i# [
) V" ?2 D/ T% `
    mov     ah,43h
: s0 r3 {9 r. h8 k+ J    int     68h
( Q: t- Z9 y* J$ C    cmp     ax,0F386h
+ d7 U- w. p+ z2 w    jz      SoftICE_Detected
2 @2 c) U$ W4 {/ f7 A
7 i3 {3 ]4 ?* f* E: Y( z, o
% e0 [2 e0 H6 L/ e=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
) _% q" b. D' b- }. H7 M) E. y) J   app like this:' _( c, Q* _" v, R& _- p

  S) Y* ~: O6 l; l6 i   BPX exec_int if ax==684 m+ h& Y  }/ {' z1 G6 ]/ @  L
   (function called is located at byte ptr [ebp+1Dh] and client eip is
" V4 q9 \, g9 h% O# W   located at [ebp+48h] for 32Bit apps)
/ Z8 m$ U& t9 q4 a8 [9 b& o__________________________________________________________________________# g" S1 ^; U4 I! q/ [' Z8 ~
0 G# S9 b1 T5 u8 z. M6 N

3 U4 O, Z$ d, X  x2 T4 @Method 08- |4 D- l! _& F9 `! ?/ _/ @
=========
$ X  J. S( i9 [7 c1 L& G3 k0 x8 q0 r% ^4 M( R1 \9 E+ e
It is not a method of detection of SoftICE but a possibility to crash the* T! r. ?# E- v4 D6 D9 X/ v
system by intercepting int 01h and int 03h and redirecting them to another
+ T* W. Q1 X0 W& r9 droutine.8 ~1 @& E3 F7 F7 L4 y) G
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points8 G$ [& f/ V' v# ]3 @
to the new routine to execute (hangs computer...)1 M. Z0 _* A' q
1 j7 x4 J4 H1 I2 \2 S0 X
    mov     ah, 25h4 s/ k, L' f8 A3 E" T0 \, K
    mov     al, Int_Number (01h or 03h)
- H" T2 ]9 x- d$ _" |    mov     dx, offset New_Int_Routine, C7 c+ u/ y. b9 b/ T
    int     21h
: }2 o) _) }* K$ @3 v  [3 X
  q9 F2 }$ S: h. T; @__________________________________________________________________________
: V) w9 d1 r8 L6 ^- i
0 s# d; h' p8 GMethod 09& I: F# m2 h' M& T" [6 D: w3 p
=========
( `9 w  p+ @; V$ F& Q0 n" l+ f, p+ b* E0 @
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
: K/ A$ h: X! J9 r% c" v4 ~performed in ring0 (VxD or a ring3 app using the VxdCall).
( {0 W* ?9 d. W7 _4 b4 qThe Get_DDB service is used to determine whether or not a VxD is installed
8 N+ V2 j% ~+ Xfor the specified device and returns a Device Description Block (in ecx) for2 B: {- P* J  F8 F3 I  s
that device if it is installed.
5 W+ D9 t/ `% p$ i  m" S( ^) s* T* c1 I+ h/ C, J1 ?
   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID  m+ f" M, G4 `$ H% ]8 r
   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
, w+ O8 D3 f* J   VMMCall Get_DDB3 f; |/ B; P, E: b# R1 k: U
   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed* @/ ~- d5 b7 `7 \4 t
1 j+ ]" _3 l; X. b- {& e2 m! x
Note as well that you can easily detect this method with SoftICE:: C) H  A2 G0 J
   bpx Get_DDB if ax==0202 || ax==7a5fh4 B% m1 K. f  J8 Z+ W
4 o6 E- ?: c; X) }' q
__________________________________________________________________________" A4 b, P$ ~+ ]7 k9 \
' i" H- O( I% a3 e
Method 10
1 _3 Y  Z+ [- f" a  m=========
+ ~# M2 u7 |; B, h
( W$ b- ?/ y4 m4 z=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with
' }9 E- X0 Q0 `! |  SoftICE while the option is enable!!' D1 f" R- [. b8 z8 t
" g* C% @' a# r+ S  N
This trick is very efficient:. n% ]9 @4 U; w1 x  y
by checking the Debug Registers, you can detect if SoftICE is loaded
7 {$ d# ]; S) w2 [! o3 x(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if. A0 [8 J1 X& h& J
there are some memory breakpoints set (dr0 to dr3) simply by reading their
4 b3 k7 e0 N. c* _* |1 Pvalue (in ring0 only). Values can be manipulated and or changed as well) {1 G. t& ~! |+ J9 h, L3 t
(clearing BPMs for instance)9 G* z( }/ }8 m$ B+ D; i1 f% g7 Z
' z: l! Q6 w3 G1 f' q+ M  n$ r0 y7 @
__________________________________________________________________________& n' {! Q. G( l1 g3 C

5 S- U6 Q- T. @3 N$ gMethod 11, {/ X7 `! l4 }0 C6 e) Y
=========
$ s9 I( r  `  N
6 W5 V# E$ l$ m" n! \' v; N" NThis method is most known as 'MeltICE' because it has been freely distributed
6 E- f7 ~0 ~- _; Evia www.winfiles.com. However it was first used by NuMega people to allow
0 c$ E6 Q2 n+ a+ ]' Y# YSymbol Loader to check if SoftICE was active or not (the code is located5 y7 S/ `5 m4 e2 O
inside nmtrans.dll)./ N( s& L& `8 O2 a7 s; @

8 {% E" \/ E. IThe way it works is very simple:, S  z3 W; d$ k# ]4 P4 G1 [
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for( z$ {: J/ \: O, D- |
WinNT) with the CreateFileA API.
" U" |! ~7 l  A2 S9 Y5 v( @, w% w' x* K% E( Z" b* e" l
Here is a sample (checking for 'SICE'):
( n0 ~5 c1 S9 @+ z2 m& _$ z
; h; B" Y  k% Y3 q+ N+ KBOOL IsSoftIce95Loaded(): v6 _* w* X! \! k
{" @: y; W3 {  [7 x
   HANDLE hFile;  8 f1 t% [: m5 B1 ~
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,. L9 @7 E3 x/ I$ C: L6 s
                      FILE_SHARE_READ | FILE_SHARE_WRITE,
$ f$ |! i* q  m' }9 B/ G                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);% J4 S9 C) q, x+ t+ q$ d* m6 K
   if( hFile != INVALID_HANDLE_VALUE )) F; I: ~6 q$ y" {: ]
   {$ N- F) `  A; Y# G+ X; K
      CloseHandle(hFile);# m1 B* ?7 e9 f1 P  j- l
      return TRUE;8 u8 `" g' j) ^
   }) l* T8 E9 S  M8 e$ D/ G* M, Z' {
   return FALSE;
( Z% e/ m" o8 C4 F1 |$ `1 `}
% _- v* j9 C' ~8 l( A& N$ B, l
% `; W8 f# f' Y4 sAlthough this trick calls the CreateFileA function, don't even expect to be
5 m9 f: j/ W, i' M) b% Bable to intercept it by installing a IFS hook: it will not work, no way!1 _& g9 V# i) j, m
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
% j+ ^0 H, \# G2 d6 a5 rservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
1 {+ q& z; ]; ?" j- ]. \: n2 e6 z4 yand then browse the DDB list until it find the VxD and its DDB_Control_Proc3 Z0 I# Y7 y- F  d8 U2 q
field., I% y( [6 H+ f* c6 z: s
In fact, its purpose is not to load/unload VxDs but only to send a ; Z% g. Y, ^- L" Q9 ^
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
. }- `5 y, j* r% k$ X, O$ p. G3 rto the VxD Control_Dispatch proc (how the hell a shareware soft could try3 X' o# `! e/ {; V  t3 I7 U1 l4 ?
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
4 \, m' H2 ~& U6 `' Z" gIf the VxD is loaded, it will always clear eax and the Carry flag to allow
/ H( l. J, y3 U- ~# {9 Yits handle to be opened and then, will be detected.  o6 K. g& N" @
You can check that simply by hooking Winice.exe control proc entry point. f  Q0 h; q9 v: U0 Z+ G
while running MeltICE.! i- p0 j0 ]8 j8 H& k# d/ q
' [# U# u9 X- T! `& H

: G, R$ l# c# S% U  00401067:  push      00402025    ; \\.\SICE1 Z1 p; c) o3 j8 L7 B; t
  0040106C:  call      CreateFileA& G7 A* K4 ?! _4 T5 ~( |
  00401071:  cmp       eax,-001
6 @3 F5 D+ a! w5 M! r  00401074:  je        00401091
  \1 s2 n6 |3 O) {+ r) G
3 P+ f4 y6 {+ S- ?2 W9 M
7 d9 S& C( W  W9 O; jThere could be hundreds of BPX you could use to detect this trick." l6 D" |* D! r# k. l
-The most classical one is:
, J5 a: \. _( k: k7 l- R  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
7 I) A' \9 A$ i1 Y$ N4 T9 ]    *(esp-&gt;4+4)=='NTIC'$ a* ?( s+ Z: |1 L
; O) M& u3 U2 L6 y
-The most exotic ones (could be very slooooow :-($ q+ n! S  a& c1 R& u
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  
# h* ]" m; o  D     ;will break 3 times :-(
9 u- D" b/ j  K$ j8 |0 K: y3 Y9 v: ?6 b% {( ?+ }
-or (a bit) faster: - ~2 I# P: s0 ~" R. p! D% b6 H
   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
! {0 z  w+ J6 C/ @* x) w
' f; j6 z! A) O   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  2 T' z; ~$ W7 b+ C- J$ m/ Y9 f
     ;will break 3 times :-(% W$ w: Q; k# C. H! v

2 S9 m# v5 W6 A# G0 c! D( Q-Much faster:
' s5 {% m5 u2 U$ Z9 d$ A; L8 K   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'
" t" ~! ~* g+ h0 n, N3 f' f* }
7 U7 e1 O. L: n* z2 l! G* [1 p) ZNote also that some programs (like AZPR3.00) use de old 16-bit _lopen7 `7 s* V3 z3 u9 K5 c$ u
function to do the same job:2 a  f' V/ p& t" d) D( Z# L# \2 y9 x
1 W3 K& z" O4 s5 ~2 g- u1 ?/ {
   push    00                        ; OF_READ
( J+ W8 X7 Z- U   mov     eax,[00656634]            ; '\\.\SICE',0: y# U, I4 R6 F9 @$ O
   push    eax
: g3 O, J4 R2 Q% Q$ P& L( y0 L4 {   call    KERNEL32!_lopen4 n. {5 ?% i% h4 U9 H2 ^
   inc     eax) a/ [2 C9 O8 o" T1 h
   jnz     00650589                  ; detected$ J6 U) v3 q+ u+ a5 o
   push    00                        ; OF_READ
! r3 F+ ~* m, E7 F   mov     eax,[00656638]            ; '\\.\SICE'* a7 R, V3 i2 J' c" V
   push    eax
% h) I# ~' C8 T' C   call    KERNEL32!_lopen
9 A8 }& D  t- r3 Q' h% Z1 m: T   inc     eax9 M7 |6 j  A6 O
   jz      006505ae                  ; not detected
7 }, R5 Z0 u+ @1 `' A1 a* |. W) B- b' |9 @" j# A
/ _. u3 T6 b& V$ k# o! }8 C- F% W% Z% n
__________________________________________________________________________
# T4 K$ t; b3 e8 p# x/ ?7 K, [, T3 N* T
Method 12
% ^3 ]+ }' C/ Y8 O4 U=========
' X/ x: J/ E: F7 T) u8 Z  ~# s
+ x" C4 M- F: I/ X- z% ?( `% |& f7 M5 d, U7 lThis trick is similar to int41h/4fh Debugger installation check (code 05. k7 F: p2 O6 L
&amp; 06) but very limited because it's only available for Win95/98 (not NT)
( ^( C0 ?- d# r% G3 f# Y0 D$ B- Zas it uses the VxDCall backdoor. This detection was found in Bleem Demo.3 A/ }1 S" r/ Z9 [5 U& H
' G# D2 v& }' U5 z" T
   push  0000004fh         ; function 4fh* l& P' E% p: }( D
   push  002a002ah         ; high word specifies which VxD (VWIN32)
, v1 N# C! R6 \# ~                           ; low word specifies which service% K. t6 k& A: W5 L
                             (VWIN32_Int41Dispatch)
5 t7 P$ Y# o4 ]+ X6 _   call  Kernel32!ORD_001  ; VxdCall
1 Z4 J9 }$ ~( ^) a" v4 a! P   cmp   ax, 0f386h        ; magic number returned by system debuggers
5 F# d, F$ X- ~3 i6 }" t   jz    SoftICE_detected
: c, k, T' a# ?0 a' T
/ Q6 U. t5 y1 THere again, several ways to detect it:
% P9 {1 ^! ^8 o: v/ y: }
  g9 l- A7 l0 W9 g* D8 V- W    BPINT 41 if ax==4f
" _' n* Q# p; ]
5 z. |& q: s: s  t- U' }    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one
: `. q5 ~3 O+ a7 W+ }  b9 t# P" t3 o- Q- _7 a8 J- c
    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A. |* {8 n* x6 f" |0 ]6 C

' e" e$ i' ~8 z$ X0 r    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!8 T8 t: r# ]3 K- {: ~

9 O' h, \  q# r+ M" k__________________________________________________________________________
  s2 Y1 Y0 J8 t  [4 `$ O
! U) }' q$ h; g& dMethod 13
# L9 T- o0 \! }" D=========
; i! n9 H5 C2 a. C) g5 X
- @5 C" B* p, i2 bNot a real method of detection, but a good way to know if SoftICE is
1 W0 \: }7 R4 K0 C1 s2 |7 Pinstalled on a computer and to locate its installation directory.
" V) l( A# T( E% ]; |0 d% [$ }It is used by few softs which access the following registry keys (usually #2) :, `8 P2 X2 Y& w
0 ]4 w/ d0 x5 k  L. m
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
* u- N! a% W% O  f/ w2 s5 d5 H\Uninstall\SoftICE# A9 b' M3 l% B* |7 l2 L
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
3 J; ~3 L! j9 d9 c+ d- K-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
7 W! v& p( R9 c, z0 {" e\App Paths\Loader32.Exe2 C- D$ {4 {$ n6 s  |- b  T) H; M+ r/ S
5 E+ F  k2 G% G- F: C6 `3 W# Z
5 G* K" g" e& i
Note that some nasty apps could then erase all files from SoftICE directory9 l$ f; c  k+ d7 T! o3 J1 j( X6 ~
(I faced that once :-(/ s( M& u$ G, B9 H2 P- U
% d: ~9 s# r/ a; z1 ]$ P3 s: u8 {/ t- m
Useful breakpoint to detect it:
  J9 @0 A$ _' ~. n( F9 I# i
, |$ w: l* y8 P     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'; ]# E/ H1 A* Y: \+ Y9 {9 f

- I+ F8 s& |! Z+ _$ K! U__________________________________________________________________________4 J, ?5 s$ i" @2 \

9 ~7 ^9 q( W5 O, i* V8 C8 p8 k7 H7 s, J  d1 F# d  [- m) Y
Method 14 0 n% p9 A4 m& M7 s3 S$ u. ~
=========
- U$ S0 O8 Z2 J/ w3 z" K; D* L$ g/ m' w$ C
$ T/ ?8 {' m# z: gA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose! N' C* d, F: b% C  J
is to determines whether a debugger is running on your system (ring0 only).4 P" _" f$ p; ^  h" n

3 B+ ]9 l& t' W- i   VMMCall Test_Debug_Installed
! ~% G( s8 }7 h; {5 l1 z   je      not_installed+ m' O, E4 p" Q# D
! q$ W1 o  p" H7 L; C
This service just checks a flag.9 N  Q+ E' e6 w# ]8 }4 Y: _5 w
</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-8-10 23:35

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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