About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>7 S& R$ h( i. M8 X$ ?
<TBODY>4 g8 C, h3 V/ l# Q- f- i
<TR>
; T% O- V  |8 \<TD><PRE>Method 01 0 U* X; Y! c) y. q8 f6 B
=========
+ ^; r0 |, e' D& d( P- W
4 m7 o7 A  f+ E; FThis method of detection of SoftICE (as well as the following one) is
! x, h( p* C6 c0 ~  ~5 yused by the majority of packers/encryptors found on Internet., L3 Y; m2 J( M4 F1 ?& h; b
It seeks the signature of BoundsChecker in SoftICE% o  m& L3 Z1 j) i
2 _; |, t9 Q, ~* {7 d$ K
    mov     ebp, 04243484Bh        ; 'BCHK'
! X) `1 x) y% o0 s' J2 ~9 N    mov     ax, 04h
3 @# d1 b  M# N& G5 R6 s    int     3       9 ^. M5 z; O7 Y; T0 I5 X/ b
    cmp     al,4
0 i8 t# |: b6 \6 C. s# {    jnz     SoftICE_Detected
$ y$ N! s8 r+ q; a# s7 Q
* X7 L, o" n/ Z8 P* e/ s& Q. _& j___________________________________________________________________________; p+ l' W2 V. E& b- t2 n8 [

" F& m6 v9 U' [- [# a1 ~Method 02
3 y/ G2 F) P9 M=========' ^3 B) [& B/ v" l  H$ w* W
: m6 b' r2 S/ W
Still a method very much used (perhaps the most frequent one).  It is used
+ c% [/ c& l5 b' ?. sto get SoftICE 'Back Door commands' which gives infos on Breakpoints,( Q, x! d; v6 w; J
or execute SoftICE commands...
) m  x5 ^% `7 S3 O- H$ qIt is also used to crash SoftICE and to force it to execute any commands
+ V; ~+ b1 |0 w# \# _1 S# w& S1 d7 L(HBOOT...) :-((  
! X8 g' ?8 T/ F9 d1 p* f; K. X
% A6 ~0 B2 e6 ~Here is a quick description:
1 D+ Y7 M9 H! Z: s1 I, }-AX = 0910h   (Display string in SIce windows)( |: s) Z) S% n5 o$ Y
-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)
, [! m; B: ~* O-AX = 0912h   (Get breakpoint infos)
2 Y: }1 K7 @/ e) t. v- z-AX = 0913h   (Set Sice breakpoints)
8 n: g. O8 \# h/ ?" G-AX = 0914h   (Remove SIce breakoints)
* c+ C# P. ?6 ~0 F5 p/ h7 V" x4 L% @; B  r% M( J( K2 a+ F+ I
Each time you'll meet this trick, you'll see:/ x7 N  @0 z% v7 r, e( d# ]6 e
-SI = 4647h
- @% l6 a% ~# H8 }9 V-DI = 4A4Dh
/ c/ p0 l- S5 a( qWhich are the 'magic values' used by SoftIce.# m5 j) m+ q. m
For more informations, see "Ralf Brown Interrupt list" chapter int 03h./ Q' c  T+ u4 I
4 [& p' ?7 I' ]0 t
Here is one example from the file "Haspinst.exe" which is the dongle HASP2 s! m9 `6 G9 t2 t' H( q! n8 r
Envelope utility use to protect DOS applications:
) J; `( l6 f* t: ~8 r; Z1 y- X/ ]% b/ v! A$ n3 c  m+ d

" \: B/ `' q2 l  C1 {4C19:0095   MOV    AX,0911  ; execute command./ x3 r0 T; \' o' r2 U- X" R4 B
4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).* l6 J5 H- L, s- }' b9 P2 c
4C19:009A   MOV    SI,4647  ; 1st magic value.! ]" n, B8 ^+ f* i! v
4C19:009D   MOV    DI,4A4D  ; 2nd magic value./ p. g7 c$ Z6 Y- @2 u1 a
4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)* ^* k+ d3 O" G' C0 |8 s$ W
4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute
2 J1 K7 B8 ?0 b* e8 w/ F4C19:00A4   INC    CX. Y' C+ }3 f$ S9 K' _$ I
4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute- Y, ]0 \4 N/ e- M
4C19:00A8   JB     0095     ; 6 different commands.) L  D/ I* u3 \# T9 H+ ]
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.0 ?8 E" s2 x7 A2 d( _
4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)( s7 s2 C1 I$ \

, r: t' |% y) s# }The program will execute 6 different SIce commands located at ds:dx, which2 R2 p; v5 j1 b5 A: f
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.6 Z4 F; v, D0 Y' s8 W+ D
* }+ L2 M# o& L* r! F( p* P& a
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
. {" `5 s, \! V2 F5 M___________________________________________________________________________
2 v4 l# A  m( d5 p3 }
  v. ?% l: G2 m* U. x1 y7 a
" `8 j5 E" y) \0 eMethod 03' \6 q  y/ d- N: k
=========9 e7 E9 O. Q: ]% s& \
! ~/ G. s) q- ~2 R/ [! T3 x
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
% C$ x5 v8 J+ l* q6 G) B(API Get entry point)
" Y. G0 O6 H, c* |9 N( Z, X        
' ^" U5 j/ k; ~2 e8 l) V7 T( W) h$ E! ?( i
    xor     di,di
7 @0 d( J8 a2 g: v+ O2 F$ e    mov     es,di. h) v1 r, S7 j2 Z! C
    mov     ax, 1684h      
! E6 }# B- |7 l' C    mov     bx, 0202h       ; VxD ID of winice
  ^1 k  d. K2 Q# W* v) l+ U9 T  u    int     2Fh; n, t" B" U  m) n# x+ ^' m
    mov     ax, es          ; ES:DI -&gt; VxD API entry point
' ~! |* A4 [; \; s- ]    add     ax, di- p  |* N1 w) Z1 ]
    test    ax,ax7 H& I: P2 D7 w. N; |
    jnz     SoftICE_Detected
! X( Y* }9 R' }  Z% f# g8 D' o* [" x& B" l
___________________________________________________________________________4 R* [. x! g- @  w7 v  p- z3 `/ N
9 P1 ~/ L, v3 N2 y' `; R
Method 04
" @. J5 k: F* C7 x* B0 t=========* D% c% }+ r$ R

# h. Y+ B5 P( gMethod identical to the preceding one except that it seeks the ID of SoftICE
: c# y% j: }/ p  d3 w/ kGFX VxD.
2 q+ `) _4 ^7 _# K) V8 [
8 U+ x+ X7 i( Q/ a1 u1 R6 O0 r) `    xor     di,di% E% F( p, d5 i
    mov     es,di
+ U' Q, c- g& s5 k3 D    mov     ax, 1684h       & N% z9 _6 X, @- y; J9 S$ d+ D
    mov     bx, 7a5Fh       ; VxD ID of SIWVID. O( q$ h; U* l: f% T6 b
    int     2fh  p* V/ y6 G7 l
    mov     ax, es          ; ES:DI -&gt; VxD API entry point
. i4 _4 S) H7 S    add     ax, di8 k- d; X* q: x3 ^: f! C. i
    test    ax,ax
$ @" D  B/ j$ t    jnz     SoftICE_Detected
! @" \6 ~  }9 _) }
' q3 \) U. y7 Y6 T* E2 a__________________________________________________________________________4 t  I+ k+ @! `. e% N
0 [# ?9 {  H( o
% J, S4 z( a$ q' l
Method 05
1 V8 l& a4 [  D: i" y=========# s1 F: `/ v  u5 Z
  Q. U& \% Y6 g+ Y% r
Method seeking the 'magic number' 0F386h returned (in ax) by all system! H; P  `/ r) H0 a  ~6 `
debugger. It calls the int 41h, function 4Fh.
' V/ M) U. H4 r# B* N! Z" X* X. wThere are several alternatives.  * }' }: Z3 U. a( l

4 Q3 `' z; e. S: M; kThe following one is the simplest:/ l4 J$ h* t2 [+ h2 ]3 a

7 u5 L+ m  S& o3 _1 f9 X    mov     ax,4fh& r# u" `9 Y: C% E8 W
    int     41h7 t: ?) e. U6 Q2 I8 B" n+ Y
    cmp     ax, 0F386# o+ _& ]) ?" q; z8 r3 t/ k- C
    jz      SoftICE_detected
7 O7 r/ a1 w" x& l) s" h+ E2 {, q% q% M' c" k! i$ F
  H& O1 J, y7 \/ t/ P5 I
Next method as well as the following one are 2 examples from Stone's
: _/ v  A  D) o1 ^5 r/ [  L+ u. F% V& u"stn-wid.zip" (www.cracking.net):5 X7 o' y# `  @8 m/ v6 [* s

' {1 i# s9 P- E, ]8 _) v( G    mov     bx, cs
8 E0 D( x8 z$ i* F5 I( n3 H% Z    lea     dx, int41handler2
8 Q; ^% F6 J" i8 F; P& f    xchg    dx, es:[41h*4]
1 z* a7 C1 K$ {$ b- J    xchg    bx, es:[41h*4+2]
2 b  i: b. g6 \; H4 V8 [: s' T    mov     ax,4fh, X; n( \4 t! U/ P
    int     41h/ r3 Q; `1 r! J5 J% d: A" e
    xchg    dx, es:[41h*4]
/ k2 ~0 K9 I5 F( H/ f; E    xchg    bx, es:[41h*4+2]
2 v6 W  p; e" A& s    cmp     ax, 0f386h
' _7 K( `2 Y; x* x6 F7 t. B2 Q    jz      SoftICE_detected
3 ~, H3 {8 q" S8 ~) k! Y. X# e$ ?' ~
int41handler2 PROC) f9 a1 I% G/ D
    iret7 S3 Z1 C7 g6 Z4 {4 B5 j
int41handler2 ENDP
8 [( G* ^4 ?( g7 I
" ^8 I5 [2 V, T$ ]! b7 y6 _
3 U. {' h' O, A_________________________________________________________________________
2 K2 @" U/ E$ u& f) S3 Z% ?
  W: l* T7 C( `7 V) X0 p& S3 L" W( D  S* P
Method 06
' i0 l: B: H. l1 l; W=========7 V- ~. ?* G0 U

& ~6 L* J+ T- k% J3 {8 ?; `0 q- n0 o! @' s! h+ X& C
2nd method similar to the preceding one but more difficult to detect:# c* B" ^" T+ i
' V. S- }6 K4 z  }  f
) a+ o- g1 Y3 g/ J/ X
int41handler PROC7 {, B. S! V1 q% T2 ~. S+ d4 ~# I
    mov     cl,al
$ U# H( p( C. k0 T, o# h    iret% ^  s6 i1 c4 _0 d* \
int41handler ENDP
% r1 x% r, E2 k) ~1 u" {6 T- I: z' |1 }0 S  ]- R+ c% T) L* [, r

  V& W5 E: @4 d! M    xor     ax,ax
# Q& d, h) ]4 I- I- Q4 Q* M2 R* u    mov     es,ax
  b6 [3 w/ _8 M# Q    mov     bx, cs! f) K0 K) m: ^% R2 N3 K2 T
    lea     dx, int41handler
0 h8 V1 v, O8 N& y/ }    xchg    dx, es:[41h*4]
5 I2 U- i+ ~8 w. K% l" [0 A  X    xchg    bx, es:[41h*4+2]
" }+ j: |% U( Q8 F6 C    in      al, 40h3 ^& w7 K& o6 L/ [' C% ~8 P! J
    xor     cx,cx  l; O: D, s. j/ W
    int     41h% r3 S2 t& n" k7 t" p
    xchg    dx, es:[41h*4]& I7 K- |& D3 \0 ~; g
    xchg    bx, es:[41h*4+2]1 g. ^# H, A/ }5 I, u
    cmp     cl,al) v" z7 H; d$ }# x$ [8 ?
    jnz     SoftICE_detected
9 U& `7 m- T: L7 ^5 Q
1 s4 b! N  h+ b3 Y, x6 b_________________________________________________________________________  d- t* M$ H& ~; Y; |! ~! j& x- e
( T% |  `, g* M! n; E
Method 07
' j( E! [! a. c$ g6 t=========
7 z% X% z6 t3 s, Q+ W6 A' j/ ~0 P, v5 \
Method of detection of the WinICE handler in the int68h (V86)' F0 Z- n2 f8 F" G: E% [- i1 t& e/ T
) y$ C3 w8 l0 A+ i' }
    mov     ah,43h. K- F9 z9 r8 J1 f4 E  A7 h' k
    int     68h
( m( m9 u2 M0 i8 D' l0 P% S* I    cmp     ax,0F386h! M6 z4 H: W- K4 X$ S6 d
    jz      SoftICE_Detected# O# u0 o2 g  f3 c& `8 \7 ]7 d
. Z5 b( J( w- Q- @& ]/ X+ X+ S
. n5 s! ^( e4 f% h, T9 b
=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
2 @" v. @& f' f8 X   app like this:
6 x6 X3 X5 ]7 ?5 h5 S* H. k: q0 v9 H* j, ?2 ?% D" P
   BPX exec_int if ax==68, b* \. p! \- t0 Q# V  N+ f& g
   (function called is located at byte ptr [ebp+1Dh] and client eip is
( I. g$ k. d* c4 C5 z   located at [ebp+48h] for 32Bit apps)! R2 h: m; L0 q
__________________________________________________________________________& f- C, [# m3 \1 E9 K( d* E+ q& N
1 x5 Q& P4 t) |

( C: c1 V5 n) [& r+ \) N  N( o1 D) _Method 08$ T( u/ s! s& F/ F
=========, }# j' g9 E8 G. Q2 a" \6 f
1 t% L: V3 A4 X
It is not a method of detection of SoftICE but a possibility to crash the
: B# Y9 X8 ~# I5 ]3 q& Ysystem by intercepting int 01h and int 03h and redirecting them to another
3 g6 o1 Y8 c  L% A( E( broutine.8 M8 M! R. h( J% w- H* A
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
9 V% v) C7 d. M4 V$ h% tto the new routine to execute (hangs computer...)7 a# c9 ~7 W  t3 [+ C2 |: W

0 C' b) R, t1 F" F7 |1 p    mov     ah, 25h
* ]8 i( ]( _1 o3 G7 x) `2 ]    mov     al, Int_Number (01h or 03h), l: M' T) o# T
    mov     dx, offset New_Int_Routine
2 [, W: W0 @. X7 ]* {5 X    int     21h. X, G2 W" k3 G* _
2 y" U3 E% y) w3 V5 Y
__________________________________________________________________________* D, w: R) C% a, R1 l' ]# b! t% g! N! ]
. E; U1 R* ?3 O9 p
Method 09
; C: p" w% G. u2 X=========
9 C9 X, d& H( R% r) T( u4 @; M' y
! T) E& z% n& ~6 Q' AThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
6 W. T2 Z! c+ S" Q% lperformed in ring0 (VxD or a ring3 app using the VxdCall).
1 Y! q6 ]" j; S) b  T; yThe Get_DDB service is used to determine whether or not a VxD is installed- p0 r" {  r9 ]
for the specified device and returns a Device Description Block (in ecx) for* c; @4 R  N) j) H8 l6 p- J
that device if it is installed." ~# k3 w- d+ d  u
- K! k, m. I% B; t: R4 m
   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID
  A$ L$ m3 I) h$ |' f   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)$ _# K* A% Z8 `- k* J4 S! L
   VMMCall Get_DDB% _# Y4 Y+ i5 G+ D0 [2 K
   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed, U. ~, I2 f# a  e$ u( X: R

( x& g, F  g9 B7 uNote as well that you can easily detect this method with SoftICE:
1 w4 y' [3 C4 Z. |6 ]. f   bpx Get_DDB if ax==0202 || ax==7a5fh' `. q( g! u/ S( S

/ D3 k" W6 B" s2 U__________________________________________________________________________
+ P$ L9 G( _3 _( @* {& L
6 s9 D, @" _1 M7 A  n( W8 t( Y1 T$ [6 zMethod 10
+ m" V) s# Y% ?* d7 d* @3 U=========
0 p; b9 ?2 g, J" ?- R( T7 h
% }0 H- d8 H8 F9 |=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with
: _- g7 h& n. t7 N* D  SoftICE while the option is enable!!
. B: i: I' v" {* I; \2 C! d0 z6 c4 C8 C* o4 _$ I8 ?
This trick is very efficient:
. F8 I; a3 P. Yby checking the Debug Registers, you can detect if SoftICE is loaded
, T) ^7 [! \/ R. @(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
. o1 l  x5 j* N, P$ Hthere are some memory breakpoints set (dr0 to dr3) simply by reading their
3 g/ m, P3 N- s4 X; m; ]0 p+ z: Yvalue (in ring0 only). Values can be manipulated and or changed as well
8 ~( k" N: t( D# }3 k(clearing BPMs for instance)# V) r- F# G4 }" s5 Z5 ?3 k* a
) _; I- c4 s" P
__________________________________________________________________________. C8 l* y% c+ q* ?. m

5 N6 ^$ S4 I  _* y9 SMethod 11
6 Z0 T& O+ [0 w5 b0 w# R: q) Y=========
) u# Y  O8 P+ O& P0 m6 b
. @. {$ Y4 C8 WThis method is most known as 'MeltICE' because it has been freely distributed
0 c" B! N+ v+ C# Bvia www.winfiles.com. However it was first used by NuMega people to allow, H* w) T$ l. B: `" @' q
Symbol Loader to check if SoftICE was active or not (the code is located; [3 S% j% ]7 h* Z5 `, A9 O( d0 M4 b
inside nmtrans.dll).; a. q+ @! o3 s2 j! p. B: s

9 \0 Y1 O' F7 g% I* UThe way it works is very simple:, h: R1 a: N$ w1 _' K$ m9 x
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for: X* X8 c4 a3 [6 A/ V
WinNT) with the CreateFileA API.
5 v/ v  [# g8 M2 U6 S- P  Z* U% `; P8 ]: H) T  {
Here is a sample (checking for 'SICE'):
& i6 }9 V8 y1 ]" h5 I( n3 @9 _4 r: I3 b% s
BOOL IsSoftIce95Loaded()
2 i/ _8 P2 f- @, h8 e' N' }{
. a1 ^, u, N4 N" N, @   HANDLE hFile;  ! Q3 i7 |- f2 e; \+ b
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,7 Y. E0 |( `! f  H* [' [
                      FILE_SHARE_READ | FILE_SHARE_WRITE,# W8 P- f5 X) V/ E- h# y/ g& T3 q
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
, P4 z. @/ ?) C! c( @* M- O8 R7 ^   if( hFile != INVALID_HANDLE_VALUE )$ k- _  x  H2 K$ \/ Y0 v; k% A
   {: L, @7 k7 X( I% z6 @& m2 e
      CloseHandle(hFile);
) P7 t" C" m& I0 p4 O4 q      return TRUE;! R, J' n! A4 k% |& h, Q+ q
   }% S8 X5 q$ }; A& O6 a* I( i
   return FALSE;
; Y" {: d: `+ I  A9 G6 M0 P}6 K; K6 g( S. f' K# ]# D  _

. K# F& p0 p, Q) e4 NAlthough this trick calls the CreateFileA function, don't even expect to be; C, Q+ W0 c1 q
able to intercept it by installing a IFS hook: it will not work, no way!
( R) V6 i' @( H$ q) `6 B+ tIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
, T# ?5 y4 s! h8 f' ]* vservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)$ n2 @& K2 t# ~/ Q, p* n' O. l
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
) F: p4 |' [+ [, O; {! h- K& ]field.
8 q6 i7 Q: y1 f' jIn fact, its purpose is not to load/unload VxDs but only to send a
5 o8 h) y8 d& q3 B3 F( b% \W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
; g3 u: b3 p1 F, s: y0 _) Cto the VxD Control_Dispatch proc (how the hell a shareware soft could try
+ C, Z& L- q% o' H$ Bto load/unload a non-dynamically loadable driver such as SoftICE ;-).& ?: \# N. j3 K" e! G6 U
If the VxD is loaded, it will always clear eax and the Carry flag to allow3 R: c5 A1 ^3 i: t' |9 w: R
its handle to be opened and then, will be detected.. B2 E1 Q$ K5 ^. L! s: E1 O
You can check that simply by hooking Winice.exe control proc entry point
* \  D( h. X8 }( h: o7 p8 Twhile running MeltICE.
( F9 ]" q" k6 M# E0 M& d3 h
! s7 {; `; {9 S! {7 R. r: y. Q% ?3 y
5 o. t" X3 x& |1 n# A  00401067:  push      00402025    ; \\.\SICE' [. y" L7 N; J2 Q2 K8 r* ~
  0040106C:  call      CreateFileA
+ K2 \6 A5 ], }. Q- u4 \0 v. T/ x  00401071:  cmp       eax,-001" N- A$ N  E9 U- Q: Y
  00401074:  je        00401091# O! C; A. V: N* L' o, M
* L+ c6 W! p& `, T& n& N

7 ~# X2 z+ ~6 G& c. ?& RThere could be hundreds of BPX you could use to detect this trick.+ _0 B9 M% ~5 U6 ]* C
-The most classical one is:
+ v3 d1 ~7 _, j. u/ A# Z; a9 m  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||( j4 [8 E) }  i! o$ ^# X
    *(esp-&gt;4+4)=='NTIC'! n% o" x) I. D. t4 v

" z$ V- c$ z) F% P7 |$ n-The most exotic ones (could be very slooooow :-(3 F& t2 a( \3 i6 H0 @
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  7 {1 }+ a) a, h5 y& U
     ;will break 3 times :-(
/ W8 G  d- Y4 P% G
! T  F- ^! F+ f; d  F" Z-or (a bit) faster:
- F% a  P6 W( y   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')0 w: N  b7 N9 w5 {/ u

6 `- E5 m8 I+ o8 R" R   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  2 ?# I* }9 h9 p% p
     ;will break 3 times :-(
5 o1 J) ?0 u# U5 K2 A2 u
4 x2 L* {& h& }2 Z-Much faster:: O6 B* u' Q, P, b. L6 T* H9 R( e3 p+ t
   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV': R( F/ o" h& t& k
8 s- c6 w% n. e# w
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
& V1 c: `5 Z/ w$ ^: n, }% g: q4 Lfunction to do the same job:
* P6 c% [5 I) F" d
" ?3 G4 f" h6 @. x% M% ~   push    00                        ; OF_READ. J+ b, W! a; ]! n
   mov     eax,[00656634]            ; '\\.\SICE',0
6 ~( w1 d% ^. y) _- T3 J   push    eax  W$ u3 ]: H& g+ {$ c+ d
   call    KERNEL32!_lopen
0 b/ C" E% b2 c' Q% ~3 V   inc     eax
+ j! W6 Z  x7 b3 x   jnz     00650589                  ; detected% S. e5 f3 z4 y" ~/ ]' A
   push    00                        ; OF_READ. J) {' m6 o9 Q1 _6 Q+ V" N4 R
   mov     eax,[00656638]            ; '\\.\SICE'
) ?6 N: o- Z5 z9 V   push    eax. ]$ y' N9 X/ m  T5 s
   call    KERNEL32!_lopen4 f* f$ b, V; m/ k% V
   inc     eax
; ~1 j  @/ H$ Z0 m6 N0 g5 a   jz      006505ae                  ; not detected8 w# c0 T1 l# E: o# V- S" g
6 a* N; T( D3 ~' f+ H

7 ?8 y& ^3 o* a. q2 b  [__________________________________________________________________________
. d" t% u0 k2 L  z' P' }( {8 [, v5 G# M/ B
Method 12
& S6 r0 g! e6 ]! P! Y! W# d( J=========
# ~1 f5 {$ N8 f- h; g$ z
& w4 m6 k) i: L" Z# |3 VThis trick is similar to int41h/4fh Debugger installation check (code 05
1 f$ j/ N! T: B1 c- V$ K$ }# k7 e&amp; 06) but very limited because it's only available for Win95/98 (not NT)
( ^  |! \  j) k) a& @as it uses the VxDCall backdoor. This detection was found in Bleem Demo.$ @$ M, T" P! T9 W) L( E& |9 T# {! L/ `

# e/ b  h% _5 s6 ^- T4 f; h0 J   push  0000004fh         ; function 4fh/ Z2 Q  W0 ?0 F: D& n7 x, `$ R
   push  002a002ah         ; high word specifies which VxD (VWIN32)* N- w/ X6 `/ T) e3 ~5 k" W0 R
                           ; low word specifies which service; b* ]5 q, h" J9 r( w3 b( e: ?9 B
                             (VWIN32_Int41Dispatch)# f+ C) ]6 o6 p
   call  Kernel32!ORD_001  ; VxdCall
0 i$ a: M: o: r8 c( ?" K   cmp   ax, 0f386h        ; magic number returned by system debuggers
' r+ J1 T% _4 Z$ U   jz    SoftICE_detected% I8 n( Z) w2 I

8 J  P" E8 Z9 y9 J( I$ n5 c4 pHere again, several ways to detect it:5 ?0 G' ]' n. e5 m0 z
! @$ L/ {0 x$ T( Q, Q
    BPINT 41 if ax==4f7 E$ d* i# P9 e' }0 ~1 X: K" l
7 l! l; [5 Y2 m* o/ u
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one
, }- \3 n) |# x& x* I
0 }& C: P$ y3 r    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
; L  l2 z- q/ [; g8 s
* b( E/ Y; E$ l    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!
3 H. |2 q; t/ r( L
7 V' f, w0 K  n! z__________________________________________________________________________5 n1 N6 a+ F$ M( F1 v
; y$ o% W% C! j$ o! h3 r
Method 13
( D4 q4 W1 p# V, j=========$ X" `+ k. S# d# q% o, A3 q

9 k2 K$ x. {! O0 M" m6 ]6 INot a real method of detection, but a good way to know if SoftICE is
" C/ W! G/ C4 M8 M; |( |; M9 a, Winstalled on a computer and to locate its installation directory.5 f) o# n0 e# R; M, s1 x! e/ B
It is used by few softs which access the following registry keys (usually #2) :
8 m& F- V/ |1 ^) s0 k
" ^- s8 f# p: r$ @) J- X-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion  w- a/ }% H2 i: k3 W& v- Y' [
\Uninstall\SoftICE& n( t+ K6 s1 @1 a! u
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE7 p1 {/ v) H; ?5 L/ e
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion. ?- g1 K( g2 ^2 d+ m" p1 W
\App Paths\Loader32.Exe
/ n! y0 e, S# Z/ f  p! ?. y% f% Q' m
- O3 w' c( G6 z; h! I4 d
" K# A- G. c' ?5 ?0 aNote that some nasty apps could then erase all files from SoftICE directory/ ?+ m& J$ T1 f# M/ f; s. Z
(I faced that once :-(
# w0 S0 @* z+ ~1 V$ [0 @# C5 w( V% G
Useful breakpoint to detect it:! |) B  |  q- t* p- ^) u

6 B: Y! N; o  m, r6 m     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
: r- D5 V+ C" i- z
, |. O) s) J) {" T% z  ^__________________________________________________________________________3 W. r6 R% o1 x4 o9 U8 m

3 x' _3 u& ?8 j5 D2 ?
- F7 _) z. a) g) L. _/ u! wMethod 14
9 N7 Z& g) B/ G% E5 B0 @=========# U' M" l/ y) ]: W

4 ?0 ?1 G4 a7 j. ]3 w% BA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose- o8 P. ]5 B+ A1 T
is to determines whether a debugger is running on your system (ring0 only).
  X, V$ w7 E. Q- Z
5 V2 }0 q* E6 `) n0 ^   VMMCall Test_Debug_Installed
9 \: x2 Y8 ]5 w# |: _   je      not_installed) m9 O  p  h  z, M0 T

% F/ w. p% W3 |+ C0 p* T; N0 pThis service just checks a flag.8 [# G) y" K9 B4 `
</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关注公众号

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

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

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