About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
) M: N3 w7 u2 b( C6 b4 Z% L- {9 W<TBODY>
2 ?: ^; ^' {$ _; i5 W* {! u* x<TR>
& o8 w! e2 l: ?6 ?0 C<TD><PRE>Method 01
/ x) t2 {! D! G9 x6 {! i=========2 ]4 \5 |( |- e1 @. B/ P
" A( b" V2 t0 W! Z" W
This method of detection of SoftICE (as well as the following one) is
0 Z0 a0 q4 o) Y" V, F9 a( Lused by the majority of packers/encryptors found on Internet.# s4 D. b% U# ?3 n& v3 [
It seeks the signature of BoundsChecker in SoftICE
& D7 F3 ~$ o  A% `5 j  q/ m. {! O$ w
    mov     ebp, 04243484Bh        ; 'BCHK'
: [! |. s3 k/ V0 G    mov     ax, 04h
& K# t! |2 u% L    int     3      
/ g' w3 Y" l/ h    cmp     al,4) b* M5 R  D; F8 r4 f
    jnz     SoftICE_Detected
9 f/ K7 S" w1 ?8 t9 d' S, L1 N; x% H) }' N  V! @' ^
___________________________________________________________________________6 `5 s  k5 z; [0 g1 ?

* I1 w/ h& N7 X* Q. @; oMethod 025 O' J, B' p3 b( V4 P
=========
) {4 d1 P3 @' a" x
, W  r0 m5 |0 r! ]4 f$ yStill a method very much used (perhaps the most frequent one).  It is used7 `& D% V# N  @) J  y& t+ R
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,9 e; I* f4 p  {/ W. l( X, Z
or execute SoftICE commands...% r/ |- _; m! s3 }( ]9 M
It is also used to crash SoftICE and to force it to execute any commands2 P3 v9 R5 |: {- J- l8 h
(HBOOT...) :-((  
" I6 z; G( W& o: {7 ~  W8 M9 L! H$ F) U2 {: R6 w2 G
Here is a quick description:% R/ p: t, @; D9 X/ W! y
-AX = 0910h   (Display string in SIce windows)2 A* b! p* m+ U6 w
-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)
2 F/ R7 ^0 Z& Z-AX = 0912h   (Get breakpoint infos)
3 M; E/ L) u6 N. j* i8 e-AX = 0913h   (Set Sice breakpoints)
3 h) H# K% h; J5 e7 A+ M+ N-AX = 0914h   (Remove SIce breakoints)
" I8 l. _4 A: N# G8 }; {7 d- |! J3 R+ ]
Each time you'll meet this trick, you'll see:
2 r( ?0 ~& {$ ^$ }0 ~2 }1 q-SI = 4647h; p0 d; S( w, M5 U. b" B* @
-DI = 4A4Dh: @% w+ t0 P1 G
Which are the 'magic values' used by SoftIce.+ K: w6 v* T1 I9 r6 |; g
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.+ I3 X% P) m9 d7 y( u8 F

* p! E6 N- o' tHere is one example from the file "Haspinst.exe" which is the dongle HASP# D# U: e3 f: R
Envelope utility use to protect DOS applications:5 Z* Z& \4 Z. l( l0 \; M
$ l+ r; C+ a& o6 r. }; F
& \7 X2 d( W% j8 u2 o8 T
4C19:0095   MOV    AX,0911  ; execute command.
" G2 }% Y! R  o4 |9 z/ E, y! k- l4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
/ G. }7 J/ C% y" V" u' U6 U4C19:009A   MOV    SI,4647  ; 1st magic value.
& Z, E; ]5 P; w" s% V7 H4C19:009D   MOV    DI,4A4D  ; 2nd magic value.
7 N* f3 \) y) g) u7 f( D4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
) q0 j8 q* h7 j0 l* j1 ?4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute2 P7 g2 w# R0 \+ c  |3 c
4C19:00A4   INC    CX5 m5 P8 K+ j! i5 D
4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute  r$ q2 Z, E' G& A) C
4C19:00A8   JB     0095     ; 6 different commands.  J+ b4 G4 V" g& b
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.: q2 Q* N( h+ X7 N
4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)
. V; T: ^+ u' I6 h& n
4 r3 C# b' Z2 }, h$ ^: KThe program will execute 6 different SIce commands located at ds:dx, which+ Z/ J3 G3 y. j4 F5 e2 n1 ]9 C/ A$ w
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
7 q. ^) T, O: k$ L9 v7 z2 V* L8 p
3 C8 o4 u- q+ s* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
, K, ^! m2 n& ~& V  H___________________________________________________________________________/ J3 {8 L5 a2 f8 v: Q
8 p+ K" c% E9 Q! n" P. I

- ]/ O% N4 |$ n5 lMethod 03
- F8 b7 c3 L0 B) J/ [=========
( _+ t1 G+ \( Y5 H8 m; f' s
, n# k8 L/ v/ q6 X; k: ~2 D3 |Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h, }% X. [- s: M9 [
(API Get entry point). O- Z/ U! |  S$ r, y3 L
        
2 K2 A' O- L: ^4 p8 i
% S, i6 Y( a' X7 k" }' p1 J    xor     di,di1 F! g" V4 t' b9 q& l
    mov     es,di
: _% \9 B5 q9 X( F3 J# a    mov     ax, 1684h       & I2 R9 l5 G  ?) J  l+ Z# w& ]
    mov     bx, 0202h       ; VxD ID of winice( e" p0 L+ @0 p* x/ K+ E- ^  k& ?2 z
    int     2Fh
& C4 _  l+ d+ h/ H/ [4 ~! P& D7 [6 N    mov     ax, es          ; ES:DI -&gt; VxD API entry point5 l- w) O+ n- Y8 x
    add     ax, di* v, ?% ^; z: c( P* K
    test    ax,ax; D7 q4 F+ f) X5 f+ w
    jnz     SoftICE_Detected
* h' P/ ~8 |$ ?: h, e2 r* c3 t  p6 b* i
___________________________________________________________________________
/ k7 t" A$ u5 P" w! ^& V
7 M5 i6 j, @$ x4 @4 ^: sMethod 04
2 m" d# j; f2 [; i  j4 y- o& A$ u=========
/ e' g1 E* J& r# S6 e, @( l. C
, V) X: `, p4 O. Y3 vMethod identical to the preceding one except that it seeks the ID of SoftICE8 F- j6 J4 |+ R6 }7 x" t  _  `! A
GFX VxD.
8 Y7 w6 w# g7 s; s1 I) u* x. o: z  G- m: ]! `; I% G
    xor     di,di
: P& ^4 y, C. x5 K9 E3 X4 d    mov     es,di
8 a: g! q) w/ S    mov     ax, 1684h       & T9 Z/ g- i/ q- c; G. \$ k
    mov     bx, 7a5Fh       ; VxD ID of SIWVID. i# L! j  `& T& s6 {
    int     2fh, B2 w' E/ P9 S4 \$ T; o
    mov     ax, es          ; ES:DI -&gt; VxD API entry point
9 @: i. n+ J( E; G2 n    add     ax, di
4 u3 g1 F9 R6 y1 Z4 W1 h6 Y/ L    test    ax,ax- d. p" o6 H$ L7 V) W# D
    jnz     SoftICE_Detected& z, M7 V0 A6 S4 Q9 C

- v7 T) r* n/ D5 X6 @; Z6 ]__________________________________________________________________________* W6 S- R' `- q+ g  {& Y3 b
* _) V+ h, P% W- m# L5 ?
) z# Y2 o! }! r+ c
Method 05
0 |/ I0 {; g1 ^  r+ w: V2 o=========
- R' I5 m8 O$ E6 |1 `2 K
' e5 d& H/ {% K- Y4 BMethod seeking the 'magic number' 0F386h returned (in ax) by all system
1 V/ _, w" f" {6 U+ X9 M7 @debugger. It calls the int 41h, function 4Fh.
3 x! B9 B' A, \8 }$ P3 OThere are several alternatives.  6 ?, D$ r5 b9 p' O2 T8 ~! ?/ y
: ~4 G# c' C$ z5 e' r: x
The following one is the simplest:9 n$ Y. l7 J( H# J' ~5 z* X( D

" ?9 N( ?" D) z* h- R    mov     ax,4fh
5 k; j. d  R& V  Z9 H! b: |    int     41h
) h( {( i' l8 n8 G% c( B( b! i8 d    cmp     ax, 0F386$ R7 w* a$ |8 w! K* j) Q0 Z; r0 }
    jz      SoftICE_detected
' |  V8 R1 Z* g5 x1 |" ]2 \' i) s- v6 _' s
- a1 x: W" F# c5 K! b
Next method as well as the following one are 2 examples from Stone's ' ]1 T' L0 _6 c7 {: c, l4 }9 r2 r
"stn-wid.zip" (www.cracking.net):
- Q, ]6 ?* i) r) |
4 t! z+ w( b  s* \8 ^    mov     bx, cs! G% Z  t3 m7 G5 ]# q; W; J; V/ c
    lea     dx, int41handler2& x1 n0 J" A4 B, x
    xchg    dx, es:[41h*4]
% Y. I1 v* V  y    xchg    bx, es:[41h*4+2]6 L- J4 B" K9 U  [
    mov     ax,4fh
  f; R" |; _# y! z3 B7 R$ I    int     41h' [3 o- I  V; D! x  ]
    xchg    dx, es:[41h*4]
& Q/ v  z2 a  Z. l# m, e6 S    xchg    bx, es:[41h*4+2]
* P: q# D- }, s" @" s" ~& W) F# q    cmp     ax, 0f386h
4 G7 {* W! A/ E2 F1 t- B3 F    jz      SoftICE_detected( _1 K' C& \: h! v& v

2 N: s* d* u. lint41handler2 PROC3 F3 k! W6 ^* n. O( q
    iret
7 `' U6 Y9 @+ l0 D8 bint41handler2 ENDP: `" b1 a5 R# B6 M6 O2 V
  {. R4 h1 v, ?. l' l, ?1 \. q7 W
* Q6 t$ \) ^; K1 m2 v4 A
_________________________________________________________________________
4 _6 Z; A6 y( ]7 ]/ {5 i2 C, U# g0 r: w3 o0 }

1 e/ T( S, w+ U+ BMethod 06
+ w0 ]2 `2 [& U$ Q=========
6 H6 I  D: N. x' C
4 [5 `0 [: B3 Z( H! D2 L9 k- ^0 |9 x) y5 U0 b& t6 V
2nd method similar to the preceding one but more difficult to detect:- b- Y/ P1 M/ E; \& C- Q
, w7 T# h+ O5 d) R$ P6 Z% f
2 k: A/ p# c3 `
int41handler PROC
( L$ ^; h1 K% P3 o5 \, a( v$ `    mov     cl,al5 Z8 R8 F* V  p; f
    iret9 W# z' O) M+ [8 j, l7 @4 h" s
int41handler ENDP5 h, p/ @& s( g3 w7 M  Y: l3 e

4 ~6 o  R1 M* k- e; c3 ?! c& a/ P8 }& P# ^0 L
    xor     ax,ax
7 D9 D: W- h4 E    mov     es,ax, g: k0 v0 R3 p3 M/ r0 b$ J* L7 K8 [
    mov     bx, cs
5 C9 \3 U8 D1 {    lea     dx, int41handler
+ i* O& ~: {: U4 |9 R  T    xchg    dx, es:[41h*4]+ P. P: ^- N6 K7 i
    xchg    bx, es:[41h*4+2]
3 T0 k8 ?0 e! D# b; e    in      al, 40h2 n5 P' c1 [8 B( L# b8 L
    xor     cx,cx
9 }- s" V7 d0 H    int     41h
. e: O0 N" t7 o+ m    xchg    dx, es:[41h*4]
" Z+ I" t- F; G* J4 S  k    xchg    bx, es:[41h*4+2]$ K3 M/ c0 [0 d" \  y" U. B3 w
    cmp     cl,al
2 q! t( v# R8 Q2 i4 }. y' x    jnz     SoftICE_detected; y; n; l$ U. }9 H

2 B, g, B" w% j' d+ ~/ I+ N- `" z_________________________________________________________________________% J- G9 {3 F* P) o$ R

6 J' `8 A# l0 x# z9 ^Method 07
0 H( i4 y9 S# U* K; Y/ V4 Z9 G  s=========" F. u" C# M% g* C/ L4 x0 h
4 E, b6 k7 G# i( E* L/ G
Method of detection of the WinICE handler in the int68h (V86)( z: }+ b' O  J0 A2 }* L" e! v

/ q; r& p+ r; _$ X# v4 I1 v* X; \7 p    mov     ah,43h
- i9 |) T- O1 E9 G6 ~0 W, M, _6 K; J    int     68h7 o( n) M+ e( m6 a% \& t/ T
    cmp     ax,0F386h
7 ?, j: s6 L% E. i; c! Q; T1 J$ C    jz      SoftICE_Detected
! O( b* a/ g5 k+ X+ O# _# n
& p9 K- ?3 W3 Z; Z$ Q) ~7 I/ x! P) g' t
=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit; L* ]5 f: E. [; u. T3 R( m& S9 m
   app like this:
1 ~: s: o% w, z- }! p1 V) I+ y- ^
1 g' L$ y8 V" k1 y4 I( r1 E   BPX exec_int if ax==680 U! Q/ L, o: b1 g) c
   (function called is located at byte ptr [ebp+1Dh] and client eip is
; Z& a4 u8 ?7 ~. m9 b   located at [ebp+48h] for 32Bit apps)1 i" W  ~6 l% K1 A9 C) O6 u! s
__________________________________________________________________________
2 x+ F6 ]! R2 y3 Q  [* c. O+ U
! f5 Q" g6 |$ E/ c
7 E. m: H3 u" P6 G% ?Method 085 J9 ]) H  t- K. v5 r
=========: U8 Q( t) P8 |9 y! S' T5 |  S# N& J# V

7 |# q" t  a0 Y- k% M$ W6 k9 J0 K+ NIt is not a method of detection of SoftICE but a possibility to crash the
6 {+ d) _; l* u- Csystem by intercepting int 01h and int 03h and redirecting them to another# n6 ~7 g  ]4 N  f
routine.
( L1 f  Z1 b5 E: K3 V" E2 pIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points' |* Q. }! ], p" ]2 q
to the new routine to execute (hangs computer...)8 N* d  j5 N* {0 d" |

* ^* }6 B7 U, S" y; @* }8 r    mov     ah, 25h
" j3 |; R* L$ d7 W    mov     al, Int_Number (01h or 03h)1 s9 }* a! Y1 C; n2 K& q: Q7 m
    mov     dx, offset New_Int_Routine
$ d2 G" J0 S6 o3 K% ~    int     21h
  y; _, b# g# t7 F& R% d3 q* e
  \% |1 T1 l" W% w, M5 H__________________________________________________________________________
/ c+ o' E# ]5 }; w' H4 {6 O( `1 Q1 A3 ~) U" @
Method 09
  i: M0 c8 a; X$ W=========. i8 f6 ^0 J( t6 q& I8 P2 k4 w4 k4 @
& |0 q1 J3 r0 G# d: ^: \
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
& @3 r+ F" @3 i: Cperformed in ring0 (VxD or a ring3 app using the VxdCall)., {4 \, x" P% Q  `/ ?
The Get_DDB service is used to determine whether or not a VxD is installed- z; ^2 `; Y- {% G
for the specified device and returns a Device Description Block (in ecx) for
$ X; a$ z' e( O+ r; Fthat device if it is installed.( m" F: d6 ^% E  n

8 F) T& ]8 M# X9 s' c& R   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID  }2 h* Y. S; K2 A# |# d& m4 r
   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
0 z9 X. S# z/ P! I( v0 @   VMMCall Get_DDB" I2 ~" s7 n1 L/ U' p
   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed4 }4 t8 l! }0 o2 U3 n
% I: ?$ x7 B, C' s. T
Note as well that you can easily detect this method with SoftICE:/ o( J  U# w' V1 t4 x- {( y8 y
   bpx Get_DDB if ax==0202 || ax==7a5fh' u& D) C  `3 U* y

+ L/ O+ q/ ?6 u. \: _. W! z, o__________________________________________________________________________
% G* E3 s) y" y) C) f% t0 Y" R& G% P; w* W: ~' u
Method 10
3 J* D4 w9 S+ g0 b# m! j4 N: ~=========
: b4 r+ X0 ^- q, s2 z* O  c
* a! a6 @7 h! Z) s=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with, t) N+ D; a" \
  SoftICE while the option is enable!!
  b! Y6 h# q% c
6 B9 w9 i/ n: N; [; iThis trick is very efficient:) e- ?, x2 b8 h
by checking the Debug Registers, you can detect if SoftICE is loaded
) n5 M6 N. H9 S7 t4 x' I( w: C(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if) E1 u; K6 C' M6 g% c9 b
there are some memory breakpoints set (dr0 to dr3) simply by reading their
/ {$ z5 t1 l3 `7 nvalue (in ring0 only). Values can be manipulated and or changed as well1 H2 I8 n$ x0 _7 O$ x, s6 C; J; ]% f
(clearing BPMs for instance)
' ]0 u/ q1 T0 V* j/ v9 O% O$ r  O: E- w- }5 V6 B: N/ Y
__________________________________________________________________________( }  |6 f8 R+ M7 l
7 H$ [+ O# Q$ J1 R, v' K7 X
Method 11
- A. Z9 y. n* n1 p=========! w( [. [2 v" g

4 G) r. _# `0 b  m, M  p" ?This method is most known as 'MeltICE' because it has been freely distributed
" |  R$ d2 A- f; E* M9 G( K# r# Gvia www.winfiles.com. However it was first used by NuMega people to allow
' x" D8 z8 A2 B; U6 ASymbol Loader to check if SoftICE was active or not (the code is located
# P5 S. F7 L, u( w( X5 ninside nmtrans.dll).9 q* E4 h# o) d- \& x6 R
% ]. |" {) ?9 p3 u
The way it works is very simple:
6 k2 Y2 z3 m, |& u" r/ `$ w+ IIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
* ^7 p7 }3 Q1 }8 VWinNT) with the CreateFileA API.
1 M7 m. t3 E; n% V  H
* a4 T' O  K. l4 ^3 c5 x7 f9 ~Here is a sample (checking for 'SICE'):
7 n$ w$ A0 }9 t" |0 a: Z/ R( X7 E+ o6 o  u* J# a+ S5 O+ E. U
BOOL IsSoftIce95Loaded()+ _9 {* Z% q$ w( S" r  a5 \
{2 w" C4 @- F" a5 e
   HANDLE hFile;  
" c( u" V5 Q& s5 N4 O6 l   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
+ p9 q, X9 [. R0 U4 u: E3 D                      FILE_SHARE_READ | FILE_SHARE_WRITE,3 G4 z% B4 A/ Y- o5 r) k
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
& T' s) _2 v' g# f& m- l3 w3 T) }0 b   if( hFile != INVALID_HANDLE_VALUE ); @0 H% P& p6 L" a
   {$ k3 s+ R2 W2 b* H/ K
      CloseHandle(hFile);
3 k+ v$ A6 x8 d6 d% e; x, ]/ Z      return TRUE;
; L& ?. l" X/ ~) k# S3 w   }
/ T$ `9 Z7 t: t* b   return FALSE;
# L/ P2 O4 ~2 v% s- O. j+ i}
6 D3 a* D5 @3 u/ Z5 E
8 ~4 Y) C( y2 s: o" l7 Z. {Although this trick calls the CreateFileA function, don't even expect to be
! o0 [  b( d! L8 S- u& x- Hable to intercept it by installing a IFS hook: it will not work, no way!
" r: B* n  t: [  \( |In fact, after the call to CreateFileA it will get through VWIN32 0x001F! ?3 ]( k7 W( B4 v3 z, i" a
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
+ Y0 R3 b" D; g% Gand then browse the DDB list until it find the VxD and its DDB_Control_Proc; g. H2 u: d9 a/ x2 {6 i
field.6 v' |0 a7 u8 p+ G* D' h6 ?& A
In fact, its purpose is not to load/unload VxDs but only to send a
- ~3 i' e' X! C8 [W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)6 i6 ^: d. T6 z$ x2 h* f
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
* o; s( L% p% r$ S8 g+ g$ Nto load/unload a non-dynamically loadable driver such as SoftICE ;-).
* @1 G- {' }* [( I1 ?0 NIf the VxD is loaded, it will always clear eax and the Carry flag to allow1 s0 W* k7 I4 d7 @. \/ O
its handle to be opened and then, will be detected.
; F+ e! U" r, {: ]! XYou can check that simply by hooking Winice.exe control proc entry point* i3 w2 Q* T6 O' p$ r
while running MeltICE.. k0 I/ V. \  G' N8 o" ^1 \/ j: q
& }* a- v, A+ E% P/ V$ V" y

+ Z- d, l+ k: ~8 A  e8 r  00401067:  push      00402025    ; \\.\SICE
$ |5 g4 Q0 M6 R, U8 `) _7 v- J; x  0040106C:  call      CreateFileA
$ C7 B+ k) w7 L6 M( l  00401071:  cmp       eax,-001
# ^* a) l* r5 @7 v) m1 \+ `% S$ o  00401074:  je        00401091! @2 G. R  p5 C' E7 ^

8 ^3 e* P* _- y+ C6 \6 f$ b* ^
# i9 L. K# z( qThere could be hundreds of BPX you could use to detect this trick.6 U$ x. R3 x0 q" b
-The most classical one is:
( |& I6 _" b. U+ U# y  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
  ~! n3 t6 ?2 w3 c% w    *(esp-&gt;4+4)=='NTIC'7 p7 M$ S9 E: E% l

' j* d, z' e0 M( n$ c-The most exotic ones (could be very slooooow :-(; c/ J7 [. h# @& {4 j$ y+ U1 D
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  ' @4 P% u4 K# e2 f! @
     ;will break 3 times :-(, v; c: ^7 f7 Y6 d
; G' Z5 y- s1 V# v+ z9 b1 G
-or (a bit) faster: , t4 _( `, Q5 a7 C; S5 i# @
   BPINT 30 if (*edi=='SICE' || *edi=='SIWV'): d0 ]; x0 f$ {( ^. q9 ~- u% V. d

( X& y6 ~, K' L5 Z) q" ^4 v   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  7 J) r) k4 \% f( r0 B4 P. J
     ;will break 3 times :-(
: m5 H6 |9 o) N% o2 z6 H$ N  ]% L* m7 X9 |
-Much faster:
2 z% g0 ]6 ]; @  {" ?   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'. h3 G$ a8 \$ `- s' ?
. I. B3 M/ G5 v1 e4 z
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
1 p) O$ Z1 Z7 j. v& B, Vfunction to do the same job:
( N) G2 J9 R# X  m
. o' p/ H3 ?! Q$ R  V   push    00                        ; OF_READ
' q. h: g, q! R   mov     eax,[00656634]            ; '\\.\SICE',02 ~9 }8 k& n' U6 t' I; W; N2 S
   push    eax
9 h  I" h: X7 x8 F& S   call    KERNEL32!_lopen
5 C, M$ ?/ ^1 d! J( A7 {0 p   inc     eax/ L, k+ O5 [9 y% A9 b/ S  t
   jnz     00650589                  ; detected
1 P( Q4 R% \8 ?& J6 s   push    00                        ; OF_READ* R: c5 ]1 w0 f# B
   mov     eax,[00656638]            ; '\\.\SICE'3 R% r' n1 I% ^$ B9 X0 U
   push    eax
9 h. {+ r7 ^1 W" D- I$ ]   call    KERNEL32!_lopen
/ Y; u0 E) ?4 _6 j" `: m& H   inc     eax
/ G& V/ X5 }: I6 S. Q$ n5 A8 g: _   jz      006505ae                  ; not detected6 }9 W, B8 d" O3 Q) X
4 }  l; M! G, z! A5 F' e) o4 X. i( c

. `; {0 ~* @+ n* S: W__________________________________________________________________________# }# f9 V# X. w) ?
0 e# p, x: F5 ]7 Y
Method 12
  l8 ?# ?( @7 D=========, N7 `* m( p' b5 p

& _3 g1 }1 B, l" ?This trick is similar to int41h/4fh Debugger installation check (code 05( F6 j) I6 u( q* y1 T
&amp; 06) but very limited because it's only available for Win95/98 (not NT)
1 p" p' E; H" z# c1 yas it uses the VxDCall backdoor. This detection was found in Bleem Demo." `2 g4 V. v/ p5 v6 E& v; L# p7 Z
  G% e3 U  @% F- j4 E; ]
   push  0000004fh         ; function 4fh
2 F9 \! L6 J5 z   push  002a002ah         ; high word specifies which VxD (VWIN32)
! ~- o+ L* |: Y7 f! E/ J( v+ s( I4 `                           ; low word specifies which service1 G; ~+ X7 V, E
                             (VWIN32_Int41Dispatch)
0 s5 |1 l$ t) ?6 D0 ^   call  Kernel32!ORD_001  ; VxdCall, S6 }4 A8 L5 @! ^( @9 Z2 a
   cmp   ax, 0f386h        ; magic number returned by system debuggers
9 L+ q1 P$ H' h7 w! [2 W4 o& h5 Y   jz    SoftICE_detected- G) E) [) Z' `6 |+ d/ u: ?
& z0 `; I+ R" i  t) I- Q
Here again, several ways to detect it:& \& o* E! K8 C9 l, n4 I
4 o& s* [9 g. q8 V9 D" F" D; d3 _1 V
    BPINT 41 if ax==4f# V# p2 L( |; }+ Q# D/ z' p' ~% q) k
0 X" a$ }  D- G4 F
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one
0 b, Y) {$ \7 r) Q% _: d, p) R
    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
+ c: J6 S3 l1 _" l. G. v& x, ]! ?1 |9 w& n/ ~
    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!
  m9 [6 Q, n. z; f. a) C! _0 D
" H2 l2 p* r8 S3 P__________________________________________________________________________' g; G& @7 c, G
( s# h/ y! A6 V4 C5 w# `0 a1 y
Method 13$ u- X/ M& t8 v- j+ Q2 x9 |: o7 Z
=========( N  d/ a8 J% p3 i3 o, Y, {6 s" [

5 ^$ n* }5 d# K$ H# a0 e: \Not a real method of detection, but a good way to know if SoftICE is" q4 E8 x4 l6 _
installed on a computer and to locate its installation directory.
6 F" b. N) J3 S/ R8 ^It is used by few softs which access the following registry keys (usually #2) :
0 O9 `9 z5 d1 d7 A$ J! l4 \' m7 S/ H
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
6 ?: v6 B8 u  o/ V+ T" Y6 v5 h\Uninstall\SoftICE- Y6 I. r+ [7 \& L# n: G
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
/ w5 z5 Z& _( d# ], ~, A-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion7 A2 ]' H: c/ ?! t
\App Paths\Loader32.Exe
$ G, |5 {* E- m1 h2 K, a# D
& `) L" s4 [& d4 C: P: j8 h
+ ^# S6 L) D, _0 R. `Note that some nasty apps could then erase all files from SoftICE directory" R, Q. Q# g8 b6 D/ Y
(I faced that once :-(% I2 S" i  p2 x; j

8 ?  c! q" z6 q% h2 kUseful breakpoint to detect it:
  i/ @% h) |$ W) `6 Z' t1 v+ F3 B% |& b8 J6 @9 Q7 h/ z
     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
* a1 H1 B; l! X7 S
$ X; T8 b4 o) s8 n/ {__________________________________________________________________________
' b$ u7 b, w6 x- z# D' c9 h7 ]) }& ?$ [3 [
) \  H( j; n& H5 w; A" K/ M2 o
Method 14
6 H+ s% x7 w( \2 ~' G=========
+ v( f4 x0 N' P1 K# x* g7 R0 }! E2 T7 H- s# ^# {
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose5 G4 H& k/ w- E! J' g; M
is to determines whether a debugger is running on your system (ring0 only).
6 f, B( r: ?$ e, N: k- K* g3 H1 U5 F" F+ B
   VMMCall Test_Debug_Installed' Y2 O$ J( |9 ^8 T
   je      not_installed
4 p1 |; v) B3 K# N' O, @
# P* z6 x! o4 H* R  l: p9 NThis service just checks a flag.
) l, I0 p4 x. l" G</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关注公众号

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

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

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