About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
7 W. l$ F% _7 S5 w; m<TBODY>1 \9 d8 Z8 K' L! T3 d
<TR>
/ J/ h# D% L6 J9 |8 f<TD><PRE>Method 01 " D* d! Y% u& Q: C5 W) }5 A
=========
. C  G1 R. Q/ {% k% _$ D* Z
2 Y6 |. \  ~, k2 j/ nThis method of detection of SoftICE (as well as the following one) is
  y, i: r5 v+ P6 O  Y1 sused by the majority of packers/encryptors found on Internet.4 u& H" {/ B1 n) b' m, h2 q
It seeks the signature of BoundsChecker in SoftICE
. Q3 G) |% ^5 C8 x& m: x, x$ o2 P5 f* I. z
    mov     ebp, 04243484Bh        ; 'BCHK'
! y: x. N( S1 \5 y, h4 U    mov     ax, 04h
4 \! V/ P! D% s& \    int     3      
% o6 V: F8 x/ g' Q* g# g! O    cmp     al,4
4 t# d: y7 Y- H1 s! }6 P& i; e    jnz     SoftICE_Detected+ w, u. ~3 U  `2 R: Q3 Y

( Z/ B1 d; z) X3 V! s7 O___________________________________________________________________________" P( V% ^/ Z) Q5 H8 m! S

$ E# V! b6 s; G# P! b1 _$ A) S' v: {3 ~Method 02
* T" J) H4 I8 j8 A* \2 \/ T=========
% T3 T  S; E- L5 l! o2 e  ^8 [+ d
Still a method very much used (perhaps the most frequent one).  It is used  R: H- h$ |* c
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,- J# o2 _4 S( H& d# D% K* [
or execute SoftICE commands...8 `7 ], Y, \5 `+ z% a8 {
It is also used to crash SoftICE and to force it to execute any commands6 P! Q, X! ?7 o
(HBOOT...) :-((  
/ d1 f0 k# T4 |, y/ Q  |) j' k0 K; B* f7 p0 h0 d
Here is a quick description:1 M/ J; v/ I# y3 F7 I( {
-AX = 0910h   (Display string in SIce windows)' C: Y; ^; `8 [; x4 T7 N( U
-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)* P8 z  z% L( t6 J- A* E5 G% p
-AX = 0912h   (Get breakpoint infos)2 T; g3 b8 c3 Q
-AX = 0913h   (Set Sice breakpoints)6 R; B$ e6 Y; ~8 r( w8 B/ Z
-AX = 0914h   (Remove SIce breakoints)
' _! i& j! G" j  K
2 Y6 K1 v0 u6 I' A* P- T- EEach time you'll meet this trick, you'll see:, i$ h/ t2 k# `* C  M
-SI = 4647h
* c9 ?0 Y8 I2 b* O* Z: H5 e-DI = 4A4Dh& e0 X+ n' ?& a
Which are the 'magic values' used by SoftIce.
* J7 Y) @8 q5 O0 x+ e" J6 u5 IFor more informations, see "Ralf Brown Interrupt list" chapter int 03h." X$ O# `, i9 |9 V8 e+ x1 R4 i/ }
! u- j4 e5 X5 `; ?( f) I# Y$ _7 y
Here is one example from the file "Haspinst.exe" which is the dongle HASP" T8 }' \. C9 P; X
Envelope utility use to protect DOS applications:
9 l0 b& a$ ]/ X
3 s9 o% L. n4 C. R) W
. Z% m+ B. n  h& r2 ]4C19:0095   MOV    AX,0911  ; execute command.. c& Y4 j' G, O7 a" j  k7 J' P5 C6 f
4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below)./ b- q1 k! {7 J
4C19:009A   MOV    SI,4647  ; 1st magic value." [3 _3 \  \( ?4 [6 f
4C19:009D   MOV    DI,4A4D  ; 2nd magic value.( F  ]. \; C$ {0 ?. J
4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
9 G1 b$ f& p, B4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute0 L9 x5 W# c0 L% R, c; ]1 ^# a3 E. F1 R
4C19:00A4   INC    CX2 H6 J0 f7 v. d* y% q' @1 _. D
4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute5 @6 M( y# F/ b$ r
4C19:00A8   JB     0095     ; 6 different commands.7 _. v+ m5 F3 y8 w) u6 A
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
1 N6 ~4 P- O7 T+ y, ^4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)# H$ v6 X/ t' `2 q- L+ S
- i8 n- [  y$ y- s
The program will execute 6 different SIce commands located at ds:dx, which9 l5 i$ j% d- |' m" P9 w1 |
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.) X1 p$ r# R! k! ~$ }
  w/ a  p2 r5 Q  C7 B+ Q. O
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
# R4 s) y% P: o" ]3 Y# F2 M___________________________________________________________________________2 _0 ~% L+ l/ O) B& v1 E' c# y1 W

5 G0 M( H6 e# D- \( {2 j7 K+ Y& U
Method 03& ?, \0 z: Y  q! T# k) u
=========+ v* \0 J! c- l7 E# \
. e$ X4 W1 \$ B( c0 S6 M
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
' B' _, k8 Z' ?$ H0 f# P- a! n% w(API Get entry point)/ o+ f6 X; b* q
        
0 F* |4 N2 _. C4 v- G# t
) j  X  l' R7 U& f    xor     di,di
8 W  z6 v2 j" l7 B# t    mov     es,di
/ V. C8 q( i7 R% o, Q- A& Q/ F    mov     ax, 1684h      
1 t3 o- s6 |: c' T& g5 y    mov     bx, 0202h       ; VxD ID of winice
  |6 Z  |! k2 \9 x0 s9 G  H    int     2Fh
  I  u  O& N# ?5 g( W    mov     ax, es          ; ES:DI -&gt; VxD API entry point. Q+ n# ~+ z. _' q! |
    add     ax, di; N- w7 ~' h1 \: H* S1 x2 J; o& x
    test    ax,ax
( X5 r) a5 r0 b5 z    jnz     SoftICE_Detected8 v1 O7 O, ?2 M5 @! E% o4 U; [& m
! G) g  p) ]. H
___________________________________________________________________________- Y6 k7 Q5 a. o
7 h" g3 L8 j& }; d( H
Method 04
1 O# e: G3 }3 C" y+ g& G=========: [, Y7 n% a. Y* K" A+ t% s  W
: N7 W0 }2 j- U& M3 U
Method identical to the preceding one except that it seeks the ID of SoftICE
; g, M3 {' m( x( RGFX VxD., i! ]; B6 B" Y. D
6 e, I9 K# s/ }
    xor     di,di
+ o: K* r% }* o8 A) R    mov     es,di
5 ]* l8 S' ]$ |0 @    mov     ax, 1684h      
, t) o7 H8 c. `4 Q6 h    mov     bx, 7a5Fh       ; VxD ID of SIWVID# o3 I& ~- D3 g1 C
    int     2fh$ m: B$ Z1 ?4 D, E( @0 Y, c7 {$ e  n5 d
    mov     ax, es          ; ES:DI -&gt; VxD API entry point# z& ?: K6 h) M2 e! h
    add     ax, di9 Z1 Y- a' T2 u4 @
    test    ax,ax- L/ {) o/ g! Z% O- \: C0 _
    jnz     SoftICE_Detected) q. R" z7 I; ]5 C; I9 B

/ ?9 m3 F# j' |- @__________________________________________________________________________: n0 f" N  c. R1 ^8 [1 i* B4 t
; y: Z8 I7 h7 ^* w9 T" y7 P- F

' ^* }: b- g! q3 x+ fMethod 05" z9 k* w# J- O8 z
=========6 I! t- j" @) T, U9 {1 ?

7 v7 V! D. |& d  Q7 r: n# x5 lMethod seeking the 'magic number' 0F386h returned (in ax) by all system1 Y5 p/ M4 i4 [% }
debugger. It calls the int 41h, function 4Fh.
' I$ V" Z$ [( [3 ~) W: u9 sThere are several alternatives.  ' X( P7 ^9 z% l) y; U
5 y) l6 r0 ?) x3 \
The following one is the simplest:
' Y: u0 p. c$ Y
, v; O" }) B4 |2 b) ^    mov     ax,4fh/ g# z  a$ r, N8 N; K8 {) K
    int     41h
4 v9 ~' i4 ~/ _7 ~- y. z6 Z, U. O+ O    cmp     ax, 0F3866 w! Q1 [% `, P% I1 Q2 l
    jz      SoftICE_detected
7 m! I. q9 [3 Z/ v# }: f
4 H2 I7 J: E0 \4 r8 k2 p2 a" S! A
Next method as well as the following one are 2 examples from Stone's
- T  y. b7 i. h3 |# k; M"stn-wid.zip" (www.cracking.net):% _3 ~1 D2 G: Q+ q1 S$ c/ a' G

9 K6 w. ]* r2 Z1 m; J) U; i, o    mov     bx, cs& i2 S" x; v# h2 M  M. i" h8 s
    lea     dx, int41handler2
# I3 m/ x5 T  l# E8 L$ w    xchg    dx, es:[41h*4]
! I0 B$ _7 b; C' O    xchg    bx, es:[41h*4+2]6 E8 o; b7 M5 q5 T
    mov     ax,4fh, i: u: W2 a- G3 Q, i$ P
    int     41h
( x" J* S: g! F& O2 O    xchg    dx, es:[41h*4]7 }1 m  O1 ?. c, M: A" b
    xchg    bx, es:[41h*4+2]
1 C0 }1 P+ L5 d6 \' l! I4 q/ ?    cmp     ax, 0f386h. L. K2 x% n- R" Q5 |. y2 y% a
    jz      SoftICE_detected
9 p1 m' ?- R% k& u" [& F) P$ h8 x( n: w" Q1 }7 \  g# c- L
int41handler2 PROC
1 u; u+ m& _6 U) ^    iret) Q* f+ j. O: Z- F1 w6 E" _
int41handler2 ENDP$ a/ w* r) }2 c* O4 j5 K& }
. Q9 h" [: U; ^& l) x6 N7 w

, ^. n: @3 C0 P3 f9 R2 ~_________________________________________________________________________
5 o' P9 j% h! S! I: p8 t5 @6 B' z3 C& m. v# X# Z

. p6 P" d4 H3 T, s; ^" iMethod 06, g- }! ]- K# ~2 F
=========
$ r) m/ E/ U2 c1 ]  m+ H* m2 C! n2 B" `# `) _

  ^0 h9 N8 Q' j2nd method similar to the preceding one but more difficult to detect:
" V3 m7 G; r* q
* N2 K8 Y4 r( W+ n- W7 h. k2 a$ j
int41handler PROC# x0 ~% r$ C) {$ f; i
    mov     cl,al
4 z5 I2 h4 S' e# m  f- `* q    iret
& G& B  ~& _9 V9 D$ y3 D, Fint41handler ENDP
3 W# C0 A6 `# N, ^  J" n! E6 l3 F  n. M$ x+ g+ {
! e) z, `% b3 b' V
    xor     ax,ax: _9 ~- V2 C4 U& n; T) `* @
    mov     es,ax! {4 T' D. }. {2 K# N
    mov     bx, cs
, b0 F7 ?3 D8 P% H! D# I    lea     dx, int41handler
+ F0 m8 G% O; l8 F. f. t5 t    xchg    dx, es:[41h*4]+ O' l) |/ {' b" ~7 ~0 l
    xchg    bx, es:[41h*4+2]
) e8 N8 G* F; Z' E8 j" ~    in      al, 40h' ]4 x- R3 K' p+ e3 ^, U7 L" Z) g
    xor     cx,cx5 E# E9 D1 }, s* F% e; s
    int     41h
4 E4 }- i& q( Y    xchg    dx, es:[41h*4]
. C, C% F6 ?6 X( R" w/ x6 F+ \    xchg    bx, es:[41h*4+2]
9 t+ G! d/ p9 M    cmp     cl,al
5 B- U7 P  C: |0 _8 X7 f    jnz     SoftICE_detected0 S* B2 p9 \. {1 e
  i- F% j6 m3 ~1 z9 F  d7 O1 b5 B. I1 b
_________________________________________________________________________
0 @6 |7 m5 |0 |9 b0 ?! v6 r  ~* n1 N* r+ V- |
Method 07- ?6 G: g3 ^- A8 X
=========" l8 q" n7 n* S
) F9 M! z! ?* K# |3 Q
Method of detection of the WinICE handler in the int68h (V86). |8 T! D+ c7 v' u1 ^9 u1 c

# k! i5 d/ t) D/ i5 D! ^    mov     ah,43h. K5 _  c. h0 X5 m* l8 R, I* _
    int     68h" x- v$ ~6 h. Q: r$ y% U
    cmp     ax,0F386h7 a. E. f; a' F3 f
    jz      SoftICE_Detected
  E, N# D3 F/ n: b* R8 I" f# S. c: |
$ n! P6 x: B+ M4 k7 s. e0 s
, f  P0 D( [& |5 @5 l=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit9 K7 x* j5 t1 e+ B; N
   app like this:
! g, L- Z9 f4 Q8 S
7 k/ v- A  D) A/ d& Y   BPX exec_int if ax==680 }9 j2 |) b  F9 R# L7 g6 w
   (function called is located at byte ptr [ebp+1Dh] and client eip is
! }- d  Z- a* h: N   located at [ebp+48h] for 32Bit apps)
2 w+ w: `2 [# u% I! [# k; v__________________________________________________________________________
6 A# A  O2 ~$ D0 c3 R
& T: D+ A/ ~& V
) V  B) p* C8 x0 _5 lMethod 088 i3 u- J' V- X
=========
; K" L! h6 D: o6 x
, i4 S) r. |7 U6 n2 c  a% MIt is not a method of detection of SoftICE but a possibility to crash the
9 z: ]! r0 }; A" G1 Ksystem by intercepting int 01h and int 03h and redirecting them to another8 L) x6 Z8 o* u9 \! \# o; m  c! |
routine.: o% ?1 v) ?& e1 O1 o9 [2 W
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points! d5 V3 p' _9 X: `# }6 ~
to the new routine to execute (hangs computer...); i* B. {; c$ c+ B# Y5 V" M

% Y: A( O* T/ S6 b$ \    mov     ah, 25h
* J6 T/ O2 w" \8 l2 n: m! F/ H* z    mov     al, Int_Number (01h or 03h)% @1 @9 g- S  {: x
    mov     dx, offset New_Int_Routine
4 {$ Q7 c/ p! i- Z, Q' \    int     21h2 |  q3 p5 q- B) X7 Q) ^! ]

% R! O5 ?0 j/ M8 n7 W  P; o( h0 ?__________________________________________________________________________. G. g9 Z8 Z6 @+ Z4 L( ~1 p
& q7 {1 E! E& {* z6 j
Method 09
  W/ u4 z5 q. p5 j1 t) c=========
: L9 ]" t& Y) E3 {& @
3 ?# L  \' O7 V1 rThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
# k* B% s9 i) i2 B5 a. G1 Nperformed in ring0 (VxD or a ring3 app using the VxdCall).9 e8 y; _, q- D! C5 `2 s
The Get_DDB service is used to determine whether or not a VxD is installed& ~6 ~, W, }2 r$ @) V+ e: J2 K
for the specified device and returns a Device Description Block (in ecx) for
" P  s' e2 P* S  Xthat device if it is installed.
1 O  g, ]5 \- H8 Y! A9 Z
, a8 r! p8 h$ M, {/ c9 l   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID
: ^: |: P+ b7 S' f   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
% c. g% a( C0 ^" B+ T# I) n# e& I) q   VMMCall Get_DDB) R1 n$ v2 G  }* m3 V
   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed" h: s8 E* v! \) N2 X$ C9 V1 F
6 b8 s: o8 p) u, j( ~& N
Note as well that you can easily detect this method with SoftICE:% A9 p, T% I- n6 d5 x6 }2 A0 u$ R
   bpx Get_DDB if ax==0202 || ax==7a5fh: R) t2 R, c- _" g+ U
2 l: H1 I' p+ a3 r% Z$ D  D# m4 P
__________________________________________________________________________9 t+ z; s. h: x$ n/ m
" z+ b9 F0 k" [2 j
Method 100 d- W& X6 U. p
=========
7 K" e- W8 ]$ e3 q6 O7 w2 a- X" R( V! u$ h) u- S( ^- _1 `# ~
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with' T9 t" w+ |( ^3 n* o6 m
  SoftICE while the option is enable!!
4 c# e  t/ s+ V+ _, F9 r7 i# q( e7 G( J8 Y6 }, E8 B
This trick is very efficient:
+ y0 D, s# _% C: M  }by checking the Debug Registers, you can detect if SoftICE is loaded7 P/ A1 J/ s: t( p. U! T6 O, u/ }" X
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
( j! L' j2 P& Kthere are some memory breakpoints set (dr0 to dr3) simply by reading their) E( b' A5 v' A5 I6 H8 s) a) C
value (in ring0 only). Values can be manipulated and or changed as well# b" B- Y4 ^! T9 J. G* A% L9 F
(clearing BPMs for instance)
$ R- H, ~% S# q3 k' U% X
9 J5 d7 N& |1 t' h__________________________________________________________________________
; M, l7 E1 K3 H0 y+ W# \- Y
/ c- v& D' E% Y$ ^8 BMethod 11- o( C+ p( l( F( Q) f2 b; x' A8 l
=========
/ b/ K* e, \' e/ C. j2 i$ s( \
This method is most known as 'MeltICE' because it has been freely distributed3 S+ s3 g' l8 \; P" f7 w
via www.winfiles.com. However it was first used by NuMega people to allow1 R0 b2 ]& v( _7 z, L. O# z5 O
Symbol Loader to check if SoftICE was active or not (the code is located
9 R# [" P2 A0 G' p3 X  b8 @+ j  X7 {inside nmtrans.dll).
5 d; q" u- f, [* N1 i3 v& t' z$ G; K7 A4 D9 x) @6 W( f& C3 V
The way it works is very simple:
" F, |/ p( E6 g  L1 Z4 hIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for! a( A* j8 @+ e4 P+ v
WinNT) with the CreateFileA API.1 r9 \' X, ~/ }9 r
- @, n% W& ]) [2 `0 N8 J+ v6 ^$ @
Here is a sample (checking for 'SICE'):! x; ~  Z, Z/ f* q) ?) {

! \% @- O1 M! i( C7 o8 h! L: x4 {& K& OBOOL IsSoftIce95Loaded()
* g" c8 |2 Y+ h$ A{  G3 s4 N9 F& E7 T9 D; a7 z) P3 P
   HANDLE hFile;  1 n  e; K6 q# p0 Y! _+ M7 X, z3 [
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
. d  c" W/ A- c' @' p3 ]& M                      FILE_SHARE_READ | FILE_SHARE_WRITE,
2 S4 S; [& n: |. \9 y" U8 d+ h                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
* |9 v# Y6 u/ u% t$ z   if( hFile != INVALID_HANDLE_VALUE )5 H0 T. M9 @2 L, ^; @1 O5 M
   {: u$ x3 N) Z: x1 T0 i. C; N( L
      CloseHandle(hFile);
0 j) {4 q( H7 r0 b6 k. C2 v/ F      return TRUE;1 T9 |7 {: T5 \( O
   }
- l' h" B, n, ^0 v1 Y! u   return FALSE;; |2 _( `5 V4 r  b2 `7 m
}
9 t4 A# y, N  w# h6 `2 w5 _" k; E% |+ W2 @) n' [% n+ a
Although this trick calls the CreateFileA function, don't even expect to be& c" _9 k1 Z# j0 G$ e
able to intercept it by installing a IFS hook: it will not work, no way!
% L9 \, u6 Q& l* @+ ]3 X7 g  KIn fact, after the call to CreateFileA it will get through VWIN32 0x001F- t7 M* D1 s3 z" R$ U
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
- y' [0 }# E. f& @5 [4 I2 h4 K' cand then browse the DDB list until it find the VxD and its DDB_Control_Proc$ H* p4 \3 g, T9 A' |, i
field.
5 l( j' r. I2 R% ]  M6 @/ {5 @1 wIn fact, its purpose is not to load/unload VxDs but only to send a
! P8 U- X, i1 j$ x( Q# EW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE); U7 o1 Y9 u9 S% z: ^+ s2 s% F. H
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
6 x6 j( ?1 O$ _/ Lto load/unload a non-dynamically loadable driver such as SoftICE ;-).( ?# J1 T) j3 {
If the VxD is loaded, it will always clear eax and the Carry flag to allow( {( x; J) k% r  c7 U3 e8 x- |
its handle to be opened and then, will be detected.
# q8 e) D1 _" R* hYou can check that simply by hooking Winice.exe control proc entry point
9 n7 T' d0 E, h4 K9 {; S9 _while running MeltICE.: e+ v! d8 P/ V6 F; d! e
' u* E1 Q+ P- g& t
1 U; C: ]5 `1 X
  00401067:  push      00402025    ; \\.\SICE$ b8 D& `4 ^  |. u
  0040106C:  call      CreateFileA
& R. M4 d7 i4 Z9 X+ s  00401071:  cmp       eax,-001
. c! _- @: j. {6 z7 d2 x& C* ^  00401074:  je        00401091
3 H1 I7 O) g( x9 w: V) _1 O6 w0 g$ h- S

8 m4 m) q# i* F/ ^/ |& aThere could be hundreds of BPX you could use to detect this trick.% h) B0 e3 s, C$ S$ p$ A
-The most classical one is:% l. D2 F. i: z2 k/ ^- U
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||6 y; ^4 r& C) K: W( l- O  w. @
    *(esp-&gt;4+4)=='NTIC': q4 [  }+ C! {; U

% r4 [! x/ T. ^, R# h-The most exotic ones (could be very slooooow :-(
+ N( X1 I# Z- ]3 D3 a* h" @5 N   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  % X0 ?+ r  D4 P7 l# [
     ;will break 3 times :-(
9 L* }* u8 d" [, B% r1 ?# V) C1 E8 w1 D9 T
-or (a bit) faster:
7 r$ j6 R: x1 Q/ }6 k3 Z3 ~   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
  z; [$ J$ _  \" E# h+ s5 ]/ {4 Z  I5 d  H% M
   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  $ W# R8 }& |4 B0 N2 b, P) Q0 e
     ;will break 3 times :-(
$ ?, q5 \& f2 I1 m6 @- w( C) Q/ l
+ f0 ]8 w0 M# U! d: P6 N" {/ O0 G-Much faster:
7 I5 D# w& W" i   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'
1 k7 C, w$ z: G2 |) E# w9 Z1 N* u& w* C9 g# `8 e
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
4 N5 r6 [4 a, K; j: Ffunction to do the same job:
7 c/ D% Z" u3 N8 g: [- T) L: h; Y# Q- y' k
   push    00                        ; OF_READ
, ]- K5 l2 d7 k# p! x0 q   mov     eax,[00656634]            ; '\\.\SICE',0
" \& n6 y8 s% u& d& T   push    eax
. H3 E* l1 i3 n; o+ E2 N" N   call    KERNEL32!_lopen- h' A3 t1 @1 [; m/ a5 M# c4 Q
   inc     eax
: `8 j' ?$ U- i1 B   jnz     00650589                  ; detected
9 e- g! K! [+ G) m. p* t( f, t   push    00                        ; OF_READ
4 N, T& P( J$ C& h8 g0 G# l: m3 m   mov     eax,[00656638]            ; '\\.\SICE'
& F7 ?8 y, i& f9 t: `   push    eax
  B! c2 I1 t% i+ y: r$ O   call    KERNEL32!_lopen$ I) B* G$ f' J  M  v4 }2 d3 N3 J
   inc     eax
& c6 X& L& ]4 g+ }   jz      006505ae                  ; not detected5 Y6 v& U) B9 b$ C" |
. D0 a0 A; E6 C5 a7 ?' p7 k
- g1 Y2 N5 I; M1 o( W# ~/ E
__________________________________________________________________________) }$ a/ B4 R/ N+ H+ C

4 V0 ]8 t# j, P" GMethod 128 [+ b4 |- Z6 m* z
=========5 s8 x0 `* Y$ `- x2 S
6 d! j0 n* @9 w
This trick is similar to int41h/4fh Debugger installation check (code 05
+ o5 `$ [; x/ S: Y, z9 f+ o+ Y% V&amp; 06) but very limited because it's only available for Win95/98 (not NT)
4 Z: Y6 O2 E+ w5 B" `3 W2 Ias it uses the VxDCall backdoor. This detection was found in Bleem Demo.
+ L6 ^- C; `. @- x8 a( p8 D! ~7 J3 a9 W1 f3 x2 [2 C
   push  0000004fh         ; function 4fh7 |3 B, [: F; r9 [' j( h
   push  002a002ah         ; high word specifies which VxD (VWIN32)& @2 ^8 ?( ?* j! B# T
                           ; low word specifies which service
  P( c! d) M. B2 j1 v. S                             (VWIN32_Int41Dispatch)5 `& C& o8 b# V- x/ d, n
   call  Kernel32!ORD_001  ; VxdCall
" R7 l/ N5 o3 e" `3 {) v   cmp   ax, 0f386h        ; magic number returned by system debuggers
: e+ V# \* V. N; u   jz    SoftICE_detected
' L( d1 _( a8 f. V
3 \( _+ ~. y, I. i8 `Here again, several ways to detect it:9 R9 m; |, |9 Z! S- o( G( a

- d( U& ~* h0 }- w4 O( E    BPINT 41 if ax==4f( o2 w! k3 ^( s0 e. A5 u: m; Y
+ P, Z) U, R/ I' u1 V6 t
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one# j+ P( X( R8 {% w6 F( g) }

/ e7 `; O  R! h# I" l    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
6 K* ^- g4 D- X; B9 f6 J' \% b
% i! J  h5 k8 y& _' d5 v. M    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!, \# a; l& ^4 v

  h! D+ f4 _8 [( W, [2 f0 F3 r& I__________________________________________________________________________7 P1 v& \$ C- `- l& D  v3 R

7 g$ W0 e9 h6 q9 |Method 13
* R$ ^# P+ c/ B=========6 U+ t' W1 D3 {- u& Q

( u4 H3 p& e/ Z8 y8 X; L% d" v  l- UNot a real method of detection, but a good way to know if SoftICE is
$ e# [0 D2 i$ g" I1 W2 ~installed on a computer and to locate its installation directory.
  @' f& Y& `; ~4 w* b2 H1 U& k3 hIt is used by few softs which access the following registry keys (usually #2) :
$ ?9 e2 Y1 s! o7 M- Z& c; ]0 d& B4 T4 U% o! @; B3 h0 l6 P9 p& R
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
# C" y5 n/ H3 ^$ N- z7 b  x! y\Uninstall\SoftICE
+ W0 X/ e+ `, n2 H' X-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE! N/ H3 m6 [' b5 B3 \
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
3 B* _6 ~7 j  F' \* c\App Paths\Loader32.Exe8 F5 K. v) a  s4 \) J; J: S1 ]

, V0 _* L4 H/ p( L6 r- b
: d8 e* K4 x+ F( `: XNote that some nasty apps could then erase all files from SoftICE directory& y+ x% p2 }& E
(I faced that once :-(9 B' o6 m6 k0 Z1 O
: D1 w# A  W2 K# V( L' N
Useful breakpoint to detect it:) L. @  T! S% c8 R8 Q$ x9 i( a

: r8 n& D5 j, B$ ~/ g     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
7 \- E. W+ Q2 |% C' L
, l4 T/ C+ n7 d) [2 `: o9 ___________________________________________________________________________8 N* j+ N8 K* f3 W; O2 N

# z( N3 s; T" J5 ^. c9 K
$ E) Y! r7 d; ^, ^: A3 JMethod 14 0 ~; j' S3 h- a3 X/ G) }
=========
. g" x& W3 ~+ L5 r+ g2 r$ s! J5 ^" \0 _
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose* g/ M  e- I" c) v
is to determines whether a debugger is running on your system (ring0 only).. A1 A4 _& \+ }7 G4 Y% k
0 J3 S! b6 D$ p0 }
   VMMCall Test_Debug_Installed. k* N( I. p% O( M
   je      not_installed# U* }; U8 r3 E/ B% ~

8 x0 b& Q9 K( ?' Z4 T# kThis service just checks a flag.3 ~& m1 t- E" _/ A( M: W6 ^
</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关注公众号

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

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

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