找回密码
 注册

QQ登录

只需一步,快速开始

About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>0 Q4 [4 N& o8 y! k1 X6 T
<TBODY>
5 G1 S4 l& Y: ~# L% R<TR>
8 W2 o+ W4 }! q<TD><PRE>Method 01   R7 J; s. ?6 N9 w
=========$ h' ^0 A+ j( X

% E: w: s. q; V: S+ t, ^This method of detection of SoftICE (as well as the following one) is
( Q" `: d* |9 Y. e4 V7 G4 aused by the majority of packers/encryptors found on Internet.  b% l0 H5 t9 S0 p+ ?. z  H  |& R
It seeks the signature of BoundsChecker in SoftICE. [$ l: B# e9 T0 D- z  p

) s7 `) |& y  B3 M    mov     ebp, 04243484Bh        ; 'BCHK'
  M* `8 Q4 J4 f6 P    mov     ax, 04h7 y+ x6 G. e; U- j" ?! I3 D7 Q# ]
    int     3       0 @4 r0 o6 `' h1 W/ l  N7 P
    cmp     al,4
5 s* h7 A# U; ?8 {, ~    jnz     SoftICE_Detected
' {2 d, y% n6 G$ I3 k# {5 E
! ]- F. C% ~& Q' r- i___________________________________________________________________________
8 h; o1 i) T! @: d
4 x( k! M! o# ~, @1 x( @Method 02' H/ j2 r6 y* k
=========! J" }7 ~" W/ h0 ~3 f" l0 C! j3 e

& R  ~( t3 ?2 J7 j) W3 [' d' n. gStill a method very much used (perhaps the most frequent one).  It is used
8 J/ X0 ~9 z, B" C3 o- c5 Qto get SoftICE 'Back Door commands' which gives infos on Breakpoints,! J- w: R. W5 f! b5 I
or execute SoftICE commands...; ^% q" N' f' b
It is also used to crash SoftICE and to force it to execute any commands
/ e. i7 V0 `9 S(HBOOT...) :-((  
9 [9 D% Q8 _: ]1 W: @' g
$ P; T5 T* y3 HHere is a quick description:
6 e+ u9 I8 {3 f( y" f-AX = 0910h   (Display string in SIce windows)1 W7 k7 Q2 z0 M+ t
-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)# A+ d4 Q" g0 a9 W1 _, s
-AX = 0912h   (Get breakpoint infos)
0 e( `6 W2 ~  ]( b( N8 w- Q4 {-AX = 0913h   (Set Sice breakpoints)
8 z" i1 k7 ^7 ?7 {, }$ M; k0 q-AX = 0914h   (Remove SIce breakoints)
( B4 E8 B* L8 d9 H/ ~6 Q- m4 {" x9 ?( _  u. }% X
Each time you'll meet this trick, you'll see:" d! m. }. C! S% \& ?" X* S
-SI = 4647h
1 ]: k$ x5 M5 h/ S  z/ Q-DI = 4A4Dh2 A: b* O' t: W4 k$ t' o$ ]
Which are the 'magic values' used by SoftIce.
6 w5 J9 D1 R- {# v4 KFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
# B  x5 N/ q1 j: [
8 L# j# c0 @( ~$ o& WHere is one example from the file "Haspinst.exe" which is the dongle HASP
! i, W5 u! ^+ H# VEnvelope utility use to protect DOS applications:
# g% H/ ~5 i2 x# f) o: T; P- o
" z4 P8 W6 V' G3 U1 Y9 ]0 [8 o, I8 e3 P
4C19:0095   MOV    AX,0911  ; execute command.
6 z( L9 J4 b3 O* |4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
  Y* a' w! F- r6 v4C19:009A   MOV    SI,4647  ; 1st magic value.8 e' k1 s- i  \  h
4C19:009D   MOV    DI,4A4D  ; 2nd magic value., C6 k& G( x3 ~* ]+ V/ p
4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
5 Z& v2 _$ T9 Y  [& S1 d4 r+ r2 S; n4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute
9 z: D# h: b3 e2 s$ A# O4 i$ ?( ^4C19:00A4   INC    CX& o# e" b9 Z+ I1 ]/ P4 ], p
4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute
2 G: T7 J0 n$ }" a5 }( D1 u4C19:00A8   JB     0095     ; 6 different commands.
5 D9 P- @' n- v% q4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
3 f" N" {7 a5 c; Y' w4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)! U2 e: q/ S( q0 `# `! [
0 I, f# F" V3 X1 i" x- t! b1 H" N
The program will execute 6 different SIce commands located at ds:dx, which
, {0 @8 W* k* c( D, nare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.) v+ H+ L4 T9 e7 X% u5 W
0 h- D* `% k4 L# v" a
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
  T' w2 d7 y1 f) j5 Y& `___________________________________________________________________________
. u8 ^- d' S4 j* P4 K* J8 `
1 _: p2 L; {8 F8 K( S2 r" h
8 R( I; _0 s) f8 bMethod 03: B& A; E! S' A; v3 l4 h
=========
& @( k$ ^1 T5 v1 |: L
  A1 ]7 h4 d& I9 M$ r" KLess used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
5 d3 v& f2 p& a% B(API Get entry point)
% Z" [; o! V( {" _0 g5 j- P        
8 j; K% s9 k& k
, Q" g  I6 b- H    xor     di,di
% s; ?2 \9 b& s& d    mov     es,di- r- o' l* g3 p8 z2 F0 K* Q
    mov     ax, 1684h      
4 m3 M4 ]- J. w) c8 b- Z$ m    mov     bx, 0202h       ; VxD ID of winice* J9 f3 w; P8 @. F* b; d% g- I& A
    int     2Fh
- w. ]8 [* D4 ]3 p) a    mov     ax, es          ; ES:DI -&gt; VxD API entry point5 M0 D5 A% z0 Z% a6 A* c: F3 r
    add     ax, di+ m* D* Z# v6 b( r2 m6 k- u$ x- d
    test    ax,ax
# ^; p8 t" @) e: z+ S    jnz     SoftICE_Detected
3 w+ e+ G* v. D; J$ |1 D. j
" l2 ?" H. _' f" t; V___________________________________________________________________________8 X' ?; B, j& T" v5 N" O5 A. x" V

' u" E7 k" T6 M& cMethod 04! l7 a8 n; L4 x$ W
=========
. j1 ^0 T0 ^; Z/ ?3 h- |
- A% F# F" U/ jMethod identical to the preceding one except that it seeks the ID of SoftICE
1 r; Y: C  p% j0 k! j  M6 B# S7 tGFX VxD.
6 H2 u. w% r; D/ t7 z! L4 O
3 p3 g+ x5 m) h+ Y    xor     di,di5 b7 d- D' R5 @+ X5 B6 V+ b" V
    mov     es,di
& f& e$ h  q. d4 ]* B! M, \) V0 k    mov     ax, 1684h      
6 J9 ~6 v* n& ]. S; e+ t    mov     bx, 7a5Fh       ; VxD ID of SIWVID& r. t4 Z0 C6 M! P$ X
    int     2fh
0 s. z( _+ g9 e( e2 E* E    mov     ax, es          ; ES:DI -&gt; VxD API entry point
  |9 Y7 ?# |% z; A+ e    add     ax, di
& R$ ], _( U% W  ~( Y  S0 t    test    ax,ax
. b# p' ^1 b4 ~4 t9 P: |2 I    jnz     SoftICE_Detected
1 u1 A3 u- q, h4 B  b
+ C4 C5 l" E% q5 o$ `  c* M__________________________________________________________________________
8 c& n: ]& z% x9 C% y9 |- y4 f+ Y  U2 \4 Z# `6 t8 c: p
8 z: O' f, R9 y$ E
Method 056 h7 k6 o+ I9 `4 K. x9 A$ d
=========& M' M+ Q- i4 E. h! }; X) |5 o
  e# k3 [2 b. Q* g0 L3 B
Method seeking the 'magic number' 0F386h returned (in ax) by all system
6 t( x6 a' y7 j2 N) {7 Ndebugger. It calls the int 41h, function 4Fh.  \2 A0 I2 |" E6 w' x
There are several alternatives.  * O! i) ^: D0 `/ F/ c

* V% {% \6 S0 AThe following one is the simplest:) f$ |- G+ y$ R6 `. c: f3 m5 x
8 e% k& n' w0 \
    mov     ax,4fh. I* }. I' A: M4 Y
    int     41h
2 d. T  a0 u5 p. O: g5 [/ O    cmp     ax, 0F386
5 L$ E; R* O9 {2 d& l    jz      SoftICE_detected5 R5 j5 B0 v8 r5 R+ h

2 t; J5 B8 T* h+ Q7 j0 y) Q# m; i) A4 D* X# I0 q
Next method as well as the following one are 2 examples from Stone's
2 x2 n5 R" e- `: X% |3 g# M0 M"stn-wid.zip" (www.cracking.net):
5 m" J6 g1 j: ]% \  [3 @$ k+ w% H+ z; l$ D$ \+ i8 Q; N2 u. U/ N
    mov     bx, cs; m8 @) @4 c: s7 D
    lea     dx, int41handler28 w! P! x" T6 S- {) r
    xchg    dx, es:[41h*4]! E" ~1 y5 ^6 m- s8 Z
    xchg    bx, es:[41h*4+2]
$ }: Y  C; \5 g  A% B! X    mov     ax,4fh! O8 s, N9 _$ r. x# e; ]5 X7 G
    int     41h
# B5 z. r0 T0 u( t    xchg    dx, es:[41h*4]+ g* L8 q* P# V# ]6 n
    xchg    bx, es:[41h*4+2]+ q" `" Z  k$ ]7 }- R' X! Q' t
    cmp     ax, 0f386h/ x  M- D4 ^5 ?3 q3 `+ T' v" r9 w
    jz      SoftICE_detected) Y9 A/ c' ^. {. m, M) P$ A/ t
+ Q: _& y" ?8 V% D- N
int41handler2 PROC
. o8 R0 O7 l# x3 }$ j9 H) b    iret4 h, Y( O! U3 J9 s$ o( d. ]
int41handler2 ENDP( M- h. o6 |' _8 k5 m+ X9 Y  I
! ~$ X/ [$ ~+ e& v* Q0 P

3 A5 v6 c: T: ~7 k" [5 k3 y1 P7 ^) h_________________________________________________________________________; `7 p3 d1 P$ z' C

) j0 t  j  M0 ?3 ~. g- ?7 W" ~4 h- B( _# b/ s
Method 06
: w- ]' P5 ~9 G- T+ C8 l=========
( A$ Z. I3 z- C. _4 }5 r5 A; I' G: g% v5 l7 m. m

$ j5 N# t: F1 l. {/ P2nd method similar to the preceding one but more difficult to detect:, C% E( `! }% u* ]5 i1 b- g1 W
( ~" H% u/ u- v

, ]! F4 y  I& X) E# ~$ b8 n( Dint41handler PROC% z9 D0 s$ V4 L/ A/ Q% }
    mov     cl,al
# W, e/ z1 Z5 d1 E3 _( q& s    iret6 T/ m8 V. y. s- Y. b: E" L
int41handler ENDP) @% b! Z% p' d0 {' L/ M  [

5 O. \5 u3 D  O& }8 y, `
$ {/ a* H. {* J! h    xor     ax,ax7 C2 @  q4 b7 R5 |
    mov     es,ax
+ J( [! l, [( o" g0 a& O; u    mov     bx, cs4 `; R$ G( h/ H7 b/ `9 B2 {
    lea     dx, int41handler  V$ q  {; Z$ ~$ G
    xchg    dx, es:[41h*4]
8 f3 J# `* b( m3 t8 G3 }' P+ X    xchg    bx, es:[41h*4+2]# J3 H) Q( D  E
    in      al, 40h
' O( E& U5 O4 \2 y+ d& P8 N, ]    xor     cx,cx' H6 N9 l" q. M! }1 Q+ y
    int     41h. X9 U  H2 ~) n, X! J& U
    xchg    dx, es:[41h*4]9 m" t% z) B, L
    xchg    bx, es:[41h*4+2]/ G" F: r6 p  q7 Q5 x
    cmp     cl,al0 v# u4 M' P- Q2 u6 ^  q
    jnz     SoftICE_detected8 m$ ~4 g1 h* d. `+ G

$ v. u* K4 P+ _+ v0 i" D_________________________________________________________________________7 E& F9 x; X& _- O* m  e& ^* O, b
; k# I' Y! ?* H
Method 07
2 s, ?, R/ j6 J+ ?8 T% w. |2 D=========' U0 }4 _: @) A  C6 W

) E* N  Q  S4 V; oMethod of detection of the WinICE handler in the int68h (V86)
5 F3 ?" i* G, G* x, F4 ~) `+ u2 \+ F  b/ U) O
    mov     ah,43h9 T& x! l4 I+ C* U
    int     68h6 v+ |  a* u0 }2 }7 b
    cmp     ax,0F386h8 t8 o) v) r$ A/ ^* `& f
    jz      SoftICE_Detected
6 i! H, d! C. L: J) }1 A* n) w# ]" S6 k1 |5 B) E( [( |6 I

# G  G: Y& d3 D4 ?. c: x5 y: v=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit/ [, a, Y& m0 b
   app like this:5 O  {6 m+ M! o9 T( q" ]* t

! a: F) _7 l; A! O* I' P   BPX exec_int if ax==68
( l! o4 ~! X& P" A, }  Y   (function called is located at byte ptr [ebp+1Dh] and client eip is
1 B$ G" F( P: P   located at [ebp+48h] for 32Bit apps)
' j- Q. F! y5 k' Y" o" \% w$ _9 ]__________________________________________________________________________" N3 H4 [% D& {* p& U% P

2 w8 d' ?: f2 p  E5 w6 f3 j
9 A0 D& S$ @- ^& AMethod 08' Q. Q$ A, J8 H2 p* o
=========  h, j9 T! F! K# v0 v
* S/ m# j/ Y, F) M5 i6 }; d& Y) I; w& L
It is not a method of detection of SoftICE but a possibility to crash the5 S1 V+ w! Y1 ?  H3 y& r+ Z
system by intercepting int 01h and int 03h and redirecting them to another
9 p. O% q6 b1 n7 P" Z9 |" Lroutine.
9 {% }" y. ?! l& M" d5 ~It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
% i0 _+ {& y. u7 }4 c4 E) R* |to the new routine to execute (hangs computer...)$ h5 d" s; a  J/ ]7 L6 g; a
4 V6 y2 s4 v+ ~0 j
    mov     ah, 25h2 S+ O8 g2 c9 A" D9 _3 ^* M
    mov     al, Int_Number (01h or 03h)9 B& m) r* x2 N0 E+ c5 s
    mov     dx, offset New_Int_Routine
8 @  p' g2 J! v    int     21h
3 k1 m5 Z# ^6 u# I* h
$ Y& L( K* y* P9 s8 e+ `__________________________________________________________________________9 Z& p. `6 N6 a( ]! t$ y' o: M/ D- M" c
; h: D4 k( T9 q4 _
Method 09
) s8 _& p# k7 c( C* G2 ]=========
+ \, `+ `7 X! t5 G0 b4 R) m3 x& k% `) c. ^& g
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
/ M% C/ S7 I1 Z  }+ Z6 W% r% vperformed in ring0 (VxD or a ring3 app using the VxdCall).
; X: ^( J9 o! H* |" |. E5 C7 g% AThe Get_DDB service is used to determine whether or not a VxD is installed
. U4 I+ o' _+ f4 Tfor the specified device and returns a Device Description Block (in ecx) for+ j$ e: T6 y6 o9 O+ l) O# E
that device if it is installed.
' a6 f5 t* y- B- U- t) d
' l$ q/ {- {  ?7 Z. ^6 E3 H   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID
$ S7 M+ K% T8 M   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)  l& j) r/ v& [5 W' Q7 q' h$ ^
   VMMCall Get_DDB
$ U% g, h/ [7 `/ \4 y+ h& x. n   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed8 ]0 A; ~0 n- y% t* ^+ y

5 Y' y. o* B9 b) Y5 lNote as well that you can easily detect this method with SoftICE:
- A' t( s- N' v' s   bpx Get_DDB if ax==0202 || ax==7a5fh
- E- {& a7 [( ^9 ^, T* A% R: R( j. @* ?2 @3 A- G
__________________________________________________________________________. |. s+ b9 J2 x) y$ o! P+ f9 K
9 k3 u' p0 X' s% s& M8 F7 G1 B2 U
Method 10
2 {0 R! {0 f& f" V2 t' h=========* N! h! I/ a' y, z( X: |

4 Y7 e2 w4 u1 D  [6 H+ A; x- {- D=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with
0 J$ g* h  R1 E9 \. \% y  SoftICE while the option is enable!!
2 e1 g, f* ^6 H3 l3 p8 T( ^- _; N# `0 h! @, H/ W: }2 B- I
This trick is very efficient:5 G9 W$ P0 E4 b' x; a& R
by checking the Debug Registers, you can detect if SoftICE is loaded$ X. K4 s% X$ j) ]& R1 q- F: O
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if7 x( L- U) V% c, o
there are some memory breakpoints set (dr0 to dr3) simply by reading their
+ A. t. @! N8 T$ A+ J0 U9 K$ F8 z/ yvalue (in ring0 only). Values can be manipulated and or changed as well$ T# R9 H* G6 c% r) v
(clearing BPMs for instance)
3 k% k& o8 ]+ O+ _; v& R9 C. P
& M' @$ O9 @' N: s# j: w' s! I__________________________________________________________________________/ u0 D% L% S! D1 b3 h
) X$ L* ^, J3 O
Method 117 V. e! X0 z3 t
=========
- B( ~/ \/ D% ~, k$ c8 e; C& b* G; C
This method is most known as 'MeltICE' because it has been freely distributed) F+ [# `5 W; Y5 j! @. i0 t
via www.winfiles.com. However it was first used by NuMega people to allow
0 P9 b, B$ q0 JSymbol Loader to check if SoftICE was active or not (the code is located
: J5 S6 ?  \5 Y- c0 \, o+ _inside nmtrans.dll).' \2 u5 z* x$ I
% C" k3 c* t+ O$ Y; p
The way it works is very simple:$ `0 W$ B$ `; ^7 @5 z, \% l) N" W1 H
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for$ G# H+ `4 Y8 }
WinNT) with the CreateFileA API.  m% |# n" E3 p+ c* Y1 x; i! }

" ?7 e5 ?5 U9 \! I% uHere is a sample (checking for 'SICE'):
; q3 S$ d4 W; E9 |. g- f  R
. r% d- x9 I' \) c0 QBOOL IsSoftIce95Loaded()
* f1 ]$ h. n4 [# D  H{$ U8 ?- f; O' F2 S$ s& ?) u) Z8 u
   HANDLE hFile;  
6 c2 r2 \* ?+ G  P  L+ K+ h& W   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
8 [' K; \. i( r- t. V                      FILE_SHARE_READ | FILE_SHARE_WRITE,
& K- l" p# Y& v5 H! S& \: ?8 @/ w                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);1 c- j2 l& k% t- u
   if( hFile != INVALID_HANDLE_VALUE )0 p  J. P/ B3 b  |
   {- ]* O) x+ w: V( a# W) J8 f. m
      CloseHandle(hFile);# L7 S0 r0 l  ], ]& S8 }4 L
      return TRUE;
9 V+ E: z. o; G: J7 K9 E   }5 r+ i4 e! w2 h3 ?
   return FALSE;9 p) s& q6 ?: \, `/ N) Z8 P* d! S
}9 _0 b  Y6 G. d/ l: ]; Z0 b

' r; V0 M% |+ }+ dAlthough this trick calls the CreateFileA function, don't even expect to be/ T" C  Q: s9 @' w2 Q" R8 O/ Z
able to intercept it by installing a IFS hook: it will not work, no way!
3 X% h) G* ~9 pIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
) G# M4 T) I5 e  g* K. u/ ?# ~service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)4 V6 z3 O& W4 @0 c! M; B0 y
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
2 |" h. S0 x6 j: ^field.2 [' @" _6 ~4 M, s! [6 F/ e+ T. q
In fact, its purpose is not to load/unload VxDs but only to send a * U( o2 [; Z* r7 f/ L
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)! C. U+ t$ V( K0 G0 r. i5 T, s
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
8 v, Q1 W; r( T! v' zto load/unload a non-dynamically loadable driver such as SoftICE ;-).  W( I+ V  ?" r% T  d' F5 n, {
If the VxD is loaded, it will always clear eax and the Carry flag to allow
  `/ k1 B+ J5 F4 T* sits handle to be opened and then, will be detected.% U3 _7 [0 d4 u
You can check that simply by hooking Winice.exe control proc entry point. I& v) Z% ~2 l) o& J6 d" x( ^3 I9 `
while running MeltICE.8 ]7 F2 l$ W5 a& e/ R3 c

8 r$ P+ Z3 w8 h; o" U( Z8 H% h. x  F; [: B5 K
  00401067:  push      00402025    ; \\.\SICE
4 Z8 M8 S* b/ W7 ^9 G  0040106C:  call      CreateFileA
& \! e, k$ E- G  00401071:  cmp       eax,-001) j8 C& i& Y9 D8 E$ t0 z4 O9 x
  00401074:  je        00401091) K) j1 k# T. k+ O; Y

% f# u) Q; O+ J3 G8 n
  B! q; `& C  q. J( Y. Z( kThere could be hundreds of BPX you could use to detect this trick.
- L9 n; [7 ]7 d% W-The most classical one is:
. D, V9 R, M; i5 k+ v. F6 p  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
' M6 l& e0 s/ I& r) c    *(esp-&gt;4+4)=='NTIC'
" ?* A# {* s% t" A0 D- v* \( [8 ^1 x7 J* C( Z4 U( B: F
-The most exotic ones (could be very slooooow :-(
7 Q6 M7 @% ^8 K# E/ v9 I   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  
4 {, t( @  f5 M4 U     ;will break 3 times :-(' O; O6 j: Q, Q2 X* i! H  ]

  C$ j2 b9 `/ J( V5 s3 N* G5 n-or (a bit) faster: * J- b8 y: N( r; B
   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')7 G+ ?, _) N; n4 N. N6 ?) h
5 u* {* n2 b5 J' u) i
   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  9 I' L$ p+ R) h
     ;will break 3 times :-(
( f. O- q9 k0 U7 X! i- `0 @' N2 q( v) i* G$ ]8 `, i* c( Y
-Much faster:
" j4 ?) i5 q0 l8 m   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'
: j6 f! p9 o* T' ]* E+ N
( d+ L/ [+ h" sNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
& {7 Y, |! K* v5 Q+ O9 }function to do the same job:3 [9 z5 ?. G" v% o
, Y" S! \' M& ]- I8 d: r& ]# ~
   push    00                        ; OF_READ# N4 i4 x1 E8 o# A# z1 W0 v" c3 l
   mov     eax,[00656634]            ; '\\.\SICE',0$ D5 S. L( M3 `% ]# K/ L' D4 d3 e
   push    eax
% S, t/ \1 y3 a5 ~. d0 E4 ~   call    KERNEL32!_lopen
+ J3 V4 {# m. R% I   inc     eax/ R/ T5 X- X% F0 L4 E
   jnz     00650589                  ; detected
2 ]5 b9 x" \/ O9 {% w   push    00                        ; OF_READ
6 \1 d1 ]4 q4 b   mov     eax,[00656638]            ; '\\.\SICE': {# d8 H  y* u: B, `- p1 j
   push    eax3 f, V2 l1 c: Q% \
   call    KERNEL32!_lopen! M1 L9 Z6 Q3 e% z+ V; _+ a
   inc     eax  |% D9 N0 B0 t7 d, n9 e/ w
   jz      006505ae                  ; not detected# c% N! Z( m% ~9 R& A% P# |
- G3 t; k1 Q4 U7 I) U: C- G

  R3 L2 H3 F. A; |3 P__________________________________________________________________________. p8 c2 F1 E9 V1 d

5 k9 S. U& |4 D3 @: ?5 R, ZMethod 12
$ y: `8 A) w/ f1 p2 p* u" `=========
% C  ^5 ^+ ]/ N! _) w1 _/ D2 }- o7 X6 X. J4 b9 W
This trick is similar to int41h/4fh Debugger installation check (code 05
2 R" r- `) w1 l9 X4 b2 R&amp; 06) but very limited because it's only available for Win95/98 (not NT)
" y0 ~2 y6 S/ N) e% S" las it uses the VxDCall backdoor. This detection was found in Bleem Demo.8 K& }) Q1 K" O5 j: I/ i

0 G& i# t0 s5 s' _. f   push  0000004fh         ; function 4fh
* g4 S7 _1 _: J! j; q   push  002a002ah         ; high word specifies which VxD (VWIN32)
5 V8 |5 {; U( Y1 T4 [, f                           ; low word specifies which service5 V1 F( J' |  U6 d  ]: B
                             (VWIN32_Int41Dispatch)
- \' B6 q  A: h   call  Kernel32!ORD_001  ; VxdCall
3 C& Y; p; ]. v) n   cmp   ax, 0f386h        ; magic number returned by system debuggers
' f, ?! [# Q1 x- e+ G   jz    SoftICE_detected  h0 Q6 R9 h# m% r$ h9 s4 F( O2 t8 ~

  e' e% F# [* w& E% ?& THere again, several ways to detect it:8 Z8 K8 b( j( b, {( @6 G
5 }7 i( r# g1 U% H# J
    BPINT 41 if ax==4f
  C$ D% O  e+ m; H7 ~. k! r' \( L: m' W% ?
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one
8 Q3 f# Z4 z8 i$ d. T1 F
6 Y3 j: T2 t  [: J, S* o2 P. ^    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
5 S, t' R! L3 E, \! b! d6 q
& M" c; f9 D' r2 [, u    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!3 A& t! T# o# F; U" R! |
' K! @7 l2 |! |8 D) o
__________________________________________________________________________9 k1 W/ y) I8 ?4 m! n9 T

0 e$ y# }5 ^5 P+ Y8 }! A! L5 ~Method 13: A1 ~# x! ]& T8 y7 A0 i% \2 U! z
=========
- _: Q; P  S: u5 f
8 ?. A, Z. r9 qNot a real method of detection, but a good way to know if SoftICE is
2 r) {( `8 }; ?% k* dinstalled on a computer and to locate its installation directory.
9 g" T+ k* b7 p* \# [: TIt is used by few softs which access the following registry keys (usually #2) :- D0 e" @' j8 l6 V5 X# ?9 k7 p
1 Q& p9 y/ j9 X+ N) q+ m
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion; f' C5 V+ k* C; q/ H
\Uninstall\SoftICE
! E0 Y9 ], K. M- `2 \  {-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
0 K0 [! b2 Q7 a$ u-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion' t0 {. {9 K5 U8 Z9 y* g) b3 J( Z6 o
\App Paths\Loader32.Exe
6 ~+ Y$ M9 P8 w) T- F* J3 `# B& V+ I0 y# c' L' B- N1 H( \% C
& s5 w. K$ t6 K* n
Note that some nasty apps could then erase all files from SoftICE directory0 C3 w; a! u( M
(I faced that once :-(
" w6 U7 h/ P7 I5 f5 c* m9 w
/ Z6 u* h2 ~% n6 B" J% iUseful breakpoint to detect it:' E2 u8 K# y' A$ U: |$ W
( [# n* s' n% [3 c8 T
     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'3 G1 J5 Q% M2 O3 y) Y# h9 Y) [5 \9 b

) ~1 l" L0 d3 c& [: P__________________________________________________________________________
, _* V0 l) @. c1 d' g# D& f6 x; k. i6 A2 O: {, y& s1 ]4 f

# ~5 T8 r- ?( h: s$ v& A$ b- uMethod 14 : t: u1 K% c# a
=========: c5 j# Z6 T) u* G- `
: M  T% m& T. n" q- z
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose7 u  [$ V+ [# `6 E2 W
is to determines whether a debugger is running on your system (ring0 only).% O/ \1 h; s* E0 \

4 \' C+ q) m+ D* T/ o5 _4 K  \   VMMCall Test_Debug_Installed
( N( U" S& \1 ~. b% x) e   je      not_installed
# j& f/ N" |* G: L0 ~: P  y/ K; z# {0 t" d1 c3 i. C
This service just checks a flag.
* I  f2 [+ V& N</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-7-25 13:10

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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