找回密码
 注册

QQ登录

只需一步,快速开始

About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
# o) d. Z  P) T/ S<TBODY>& b, x2 v' [7 C- a) d2 M* R
<TR>0 {- R! V  i6 ^& I
<TD><PRE>Method 01 % i! n% ]7 S! r" ~9 Z4 T
=========
& W; ~) S: P; C8 S* B1 J" B7 U* R! x. D! ~" i
This method of detection of SoftICE (as well as the following one) is
# V2 C+ {, M3 b7 a0 d1 \9 {* X" ]% eused by the majority of packers/encryptors found on Internet.2 `5 C; w8 ^  |/ z  K
It seeks the signature of BoundsChecker in SoftICE
4 L. M. U% [: T! G) ~" }8 x
4 X4 |& y' K) `: @( A+ {    mov     ebp, 04243484Bh        ; 'BCHK'$ j; r. F% b2 q! P
    mov     ax, 04h! S% W- k  a$ L0 P/ s6 {+ m5 e# T, ~
    int     3      
# s  M3 m( c9 X    cmp     al,4
+ R: z- n4 `  u2 E6 h    jnz     SoftICE_Detected$ `7 ?+ I2 N$ }! p
# t4 v$ ~; |5 ?5 B8 x
___________________________________________________________________________
6 t4 m3 g) Y: {4 d5 [4 c% c. R/ k2 p' R4 f
Method 02  S' K+ i. k+ T8 E+ ~
=========2 K! h/ s: f: j1 T( Y* Y( I& P
) p4 h( Q+ [% P( B
Still a method very much used (perhaps the most frequent one).  It is used
+ i1 d) S5 a) m# e3 \3 Sto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
) d5 r/ [& J+ p2 Eor execute SoftICE commands...# c7 n/ E' y3 w/ A- X0 K5 k- b
It is also used to crash SoftICE and to force it to execute any commands
2 k1 y+ V5 w' c1 e(HBOOT...) :-((  
0 I: ~3 w& l. t* a) l$ X( n" h) t5 I$ h! t
Here is a quick description:  p! V8 U; S6 }  v
-AX = 0910h   (Display string in SIce windows)
. f8 `5 o$ x/ I' Q-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)
" Q$ S* q1 Y+ m-AX = 0912h   (Get breakpoint infos)/ E1 U, B- V4 q& l
-AX = 0913h   (Set Sice breakpoints)
; ^& W& Z3 u' O# a-AX = 0914h   (Remove SIce breakoints)+ J" M, R; g6 ?7 I

8 X4 e( D* Q, bEach time you'll meet this trick, you'll see:. N' f, [% b. z( c" L
-SI = 4647h
% n# Y5 R; ~9 ?% v; L, F( R0 f- V-DI = 4A4Dh3 r* _/ {7 q1 m( d# H. ]0 \9 m
Which are the 'magic values' used by SoftIce.
6 x. D# ^2 a3 ]! J( ^5 nFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
6 N2 s4 F' N" Y/ W3 y* o8 ~$ F' B8 j' c9 x* t0 E
Here is one example from the file "Haspinst.exe" which is the dongle HASP
; L% H6 w: n6 `Envelope utility use to protect DOS applications:
9 k2 u& r- o7 f! G+ C2 V$ N  _0 \- `5 K0 B. h* J1 P- \. t& j

" K( I4 h3 j( `, o* `4C19:0095   MOV    AX,0911  ; execute command.
; S0 w6 D1 U5 G# |( ~% V: Y4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).$ _' F& \# d; z. \; m% {
4C19:009A   MOV    SI,4647  ; 1st magic value.
, n7 [; \- [$ g. V4C19:009D   MOV    DI,4A4D  ; 2nd magic value.* z' J5 _* t' [2 Y6 N
4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
0 y! `: ~- l8 w1 @; X/ Y5 D4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute
1 W: ~0 M$ q" t6 q, F$ M0 _4C19:00A4   INC    CX
) H9 t: v, a8 Y* o+ c, \4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute" v4 b3 t" _; B$ b
4C19:00A8   JB     0095     ; 6 different commands.; H( @& Q8 G/ ~2 C/ _( X
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.' [' \" ^) a: k8 {. {
4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)
  D* Q5 {9 ?8 F8 \# Y1 W: R7 A& I$ d  H1 o2 N$ ?! I0 ?
The program will execute 6 different SIce commands located at ds:dx, which
* ^; r# P8 a0 fare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.3 p( Y  M: A1 B. ?# |/ R' n5 ?4 J

& i; [( n; H. ^4 I, q2 T2 B* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
( J' d7 i  P% m4 U" c4 _8 W___________________________________________________________________________( J2 g1 w2 k! Z/ _
  G. X5 q2 x1 M

6 ?) q) y8 E# d! `" C8 T0 O& s" v$ h& O! VMethod 03
5 ~9 C) j" _  m# l$ ~+ u=========
! K7 d& [; K/ ]" Y1 H4 }, q# w. C- \0 j3 ?3 Q6 H0 v
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
( n$ X' F1 j3 G, G0 m( }  x(API Get entry point)* m, [# ^7 ]; o: ^/ X
        $ B0 L0 S! p9 r' U9 ~% f8 [+ p3 e

- {: {( N- v4 D9 y  I6 p$ `0 B    xor     di,di
, v7 I% A- p" Y5 ~    mov     es,di
0 T3 _4 M: l/ O3 m    mov     ax, 1684h      
5 Z+ R9 N$ D) P) p  Y1 T. b  C    mov     bx, 0202h       ; VxD ID of winice, ?* G) w4 {, G1 Y( {  }
    int     2Fh8 G& t; l' Q. @3 W& }" j
    mov     ax, es          ; ES:DI -&gt; VxD API entry point
& J% G- N2 V$ i: ^; S% m9 k    add     ax, di
/ g# y, H+ \, h' Q' l: V+ x    test    ax,ax( S5 y( a* K/ P+ c; d! A
    jnz     SoftICE_Detected
6 `: v( o' q+ R9 k3 a) m) _/ i
6 ^( a% i$ [' P# D___________________________________________________________________________4 {7 @& k. ]8 `! J

! }+ [2 t' s0 x- Y! `8 C' zMethod 04
/ t. D$ N2 \0 S; P1 \=========5 b3 K/ h% t! f2 N$ ^2 d

/ P2 {, e1 x+ C; _' rMethod identical to the preceding one except that it seeks the ID of SoftICE
' u5 X( v, R7 q5 _+ b5 f( U  k& iGFX VxD.
7 x6 T: p0 C6 {7 P/ q/ B$ \: p  O$ @% G* d
    xor     di,di0 V/ a- E9 Y0 L3 p& V4 U
    mov     es,di9 J: Y$ G1 W% g: c# Z, f( ?
    mov     ax, 1684h      
/ ~/ m0 H8 U7 w5 e    mov     bx, 7a5Fh       ; VxD ID of SIWVID3 e# L. }: y4 }
    int     2fh
' ^  J$ a$ M7 v- G6 i1 F7 q    mov     ax, es          ; ES:DI -&gt; VxD API entry point
1 ]( S  O4 Z" _" \    add     ax, di8 M1 D" T. G+ x; k# f- h$ |% h
    test    ax,ax8 R  r  x5 O% r) I# \$ y" d3 m
    jnz     SoftICE_Detected
; x" T5 K% `( ~2 v- w+ ~. Y( A/ ~0 c; [
__________________________________________________________________________
9 Y/ M  ?9 }7 ]+ P5 u# W# P" p0 ]  H# x& w
: q$ A  e+ [& A$ n2 x0 G
Method 05
" A! x, P6 v& g7 r( E=========. o: s9 |5 x  f

' P) J3 a! x& ]Method seeking the 'magic number' 0F386h returned (in ax) by all system$ v+ P: S0 y6 s1 _  u7 x& V* k. S0 Z
debugger. It calls the int 41h, function 4Fh.
+ L8 P% ~, W) m% pThere are several alternatives.  
7 Y3 P. P4 s) d/ N, w6 H! B4 P# G( v" ^& `* s, Y/ v4 i
The following one is the simplest:& W6 @- f% u, N! O: g
, \0 d. \( C/ M
    mov     ax,4fh
% Q! g* m" @, s  P' u0 ?    int     41h% ~, B9 r$ Z. [* P7 A
    cmp     ax, 0F386
2 K' w" ~' b9 |! N" x    jz      SoftICE_detected
" J. P3 W1 Z" a7 M" Y/ j. G* s: J. @" c: [
9 `" Q5 b# V& T7 h" X/ c
Next method as well as the following one are 2 examples from Stone's 3 P! {1 q4 M' j% F, d
"stn-wid.zip" (www.cracking.net):  l1 M2 e! b- V
$ W2 o- @* _! G* w  F
    mov     bx, cs
  J' L# @. j( y  e- ^7 D    lea     dx, int41handler22 U& \& B3 N8 Z6 P. n' Y9 u$ y
    xchg    dx, es:[41h*4]2 Y0 @7 p+ u) q
    xchg    bx, es:[41h*4+2]: j( f0 b' G3 ~
    mov     ax,4fh
6 ?( [# d" I0 o# `$ s# d2 u    int     41h
/ D" x5 ]7 B& @1 n    xchg    dx, es:[41h*4]
  d- m% V5 U* G4 I    xchg    bx, es:[41h*4+2]
! r$ h2 f: X" M: x7 n; v1 t, R8 K    cmp     ax, 0f386h. ~9 |1 O7 ~0 b& i
    jz      SoftICE_detected
6 i6 X- n5 ]4 |0 U" B' U) U, W) S- D+ l& H/ @% l! y6 U
int41handler2 PROC
$ S! C' X' q7 u+ a2 x: X% F    iret
9 O5 w: g( t6 D& C. O* {6 ?int41handler2 ENDP
, N7 a+ _* f$ J! J
$ ?+ g3 W8 M+ p( O# F8 D
. D9 @: L! x$ B4 a( `( C_________________________________________________________________________
4 ^5 A# I0 P; \2 u
5 y5 O% Q. B' b* w& ]6 V( M7 i. z" m' |1 ^2 q
Method 06, j# W9 n$ U% R, w9 S9 i  T# N
=========% T' f5 m. U( p) G% r$ T" W" [$ }

! Z4 i) z/ c) O. A
& Y( q" X- k  P6 }7 k$ l2nd method similar to the preceding one but more difficult to detect:
5 s/ S6 j& b7 ]6 V
, |, F* Z1 s" G9 a; n5 s* J) t8 y/ C) c! k' s+ ^8 `
int41handler PROC
9 |/ k5 c' q7 T2 n6 a: p* z    mov     cl,al  Z- _2 X  l: D" F
    iret2 e. l$ k- S7 a3 G$ T0 `
int41handler ENDP
7 D) a5 l* }) h) j1 X- l: ]5 z+ a, Z; _8 H4 `* F; ]

0 ~! u! d$ b. b    xor     ax,ax
" |7 m' q( H4 ?! y- W    mov     es,ax
8 q7 t4 Y4 f: j    mov     bx, cs# a' C# N& T! L/ O, ?
    lea     dx, int41handler2 r2 _' z9 Z1 u8 j( E; t
    xchg    dx, es:[41h*4]' w, E0 l1 _( ~' `+ j/ ]
    xchg    bx, es:[41h*4+2]
. M2 H: f! w, {    in      al, 40h: t$ T7 L6 M- @
    xor     cx,cx% |# C+ Q/ I6 e
    int     41h, f% X, e: o, W$ `
    xchg    dx, es:[41h*4]
+ o' L# Q. i" z- O. F+ S9 q    xchg    bx, es:[41h*4+2]0 k1 T  w* j% h( K6 O
    cmp     cl,al* h7 a. q" ~, Z) t. Z" X8 G5 b5 A) {
    jnz     SoftICE_detected
( X0 J5 v2 G/ Q7 g$ I
5 D. F( Z$ P6 m9 t_________________________________________________________________________
  J" L# ?2 b8 ]1 N5 u
" |. Y- h8 s; a. W' uMethod 07. ~- t0 h1 D2 x2 u
=========
2 x2 x( A1 K3 h1 E
! Z4 Q7 a3 C8 zMethod of detection of the WinICE handler in the int68h (V86): m" M9 A( U7 [7 G

9 z4 q0 A; L+ Z8 T    mov     ah,43h
+ n: s4 A0 g% g    int     68h
( k$ h" o0 m5 c3 C( _( a3 l    cmp     ax,0F386h
: h$ t  T' q" G0 _% Z) @1 o    jz      SoftICE_Detected
  [# |9 Z$ Z7 `8 k5 N. O3 j4 @3 P2 p8 Y0 a& u8 [7 p9 A* u6 j7 c  O! w
+ j5 a. h8 K3 v9 c$ S3 T$ N! f8 V8 x
=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
7 s) b; ~" t" b. [  {5 v' p2 K+ e) ]   app like this:/ a. D( m; t3 U. K7 ~4 Z

7 n5 [5 u2 L. F7 c  r; p# j   BPX exec_int if ax==68
! E' F( V+ h/ Z: T. _) \* R   (function called is located at byte ptr [ebp+1Dh] and client eip is9 x+ U; B! P. {, d3 i* @& C( u
   located at [ebp+48h] for 32Bit apps)" j0 p+ V6 r! z& z) D) G* \8 X
__________________________________________________________________________
! l# @+ {" w& x$ }+ ~$ |2 |8 f
! G$ h- s5 `3 m: h5 y6 n3 ?
" \9 _( Z7 k  G0 W% K0 UMethod 08
) ^* K+ H3 C9 ~5 R5 w; B=========
; Z/ i+ @2 R7 y* |& Q- t) e: ~& r1 U, C
It is not a method of detection of SoftICE but a possibility to crash the: ?( _3 N  F1 c4 G. X  H
system by intercepting int 01h and int 03h and redirecting them to another
$ S1 Y1 M! @% \. w. A) V9 Sroutine.
3 _: `' g5 w+ a/ kIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
( ^" R+ X* h) Gto the new routine to execute (hangs computer...)
4 Q! E/ g9 {4 d5 F/ O; W7 N8 J& l1 K5 m( |- j5 h
    mov     ah, 25h' ~7 l" l! G; T* ?" ]% l
    mov     al, Int_Number (01h or 03h)
- I, y9 ~$ T* N4 H' Q5 V) i    mov     dx, offset New_Int_Routine) ~  p" q8 \7 r. `/ K7 L' n
    int     21h
% q5 O! A) U$ D7 q% N
# z2 {2 O! B% ]% G' ^; B) D4 i__________________________________________________________________________9 g2 F  }* P' @2 t  l5 o7 m

- r2 S3 n* f5 {' r' U8 X5 |5 C0 YMethod 09
* w2 r+ P6 S/ }6 C=========' Y$ \; I5 b+ i8 }! ?& C7 e
1 H6 w; A1 I9 Q1 M3 x
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only& a7 x1 j# E9 j- ^3 n1 ~
performed in ring0 (VxD or a ring3 app using the VxdCall).
% [! P& \# M5 |1 [/ {The Get_DDB service is used to determine whether or not a VxD is installed6 Z& l: S/ ]& q8 x* j3 E+ M
for the specified device and returns a Device Description Block (in ecx) for
# {. J0 G3 ?' zthat device if it is installed.$ ^, x- A3 W# q: p
' R9 z! R  `1 m
   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID  `, B3 }; Y+ P& q1 y# B
   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)  ~. p0 N& a: a; h: ^1 [4 s
   VMMCall Get_DDB
) @; m& m" M6 V; ^8 ?+ U6 Z   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed
5 z3 ]* J4 [1 t5 |1 f4 u4 h/ [0 B7 x  C& @2 `  z$ _
Note as well that you can easily detect this method with SoftICE:
  V; T  u, e' B/ m/ P6 l   bpx Get_DDB if ax==0202 || ax==7a5fh0 q3 T  G/ L- d+ |- M; ]

  m( s% Q- s0 {9 G1 m) a- R8 W__________________________________________________________________________! e# l5 C; N1 _& X( K  W7 n  m
, {4 J( `9 l0 w: }* h" K
Method 10
4 x! ~' V6 W: Q2 D. x7 Q7 c=========6 K7 A9 O$ q4 H0 ?& m- o! k8 `+ q
6 i2 T/ }3 J( d
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with# `4 a  h# E1 c
  SoftICE while the option is enable!!
" _6 X, z: B9 }  k+ ?4 P
  y' h8 j7 u3 a1 zThis trick is very efficient:
& c$ @$ b" V4 {+ {& G3 Fby checking the Debug Registers, you can detect if SoftICE is loaded5 A) o3 Q* o8 u: `2 k
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if, A9 j+ A, k5 t& C! \; h
there are some memory breakpoints set (dr0 to dr3) simply by reading their  u+ m, [1 K8 I" D" N
value (in ring0 only). Values can be manipulated and or changed as well
- e3 A( [1 E2 T7 n0 z$ u/ K(clearing BPMs for instance)
$ U! r" R9 `7 s, ]5 b6 m: t
# b6 o, T: K  e& Y__________________________________________________________________________
5 r" d# X. p. A2 ^* q5 p5 j  m; u: ~- c- e% v5 o( }, p- m* F- c
Method 11
$ Z6 v( B/ a" _* B, J- R=========8 r" ]/ a8 x. q
6 I$ \) m7 a4 I8 @6 q* W! ]
This method is most known as 'MeltICE' because it has been freely distributed
* M; P. s" R; }* _via www.winfiles.com. However it was first used by NuMega people to allow' r' c( V% P0 P5 m& i# V; y
Symbol Loader to check if SoftICE was active or not (the code is located
0 ?2 M& l0 P. [; n8 r5 T- j2 Yinside nmtrans.dll).
* r; ?3 y! v6 O8 o+ ^
3 S1 K8 I3 ?% FThe way it works is very simple:
1 l( Z/ Y0 T/ @* u2 o. TIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
* r8 J# x  U3 W& m: i! |WinNT) with the CreateFileA API.
( G5 @8 A6 q1 O+ T' s! ?, k2 T/ b# j. n/ ~6 R1 m) i$ H9 }
Here is a sample (checking for 'SICE'):
' W# K* m& F" W
. y$ S4 T. b2 X8 e5 S! HBOOL IsSoftIce95Loaded()
7 s5 J4 J% c7 M! v1 C{6 r. j& x' k, `  U. B" O
   HANDLE hFile;  
8 @6 E0 j" ~; S8 j# h' q- ]   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,7 s' Z# Z% O/ \) O% n
                      FILE_SHARE_READ | FILE_SHARE_WRITE,* A. W0 C: Q5 ]
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);$ `# n$ l/ }7 ]" c7 K% _2 B, N
   if( hFile != INVALID_HANDLE_VALUE )6 ^5 w1 {3 x: c  _& [: k
   {. P6 B6 ?; D( G- k: _5 p* N2 b
      CloseHandle(hFile);; Y9 V+ O. F5 T( C
      return TRUE;! X8 z$ d8 J/ q7 C+ I/ v: Z
   }4 i( o) p/ k' d0 y' C- C9 d
   return FALSE;
( D0 s$ I# q5 i, o$ X) e. R% ]}
# D0 S2 Z, W0 r( O6 z
/ Y2 X" Q5 M) @, l  c( N8 x- v) eAlthough this trick calls the CreateFileA function, don't even expect to be% i% }1 O3 T: J/ W3 A( n
able to intercept it by installing a IFS hook: it will not work, no way!8 g. \+ f5 G$ T3 n% v' x0 ]! ^
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
) }& c/ ], J8 J2 b" Eservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)) Z0 a- K( K  z" V' k
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
5 |. b. p0 Q/ W0 |7 c  @7 O& xfield.1 |) L( i8 w% l: o
In fact, its purpose is not to load/unload VxDs but only to send a
& j1 V5 Z4 y0 \, c  @W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)* Z; ]1 Q& \5 H- G( K1 t. p; q/ h
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
1 b8 N+ ?) o+ y4 v; `to load/unload a non-dynamically loadable driver such as SoftICE ;-).
& f! _. |  l: y* T& |6 o- h8 HIf the VxD is loaded, it will always clear eax and the Carry flag to allow( r- q1 L! J$ a7 H, q
its handle to be opened and then, will be detected.
* J8 P9 D( {4 h; G0 G- VYou can check that simply by hooking Winice.exe control proc entry point$ V9 ]$ _& a! g# C
while running MeltICE.5 k) U$ L; y  z) U9 a" J4 A

  S  C$ o& y/ v! c/ ?+ b- Z# I
. G9 t, I) l. J7 ]  00401067:  push      00402025    ; \\.\SICE
2 i+ d9 ]$ [% R) a& `1 o  0040106C:  call      CreateFileA
8 `  D9 n* k% {4 m  V: p  00401071:  cmp       eax,-001( l' Q9 B) t/ H& G0 {
  00401074:  je        00401091* P& S* T0 W5 o( M" A/ o2 u, _* y
5 p- C  _& V$ |% O  [, k5 Q
/ _2 C/ q+ l3 }
There could be hundreds of BPX you could use to detect this trick.$ c1 N' I( R* r8 e
-The most classical one is:$ s. a2 c+ }: E. u5 D2 i) i4 Y
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
. c& b/ ^. ]& \    *(esp-&gt;4+4)=='NTIC'6 L: V& f6 ^& w( D4 j
. v, N/ E+ l" E2 `3 o2 m
-The most exotic ones (could be very slooooow :-(+ I' R+ c/ Q; f9 j1 R
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  
+ T; c$ B1 c: {1 u     ;will break 3 times :-(
2 V0 [! }. n3 h7 C3 N" p+ P! D) y) ^
* ~" y" s# j1 ?" s: a-or (a bit) faster:
3 O$ ]8 V  }" \  E8 ]   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')' k" @5 O- a1 s5 R( S' n$ C+ N

- @& d9 b  `1 Q  B   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  
  q9 q+ ]* K; a/ }     ;will break 3 times :-(6 q" b7 x- f( p8 U
, }% V% K" `0 [* T
-Much faster:
; u$ `% U6 Y2 p" Z   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'
" Q! d7 l; S0 M, `1 Z( i: G  ?) t0 \+ [% e$ |
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen8 L: _9 N. W1 y, w
function to do the same job:- i" `( N$ `( h! Y; d
' c; q/ i" e) E4 N3 L. z( f
   push    00                        ; OF_READ6 p2 a" L) ]8 e7 @
   mov     eax,[00656634]            ; '\\.\SICE',0
* ^6 }) ?- i4 @: a( h2 E# e   push    eax, J! o' J1 k2 }; Q  s
   call    KERNEL32!_lopen
7 I2 G. w1 D, O; u8 c' @' v   inc     eax
% b/ j3 f1 E) j   jnz     00650589                  ; detected
7 ~1 q! R2 e& ~7 x  j7 p2 q- C* F   push    00                        ; OF_READ
3 Q9 |4 X; g6 ]! h3 D& @  c8 m! f   mov     eax,[00656638]            ; '\\.\SICE'
( D, m" |2 K3 o% z   push    eax
' M) Y: J( p6 N  a/ A   call    KERNEL32!_lopen
$ ?1 s" L3 w; |" }   inc     eax
. i. R. @5 O, p   jz      006505ae                  ; not detected( m) v; m% l9 b, c8 U6 t7 o
: s7 P& A* V* |7 N" F0 |# C' |
) n+ ]. y3 J) n- x8 o' [
__________________________________________________________________________9 L8 |6 R+ F1 ~* X

; J+ m' S3 L3 D6 F& n3 Y7 S/ T1 uMethod 12! a; c( f" T! E" z/ z
=========9 b6 f( v% ]) ~4 e' F  o
5 i7 V0 A5 b; W( \' j0 i
This trick is similar to int41h/4fh Debugger installation check (code 05
: P* l) ^; m$ c: N# y&amp; 06) but very limited because it's only available for Win95/98 (not NT)8 D, v( t% N. O8 w& O
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.- I2 I8 p; Y& m

7 A" K. }4 F1 R% V# e   push  0000004fh         ; function 4fh) @9 P) J; S# }1 {
   push  002a002ah         ; high word specifies which VxD (VWIN32)9 l" A: J- }9 d$ S% |! `
                           ; low word specifies which service3 v) ]  G# T% U3 M4 x7 N' @
                             (VWIN32_Int41Dispatch)# Y' c  U% v; W) T8 }/ n6 u
   call  Kernel32!ORD_001  ; VxdCall
- D5 k7 k! G! |5 k* a7 z3 I9 g8 S' ?   cmp   ax, 0f386h        ; magic number returned by system debuggers# q6 v3 Y4 v, L* O- z
   jz    SoftICE_detected
. C3 N( V# m& j! H2 _" `# V+ A8 S) b3 _0 o# v
Here again, several ways to detect it:' c, [2 p2 f' N

% X* Y; ]3 {# H5 K3 D    BPINT 41 if ax==4f
- P7 K+ A4 J8 d, m' t% x4 N
' q1 C4 z9 B1 j7 C4 {3 P8 X    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one
% g9 ~$ X: _$ D+ t2 `
/ V( C  R- K  F7 c3 r    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A/ Z$ y( O/ H# j2 j3 y. _

( `: V! ^0 C8 n+ y    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!
( }8 Q2 ?( b* X7 Z- f! A! l
6 u' X! D3 S9 a/ a2 f/ r' z! a__________________________________________________________________________
5 r  _2 k4 B9 r, n
3 N  _& }$ m" c/ F5 E; kMethod 13
: i( E8 D; r" `2 X. {- y8 Y=========
4 T/ n0 n2 U7 v& z/ f$ p6 Q+ _  }! j4 @
Not a real method of detection, but a good way to know if SoftICE is
9 ^* e# g4 o  d* F" Einstalled on a computer and to locate its installation directory.* Q! V) }; C2 i0 e0 p: J) M
It is used by few softs which access the following registry keys (usually #2) :
% i! d$ `2 J: T+ W3 T9 l6 D5 ?0 _4 G/ b
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion/ d; P3 }3 l( z" W9 v1 e
\Uninstall\SoftICE
; {' c+ s+ c( E6 K; J- ?-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE* d: u/ n6 K/ y5 o0 f( k
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
' V; r3 [4 U8 E\App Paths\Loader32.Exe
2 _; g! Z* @8 {) `9 D
, y+ t: J, T' R+ |. u% \+ ?! A9 x
% C- X4 x# X; t3 b, INote that some nasty apps could then erase all files from SoftICE directory" r8 |! A- x. Z. t. T% R
(I faced that once :-(1 v$ ?6 E0 g' _- O% x

3 }1 c2 R9 ]1 T5 w' HUseful breakpoint to detect it:$ t) [. B# f$ T
! w; t2 H% B% O9 M
     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
% j! V5 S9 ]6 B+ d+ K3 E5 [% f' X- {7 O, Q3 Z9 J: o
__________________________________________________________________________) S8 N+ @* s6 M: A5 j' @
) @. t4 s& E8 p# z; @

7 Z" x3 Q- @4 zMethod 14 $ b! z& P& _3 ]
=========
$ p# |; f2 \, @2 L0 b3 s8 j. j: v, Y4 z7 q
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose; p' ?' a8 o1 n$ P6 c+ ]% B
is to determines whether a debugger is running on your system (ring0 only)./ @8 q2 i* f8 a' B! R2 N& `6 A, [

/ A/ `" x4 }! Z9 x" J" L% [8 e   VMMCall Test_Debug_Installed0 u" D+ A) _* W- e
   je      not_installed2 y. I. d! R/ x2 V/ {3 `5 `. b- _

4 E  n6 g( a  x! cThis service just checks a flag.
9 l/ }: b& V& R</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-6-23 16:32

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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