About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>/ T0 m9 p$ ~& x; x2 x- ~6 N
<TBODY>
1 O% M0 [: }- [. A4 s<TR>9 M# l0 q& v1 S+ H( s
<TD><PRE>Method 01
* U1 j6 |) y# Q5 D+ K( e' S- L=========
% Q$ J* E' [- ?- W6 _# i9 t" K6 T5 r9 t# ^9 J1 w
This method of detection of SoftICE (as well as the following one) is& e4 U: K% S" V+ H3 Z" l2 ^
used by the majority of packers/encryptors found on Internet.
4 Z0 A( U  `' o) K, Y* lIt seeks the signature of BoundsChecker in SoftICE
7 q3 U7 \8 E$ _) f9 Y6 P) ^* x" U  T4 M# Z. n/ F4 m: }
    mov     ebp, 04243484Bh        ; 'BCHK'
0 }$ P/ ?9 s- R    mov     ax, 04h( Y: V' {! g- Y$ a/ j7 R
    int     3       3 ?- B* L4 a* w: }# X+ A
    cmp     al,4
0 D  D" J$ K6 {, l5 I% W( |    jnz     SoftICE_Detected4 I/ W; ]# g& v% m% g- p1 s8 c
' D, J: k9 F  m5 `8 V: i( f
___________________________________________________________________________
- _# ^) e$ |8 d0 o. g" ?) O5 I$ O
" C1 ~' f# s) F+ y- K, l; k. e& RMethod 020 C, J6 `7 C/ A9 @! d
=========
) C7 t1 d8 j8 X, s: k- X: \$ j2 r+ U7 T4 g/ s
Still a method very much used (perhaps the most frequent one).  It is used
% p- s1 U* Z- ?7 hto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
3 P, I7 @2 y! `7 Cor execute SoftICE commands...- t4 I  q+ g( M
It is also used to crash SoftICE and to force it to execute any commands) Q$ T! F1 I, W  Y6 y
(HBOOT...) :-((    h+ s. l; r% O5 i: M1 U

0 E% }+ I" j1 B" e3 x5 gHere is a quick description:
) S8 C- f* U5 u# `-AX = 0910h   (Display string in SIce windows)3 x# x' S# I0 g; h
-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)9 f  G4 T. \! _7 i' D
-AX = 0912h   (Get breakpoint infos)
. i+ d2 b% h0 z/ F8 O+ y1 u-AX = 0913h   (Set Sice breakpoints)4 p7 F7 V+ @, L+ a% w( l& V
-AX = 0914h   (Remove SIce breakoints)
& `& Y% h! Z9 L8 e7 }/ g6 g& m
8 p2 x- a$ o3 u1 f  z1 s  f3 nEach time you'll meet this trick, you'll see:
! d$ P5 R" ]" R) F- K/ j2 ~-SI = 4647h$ I9 z7 A. A' ^$ ~6 g( m& D* T' i* l
-DI = 4A4Dh
% P, ?* V- g/ G' S. I8 ?( P  vWhich are the 'magic values' used by SoftIce.$ z/ r2 @1 v+ T  ^  g( s6 v, F3 |% q
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
( w( T' ^7 s- P3 g/ \9 g) [8 b$ @$ l/ D( s7 u$ F' E( k' z6 ?
Here is one example from the file "Haspinst.exe" which is the dongle HASP2 R8 W& L' c, r& E1 R) e+ |6 n5 D
Envelope utility use to protect DOS applications:- F3 G1 e* w8 k: D6 L

" u3 W; t' x; D
& p6 [0 R9 Y/ Z% r% ~5 {* \4C19:0095   MOV    AX,0911  ; execute command., r0 e$ `% K8 X3 ~
4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
1 I7 O& e, C/ d2 X% F- e0 D4C19:009A   MOV    SI,4647  ; 1st magic value.
, `& b  n, k- e" l  ?* G4C19:009D   MOV    DI,4A4D  ; 2nd magic value.
1 g' Z) X( `( G4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*). p& T8 x( O- A% t
4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute* u) k. i! d5 |
4C19:00A4   INC    CX
2 a) t" ~( l. j" b/ V4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute
0 G5 x, D& U* Z4 |' E6 P+ c+ g% x4C19:00A8   JB     0095     ; 6 different commands.0 B* _$ X- r5 a( |9 G
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
& h! J' @- z7 Y3 \/ g# h- @" V4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)% g+ N* `% y- r8 @$ {# K

2 x! Q  O3 Y: E9 s8 iThe program will execute 6 different SIce commands located at ds:dx, which
/ j. a# G3 ?  X& \) Y2 Kare: LDT, IDT, GDT, TSS, RS, and ...HBOOT." v' ^* ]" q8 y4 `4 Y0 o
7 |& Q9 K' Z) l( j  [( I( T1 P
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
$ E: {$ ?5 R- J4 ]7 g8 \___________________________________________________________________________
% r2 e' S% a' _& I; I2 W3 k% D2 D  H7 I* N

0 T$ v4 b) G, o  ^, yMethod 03
1 ~% Q; \6 ^, [+ W/ W  g: F=========
+ _1 \/ E% ?0 l: A2 H" l  I9 d7 W/ D" O' ~8 P/ b& ?  B- t
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
  }2 l; ^) y" V' C(API Get entry point)9 a3 ^% a7 k# J, y7 z
        
* M  @- ]) Y) {! d; Y0 s# X9 S; H, m! P
    xor     di,di3 _0 c" v; v9 v3 J0 U' D
    mov     es,di
  F2 a" J9 O" I7 a: S4 p    mov     ax, 1684h      
/ J: l3 i  y- O  p- |/ c    mov     bx, 0202h       ; VxD ID of winice, R5 ~# }2 D9 n" x6 Z" L
    int     2Fh
  X  G# S4 u! i" Z" h    mov     ax, es          ; ES:DI -&gt; VxD API entry point' t7 @6 B0 l, R' a9 y
    add     ax, di4 s) g7 p# O1 n. K2 G
    test    ax,ax
0 A4 i0 K4 w& T9 |$ l    jnz     SoftICE_Detected* t1 D( i- J& P0 i7 g+ Y
- G- e  R- I% n5 M5 l7 ?
___________________________________________________________________________
0 ^: D; ?- m+ |/ L3 n% f# s9 q" q% P" I" d3 C+ P
Method 04
# G: O. ]* O7 |, @0 p=========
* i2 R6 s* j" \" g% }* {4 w0 X" @. h' w7 P) U  Z! O4 m2 Y
Method identical to the preceding one except that it seeks the ID of SoftICE
: o/ S$ G$ S0 X9 {% |/ s& QGFX VxD.- Z! ]4 b+ T) @( g1 O

. y+ ^, A# ]& R5 G! Y  P    xor     di,di/ ]# ], y5 _! a! T6 g
    mov     es,di6 N0 N3 k3 b. O) i$ M; X- A9 h
    mov     ax, 1684h       & q6 u1 j0 a. w/ s
    mov     bx, 7a5Fh       ; VxD ID of SIWVID
1 G. _" p* |7 l, d: o3 I3 v    int     2fh/ R( n! }2 \1 w0 ]3 \; Y& m
    mov     ax, es          ; ES:DI -&gt; VxD API entry point
, Z, J, m) E' j7 x7 i0 H5 E; M    add     ax, di6 G; J( A2 T! m& b0 j" \5 s' V  U
    test    ax,ax
! S! l/ \( h# a& v3 I9 O7 Q8 R    jnz     SoftICE_Detected
3 w. t2 a. J0 O( M  }! f
. y/ c" S: x. S: d+ G# r/ v& n* M$ P" s__________________________________________________________________________. j5 i% n7 q: s$ j% V* l

8 z# g% b! a( M' \9 a1 k+ G3 d+ ], p) j8 X4 {; ]3 s9 l2 \9 U4 ^
Method 05
. V! s- c  H/ c- i+ q=========
' G5 B6 m+ I; q) F" m
2 ~) F6 A3 U- Z4 V. p; sMethod seeking the 'magic number' 0F386h returned (in ax) by all system/ ^2 x: ]' n) R
debugger. It calls the int 41h, function 4Fh.$ i5 O! w$ s8 [) L
There are several alternatives.  
8 N) L2 B' S7 @4 U1 b
) e) m# F( v9 _% pThe following one is the simplest:
. z' x  e/ I! Q( i& J* M6 s# g) N' w& F2 o: {9 k6 e
    mov     ax,4fh
$ R3 L& F6 \* B5 J- O. i0 v: Z    int     41h" {, D/ t# o6 t8 m) T3 p$ a0 m9 z
    cmp     ax, 0F386
' K3 @9 F* z! m9 |' t5 `    jz      SoftICE_detected
: Y7 ?! {4 H2 j
/ W- _# ?* g- B4 f8 D9 d9 U1 C6 [' @) ~  a) ~: r
Next method as well as the following one are 2 examples from Stone's
4 x/ a( q% w- i9 B"stn-wid.zip" (www.cracking.net):$ j$ ?, ~6 {, x

4 p* w- F5 }' l: `. c: Q( b2 f    mov     bx, cs
3 D& h+ N5 c5 S2 d+ I+ v    lea     dx, int41handler2" l% k9 P+ U) R; v$ x- Q3 D- V& e
    xchg    dx, es:[41h*4]5 U5 w3 g7 U* L' R
    xchg    bx, es:[41h*4+2]: O$ h0 {, q: r: }! l* P
    mov     ax,4fh
9 R6 B# [0 X7 O% I( u% |( |: Q& @: T    int     41h8 V4 P- m- r2 K( ^
    xchg    dx, es:[41h*4]4 v' P8 \+ r9 b- u' S. R6 Y
    xchg    bx, es:[41h*4+2]5 W/ X" V0 ~7 B
    cmp     ax, 0f386h
  x$ K7 T% B5 |    jz      SoftICE_detected' H7 E0 s9 n' F! M. q3 H9 c
+ Y7 |5 H" a  N+ ]8 i% p
int41handler2 PROC+ ~6 P1 _+ }" c
    iret4 V0 y/ w9 g0 [; a3 ?4 W
int41handler2 ENDP% z+ v$ v, v' G7 r" U4 g1 f3 }$ W6 U

4 Y, I. N2 P: f( Q
8 b+ ^1 M6 r9 b0 X; X_________________________________________________________________________
* H, ^" f$ q8 a; P* U$ u3 K5 g" n$ D. d6 I
( s5 E/ C. g7 ^+ x# L: `/ {
Method 06# {, ~! B6 D) _) Y; y
=========
& g0 s4 p5 {% \) _5 U; l. {3 q# M+ j( s% y

7 O( A9 |) A$ y# i4 S3 M8 q2nd method similar to the preceding one but more difficult to detect:
+ I3 n4 U" t1 [2 r4 W# H% w2 f# n2 ]& A) }+ C6 W) y( d0 g
# u! v( }6 x, X7 T& E9 D0 Y
int41handler PROC  b2 n/ f% J% Z3 j% `) i- D- o9 ]
    mov     cl,al( Y/ O- h) q1 Z* G. `. m
    iret6 p: Q, @1 N( A" M8 W
int41handler ENDP
& {/ u8 k! ]( E! w; @; B/ M" b1 `0 J9 N& Y  n/ t
! w6 w. K9 Z0 b( k& ]0 O
    xor     ax,ax
5 ]5 X8 S, m  y7 T+ W    mov     es,ax* n, n5 I, K* B/ M
    mov     bx, cs
# {6 M$ U9 d+ l, b* g    lea     dx, int41handler
. [' ~6 C# Y* U0 G1 q7 p1 v$ E    xchg    dx, es:[41h*4]
( X% f! M: Z# j0 d1 B5 R    xchg    bx, es:[41h*4+2]
& J# F  S4 L7 Q; ?  Y    in      al, 40h" O  u, ~+ G- B! w/ J4 {+ c9 I
    xor     cx,cx
  q0 b9 h# @& k6 l" R" o# n& ]    int     41h
% v. X- W+ d1 c. K4 i    xchg    dx, es:[41h*4]
: ]: e$ F  B. F3 I/ u* R  T: C7 K3 S    xchg    bx, es:[41h*4+2]
& h3 p# I! @' c' C. d2 Y    cmp     cl,al
% I& [$ d9 G; V6 E$ B5 W2 v    jnz     SoftICE_detected
0 r! w6 u; j* o7 @# @( |/ M) _% ]' u, r
_________________________________________________________________________
0 H% d2 {% ~- s& _+ Z  o. z; r1 f) o1 c% @% h% r" o* L8 C! ~
Method 074 U  c6 T9 b# ?% ^
=========
9 \* T( D' m1 x# {7 h8 |# L2 j+ F: h& t& V3 Q
Method of detection of the WinICE handler in the int68h (V86)6 d8 `; W4 M* |% {
+ D) l3 V" E5 O) x$ t: K$ _
    mov     ah,43h8 _9 I* A7 `( t
    int     68h8 u: B! _% \( `, b& [
    cmp     ax,0F386h8 u, b7 }' Q: u& ^4 N6 W) t. @1 \
    jz      SoftICE_Detected% q  `, x* n- k+ d

. N6 y$ T8 Y$ ?6 p2 B  L) L) ~
( L* F2 U' L: s$ ?=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit' P4 Q+ ~9 b# f, K, }
   app like this:- D$ {% Q/ h+ v6 h
' H5 t3 d0 E% c8 j; r# e  G/ b& Y
   BPX exec_int if ax==685 I. Y1 y% @# {5 @) T
   (function called is located at byte ptr [ebp+1Dh] and client eip is
8 |, H. ]; `* U   located at [ebp+48h] for 32Bit apps)
. i. t) a. E& f+ z& K4 [* s. b! B__________________________________________________________________________
- A2 }/ W9 W$ ~2 S6 [  H' X* j( Y2 Q8 t
) Z4 |1 g/ O8 Y1 ~# j
Method 083 S3 w. n& [* z% m: @1 y7 W3 W
=========) H8 T: c' p# r, }+ Y, ^

8 m6 J9 k7 z% H2 N) U& U( WIt is not a method of detection of SoftICE but a possibility to crash the6 v/ h4 D4 j# {
system by intercepting int 01h and int 03h and redirecting them to another; |# S7 ^6 m4 ~% N. d/ k7 E
routine.
; j6 I8 n4 z: N2 h; rIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
2 {1 ~; K4 P6 {to the new routine to execute (hangs computer...)
4 F7 m% M5 Z& g- {6 D+ \
) w: q+ p* |4 ?    mov     ah, 25h9 Y6 Y, J; i8 M; w" B
    mov     al, Int_Number (01h or 03h)1 F* i: C* b( u1 D" t; D& [
    mov     dx, offset New_Int_Routine
, `, C; M1 H: R1 b) ~    int     21h) c" R- W* k, H# Q4 S/ Q: f% k
) G: O' P9 E. X  J% G" g
__________________________________________________________________________
! C( S# G! C; w4 A9 e& g$ x
0 e  l; b& c1 ?; y+ }8 F' S- LMethod 09
' c1 o/ [: Y0 Z! E* D" A=========" i' P$ `2 O( G' v0 Q0 ?7 b# O/ U: s0 y

0 }" t) u6 q$ kThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
  Y" _1 b& ]6 ~) `/ E: G% x4 gperformed in ring0 (VxD or a ring3 app using the VxdCall).
+ {& h; u+ L8 J* W) A' HThe Get_DDB service is used to determine whether or not a VxD is installed
9 d6 o5 o+ p/ V6 Yfor the specified device and returns a Device Description Block (in ecx) for
4 ]; J+ j! P" Y2 e1 Vthat device if it is installed.
' |" M. R5 N3 F3 p: d: v# ^0 A) P9 L! o4 F' J
   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID
2 D4 h- g( ?$ ^4 ]9 \, y- E4 b   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
( @+ ]) d2 b7 |6 ~3 g: y( o$ D) N   VMMCall Get_DDB; o7 Z/ F# U9 U  Q6 M; p
   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed7 s* `, m0 H8 l3 G

% _! s# J0 p! w) KNote as well that you can easily detect this method with SoftICE:0 U) [  T( l: K. H) R, T
   bpx Get_DDB if ax==0202 || ax==7a5fh6 `3 N4 d8 x6 u7 Z

4 V4 y: C4 I0 q6 F/ Z, X' U* |__________________________________________________________________________. j5 P9 b# ^  B# Q, `
+ ^; q1 Q9 W/ @5 R2 p# M
Method 10% @0 `2 k9 j' W  h, o3 x) r0 Q; E
=========) U; `1 g$ r, e, [3 X& s

6 w# i) M) T! p# c5 g=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with
/ H' {. B; e4 e  SoftICE while the option is enable!!  @7 `. s  W" e: i

$ i1 E8 h6 W. |This trick is very efficient:; e( r9 w9 k; j- K, J' ^% f' G
by checking the Debug Registers, you can detect if SoftICE is loaded6 e" L$ c5 b6 _
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
, K- @6 }9 r& A5 P4 X3 a4 r& v5 P& nthere are some memory breakpoints set (dr0 to dr3) simply by reading their9 p1 Q. D6 c+ B0 o* P+ D. _. Y- ?1 W
value (in ring0 only). Values can be manipulated and or changed as well
8 H0 _2 o3 S. z2 N! U) c! r) R(clearing BPMs for instance)9 }' S9 u# C, D/ X# r7 e: }2 H
. `2 r6 o: Z1 B/ c; }; Z
__________________________________________________________________________
8 j0 f  w; f# a' l. q* F- ~, b# }+ m
Method 111 b& f+ z+ m" s7 A
=========
+ N0 M* p5 ~! Q+ S  k6 m: w2 J) o+ ?2 D3 ^  |7 }1 m5 {* f0 h
This method is most known as 'MeltICE' because it has been freely distributed
* d. y( w6 ^0 @* ~# O! B$ `via www.winfiles.com. However it was first used by NuMega people to allow( a; F7 M; I0 D- t# N# J! B
Symbol Loader to check if SoftICE was active or not (the code is located9 C/ J$ m9 q# N7 f( ]  J; y4 X
inside nmtrans.dll).
1 B9 K  K' v( m" k# A4 M: G4 M4 C7 b4 v9 l1 j# L, M# ^
The way it works is very simple:, z/ l) r1 K- c3 L: {: L0 p$ j
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for  g5 @; M7 }6 r
WinNT) with the CreateFileA API.
/ X0 r# |; ]. D6 Z
0 w8 n: Y# k* ^. dHere is a sample (checking for 'SICE'):" y- f0 ?/ E: P( t! t. j* z

" [2 [0 }* k' i3 rBOOL IsSoftIce95Loaded()6 t) u+ e9 w9 o' m% j7 ]
{
3 Q* x' B7 H& Y: M) _$ }   HANDLE hFile;  
, s) k, K! g5 l6 F: ]* G& T/ l   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,. k% @' H. m! E) X$ }) B3 F5 R
                      FILE_SHARE_READ | FILE_SHARE_WRITE,
) A: x2 D/ T& J& e. h+ h0 ~                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);3 [( J' [" f5 c1 S- t, ~
   if( hFile != INVALID_HANDLE_VALUE )* d" b4 _/ ^3 ]
   {
: [$ k$ T/ ^" V1 F      CloseHandle(hFile);0 Y$ U% U" P) t
      return TRUE;
2 o3 B/ S% g- [/ {" \   }4 {& v& m$ W2 c, \
   return FALSE;
/ L/ y( H" p' n6 P2 f}7 _8 r$ K9 F3 ~8 n1 z( Y
/ B  f# q2 m& _' e4 a2 F
Although this trick calls the CreateFileA function, don't even expect to be; i8 ?: ]- |( s$ S: `: {& v  E, {
able to intercept it by installing a IFS hook: it will not work, no way!' u$ |. k7 U5 s! B( X# b  k
In fact, after the call to CreateFileA it will get through VWIN32 0x001F8 {! B7 A$ M2 Q7 P2 q4 n% o
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
7 f3 w- d$ G) J1 z3 Land then browse the DDB list until it find the VxD and its DDB_Control_Proc
% q' Y4 w' J7 e* U0 A; ~( Gfield.. Y, P2 c/ \+ E5 Z5 E! \# H
In fact, its purpose is not to load/unload VxDs but only to send a
  X4 u( t: U: k8 l1 h5 h7 dW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE); ?" \6 T9 P2 T- N, V. y
to the VxD Control_Dispatch proc (how the hell a shareware soft could try8 \8 f4 x4 A0 n; C/ T; k
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
3 X' a/ T0 Y! [' H8 cIf the VxD is loaded, it will always clear eax and the Carry flag to allow% k1 Y" T" b" K  s7 f: Z5 K8 p
its handle to be opened and then, will be detected.
; L( W/ U/ C& kYou can check that simply by hooking Winice.exe control proc entry point$ b2 z3 j# j* V; h& c  g9 |
while running MeltICE.. n( _2 C: ?2 y! n4 ?; B
- |( u+ M. K0 }; U. ~0 b
$ @0 U* o; h: A" d
  00401067:  push      00402025    ; \\.\SICE
# P9 ?' Z" M! `1 A8 L6 A  0040106C:  call      CreateFileA) r, e: V7 _1 A. s
  00401071:  cmp       eax,-001
: d; k' D. R$ X& f4 w# l, ]3 z  00401074:  je        00401091
  T1 \6 z8 \1 Q2 K8 _6 l
, f; M* {2 p% C  z0 U. p# u' N+ L
* m  P6 E+ H/ F" Z+ E* _# t$ bThere could be hundreds of BPX you could use to detect this trick.
- |( P- B" q& }; `6 `; ]-The most classical one is:
) N9 X# j" D2 |  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
6 b0 n% l. S) l4 n# {# w3 Y; F    *(esp-&gt;4+4)=='NTIC'
1 X8 x+ u, C; y" z7 o- Q$ F! r; [/ H, W8 [( Q
-The most exotic ones (could be very slooooow :-(
# x6 o, Z" |" s1 ?3 Q2 w   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  ' [" v' h+ C! R% u( ^( Q# G
     ;will break 3 times :-(
/ c) U0 g& ~. Z! J
' r$ c3 x6 P8 A4 Z9 S2 }( X6 f  d-or (a bit) faster: ; J% q0 }: t9 v% l
   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')) k' ]. U. i4 t9 y

" J9 b6 w0 B0 l0 d9 K) E- H5 x   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  
: ~1 l; c) |6 f. }3 V2 d' q$ |     ;will break 3 times :-(
8 s7 O0 n* v; E. W
6 X* V, W3 N" W0 K8 P-Much faster:( `6 ^9 {/ ~( a/ ~! l" {0 }
   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'
# @0 K  t+ }) |, k/ T! W, E4 |7 R0 P2 g; z' W3 n
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen6 n" {% C, ~; v& V% w1 \7 s; Z" D9 A
function to do the same job:! l& Y' ~/ K$ J. ^0 y! `; r9 [
0 [( A; |; T9 ]2 v! A
   push    00                        ; OF_READ
- N5 _, \' {7 @6 U  v' ^   mov     eax,[00656634]            ; '\\.\SICE',0( |4 ^' I, J- x* W
   push    eax
9 R' a- q. n  Y$ |; L- D& o9 J" _   call    KERNEL32!_lopen2 G4 }, n8 d, m2 @0 \% o- Q
   inc     eax
$ t5 o/ r) {3 i( I, n   jnz     00650589                  ; detected
5 b" N; g6 t" ~1 v   push    00                        ; OF_READ  q  ^. f& {& d# {
   mov     eax,[00656638]            ; '\\.\SICE'$ u6 s  B# M) L% r
   push    eax; R3 o9 l: W/ ?, i; E
   call    KERNEL32!_lopen" ~! X  Y" _3 v
   inc     eax
# W( i7 d' u7 Q4 I. E* M+ j   jz      006505ae                  ; not detected0 t, s3 G8 d2 i1 p: |% |

; R1 J/ W, J/ f8 v( _, ^, [+ I* W( S1 H* C+ l, f; C
__________________________________________________________________________/ Z/ |7 l$ j) u; A/ \: Y
* i# T* v$ ]% s
Method 12
7 i& n& T9 x! k+ v* g=========
: x( G! c9 o* O: L$ u- U
$ M; y1 W+ B  z' K  eThis trick is similar to int41h/4fh Debugger installation check (code 05
6 a, f) L/ K) p; u- r* f7 }' M3 w&amp; 06) but very limited because it's only available for Win95/98 (not NT)
/ O# Z$ C" Z- O6 \as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
# N1 P: N; r) t) S( N
4 j: m0 S: {5 M( }) Q   push  0000004fh         ; function 4fh9 f3 @0 u2 X( ^; w
   push  002a002ah         ; high word specifies which VxD (VWIN32)$ H* B# n; N+ N% l, D! a+ p
                           ; low word specifies which service
! p) b3 O  s* \2 `3 q                             (VWIN32_Int41Dispatch)9 t, o: g  W* n: a2 v9 e
   call  Kernel32!ORD_001  ; VxdCall
8 C7 J" T+ g9 Y/ W' X" U   cmp   ax, 0f386h        ; magic number returned by system debuggers2 @/ w8 ]7 M5 Z) [) t
   jz    SoftICE_detected
& m4 ?% `: |" A% |- g0 B3 A# v' _/ \; g
Here again, several ways to detect it:+ [: g  c) `2 U3 W  Z& o  h
/ m& y6 u5 K0 ~8 Z
    BPINT 41 if ax==4f+ q" k3 |2 b5 A
+ z+ N, k4 U2 x6 q5 G: S
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one
5 M) _, t+ r- _5 i) @+ G# u: S5 L& G2 Z+ q% D. ^- }* ^& U
    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
8 w! _& b. v8 E( ?) G& u3 K8 a! I) y; ~) L7 x7 }
    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!( X8 |) U! n* R& U$ p% @

# a5 ]2 D0 l$ p__________________________________________________________________________
5 X& ?" }1 {9 M  j* p# H) [& ~4 u  {3 J( V( ^$ ~7 |
Method 13% o& I- k& r2 g4 h
=========
6 g/ Z4 [% J; M, }; U( [) @! r! n! L5 k
Not a real method of detection, but a good way to know if SoftICE is& F6 |8 W7 O1 V2 a, F
installed on a computer and to locate its installation directory.
6 E3 S  ~$ u8 m% }It is used by few softs which access the following registry keys (usually #2) :
# L1 \+ c- [2 P& ~( T4 u5 F" W. D% l1 l7 c! O
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
+ T7 M  M0 w! B( D# W. A\Uninstall\SoftICE: U2 A  b& Y7 Z( H' U# d
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
% u( e  V9 Z, F* s: R7 s/ n-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
% _: ]& r, d+ l5 y& x: e2 h5 [+ Y\App Paths\Loader32.Exe
& |( x1 J: G$ o" G% h8 f6 l% @* u
$ u5 C- G2 ?% U" Y" y8 G9 Z. S0 c; P- l$ {
Note that some nasty apps could then erase all files from SoftICE directory
- u; ~7 c3 J5 K& Y4 d) Y3 W(I faced that once :-(
3 K. ^  y8 i( S, A2 x; w- m. b1 f, s
Useful breakpoint to detect it:
) ^4 I4 U9 M! m1 d- a2 `2 ]! @8 l- j' Q2 P  T8 U9 E' z
     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE', F  ?& ~8 |% D$ A2 z6 J

% P! k; u. t6 K2 B! B6 B__________________________________________________________________________- t3 A/ c. t6 @

8 s" ?9 Q$ W" e" R3 A- \1 q8 t3 A' b1 L3 c0 a. }
Method 14
' v1 {. I& D' P8 r=========- a7 f6 r3 J$ d* F& B
+ y* Z/ ^9 h7 p3 u' L) i. X
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose! b0 q7 P; {6 E7 t* Z" N
is to determines whether a debugger is running on your system (ring0 only).
$ G; i8 \( W8 a0 r# R- f, E3 u
& q9 K$ y3 N9 z+ H; I) m+ [( L   VMMCall Test_Debug_Installed/ r3 \) J' {& F$ }1 u4 Q' _7 P0 Z
   je      not_installed
( ^! H2 ?) ?' u( q# n7 h0 U4 d, F. u
This service just checks a flag.
( r  i7 G: l! w7 A+ I' r; |</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关注公众号

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

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

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