找回密码
 注册

QQ登录

只需一步,快速开始

About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>: R* ~. H, {% F! g' d, l5 g: J
<TBODY>
) |# T0 w8 T* s<TR>- b% K% D4 ]  g$ J' B; A" |
<TD><PRE>Method 01 1 M" Q6 _" |3 x9 D; d
=========% a. A3 Q' b1 m% Q; R& z: l- A. _
  ^4 Y% i3 N7 n3 r
This method of detection of SoftICE (as well as the following one) is7 }( d& Q4 i, L7 }
used by the majority of packers/encryptors found on Internet.- `% w4 J7 A% A. I% ~" E4 d
It seeks the signature of BoundsChecker in SoftICE
1 n; {. b% b' ~, X  L1 c' Q. O" K6 D  C
    mov     ebp, 04243484Bh        ; 'BCHK'
2 N% }' M# @$ U+ F/ r3 N    mov     ax, 04h# X/ X4 [$ `% i$ p6 Q
    int     3      
, `5 [* f4 ^5 m' t2 P6 _    cmp     al,4$ a+ D$ P- I/ x
    jnz     SoftICE_Detected
9 _" M9 k5 V3 [8 \& \; ?" f1 L: S+ ~' x% ^2 u  \
___________________________________________________________________________  F7 \0 o3 r+ v

' u8 D2 f# O' |Method 029 ]$ q" I/ P9 E( e4 j* w6 W
=========( t% K5 f! V  W$ X6 t) [

1 @6 ]9 u. D: u2 G$ JStill a method very much used (perhaps the most frequent one).  It is used
1 V; `4 r$ q; Eto get SoftICE 'Back Door commands' which gives infos on Breakpoints,8 {$ X; y7 S: X: ]0 @; z) ~
or execute SoftICE commands...$ ]' q( N$ l- ?; k% n
It is also used to crash SoftICE and to force it to execute any commands
% a( p! ?/ \2 `# Y(HBOOT...) :-((  
7 H8 ^0 X" u& i  Q0 S& x4 F  h# a+ O' g9 Q
Here is a quick description:1 @1 j$ ^# w  N
-AX = 0910h   (Display string in SIce windows)
# c, \3 L1 n1 h( a-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)3 E$ J/ h  [: ]8 ]0 a
-AX = 0912h   (Get breakpoint infos)  f/ H: I7 Y; z) m
-AX = 0913h   (Set Sice breakpoints)
( V5 q: s! S$ B' b( k# o. C' J-AX = 0914h   (Remove SIce breakoints)) e9 @' v9 V& K! p

) H8 B  a) u' j5 D, X2 AEach time you'll meet this trick, you'll see:$ _+ b; @! ~5 ]  b
-SI = 4647h
+ w1 S" l$ O$ t: o# v-DI = 4A4Dh) T; s* j. t8 _; T8 c
Which are the 'magic values' used by SoftIce.
! H8 g% s1 a9 @# S) |5 o) `For more informations, see "Ralf Brown Interrupt list" chapter int 03h.5 G1 ?3 X: }! c  a+ a4 Z3 e

9 l; l  b/ [# sHere is one example from the file "Haspinst.exe" which is the dongle HASP
; a7 {/ T. `1 ^6 d- @Envelope utility use to protect DOS applications:
' L! y- E; j- T# ^0 t
# S0 ^0 W0 z3 j+ H+ n0 x
1 u, G8 Q/ f+ o0 u( `% h4C19:0095   MOV    AX,0911  ; execute command.
& W  @& z9 P9 d) Y: I4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
& d8 V/ a/ }9 V& K0 ]" D. N4C19:009A   MOV    SI,4647  ; 1st magic value.& F3 W- w$ G+ N$ S; r0 N+ \) ]
4C19:009D   MOV    DI,4A4D  ; 2nd magic value.* x2 r6 Y& F. I0 [! Z0 t7 V
4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)3 }$ i2 x/ h$ k4 k6 w6 }# C- h
4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute
- e* n1 @8 N, p$ V- q( y. X4C19:00A4   INC    CX0 `( s4 \7 k& @" N! r3 F" t( j
4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute
4 c5 G/ `/ M5 b" }9 y/ g+ M4C19:00A8   JB     0095     ; 6 different commands.
7 y) O, v" B3 y7 b4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
" g/ w" g/ ]% L$ Q, H( O4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)  B& h/ U& f+ x  Z' M- W
. N& W, o) ], H6 ~$ S- u$ ?
The program will execute 6 different SIce commands located at ds:dx, which
" a1 @: ^/ {6 P: t( vare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
# _& A2 G3 r8 L) C& k7 E% B
0 q, y& Z9 C& Q6 ]$ z/ `/ B$ R  U* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.& I- O% H" Z, C$ m0 p
___________________________________________________________________________* H5 r& E/ F5 W: _8 j  B* B) c
, o8 o; q, Z. G' D' A/ C

$ h& R. D. [* c( ~0 P. b6 aMethod 039 e! N& s8 @& L& Q
=========
* K4 Z# u  j& A" B, Q' T' O) T5 U% @& v9 [  h( p
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
4 r$ }# ~' h2 V: j% j(API Get entry point)
4 f: ?7 P! T0 }) j2 Z3 m        4 g' N) o; @+ A  x' X

8 Q- Q1 R# N5 T    xor     di,di& ]* M5 J8 `# l* \4 i
    mov     es,di' U% ^; V5 e6 P) [' S8 X1 A
    mov     ax, 1684h      
3 \# d3 Y* H6 G  o3 D6 B" A& t! g' y    mov     bx, 0202h       ; VxD ID of winice* s& g% d8 L% h+ J- o
    int     2Fh: V& Q8 V, B# }$ U* M6 P; [7 D
    mov     ax, es          ; ES:DI -&gt; VxD API entry point
3 r1 f' y2 D5 |7 e8 ]% d    add     ax, di
7 v0 g& {1 z0 B$ B    test    ax,ax' u' G: l' E$ \6 S3 v4 ~, W
    jnz     SoftICE_Detected! J9 C1 ~+ B  W, P& I  {. Z
" M. f* u7 a+ \9 k% M
___________________________________________________________________________
4 p( G- {, n2 O4 o* b7 X5 T/ Z7 l
Method 04  v: l2 D4 R* t
=========( Z# `: w9 e  M3 P2 H8 G+ l3 o+ v

% M, u3 X/ b# H, L' RMethod identical to the preceding one except that it seeks the ID of SoftICE% }1 X  w+ h$ U
GFX VxD.
! P4 n3 }- u$ P" K# @
9 A, x; ^+ u( t& c% ]/ _    xor     di,di
  U. k4 x( v1 s) ?    mov     es,di1 G* O& K; u% H
    mov     ax, 1684h       5 A1 k. k2 E( V( G
    mov     bx, 7a5Fh       ; VxD ID of SIWVID4 k' D- U1 }: J. [; W
    int     2fh# e/ E2 K/ A( D4 q3 N' K3 @
    mov     ax, es          ; ES:DI -&gt; VxD API entry point+ e" l" @  \$ O+ n& O' ?4 t
    add     ax, di
* M7 i# x  Y( U! j/ W5 I    test    ax,ax6 F, T# C9 k7 b4 Q6 x3 {  e
    jnz     SoftICE_Detected( X* U9 S3 L% \' b! k+ i7 \7 v
: ^9 _; Z% b6 i8 Q0 R6 i
__________________________________________________________________________( f/ L, M% D$ U6 W" O; l
) [  L& ]; Y+ H, T

$ t  k. ^7 S9 ?' w  L) H' m7 X0 DMethod 05
0 t. j! U# ?# z+ a( [5 [=========
: W# o: w/ {# |5 R. f
) A8 l) \4 p# g  W; P( @) X3 H6 fMethod seeking the 'magic number' 0F386h returned (in ax) by all system% U. C+ N; |4 u5 M1 W  I# N! V
debugger. It calls the int 41h, function 4Fh.
4 d* P8 O5 l. {; e1 i4 dThere are several alternatives.  
  Y! q3 r- h- p: ]0 Z9 o
) e2 r9 Z6 a) @2 F4 y0 r5 e- m8 N" ~The following one is the simplest:
9 o+ X6 x! ]5 w) }3 E3 S, K2 m! d' i/ g6 p2 y# E
    mov     ax,4fh
* }3 C, u2 W6 I6 Y3 P    int     41h
0 y& M& A: ]6 E/ a    cmp     ax, 0F386
3 J8 T* O$ ]( [3 o) U# t    jz      SoftICE_detected
* L! z; d, N/ P' a' Y9 ?
, |; S3 C' H, I) ?$ v/ z. _9 {- ?: o# ]9 Z/ {! V$ A
Next method as well as the following one are 2 examples from Stone's
7 A8 S8 G1 @8 L+ [+ O+ @"stn-wid.zip" (www.cracking.net):
5 V) L2 K/ D! v' e. }. q: \9 w6 t# @, [) v; Z6 {
    mov     bx, cs/ w: q3 x) @. m, |! }
    lea     dx, int41handler20 o2 V8 K+ Q  ?
    xchg    dx, es:[41h*4]3 \( y7 g" o; E
    xchg    bx, es:[41h*4+2]
! ^; b% A. i) W& [$ F9 j# L3 q    mov     ax,4fh
- U) Q! ?1 Y7 F) A2 ?4 J' g6 h    int     41h  {, E' `6 V& Q, C% M3 T. `# d
    xchg    dx, es:[41h*4]
, R5 K( Y& C3 ^& l    xchg    bx, es:[41h*4+2]$ N/ u0 D3 l. @2 B* |- O6 F
    cmp     ax, 0f386h( X2 [) K" F: H9 D
    jz      SoftICE_detected% }0 ^7 d) v# T& ]+ m
0 ]& Y# W, {4 ^# @, _3 x
int41handler2 PROC
/ b' @& A3 `* _1 w3 m2 U& ^    iret; Y( |+ H4 q# A! S0 ^3 M
int41handler2 ENDP
8 N( R( ~3 r7 A) F5 V5 |7 X8 f. O  H

3 U) a* Y. U& D, E_________________________________________________________________________
, c+ P! |( K4 g7 q. U. A: R
/ C' B2 U% n& P! H
- n3 t( G( U+ Y/ [2 K9 tMethod 06- g: W5 \  C+ H4 a6 ?: E
=========
6 z0 S  q! K7 R7 _* H$ s
0 P' [5 {# @9 b- y' e2 ^" b% e+ K/ N
2nd method similar to the preceding one but more difficult to detect:
( H* O7 m/ c9 J8 e! m1 ?' e9 a( X) c8 ?

  m% I4 N: ~, U5 t% aint41handler PROC4 P4 M4 d1 {5 [* j0 {( A0 f
    mov     cl,al, ~: R1 Z' q9 O' G
    iret
9 j$ a1 F; P. `int41handler ENDP1 x$ c. ]# H7 {
0 D- |! n5 l( O, e5 d2 T5 l" V

$ {8 T3 D& C8 ?, R" A+ Q1 K6 x9 K: \    xor     ax,ax7 |. k$ [( K# O1 c1 k0 d
    mov     es,ax
0 R% [0 o$ ]; t    mov     bx, cs* B8 k7 H6 ]3 i
    lea     dx, int41handler
( m; X/ v9 R8 Z% r    xchg    dx, es:[41h*4]
( }" q4 \1 `: Q! k/ B- n6 V' p* P    xchg    bx, es:[41h*4+2]9 p) L0 c  b8 U3 ]- `8 E
    in      al, 40h
1 [  h* a: m) s* s( x5 S) D    xor     cx,cx: X* }) Q* v9 g, b; l
    int     41h( f5 K  n, X. \7 s$ g$ p
    xchg    dx, es:[41h*4]$ A* N% g/ B1 n
    xchg    bx, es:[41h*4+2]
; x! {4 P: ~. Y6 R. p& K    cmp     cl,al
: r5 P3 Z8 A, g/ {' p6 z) L$ w    jnz     SoftICE_detected; T5 W6 ?5 v8 `( c* \

6 k3 \; m6 `+ O& Z_________________________________________________________________________; H, V3 c  p# T* r6 W! W/ S. d

6 j+ @3 L: N1 G8 k$ LMethod 075 A5 `4 W: ]* I3 C$ _1 Y6 @
=========7 W3 D7 @5 q+ V7 B
0 _& i0 O! i: t$ j
Method of detection of the WinICE handler in the int68h (V86)
" U- h* h" d- R' ~& {; G7 c, |9 ?: w& x6 Y! [* \' m7 o
    mov     ah,43h
: M1 [# k( P: [. r' ~; |; i    int     68h
( A7 E6 Y) }- _+ {    cmp     ax,0F386h) |1 M/ v+ X& G2 T5 N/ E
    jz      SoftICE_Detected# `! t/ O- A8 Q  H3 _
6 S$ r" M8 S$ \! g
: @  o: Z  y, Y! q- q" Q+ t
=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
  N3 u% w; K5 E' T) ~1 @   app like this:
- Q! ?, j: ~1 K; `
2 t0 _  r( A' t* C$ v+ r& ^9 z  W   BPX exec_int if ax==686 Q- P" {( _/ U' D  w3 z
   (function called is located at byte ptr [ebp+1Dh] and client eip is
* Y. W$ l- t5 R0 |, v* p! p   located at [ebp+48h] for 32Bit apps)0 |) ~9 M3 d& U8 F. ]0 m
__________________________________________________________________________" R* W: m* v+ D# r& S% O2 n" H4 U
7 _4 P; F( R  m: x; h% P' w4 D
$ F! ^$ u& X9 T- R5 h* Y
Method 087 q, T! `7 u- Q/ d7 Z2 ~. ~/ s3 [
=========
  |$ }  J7 `4 I6 d) {* F  [' U7 P- D  A3 L$ G( O% e9 Q. n
It is not a method of detection of SoftICE but a possibility to crash the; t- ]* x/ w& G3 M' P
system by intercepting int 01h and int 03h and redirecting them to another
6 T9 L. h4 A) h' \  L" `' proutine.
* C$ }4 u' N- K# W: H" C7 C+ ZIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
( C' f. t, Q( S: H  o1 Hto the new routine to execute (hangs computer...)
9 r  \0 O, ^% W& T9 N7 u
; q# p4 R1 y4 J% E! w2 l    mov     ah, 25h5 H7 h% v% p$ Y& i0 O3 V2 s5 L
    mov     al, Int_Number (01h or 03h)0 W  \: U, g& @8 T2 r
    mov     dx, offset New_Int_Routine7 Z/ {5 N0 B  r) A+ u" T6 h
    int     21h
" Q9 s# o* f; D9 v
% A2 J9 {; T( z- _0 |__________________________________________________________________________* a1 F/ S, e  m2 N* E2 m

# b; s2 U) g3 _2 ]/ h) D3 hMethod 098 X# r! P' Z% q/ j7 V4 d
=========7 _$ K2 G7 Z3 v8 h1 e; q
( B; ~! j* W" {$ G) h* U
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
2 K! E- ~, n" t$ S8 P4 n% Xperformed in ring0 (VxD or a ring3 app using the VxdCall).
  m- [7 }2 y5 Z: |' P& w  Z0 HThe Get_DDB service is used to determine whether or not a VxD is installed
9 ^/ f: |$ h" \2 _4 `, @for the specified device and returns a Device Description Block (in ecx) for1 F7 p& q4 ^5 n( J' C. w
that device if it is installed.8 c: E2 }5 C" _0 g

9 z2 [: r9 O3 K) w( o4 }" @4 v5 a7 L   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID, f+ D( Y; g1 l
   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
0 z4 N5 r9 q5 P7 k   VMMCall Get_DDB! x( x  H4 h  N$ U0 `; u* ]" ]
   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed  ]" S7 H) A  E+ v$ r

- Q& u( h/ G: z0 |5 r) o0 MNote as well that you can easily detect this method with SoftICE:( t. a; Z6 d6 f+ _$ r" K
   bpx Get_DDB if ax==0202 || ax==7a5fh4 X# J5 R  {6 e, U
0 _6 s" W: p" U( R- K
__________________________________________________________________________
# q) R7 D: a' Q1 Z8 D
; S+ O: a; z9 p  }Method 10
0 a! o! W- ~, m4 I=========
% r# ~; k' f8 k; Y) k8 I. z4 f% e& q; d! B. |! `4 W; N
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with
, v& a" V6 q* [  SoftICE while the option is enable!!
8 S7 n  o  S/ Q- T* L5 N2 `/ j
# s1 `8 E  x1 oThis trick is very efficient:# J. F, g" |" w
by checking the Debug Registers, you can detect if SoftICE is loaded
0 e  {, l( k2 S' h5 n% ]6 ^(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
7 I' i# H) D1 |' Vthere are some memory breakpoints set (dr0 to dr3) simply by reading their" ~2 q* Z$ [# }5 l5 ?
value (in ring0 only). Values can be manipulated and or changed as well
- X+ B/ {& A; ^/ `2 a) p$ H3 E(clearing BPMs for instance)
& ~  A8 P4 Z2 t6 v% a- t$ F, G5 \  v1 i$ p4 E/ ^/ K
__________________________________________________________________________8 Z& ^3 g2 }0 P/ [

0 _4 v5 @2 [/ H. A/ R; V1 N4 uMethod 11
$ R: V0 \2 K8 B3 _! f=========
0 @* J. S/ h/ u9 r, l; b' U4 K
+ T7 l9 H' K; t# `This method is most known as 'MeltICE' because it has been freely distributed
* T7 m- f: i* H6 [1 r. z* Vvia www.winfiles.com. However it was first used by NuMega people to allow$ t1 }! X" L! N/ h& x* O2 B6 M, }
Symbol Loader to check if SoftICE was active or not (the code is located
7 M5 B5 ?) c; B& H. z  Z( K7 N* tinside nmtrans.dll).
/ J; ~4 u3 x: q2 w' |
! Q: P+ o* O3 G7 G: U$ v$ x1 jThe way it works is very simple:
" [2 k( C8 m# MIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
" S4 T8 [1 s0 H9 @/ SWinNT) with the CreateFileA API./ P5 }4 J% w. ~' x5 ]8 X2 a
5 e2 ~  p# i2 H
Here is a sample (checking for 'SICE'):
) I( G& F% y( U' Q1 h: k- ]
! z1 E1 o9 p2 l8 NBOOL IsSoftIce95Loaded()
. i& Z: Y% L' m6 A# _{, U) b$ _( Q4 L+ S9 o. o/ p
   HANDLE hFile;  & z) e* M8 z/ R" }
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,1 U3 v* j0 Y; O6 j. V! C
                      FILE_SHARE_READ | FILE_SHARE_WRITE,
5 u, c$ o, F! a0 c8 j                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);0 I' l: c+ [* a7 S4 b3 V
   if( hFile != INVALID_HANDLE_VALUE ), _0 J8 O7 Z% W1 G4 c
   {
) j- L8 v! Z& \4 A      CloseHandle(hFile);
6 |- ]6 H" y" _: X3 J# K; L! e      return TRUE;
. ?1 E8 }9 B% P/ q/ w  K. j   }& q( C0 S, O0 o2 t
   return FALSE;
7 a  e, @4 ?4 R/ _" z. U}$ T% ~3 m$ J$ Q0 r% j8 M* V% I

) M' P9 D- r6 ]) F- P3 d# c9 QAlthough this trick calls the CreateFileA function, don't even expect to be* y* |9 f) J( X+ H1 H) z
able to intercept it by installing a IFS hook: it will not work, no way!# j( _! Y6 i: p2 x; R
In fact, after the call to CreateFileA it will get through VWIN32 0x001F' e5 T! @# C$ n% {. i: \
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
& R9 o. J7 b9 d* h+ nand then browse the DDB list until it find the VxD and its DDB_Control_Proc4 p2 [- V  ?* C3 U' Q6 Z7 l
field.3 M+ V  q* M4 J) k
In fact, its purpose is not to load/unload VxDs but only to send a
/ L) ~! G9 f( @, KW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
3 W) n: A% l0 zto the VxD Control_Dispatch proc (how the hell a shareware soft could try
6 Y3 X) c- P! }4 V5 t% Uto load/unload a non-dynamically loadable driver such as SoftICE ;-).9 ^% y5 q& S) ^: x+ k# O4 H+ P: }
If the VxD is loaded, it will always clear eax and the Carry flag to allow4 u  s; c# `, K$ w' D
its handle to be opened and then, will be detected.
" e* G8 |1 \  _+ t+ F9 Q& T- `You can check that simply by hooking Winice.exe control proc entry point
- A7 P/ R  ?$ ?' Lwhile running MeltICE.
. ], t: z' F# R0 \7 L  m+ @
3 v. {1 b" v! i# f
) a6 U: h; m% I" d  00401067:  push      00402025    ; \\.\SICE
2 f! P- T  b0 V7 o& ^  J9 l  0040106C:  call      CreateFileA: {/ @4 z( M( m' {
  00401071:  cmp       eax,-001% X) \* {' B; A
  00401074:  je        004010919 {/ d' o' A' ~3 u
: m+ a9 B+ r0 V( @5 N& S* A

! U0 w* }+ o. U& qThere could be hundreds of BPX you could use to detect this trick.; x' A% P& B% N
-The most classical one is:
* Q" P! d1 {$ o" H  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
- }" C0 d+ Y/ t. `# d$ F7 f+ `; |    *(esp-&gt;4+4)=='NTIC') k! N8 T# r/ R( e" C" U4 }- }

; }: @$ e1 W2 ?2 x0 a. e1 I-The most exotic ones (could be very slooooow :-(
+ L5 d, Z5 X% ~: V0 p- r   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  
* u& g# l, I/ X  z     ;will break 3 times :-(/ o+ s% o$ D/ u5 l) I: w: T9 [
8 K. s, a. ~3 M2 R! D" ^
-or (a bit) faster: / D; Z. C9 Z0 A
   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
& }. K& s8 F$ T, K2 i& N9 j! `$ y  K- M
   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  
) l" q: c- `" Y/ t) C7 l. n     ;will break 3 times :-(
* b5 J5 p- L) a6 j. K
3 r+ A  S% H5 w8 ~8 H. V-Much faster:
2 B/ H9 ?4 R$ K8 D4 |* n# t0 W   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'
3 |4 [+ q! f# r
2 f) N( H1 S" C# wNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
8 B- ?( X: D2 A, `# f: U$ ifunction to do the same job:
# A2 a0 z  h* o' H3 j# q" a+ k( ?- a! K2 @, h* L
   push    00                        ; OF_READ& K2 d3 X  Z. |
   mov     eax,[00656634]            ; '\\.\SICE',0
8 U: \; G0 d7 n' T8 ?   push    eax/ Q6 V; u, G8 v
   call    KERNEL32!_lopen
- ~0 T5 r% ^* k   inc     eax
/ N0 z! m1 q3 V6 h+ m2 V   jnz     00650589                  ; detected
# C! p% k! N2 `9 k$ d1 C+ [   push    00                        ; OF_READ8 _7 m- U- j0 ?. ~: |: C0 T% G
   mov     eax,[00656638]            ; '\\.\SICE'
% R/ x" n1 F2 n8 f   push    eax6 E' E0 E5 z0 @9 f& R0 b2 ]5 N2 A
   call    KERNEL32!_lopen
* V& n" z& h# J) N, ^( k# J   inc     eax: v7 p9 R) B6 G1 M' W
   jz      006505ae                  ; not detected) j. ~" S) [9 g8 U7 \) m
8 B4 j& W7 k+ R# K' S8 Z
% o9 ?8 i6 i# k- ^+ i
__________________________________________________________________________
  i  A2 o0 ]1 p7 n: \, E. I/ P% r$ @, L) ?
Method 12% c. ?  {& m3 L
=========8 d. e& q) c3 `  @* O1 C1 x# M2 T

; _) I2 i' V, K  Q  kThis trick is similar to int41h/4fh Debugger installation check (code 05
% A' H) A$ {* x1 X) P8 v( K&amp; 06) but very limited because it's only available for Win95/98 (not NT)
* m& I/ p+ O* p) ?as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
+ e8 C1 p( m  ]% u8 ?" v
* t5 e+ M( l0 ?# D: E5 k) L9 b  i  J, ~   push  0000004fh         ; function 4fh5 p8 ~: u. E1 A* N
   push  002a002ah         ; high word specifies which VxD (VWIN32)3 C) s! G! a1 G9 O4 t. n, b; D  d
                           ; low word specifies which service
/ b- F2 _' N1 Q% [0 f/ ^( ]                             (VWIN32_Int41Dispatch)
9 q' T: G% f; X" P  U: p% k6 K4 I   call  Kernel32!ORD_001  ; VxdCall
9 ]" S4 f* @: _* g   cmp   ax, 0f386h        ; magic number returned by system debuggers" U& ]* w$ {5 j5 k
   jz    SoftICE_detected
; X) ?7 v9 V6 V0 u$ Q! J- A# w+ z% q( m: n1 m
Here again, several ways to detect it:$ D) a. H' X4 A( l

6 ?1 \4 ?5 ^& h& ~5 L    BPINT 41 if ax==4f
, g( x2 B3 b1 b/ \2 n; R% I: W/ Q/ e' O5 E3 L" t. P
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one
8 b, m1 u0 L( b  x2 H- I# W
* L8 y5 H' N% T' C& [. O! R0 d3 N    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A$ S6 Y7 Q9 S0 M9 g7 N/ r: x
3 D: L+ o% e$ m- @7 u5 O  m
    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!9 X/ @6 e3 `- ^7 z5 U5 j
: ]! Y$ e5 d2 A' t" |/ @
__________________________________________________________________________
% |7 F  W$ O, D& V
. k0 |8 V' z+ R- O& i; D+ FMethod 13
% {5 ~( r$ i! I- F; a# s. y=========
2 s! ^& [/ A  G9 O( e0 c/ r9 w
8 C& `' m' v: q( o  l" INot a real method of detection, but a good way to know if SoftICE is% @% @+ d' }  l
installed on a computer and to locate its installation directory.
; I8 K; W1 e" ~; O0 T7 gIt is used by few softs which access the following registry keys (usually #2) :
5 p" R0 Q5 [. [; H/ y
0 r" s# ?# P4 U' W) ?-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
% `; |2 t+ a8 J+ I, S\Uninstall\SoftICE
1 d. i) |9 |9 Q-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
" k* l& l% Y* b* m+ l$ N! ]-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion# A& Y4 d4 P; n1 @+ e
\App Paths\Loader32.Exe
! N; g8 D- M8 L8 n  o# `$ c9 b3 q" j- c

) }4 V& d3 G+ o1 ?2 g' t- TNote that some nasty apps could then erase all files from SoftICE directory& U$ o& [1 D! b4 X& e% B
(I faced that once :-(1 h$ J( ?7 g( P# X
/ u: ?, n7 q0 H$ F* {
Useful breakpoint to detect it:
1 f1 D( o* T2 k5 D& C
8 {- \: G* j6 O- C5 I/ O     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
: \1 ~6 a; s8 q. {! ?, u. W7 r  `7 p4 X# ^$ O, G
__________________________________________________________________________1 e9 d( R  [5 \6 h7 _3 M0 K
+ M1 c" e, V4 M6 c# x5 p- A

0 g+ w/ p( ~: x) N1 I3 E% WMethod 14
! L) _' R4 A: i( }  C6 Y6 h=========
8 L: a" ^3 J( A, P; s, w. t* |1 j3 ]5 y& j8 y$ m8 @! [! E
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
' R. M2 O# ]- y  uis to determines whether a debugger is running on your system (ring0 only).
  S* Y4 u& y" ]3 ^- Z/ w( Y5 |9 x& z: _0 F, B; W
   VMMCall Test_Debug_Installed! q0 X) s# f+ l, c3 t) R
   je      not_installed% s' D- G  _$ ^, n( j

) o8 D+ ?: \& X( @) YThis service just checks a flag., \. `* m4 v- x$ b- r' b7 u
</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-7-26 02:08

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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