找回密码
 注册

QQ登录

只需一步,快速开始

About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>5 u$ M1 p$ ^3 e! ?: |+ ^& _4 b& ]0 L! Y
<TBODY>, D2 p5 k3 j" N: R! k
<TR># q% B: q- T. V
<TD><PRE>Method 01
. |# I/ S2 \$ F- ?4 `=========% Z( o; A( \0 ^. `$ [4 y

# Q$ y. E: r* IThis method of detection of SoftICE (as well as the following one) is
7 _- k. B% k+ |; ], U3 o$ ~used by the majority of packers/encryptors found on Internet.; i- k5 `& y4 A5 L3 O/ ^$ e7 L
It seeks the signature of BoundsChecker in SoftICE
' }& J. V0 g6 R: G: I0 s: E( P6 f) M$ Y
    mov     ebp, 04243484Bh        ; 'BCHK'
6 E& v8 ~- r' h% K& @    mov     ax, 04h
  @+ l8 k" ~" B6 K8 p    int     3      
& H- g) ^. q$ L$ w$ ], H7 M! N    cmp     al,4. p7 [! ^- p8 b3 f# ?" L% j
    jnz     SoftICE_Detected2 j# k0 i1 w. C- b0 G  G- C

6 H# U2 _/ L+ _& V4 i8 Q___________________________________________________________________________* l2 X9 E# w* j% I$ ^

# {, S8 G' S( O0 X) {5 _Method 022 Y- i/ [! Y; u6 j4 X* a5 O
=========4 y/ u- C8 O  |  j, x6 N4 I

) j0 v2 N# V0 I  e) P* zStill a method very much used (perhaps the most frequent one).  It is used& [1 k' G: [5 ^' V
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
7 L& t5 b' v, K+ `" Q7 _or execute SoftICE commands...& I% I1 T7 U' j4 I# C: P- p' d/ f! \
It is also used to crash SoftICE and to force it to execute any commands
, ]6 T6 c6 G$ ~: c3 Q(HBOOT...) :-((  & o9 ~1 x6 z. h, z: F8 _
4 n/ r. t& h+ C  d7 W
Here is a quick description:) Q; J6 u% @- p. @& A" x- i
-AX = 0910h   (Display string in SIce windows)( \8 f% I% F+ v/ X6 v+ Z
-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)% T2 x( Z2 ?. x' Q) g
-AX = 0912h   (Get breakpoint infos)+ Q6 ]9 P& y6 v# Z
-AX = 0913h   (Set Sice breakpoints)
$ A3 @1 @$ g) K9 k3 O-AX = 0914h   (Remove SIce breakoints)" n! E' e7 l+ Q( J( }

( P$ r0 p* L* o( p% ]Each time you'll meet this trick, you'll see:) u/ L( g! w' N
-SI = 4647h
6 y8 r' _9 [0 `4 ^3 A( a1 D-DI = 4A4Dh4 \: s# x2 A7 D  Q9 _! I
Which are the 'magic values' used by SoftIce.
4 O& J9 B' [4 d* }) IFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
' D+ u5 A+ l! w$ R6 C" e/ D" C
# e( t1 o+ q- [$ p6 s. `* v$ ?Here is one example from the file "Haspinst.exe" which is the dongle HASP$ b/ N. Z5 J5 R
Envelope utility use to protect DOS applications:
$ J& ^0 x$ b+ X- H8 a6 [* `: f
: ]- c6 J: T& o% z: V5 Q- P  s2 r8 s3 G. g  o
4C19:0095   MOV    AX,0911  ; execute command.8 u, ?" \( u" f0 T. y
4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).; K( t3 z6 t3 K2 F1 E( v3 G! @1 U+ |
4C19:009A   MOV    SI,4647  ; 1st magic value.9 [. _" W! V$ J; X7 y& A
4C19:009D   MOV    DI,4A4D  ; 2nd magic value.
( U- I- u$ @7 w2 N* N4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
; q4 F2 H' G7 \, u# c* n4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute  }1 \+ C( |# f5 y( e; _
4C19:00A4   INC    CX
0 N. M- b& L7 z8 b4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute
* o: \4 B. z: t/ J* }3 c4C19:00A8   JB     0095     ; 6 different commands.
3 c: d: t* y0 i4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
* F* s0 Y) }9 z! V' }0 z/ Y* n4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)
/ e: ?4 `# D3 v2 k2 E6 j
$ @) T0 P: a0 Z' K7 K0 T" C' iThe program will execute 6 different SIce commands located at ds:dx, which
5 p, p7 c) x6 Z9 `! b+ l& Z0 lare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.' d7 m# y- U7 G* c& m/ S( d( u7 `+ S
& O, h2 Y7 ~1 c# ?& u
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.$ c5 r- x" r/ w; |, l: J+ u
___________________________________________________________________________2 ]7 H- V; ^0 c! Y9 A

2 P+ h2 J1 B( @# a. N. [* C
; k2 ~% Q/ z( s7 Z+ X2 AMethod 031 P! O2 ]2 [0 L3 f
=========
7 P% k* r. t7 k( b9 Z. `5 M' o+ G- a5 v4 F3 N" c
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
8 x+ m2 B, u7 f(API Get entry point)
2 z+ \6 N7 _1 s" r/ F0 g5 a) J/ u8 t& ]        
; G+ s8 T" l7 i! H9 ~9 i, F- ?: A4 C( I5 d, Y5 f$ [: O" n5 X; s
    xor     di,di5 V" q3 m( F- y% ^3 G' n
    mov     es,di
* X; C2 `0 d4 e% B. K  G. F    mov     ax, 1684h       2 z+ P+ Y  C% [7 l: F
    mov     bx, 0202h       ; VxD ID of winice
, K( o4 j' M' J    int     2Fh
* B* `' \7 F4 {    mov     ax, es          ; ES:DI -&gt; VxD API entry point3 B% k/ T% Y) H- [! \7 I1 ~
    add     ax, di
& B5 F2 D7 {0 B4 j9 V0 ?/ Y    test    ax,ax3 y" K: i# w$ u0 Q; C+ u( _
    jnz     SoftICE_Detected: w! O% C! J1 ^' x9 B" ^

$ ]% p% c  s: ~3 ~9 C# b3 y' R___________________________________________________________________________
, {! |* z& A/ J0 K7 g! b! F  `; B& i6 u2 ^
Method 045 Y6 i5 W9 j( w9 {! X4 W% Q' h
=========: [  D7 _$ y! r9 ]8 j

- ^) l; U+ s6 P( s4 `. XMethod identical to the preceding one except that it seeks the ID of SoftICE7 y/ V! V6 J7 q9 \4 v
GFX VxD.
/ ]4 @& Q9 ]7 m0 ]$ k  {, a% a" S- ^2 w' u
    xor     di,di, `3 s5 D7 U7 h$ m  f7 X
    mov     es,di
# ^( U! K% s, c  V    mov     ax, 1684h       . i' c. D, x' k
    mov     bx, 7a5Fh       ; VxD ID of SIWVID' p' N# t: I, E# s3 E; G
    int     2fh. g) \0 ?2 S$ _: F% o
    mov     ax, es          ; ES:DI -&gt; VxD API entry point# r& Z. S3 O# r- T; K: @% V6 t
    add     ax, di& G: r5 E- _% J. I7 A
    test    ax,ax  D1 Q. R/ a4 E# W4 b% U
    jnz     SoftICE_Detected9 n1 \9 N' J. y4 `- }0 F

' l3 E. S) I$ N__________________________________________________________________________
# A0 _. [& C3 M3 e- u( g) k# B/ K/ w) P: p# y" p- N. r" D. O

4 e# k  n" q/ Q& O$ U9 HMethod 059 E+ v8 i6 g( z1 z/ \1 f9 k
=========. w3 `( @1 J5 A8 v
8 G# w4 V5 N) a! w1 B4 M
Method seeking the 'magic number' 0F386h returned (in ax) by all system4 Z# }0 T0 j: R" R6 M5 T, p# z
debugger. It calls the int 41h, function 4Fh.
8 @2 Z* N; @+ K! u( [  }! S5 ^There are several alternatives.  
8 ?5 G- b0 X2 A. {; K+ [) Y! u
5 f; f( \8 [1 K% v9 YThe following one is the simplest:2 H+ M7 q6 G- b- o& w
$ {- ^6 z1 K! x4 |
    mov     ax,4fh
& n9 r2 i; j: K5 u+ Z    int     41h4 C7 v' x3 `  @  c  Q) j
    cmp     ax, 0F386" k9 n* Q5 `2 g+ B9 @/ S$ w$ y
    jz      SoftICE_detected
- S' }* X5 N4 _  M8 _; z$ ~+ k6 M
1 Q7 a3 Q; r* i6 e4 e
* E% k# A  b% U" CNext method as well as the following one are 2 examples from Stone's , T$ q) V2 X2 s6 }( l
"stn-wid.zip" (www.cracking.net):
% U1 H! d4 g! I1 }9 d, X% \6 W4 w3 s# E6 \  ^
    mov     bx, cs1 A) ]. j% Y& W( f) E; w
    lea     dx, int41handler2
( U4 T8 M3 u8 P/ a6 w. f  y    xchg    dx, es:[41h*4], F# O% P) c) F0 i9 S( Q8 e& E& H
    xchg    bx, es:[41h*4+2]
& A" {7 N0 |6 s+ y    mov     ax,4fh8 b  x. h* h6 i5 @9 g  a0 S3 W0 o
    int     41h/ |2 p- K  \& r% \# @4 _) p& g" w" U
    xchg    dx, es:[41h*4]
, a' |' {$ q5 u, q    xchg    bx, es:[41h*4+2]
3 `" c3 R8 z, {/ r4 w3 J3 D! l" |    cmp     ax, 0f386h
3 g0 j5 j* _' O6 n/ Y* R    jz      SoftICE_detected+ K% F9 t) v, U1 B
9 M6 M  o; J7 i. t$ ~0 T  ]  r
int41handler2 PROC
4 u4 G# ?  w. l+ t. H    iret
, F& J3 M! s. @9 N  i5 {& ^int41handler2 ENDP
4 ]! e) F. _3 U) X  o3 G
& j- E, E0 p$ R. p9 f$ H8 l; z/ C' V" `4 O8 r7 u
_________________________________________________________________________  v  v: b# Q& x

% H7 ?  _9 w% I2 Q  l- d7 S3 F9 y4 X! W. t! r9 u1 F! k/ b
Method 06* H. ^5 q9 U/ u. `
=========0 P% O8 P$ v% B2 e
$ S9 K3 o7 Z( r* K; n

" B- L' Z$ k% I# ~2nd method similar to the preceding one but more difficult to detect:
! }$ [! Z' z1 ]$ ^
* F& U" N' K3 t8 [0 m) Z9 B. g  y& |: `9 ?9 q  u
int41handler PROC
0 ]( k( Z- m9 d; P" t) B; C    mov     cl,al- b9 o* `9 F7 E% P3 H
    iret7 [/ T" \7 Y8 D* _3 Y
int41handler ENDP3 o2 A3 {; H# W& U4 V* i1 J, q

% p6 R& F7 R. U" M: r3 ~! n
5 h8 v+ c+ ^! t0 ]+ A$ M' u    xor     ax,ax
, N  B5 }' r% y7 D0 H    mov     es,ax
9 ?: B9 Z* L5 F# [& A* D" T    mov     bx, cs
! D" A  ?3 ~6 `5 F    lea     dx, int41handler4 e- N* z, W$ z; _
    xchg    dx, es:[41h*4]
* \3 E0 a6 z# n" F( S9 a    xchg    bx, es:[41h*4+2]
2 }9 S' j  ]6 W    in      al, 40h+ t& W/ a% T% F) P9 y- {
    xor     cx,cx. T$ J" S) j' w. ~- b' w; |
    int     41h6 `4 P/ _9 r2 c
    xchg    dx, es:[41h*4]
% W' v% u- l# L2 ?) k8 }. k    xchg    bx, es:[41h*4+2]5 {/ J: l/ u; N
    cmp     cl,al) C2 e3 q4 n4 u. P6 n7 t) C
    jnz     SoftICE_detected8 A" r, x4 d; m) X+ ]1 M% K3 F

3 _, i% g$ C. ]: i_________________________________________________________________________
$ s( w6 N8 o: Y3 o, L6 v4 P# {: z( J; d* h$ [
Method 07
% C! ]$ x/ L! r  E=========
; K( ?$ Q( y* F; g( V3 @5 d4 ]" B: Z6 j6 m
Method of detection of the WinICE handler in the int68h (V86)( M6 J/ T1 _3 D& J' p1 D4 k
3 Z# _$ r# e% K6 o
    mov     ah,43h
6 h* K% [: z5 j. \+ z: O    int     68h9 G& @9 c7 |  U- G& c$ N: w% Q
    cmp     ax,0F386h1 b4 U  {+ ]5 l. n2 V- t
    jz      SoftICE_Detected9 F5 R+ r! L7 }+ W: s
; W% U' d. b5 I  p

0 o7 ]. ]7 j% S* h=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
! v! W2 E2 r' J, d! O. i% x   app like this:
/ k4 ?/ b3 c  ^4 ^- v/ x5 I& Y. G
. a( h. _& n$ {" X   BPX exec_int if ax==68
; G" r1 N% U: B2 k* d2 @; ?5 N   (function called is located at byte ptr [ebp+1Dh] and client eip is
3 ]  ~0 {$ w$ |$ W   located at [ebp+48h] for 32Bit apps)
0 f- D8 D1 I' E/ {__________________________________________________________________________
+ \* A7 m' C  A: d4 t' E4 K# f3 U4 o7 k5 j5 s

2 {5 b/ Y9 ^& U7 R, d" Y" x$ dMethod 08
- ]. }, ?# W& g; t=========; M( r  P( o2 g) p8 ]+ d9 L

9 P4 K$ Y# L7 K+ P' fIt is not a method of detection of SoftICE but a possibility to crash the
3 w, P% j) |7 _( ~7 p6 ?system by intercepting int 01h and int 03h and redirecting them to another
7 A% L. s. q; F+ f, eroutine.
4 x% u' K: L; X2 n) N* p- t, w# ~It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points" \; V, _' M2 m; k% @) Q% ]
to the new routine to execute (hangs computer...)
, B; f% v& O$ b2 i! h  V; _+ R) d( W% n8 {
    mov     ah, 25h0 D0 Q( |7 t7 U  j6 x
    mov     al, Int_Number (01h or 03h)
% t9 K4 ~+ L, T/ [    mov     dx, offset New_Int_Routine
! H, i" Q1 W, x$ k- f3 `9 \    int     21h9 J  n$ _1 M! M% X% [. q
' G, ?( G! L, S" o
__________________________________________________________________________
# w& T5 i) Z) h) _$ ]2 V3 e8 s0 m4 |' t5 @. p
Method 09
& H& X( W- a  D: @) }: \3 {=========' H) g3 f) S0 l( J- K! n
: F, w- h+ |9 ^& ]% B7 B
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only, B; O3 c9 }+ S* n4 f' A) Y/ B
performed in ring0 (VxD or a ring3 app using the VxdCall).
$ v9 y2 N* r1 c- v. ]8 O" WThe Get_DDB service is used to determine whether or not a VxD is installed
2 v" g* c! Z& J( ~* M) P5 mfor the specified device and returns a Device Description Block (in ecx) for
# U3 {/ w  X' c" Rthat device if it is installed., ~0 u% {% B5 u: x

+ T& A6 F- C& N" p2 e   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID( k" w* E9 I1 H
   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
* ~4 K0 E- h6 `2 y6 ]  T   VMMCall Get_DDB  e8 q& D! s" M. S% I8 S8 o
   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed
" U& J! H9 t4 z5 O3 E& }! K$ x3 p1 h  [$ E- Q7 W
Note as well that you can easily detect this method with SoftICE:  i- N, v8 V& L
   bpx Get_DDB if ax==0202 || ax==7a5fh
& K) U7 e, M! h7 c3 c+ D2 g2 m% k, X9 N: p/ F
__________________________________________________________________________
* ]4 s6 r6 @  u: J  V: n, s9 c
5 }3 O' j5 _: ?) lMethod 10
( u) f2 U( Z7 ~7 @7 ]=========' [6 s' U8 |" L8 {3 r. ?& w
) I) `' W$ z" ^8 Q8 ]
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with; Z& S8 _6 d* x& _3 P+ y
  SoftICE while the option is enable!!- y0 A1 {/ F& [
3 D  @) F% z* ~6 R
This trick is very efficient:6 x+ J/ M5 B! O
by checking the Debug Registers, you can detect if SoftICE is loaded
. U2 W- L* N9 ~& G, h(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if2 R. s  {0 q) D) d9 _
there are some memory breakpoints set (dr0 to dr3) simply by reading their
1 o7 a4 d: f" x) X; R2 mvalue (in ring0 only). Values can be manipulated and or changed as well; N/ E$ }: c# S) G' `* \
(clearing BPMs for instance)
. z+ t, s/ P3 C4 N$ f/ w0 z5 v* L+ z6 L' m6 N
__________________________________________________________________________( |, m# P9 H' ]4 N% S% [

' ^4 n" v$ v# jMethod 11+ a4 s  u- h3 T% q  k
=========
2 \' T3 T5 N6 r# P' [2 u. ^# ?' f7 O) i( t( C& H% A8 t
This method is most known as 'MeltICE' because it has been freely distributed8 P( ]2 D0 ~( e- X4 O
via www.winfiles.com. However it was first used by NuMega people to allow# f5 i& A6 i. g7 O
Symbol Loader to check if SoftICE was active or not (the code is located
' r$ t& W& {8 B, }+ a) F- D3 ~inside nmtrans.dll).8 N9 h/ A2 A! x+ z6 G
0 B- U8 _2 \0 Q9 A
The way it works is very simple:
4 X  @" i( u5 Y  a" c4 SIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
0 m5 _( R  o8 Y# L% ?) dWinNT) with the CreateFileA API.0 G# {# V9 |8 U' k5 b- }, v; X5 x0 g

, d) e# Z* K# U& c8 O5 F% aHere is a sample (checking for 'SICE'):0 @% W3 [" t% A- L

5 t1 _0 m/ Q) VBOOL IsSoftIce95Loaded()$ R! X: i' v8 T4 k* Z1 G1 K
{
2 q. f6 y% o3 j0 K   HANDLE hFile;  7 W  m' e6 g$ o
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,: D$ h$ T2 o& r) K$ e
                      FILE_SHARE_READ | FILE_SHARE_WRITE,
' V; l# W9 ]* u& c                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);! g, x6 n% C- O. [
   if( hFile != INVALID_HANDLE_VALUE )
$ b/ |* }+ b( n3 d! c' [' d   {
5 g9 ^* y* [8 y4 a8 d      CloseHandle(hFile);( Y- ~8 L5 g& c% x
      return TRUE;% `  W4 e" x5 }& R
   }
" i9 }$ l$ }& N$ d% s% M2 O" V   return FALSE;. n' \$ Z7 C: \6 b( c! `3 u- @
}% }/ q' j/ o% O4 Y
# p  C/ l6 Y, Z( n* i
Although this trick calls the CreateFileA function, don't even expect to be
& ^& U- N5 q7 C+ L& |able to intercept it by installing a IFS hook: it will not work, no way!; ^# c& K' Q. v' f
In fact, after the call to CreateFileA it will get through VWIN32 0x001F9 i7 |- {. \# O9 b' Y/ t$ ]! V
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
3 @, I. D+ \0 v: C% land then browse the DDB list until it find the VxD and its DDB_Control_Proc
: K3 H2 Y. g# V5 m1 jfield.1 E# g$ c1 L; W* v
In fact, its purpose is not to load/unload VxDs but only to send a
- O- u; T0 F7 a3 j* ]  `1 A" hW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)- t2 L9 _' x: u# @2 U* I
to the VxD Control_Dispatch proc (how the hell a shareware soft could try9 D" }! f7 x! ]
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
* H3 i! f& u: ]1 U. c7 l/ eIf the VxD is loaded, it will always clear eax and the Carry flag to allow6 S) {  d( T4 H  c' K7 k
its handle to be opened and then, will be detected.
5 A) ?, [3 t) Z: L" D- jYou can check that simply by hooking Winice.exe control proc entry point- m( u2 X  Z" Q8 q. F# t5 q% L! H
while running MeltICE.
( z; j: I3 S7 ~2 C3 h% O+ T. V0 Z6 M8 b# f, h! L5 Z" A
: j5 P4 B/ a! p, u; |
  00401067:  push      00402025    ; \\.\SICE, N& H) K; ?7 q3 U
  0040106C:  call      CreateFileA
# g: D% I. D6 ~$ C  00401071:  cmp       eax,-001
& T% r! r% p4 d% \3 v9 L1 @* Q  00401074:  je        00401091- ], h8 N+ f  O+ ?' L

! `# r7 D- z& P; e5 K4 V# d4 Q2 x0 K  @4 r1 Q; `6 p  Q9 b
There could be hundreds of BPX you could use to detect this trick.
. I2 j9 L- P' v: O-The most classical one is:4 g" \1 h- F- H# g& A% h( V
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||7 x4 j1 s- l# h. B0 a( I8 X
    *(esp-&gt;4+4)=='NTIC'8 W5 |: x, S! u+ r9 F+ i
. D; x5 a/ q9 q* f' q3 q  I1 r
-The most exotic ones (could be very slooooow :-(
2 ~# W! T) s+ v* x   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  2 G' Z3 \  ]) v
     ;will break 3 times :-(5 C$ d& v6 Q9 k& O

. \5 |6 P/ Z" g, T3 z2 a8 G5 z-or (a bit) faster: " m& K' P! y$ Y0 t0 g* S
   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
( j2 b# j* J) N' z3 d6 }& w0 i5 f1 Y" P, z9 F3 e  e0 V
   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  0 N, h1 |2 N/ Z* U! Z
     ;will break 3 times :-(
" I# Q# ]7 \% X* {
+ M$ c4 Z7 U  G. B; l) [-Much faster:; m, u+ V! ^. P  _6 Y
   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'
6 O: P! D% M! H# ^$ I; o# s# o6 h
" g$ ]1 E0 X  ZNote also that some programs (like AZPR3.00) use de old 16-bit _lopen5 @1 o1 [( b  w, \/ z
function to do the same job:* m8 D% _9 x: e" g6 n' z
0 J0 x  L: z4 w6 X* n& @
   push    00                        ; OF_READ
) u# M5 S! b" e. \; P& Q   mov     eax,[00656634]            ; '\\.\SICE',0
1 ?/ X7 c9 _: r) Q5 j   push    eax
+ w# Q1 f% g* U7 V   call    KERNEL32!_lopen
9 e; o# n* ^: _" T6 i   inc     eax! t& s( A$ W/ Y: K% ~+ I
   jnz     00650589                  ; detected+ C$ l8 ^* p5 L! n* p, K# ^
   push    00                        ; OF_READ; i/ ?3 \) h# N0 H8 e
   mov     eax,[00656638]            ; '\\.\SICE'' I* @# h7 O, Y. E' T+ V
   push    eax& Y) }: f5 n! ~
   call    KERNEL32!_lopen7 p1 Q' N6 s0 N, A" s. p6 O
   inc     eax3 T: [3 a! ]/ J) a& _+ T3 G3 l: U9 z' q
   jz      006505ae                  ; not detected9 e# F" k4 z/ J* f0 g7 L
- f! t' l* c1 z+ Q  y. [+ V+ Z
% G9 K# u+ Z; c) `$ ]/ u
__________________________________________________________________________/ W0 {6 V1 o! k* X" J2 W3 l

# B2 }5 J" w: U4 V) gMethod 12
. S! Z6 i1 ~0 v1 s7 O=========
, K$ w+ g: h4 w+ N  v% `. p
+ f, X& F8 J2 S; T, n( xThis trick is similar to int41h/4fh Debugger installation check (code 05
& w0 ?' J9 t' m$ Z; G! X&amp; 06) but very limited because it's only available for Win95/98 (not NT)
: C6 l: p$ l' `) B$ D) ~as it uses the VxDCall backdoor. This detection was found in Bleem Demo.7 \7 W, o& L6 \' I& V

* @! @$ w& c/ i& p$ {) i  E4 o   push  0000004fh         ; function 4fh" [3 K. s. J$ A# F/ r
   push  002a002ah         ; high word specifies which VxD (VWIN32)
- ~" o: |% ]0 G2 {: p4 }                           ; low word specifies which service
) {$ p& E  G/ W) B0 }                             (VWIN32_Int41Dispatch)1 K$ n& I. D8 J7 V- X
   call  Kernel32!ORD_001  ; VxdCall) C! D  n6 o! R; G8 z5 w: w; G
   cmp   ax, 0f386h        ; magic number returned by system debuggers; Y" o5 ?8 f6 t) i& Y* j
   jz    SoftICE_detected( N0 ?8 z* f8 ^- c% p# h. |2 J& {
6 Q+ x! U" j8 v; e  P4 [; p5 J! P
Here again, several ways to detect it:( j$ ~  ^: m. E; c

5 O$ j! ~+ T9 \1 z* A0 V    BPINT 41 if ax==4f# H, x$ G+ ?+ Y1 a& e( o$ C& _6 i

% A; s, p7 M: A! @( o% c4 \, h    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one, b! x6 Z" z1 W1 Z

" _$ d8 N; O4 O8 n9 R6 t( u    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A# c  z: \3 ?# ~* q, x

+ Z3 O' ^) M4 T( |2 z- [; A1 L    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!8 e; b4 L; v& y: {" B7 ]. v
" U1 F' M  L: D: u
__________________________________________________________________________
$ ?% R- f0 K3 b' x# D, J, }" ?
/ Z* n+ f$ a  k- |: ^# @2 n! {Method 132 N9 p1 Z6 |: I, _' s/ C$ {' @
=========3 K6 N' N4 u. t5 S* M) Z' Z- n

- f2 q0 t9 ?0 q7 r+ z" }Not a real method of detection, but a good way to know if SoftICE is
9 m! ~( D- N5 ^3 b4 Binstalled on a computer and to locate its installation directory.9 |) w7 ]% |' V1 X8 v
It is used by few softs which access the following registry keys (usually #2) :
* g' S2 o" }5 U+ E) G; [$ @  i
2 P- R/ C, R( u-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion4 d$ ^: U% ?" Q/ {  y! k
\Uninstall\SoftICE& ?* I6 f/ j$ K4 j4 {& Y8 A
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE0 F1 d* S8 Q) C* R( A2 j6 R
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion$ W: A3 w& m6 v" ]2 \" q$ Q3 G
\App Paths\Loader32.Exe
5 R7 u) ^+ m* L. f$ {; c8 M
2 H8 t4 |2 m# }  b/ e! V0 Y, j* x2 K6 w9 u  O) R$ ^
Note that some nasty apps could then erase all files from SoftICE directory1 p. P. C7 @* ^" h3 ?
(I faced that once :-(/ N% n# [0 @; ^: ^- m, R( ^
& V4 l  D9 L. @% f9 p: c, |
Useful breakpoint to detect it:. _. E& W" Y( V* Z  R; r4 y. L

  K) k. k. i  _# n     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'  H) f& y# E% Q( H) v

/ l6 M: K" ~4 b. [) W__________________________________________________________________________& W% Z2 v$ W+ b; j% A$ K9 h0 c  i1 B: P

5 L  D% x' l/ `8 [, x
. P0 r/ l! y6 cMethod 14 & ]# O6 H/ b& T( l/ A% l. y) Q2 n+ Q
=========
4 c6 B6 a4 C" H8 M  `1 o3 r, d
/ }" O7 z# ~/ K5 b( g9 `A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose$ D8 C2 C5 D' ?4 ^2 ?6 B" v
is to determines whether a debugger is running on your system (ring0 only).
: o8 H1 L" h$ S0 i  ]
$ ^) W7 O$ Y  S   VMMCall Test_Debug_Installed$ L9 K6 d3 |( E
   je      not_installed- a1 M$ l/ i4 h* V
& f. p5 |( w3 f
This service just checks a flag.
. Q0 H6 ^  F0 A2 ?; n9 X: L</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-8-20 17:47

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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