About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>: f! c# N( F, r
<TBODY>
6 }! P: E+ `& o( t# \/ _<TR>% A7 k: z, C' {0 e3 @% [7 J
<TD><PRE>Method 01 3 G! Z2 r( \( S
=========
7 z( |& E9 \6 J! `! \3 y. E' m1 Y8 G1 T% ?
This method of detection of SoftICE (as well as the following one) is) ]8 q, u& @3 ?' p
used by the majority of packers/encryptors found on Internet.9 j$ j" P! Q* y1 k0 e/ m
It seeks the signature of BoundsChecker in SoftICE
8 A6 R! k/ n' u! c8 u2 R' }  q! S7 q; v. m8 j
    mov     ebp, 04243484Bh        ; 'BCHK'' S& d2 q8 ~( o
    mov     ax, 04h
/ b: J$ t" B5 i3 [    int     3      
. L; n+ m7 h: t. z    cmp     al,4" O+ m5 M! z- w% |/ `: h
    jnz     SoftICE_Detected0 v4 S" W# p  Q
/ e6 [) P& H" @- }2 i) ~. x0 C
___________________________________________________________________________( T: J  |! |) Y% G

3 i4 e3 _: \& [% uMethod 02
( @# K1 H$ a( Q=========+ P1 G7 ~& M& a* E

4 D# j" m& |' u0 |( M5 qStill a method very much used (perhaps the most frequent one).  It is used1 ?$ Q( r5 ~; l) `7 z5 E) D) M0 k
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,2 v# D' N3 a1 P# D6 d
or execute SoftICE commands..., f) A  q; Y& k( Y
It is also used to crash SoftICE and to force it to execute any commands. ?; A/ v8 x( k2 V+ Y  }. Z+ U
(HBOOT...) :-((  
( a0 L7 ~4 _: R8 t+ S7 C& z2 u$ ?# @$ i
Here is a quick description:3 g4 ^5 J5 q0 g( X+ d
-AX = 0910h   (Display string in SIce windows)
  o& k6 |+ @3 C- N) z. P-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)& a: V! ?1 W1 K0 c
-AX = 0912h   (Get breakpoint infos)  @1 C, @! d3 g' V+ g: y
-AX = 0913h   (Set Sice breakpoints)8 D8 w! C# ]5 p/ e6 W2 Y: X  E
-AX = 0914h   (Remove SIce breakoints), \2 D- P& p) {! ?2 t

' p" c- H- n6 t+ q+ gEach time you'll meet this trick, you'll see:5 u" f0 k; ^/ g/ n5 i" p
-SI = 4647h" `: u& Y6 o) [. `" N+ y
-DI = 4A4Dh: r! Q3 t7 r1 u; a
Which are the 'magic values' used by SoftIce.
. c* R3 h5 ]) i( i5 T! LFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
- G) R  \% Y# R6 y7 e4 W" n9 x! I- k% N* g
Here is one example from the file "Haspinst.exe" which is the dongle HASP% |% f. E/ X# }4 s- I/ Z6 `, y) B
Envelope utility use to protect DOS applications:
! p, n6 c7 r5 b, k3 d$ ~) Y2 R# M5 s2 x) @( h
( V+ A- d- k9 {* R2 y. X+ @
4C19:0095   MOV    AX,0911  ; execute command.
$ Q* h, V2 _0 T  J4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
/ h/ g+ ~: K3 m6 G4C19:009A   MOV    SI,4647  ; 1st magic value.
. i" k' T0 z+ n+ R4C19:009D   MOV    DI,4A4D  ; 2nd magic value.
0 ~: v6 @$ ~3 Y8 U5 E4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
2 K  A1 R7 B0 k4 Y  W& c2 u4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute& S% N  u- `) W5 o. T. }
4C19:00A4   INC    CX
6 Z$ k1 R9 g& y$ N7 `7 T. }5 i4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute- C* {5 q8 v9 L: X, D* N
4C19:00A8   JB     0095     ; 6 different commands.
0 p- O3 ~  q7 K1 X3 E5 K6 }6 @0 d4C19:00AA   JMP    0002     ; Bad_Guy jmp back.. w4 r* f5 j6 E; Z
4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)$ A) L, J' G; Z3 k' @8 y' g+ d* y9 `
% Q  [# ?$ ^0 n
The program will execute 6 different SIce commands located at ds:dx, which
5 q, i6 c6 \. w% p/ V+ k2 }are: LDT, IDT, GDT, TSS, RS, and ...HBOOT." l6 S$ ~' ~& b' d: K

- y, G: V" d5 p' l/ E9 C. d* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.% @6 H/ w1 m( B" n8 s. `
___________________________________________________________________________
5 |. d0 C8 N, m3 F8 u
0 }5 A- p) G$ W7 [! B0 v- `2 c0 U( ?- z# T/ n0 w, k
Method 03! h, Y/ v) {0 s  w, G  ^$ ]9 a+ B* C0 O
=========, l2 F1 O0 N5 Y7 W

! |+ L$ a0 @( S9 ^Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
' B) z* I, W/ T* T* R- B(API Get entry point)* Z7 D; q, \$ O* k0 V
        
' P8 k9 s6 b& J8 u- @3 b) O7 @  G9 _; {5 `+ V
    xor     di,di
/ j5 t9 ~: L! G* I    mov     es,di
8 w  P# m7 G6 G' v" C0 N" n8 f3 I    mov     ax, 1684h      
" u  \( E; G! \, G    mov     bx, 0202h       ; VxD ID of winice/ q/ F3 g' ~5 _  B. a
    int     2Fh) d% E- b, W# k" S# \3 L* ]
    mov     ax, es          ; ES:DI -&gt; VxD API entry point
; ?1 N: v+ I9 Z$ m0 U4 G    add     ax, di
2 w& S; \6 U7 v- b    test    ax,ax
# |& {# w1 z' p6 w2 g' z& v    jnz     SoftICE_Detected. K( I3 |/ @9 y
/ c1 \. H: e% T3 U" D! m. ?9 T
___________________________________________________________________________
6 G" k* P4 T: h& u8 Q* v) d0 Q3 M) k2 w
Method 04
( l" ~9 p( T4 P: e. N  B# D=========
9 Y) f1 {- [. j6 P2 p, p  U; r
Method identical to the preceding one except that it seeks the ID of SoftICE
5 |: ]( {2 d7 P+ @) a, f2 K" t, T6 ^GFX VxD.- u% g7 \9 a0 x/ k# N+ V+ w
! r1 m4 g8 x" s8 f$ e3 R
    xor     di,di
1 z6 J. P9 o+ Z4 v( g1 h    mov     es,di0 [4 E5 D% _5 @' u  Z
    mov     ax, 1684h      
8 R$ `3 t3 M3 T+ i9 ?) n- F# c6 _    mov     bx, 7a5Fh       ; VxD ID of SIWVID
% H6 [! ?1 m& Q4 p& y4 U' N    int     2fh! k% l9 K. x+ T2 l7 i" o2 U
    mov     ax, es          ; ES:DI -&gt; VxD API entry point) C* D+ p% H9 p5 D
    add     ax, di
+ q! T4 `: O- `& C    test    ax,ax& S; o0 k6 X/ }5 G2 j; Y
    jnz     SoftICE_Detected8 e& D1 P, k8 x+ X

9 R% c: {  K  V4 _! B) t( {2 g__________________________________________________________________________
0 E" l/ A9 }* A3 @, \- S1 ]/ p

- [& l" H, [9 A( g4 Q, p2 CMethod 05
5 Y" k! Y+ e8 S" J) x! S, Q=========* A3 m8 U' t3 @4 ?, r0 r
0 M% E- g: v9 N4 k( U- O
Method seeking the 'magic number' 0F386h returned (in ax) by all system0 G% a! `8 [. w' [& F
debugger. It calls the int 41h, function 4Fh.
3 t3 f" @5 w; B9 N& HThere are several alternatives.  
7 E) _* o- w% k7 i; H6 e' x; N& T2 Z+ T9 [$ i$ M1 t0 Z
The following one is the simplest:
& S" [5 P& C9 ], C6 g: f5 K2 H' t) @& }9 Y7 G+ M- g& U
    mov     ax,4fh
6 d, j1 H6 P/ h6 Q) p    int     41h7 Q/ w. I5 U1 ^  h* W- h0 I
    cmp     ax, 0F3866 i- I+ ?( Z8 v  W* \) U6 Y
    jz      SoftICE_detected% r. j: [& _1 p4 j. b. H

7 K5 ~! q/ h4 `. g0 M
# ?2 ~) A4 z9 L+ ^- \; kNext method as well as the following one are 2 examples from Stone's : L5 [# x3 K9 t6 M( v, |1 g
"stn-wid.zip" (www.cracking.net):
4 a6 u4 d" P+ W2 g& ]; l1 `% ]) U0 V/ G1 C+ E' P; g5 U
    mov     bx, cs
% b1 m* b! T+ _+ H) E    lea     dx, int41handler2
5 i  f5 H9 e8 ]. H+ j, M$ g    xchg    dx, es:[41h*4]
+ B: B0 G! U! }% i, `2 P! D    xchg    bx, es:[41h*4+2]
/ B& ?& z+ e# b6 |2 I4 S: t    mov     ax,4fh1 i2 f. T( j, n6 ^( ]8 Y
    int     41h9 }% A; \) V% V8 C6 s
    xchg    dx, es:[41h*4]. |8 _: V% T4 D" s- r, B& q
    xchg    bx, es:[41h*4+2]
  ^1 `. }7 {8 r3 x) t, C2 b    cmp     ax, 0f386h- y* A7 Y  r- |3 }
    jz      SoftICE_detected
. u7 s/ ~" Q: h6 `7 V. O
% w, f/ f3 d5 k4 a. Y# H7 oint41handler2 PROC& j- G! a4 m( O
    iret% a. P4 S& n1 d4 K
int41handler2 ENDP2 c: K" \  D/ ^9 ^% s
" u- ~4 `% B7 D: a% N
  P. c2 \# m7 A* c" n5 {/ `
_________________________________________________________________________8 o2 u2 C; l8 M  i7 g

0 L3 w8 r; N# S1 H. H, w
4 I8 W/ B5 \- _! o8 z8 U3 I$ ?Method 06( E2 y7 K6 o+ I$ ^; E4 P3 C
=========' _9 R, E0 N3 z% r( \# S
2 ?3 ]3 Q* X% h6 y8 b

9 F; L; ?) r1 Z9 m3 x' f2nd method similar to the preceding one but more difficult to detect:
: _) v6 D0 V3 Y: _9 x# z6 R& b. z) Z5 i; K& B! Z0 f- [
! Z2 ]: a. S6 N& J2 W
int41handler PROC: Y- r% q  P% i8 Y
    mov     cl,al
2 d- t( D! G; A0 o    iret
0 f: {$ ]/ \3 [  h6 q# I' X) kint41handler ENDP4 k0 L5 S5 g" C- j+ |' F

$ K8 @# E- w0 e7 L0 }1 N# l6 B/ n% l6 l  e
    xor     ax,ax
- X' C" ?3 U6 S) L) c" J# p    mov     es,ax
" U% Q7 D! ^7 R  H$ W    mov     bx, cs3 \- L- K* W& [* V& Y7 ^2 I5 U
    lea     dx, int41handler' }- a& o1 t% L* h/ |3 n+ a
    xchg    dx, es:[41h*4]
( ~$ q( `; \( x2 ^# t    xchg    bx, es:[41h*4+2]5 A0 U. ?5 u) ]! s# V
    in      al, 40h3 l$ S# Y% M- H
    xor     cx,cx9 Y" M8 N' L, M- [: s% r
    int     41h
; Y( y/ k/ t9 i    xchg    dx, es:[41h*4]
5 {1 A: m5 M* f, f* G* Q    xchg    bx, es:[41h*4+2]
/ M4 @1 W% A, _0 B# n. |    cmp     cl,al
# G0 g3 S' V/ p. W6 E    jnz     SoftICE_detected$ F0 c5 V  ?. s+ q5 t

8 I% `* ]/ ?+ j$ G8 ?_________________________________________________________________________. T* H* d1 }- c7 c+ f. m

$ S$ J3 B/ o% `, L" N. d( uMethod 07
  s+ `" F1 j* j6 U" K- [; ^=========
, C; p6 }# ?4 x7 b0 p, y7 z! B/ u; ?) X9 ]" v
Method of detection of the WinICE handler in the int68h (V86)9 J( ]. z  f1 E- A* K0 e' r8 s
* v8 p* L- p! s7 c  w
    mov     ah,43h
' `) F5 }0 ~0 v6 H8 I  _4 l; d/ s, q    int     68h) M- O* l; C5 l
    cmp     ax,0F386h
9 C  A  Y+ ]! {4 {    jz      SoftICE_Detected1 r+ R1 U1 y" H
' c- l1 Q6 Q8 s3 ]9 X

' K  e3 f/ I# U6 V5 A=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
$ ]  r1 g/ P/ i  r, z$ R$ \   app like this:  y% R7 J* Z2 E! V% N: u

( [( K3 G0 M5 {3 x   BPX exec_int if ax==68
0 @7 i! L) g/ W/ S/ ]* A" J   (function called is located at byte ptr [ebp+1Dh] and client eip is0 i9 S% d1 G/ o% U
   located at [ebp+48h] for 32Bit apps)3 S+ H! x0 E% L5 m$ O# l1 G, H
__________________________________________________________________________
# Q) ?0 P. b7 W  f8 n, n3 `' `" x) w* D& O

, a- Y7 X% s1 g4 f- O  w$ w' W: jMethod 08
! J* k6 q# S# o  M; j/ z=========: `" W% x* c( d$ x" P: M
. J* q8 h0 w* N. {
It is not a method of detection of SoftICE but a possibility to crash the5 g8 D6 c* \( _' ^( f7 p/ q; i6 g
system by intercepting int 01h and int 03h and redirecting them to another% h" g$ Z" |, Q
routine.  y/ o' |% z/ C# y0 r! q! _+ K
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
0 a' I1 u9 a' nto the new routine to execute (hangs computer...)% k. U4 c6 R6 ?2 q0 l8 {$ u) g

% @. C) Q% A  K5 x1 ^' z    mov     ah, 25h
2 @5 N- N3 |5 [" ?    mov     al, Int_Number (01h or 03h). N( o! ?. l# E$ Z
    mov     dx, offset New_Int_Routine1 A' C9 w5 W# }. Y
    int     21h
3 k) v8 K$ \4 C+ k
! Q2 `  X* I) o2 F* P__________________________________________________________________________
/ t+ x; D/ \7 y
0 K+ [0 J$ Q( t" W# @Method 09
0 w$ d6 h% a9 s" ]/ C6 y% b=========7 c! z! ~2 m; w- M9 [
( g, u7 }" ?% J  {5 E2 y7 T$ ^
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only- S: Y. d1 ?. b8 C- v' X( Z
performed in ring0 (VxD or a ring3 app using the VxdCall).1 y- V3 c$ a) t' d) z, q  [
The Get_DDB service is used to determine whether or not a VxD is installed& K4 N& X" P8 t: o3 [' J& C9 ?: x5 K
for the specified device and returns a Device Description Block (in ecx) for# Q3 Z( i: n  d+ O6 K3 d) c
that device if it is installed.
$ D& v. E5 \- `4 q& N6 t8 j0 T0 m" X& M% A  s9 e- B% \
   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID  V' q& n" J! G1 q& ]+ r2 L0 H
   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)+ m" {7 ]8 I# M% K* ^
   VMMCall Get_DDB
) r7 U) C' n$ u8 I7 h# v   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed; G( w9 m' \! c& g, y2 n; f

1 p- @9 x% v* KNote as well that you can easily detect this method with SoftICE:
% x% h' F7 M  J( X1 C( V   bpx Get_DDB if ax==0202 || ax==7a5fh
/ C3 \: a* z, i8 o3 o
3 {  }; ?  G1 m' E) W0 q__________________________________________________________________________1 Q0 r5 J: w( i# Q/ b' V
; |! Q' A% o$ @: K6 P
Method 10  [3 {8 v- E5 ?  W5 \# P* `
=========. |8 W$ S+ ~' k/ j& a6 y

8 |7 ?8 S! b% b- h( ?; q2 {* E2 J=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with. z1 x: ?/ L- d( W2 E0 e
  SoftICE while the option is enable!!! I5 H8 r- M7 J

8 S+ q* h9 x4 l2 Q# R" K* TThis trick is very efficient:
0 H* l6 o% W( }, W* s& j  k' L" w& Oby checking the Debug Registers, you can detect if SoftICE is loaded
2 x: z' i( t/ O(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if6 c" B3 s! ~! e# ?! Q
there are some memory breakpoints set (dr0 to dr3) simply by reading their
2 X6 ]; Z. o! }8 w( j' t6 A* B$ C0 avalue (in ring0 only). Values can be manipulated and or changed as well
7 D0 q3 h: ^% d9 Y) w; y, X7 ~(clearing BPMs for instance)5 @( q' f8 D3 |8 ?8 }
5 S  f* {8 K+ X. w
__________________________________________________________________________
4 H+ F6 Q0 k" L! l5 [5 m1 p( I$ \) t& R1 d- f
Method 11
3 W1 F  j9 D" @" g* F) V: n=========! y+ g1 Q! @6 E3 ~; G: @
4 W! c# T7 w- ?4 e& Q
This method is most known as 'MeltICE' because it has been freely distributed
3 L0 _3 X( W6 j3 s8 C8 }via www.winfiles.com. However it was first used by NuMega people to allow
  M8 P5 b8 |: f" w9 ]4 QSymbol Loader to check if SoftICE was active or not (the code is located' q* b/ [0 H3 N
inside nmtrans.dll).  h) g0 [# }$ z3 F2 n" J, h# r
2 g6 d$ Q# J+ ^
The way it works is very simple:
& v) `0 x  h+ {( \8 K; |' Z" Q# |" gIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for  q# e3 z5 R. C5 h: z1 q
WinNT) with the CreateFileA API.% [& Z% t% F  c9 `& r) A

. y1 d. Z4 N. r' pHere is a sample (checking for 'SICE'):
# P: I. W+ Z, s& J( c' \9 s0 ]0 x* b- m$ B5 ~/ _
BOOL IsSoftIce95Loaded()
8 ?( D+ q# }4 R; L! d$ y, i, G1 m" A{
( m& y% q" p6 `0 [   HANDLE hFile;  
! N& ]- o5 a8 l! X   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
' `" k6 G( b% L4 v- x+ |% ~; l                      FILE_SHARE_READ | FILE_SHARE_WRITE,
3 h! k5 r$ J+ w4 ?/ k5 g2 ^. o                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);/ _/ Q3 V/ J7 ]% G; J; M5 c5 D- D
   if( hFile != INVALID_HANDLE_VALUE )! o; h8 d' p- G+ _! y+ N
   {. o4 z& J3 j( `* A
      CloseHandle(hFile);( a( @9 G% ?" G3 b' D9 k/ K
      return TRUE;- h# K) @$ s" u1 w* h4 y" X* I
   }$ F$ u  u6 u% G$ b9 G5 n
   return FALSE;) R  j7 a* m# l% k
}
1 {; H# D! `% ~0 ]+ n, G& U2 h. e
Although this trick calls the CreateFileA function, don't even expect to be
$ L% i$ r, I( x9 Rable to intercept it by installing a IFS hook: it will not work, no way!/ _7 H# Z- P/ L# P2 V5 m0 D
In fact, after the call to CreateFileA it will get through VWIN32 0x001F' _& g2 U8 K# h6 p, d! Q- ?
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
. X" {2 t+ K( A% b1 ?5 ]/ t/ H4 Tand then browse the DDB list until it find the VxD and its DDB_Control_Proc
' x3 ^8 [1 j7 o0 w$ b3 g  H& J/ v, ?field.- ^+ a" G. I: v! R8 ]9 Y
In fact, its purpose is not to load/unload VxDs but only to send a 0 t! z. q; S1 \/ \1 \9 l
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
" P# O! {' t% fto the VxD Control_Dispatch proc (how the hell a shareware soft could try
! @( D  z& x' B& dto load/unload a non-dynamically loadable driver such as SoftICE ;-).' H* V! [" n$ F3 Z, }6 @' ~7 V
If the VxD is loaded, it will always clear eax and the Carry flag to allow4 f9 P: R! T+ d
its handle to be opened and then, will be detected.+ ~  D; E/ I/ O/ A  Y
You can check that simply by hooking Winice.exe control proc entry point
% _) ^( y, c5 g2 N2 y! ewhile running MeltICE.
& m1 k% @! W, s' E$ A/ I+ j+ Z- v, c( a! t, a* ^5 C

1 q% {& o: e- G# p/ S0 n  00401067:  push      00402025    ; \\.\SICE' }) R6 N) R' h8 T- l  E5 e
  0040106C:  call      CreateFileA
) L; G2 E% ]% N1 B5 o; }  00401071:  cmp       eax,-001. x  v3 w7 t% i/ W0 _* Q) z& I5 V
  00401074:  je        004010915 y' Y, _0 w" t" o: g6 W) x  {1 U
$ ~: q% A; ?+ N3 c: |

6 ?0 X$ A1 @9 v3 |0 A; v& {* qThere could be hundreds of BPX you could use to detect this trick.
' Z! b1 a0 i0 [1 K/ z" @-The most classical one is:+ A3 C$ ?5 {- Z1 C
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||9 T6 p/ c" x) M$ j
    *(esp-&gt;4+4)=='NTIC'9 e! G  K4 {! O7 T* h

4 E, {- v" w) B. F, H7 ?% }. T-The most exotic ones (could be very slooooow :-(
  G8 @6 S; V" l' ~% v! |   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  
- s! k: |9 d: Z& L1 P1 X$ M     ;will break 3 times :-(! W6 w  Q' ^3 y: r; P

% S. y  D1 j& [: T; g-or (a bit) faster: 1 I5 y/ n' s) A( T, F) s
   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')7 v) L* O% x( q

8 y, _9 Y& o9 u2 _1 T4 B   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  
2 {7 [: P) @& k- r2 E     ;will break 3 times :-(
  x4 q$ Q- U5 F+ v& n
! K( @  y2 D+ o7 I1 e-Much faster:7 |* r) h' h; a% i! r" k
   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'
; c7 Q3 o% q4 i  s6 I0 H2 s. ?2 K7 o; f  u+ z1 `
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen9 t' t& |, F  R$ A+ D4 G
function to do the same job:
, X  |/ \- w5 V" b* ^& Z
5 M+ z" {( \, s- _9 _   push    00                        ; OF_READ) e& y8 A0 |1 x) h7 I
   mov     eax,[00656634]            ; '\\.\SICE',0
/ @4 j4 Q- H: v9 _$ e: R   push    eax2 d2 L+ I& p. X# u- e
   call    KERNEL32!_lopen) \& E; d7 k. S8 [8 V
   inc     eax7 o; D# }9 t/ S
   jnz     00650589                  ; detected' _" X& Q: a3 E! R$ |/ t4 t4 I
   push    00                        ; OF_READ( h+ J) _# _* K9 z
   mov     eax,[00656638]            ; '\\.\SICE'* a1 d* T# {# Z# q( D" u' S- H. A
   push    eax
% s" s$ Y. u% i/ }: ?, W. p   call    KERNEL32!_lopen
/ H2 o) u; j" W4 }1 [1 R) p   inc     eax
& {9 c0 s/ ]" |, H( N   jz      006505ae                  ; not detected) w- e3 R( t! Q

3 D% [  b7 r: N7 G1 _
' g" i4 z4 G4 ]: r# q8 L__________________________________________________________________________
& R1 x; c- B$ I0 k9 A% S. F; S9 ^& S& W& {! q
Method 12
) E% ]  e4 M( ]% A( Q=========
" ^: l' i) B/ J0 P
2 X$ H' |- O  DThis trick is similar to int41h/4fh Debugger installation check (code 05) _" d+ r7 O2 W7 Y% ?( C
&amp; 06) but very limited because it's only available for Win95/98 (not NT)( T# g# S2 }) ]" e0 F1 G( g
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.( i+ t" r) N, F0 U: D" j$ p' v

0 [2 b8 t  j/ O3 E$ ?( V7 H1 D   push  0000004fh         ; function 4fh
* g2 w8 C3 `9 O3 ^2 ~* W6 y   push  002a002ah         ; high word specifies which VxD (VWIN32)
6 G6 p- k1 M: C# u  h                           ; low word specifies which service
, |% z4 J& l, ]: [% C# V& m- s                             (VWIN32_Int41Dispatch)1 a7 D" h8 X* t6 F# K
   call  Kernel32!ORD_001  ; VxdCall/ H! w: ?& B/ E, W% m
   cmp   ax, 0f386h        ; magic number returned by system debuggers
0 H: H* g7 |+ Q5 m* b0 [   jz    SoftICE_detected4 m0 X5 {! Z% N, o
4 V9 k5 a( _9 E6 @" X$ z3 m. j& d
Here again, several ways to detect it:
, O- @0 I' m) u0 i- O+ b0 S- f% p8 w& K
    BPINT 41 if ax==4f" B' d7 ]; Y$ x8 x% c( ]. R8 ^
: v! j  s! V/ W- E* N* @
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one
5 q# ]" W. o2 _! [3 n4 ?
5 B: w' Y8 R( s- q$ K, h    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
+ m9 \& [' X+ P1 r# q8 Y
- U. w8 T) ?5 r- N1 W9 d    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!- I! d9 R$ d  q

0 E/ k* j$ @3 O7 P6 M__________________________________________________________________________
5 ^' `# U+ @+ g, C: F5 l. j! E
6 s' a, L& b9 o4 a+ lMethod 13( P- u% A, v! h1 e6 s. q8 C
=========
% G7 J6 t7 R, ]" O+ F3 I% s: ?* M1 q+ ~8 [/ n
Not a real method of detection, but a good way to know if SoftICE is" d6 v- p0 g' {1 D3 G9 k: X% t: F( j
installed on a computer and to locate its installation directory.) x8 Q6 w. B* A( n: \7 F
It is used by few softs which access the following registry keys (usually #2) :7 I0 Y6 a: u: N; n; [% F. O# ^. y

* \; P% u8 _7 r# L' h8 f& t-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion& |0 v4 b/ o  H# }# o
\Uninstall\SoftICE0 u7 j" l1 m8 b4 S( z- F" P
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE- y$ z& H. e0 o2 X4 K5 k+ D
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
4 V' ?& W, k" p\App Paths\Loader32.Exe0 D7 V' F. @8 V1 ?) k/ h' g

* q7 Q2 `+ M8 w/ }1 \7 ?7 \
: Z. [* T: I5 h9 M! jNote that some nasty apps could then erase all files from SoftICE directory+ x6 T  v" P3 U5 \2 O
(I faced that once :-(
, Q- f/ f7 g5 _4 ~3 i
$ Y' f4 O  r8 @Useful breakpoint to detect it:6 b( Z0 |; {, d$ \/ k
6 P2 r  l4 |8 `! z* o/ v8 _4 r3 @
     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
0 T. `: x. e3 S* Y; s
0 q! Q# t, W1 `2 ]4 i. V2 Q: {6 e__________________________________________________________________________
' J2 Z% v" a) V. B7 `  ]0 J# O4 C, |2 @# p& _
4 e- h7 a  N/ u  L, M
Method 14 7 e0 J" H+ w- a& d: [: R0 @
=========
. [" M* }) |* j( `- s6 C) ~; b1 e1 J2 _
4 U( |9 O% y: ]8 g* U9 \4 `/ J9 b9 Z) eA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose  h& U& u0 W2 [
is to determines whether a debugger is running on your system (ring0 only).& Y5 d" \/ G7 u" G, Q, o! z

; T$ v* M& j8 M5 Q3 s+ Z3 b2 Q  S6 W   VMMCall Test_Debug_Installed
. E. z' M6 J) ]: z- g   je      not_installed
( m; v  l4 `8 ?: ^% S5 i1 j
/ A$ G6 c* x8 \9 X' p4 T9 a0 GThis service just checks a flag.. m$ n4 c: @% h' n/ l: x$ X
</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关注公众号

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

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

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