About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>' }" n2 k7 _+ \+ {
<TBODY>
% E: ?1 ^8 q+ G( c  e( ^* {<TR>
! _  y& R) e* ^- N1 T7 @0 H<TD><PRE>Method 01
! v2 g+ O- f/ p1 g% m=========2 e  ?( i1 k9 B( c$ u- K6 T- v% ^

# _6 Z) f7 X% [$ `" TThis method of detection of SoftICE (as well as the following one) is( w' {/ e. i& r1 y$ l, j4 w
used by the majority of packers/encryptors found on Internet.1 }6 l3 C( w; b- }, {
It seeks the signature of BoundsChecker in SoftICE
) `: Q: |0 M! v+ c# f6 j! a) p9 e) i8 E7 K5 z' R
    mov     ebp, 04243484Bh        ; 'BCHK'3 r& n: x# a6 Z8 ?
    mov     ax, 04h: s0 k. z0 b6 x8 D5 @
    int     3       ; s' \0 i+ F6 F& M
    cmp     al,4
6 W( ^4 [) l- d. f5 H# f/ g5 d/ h    jnz     SoftICE_Detected
) Q4 m- k( e+ U
! h8 w; n! g4 V/ o___________________________________________________________________________
+ ]2 Z6 Q+ h2 `( m9 q
! P' b. W6 V, NMethod 02
* P" M4 W- W: O$ ]3 l=========
: o' @  f- I$ {3 w( Y- R/ p/ d0 |# V" x' ?( p2 w, B3 v! B- p2 z# ?7 Y
Still a method very much used (perhaps the most frequent one).  It is used
6 p7 D2 U0 @7 U6 g+ q; J) D$ C1 Eto get SoftICE 'Back Door commands' which gives infos on Breakpoints,: e. @2 p7 a, Q5 Y
or execute SoftICE commands...  b! ?7 _7 ^9 y& Y/ c+ _
It is also used to crash SoftICE and to force it to execute any commands5 v/ X: \  n5 L
(HBOOT...) :-((  
& `0 j( H+ {/ C/ S7 |1 G- I5 [# x( \1 n6 ?* A! {& I
Here is a quick description:& W( ?1 L* r7 t6 ^- W+ p6 S9 s
-AX = 0910h   (Display string in SIce windows)
* B: y3 @6 b& ?: Y8 K+ _6 g% x, @-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx): X( y/ R* X+ x3 ?/ {- w
-AX = 0912h   (Get breakpoint infos)
6 A) ^2 h; E2 C6 ~-AX = 0913h   (Set Sice breakpoints)# T9 F5 [4 x* v  q2 E$ F% B
-AX = 0914h   (Remove SIce breakoints)! `$ y  A( b2 E) l7 V+ M1 T5 J5 e

6 j3 O0 X- n2 P: I9 u* d. g/ FEach time you'll meet this trick, you'll see:
+ S8 h7 R& ~/ ?/ I0 H- i-SI = 4647h
; k8 l2 t$ n$ E6 P* j! y-DI = 4A4Dh
0 }! P$ m0 ^) eWhich are the 'magic values' used by SoftIce., b% [, E; X8 O& n# Q
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.5 C0 x& o. u* y

& W; E/ a% P' v) Y0 ?/ S; WHere is one example from the file "Haspinst.exe" which is the dongle HASP3 {+ w) y$ e; e$ r
Envelope utility use to protect DOS applications:
) [  \& S5 J( a8 t! W( I) U
9 s* t0 H  V; R
7 \7 p% F6 K; C# }9 X7 j4C19:0095   MOV    AX,0911  ; execute command.
( v8 _( p7 A8 I9 h- \4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).! U4 o, P; C( u; c( |
4C19:009A   MOV    SI,4647  ; 1st magic value.
+ j* ]( |" ~4 S- E4C19:009D   MOV    DI,4A4D  ; 2nd magic value.) v1 X) y7 Z. r8 D; |
4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)) Y# A9 s8 J( ~, x
4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute* Q/ V5 \6 ]9 q$ e% R' f4 i* I
4C19:00A4   INC    CX& u: r* u0 u; r
4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute0 E; N1 E+ |7 P; f
4C19:00A8   JB     0095     ; 6 different commands.  B" m$ Y9 Y  S" t
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
/ `4 m$ L& i0 w7 d8 D4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)
+ J- i6 S, l7 z) L+ `. z8 b) g3 d( ^& ]3 {0 {
The program will execute 6 different SIce commands located at ds:dx, which
/ f6 t0 N5 ~( ]2 Z( @. d! j. Jare: LDT, IDT, GDT, TSS, RS, and ...HBOOT./ y! C5 N* o: A& {6 K
5 l0 n$ \9 U4 h* l& [  c; q0 [
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.8 u% M1 D' O# b
___________________________________________________________________________
6 k; o7 u! f5 P8 ?) W# [& c- u) @; o
) h6 _6 f3 j3 V' |
Method 03
! |9 r' x  l% x9 `+ b0 J+ H' q=========
' M  K6 C1 u& I. \; W3 j
# w2 _! D, p. G; j9 \# X9 qLess used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h: d+ }' a  u, T. c5 g
(API Get entry point), T$ t: l2 H1 N( t" ^
        ; ~6 j0 ~3 e: W! b1 J- G) e
/ F, }$ g  v6 o9 o6 [) J
    xor     di,di) K5 y0 L$ P( j6 A& i+ f
    mov     es,di8 P( C+ q4 o# a: a
    mov     ax, 1684h      
/ Y# `: V- i2 @; G, [( g    mov     bx, 0202h       ; VxD ID of winice2 T. `1 ~( D! _" ~/ q& @. o4 M
    int     2Fh7 |  s) k0 d. @9 h2 l9 N
    mov     ax, es          ; ES:DI -&gt; VxD API entry point4 _; c. D- v4 x8 J
    add     ax, di: q8 s4 X7 {. Y5 w' T' D0 ^
    test    ax,ax; M$ F7 p. L5 ^7 C; }: k
    jnz     SoftICE_Detected
8 H0 ]0 {  r9 t
) y% I4 D% F% i' l9 B" y3 m  I___________________________________________________________________________' G  |/ U# e" i0 G7 w
+ l) d3 c" |' w+ R% \, J& T" Q! N
Method 04. R$ c4 j+ u. O+ P# {. L: l& j
=========4 @% ?& c3 W/ p. j: {

; |2 R( m4 M+ aMethod identical to the preceding one except that it seeks the ID of SoftICE( M# f0 E- J1 Y3 A' p
GFX VxD.
- J7 q% a+ C+ _* s& k+ @' [( Z$ `$ a( U+ t. _) o! C$ J
    xor     di,di9 I  _1 r+ }- k/ m
    mov     es,di! f: k3 a* {$ N1 e3 J
    mov     ax, 1684h       ; w8 m: c1 Y4 A7 b& \- U
    mov     bx, 7a5Fh       ; VxD ID of SIWVID% H' c2 i3 C! S* I3 B
    int     2fh) A$ A1 Q3 W) B+ N
    mov     ax, es          ; ES:DI -&gt; VxD API entry point: z" `' q) m& m7 i
    add     ax, di* S" ^8 E+ G5 D% I8 w0 e8 y! |- r
    test    ax,ax( Z9 E# [/ v; v+ n# I) [( T
    jnz     SoftICE_Detected  _. \& A6 Z" H' h4 o7 g- x& b
. g% d% H) U# W( M$ H- Z
__________________________________________________________________________
. o8 C' R1 v" |, n! _' I) F2 M  r. {$ D4 ], |
3 I' v4 }6 }7 o. \
Method 05
( I( Q1 K, n0 {3 B: Y=========
& ~& B) s2 H6 q7 Q* ~, w- a' r% l7 v
Method seeking the 'magic number' 0F386h returned (in ax) by all system" \2 i; g+ G' J+ }( u3 `& M; `
debugger. It calls the int 41h, function 4Fh.
4 Y* [9 {/ V/ `7 Z. ?  ]0 |2 @. tThere are several alternatives.  
& e+ k8 P; U# t- G1 O: z- |
( i0 {  m( `% H4 C; I; {9 zThe following one is the simplest:
5 P5 n8 O* V; d
2 T3 n- |- s0 r0 F. _7 q+ _    mov     ax,4fh3 t1 \5 q2 T! r2 c- S. J
    int     41h% m- Z" m" f% h, w) p
    cmp     ax, 0F386% L% |; }% N5 N8 p! M1 d) A
    jz      SoftICE_detected9 B* V& Z" g  ], B

! ]# G+ v3 P! D( Y7 i3 |% g- ~7 q+ A) x5 C+ d% ]1 f1 V
Next method as well as the following one are 2 examples from Stone's 3 H7 K, k# I( f) t. F0 r
"stn-wid.zip" (www.cracking.net):
, ^  e5 E) k+ h, g% U
$ k* j# {+ N8 @5 e3 J9 U# Z    mov     bx, cs8 J7 w7 c2 l" J' r
    lea     dx, int41handler27 |4 Y- _7 @6 u& @2 K8 A$ F/ H
    xchg    dx, es:[41h*4]
0 x1 `$ u: \( t! `/ v/ r    xchg    bx, es:[41h*4+2]" O. b% t) A0 i6 p( }  n9 ?# ^/ t! O  X
    mov     ax,4fh
3 ^5 T% N/ C9 c& V8 h    int     41h
. ^8 j: m5 B: v; P% Q% \    xchg    dx, es:[41h*4]
* o8 P0 O3 C# ]3 r9 \2 r( r9 ^    xchg    bx, es:[41h*4+2]- |6 M8 @$ F& y1 \' C# a  E. n
    cmp     ax, 0f386h
' D/ s3 I' Q, X6 c    jz      SoftICE_detected
3 f) c4 a/ Z$ B8 a2 [& r* L! `7 t& n* z/ P/ C1 W, ]2 w
int41handler2 PROC
3 f# }0 k! G$ W, g% z    iret; W& e- \1 O0 @
int41handler2 ENDP
- q* \6 a" Y8 _, }! U: i. D1 e3 W' e, ]* f$ F

& g1 R4 D, s' l( n( S8 C_________________________________________________________________________
1 E4 H- ^  e( g+ [; \5 |+ I
4 O9 }$ C" L9 e4 ^9 P$ O: k5 H5 A- N( l- t1 H
Method 060 i( G$ l1 r/ P8 T) R% E+ `
=========6 o* u, p$ u3 ]! e
& c$ g1 {) F7 T: y; I0 [" X

# R+ a2 V5 K% [4 O* y2nd method similar to the preceding one but more difficult to detect:' \! L. b& z! B$ r9 q! H, I

# w, I7 C# V& f. C( B$ z/ o- n
# l1 w) E9 Z7 d; {  Q5 ~int41handler PROC
$ v( }9 O0 A. x4 N* v  @4 {& t    mov     cl,al6 n4 {- o6 |. g! @; n' U& s
    iret
9 m% W6 I) J" @/ b7 ?) rint41handler ENDP
9 F# [4 K' D( ]" p
- \$ _8 ~1 D( y+ |$ Z( ?7 S! X- |! J% ^0 D4 d
    xor     ax,ax
) P0 R  |3 A; k2 L( m    mov     es,ax
- W- u$ L& ^1 y, e    mov     bx, cs
$ F' v% ?. R1 z) b+ o3 k; \    lea     dx, int41handler
5 k: U* l, q$ {( z+ j7 u7 B    xchg    dx, es:[41h*4]
- w$ u& l% k! w7 q    xchg    bx, es:[41h*4+2]
  }9 E' v0 K+ Y8 l7 O    in      al, 40h2 a; c0 o2 w" P
    xor     cx,cx9 H! ^; w' ?9 n5 E$ w5 k
    int     41h
) e8 P5 @: \+ t$ T    xchg    dx, es:[41h*4]1 R) I# \3 @( L+ q; e' z
    xchg    bx, es:[41h*4+2]
5 _2 z6 l" x2 K9 E8 z7 R, z9 l    cmp     cl,al
1 H1 c+ Z( i" d4 f, G' L- @    jnz     SoftICE_detected3 a& c, L7 w) W- [- j7 B' v3 q
9 M5 @( L/ m( j. i
_________________________________________________________________________' E- R' G2 [2 q) q( p

, Q5 X' Z- ~9 ^& z' X8 qMethod 07
( N, M7 \/ m( }- N" T2 `% E0 T  R=========! `, g5 A" h+ ]' i+ R3 l

; W/ ]7 s& V- ]" y! f" k& uMethod of detection of the WinICE handler in the int68h (V86)
8 Q+ y: B4 v, T1 d, c
7 y  G0 t! R" q" L/ p" j) @0 S$ @% [1 o    mov     ah,43h, o$ d( Z+ @0 K
    int     68h
' F( ?. c' q$ ]8 E3 @    cmp     ax,0F386h7 t3 P1 u+ s3 L/ z( I+ y, y0 g
    jz      SoftICE_Detected0 C* }& _# \* U

* E  T9 C3 \* T
; f0 V! k' j: _3 V# d, o=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit( N8 r) x7 k7 h
   app like this:8 c1 R1 u4 f* h! t/ w, z
' g& _) ~0 U+ H/ P6 e% f7 a
   BPX exec_int if ax==68
0 t7 R8 {. `% O   (function called is located at byte ptr [ebp+1Dh] and client eip is1 m; E" P$ m+ _3 V) D; }0 r9 |
   located at [ebp+48h] for 32Bit apps)  _$ W, x' N7 @. U" k" z
__________________________________________________________________________
7 c1 J, L% X( }  K7 g, e# t4 ?- ~+ Z, C( g6 g2 ~; K; n/ Z% L
  b! v  G3 Q! \; p& `% I
Method 08( i. H  A9 K; }3 ]% _8 z
=========3 z, s! U, \: l

0 Z5 n( r* `; P7 J0 eIt is not a method of detection of SoftICE but a possibility to crash the5 f; l6 r3 R! _3 ?
system by intercepting int 01h and int 03h and redirecting them to another) H7 i! s5 P3 y$ E* ]4 J* j
routine.
2 N$ a/ I( J. J$ o1 WIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
. k; [6 g+ P$ M! u: F6 \  wto the new routine to execute (hangs computer...)
1 S$ p: Z, T" ^8 F9 U& N3 R* [+ H9 x& ~0 n* w! z. J
    mov     ah, 25h1 b7 X+ A4 h* u% i% {( P
    mov     al, Int_Number (01h or 03h)
: i& q0 P. }+ ]- x$ T( T# j; K    mov     dx, offset New_Int_Routine) i/ L/ U- f" p" p
    int     21h+ u& M7 W6 {* a! W9 S3 e. n
0 k: j9 u; |, o5 S% k; v
__________________________________________________________________________
9 Z+ B; i5 {: U9 }9 m: U: w9 ]3 I! _/ i
Method 090 r; H, r* I1 g$ ]
=========! d' u" O/ T4 \! x4 f* J% c5 Z

$ m) M* I8 c/ R8 y) f5 \: k+ T& P( XThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only8 L) `1 r7 C6 [# T) e+ Q
performed in ring0 (VxD or a ring3 app using the VxdCall).
  c" ?+ H' Z, s; @/ tThe Get_DDB service is used to determine whether or not a VxD is installed
! `6 \/ }& _- M  M/ B; L. @8 Yfor the specified device and returns a Device Description Block (in ecx) for8 Q7 f* D( O0 ^+ L
that device if it is installed.2 W3 y' A) t: {" \8 i

0 X; h4 d4 i9 n5 q- Z' t   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID$ m2 M/ M  H! m, z9 V
   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
! _# ~2 H% f* R: ?" q. p   VMMCall Get_DDB
1 v" u7 j+ B. h  b2 B   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed0 E* R3 G. D5 W; T" [+ z! i

. E& o8 U2 F  h. gNote as well that you can easily detect this method with SoftICE:
6 {6 Z7 }( \5 q6 x1 p' H1 G   bpx Get_DDB if ax==0202 || ax==7a5fh, \/ {4 ~  ?5 `, m5 I# g3 O

+ y2 Z2 i! k, ^' i- s__________________________________________________________________________
" x0 o6 z* S) ]& |4 e' [6 ~3 G) o0 s& d9 P
Method 10
& l! ^+ [+ {# S=========/ I' C  B: n4 @7 M) ]
( e8 l' b. y/ g! v( ~
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with
% O2 d$ z: \  B/ S1 u% u  SoftICE while the option is enable!!
9 k8 O; J7 S' v3 l4 C3 o% E! f* C% E! K9 l  |1 E7 d6 o
This trick is very efficient:2 I, D" i4 ?  s$ J
by checking the Debug Registers, you can detect if SoftICE is loaded8 x1 o$ P5 \7 f4 h
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
; M  p, {! k; q# e2 w* fthere are some memory breakpoints set (dr0 to dr3) simply by reading their
, C" l; K5 ^. U) ^+ f2 z% rvalue (in ring0 only). Values can be manipulated and or changed as well: ]2 f+ o. R' E# N, E) {
(clearing BPMs for instance)
9 ^  }4 @( L/ o1 U
* ~3 r/ a9 I% v. K7 e__________________________________________________________________________  h- @( r3 M' Q- x. U( Q
; [% F% D+ r! C* g2 V+ O/ J# K
Method 11
# h5 S. n% o, x=========4 i' x9 o' p/ `* a# Y4 |0 ?
! V' l6 L" M% s% c: V# C8 A
This method is most known as 'MeltICE' because it has been freely distributed
4 s5 B3 z: K; K# ]via www.winfiles.com. However it was first used by NuMega people to allow
/ d' D9 y* `4 _. Y+ TSymbol Loader to check if SoftICE was active or not (the code is located! s! Q) b- X; j( x0 @: {- [, L$ Y
inside nmtrans.dll).
7 U/ I2 x- T- M3 k) M: o
5 b: k; M$ O( s! W6 W" Z3 q, kThe way it works is very simple:
3 v4 ?# F( e" d% K2 t; N( `It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
# l5 T) z0 ^7 BWinNT) with the CreateFileA API.  T2 m  E/ ?% O& k
3 q. D6 N1 Q+ @: M2 S! Y( L/ u1 D
Here is a sample (checking for 'SICE'):
7 T) F, ^5 r0 C6 I  ~- f" a) U" m5 P5 s, x0 C
BOOL IsSoftIce95Loaded()1 I# [* }" Y. s, a* {2 S3 m
{+ S3 d7 x1 K) H3 N
   HANDLE hFile;  2 d7 G1 w) C2 X7 {4 _
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
. g  J5 U7 L  G                      FILE_SHARE_READ | FILE_SHARE_WRITE,
! c5 X% _, U1 K3 l5 v% S/ c" t                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);7 T- Z0 i5 y' r# q6 Y. n
   if( hFile != INVALID_HANDLE_VALUE )8 Y5 {# i0 u- D) n; L
   {; l6 e* S9 U4 }- O) R* S
      CloseHandle(hFile);1 q: Z5 Z/ @2 r, d& k- `6 @$ o. V
      return TRUE;
& _$ T. T7 s* j( N8 s/ T( Z6 ^   }
( q5 P! D3 R5 Q2 p   return FALSE;9 G# w% \- R/ c+ v5 {% O* @  V
}
$ r, H- ?1 U' K. S( k( c: K! C2 f, M
Although this trick calls the CreateFileA function, don't even expect to be# L; O* l/ J+ E4 A, H3 A* k- `
able to intercept it by installing a IFS hook: it will not work, no way!* |* W  I6 ^& i+ p' q4 W5 Q
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
& N: L; k6 S% V5 Sservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
. e  R3 B  ]- a. h" I" hand then browse the DDB list until it find the VxD and its DDB_Control_Proc( F. `  f$ X% t% o
field.! N* @4 t  _; P) x6 r
In fact, its purpose is not to load/unload VxDs but only to send a
6 Y: o3 V( Q7 W' p: p& ]W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)0 d0 D6 X8 g# y( [/ L/ v
to the VxD Control_Dispatch proc (how the hell a shareware soft could try/ }8 Q' j/ t9 j
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
( }) t, i( F) l( H* A" ?If the VxD is loaded, it will always clear eax and the Carry flag to allow
, x( T' G, `$ y7 _$ p7 e  Mits handle to be opened and then, will be detected.
. u) `7 p) Z0 e* t& w1 ~You can check that simply by hooking Winice.exe control proc entry point( T% |% J* Z" H
while running MeltICE." p& x3 A* E4 S2 t8 |% m1 I
. X; `/ a$ T: d! B% x! o" |

4 l- q' @# b7 Y* z+ d, ^" Y- |  00401067:  push      00402025    ; \\.\SICE
9 k3 ^+ m- j! O( P& ?  0040106C:  call      CreateFileA, r( K9 x. i( k! I  S6 |
  00401071:  cmp       eax,-001& P8 O! y# j7 w* D6 n7 y& a
  00401074:  je        00401091* w& K. N. K, V* h, Q# k

1 e0 ]' Z6 e1 K) x& R# u
4 x$ T: H) b* z7 E$ u  x/ pThere could be hundreds of BPX you could use to detect this trick.$ M3 [' `7 O; N' `' \
-The most classical one is:2 Y& W) g5 ~# P3 z  O
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
) ?3 w6 w9 ?* i$ L    *(esp-&gt;4+4)=='NTIC'
( i- I7 X7 O# x) y
5 T5 x8 [' c9 }; P' s-The most exotic ones (could be very slooooow :-(
3 x! c; n7 i+ A. Y   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  - k( q- N  z1 ^, w0 Q8 l9 O
     ;will break 3 times :-(
! `. a3 ~8 d( r, B7 T6 r$ S* B
7 m  N1 d. D* z) x2 {-or (a bit) faster: $ `+ n, X- }- X- {: ?9 h
   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
9 F# C$ W3 @- I' A. K5 `* l. S3 U$ ^
   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  ) K7 f2 c7 E# F& P  V
     ;will break 3 times :-(& e( K" C) K) e

  V/ V9 F* `  m" U* `  q% l9 E- @-Much faster:
* N, n* _5 q6 ^- e5 I   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'
/ y' N: B# o5 V" d9 @+ k8 S) w! j& x7 U
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen+ d7 P, X  u; C
function to do the same job:  C# N5 e( ~% X; `$ H- ~

* ^' ^( l* v) ?; x, V5 _. p8 i   push    00                        ; OF_READ
* k# B- C  L) I9 g0 P% A, J" a   mov     eax,[00656634]            ; '\\.\SICE',0
7 \( t0 {$ C& [% @7 y# p   push    eax3 e; b& w5 g; B0 z: d) H
   call    KERNEL32!_lopen6 v- C3 i) O4 U% K- J0 Y) h
   inc     eax6 i- v! E6 W! M7 l+ i- l
   jnz     00650589                  ; detected& Q4 K0 ]  K* g6 C: t
   push    00                        ; OF_READ& X% l+ @% |7 ]; s
   mov     eax,[00656638]            ; '\\.\SICE'$ _# P1 [' ?! `* {3 h
   push    eax
$ `/ e2 q1 r/ _: r   call    KERNEL32!_lopen& k1 Y$ u5 w8 x$ ^$ H. v
   inc     eax. T$ i+ e' n- u  n" P$ L% ]
   jz      006505ae                  ; not detected: Y2 l- Q6 b$ y. D
" v6 |/ ^+ ?* `4 O. u

3 l  [* h8 u7 C  y6 T0 z7 d. ]__________________________________________________________________________3 p# w8 u7 {7 z. q+ ^; t
, l& Z% x# z2 X# Z
Method 12
& q  H9 o4 \4 S8 @4 z0 b* ]3 T  z=========
: c9 |7 _7 S8 \
7 d, @/ d: Z, \4 U% eThis trick is similar to int41h/4fh Debugger installation check (code 05
1 W$ Y: z, h! @2 u( ]+ A&amp; 06) but very limited because it's only available for Win95/98 (not NT)' G! F0 V( u% z: c+ y9 o
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.# M$ ]& J$ n% J, B, u6 }( @

  V; o" n1 g' Z. R   push  0000004fh         ; function 4fh
+ B  V. M: t8 W; h9 K* N   push  002a002ah         ; high word specifies which VxD (VWIN32)
0 ]( L0 L( Y0 i4 Y% T                           ; low word specifies which service4 }6 a6 t) O. [/ e0 n
                             (VWIN32_Int41Dispatch)
8 p2 E3 L4 X! J   call  Kernel32!ORD_001  ; VxdCall' x5 X' K# d) v' A8 `9 ^: }
   cmp   ax, 0f386h        ; magic number returned by system debuggers
# ~/ T, Z+ ~7 V& R7 F   jz    SoftICE_detected. l$ N9 d7 V1 b/ Q4 f! R

: g; H, x% w+ fHere again, several ways to detect it:# u; O" X+ n) U
. X# X) f+ y3 a* g: `" h+ s
    BPINT 41 if ax==4f2 l2 k" |- |0 _7 J* J( r

8 j* r% Z9 U8 ?5 a. K/ [) ~0 l    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one3 d4 x4 v3 D, @8 E/ m' v
( J: j! t+ f6 {* j
    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
8 w6 R3 J. y; B. z' F0 e; O, g# k& H
    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!
% {" w% H" ^4 ^- W! X
2 }; h2 N$ \$ o) q__________________________________________________________________________
; p$ i/ E  p# z6 U0 y  x  Q
! q) i! Y, |: W) D* W1 sMethod 13
8 P/ a. E. ^) ?: i  ^( q=========. I% x2 d: H3 ?- X3 A; y

, N9 }4 X' }; b& q0 o+ F: TNot a real method of detection, but a good way to know if SoftICE is1 _0 f3 i) J3 E4 O; N
installed on a computer and to locate its installation directory." q3 k3 v- L* ^! ~, n
It is used by few softs which access the following registry keys (usually #2) :
+ d: v7 v4 G: c* h- v' F  S0 |0 C! a" N5 T& H! [! B- d/ |" J
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion6 p+ D* Q: z6 u# w
\Uninstall\SoftICE
% h/ S  E9 U3 ^. F-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
3 u7 [& m2 T4 i-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion5 ?5 V) B& e5 F! X2 U+ |
\App Paths\Loader32.Exe$ A3 U- R( O( ]/ g5 C. z! \" _
0 a$ h% M7 m* c; v9 ~2 G' {* g

+ }; ~  r% f- ^9 K) [Note that some nasty apps could then erase all files from SoftICE directory
  {$ W. E$ j0 b* J(I faced that once :-(9 w2 l, s1 M! P! X# T

6 b0 c# ~7 x- ^9 n3 e0 wUseful breakpoint to detect it:* L1 {+ t! D/ `% a  L
& h% ~  J& n& a* o8 `3 [4 Z
     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
$ q. o. a* p" f0 f/ S. q4 H4 f) ^! C* g
__________________________________________________________________________* ]  w$ x( v% q, V

' B" h& _/ \9 l" U* x2 h6 p/ N7 W5 i
Method 14 ! m6 Q" {3 F8 w6 ~
=========
$ U1 s5 H' ~6 j, n- Q
! `+ Q+ C$ [% |& \8 y" LA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
7 I3 z0 L- b: _* Lis to determines whether a debugger is running on your system (ring0 only).
/ A  M# w' P0 V/ a& j) g
9 ^: n6 I  H1 R* ~( ^   VMMCall Test_Debug_Installed
4 u# N! h  |' {' c7 A9 g' n   je      not_installed
  _8 ]; |  D6 H1 _- a* v$ w
8 w, K/ E+ z9 P- oThis service just checks a flag.
! s- A' g+ o9 j</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关注公众号

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

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

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