About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
2 X4 S, L) i, t1 K, Z' B<TBODY>& T( G. t: c8 m* L$ S7 m
<TR>
; u8 J! b# u: _6 [, e<TD><PRE>Method 01
% \$ |6 }4 _& r=========
6 s" Y& i7 h8 B7 K7 f7 ~! i: {. o9 P8 a. R' o
3 Z/ O# p" f2 a" @0 _' q: K$ FThis method of detection of SoftICE (as well as the following one) is
! Y5 u5 `" s2 ~; \used by the majority of packers/encryptors found on Internet.
6 E$ M' D7 q! r0 z% ?It seeks the signature of BoundsChecker in SoftICE
1 X* a, t' u4 e- X# H4 i" [+ Y$ L5 C, T3 Z: }3 G
    mov     ebp, 04243484Bh        ; 'BCHK'& E* I7 J2 w* }6 N* p. x
    mov     ax, 04h) G' `0 ?: c3 s! C# e5 i/ S
    int     3       + `8 ^, o5 g6 z/ d/ h+ y8 i% a  {% ]: K
    cmp     al,4
- t8 r8 x, r8 W5 G  h6 j" G    jnz     SoftICE_Detected. l$ ~% g9 e  T. {. y( J6 [
! l. h/ v! L, Z$ [. _
___________________________________________________________________________/ Z8 b0 @! j3 b& w" R* m

, L5 y* ]3 P% L9 p  ?7 @( q" h: O  NMethod 021 @: Q. L5 I; c! T9 ~7 S
=========
6 p  x- w8 I( z( D/ g) c( U# V# H7 Q# {! p: y) m/ r( v6 m
Still a method very much used (perhaps the most frequent one).  It is used( @5 d5 x8 l# ~4 K  G- ?+ W$ I8 F; Y
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,* T% d2 m! g9 j
or execute SoftICE commands...1 j# M& c) E  `6 @9 {7 I" g/ m
It is also used to crash SoftICE and to force it to execute any commands) Q8 v( ?8 m9 N  ~6 D+ K" a2 B# X
(HBOOT...) :-((  3 K3 D; |3 B$ |3 Q7 [5 ]) Q

4 D" Q2 E. Z" q  A+ D+ NHere is a quick description:
+ t2 E" N8 F4 y2 g-AX = 0910h   (Display string in SIce windows)+ R2 |, J& _0 m: n: O3 M9 P; y
-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)2 v' B. `2 X, y1 V1 H0 [
-AX = 0912h   (Get breakpoint infos)1 t$ j4 r0 u4 \
-AX = 0913h   (Set Sice breakpoints)' R- K" k7 `% M, X
-AX = 0914h   (Remove SIce breakoints)3 g0 _3 G" e) e/ l4 c: @) T

9 B4 u! K8 n* ~: s, E+ B* JEach time you'll meet this trick, you'll see:, b# k& o1 J$ n+ _6 ^; h+ q
-SI = 4647h
5 |: {" |9 [3 D/ J4 G-DI = 4A4Dh
$ l+ P. U# z. l: v7 O+ c" Y' PWhich are the 'magic values' used by SoftIce.
- C; c2 b* Y" W; ~9 y3 y/ q7 BFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
9 g- H& o# n! E, l! ]3 l% m# Q& `4 i
Here is one example from the file "Haspinst.exe" which is the dongle HASP% O' ^, p  p& [0 N' p  q  y
Envelope utility use to protect DOS applications:
9 v' b1 z9 t& T! C2 d  w1 ^. s. ~$ m5 |' Q, h" F. Z
) D5 ~/ P3 m2 s0 b( z' E) e: s; g- X
4C19:0095   MOV    AX,0911  ; execute command.
. M5 g" B$ X7 z7 U4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).  F' ]3 E5 i' |/ e
4C19:009A   MOV    SI,4647  ; 1st magic value.' z- z, R) S. X% h
4C19:009D   MOV    DI,4A4D  ; 2nd magic value.: {4 I5 ^( A4 w" X8 {/ z
4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
% I3 y: v7 }* Y8 r5 u3 [8 H$ v4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute
2 X  e4 ], l. O9 w5 d0 k. v4C19:00A4   INC    CX6 o+ q" l( `1 t7 o$ _- b2 i* H
4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute6 G" v9 _% P. S; w( R
4C19:00A8   JB     0095     ; 6 different commands./ ?/ C6 o) F2 F
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
/ a& A* g& \' M' O- e4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)
! l3 S$ o4 m) F7 j# s" H. @! `
# J6 J* x# W6 ~2 NThe program will execute 6 different SIce commands located at ds:dx, which  {4 p7 M8 U, t+ e
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT./ R$ u& F5 B8 m; @# e: w) R* r- m3 ]

" b* ]+ h! P! B) B0 A3 D* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
$ ^# c' p. q6 P! E/ B  I/ w___________________________________________________________________________; i( n9 i! p8 T6 y' f; T
+ ]- M) {3 U4 ~6 M7 q6 F3 N

7 C; R8 F' f6 y1 ]! a9 c2 q/ iMethod 03
+ ~* n; K& H; j# v7 w. F" ~=========8 j' P6 S6 o* X

- a" }# ~9 l5 |8 S1 y! e5 d- jLess used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
$ k, r9 l# I5 S" T6 X(API Get entry point)
% R9 j& s- M: o9 E4 M        
- z1 e7 t' n$ h" T; f, K0 m( s) V
    xor     di,di
# n5 [0 j* p: k4 j9 C    mov     es,di
2 q, k3 a1 I: L+ Q  \    mov     ax, 1684h      
' `7 A. S( {) p" O    mov     bx, 0202h       ; VxD ID of winice
5 b, m4 X; F0 O* `; `& e    int     2Fh
  }+ E, c6 C0 A) g1 g+ n    mov     ax, es          ; ES:DI -&gt; VxD API entry point
% L" j- F! v( K" m1 h    add     ax, di
8 P4 u/ d' V; L- o; B( k    test    ax,ax
& }$ `  N" `% B    jnz     SoftICE_Detected+ _5 L: L) F% C' E

  w$ b! f6 G6 Q8 l. x8 h___________________________________________________________________________5 P- a: W* x8 J& I

4 \* P/ O. l2 G5 }3 E9 UMethod 04+ o& r# j6 I  \9 N* Q6 `! e3 \# O
=========
" n7 l6 ^% p: A" w  o6 R; d( O9 Z) r- u6 n, l# S% p5 a% q6 R3 `
Method identical to the preceding one except that it seeks the ID of SoftICE
2 p2 }1 y# C, K, C# _GFX VxD.& v) @: o  Z% J6 ?3 j; B) Z

# U1 ^2 W3 K+ C    xor     di,di  {( }% c( q4 _
    mov     es,di9 y, z+ X2 _5 n8 B+ P
    mov     ax, 1684h       ( b- F& E: }' V: A  b& P. g# j; {
    mov     bx, 7a5Fh       ; VxD ID of SIWVID
: R+ R6 J0 c: v( @- D6 r    int     2fh
' i) }' m: P' R; J5 n( _* V    mov     ax, es          ; ES:DI -&gt; VxD API entry point
* U1 y! N$ `0 \: q4 T( K& f. k5 U    add     ax, di9 ~& w" k- j6 i* u: h7 {0 ~+ ~
    test    ax,ax
/ e6 m/ s2 W  E% p, R! I- ~" M    jnz     SoftICE_Detected
9 j0 @+ R- R) X5 J% n1 [& x) o" O5 _& B
__________________________________________________________________________! \0 I% @; G7 ^& ^

* E7 ]3 y; a* F
1 q% }8 I/ N8 [3 P- IMethod 05
  J7 u3 E8 \, ~1 j# i+ v- m0 P8 q=========
+ N& h* @: h1 Z6 G7 ?; n1 D2 H4 o2 B1 K* A* q) D. S
Method seeking the 'magic number' 0F386h returned (in ax) by all system. r5 t5 I3 l) H1 G; {
debugger. It calls the int 41h, function 4Fh.: `% {8 Q8 I/ g. E
There are several alternatives.  " |# K0 M4 s% `" s; O3 v
* L: g! h4 Q* }8 o+ o5 N
The following one is the simplest:& ?# v/ x6 c& E, `2 ?. {2 {5 E, u
" D/ ]2 h( \6 p, C: A/ \
    mov     ax,4fh) C; f+ W! e, {  M8 K! m! s7 o! i
    int     41h
0 B7 V& B4 J: i( q    cmp     ax, 0F386
, Q( W9 M4 F4 f& L  x! X    jz      SoftICE_detected3 n6 G8 H4 x6 F/ T9 h" _
& c. ~& h  z6 G7 ]

- E6 `8 N, k/ c9 u3 Q0 o' i" VNext method as well as the following one are 2 examples from Stone's ( }# M1 [- g) d* _/ J/ D& q! |
"stn-wid.zip" (www.cracking.net):
( O+ b( e: J7 f
# H1 I! f5 ~. I    mov     bx, cs5 [- L* @" I$ E
    lea     dx, int41handler24 v! p4 P& \6 {7 V" x
    xchg    dx, es:[41h*4]7 h) _  I$ S  d6 E
    xchg    bx, es:[41h*4+2]
% {* O6 u: a" S! C    mov     ax,4fh
. c; _# L! i! V9 Q9 N) m    int     41h' C6 p/ k; Y, W) f: q/ Q
    xchg    dx, es:[41h*4]
) U7 Y- h, |3 g! P/ J    xchg    bx, es:[41h*4+2]
; i: C6 M8 K3 m+ z; e; y/ G    cmp     ax, 0f386h" b. V- V7 h0 v4 j
    jz      SoftICE_detected
, k/ K3 s  e. h/ n! @  r: n
6 F5 r7 S# S/ H' T, c! gint41handler2 PROC- v6 G; r  R, E4 x8 x5 Y
    iret
9 B; t, n! T; Y. Rint41handler2 ENDP
/ l  T+ q6 l8 j: T+ @6 E% l  V+ c5 M% S' g. C0 R0 _

! g' ?' K, _" g+ d_________________________________________________________________________5 x, H" r- ]9 J7 v' T' L
9 t2 F  m. O7 d7 E" M5 G. F! G1 _

6 y5 K$ Y: v7 S; `) B# k* |Method 065 W4 p: E' B& i7 K
=========7 t( H( p6 V1 F! ]+ f8 ?
8 C' Q' C" p% s& x( u

6 V" g/ C1 H2 k+ `) g' y2nd method similar to the preceding one but more difficult to detect:
' Q6 N" n" u+ I# j3 ]5 u& B4 N1 m% W+ V2 i% R
2 U4 W* K, {8 A! k' y
int41handler PROC. p% S* o/ r7 k- e+ Y
    mov     cl,al: r  ]* n5 ?! D3 |3 d6 \
    iret
# F! |) n) h& m3 n. V" xint41handler ENDP  e! Z+ x" e3 Z' }/ R% }- b; \' i

3 R' w9 |) ]8 b. p0 w; A: G$ B+ Q3 `& m+ r' T" U
    xor     ax,ax
- `( q7 J9 p5 `# q    mov     es,ax
6 f. I7 |+ k8 T' i7 x6 i5 T( c    mov     bx, cs3 a% E9 I9 ~, @2 K: X
    lea     dx, int41handler
8 s( U/ w! R" @4 Y3 Q$ v, V1 j# Q    xchg    dx, es:[41h*4]' f6 T" ]2 _( h; C2 M
    xchg    bx, es:[41h*4+2]
$ r, q6 i5 X0 o    in      al, 40h' ]' ^: w# X2 V0 v5 e1 ?/ e& D
    xor     cx,cx+ e! b( b' j8 t) c7 q
    int     41h
5 i* m, x# ~# a0 \0 N    xchg    dx, es:[41h*4]1 [/ s' T4 |) S  `
    xchg    bx, es:[41h*4+2]$ `2 p/ T! c  j+ A( S
    cmp     cl,al2 e, O7 y+ I4 ^( a( Y- O
    jnz     SoftICE_detected: @- i  @  _+ g% g0 u

8 A& [9 ~5 o2 D$ J_________________________________________________________________________' D3 r: V0 d3 a+ t: S: i( q5 \2 C1 S2 M
' H! W0 @  a' x4 N+ r  W
Method 07; H! t- O& f" w1 p
=========
- B) d5 i( R& f( o7 K
2 B) A0 W4 `8 [2 z/ zMethod of detection of the WinICE handler in the int68h (V86)
; R3 @6 Q- O) i' K1 ^8 w* R5 s9 F6 b  t! Q
    mov     ah,43h* M) b3 B0 @- t, U9 U3 u5 y
    int     68h7 ?! [8 n' o- J  h
    cmp     ax,0F386h- |. [/ G* \5 c
    jz      SoftICE_Detected
6 U0 e0 i- |) E8 I* B/ \' p
0 n' l% o9 m( C+ v  \
  b4 h! A+ ]/ V7 S7 Z=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit( f$ H: L3 ~& V4 o7 E, o* C
   app like this:- d3 x  X+ M& m' X  `5 ^2 r
* @, q) l: R/ u2 e
   BPX exec_int if ax==682 W) C" H( H" O. _; `, J
   (function called is located at byte ptr [ebp+1Dh] and client eip is' v* l" y' A! W7 A2 x4 T
   located at [ebp+48h] for 32Bit apps)
' d/ \; G8 S: S: W* `__________________________________________________________________________  I# B7 |: |3 N- [. |; i! ~' F
. ~, q0 w+ g, y# B' u/ \
* a% T0 w5 P5 [4 {5 m
Method 08
4 j2 R: y- J# B2 Z; q/ }=========6 l4 E; ^( O+ [6 I

& D  A- l1 `/ n. rIt is not a method of detection of SoftICE but a possibility to crash the8 I: e/ H/ z6 `
system by intercepting int 01h and int 03h and redirecting them to another
6 x7 X! w. J0 B5 Iroutine.5 V' y" f' a9 N7 G
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
- C& b1 p" J! N+ Bto the new routine to execute (hangs computer...)6 q$ d5 z5 r$ a+ a, V
6 L- C' |& M) H. a+ B& `! r" K
    mov     ah, 25h. C6 |4 D, y; P/ U6 I* d. U
    mov     al, Int_Number (01h or 03h)
. ~& J3 P/ Y3 L% ~: T. \    mov     dx, offset New_Int_Routine# ?& Q! y3 [( f+ I( E9 A- V6 \% J& S
    int     21h
8 U% `  [; e/ O& e) v/ G! E8 \( g$ v9 j) V7 ]2 q
__________________________________________________________________________- d. p: j# T- O" n$ {
9 x  `$ Z+ ^0 f- I# N; u
Method 09& h- H& B( c* m# \  X; N% l
=========
8 N7 r. C1 f8 T& p  O8 E# A7 F, l+ G: P4 b: u. P
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only' u! X0 M  j' A7 d
performed in ring0 (VxD or a ring3 app using the VxdCall).& L$ `3 x5 t3 G2 W- m
The Get_DDB service is used to determine whether or not a VxD is installed8 e# p' [+ g5 p1 c# a  n
for the specified device and returns a Device Description Block (in ecx) for
9 c8 [/ m% W! y' f; s/ {that device if it is installed.
: k8 S1 O+ j7 d; e4 E6 {
  O. h: f! i0 W3 p9 c3 j   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID
" U- ~* T6 n6 s- t/ y4 v   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
$ L  ]  J8 X% D8 H   VMMCall Get_DDB
7 V# ?* _: X( x) _) @8 e/ c- ^   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed# I' {/ F/ ]- Y, m5 ]2 o& ~
# V  t0 g# {  z. K1 `$ o
Note as well that you can easily detect this method with SoftICE:- ~' ^5 w* H: o0 m8 ?  n
   bpx Get_DDB if ax==0202 || ax==7a5fh3 v4 [3 y$ o3 Z- f
& `. `+ ^7 a8 K: ]
__________________________________________________________________________
4 `) @. q. e: ]& p/ k7 k) s5 W9 n2 K- j
Method 10' [! |) h9 S% E# K) H
=========8 d, U) J' f0 ~4 @" U+ p; a
3 P. K1 ?; [0 T: l% E8 G  G
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with
; v7 U  X. |6 o/ D6 a) Q/ |  SoftICE while the option is enable!!
+ {+ [3 [9 @* r, V. k6 H: b; Z
9 W0 d4 q8 o: ]. S! R  uThis trick is very efficient:
: Q" J% ]' d+ Z! l6 Mby checking the Debug Registers, you can detect if SoftICE is loaded
" S0 V; i) d1 Z/ U" v(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if4 z! @$ i# e! J5 A; D
there are some memory breakpoints set (dr0 to dr3) simply by reading their
9 Z! y: d1 K& w: ~value (in ring0 only). Values can be manipulated and or changed as well. Z" w- p  M) q+ L! R1 l' W
(clearing BPMs for instance)
; E4 p, \: [, z; E, `( m. W+ e  G8 J! l
__________________________________________________________________________; A  ~- O/ O" _4 B; z+ @& |
9 f1 E: Q$ o  T# }9 a
Method 11
! i0 q+ i- N. P, E) ?=========( ^1 w' g% P& N- ~+ J; g% ~  B

; Z/ Q6 V: k0 ^; F8 T% A. FThis method is most known as 'MeltICE' because it has been freely distributed
" u& j% [5 L' e  Xvia www.winfiles.com. However it was first used by NuMega people to allow; P$ \- a" S6 i* V5 A
Symbol Loader to check if SoftICE was active or not (the code is located& m( C- [, c0 p# R, l6 t
inside nmtrans.dll).
$ x' T  [0 o. J/ X, g1 C5 ~0 ^0 E8 }, X& h& ^' p* Z3 ~
The way it works is very simple:. y4 J' n! J3 V+ _; i
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for/ ^* m& R  b  g2 C' B
WinNT) with the CreateFileA API.! v+ P( [2 _! N" s0 P# t

" q! h5 @; d) g8 A/ `: m% LHere is a sample (checking for 'SICE'):
5 O5 A& F) g' o3 W/ l- i) q- @( `1 `* Y2 f% E) k
BOOL IsSoftIce95Loaded()
) r8 }% h  B7 j: A! z{' C+ k4 X" E, t7 B* j
   HANDLE hFile;  0 w8 @2 w3 L5 H1 Y. H
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
# q% J4 X4 a* ]: A+ W# m                      FILE_SHARE_READ | FILE_SHARE_WRITE,
2 `0 b1 e1 |# `' A                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
9 e! v# d/ ?8 a: e1 c9 ?   if( hFile != INVALID_HANDLE_VALUE )8 I0 Y; C4 m2 A2 T1 I! M8 C
   {
/ s. M% r% I6 E3 u1 I      CloseHandle(hFile);
% ?9 H" T1 `. I& R4 o      return TRUE;
; g% V+ C; B9 a$ U' Q* e4 Q   }5 ^8 ]% Q9 S; {
   return FALSE;
, B1 e2 N& J# w! i( S1 {* o+ t' \}* ~3 y: b% y8 R: r- h
1 I& [2 G* k# i- X
Although this trick calls the CreateFileA function, don't even expect to be# X8 W2 J* q3 ~, ]7 C
able to intercept it by installing a IFS hook: it will not work, no way!
8 W# M1 \1 i$ ~  i& EIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
$ v+ q0 Q% h5 c* u) Y: }/ S5 Lservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
7 l) H1 V. Z1 c+ s. S' t9 P+ ^and then browse the DDB list until it find the VxD and its DDB_Control_Proc
+ b6 a& ?" p7 e4 ~6 rfield.
- G; ?- H$ u# L; z! tIn fact, its purpose is not to load/unload VxDs but only to send a $ p) c" ~: \# |1 K1 A! C$ N
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)1 L( q* [, @: r6 i, H0 a
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
! u# g3 N  a' i0 hto load/unload a non-dynamically loadable driver such as SoftICE ;-).
5 B3 @- h8 K; T, z  {, SIf the VxD is loaded, it will always clear eax and the Carry flag to allow
% N3 W  o* k2 o0 h8 Rits handle to be opened and then, will be detected.3 @8 d# Z) o! c1 ~
You can check that simply by hooking Winice.exe control proc entry point. _# F: n. c; o7 w1 d) Q1 I- ^
while running MeltICE.! d' z& `% V5 r* q/ R9 I6 Y; i

+ D8 m  g" z: P- b8 g6 f: e/ `- A9 Y$ I
  00401067:  push      00402025    ; \\.\SICE& H- w3 b* N9 J
  0040106C:  call      CreateFileA
" w+ A/ s9 g' O  00401071:  cmp       eax,-001
7 L# h5 ~# a& l8 j  @* o5 h  00401074:  je        00401091
1 A" w6 K7 M5 r' \8 y% O) d8 V6 E) u8 }+ [7 R, Z
) c6 O+ g) |) Q, a! W
There could be hundreds of BPX you could use to detect this trick./ F9 S8 O- s2 ?8 \
-The most classical one is:3 w6 h1 u9 b( Y8 M8 |2 h4 T5 k4 x
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
" }3 A& f; y  D5 |9 ~' X, B) X    *(esp-&gt;4+4)=='NTIC'% o/ a& A" S3 E! p6 K9 C) D1 l% P
" j7 n* P2 ?4 @3 |; J8 X1 B' ^
-The most exotic ones (could be very slooooow :-(
% y8 @# e* \& M# l   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  ( j- E2 e$ n. M# H' g! s
     ;will break 3 times :-() C9 z) g3 r4 r, T9 E/ f

6 T! B; Q% X- @8 }-or (a bit) faster:
( Y" G- R6 r( D# Y   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
6 ?% I) `, A1 E& Y# f. |8 o8 J2 p- T: a2 G' E3 o
   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  9 n% E! [$ d3 k* q1 \
     ;will break 3 times :-(
; Y6 g. u% f- X: G# F% ^# z/ Q) k) w
-Much faster:( h" i% f% m3 R, W  r/ Y! w/ @( ]
   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'! m5 b8 @2 ^1 C

6 q7 [+ h  b9 A: SNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
, i4 t, P/ h( jfunction to do the same job:, H* k! j3 O4 t$ `5 \; `

( M: Z" p7 f5 Y1 y5 r   push    00                        ; OF_READ
+ q8 f7 P4 Y# p* Y. }4 ^" |   mov     eax,[00656634]            ; '\\.\SICE',0- T! u( p3 c! n; d1 @
   push    eax1 W/ A- i( L4 L  f/ F" w
   call    KERNEL32!_lopen
  B( E, u4 k/ [* b* C   inc     eax/ ?* c0 \+ ]1 k# t+ T# a
   jnz     00650589                  ; detected8 _. ~8 C2 q/ Z8 ]; Q7 z! K& E5 }
   push    00                        ; OF_READ# [# D, [" B2 C/ n
   mov     eax,[00656638]            ; '\\.\SICE'& A2 V4 t1 p, I/ U
   push    eax% N# m8 |4 H* C8 J( V  O0 |- c, G) u9 y: v
   call    KERNEL32!_lopen
9 d1 k! C% P! B4 D' `   inc     eax
; P2 p) u( y- h( v5 S8 B) r$ [   jz      006505ae                  ; not detected# E8 F4 L! A& F; Q; t

; J3 o1 R  q# K8 E2 h0 _& s) j6 i# p: y4 D' K8 }9 Q) @/ ?
__________________________________________________________________________
5 d4 Z# ]  T1 r/ d  ]
& a. ~# H0 Z8 R5 v5 u: @' y0 f* GMethod 12
9 s* A+ p; O# p5 t7 y/ V=========, p3 q" w, n2 Y- I, e5 i9 M

! O4 \" M* c/ E0 i/ A" f0 l0 cThis trick is similar to int41h/4fh Debugger installation check (code 05* G5 |' Q8 Z# b6 G. D* R- I
&amp; 06) but very limited because it's only available for Win95/98 (not NT)6 V0 ^! u2 J4 ?1 Q& B
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.& H6 [% W+ o( i" ~- a" o3 k  O
( T2 M6 ~- d$ Y3 m/ q
   push  0000004fh         ; function 4fh& z0 ^( R6 h. R$ O9 G
   push  002a002ah         ; high word specifies which VxD (VWIN32)
. G- v' Z# K  \. Y; c2 V                           ; low word specifies which service
- A7 N0 m5 [) m( J( q8 {, h                             (VWIN32_Int41Dispatch)
- U# T+ w) [% }; x6 `   call  Kernel32!ORD_001  ; VxdCall  F1 ], \; l2 q+ G2 `& J
   cmp   ax, 0f386h        ; magic number returned by system debuggers( x% K1 v3 u) {- i0 l3 l
   jz    SoftICE_detected
& n! r' |" |2 F3 \  U( c
; D9 l$ a: ]3 f# C; |6 ^) THere again, several ways to detect it:" F  Z7 w4 @6 k- B0 o* U/ p- Q

. o& {' R$ l6 w- \. A9 x    BPINT 41 if ax==4f
5 d' M& s1 _7 X; Z+ V1 h5 i! V( v+ D6 V" q! j; u/ e8 E4 a
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one1 Y% ?; b4 o, M- g$ x) V9 _% Z
1 |+ A' v' ^/ d3 s
    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
3 M6 F; i: J3 j, Z# r- F" V; r
* v- M6 P; t% M4 m+ l. @$ B    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!
' a  k) o+ {( u/ N
7 C2 S+ ?% @! r! Y: p__________________________________________________________________________$ w$ N  |: V# W( W7 [

% L8 F- r5 r$ n" P0 a& ^9 tMethod 13
6 w# A( M) {" f% h* o=========3 I0 S  U) {9 {- i  j1 \- L

, s$ Y0 O5 E/ S# o8 nNot a real method of detection, but a good way to know if SoftICE is
* L, |* L7 w$ q/ `$ S! T$ ~1 `installed on a computer and to locate its installation directory.
' u  {% v6 s9 wIt is used by few softs which access the following registry keys (usually #2) :
+ ]% ~' n$ `; c
4 S8 }. P: x- e' F& g2 \* c0 D. R3 t-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion. a& Y( V  R' ?
\Uninstall\SoftICE
7 |% Q9 G- c! L* k$ y: l0 l-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
) c6 m; l) d* D7 k6 v6 R( T-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion0 O3 F5 ?" N6 M" Q! Z) p
\App Paths\Loader32.Exe$ q5 c( n( O$ V+ A4 B0 `, a3 [

! m/ i% w$ m$ r3 A2 E* a! Y. z
! M# z! s5 Y+ [8 ^, jNote that some nasty apps could then erase all files from SoftICE directory
9 }, n9 ?3 s8 ]. x; r(I faced that once :-(
0 ?+ Y7 J0 s' M  u- o! y
6 U9 Y9 p* Z! m) [, GUseful breakpoint to detect it:
! `( C$ T6 j+ S# r* I; A4 d4 J+ G
7 {5 g5 `3 Z+ |# G) h     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
/ z' W$ c2 p) N6 V; g- y, V2 U$ c7 Q# [, t
__________________________________________________________________________4 i7 J, \$ q$ B5 D( X
+ _; l  L- Q! F

! Q! g0 f* i2 V( JMethod 14 & f. L* O# K# P
=========: K7 b7 s+ T0 D5 o

% f! i4 c2 G* ^2 LA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
1 f9 k+ N9 ^- G! n! his to determines whether a debugger is running on your system (ring0 only).
6 u- ~+ k! i. F; c, B! t3 l9 T$ V* _) m9 Y5 J
   VMMCall Test_Debug_Installed8 B8 `) @# G: o/ ], [- _  l
   je      not_installed4 `" t$ b0 ~5 n' z, w! \
1 p/ t  x+ X" P  r8 G# r
This service just checks a flag.
* A9 I' J3 |8 ?9 @$ K</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关注公众号

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

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

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