About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>, `! s: |6 [$ x: s  W" \
<TBODY>5 }! P1 ]+ `1 {" P+ O
<TR>6 Z  g, T: W3 `9 O
<TD><PRE>Method 01 ; v, L/ }& a' f* b6 h
=========' f' A. }+ [6 k* {( X2 C  \3 l3 t4 A

" B) V6 s! Z# ~9 f6 t3 L% ~This method of detection of SoftICE (as well as the following one) is. M- J; |. r* e$ p. l
used by the majority of packers/encryptors found on Internet.) t8 w1 E) u1 M) H
It seeks the signature of BoundsChecker in SoftICE
8 Y8 b4 _0 e; {  K- c4 B# b" h0 z. w+ l/ w  w3 K$ v7 w) a+ s
    mov     ebp, 04243484Bh        ; 'BCHK'0 K4 `8 |! p' [! V+ A
    mov     ax, 04h" A# t5 _. z, B3 W% l" V' _4 b
    int     3      
8 ~1 l1 F& @. t6 s. V; P    cmp     al,4
/ s! t' O3 j* o! f, v1 h9 L    jnz     SoftICE_Detected" `: x* A9 R( A3 Y9 v! L
, }: i+ [! i. H
___________________________________________________________________________/ E6 F; K9 y+ L7 A
+ i. X; T: x! u+ f! G7 L
Method 028 J8 g- i4 P5 ~1 z8 k  _
=========. m+ v% J- H4 O" x9 ]6 S; ?0 O
( L9 x9 }! [" V, {: _% I
Still a method very much used (perhaps the most frequent one).  It is used
* B. ~! [: }; R: @to get SoftICE 'Back Door commands' which gives infos on Breakpoints,8 C! m) F8 w2 [# c
or execute SoftICE commands...
, U8 X1 m; E7 R% z& vIt is also used to crash SoftICE and to force it to execute any commands" L9 w" V" ~3 H7 R9 v
(HBOOT...) :-((  3 q) R, p9 V5 x# Q

; h: X& v' {2 C2 v. oHere is a quick description:0 G# @" Y( ^# P, U" g8 {
-AX = 0910h   (Display string in SIce windows)- r  H0 s6 O  O3 a5 @# L" ]+ ^6 ?
-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)' X5 c! I" C! x! @& _! e8 b  u
-AX = 0912h   (Get breakpoint infos)
0 a+ |$ B2 [, \3 n  I-AX = 0913h   (Set Sice breakpoints)# t) s. p" U; B6 ~- W9 {
-AX = 0914h   (Remove SIce breakoints)4 q+ S- b3 V. T- e! E8 Z

  {% R( l/ |0 m" M4 x! J: K# z) GEach time you'll meet this trick, you'll see:
. F( R! V7 C. Q0 K0 R( x-SI = 4647h1 V' }0 U$ g+ E) S9 [
-DI = 4A4Dh- q7 L! h- I( M2 m& W
Which are the 'magic values' used by SoftIce.
. V& b4 h4 ?7 n5 |% ]1 t+ XFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
- v1 L' `' a! ~# e7 n& k& ~. _( p; A$ _. M
Here is one example from the file "Haspinst.exe" which is the dongle HASP
0 z% Q$ z9 Y& t- u8 sEnvelope utility use to protect DOS applications:
( G  M$ S" p1 ]/ o  J4 B8 E) t' m/ o+ A/ {
9 N1 ?  ?- \5 x3 d
4C19:0095   MOV    AX,0911  ; execute command.
9 v( i, I0 L2 o" K4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
! A4 j* s) A: s) f; O* S4C19:009A   MOV    SI,4647  ; 1st magic value.
( d/ D& w0 M* M* x2 b4C19:009D   MOV    DI,4A4D  ; 2nd magic value.
# f8 }1 f0 G, i6 B- i: c4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)4 k* P) a, _$ g$ [0 S, [3 [
4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute0 I5 Z- s& }3 ]5 x: ]$ h
4C19:00A4   INC    CX
: D8 W# E4 T( H+ ]4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute& c% o9 P9 y$ P6 M4 Y( S7 }3 h9 d
4C19:00A8   JB     0095     ; 6 different commands.
, g  M, K/ h1 A! X/ J0 z$ c3 L4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
0 V$ X! j2 z: `3 r  ]' A, J4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)
2 |/ V, p' c2 \3 |( n
+ F# n: {  K9 Q# L" x8 _: jThe program will execute 6 different SIce commands located at ds:dx, which
, T6 l3 S* z8 t5 r, d: k2 E8 Vare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.5 J4 }: v0 [2 Y
( d3 g+ B7 M# f
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
4 n* m! m1 [5 T___________________________________________________________________________0 V/ B+ v4 L) ^1 B9 p

) ]! L1 }7 l8 O* m7 l) N; n# r8 P
3 u6 C3 e* f, K6 n, a# |$ J, ZMethod 03
+ K' C* F0 {( i4 `! p=========
. G6 x* e$ _7 [) X* H- B
$ [. x* i) p' m& [' ~Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h: x& ~( F/ W$ V& {" i
(API Get entry point)
* b: x$ l- Y* f6 v# N        * q- G  X9 p7 i9 ^# {5 X( e+ U

# m* u; d' K$ R1 e% X) q% K    xor     di,di0 Z$ |" g# j9 _1 k9 ~
    mov     es,di% [/ a6 K! S+ k3 N6 f
    mov     ax, 1684h      
3 J$ p$ U) H% G8 k5 s    mov     bx, 0202h       ; VxD ID of winice: T3 U3 f7 G6 ~- h
    int     2Fh
% O: _- c/ V7 f( s    mov     ax, es          ; ES:DI -&gt; VxD API entry point
) P5 A4 Z: b6 q# i$ j& F! {    add     ax, di$ k+ z' _* p! z0 U, Q* r
    test    ax,ax1 a- B) e* d! s4 ]( A$ o: ?! F" z
    jnz     SoftICE_Detected1 R/ o+ V+ r8 L, _: P, ]+ W0 j$ s
% d4 a1 F( f, L4 A; N' G% Q7 ]
___________________________________________________________________________8 v7 F) x, @$ ]3 k/ i* K
, \: W# P$ D, T
Method 04
' Z/ y$ N9 |0 S% @0 t$ h=========" J" W! q! Z/ R1 [7 F% Y( c

: r& W% a& A$ g, y* G: JMethod identical to the preceding one except that it seeks the ID of SoftICE, t. z! f9 t* y( ]7 @
GFX VxD.
$ }; E" y/ l4 V) E+ R9 ?4 C1 [6 L3 d+ a5 @$ F, v$ ^$ K$ K. c
    xor     di,di
* O% S5 @) {3 j( ?& ]- Q    mov     es,di
- u9 s! [5 K' u. S# L( I; a    mov     ax, 1684h      
8 O0 B2 H+ t# |7 w    mov     bx, 7a5Fh       ; VxD ID of SIWVID9 K' e/ k0 d* i# T0 x8 O" d7 D
    int     2fh
$ }; h9 q3 h* N( G! m+ D    mov     ax, es          ; ES:DI -&gt; VxD API entry point
+ ^  R! ]8 n+ S2 J% _/ r    add     ax, di. |: ]1 I8 B8 n  M8 `1 K
    test    ax,ax/ F' C$ k( t% q% n
    jnz     SoftICE_Detected
4 X5 F' T; U& t$ q8 g$ h
. g4 K7 A% X& ~9 d__________________________________________________________________________( I2 l9 o) x+ W8 m( l: H
5 R! K. K7 n, x" f# M- S
; E8 ]. I* G0 D; ]) e. K; I9 g0 }) X
Method 058 |; p) h: N0 u; w* e
=========1 i2 v6 U& ?: V0 p: \+ I5 F
' N% C& o; |! t0 I
Method seeking the 'magic number' 0F386h returned (in ax) by all system# K9 C) h8 {9 }$ E
debugger. It calls the int 41h, function 4Fh.
7 Y; Y( h9 `1 ?5 }' q/ v2 C) L. EThere are several alternatives.  4 v3 M6 @- ^& J
, k  t2 u) P1 D( Z3 L5 v4 }
The following one is the simplest:6 I% a. F* z# F* i( S$ k6 {8 e! @
+ F" a9 x- y* i  a2 d3 W/ T
    mov     ax,4fh
- |) X. D7 e1 T% X    int     41h2 l/ g5 r8 V, M5 A8 v
    cmp     ax, 0F386
' Q, }" ~% g' q    jz      SoftICE_detected
* \9 B& w' b& d! s: m: M8 |
6 V* y' o8 D' o
6 F; G( n$ W  N5 _- \1 X+ f8 ENext method as well as the following one are 2 examples from Stone's
  P4 G& H3 f6 \3 v$ H8 j3 q% F"stn-wid.zip" (www.cracking.net):
/ C) S) z7 T5 e, R- F5 _  `6 W9 |
4 ]4 x4 ~! X( e1 U    mov     bx, cs' J7 d% H# J% T* w; |% S& q
    lea     dx, int41handler21 Q# R: Y) ?0 G
    xchg    dx, es:[41h*4]7 s. {" t/ k! t* z0 q
    xchg    bx, es:[41h*4+2]
. g* x# L, f3 v2 t2 y4 a# c! o! P    mov     ax,4fh
, `0 B; F# M4 {* I    int     41h7 L+ q  ?5 b( H% m. n9 h
    xchg    dx, es:[41h*4]
9 O* P0 N) A3 z    xchg    bx, es:[41h*4+2]
* x+ P0 e+ Z& e( K" y) i    cmp     ax, 0f386h2 c* U* Y9 d: [: A
    jz      SoftICE_detected* I+ `6 n3 G% ~& B$ E5 U
. a4 I: q4 b* {/ |  g0 w: l% b9 v) R
int41handler2 PROC9 v7 `8 J: `" [! i4 D# e
    iret
$ }8 D4 k9 i, [3 h) p/ dint41handler2 ENDP
  z  i( Y! [/ s( B+ \+ G- o9 G

: {0 O, ~7 ]5 c6 z- `* [_________________________________________________________________________
3 j4 u3 P  b. g0 X! N' P' z1 p% H' Z+ @% r% @2 H' k
" h4 Q: d2 u, \0 h. o& v
Method 06
/ p" ~1 h3 q' o6 L2 }5 i+ _* X" Q. z8 F2 v=========
2 T/ p8 P) R. B) m
8 F6 ]4 T2 i& M5 H4 C% ^6 @0 y
2nd method similar to the preceding one but more difficult to detect:% [. w3 O1 l0 |4 m) a
/ D5 u* ]! P7 x& L
' V8 D  Y* J- I) P6 w
int41handler PROC
3 O' H2 l3 c3 H0 j    mov     cl,al6 b/ p2 r( ]# t+ ]$ Q3 o6 O# l
    iret
+ Y0 v# y3 A5 b1 d2 [int41handler ENDP: F2 e) i2 X( a! |* C
8 H: {/ r0 G6 i$ w7 p2 U/ B$ N
  X: [2 k2 a; o8 }2 ~" I
    xor     ax,ax2 F: x6 ^! p; S  C  |7 @
    mov     es,ax; R6 a. y0 o5 w; Q
    mov     bx, cs
- X+ @" F# W" E. a1 B2 R9 |# Q3 P    lea     dx, int41handler8 t, V2 W* F' p$ v
    xchg    dx, es:[41h*4]9 e% n' j; X& O8 o9 p! ]2 c
    xchg    bx, es:[41h*4+2]
, S9 ~' I) l: ~    in      al, 40h
( \: v/ k5 m, T2 a9 `; e- [& R    xor     cx,cx6 }3 e0 v, e1 }
    int     41h$ E+ n2 P" y1 _$ c" G; O( n# E
    xchg    dx, es:[41h*4]: \  e! |* i/ n% d/ \" }2 @% G; q
    xchg    bx, es:[41h*4+2]
  i7 l8 B; i+ o5 C. {    cmp     cl,al
) r3 y" P6 t7 Q, {: y    jnz     SoftICE_detected" q$ {; M9 {7 }: v( @0 [9 J

: ~0 u; R7 U. L. Y_________________________________________________________________________
9 c! L/ n9 e7 U! Z' I6 K0 B; Q4 m, {! F( k4 O4 a  S
Method 075 s) i8 b9 ]% F! @" O* G) I
=========
6 {, ?* P3 d- G$ p& A1 J! M: J/ y
! ~* I2 k. F1 \* @! Q# L8 U5 kMethod of detection of the WinICE handler in the int68h (V86)
3 x+ }) L# D7 T. ^4 |
; D# W6 Z) X! H0 D2 i6 A5 P, w- [" y    mov     ah,43h
; H: }* M/ R! D( P    int     68h
1 ?  h% |  Q5 n/ b! a: Y    cmp     ax,0F386h
; N% f) \6 ]: g/ I# b! E& Y0 z& {& f    jz      SoftICE_Detected
8 k9 ^6 [+ e) a$ v1 y2 n' f/ J) h2 f2 q0 O, g8 k9 P4 }

- X' |* {, F7 M5 p=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit6 x0 }" v" u- L& M3 ^0 e, E) p
   app like this:
  C4 X$ f: l, ?/ t- S+ c
* }% y* ?; s. q( B- G; g/ l   BPX exec_int if ax==68
5 M* W: ^/ `* `' B( S9 [) Z   (function called is located at byte ptr [ebp+1Dh] and client eip is: ]. Y' ?! ?- \( v; W# r
   located at [ebp+48h] for 32Bit apps)
- V% F. S$ F6 X6 L__________________________________________________________________________) L8 ^) d$ G+ a+ t
9 H' O8 G+ L# w, n# z7 N* j" X9 M

- p; r& M* G: @9 yMethod 08, ~: e. A. \4 h& B
=========$ g/ M- ?. I# r* g
3 u6 s1 t) p8 l
It is not a method of detection of SoftICE but a possibility to crash the
2 _' _0 t' o. R0 v0 @) W& Dsystem by intercepting int 01h and int 03h and redirecting them to another
8 t7 W" `4 j; U& @/ I8 q, S! ]2 qroutine.8 }* |8 Q  t+ f' B- \' L0 z: u2 ]
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points" D/ i9 v  j/ ~8 V9 T$ t* s
to the new routine to execute (hangs computer...)) ]9 ~( ?$ a# C2 m, ]
7 B! N8 ~, ~" O* G8 Y3 J# D$ G
    mov     ah, 25h
9 X" q$ `+ @; C1 d: f/ T4 y( \+ k    mov     al, Int_Number (01h or 03h)0 R! g% E4 H3 N' `" M/ z8 `
    mov     dx, offset New_Int_Routine
$ x+ w! p2 [% r* L$ m/ m* Y    int     21h, @5 I0 Y* G) J
3 X' V; z/ ~- L
__________________________________________________________________________
; W, S' W% a0 }
- u  y6 ^7 p- n5 a5 n9 ~+ t+ q9 _* GMethod 09
% Q  k1 {* {/ B: {# |! t! h=========; ]. e$ S$ G' t2 ~1 B

6 P- C: _& K" c/ P) [9 r* E1 `This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
! `7 W! {) s1 P. |; zperformed in ring0 (VxD or a ring3 app using the VxdCall).( l+ w% q+ A0 Y& ~
The Get_DDB service is used to determine whether or not a VxD is installed' L7 O+ p5 n2 E( R' ^
for the specified device and returns a Device Description Block (in ecx) for8 G0 E6 ]2 ^/ r, e  v' d
that device if it is installed.
+ O0 R( U  E# l/ q" j
9 @$ O5 _; P4 p: V8 U   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID% @; F4 t( O9 e
   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)/ @/ o- O+ Y7 j0 b- o
   VMMCall Get_DDB
: m* s' e, l7 u5 c  w0 a/ ?   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed
: S( Q4 {+ Y) G, x0 j) n
+ ^& G* J; o+ I: g  @Note as well that you can easily detect this method with SoftICE:- G* O5 C& f6 W% t1 m( U
   bpx Get_DDB if ax==0202 || ax==7a5fh
: ?! R2 p' ?$ N* P) \4 V0 t$ Y$ Y1 F1 j. x% _
__________________________________________________________________________; o9 V2 Q  S$ n+ I6 I% W6 h
+ G2 F- ?; e3 G1 o. P
Method 10
0 F! k0 w; O/ i( T1 q* P8 \=========, g* d! o+ `4 W

! U4 q! e( X3 _=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with
) @2 r# Z5 h, l2 V+ W9 q$ V  SoftICE while the option is enable!!% |' r9 M1 W# ^1 r2 q+ [# ~% y
" d9 j; y) ~7 W: G- `- n
This trick is very efficient:
$ V' X; s3 K7 R7 Dby checking the Debug Registers, you can detect if SoftICE is loaded
' s0 w; g# _  U6 A(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
; G, L8 f; u3 }, v: Ethere are some memory breakpoints set (dr0 to dr3) simply by reading their! K  }5 ^8 R2 G- n% D0 A
value (in ring0 only). Values can be manipulated and or changed as well
5 L$ u/ u2 C% i* J(clearing BPMs for instance)
7 R3 f. O. ^- r; ]6 e2 o6 {) e2 ~$ b7 F
__________________________________________________________________________
- ~- R* q9 r! y" E% [5 C$ _6 e: f/ k: a8 ]" ]9 o
Method 11
2 H' \" A5 u  k$ r: W/ c=========7 Q# X7 f: n- f! O. y3 {+ ?

2 e* j6 `* ~+ Y; }1 O3 e1 jThis method is most known as 'MeltICE' because it has been freely distributed# q# f8 A$ K+ f* K7 X+ H2 ?. }
via www.winfiles.com. However it was first used by NuMega people to allow
" f9 _- e" i6 L( ~3 s' SSymbol Loader to check if SoftICE was active or not (the code is located
2 }4 F4 j8 l' @! ^7 s, yinside nmtrans.dll).
& G, G6 v" L. g  S+ S2 g+ x1 j4 G$ I8 J9 i5 `5 v1 g
The way it works is very simple:# p1 k2 G+ |" ~9 k+ _
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
" ]: A" E: s) R  WWinNT) with the CreateFileA API.
% ]; S+ }8 m1 O9 l, e- s# A. k- H& {
: v) o" [, {- [3 E! B- @& OHere is a sample (checking for 'SICE'):
7 I2 M0 _" G" k- U4 v/ A) G
9 c3 `, T+ k2 {$ T- K4 T/ X. J+ PBOOL IsSoftIce95Loaded()* S! M/ i! T8 Y" s9 l2 x3 ]
{
2 t/ Y7 |, c. z& G- C   HANDLE hFile;  " s$ Z3 G. e1 u! B- ^+ g
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE," {, E' W6 n2 m
                      FILE_SHARE_READ | FILE_SHARE_WRITE,% \" X" z) W4 q/ u5 C- n# G
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
  S4 I& o5 ^+ B' I/ }   if( hFile != INVALID_HANDLE_VALUE )
2 u# X6 ~5 @& [% V   {
4 S. k' _. }2 E% m2 u; U      CloseHandle(hFile);, e- n4 d$ B( c, _" Q- y9 g+ D- W
      return TRUE;
: Z- R0 @9 H8 D: P/ n0 v   }( q5 j  D8 g3 |% h8 R
   return FALSE;
. K( p9 m1 i% _* U) z}
1 q# {7 K0 w, R/ @  C6 U% q+ A0 Y
+ ^3 U1 O1 p/ g+ L: B% ]8 x+ |Although this trick calls the CreateFileA function, don't even expect to be  Z, q  s# Q9 C7 s
able to intercept it by installing a IFS hook: it will not work, no way!  n/ M% P5 s, C. m
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
" r! N' ]7 l; P4 vservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)5 p  h2 ?5 v4 E1 u9 Q' ^0 c
and then browse the DDB list until it find the VxD and its DDB_Control_Proc: l4 p' S7 X) w, w; Q1 w; _" s) i
field.4 p3 e# }6 r% j% C. @
In fact, its purpose is not to load/unload VxDs but only to send a
2 _( Z, }! F+ h3 }3 ^; y  ?% JW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE). }1 V7 o( Z9 h( r6 f, ^* P
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
1 H* l; M* y/ q0 D/ _3 ^2 T) N& R8 eto load/unload a non-dynamically loadable driver such as SoftICE ;-).- @5 ~5 h: ^$ H) H" }
If the VxD is loaded, it will always clear eax and the Carry flag to allow
! [2 l7 p& C4 Q& hits handle to be opened and then, will be detected.
( {- B7 }8 Y& {1 T5 o5 r( rYou can check that simply by hooking Winice.exe control proc entry point
- u1 [2 G8 }& Y. j$ b; vwhile running MeltICE.: N. T0 a, Q0 E9 L' @- y

. ^% [  o! q! a# O5 Q2 v  m
; v, W6 l# @, B9 T* T6 ?7 ^3 Q- M  00401067:  push      00402025    ; \\.\SICE
* H/ q: M0 [" `/ T  0040106C:  call      CreateFileA
& v( b' [+ C5 `5 U" X, K: }  00401071:  cmp       eax,-0014 P* P5 t, h5 X2 j2 K
  00401074:  je        00401091/ l& K6 g8 n* y! m3 r/ l
# `/ x$ [& z9 L  I

2 S5 E3 q" _9 r2 Q$ |There could be hundreds of BPX you could use to detect this trick.
; r* ~- Z: k# R3 c; Z5 Z-The most classical one is:
* L$ b0 d. m7 S1 p5 k% m+ D  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
4 @' h' w: A4 j    *(esp-&gt;4+4)=='NTIC'4 _! s4 V4 P' n. u9 ]" e
" }% X8 |: l$ N
-The most exotic ones (could be very slooooow :-(
; ?/ }2 `0 U. ~   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  " R/ n! }5 m4 g9 J
     ;will break 3 times :-(1 r) e1 F9 g' e- a7 b: z, a

3 j  P! J% I  |& s$ S/ c-or (a bit) faster:
% @( I  d4 s6 V& E& u   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
$ {# }( p4 q$ A' h: e
: m$ x1 _' u' ~: K7 R- W+ \   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  6 P! \0 l7 K1 h5 H
     ;will break 3 times :-(
1 K, O, y- A, L& s8 h4 s) Z2 ^7 u$ o! Y! L
-Much faster:
: m  C% H( t3 ^  t) k: e5 \   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'
! V( U: k6 K0 l6 W) ~8 ]& Z: }* K% s7 A7 }% ?% L) R* z: p
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
! P* N8 d7 _4 s3 Ufunction to do the same job:1 g+ [- R3 V. A8 V9 j5 A

1 {) @1 ^+ r/ J" J% P) L   push    00                        ; OF_READ
9 `! P' j: R+ ]) ~' i1 |. }   mov     eax,[00656634]            ; '\\.\SICE',0# t! v6 {! e  E7 R( k$ h5 }" x
   push    eax- h$ y! l& `/ F$ d
   call    KERNEL32!_lopen, X; _% O' Q7 A2 c
   inc     eax
( h/ M( N+ |) C! @/ G% v   jnz     00650589                  ; detected
# A( [! @# d& O  n6 o1 d   push    00                        ; OF_READ8 u" o7 V; y4 R2 E7 u
   mov     eax,[00656638]            ; '\\.\SICE'
/ c( v" O- N0 p; Q5 o2 m* F" w/ ~) r   push    eax6 f% F# p; V  ^) l- i; s% V
   call    KERNEL32!_lopen8 W4 D# i6 C/ q7 _5 `7 X. z) b. M& V
   inc     eax0 y4 f7 g8 Y  _' i0 k) U
   jz      006505ae                  ; not detected
4 }( B5 F5 t" ?* t& l- j0 j% v- x( h0 F; J; o

% k6 g, o- t- S" v__________________________________________________________________________
7 F+ \* z4 S- f- X6 A* r& q2 D
0 m1 y  _' J! @, \6 U5 f1 AMethod 12
/ b1 A$ f8 [1 q4 _+ u; ~=========* k' n: A- W) J1 C( m

; X/ t3 e5 F6 P4 G8 @0 z1 dThis trick is similar to int41h/4fh Debugger installation check (code 052 s- c0 j2 X7 x9 m( a+ H
&amp; 06) but very limited because it's only available for Win95/98 (not NT)
8 F; T9 k  ?. n) `# Qas it uses the VxDCall backdoor. This detection was found in Bleem Demo.$ V" J! p1 K  G* k$ _' t; w; C
. @9 G: @' F9 J" f# |
   push  0000004fh         ; function 4fh
/ @# O% r' i9 L& O( j   push  002a002ah         ; high word specifies which VxD (VWIN32)' M# \) V7 P4 D; a6 @
                           ; low word specifies which service9 o) f4 T, f0 t4 @2 }- q0 ]
                             (VWIN32_Int41Dispatch)
7 O( u6 M$ M  J   call  Kernel32!ORD_001  ; VxdCall
7 ]" _3 {3 A. X! Y- O   cmp   ax, 0f386h        ; magic number returned by system debuggers
; T; n9 }8 G" I# K% m  |/ \2 U   jz    SoftICE_detected
+ w) K* r7 F7 C$ B9 I# q4 W. p9 q; L" D: ?# S  @: l  u
Here again, several ways to detect it:, [% t, l( O1 B9 p6 v& [# [/ z
- V, ^% Z6 ^, b9 o8 f5 U6 H. `! R
    BPINT 41 if ax==4f; D! N  o# a9 o% {$ c

; y  A1 R: c$ e3 ?    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one: z  F0 Q" s5 C& }1 e; w/ g0 P
6 t0 z/ c9 n# ~% ?( V1 Z* O; k
    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
" e- a6 S3 V' y- l4 I7 d, g# Q1 U6 I1 G. }' j
    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!
7 J( \3 ^7 A0 Y7 h) ?! Z
* Z, w5 u' G( M0 S5 l0 H% A__________________________________________________________________________) Z* U) H; `! K. j

+ ~$ I8 }& S2 ]- [/ BMethod 13
/ C4 X" s/ H$ E/ ^4 w2 p=========$ e1 i  i7 e- Y( i4 D
9 s" p, U; h; V$ \+ ~2 i6 M
Not a real method of detection, but a good way to know if SoftICE is
' ~1 W1 X" e& Iinstalled on a computer and to locate its installation directory.
' G" }" ^+ E7 K! s7 O! X$ F# u5 tIt is used by few softs which access the following registry keys (usually #2) :7 C0 M" y4 `2 Q. T1 S

  I. d4 ]: S% q5 ]: ]4 Y5 b- s4 g-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion7 n1 p: e, k3 j1 d# Q
\Uninstall\SoftICE
4 V4 t% K' _& i" ~# I( O* v-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE4 ^6 r# @* m# q8 `1 S1 M
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
/ A6 T. H3 X2 C6 \\App Paths\Loader32.Exe+ M" u8 }- j. J9 z

% Z( u. [8 \1 V4 D! q2 R: I
4 S7 ]) B9 O5 n4 {$ N+ o* g' pNote that some nasty apps could then erase all files from SoftICE directory
" O. u& P; F& A3 d(I faced that once :-(
1 M0 u. ?! W" D& `7 L/ _8 K! F; }6 d) C# s7 A
Useful breakpoint to detect it:
3 m2 a8 r$ f. S+ y7 R( O& H. ?# @$ a  e/ s
     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
$ v7 c- ^5 N! L7 X2 A. Z4 f0 V/ i0 ~2 g: y/ {$ \
__________________________________________________________________________
9 s/ c& B$ _2 ?
+ D% V: J2 k4 X! L6 H1 U8 t- ^* D  }( ]9 O- I
Method 14 2 s% s6 A. w( |5 N9 W
=========) y1 ]: z1 `! _7 `) T6 X" H

6 |. M0 P7 V. Q! m: c& @: vA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose8 ~" ^1 O& n4 L$ u3 p4 `5 q
is to determines whether a debugger is running on your system (ring0 only).
: P, D+ ^+ s6 w' k! C$ y
. l4 o$ b- ?( q- r   VMMCall Test_Debug_Installed
( T2 _! m$ j1 p% `5 U; G  Y3 F   je      not_installed# L0 F2 l: V! y" v/ C+ C

2 [; A- }0 A7 v1 @% f, ^$ K5 TThis service just checks a flag.
) B* p: n' |3 J4 `& Q9 c</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关注公众号

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

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

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