找回密码
 注册

QQ登录

只需一步,快速开始

About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
/ |( s/ m! J0 L3 P2 s1 f, `( D# P) a" ~<TBODY>4 N( {7 s# l, |& H+ ]2 m6 N) g
<TR>" \: u/ R  z# G5 E
<TD><PRE>Method 01
( Z* z8 Y3 a* s# L3 J/ E5 |! R+ `: Y=========
% a( O% b$ a5 k
- D. N* c3 |& d# ~* u, zThis method of detection of SoftICE (as well as the following one) is
$ n7 z! E) h! v3 r" X( aused by the majority of packers/encryptors found on Internet.1 _7 a3 n1 s9 S) P4 c8 h" t
It seeks the signature of BoundsChecker in SoftICE
- k4 V$ M8 r0 P; U: ^$ j4 ]2 A  Y; z* b. R' U) E, O. ]$ @
    mov     ebp, 04243484Bh        ; 'BCHK'
8 q* Z; d0 k. g    mov     ax, 04h
# M" m! J% T; j# g    int     3       , A9 d  c+ T4 s& C7 j7 k
    cmp     al,46 k. n. T5 Y7 {. C+ O
    jnz     SoftICE_Detected( p' y  m& `0 i2 F+ Y# L
, `2 [$ j, F$ n5 I  a
___________________________________________________________________________
: \6 D+ [# Y- D# Y' V
4 P( G) H% L  C5 Y7 G+ ?" o  S; qMethod 02
. _; x6 z: q8 [5 i; v( |% g=========& S" q9 h6 A9 V( J

" Y- m( \  u1 @+ t0 m3 }- r, ~Still a method very much used (perhaps the most frequent one).  It is used* S% Y$ ~/ C% M, f) N+ f% F% s( x$ L
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
+ b  v+ n! n$ S' L- Q' ]or execute SoftICE commands...
" Z+ a4 w! p* l# Q# m! |: v; DIt is also used to crash SoftICE and to force it to execute any commands
% _+ ~- i7 l4 @( s% p1 h0 ](HBOOT...) :-((  
1 n% ]3 H- r* U" G* S
; l+ @' h* l! ~; L' n* iHere is a quick description:8 @% X3 M6 O+ v
-AX = 0910h   (Display string in SIce windows)5 t$ p/ M& u2 i6 b$ ?$ }
-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)
+ l. c5 P7 I; V$ p( c; g-AX = 0912h   (Get breakpoint infos)
# r7 [, y+ `3 H+ V-AX = 0913h   (Set Sice breakpoints)
) J# C) s  `9 F6 o: J: {" Y-AX = 0914h   (Remove SIce breakoints)* c* [' S$ d, a: U( g

* l8 ]  ]9 D. B  a4 L( B- p& k& @Each time you'll meet this trick, you'll see:
$ E: |1 I$ x3 Z9 i: Z-SI = 4647h) x- N) K( r  G% F: C
-DI = 4A4Dh
, ]) N$ M3 D* [9 p) lWhich are the 'magic values' used by SoftIce.
5 _' W9 a% X3 y0 d9 ]) i8 U, u4 cFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
1 D$ ~6 I3 b  m& \( Q  |
5 Z+ s& O4 s; A( O' Z& X: o2 i5 NHere is one example from the file "Haspinst.exe" which is the dongle HASP
5 e6 [% w" A  M6 M$ k" m$ zEnvelope utility use to protect DOS applications:# W! `* K% m6 u& _9 ?4 m" d2 {( ^, F2 L% I
" ]% |7 F3 \; C: p
1 B/ ~! h6 o: s- J: o
4C19:0095   MOV    AX,0911  ; execute command.
* ^* g) a8 J  A; V0 O$ k/ e1 E8 y4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).- a6 j, K4 L# ^% s* N' K, H
4C19:009A   MOV    SI,4647  ; 1st magic value.
( R7 B$ H8 }" ^' l# i4C19:009D   MOV    DI,4A4D  ; 2nd magic value.+ J' ?9 S- b) |
4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)0 Z9 w; R+ U; ]8 w8 ^8 r, {$ j' F
4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute
, h' B% A1 V$ \# ^" p- ~) ]4C19:00A4   INC    CX5 l" N6 u/ v9 v. S) h
4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute& v7 T( p- y5 u5 p. T
4C19:00A8   JB     0095     ; 6 different commands.: b- W. o# J# K$ S' u7 ]6 i# a
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.: X0 j( J, ^  Y; i% D" H
4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)) t' u- Q6 L  X/ d+ x: m8 A/ K
$ t. x: n9 Q$ O# W6 G0 i
The program will execute 6 different SIce commands located at ds:dx, which
$ K2 F9 I6 [) h4 @4 iare: LDT, IDT, GDT, TSS, RS, and ...HBOOT., q) T# O$ j' v2 J
3 K! d6 K/ g) j0 p: p  c5 x  S8 a6 A  q4 y
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded./ W8 a7 N8 N) W
___________________________________________________________________________/ j$ j1 x+ j) e7 c$ {' {

' B# }. |- Y' X- T5 a0 Z/ S+ z, |8 q0 W
Method 03
" t9 ]2 U' n5 O6 M' s=========9 c5 D2 B% q0 E4 |

9 N- Z  n. s9 {- t$ h; qLess used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
; K+ e" k7 o7 O5 i4 M. j; t3 D& }(API Get entry point)$ L+ g$ T% E( o- S
        
6 ]- J  `% `% h! p% Z) b8 f2 R- J3 F. z1 S" A# U8 P6 B
    xor     di,di5 B: @" M& E, y. R7 f+ q  H% a
    mov     es,di
1 v& |; \8 y! ?# ~& S" ~* p8 Q    mov     ax, 1684h      
& Z6 k& n3 [& s) ~    mov     bx, 0202h       ; VxD ID of winice
/ C3 p) G) u3 I# w' B2 q    int     2Fh$ B  p$ ?! |8 [0 V. [3 z' c+ g
    mov     ax, es          ; ES:DI -&gt; VxD API entry point
" X8 V- g& @; N- H4 I8 F    add     ax, di, a9 }3 S* t. b# m' Z: U; i' J
    test    ax,ax' Q( ~9 q# s8 L, m* A" r4 D
    jnz     SoftICE_Detected9 G) u  o, Q( P
: c- E' }3 b. r  t- ]
___________________________________________________________________________
. k& M6 K# k" G+ {7 H$ i8 }9 \; h
6 \$ k$ g0 H& b. yMethod 040 q3 l. \5 J, I. R8 V/ Z' s+ a  ^( Z
=========$ }' n- Y, C5 ^' N+ g! L7 Q

. M# L8 v# F6 c  L/ r; X1 \Method identical to the preceding one except that it seeks the ID of SoftICE$ N8 l5 f) O9 n6 b6 N& \0 S% O
GFX VxD.
; f' z  p0 m5 w( T* U! S4 G4 Z' X9 n1 k! @) |, I
    xor     di,di
1 Y1 u' q% {$ E  f( [) ~    mov     es,di4 A! ]; k, [  l
    mov     ax, 1684h       / b" `; P% ~1 U! `1 b
    mov     bx, 7a5Fh       ; VxD ID of SIWVID+ f0 X+ C' q: f2 r
    int     2fh3 a8 ]" s( j) x( m% s% K! P: g8 I
    mov     ax, es          ; ES:DI -&gt; VxD API entry point4 c: v5 ?) W& O, E3 d! {
    add     ax, di
. d1 ]/ C; h) s4 c* s    test    ax,ax
; j* s/ a$ U% v8 _+ ~    jnz     SoftICE_Detected
. G' c- M( @6 u5 E) `' `7 l, T/ F% z2 l# T: v* j" J
__________________________________________________________________________
8 J! Z. U7 @# e" `1 y
1 w' c+ K3 c0 h3 d4 i( z4 \- t! P
Method 056 _. [, z5 g2 i1 }1 Z& ^" @% k
=========
$ I+ w. e% t, g$ _  p3 J1 I2 a' v6 c/ c' R! @2 H, g+ I
Method seeking the 'magic number' 0F386h returned (in ax) by all system
; o% ~3 S1 a8 z6 `5 e5 Q8 q' u, z, ydebugger. It calls the int 41h, function 4Fh.6 F/ ^9 i2 s6 X- h
There are several alternatives.  
5 ^' }1 \8 Y- |/ s& B! d6 s/ B/ i% U8 o# c
The following one is the simplest:
/ F/ B8 L8 ^0 }! Z  d. A
3 W  n' ]8 y5 ?# {! i8 ?    mov     ax,4fh
6 f( y- ?- O% V9 [# o    int     41h4 ~" @: s& O8 L. s0 z" h6 b
    cmp     ax, 0F386
+ g5 E9 ?0 r: a: _- y) v    jz      SoftICE_detected
' P, X, O4 t& b/ l" t3 Q" @, V1 V" g% ]+ {2 k/ G1 \: F
' O! q( Y! D& D# K6 A
Next method as well as the following one are 2 examples from Stone's
! x/ N7 I$ I* K. m" ?"stn-wid.zip" (www.cracking.net):
, p% E  i' j8 b7 u' M4 i
' u5 o5 N% j4 T) u0 z    mov     bx, cs9 Z; d0 T* `0 x- O( n
    lea     dx, int41handler2
3 }  [/ v+ W) w: U    xchg    dx, es:[41h*4]
8 @9 n) ~: \$ A3 h0 V( h    xchg    bx, es:[41h*4+2]# S& ?- r6 v$ o' q
    mov     ax,4fh
) C" \# R( E' \' c" m# w( Y! D    int     41h+ Z$ D" `" H2 O+ Y! b- w
    xchg    dx, es:[41h*4]
) o7 d3 r) s" b* b7 M3 w    xchg    bx, es:[41h*4+2]* Y0 S+ t! ?+ n  N4 l
    cmp     ax, 0f386h
* z. G( Q  l( {( |/ t' U  t/ |    jz      SoftICE_detected/ R! T0 Y/ H( s

; f$ K7 T. n5 R# b$ M( @3 pint41handler2 PROC/ h% D+ e& A6 y; ^
    iret$ j. W, F! T5 ~* M, J3 U
int41handler2 ENDP
! G2 [, ~; s9 s9 q# n# I8 p; s+ ~% y% s4 a
7 V3 K3 o* q3 a
_________________________________________________________________________) E- B2 F5 S# u% F

% H4 \# l) S; n+ o8 x3 X! a1 m) N! a+ T! {3 S# j9 Y
Method 06
4 E  h" b4 }( B; P) \=========5 ]' F+ H' ~" ?

( I( d- v) o9 D0 R, ~! N9 x( P( W
2nd method similar to the preceding one but more difficult to detect:
5 x; v. ]3 A8 n' s  ^1 t; c7 H! Y0 B% S$ c5 R2 D

& F9 }( x' X9 D7 fint41handler PROC
9 V: y  X) F# _3 m. b2 [) |    mov     cl,al
+ ], S1 A# \$ {% m* h    iret$ S7 S& i4 V+ ]  K5 i- u" I
int41handler ENDP
4 j  l+ j/ B$ S( S7 |/ j
" Z% v* {+ J5 u- e5 h
: A1 B" _& x2 Q1 k    xor     ax,ax
  s9 ^$ f, Y9 ]* u+ @    mov     es,ax
+ E$ R4 e5 B' A# K    mov     bx, cs
! _, f2 y; k2 w6 q3 o8 g$ c    lea     dx, int41handler
, y6 J; h: P4 k. k2 m1 j, h% v    xchg    dx, es:[41h*4]$ }; R8 P. H% K+ G9 q
    xchg    bx, es:[41h*4+2], C- p9 j0 j- i' c" C2 M; a
    in      al, 40h
) K! r/ F# y; h% U! z; X    xor     cx,cx
4 _2 [- x; M1 ~' ?0 ^( G/ i    int     41h
+ Q9 x' s0 N0 L4 o4 h* F    xchg    dx, es:[41h*4]3 L( A* n% S) J  g* H7 K
    xchg    bx, es:[41h*4+2]' z1 b: r6 [7 ~7 P
    cmp     cl,al& g7 h: o5 b) d' t5 f3 G4 i+ W8 k: H
    jnz     SoftICE_detected
( [6 f) o3 j& ~  h% ~5 Q' r( v
: F! a4 y; ~% Q5 q' P_________________________________________________________________________
" n* l: q6 o9 I/ _0 E9 n+ ~& `* o' m) Z! h
Method 07: }& d' H" Q6 o
=========
! k6 T4 h* V1 L4 _9 }. Q) {* V+ V8 N
Method of detection of the WinICE handler in the int68h (V86)
7 T5 N( U) |; @
2 c5 N. f$ ~( N# j% n# ^3 S    mov     ah,43h
; r3 Q9 k( L2 E* N  Z0 |9 B$ S    int     68h1 X) g3 k8 u) ~
    cmp     ax,0F386h# E$ g# @) m# V8 x. [' ]" Z: f
    jz      SoftICE_Detected
5 Y5 [' i) t/ N
- Y% R3 s& i3 m+ l: l
! c$ P3 v' D! p% V+ k3 ~* ]=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit( C$ Q; F" S$ X2 u) g* [8 S
   app like this:
2 v, R* W+ v# K$ s; ]3 J) @7 l" s7 ?
   BPX exec_int if ax==68" g4 g. H6 a2 [& @- ^& x$ G' C
   (function called is located at byte ptr [ebp+1Dh] and client eip is
8 e. u3 U4 i  w, ^: `9 ^   located at [ebp+48h] for 32Bit apps)" ?$ Z3 H9 g. [- B
__________________________________________________________________________
- p: R6 @8 n  c6 ^0 c
, \) O$ G' a* i+ Y- J
9 ~0 ^0 D; l( nMethod 08
6 N5 F+ g) u6 i* h( W* H=========, ]' I6 u" `/ r) m) j4 @& f; I
; a7 y& T& H) e4 m5 Q4 |: r
It is not a method of detection of SoftICE but a possibility to crash the
# P+ z# H  Y1 isystem by intercepting int 01h and int 03h and redirecting them to another
' H8 \& g% B$ U  g+ f$ aroutine.7 T9 y# A( t( Y& g, i9 C0 H( O
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points- w  ]& h7 S& K
to the new routine to execute (hangs computer...)
$ n7 M8 O% Y$ z1 B! s, K: Q; J" H
    mov     ah, 25h* [5 E) y$ L: E7 ^( n9 j' J& v7 t3 O
    mov     al, Int_Number (01h or 03h)7 ]7 B9 L3 W% D3 i# Q4 ?6 l; R5 s
    mov     dx, offset New_Int_Routine
) K) w2 L+ H  @$ P7 T) y$ E  X$ g    int     21h
% D+ ]% o" j. L7 M& @& ~# |4 m. ?6 t; f6 T  [# y3 C9 X
__________________________________________________________________________
. Z& S3 h+ M8 C
1 `2 ^' U8 t2 r! q' LMethod 09/ C0 b1 F; d8 I
=========' L" z9 n7 V3 s
( B: v2 e0 Y6 B( B/ ]6 e! c
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only- X6 ~: d. f" ^( f
performed in ring0 (VxD or a ring3 app using the VxdCall).( F& Q: c7 e! V
The Get_DDB service is used to determine whether or not a VxD is installed
# X4 r0 R6 }) Z5 {! q* @7 Ufor the specified device and returns a Device Description Block (in ecx) for
! I/ W: s, @: v6 [that device if it is installed.( ~' c  P+ l) X# i1 o5 O

8 F7 B3 ^/ \9 R7 a, e+ y, t5 m, \. |5 [   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID+ L0 {% K/ q2 f( m' g: D! W
   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
% B/ q& S! r' X& A   VMMCall Get_DDB
; @4 J" M0 ~; P* X  g3 Q5 l9 h4 @   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed
$ S9 C+ W$ R" E! R- B5 G3 j7 M: Y$ a) A; L9 Y( r
Note as well that you can easily detect this method with SoftICE:+ \/ g4 l6 |$ B- g4 ]! j
   bpx Get_DDB if ax==0202 || ax==7a5fh) k- a4 V& W1 m' ?7 W0 w" D

: P7 C! \5 o- V+ @: b( B, E__________________________________________________________________________, Y- C; T' k6 [1 U
6 m, k: y9 E4 W! n
Method 10
3 G( N5 ?, e2 `# r/ s=========/ m8 L% Y1 @6 ^5 P# \
: B1 L$ y* R7 h% k( V
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with0 D/ K, q0 _, j
  SoftICE while the option is enable!!+ t: T4 S. p# T9 ^
2 O: N: D$ U/ \# L! Z1 W
This trick is very efficient:
% x2 Q: c9 Q5 a5 i$ I0 ~# O" v. }by checking the Debug Registers, you can detect if SoftICE is loaded
/ V( _( ^$ w+ C$ l8 X" A7 E(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
+ m. `  B' l9 c7 ]7 B- b/ x& Q5 Kthere are some memory breakpoints set (dr0 to dr3) simply by reading their
! z; n' U/ `' P: \value (in ring0 only). Values can be manipulated and or changed as well8 Q% h( z# y; y, q3 D, [
(clearing BPMs for instance), p5 N. O4 m+ s# M4 [+ o

* }7 X: B& R6 D0 x/ Y$ h__________________________________________________________________________
" Y9 q. G; r1 L8 `
. }: N8 V/ u! o- qMethod 114 s. E) ]7 t; ^0 C9 R2 P
=========
4 B0 X6 t! g3 U8 }6 D+ Y* d
2 I$ a5 O" [" Z3 ^This method is most known as 'MeltICE' because it has been freely distributed7 Q" g2 L% O) @8 @( u
via www.winfiles.com. However it was first used by NuMega people to allow
6 `8 N! x1 f5 F; ]5 K" xSymbol Loader to check if SoftICE was active or not (the code is located* m) F+ Y& f% x
inside nmtrans.dll).
3 Z$ S/ J8 X( _/ b+ M/ b! y' H3 s6 x1 L3 m& J9 H+ X: U" M% D' G
The way it works is very simple:  G# w: N+ l- i( T6 t( r1 V5 C
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for" f" o! [9 d% X1 R1 Q/ \4 c6 I
WinNT) with the CreateFileA API.9 Z1 w5 l+ L; d8 \5 m5 ?4 X

1 \. p6 _: T8 U- O, S1 AHere is a sample (checking for 'SICE'):0 v! B8 Y) h  J/ K' y

0 v- |$ w  v3 eBOOL IsSoftIce95Loaded()/ W7 p6 }3 @6 p* l- b! Z7 Q
{8 j4 t/ K  l, {9 U* P* X
   HANDLE hFile;    S3 S0 h0 g: R) h
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,! p# l) M0 W# m' d
                      FILE_SHARE_READ | FILE_SHARE_WRITE,( Y- J2 w# A0 t
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
. s. ^; O; F  M) v7 Y8 r' d& O9 j3 a   if( hFile != INVALID_HANDLE_VALUE )
7 N& k) l+ n. s, }   {6 w: a3 l8 e' y' Q- h/ `0 g/ _/ Z
      CloseHandle(hFile);
6 E) V5 U5 m4 }$ J2 f: A' x, C! M      return TRUE;0 m# U* Y: u8 }+ E5 E+ S
   }- \/ v/ W. _4 Z' l9 p  d+ x' Q
   return FALSE;, x  o( Y" B% Y3 y; r4 m5 k
}
8 M7 U4 B( I1 F+ I/ v
/ m9 G# ?* T6 ?9 W% wAlthough this trick calls the CreateFileA function, don't even expect to be' k# Y: F  N( f9 \) B  M4 T; M
able to intercept it by installing a IFS hook: it will not work, no way!
6 c9 w7 Z$ h$ e* u, E8 i2 ?In fact, after the call to CreateFileA it will get through VWIN32 0x001F; R9 M5 b& Z( l! P. V
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)6 ?' ]# h' E7 v  L$ p- `
and then browse the DDB list until it find the VxD and its DDB_Control_Proc8 E$ d. M, {' Z/ Y* }! L# z
field.
8 ~( F( ^' w0 T- }# O: }8 rIn fact, its purpose is not to load/unload VxDs but only to send a
! x, E5 M" t7 PW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)6 u0 W( m6 o- p  x3 V2 X+ k7 V- j
to the VxD Control_Dispatch proc (how the hell a shareware soft could try. _! {, v: |. l( }* P+ K4 p5 w
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
& z0 B$ R$ V( L8 d% x+ tIf the VxD is loaded, it will always clear eax and the Carry flag to allow
: @3 B) B+ h) s# M( ]9 Eits handle to be opened and then, will be detected.
2 D& i$ n$ R# e: F2 l" g( [7 EYou can check that simply by hooking Winice.exe control proc entry point8 [0 J- H: p$ i* A: s
while running MeltICE.
2 t0 l4 H# k! @  b+ B- |, y5 `
: D4 _5 L- f' \+ p2 M3 _0 I* w- r0 \* d- t
  00401067:  push      00402025    ; \\.\SICE
4 Y$ U! D/ p* n" Q  0040106C:  call      CreateFileA$ n; b. t4 I; _$ I0 |
  00401071:  cmp       eax,-001
6 j* ?2 T+ n/ s  00401074:  je        004010912 t$ Z& G" [( v: o6 w0 h( e: s! K
$ y( ^" W( G) @$ u

! U, B9 i" {+ t0 U+ `3 sThere could be hundreds of BPX you could use to detect this trick." c, s8 w& `& f6 k* {. i
-The most classical one is:0 e: h" R% t% J# \1 W& W8 C
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||/ J& Q) U: o6 x" h. v
    *(esp-&gt;4+4)=='NTIC'- }. `2 Q# z' q" m$ e. z0 k6 h

' N; u3 Q2 z4 m4 X5 t& o9 b6 C-The most exotic ones (could be very slooooow :-(
2 X2 @. N7 A; D4 x1 ^* y   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  
5 o" G/ b( y1 B6 T+ @7 |; \, Y     ;will break 3 times :-(
6 H0 m; a7 |/ i, G6 [7 S
& |0 F, U' L4 k  C/ }-or (a bit) faster:
0 D7 z$ `9 D3 g' K0 T   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')" M4 I8 N9 r  L/ j$ ^8 x$ [$ Y8 |

; F  c: v7 f+ j* i5 r" J  H" f   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  , |; [& @: |( C, m. o
     ;will break 3 times :-(
' z+ h+ k/ b0 Z5 B1 D8 n
1 [) d3 h# U' @* `-Much faster:' n4 K" B# A9 @3 W
   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'
# b5 I" _! Q" }  \, W; O, \
4 K& P1 q' G, {8 G! r5 `Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
# S. k* z7 S* z) r/ \+ Hfunction to do the same job:8 X0 |4 o4 d/ o

* R  y7 S3 l. Q   push    00                        ; OF_READ
* G3 B8 }! J  S% _# s   mov     eax,[00656634]            ; '\\.\SICE',02 z& o- f3 L/ E! {6 D& {0 T
   push    eax
5 t2 B( D& B/ W4 I+ @   call    KERNEL32!_lopen* w  w2 z/ Q5 W0 ~! Q2 y1 {8 m
   inc     eax  M, k  r2 H! \2 u% V+ H
   jnz     00650589                  ; detected
$ P8 |9 `' L; o3 U9 C9 _/ h. P% \( v   push    00                        ; OF_READ: K, a* c' C% s- \! W- U) F0 v
   mov     eax,[00656638]            ; '\\.\SICE'. Y* d% \3 H+ J4 U
   push    eax7 z- q$ E/ s: I/ e- D
   call    KERNEL32!_lopen* w, N7 B( ^$ B8 o- b
   inc     eax. ]- O& F( ?- Q3 {' t
   jz      006505ae                  ; not detected
2 Y6 w- J+ N3 a2 f/ k( ?1 t  k1 c/ l
" N  w9 h( k* P# R- s1 T; }: w
__________________________________________________________________________; f$ r6 q$ G% ~6 O% F5 |; V( V

! {( ?5 T  e; H! \0 kMethod 12
# k* O$ a* w  R=========/ l/ k4 o( i* D
8 E, ?3 p  p8 z8 d" u: }# W
This trick is similar to int41h/4fh Debugger installation check (code 05
! M$ ?7 [* V" [' m$ T&amp; 06) but very limited because it's only available for Win95/98 (not NT)8 b+ Y! X% b- T$ x6 Y  k3 V
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.3 H7 m( b" K  k; ^0 Z  [; q. A, g; Z  K

$ }1 t1 p% W4 X2 F) A5 T5 q   push  0000004fh         ; function 4fh
3 x8 q* H+ t2 p   push  002a002ah         ; high word specifies which VxD (VWIN32)* s) B4 F$ D% q1 v! Q+ \- X  ^
                           ; low word specifies which service# T2 a+ J- M; S
                             (VWIN32_Int41Dispatch)
. H) K, u5 d1 x# S+ C- h   call  Kernel32!ORD_001  ; VxdCall
, o! M4 X; C. v5 y5 c! L   cmp   ax, 0f386h        ; magic number returned by system debuggers  L# F  i9 i. C3 W1 K7 U0 s
   jz    SoftICE_detected/ S: O. i* k) P$ m+ f
) x* E- W0 q  T# g% o
Here again, several ways to detect it:8 F& d9 k. H) N+ x. I( k# v
, `% ?) g  L' I" V4 N
    BPINT 41 if ax==4f$ L8 t) p. {  L- A  t* h+ x
, j9 u+ t- E, f  e
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one
% k% f6 P1 N6 l3 l+ g. i& b5 v7 A$ H" f5 P  g" ^8 y0 e
    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A$ l* Y! y6 ~. q/ H0 T3 m$ }  B
. r  S  o, R/ T+ U5 ]
    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!
8 x- q/ B# Z$ I
; C( t( h, w/ ~$ r' |- Y__________________________________________________________________________
4 u$ V- H2 S3 U8 O. Q+ u- G+ G5 e
Method 135 j& J9 ?! j0 I, X2 B3 b6 U5 l
=========" n/ s  J  V% S9 o9 A" M
, g) s. O* D, a" Z
Not a real method of detection, but a good way to know if SoftICE is
% }  S) X- n1 C1 k& s- jinstalled on a computer and to locate its installation directory.$ Y* {: g+ q- Z. D5 N
It is used by few softs which access the following registry keys (usually #2) :
' L, J8 I8 T5 a1 X* V( z
# B) f- b4 g' A  P5 v% X9 B-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion6 ^6 p5 q! `, Z* l! \$ ?( K6 \
\Uninstall\SoftICE, M, Z! Z& o- {, |
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
4 O  _4 D! c# e  D# h) j* j-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion" J) E# C7 N8 F5 t
\App Paths\Loader32.Exe
5 O1 C# a( E! Z& A# c1 ~
: `! f" b6 R5 d: n1 ], U/ Z; g: \2 I
% Y0 @6 B6 V+ @, JNote that some nasty apps could then erase all files from SoftICE directory4 N5 I0 ?% m/ p$ `5 Q
(I faced that once :-(
. n5 H5 X7 f8 x7 C5 X! Y6 h7 r. A+ z4 K
Useful breakpoint to detect it:
1 z% X" d% u# T9 e
$ T1 X5 r! {9 }7 r+ g     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
1 {( i9 y) s) s* j6 _& V+ G2 V/ r1 t, y  N! o* v) Z
__________________________________________________________________________
7 ^) ]' ^9 |! k( B( `+ |3 |( M% t  C/ {$ J+ \4 Y
2 o8 G5 Y3 T2 L& i# T
Method 14 / Q8 K7 D8 d5 k8 T5 ?' I1 _
=========
9 U- C0 r4 x1 U( I& m* L% T) i: `5 S/ ?1 i5 ^
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
. k( G& H8 j, \/ x! U: vis to determines whether a debugger is running on your system (ring0 only).
2 n# ~( v/ k& c9 l3 \, _" u+ T* W5 E) {7 D2 |7 B- c
   VMMCall Test_Debug_Installed
  A6 E& Y5 Y( S; I+ @   je      not_installed4 w) `4 p5 P$ s& J5 O9 _+ X

; H" Q* p' o- W5 F& |- ]# `This service just checks a flag.
8 @9 a) V# k) R+ A' Z$ G4 ?/ t</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-4-12 21:38

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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