找回密码
 注册

QQ登录

只需一步,快速开始

About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>! k/ e' I0 ~8 S: I, Y8 t
<TBODY>
$ g' N( x2 q' i2 _- A/ ?<TR>9 P+ y1 A1 Q. X8 c- A7 I+ W$ b
<TD><PRE>Method 01 % d+ Z8 l$ @7 s8 T! j2 b
=========- O. j# D8 Z1 [2 n8 \) i1 U- i
! {, m5 _9 e, p$ Y% [' Y5 y; J2 x
This method of detection of SoftICE (as well as the following one) is! }! [" Y! @( V' Q
used by the majority of packers/encryptors found on Internet.
# f- E) Y) x- Y" N! X" e* @: UIt seeks the signature of BoundsChecker in SoftICE$ X) j7 ]: V) ]) v6 |+ n/ l

5 d4 |# I! @/ c! V    mov     ebp, 04243484Bh        ; 'BCHK'
  t) S) Z8 K# Z4 P$ J% S2 d: O    mov     ax, 04h6 R* N% o2 G. h0 ~5 n3 Y( N) Z
    int     3      
) s5 ]) t7 N2 a    cmp     al,4
9 g# x9 s6 q# a1 ^' E    jnz     SoftICE_Detected+ \- c+ G5 R& I
1 C8 s; \$ x4 `; @/ a" h
___________________________________________________________________________
  R; x" V- e) P# u0 d
% S. U8 h+ O) ^& k3 rMethod 02
; C  O' Z" w3 j. F; e* q. q=========
# ^' r) i9 C0 N  e* I
- A) K$ w3 R# _Still a method very much used (perhaps the most frequent one).  It is used
8 g  q8 s- K( ~to get SoftICE 'Back Door commands' which gives infos on Breakpoints,. f; a$ K/ K, S/ e1 x7 e
or execute SoftICE commands...
# x9 F5 h% D, AIt is also used to crash SoftICE and to force it to execute any commands6 N  W/ p7 F  \3 [
(HBOOT...) :-((  
  J, b" Q" G0 _3 S* @. S0 r& g! o
Here is a quick description:* m; L9 q# }6 n( m! P5 X8 o0 E
-AX = 0910h   (Display string in SIce windows)* U" }- d! O% K( F5 `
-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)
5 U5 H. i, w; J$ z* u; |-AX = 0912h   (Get breakpoint infos)
3 l% A) o( f, E# ^-AX = 0913h   (Set Sice breakpoints)7 ~0 d* a! p+ b) N1 k; a, ?! e
-AX = 0914h   (Remove SIce breakoints)
+ o6 q$ d$ G# x3 D3 I
3 q' E! W9 B0 G% q7 w  H* @Each time you'll meet this trick, you'll see:; I5 A0 Z' T  j8 U2 V8 t
-SI = 4647h- P% H( Q/ y& l: q+ {0 G# E
-DI = 4A4Dh- i* Q( }  \; `6 Z
Which are the 'magic values' used by SoftIce.4 S/ h+ W- W6 i. ?$ k- o
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.+ S1 M3 g3 i6 O# `: D3 O# u
# Y& r4 O0 u# n7 w7 Q2 u8 s
Here is one example from the file "Haspinst.exe" which is the dongle HASP6 r- T6 [# p0 C# C9 w' u
Envelope utility use to protect DOS applications:, T" _0 ?) I; u& ^. I8 H8 w* L

% [$ N% f$ s1 u5 V, I4 m; ^$ N. z* P9 ]% U/ _+ T% i( d
4C19:0095   MOV    AX,0911  ; execute command.+ M8 X! \5 q; p+ y4 i
4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).8 o0 L: U$ m% J! Y6 B
4C19:009A   MOV    SI,4647  ; 1st magic value.
1 _" L/ f$ b$ _4C19:009D   MOV    DI,4A4D  ; 2nd magic value.
6 Z# M# Q0 [9 k. \, Y5 ^$ H4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)1 _7 d/ L, x! I) Q2 q- s
4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute
9 p5 q! a  D- X6 m3 X1 [, J1 n$ O4C19:00A4   INC    CX% |& f5 x) F/ T8 v, C
4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute5 H) b/ t/ C  K9 \' x; q
4C19:00A8   JB     0095     ; 6 different commands.5 a- ?3 L: \. m, I5 K1 F
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
4 x1 b: W8 `0 A( X0 L; `4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)
* f3 f- M5 `5 |7 W( M" g" Y
3 g! j4 Q( t; D1 @, C/ TThe program will execute 6 different SIce commands located at ds:dx, which) r# e, n( y& I- n
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.9 ~8 U% C1 D9 L3 Y: Z4 L
6 d) V5 x& g/ Q* O. F6 w
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.2 Q; u2 W& N- R: F7 P7 b
___________________________________________________________________________
3 L; ?! _3 U- I2 O- S, ^
: |. C. K9 L# Z0 j# Y# a% j$ p! W+ M1 @
Method 03. H! f: ~  a* T8 T
=========
! g" s. [+ T; w# M- M' d$ o' A2 u  Y- @' N$ e
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h5 C' D! k( B0 e# z4 K3 G! f: F# b
(API Get entry point)" ~0 c2 l2 M- W$ D- f* j; q% q* \$ u
        ( j: }* ^5 D7 y: K

, y+ K, ]1 I1 y2 s, K    xor     di,di
* d/ H& c: s5 U! t/ S7 `4 b, C    mov     es,di4 ]$ D2 F9 h' Y6 n+ x. |
    mov     ax, 1684h       # a/ T+ K- r7 `6 G+ M
    mov     bx, 0202h       ; VxD ID of winice
% M- D( ]- J% Q; Q    int     2Fh
; F( t) [" c' {% V" G" R0 @1 N    mov     ax, es          ; ES:DI -&gt; VxD API entry point
9 O0 O1 I6 d  Z) K# |1 u    add     ax, di# g: _* c: e; K- ]5 k9 ~) @
    test    ax,ax
3 O2 e5 @; o  \( D, s    jnz     SoftICE_Detected
' r0 x, ?$ _% x+ L/ p$ s" }7 _; J6 l2 h+ |8 i4 {5 _/ m) r
___________________________________________________________________________) w" O5 Z' x% p

2 S& T2 Y: U( r( n! x! CMethod 04
  ~: d" b+ {) C1 F* R=========" Q8 l' _$ ~$ {' ~# _# ^7 G
& T5 [, y' Q/ T- b" }5 q
Method identical to the preceding one except that it seeks the ID of SoftICE
' b/ B% j# A# {+ ]  M( t. LGFX VxD.
5 t1 y/ l' f9 H- t6 S9 X2 ]) a- b$ j6 j0 M3 Q6 Z1 j( d
    xor     di,di; @+ L+ D1 E% u3 ^- E
    mov     es,di
4 D) N* k* ^! y% g5 W    mov     ax, 1684h      
( @+ `/ L0 C7 e7 [4 t0 g3 K! O% O5 V% N/ D    mov     bx, 7a5Fh       ; VxD ID of SIWVID. S1 D; ]: z6 D1 A) H
    int     2fh
3 Y; U: a9 I. ~    mov     ax, es          ; ES:DI -&gt; VxD API entry point
, F9 }* L% `$ K    add     ax, di
# V8 ^+ ^4 e" U# B$ e7 [- S$ ?4 {    test    ax,ax
- z, ~- q; c8 ^    jnz     SoftICE_Detected
7 I0 a8 A, a) ~8 V1 Z# z  F: z, W  w: F. W/ u
__________________________________________________________________________4 f$ j) S& _: P# Y) Y2 b& w
% F, a! E: f4 {* [$ l# A  N* D  z

: i) h5 N) ]" K( c/ ^3 V8 L. K; FMethod 05
% H) Q+ C: U! I/ ^9 J" J=========( s& A( F- j- K/ ~0 \8 j9 t
! ]- R2 N; X1 |* C2 M1 `% D* Y3 w; N
Method seeking the 'magic number' 0F386h returned (in ax) by all system! D, X* F% y* T, y# C( b
debugger. It calls the int 41h, function 4Fh.6 M; ~* L1 P2 u6 j* y
There are several alternatives.  
. J) w1 A+ ]; ~
" \0 b1 }0 x9 C7 F! f0 ?6 DThe following one is the simplest:
& l; J3 `3 i: F8 B2 M8 e2 s0 k% r  k, F) i3 f6 ~% v" k0 X
    mov     ax,4fh
* i0 G- I  _2 P3 y0 g2 T0 u, M8 M    int     41h
) Q4 [& N# ]1 o0 f( Y; ?  M* O# C    cmp     ax, 0F386- u* f* J' n" Y$ o" i0 |; ?+ v
    jz      SoftICE_detected
* Q" B% B- O. C) Y# H+ X7 ~; b- u  f5 U7 z! c2 g2 B
& B7 X' S5 S: G  E
Next method as well as the following one are 2 examples from Stone's ' C* }  j7 l2 P# p! Y! ^- A
"stn-wid.zip" (www.cracking.net):  u) P' D9 ~8 s( |% F7 [+ l3 Z- N

; z: x  z; Y% F# v' `% t, F* M    mov     bx, cs
" J& N/ m/ Z8 j    lea     dx, int41handler2* z1 T6 p/ C8 w
    xchg    dx, es:[41h*4]
. \6 P* b5 Y! F$ q( H    xchg    bx, es:[41h*4+2]6 v. n6 \; O( \& `6 w
    mov     ax,4fh
) ^9 C5 s4 P& I, m4 f    int     41h2 U6 j, Y. {  [. T  i
    xchg    dx, es:[41h*4]6 y0 k9 B7 Z3 b' a9 P6 x
    xchg    bx, es:[41h*4+2]( v. a8 N% `, |) R
    cmp     ax, 0f386h
% Q1 x6 N" L9 k    jz      SoftICE_detected0 G- I/ Z+ }3 s6 ?5 ]

7 P$ }) R! c4 u( _$ e8 Vint41handler2 PROC
4 l4 I2 s# q) T+ p) D    iret- l+ ]& m" k1 e$ B8 M
int41handler2 ENDP& y' h& A* z# A( _- |, M
. E9 Y& Z$ l5 Y  _3 N- U: V; R
$ r; _3 d7 \9 W" Q* g6 }9 ]. _
_________________________________________________________________________
4 J1 h8 z4 v, I6 M" d3 E9 N4 P! E6 o! t/ b0 A+ v5 X
( M( W  x! Y& Y- x/ V
Method 062 x" Z% c* {  N1 }# K2 R
=========& ]: ^9 K" m+ ?: a9 L1 v6 ?

2 K& ?' K0 T8 C, n+ R7 K" {0 ]5 O' i& S! R
2nd method similar to the preceding one but more difficult to detect:9 P2 B" ?: u, O2 d( |9 Q) |6 s* O

/ c' D* e8 O( n1 E9 H4 G2 r6 A6 U/ q* c2 u+ U0 ?7 G- g/ }
int41handler PROC! R# t% d; {* z/ j
    mov     cl,al
) b% C2 w( \  Y- ?3 L4 d8 Y    iret
9 Z7 t8 t3 b( k- l% x, a+ Fint41handler ENDP
7 a/ T( w0 y! [- T' d6 i3 C: S9 e0 @* J
0 s, k# {( C& R7 D# J, A
    xor     ax,ax
9 d' f+ `# U, v" ^  W    mov     es,ax" y! u8 ?& S7 C. y9 B- e
    mov     bx, cs/ ?( Q9 \" _( M2 }" s/ N
    lea     dx, int41handler0 w6 j% l4 ?* J* l
    xchg    dx, es:[41h*4]8 b% D% E8 ]" p" Q$ L8 P& Y9 ]
    xchg    bx, es:[41h*4+2]* z5 P7 L$ ~0 X6 k
    in      al, 40h
6 S! X  p- G8 {. k    xor     cx,cx: l  ?' v3 n7 G6 S9 b
    int     41h4 ^) t: m( w% Z' B' y6 g; L; }1 c
    xchg    dx, es:[41h*4]+ i1 C" U- E; Z! \5 a7 d
    xchg    bx, es:[41h*4+2]
9 Q% u4 z1 T; |( t7 i    cmp     cl,al
( R2 E8 u7 d' e# s( w2 r6 `    jnz     SoftICE_detected
* n% ~2 Z' \* \/ j8 ]' l, ?4 g: B. J( D
_________________________________________________________________________
% T+ V3 A4 P# T8 n( B; i9 A4 v% V5 g# f- g( \+ o
Method 07$ M( N9 @9 ~2 g4 L- L
=========7 ?: \- l9 B. y( Z, |0 D$ }# o) X

, d: d" f# c! q" j: L1 m/ @Method of detection of the WinICE handler in the int68h (V86)) s" n: U, k" N9 |  f
6 U5 g- I7 G" f' f, Y, Q
    mov     ah,43h& M7 ?5 k/ L9 X) C  V8 e6 `
    int     68h/ T  a, d6 ^" z: j) ]) w
    cmp     ax,0F386h0 a! u! M5 q; r9 p; J3 e2 P2 K
    jz      SoftICE_Detected
6 {: {' t* N4 [9 P: f  }3 Z; C  ^; d- u2 X4 \0 A

  R  e- i# [2 \7 r=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit: F' N* @+ I2 K; M4 S
   app like this:
( `* D$ h3 t$ `1 [
' ]' e- A7 C$ W& e2 H6 k+ W# f1 N   BPX exec_int if ax==68
$ J* T  n- \' M# F1 x) y' `+ o% b   (function called is located at byte ptr [ebp+1Dh] and client eip is
6 I% J5 Z2 I1 @  \   located at [ebp+48h] for 32Bit apps)* b$ e, a" a7 W2 U: ~& Y
__________________________________________________________________________
0 c& w7 Z' W+ J- H
) _9 r" _$ D" u0 g, f  x% r) Y' a
% U& T. Q9 Q6 N/ q0 q; H) ~' lMethod 08
8 n' }8 g% j: o+ P. J=========( k; n* |0 ?0 X. W7 L
, O9 }4 n$ T9 y( ?1 d8 ~1 D
It is not a method of detection of SoftICE but a possibility to crash the+ x( Y/ x/ Q: G% i0 v4 q& [
system by intercepting int 01h and int 03h and redirecting them to another
7 T9 ^. @+ L1 g* {routine.. `' }) I1 h3 X/ c# z
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points" y: y- z$ V5 _* ~# G7 w
to the new routine to execute (hangs computer...)" V. y9 h6 K- X- `8 |
8 H2 X; T# _, P6 m
    mov     ah, 25h# a- q+ U( n3 z% x) \' H: Q: r/ K1 B
    mov     al, Int_Number (01h or 03h)
! m' G( Q3 D0 A* v2 |7 A7 Z    mov     dx, offset New_Int_Routine' \, b1 U, v1 y& ]: k0 Y' O
    int     21h
/ ~' `! j/ A5 L2 e6 X( L
. }) t4 o. v' J" P7 |$ _! ?__________________________________________________________________________2 d$ S6 W  B, N2 e; b4 k
: B/ Y* |; L7 t
Method 09* c6 U; L, k5 E
=========
" t: c) B' H. ~7 B3 g' H- f$ u* F
1 r" I5 n( Y- q; |  z3 n2 l7 lThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only4 h+ b2 {  O6 z* E7 z6 Q
performed in ring0 (VxD or a ring3 app using the VxdCall).$ m: D0 s4 H; i) u5 h
The Get_DDB service is used to determine whether or not a VxD is installed, U6 K3 i4 E4 \* m( V
for the specified device and returns a Device Description Block (in ecx) for
* ?6 l7 ~( V& w" ?: O/ bthat device if it is installed.' x" J8 X% g2 }
; A) @7 D6 ~8 ?6 F( S% K7 R
   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID
7 S) x" _+ T5 u( Y$ T   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)7 Y# f0 [, u$ u/ v6 E& n
   VMMCall Get_DDB
+ E: d6 g& H1 u4 J8 `' Y% L   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed
! c  X9 @% m" |( ^& Y# J7 X9 j( u; c# W5 U7 z$ e& U3 A" C, D
Note as well that you can easily detect this method with SoftICE:3 u6 J7 I6 }- X
   bpx Get_DDB if ax==0202 || ax==7a5fh! s0 {) l! B0 {, K" ^

1 H/ f6 c5 B% O  ?__________________________________________________________________________
. G7 o1 }1 A% |& v. v! j9 a- J* _
6 y  r+ b; X. n$ b7 hMethod 10
7 T$ b+ S# E" o7 y9 O% R=========
2 Z! J0 B$ V; ?4 v/ A8 n
3 P0 e0 }1 J+ }# x=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with
$ s" T; b8 d3 ~+ j4 e5 N* T  SoftICE while the option is enable!!
, g% t( P' h) i5 o6 `  T1 I) S3 b( L! u& b4 [
This trick is very efficient:5 Y" D8 f, J  I) Z0 z% h
by checking the Debug Registers, you can detect if SoftICE is loaded7 i0 Q7 _& a$ C2 t/ z
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if2 H, M% U0 s! d5 c+ x, l. F
there are some memory breakpoints set (dr0 to dr3) simply by reading their" {# A( K. y# Y9 q* W4 e$ ]
value (in ring0 only). Values can be manipulated and or changed as well
9 G9 k3 f- k0 m. w: u(clearing BPMs for instance), \& |" C% M# J

6 v" y, `# S9 m__________________________________________________________________________
! E6 ?" g" L: `( q/ v6 p1 c
2 V: J" m/ j( A8 T5 c2 f6 S: ^5 ~Method 11' ?) y! n! `& ?% n. o' K& a% ?
=========
8 r4 Y- e" F0 x8 ?" [
: t) n  D* T! p& R. s7 r! FThis method is most known as 'MeltICE' because it has been freely distributed
- {/ E5 T6 j4 w% Z0 Rvia www.winfiles.com. However it was first used by NuMega people to allow* b7 o2 l. J# r% ]7 j1 s7 f- e
Symbol Loader to check if SoftICE was active or not (the code is located7 ~& p0 E7 O2 s0 j$ K; F
inside nmtrans.dll).
$ |; D' j) q9 s3 H/ {
8 q( b7 l1 u9 `' FThe way it works is very simple:
2 _& G% `/ h* v& `It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
' b" E; l4 D* f6 d! hWinNT) with the CreateFileA API.
$ l4 Y! ?* P6 x& K% F
" b& B, h6 C/ c/ mHere is a sample (checking for 'SICE'):
* z. Y, w  ^( ?' v
6 ^( j0 o. u4 v' C2 B; f% pBOOL IsSoftIce95Loaded(): Q, s# Z: `/ k3 ~" ]) D
{5 O' i$ ?1 |$ H
   HANDLE hFile;  6 I/ |/ G) F, |
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,  e4 @7 Z7 H( u0 A' \7 d, p3 j
                      FILE_SHARE_READ | FILE_SHARE_WRITE,. t/ a3 m5 W/ g. O
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
! u# ^' Z2 q' i8 M1 b   if( hFile != INVALID_HANDLE_VALUE )
2 \2 B( \; O) L# R   {
. o5 C) U0 Y9 |) d      CloseHandle(hFile);
0 e, z& z: B" U3 ^7 E% ]( S      return TRUE;
9 r+ V/ j& s  ^   }
2 m8 W2 T1 M1 U5 \   return FALSE;0 V% e" G- ?: ]  x
}! ?: I) s! N$ a/ N) Y8 R, b

# {- H! J9 V; j7 j/ o* S% aAlthough this trick calls the CreateFileA function, don't even expect to be
) g0 ~" b- i$ w+ N; K( ~1 Qable to intercept it by installing a IFS hook: it will not work, no way!
# e$ H. I( Y/ V! Z8 |In fact, after the call to CreateFileA it will get through VWIN32 0x001F
$ x: F7 V" L& T7 Q! Bservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function). a7 p  h2 _' f+ @8 f% Z7 T% ~
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
1 j5 ~! Q1 n& l5 B7 h' X/ dfield.$ i% b/ `9 X: S6 S0 e; C" i2 T
In fact, its purpose is not to load/unload VxDs but only to send a 4 v9 ~( K5 N8 ^8 O0 c
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
7 r) F& d# s/ e1 q' q, Mto the VxD Control_Dispatch proc (how the hell a shareware soft could try
+ F0 S5 r2 }$ Q! X/ b  Ito load/unload a non-dynamically loadable driver such as SoftICE ;-).
6 q  g7 v+ [% K5 B2 _% Q; fIf the VxD is loaded, it will always clear eax and the Carry flag to allow( F# q! \/ p1 V0 J8 h2 F
its handle to be opened and then, will be detected.
1 {' H0 u0 d* e# TYou can check that simply by hooking Winice.exe control proc entry point
6 |+ u4 r) _) s1 S) E$ Z# s( x5 nwhile running MeltICE., a+ `7 ?: Y3 I9 `
. F  e' i! E  ~% T% o( i. g$ y
# c+ L+ R. g( I7 ^
  00401067:  push      00402025    ; \\.\SICE
& J* e- B! m3 v8 i8 F$ c  0040106C:  call      CreateFileA1 G5 G# m' r' {8 a. S2 M1 m: E
  00401071:  cmp       eax,-001- o4 P  f& u2 T
  00401074:  je        00401091
4 U) Y/ z4 U8 r& r0 x2 o1 d, S
0 L7 m8 {4 U/ [. W, O" Z2 J$ \: ~* s7 {* D% {0 M
There could be hundreds of BPX you could use to detect this trick.! p/ p# [0 u2 W" }# Z
-The most classical one is:) g' [, p! N( Z5 m( b7 b9 z
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
, N9 @+ \% ?7 p- z    *(esp-&gt;4+4)=='NTIC'
$ J7 M7 S8 \9 N6 F) m2 {+ e* T  ?+ r! W3 k7 q; v. I  d
-The most exotic ones (could be very slooooow :-(
- X) W; x- ~7 a   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  7 C) f2 V9 x, `* r
     ;will break 3 times :-(7 a1 e1 g8 ?: O8 _( t9 ]& o' S

# M3 I  T' `4 }, }-or (a bit) faster: 2 Q' G- b* F/ [
   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
, v6 t. q/ }+ j& a' d7 n* c7 i( C0 g. P; k) k' b. G& M3 L, O
   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  
7 r& b# {. p" g. S9 _, I     ;will break 3 times :-(; |! R' H  ~( I4 H+ t, D
0 z7 `1 ~. X( n$ L' d5 _
-Much faster:7 B  t0 V, k+ i5 x  U; T" q; n! S
   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'
4 P4 k/ F, T0 X1 ^3 x, r( E. V! f* C+ c9 g. R4 E: a" ~: I
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
4 S$ g) U+ _+ W  o! ]function to do the same job:5 O: A# }1 O1 S  m- }+ a* H8 j! n

7 e" |+ s0 X! a2 x* {6 _5 e; u9 d   push    00                        ; OF_READ
1 [# m% m5 @& ]   mov     eax,[00656634]            ; '\\.\SICE',0$ I1 ~% p& G0 {2 [2 T
   push    eax* @2 B: q( [' c8 h
   call    KERNEL32!_lopen
  b- p; z: I! `' w   inc     eax, U; P; z9 D" k. N( ?+ i
   jnz     00650589                  ; detected8 f- i0 r& c# e( z* g& X
   push    00                        ; OF_READ
6 O. b( p5 g" n$ b. T2 s   mov     eax,[00656638]            ; '\\.\SICE'3 T& `; c4 L& R
   push    eax
4 i/ t1 F) A) H) q, X   call    KERNEL32!_lopen; K; s! U" V  {& e) |
   inc     eax9 S: p( _2 t  x* y/ x) i3 k
   jz      006505ae                  ; not detected
# b$ B% o6 I( ]2 S4 h+ \6 L( u7 m! W9 @$ W7 t5 f. Z

) g: y/ w' {. @# Q# }) K% F6 B__________________________________________________________________________& L8 @0 |( \* Y: \7 m) _: D

: `# U& E, R9 B: p0 |' cMethod 12
# s- ~  D1 ]* |=========
7 C  ]$ y- L0 F1 J/ P1 ?
3 u# B" ^( U. j2 j& Y) sThis trick is similar to int41h/4fh Debugger installation check (code 05
9 H* [3 r$ W9 K/ G* X+ @1 k# H&amp; 06) but very limited because it's only available for Win95/98 (not NT)/ y. w9 l  S5 |* P4 c" t) T- `7 O
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
+ H7 n' _% D9 d5 a$ b
+ U4 ?" ^. ^: n% e; `* u6 w& o   push  0000004fh         ; function 4fh
! ?4 [7 \6 E$ F2 i. s   push  002a002ah         ; high word specifies which VxD (VWIN32)
0 B- C4 o9 I/ f# _6 _# [                           ; low word specifies which service2 o) N$ y" h: ~( p9 F3 G
                             (VWIN32_Int41Dispatch), y& @# A( w. s: r8 I5 T7 D# u
   call  Kernel32!ORD_001  ; VxdCall
! ^5 G1 V0 p, M" \+ @, R   cmp   ax, 0f386h        ; magic number returned by system debuggers
+ d0 q# _. f9 w$ {, a1 S6 n  m   jz    SoftICE_detected  U6 h; E$ B, M) O
/ _& |, G/ o- [$ y8 y+ x) G
Here again, several ways to detect it:
9 b- B6 w0 W- Z; q, Y2 W6 U  q1 v+ Z! T  t0 d
    BPINT 41 if ax==4f/ u3 ?4 J. c6 f% Z, w" W1 Z

6 Z0 H+ W$ a, a: l* M5 h3 H    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one9 {0 B  z4 K( C. s/ C3 u

; T) p. i. ]0 Q0 y; }. }/ r+ v' N    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
4 C2 R( N& W/ h: F1 @& [3 _+ p
/ g' G. a3 A: u* S7 j3 R    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!6 a6 x8 m+ {) I- y
4 I9 d( n7 a: F! n
__________________________________________________________________________
( ?" Z+ J7 q3 J2 y5 V9 c8 F( I' B2 I6 i8 b% V3 [9 `1 t5 E1 o; @$ ~
Method 13. m. Z  I' W* i9 O! l
=========* W- M; q6 p" O! a0 t3 [- b
2 H( Z$ p/ K# V" R' i& s4 Y
Not a real method of detection, but a good way to know if SoftICE is
) J, _) @$ M  _7 I5 kinstalled on a computer and to locate its installation directory.
0 C8 C+ A) |; N& |: Z$ CIt is used by few softs which access the following registry keys (usually #2) :
& ]% t& r5 j* x4 P5 ~
9 O) D/ n4 ?1 s( K! X' v-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion8 N0 X; Y: }7 f, n! ~
\Uninstall\SoftICE9 x( N' ^5 D  M9 S0 {( T
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE  j8 b- |" _. F  [
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion) W- r, p7 Y2 r8 W" }
\App Paths\Loader32.Exe
# W* K/ }5 |. G2 b. ]& p
, _( x- T, \( G, v, [. ]* D
' t2 x, }' Y" J. h, p( v4 ^$ c* W  ZNote that some nasty apps could then erase all files from SoftICE directory. B0 |+ ]5 N$ O0 [: M* u
(I faced that once :-(! t, y" K/ m# h

) X5 F/ ]* h1 m- S* NUseful breakpoint to detect it:
$ I- [! q  F( a4 @+ w9 C. R
' e9 `* k$ A2 T# D2 p' {6 m     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'9 w) H2 w  j( z' _

" D" z/ z$ a$ |- j0 k__________________________________________________________________________. ^( _8 b# M  R7 l

0 ?  j0 Z& ?9 n9 E# _
4 r4 t- }3 V( Y% i0 v+ [Method 14
8 w& s& q& ^3 L=========
" A0 t4 E# u/ K2 m, W" g4 U6 g9 W' ^! E( d3 \, |! w- Z" N
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
- q- ^# N( F9 i( m; C$ Nis to determines whether a debugger is running on your system (ring0 only).9 v5 v4 d' _: e/ g/ n; `

: {: H9 r) E; }/ a- _6 T   VMMCall Test_Debug_Installed
* m6 z) i# h2 ]8 P6 d   je      not_installed
6 v. m) I4 k, P  Y  T! s' I  J
5 k0 G6 q$ w% u1 b1 DThis service just checks a flag.: A, P' I, O  J0 W3 ]# d" N
</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2025-11-21 22:45

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

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