About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
) A6 ^  P: S! y# N# O+ K; O<TBODY>
) s1 n0 @; i/ W+ x* u<TR>
/ s5 y3 O0 d! ?. k& [( d% q+ w<TD><PRE>Method 01 ( f: Q, Y# G3 _' V2 ?# C! }( h. W
=========
, r: m' R4 P. k, k3 P' M& \& v0 d, o# q9 K3 W6 a" R# N
This method of detection of SoftICE (as well as the following one) is
/ X* b$ @) [6 `5 rused by the majority of packers/encryptors found on Internet.5 l+ h. A* z6 X6 q" i( w! c
It seeks the signature of BoundsChecker in SoftICE
$ z/ U  m3 l1 N1 |' @8 ?' P
2 l" ?1 _6 |! ]" b/ X7 {' `    mov     ebp, 04243484Bh        ; 'BCHK'( E0 U8 H9 f- p2 J
    mov     ax, 04h
$ ^3 L( Z* D2 o$ y- `' s# w    int     3      
0 b2 i5 Q* `3 s$ `: Z: T9 B, t7 j' K    cmp     al,4
3 v) l" ~4 C" T- q- @& U    jnz     SoftICE_Detected
- n7 D/ S8 t! J, Z- G6 O) I% x5 d
+ [6 a$ m( C, R___________________________________________________________________________
, Z: l. L* S& q% z3 p0 Z
1 ]8 |- |; M: f$ GMethod 02
7 C; W$ T: e4 l  X# u2 V7 l% V' |=========
: X' \6 J' K+ o+ l1 Q/ @7 G! ^6 T) ~0 f: |# W7 M$ {' K
Still a method very much used (perhaps the most frequent one).  It is used
' g, Z1 D  ~! w6 B# vto get SoftICE 'Back Door commands' which gives infos on Breakpoints,6 U# M5 ]2 i6 k
or execute SoftICE commands...0 d# h' ~2 s6 W6 v, G
It is also used to crash SoftICE and to force it to execute any commands1 }" F. O% K( f' y# T7 R" Z; U
(HBOOT...) :-((  
4 {( o" T$ v/ [. `$ Q
* o) e! {+ ]) `Here is a quick description:0 Y( W9 O) ^" F  u8 U. A. T
-AX = 0910h   (Display string in SIce windows)
7 c; ?! p! [6 i0 P1 W-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)
4 M8 D4 U  L6 _! d& H% g; q6 o: I-AX = 0912h   (Get breakpoint infos)2 P6 `. A7 s2 ]+ @8 ]
-AX = 0913h   (Set Sice breakpoints)
. }# `: T3 [  V$ Q4 h/ L-AX = 0914h   (Remove SIce breakoints)
8 U$ H" s  B5 U7 ~4 N6 x) o. d3 j
  x+ [0 g. t) |. C2 \Each time you'll meet this trick, you'll see:
% }, w# Y& S1 O- N% n- f4 H; G6 B-SI = 4647h! k* E- l7 p% `
-DI = 4A4Dh/ Y1 y! v  f& {0 [( z! b2 D8 ^
Which are the 'magic values' used by SoftIce.! P/ n, G7 m! E6 ]" v+ X
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.3 ]/ V/ r: S& b& s8 n
  n7 p+ A" g: v2 T0 X0 ?
Here is one example from the file "Haspinst.exe" which is the dongle HASP* _( ]' D  Y2 L: U8 f' N
Envelope utility use to protect DOS applications:3 _6 v5 V3 _2 F

# H3 N) Z; Y9 r* T1 [  B( m4 a! m! x0 }6 |2 X
4C19:0095   MOV    AX,0911  ; execute command.  Z! ~% f& Z( K( S% C
4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).! T: d4 }9 r" X/ l
4C19:009A   MOV    SI,4647  ; 1st magic value." f% S! @2 _- y5 I! W5 W
4C19:009D   MOV    DI,4A4D  ; 2nd magic value.8 _: d( }: r1 n+ h# u0 y4 @4 p
4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
* f3 V, ^$ e) U1 C1 W4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute8 g  n5 q9 f9 T0 f) j* A" t
4C19:00A4   INC    CX
/ v& r9 p; f+ }8 M# Q/ Y4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute
9 C- e0 f3 v4 }" v+ m4C19:00A8   JB     0095     ; 6 different commands.
" C! I" i+ C- y. u4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
+ k7 y" G/ M4 ~+ j" N4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)
3 \2 g7 t; O/ y7 O$ P1 K3 k( S% p# Q, r) ^4 {
The program will execute 6 different SIce commands located at ds:dx, which. E# x8 k! s1 d+ d
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
& Z' ?; p+ D: ]6 N
$ W2 \! n' D; R* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.& p9 _% _) _" E. D
___________________________________________________________________________: o; W/ ]1 z) y" V1 D
* p* N7 S7 j/ ]; ^6 Z& q
" N8 v8 J) x/ r7 ^, v) A; B
Method 03
3 F  u( ~( q+ {5 M& I8 b. I=========' `: @( O& b' W- F2 w) r1 Y
! ~) t; I- v* l/ l: v% C: O0 X
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h, I  E2 X% |- D! ]
(API Get entry point)
- Y- u% _& j: d- A, i6 k        % v& H; [! [5 W2 B9 |; k2 [" k

1 h4 O& v) H( y4 y$ H4 }9 b    xor     di,di' [; \5 f2 w/ b0 z9 W
    mov     es,di
# \; k, ]' i  v6 v# \/ D- y    mov     ax, 1684h       $ ^( c! b9 l6 n+ k& D8 g: p
    mov     bx, 0202h       ; VxD ID of winice
1 q: A! r9 K( X: V    int     2Fh
8 }, x' X7 ?: l8 A+ ~    mov     ax, es          ; ES:DI -&gt; VxD API entry point
' L8 H8 \. u2 p; C0 e. Q    add     ax, di7 J7 \  D% P' l/ G9 m
    test    ax,ax2 @1 r, a5 S$ G! g, T' L6 @# @' |$ y
    jnz     SoftICE_Detected( O2 [8 ^$ L) z2 ~5 ~" y9 u1 A

6 l5 R! j' ]7 b% `___________________________________________________________________________
8 C; P7 G8 J# O! r* h9 b/ W- ^$ p; P7 R' R# w+ t1 ?9 F* D! |9 E: ~, g
Method 04: g! \. _; b( B1 Y
=========
6 `! A2 B: K7 f. ]% _2 h" h9 Q  ]% s5 T  e* Y7 a+ y+ S
Method identical to the preceding one except that it seeks the ID of SoftICE
+ n9 E8 D  p; [# w$ KGFX VxD.
. T$ S( T" K1 i) @
) i' w* h' W  y( A+ h) _3 }    xor     di,di! \1 O9 Y9 U$ \9 W/ w# V! I6 y
    mov     es,di
2 _! S( f! F: b2 q; \4 T, i    mov     ax, 1684h       ) A7 Y; k6 @$ ~9 V
    mov     bx, 7a5Fh       ; VxD ID of SIWVID
" w! ?8 f# o2 g" Z9 ^8 B0 t    int     2fh/ \' i( L! r7 m  Q5 y3 U- `4 I  C
    mov     ax, es          ; ES:DI -&gt; VxD API entry point
* S! _" {7 Y* c0 M& O3 a    add     ax, di) E; |: G4 P  Z+ B* b) C5 r
    test    ax,ax
4 O  L) `  U' n    jnz     SoftICE_Detected
6 b' @! ~6 h$ H7 Y0 M6 m! A# Z" @7 K
( h7 b  Y; C2 Q8 T$ k6 {__________________________________________________________________________
1 i! i  ]6 Q8 T+ R& W2 E/ J, U! L; I, J) ?2 B. k+ D
8 x% o9 {( F5 O% y* K
Method 05. C1 T' H" ]% `; h& o) P% M
=========$ }1 v! `+ O- ]6 i) d

3 ]0 T; y* m9 j: w$ |1 tMethod seeking the 'magic number' 0F386h returned (in ax) by all system
* s" C9 X. i+ p5 B$ h1 V8 Ndebugger. It calls the int 41h, function 4Fh.
4 {0 d4 k( X* k' R8 B" v; ^/ I( j, \There are several alternatives.  
. \' M# I1 Y8 h3 _$ m: _
3 x( A, J; L! l4 t& lThe following one is the simplest:
: p" J- o# V+ x3 A/ M$ R: N& n5 O+ V, x* Q/ E8 A
    mov     ax,4fh
; Q3 s1 V5 X% B7 u8 @4 B/ V    int     41h. O$ |  |: B, u' f( n# h; f
    cmp     ax, 0F386
  ]6 V' b( K, _: \6 \# L! \    jz      SoftICE_detected
) `& `0 n& L+ l: j3 K( l, c. B9 K" _' t3 N& m8 N- }) k1 _% t
% {) g- }6 ?2 T, w' J$ T
Next method as well as the following one are 2 examples from Stone's / x# h( }5 |4 ?0 o+ ^% ]/ a
"stn-wid.zip" (www.cracking.net):
& @( m8 [. }+ @
! Q8 P/ z7 L- j0 a  r/ U4 q    mov     bx, cs3 o9 v0 e& W) J
    lea     dx, int41handler2$ v+ U0 X/ A$ m- w  P
    xchg    dx, es:[41h*4]4 _4 q7 H; G9 J9 m+ @
    xchg    bx, es:[41h*4+2]/ a9 C+ x6 T! K9 _4 D( ?: }# X
    mov     ax,4fh
" X, Q; U8 }" r- E2 m% ?) E    int     41h
/ `% d9 k0 V1 m. O1 }    xchg    dx, es:[41h*4]+ D* p1 N6 P0 }4 C1 w8 b
    xchg    bx, es:[41h*4+2]
9 k, E) e3 a$ ]    cmp     ax, 0f386h
" H: d5 z4 z  p! n' I    jz      SoftICE_detected
% t' u3 v% w0 l0 ~: ?
3 q- J9 r3 ?, G! `* @) uint41handler2 PROC1 F+ q/ \. q9 j: F
    iret
( u" ~5 }$ d0 v) p0 {int41handler2 ENDP
' j, y0 `5 C' _. a8 U" g7 D+ {) x6 k: S  j  ^" T$ D- r

- \6 p* \. r# O1 d: D$ T_________________________________________________________________________; ~0 s' k/ ~' v& j# c  f' O8 E
$ i0 p3 Y* c# R: S; w. r3 v' w5 {+ z
! q2 c2 h! e$ F& h6 |; M
Method 066 [5 v5 n5 \0 a0 H/ u7 U
=========
' B, I1 t' ~. A+ m0 O" p( o% e) n8 u9 v5 u" O+ K

4 J8 f, S! k/ e/ s2nd method similar to the preceding one but more difficult to detect:
8 Z- w- X7 `2 l; g$ h
! m3 {9 N+ V; a) f, R% d: U
1 f" t# W( G! ~2 rint41handler PROC
5 Z; N1 |$ [5 S. g8 A5 O, x    mov     cl,al# q& x/ @, e0 L: p
    iret: D5 j% y8 z5 Q. R, W
int41handler ENDP
( E" ]3 g# k6 W; Q$ r  Z3 ?, Z1 u" ?
" G( s( H9 T' x( ?8 I& ]6 ]# T  ^* A7 N* ]1 N( o" m. U
    xor     ax,ax
. z% j7 q  _3 p8 u% {    mov     es,ax' v2 S4 a* ~* O( q1 ]
    mov     bx, cs
3 L! z! F- c) K; X/ ?    lea     dx, int41handler
- I3 B& O$ `8 `    xchg    dx, es:[41h*4]
1 {) T  S% |9 F) j    xchg    bx, es:[41h*4+2]
( }* l4 Z* G; z* p3 R2 n7 e    in      al, 40h
8 {4 ]' b) |; a2 W/ x6 g    xor     cx,cx" @9 i) h+ E- R# J
    int     41h
5 A  ~2 n! g; z    xchg    dx, es:[41h*4]! L$ K# l: |/ K- P, y1 s+ R% [
    xchg    bx, es:[41h*4+2]8 M! J* w& ~8 B0 Q  F
    cmp     cl,al
( V5 j) V% h6 I5 U    jnz     SoftICE_detected0 e7 D* W  K& z, N3 l

6 @! D, f. e1 y6 @7 ~2 l_________________________________________________________________________; R5 |0 j. M9 L8 z

8 F2 v$ |2 m6 nMethod 07
2 B# g+ q  ~( a/ ~& B=========
3 w  t- S# O. U/ w" _; p/ Y/ A' c
& t- m. Z8 s: o* y  [Method of detection of the WinICE handler in the int68h (V86)
2 d! S  D1 ~2 P/ p
* p5 l# Z8 S5 L2 h    mov     ah,43h4 ?- N: c% u0 U8 f+ Y
    int     68h- E0 |. k0 H3 e1 v, u: i
    cmp     ax,0F386h5 h4 H/ f! ^; U* M
    jz      SoftICE_Detected
4 f1 C  J8 |- n6 E% ~  D, J
6 t3 O/ l5 _3 j; @/ Y, L% A6 U9 e+ a% s
=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
8 ?; D' r! j! H; r   app like this:4 k4 {# b/ F5 \/ ^$ b

# y+ E: ]+ r/ o4 g, ]) a* s   BPX exec_int if ax==68, R% H# t+ p' `
   (function called is located at byte ptr [ebp+1Dh] and client eip is% |  N" N1 J# q( h/ i/ v8 @! W
   located at [ebp+48h] for 32Bit apps)& R; [/ |& h. T" u4 u+ L
__________________________________________________________________________( }9 S$ w8 ^+ {1 H* a* w

6 }9 p. s+ I! L
: k' ?" j# c; U+ pMethod 088 T+ R6 x. m: S6 R' {% J% I
=========
' _2 [* D9 [) I- ?! T* c) ?2 e3 V0 e( O0 c/ e8 R( p0 I
It is not a method of detection of SoftICE but a possibility to crash the
$ ~3 p; o0 Y' \+ L3 w+ Msystem by intercepting int 01h and int 03h and redirecting them to another
( u( @& Z% g6 D" [4 y. [; Nroutine.
1 F9 V4 \) `& y/ Z' D6 O# K) rIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
3 L$ V9 R# Z7 D% h! }! p2 rto the new routine to execute (hangs computer...)
3 {( R. c- Y2 D1 s$ h3 x
3 {6 b# F" |, V+ r# J+ X. D    mov     ah, 25h  |) M; Y- t7 |3 X, ^2 o& A
    mov     al, Int_Number (01h or 03h)$ ?6 g. ]; w% J9 D  N3 A
    mov     dx, offset New_Int_Routine0 z% g( z" V" m8 ?) O0 [% U8 Z5 B
    int     21h% E  ?/ y8 W" H, @/ [$ Y7 C5 Y
6 o+ g% y' B( p  h; S9 N$ c
__________________________________________________________________________
% f0 ^* m1 l* ?
  p; J4 D# d, F) BMethod 09
7 d3 P/ Q. t& L6 E+ U=========6 D8 a5 P. s4 u6 r: u% I4 O* @$ b
3 x$ k: h$ R! Y$ W6 }# D
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only# g6 T1 P" ^/ ?6 X2 f$ p# m2 p' r
performed in ring0 (VxD or a ring3 app using the VxdCall).
& e! D2 K3 y1 W$ w- \The Get_DDB service is used to determine whether or not a VxD is installed2 z* Y5 d' a/ S7 x) G. Y9 N* e
for the specified device and returns a Device Description Block (in ecx) for
6 @+ T( k# {* Q( \- s+ L  j9 \that device if it is installed.
# N; F% V& G* h8 L" p
; a( b) y7 I0 N* k* G& I; H) Q& }   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID% ~3 e: z5 B, z, l
   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
$ i* B' V8 o& W  H3 _9 \   VMMCall Get_DDB9 j8 o- ^3 l! j: v; c% t3 _7 _
   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed: l9 X4 `3 }) t. y) W+ T& R) {* N  k2 e

) b# N0 D  i4 \7 F: U' ONote as well that you can easily detect this method with SoftICE:
% b- L6 i. Q# F; D: _7 P   bpx Get_DDB if ax==0202 || ax==7a5fh6 ~! c  p8 \% t2 Q# O$ H
3 A1 V/ i  h6 h7 E/ G
__________________________________________________________________________
: U5 p& z7 Y6 W: l6 m; A* H6 q& f+ ]2 s. r( ~$ g
Method 10
1 G8 i2 g0 [5 d) U$ N- o9 G4 ?=========
' y9 B2 b  r5 h+ L7 `
# g8 h7 r3 Z  v7 p=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with! ]5 S; h' R- }/ _+ l* b
  SoftICE while the option is enable!!1 h3 l: _4 c7 e1 N
: w' y, B! ?* ^) m# ]; X
This trick is very efficient:
* W- i. {- D' w: `4 w' D7 _by checking the Debug Registers, you can detect if SoftICE is loaded1 m5 K+ [5 k2 j
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if* c! |+ T) D2 y5 [$ t; _
there are some memory breakpoints set (dr0 to dr3) simply by reading their5 Y" ?4 {) `8 j" A( a/ y9 F
value (in ring0 only). Values can be manipulated and or changed as well
0 T0 Y  T0 p* y1 m, B. @7 P& V: c(clearing BPMs for instance)
8 _  C5 E% ?6 K8 j
! N! L/ w" F! N7 |9 N/ U; C5 l__________________________________________________________________________# B- N1 K* b: W1 y( M
6 A3 g5 I$ J4 @# O) t1 D
Method 112 _/ H2 b# x1 @: o4 i
=========
$ U) V( `; x( K: {! y5 Q! [: G' q7 J5 Y
This method is most known as 'MeltICE' because it has been freely distributed
/ p: d3 t' w$ p8 `, |) e( Z, Fvia www.winfiles.com. However it was first used by NuMega people to allow
2 G9 l- v0 \- L+ aSymbol Loader to check if SoftICE was active or not (the code is located
4 ~0 A2 O! S; c  g! k+ Ginside nmtrans.dll).
4 V2 T8 K! L. h2 }* }( H
' D1 q, m" ]! k, p( ]. s! Y9 `The way it works is very simple:* X  Z; P" f% J  S
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for' `& @- T1 J5 k. Y
WinNT) with the CreateFileA API.6 ~7 I' z; k! _6 C
0 P1 y, }* O% \
Here is a sample (checking for 'SICE'):; ?( |5 i& q) }4 U

2 o3 B5 N. }7 V! d) u9 q' V7 gBOOL IsSoftIce95Loaded()- o/ e1 a8 \  Y0 N: {) s! K
{
( L: s/ M+ H$ M+ t% j2 @- P" d   HANDLE hFile;  ( Z, ]% E3 f& K7 |( J
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,- }. B- ]& m* M) H1 c# s
                      FILE_SHARE_READ | FILE_SHARE_WRITE,+ a& k" Z  T- p* n9 P7 z! b
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);5 u! f6 ~( T5 c4 ]
   if( hFile != INVALID_HANDLE_VALUE )
0 P2 `8 \3 R& Y/ q" O+ r4 _9 ?   {0 [4 n- Q$ _9 v0 X
      CloseHandle(hFile);, Z& @7 n, d5 a
      return TRUE;
7 h# F! A( ~# w. ?' c   }: f: T; }: _' U2 b
   return FALSE;
( i: P* H* G4 C}
2 ^. c# i: N0 R# I$ L2 h6 Y
: ~( u2 K- I1 F. \) X/ h7 kAlthough this trick calls the CreateFileA function, don't even expect to be
* K& |3 Y' F1 |+ H( i* ]5 eable to intercept it by installing a IFS hook: it will not work, no way!
9 G' ^( H5 X9 r7 ], _In fact, after the call to CreateFileA it will get through VWIN32 0x001F
- ^  C4 @2 H, Q% U0 Mservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
& f$ r- r& ^  s- Hand then browse the DDB list until it find the VxD and its DDB_Control_Proc
$ U$ S+ b1 P% S6 m- U8 z# L9 L7 H. cfield.
, U, ~3 [' E" s. Z9 R' W  {In fact, its purpose is not to load/unload VxDs but only to send a
  [% q4 @6 y1 U( j* j: YW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)) [, z/ R$ |. o9 |+ j) N
to the VxD Control_Dispatch proc (how the hell a shareware soft could try4 |/ U9 t/ n- X5 X, e
to load/unload a non-dynamically loadable driver such as SoftICE ;-).* P$ D7 e. u/ G0 l  b! X% j
If the VxD is loaded, it will always clear eax and the Carry flag to allow8 F+ C5 ]3 x5 Y5 c! Z. s) E9 |
its handle to be opened and then, will be detected.: ]$ l3 x; `7 S  d6 C5 S& ?. b
You can check that simply by hooking Winice.exe control proc entry point
" v' U! B: d' E# p- z& ^) zwhile running MeltICE.
$ A* N$ h3 C1 X4 a8 e0 o5 G8 `3 G! k

' n9 F0 `# K0 n8 ?  00401067:  push      00402025    ; \\.\SICE
7 C- I4 Q9 v6 O" F6 \& w) J  0040106C:  call      CreateFileA
, P+ P. S3 ~+ M7 ~) X4 A0 ]4 @  00401071:  cmp       eax,-001
3 e, `0 Y5 J5 J. d9 g  00401074:  je        00401091
/ N$ K  Y' |% B5 f* F; M
( z) P) }5 t1 s- v, Z" ?$ D- @3 w+ O! o3 g! {
There could be hundreds of BPX you could use to detect this trick.) f1 {0 [  r0 }
-The most classical one is:4 s+ @* v- }# C
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||" j7 b5 Z: C2 f' a+ c
    *(esp-&gt;4+4)=='NTIC'3 U) O  {7 N. J( _) v# c$ M( B

6 v2 {. j5 ~( U, [-The most exotic ones (could be very slooooow :-(
2 ~5 m3 R9 i3 M2 \: w4 |+ G   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  8 @# X9 ?- T6 M% \% ?! P* j- i
     ;will break 3 times :-() l% V# H# ^1 B& b2 \) G+ O
# |5 q, s9 Q5 P. p  a
-or (a bit) faster: " A6 K! Z) i+ H# o) U! t% y
   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')' E7 |7 |" X" T
+ [0 N. }( V: ?& x: S( F6 w2 U, p9 C
   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  
* B1 ~- w1 U3 i  x$ ]3 n4 s! m1 M     ;will break 3 times :-(  A4 ?- I* N( s6 Y# h

% y. J% d/ ]- Y/ _5 C+ W* q-Much faster:
" `, a4 t7 U9 w- T' H   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'
: a/ w+ D: \* i# {
) ^1 g+ e! p# i- S/ R$ F: xNote also that some programs (like AZPR3.00) use de old 16-bit _lopen. B* d/ y  ?# W
function to do the same job:
9 Y0 N1 Q1 i. `0 ^, j" e  t* z/ |, R  G
   push    00                        ; OF_READ) E' L$ e9 t  x
   mov     eax,[00656634]            ; '\\.\SICE',07 C# [2 D4 V5 O: F, A* ]2 `4 O6 I5 u
   push    eax9 l6 Y; [8 h, h0 q/ Y4 O
   call    KERNEL32!_lopen
8 @; w; X4 C% A* L7 e5 G' Q   inc     eax8 x# E. e  g$ x, W6 m
   jnz     00650589                  ; detected, X7 d) }8 F7 B" m9 [+ b+ S
   push    00                        ; OF_READ
7 R3 }% k" H/ v  }+ s   mov     eax,[00656638]            ; '\\.\SICE'
& g! e2 M( W. O' z( f% E) U   push    eax
5 y0 [; i1 Z7 e& a4 h   call    KERNEL32!_lopen0 m* V- H/ x8 `& a9 ?
   inc     eax* x$ Q/ y- a& t
   jz      006505ae                  ; not detected- W  x; k0 T2 x: w; q
9 c- _6 l+ R: B
- Z" {- k3 F+ u4 ]. D$ l* Z
__________________________________________________________________________! i% L* }/ r4 U/ `

, j2 F' ?: C4 ]Method 12
# v: s' ?  z4 y* }5 t$ N=========
% w$ ?% v' f- N: T) \- D, e, G/ J$ L, A- |; E) p2 ?* D* }
This trick is similar to int41h/4fh Debugger installation check (code 052 I# e2 |7 d9 k& s! `+ f& m
&amp; 06) but very limited because it's only available for Win95/98 (not NT)( M# ~: k' G7 v5 x
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.5 }6 p9 M; X/ ^! l5 M2 y

4 M4 Q4 [9 H% @6 h+ U; `9 m   push  0000004fh         ; function 4fh9 \4 p% Q& g8 g% C
   push  002a002ah         ; high word specifies which VxD (VWIN32)
# A7 w$ U5 a: f                           ; low word specifies which service
8 i/ [8 n" Z# Z$ W3 r" ^                             (VWIN32_Int41Dispatch)/ u# G, v. g4 w3 s1 }
   call  Kernel32!ORD_001  ; VxdCall4 P' Z7 T# D% Z
   cmp   ax, 0f386h        ; magic number returned by system debuggers2 U- t# L, p/ l' V! U7 {
   jz    SoftICE_detected. S  S+ J' [. d0 `

2 {' r4 J! `- i7 Q/ c- iHere again, several ways to detect it:: Q! w) N4 \. Q7 Z

( b# I6 b& Z# L$ T( A* c  s    BPINT 41 if ax==4f
* ^2 U9 P) S; p/ v% P% o8 y8 i% I9 k# S+ u- c
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one
: m7 r( p+ o* w1 P6 F' B# c
, d/ S4 O4 f- w! e4 b/ Y    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
( x4 {. y% U' r- x% n0 t9 m1 J
1 T% x, i( P* K, N0 b8 u% {    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!+ b: p4 K- a4 a: d: u; S
) ~, x. ^" g' {1 t  }& C
__________________________________________________________________________5 c7 a1 _4 F# _

2 Q; E) z. g; P: ZMethod 131 J! }0 O; b( u2 Y
=========
) d" G7 r& R5 V+ O$ f  ~6 G: M, x; S" P+ R: \$ f4 `
Not a real method of detection, but a good way to know if SoftICE is
7 f) X4 w* N, W( ^# G# e2 M1 `, uinstalled on a computer and to locate its installation directory.5 y3 C1 c7 `# d, \( I( V
It is used by few softs which access the following registry keys (usually #2) :
7 I0 n" l  K& c1 H5 s4 B
& t7 r  ^' r/ \8 ?7 T-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion, ~& I3 t. m* ~, I
\Uninstall\SoftICE$ X3 A0 L) U4 v3 G. T6 g
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE! p( p7 v2 B$ G) }1 G( I, A5 O1 K: p
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
* ]8 }+ Z2 S* [' E\App Paths\Loader32.Exe$ w  F5 m( h6 v/ f$ |9 i$ ?- S

' ~1 }( Z& j+ }, a1 P, ^4 ^0 _1 n
5 y: @: s5 E; I: _% q0 kNote that some nasty apps could then erase all files from SoftICE directory- v) D" D( \5 }2 \; W1 B
(I faced that once :-(8 W$ e* u8 R0 U8 H- }

0 o5 r9 a& F) K# E( R3 VUseful breakpoint to detect it:% Q0 x9 L- b: ~
4 h/ _: U- r" r  {/ u' ^+ e$ {5 ?
     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE': v4 z* _. t/ I6 G- X' K0 O
" h5 e! W7 }* e
__________________________________________________________________________" z1 P# C+ s! X& h: ]( @8 s
4 Q2 Y  T, U& K& o( g9 l1 Y  [4 _
5 H: {; G: I; J4 _. j5 ~* Z
Method 14
& \, n/ M7 ]$ I& `- Y" i=========
- ~- Y  G; q' E4 ?4 A6 L# z; R4 M2 Q+ n+ `
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose7 w* J" \* r' K( d3 ?( ~+ B
is to determines whether a debugger is running on your system (ring0 only).
9 U. M. P+ i+ v
  E7 {7 v! R/ ]7 F4 g! ~0 X   VMMCall Test_Debug_Installed
4 ?3 G& c/ j6 o   je      not_installed
$ L* {% V: i0 W; [' J' I5 t. b1 X, P
This service just checks a flag.$ g$ T" U/ L( L% O( _
</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关注公众号

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

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

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