找回密码
 注册

QQ登录

只需一步,快速开始

About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>3 ^5 c( T7 `5 @* Z; {
<TBODY>
/ s- B$ H* F& @+ w5 V<TR>; ?( G( ^3 `; j) a2 V* M. l% u
<TD><PRE>Method 01
# ~4 @- M, |6 R2 n& Q+ d=========: L4 |8 Y' N2 q" k5 Y2 O6 j  s* Z
( y' e1 w% U: U( ^2 ^- @, r( B
This method of detection of SoftICE (as well as the following one) is, V8 _' U1 j6 ?& S' j* o4 o( X
used by the majority of packers/encryptors found on Internet.6 b" f+ v' S& X# i) }) N& u
It seeks the signature of BoundsChecker in SoftICE
- Y' `/ _# E# r9 `6 ~+ u+ }0 j/ q% f# Q3 J9 j3 r
    mov     ebp, 04243484Bh        ; 'BCHK'
4 j, ?" }: z2 `    mov     ax, 04h
# ~8 M# k8 O, p' s: C1 S* S8 V/ ]; I    int     3       , W7 q. n- f- G4 m* v
    cmp     al,4
2 d! x% V' M9 {* N5 \4 j- h    jnz     SoftICE_Detected. m) i& L5 Y1 R8 n
! n7 o  z* s; P- ^! k' Z8 {7 Y
___________________________________________________________________________2 ~" ]2 i4 F1 k( p3 Z: ]# g

5 o  G  h/ {: D+ u/ _) tMethod 02/ X2 c+ x5 V0 @
=========; c& S8 a8 J" o* y0 y
9 Y: Y; |  O8 ?8 K2 j4 G
Still a method very much used (perhaps the most frequent one).  It is used
$ Y+ C! y7 [9 E5 J9 \+ zto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
5 B) `8 ^; J) [. yor execute SoftICE commands...: m, N+ T/ T! U  t- v. I  A
It is also used to crash SoftICE and to force it to execute any commands. D4 ~1 K; J' N8 W0 p
(HBOOT...) :-((  
9 R3 X; z4 B/ }1 }3 a( ~9 s# Y7 q; P' O" u. V
Here is a quick description:
7 s- u2 O1 t8 W, G1 U: [/ j  Q-AX = 0910h   (Display string in SIce windows)
; _. f" W& [0 X2 `% [-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)5 V8 y" ^0 R+ H1 ^5 L; d6 U
-AX = 0912h   (Get breakpoint infos)
; M) t  b. b! c: y-AX = 0913h   (Set Sice breakpoints); ], K( H% l/ h; \3 x, d
-AX = 0914h   (Remove SIce breakoints)3 g4 c) L2 j; i9 }3 T$ r4 `4 L: t; q

4 K/ Y6 b) H' d5 H. g' T3 gEach time you'll meet this trick, you'll see:
2 K) f. ~4 l7 D0 Y0 t- o-SI = 4647h6 }: C/ [- a. t5 p# L% s% D! e; O
-DI = 4A4Dh
" @5 H; j' Q, H! n! UWhich are the 'magic values' used by SoftIce.
7 w" _; t& z" b3 U; g: s% q5 mFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
; u( [+ ]0 g, Z; ~& P# _& N4 P/ k( r, j1 G* h& @# W) b- C: S
Here is one example from the file "Haspinst.exe" which is the dongle HASP8 R3 P' D% A- Z: g, X0 q
Envelope utility use to protect DOS applications:
  x/ {/ J$ C" e8 p) ]( c# |# e5 \7 G+ T/ U3 t

1 c5 C9 c1 {+ A4C19:0095   MOV    AX,0911  ; execute command.
% h0 W; r6 ?7 ^. P4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below)." ]  `* R- O2 r1 s4 M2 Y* h6 l* q9 E3 b
4C19:009A   MOV    SI,4647  ; 1st magic value.
' b8 o: c* u* b, M# Q7 B7 Y) z* t4C19:009D   MOV    DI,4A4D  ; 2nd magic value.
! @; b( w% Q& W- ?8 m% V4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)+ R2 ]4 X6 M2 k! ^
4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute
9 s' m* f- K8 f, Q& U% v  ~) Z4C19:00A4   INC    CX
! T- E3 |8 ~5 m! ^2 y0 d; t4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute  d; L& f& [( B
4C19:00A8   JB     0095     ; 6 different commands.! z8 w; c1 ~' i. b, u3 S9 |' ~
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
/ S2 i9 u/ g0 N2 `  \9 a4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)
* X3 t5 }4 x+ A  y  t+ G- `
. X# s0 s+ T$ [+ `) R. @) f/ ~The program will execute 6 different SIce commands located at ds:dx, which
$ s( p6 w! j1 [+ oare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.. v- S: }( f2 R0 [( i  a1 |6 c
" f* f& V9 Y; V' e0 V
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.5 B& U8 H0 Z# ]
___________________________________________________________________________, @! b" n8 ~- w9 W% E$ W, c

: _1 U4 D: I" F& M5 V: G
! v* t  Q; j3 U8 nMethod 03
. p  E; B. E+ g=========
( H! V6 B8 |' U2 E
- r4 p" B0 T% }, I% |5 j  HLess used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h' O0 Z( d9 M! T. n
(API Get entry point)
& ?  k1 ^# U6 }3 }, g. w9 V        ; R# R2 L) k  p' e' F

0 w. d* S% U5 W5 k$ |4 X9 h    xor     di,di
2 F$ A0 Q8 S) s% K* C& n    mov     es,di
/ F; I2 z: m1 e7 l/ f    mov     ax, 1684h      
, L  |2 ^/ L9 y0 t2 {# h4 x    mov     bx, 0202h       ; VxD ID of winice
1 J8 G# s* K/ [4 l& Z4 m    int     2Fh
7 K* s$ f& M  J, U, @9 F    mov     ax, es          ; ES:DI -&gt; VxD API entry point  W5 ~4 \* d. A3 {1 G; f, G. W
    add     ax, di$ Q* Y6 o4 Y4 r. k
    test    ax,ax/ }/ ~  u% q$ i1 Q% p# p
    jnz     SoftICE_Detected
/ l9 S1 G$ `* h3 t+ E
8 W! O+ o4 m# n, l2 R1 L5 [2 K& E) g___________________________________________________________________________0 n' P/ _1 Q8 s- [$ _

$ ~. }' n6 ^( [) l' _6 tMethod 04, E; H; N& E& f8 M/ l& w
=========# P' A. e6 B$ v. J

& [7 Y& g1 o; j, y; }Method identical to the preceding one except that it seeks the ID of SoftICE$ Z3 ?! M: ]! ^) ?6 ~0 A# j
GFX VxD.
5 [" a, W; n2 d' u. n- j
# Q9 c) f: S1 P% {0 o! R  Z    xor     di,di
0 ~2 R0 f8 K; i& ?1 A% I    mov     es,di- o* c# S  y9 W/ m( V# |& V! e
    mov     ax, 1684h      
* N, \/ `& c2 a    mov     bx, 7a5Fh       ; VxD ID of SIWVID
! Z6 t+ X2 j6 w0 u3 G    int     2fh
, Y8 k- m; D: B! y; t, S    mov     ax, es          ; ES:DI -&gt; VxD API entry point) b0 R" o( ]; y2 {) `3 I$ Y* \
    add     ax, di! Y0 G( @4 \# ?8 b! \
    test    ax,ax" d! b; e* z/ F6 ?' ?
    jnz     SoftICE_Detected
% r: j* j$ U. P9 U  }; B
( c. l  `2 A9 N3 I5 M; e+ y__________________________________________________________________________" u& K  C- q- P, z

  s9 l0 h/ H, h; e% x7 l$ y# v
, a1 x: [. }3 o7 S& w' [Method 05) S0 ~' N! z! A5 M9 ]
=========
. N% P8 d4 }0 X2 ]
# o  k8 `& G# A) t  cMethod seeking the 'magic number' 0F386h returned (in ax) by all system
; e- y! m% y0 a: Y0 n8 |debugger. It calls the int 41h, function 4Fh.
2 f( ]7 r& [+ o4 [5 p7 |+ D! v4 pThere are several alternatives.  % \7 \0 B' q( X/ Q9 s
. G0 d; j) e5 \( F/ G. f9 J$ a5 U
The following one is the simplest:
; `8 {- m7 f6 b6 a! \/ u. e
5 K" O. h; q/ @9 b- C5 K    mov     ax,4fh
1 y' \6 ~. k# X/ |* B, i5 k1 v    int     41h8 X5 ]1 N9 V* [5 H, N8 C
    cmp     ax, 0F386; O  f8 E/ P$ N3 Y3 V
    jz      SoftICE_detected2 v6 A* I7 J% D0 Q) s8 _

" M! K: `5 S6 {1 _- b$ ]
# G8 A. G. |; ?Next method as well as the following one are 2 examples from Stone's ' l. Q' w% U$ A* }& P4 A8 |* b0 z
"stn-wid.zip" (www.cracking.net):
1 F5 b4 u! B. s! g; d6 Y3 o( q. S+ c1 \
    mov     bx, cs
4 d! k, }1 }/ F, |2 |! P6 e    lea     dx, int41handler2
5 }8 i1 i9 l- ]& H6 B7 i    xchg    dx, es:[41h*4]6 r" Y8 d7 ^4 f6 O% a5 `
    xchg    bx, es:[41h*4+2]
5 i% Q8 q! P' r% ?: [    mov     ax,4fh
+ W2 V" E' [$ C    int     41h
: I% S( V8 R+ O3 H8 [1 G    xchg    dx, es:[41h*4]$ w# W4 f7 Y5 S4 [8 l1 b* i3 }
    xchg    bx, es:[41h*4+2]
* R! v" `  b% K% w1 i0 o- i    cmp     ax, 0f386h+ [) |& p- [# {" v! _7 Y! v
    jz      SoftICE_detected  F4 a+ J. e: h& ^$ }' Z# ]/ K" O, X

* B0 [' e5 h; w% wint41handler2 PROC
- C9 e" I4 w' c8 |! P5 L    iret
9 n9 Z2 m5 ?5 c+ f  p" Kint41handler2 ENDP
: S4 T4 ?# x: \/ y& d- s' k" d3 v" G' q/ p/ u

  M/ o8 e* C% O% Q0 |6 M_________________________________________________________________________
& e& o& {; c5 {: J/ L7 p0 S9 i) P; Q# H# \7 e( _5 T( O: g( y
. A. Q: ~, N5 B% A! k/ F. P6 e
Method 06; s6 ]: V, z: |* Y1 |
=========0 p* ~9 I% o/ e+ g: h* @0 N

) i0 e. B+ s3 d+ P8 B6 R) w- E
: W3 U7 Y3 E! m% x2nd method similar to the preceding one but more difficult to detect:* b1 o- ]8 H& e

+ k& o3 V2 r* m6 T8 Q0 s) D( M$ b; c$ Z; n% k' Q: @* _# e
int41handler PROC0 ]0 `" \: \! y2 e& @4 [
    mov     cl,al
  g; s0 _0 Q% j    iret  F. t) }: u5 o2 b! d5 d
int41handler ENDP$ T( ]: n$ B1 [# G5 S8 E( c  H3 q
% G4 J- V  ]  S% _- {- I& w) b

1 m) Q: I  D0 B, K    xor     ax,ax: V" k3 N9 @. c) h$ N0 @5 [, {0 x
    mov     es,ax
' t  `3 D/ q0 H    mov     bx, cs
4 y. R1 h' s' y' v    lea     dx, int41handler* z7 }3 o9 I/ G, W; S# \. D4 y1 X
    xchg    dx, es:[41h*4]8 Y; Z7 a" t! t' m% C
    xchg    bx, es:[41h*4+2]* f2 V; }; x0 {# m6 x- H
    in      al, 40h
7 t2 `* G2 ~* L1 w7 r- }  z( e. B    xor     cx,cx
' F0 j- j, b7 K  G( B) m  w- L* _    int     41h  m& t) p  V; R) x; @- T% P* Z) M
    xchg    dx, es:[41h*4]6 ]- R2 H9 o( W6 l) l. g  U: M
    xchg    bx, es:[41h*4+2]
# a" g! E1 b8 r, u, q    cmp     cl,al. _5 K2 S% m3 b, w1 J
    jnz     SoftICE_detected
% ]; \, K+ y) b1 ~# Q
' R+ }( M+ [" d# S_________________________________________________________________________  ~( J! a! {9 p$ O

* Q, H* y% N: L7 w+ s' FMethod 07% n3 [! {5 S3 z6 z
=========
5 s3 `6 z+ [) O9 {) }9 j, d* h6 B. l7 j! u/ h
Method of detection of the WinICE handler in the int68h (V86)# F1 m# m/ W# T5 m5 o. O2 m" S

' W2 Z  t4 O, q" |- {    mov     ah,43h& A7 h* j9 x3 U  [3 Z9 t9 B
    int     68h
7 s7 y0 N/ U7 c/ W    cmp     ax,0F386h
' H/ @. D) a, P    jz      SoftICE_Detected
" y$ E1 n: r4 l7 o# N! d! C' p% H% C+ j. x4 [/ |1 M. P
. G9 Q! L4 H% W9 q- q
=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit% w, z! U) A  S" w2 N
   app like this:2 ?, q' j, w  i$ [6 a8 e3 K% A
$ a- Q0 F6 J5 P8 n; r0 z
   BPX exec_int if ax==68
5 D: D- V8 y! k( [5 \   (function called is located at byte ptr [ebp+1Dh] and client eip is
& B1 o4 E9 N$ S, Z- e   located at [ebp+48h] for 32Bit apps)" r) @+ z6 p2 B! N
__________________________________________________________________________
+ D: f- ^" }, a  d4 ^/ c9 y
# x% P# e! [# b' y) l9 Y8 G
2 W) _+ s# W* d2 W1 y3 ?, S2 zMethod 086 f, y( M8 B9 C
=========! _+ o7 H4 M" Q" B

" a% L5 ^, Z5 J) XIt is not a method of detection of SoftICE but a possibility to crash the
. _" k& k/ o/ R) @+ ksystem by intercepting int 01h and int 03h and redirecting them to another0 O) G9 s# @  x/ [$ X+ Y
routine.; \" r4 E4 v$ A" G
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
4 l, X+ w  R4 |; _7 N6 W) [, W& vto the new routine to execute (hangs computer...)
& g6 t9 O4 n9 n) L  ~
* W7 ~! M: [- _    mov     ah, 25h
) B0 j5 `) V( y' L    mov     al, Int_Number (01h or 03h)
2 u6 @* C9 i; ]* G    mov     dx, offset New_Int_Routine
% Y) h: X/ O7 R- d9 a7 r6 |3 J    int     21h8 M1 b- F, \+ Z& I7 J) n3 z

9 {. I2 f* B& ]( j__________________________________________________________________________7 o( ^) j, f. X9 K
6 f, W# U! U! X2 W
Method 091 C. Q7 P, S4 n9 k/ @* D/ o8 q
=========( d! w: G, N+ D- D- e% o: e

8 e  X$ L' g9 c4 ?' [/ t6 TThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only1 ~0 z; a: E7 ~; o, }
performed in ring0 (VxD or a ring3 app using the VxdCall).
9 T' d0 g: M2 y. BThe Get_DDB service is used to determine whether or not a VxD is installed
7 T% Z/ o; z7 H0 Rfor the specified device and returns a Device Description Block (in ecx) for
* j- e  x+ e  ~, {8 [# }0 Sthat device if it is installed.
$ L  X6 `6 K& K: Q- n' ^5 I/ X0 R; ?8 S7 S$ R9 s; }- t
   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID
/ u, l* L7 C; o1 z$ z, G4 Q$ O   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
+ r3 w$ P6 ]' y; |% T6 B0 s   VMMCall Get_DDB1 f$ i, s8 Z. \
   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed; {6 u4 B; T# A7 z3 _4 n

3 D7 w: k# m8 \Note as well that you can easily detect this method with SoftICE:! \3 j7 z. K# L( f5 k
   bpx Get_DDB if ax==0202 || ax==7a5fh
" Z+ S6 A7 P) Q4 @+ U7 P  v  f% O/ |9 g. K" J
__________________________________________________________________________2 h) J) C' ^7 _/ Y" v" w

% A0 p: k0 G! F0 F! T7 _Method 105 P$ @: t( c2 v6 U" e- B/ C- E
=========/ s; `/ N* ?2 n1 |7 z3 i5 J% \7 [

& n1 F/ x# _* a=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with3 w  @! a/ ~& E4 i$ y! L& y
  SoftICE while the option is enable!!1 o' S) e) S# P# D3 L
8 g" o& E7 P: M$ V' w" d) T( e
This trick is very efficient:
$ o5 r- }; Y0 u( N. [3 b, V, vby checking the Debug Registers, you can detect if SoftICE is loaded$ G: X8 A3 m1 G1 w; z( j# t
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
) L' c- f, N+ X7 |- m1 Ithere are some memory breakpoints set (dr0 to dr3) simply by reading their9 I- d0 e1 s: z4 E: \# J
value (in ring0 only). Values can be manipulated and or changed as well
( F" j' A2 a# @(clearing BPMs for instance), Q2 e7 ~  p0 w/ q9 t+ z
" W' ?) G9 I/ a8 s6 Y' J
__________________________________________________________________________7 n2 Y2 S7 Z, o( J
  z! ?- w! R. k% }' @
Method 11
6 u+ R. A. F; b4 C6 s6 ~=========' v) ^' K) w* y9 k5 n+ F
7 [; B$ [- s  }3 g4 ~- W4 l
This method is most known as 'MeltICE' because it has been freely distributed
, v. V1 @' m5 Uvia www.winfiles.com. However it was first used by NuMega people to allow
/ h9 _8 k$ G. cSymbol Loader to check if SoftICE was active or not (the code is located
$ b/ |5 d$ c, O. }inside nmtrans.dll).
: k+ U2 L# O) |; z3 r8 m! Y; U6 g7 G) O3 J3 H
The way it works is very simple:3 q- O' Z, ~$ O/ U8 s0 s; N" K
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for7 _! i( Z/ ]( ?( r* s
WinNT) with the CreateFileA API.$ Z/ F( i: W. ~; {' Z
- m6 t% n* j) w( z; t
Here is a sample (checking for 'SICE'):
3 K/ b! _5 w$ @( R( S
9 F  p: y7 @6 v& hBOOL IsSoftIce95Loaded()
6 ~; P, S' L0 G/ o# |& `6 B" b{- p- |0 ]* V  D# w$ h
   HANDLE hFile;  ! k9 B* p; o% w+ C$ Z# t
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
) c, p) N) r5 D8 ?                      FILE_SHARE_READ | FILE_SHARE_WRITE,
( P- N2 j3 r; }3 ^                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
" Y3 \& I4 a2 {4 M5 L4 r   if( hFile != INVALID_HANDLE_VALUE )- V- ^2 H4 {# t5 z% h0 v
   {, T) e- k+ p4 o
      CloseHandle(hFile);4 `6 Z2 W: L( Y9 y4 t8 G+ Y- p; r% e
      return TRUE;
' M% M3 ^4 L8 s2 I2 M   }
" U, T& v1 K- f4 `9 C+ F, z" D   return FALSE;3 K* U, P6 i2 R2 _% }" `
}
" S- \( V2 c2 ?' G. a# S  Z
: |% I& L) `8 QAlthough this trick calls the CreateFileA function, don't even expect to be
0 [7 u1 Z2 @- f. sable to intercept it by installing a IFS hook: it will not work, no way!
( _9 P: O. l" b& eIn fact, after the call to CreateFileA it will get through VWIN32 0x001F7 U' d1 M/ C2 |; j0 c* a  G
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
1 @' C- {, H3 a4 I1 ?0 z5 ~) Yand then browse the DDB list until it find the VxD and its DDB_Control_Proc
+ ^* _" Z' X8 E8 c4 Ffield.
& r7 k9 e3 E; T4 BIn fact, its purpose is not to load/unload VxDs but only to send a 3 I' A- Z, q0 i7 L
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
6 N! z) G. U* [. n8 ato the VxD Control_Dispatch proc (how the hell a shareware soft could try3 A# d$ j* J* a' d! Y
to load/unload a non-dynamically loadable driver such as SoftICE ;-).- ^& V& h6 V5 I+ }2 m
If the VxD is loaded, it will always clear eax and the Carry flag to allow
) F% s/ m" H7 R+ C8 \its handle to be opened and then, will be detected.* ~" Y& o3 t2 m! c
You can check that simply by hooking Winice.exe control proc entry point
3 |5 f* b/ X- S' Ywhile running MeltICE.( \" n* K9 g5 a6 Q( ^3 b. v5 ]
9 L7 s2 Y- |7 d; Y0 w0 A8 `4 x
6 ]4 }0 M( U$ w" k) F
  00401067:  push      00402025    ; \\.\SICE% c  q- q  t: ~( M
  0040106C:  call      CreateFileA
/ \! F) G+ u( w( }) y$ G  00401071:  cmp       eax,-001
! D. p/ H# V$ f( b  00401074:  je        00401091+ X" Y) h: Z8 t5 D" _9 t, p0 @
& T! Z) p- q4 t. V+ P, `
+ P& U7 F  D* g1 K. Q
There could be hundreds of BPX you could use to detect this trick.( y; l8 |$ b1 x( W. C
-The most classical one is:0 |6 C, a% s3 v' v
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
2 {# E8 M) r$ y4 e* D$ g5 j# B0 y    *(esp-&gt;4+4)=='NTIC'* n9 A8 _9 ]. p3 i- d) W7 E9 q) x- k! q
8 e3 F, d. P+ k3 \7 `4 x  E
-The most exotic ones (could be very slooooow :-(( i8 g! s  a& _' R/ w, J
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  2 |% k+ X( S. y6 m# ?2 A$ x
     ;will break 3 times :-(
1 g# P- D! H# x4 ]) s# n
  a$ e: E- k6 V0 J/ @/ a-or (a bit) faster: % U: {. w4 @$ B+ f8 S
   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')" J% p, Z$ r; _- n$ y3 S

7 N% R0 x2 a8 O   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  
+ D- ^! c. @& q& d& H" D- `     ;will break 3 times :-() Z  e) C& \; M4 N, B, U

, L' t+ C: }, g- T0 v7 ^-Much faster:
$ `5 G! a. x  e& [; I$ _/ N4 i9 `4 I   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'
  c8 u) n! Q  u: y$ ~4 D
1 s, S" I6 U: b" p6 g3 z7 a$ ~Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
. F5 v9 b" H. ~1 A) o2 Ifunction to do the same job:' u+ T6 j2 i$ x! G

; w4 T4 O" P8 T. m; U6 H# i   push    00                        ; OF_READ8 B9 M4 @( l! q! [0 A8 x* A
   mov     eax,[00656634]            ; '\\.\SICE',0- I! Y/ q& r$ ~. j
   push    eax
6 |- w' B& f! a% r, `+ f, S! H   call    KERNEL32!_lopen3 c8 j* V+ f. L$ v' V) m8 u% ^
   inc     eax
; c: Y" M1 I% B- a2 O   jnz     00650589                  ; detected
2 u- s! g0 h, M* _   push    00                        ; OF_READ- y1 J4 S* Q2 `( U, S5 A
   mov     eax,[00656638]            ; '\\.\SICE'
5 {7 K! ?% S7 t* e: ~   push    eax' ?) w1 ^& }. S. D, ]
   call    KERNEL32!_lopen8 ]+ r: C2 ~& P# c
   inc     eax% t- F, H. @# t* Q% c3 S
   jz      006505ae                  ; not detected
+ i9 V# u7 |* x& G9 E& v# [
7 q8 L7 ]9 I; B* K
' s$ k% l( Q' O2 t__________________________________________________________________________
, v5 D$ ?  g+ Z: `* o* y# o6 S9 v! s" B/ L5 ?- z) g. Q6 H
Method 12
7 Z& S# R1 `* m! I=========
9 A* y: p4 {" q; u) W" M, e" c. p9 \1 m; t8 O0 _
This trick is similar to int41h/4fh Debugger installation check (code 05
" N. C' S/ w( M/ _; R% O8 Z& G&amp; 06) but very limited because it's only available for Win95/98 (not NT)
! {& u9 c4 u! Z1 Sas it uses the VxDCall backdoor. This detection was found in Bleem Demo./ f8 o3 [; W6 Z2 K% f

& t! H, v8 ]' m' v/ |   push  0000004fh         ; function 4fh
% R4 N8 N" |7 i6 \) [   push  002a002ah         ; high word specifies which VxD (VWIN32)
/ D: _% E, c5 ~- X: V                           ; low word specifies which service1 x/ H8 L+ c3 b2 b; |- ]- B
                             (VWIN32_Int41Dispatch)
6 ^) u  Z/ f8 r7 L$ B$ }, `   call  Kernel32!ORD_001  ; VxdCall
& a8 a, ?3 ?* R* V* n   cmp   ax, 0f386h        ; magic number returned by system debuggers6 l3 P3 Z! C" u
   jz    SoftICE_detected
6 O; d+ }) ]% ?# E! P9 P& d0 c/ p6 a
Here again, several ways to detect it:
1 ?1 t3 I4 ^' O- j' l, Q
0 g% T( x9 }7 o+ r, k- I* m    BPINT 41 if ax==4f4 M! g2 {  D, G9 I& J' `1 e  j

4 B7 F' Z) w" n+ B: i1 A    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one
$ l7 X( d. D' d# h" ~( v7 |. s$ S  _8 X2 y
    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
. j2 f6 v0 i% W$ g  s7 q: o1 K" p8 ^  ?- A0 E$ n( q; h
    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!
: N- T9 f5 g$ Q3 Y2 E; Z2 ?, g2 m# W/ E* p& s/ g9 p
__________________________________________________________________________
% v4 H+ r8 J* l: v( {+ J: a$ l+ Z2 Y8 I& L, ^( Q9 Q
Method 133 L( @: P' _4 k: ]8 q" ^
=========* J' m' y- x# L% A1 T: z$ j. b

4 B) F1 D3 t7 y1 V3 d! z. K' Q, nNot a real method of detection, but a good way to know if SoftICE is3 E) ^& Q, E* W+ ^! v: W, ^& A3 v- g
installed on a computer and to locate its installation directory.
4 P& H- F+ h$ @( |6 H7 Z' L: rIt is used by few softs which access the following registry keys (usually #2) :
3 e& ^0 S# H4 m$ l, v$ r6 j* O" `$ M  w+ h. |3 d6 W. [
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
) y8 l- u" s3 \) @8 V$ Y6 L0 I\Uninstall\SoftICE6 @7 a& D5 u( \
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
5 ~3 E2 m/ i, {' G-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion- w* J# N. m: w9 V! w
\App Paths\Loader32.Exe
6 e# l8 I/ V4 k' c% [6 k" A. v9 q1 U0 `1 u& I

/ o* f# f3 J! T2 VNote that some nasty apps could then erase all files from SoftICE directory" i! l1 R2 U9 _- T  p1 I
(I faced that once :-(& y' z$ J5 a8 i, c

* z9 Q1 m9 s: O% O( q2 _Useful breakpoint to detect it:
4 \. t/ w1 ~( J% v- e: s: W, O3 |2 F: l) g
     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'  n1 d+ J6 B, G' U! Q. ]' J3 @% y
1 k! C  h# W7 t* D" R1 Q6 V
__________________________________________________________________________
' p. r* Z7 Y) T2 O$ Z, _* |
; z/ f. O$ \9 x8 F' ~9 \/ y- d) B: z9 y1 E9 S: Z7 p* e
Method 14
1 p' s9 \9 S& K6 D. V3 F9 b=========
9 R+ \8 [3 {' }8 ~( r) {: J, D) F3 Z5 _1 l1 z: e" [
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
' L; a& G2 f; Q% h0 D' p4 O# wis to determines whether a debugger is running on your system (ring0 only).
6 M1 a9 }, ?2 h- A. h8 f; [& }4 D* O5 ^. @
   VMMCall Test_Debug_Installed
2 f7 Z9 c. u2 i   je      not_installed3 [1 ?/ ^, D# x( S) X

1 j8 o6 J$ L3 d( Q: ?# ]5 L; e' w/ WThis service just checks a flag.
. w8 [* A8 {4 K  ]& r</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-8-15 13:11

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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