About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>1 z" k0 c0 e5 q1 o
<TBODY>- t! N! {$ T4 i8 f, D/ c
<TR>1 [* W8 s# {, x5 X0 z4 g
<TD><PRE>Method 01 % j; f) x/ B- R, C7 q3 @. m
=========( q) ?# T3 e0 t1 [3 @( x/ h
! q1 ?- n, m! f+ h& M. {
This method of detection of SoftICE (as well as the following one) is
: p% a7 B7 Y3 G9 U  C+ c( Oused by the majority of packers/encryptors found on Internet.& t- B; |0 w$ T
It seeks the signature of BoundsChecker in SoftICE/ n  b& ?1 G+ t7 o  s% [
4 x" {6 w8 e( O% h$ m
    mov     ebp, 04243484Bh        ; 'BCHK'
$ }; Y% E% o! _! I2 Y    mov     ax, 04h
3 a' f: u$ N2 y- K    int     3      
- E9 r5 d, v; x; K    cmp     al,4$ t9 b1 U# D& x( f. N
    jnz     SoftICE_Detected* J4 E6 s7 j& P2 e) O/ K$ R3 f- R
4 W: e$ O9 W! c& N: A2 m
___________________________________________________________________________5 K5 K, p9 k" E) M( |8 T7 d

- s- r3 q% R/ ~( D! GMethod 026 I( a9 ~' [' n2 l
=========. ?# h2 u+ ?8 O2 L4 s
$ C( a  a1 i3 R( K
Still a method very much used (perhaps the most frequent one).  It is used" F8 j7 Q6 W+ d2 [, [* U% ^. V
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,9 T4 ?# P1 S/ ], h8 t: c
or execute SoftICE commands...; S* `5 H9 B. H9 _; X. a' D
It is also used to crash SoftICE and to force it to execute any commands
, `( O- V7 h5 ^1 |(HBOOT...) :-((  
7 {9 V5 P+ U  k4 b8 y5 [6 ~& H' o0 ?2 n2 w' `1 ^$ C1 P
Here is a quick description:
1 n; f  u7 }( c+ c-AX = 0910h   (Display string in SIce windows)8 `' [" X: I! N8 i+ _! h
-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)( Y# N, ]. B9 B* V
-AX = 0912h   (Get breakpoint infos)
6 W/ ]0 c% y. |" c# P-AX = 0913h   (Set Sice breakpoints)
+ Y6 ~+ p4 z* S5 e5 R3 v-AX = 0914h   (Remove SIce breakoints)
( l$ G7 D/ I8 [
$ q# q3 Y% }' V, ?# Q/ UEach time you'll meet this trick, you'll see:+ l7 N8 z9 o. L2 N$ }8 n1 Y, a+ i
-SI = 4647h
5 G- G" F2 t3 T, W7 i: p-DI = 4A4Dh
- R/ L8 t+ r, Z: r3 K. a' W- m$ MWhich are the 'magic values' used by SoftIce.3 y" ~' \/ t, V: i7 _6 Z, C
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.$ V" j  N+ W9 I$ ]

+ B0 t( f. Y# B. x$ d: G6 ]1 s2 W/ F* mHere is one example from the file "Haspinst.exe" which is the dongle HASP: P) ~$ @4 Q4 n" {# N. j
Envelope utility use to protect DOS applications:7 w3 u- h6 P4 i8 H0 s$ T: j% I; C
0 k& T+ d: c4 e: F& \' U
" b+ N- G. E0 y  o9 ]* V. x
4C19:0095   MOV    AX,0911  ; execute command.
* V! T1 Z( o9 b# o3 r" r4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).4 n* M+ c' P' u; R3 g0 t. Q6 c/ A- G! D5 }
4C19:009A   MOV    SI,4647  ; 1st magic value., o6 ?' {! @. v3 {! A. b& a: \
4C19:009D   MOV    DI,4A4D  ; 2nd magic value.' J6 Q3 `1 L2 [: V  F0 r+ v+ d
4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
- A0 q: |) k0 h, d" C1 c  V4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute, u, {1 n8 N/ M! F( C7 O
4C19:00A4   INC    CX
/ y1 e' F4 b7 b9 C; ]4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute7 p5 Q! [3 Z# b% V
4C19:00A8   JB     0095     ; 6 different commands.0 B+ u& ?8 _5 p4 t+ X" q
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
! J6 m. a: R  W5 l) p  h' W4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)
' `( d5 V: {+ Y6 H0 \$ d, @# m% r! y# o0 y
The program will execute 6 different SIce commands located at ds:dx, which9 r1 P. r& h9 F+ |; k
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
. @, o" ]+ B5 P/ C
4 |% F5 x! D# E5 I* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
1 P$ q, ]5 u% N5 _6 W+ d& Z! \+ b$ Q6 Y___________________________________________________________________________$ n4 e- A; K3 f, {

) y( e  ?  @( @# K
3 r6 U! Z6 \; B- i" b( @1 wMethod 03
1 ]/ g* w/ Z) u0 o' y! c6 c=========
' q' \/ [8 t! }# X7 o  H, R* K6 Y& L! m
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h( G! O+ n3 ~; f& l% Q: {. O
(API Get entry point)% f1 B  I; k5 ]4 Q, m
        2 \+ D0 a* H( ]

" _/ D" Q/ q$ n, V+ I3 H    xor     di,di: S; d" z, e0 o% \0 j
    mov     es,di) |1 e8 M/ H" v1 W- G& f# @/ z2 f
    mov     ax, 1684h         `4 D' \5 |, w* d' Y9 n* e- z0 c
    mov     bx, 0202h       ; VxD ID of winice
: F! b, C% `! y/ {# b1 ]5 Z; A    int     2Fh
: D9 @1 T# G( z) m( i    mov     ax, es          ; ES:DI -&gt; VxD API entry point
$ k& d! x6 i4 ~0 V# F; b  n# A    add     ax, di$ j- n' |4 [3 F/ ]+ ^
    test    ax,ax) H' v/ ~% |% G# [8 z( M& g
    jnz     SoftICE_Detected& M+ L5 W# b. I* N7 i8 m
# }6 ~; F" q8 s* O  \
___________________________________________________________________________
) W' }4 V5 C! A) K/ a' H% X1 @
; \: T2 {8 O7 u" T/ C/ L1 B. U3 ]/ vMethod 04) T4 v6 W3 P8 ~
=========
( o& B) H' }* d! a" N& k& N) i% a( }/ X8 G8 S6 @! q# a1 u* P5 z6 N& q$ Y
Method identical to the preceding one except that it seeks the ID of SoftICE
7 t" ~. K7 w8 b. m1 {9 s  L2 kGFX VxD.
9 q3 a5 v' q( f* C$ ]( `" I# D7 ]' c+ u" `. i. g6 a) B5 U
    xor     di,di- A8 f+ L3 l3 a! V
    mov     es,di, }9 J1 f+ f8 y! u- S. t" [" R
    mov     ax, 1684h      
  H9 @5 D' W* N5 [3 k% z  j    mov     bx, 7a5Fh       ; VxD ID of SIWVID! B4 D' N0 [2 G3 s! h6 E
    int     2fh* [* l( ~/ ^9 I" P2 z6 H9 \8 V
    mov     ax, es          ; ES:DI -&gt; VxD API entry point
- }. w3 Y4 T5 b' b! F9 }. s    add     ax, di- ]) A7 _7 P/ h* |3 l
    test    ax,ax
# f: c2 Y- Q. ]; N' }5 X' q1 P    jnz     SoftICE_Detected# v# p5 V$ j# `- l

& {" R, e- m$ V( z__________________________________________________________________________: b4 G  c& V+ w4 I: r8 }
. d+ J- l% S) @5 D5 U" K

# d+ N7 v( r+ c' i, y3 Q/ A9 PMethod 05* o. q8 M% i' I3 l+ ?0 _# K3 \* T, F# k# b
=========
. T* ]4 m* b$ L9 P6 {3 S, o7 g) V% e2 s& l9 D: w8 n
Method seeking the 'magic number' 0F386h returned (in ax) by all system# N% \+ y3 ~5 S+ x3 u: b) @& i
debugger. It calls the int 41h, function 4Fh.
2 x8 x; T, u2 @* m  tThere are several alternatives.  * @/ b8 ]" C3 z# Z

" F2 x0 e& H! n" rThe following one is the simplest:
: L% h. K" G$ ]& X
- U: I3 x: Z" d5 N% s; ]    mov     ax,4fh
7 \! g2 U  w8 J: i( ~    int     41h, j7 j* v; x7 Y, V( w
    cmp     ax, 0F386" u; g0 O  f' T2 M6 T6 h2 S" |
    jz      SoftICE_detected; ]  A% N% o) n; }4 b- Y; m0 ^

/ G+ ]7 a6 r1 y# \2 {$ z9 w
9 V: X+ W! }+ T% E; VNext method as well as the following one are 2 examples from Stone's
1 V3 p( T) N4 F, D# [( C"stn-wid.zip" (www.cracking.net):
% {9 {; k% V# E$ r. x: T2 B% {( p" v7 R) }6 r. A# J1 G
    mov     bx, cs
8 ^5 \" f+ L9 O8 W' J( R    lea     dx, int41handler2. A& E- o1 z3 Q5 W5 }0 m) E
    xchg    dx, es:[41h*4]( Q& T* v5 B! f9 b# Y$ e; p
    xchg    bx, es:[41h*4+2]
3 j2 _3 L# A8 l6 P/ v) L    mov     ax,4fh4 s$ C' Q5 _7 I$ \7 `
    int     41h2 C9 V) Q6 u' _! m; [* J
    xchg    dx, es:[41h*4]
. Z2 q! z  n/ q/ b    xchg    bx, es:[41h*4+2]0 G, f4 c3 k+ e8 q; a9 n8 f& L& f
    cmp     ax, 0f386h
, E  M5 x" n- D6 {    jz      SoftICE_detected
) h, i- D0 A7 R+ N8 Q. b: C) z% {" o
int41handler2 PROC
+ |: {0 I* q5 X. M" V" L! Z) K/ D3 {    iret+ {, ^. M8 c6 U
int41handler2 ENDP
% A8 M  {9 |1 k  l# ~0 K2 H: v4 U4 P" V8 I
/ v( e1 E$ J6 Z6 L* s  B) n+ y' U9 S
_________________________________________________________________________
* K$ M9 M7 p) ?+ o0 O$ C: w/ U- {3 m6 l" K# }. d3 s+ q6 t

0 C% m. i0 M: I" s# e, H+ }4 u: A0 EMethod 06
8 `: p, O, r: ^7 p! h# d5 a% E=========
& h- C/ k4 E- P( H, a- w% N( `- c( k  l: f& p  h

( _" S7 T( d9 L) E. `; {* s* J2nd method similar to the preceding one but more difficult to detect:
; Y( a  ~1 Q; \( T0 ?
/ i  u* b4 ?# \& f' ]8 m' Z' c- ^& V# E3 Z* Y
int41handler PROC
/ v2 ~0 p, T5 k- d    mov     cl,al
+ b1 H5 O) I" ~7 `; u* [* f    iret
  ?- ]0 ?  D/ a- \int41handler ENDP
4 E) N* f6 A% k! k7 M! i( _  X
2 r* t, o) Y$ C8 o# r& D1 u1 l
- u" E6 z' ?. _5 Z  D9 k) a% T" E    xor     ax,ax
( S. W: K" }8 j0 g    mov     es,ax
  M: |9 N$ x) |9 n( m4 @. y    mov     bx, cs1 w: F. L! u- u9 v1 _
    lea     dx, int41handler2 S  e3 M0 J5 _! w1 p; M
    xchg    dx, es:[41h*4]
, n+ m2 Q9 A7 f    xchg    bx, es:[41h*4+2]2 |9 D* `+ D3 S9 [* i) }
    in      al, 40h! [. P' P0 E$ ^% O  c
    xor     cx,cx1 K7 o& j" W( Z4 I% k* d7 }
    int     41h
+ B% s, K; V8 c$ j! c    xchg    dx, es:[41h*4]2 m, |$ o+ i& b- |1 x9 t
    xchg    bx, es:[41h*4+2]
! P8 O9 o& X/ K; ~& h; S, _    cmp     cl,al: K4 M# t! x4 A4 e  r
    jnz     SoftICE_detected
2 X* ]5 ]0 h5 X% M: c3 F4 x0 m' H. y' L" s. {. R! Y& c1 u( W
_________________________________________________________________________; F" M: [8 s% i, C
! A2 x7 E2 N. g* ~3 ?7 O
Method 07, i; D( K+ {6 ^; m: Y' V1 [6 f
=========
/ ^' H/ ?6 S: [3 H2 v, p! t  {: i
0 |7 T" m# U! K  w0 x( uMethod of detection of the WinICE handler in the int68h (V86)7 O" D  h. b5 \% N2 q" k  ]

5 s8 v4 l. n/ A$ f. A* U* i3 _% g    mov     ah,43h+ Z; w9 R- m" D3 F9 Z) e
    int     68h
% n) Y7 p" h4 y6 V6 h    cmp     ax,0F386h) `' B8 k1 e4 G
    jz      SoftICE_Detected- i: _6 D) C: q7 r+ \
; w6 |: A0 G- |7 _

) O  Z/ n1 x$ s  W" F; j  L=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
) K4 Z% Q8 c" U4 R4 ]0 {   app like this:
- z+ Y6 G' x4 h7 k: W! S% O5 `& b9 y9 I  ]. W9 @9 |1 z! S
   BPX exec_int if ax==68: X1 Q0 {- c2 R# }8 t4 Q& L+ }
   (function called is located at byte ptr [ebp+1Dh] and client eip is. {  P( q3 k8 d3 i
   located at [ebp+48h] for 32Bit apps)/ K9 r0 {+ t' ?, C( v1 f9 h
__________________________________________________________________________
$ C6 |  p  D+ V2 n: S8 F
+ a; t- x# z0 _% f! o2 [# {2 O" x- ?! |  B) P
Method 08$ h, A4 F+ v: r8 E4 T7 W+ V
=========, ^+ p5 f" D  e6 \* X% ?# Y8 `0 g# D3 E

+ @* v# x5 T- G8 P" o) PIt is not a method of detection of SoftICE but a possibility to crash the
7 ^4 W2 M6 h5 T4 ^! y8 Wsystem by intercepting int 01h and int 03h and redirecting them to another) `$ L+ M$ X. ~1 K
routine.! D% S3 K% u/ I7 H7 \, ?" I: I$ G/ G
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
6 N) h6 y" C# N0 B& F, M# |9 gto the new routine to execute (hangs computer...)9 W  s* f. P; w- [& Y5 n
  h8 b3 W1 K, v2 `3 F3 N. B; B
    mov     ah, 25h- \7 ^/ ]0 E/ X
    mov     al, Int_Number (01h or 03h)! ~' _6 L! ~& N, q, K
    mov     dx, offset New_Int_Routine
$ b1 c6 t2 H/ t! m$ C( X4 ^* q    int     21h- X  D( k+ H$ u" c3 g8 M9 n% J8 t
3 w  w2 F! y3 u# M5 G% w& f
__________________________________________________________________________0 A3 e' {. V2 u5 t. M9 b
% k, A2 [! @0 S: f; t/ ~
Method 096 K# n5 a0 i) X9 m  ^0 p4 Q4 D
=========5 o& ^* E; O# ^6 D  ?9 Z8 E5 P

: z- Y- X5 n2 ]" h0 R! wThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
$ @# s0 G7 [1 v$ y; i$ fperformed in ring0 (VxD or a ring3 app using the VxdCall).
% `8 W. s- u$ {* g: j% `The Get_DDB service is used to determine whether or not a VxD is installed9 L8 N9 C( {7 d7 ]8 h1 r1 P
for the specified device and returns a Device Description Block (in ecx) for
% C# y) @7 ^6 T" L9 P' b& Cthat device if it is installed.. ~" h1 S' G- H' V2 i. t+ N
. N5 k# |$ J+ Y/ M5 V! s9 A9 C0 i
   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID
; r& `$ v) f; c2 S9 P9 R0 X5 i   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)' ~; K# \* P) [* J1 [% e" Z; |
   VMMCall Get_DDB
- v7 E$ u3 @5 E$ R4 H   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed* a2 k! V: U/ s) `! g
, t3 T9 S' B9 e6 {% @  g
Note as well that you can easily detect this method with SoftICE:$ P3 i7 h8 d# S
   bpx Get_DDB if ax==0202 || ax==7a5fh
4 f, R& |1 B% N! ~& o
' E0 Y$ k# H* N5 Q: N2 B  R__________________________________________________________________________
+ j/ D- O3 e0 C$ E* M) u0 B' m" v3 a- }" s  U8 G  E5 W
Method 10; J" }0 A& ^. w) z- n" y, _( y
=========: r# }; e* q% s7 `2 O$ v& t5 y- `) i

4 p: m1 P8 m& o; r: }=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with' p' i% w0 j9 W# ^
  SoftICE while the option is enable!!
; n+ T, l% u, Z3 P2 |/ k6 H% R6 m  Z9 t8 d/ \
This trick is very efficient:
; P/ [3 b3 x2 s6 }, Eby checking the Debug Registers, you can detect if SoftICE is loaded
" r- P, n9 Z& j1 `/ Y% K(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
# Z/ G$ U1 f) j6 m6 fthere are some memory breakpoints set (dr0 to dr3) simply by reading their) C2 F# f* |' h$ \) j" Z  _* e2 \/ v/ q
value (in ring0 only). Values can be manipulated and or changed as well
# `4 _* R9 r* m+ v(clearing BPMs for instance)  L5 N0 z' N6 Q) c8 K1 B
4 |" ?1 p' e9 G9 }3 q+ F
__________________________________________________________________________
9 [2 x5 s4 r, {$ ~
, b/ d% k2 B3 fMethod 11
: D5 h% I+ M! W& g9 \8 B9 u=========
* h% ~0 F$ o, M+ e, r
( D8 }+ d; l$ L/ tThis method is most known as 'MeltICE' because it has been freely distributed# W6 G) O$ Q; Y( ^, ~
via www.winfiles.com. However it was first used by NuMega people to allow
) l6 W( [& Y, W# t7 v. ]: |Symbol Loader to check if SoftICE was active or not (the code is located/ ~3 \% u' }0 F8 h
inside nmtrans.dll).
- Y& ]$ _! n5 A4 }: g8 D; e* {; }) `9 ^. C( c- W, s/ C
The way it works is very simple:
7 M( n6 \/ E7 K1 `. E1 dIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
$ k- W% d/ l6 O9 P2 @WinNT) with the CreateFileA API.
! Q# o) {' Y# x" }& F
  p; N# J1 G, j1 X2 VHere is a sample (checking for 'SICE'):% x+ S% c4 ?, d
$ Z0 N* X8 ^! N
BOOL IsSoftIce95Loaded()$ X! U" c2 U$ q1 N8 F
{
2 J+ l: e% d6 d2 x, t" `- @   HANDLE hFile;  " \" U7 L: R- y! n% V
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,9 e' g  _  x& W  K# S3 F
                      FILE_SHARE_READ | FILE_SHARE_WRITE,. B6 H9 u6 C* d7 y- L
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);8 r% @6 w% V! y3 |
   if( hFile != INVALID_HANDLE_VALUE )
; O5 Z: i9 ]3 F* x6 n1 M   {# C) |9 P+ w6 u5 n8 Y% I/ o
      CloseHandle(hFile);
% n1 B, {% a; z, L  r6 k( K; w      return TRUE;+ F; X: g- c& B+ x# e
   }9 u0 \3 M. T$ g* o6 ~$ \
   return FALSE;
( G. N" L. Q& C  r/ \/ C9 M( ^}7 F3 s! k4 _8 l4 ]/ ?
8 V, V& r2 p% ~& e& V
Although this trick calls the CreateFileA function, don't even expect to be* j4 \$ Y: j2 p
able to intercept it by installing a IFS hook: it will not work, no way!
- c' \. x3 L1 E! ?2 ^' M4 {/ f- aIn fact, after the call to CreateFileA it will get through VWIN32 0x001F9 X2 G; ~6 h2 N" F! X$ |
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
3 c( s9 B" w* P: `( Q; @3 z4 a8 |, Jand then browse the DDB list until it find the VxD and its DDB_Control_Proc, S1 L" U: h' I. A, I( s
field.
0 ~; w; V/ G/ l9 \" PIn fact, its purpose is not to load/unload VxDs but only to send a
. G+ S2 c$ a" K2 u9 |. y9 YW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)4 I5 H5 `# ^( }& V( b" d3 ?* Y
to the VxD Control_Dispatch proc (how the hell a shareware soft could try' |% ^8 B4 w4 D4 j
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
$ j+ H# G  p6 W5 y8 gIf the VxD is loaded, it will always clear eax and the Carry flag to allow. u$ a+ U5 L4 k; O; Z+ p
its handle to be opened and then, will be detected.  f) b1 r* a* G2 j4 E1 t
You can check that simply by hooking Winice.exe control proc entry point4 u: E7 J* E0 H) Q) L9 _/ N
while running MeltICE.! C/ Y5 p, Z4 Z" v; `

* n. [6 T% p1 h. @: n3 T+ u4 ], q2 g9 [& l
  00401067:  push      00402025    ; \\.\SICE5 O4 K) o/ i7 x' `" n& z
  0040106C:  call      CreateFileA6 W% G) N" R9 A# ?1 ?6 [4 ?
  00401071:  cmp       eax,-001
! Y; u; q; e& U  00401074:  je        00401091
; [$ f& w: k* v4 C2 b# ]1 {  [
# C, p4 t* m/ Q3 e+ Z! z# s0 X' z" G3 x5 Q# B+ f6 G7 X$ d1 \# [
There could be hundreds of BPX you could use to detect this trick.
; p4 d6 w# l7 Q  f2 r2 f-The most classical one is:# Z$ I+ P2 f% ?; }0 O- i) c" G; ^* C
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||  q# r  o; Z, r* F/ H
    *(esp-&gt;4+4)=='NTIC'( L# F0 l6 t8 @1 T; F

! o- ^/ v6 f. h2 a+ e8 S! N-The most exotic ones (could be very slooooow :-(: |$ `. j! J4 @3 T3 D6 O# V$ e
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  
: I# |6 ^1 X. `     ;will break 3 times :-(
1 T6 m8 d* m. B9 }' ?5 c- U0 `5 q4 n" h+ e9 l$ n
-or (a bit) faster:
* P+ D! |& Z! Z3 N- r# N   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
: N9 R+ s3 c# U5 N* p4 ?
3 f& t4 n+ n- e5 w* O/ B   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  * W) @8 \4 h* r1 n9 H9 Q
     ;will break 3 times :-(9 o/ |- r; ]$ f  l" R+ Z

) C4 N) `9 T1 g; Z2 @* k3 R+ I8 Y-Much faster:
+ B6 k8 f0 X& S0 H7 I# \' K   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV') B( z4 R: M1 ]# h) X+ _

9 L+ p! o: I! g% K/ ZNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
# U/ l* E, R/ r) ~5 Ifunction to do the same job:6 g- s) U1 l9 g

/ b7 Q& L/ z0 \6 P( G# a0 V   push    00                        ; OF_READ
+ e! b5 f! \& h1 A7 r, H2 t   mov     eax,[00656634]            ; '\\.\SICE',0
  }% s& u& _  a" |   push    eax% t0 q! H7 s7 N
   call    KERNEL32!_lopen
, O- [+ C" F. c' m" \   inc     eax
6 `2 m* o0 V8 q9 @' l   jnz     00650589                  ; detected; T' C3 B& c" \/ M, w
   push    00                        ; OF_READ
1 y' t+ w* S+ t) x0 T& k   mov     eax,[00656638]            ; '\\.\SICE'
# N+ T6 F- `+ x4 ]* p: |   push    eax1 S1 B: D: n2 Y
   call    KERNEL32!_lopen/ t" o% ^8 A8 T: t# m
   inc     eax4 P: |" e: o+ U/ M4 e9 W8 J
   jz      006505ae                  ; not detected5 d0 {1 L5 a( ]6 X4 _3 y# _! b3 \+ \# P
- b+ [0 a# H8 B5 `, o9 Q
) _: {/ g) j6 o
__________________________________________________________________________$ i9 P) b3 n( {- d3 e. c
1 p6 N1 G9 k; Q
Method 12
7 C. D' q' H! N% N2 q=========
; b+ r; _' T, w; L4 j$ _" w% z9 C8 h$ y# r( a/ U6 i1 \1 W
This trick is similar to int41h/4fh Debugger installation check (code 05' P2 e3 ?, b9 [2 ?" [$ `2 A) P6 D
&amp; 06) but very limited because it's only available for Win95/98 (not NT)
) \( I  J! N* F# D8 _+ F. p( _4 l' vas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
1 Z: V/ X2 l& g/ U# I
; a0 ?) ~, X4 T% |. X6 l' q   push  0000004fh         ; function 4fh
" A5 t' H; l6 }# M4 g9 ?   push  002a002ah         ; high word specifies which VxD (VWIN32)
0 ?) I/ K/ i% p+ g                           ; low word specifies which service2 K" g% @. z2 g+ l: w; F- k$ C3 U
                             (VWIN32_Int41Dispatch)2 f. S$ J, B3 Y! n6 y0 B. j
   call  Kernel32!ORD_001  ; VxdCall
) R- r/ B$ A0 Y- Q! L   cmp   ax, 0f386h        ; magic number returned by system debuggers
+ n* L( y2 M) r   jz    SoftICE_detected9 @. o4 A8 g9 I- t( I7 u
8 g: L6 f4 I3 e$ k. e( X
Here again, several ways to detect it:5 P% ^& h# W0 d4 F* H1 a! y& c
/ p% P' l7 U+ r0 e2 j1 m4 L
    BPINT 41 if ax==4f5 u; \- X: Q3 c6 }, G  d7 I
6 ~! D8 V( Q$ c8 L$ v; g
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one5 m1 q# P3 R1 F& z" |9 K/ }, [8 k

6 b3 g; e2 k0 G" w; U    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
3 [. ]! ?" p3 g  E$ S
3 }: S# p7 _; q$ U    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!
+ {8 g+ F9 y$ V2 V
$ i' l3 f" f9 p* T) F__________________________________________________________________________- r  R+ j) @& b+ S

2 h& q& o$ J( ~Method 13" ^3 Z. X/ t# W, f( }8 `
=========) @# R8 [/ ]7 g. p; T: O

5 J- H( A& B1 gNot a real method of detection, but a good way to know if SoftICE is
, X1 D& ?7 M; V" U/ Kinstalled on a computer and to locate its installation directory.
1 B- F, U' a0 D2 e% PIt is used by few softs which access the following registry keys (usually #2) :5 J; n) M1 `8 X$ \4 D$ J7 F

; t8 i. _5 f$ N/ E9 r0 Y-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
+ N! c% C9 V8 ~" n' Q4 [\Uninstall\SoftICE
/ F$ d1 Q% k. _) ^& V" t* V-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE( [3 I! r. y+ D* l9 |5 {7 S  L
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion* A& [# m0 X& X( X! r2 H
\App Paths\Loader32.Exe9 b& J  t2 Q( \; S3 B4 y3 w
0 N# r/ X0 \1 w+ d% S) W

+ m+ ]' w& {/ M$ [! H) t# PNote that some nasty apps could then erase all files from SoftICE directory
+ a7 d# O! l' D9 p* i(I faced that once :-(: d, p' U6 R2 }2 a$ O
5 o+ k! V5 a/ W% I1 O) O  `
Useful breakpoint to detect it:
0 G, s4 ]! r' Z  E, R
% A6 q& d& K; B: S/ N0 _     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
  o1 ~# t/ U. T
1 S) Z( v  O: Q4 v7 e4 N__________________________________________________________________________/ A- K7 e7 ^. u  q2 ^( n
0 Q! }: Z& j' i) m; K1 |

0 r4 g* Q8 |# _" A# H) U' }6 AMethod 14
$ d+ v0 F! C/ [& ]' n=========2 z- Q4 ^: Z  Z' o- @# E2 Q7 a' x# M
" F( H7 n( Q: }0 M
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose7 z0 g0 t/ y/ K3 l: k" N2 ?7 c  O
is to determines whether a debugger is running on your system (ring0 only).# |% H4 t& n& L2 W/ V6 X

( X9 V: |/ T( s2 L: q: l   VMMCall Test_Debug_Installed" S5 ?5 k" a! L
   je      not_installed
1 N  E8 T0 G7 \2 `, w3 D/ t4 X/ e9 {& Y
This service just checks a flag.
' R& ^* a  p* u" y</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关注公众号

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

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

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