About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
% e6 J; F( k' ~<TBODY>; A8 _2 d2 j: H
<TR>
, i$ {+ \5 p: o  q<TD><PRE>Method 01 ' A( l3 P8 B5 k$ v# F. e
=========
+ \  `( B- Q9 a+ y
8 F' L/ v; f$ eThis method of detection of SoftICE (as well as the following one) is
0 d9 r! I- l* h- M. c1 W4 Z( Bused by the majority of packers/encryptors found on Internet.
: _% ^7 q* l0 K# W* ^It seeks the signature of BoundsChecker in SoftICE
& F7 B3 a1 C/ t+ {& J9 J
* ]% p: `6 S0 f  g( H    mov     ebp, 04243484Bh        ; 'BCHK'6 S! E$ I8 H) J1 M: M) w
    mov     ax, 04h5 [; L# s5 z! G1 T
    int     3      
% h  {5 X' V# C6 {, {    cmp     al,48 y  n( ]/ V; z3 @( h* h  y  `% f: \
    jnz     SoftICE_Detected4 t# K- p, p" D" k- E0 k& g

3 M5 H4 s" E0 ]! I6 `___________________________________________________________________________1 _% |: P: x* y) x/ C% X
" S2 H3 g% p5 g' Z
Method 025 b( S) R! W2 x, |
=========! [) h+ `  Z  Q
8 Y* ]$ h4 b* g
Still a method very much used (perhaps the most frequent one).  It is used
3 @+ t/ @8 ~9 a7 Cto get SoftICE 'Back Door commands' which gives infos on Breakpoints,0 b) D" b2 U9 w9 c6 t
or execute SoftICE commands...
4 k5 U8 g  d9 n6 n& u0 H2 u2 f1 U2 N- x6 iIt is also used to crash SoftICE and to force it to execute any commands, W4 R  [, v$ X% a/ j# \4 X  t
(HBOOT...) :-((  : v- K) f& D4 T5 [" }1 [

1 |+ C* _  B! t/ O$ pHere is a quick description:
% U) N( w8 K% g8 ]$ {7 G* b$ l, X/ q-AX = 0910h   (Display string in SIce windows)
5 D* G# y- O8 m# E-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)
- I8 N1 @4 |! C) w, z3 a+ P9 K" ^-AX = 0912h   (Get breakpoint infos). o; H& \4 R- ]4 |' X& E; a% Z
-AX = 0913h   (Set Sice breakpoints)
* H5 L, ^4 A& _- y* H-AX = 0914h   (Remove SIce breakoints)' j$ G+ R5 {. r' t& n0 O, a

; k2 D( G" S6 P* q6 ?Each time you'll meet this trick, you'll see:
, D" ?6 R! o# [: n0 X8 e* e) C-SI = 4647h
6 g& ]+ r0 l+ _" C, p-DI = 4A4Dh
9 U( W9 U. Q+ V; @" d) nWhich are the 'magic values' used by SoftIce.9 }  O+ F- @& B( M  ]! a1 p
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
2 \7 T# C( ^& F1 G0 g) Y5 ~
) r. W% s5 v& S, O$ BHere is one example from the file "Haspinst.exe" which is the dongle HASP/ f. R7 j; D8 s, e  M. m
Envelope utility use to protect DOS applications:9 |) z3 K$ h, r' z* ~) x/ ]

# r, `6 J  u6 I+ i
5 p" f5 Z1 T2 w3 l  l2 _4C19:0095   MOV    AX,0911  ; execute command.+ p0 f( S0 G6 e0 ?
4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
: A9 Z& S7 c5 l- r2 V8 r4C19:009A   MOV    SI,4647  ; 1st magic value., Y+ g. W- F3 D% }7 V+ p; o0 i9 }+ h
4C19:009D   MOV    DI,4A4D  ; 2nd magic value." o. l& A% M7 {0 E7 |# R; R
4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
  t' h0 i, }) k" L6 p4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute
6 r4 g/ d7 L' {; H" o- I4C19:00A4   INC    CX' j- q9 n. D: A" Z  q6 S; o
4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute
' _# ^' B# L# J  l# q4C19:00A8   JB     0095     ; 6 different commands.6 A5 y7 w2 ]( i( _8 [) E7 y2 G9 z+ i
4C19:00AA   JMP    0002     ; Bad_Guy jmp back., m, K$ }4 l- K2 H
4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)
% v7 C4 U# y6 R" ]" f3 F& |! u/ o, B: x7 w
The program will execute 6 different SIce commands located at ds:dx, which
1 a, ~4 p% ^$ q1 n( A" j/ N, Care: LDT, IDT, GDT, TSS, RS, and ...HBOOT.. g' \  Z) d% X: S) w

  ~: ]2 k% R. j4 T& A* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.; p& R1 R9 W0 k5 `
___________________________________________________________________________6 }/ B. r% U, d' E; o2 a
" [( A; N8 @8 \7 S: Q
* o! P! T* h- |  B
Method 03
+ V9 }9 |+ p9 b& W7 d=========! J8 ]3 D+ H8 g! t

6 V( C3 W4 |' d' I  TLess used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
! ^  V' ~( Z5 S1 x& d(API Get entry point)
9 q* e2 L# t3 e4 B3 p6 _: O        , ]' E9 [/ h" u: r: {( [% b, A
. E( s# G0 i9 p! W; S$ ]
    xor     di,di* O6 d0 i' v; M, I- s
    mov     es,di
; i4 ?+ L: J. D; z/ G5 B    mov     ax, 1684h      
7 W( s1 e1 F# ^- T1 h1 c1 d    mov     bx, 0202h       ; VxD ID of winice
8 f% d1 q% A. W    int     2Fh
9 h7 h3 z7 k% A' u    mov     ax, es          ; ES:DI -&gt; VxD API entry point" v) u2 ?  Z8 o4 [( ^% F" ^2 }$ e" o
    add     ax, di
) z- x: i7 D0 _' ]+ O1 o3 J    test    ax,ax
9 Y3 I, H7 P' _8 A' ~% s    jnz     SoftICE_Detected
& n: O+ W1 y6 L3 w8 k9 ?& n9 g3 b% ]8 I8 i* E3 o0 b4 R
___________________________________________________________________________$ P& y: j- _- y. Z7 \. Q0 n* X) |
* C4 u9 u4 t9 M( ~- |
Method 04
4 S7 }0 y! H" K7 P* Y7 c9 g: I  f2 O+ O* }=========
- b$ V/ |+ K1 C" \8 x3 h. l, y- d4 f3 Q# y; N/ V4 z7 L& y
Method identical to the preceding one except that it seeks the ID of SoftICE
- k% l, \. f6 Z1 [, n0 G- RGFX VxD.
5 d2 b9 r+ [+ @% u' f. u0 b
( K& c' ~  w' L* J    xor     di,di  `" l0 y4 {& K$ k5 L
    mov     es,di3 g. l, b% p& Q
    mov     ax, 1684h       ) W( S2 t+ y: i" N9 r7 O
    mov     bx, 7a5Fh       ; VxD ID of SIWVID' O: K/ n5 ^# j  F4 B
    int     2fh
' K9 o8 `5 z" F    mov     ax, es          ; ES:DI -&gt; VxD API entry point, f. d. k9 N3 r4 \) x
    add     ax, di, @" q0 S. V! G3 G4 U
    test    ax,ax
2 k& V& S0 ]9 S: E4 d+ M- Q    jnz     SoftICE_Detected
" d3 B% v* _2 o) H8 M) [; d6 h0 K9 @) C# z6 ?' ?5 A! U) l
__________________________________________________________________________
$ _4 v( l5 f" I2 ~+ L( ?; g: E1 G: y9 \- A* U8 n9 h
6 |2 A& u" f( g' v# j$ H; A
Method 05
$ e. `, ~* v  Q, C( \% m7 k: Q=========1 K* [5 b1 d% j! b5 p

' j6 P5 m4 ]* G. ^& Z- yMethod seeking the 'magic number' 0F386h returned (in ax) by all system9 ]8 h1 p$ Z) K2 ]% R7 ^
debugger. It calls the int 41h, function 4Fh.- n+ l* l! N9 i8 B
There are several alternatives.  
6 E( j2 {; L" U# a- w" ~$ a1 `4 ~  i& Q9 P+ G
The following one is the simplest:
3 ?) y. S5 t. t% W; E. C  W  u& w( z9 k9 S
    mov     ax,4fh
* p% g; c+ D/ S+ q- {2 k- X! }9 j% b$ A    int     41h
' ~4 b( P  I8 S2 A' N    cmp     ax, 0F386
5 N! W* t: r* L( }' {) e    jz      SoftICE_detected
4 X( m4 T' a' n7 N6 t8 [& P# \# D4 W; q

, ^8 U  H1 d; ?2 V1 R: m: u$ p, GNext method as well as the following one are 2 examples from Stone's
9 U. @/ w( O2 i# N; O"stn-wid.zip" (www.cracking.net):
" `! R# M! O3 l" x; w, f; `, l; T. Z" U3 c
    mov     bx, cs
$ w' f: ^; s5 s0 z5 b9 |    lea     dx, int41handler2
% T8 a0 ^  F. F& u    xchg    dx, es:[41h*4]) M. X4 m0 M- A3 _1 U
    xchg    bx, es:[41h*4+2]9 ?* T* M8 R* ?' W' }+ G
    mov     ax,4fh
4 ?, i' ]: _% d/ W! e    int     41h8 m/ e" p& k' Y9 W2 ~6 i
    xchg    dx, es:[41h*4]7 z( \; x; i' k6 @' m
    xchg    bx, es:[41h*4+2]
2 u0 ~* a% W* J4 u# h# r9 X8 f    cmp     ax, 0f386h; m$ R. S1 V1 }+ ^# ?
    jz      SoftICE_detected
- A; ~+ W/ o2 j/ I& \" B) ~& k* Q. F4 w* h
int41handler2 PROC% l9 D6 c* Y1 L3 j7 Q
    iret0 v9 t& z+ _% v2 X' C3 q
int41handler2 ENDP  d2 Z4 r& K/ [

1 ~2 O+ Y' n1 g
" U5 d$ }) k2 a7 }_________________________________________________________________________
( B  h2 k! {6 j: a' L9 s+ M5 Z5 g, Q8 Y4 }$ Q9 G

3 T& F! S" s5 K- K! f1 HMethod 06
- q2 `  y' X6 u. K$ P6 D=========
/ |# b: n6 Z- E7 w/ @4 L  [3 D% ]5 x7 W3 d0 u# R% G; E9 ^

1 ]7 c. F8 i8 a/ {: L2nd method similar to the preceding one but more difficult to detect:
9 m9 d" C1 R5 j
0 Y" C$ ^4 j, e, H; a; z: d! p. B/ [+ R+ D
int41handler PROC
9 _' D: r$ j5 [2 L9 A. E- d    mov     cl,al$ `3 H9 ~) q+ J7 o
    iret
2 W7 K" W* |. q# T: cint41handler ENDP
$ I# _  [' b6 x& q, N4 {0 L. \- z6 m) x& E
1 p! k1 z2 v3 S1 m
    xor     ax,ax
; X; _5 z2 t% [9 Q2 w& Y0 w    mov     es,ax1 U' O9 e7 Y0 _4 [
    mov     bx, cs5 I% D  C' ^' P+ ~
    lea     dx, int41handler! l! ^) w1 x* Q9 [
    xchg    dx, es:[41h*4]
1 H' y# R2 \8 v6 F5 n0 ?    xchg    bx, es:[41h*4+2]
3 `+ _2 n$ m2 W) v% K8 e3 v4 k    in      al, 40h0 B2 k2 Q: a% t6 [/ S2 j: z* s7 `' h
    xor     cx,cx  p: I9 N& x5 P# w9 H
    int     41h% {% I7 ]" G" k4 B. ~
    xchg    dx, es:[41h*4]6 N, P6 P( F) w: D
    xchg    bx, es:[41h*4+2]+ N5 V7 z0 D- Y. U. q, v3 N
    cmp     cl,al! N- [7 I2 z4 S
    jnz     SoftICE_detected
: @8 o, l6 u# H; ^1 t: m* e" _3 C$ c  c( P4 F" |0 l# o  O$ y
_________________________________________________________________________- ?' c6 c8 d" H4 ]+ O

' ?; ~5 D& ~! Y2 z; I1 k5 PMethod 077 V5 B* L) e; v
=========1 x1 F/ z" e) r% X1 u! S
* a. p& [& F2 {
Method of detection of the WinICE handler in the int68h (V86)$ K( T) D- J! o4 m

4 l# T( }# w$ J, P/ p; |    mov     ah,43h
- P. T* r0 c# ^1 b    int     68h+ `9 U9 p( Z4 G; Y
    cmp     ax,0F386h$ ?) _4 J+ M* x) {
    jz      SoftICE_Detected
8 R5 f: _) r3 \! ]) g) L7 q) ~$ f7 `* A$ f: f3 K5 \5 x

0 G" Z" `! z. f3 M=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit6 o# |4 Y; P) ?% ^, ?
   app like this:& y5 p, j+ v4 w7 b0 J

+ c9 t2 N! z; u   BPX exec_int if ax==68" w+ S: p7 ^2 h( e4 g, N
   (function called is located at byte ptr [ebp+1Dh] and client eip is
6 y5 r7 w4 B' ?# {1 w   located at [ebp+48h] for 32Bit apps)6 i0 \/ S+ O' x+ c; L7 \
__________________________________________________________________________' u$ |3 \" X7 r- T% b; }
4 k& b8 M8 l# Y2 v3 Q
: ^) l# E" q: G- H" ?  t7 Q8 J& c
Method 08
4 I+ f# _. A+ a9 x) K=========
. k0 I- B. N4 f7 v; b
9 b* J: P( u1 D/ q* }$ S+ w1 `It is not a method of detection of SoftICE but a possibility to crash the
, Q8 S3 I5 K5 E1 e. [! Qsystem by intercepting int 01h and int 03h and redirecting them to another# f( s3 ?8 q# T" D
routine.
% G8 p+ A4 _. A  |It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points4 N) D9 y6 C. @, A9 ?$ n
to the new routine to execute (hangs computer...)
7 e0 G. P0 j( t2 H1 B/ a( A. \, h- u6 u; H% V
    mov     ah, 25h
; A5 L+ f9 y( P5 g4 n/ S    mov     al, Int_Number (01h or 03h)
4 G$ Y4 C6 d7 e8 t1 n, L7 X% G  I5 b    mov     dx, offset New_Int_Routine
# }. V# y1 r' `5 V0 N  `    int     21h% \9 O( k; s, X
6 U' i- T9 K7 A$ f+ ^
__________________________________________________________________________: E  Q7 a. }0 W& ^# `

* k/ W( |' V4 }9 ~, W6 V; `3 ^5 z0 j+ cMethod 09
3 b" \7 t7 T; R=========8 d7 F3 P! v2 R2 H4 F
  S1 \( s# B( o1 g
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
7 [# y2 S( F# wperformed in ring0 (VxD or a ring3 app using the VxdCall).4 W. c- i: K) @+ R
The Get_DDB service is used to determine whether or not a VxD is installed7 @3 b$ J# S) v: I& A
for the specified device and returns a Device Description Block (in ecx) for6 O  T, U/ W5 K# g0 M/ B
that device if it is installed.
0 x) \0 D2 U, S7 {% B* v; G/ _( ?
# K* ~- y! C3 V) P) D# G) D   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID4 Y1 J9 a  N8 d. d  k
   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)8 S6 q6 J5 x- u$ g& b0 J, y
   VMMCall Get_DDB
0 S: h2 S. V* c6 k' `$ y0 N3 L   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed
6 Z! D- v9 y" U+ |' d: n4 N( {8 E, r6 p" y( E! |" Y( |
Note as well that you can easily detect this method with SoftICE:
( T- z  U6 i3 R# G. w   bpx Get_DDB if ax==0202 || ax==7a5fh! T, |0 \3 y  v4 i  n( H
! u3 g( Q+ s. T9 z( \- o" J, r
__________________________________________________________________________" q* j2 o+ i, r1 m/ N7 _% {

, r' P# h0 o' Z1 S% L$ m* q0 DMethod 10
! Z. Z: ]; G3 m% \=========0 b7 z0 N" i- Z. R
4 _, N+ P0 m  y/ Z3 t% q; I
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with
$ m" S4 b0 ~6 L& c5 T  SoftICE while the option is enable!!
2 k8 `7 w" u* N3 t2 [/ s3 h6 d5 s# d' V. X/ Z; r
This trick is very efficient:
7 p# P" c7 h* ~: ^# S8 dby checking the Debug Registers, you can detect if SoftICE is loaded
; T4 N. `, ~0 B) ]+ H2 F/ C(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
2 r# V* l. r" v& j2 @# M7 Z( t5 F1 pthere are some memory breakpoints set (dr0 to dr3) simply by reading their
7 h% Y! C' r7 I8 _value (in ring0 only). Values can be manipulated and or changed as well* Z! F/ W: ]9 j8 }) X
(clearing BPMs for instance)% R; _* C& l  m  M. y# r7 O( w

5 c. G* }+ s' p1 N, E__________________________________________________________________________$ p7 ]6 C9 o' \
5 I+ m' f" H4 n1 ^* k# O) \
Method 11' b2 y  H8 ]& X4 u% o, q
=========0 {5 R7 c' n' h7 x

  V6 X8 @- Y$ p3 `$ GThis method is most known as 'MeltICE' because it has been freely distributed
! Y. }5 _- K. y; G* i- @via www.winfiles.com. However it was first used by NuMega people to allow
# }. v' Q5 U5 qSymbol Loader to check if SoftICE was active or not (the code is located
: `% N1 x: [$ I" c/ t# L9 [inside nmtrans.dll).. ?1 G/ g3 U8 @! l
& e! g0 F. s% X
The way it works is very simple:
% o2 J. g# g6 z; ^7 h( V/ MIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for) d) X' B. B* c
WinNT) with the CreateFileA API.+ }7 x5 R$ C0 ]
# t: e- }; H* B" \2 t& X0 F, ^6 M- f
Here is a sample (checking for 'SICE'):
) d0 `2 p8 G  h  F
5 x/ i# R% ^7 z1 v/ hBOOL IsSoftIce95Loaded()
5 [. }8 j3 l0 i: }( F- F5 u{3 m1 Z- w! r8 _, Z+ c
   HANDLE hFile;  9 w+ J0 R" [! s# i. {& l) c
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
9 A. g# R, U1 r: G9 k; m* P                      FILE_SHARE_READ | FILE_SHARE_WRITE,, H* Z- c/ V" C
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
( }8 W0 W$ }- I/ S  ?$ \' A. |3 F  _   if( hFile != INVALID_HANDLE_VALUE )- f  f( [- j! p# P
   {5 Y7 Z( X" A. P1 s+ L$ t
      CloseHandle(hFile);( i" n$ U% c) J( M" {0 V
      return TRUE;2 {# n# y) k% Q. s" Y
   }, g- p" K! ], U; I  Z0 M: h$ p
   return FALSE;
" M9 M" H! T3 R6 N5 s' A7 Z}, `1 s' y) T5 \) h/ j3 B0 Z" L9 z

. t4 O3 @3 r7 O$ B( R! NAlthough this trick calls the CreateFileA function, don't even expect to be
3 f) k5 ~: X: g& N3 B! e/ E, eable to intercept it by installing a IFS hook: it will not work, no way!
5 p3 W" @7 |! w0 LIn fact, after the call to CreateFileA it will get through VWIN32 0x001F& q# D2 |8 ^3 b& @, J9 p8 A
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)0 ^1 b, o& W# J8 e3 x' b8 X4 T% c
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
; V3 C" W9 r; E* N6 x' W4 D" Bfield.
, @- ~2 R. k9 oIn fact, its purpose is not to load/unload VxDs but only to send a ' @; t& V$ S$ ~' ?' t8 s
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
- O0 J: S; ]! M" H8 [" F9 t& D( ^to the VxD Control_Dispatch proc (how the hell a shareware soft could try
, i! X! H- W3 H$ D7 fto load/unload a non-dynamically loadable driver such as SoftICE ;-).
4 [' ]4 ~) s* k( L1 bIf the VxD is loaded, it will always clear eax and the Carry flag to allow0 @+ _7 E$ O& V1 x0 x
its handle to be opened and then, will be detected.$ L) J  U- j8 `1 b, W, ^
You can check that simply by hooking Winice.exe control proc entry point
2 ]3 q3 f4 f5 [& ]- Uwhile running MeltICE.# Y, d; g) q# B, S1 v( g

0 k# c7 N6 z9 F" t+ [5 M$ W
- D: W! b" r# l5 t/ F, m+ t# Z  00401067:  push      00402025    ; \\.\SICE6 ^" x. W5 X$ L; [  v5 N
  0040106C:  call      CreateFileA
$ c5 D2 d3 {* N8 h  00401071:  cmp       eax,-001; b6 q; X3 B: X2 M, l4 D/ x
  00401074:  je        00401091
7 G3 a- E' h- M- r" b% z
- b1 w+ ?" A* i3 C; v4 g
$ f0 ?) A( }+ h, Q2 bThere could be hundreds of BPX you could use to detect this trick.* M7 [2 @+ P9 e$ A, o+ h
-The most classical one is:
& N% P. p% @/ ^& b  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||8 y5 Z- A, |7 {* X3 H
    *(esp-&gt;4+4)=='NTIC'
6 L5 `$ |, T$ Q$ G( O( h
% P0 m6 |2 k( {  e-The most exotic ones (could be very slooooow :-(& U  q' W( u; q% F- A
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  ( S7 o  q4 X" n7 H! w& V
     ;will break 3 times :-(
$ p' t& _: q: A2 S
' q1 ~. A/ S& _-or (a bit) faster:
* g! L: |5 A4 v6 v+ T) |   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
! p% a) {7 G5 h
1 S4 f1 N& |+ I   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  
7 ~6 d2 D/ r: I  w8 U! U     ;will break 3 times :-(2 _# T$ R- p+ B' ]3 V; T

# A9 ^5 I; ~. ]8 M, A2 D-Much faster:9 Q1 o3 b) v" d/ C7 @4 K& J" j3 C
   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'
/ A0 ^/ x9 [" P4 u" I+ K# ]0 \* @9 k
: [6 r- V; L: U/ K) DNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
9 w9 _" m$ |: j# X( ffunction to do the same job:1 S6 j, `: o/ M. p2 Y' G2 B9 V4 g1 ^9 J
2 f" C$ v) Q! ]# c0 V, G+ F
   push    00                        ; OF_READ
. ~# \& i* P3 {( f( \. ^# R   mov     eax,[00656634]            ; '\\.\SICE',0
' n& G4 {: Y6 F- s- ?" n   push    eax% v% f3 N7 A! u* P! u
   call    KERNEL32!_lopen; h' }7 h3 v: n8 j2 U8 E
   inc     eax
; @4 b& H0 z6 N$ j* t, a   jnz     00650589                  ; detected$ a1 \* @  B2 p, ?5 T
   push    00                        ; OF_READ
1 M+ D8 g3 |8 J# b) z% h   mov     eax,[00656638]            ; '\\.\SICE'9 y+ C1 ?8 r$ {7 [% `* Y! @9 [- ?, x
   push    eax
$ S# Q6 c7 d! z! h) t   call    KERNEL32!_lopen
4 s( t1 h, o" f9 H   inc     eax6 |' W. `5 u' C
   jz      006505ae                  ; not detected5 ~2 X; G' ]$ {3 A# O

+ A" O! N+ @$ ]+ z' y( e
6 \$ y) P5 p% u4 R' ^__________________________________________________________________________2 \" |4 R5 c" T0 L5 a" ]
+ Z' g8 v* T. _$ B; Q) L
Method 12" ?( `) d& D$ ]
=========# N4 W# o; e$ U9 C) d; u: I: Y% x
* e2 }3 {) j7 b
This trick is similar to int41h/4fh Debugger installation check (code 05
4 h+ c( `$ w. E" P. e&amp; 06) but very limited because it's only available for Win95/98 (not NT)
) U% ~. A0 `9 a3 nas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
% |! o9 C) ]- R( [4 t' B9 L/ _8 V8 s% H1 |; U% {
   push  0000004fh         ; function 4fh
" F' x  a* V3 o. m6 p2 w   push  002a002ah         ; high word specifies which VxD (VWIN32)! j! F: M& k; {  c, H
                           ; low word specifies which service6 V, t5 K& N+ l
                             (VWIN32_Int41Dispatch)
1 l, Z, j7 ~1 A1 W   call  Kernel32!ORD_001  ; VxdCall
) ]* g! W  A8 L4 a+ E; b   cmp   ax, 0f386h        ; magic number returned by system debuggers7 d) v2 f" a: ^8 G" d
   jz    SoftICE_detected
1 s) p( z% K0 w3 R# k
4 ?4 F2 U$ \! R/ O: SHere again, several ways to detect it:1 V- `! o* L) T' L+ ~

) l# G( z+ h: }$ G    BPINT 41 if ax==4f
1 p! d' q* k$ N1 Y& I, \  [2 y  n3 M, F
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one
2 M) k* \$ M/ C* U
$ s+ \# B% [- A' o$ f$ X2 X0 [    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A+ n4 O  S, {0 b
: n. U6 u& t' Z0 X& v% S9 K
    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!
' n( W% c/ n) V. a/ G5 L
. w$ }- G3 B9 h6 Y/ c7 A__________________________________________________________________________- U  J4 a9 P! s  _# q9 G0 Z
8 I1 m+ Y) u8 u$ A
Method 13' {2 k3 F2 Q2 A' k
=========9 R. V8 u( A8 V7 S; q' j5 U* M

; K6 @" k. m- e) [Not a real method of detection, but a good way to know if SoftICE is* @! ]6 Q; N5 e* f( u2 ~
installed on a computer and to locate its installation directory.. S& x& T* m; g& r
It is used by few softs which access the following registry keys (usually #2) :1 K0 R/ T( s+ O5 O+ D& g
( {7 c8 D' Y/ P  M) z
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion6 F; I" ^, W) i0 w
\Uninstall\SoftICE
( `0 K2 o; Z! L/ d1 k3 \-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
1 ?- T- B! G' P7 x4 Z4 R-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion  a& i+ M2 B/ l# J
\App Paths\Loader32.Exe
" b! D) S1 E5 l. t6 a; Q7 ?6 N) x" n% v# r# p# P
, H: a! L8 O+ u' ~* b/ Q
Note that some nasty apps could then erase all files from SoftICE directory- a3 J: _) g5 a( m
(I faced that once :-(. A: D$ I7 F' `& ]3 A

: R  {  q; P6 Z4 c7 _3 z: |Useful breakpoint to detect it:
$ L" E. A  C; m& o6 D6 I& A4 |. R; x/ Y- Y3 v
     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
/ B1 x& ?3 g$ D) y7 W: Z6 f8 \8 P, j
5 F; P  k/ H6 A/ b__________________________________________________________________________/ v6 m, Q) k8 r# z; U
; J& c0 L* A: }3 R; N/ |
3 y: S- J5 R( y4 @7 d, X3 g! P
Method 14
6 a+ f8 p* x# ?0 {=========
5 [' d3 n) X9 W2 D" r+ C
" _  f. b' I. ]1 S! M9 @A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
5 W' F" H# k9 [" Xis to determines whether a debugger is running on your system (ring0 only).
  D7 K7 k( U" J2 g" D5 [: D3 Q
2 N8 B+ L0 g5 v   VMMCall Test_Debug_Installed7 g, q) M7 d% t. u+ _
   je      not_installed1 U  W" N- ^" w, u+ O

2 g- T2 I# u4 c/ G. C. qThis service just checks a flag.% L; H$ ?0 X! J) o: [0 @9 a
</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关注公众号

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

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

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