About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>! }" h1 K$ P# p% w: p* F- F6 a
<TBODY>4 |/ [6 i% s7 `6 ]( B
<TR>
# Z- A8 j) F+ i: p<TD><PRE>Method 01
: |: P! D$ @7 M; |=========
4 ^9 y+ a- v- S7 z# V
% J; \  V3 b0 z9 kThis method of detection of SoftICE (as well as the following one) is
+ M3 C3 o: Q, d. M( m; w3 bused by the majority of packers/encryptors found on Internet.
' x7 n5 J- `. a4 z4 VIt seeks the signature of BoundsChecker in SoftICE
& y1 h3 v3 S" |+ L1 P+ J: Q1 y
- Z: X- m% E7 p) L    mov     ebp, 04243484Bh        ; 'BCHK'
+ d  h$ P; ?9 H6 l2 B    mov     ax, 04h: R  X/ J& A6 E' l8 j) t3 c0 \
    int     3      
: \6 M: `, X0 e: ?# _    cmp     al,4- b+ ]+ o- D8 I' _) n( I
    jnz     SoftICE_Detected+ x5 A7 m0 j  D1 X

, l/ I8 V0 R7 }___________________________________________________________________________6 ], t1 h& c8 P4 w% [
; M1 {6 N/ r. \  _
Method 028 D7 G- R/ {* I% x- ~
=========7 T7 E$ ^+ g+ Q( R
! \, _: B0 k/ |; g$ X/ E
Still a method very much used (perhaps the most frequent one).  It is used% R& p. r' _5 K
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
- h( J$ G1 x3 S( p0 I% Q/ }$ U. o: yor execute SoftICE commands...( c* E& s: K) j" Y$ g
It is also used to crash SoftICE and to force it to execute any commands
; o0 l, u, ^3 j" }# r(HBOOT...) :-((  + n2 w- {& F) [; {5 E% k' }" v
) A6 D5 ^2 Z+ f: r- O) K: u
Here is a quick description:
% W9 B* \! ^( R% h-AX = 0910h   (Display string in SIce windows)
+ x/ t4 u. T7 g& z9 x+ f- [-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)+ P+ a; I  f" I# T. Z6 s, B
-AX = 0912h   (Get breakpoint infos)/ g7 M1 q) G; U; t( P4 V! q  f
-AX = 0913h   (Set Sice breakpoints)+ G( a: \$ h' v
-AX = 0914h   (Remove SIce breakoints)+ o+ u' y/ j( m  {$ @
0 S- _5 k0 D( z
Each time you'll meet this trick, you'll see:  G2 Y& b& a) h( a* @
-SI = 4647h, T* F* A) X; r  }0 P
-DI = 4A4Dh# t" r- u* u+ T
Which are the 'magic values' used by SoftIce.
% b0 o' s7 ^5 z% h4 [/ F5 VFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.7 k8 S" f- ^6 q! e+ m

" @. H1 u5 U& `* v2 v7 m% N0 [Here is one example from the file "Haspinst.exe" which is the dongle HASP
9 e7 Q1 E# X/ D9 iEnvelope utility use to protect DOS applications:
7 A# p- w% N% `7 d  P( s  H, O- O, i7 j
+ S! D0 U8 W. @1 b. f  o8 g
4C19:0095   MOV    AX,0911  ; execute command.
! m" Z- X* k" S+ A' `8 u  D& e4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).( Y+ W0 J, |% Z. b! H( b  V
4C19:009A   MOV    SI,4647  ; 1st magic value.
( ~2 B8 c0 }) y( A9 _4C19:009D   MOV    DI,4A4D  ; 2nd magic value.
0 U8 G0 `5 [+ d& l/ p- b1 L9 x! D4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)$ D  |- {# M9 P  q. Z! K5 S
4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute( W( t- w* H8 g/ q
4C19:00A4   INC    CX3 H* F/ V5 |, A+ \) N3 l) n
4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute
( @: f3 `7 w4 \! z9 F  ~' u' R4C19:00A8   JB     0095     ; 6 different commands.
- z1 d7 H# p3 q: X1 s1 e4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
+ z! x# ?, s5 g) a. a+ N4 L$ }4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)
) K% K" m) F5 c, O: v5 _5 J* P6 y& R' }* O* e8 n
The program will execute 6 different SIce commands located at ds:dx, which
# d% L) X3 ], W# Yare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.# y5 L4 W' c) g; q' \* y+ J
2 E' c' w# n7 V! ?
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
& c  b8 o% [! M+ g! a) L* @! g4 T___________________________________________________________________________
" _+ b& X' W% C6 S, W6 S" d. O- p& S+ w7 n3 A2 _. f7 W# J' ]

4 J% g( b+ M" oMethod 034 T- m5 W1 j3 _$ j: |0 @: _8 U
=========$ e4 p3 o/ ?9 e+ f% ~1 z, N3 ~

" `7 q$ E0 i2 ]3 ~2 V& T% iLess used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
  F) T- j; N7 k3 k4 w  j2 M7 O' X- B(API Get entry point)
2 N1 E; @7 W( k. X+ R0 G+ o        - k  L' }9 e. r4 w& w/ V6 G
- q2 H- R2 h7 K+ B
    xor     di,di
% `/ O" f6 B0 W, {# G    mov     es,di
# N9 b6 S+ X  ?1 s( ?1 T' j* [    mov     ax, 1684h      
5 h; |5 i; P; Q1 w7 S! S4 d    mov     bx, 0202h       ; VxD ID of winice$ }7 O/ g' w2 N( h  I
    int     2Fh/ |; j( g  M. o& _& J
    mov     ax, es          ; ES:DI -&gt; VxD API entry point
5 |) D5 {( J1 o/ B% F7 Y% ]    add     ax, di& X* M2 ^! ~/ L/ e& `( X7 q
    test    ax,ax/ c7 m+ C$ R) }* q  Y
    jnz     SoftICE_Detected8 S* m, q# g: z

( C. G' Z% I2 S+ ^8 E% V/ l" X___________________________________________________________________________# f, Q) \0 N. r  P
; v% u' T  {2 h4 a
Method 04( |5 S; D/ p/ t4 V
=========
- N- |1 d& ?1 o, c+ `/ }' ~% G
8 }7 Y/ P$ r: W, M( d. J1 t, QMethod identical to the preceding one except that it seeks the ID of SoftICE8 k& G  t* E4 f) w6 i$ M- i$ @: g
GFX VxD., F! M* z- m9 x" C$ `) Y: I/ h
1 \0 Y4 P3 g8 J2 o
    xor     di,di
* H; u* y+ w5 M0 t/ W    mov     es,di; V* S* {/ l# y
    mov     ax, 1684h      
4 c6 a4 d: }( Q5 P1 `2 ^    mov     bx, 7a5Fh       ; VxD ID of SIWVID  Y. h' W. c9 U1 x% \: u
    int     2fh9 m# q/ u( k* I. S3 _
    mov     ax, es          ; ES:DI -&gt; VxD API entry point# x) ^; ~. N+ {. U
    add     ax, di
, D; H7 Q( o  }- V( U    test    ax,ax
( t* G& m7 B$ s* v: ^    jnz     SoftICE_Detected; B( c" c4 F2 N0 r8 G3 e+ {# n

2 V) I  ?* {  e: G0 d" L9 d$ ~__________________________________________________________________________
+ l* n; I0 p( d7 t. S" M& S6 }$ G& g+ _) u
2 C4 M' V9 _* T; G2 A
Method 05
0 |) C+ N- @3 e- P. |=========+ d, k+ U( S/ a# Q% ]

( n8 j7 y, O# @2 M% NMethod seeking the 'magic number' 0F386h returned (in ax) by all system! h' ~, `0 a; P6 `
debugger. It calls the int 41h, function 4Fh.: y" o* K  i  |9 F
There are several alternatives.  9 C- J1 Y/ [& c: B- x& {2 e8 x6 ]- J
* C( f7 I/ L" D9 s1 t: O
The following one is the simplest:
3 {! F( `1 Y4 f6 Y9 C6 ^& l" y+ L7 I: T& Q
    mov     ax,4fh% {' h$ n2 B+ `( a2 S
    int     41h
$ o1 N9 e/ q; ^" n( y1 @' r. h    cmp     ax, 0F386; ~& K; I7 d& [$ h9 }: r
    jz      SoftICE_detected
# s! A7 ^2 ~* K" a( @( H$ F6 l
' n) I, U1 U! s/ o: o+ p
6 N4 v/ B- T) g, d7 @. R, ONext method as well as the following one are 2 examples from Stone's : `5 \$ J$ v3 S+ U/ n
"stn-wid.zip" (www.cracking.net):: t4 ?. H/ p0 C3 P3 E  w7 x
' n% P$ y1 L7 X! e  |( b3 _) k. b
    mov     bx, cs+ }1 t  _. z4 Z& Z7 o
    lea     dx, int41handler21 F& K3 _4 x  c) k* |) p% N" Y! V
    xchg    dx, es:[41h*4], T5 Z0 X2 a9 _" g' b' M
    xchg    bx, es:[41h*4+2]
7 {2 W/ \) F. M. T3 H$ ~, p7 }( q6 P7 k    mov     ax,4fh
1 M+ a, `$ v- @    int     41h
8 o! I" v& G( D' `" G2 j    xchg    dx, es:[41h*4]
  i1 C6 ~5 U2 D5 X4 P2 W    xchg    bx, es:[41h*4+2]8 t0 n  A) K- D" a
    cmp     ax, 0f386h
* _" e3 z$ I* M( S& {* G1 ]; s    jz      SoftICE_detected
7 C, f( b( a( T9 _: k. S" f
+ n5 y$ b+ {) T# ?$ i$ Vint41handler2 PROC
2 b. H3 e& |2 {    iret
5 |+ J! q+ l* C1 k0 Dint41handler2 ENDP
; p$ Y* }5 ~9 G2 U3 y3 c& F3 U$ O6 P* N( v* w

+ r7 B  I. q; M# v_________________________________________________________________________
: K/ Q9 n0 }7 ^: S& D2 ]4 u. @; S3 m9 P; S  ?
* O4 P- P- b7 l) l' Y$ |1 o8 @
Method 06
+ h2 w, h7 V6 N& W$ M=========
& O9 q9 M  k! O% n; e
  G$ k4 W1 Y( u5 f4 A: e* Q$ g6 p* W; M7 ^' a2 ?
2nd method similar to the preceding one but more difficult to detect:6 f, r( P9 i/ U

" ]4 R) I$ _* H) u! n+ V) L9 F
int41handler PROC) R) [3 K2 I: D1 q: C$ F: k; M4 w
    mov     cl,al
+ E. S7 V, D3 O; m    iret
  ~# m7 v' g; P. t/ L) ]int41handler ENDP
* K0 [) g5 ^6 S* V% m
* f' B3 D* s* s7 e( K+ C/ [
$ Y- d% t% g! f6 }5 G    xor     ax,ax* F' P$ M- y" n5 Y
    mov     es,ax
- u& u5 {6 U6 t) F& P    mov     bx, cs
: X0 J1 b6 h. u( }    lea     dx, int41handler
! C4 `# v' {2 ^. ~: U) A2 ^    xchg    dx, es:[41h*4]
( [+ x0 Y+ _6 X/ v- v* e    xchg    bx, es:[41h*4+2]0 X) v! d) _$ o& d* L# r
    in      al, 40h% d: R2 a. {2 Z' E) r
    xor     cx,cx
& ]0 b4 Q7 g# @0 F$ I3 K, r, p- [# X( I    int     41h
- S9 [1 I4 K! ?5 P# n& r6 f! F) n6 V    xchg    dx, es:[41h*4]
- T) _  l; R2 F    xchg    bx, es:[41h*4+2]* ?" ^/ j3 e2 k* y  M* W
    cmp     cl,al1 o. U$ V, {+ Y4 q, ^
    jnz     SoftICE_detected
" E1 h9 d6 U* X" t
1 t; i' R4 k. T5 J_________________________________________________________________________' {9 _# ]* F7 q5 \, I

/ V/ o. }* \( Q6 jMethod 07" G4 s' R8 N" J! I
=========; ~! b/ y6 s" Y& i8 t

$ x* D& H4 j1 \$ l/ m# TMethod of detection of the WinICE handler in the int68h (V86)6 v2 f9 {1 v7 K* K

/ w! z  v( [  G- F! x- l: Y    mov     ah,43h
" l6 \; k1 R; t    int     68h
& a) r/ l5 s' @5 X. B; N- R9 ]    cmp     ax,0F386h
. L1 q3 V: t$ ~/ a0 X    jz      SoftICE_Detected; H) o3 M3 c" i- o
* C3 s5 O9 x  Q

& I; l% c  l2 y: j( [=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit. }: O" t4 Y( U& g  G( M
   app like this:
5 k% D, F. D6 e2 y; F4 i  v. Y0 p/ q
   BPX exec_int if ax==684 j7 P/ x' K- Z
   (function called is located at byte ptr [ebp+1Dh] and client eip is
4 g( ^% L: F, o   located at [ebp+48h] for 32Bit apps)! l1 P/ f( S( i
__________________________________________________________________________
& a+ R- t) {# f( B8 l0 n) o- n  u6 R% x! E

! v4 w0 @3 z9 x4 NMethod 08
" n4 m8 T$ l: H4 Q=========( D' ~% \( Y6 \/ {  w& ^. e: e
3 T( M$ @* W/ X, [' b/ N
It is not a method of detection of SoftICE but a possibility to crash the
) a4 X4 N* R8 J$ Asystem by intercepting int 01h and int 03h and redirecting them to another( R) \! p/ N3 ]) @7 x! T
routine.
/ r+ _1 u6 y: Q* C" b8 t% ?% a1 v3 PIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
3 F( k  d/ Z! S! r- |6 `* Nto the new routine to execute (hangs computer...)
! @. D9 ~, L- q
, {1 H, H6 {8 W# E    mov     ah, 25h
4 ?( z, l" L) r& W( u4 s    mov     al, Int_Number (01h or 03h)
% y* @5 H: W2 G7 U3 _2 a3 w: O) {5 @    mov     dx, offset New_Int_Routine: S( j) B0 ~3 b# F5 H
    int     21h
2 N% s% F/ n  s( r
5 n9 K- H" C; V: P__________________________________________________________________________0 }+ e% R2 m7 a
6 I% @8 _" C  N' G1 v+ G3 E  R3 a0 F
Method 09% ~. m/ H  _( b! e
=========
7 `$ C% G* x9 l( W4 K' l( m0 E6 ]& y
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
& G! q$ S+ \; y6 ?1 l: cperformed in ring0 (VxD or a ring3 app using the VxdCall).) d9 K: c0 ?6 c7 L3 _% o8 k* m
The Get_DDB service is used to determine whether or not a VxD is installed
! H+ _' q" X5 ?# E6 hfor the specified device and returns a Device Description Block (in ecx) for2 p# [- m' m: u" k, r
that device if it is installed.
1 S  ^$ M' |$ T& e) l4 A
" V" ]3 {+ F3 i: ~; S   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID9 o) \' l5 I' a$ ~+ a  W: _
   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
8 n: c- j( l5 c  t9 e) ]   VMMCall Get_DDB) C+ H5 |) R& {1 _2 T1 |
   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed$ n& j$ B3 q9 `, ?" E) U

+ [0 ]8 l5 N3 hNote as well that you can easily detect this method with SoftICE:
& j2 E: ~7 B* h) |   bpx Get_DDB if ax==0202 || ax==7a5fh
( {' ~( a( U& M1 S: W2 Q8 }9 B3 {) w7 c8 \: h) c! K
__________________________________________________________________________
! c2 ~3 |3 Z9 U, ^5 ]' G6 K( F, M" `5 I) z
Method 10$ e: Q8 v% m6 E  a
=========) ~9 o0 z9 j. h! i  H9 |+ M! j
3 a' M; P) {5 c1 O
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with, S, N7 A* F- p$ z$ G; `
  SoftICE while the option is enable!!& X4 t, N' [$ J# R0 `) a

% D6 F& _0 f2 m& W1 F6 ^This trick is very efficient:
8 f( s+ O+ y' J  O2 J  d$ kby checking the Debug Registers, you can detect if SoftICE is loaded4 Z. d2 B4 W) @% _
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if% ^/ C' j$ f; s
there are some memory breakpoints set (dr0 to dr3) simply by reading their
2 l, Q4 X  [4 Lvalue (in ring0 only). Values can be manipulated and or changed as well) a- ?7 N, s2 O7 Z. g! u2 S4 y
(clearing BPMs for instance)2 W- A2 m9 C, ~) X* [
% v  P6 Q7 d" F: P
__________________________________________________________________________. w9 N- F* w- R

# M; z5 A$ [9 Q7 wMethod 11
3 l9 p# f* I9 T1 v3 l! M; P6 m' V7 {=========1 G1 O+ I: u2 c0 x2 B8 N: G7 E3 _' Z

1 U3 z$ R+ h4 j$ Y+ t$ [. PThis method is most known as 'MeltICE' because it has been freely distributed" m5 Y9 @  T6 a2 n$ {* k6 l
via www.winfiles.com. However it was first used by NuMega people to allow
/ V% x# w6 g' n' \- X3 jSymbol Loader to check if SoftICE was active or not (the code is located* J) _7 m5 R. P
inside nmtrans.dll).
4 D' m* f. A  H7 h# J% c+ \- z" U- X. `( _+ O/ @6 s  [
The way it works is very simple:: B9 M$ }# G7 e, P) w* {" ^- P
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for+ `% J+ X7 i2 Q7 F2 ]
WinNT) with the CreateFileA API.
0 o8 Q" y7 i- G7 b* E! M8 z; C3 }9 T3 x2 Q. i! r0 k9 N
Here is a sample (checking for 'SICE'):
( S6 b0 G' s: ~0 e
" ~$ Z& F% u) i) x0 KBOOL IsSoftIce95Loaded()& Q& r1 j; N5 }7 K0 s; z
{
( d) B. h* |0 Z1 }   HANDLE hFile;  
: q, l8 k: C' y% @% x   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,( I2 A! {4 I; d. J9 }- E: ~5 n3 m
                      FILE_SHARE_READ | FILE_SHARE_WRITE,
5 a( Z' S8 k; k) S# I' x                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);  A* o: Y* e. y" @
   if( hFile != INVALID_HANDLE_VALUE )6 O' M4 |* ?& x4 V
   {! V4 Q+ v' V  p+ I9 E
      CloseHandle(hFile);
( M! G* c- ^) P% s5 I& L3 y+ N      return TRUE;& ^, N  |* N8 G
   }. O; ?: j( p; e. U0 k
   return FALSE;" M% a: J9 Y3 R' J  J; s6 t
}
' O5 D# w! l1 w  b. x* p$ t2 ~1 E9 f. p8 i* w. y& z1 T2 W
Although this trick calls the CreateFileA function, don't even expect to be- `( C& W- r# O, I/ `" A. F( Y4 a
able to intercept it by installing a IFS hook: it will not work, no way!
/ i+ X7 _& t, e' e+ i. JIn fact, after the call to CreateFileA it will get through VWIN32 0x001F9 T+ E% V& V% I
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
- A9 s: k6 E) jand then browse the DDB list until it find the VxD and its DDB_Control_Proc3 z( @; Z, [, s& G
field.% Z9 I/ K# ^5 l/ }( e7 m
In fact, its purpose is not to load/unload VxDs but only to send a ' H9 m! `2 `' H" @* ?& z" I' \
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)$ \+ X' {# x9 A1 W
to the VxD Control_Dispatch proc (how the hell a shareware soft could try/ N! d3 l& n: B' x8 q3 N$ u
to load/unload a non-dynamically loadable driver such as SoftICE ;-).$ W0 D3 q* z9 E- |
If the VxD is loaded, it will always clear eax and the Carry flag to allow
4 h+ h9 A0 C5 B3 @' n  e3 eits handle to be opened and then, will be detected.
% r/ c2 z3 s8 fYou can check that simply by hooking Winice.exe control proc entry point
) J; B) R. V- T# N6 X* pwhile running MeltICE.
2 o) l# K: f  Q3 ^- G' `2 }) o6 m% E0 S
. q  {. B" i; a, s
  00401067:  push      00402025    ; \\.\SICE/ Z+ C! s! l- L; i
  0040106C:  call      CreateFileA
5 U# t$ X/ p! {: A# w# L* L  00401071:  cmp       eax,-0015 W: J1 ~% Q9 ^' D6 i+ R
  00401074:  je        00401091* U1 w; K+ [) A
. E* r( X4 o' q: G9 x! p
: E8 [4 W, d& p5 R" z* \* a
There could be hundreds of BPX you could use to detect this trick.3 S( b5 @' z- [* P7 \" J" x/ T' P
-The most classical one is:
/ Z8 h" C. P6 Y# E9 O  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
4 o1 X7 ]+ c9 D) H    *(esp-&gt;4+4)=='NTIC'  C& T$ w$ w$ g+ J0 E; B3 i3 o
" K. J5 O, p0 ~8 q" o% k& Z
-The most exotic ones (could be very slooooow :-(
" \6 O5 \7 B" X! ]& `   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  
8 b0 D( }; J3 n" i0 B2 O- R     ;will break 3 times :-(
* X& G3 L% ]9 h% N3 D8 @: p4 e4 T
/ J8 Y0 |1 A1 G( o$ ^3 u- _-or (a bit) faster:
% ?7 P0 V! n* N  p   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
( p, w- M1 A6 P
* S" l- s9 u4 a0 U& `3 J   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  
7 \  x! u% I9 ^& C2 ^     ;will break 3 times :-(! h% J' `( G3 n. \) W+ U

6 b, ]4 K$ U) m  J-Much faster:0 \# S8 K4 ?* y; Q1 x' i
   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'
, |0 H4 @* z2 X, K6 R" V1 a9 G( K
  E4 J3 z# z4 t& c' mNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
& v/ P3 v2 F0 m/ Afunction to do the same job:! H3 v5 y) v$ V5 v+ E7 k8 ]; H
, Q+ O! z$ [7 R9 Z% C
   push    00                        ; OF_READ
$ Y% @- W$ E" [+ R; T   mov     eax,[00656634]            ; '\\.\SICE',0! d4 m7 X$ Z5 O5 \, o- J4 P! q$ m
   push    eax5 ^/ `3 P! S4 l4 x1 ]; W
   call    KERNEL32!_lopen
, T' W) e9 v4 H, r0 ], Q- V  `; ~   inc     eax
- @- J9 ?/ N2 r6 g   jnz     00650589                  ; detected8 Y" Z8 Q" V" o' }# v# T5 l2 ^! x
   push    00                        ; OF_READ1 |. j7 N6 x6 U' |& m% z
   mov     eax,[00656638]            ; '\\.\SICE'% }2 S3 z' g- C* R* ]3 H4 n- H7 D
   push    eax# m7 S+ J( z- r2 h3 a! U
   call    KERNEL32!_lopen2 h0 v6 G! r! ?6 m5 P
   inc     eax
9 K; M: C/ Y9 G* F8 T* c6 L: y$ I9 i   jz      006505ae                  ; not detected8 N! g9 L% c8 O9 U* V* X  F7 B

: _7 S% @: e6 m  ]3 l% J* r) ]5 L  S9 D' _3 @7 M
__________________________________________________________________________# c) J5 s; S, n7 S) |- F: Q
: m0 J" r) c6 d( z3 T0 G
Method 12
6 x: c, d) r  C8 C( Z=========8 E$ Q: g4 A4 c5 s. U) ^
0 ~: r9 C. J1 `1 V$ N
This trick is similar to int41h/4fh Debugger installation check (code 05# L. z1 V  t+ `
&amp; 06) but very limited because it's only available for Win95/98 (not NT)
) X, ]& }. b/ Kas it uses the VxDCall backdoor. This detection was found in Bleem Demo.; r( s2 r  M1 ^% c1 Q

' t4 ^% M3 ]% a   push  0000004fh         ; function 4fh
0 e. n# g% ^6 K& O   push  002a002ah         ; high word specifies which VxD (VWIN32), V; A$ _0 {$ F) S5 [3 D& T
                           ; low word specifies which service
# V6 c# C3 b, y; Y! V# |6 }                             (VWIN32_Int41Dispatch)6 n$ w9 _* k9 F9 `. d3 Z
   call  Kernel32!ORD_001  ; VxdCall; N# x! O2 Y$ |2 `1 A
   cmp   ax, 0f386h        ; magic number returned by system debuggers7 c) p0 w. B: O# u9 h
   jz    SoftICE_detected, T7 ]: T; w% J7 b) l) {% ?. {, _
% q: z# }6 B4 f8 V5 y& p
Here again, several ways to detect it:+ s3 g8 k* O+ S+ _5 a- R
1 ~% {! e+ _' L! n
    BPINT 41 if ax==4f7 Z$ P8 f1 H  N  T6 w7 X1 N
, i% Y& y0 Y* _) X' K8 [
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one  X4 ]$ s! S( F4 m9 j- W$ l

& G4 X, ^5 s) u, ]0 e9 j. C    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
# m, n8 }" B3 z+ H$ @; s. Q4 [: V( }) I5 D* B4 M9 _. H6 [0 S
    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!
  t0 q$ J% [* P/ d7 H9 _$ z, {  A$ d9 Z0 g! n
__________________________________________________________________________& G* k/ e; Q4 H1 e5 B
3 l* E* S$ w. E+ F7 V1 K; n; K
Method 13* _( A" c; l2 o4 V
=========5 F7 n7 d! J, o- n  {+ |
' ?" X/ I# j( O
Not a real method of detection, but a good way to know if SoftICE is
- @6 V9 ~# u. k/ pinstalled on a computer and to locate its installation directory.
; I5 r  {' h3 G4 K0 zIt is used by few softs which access the following registry keys (usually #2) :0 ]0 O2 [4 |: B  X/ F9 a1 ^

; A0 W# O) [" b  O0 `( J  W-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
" F" a9 j: j* f0 }$ k2 j\Uninstall\SoftICE
6 J. V. C& [/ @-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE. p1 t& E% h( G- m. W' r0 F& l
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion7 V' d; d! ~- D6 q1 n1 y! r
\App Paths\Loader32.Exe
: g6 F& H- q' T- p& i! A/ Y( I5 {' B2 K. m$ [0 P* ?
  U6 K# V" H! ?' X1 x# q
Note that some nasty apps could then erase all files from SoftICE directory8 y" o( e) q4 }& p: Q* |
(I faced that once :-(
1 H* D) s3 `3 O# g# T7 Q# N6 U4 B
Useful breakpoint to detect it:3 S0 ^( K8 o& p8 l& }3 ]& E5 R

0 y4 L  S; l  Z, l     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'6 |- `# z! D) r7 z- L' l2 a, G
3 F8 l- \+ w: d' ^$ m5 F+ C( W; K
__________________________________________________________________________) E& C' S' h* o

. o8 @2 c. W. q% B7 D
! o* x2 G( i, \4 j4 i; xMethod 14 & U/ v9 B. D3 q, O8 T% L5 x; f
=========( u- z# Q/ G$ D6 d, z
. @# d  X: H6 ^6 H  p' ^
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose4 I' f/ n4 u  H& N
is to determines whether a debugger is running on your system (ring0 only).
5 E+ ?" ]% `2 y5 u5 R
, ?! |8 s9 N3 f   VMMCall Test_Debug_Installed
3 j% C1 P6 ~! L5 L- n% ^   je      not_installed
6 D4 M  R/ \- Y; k( I2 f0 ]2 k, U: @
This service just checks a flag.1 R0 i# B0 ~' d: n$ T5 @- }
</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关注公众号

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

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

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