找回密码
 注册

QQ登录

只需一步,快速开始

About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
3 q6 j0 }% z! X9 L4 e+ u. y9 g<TBODY>' M! q1 f' k; |, `9 C
<TR>
& n3 B* c. F9 V. Y; w: U8 d! Z<TD><PRE>Method 01
! P% x- G0 {3 g) V; F=========
7 H/ Z; Z$ g# ^& a6 ~! S
3 y" b1 g( x6 A3 p- XThis method of detection of SoftICE (as well as the following one) is
  P! B$ s5 N  p- F6 Q$ z) s8 c) ^* Vused by the majority of packers/encryptors found on Internet.
9 o5 s! P7 r- G8 @/ B6 h& yIt seeks the signature of BoundsChecker in SoftICE
/ A% F2 P8 r0 r: {7 B- T5 j, b. T5 I6 d
    mov     ebp, 04243484Bh        ; 'BCHK'
( D) |% l5 \3 Y8 a, z    mov     ax, 04h% L; Y& f) g% z) _/ j  X& Z% i' b1 [
    int     3      
, t# q$ S8 t4 y% e% D3 p  b2 M+ I    cmp     al,4
$ h* h1 Z1 a) i; c. |/ a: Q  a    jnz     SoftICE_Detected* z) ~: h( j2 T# C

" }4 B0 o$ y. J6 r- B8 S" m% e" z___________________________________________________________________________
5 K9 y' N% |# r9 a3 u' {6 f) ]7 n% B" P5 w
Method 02$ I4 ^- u- ]' ^+ s0 c- _
=========
6 s5 S4 W! X1 B. y
1 |! S1 K9 s5 j* Q# @' d6 M3 l. bStill a method very much used (perhaps the most frequent one).  It is used; M* c8 o" I; s' U9 g. h1 }3 Z
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
- p6 w5 O2 {+ `5 for execute SoftICE commands...  D. b- z/ B9 ^# Z
It is also used to crash SoftICE and to force it to execute any commands# D# a0 d% W, Q  S  I5 ~
(HBOOT...) :-((  
, P, [1 {9 q- \- ~
5 h# M% h6 P2 o$ p; W6 F& EHere is a quick description:' I/ f4 H8 u) Z% ^
-AX = 0910h   (Display string in SIce windows)' j$ Y, d8 Q/ M/ A1 ^
-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)8 @( Y. f$ k4 f1 C% Z& c* \
-AX = 0912h   (Get breakpoint infos)
" A" k  o6 B2 |3 P0 Y-AX = 0913h   (Set Sice breakpoints)
4 v2 \4 F7 M# Y. R* ?& T# K-AX = 0914h   (Remove SIce breakoints)
$ _" W5 H6 O& D/ m4 w( l2 l: f& E* F3 X( }5 |( t) ^
Each time you'll meet this trick, you'll see:, e0 `  `: v1 Z& L* X2 ]) h
-SI = 4647h2 s. Z4 J' n# y* R
-DI = 4A4Dh* W1 F% G- `" k% E
Which are the 'magic values' used by SoftIce.# r; G7 i) j+ u* p- `$ Q; L
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
9 {( U; @% |# V# r4 ]# `7 q6 r& N* x3 p& A
Here is one example from the file "Haspinst.exe" which is the dongle HASP
7 ?1 t" C& [+ `+ z5 `% j) CEnvelope utility use to protect DOS applications:
9 k& U) n# \" M& h
. l0 r1 [$ X9 e9 W/ q4 U
# B3 I0 \: u6 j9 p9 b/ y4C19:0095   MOV    AX,0911  ; execute command.4 y  }- i' D; O1 a1 |
4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).  p7 p+ e. P! e
4C19:009A   MOV    SI,4647  ; 1st magic value.& D# [2 s7 ^* @5 _' K
4C19:009D   MOV    DI,4A4D  ; 2nd magic value.
9 _  w3 l) r! @7 _" D4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
. ~# D! ?! ~3 g* n1 g4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute9 \% d. d5 I. i) p# E) c
4C19:00A4   INC    CX" v$ J* _0 L/ s- t: c, t) ?
4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute
5 G" }4 V8 Z. S2 R0 E9 I+ _. J% c4C19:00A8   JB     0095     ; 6 different commands.
8 _  T9 F3 ^. E) y. o& z( o4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
9 y; i8 w0 g+ z: d4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :); x2 g+ r- i: r9 z( \

6 Q, |, |, e' i, ~8 A9 QThe program will execute 6 different SIce commands located at ds:dx, which
9 w$ n% z# S( d) ?9 \& ?are: LDT, IDT, GDT, TSS, RS, and ...HBOOT., o( Z3 F+ P# _; t# [

# y+ e& r% b& k+ O6 ~* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
* x# d( ~- c1 h; i8 z) Y5 `+ \___________________________________________________________________________
: I& _8 w$ J: W+ b2 C' ?) [
1 b8 B. a! {" m( D3 V
/ F5 P' K4 p9 a. NMethod 03
% N# t, ]* G) J) A4 R=========5 R& I0 Q2 n6 O4 y  w6 ]
! M7 R2 K) r& s1 J9 U/ n2 H
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
% W2 w% p% Y: y$ u2 H; ](API Get entry point)
3 m- f1 t2 a0 S2 Z8 s5 k1 H        
/ Y8 s2 l* n' U
1 I/ }1 d" p% j- E* X) V- [    xor     di,di
& b8 c; e2 b  n2 ^    mov     es,di) h1 W' A. c% b* z9 Z+ _8 r
    mov     ax, 1684h       % z1 {' [  L0 o
    mov     bx, 0202h       ; VxD ID of winice
+ f5 F$ Z& O. ]# h+ ^    int     2Fh; ]- e: D- t) Q1 |- y0 b
    mov     ax, es          ; ES:DI -&gt; VxD API entry point( Q0 c# }4 ~$ H9 d9 ?; _
    add     ax, di
2 p; b7 v4 Y. D+ p% J2 J    test    ax,ax; z4 k2 I: C; O: B4 p* E
    jnz     SoftICE_Detected% Q' O# z- W8 X
5 A3 N* B( E; k
___________________________________________________________________________
" \, o; p! _3 Y6 V+ P8 T; h7 ]$ h0 g& p4 d9 |
Method 04
  z- }- o; r$ u5 l9 s) J% j6 l* |=========
$ o$ ?5 ^. \/ w' p
( Y( V4 ?/ ?7 WMethod identical to the preceding one except that it seeks the ID of SoftICE
6 n# {% R( W; M: R# ~GFX VxD.. c5 ?& g7 ?1 |5 s

, k! [/ w% Q  I0 E    xor     di,di
# y; @) D- }8 b: N1 W$ ]5 x" \! }    mov     es,di
! d$ e( ]" K$ \- L  ^5 O2 I' `    mov     ax, 1684h      
& U3 l8 R" N% g    mov     bx, 7a5Fh       ; VxD ID of SIWVID; x& c; ^2 A2 {
    int     2fh
7 X5 O; H- ~1 F1 n" q1 C7 ?    mov     ax, es          ; ES:DI -&gt; VxD API entry point
0 P& |& n- L( z; V, G    add     ax, di+ m3 g4 `* m: C# t  G# t1 t( t
    test    ax,ax
6 z% j2 M7 G8 l0 I    jnz     SoftICE_Detected% c" V1 S+ p) a; U1 v! B2 g. I7 w
. ]( J8 V0 W- L+ u5 i5 s4 p
__________________________________________________________________________9 E9 }2 ]& U+ O7 V3 y- c3 y

9 n" T' p* b, K% j2 @. @
: ?' d$ g7 `8 U9 }# G6 _Method 05' m) D1 y# ~: L3 f
=========
6 M8 D. s2 b$ v5 I" A) a- h9 P0 t& w$ @6 T% V( ^  y
Method seeking the 'magic number' 0F386h returned (in ax) by all system
. |! v  s% W3 g5 Y9 f5 bdebugger. It calls the int 41h, function 4Fh.- o' S7 |, `! v- m( h3 z1 o
There are several alternatives.  # E7 P1 {0 @1 O* @5 I1 o8 `
0 C! g- r9 ?6 n
The following one is the simplest:* Q8 E+ r+ C5 p' ]) T3 P4 a7 l
- B9 j- O& m: f. g) p: B$ J2 o
    mov     ax,4fh3 |/ I4 q+ I: y# s1 C
    int     41h
& V" K; R+ `9 v8 W0 Z! |* f    cmp     ax, 0F386) H, e' ~6 s$ d
    jz      SoftICE_detected' k% ]+ ^/ t% {: ^9 T, @

! L2 R' k0 F& {7 v) c+ d# P0 c
4 A) L& F9 C; ^4 E4 PNext method as well as the following one are 2 examples from Stone's ) x0 S' h7 x' X* X) s- {9 U
"stn-wid.zip" (www.cracking.net):% G# J& Y% k2 ^' V
1 J9 H8 @+ ~+ Q$ J) S3 z$ J
    mov     bx, cs
+ }" W! [3 Y6 Z6 y0 o    lea     dx, int41handler2
2 D  O/ X" i- ?' X) r    xchg    dx, es:[41h*4]
) [( Q- l. {& B7 l. }6 g1 b    xchg    bx, es:[41h*4+2]- k% @& v/ U' e* L
    mov     ax,4fh) b. Z& L( q, H( U
    int     41h" B% ^$ y8 N1 D4 E; t/ X! H
    xchg    dx, es:[41h*4]
& P$ P1 X0 R! |2 `: I    xchg    bx, es:[41h*4+2]" W% q1 \) {& B1 t
    cmp     ax, 0f386h
" k3 K& ~6 K- Y    jz      SoftICE_detected
8 e! o: k+ y+ K3 Y% ^/ [* p( P2 R3 H! ^: |8 o% [
int41handler2 PROC
1 l0 U$ g$ z; y/ V8 J3 A) l    iret
: ]+ U' {( F! o0 F9 I! N" e' Tint41handler2 ENDP6 d% S7 |$ O5 s- U9 m* {

5 S5 `6 j* F- n' m2 b+ V% B2 u+ T1 G
_________________________________________________________________________( p& m! |4 `2 u# a, W( ]6 x

/ X$ |- c& p0 `. c/ q7 K
; o% W, y& b6 [- o# O$ l0 v: FMethod 06* ^9 F+ E- U9 C3 a4 _0 @+ k
=========
  h9 O1 Z* T3 K& B8 b7 M$ E; }* B) s+ Z0 ]2 t6 a' K. j

5 j( ~9 {0 I& H9 h1 f2nd method similar to the preceding one but more difficult to detect:8 z6 F( a% {2 C. {" m/ B0 ^

& h$ D" p  j  z' u* k
+ }7 j3 Z3 N4 z( }0 r, s( k; Vint41handler PROC
* q' B9 e! K8 T" @+ E7 ]) I4 m    mov     cl,al
9 m& w, ^8 \$ N$ \/ z9 m& `- g) D    iret  M& @2 f% ~" d5 T: q# F
int41handler ENDP2 j7 v9 q; z0 y( D$ m5 O8 H1 j

' _8 x  [0 }3 O5 b4 J8 R  a
. g4 w1 T" B7 ~# C# n; A    xor     ax,ax
* P  \" T# A, b& O    mov     es,ax7 l" k+ Z& c2 P" C8 n; [7 n. s+ z
    mov     bx, cs* q6 y; p- m# p; ~9 Y4 ]3 c
    lea     dx, int41handler) ]3 \4 g5 b7 f# x( d/ H5 q5 t
    xchg    dx, es:[41h*4]5 m/ [3 C3 ]5 H9 J. B
    xchg    bx, es:[41h*4+2]
3 q1 ]3 r3 B, @/ O1 M) m+ l    in      al, 40h& V6 D$ O" [+ u  S
    xor     cx,cx& w) q* y2 N* _0 {/ c
    int     41h
9 b& z+ q* i3 A5 z9 _4 Q: `    xchg    dx, es:[41h*4]! {5 j$ n% t0 k2 K; Y3 K$ _
    xchg    bx, es:[41h*4+2]: J. p' X; N/ a
    cmp     cl,al
* n9 M$ P/ w5 C' l9 O% Y( f% v    jnz     SoftICE_detected
) A/ G/ Y/ k. P" |. i  C; ]; l) T# A
_________________________________________________________________________, \( y+ w" Q" b7 N8 |, ?
9 X- s8 l$ ~/ Q6 l
Method 07) @) _4 r* s+ H4 |9 k
=========8 }; R9 U9 r; v" p6 p

/ Z# r( y! l" |* C* z# v  V; TMethod of detection of the WinICE handler in the int68h (V86)
. t! [: d$ |$ c7 I5 X; L4 J
: h+ V0 _4 s2 u0 e6 i" t0 f    mov     ah,43h
1 e# C- Z, D$ {% s/ U    int     68h
. {3 @  i9 A" r7 E% f    cmp     ax,0F386h
/ S9 Z3 S* W; J% t2 f7 B8 z    jz      SoftICE_Detected
3 n5 a& z! y6 q3 X0 {- F5 g
: f7 }9 M' Q# J( x! |4 f& h8 Q1 w( @
=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
# `2 f) H( r: _0 Y2 x. E   app like this:& A; K. {1 X" s
) f0 u( X, Y7 ?; ^# C  c1 p1 W2 x
   BPX exec_int if ax==68
8 @0 }2 I6 s) F$ x4 t+ B   (function called is located at byte ptr [ebp+1Dh] and client eip is
( ^# P6 D; D2 s   located at [ebp+48h] for 32Bit apps)5 S4 _1 E1 u% E* ^% H* M* p( d
__________________________________________________________________________, N9 P+ Q  F4 L" v! M% v
" I+ R" @9 b- t6 z, c

  f4 {* v, d: G' CMethod 08
/ {" N! \+ @7 F=========
. g/ B3 \8 @9 B( `
, T! o+ z6 f, y& r, `It is not a method of detection of SoftICE but a possibility to crash the& k; W( ^% I* Q1 q4 L
system by intercepting int 01h and int 03h and redirecting them to another
! I3 I0 K6 @, Aroutine.$ x1 B/ ~& G  s
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
9 B) z% F' w* dto the new routine to execute (hangs computer...)
0 d9 d  _) ~# N0 ]) }5 m+ s7 S& b$ G& o% O% O1 B
    mov     ah, 25h
3 V3 z- S) N0 S    mov     al, Int_Number (01h or 03h); W9 A5 o, ?3 I. q1 X
    mov     dx, offset New_Int_Routine1 o9 m" o8 X! m. H& j/ l# R
    int     21h9 X; \# O9 W% B" e/ ], L
/ C+ b; e: _2 A: V4 j% B( C% O' g3 a
__________________________________________________________________________/ z* n, T1 X6 V1 b' U& E
% |8 |5 W1 s3 S1 }/ j) q3 b$ ]3 @( s
Method 09
3 H: j$ t' N) y=========
7 y* Z% K" V! W9 Q' o* L- k! N" L5 n$ ?
/ ?% e* ^0 w0 m$ L4 v- F4 dThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
3 Q8 p, f$ A) V6 iperformed in ring0 (VxD or a ring3 app using the VxdCall).
* Q8 J; m0 o) Q; iThe Get_DDB service is used to determine whether or not a VxD is installed
/ U( e# p  X* M% X* }" ~& o# qfor the specified device and returns a Device Description Block (in ecx) for
6 l4 L0 T6 ]# R, Sthat device if it is installed.2 p+ k& v8 f' L$ Z

/ f: l9 _1 y( [0 g' i   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID
/ U; [( T5 U+ G0 D" u$ ]2 Q. R1 R   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
" C1 e4 F. u! _: W- J   VMMCall Get_DDB
1 t3 v& ]; B* T' g. k   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed* ^. A0 G/ u) e7 }7 q, M' j

3 M, J# {" G$ ]; BNote as well that you can easily detect this method with SoftICE:
5 |3 f- V7 |1 H4 w. E( x   bpx Get_DDB if ax==0202 || ax==7a5fh
2 G: z+ j5 f# [) j* c
; B. p! B0 l8 \2 n" L% B__________________________________________________________________________
& ?0 A2 s. V& M" c. {/ o! [( ?3 s+ ]- p) [& ]7 `; K& @; O- p
Method 10& o  }/ \4 v: R6 ?% \7 ?8 M
=========
8 A9 Y4 y. E7 I3 t! T6 s2 R# A' R8 Z
; q9 G4 x: w& t. t# H=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with
( L, H' k" p* i: Q, M  SoftICE while the option is enable!!
& O4 g3 n/ a2 J: O( C8 ?, E% V; M( T& J- f+ o, X2 p
This trick is very efficient:# H2 g1 p9 u. a: H# R
by checking the Debug Registers, you can detect if SoftICE is loaded8 b+ I. S9 a2 G5 X& c
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if6 b3 K8 G" ]9 w& `, o
there are some memory breakpoints set (dr0 to dr3) simply by reading their
8 e& J( p# v: fvalue (in ring0 only). Values can be manipulated and or changed as well; _3 h* A! O3 B1 O, E
(clearing BPMs for instance)
6 r- n9 ?$ X5 v! k7 F% m0 v. d% R
__________________________________________________________________________
2 b$ K3 r, g5 v: m; x) R+ P& A% |, Q9 W- e* R; z9 U
Method 11
# V3 S. B4 b+ O% t  g7 \=========) w% Y1 Q. d0 o' |) d& S( ^
7 F) j/ t1 E! K- g( K# U
This method is most known as 'MeltICE' because it has been freely distributed2 o; V# [- @( z4 K# M
via www.winfiles.com. However it was first used by NuMega people to allow- v3 G: ?, R. f0 L
Symbol Loader to check if SoftICE was active or not (the code is located
/ G- T# x& t3 g3 O, M# u; x$ Iinside nmtrans.dll).
2 f* ?1 W$ ]4 a% g0 _4 i8 L! ?+ \( ^: s6 h& P" }) A# l
The way it works is very simple:2 p7 Q) H0 F0 O
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for+ M. J" `, g3 V! \. N& w  Z
WinNT) with the CreateFileA API.
# p) K6 U( S2 v; {1 ?/ i7 P, |: P* m* ?1 U& C) a1 S2 T/ H' x1 p
Here is a sample (checking for 'SICE'):8 N' m" `3 Y. u" l" j

7 z% O0 f' ?* ^7 Q0 E8 l" w; }BOOL IsSoftIce95Loaded()3 V7 c9 B! o+ X  T
{  \! a' M4 b2 \, ^. h# `/ Z6 F
   HANDLE hFile;  
) _3 T" }4 `# U) n2 c3 A  r   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,) f5 L) [: R2 T+ A5 _% i1 L
                      FILE_SHARE_READ | FILE_SHARE_WRITE,) P3 B( v) J0 Q; m3 Q, W
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);) H' r+ R8 X6 |$ B7 D' [0 [1 C9 m' L
   if( hFile != INVALID_HANDLE_VALUE ); N, z! K% d! l/ M& U
   {
( m$ _, v% E2 K9 J" P2 k1 J5 }      CloseHandle(hFile);
0 y' [9 ]& {3 H4 {1 _* Q6 m      return TRUE;
, F9 L* `4 N3 R# V, f   }: n- R# Q. @; t6 Z; U9 A  g1 E$ Z1 l
   return FALSE;$ H2 e' O0 }4 ~' s7 o
}7 z0 y1 n" B% a) O* D4 K, L

/ p' j2 L7 T9 pAlthough this trick calls the CreateFileA function, don't even expect to be
, f) M8 c  T" g7 M0 Nable to intercept it by installing a IFS hook: it will not work, no way!- x( G& E: t7 [$ J2 L4 V
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
2 |3 s/ a0 N( h& H, l8 l7 o* P9 kservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)) d9 h( u6 a1 X5 G' F7 F) ^1 C
and then browse the DDB list until it find the VxD and its DDB_Control_Proc3 K9 a. C, f0 V/ v& N2 L
field.; P8 J0 q: Q, Q' P5 c4 {$ l
In fact, its purpose is not to load/unload VxDs but only to send a
/ ]+ T( V# Y% B7 uW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE): i' r3 L  q  A$ u: f* e: a
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
6 Z) p0 f9 ^2 [/ q  bto load/unload a non-dynamically loadable driver such as SoftICE ;-).
$ H( S4 R5 N  Y, ?0 xIf the VxD is loaded, it will always clear eax and the Carry flag to allow/ s0 f. p0 u/ x( L' F& ^
its handle to be opened and then, will be detected.# P% `2 e7 A  w" s/ ]$ p
You can check that simply by hooking Winice.exe control proc entry point- E+ Y: w3 g! O& E
while running MeltICE.
- r8 J5 f5 i( ]4 n& @4 H  Y1 _6 G" k" L! f9 l+ e
! Z2 T" v+ [5 h: [8 H$ i
  00401067:  push      00402025    ; \\.\SICE
, k: M% A6 `/ w- b  0040106C:  call      CreateFileA4 A& E7 l4 P" b+ s$ T
  00401071:  cmp       eax,-0011 `# z% _! S6 }! A' k( T
  00401074:  je        004010910 g0 D" @& x* K. n8 z) \  W8 ^

: C7 }1 \4 Z: ]7 s( N8 d1 V
" y1 o3 J, s) v! X  e, ~There could be hundreds of BPX you could use to detect this trick.
0 n0 o- a* d# X/ d% W-The most classical one is:
  G7 J& A. z# a7 \  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
# l- E  z# b8 Q0 W7 H  }    *(esp-&gt;4+4)=='NTIC'
1 l" H8 Z$ }5 |, i
' I+ M8 [* V) u2 S-The most exotic ones (could be very slooooow :-(: ~+ a! v0 E4 F4 M
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')    i, h: N! x5 g- }
     ;will break 3 times :-(
0 `0 C& O' E& I! e4 h( N& D- K* a# y: O' j, B, `$ @/ e. ~
-or (a bit) faster: , E; e' \3 K, R$ ~
   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')4 \" B7 z7 t) w4 ]. _

" e* e7 Q9 h& h  J: B   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  
% \$ @' F, J7 d* }, N3 n     ;will break 3 times :-(& G: N1 |8 b& a& t8 ^* T+ F
3 `3 S# i# d  i# V& J" f4 j
-Much faster:
( w. `* o. \, |6 Z$ D   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'
7 \7 I# |1 F* T0 Z4 d1 X  n# Z+ L7 L: C0 Q1 s3 ?; n/ ?) M9 I
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
9 q: O6 |/ G7 B1 hfunction to do the same job:
4 @2 W8 T# P; a! D' N, w3 K/ H/ a4 N7 m% P& p) m2 R
   push    00                        ; OF_READ) P0 l, N7 Q* i8 w
   mov     eax,[00656634]            ; '\\.\SICE',09 C2 F1 T( g, J1 i7 `, _
   push    eax
6 s7 }' q8 J; K& b! z   call    KERNEL32!_lopen' }5 [+ S0 R5 ]0 R  R! k
   inc     eax7 ^+ ?) O9 C! T  Y; T1 r
   jnz     00650589                  ; detected% g7 J0 E% @5 J
   push    00                        ; OF_READ6 l: R5 S: |, B0 b
   mov     eax,[00656638]            ; '\\.\SICE') n0 L8 s  I3 z% i  O
   push    eax' V; C3 X. s. H8 Z! [
   call    KERNEL32!_lopen
, w' A; w$ T! X8 k8 j, c   inc     eax+ O$ p* p/ v; Z" y+ G
   jz      006505ae                  ; not detected
. c( g, r3 t+ D; e  C
0 Y/ Z+ }# I2 H0 p  q/ K$ E. @5 F' X; s' T7 G0 {9 s
__________________________________________________________________________; z- J- u) Z2 r% H' r
' a) H: M* U  p4 |$ O. s# V
Method 122 S. c# H  y1 o  B$ E
=========
: V- S! m2 A( {4 ^3 u! _8 S4 [% V8 P7 o) u6 `, G' L
This trick is similar to int41h/4fh Debugger installation check (code 054 G) L- z3 l& `; l" _2 C
&amp; 06) but very limited because it's only available for Win95/98 (not NT)2 P; n1 ~3 u( _
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.# E" z* C* d: z9 ]. A. x

3 h, c+ ^4 J2 s$ A% `- M2 ~   push  0000004fh         ; function 4fh  y; y* g% P5 D) j9 E
   push  002a002ah         ; high word specifies which VxD (VWIN32)4 H1 j8 [6 W. j- j
                           ; low word specifies which service' q* b3 V" `& t# |* w/ S) w3 s
                             (VWIN32_Int41Dispatch)
, D! S& u" m- X. A, ^   call  Kernel32!ORD_001  ; VxdCall3 D9 K1 Z1 @: v- H) J8 }- g
   cmp   ax, 0f386h        ; magic number returned by system debuggers
5 R0 F' ]9 M) b! D" J; t8 _8 H0 x) }   jz    SoftICE_detected
, a8 U0 }6 R  G: a. q; E3 W) V4 y" i2 E: A3 y. O" b( Z
Here again, several ways to detect it:1 e: ]$ g& ^+ r
- ^$ ]( e# ^1 t' i% h
    BPINT 41 if ax==4f
- ]: R" }) o3 h$ \1 f/ }, W2 a. v
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one
! y; I' w4 B5 h- b% `" C9 N8 J5 |( Q) r( J' p/ Q+ c
    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
% ^! n7 C2 B4 h5 J8 f
# r" p: s' Y5 d9 v    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!
: o+ r: t& C' r' R8 O. A5 e6 V. `8 V0 R5 J. H4 d# k
__________________________________________________________________________
, H8 p3 V9 ?7 C, W/ z* k5 w- J' Y5 |4 A) g% J1 R
Method 13+ R* l5 q( U2 r0 j8 W$ _8 \; p; ]
=========3 R. u: P  o/ b4 Y. E1 [) M

) u5 L; l6 i$ E$ g8 h& H% a( `Not a real method of detection, but a good way to know if SoftICE is
. G8 \  |) g7 B$ s4 N. L; r8 Yinstalled on a computer and to locate its installation directory.
: U  T6 H; T! `9 T8 N6 A5 tIt is used by few softs which access the following registry keys (usually #2) :
; f- w" ?4 M" l* q3 W* \% G9 B9 R2 E4 r
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
; v9 B! S7 w( j! h9 v# Q\Uninstall\SoftICE
1 w( M; E% H& k3 e+ y+ D-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE3 ~5 i  N2 l) ~9 ~0 @2 ]+ g7 `( u
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
. c7 J: n. G  r4 j\App Paths\Loader32.Exe7 \. l8 Z0 B$ K5 ]! C' E5 \" L) v, p

6 w7 s7 ^: m" ?6 S/ @
  `- C+ j" J0 V4 W+ u" P8 k- ENote that some nasty apps could then erase all files from SoftICE directory- d" u& M; v5 M! b6 L
(I faced that once :-(
$ F2 J9 k. E. d- I% L/ z$ [7 D5 i- J: p  R! A! O/ B
Useful breakpoint to detect it:8 x' w" W$ f3 _& y. W' Z7 g

0 `2 O3 j7 X& G: x     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'/ A6 B; i$ ?  ?

8 |$ q# p- ?! \! h& |4 j) d__________________________________________________________________________) ^9 G) O+ u# I6 q% a

# e& s7 G0 @  K$ S. q( l7 ^# ~5 d
Method 14
' ]+ P: c( V& @* e  h, N=========1 u6 ]  \: j! h- e4 [4 g: j
2 `$ `9 ^8 i" Z6 r; _5 N
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose- O2 U  }* o+ }2 p' N7 V
is to determines whether a debugger is running on your system (ring0 only).
4 L* O9 K( S- u" J, a* O  t  C; v* I: S7 j* h6 x, p
   VMMCall Test_Debug_Installed- p# I+ {( _6 |3 P3 z/ q% ^! O8 G
   je      not_installed
8 r4 H; b5 Q- r& o7 s& ]1 ]' ^( A1 h" j
This service just checks a flag.
  d& B5 L* F$ |) A; d0 A0 ]$ M</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-8-20 10:20

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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