找回密码
 注册

QQ登录

只需一步,快速开始

About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
5 j, Y9 W' i  s5 [# d<TBODY>( d. Z% d) d5 B
<TR>: V5 D- |- _) {- n5 e- L, k$ w1 Y
<TD><PRE>Method 01
! k% v# _5 O* X/ |3 ?0 b=========& u8 @/ W6 n$ m
, `7 ?2 k) r1 r6 z& F* j  X
This method of detection of SoftICE (as well as the following one) is, d0 p( W( C9 e6 ]  G. D8 ~
used by the majority of packers/encryptors found on Internet.
; l; r" d6 ^0 `3 L# a- ^* \It seeks the signature of BoundsChecker in SoftICE
* B: E; F! Q) a7 _0 v
) `4 V/ j: w; f- u7 y+ F6 C# F    mov     ebp, 04243484Bh        ; 'BCHK'
( v7 R# [( l9 i: X, i0 R, z; z    mov     ax, 04h+ U: B6 r! O+ ~, L# j8 Y7 ?
    int     3       : g# w$ e. Y  T- z6 ~
    cmp     al,4) Y: `. y7 k" k3 X( X: Y% ^8 Q) |' d& h
    jnz     SoftICE_Detected+ M" s$ Z; C% ~! t9 I; U1 U  D

$ L' p: A5 }9 v9 A' y___________________________________________________________________________& m+ ^: J2 @$ e7 Y( i# Y

/ s+ o; B9 O, h/ z: \Method 02
9 O! I$ k6 @+ r$ S1 }  a* m=========
% V1 X0 y- f4 U( ^% k
5 U6 l9 M( C* t" K) HStill a method very much used (perhaps the most frequent one).  It is used9 _- I5 ?+ m' x+ |/ I# ~5 L
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,3 n/ S- D! G7 H5 t  |4 i
or execute SoftICE commands...$ b& d) [) W* S8 f0 x+ F* [& k
It is also used to crash SoftICE and to force it to execute any commands; D6 Z5 A* K, i: P7 f3 `
(HBOOT...) :-((  ) T5 {  @9 X  a7 G# w3 r$ ^: ~- F5 s
" `* _9 P" }& R+ K* |0 R; i
Here is a quick description:. @+ m6 D) E0 Y& M2 J# L( K; J5 |! K0 ~
-AX = 0910h   (Display string in SIce windows)
% S0 L* F6 j% c5 B-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)
! A) B- ^& R2 |0 m$ w-AX = 0912h   (Get breakpoint infos)
% p" }$ d0 b. w-AX = 0913h   (Set Sice breakpoints)
# W! H9 {! D8 t+ B-AX = 0914h   (Remove SIce breakoints)
' u. o+ p4 X: g! n# i
- A2 B* L2 O- Q, x7 v/ KEach time you'll meet this trick, you'll see:- X8 x( S# ]  z
-SI = 4647h' C" v/ E" i* L# K  f3 c' K
-DI = 4A4Dh
% N/ F) ~/ m$ v) FWhich are the 'magic values' used by SoftIce.
" U& e' `! L6 }/ KFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
6 S7 H  ], [8 |" V, a4 l5 y: p: k; t0 E; C
Here is one example from the file "Haspinst.exe" which is the dongle HASP
* L% W0 O4 z5 D# c- e4 ~. bEnvelope utility use to protect DOS applications:8 H- T7 q: ?: y  e: d0 j
: K0 q2 z* e8 M* }2 q
5 Q2 G' |& i; z5 ~6 m& S) r
4C19:0095   MOV    AX,0911  ; execute command.) ?; P+ S- Q, e: t
4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).+ {, _# {- l: z$ @* |
4C19:009A   MOV    SI,4647  ; 1st magic value.
9 I3 @# H3 c! y! f3 `* g4C19:009D   MOV    DI,4A4D  ; 2nd magic value.) I+ r/ J) H2 V& s0 t8 d
4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*): s- y2 ~% r! ~3 U% j' S, C5 R
4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute8 x/ p  }# C4 y2 W3 j0 m0 n% r5 I# d
4C19:00A4   INC    CX8 C% C; `' d% I# w% p7 ^$ P
4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute
; N- ~" Q- S. v8 r4C19:00A8   JB     0095     ; 6 different commands.  a) k4 V, n, ~
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
' y8 \& c6 E0 d0 L$ m, J2 I! F4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :). N( _& B2 Y3 S/ B# i
6 a" E* C/ H6 I. b/ Y6 I% J
The program will execute 6 different SIce commands located at ds:dx, which; F9 d9 B7 |) A0 K$ U) ]5 V
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.! g7 [$ L7 K1 u

  Z' T& A2 p. G9 t3 T* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
$ b' o$ e4 t- E3 O- ]+ L___________________________________________________________________________$ T  I! o+ G6 {' m
8 ~& X4 k9 z9 `- z, a
( h5 n  d& U  H& k8 K. `$ D
Method 03
  d  ~7 |! h' b( R3 @=========
- F, O: H; ], K- p
8 g4 M; I5 o/ J% }4 aLess used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h" E. o6 `, ^- x$ ?. l
(API Get entry point)* r8 D; M8 }6 [: p3 ^0 i2 C! L
        
7 y! J) d, v6 n: ~& \+ B% }7 y
5 I; U8 K+ n* m    xor     di,di
% B* P6 l' j, [& N$ [; V    mov     es,di- q4 F2 S% z$ d! F( w7 d
    mov     ax, 1684h       . i. h+ J! M6 s8 T( q$ ~
    mov     bx, 0202h       ; VxD ID of winice
, G# `( M' T7 e% f* U- t" p2 V    int     2Fh/ k/ p) }" N, ^6 Z% P/ R
    mov     ax, es          ; ES:DI -&gt; VxD API entry point' x, a1 M; V& F2 k" }
    add     ax, di  X2 V/ v- F6 y
    test    ax,ax
% K" M# P" x1 W) q( @" b+ K& I    jnz     SoftICE_Detected" u! r8 h/ J6 y! h7 [9 f
+ x# s$ h' t  S" c: ^+ T# p+ t# C
___________________________________________________________________________3 T9 Z4 D% i" V0 h( f7 U, v

  ]! a) t/ X4 S9 Z  q+ ]  v4 b& {1 dMethod 041 N+ Z% @2 N) E9 \! K! w
=========
5 s' @$ H% q: r  u6 ]3 o. P
9 |1 V9 `6 i) Y+ w6 t/ w5 oMethod identical to the preceding one except that it seeks the ID of SoftICE
" V' ~( `! O, JGFX VxD.. z# n* n, A8 R) Z8 F6 ?, h" }
% c1 F5 [% p# a$ I% T
    xor     di,di
0 a$ v( B2 c0 @7 Y5 T% E5 f    mov     es,di
, V) y* X" O; w    mov     ax, 1684h      
  ]8 T# _" J7 r) L$ ]& \1 @    mov     bx, 7a5Fh       ; VxD ID of SIWVID/ e9 [8 X8 f) O; @7 N
    int     2fh3 j( d. C3 n0 a# A& E' k
    mov     ax, es          ; ES:DI -&gt; VxD API entry point: M( I( h& \1 _1 g* A# e  V
    add     ax, di
8 L" K$ b6 K% o3 f% w1 i. u+ R; k    test    ax,ax3 x1 z1 n. y4 _2 v" s
    jnz     SoftICE_Detected% ?' ^4 e" F) l/ o  K

3 G7 e2 y) V, l. L* O) s/ L__________________________________________________________________________
! o1 K& z: O7 v6 A6 {/ b$ L" h
1 G. L: z7 I; D
' W; A, O. `5 ]% S6 X9 tMethod 05
" t: s+ K1 }/ }) c=========5 C8 `# X* Q* |4 ~: M

# B) ^! K$ F# k0 x. dMethod seeking the 'magic number' 0F386h returned (in ax) by all system2 e7 m: b0 p/ Z) B  i3 S
debugger. It calls the int 41h, function 4Fh.% b0 w% B3 O0 _; W" n, D
There are several alternatives.  
, C4 \* x5 P9 z$ R  G
: Q! L' x8 k5 i2 o/ z1 lThe following one is the simplest:. u: T5 S( J, v' J/ ~+ G

# O( m9 y# {8 Q    mov     ax,4fh
1 k9 H' |; ]4 `! ^5 }4 O    int     41h) x6 e7 R6 W; p; t) D
    cmp     ax, 0F386* y3 s% ?3 f( L9 Q5 T) {' H
    jz      SoftICE_detected+ L( E( I0 I* y
6 _0 ~( Q" |$ {- D

+ l7 }- H' A1 j( ^8 K  bNext method as well as the following one are 2 examples from Stone's
) w; G, L6 \6 f7 W1 u0 ?"stn-wid.zip" (www.cracking.net):
# d: g+ k  \( v& g- [, z4 K8 Z5 [7 x+ y4 [6 {9 B& g! N
    mov     bx, cs3 ~" N6 J0 z( [# a- P
    lea     dx, int41handler2
3 n- J8 O+ L- G. H0 Y    xchg    dx, es:[41h*4]1 q- N3 L1 W4 e4 v+ O7 n6 h8 h
    xchg    bx, es:[41h*4+2]! |8 b2 F3 L9 z8 g
    mov     ax,4fh
6 U# i, X! ]5 M6 Q4 w    int     41h  I1 M1 Y2 \) H0 W1 Q$ k' E
    xchg    dx, es:[41h*4]. n+ |( {% C% Y. `* f. F) I
    xchg    bx, es:[41h*4+2]! a; X- y  U- [5 v. w7 d
    cmp     ax, 0f386h
4 m$ ~' N1 s4 a6 E  l1 G    jz      SoftICE_detected  ?# m' p3 m  A1 A4 v0 h# p

+ U# z$ N: N. }8 ~1 H3 kint41handler2 PROC7 Y& y1 c- X6 f
    iret
+ Y4 j2 B. w! b  q" ^! a: Dint41handler2 ENDP
3 Y+ j# O5 \$ d5 v; o
" {4 D! a7 E7 ]
6 i  t% K* b1 T( K4 j2 B_________________________________________________________________________# s2 H( O. `, A
1 V0 c2 W# B4 V/ ^

8 K9 _: b" F1 ^! e4 eMethod 06
, k; _' }  f7 ~+ S=========
1 Z1 l: j; P- ]
( P* D* z2 G* S  T" f
" S* m* e* p4 o4 }' f. ], w2nd method similar to the preceding one but more difficult to detect:9 U3 m% B4 L0 u+ U6 t' u5 `0 {
2 V& P6 C- K# `
$ O5 `3 b' g: x" {6 R2 s8 }
int41handler PROC
) H' {4 C; Z  n8 [0 X    mov     cl,al* ^; F+ B4 J- [  U  K
    iret! k0 }; H% {$ P' w$ Y, b
int41handler ENDP( {- |' A/ e" ?! a
$ z$ c. L$ n6 A4 q
+ x( F* C) M- ]8 f2 C
    xor     ax,ax6 I, J# p/ L' k9 B8 L
    mov     es,ax
; B, E0 {1 j, v5 O( B9 o    mov     bx, cs
1 w' Y% C4 Q: [& o& `0 p9 m, G    lea     dx, int41handler
* g& m# T% `1 N, I    xchg    dx, es:[41h*4]
+ j4 P: n2 ~& x% K" Q9 ^$ V    xchg    bx, es:[41h*4+2]- g# ~6 K2 v- u
    in      al, 40h
6 s* K, ^! h  T6 u* ]' O    xor     cx,cx
- ?3 n3 c$ p9 ]8 f* ~4 |5 L6 ]8 H    int     41h
1 \9 v3 l  G- @" j) {    xchg    dx, es:[41h*4]; w9 `  i3 E$ O- ~- L
    xchg    bx, es:[41h*4+2]
0 N* w/ V0 ]. r- }* H2 }9 N    cmp     cl,al: r9 u3 u2 t8 R, p; l
    jnz     SoftICE_detected
6 J! B6 i# t  Z  D5 C2 ^: a5 x, Q* I3 E9 B' U
_________________________________________________________________________
; o% C+ c. H" f  B; `6 Z: _1 d( X3 X5 W: x
Method 07: U% B- u. b9 b0 V1 l  I
=========
  Z9 V  y. R) Z
7 ?) q$ i" H2 p3 U# ?, N2 u: Q/ ]Method of detection of the WinICE handler in the int68h (V86)
6 l( |& h# j/ x: ~+ `6 |$ U6 w4 S0 {6 [
    mov     ah,43h
. y/ M3 `3 z/ r, h+ v    int     68h
  a* e9 S; i7 I    cmp     ax,0F386h
' E9 T* R+ D5 U' F  P, Z* g    jz      SoftICE_Detected, f3 Q$ C# q; D- R2 _/ f
! H- U# X3 c; N4 i  u

) y3 p6 E* \" s=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit  i: e5 c1 @4 r& B4 [. R- b
   app like this:
. ]! ?8 c6 O+ h' \- J- ]; N
6 T+ f$ _4 A" g   BPX exec_int if ax==68% ?& y) s9 S# [! h3 _: s
   (function called is located at byte ptr [ebp+1Dh] and client eip is
. `. [3 M( i& h7 Q& s   located at [ebp+48h] for 32Bit apps)! p, x" P1 C. C7 }1 T
__________________________________________________________________________
# Q2 a, Q5 B! M  x; ~" p' z! ]% E: b

/ \0 \  H; _3 v/ E/ mMethod 08
% q: E2 z& P. y% u5 A=========
( B( D5 P6 |/ X% w. s4 {  D: E) p' ?; u2 L
It is not a method of detection of SoftICE but a possibility to crash the8 G' `# l4 K, k& v
system by intercepting int 01h and int 03h and redirecting them to another# f5 G% m+ y. P
routine.
- C/ ~+ ^# E# Z1 V3 s) ^; XIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points. V1 n. W" W8 k: X
to the new routine to execute (hangs computer...)
' I( d; v! B! @3 O- y) E6 s( k- P- _6 ~) x  Y
    mov     ah, 25h& Y/ ~, \7 G5 p: Y
    mov     al, Int_Number (01h or 03h)1 Y7 v) G  w( z/ U0 j
    mov     dx, offset New_Int_Routine
" Q( o& a$ w' O, D- k( H& Q0 L    int     21h, D* f, q7 Y- d7 b/ x# Y

' m2 Y+ F6 _; u1 [6 k# Q/ P, |__________________________________________________________________________, J; }: c" l; l) \' A
% p$ |" z4 L. v0 r8 P; _8 V( x
Method 096 Y5 e1 p' ~5 Z2 Q0 B
=========1 b4 }9 u0 R: s0 }$ L  C
1 P0 v: B5 _; @8 k* K  a' a3 N, s
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
# F0 u6 _. d/ T# k! Z, z( bperformed in ring0 (VxD or a ring3 app using the VxdCall).8 t5 {: X7 K: }6 k
The Get_DDB service is used to determine whether or not a VxD is installed
3 `5 I9 c8 S- g4 {+ [0 Z# Jfor the specified device and returns a Device Description Block (in ecx) for0 c. p! ?+ t$ Z  G1 k1 v( F
that device if it is installed.
, I7 P; U0 k. N5 H+ [0 g: G* m# G$ k, Z3 x- S+ W
   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID
  g2 f, |5 f% P8 j  ^   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
- S$ _) w/ g, r: ?/ [$ i( L1 |   VMMCall Get_DDB
( O0 X' T5 K% U* A' v4 k# d   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed7 R4 g* R9 R! ^; m. Z/ a7 B2 b

' t& q& q' j; c1 _  SNote as well that you can easily detect this method with SoftICE:6 N5 c; X3 a$ z$ ?3 p* K. ]
   bpx Get_DDB if ax==0202 || ax==7a5fh- I! x2 f% l& {' Y. S

1 W3 P3 n4 L# j$ D7 \7 x4 I__________________________________________________________________________
# J! q# Z6 w" U3 W, x, H) ]% B6 W+ J: p4 ~
Method 104 D' x: T8 }* T
=========6 H, _) a& o. c7 Q

& V' E4 f; S5 q! w0 R3 _! U) ]=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with
" f" Y# ^! Z' ]9 M. r8 G  SoftICE while the option is enable!!  G( `; S, a! Z& V7 D6 Z& a* j/ y! N
9 K6 d4 a# Q$ _$ t
This trick is very efficient:
0 y" `+ i/ d' R) k+ W0 Nby checking the Debug Registers, you can detect if SoftICE is loaded
7 u2 n7 Z3 h/ M% d7 {" N/ m(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
, T9 a$ E6 H' V3 vthere are some memory breakpoints set (dr0 to dr3) simply by reading their4 e$ w' B, n& @7 [4 _1 y$ M
value (in ring0 only). Values can be manipulated and or changed as well9 s- z  O/ K% i0 h
(clearing BPMs for instance)
" N) h# d# l0 S
) w: G, X" N6 f__________________________________________________________________________5 q0 g  Z4 E' u: p- w% e
& I0 c( ?9 ?/ l0 G) w9 ]
Method 11
& G* u7 L' i- L# a4 X$ D' \=========
6 g, W  C2 O7 x# q
* I! X6 @; w5 ]- B  z  zThis method is most known as 'MeltICE' because it has been freely distributed
  n) [2 ]; K$ P3 u5 zvia www.winfiles.com. However it was first used by NuMega people to allow
4 o' z! a! f: z7 bSymbol Loader to check if SoftICE was active or not (the code is located" B9 X; x- {# d2 L4 a: ^
inside nmtrans.dll).
7 G; \- T+ a8 ~  d4 `
1 ~9 w1 f' Z6 c* }# VThe way it works is very simple:
% i/ T! B' S- @, \* W8 Z0 xIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for, j, D, T. [+ _7 Y& }2 ]2 Q; Y# }
WinNT) with the CreateFileA API.& A5 E0 F- @% U

9 h/ s, [! ^9 G2 C& MHere is a sample (checking for 'SICE'):; T: K/ F; c; h! Z) t2 K. i

+ |/ D" _( ?' uBOOL IsSoftIce95Loaded()! _; W4 Q7 g& z( u1 a4 x/ ]: Y
{
1 x0 U. m1 D4 |  t   HANDLE hFile;  7 t$ O" A) D8 [* J7 a3 k
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
3 f' F8 G/ S* g                      FILE_SHARE_READ | FILE_SHARE_WRITE,8 o/ A% E- W" t
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
' ]7 n' _8 f" j9 B( W8 v   if( hFile != INVALID_HANDLE_VALUE ), `* d5 F9 Q* ^% a) E& N
   {" S) L- [# R" [; f1 d8 e- l; o
      CloseHandle(hFile);
  |8 a" e( Q3 e/ S      return TRUE;
% c! D! w. @1 F   }
! x1 K; Y6 b+ n' o) A   return FALSE;
+ q, q* k/ Z, v  ^3 V/ n}* y; g( n  `7 F: k9 R3 m
* U% J& b8 \3 x
Although this trick calls the CreateFileA function, don't even expect to be7 f) z! }. P+ B4 T$ d
able to intercept it by installing a IFS hook: it will not work, no way!
3 o" m) H; i/ a: D& m9 Y, rIn fact, after the call to CreateFileA it will get through VWIN32 0x001F' |9 ~' E+ N( j3 J
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)& N* K% O; O* t+ j% i: y/ r: F7 B
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
1 B4 l' G4 ^% z# l# Zfield.
. e& P7 X4 R7 @7 [/ K! p8 jIn fact, its purpose is not to load/unload VxDs but only to send a % z: \: v; ^: ?+ h
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
9 d, P5 O, Q' I1 A" ~9 I9 ^/ y3 Uto the VxD Control_Dispatch proc (how the hell a shareware soft could try
4 {- G) X( |; l% [! I# j& Jto load/unload a non-dynamically loadable driver such as SoftICE ;-).
" k, X4 p; e4 `, H9 |If the VxD is loaded, it will always clear eax and the Carry flag to allow
$ X6 l2 m, A2 ~its handle to be opened and then, will be detected.8 k& R& A) i, b0 _  y) ~9 `5 f
You can check that simply by hooking Winice.exe control proc entry point9 E- G; t* F  D, s
while running MeltICE.
; Z0 e4 g" o. t, p7 a5 N3 n! x) {7 N! C7 j5 S

4 J2 e6 N5 N6 e5 R# v( i  00401067:  push      00402025    ; \\.\SICE7 _% o6 Z2 k, u
  0040106C:  call      CreateFileA
* `) x" G1 x3 o) [: _. w  00401071:  cmp       eax,-001. g0 w4 P& V0 q
  00401074:  je        004010915 @+ U+ Y+ a4 t( n, i) G1 l

& d9 j1 u+ m* i$ l0 F
  J/ d& w; ?+ t( L5 x# SThere could be hundreds of BPX you could use to detect this trick.& D$ c2 y% I. |
-The most classical one is:5 O: D0 a0 [' L- z0 k- E+ g
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
( D! c  I7 J9 P1 V6 W9 a8 X& R    *(esp-&gt;4+4)=='NTIC'
. u1 E- D1 X, L( R7 {
% L4 t6 L% M! `% l8 ~-The most exotic ones (could be very slooooow :-(
* T& u0 K1 C" I6 F  {/ s   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  8 y+ ~: s6 U& f+ n
     ;will break 3 times :-(
( u1 j* v; K  Y( u5 l7 g* N% W- w, E- H- n  f$ d& e) @
-or (a bit) faster:
1 n; g7 K6 B+ }   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')& E% ^0 I9 m) s% i& x  Q

0 J; g/ L1 B! T- p8 K   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  & }' d# b6 J0 }# w, j
     ;will break 3 times :-(
1 P- {* a5 d  R/ E2 k) r1 q! s7 U1 B8 E: y* g
-Much faster:
/ U) s2 S* K, m   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'0 m: k  a% R: Y0 D. F% G% ^
* {, B; Y  y2 k3 o
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
# f2 C7 B, R! P, c% [: }function to do the same job:
9 d) I' K$ d+ C* w' @1 j2 @5 N9 r- ]
! T$ m  t7 r; g   push    00                        ; OF_READ$ p  M! S  I! \/ N$ ^, @
   mov     eax,[00656634]            ; '\\.\SICE',0
  J0 g! w- v% G5 j' {2 s   push    eax
+ c5 U) _" N- l5 M  ^: \; X   call    KERNEL32!_lopen3 S( g/ J2 d* u9 ^( N
   inc     eax
( e% o; s3 t, `- C4 t. o6 F   jnz     00650589                  ; detected
8 h% Y, r: ^2 D" N   push    00                        ; OF_READ: o. B. u1 F2 b4 _/ I
   mov     eax,[00656638]            ; '\\.\SICE'% N+ G: \* O" ^' I8 S
   push    eax$ n" [. \! o3 y1 T, D3 m- N
   call    KERNEL32!_lopen2 M  K. |' z8 k0 j& N( t
   inc     eax
& j. c6 o8 L9 `  n; X, Y1 i7 t   jz      006505ae                  ; not detected. R( F' O- h; d9 M4 N

) |; j8 @% M2 t5 T% M0 w, S+ S) t8 L" B+ A
__________________________________________________________________________1 _3 F- q& l: k/ W4 E  Y3 \, v8 S

+ o8 g5 H$ L( |! \Method 12; D  g  O+ N, S
=========9 v, ~) ~9 @. t& ^9 ]
! D/ @  D+ O/ T" `
This trick is similar to int41h/4fh Debugger installation check (code 05, H# k/ V: l: Q: j6 Q9 C" P; l
&amp; 06) but very limited because it's only available for Win95/98 (not NT), v5 T) @+ @$ O/ S  P& ]
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.5 u5 a: M3 v/ u$ o
. v  \5 V; L+ c, S7 A( e. a( H' l
   push  0000004fh         ; function 4fh
8 z8 N1 T* {* }" q' M6 y+ @   push  002a002ah         ; high word specifies which VxD (VWIN32)* N- o# U: _9 P( P/ O7 x
                           ; low word specifies which service
1 v+ u1 {+ D8 q' p; Y" f. G                             (VWIN32_Int41Dispatch)
( l9 l0 z: l# x5 ]. v   call  Kernel32!ORD_001  ; VxdCall5 M6 B9 S: R( B. l, p5 q: v1 k
   cmp   ax, 0f386h        ; magic number returned by system debuggers
* |5 A: }' I- J) M' y; X   jz    SoftICE_detected
: X# n! r* X/ ?' N; M2 C3 ]2 Y$ ]6 m
Here again, several ways to detect it:
/ X7 M9 h% X+ s  v; x
# q3 c& h& O. x4 [7 R% V; A& a    BPINT 41 if ax==4f
: h6 E# @1 w0 T9 i4 X2 |: Q& K5 u6 d* q& q' \+ g5 m* F0 `. T) ~1 k
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one
1 }8 V6 `- `& T- A: z2 i1 [: ^7 j! {
) C( v% V8 V7 j  {6 i$ c- O2 ?4 ]; L    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A, ]2 F+ P) ?# K. v' G
! `& ~( s3 D* O! [
    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!
1 s$ Y5 x1 A/ R/ m
7 ?2 k, c2 v  W# X; ~$ C__________________________________________________________________________
& O" I1 _* ?0 u% D- I! d2 C
# i1 I* I5 l  h% `Method 13
$ j0 R" j  n% A# @=========
/ b. P; J. M8 P1 \3 y/ m
5 i% e! G6 S& z+ a6 V$ k" _Not a real method of detection, but a good way to know if SoftICE is5 G( c6 `+ [- L, z% p% _
installed on a computer and to locate its installation directory.: s$ {/ t( z1 G, p  M
It is used by few softs which access the following registry keys (usually #2) :
( p. y0 }8 F: A/ u7 T: }4 e* n+ d! d4 y, z  L  n/ A( w
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion7 Y( m  e2 N, p. s! O. O* o
\Uninstall\SoftICE
3 \) S# a' @) h# _-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
3 o! [: x/ V" |- p0 q, n-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
8 N# h+ H  Z4 s; j% s- t\App Paths\Loader32.Exe3 _$ }! q. M$ N! l
" G( a3 [( x: {; l9 ~" m+ T; I

$ f/ B/ m4 b$ b8 ^" K3 Z  m6 V- `  x5 KNote that some nasty apps could then erase all files from SoftICE directory- _0 Y& B, X8 l1 F
(I faced that once :-(
8 T$ J0 H  t3 Z- M" I1 q; ~! t5 Y3 [* n' c- v5 I. N
Useful breakpoint to detect it:
- K: t! x6 \5 @2 ]4 n. Y9 t
1 [* p. z" [6 h6 c3 B( a     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'* Z% D1 p: u( T1 f+ o. k; w" \% W1 [

# h. U" v$ k0 V: E" ~! o. G  r__________________________________________________________________________! \1 i* D* p) w  l7 l. p! l

& L4 u$ e) V! ]
  [0 O0 a9 [1 i' J3 g  UMethod 14 ( A$ e3 |6 R; H/ p, G
=========1 c8 l/ r) q+ O! \- l5 x$ p
) Y( x  n' B0 u; _$ E9 O. e, L
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose& M. h( C4 K* d  }
is to determines whether a debugger is running on your system (ring0 only).2 ?7 O* D/ ?& p3 C1 I6 s) ^7 k) D$ x

! R; d+ p! A0 |& W4 y* E% [   VMMCall Test_Debug_Installed) Q6 R7 ?- o7 x/ a+ s8 `
   je      not_installed3 |/ }! s' o1 y7 Y. `1 m

0 @0 Z" Z+ E# _9 b$ t+ }This service just checks a flag.
- B4 r2 ]" O1 O5 f& z7 _0 h</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-7-26 15:27

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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