About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
9 O( w$ f; f8 {- ^. j<TBODY>
5 K% m0 F+ M  F<TR>( P9 V3 R$ G8 m' O
<TD><PRE>Method 01 ; O3 B/ W! B. V  l
=========
0 B5 `* n# V' E: d- M$ o& r6 i9 s7 d& @+ z( O: V2 \6 F
This method of detection of SoftICE (as well as the following one) is1 [4 n: D* G- n; E$ c) W8 a
used by the majority of packers/encryptors found on Internet.+ V3 W1 B4 @. J
It seeks the signature of BoundsChecker in SoftICE8 m# W  r; l2 F; [7 c" D; L8 u( [
1 |: _' z/ Z7 A: K
    mov     ebp, 04243484Bh        ; 'BCHK'" e9 D" [& j7 S( H
    mov     ax, 04h
9 Z. I& C- V! A8 V7 B4 X+ u    int     3      
" \$ k/ v1 ~$ ~+ {    cmp     al,45 P9 e( Z+ G! L: s
    jnz     SoftICE_Detected
2 U! l: Q* q7 U5 \  r; U  v: {7 x4 d! X  K. s* P, Y9 f
___________________________________________________________________________
: g$ @( ~( a  ]# S) |! T  R
+ K, S8 F' E7 l6 l, UMethod 02
1 P" [5 F2 N- Z8 c4 u=========5 J, d6 s9 I3 Q( b' d5 n

2 s2 c8 m$ B3 W  |! F2 R  w" T1 PStill a method very much used (perhaps the most frequent one).  It is used3 T, i( {$ |' J: {/ v
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
" e% t3 ~1 z. O& W! M/ {' R. por execute SoftICE commands...
- s' \; r4 i+ i4 o4 c+ _It is also used to crash SoftICE and to force it to execute any commands
3 Q' U$ |9 D4 W. }1 Q! u* o(HBOOT...) :-((  ! k0 v/ [7 y: M6 B: }& n  G

& p9 s7 y, @5 z+ ~* T  c6 {! RHere is a quick description:
, [' ^& ^( r: p( i2 C-AX = 0910h   (Display string in SIce windows)
+ x/ x1 b& u1 I' Q-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)) l: e" @2 ]6 T+ Q
-AX = 0912h   (Get breakpoint infos)
7 f7 L+ U! r3 I9 v* A) K, K-AX = 0913h   (Set Sice breakpoints)
  d" G9 M  I8 g: k3 ~-AX = 0914h   (Remove SIce breakoints)' m( m2 K% P0 o

3 K! \7 E4 U2 R  TEach time you'll meet this trick, you'll see:$ x; u% ~, n% k. b
-SI = 4647h
) G" x) T& i# P+ r0 ]-DI = 4A4Dh; ^; e7 R0 {" K" @& U8 H3 {
Which are the 'magic values' used by SoftIce.
# |) Z" H& |. T+ I; ^  x) ~For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
" i  Y1 V, n5 k/ K5 a. f) _* Z: w8 |& z( h, ?( V; j- q
Here is one example from the file "Haspinst.exe" which is the dongle HASP
2 O4 ^9 U4 j3 F. ~Envelope utility use to protect DOS applications:) L0 i9 c, e2 ~: p5 W
, P6 d% W0 c* ^) [

+ q' y; V, Y" T9 `! @9 E4C19:0095   MOV    AX,0911  ; execute command.( S2 y# ~0 J& H! H/ Y& W
4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).& c% u0 ~2 q) }3 X7 Z6 \
4C19:009A   MOV    SI,4647  ; 1st magic value.$ x0 [2 j; m- c  a
4C19:009D   MOV    DI,4A4D  ; 2nd magic value.4 s. a" e+ a9 ]$ l
4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*); j1 t: ?5 B. K
4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute
2 L' ]( _1 M5 t# Q  V" J9 y4C19:00A4   INC    CX% V" B$ K  F4 m: Y3 ]
4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute9 K, c  O, p% b9 ]# h
4C19:00A8   JB     0095     ; 6 different commands.6 F" w; H' {! y% K; ?* J
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.6 j! d" A5 C9 ^# q" A! _
4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)1 _9 r1 _; p! L6 J2 O  k' N" S
$ F3 q( j3 N$ X7 i6 I
The program will execute 6 different SIce commands located at ds:dx, which
  j  e6 o! q. f5 T! \' ^are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
" F- a) O! f8 R9 L& c( w' R- E: I( z" ?3 j2 b
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.; E  i: ?% l5 J
___________________________________________________________________________. Y0 F3 z/ ~/ J% a$ C
! S. [; C4 D- b

; F, h3 C9 R9 `; j" q' S1 _9 F/ nMethod 03, z$ V& v" W9 Y7 \5 o: z4 T6 `
=========9 p% o2 }4 L' |6 |% ?
" y+ C3 ^; P$ K
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h1 T  n* D: U- k6 E: w
(API Get entry point)
+ j& V' i0 t5 Z3 B        
$ \1 |) b8 N  ~# Z7 A3 I$ ^) }5 x! `4 s. w, v
    xor     di,di
( o5 j9 X. D* [3 y: _* i1 J    mov     es,di2 l: u! z5 G7 G( M
    mov     ax, 1684h      
- p( S. Q& H( z2 Z    mov     bx, 0202h       ; VxD ID of winice
6 k4 Q3 q) C, Y8 o7 `' s. O    int     2Fh4 f0 I- d! T/ |& l
    mov     ax, es          ; ES:DI -&gt; VxD API entry point
. f# q  f- |# R    add     ax, di' B* I7 k( }: P1 W: V. m9 }) [
    test    ax,ax
8 I! [: {- c: F' Z    jnz     SoftICE_Detected' j- J) U0 N5 A0 Y, N& _. v
( n9 M+ y: ]4 l- `7 J% x
___________________________________________________________________________
: ~7 h8 o5 U5 Y
) y6 ~$ K4 d. v3 YMethod 04) E: i# E( Y: C5 A/ c: U
=========
8 O, A: N2 L+ Q( D& _0 m
. p! a7 c, g. J2 D4 F, T; y  mMethod identical to the preceding one except that it seeks the ID of SoftICE! f4 ^' F3 Q% M6 t
GFX VxD.
. Q) m' k9 @1 ^8 ^4 y5 [1 b
5 f+ A9 v8 o( r7 B% m1 ~    xor     di,di
1 U) t; o. `0 l7 ~" F8 }& d    mov     es,di
# s( V- S1 L* C    mov     ax, 1684h      
! K" V3 ]" f3 r) R; I$ Y1 C; j    mov     bx, 7a5Fh       ; VxD ID of SIWVID
3 ^, g* i* x# @    int     2fh3 w8 x: F/ F# K  i
    mov     ax, es          ; ES:DI -&gt; VxD API entry point
. h0 P7 A- j# t3 j    add     ax, di
" y6 |% U8 _$ v% t8 z  n+ _" n% H4 }    test    ax,ax& @5 \0 f( ^6 g- h) T7 S& g
    jnz     SoftICE_Detected2 l+ Z( V" {* [$ d8 U5 H4 G4 R

) x" x* Y/ D6 y/ O3 R% Q__________________________________________________________________________" M) ^7 p: w; K* [+ _" X) X& A- y6 u9 k

; L  |) ^' }4 c: }1 X# s
% _: r6 _9 h: M9 Y6 A5 R: ~Method 057 E# L4 M- Q) b. u1 V: D
=========
2 g- [( |' U* x% r. C* @' [% Q
: G$ b9 O% ^- l. m6 G6 f9 [! W2 F' uMethod seeking the 'magic number' 0F386h returned (in ax) by all system
0 K4 c( Z) P! ^6 @9 M* odebugger. It calls the int 41h, function 4Fh.% F9 f3 t. O0 L0 l
There are several alternatives.  
: M+ t2 W* k% Y: B* a/ \
. u* J; [0 q% J6 \3 pThe following one is the simplest:. p0 T3 S, o; R
9 B& h: ]+ N  W- X; }/ S2 s$ k7 P. X
    mov     ax,4fh7 K3 W0 y5 c- s% M6 i
    int     41h9 j: {' x# c7 n" M2 t
    cmp     ax, 0F386
: l9 I# e9 E1 v$ C$ ]    jz      SoftICE_detected* B7 x* }( h/ V( t5 Q6 T# ?' V
( ~: u- \& L9 {# S
% f! Q+ D3 P6 n1 C
Next method as well as the following one are 2 examples from Stone's ; U% m$ k5 g( R  j. v
"stn-wid.zip" (www.cracking.net):
) p0 [1 `3 e* ]1 I6 m- D4 B6 }2 m8 h9 h4 T7 B) n
    mov     bx, cs# ~) X3 j, m" @0 J! t; T
    lea     dx, int41handler2
2 t4 Q% S8 w9 i1 x3 }9 b9 T8 d* o    xchg    dx, es:[41h*4]
# T6 v" t( }$ F* Q9 Q9 H    xchg    bx, es:[41h*4+2]. [% J* }* _3 c. e# @, M
    mov     ax,4fh
+ r, o7 Z$ W8 m    int     41h
& ^: J+ g" W- L9 S    xchg    dx, es:[41h*4]
! m: I  y# t+ J. Q    xchg    bx, es:[41h*4+2]
4 l! u8 L/ z3 S; k    cmp     ax, 0f386h
8 x9 W, n6 ~3 n9 E6 ~    jz      SoftICE_detected
* K; u" N8 b' y0 g
* d2 g8 J3 c0 h. w. [5 qint41handler2 PROC
3 K' J: N" X7 B3 ^1 g1 f" H# {: S    iret
7 U. f& y! R5 T3 x9 H5 A$ _int41handler2 ENDP
5 N5 K$ j+ b' E0 k/ d/ m% ]
5 k! y% X7 I6 l7 P5 i! B8 B
2 o3 l, L8 T. f2 d+ n6 R8 f_________________________________________________________________________, b6 ]+ X0 n$ k. x

9 b9 K  _( U1 Z
! X* P' j2 T2 q5 y( BMethod 062 ?( U( c& ~/ f9 q& |; _
=========
! f( [7 \4 q) Q) ^3 L2 D
! D3 d, r+ c# t5 V( [4 Y0 l
. y$ T9 m6 D+ C% p2nd method similar to the preceding one but more difficult to detect:
7 r/ m- S. K4 _. D" k' J3 G9 Q0 e
4 I, l6 _4 ^9 r" Y& {$ b: t
int41handler PROC; c5 Z# R( t" D; A, G2 ?1 l
    mov     cl,al; d( [. u0 T& Y1 A2 p
    iret( d. C: ^& v. [8 O6 G# s8 E: G
int41handler ENDP
1 ]0 w" V' y9 q
7 Y* b" B) X. W, ^- v3 q- t8 x2 w* x' Y) W/ f$ i" `. f; C- ]
    xor     ax,ax( I0 @: x; J" W9 N7 R
    mov     es,ax
8 o& p; [& Q. m- m1 h7 w# U    mov     bx, cs
3 q/ P! X# X8 O, x    lea     dx, int41handler6 C2 L! r8 h% Q+ R! {$ F
    xchg    dx, es:[41h*4]
+ E8 W2 }9 {8 y4 a  ?    xchg    bx, es:[41h*4+2]
# P$ M( x: v% @    in      al, 40h- E1 d# h0 o: |- w9 Z
    xor     cx,cx
6 D/ ^0 E0 H& q5 `: j1 R    int     41h, W& [* t- W0 o
    xchg    dx, es:[41h*4]' d* j. |) F( f/ D8 O. n
    xchg    bx, es:[41h*4+2]
1 p+ k2 Q0 V0 i7 @    cmp     cl,al0 K2 h( o" ^* |5 W& o
    jnz     SoftICE_detected* J. r3 {# D/ M3 m) N
: n3 S; V2 J; }( |; Q. X; Z) p& H2 i3 Y
_________________________________________________________________________# c6 ~3 j: ^# d2 ]4 M# Q

7 Z+ I& s0 I4 n7 c! {6 [Method 07
: }2 Q/ }1 X6 C7 X0 h=========
" k% z  y; t0 i5 [. R0 S6 m# J  v+ Z0 k# Y
Method of detection of the WinICE handler in the int68h (V86)
! ]7 C4 c; S5 r) T/ j6 N6 ?3 N) s4 ^. q# G
    mov     ah,43h
7 Y# x. K2 V& ]6 I2 I( m2 [    int     68h
, ?$ ~" B+ K, S, A    cmp     ax,0F386h
( l7 T2 V% n. ?    jz      SoftICE_Detected
6 H5 S9 C; x7 _0 U+ s% P) W7 M& ]
, v, H' \2 {1 r7 a" R6 [
=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit3 v. \- j" q5 Q* \) x
   app like this:$ }; u+ R. ]1 H& v
2 M+ q/ Q' x/ \
   BPX exec_int if ax==68
, p" ?  r. {* w8 S% h* r+ S   (function called is located at byte ptr [ebp+1Dh] and client eip is
! O6 w+ q) k2 A4 n5 _0 R( H   located at [ebp+48h] for 32Bit apps)' Q) _; {4 t- _0 c% v
__________________________________________________________________________- z; G, }7 R1 G4 ]' a- K

6 m) Z& [( B! Z6 J# r7 R- C% ~. @) V4 G, i* r" J) r8 `+ q
Method 085 c( N7 l8 k# j' K+ P3 B/ ]3 E
=========3 q9 h: O  }$ ]! C* d

5 c- c3 {( L! B. S+ [0 c6 J. PIt is not a method of detection of SoftICE but a possibility to crash the8 X' ~5 s& u: @
system by intercepting int 01h and int 03h and redirecting them to another
- |1 K6 d9 Y8 Z' b8 l0 Z2 E0 _; Groutine.( E7 z; H6 j6 `, K; K3 u
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
4 h4 b( |! ~) |/ t! x, [3 [to the new routine to execute (hangs computer...)4 y) D- N  _6 l1 @- U* `

* |1 ?4 s$ f1 t- s% x- e    mov     ah, 25h
3 G: T3 a8 i: P0 l    mov     al, Int_Number (01h or 03h)$ s( q5 H( Y9 P7 w4 B
    mov     dx, offset New_Int_Routine0 v% |2 j# m3 p
    int     21h
8 _. H% {/ d. K, _- c) y) T" p* y$ @. O- e& U& A6 V
__________________________________________________________________________7 ^- O& I; h6 N; O) `6 U5 N  h6 h
0 l% U( Q" v0 G
Method 09
5 P) Q% ~* n. c4 a=========3 C) Z6 G+ b' N- W! a. D# U! v. ]  G

! p8 I* H& c. y! mThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only9 W* l8 O4 {4 z8 p7 [
performed in ring0 (VxD or a ring3 app using the VxdCall).; e4 i/ [* }, L5 P% J3 g8 P, {
The Get_DDB service is used to determine whether or not a VxD is installed
5 T5 c2 \4 s, b! ]& Bfor the specified device and returns a Device Description Block (in ecx) for7 u+ C" |0 Y- w, z4 w
that device if it is installed.' X7 p) N/ {$ q$ `+ r7 v' r( ^  v

1 [+ A- y- {# s   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID
; g/ ^5 b+ c- @$ V9 t   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)! y' U) H" r1 G* ~
   VMMCall Get_DDB, V2 X. z" g3 W9 v) ]
   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed& P5 I; t# g' W* Y+ \9 a6 F

& [8 ^3 ^( J4 G6 q% D6 E5 }9 ]9 m) QNote as well that you can easily detect this method with SoftICE:
( F2 Q6 H- ]$ z/ H& f) h2 J   bpx Get_DDB if ax==0202 || ax==7a5fh- i5 m8 ^# g1 h7 F/ }0 `
0 {+ R4 l+ ?) P. ^$ `
__________________________________________________________________________# _. x; F* J. X5 C; j

& n0 {  a- K$ Y* |0 ~8 n' dMethod 10
$ @  R% w' G" h1 j3 q=========: t2 {6 P: ~7 V
, }% ^, z, ?1 z; l
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with
6 X# L* m# Y* {- [  SoftICE while the option is enable!!4 y* Q( o2 u8 P; h3 [. v
* _! A& f. K5 b. B  X9 d
This trick is very efficient:
- ]6 e% M: q% k; S6 ?2 S6 qby checking the Debug Registers, you can detect if SoftICE is loaded$ U% \6 {0 G" \
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
+ G3 ^$ }! L+ p0 P  N* Cthere are some memory breakpoints set (dr0 to dr3) simply by reading their- S4 C  k9 P1 S  q: e" \
value (in ring0 only). Values can be manipulated and or changed as well
+ v/ o4 ]5 |) K5 h(clearing BPMs for instance)" c" w2 W0 p. I" B8 d& f3 C

7 s* y0 \6 ]; F* m' u4 b  g/ B, N__________________________________________________________________________2 ?( u; V3 ~. F; g( u/ U. {

0 J; A1 v3 g  s4 H/ k& lMethod 11) r; {$ \1 |% F/ u, z$ A
=========4 i( }% E1 E$ l- l0 S* c8 t' Y
( Y0 d: B- {5 |, M! c
This method is most known as 'MeltICE' because it has been freely distributed4 t, \/ M- E0 J1 A7 ]
via www.winfiles.com. However it was first used by NuMega people to allow
' t1 Z3 b* I6 `, bSymbol Loader to check if SoftICE was active or not (the code is located
: T" l+ V( {  d$ D% _1 J' ninside nmtrans.dll).  o  C: m/ S' \9 [# j) \& t! E
" u7 a$ x8 \% ^6 r4 r
The way it works is very simple:
0 S# h8 E3 K( h( @It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
( ^% ^" ?4 W  V7 _6 u, DWinNT) with the CreateFileA API.. k+ H6 C2 j2 n1 @: h. H
( i! g$ F' F, [: W6 E- ^
Here is a sample (checking for 'SICE'):
" y  K' D  r5 A4 B( {; w
- {3 a3 d2 [' `: V  WBOOL IsSoftIce95Loaded()3 U& f: @% u: S& ?7 f
{8 o6 F2 _' b7 M2 [5 H# Q/ h
   HANDLE hFile;  # x9 L( a; Q/ \1 I* k' Q
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
5 i5 g( |2 {  i" P5 c  d: w                      FILE_SHARE_READ | FILE_SHARE_WRITE,
# k. {: g4 @$ N                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);/ G1 q6 J3 l4 |; J
   if( hFile != INVALID_HANDLE_VALUE )3 y4 ?1 G2 o% e- `2 C9 P
   {
* a4 K1 m4 d, S  ~' D3 E* ], V/ l      CloseHandle(hFile);
" P8 [/ H& {# e, ?      return TRUE;' Z( s( |" C4 o7 K) [. F  i( U
   }2 s7 R- L+ o' Z" k( ]+ `
   return FALSE;- ~. z* G0 Z9 h" x
}+ F0 i) u0 c- G7 O7 R& F) ~

( s- J" B& I6 e' E9 f( |; pAlthough this trick calls the CreateFileA function, don't even expect to be% T  P( P3 \+ s+ O
able to intercept it by installing a IFS hook: it will not work, no way!
" A8 n( _+ B$ [3 vIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
+ c9 q* s& b5 m/ t% o8 x8 ?service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function). J$ x9 c* W3 A: h
and then browse the DDB list until it find the VxD and its DDB_Control_Proc; J7 ~  M0 A" X
field.) l% b0 c1 q9 [, I2 J6 G0 ?% F
In fact, its purpose is not to load/unload VxDs but only to send a ( ]: {' K3 [) a' H( F
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)& q2 ^* K2 n1 M4 u9 L) s9 P
to the VxD Control_Dispatch proc (how the hell a shareware soft could try0 U3 ~7 J. J! U0 m
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
. Y3 n) I9 O& y# g6 k8 x, SIf the VxD is loaded, it will always clear eax and the Carry flag to allow; ]: x  y7 m* e; b/ u% c' _% H
its handle to be opened and then, will be detected.
1 e' z* I3 J- ?  A* W  lYou can check that simply by hooking Winice.exe control proc entry point7 L9 f% v) I8 s# _
while running MeltICE.) B- U* o' W( ~% [. i# v& Q
7 C6 c' l) i3 Y

0 o4 b  O' @6 M- c  00401067:  push      00402025    ; \\.\SICE: }$ q) O4 f0 ~& V4 U: p
  0040106C:  call      CreateFileA) W, z6 h, a3 E' ^* P
  00401071:  cmp       eax,-0015 W& H8 G$ x3 r2 @
  00401074:  je        004010914 \! d, S# a. z7 ]* H" ?$ o

8 ]5 g) g1 l7 j% S- C5 ]1 k" J1 e
+ c- H( S9 G" m- V) y5 OThere could be hundreds of BPX you could use to detect this trick.
+ d9 h2 I1 j3 H1 m-The most classical one is:
0 f3 K: k; w. q0 h: L  d& R  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
% x" ~2 h; f- D) t9 t& e    *(esp-&gt;4+4)=='NTIC'" R) y, q) {1 q5 d2 W! h
+ W5 _( l% O  J# E
-The most exotic ones (could be very slooooow :-(  `9 U# e. Y* H/ e3 r; l9 }
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  0 @: I; Z: p, B: v$ D9 q( y) I! L
     ;will break 3 times :-(
' t; b) Q/ t. x! n4 \# w9 Z* v$ ^8 D+ Z4 b1 |0 P$ }; c% ~
-or (a bit) faster:
4 _! n, b+ {. T   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')* r7 \/ Y/ \: L2 n6 K& p  r

- e  {4 y! O0 Q! u3 A& N' d* E   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  7 Y7 D$ j8 u0 r1 S: j0 }5 p8 `; }4 C* E
     ;will break 3 times :-(/ G3 U$ u8 j9 h* P
* X4 S5 ]9 L$ C" R) J8 n! U+ t
-Much faster:
; n7 M% J; |2 }- T* [9 Y; m. O   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'1 \+ Y1 k$ }. _: L. L

) Q! \2 y, ?- x* K! k3 W. `' hNote also that some programs (like AZPR3.00) use de old 16-bit _lopen$ a! ^# U. G1 B3 t! x2 P" l
function to do the same job:
' [  G) f& l& Z* z9 @6 n2 I6 X3 _' d4 k  ^6 z3 T3 v8 J
   push    00                        ; OF_READ
8 ~8 \$ H4 q0 {* I- j/ F   mov     eax,[00656634]            ; '\\.\SICE',0; k& _. G; [, \( q, `
   push    eax
* n$ N! y6 M( r   call    KERNEL32!_lopen
- U( c% J8 J) t* f! F   inc     eax
# x+ g( Z( B5 a2 p0 t3 t   jnz     00650589                  ; detected8 x7 v5 e2 a* D2 r
   push    00                        ; OF_READ
0 f& T- g$ |; i6 J9 I, d+ ^   mov     eax,[00656638]            ; '\\.\SICE'
. A( l- @( A* C) c. S& W   push    eax+ e7 u& ]! X% v% ?- l- J
   call    KERNEL32!_lopen
, Y& f- R0 {4 r) Y7 }6 {7 W   inc     eax
- c& n6 l) E! U+ ]   jz      006505ae                  ; not detected! z5 W6 j6 o5 Y' X) b
* ]" R4 }6 ~+ p7 h6 F: ]
6 t6 y8 I$ L6 e. c2 K0 Z; m) w1 @" @
__________________________________________________________________________2 m& K; U3 P; U( \# S7 G

: {; g6 G) K7 u# ]) }5 |Method 12
9 x2 ]+ ^4 P8 }; ?, R=========
5 L# j2 o2 H' j" k% ]
% C5 G7 b+ f% m1 a; l( a7 Z0 sThis trick is similar to int41h/4fh Debugger installation check (code 05
7 `* U; j) ]2 g&amp; 06) but very limited because it's only available for Win95/98 (not NT)- `% ?" u' C' ?) K# o
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.& p1 u( E1 l7 \

% X- W* z2 j9 W   push  0000004fh         ; function 4fh; h* ~0 O. @# r% ]3 E8 Z& R/ l: }
   push  002a002ah         ; high word specifies which VxD (VWIN32)/ _8 L. Z* S, N
                           ; low word specifies which service. |+ u9 L3 Y+ s/ N! A
                             (VWIN32_Int41Dispatch)
4 |8 }3 f9 Y  w( ~3 ?5 F5 g0 ~   call  Kernel32!ORD_001  ; VxdCall6 d' _" F$ s/ }3 u4 J* x
   cmp   ax, 0f386h        ; magic number returned by system debuggers. ^/ g* S8 S5 q' e
   jz    SoftICE_detected, t* D0 j6 ~2 `8 `. d+ e
# d5 T% }1 s' ^
Here again, several ways to detect it:( W) z- v( l; y" r3 V- A

& J2 w; O' |7 a8 Q: S, [% ?    BPINT 41 if ax==4f0 {8 Z* l) G( }1 ?  c+ j

9 b4 |/ g# F# U5 q    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one
4 }; }9 p& ^, [& H) f/ @
  B& ~3 U. u  I5 O% f    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
  Z" l9 C; u, S4 q/ ]
2 r5 F* \: ^0 D% L    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!" |4 Y6 ]+ k6 \9 k( k2 `- q( _% _

, h% w" l. ]2 z$ F  u9 w# y__________________________________________________________________________
8 R+ Q& N8 q" \0 P+ Y  t/ J! A/ F+ P1 i( z9 u- f8 A
Method 13  u8 H1 D/ n6 D8 |' s% [# Y) K$ }
=========
1 N$ o* _# B/ M9 W+ @/ }. s( M) U' B' h- y6 n# E" o" F
Not a real method of detection, but a good way to know if SoftICE is
! x5 ^. n6 N, Linstalled on a computer and to locate its installation directory.
/ M% Z* ^/ `6 [* c9 V+ u3 J  E6 wIt is used by few softs which access the following registry keys (usually #2) :
( L  Q6 B7 L& b2 x9 k- d5 T" W
0 K5 J+ B: S3 g2 Y' U8 D) ]-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
1 H- r) p, ]5 i\Uninstall\SoftICE
& N1 n* j. r. _$ v/ m-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
0 l) g8 g2 a* O1 W$ \1 I$ A-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion2 x% v8 d$ W: E" c$ e
\App Paths\Loader32.Exe
/ G$ [" Z% ~  D, b
" H! L* F( M8 q" {% H- y+ e/ M7 ]. s
! {3 f8 P2 j4 V$ RNote that some nasty apps could then erase all files from SoftICE directory
) c& g$ i+ \/ L% k/ _1 f- ]7 E(I faced that once :-(; Y) \! w  F6 t
  O2 L- {& J8 l$ R9 ^/ y  R7 \
Useful breakpoint to detect it:; i. h2 f  l/ Z( N" G/ a0 _' W, `
$ X2 H! R. i( I* N
     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'1 D- B% z4 Y( C% B8 y" R

8 ^2 O* ^" E+ I: M1 I7 F; f; h4 W__________________________________________________________________________
; V  A/ b: E: e  u4 D7 |& A5 {5 h# T2 T! E* d
1 w  ]/ M' Z# \7 ]
Method 14
  h2 R- y! O$ a" s# n7 Y=========
: G7 Q7 G7 ^  k2 p2 M4 p5 r
) ]2 l. v" Y; v- KA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose; Z  E4 Y+ E7 C8 S9 @
is to determines whether a debugger is running on your system (ring0 only).) d( W3 r1 m! y0 C
# w1 i& Y3 z/ W- z" t
   VMMCall Test_Debug_Installed- U! ~- g( A# ?6 I) i
   je      not_installed# H. ]: k- {0 z# `/ s1 D# ^* d7 u# b
) s7 W! }2 d1 o% I% C" V
This service just checks a flag.
- N3 m' w* a1 O; X) Y! v. i4 v( Z</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关注公众号

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

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

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