About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
4 Y7 ^" d1 c" ^5 t2 h) m<TBODY>
" e7 x. G2 s! X8 ^<TR>
3 M! k: T; _5 E$ P6 t4 B* A: @<TD><PRE>Method 01 ( _& r) G$ z: i/ y
=========9 l+ a' x! l0 M
7 d( J$ d+ T* D5 _
This method of detection of SoftICE (as well as the following one) is- n7 b' q/ ]5 h, {  @% i, z
used by the majority of packers/encryptors found on Internet.
2 |5 K/ c/ v3 z% t# B; T% {It seeks the signature of BoundsChecker in SoftICE
* M8 x( f" l% _% T% @
* h" L; s0 R( a: t/ u. _    mov     ebp, 04243484Bh        ; 'BCHK'
) X7 P( q, h3 I9 z: K    mov     ax, 04h  V4 g& H' }& {" o+ X3 o/ _- H
    int     3       5 b, Y" }9 V4 G% t7 {3 l% q1 K
    cmp     al,4
8 P0 ~4 J/ S% y0 k, G    jnz     SoftICE_Detected
& s& d9 Z6 n# ?8 C  X) c* B! z' n8 \) s. [% M
___________________________________________________________________________' o: E" C' L2 R. x) A  {+ N

0 Z) _6 e9 A( ^- n- MMethod 027 J$ }: y0 T7 d. a
=========( Y9 s! q/ }9 g* ?: E, |
+ l% w9 t9 H1 K# }- Z% @' T4 h- Q# y
Still a method very much used (perhaps the most frequent one).  It is used7 K. T) ~  h3 F! C6 {1 F% w
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
: V2 d5 [$ t' _3 X$ x( K" Oor execute SoftICE commands...
/ \( {* b' w" C/ Z7 n6 CIt is also used to crash SoftICE and to force it to execute any commands0 P: K' j, D0 I* A& n7 E
(HBOOT...) :-((  & ~# H+ x3 ]8 @+ u) B1 f

6 O2 ~: B) e+ r: f6 JHere is a quick description:8 n1 k# \; z7 u# N, K: p
-AX = 0910h   (Display string in SIce windows)
5 |- ~. f9 E: |+ }; O-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)
% f3 R8 n, x. H7 ~9 e-AX = 0912h   (Get breakpoint infos)8 P- F; Q' ?6 f  T( A: ]- k
-AX = 0913h   (Set Sice breakpoints)
$ i+ X( X/ j7 j+ ^: U/ i-AX = 0914h   (Remove SIce breakoints)
) s  u$ N  U8 J9 z
8 V* s6 [% M) o0 l7 YEach time you'll meet this trick, you'll see:
; \' p  f: F5 T0 f6 c2 u) ~' t-SI = 4647h
( o$ L3 w) m7 j/ u3 z-DI = 4A4Dh- K9 a4 k6 A* H( a5 g4 S/ N! l( s
Which are the 'magic values' used by SoftIce.
& L. e7 Q- x; ?' p4 _8 s2 |  n+ rFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
" o4 `( q4 v2 x3 E2 k
- d, B% `, J8 ?* y4 D8 hHere is one example from the file "Haspinst.exe" which is the dongle HASP5 M7 |8 B( ^3 r' }3 n" @
Envelope utility use to protect DOS applications:
; `( a/ d. c, g9 S8 P& z0 I% a
2 z! G# G3 m, H3 y" ]
8 F1 X7 \# p' c6 e8 C( i8 q; j) e8 D4C19:0095   MOV    AX,0911  ; execute command.# c1 z3 _5 N0 q7 O
4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
) _, m4 S; E- O  L4C19:009A   MOV    SI,4647  ; 1st magic value.8 b  `4 B3 Q+ r2 q2 d% f
4C19:009D   MOV    DI,4A4D  ; 2nd magic value.
: E7 a! n! W' E" O$ H! ~) a7 b. o" r4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
4 `* v: a( B) v. `4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute; e; M( G/ h4 D8 e
4C19:00A4   INC    CX
  B% I! r. B! l7 G; M4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute
7 B% @: i3 n! F4 G- M' w: r3 Y: g" B4C19:00A8   JB     0095     ; 6 different commands.0 l$ K$ h' Q4 a5 o6 Z4 J9 h# W& z
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.8 E1 E  w$ ]! s. e% V+ P
4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)
2 l; K; ~# q/ n, t5 h& b7 Z' F
. ^6 f; A* D$ j0 l+ Q- y% Y8 tThe program will execute 6 different SIce commands located at ds:dx, which
, m, E) e, @$ f0 u, K8 Jare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.+ k" u6 d7 L7 D4 g, e' e5 Y! J

) _2 w* }: B- P# S' |" W( d* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.5 y2 x& C# G& L5 e& A' a
___________________________________________________________________________  w0 B, }1 U" s$ x
/ ^9 N/ u- p9 H

6 T# k1 G4 B, a/ W  _8 e  ^5 |Method 034 Z# p& Z$ }3 k5 k1 m  f( D. `
=========
5 s& Z7 b8 X4 H8 |+ f" ~2 ?. L/ H3 j9 p( K0 A
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
. u* O  F5 R6 ~. p! Z  k: e$ q(API Get entry point)
0 |. U' j4 J' d% @2 h        
! K! ^! {& |0 l7 b+ x6 m9 B( o: U2 g+ r- s$ H- F/ u
    xor     di,di9 K5 z; n. C$ I" D1 v2 C6 T
    mov     es,di3 m; M. x$ @  c$ M+ r2 B
    mov     ax, 1684h      
+ u& n9 Y2 L$ O! @    mov     bx, 0202h       ; VxD ID of winice6 w1 ^+ l7 ^& B: A0 l
    int     2Fh. C% E5 w: u+ @
    mov     ax, es          ; ES:DI -&gt; VxD API entry point
% N' a1 C+ b4 y; m6 U7 o& k4 p    add     ax, di% k9 Q5 l1 f; m
    test    ax,ax
4 K" [! }0 D& f1 _% C) f# D/ F    jnz     SoftICE_Detected) w1 h  o5 ?3 H8 q: W9 p
: |: {( j+ k" O- c" m
___________________________________________________________________________
: ]) \( Y9 s4 n4 ~. k/ Q4 m  ^5 A# a7 e7 e
Method 04
9 U6 u0 K. |4 W4 }=========, ]7 _4 D( ~- [  R# a
/ ^, c1 s3 Q# M) b1 r' e2 h& w
Method identical to the preceding one except that it seeks the ID of SoftICE
' d: @1 O) @: EGFX VxD.
/ Y& m+ P( n" s2 z7 J! d& D9 z5 }, J
    xor     di,di# R$ h& q/ ^9 Q9 c- \/ z" ]/ C  i
    mov     es,di
$ ?2 O9 b8 @3 N' u7 m( n    mov     ax, 1684h       3 A( _/ F. J& o. @7 r, ~5 _5 T
    mov     bx, 7a5Fh       ; VxD ID of SIWVID
4 v. p( N5 f4 [; @    int     2fh" Y1 p+ ]% j& d/ [
    mov     ax, es          ; ES:DI -&gt; VxD API entry point
! `$ p( r  A  K6 {7 {    add     ax, di' {5 i- ]) h- m+ Y, j
    test    ax,ax, U9 O. |% g, r
    jnz     SoftICE_Detected* n7 m* S; R" ?7 |
5 Z  _* v+ O* u5 o* Q$ N
__________________________________________________________________________  c( s) F+ c& G6 G6 C& ?, [  d

+ V; [. q' _8 K) j
5 V7 x/ U$ G0 s2 fMethod 05
- v5 B, m6 m, n; P; L=========
5 c1 _5 k8 W8 p) _4 u/ ^, _" T8 o: A, ]$ l0 d
Method seeking the 'magic number' 0F386h returned (in ax) by all system
" x& G; h0 N5 u7 `( Ydebugger. It calls the int 41h, function 4Fh.# X5 @+ I9 e9 l) M( V; z3 E
There are several alternatives.  
3 `' y5 `6 R2 V3 N  J, ^! I% R4 G3 ~4 g" F* o
The following one is the simplest:
" s; w' F7 A, z  \* I: @8 F4 B+ d+ A! A
    mov     ax,4fh
/ ?0 \6 k- d4 S. O  Q5 {    int     41h
  q) K0 r5 ]: d5 H: k7 p7 H    cmp     ax, 0F3869 V7 Z" V2 E9 e, w
    jz      SoftICE_detected
) r2 Z2 i, h. y4 z/ z+ q8 w; P. m" ?: p

/ Q* F: T1 k, _+ X6 t0 ^' yNext method as well as the following one are 2 examples from Stone's
+ F9 n! n. Q' x' |. O; V4 t"stn-wid.zip" (www.cracking.net):
; U" r7 s$ p9 j4 N  p4 o' w/ S* S" v! c3 l; c' b+ t8 I1 v6 N- b
    mov     bx, cs  r' `& V& S  ^. p
    lea     dx, int41handler2. d3 R7 o# I$ L( m  y
    xchg    dx, es:[41h*4]& M4 @. z4 d8 D; i6 x
    xchg    bx, es:[41h*4+2]
* r4 a, U1 Q0 u3 P! X* V    mov     ax,4fh4 D3 `% `, ~' r( n( w
    int     41h+ N1 z% r: Q7 h0 M* I
    xchg    dx, es:[41h*4]
( y: O. q2 c+ }- E* b    xchg    bx, es:[41h*4+2]
6 L: ^7 V, b* z( g' \2 w7 Y    cmp     ax, 0f386h/ U6 \7 X  |% Q1 ]8 |( v. u8 z: }- ]/ h
    jz      SoftICE_detected( E' S9 f6 m( _+ A

; X- ]2 F5 I" Z5 W. oint41handler2 PROC
3 n6 A; G9 G, S; X    iret
  s+ j7 Y# U) c+ }$ Gint41handler2 ENDP) V& z& W% g1 A5 S2 N
. k1 S/ V( G4 R& I) z& k/ @
5 v/ ~' T) M) @  i; ]6 r5 c
_________________________________________________________________________
% w: D* J. P  M6 q: Q6 u5 y$ \' X+ ?* ?& }0 ~$ C/ v
9 d- a, N$ }; z& i( N
Method 06
& n% G. Y! S9 `$ T/ P8 p=========
, p, p" w8 w/ ^: W+ G5 l* ~7 K" L, V& `  p' H1 C3 S' i2 Y5 y
& U* B$ _( m( D
2nd method similar to the preceding one but more difficult to detect:) y6 q% i/ t  t8 v5 b
/ @3 B+ S& r" X8 m0 S0 C
6 z' n) F# A; f2 W0 v
int41handler PROC
2 I* D. P% ?+ m  g/ E! L    mov     cl,al: ]$ x( h  Z. _
    iret! Q2 |' z" S! N2 z: b  X
int41handler ENDP
0 P5 ]( O: _: [/ J
2 e  d0 \6 \% f8 n1 R9 z- @
6 S+ O* S" T; }' m$ p3 d6 y    xor     ax,ax
. l* x  q3 t6 a3 V, ]9 [    mov     es,ax1 T7 w6 _  A6 v; |8 W0 A* t
    mov     bx, cs" Z: a* V  t8 [3 |& t8 I
    lea     dx, int41handler
: Q0 \2 P5 f* m    xchg    dx, es:[41h*4]% u5 I( Z% p" A# M4 ]. Z
    xchg    bx, es:[41h*4+2]$ i' x8 c! V8 a1 u3 f$ U1 K
    in      al, 40h
7 Y) P4 _( A4 l4 Z3 {4 U7 n3 Z3 c( ~  n    xor     cx,cx! t; D+ ^/ x: u# k
    int     41h
/ Z% q7 d6 w6 G* F% ^7 n) S    xchg    dx, es:[41h*4]
6 m- q% @4 I$ T+ \    xchg    bx, es:[41h*4+2]
  h: T( e+ q* |2 Y8 x+ o' _    cmp     cl,al1 T  z) L0 C) B) @3 r9 ^
    jnz     SoftICE_detected
# g# D6 S8 z5 f* e. I) G: S& R: W( M  \6 B9 o2 C! g( h
_________________________________________________________________________
$ ?* c2 I2 P5 j* \3 e! L. z! a- @) H, o" I* w9 l* i6 a- n
Method 07
5 e9 c0 |' v* Z$ N& h8 G5 z: F=========: \2 f' g; n& Q+ `0 S
6 Z4 s! E  H9 H) z' x3 x2 }7 w
Method of detection of the WinICE handler in the int68h (V86)! \+ E: Q) v2 Z  J# I  J- [" K

0 Y# O! ~. }5 K2 A  t" _    mov     ah,43h
3 N) Y, y' m7 j* w7 F    int     68h3 b! x/ P6 |8 H4 B' }
    cmp     ax,0F386h' G+ |) W# d2 z# g: c4 M
    jz      SoftICE_Detected2 ^1 r" t" a7 a& g0 i1 G

9 ^1 S3 b# h) W% R3 ?) V$ X0 Z; f" ~- V- |% ]& i9 \; O
=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit2 a# k% `; A& F: Z# B
   app like this:, a* n, Z! {% x

* d3 [$ \+ N# M' J7 R) Q   BPX exec_int if ax==68
) g+ i& V: N9 o$ E  L# J3 v   (function called is located at byte ptr [ebp+1Dh] and client eip is
; m! v8 S) s- Q/ {) B   located at [ebp+48h] for 32Bit apps)
# t) P. N0 [# A" W% e) H1 s" a__________________________________________________________________________$ n+ C( V6 v/ h1 [! J* T
) M7 v0 ]( b% k7 n: {1 g8 ^

8 q* r/ y. I5 ~2 g+ BMethod 08, r$ D) g1 W. q- U  s8 K
=========* i* {4 O- `% o# s9 O
5 s) U7 R, a8 N3 `) G) ?. E* K
It is not a method of detection of SoftICE but a possibility to crash the
7 W) ^6 r. V( L, B4 z2 ?system by intercepting int 01h and int 03h and redirecting them to another- c( N3 `" Z- d! ]4 F
routine.
6 H% i4 r( W2 V0 _4 u. n, o  HIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
% N" p! z7 b  @3 X3 |- a; }to the new routine to execute (hangs computer...)
' d) c1 L( U5 s  C" X8 P# c) v: j4 ^0 `% {
    mov     ah, 25h
  L* C6 y$ d( Z( W- x+ R    mov     al, Int_Number (01h or 03h)* D3 b5 c+ n2 I9 i" j( E' V- m
    mov     dx, offset New_Int_Routine7 `) J& Z' }( B/ M6 a% y- r! e; R
    int     21h9 W0 q* M5 v. ~$ N7 A: M& E
5 \% h/ a) ]* F4 e+ X4 x
__________________________________________________________________________
/ B( I! O3 f7 _4 R2 g/ \+ _+ n- m/ P9 H
Method 09
: m8 ?& T# T5 a4 l" A=========
5 m! T* I4 X0 f, f* z
9 y$ Y8 G' ?/ JThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only! Y: ?. s* [; G7 y3 Z" Y$ S& H
performed in ring0 (VxD or a ring3 app using the VxdCall).
/ K8 A/ M/ ^" ?; s! W' s1 t. IThe Get_DDB service is used to determine whether or not a VxD is installed$ G* G2 F0 ]: g' S1 }+ M
for the specified device and returns a Device Description Block (in ecx) for
$ }# T8 M! e+ y* c, Uthat device if it is installed./ Q0 W, X( J2 O( `  O  t9 R
- @# ]0 i3 O+ l& i
   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID8 i; X" a% I  v1 n4 z5 u
   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-), W8 c* Y  d: A5 \9 D9 G0 H5 N
   VMMCall Get_DDB
% y! ^( V* `  o0 l4 Q) c1 x" g+ A   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed6 D) T1 i/ S1 X, E, k( N

' R0 Y4 o+ ?4 aNote as well that you can easily detect this method with SoftICE:+ a' c$ Q: |& m
   bpx Get_DDB if ax==0202 || ax==7a5fh
. T% ~+ i7 f- ~9 G! A9 J2 p" ^8 d  L+ N7 c$ }& r5 }
__________________________________________________________________________$ E* Y8 C' e- Y+ }1 _  q6 Q; X
; @, k# A" e" {* e
Method 10: D. X1 B6 U% \
=========
" D% h( v# ?  Y) O* K8 C& ~: V8 Q# X+ H, |1 a! i* P
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with  `- C, _4 ^5 ]8 c
  SoftICE while the option is enable!!
4 E2 Z* b. p, A) J2 x
+ z" w) M/ \- x4 }: t% ^This trick is very efficient:
2 |2 D# L, ^( w: Wby checking the Debug Registers, you can detect if SoftICE is loaded
: q! N- r5 h7 S6 a6 o/ E* q5 a. L  i5 K(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
+ s+ ^' Z. O! H8 ithere are some memory breakpoints set (dr0 to dr3) simply by reading their; s7 w. y2 P7 W  y6 _3 S6 P1 g
value (in ring0 only). Values can be manipulated and or changed as well
1 t- |  h0 `8 o, T$ C(clearing BPMs for instance)
  ~/ y" A' L$ Y7 D1 j: ?  T  p- c" X9 U0 I% O
__________________________________________________________________________
1 c0 F' u: a: }3 N* o- o2 G8 B" q0 q" R
Method 11* F& k4 O) \& e7 ]0 P
=========
' G  d2 U& ?; h2 u- \; `
" u, W+ k& c5 R  r( yThis method is most known as 'MeltICE' because it has been freely distributed% J; t# x' q$ {* [* a3 v1 I- k
via www.winfiles.com. However it was first used by NuMega people to allow
* e0 n( |3 C1 J4 Z7 z/ p% \Symbol Loader to check if SoftICE was active or not (the code is located
1 F8 B  k2 \" ~% t0 G6 i6 [. Yinside nmtrans.dll).+ `9 a/ m' ]* d( R5 ?
  A% R+ e& y/ `& f3 I, {
The way it works is very simple:
) k3 a5 Z) I2 ^0 m. E* T$ a5 hIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for9 r/ v! H- z3 S, r' n
WinNT) with the CreateFileA API.
; R( h0 p8 o; H0 q; O& \2 m" d9 f1 F9 m- L8 V% |
Here is a sample (checking for 'SICE'):
: t0 f5 l' @/ I. J* w' L0 L( |, M' T
BOOL IsSoftIce95Loaded(). z0 e$ ^1 w+ e8 D5 }% i* V
{
6 Y# d2 G: A( G7 c/ K5 d   HANDLE hFile;  
: t, ^/ I8 S: n% I0 k- \  k- [7 A   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
$ j1 v$ [# y# p4 ?                      FILE_SHARE_READ | FILE_SHARE_WRITE,
' w( \! @1 \& Y5 {+ ^! @- i                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
+ u  g+ x7 w: X( u$ j9 H   if( hFile != INVALID_HANDLE_VALUE )
  U) R6 \& G$ ~# r! K7 @   {
4 b% E5 o* V; C( w9 y7 Y, F6 o2 O      CloseHandle(hFile);5 e) {: _5 j* D' D) P) a
      return TRUE;
  {% R  `6 K: Z   }
* ~  o7 I  V9 i3 N0 {   return FALSE;
1 {6 [' |" k, }5 C! Y$ r9 {}5 v, K" U; ]2 g+ p: F/ W

0 i' l0 d4 `+ f0 g+ S$ PAlthough this trick calls the CreateFileA function, don't even expect to be) i# y% v2 G" k% k
able to intercept it by installing a IFS hook: it will not work, no way!
6 Y1 g/ G9 W. E  u; I$ t7 uIn fact, after the call to CreateFileA it will get through VWIN32 0x001F( @: f% C  @& m
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function), v3 ~8 _' [7 h6 u2 _& w
and then browse the DDB list until it find the VxD and its DDB_Control_Proc) q- [9 p% `  M) }, U5 ?: J
field.
* J' m  U8 v: o" H' D# AIn fact, its purpose is not to load/unload VxDs but only to send a
# i- p/ r# H6 V! W4 TW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)4 j4 L5 G) n2 r
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
" T. F  g4 |' K6 a' e0 E% W/ A+ T9 pto load/unload a non-dynamically loadable driver such as SoftICE ;-).9 e7 [1 k1 a% J2 d; G
If the VxD is loaded, it will always clear eax and the Carry flag to allow
( U- u1 N7 l. o6 P! u8 h! wits handle to be opened and then, will be detected./ C& Q1 i0 k6 S, I
You can check that simply by hooking Winice.exe control proc entry point1 q) L1 y7 K# |5 }
while running MeltICE.
; [; y; h$ p/ k. \3 Y6 T4 k0 J/ x7 c7 J( X3 ~

5 J8 U$ ~4 X% N+ m8 V. V% b! m3 n  00401067:  push      00402025    ; \\.\SICE
& @0 A4 p8 c( D# \+ O  0040106C:  call      CreateFileA
/ b- y: t0 _, {6 h  00401071:  cmp       eax,-001" d4 O) t) _0 b, L$ e. R, B
  00401074:  je        00401091' U9 p; h3 _- P7 }; C" A" k
1 E( Q  m0 N" C# }9 Q9 Z: ~; ?/ Y

3 f. J" V+ R4 x+ L' z& ZThere could be hundreds of BPX you could use to detect this trick.
: y3 r3 a$ d& d, {1 A% F( E-The most classical one is:) X, c* C+ k# G" A7 a
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
3 y! D  I3 {# b# a0 F- J5 N; Y4 d' z+ J    *(esp-&gt;4+4)=='NTIC'3 v8 ?& A+ M$ `7 o0 u: R

* g, F; x, V0 l, B' u-The most exotic ones (could be very slooooow :-(
! m6 t. L/ g% [5 e   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  
# T& F$ H9 \' p2 l     ;will break 3 times :-(# {- J, M& _1 ~% L9 y  c
  X8 [# i, g- M9 i- U
-or (a bit) faster: ; `+ |. ]( ^2 k. e4 \. x5 M6 H
   BPINT 30 if (*edi=='SICE' || *edi=='SIWV'): P% ?6 u' Y, z" m* y$ _  m' F( Z

& O5 G; A. X+ r   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  - U3 Y# K( b6 T9 S- g/ m
     ;will break 3 times :-(
! j6 {7 o( C* z: J
0 V8 W8 }/ v0 o: q3 Q+ Y& n- T-Much faster:
8 n2 S& q: y2 }% Z   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'" Y( @- n3 t* Z; t

. G% m/ m$ G6 Y! F. UNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
* c! t, C/ w6 v: N2 E" x8 _function to do the same job:
' F1 ]$ L5 T9 m* Z; e: l! k
2 f$ n7 [4 _: q5 @) i   push    00                        ; OF_READ0 p3 M$ Q* r1 Q- B
   mov     eax,[00656634]            ; '\\.\SICE',0
3 F# X9 H6 O% o( o/ g   push    eax
5 ~" a% d7 G6 f   call    KERNEL32!_lopen- U3 `6 t; T1 U" a! `& G  a; h
   inc     eax
& y8 d: N- |- V+ f" P   jnz     00650589                  ; detected) Z4 V$ K/ f  C9 Z$ f2 T  f
   push    00                        ; OF_READ
$ c5 ]/ U5 ^8 x   mov     eax,[00656638]            ; '\\.\SICE'
0 O1 p! a- W+ ?$ \4 F$ G+ E) a   push    eax
! f; R( l! N7 `   call    KERNEL32!_lopen
9 ~& F& r' \/ f. [4 c& R- n   inc     eax3 R( i* h# T+ z# W9 t" d2 V% Z7 g: u
   jz      006505ae                  ; not detected# [' p2 }0 a/ |3 @; W% H1 ?( u, \

$ e) \+ x2 U+ I% ~, g7 w, w% O! ]5 c, ?/ g
__________________________________________________________________________
9 S  e  T  P* j8 i  V) ~/ B6 g2 T' Q. y9 T' }
Method 12; d. Z, K- v0 g+ r( Y- F# e
=========
& {4 e: K0 S4 A5 u2 ]* l3 M" G2 B
, y0 L, i$ [9 z& b* EThis trick is similar to int41h/4fh Debugger installation check (code 05; H" G/ t7 r, U  `& j
&amp; 06) but very limited because it's only available for Win95/98 (not NT)
: u- N9 l: f0 L% d7 las it uses the VxDCall backdoor. This detection was found in Bleem Demo.
+ K7 ^: T. ?8 C1 o! Z& `" A/ [9 n3 a# B
   push  0000004fh         ; function 4fh
& y7 s$ V& g1 n; a   push  002a002ah         ; high word specifies which VxD (VWIN32)
5 X" s0 T2 }7 ]+ s  M                           ; low word specifies which service+ x2 p1 Z1 t5 x
                             (VWIN32_Int41Dispatch)" s' o6 i6 s$ H2 b( W6 q& V" u
   call  Kernel32!ORD_001  ; VxdCall
0 U8 X: o, |: ?' b/ K; ?3 G   cmp   ax, 0f386h        ; magic number returned by system debuggers
4 H5 z# {* u. ~, X+ k% c. K   jz    SoftICE_detected6 i+ _0 Q/ l. k$ @
- G* W# r3 Z1 i% l" }
Here again, several ways to detect it:0 B6 K( T; M. ~9 J! H) }
: a! b% L, O# \% k# a: C' P3 ]9 M3 G
    BPINT 41 if ax==4f
" t) h* j5 L. l' J* m/ U) O5 v9 S$ N/ }1 r
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one# M5 d: T  U' C- z. ^& l

5 j( M, s* Q" m7 o: N# h    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
, C% ^2 W/ w& l1 }
. R) G3 T/ k; ~    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!/ V  `% G5 t7 t: L2 ]9 Y! I+ V6 ], [

- H0 R1 S( d4 \__________________________________________________________________________) ~- X% n5 q1 d  w( O
5 E) {2 l  Y0 u7 [: p: |
Method 13* D$ `% p' z5 O* l+ T
=========. B( f' ?8 u3 u+ H0 O. z

( j/ q7 F) D9 V& SNot a real method of detection, but a good way to know if SoftICE is1 E' I* j/ }6 }9 r( b
installed on a computer and to locate its installation directory.
4 w( u5 a7 m' s7 r  i6 TIt is used by few softs which access the following registry keys (usually #2) :
: Z$ k9 Q9 C6 P# Q* X' u' S0 c! d$ m1 v3 S
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion; e5 c# k; J1 \2 U4 W- E3 `
\Uninstall\SoftICE' z+ R2 C* E" W/ |' u: b; J- O( Q
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE% K* m. S  ~3 V% L! e* d& N% X1 _
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion. P  {; D  q, a/ `  m2 E. H
\App Paths\Loader32.Exe" G( T' _- E3 i. d
& g6 }) c/ y: L# C6 Q6 P2 O
  A! y+ h1 s* J. M& Q& a) U4 g
Note that some nasty apps could then erase all files from SoftICE directory
% _* b+ H+ N8 Q8 k; c- M! J(I faced that once :-($ i- Z9 B  i1 t( w% h* b7 S/ m
8 U4 C4 k; ]  O7 W. A  `+ |
Useful breakpoint to detect it:$ \3 M. B4 x6 \, B9 [
/ l5 L, `- e1 l+ Q5 Y
     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE') H) H6 R6 b' G: R# r7 G
0 }( S; r. v/ R9 P$ F7 s# o
__________________________________________________________________________
/ H1 v& s) E4 j, s
: U9 Y( U) S, R3 K  Z+ A; {5 J
  |8 {2 x, _, g) t$ S+ X4 K. tMethod 14 & g6 H+ C4 o; ~( G' f
=========% s4 o' @, l" J/ ?2 o' M

: g( I$ v3 l& c6 N8 DA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose* N! ?, ?% f" g; w
is to determines whether a debugger is running on your system (ring0 only).# _0 [& F1 E! g$ p. Z

' \! y% Y- I) r0 S   VMMCall Test_Debug_Installed5 U+ _8 ]1 H* n' h; s9 `
   je      not_installed2 O8 T* f8 B5 ~% P

: q- ^0 K( E# oThis service just checks a flag.
# A5 v+ m# A+ S, m* a6 @</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关注公众号

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

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

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