找回密码
 注册

QQ登录

只需一步,快速开始

About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
- D. Y) A4 u- o$ e* H<TBODY>& L$ u9 p. ~9 c! p
<TR>5 B# Z6 g& O0 y3 y
<TD><PRE>Method 01
2 E/ e" b7 [. E=========1 d- k2 z- k* b- Z% R% P6 W
( \7 E$ ^8 c; r8 @+ e/ e% l9 _
This method of detection of SoftICE (as well as the following one) is% o, t3 \$ A- k; o8 \
used by the majority of packers/encryptors found on Internet.
% g2 O" X8 ^" C  }: U/ nIt seeks the signature of BoundsChecker in SoftICE
- r* p: F" L: u" K7 r* W. z3 B7 M3 x9 a, H
    mov     ebp, 04243484Bh        ; 'BCHK'- H3 ]0 s. s% I) t: J, h0 ?6 n
    mov     ax, 04h
( A  i1 C1 v# V1 }    int     3      
7 P+ w; f7 Y1 u    cmp     al,49 k  T& e2 D. }
    jnz     SoftICE_Detected
$ R) Q6 A+ }! ^' h3 D  f) P4 ^- {8 |& M0 w
___________________________________________________________________________
) M1 @  ~/ u! Y
$ x0 I# ]8 _4 L3 H! kMethod 022 B$ V" y" c9 ~) L4 S2 K
=========
' I6 n5 Q5 _+ I
5 r$ a" b- {4 C  g. C+ {8 X6 AStill a method very much used (perhaps the most frequent one).  It is used
: w% E1 h2 F% _# k8 O, y& a' E  _, sto get SoftICE 'Back Door commands' which gives infos on Breakpoints,$ g  @! I: f& L/ D, j
or execute SoftICE commands...8 s8 Y; s/ V( x5 ?
It is also used to crash SoftICE and to force it to execute any commands7 D  W0 T9 ?( R) V: W& `
(HBOOT...) :-((  
* I( g. x2 l' `, O$ M
) O. G  P9 Y1 q/ `( r% dHere is a quick description:
# r6 q3 \% S. a6 a7 I9 c4 e. T4 O. J-AX = 0910h   (Display string in SIce windows)
5 r) f) k7 K% l& O, y" V) y( ]-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)
- a; v7 d5 @2 t8 K8 Z5 N9 N6 @-AX = 0912h   (Get breakpoint infos)
; M4 `9 a9 u1 k. b5 m. V+ l-AX = 0913h   (Set Sice breakpoints)
1 y8 e: C( x4 ~-AX = 0914h   (Remove SIce breakoints)% U- D+ b! e6 e* _) N
' \% E, x: A# H) p5 p" h  P
Each time you'll meet this trick, you'll see:
7 p! ?' n8 H7 M-SI = 4647h
1 u4 S  x) J9 }5 {% J-DI = 4A4Dh
! s; U6 ^% i& O3 YWhich are the 'magic values' used by SoftIce.5 ?6 j7 l8 G5 A; f. D
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
1 }# k3 B6 n+ a; c  G1 S# S7 ~3 x0 C2 p! i0 T( K+ T0 l) h
Here is one example from the file "Haspinst.exe" which is the dongle HASP" p& O+ ]/ A4 r! Y5 P
Envelope utility use to protect DOS applications:
, L- \1 R0 _/ ]. K7 z+ W/ ~
; b( k$ R/ w, a; _/ k+ j+ {
: W/ Z) x) Y3 a; T8 G1 v# v3 j. V4C19:0095   MOV    AX,0911  ; execute command.
; U( V- `2 J3 s. z, \# Q+ ]4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below)., d7 Y8 G: j$ |& P
4C19:009A   MOV    SI,4647  ; 1st magic value.  b- Z' r9 r8 W( Q" B! `' b
4C19:009D   MOV    DI,4A4D  ; 2nd magic value.
7 }/ @) ]9 ?" F5 ]4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)9 f9 n; d' T) w0 ]# j5 I
4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute
7 ~3 W9 T( X5 G9 b. ?( Z4C19:00A4   INC    CX+ c6 F. ]8 U4 B( e
4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute3 @( b: ~. C/ X8 }0 J: `+ V8 _! @9 F
4C19:00A8   JB     0095     ; 6 different commands.
; W! [0 \8 |0 `( \& p4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
4 s4 d" W, b5 z4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)4 U% B+ G7 s" E3 T. U* q$ X" @& x

2 E; N7 G+ A' L" KThe program will execute 6 different SIce commands located at ds:dx, which4 w5 `6 R0 R9 S; i- s; j$ t- Y
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
5 n$ `4 ^- k  h* C% {9 r4 @, I8 B& u1 X
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.8 C& E) [) w7 ?" t2 L8 i+ C8 K
___________________________________________________________________________1 _5 q3 t# |7 E
  |$ |* _! U6 L9 A3 U8 a

, x5 M1 d" b3 d4 V: l8 ?Method 03+ S9 ]$ o* ^" u$ @/ ]3 N& w
=========! N$ z  ~: |$ R

( F  F- m. y+ e7 KLess used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
5 x) {$ Q7 y- D8 N6 E(API Get entry point)  `5 f: N; I% B  ~7 |
        1 }4 J$ J8 j& [; z

+ R6 G3 |2 J' u9 x7 d    xor     di,di, f  g, }! W% Z+ X  |
    mov     es,di
* w& V' L. s" n( r    mov     ax, 1684h       / I' O/ @' w6 G5 M' G1 y
    mov     bx, 0202h       ; VxD ID of winice
7 L; a" V' Y  n6 I4 q. Q    int     2Fh$ j0 P4 v# N4 V+ A$ e, U
    mov     ax, es          ; ES:DI -&gt; VxD API entry point
* {7 _5 x# N& b$ N7 o1 ^    add     ax, di
( f5 y! z3 h: p9 P) }( Z    test    ax,ax
( e4 H& Q1 p! `0 B" [- H    jnz     SoftICE_Detected
$ l( i9 G' r; J, l* o7 w% ?6 g( H; n3 l! f; r5 Y
___________________________________________________________________________
8 M' O; S- ~7 L
1 U: k) ^0 h' `+ M, \Method 04+ L! T9 f( K! ~& J' N- l
=========' o+ E; I0 v2 P

' I% q- I. |& [Method identical to the preceding one except that it seeks the ID of SoftICE; U! d$ c/ [- X3 s6 b( ^9 o/ X
GFX VxD.4 A, b0 P6 z( n. H2 W$ L

5 m. _# J# N/ }5 h5 P; v# U. w# s    xor     di,di3 v7 g/ P2 ?. E4 z* [- x
    mov     es,di
& e: R" O: d* i    mov     ax, 1684h      
$ V8 N7 I! b$ Z- Y( x& Z% a1 Y    mov     bx, 7a5Fh       ; VxD ID of SIWVID( ^$ Z; Y! J* C, }# ^3 I6 S5 W
    int     2fh% i1 b1 B8 |2 \7 ^6 o& d, P7 w. B
    mov     ax, es          ; ES:DI -&gt; VxD API entry point& u& K; r2 ^  F2 @
    add     ax, di
3 }. G% K2 u' U% n/ A8 m    test    ax,ax( F( ~4 G$ t1 R6 ^. C) p
    jnz     SoftICE_Detected
9 p* X- b1 H2 e. a" ?2 ~( o
/ }3 p5 b2 W3 x/ x' i- |2 A  K  J__________________________________________________________________________
3 [0 x* J+ w$ C) L) V6 @$ t2 a( `* R3 ~8 b% m# d2 {! J
* I% _8 ^# u5 J" @' X- E
Method 05! H9 O  _; I& r/ I7 b" V- ]2 `
=========
: q2 v0 w2 E8 R0 X+ p* u( ^; h5 Y- J4 Y# t, G% l: r! ^
Method seeking the 'magic number' 0F386h returned (in ax) by all system, K& g4 Z4 ~3 Y2 F4 X/ `
debugger. It calls the int 41h, function 4Fh./ _. _6 R# [- ?) d
There are several alternatives.  
3 @9 X1 J+ L4 v' l+ l
: p0 t" c9 F) N5 Z$ n/ ]4 qThe following one is the simplest:3 C; {* {' `: V- ~; l" [
" i2 F0 m% s4 u  D
    mov     ax,4fh
" I" g# b/ a7 ?. V* t. L    int     41h6 N# i* t- ~/ m& R1 b3 q" a
    cmp     ax, 0F3864 ^0 t  h9 D, I0 i
    jz      SoftICE_detected; u9 C9 A, z6 x) x

: \: b' C$ |$ d. T  f
& b- |1 L% m  `7 ]. }3 X5 xNext method as well as the following one are 2 examples from Stone's " K. J" G7 k0 R  g6 S+ d. g
"stn-wid.zip" (www.cracking.net):9 \! }+ p. T' z, q, u1 M8 V1 T8 r- d
! w$ g6 s8 Q2 I+ A
    mov     bx, cs3 O; q0 o- t; f0 U, j
    lea     dx, int41handler2, J" Q# e7 l( b3 a/ F4 R; _4 ^. [7 d* w
    xchg    dx, es:[41h*4]  s& j. `% i* c6 ~3 q
    xchg    bx, es:[41h*4+2]) c5 I+ V6 D2 e/ r( z: X: T
    mov     ax,4fh" A% ]6 K9 ~, \) I
    int     41h5 b3 P- m: y/ s
    xchg    dx, es:[41h*4]
/ j8 u" _3 [+ A# `5 Q    xchg    bx, es:[41h*4+2]
4 M+ R- J" I; g! ~    cmp     ax, 0f386h
) K1 X0 k) u# J  I* N    jz      SoftICE_detected
7 ]4 u3 |, G! \5 w! d# }8 M+ {
7 @' C; t4 t) k+ X* |) }+ rint41handler2 PROC1 P/ q$ V* j. y4 L; L0 f! Q0 ?7 N
    iret6 K% c: L% R7 A4 U+ \
int41handler2 ENDP
+ L* I$ A" N- U  X
5 g* m. V+ P. M# L
! k9 X: c$ C4 ~' q) __________________________________________________________________________
1 ?1 w1 p! v5 y8 T
$ A1 T$ D' z1 b: b! c4 r* p7 Q: T! v% i; q" Q. Z7 e
Method 066 k5 h: F- e8 n, I
=========
& G5 d- g# [) _8 z) ~' a. |7 P7 n- r; T2 {  \2 P8 D7 j
4 m1 s  \; U6 E% ?, S
2nd method similar to the preceding one but more difficult to detect:
+ s3 S3 @" O! n/ d  [% P: d' [2 {; h3 {  {6 D, q, |; l8 @
  i5 p( U- E- f6 a! G
int41handler PROC" D5 o9 _5 s$ y2 O
    mov     cl,al
$ v0 T( t3 B( `( O% @    iret
5 |3 z# q7 d- J2 l3 |# `int41handler ENDP% _- F, _- \) M

. P2 }; m, G( @0 b
4 o" t. e: G8 f4 f6 G5 T    xor     ax,ax
  @. U4 D( ~8 Q" B& y. G" R8 ^    mov     es,ax1 b7 j+ K: A5 S) A4 u/ I* k
    mov     bx, cs5 {- ?0 ~' `+ I0 f  p2 I7 M7 N
    lea     dx, int41handler" z" E7 S! I$ {# ]$ K
    xchg    dx, es:[41h*4]
" P7 C! J  A& x% ?; r) X/ c    xchg    bx, es:[41h*4+2]
) p2 c% T  _# R: K/ ?5 g' Z7 q    in      al, 40h2 ^% p9 d( k7 p5 ?1 t9 T
    xor     cx,cx0 @; l) {* w2 n' z( Z
    int     41h0 t3 _9 w' A4 [/ q4 ~% l
    xchg    dx, es:[41h*4]
5 E8 ]  h0 M9 a/ z9 d    xchg    bx, es:[41h*4+2]
( `& `4 E- n- F( G6 A    cmp     cl,al
2 y7 F% G6 a& _7 h    jnz     SoftICE_detected4 S* H% T: b+ G8 `+ R

) ]8 J) f# G1 @_________________________________________________________________________% r! W2 {4 ]' |7 F

9 m* `' S( r8 U! P5 W: qMethod 07+ k/ ~  K. H# M& d  J5 \
=========. g/ K5 p, Y' v  c( n# j/ C: [, n

4 }% j8 Q( ]) i0 f; WMethod of detection of the WinICE handler in the int68h (V86)) O; a2 f: f/ y9 M8 J
8 e, G0 e& I2 U! j/ b
    mov     ah,43h3 q% ]' X; w$ J& _/ G5 z
    int     68h
9 M* `3 _  ^' r    cmp     ax,0F386h/ C# a1 @! a6 d" @, r
    jz      SoftICE_Detected8 @, J! o7 i2 a& D5 @
$ m  P# O: [/ r$ t' U  _
4 T6 E2 \: b3 o2 S; W3 P4 k
=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
6 Y2 D7 R! r! v" |   app like this:
. t# t& S, J, k& }9 @0 g9 F7 g
# B7 n$ G! z# E   BPX exec_int if ax==68' t# j  z+ O9 ?* u4 R1 P9 M( W
   (function called is located at byte ptr [ebp+1Dh] and client eip is
  }5 F3 p9 F9 l3 S" l' O   located at [ebp+48h] for 32Bit apps)
1 N7 Y" |8 W  y: L__________________________________________________________________________
* e0 U* v* |' s! P: b6 V6 ^; g
5 V- E+ j" r' U) H9 @
; h4 l# h2 ?4 p% k6 L' b6 NMethod 08
- Z( \) Q$ f, o7 i. v- _1 o=========- G. g0 o& E% q
. a. G* g: q) z7 T
It is not a method of detection of SoftICE but a possibility to crash the  f  \/ e3 Z3 s% A' g8 Y, }' B
system by intercepting int 01h and int 03h and redirecting them to another
% E, b2 s4 n1 U6 |% f( |) q! Jroutine.
& B3 |/ G; |" e0 R1 JIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points+ k- ~, Z7 k, m
to the new routine to execute (hangs computer...)
, H1 J0 A, q( r6 |- V% @
# C2 E2 I8 s% K    mov     ah, 25h
$ M4 d, l' L  [$ A3 i    mov     al, Int_Number (01h or 03h)
% n/ B( G! k( n4 j) X0 W! U1 H" h# b    mov     dx, offset New_Int_Routine
. X1 }: p, R! |    int     21h* c6 _" j! n1 L( J; z- t
! H: m9 B" k, ~0 Y$ |3 E
__________________________________________________________________________% i& M) X$ V8 V8 |! q. w

4 l/ I: f+ z* l5 J4 {* X! ]( PMethod 092 a, Z/ Q7 }0 s
=========
2 C* e0 I# V0 K) k' H% z- o  |# ^* B3 r' f
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
8 x$ l: ?% k. g. S+ H4 }performed in ring0 (VxD or a ring3 app using the VxdCall).
4 {5 |1 h( h  n- O  QThe Get_DDB service is used to determine whether or not a VxD is installed* f' D9 e0 M# t% m
for the specified device and returns a Device Description Block (in ecx) for
* P) c8 p) y5 ethat device if it is installed.
& F) [! p' J8 J3 h( h. Y1 q
% y' i8 {. n. x0 ?$ }; d6 D, _   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID# _: i7 o+ b: n: Q
   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-). k6 G& N! _4 j  v$ n3 ]( k0 b) O
   VMMCall Get_DDB
3 n# N# P# v. j* T$ _   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed
6 q& k& K* m9 c+ M! K4 V# w3 Q1 j4 |/ g9 n
Note as well that you can easily detect this method with SoftICE:
0 I0 ?! n- u" H9 D5 y/ t8 f   bpx Get_DDB if ax==0202 || ax==7a5fh
. Y5 v8 k3 p6 }& V) E2 E. l9 A: e) T* Y) f6 U5 d( ?/ @
__________________________________________________________________________
' l) u+ s$ Y/ `; d. |) h  a9 f
( H8 {9 I0 ~  ?( @: ^Method 10/ q% \" U, O- H) {
=========- U6 t. O4 Y, l, P
7 ^, ^8 F* |8 [: k* d1 O
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with: M0 m% A, q5 d9 y! X8 ^4 t5 s; p
  SoftICE while the option is enable!!
* K; y) m  F" I2 f+ B! l# u- w. z' V% L
This trick is very efficient:% O; A8 g( C! I: L9 H1 u9 k+ ]- F
by checking the Debug Registers, you can detect if SoftICE is loaded
' X% u% B3 I2 v0 W* ~(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
3 e% E1 @; j: v+ H9 T0 Lthere are some memory breakpoints set (dr0 to dr3) simply by reading their
2 ~8 t- a6 M) |3 _value (in ring0 only). Values can be manipulated and or changed as well$ ?* Z; |& O' F, [+ a7 U4 J
(clearing BPMs for instance)/ |( i+ W1 ~8 r
6 p4 Q( i( R: ?& ~
__________________________________________________________________________6 V" m- k) M4 u! j: A  r

4 M$ S% i( W. I/ ]+ w" E5 U) m! |Method 11  |4 I( I" |% t
=========
# M& {, W7 v5 ]/ Q6 r- G! q+ }" i4 j9 j' c( A8 E
This method is most known as 'MeltICE' because it has been freely distributed2 t! L6 E; V# C* _. ^: P) w
via www.winfiles.com. However it was first used by NuMega people to allow3 g8 n) a  B. P( Z6 F
Symbol Loader to check if SoftICE was active or not (the code is located
1 X# l- ~  c7 O& N( `. Finside nmtrans.dll).
" B. S* w5 l1 F
5 g6 I# t$ p1 W, Z& h# FThe way it works is very simple:
  l* ^  Y; P* z# y9 {It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for' d" p+ Y7 z- ]! U' b
WinNT) with the CreateFileA API.
" L1 C; s( h3 Z9 ^2 M) J
/ r: H; R8 v9 u! d2 {Here is a sample (checking for 'SICE'):$ `- u4 G2 S  J' y$ T0 b% K

, y) e, O; j3 j- S5 r  GBOOL IsSoftIce95Loaded()$ u5 X. J# j2 p' ]9 C
{2 @" N! M8 s! i$ f- z; n% ]
   HANDLE hFile;  
' p& T( C0 j+ p3 z) E( I+ a   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,: N3 m. Z8 v8 |" l0 I' u% t
                      FILE_SHARE_READ | FILE_SHARE_WRITE,
7 f! C) q, ^. s: r6 F                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);, D: ], ?( S# ?& k
   if( hFile != INVALID_HANDLE_VALUE )
" x7 ~; {, R' Q3 M, l- H: h   {$ [+ [+ ~9 f# a9 R
      CloseHandle(hFile);  F/ ^; E0 z3 k. v8 p" ~# t% \
      return TRUE;; Y& o+ e. \* T$ C9 J
   }9 ^# v5 _" h( h  t$ h* ?
   return FALSE;
0 D2 l2 ~  }2 V}
. G  ^$ `8 A! C* y( l# f7 s/ C/ F/ T; o9 N# ~
Although this trick calls the CreateFileA function, don't even expect to be
9 c! V5 x& F- Q! u% g7 mable to intercept it by installing a IFS hook: it will not work, no way!
0 \8 @( v* L( I: j6 G6 Q- r) yIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
5 }( O9 _2 y- R5 C2 d# a% y6 {service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)9 p0 M* ^  e4 e
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
0 v$ h2 e& Q- W5 tfield.% l( U: i6 O' _& S6 s. @
In fact, its purpose is not to load/unload VxDs but only to send a
2 R; n" [- C% o1 ZW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)/ K1 l" a$ D  j7 q: f
to the VxD Control_Dispatch proc (how the hell a shareware soft could try9 y! d; C3 f- D% G; ]
to load/unload a non-dynamically loadable driver such as SoftICE ;-).- U6 y8 i: o3 Q* D1 `$ d* Y
If the VxD is loaded, it will always clear eax and the Carry flag to allow5 g! H- U( t5 {: Z
its handle to be opened and then, will be detected.
: `. `8 @' m: G; I  z; f5 b) `" SYou can check that simply by hooking Winice.exe control proc entry point
  L: w3 B( H0 O+ A9 dwhile running MeltICE.
9 Z# v9 o* j9 f  a
4 s/ e6 O1 G. Q+ W# k) x5 @7 R( K. T7 R) {4 O) T
  00401067:  push      00402025    ; \\.\SICE
$ B3 L$ o1 x: P5 m& H& A  0040106C:  call      CreateFileA9 m" l# s+ i& `
  00401071:  cmp       eax,-001
, C4 C  J: v9 Q: f/ l  00401074:  je        004010918 ]- N; Y) S. ?0 p) _: \' k

; w5 J; x3 `; e; M/ x
8 Q' s* f5 M, w9 W- p$ vThere could be hundreds of BPX you could use to detect this trick.7 ^4 w: v$ Q1 V5 ~/ G8 n
-The most classical one is:4 }4 D0 ^/ R, s! M
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||# p- i7 v6 W+ Z/ Z4 c. u. f! b
    *(esp-&gt;4+4)=='NTIC'+ c* `! V: N0 `! f

0 l7 o7 j: l3 }# K. r, ?- g-The most exotic ones (could be very slooooow :-(( j$ J/ S6 B# ?7 W- t& r* H
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  
2 g0 N3 L' q( l- A7 U; |- Z6 X     ;will break 3 times :-(& m6 p. j! Y# y. T# q) q* T/ `
% M8 \9 T1 j  l
-or (a bit) faster:
! F; n: J) t, |  w* n4 R* I' T   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')' W  |* |9 f2 J% x0 P+ F8 o
' K) l0 k* [0 Z+ U, h
   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  7 e" t, s% e: |' m& t
     ;will break 3 times :-(
3 [$ }& m6 }% b0 g. \. Z) ^, b) f" x; o
-Much faster:
( E1 a4 x+ C1 I" K: N/ g3 e! w   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'' r) H4 [  e( m) L, v' p" i' P& Y
9 S1 t0 D% Y0 w7 T  o0 k  W% p
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
- D9 L7 x) i  _' ~. K- D+ E. E. Afunction to do the same job:/ ^4 z' f) \! e. F0 q
# {7 n: M% v% J0 X* @
   push    00                        ; OF_READ3 G' o2 ~2 C' B: ?) G
   mov     eax,[00656634]            ; '\\.\SICE',0) [5 i  t- A" S
   push    eax" o, O9 V2 w& s7 Z  }9 V* m: h
   call    KERNEL32!_lopen
* f  @$ |) E$ \5 d. p" c9 _! j8 P   inc     eax
" o0 `! d$ {+ p, b' }   jnz     00650589                  ; detected
' Q* O3 B( I2 q; H, b2 Z3 w6 r   push    00                        ; OF_READ7 o' P2 r4 ]! `) d
   mov     eax,[00656638]            ; '\\.\SICE': T& V5 G& z1 T
   push    eax
" o& v* |" G1 c/ @2 a% r   call    KERNEL32!_lopen
' W. N, S1 g6 f7 r- _/ N   inc     eax) c- i! v( v  @, s' U
   jz      006505ae                  ; not detected, V' U4 o. A- T" V6 Q5 l+ c

6 Y, u3 F6 Q9 d; E# k' }' N% F! \; j0 X9 ~6 |+ \/ I/ i. E
__________________________________________________________________________: a4 h; o$ h0 Y
, `" L4 J1 {$ j# ?  u7 I4 O  }
Method 12
: h  ?7 j) t6 B7 Z=========
/ d+ e4 M% z- N5 E
# W+ e2 I" ]( q" f3 V# I9 i: dThis trick is similar to int41h/4fh Debugger installation check (code 05
$ a1 M6 P# r1 s* W% B) K8 X- ]&amp; 06) but very limited because it's only available for Win95/98 (not NT)
8 Q9 y- M& Y  r; T  Qas it uses the VxDCall backdoor. This detection was found in Bleem Demo.- J% r1 A: Y3 P2 v

5 @; {+ @2 j9 S" i9 ?   push  0000004fh         ; function 4fh  O5 ~/ e* \# L; U: Q
   push  002a002ah         ; high word specifies which VxD (VWIN32)) ?$ x9 M7 e& v
                           ; low word specifies which service: c& g+ g  |7 A
                             (VWIN32_Int41Dispatch)
7 ]  N8 Y3 o% |& k) k! P   call  Kernel32!ORD_001  ; VxdCall
1 A8 ?5 O4 |. h9 o0 J   cmp   ax, 0f386h        ; magic number returned by system debuggers6 |% T) j& K( z- `- ^; t" z  A
   jz    SoftICE_detected- Z: \$ u+ z- n* s' W4 e3 e. R) N. [
3 r% W, p) s- {6 n7 h: q, S
Here again, several ways to detect it:& A3 h# Z$ l1 n; [, h) I+ a2 e" s

4 H. g- k& m, G& `$ c    BPINT 41 if ax==4f0 Q  _9 w& J2 Z; A  n
7 l% g. \0 f9 g6 E
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one
+ N7 t0 B% \5 @! q' S  x& ^1 K9 t- z  c" j2 T
    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
  \  F$ _7 o) l) }$ Q( x0 p" c" _3 {2 n3 @
    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!3 @/ T# n, z7 Q* e1 n) y: Q
# B5 s. Q8 |1 q  I  v& n8 n
__________________________________________________________________________4 V. O, ?7 r9 ?! e+ D

7 s; K/ u  t% r$ J9 [Method 13
0 M+ X) K+ R4 ?/ A/ G4 f1 ]) g8 b=========0 h) _3 a3 ]' A. r/ ^; B  s$ u5 }% N2 y

! U, S7 S7 _# L- K1 p- V0 HNot a real method of detection, but a good way to know if SoftICE is8 E" \4 a4 r/ F& o: `
installed on a computer and to locate its installation directory.
& o; o" ~4 l0 W7 w" z. s0 SIt is used by few softs which access the following registry keys (usually #2) :7 D; Q6 G. h8 I) e1 u
' V4 l& d5 n7 L: E
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion& c* B6 P+ \/ u* A
\Uninstall\SoftICE- f6 K5 m9 g! ~& p: ]  y
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
7 a& \4 e* }0 A* T7 \-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
0 u" Y7 h$ Q3 v; B) G* w0 n4 j9 ?\App Paths\Loader32.Exe
* |+ l# `# v: T0 t( @
% Y* P! F" a" n4 O3 L7 k0 L
3 O- A9 \* d- {) {- y, I* INote that some nasty apps could then erase all files from SoftICE directory, J8 N9 B+ c1 I
(I faced that once :-(
/ v' f' a0 N: x6 E9 e2 Q  a+ F+ ?* A$ p5 i) Z3 E* W+ s
Useful breakpoint to detect it:8 K3 k. N& k4 g$ {2 \  Q  a

% @! R# e$ _& e3 x* j% j1 p     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'* P& A1 C  X* p- m7 {' d

2 y! G; U0 y4 c- w* l+ P__________________________________________________________________________1 G* F: s0 V& H; Q. H' s2 W
3 |  C% l6 S# c( l

1 X: P! }7 H3 X0 e' V7 j6 n/ @8 i+ sMethod 14
% n# L) M& [# _" R  D=========4 j/ `) ~- s* f9 i

& o- M6 z8 t: f, Z" iA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
6 ~7 @3 C5 x+ D' ^. n& K2 ais to determines whether a debugger is running on your system (ring0 only).
) M' i% H7 O) ?$ W5 l7 K0 _$ t- W# D4 z. K" x) n! [( H2 G
   VMMCall Test_Debug_Installed& Y9 Z9 `$ ?' U* A7 A. ^, ]2 N; \7 s
   je      not_installed
- h, Y3 }# V  q9 Z; w: I: p
7 ]$ @" z; q7 S/ T) u- P2 ^This service just checks a flag.8 y7 a8 E$ g6 C! s' o
</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-1-27 18:13

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

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