找回密码
 注册

QQ登录

只需一步,快速开始

About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
: f% O! l2 l+ Z, s/ o) W4 l<TBODY>7 H9 F" O3 t  C* K2 H
<TR>! h- e/ i* F& l  D
<TD><PRE>Method 01
8 n% y0 S* D7 R5 o$ o( Q8 o& A=========+ _' G4 F# e+ m  D% z
' f1 [" C$ J# k
This method of detection of SoftICE (as well as the following one) is# A) G/ H/ x2 I+ N- L
used by the majority of packers/encryptors found on Internet./ ], z! S1 W5 h* i0 D1 V9 C1 }8 `+ t
It seeks the signature of BoundsChecker in SoftICE
" H& {5 ]$ K7 C2 s7 W0 D1 t$ \6 N- A* q
    mov     ebp, 04243484Bh        ; 'BCHK'
; q% P4 j& C2 F# y6 G% F    mov     ax, 04h$ @; X4 G$ n/ d! G! i6 b- @9 d. }
    int     3      
) c! r1 H$ n' i    cmp     al,4
. J1 ?5 X+ J8 S! U' y7 `2 p9 T    jnz     SoftICE_Detected2 v& O6 Z& [0 k" Z3 n
# T, E) s4 t4 c4 n. m7 u4 R" z
___________________________________________________________________________% N% T/ s$ D% @+ p: D+ |

, y6 E9 x4 g* J5 M* uMethod 028 \. P: p/ g9 v; h# a
=========
0 X0 T9 p- t9 V0 c4 \0 W) q3 d
; h; I6 H3 ]( uStill a method very much used (perhaps the most frequent one).  It is used
" z- M' ^6 q1 m! y1 F* l4 qto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
2 E2 M4 h' I: _2 qor execute SoftICE commands...
- W* f, z7 _7 yIt is also used to crash SoftICE and to force it to execute any commands2 `& ^) Z2 g; _6 O- f# w
(HBOOT...) :-((  
& e8 E# F0 \/ C- R+ r4 m7 h. G; P2 g5 r* ^1 j( E
Here is a quick description:" R- X( C& l  p
-AX = 0910h   (Display string in SIce windows)
) h" M! H  R+ y7 [$ S" j" c3 v3 \: h-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)
, ?" N) E: g( `8 o: s; i-AX = 0912h   (Get breakpoint infos)
* ~3 t: f8 `$ A-AX = 0913h   (Set Sice breakpoints)
* @. W( _% s+ M$ }* R. h-AX = 0914h   (Remove SIce breakoints). \' _. p) u& `5 y! L

& Z# q8 X) B" W' A, @! i4 g0 CEach time you'll meet this trick, you'll see:
9 _7 [. o$ N& v' D( _$ m4 e-SI = 4647h: @+ Q8 j2 Y' o" V% Z. V
-DI = 4A4Dh' Z9 ^9 _$ U0 H. Y0 \5 P5 I5 e
Which are the 'magic values' used by SoftIce.
- Y: v& p+ a3 x; GFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
$ Y- o! b: d2 l7 S) X
1 R4 r, u/ m5 ^Here is one example from the file "Haspinst.exe" which is the dongle HASP
) y+ h- t7 s  lEnvelope utility use to protect DOS applications:
9 w& B1 X1 v) x/ D9 V
! |. a2 ?/ e! r7 m
/ U/ c6 M6 e- ?8 E, H: M# V$ b4C19:0095   MOV    AX,0911  ; execute command.) l8 \" \6 d. f2 _
4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
$ x; ]$ {- ]6 k# F4C19:009A   MOV    SI,4647  ; 1st magic value.  N* C& K2 y" O) l: p
4C19:009D   MOV    DI,4A4D  ; 2nd magic value.
) r9 z0 e+ O0 ?( Y: s, f4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
' j" x) P' K! _8 g9 Y% M* h4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute
, x" r9 a$ p: b7 H& F% b4C19:00A4   INC    CX2 R1 a0 ?+ a! g9 S  p) j; E9 g  ~
4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute
6 E& m/ }) _. e/ `: ?  {4C19:00A8   JB     0095     ; 6 different commands.0 a( \9 Q  w- }7 s
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.% O) j, w7 t: c! I
4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)
5 O/ t4 N: ~" d1 ]
: B& }; q  a' M4 |- KThe program will execute 6 different SIce commands located at ds:dx, which
, \! P) ^0 w9 U. @# Xare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
  K$ C- s0 c4 R9 c/ t
1 c5 H5 z9 V) ]! A  |* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.( _/ x0 `- f0 S' _
___________________________________________________________________________% s8 h" J, n7 a6 g% {: B
& \+ O( Y  |7 f9 {  |" m1 d) M4 j
. H: E9 `9 R6 o8 |- F
Method 03- W9 i! C  I, v7 g/ Q2 B8 f
=========
: I* W' Y8 h2 d  M9 N7 B& Q9 ]# V/ I" p. H" g& _( C8 u
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
# q! @! g& \( z0 D& ?(API Get entry point)
8 w. x" T8 n: Q- T) e* U7 s        / e$ L. R. e3 P1 x- Y/ V
1 c  _' D% M8 @; ~2 ~$ Y3 c
    xor     di,di4 h$ K9 H% Q! B/ ~% a& L
    mov     es,di5 B4 I/ d+ r( j
    mov     ax, 1684h      
. h/ ^! ?, S  [% G" u$ q9 _0 {    mov     bx, 0202h       ; VxD ID of winice3 R& ^0 Z% X. a( S
    int     2Fh
/ t) E% R3 U5 g8 `' u( ]    mov     ax, es          ; ES:DI -&gt; VxD API entry point
) M1 W# H$ z# i) n( w    add     ax, di
+ t/ p+ _6 k. }7 |( Y    test    ax,ax
2 O+ X) i% g6 W    jnz     SoftICE_Detected
% z' l6 g5 U! _, P3 V" N8 S7 H& \  ]- H4 D
___________________________________________________________________________! M- [5 n% Z( W7 q6 Q
, _0 R: e- X; L9 x4 T9 v" P
Method 041 k1 z+ d! K6 |* V6 U
=========
$ Z! o1 p( r% z, j1 t6 v
* d( U7 `% R  mMethod identical to the preceding one except that it seeks the ID of SoftICE
3 B4 J: F2 ^: s, H+ ~4 ~9 qGFX VxD.
  H4 h( @0 t1 D; k0 @
" w  q2 ]5 ~; n6 }5 w7 u    xor     di,di4 u0 Y3 d% _" i0 P6 @
    mov     es,di
0 ]5 k+ y3 K- V2 @9 d. K    mov     ax, 1684h      
4 }/ z" o' l- d    mov     bx, 7a5Fh       ; VxD ID of SIWVID( |" R; M. ?5 t
    int     2fh
& t7 _, W% m0 W, l! a9 Y0 s6 t7 y    mov     ax, es          ; ES:DI -&gt; VxD API entry point
% w* Q5 n% R- c9 {4 j    add     ax, di3 l& \- I; c; w
    test    ax,ax
9 F: X2 Y# k+ e7 T  r/ S    jnz     SoftICE_Detected6 v* {9 a( y) c; ^8 J0 |
4 o, h8 ^, m, e) u2 h. Q9 t4 q9 z
__________________________________________________________________________
- n( [6 r3 t1 f* d4 w7 g9 w- c" Y) ~. Y5 g( u

6 {: [6 }# Q. g- E8 t+ KMethod 05
2 w. [& ^! j( @( R6 R6 j/ ^=========
) s, M% c$ Y% B" S7 W* {
# o9 a3 r1 Z5 x$ v* u/ O# s" G$ RMethod seeking the 'magic number' 0F386h returned (in ax) by all system
9 _* Y* M5 s% [6 o& Idebugger. It calls the int 41h, function 4Fh.
; X+ }5 M  B/ Z" S( h: qThere are several alternatives.  7 V: S  f) ^  ^: c  P, b7 I
& i  A- ~1 b4 Q6 G
The following one is the simplest:, ]- O2 @& ?& b. e0 B

  N! ?# R( u2 ~% |1 N: M2 O+ i2 h    mov     ax,4fh( k3 y) }; k/ U8 r# H) @3 p
    int     41h% S) O, @/ y5 z$ u6 m) ?% q
    cmp     ax, 0F386- J( K- h  }0 |1 E+ y' y
    jz      SoftICE_detected5 Z9 p/ w* O% ]2 s( ?

! ^. K: {6 E" b5 g5 N/ j5 ]
4 [1 a. q6 p% I+ Z( V. A/ d1 ]& TNext method as well as the following one are 2 examples from Stone's
; W; |% Y; \" @8 P- L" Y* ?"stn-wid.zip" (www.cracking.net):
7 e. [- Y7 P- q6 e2 H' d! ^8 t; {
6 L! _2 J" V9 G    mov     bx, cs9 h- Q* Q' c2 s' n
    lea     dx, int41handler25 b& @( E+ k( M+ ?8 Q) [
    xchg    dx, es:[41h*4]
4 V# x8 c( h9 b( Y    xchg    bx, es:[41h*4+2]8 x( s3 Q$ B  w$ a# M+ \4 w
    mov     ax,4fh
5 ]) z! d& O% K4 L9 @    int     41h
% |7 B. o0 ^( m# s  r" a0 F    xchg    dx, es:[41h*4]
) P7 y' ~8 W- \6 `  E6 T) p    xchg    bx, es:[41h*4+2]- S* q: @' s& `1 k
    cmp     ax, 0f386h
8 P3 ]/ @: c; p    jz      SoftICE_detected
+ V0 K" P. ]3 O" n6 c9 [. Q. ~6 t4 m4 {# T6 r& p
int41handler2 PROC
( h% R" }# O/ c$ q    iret9 r# [/ L: q: ~
int41handler2 ENDP% e4 m0 r) t, Y# i; j: K
" L  Y+ l( x" y9 q5 r6 W; x% Q; F! `$ t

6 q% Z+ c$ ], F8 C_________________________________________________________________________6 t, T$ e, t0 C7 i) j

2 C( s- w" n/ W6 L% ?' I+ o# X+ K2 }
) J4 L* ]) U* j& R- m: ?Method 06
. Z* ]* s- y" n" D* I=========$ B# l1 B- H4 f$ T& g
2 T/ L5 S( @8 M# ^

. i0 v/ y/ F, d" t- w/ j/ n2nd method similar to the preceding one but more difficult to detect:
' W( y& T2 U5 I5 a( J7 m1 v2 P7 U, y* `4 ], E
0 T& z6 O+ x9 f; I4 l
int41handler PROC3 M$ C' T5 c9 O: W3 b  t
    mov     cl,al
6 j# ~0 G6 f& a! M# |' X    iret; x+ S9 E! o  M! H7 I! i. z
int41handler ENDP1 G9 p4 U" }1 P0 H' x1 E

: d+ e# D. @0 y: x6 ~9 y& m5 u9 \9 F# o- b- g
    xor     ax,ax: L6 r/ j: T* J# |% y3 }- d; w6 C
    mov     es,ax
3 A6 C: M1 s4 @) A4 p# Z    mov     bx, cs1 ~0 _) i# a# l6 ~
    lea     dx, int41handler& j7 j+ q6 ]! o& A
    xchg    dx, es:[41h*4]
) W  Z* M. z& v( g9 {    xchg    bx, es:[41h*4+2]- |2 P! y" G4 \1 p" \
    in      al, 40h
3 H7 E! M4 f2 e    xor     cx,cx9 t0 C7 r- t0 n9 n! E
    int     41h
  X* Y- {2 P# B6 M  C" x    xchg    dx, es:[41h*4]3 w/ T8 |/ ~' B. L
    xchg    bx, es:[41h*4+2]
1 s8 V" |! w1 s4 t  d    cmp     cl,al) w' X* w) C4 o% r0 ~
    jnz     SoftICE_detected
" Q6 g$ [( k6 j& {& Q. W+ A
. y! S# j* v' V/ ]3 A% W_________________________________________________________________________
8 P& x) H6 z% p  s3 c0 ~4 O5 X: S/ U( Q+ y
Method 07
; ]  k) v3 H( w% G=========( @- f! l3 s+ u" W$ C
  o- U  D" x& }8 v7 \" ^
Method of detection of the WinICE handler in the int68h (V86)
& M  s+ Z, m+ N& c5 l9 d) ]7 e% O* l
9 u( ^+ }" V7 N4 [- _- \    mov     ah,43h1 L0 N* ^8 y; \, v8 V! p
    int     68h' ?. p4 [5 K9 ]1 u4 m) L
    cmp     ax,0F386h! j  m2 C" V; ~3 T( G! Q5 a
    jz      SoftICE_Detected
+ B' l: [. F- H9 q$ Z6 E
% X2 G6 w5 f& V4 r- y5 a& q+ d) I2 k" J# ]% `$ l. w
=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
! U2 D) d+ |/ E8 x! a) J   app like this:
) v: b  o/ s2 _' U# S, i" b) C4 `' l1 z: `6 ]5 N
   BPX exec_int if ax==68$ B# [; q+ D: J7 G- E4 o
   (function called is located at byte ptr [ebp+1Dh] and client eip is* Y/ k2 l+ P2 X  Z, \  m
   located at [ebp+48h] for 32Bit apps); j4 H. G& G$ F+ |: J
__________________________________________________________________________
4 j4 ]% [4 d7 P* S) N' H$ C  G9 Q0 e/ m
  z, z* @4 V# r! R8 A9 l! a# x' L
Method 088 h/ Q, L% }' }2 L
=========/ G5 l: I5 p; d, |
3 G0 n5 e7 L0 f
It is not a method of detection of SoftICE but a possibility to crash the
" k: u! q( {4 l2 K; s  A8 esystem by intercepting int 01h and int 03h and redirecting them to another
) @; u6 ^) s; s/ ~4 {" |routine.
$ E  O; |! m1 R5 j3 iIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
+ C' H7 k8 |: j; kto the new routine to execute (hangs computer...)( L) x; I: m7 u9 T
! V" i- L1 ^. K7 y
    mov     ah, 25h
& z) b. d3 r) N- K. g    mov     al, Int_Number (01h or 03h)
! F) J4 ?5 Y- Y" }# M; Q    mov     dx, offset New_Int_Routine) @7 S7 R4 P; }8 Y" k
    int     21h
  c' _* l& P+ q, C' V- H3 d4 a1 T$ b; D6 H% D0 t6 p6 Y* V  J# s1 P' l
__________________________________________________________________________
* |0 `- f) M# ]' T5 `* S4 t* n% I8 f9 v3 y
Method 09
" X* a9 z3 m+ m4 Y" u=========2 Y- k! [8 l4 w/ G

# X! t- G* W8 I# z4 WThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only* L& ?( l1 Z* Y  ]! y1 M3 m4 o# `  D
performed in ring0 (VxD or a ring3 app using the VxdCall).! X0 A2 j6 E% Y, w  c+ |; {. d
The Get_DDB service is used to determine whether or not a VxD is installed
* Y- r" M8 i" r3 M. afor the specified device and returns a Device Description Block (in ecx) for
$ W# ?3 i+ L9 b- w7 A( o( D+ n! S  athat device if it is installed.$ p8 c& R! p9 e
# ~; E/ G, d$ `2 H, x; |5 V0 ]0 J6 y
   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID4 c1 c' J" `8 B; M2 \) k
   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)& ]0 D+ N) O+ j; Q$ x0 |
   VMMCall Get_DDB
/ K' e5 X/ n) y. p& @% N   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed: ^' X2 W' x$ D
# M: C3 ~/ {; ^. S
Note as well that you can easily detect this method with SoftICE:6 u2 F( d, M3 R2 [, A. L( c
   bpx Get_DDB if ax==0202 || ax==7a5fh
# s2 c# q+ T( K; `7 j
. {8 O+ r! F( ___________________________________________________________________________
, q) j- q8 q* q. j. \: ~  m# L! y+ J, j7 f7 [* ?, H
Method 10
" L9 I2 A/ b6 ~8 Z' f( b8 W=========
; s+ y* F0 Y9 E1 [: y$ N' Q. f/ g# z0 N2 x9 X
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with) m. @5 F3 L& k" t
  SoftICE while the option is enable!!; Z$ ~0 t, _8 O$ b. K9 I; M
5 l! Q. d2 O+ p  }+ t) z
This trick is very efficient:( O% c9 ^4 u/ Q
by checking the Debug Registers, you can detect if SoftICE is loaded1 _3 k4 J6 i3 B  Q3 T$ Y+ {
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
4 U5 J  p9 w  ~4 [there are some memory breakpoints set (dr0 to dr3) simply by reading their
, S1 }$ m: |& cvalue (in ring0 only). Values can be manipulated and or changed as well& u& p( K  w" C5 c2 t& s& _
(clearing BPMs for instance)8 L4 M1 l: v% l  u# a; K) u3 I
, e: p- G, Z7 N* q. a
__________________________________________________________________________
" l% k) `. U; u( z- n' U7 C. M! a$ x' `8 r
Method 11
9 `! `: [7 g. r=========
: r( r6 o; y' J3 ]$ c
+ L' ~" {6 k$ ?3 FThis method is most known as 'MeltICE' because it has been freely distributed
# ~$ d1 Z' c* ]4 m2 ~via www.winfiles.com. However it was first used by NuMega people to allow
$ t$ ^+ m$ }% U& a. m9 ~# a" OSymbol Loader to check if SoftICE was active or not (the code is located
9 k* H9 o  Y6 }- Minside nmtrans.dll).% }. I. Q6 P# E" c( [7 c8 P2 L
5 Z$ `2 F8 i$ ]' h) T0 D& K1 ~* x$ ~
The way it works is very simple:+ p5 E3 `( U" W( E+ i& M3 D0 R
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for8 N) {  `( X+ l3 N* A2 f1 b
WinNT) with the CreateFileA API.
5 ]( t7 w9 x3 J8 y0 G2 t
- A# ?& e8 p3 S9 l  ^Here is a sample (checking for 'SICE'):! v/ K' ]1 b$ j& y
+ ^* U; D6 Y! o; r3 t- n, n& `6 G1 f" O
BOOL IsSoftIce95Loaded()7 N) _& |- C* P# @( I( T
{
- n4 z+ q8 `8 A7 a, W   HANDLE hFile;  : H. h' \* I9 h8 p7 L& l
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,0 {6 S  Y3 {* H6 y
                      FILE_SHARE_READ | FILE_SHARE_WRITE,
. _0 V6 R; K; T+ N" q' i7 b4 J                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);& ?# K8 z! p- V* H
   if( hFile != INVALID_HANDLE_VALUE )
0 l- ?" f( T" n/ l9 B+ [0 I   {
8 Q$ P$ f! a/ o' g6 Z/ a8 t      CloseHandle(hFile);! I$ K" k, }9 r$ [9 Z* e+ A0 g; A
      return TRUE;, B6 `  @* c2 {& R& c
   }1 @) L: k$ }; A% x
   return FALSE;5 T, F, Z+ H# F4 k
}2 r# ^0 w; D4 N; L
4 a) T6 t1 m+ y0 z
Although this trick calls the CreateFileA function, don't even expect to be
4 k+ f8 K; G$ e. @2 z4 E& r$ jable to intercept it by installing a IFS hook: it will not work, no way!( i* B) M. k3 n9 Z
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
) Z" Q. o1 U" t" J+ x; g3 xservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
& \( H$ m3 p3 n4 {( Sand then browse the DDB list until it find the VxD and its DDB_Control_Proc
2 i( V6 a: r" Bfield.7 A; b& b& f  L9 j
In fact, its purpose is not to load/unload VxDs but only to send a
; p, F2 ^+ l. |3 DW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)8 @- _! _6 Q& b% M
to the VxD Control_Dispatch proc (how the hell a shareware soft could try. S- G% i! N# ]4 Y8 l; D3 w
to load/unload a non-dynamically loadable driver such as SoftICE ;-).# d4 i# c' d& }5 \% T) n
If the VxD is loaded, it will always clear eax and the Carry flag to allow3 v, F: V5 @" i
its handle to be opened and then, will be detected.( {+ J' m. S1 N
You can check that simply by hooking Winice.exe control proc entry point# i# O  p5 L9 ?7 G! b1 h
while running MeltICE.
4 d8 |  E4 b. ^. [: S
% d( m9 U9 T* K0 q. k- Z5 h7 F
( ?- W2 c3 c/ t, Q  00401067:  push      00402025    ; \\.\SICE+ q9 \3 L; N% d: x& G
  0040106C:  call      CreateFileA
6 w8 i% u0 W/ b6 C8 r  00401071:  cmp       eax,-001/ I4 C6 a! k5 W3 O5 W
  00401074:  je        004010917 z2 @% ]' P2 z7 k! p" t& {+ {
7 j# l2 R8 e1 F8 ?
: `8 Y' R4 z3 R! L; i
There could be hundreds of BPX you could use to detect this trick.6 k8 M* l+ K) P9 v
-The most classical one is:
( ]1 Z8 a+ ~7 L4 k8 }  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
/ m, l8 _0 J1 g4 Q    *(esp-&gt;4+4)=='NTIC'
5 _0 {+ I1 {1 {. Q* U/ @, ~: I/ y* P
. g% B4 q" i" Y7 H; ]  o" {4 H-The most exotic ones (could be very slooooow :-(
+ s$ n& c1 J/ v" X6 ]( T4 ]: }   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  % Y1 B  f$ ?7 V
     ;will break 3 times :-(
  k  k. o4 Q8 H: O4 N8 S- K# f: P) y. u7 w2 M+ a, Q- t/ e
-or (a bit) faster:
* H5 Z& H- t5 t) [   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')$ x. d1 E1 U0 L8 \$ Y  W( x; o

' s) T+ `8 L' |, x/ u' P   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  
# d* l9 {6 T9 M     ;will break 3 times :-(4 W6 k5 v, X! r

; O% y8 t( d$ [# k; w' q-Much faster:9 R. Q, R; Q" T" b
   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'3 l! e( s; G- I& r% {( Y7 S

- O' e( }  d5 v. _' tNote also that some programs (like AZPR3.00) use de old 16-bit _lopen* }0 w2 Q4 ?% A
function to do the same job:: V6 I. c) X5 L( c) ^
6 @( V0 m1 l- b) ~# R5 v3 t
   push    00                        ; OF_READ
6 {. F1 K) p" l) s   mov     eax,[00656634]            ; '\\.\SICE',0
- P; A8 A0 _  p' r! J% u; Z. d   push    eax
: s. W' U; Z6 B1 G   call    KERNEL32!_lopen: |5 o2 _; d& F) @# P, `9 \; }
   inc     eax
1 P  N6 K' M& }/ _9 L   jnz     00650589                  ; detected
7 Y0 s7 T! E0 K5 D* K7 M. O   push    00                        ; OF_READ
% F: `% @1 z& p  f( `" b: Q   mov     eax,[00656638]            ; '\\.\SICE'
: W. H) y3 w' W5 X: U1 a+ f6 ~   push    eax
7 X+ Q5 Y2 p( N4 x+ }3 ?  Y   call    KERNEL32!_lopen
" O7 t* `1 ], W2 O' j! A   inc     eax# Y+ T7 o7 N& r2 {- V4 b9 c
   jz      006505ae                  ; not detected/ j4 i2 s8 N% j  l/ h. ]

; I8 i# J+ D% x% S2 K0 d) Y- F7 i+ t6 u/ Z6 ?7 {/ Z/ X
__________________________________________________________________________- @$ P$ h+ c4 g' Q9 f8 e

6 k) g# v! g# c8 x) LMethod 129 Y6 ~* o. t5 v# i$ Z
=========  r3 G  N  @3 J' |

0 s/ P1 f  ?+ I' Y& x9 LThis trick is similar to int41h/4fh Debugger installation check (code 05
& p! H9 X5 A2 e5 @: H7 M3 _, E&amp; 06) but very limited because it's only available for Win95/98 (not NT)
+ r9 V, d" n" g! H; M0 a' Bas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
: ]/ k" ?1 x* n! H  i4 I; V6 @( y6 M2 Z# G
   push  0000004fh         ; function 4fh$ q  M1 e0 S1 U8 g1 n5 P: y7 \
   push  002a002ah         ; high word specifies which VxD (VWIN32)
, f( D* G) r6 K0 P: s7 w                           ; low word specifies which service
9 g5 j/ }# g& n% c& Q1 Y  s                             (VWIN32_Int41Dispatch)
/ r' d, Y4 v6 V   call  Kernel32!ORD_001  ; VxdCall
! ?2 Y) x4 ~) j7 ~( M( l# A   cmp   ax, 0f386h        ; magic number returned by system debuggers5 ]. ?% d3 P1 X. R- a: w1 l4 E
   jz    SoftICE_detected2 I3 O- e  l0 `3 t
( N) E5 O) @' ^9 o( b8 z9 x
Here again, several ways to detect it:& r' m" c/ d: R3 s4 M; Z5 _0 P3 ?
* L, Y, e6 j2 W, m* e" N
    BPINT 41 if ax==4f, f6 a' q( ^5 }' G+ t
4 b3 ^# Q; N" B
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one! U  f  x0 {% ^; X
2 j1 M3 e( M# G' Y8 g. Q5 A
    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A& x$ h. f; F3 h; P- @3 {6 `2 z
$ c2 P& [) {+ u  o, q7 Q, d1 v9 P, A
    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!
% y- |, M" d7 F4 Y$ k% i/ L' q9 e- J$ ?
__________________________________________________________________________/ L% _9 R5 s4 {8 q% D" _% b/ {( e; u
/ O9 r: F3 e  K2 e( H1 M) t
Method 13
3 c1 f! x5 C( M2 @# m) M$ S' t=========
5 P3 l* {3 E5 _- o! ]6 d' W2 U" Q( I. c
Not a real method of detection, but a good way to know if SoftICE is
) U$ A3 g/ X$ J" I' Q* iinstalled on a computer and to locate its installation directory.1 v6 N3 @4 I  g9 C
It is used by few softs which access the following registry keys (usually #2) :' {) p* s. ^' R( u8 V

' Z+ ^; u" M. @- e3 Q" N) M) D-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion$ I7 e' Z/ B7 P2 f6 y3 H4 [
\Uninstall\SoftICE
8 V" y* |: c7 g" v, R, ^: j-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE; U( J- I& O+ `- Z. f  h, X
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
1 }; k& v$ a# G" b\App Paths\Loader32.Exe
8 e+ ]2 z- I5 @0 m8 j$ ]6 X3 s* q5 F! R8 `0 O' z, J
& B& q3 g- Z& R0 C+ @
Note that some nasty apps could then erase all files from SoftICE directory4 c. g* d' N# N" b' z" `0 J. L$ h, n* [
(I faced that once :-(. V. A/ |3 e0 J: K5 \

2 z. Q8 L/ }4 r: k6 j& P/ w3 S- E7 ZUseful breakpoint to detect it:. v5 N% C. A7 e! E/ q5 ]
+ \% d8 J9 u# C
     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'9 a5 J" ^+ q& t
+ r: l  t% X1 o, p1 M7 q' {
__________________________________________________________________________
& H* U% _4 n* m( z1 a+ f% H: B
+ }1 [4 ^% u& y8 w, a) Q
- J! j7 [- ?" i7 A4 Y9 a9 AMethod 14 ! a- l  S: Q' h, Z$ d
=========
( z# }  l& P+ h$ A. ?" x5 X$ w% }+ x0 Q* \0 d
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
1 f& \- B" |" bis to determines whether a debugger is running on your system (ring0 only).8 \9 @& J2 s. X! ?# @
- ^3 E) w7 ?4 S% i/ y0 v
   VMMCall Test_Debug_Installed1 ]& }9 f$ z3 ^0 ~4 t& ^
   je      not_installed
% @8 L, Z: c) k- e- u4 i+ D6 ?- `; W. v1 T7 E! @" o9 x& O
This service just checks a flag.* i3 G) ^1 E  |% |# w
</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-8-10 16:55

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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