About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
& S4 u6 m/ F8 X, z% `3 E<TBODY>
8 @8 E+ x+ \3 G' L* \6 }<TR>
& x( o) I) e8 a! \3 Z7 L* y<TD><PRE>Method 01 - p+ S  p0 G9 u9 G
=========) `" S6 e  l9 l& i7 c; O; a3 A* B; e

% ]1 h8 e7 r/ SThis method of detection of SoftICE (as well as the following one) is
0 y) U$ E5 n1 h! l% I. hused by the majority of packers/encryptors found on Internet.! Q  x9 _# Q" V/ t  a
It seeks the signature of BoundsChecker in SoftICE
/ H% s1 f! g5 o0 \5 u0 Z9 j3 Z8 p/ \8 J# V
    mov     ebp, 04243484Bh        ; 'BCHK'9 V0 ~  x3 f* L1 B
    mov     ax, 04h/ r* I& y0 y. Q0 y7 w2 e
    int     3      
  y; j5 V, U0 D- J& m" B& ]    cmp     al,48 }0 ?% _- b# ~3 v% C$ \
    jnz     SoftICE_Detected' y3 ^7 @1 g, i/ N
2 D- ]6 I4 s. F
___________________________________________________________________________
. a0 |5 @. T, k2 d  f8 `
. j6 m- C. A0 e* c6 jMethod 02) O7 H+ ~+ E1 {4 F' M$ Y
=========
/ r- B* ?, X& X' M, o6 n8 j# a) O5 M3 d
Still a method very much used (perhaps the most frequent one).  It is used
" q9 g1 C. j+ e7 T: X' Gto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
  c8 V2 f4 [- L0 m# _3 r, \or execute SoftICE commands...3 f0 r# P8 x/ i8 _6 `
It is also used to crash SoftICE and to force it to execute any commands
  R4 }2 z' B* E5 M0 i+ O, M, |(HBOOT...) :-((  
" N9 J' a7 H1 Q& F, j! `4 M6 Q& d* S! f, F5 Z6 q3 q
Here is a quick description:
) t. v2 m, Z5 v- p! @3 @-AX = 0910h   (Display string in SIce windows)
) ]3 N9 ^+ V$ h! D-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx), A3 m7 h5 `$ q% t* U0 p' `1 F
-AX = 0912h   (Get breakpoint infos)
0 w# ^# T- T3 e: [5 r# K-AX = 0913h   (Set Sice breakpoints)* u/ ?: |! w, C# Z9 Q. p: b( [8 {
-AX = 0914h   (Remove SIce breakoints)
( _. w) F. V9 G: P& s
/ m6 c) B- [4 H. REach time you'll meet this trick, you'll see:# T- ]( b" S/ @8 B0 o  s" N7 F
-SI = 4647h' O& e2 D% J5 Q% S6 f
-DI = 4A4Dh
1 X* F. M) ]+ B. ?& ~" `Which are the 'magic values' used by SoftIce.$ M7 l2 \, u3 g+ ?9 N
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.' ^4 Z: `% _3 i, M
" {" r) h# O+ h8 ^1 P8 d* J
Here is one example from the file "Haspinst.exe" which is the dongle HASP* _) U: e; L/ i0 C6 l0 P
Envelope utility use to protect DOS applications:. |7 u$ I  \: n; C
* R1 N0 ^. `3 d3 M
4 K8 L1 T: x6 C( K, i5 v, j# K
4C19:0095   MOV    AX,0911  ; execute command.
1 y/ A( x5 ?: b0 l4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).+ Q$ m4 C  `" u) I" g1 H
4C19:009A   MOV    SI,4647  ; 1st magic value.
& f' w* I4 x' e' q5 y9 W+ q0 p9 p4C19:009D   MOV    DI,4A4D  ; 2nd magic value.
( S) ~, @/ c, c" u- N; h4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
4 d  Q* ?5 u1 x1 S/ b4 z- N% r4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute* o) E" E' X0 H* \: U5 v
4C19:00A4   INC    CX3 X+ I3 C& G" w! V
4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute
( W- q3 |4 A# P! ~4C19:00A8   JB     0095     ; 6 different commands.9 ]+ N9 |5 r* p/ p% v
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
+ B" P; S  U' K& P3 K7 C5 z. `4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)5 r: ]4 Y/ \$ E. v: K: v
- H6 A( K, q0 x3 j$ _' `* y
The program will execute 6 different SIce commands located at ds:dx, which
$ s; g/ U8 [4 H3 bare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.  w5 j/ P) R0 ^& P; n5 U+ t

/ z0 u5 f- z- ~6 \: S# j* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.1 m' V' S2 G& u7 T0 b5 n) s% H' T
___________________________________________________________________________
. ^  a! U, l3 y1 H8 b
# m; k- {. F: d( `% w5 b( s, Q- J& H% N0 s
Method 03
. J1 X4 Z8 V' {6 {( o! k8 f=========
5 C3 z$ O) v; R; J$ c8 g
8 v% b/ Y+ s  H2 OLess used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h, R1 z6 Y! w; `- Y, F  t
(API Get entry point). z0 U) K! p) y4 d( Q
        
/ G$ A" q% L- j
$ W! r7 W' q- Q, k4 ]2 |/ @4 o( a    xor     di,di# C+ I) d7 U; J/ f; y0 S
    mov     es,di- V7 V' G3 `2 ~% ^
    mov     ax, 1684h      
% F4 v- f8 [. d, R# E    mov     bx, 0202h       ; VxD ID of winice* {$ F  _! U1 A4 ^
    int     2Fh5 A; o4 D" i9 h* {5 i3 E
    mov     ax, es          ; ES:DI -&gt; VxD API entry point
2 R  H% _! s2 k1 T; l    add     ax, di1 D8 ?; ~) P! f8 P- n/ K4 T% g, L3 F. Z
    test    ax,ax
: _8 ~2 d! ~, S- b' r5 K1 [: V' k    jnz     SoftICE_Detected
8 H. H' S& m4 n2 }. h2 r# a3 N0 o) i9 k- w
___________________________________________________________________________
( N( f& Q% h3 F8 Y, S7 S3 m3 k) d0 G3 z- ]) _
Method 04
; z& t) w3 |3 i# W+ C=========
* i% v, f& S+ T( f; M: e' P
. g: Q  g& N5 CMethod identical to the preceding one except that it seeks the ID of SoftICE) C5 F9 x3 h% [  x6 X, C
GFX VxD.
" \3 e" d7 z6 n5 Y' {4 x0 r3 ]2 y2 m7 R  ~3 p) S
    xor     di,di& K) z+ z- q& A% Z" X3 t' G
    mov     es,di: U, w2 U) {+ G6 t, k/ ^
    mov     ax, 1684h      
/ v$ e" O: i8 D% e! G* `* ~    mov     bx, 7a5Fh       ; VxD ID of SIWVID1 l  I/ U/ y9 A% B+ a4 C3 P! j
    int     2fh) l9 J$ Q* j2 i0 m7 M( P6 {
    mov     ax, es          ; ES:DI -&gt; VxD API entry point9 ~6 v9 Z+ f2 u
    add     ax, di4 z; U9 A! n6 I7 t% j% e8 X3 ?$ E
    test    ax,ax6 u8 u9 C2 s# g4 P
    jnz     SoftICE_Detected% g0 c6 o; j' S
+ D* U6 N' \$ l5 p; v) l5 D9 b* `( y6 P
__________________________________________________________________________' F: l* A* ^* L* k' x# {6 W

" T% Y- q1 ~1 L/ l; q5 C* s1 m
3 Q6 \) j* S' t" }/ i5 ZMethod 05/ a/ ~: C  h8 J, Z" L
=========
2 ~. q% u# }4 D: \: \4 X
, M% F. l2 ~6 I$ @6 a% E0 ?Method seeking the 'magic number' 0F386h returned (in ax) by all system* N; |$ @$ f' Q7 _1 V9 ?
debugger. It calls the int 41h, function 4Fh.& v5 b6 @7 }4 Z/ W0 u! ~4 ^
There are several alternatives.  ' M" N" @- n* t
0 |2 l& q& F& \( k: M6 ]) w
The following one is the simplest:
0 ~2 a9 I, L( z) ^' q  s* {! N6 v8 P6 {+ x; W$ ~5 N" z$ E0 h- o
    mov     ax,4fh
* l2 @) g( m. c+ m. K    int     41h
9 i4 B8 Y2 G& v4 Q7 j    cmp     ax, 0F386$ |$ `8 u! U% o7 h1 |0 t0 ~) r
    jz      SoftICE_detected
" D9 @, A; v8 ]9 L( P
. f* x6 p5 |/ L7 J+ F/ M+ V6 L1 d9 l( U1 m
Next method as well as the following one are 2 examples from Stone's " g: u" {- H1 s/ v/ ^0 m+ D
"stn-wid.zip" (www.cracking.net):4 w7 w* r+ N4 Q: ?. B" D
6 J& \$ i; V2 A- o8 Y
    mov     bx, cs
) E! J  f. Z1 i5 e0 V" H    lea     dx, int41handler2
- \0 y( Q6 j' Q    xchg    dx, es:[41h*4]. S! e- f/ V% Z: D
    xchg    bx, es:[41h*4+2]
) C) R8 V+ W9 ?3 D( O8 y7 _    mov     ax,4fh+ k, v/ s' I5 [1 K, o# s
    int     41h) m2 r. J- k, k. _+ B4 S+ T
    xchg    dx, es:[41h*4]
; T$ ?5 h0 ~  P, g  L/ T    xchg    bx, es:[41h*4+2]* F5 ~% u+ m6 e6 Z& [
    cmp     ax, 0f386h
3 u' ]7 J, Q! p# n    jz      SoftICE_detected: {# {! d8 X0 @! M! n" k* ^+ w5 e

9 e0 i9 i2 E# B0 Q% q. gint41handler2 PROC
7 Y( @( g& p+ t1 _    iret" i9 _- l1 B9 i
int41handler2 ENDP
! @3 q/ @. r1 H1 Q  A; P. n$ a8 L2 D1 B' U2 p
) T" v/ ^5 \, F8 t. g; f
_________________________________________________________________________
/ [# M+ E5 A4 H! T
: }0 b# @$ l3 b2 R" J1 x$ V9 I/ G! f' W1 g$ ]
Method 064 `6 y* V0 e0 l! j& e
=========0 f4 l! N9 ~# s4 J$ u/ D7 v# t

. @9 ~7 f/ _% y. K' T! b- k& E2 V& N( B$ T% h& B5 G6 M
2nd method similar to the preceding one but more difficult to detect:  x' N1 _. C7 |) M6 y7 S
$ V0 ?/ [8 o8 [

- }# Q8 u0 ~8 G; Z4 F: `int41handler PROC
& r" W" D6 c: b- w    mov     cl,al. g' a) k* o7 D6 p  e4 X# L( |
    iret. S$ G% o" b5 l* ^
int41handler ENDP
# w0 G" _; |; X' ^# e8 d1 d: N: x& h! z$ Q$ |
$ u# Y! ~6 l1 K, y/ ?$ `
    xor     ax,ax
# m/ O$ _6 ]& H% Z  x8 I5 R1 H. t    mov     es,ax
: C/ s3 `1 u1 I; H) v1 u" p; G    mov     bx, cs
, h) Q- F6 E* O    lea     dx, int41handler
& a* A" j; p0 E    xchg    dx, es:[41h*4]
: H+ k* h9 \$ T    xchg    bx, es:[41h*4+2]
+ `/ ]+ E2 `3 b0 w% f    in      al, 40h
2 `" ^+ X/ A% `" h! Q; I    xor     cx,cx& }" Y3 T6 B. D& o( c# V' L8 A- m! q
    int     41h# R0 H0 a* j/ T5 v4 @
    xchg    dx, es:[41h*4]
8 y" b9 G  z3 E& J3 o    xchg    bx, es:[41h*4+2]
0 B3 [! h' P, p2 ~; C) S8 L    cmp     cl,al
' O9 Y' ], e6 H! A, b3 i    jnz     SoftICE_detected: |0 n- E( r5 p5 P5 N" i7 x

& r* W, [% e9 Q8 O7 j_________________________________________________________________________
4 {! T8 J) F2 q0 U
; D$ Z, Y2 n% l0 ]7 lMethod 07
0 }0 ^' W, H/ `, p=========' P/ q5 e& d9 E8 O- R! n! ~# @

7 ~9 v! {7 \- G# z5 p/ O0 RMethod of detection of the WinICE handler in the int68h (V86)
8 j' M  t6 o: R1 U! i0 r; V& A+ Q1 _$ J
    mov     ah,43h7 o& W* D0 c2 O# a! p- p
    int     68h
; C& V0 t$ w& i5 u* \    cmp     ax,0F386h& A1 t1 G9 Z8 E. _5 U& f& _
    jz      SoftICE_Detected2 ~5 s8 x. Z/ {3 W; A" p- T- w# n
: d" H" w8 A3 d# o

2 D. Y& m, ^) ~) A% X, a* W: {=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
8 w* f& E! W# T6 N  f7 L: [   app like this:
7 |9 j. ^5 _! j. a& Y: `+ j' _) B" s0 P) Y' h. n- H' b4 a* D
   BPX exec_int if ax==68; w7 u3 j& J* ?" c# Z. F& R0 r
   (function called is located at byte ptr [ebp+1Dh] and client eip is7 c/ _. r* ?  {0 M4 n+ E
   located at [ebp+48h] for 32Bit apps)
8 x6 }+ o9 I2 p8 [__________________________________________________________________________
! b$ x: B) t0 @1 t3 H; `: ^' C. O4 l

! q' C( f& a5 ~5 K. CMethod 08
0 Q3 Q4 T$ Y+ u: P" u- J) |! x=========
! r$ @0 A4 i: T/ k) E: a! G
5 C* d0 i, w' c, W2 t7 f* fIt is not a method of detection of SoftICE but a possibility to crash the, m% l  |) y8 _8 }1 S/ n2 T& y% b
system by intercepting int 01h and int 03h and redirecting them to another
4 a3 f$ Z3 \2 n$ h2 W# iroutine.3 h) v& H( k& e- G
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points5 m5 ?" [5 y4 V6 c" ^- Q
to the new routine to execute (hangs computer...)! A9 H+ o0 f$ o1 D
) v' H$ B. u/ l8 a! o2 R8 S
    mov     ah, 25h
( ^. A7 Z; m! m+ r# S8 h1 L    mov     al, Int_Number (01h or 03h), P2 }* H% i" T, _& W8 ^
    mov     dx, offset New_Int_Routine
0 Z; U- n& n. Q$ f5 z3 h* j. ^1 D    int     21h+ U4 j8 ?# ^" ?

- y, s, w# @8 W7 [% u/ |6 r__________________________________________________________________________+ X4 K1 L, r" y: z2 F: y
! D( U* |, T: l% _3 p: F
Method 097 j  T" X0 J, G3 @
=========; S( f. z$ J" J6 ^& V

' D7 Z* _" a0 Y2 }This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only0 |2 ~; V- g  w% D7 V2 W# c
performed in ring0 (VxD or a ring3 app using the VxdCall).+ t0 ~5 ~* g$ ~% B
The Get_DDB service is used to determine whether or not a VxD is installed1 |, Q, f# ]& A& O8 y; k/ \
for the specified device and returns a Device Description Block (in ecx) for3 T: b" P' p7 E7 ~) l
that device if it is installed.
  X+ n- o# O" x( R# s0 @9 V: ~) a7 q) Q' Z. u/ x
   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID
1 M) r6 E  e3 F   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)7 Q* k- d8 q5 ~& [; ~9 `2 |6 c/ G1 j
   VMMCall Get_DDB/ p* z+ y; f+ T8 `' Q7 J: o) j
   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed0 N3 Z3 W2 m. G' R
3 j( C& c: a/ u1 g) `! n
Note as well that you can easily detect this method with SoftICE:
) S' r9 B2 o- n- D2 V' h   bpx Get_DDB if ax==0202 || ax==7a5fh- q$ f( \" _8 j, M, [

: t# Z) {& b: ~) ]9 q/ x2 I__________________________________________________________________________2 ^6 z- {" `$ a. Z$ O: B! Q0 P

( A2 p+ p. H( ]Method 10
- n/ P' C3 y- w6 _=========; T. A' J5 L  k, v7 a! P5 p4 y. c
% n/ L# \" ^1 h: f
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with; {3 x$ l' @7 ^0 T0 k
  SoftICE while the option is enable!!/ n( U' P% L! t& N% P

6 @+ U) ~1 C7 ]( O, [; nThis trick is very efficient:
' g6 H: j4 |/ l5 |" Xby checking the Debug Registers, you can detect if SoftICE is loaded8 S9 w8 s5 P/ w7 X2 @* R
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if7 k4 d9 u6 r! V) Q0 |
there are some memory breakpoints set (dr0 to dr3) simply by reading their7 t+ V6 Y1 Y. @
value (in ring0 only). Values can be manipulated and or changed as well
1 x+ Y& W+ b1 Q% B- _3 J) ~; w(clearing BPMs for instance)" w# |3 `4 P( x- y. t
$ [$ W- `! G% P1 P2 J
__________________________________________________________________________
, ?- S2 Z7 J& p- y* C$ I2 A/ c6 H! k. ?
  {1 T) W) R1 q0 c/ hMethod 115 b* S8 T- Q9 U8 n- B$ L
=========  |9 z. x( `3 C- x
( c: X: z3 a2 f6 j0 B7 T; e' M
This method is most known as 'MeltICE' because it has been freely distributed
9 e  Z' m0 N$ q$ @7 V$ Z- |6 Zvia www.winfiles.com. However it was first used by NuMega people to allow
% Z8 k' U# p" T+ w( O( rSymbol Loader to check if SoftICE was active or not (the code is located
2 M7 s! ?5 F; k1 t8 G7 Binside nmtrans.dll).) v+ e! x! q' t0 e0 _  f
" X3 ?- y& q; _7 G6 E
The way it works is very simple:
' T! S! d0 g) ]  b7 w6 MIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for8 ]8 g# T& |/ N8 V
WinNT) with the CreateFileA API." _* N5 a0 R2 F6 r( S! K+ a7 S  ^

3 `" H  L2 m9 {# yHere is a sample (checking for 'SICE'):
* V- B2 q9 G4 z0 i
0 {- M" P0 W" B: F% p) dBOOL IsSoftIce95Loaded()
- t7 |- m4 P3 V. K{5 {3 x# q5 Y& ~" ]6 a
   HANDLE hFile;  
4 t4 Y4 y0 ^( o1 k. U   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
9 Q# o" p# x) ]$ O3 c9 m, \                      FILE_SHARE_READ | FILE_SHARE_WRITE,
9 _( G3 F0 I" X7 g                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);& j& Y+ _2 l! Q* o6 i7 U
   if( hFile != INVALID_HANDLE_VALUE )% a/ ^- d+ e- Y. o3 z
   {
4 X; ^4 C2 q. f! i! I# U      CloseHandle(hFile);7 ^2 }7 |$ O0 M& r, W
      return TRUE;( l( ]3 H( L- ~8 U0 l
   }
/ t& ]8 W, y: g1 h) S! b   return FALSE;
, f7 G+ N8 b' H9 ]}: P" A/ ?% ~4 h; \1 u

  ~3 P: K0 S: ]7 b' p2 |Although this trick calls the CreateFileA function, don't even expect to be
; k& I" ^- d8 K4 s2 Q; Oable to intercept it by installing a IFS hook: it will not work, no way!
: k( ], S2 K; g8 I' i4 }# Z# ZIn fact, after the call to CreateFileA it will get through VWIN32 0x001F  V2 Y  g1 T8 w: o' M4 c' Y- q
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
- M. A9 ]7 d! nand then browse the DDB list until it find the VxD and its DDB_Control_Proc, L. B$ Y% v: e5 `4 Q. L4 i# j: E" e+ w
field.
+ a( G- L7 z+ RIn fact, its purpose is not to load/unload VxDs but only to send a ; I; u3 D: f( v
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
, Q8 D7 c: {, x3 e' {5 s3 ito the VxD Control_Dispatch proc (how the hell a shareware soft could try. j" b  k8 t2 T. G6 y0 K
to load/unload a non-dynamically loadable driver such as SoftICE ;-).( y* A3 V3 t" ?# K; v* h' o
If the VxD is loaded, it will always clear eax and the Carry flag to allow
+ y. ^6 k; [$ ?1 B+ P+ K# Zits handle to be opened and then, will be detected.
  @/ _- z) U& T3 F  F3 [4 c9 _; cYou can check that simply by hooking Winice.exe control proc entry point4 W1 k$ N2 s( Y2 v4 f& D0 y
while running MeltICE.$ b) w5 I' C4 N  ?4 j

% F6 ^5 A1 K1 q9 f, c3 G( p, T" U9 l$ I3 H4 ^8 z" N
  00401067:  push      00402025    ; \\.\SICE
) o& e; q* J/ w. G  0040106C:  call      CreateFileA
. h% H* H$ V  O  00401071:  cmp       eax,-001
9 C, v* v; t8 y  00401074:  je        00401091
: f- H$ [* @" ?7 s  V7 F1 H
: p  ?$ }; q" m. t( W
9 E* Y; j( {3 \! [There could be hundreds of BPX you could use to detect this trick.. O1 i7 H% p5 s: r& \
-The most classical one is:
/ G* K4 e- @. U; a  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
$ P' t0 F: ]1 ^" W' b+ i/ F    *(esp-&gt;4+4)=='NTIC'/ B4 R0 ^3 A( U# l

5 X" f( {4 @  W8 x1 ^6 v: t$ o-The most exotic ones (could be very slooooow :-(
! `; w8 X: g9 {. @( p   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  7 H9 o, \! l/ i: B5 e" O& s' s- c) |
     ;will break 3 times :-(
$ H, N5 h: V0 B' J( h1 f& [5 d# e2 r) s& B9 F
-or (a bit) faster: # H& C/ y; ?* s& V
   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
+ s' S5 Y7 ]& Q8 N: P7 Y0 x$ R% S8 \) u3 E% k0 `0 ]
   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  
" i" P7 A9 ?$ h$ _) {% L, ~     ;will break 3 times :-(1 y/ J( n/ T& d$ }2 c
* M9 x* v5 {! [' {9 h3 D
-Much faster:0 }. F. d$ z* m6 {0 Z% p
   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'
0 B. y9 t$ O' `
! T( q( }+ U' }# T( ]- TNote also that some programs (like AZPR3.00) use de old 16-bit _lopen7 D  r" r; i9 e
function to do the same job:- C# {4 B+ w  o) g$ X8 a

$ b7 b1 {2 @8 ?6 `3 k) \   push    00                        ; OF_READ
- O  A% J7 b3 N   mov     eax,[00656634]            ; '\\.\SICE',07 h% Z7 X- s+ W
   push    eax
: }- `3 k+ f0 Q( E- l) u# G6 o   call    KERNEL32!_lopen
4 X, @% u; O& [, i   inc     eax& U- o& A# M. n3 f* c, b. M
   jnz     00650589                  ; detected8 w4 x& f+ [" t) l3 E' s
   push    00                        ; OF_READ% R6 ?! C7 x& z" p) e
   mov     eax,[00656638]            ; '\\.\SICE'
: Y& w2 a8 P% h; }8 g& Y" C4 @# k! w   push    eax3 V$ j$ R0 b+ o- P" J
   call    KERNEL32!_lopen; W" X5 b' f% n" m: R3 H/ }  P
   inc     eax
+ L+ x7 N1 P, e0 G6 l   jz      006505ae                  ; not detected1 K& F# q9 p4 A
% [: w% j  l0 i0 q7 ]4 |

, c' e+ W( i% @7 {__________________________________________________________________________& E- Z* N: S. U3 T
9 ]+ ?2 n3 n& M  \1 m( ~, K5 I- W
Method 12
$ h: B& @1 m6 a- ]# @! c" W, ]) f=========
8 t7 ]4 |: D; u& Z$ i. [1 P
3 O3 i; b& `6 i( v  qThis trick is similar to int41h/4fh Debugger installation check (code 05$ H$ Y! \: s# h3 m& O9 [6 B0 e9 u
&amp; 06) but very limited because it's only available for Win95/98 (not NT)7 U+ e. z" W. a7 M9 Q8 b- h1 r
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.7 @7 q. r- a: A' c
+ D5 ~) B& u. z6 _: ~
   push  0000004fh         ; function 4fh* }) u  r! B% V* C6 `
   push  002a002ah         ; high word specifies which VxD (VWIN32)  N2 W; l3 s8 E! G: X: Z
                           ; low word specifies which service
* q7 l& N+ \% v: ~/ f% C                             (VWIN32_Int41Dispatch)
  U: C4 K- g+ e/ |7 v4 J4 y' @   call  Kernel32!ORD_001  ; VxdCall
, p" ?& m: e# h8 E$ J7 {8 B5 X2 H   cmp   ax, 0f386h        ; magic number returned by system debuggers" K7 M" [# x/ A) E1 a
   jz    SoftICE_detected/ E* n  D% V. j3 `, ]5 S* M
3 t$ r7 E7 k% P/ @7 l$ o. P) {
Here again, several ways to detect it:
6 ^7 x9 e, t$ ]' q. k7 x" {$ c$ ^" P7 \6 q4 ~# }& D8 b6 Z3 p( \
    BPINT 41 if ax==4f
; E+ G6 b# N+ L% ^* M$ c+ U! W* @' P" A  B2 \
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one* U+ Q2 C! E% X

4 u# R! {, D% M& b3 E    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
( M1 q9 Q7 Z( b2 S) b' k
* w! ^9 L- e6 v8 J6 c; D    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!- e7 S' a7 ~' _  s# a8 m8 [
  j  d* ~2 p- g* _' W9 ]
__________________________________________________________________________
6 _/ v4 X& F" R  Y
, o; g$ b4 N# c8 D7 JMethod 13
# c7 o) `/ ], B* x=========+ n# X+ U; G: U4 M1 t; q
' b2 ^7 i% u3 g3 R2 C- I. ]
Not a real method of detection, but a good way to know if SoftICE is$ d3 Z8 v: b7 s" s: U' q. |
installed on a computer and to locate its installation directory.
) t* N: C# }1 `8 C! U' q( |It is used by few softs which access the following registry keys (usually #2) :
  o' D6 _9 W' e& T5 l+ x
- N2 P, d1 `1 }; B) Z" x& L-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
$ }) V1 l. l  E$ o9 |\Uninstall\SoftICE! R0 p4 }1 K5 B5 K, d" h( i" z& T
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
9 R. m* M1 ~$ Z0 w! w8 m' S-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
$ I) r' l% M5 b! i% P\App Paths\Loader32.Exe
9 N0 P3 P8 s' q1 ]+ ?& U0 w& r
" w3 E8 m3 ?4 e  a- j
% S! ^% y/ ^$ l3 PNote that some nasty apps could then erase all files from SoftICE directory3 W9 A" F& U$ |  @8 R7 f  ?# M
(I faced that once :-(7 z! _8 O5 ?% y; H. Q, f9 k0 M/ n

. G* x5 |/ X/ bUseful breakpoint to detect it:; [% {6 M' ^  W6 j+ K1 p- e
9 g- H" Q( R: o# s
     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
, x& V$ S( z; Y: q' e5 u7 K" w' v
4 h! |! g+ F' K* Q__________________________________________________________________________
6 |% e! q( `  b: h. p" Z6 m: Y' w! x
7 W& F' i7 u& z1 d8 y4 p; X& M9 R% T! {0 L6 g+ @: U/ t( f% y. i7 v+ Z
Method 14 / b! d; c" C4 @2 O
=========' {6 C" X$ ~2 s1 U, `8 v/ ?

. G. c* `, M) I8 c# k0 j( }A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose+ k5 [  B3 }6 s8 l
is to determines whether a debugger is running on your system (ring0 only).  o$ I( Q& q: H% o+ V0 x
3 j- t5 D# {$ ?8 L6 }; \
   VMMCall Test_Debug_Installed
0 S/ _9 Z$ j+ g, \* A   je      not_installed3 b7 g  b5 z  a4 C* o* C, P. ]% N4 Z

2 \: z  z: F6 C% j1 G9 F# tThis service just checks a flag.) J5 r2 b! e* k7 {- H# J: R
</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关注公众号

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

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

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