About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
' ?8 ?8 c  q7 h* y( s. G& \<TBODY>
5 e3 m8 t% }9 S- M<TR>
7 N7 _9 W( r) Y) ?+ b* J<TD><PRE>Method 01
9 ^( m2 _  [- N( s! X=========4 _' ~7 Z- ~  K' a9 Y' X: B9 D

8 T2 p$ E0 ~/ L* |9 a$ ^This method of detection of SoftICE (as well as the following one) is
. |7 g6 d# o! k! K  k+ |used by the majority of packers/encryptors found on Internet.2 i: t4 u* q: I% l8 m4 ?
It seeks the signature of BoundsChecker in SoftICE
5 |( t' o  |0 h1 `5 \
( `  L& s0 b& D0 ^$ O# l- t6 f$ ?    mov     ebp, 04243484Bh        ; 'BCHK', b0 o% Q$ ^! p3 R
    mov     ax, 04h
3 i+ `& a/ w# q% N, ^- h    int     3      
, T/ I! ]# |% N* l& y. C    cmp     al,4
3 A8 o- t: ?% R& P) R7 d" Z8 @    jnz     SoftICE_Detected$ J- S% t9 Q$ P5 S
1 U' X* L/ P7 {( P* q8 X. U* x7 \
___________________________________________________________________________' ~, ?3 A4 h; V! J
# {2 R# y  Y1 v
Method 02
; ~- ~) ~, a6 K$ K3 C9 ]  t=========
) T& g% ^% g  _8 @+ v# J
! E5 P3 R: N  a8 g2 LStill a method very much used (perhaps the most frequent one).  It is used4 i1 i$ I+ W) Q) n& \3 s4 r/ N
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,/ b5 x3 ]+ y# k# _4 z
or execute SoftICE commands...
' ~3 N& i/ ~  V1 ^, t( bIt is also used to crash SoftICE and to force it to execute any commands* K" l0 C9 `  [* i/ U
(HBOOT...) :-((  
- x& U/ N) c* h
8 M7 R6 Y7 K! k- WHere is a quick description:  F: k% d/ B. i' p* e& b/ t
-AX = 0910h   (Display string in SIce windows)  z5 Q1 s. S5 ]+ {9 ?( t/ h
-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)- ?# I6 \2 n! }: D+ h
-AX = 0912h   (Get breakpoint infos)
- \2 U4 z, n% E* S4 D-AX = 0913h   (Set Sice breakpoints)" f$ F* ?, n" g$ g( ]
-AX = 0914h   (Remove SIce breakoints)9 y1 T6 \) U# y( h. U

6 J3 ]0 w% G, e# T. a) {& |Each time you'll meet this trick, you'll see:
) S) [& S5 B4 F. U-SI = 4647h
# K7 n" F. q) A-DI = 4A4Dh) h3 g8 E! Y% j8 ~+ \
Which are the 'magic values' used by SoftIce.
- u+ ^3 X; D3 }8 j  L& V3 GFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
0 X0 ?4 N3 e3 o' X  B& I) G- X) ~! L' H0 ]7 m
Here is one example from the file "Haspinst.exe" which is the dongle HASP
1 d, W/ u* R/ Q, ?  N! U( e# d5 tEnvelope utility use to protect DOS applications:- c. f" ~2 @6 o4 ]

  j/ [' }5 p3 K: P% N1 J, {7 m  ?- a3 |4 [0 M+ ?( y% V6 ?4 p
4C19:0095   MOV    AX,0911  ; execute command.
8 y7 R) H! ]5 ^$ Z5 p( {. _( r4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
3 k  I; h0 G+ v0 o% Y6 n0 ?6 O1 n4C19:009A   MOV    SI,4647  ; 1st magic value.
. W( d0 }- ?) H4C19:009D   MOV    DI,4A4D  ; 2nd magic value.5 G1 \$ n3 @. K9 q6 l2 X
4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*). o2 g4 v1 K6 {, ]1 k
4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute
5 n; U! m& p- m- M! W$ Z, `4C19:00A4   INC    CX
6 K5 ?" N9 R2 c5 K/ a' Z2 D4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute
6 |$ E% P; x. A9 J' t: V6 V, X0 Q4C19:00A8   JB     0095     ; 6 different commands." u- V1 e- H3 P- t: `$ i
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
1 S9 ^2 e$ [# [. ^* T: C' Y8 k" y( _4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)
. X9 b# t" G% Z& X  L! |+ }
( U' ]. g1 q3 O! kThe program will execute 6 different SIce commands located at ds:dx, which9 [1 m& x6 ~/ Y8 d. P3 G  L
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
$ x" g" B1 _2 ?0 ^' T1 c3 D4 ~. O4 Q9 V3 E# Y
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
! q! d( s$ R2 f/ h___________________________________________________________________________
, a2 T- p! A6 o# n6 r# \
; S# D0 x4 v6 S6 ^5 \" }% n- w3 Z) I" ^$ B" y
Method 03- X) Z4 X; b, ?( u; ]& Y" X
=========
" `/ g, z0 Y. v  f" G$ ~3 B5 }; ~$ Q: {; m1 Y! ]: A4 d/ d, c3 Y
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h! l' u( a. Y/ ]5 H/ O# u2 k
(API Get entry point)
/ j4 {: I" i# q        / y! Y! ?7 y. J7 M5 r% n
3 H. T) V- q0 r& J% v& n
    xor     di,di8 |" _3 Y1 H: G6 [
    mov     es,di
8 O# B8 W& n/ y$ L$ q7 _    mov     ax, 1684h       - i  \' {. n3 E+ U# b! h
    mov     bx, 0202h       ; VxD ID of winice& L7 [7 ^# p( V4 a8 p$ S1 z
    int     2Fh
6 F/ g- B( f' i  }    mov     ax, es          ; ES:DI -&gt; VxD API entry point( ~  w  k; [" w  D/ _% m
    add     ax, di
/ m" A: P7 {7 e% w; B( T; G7 E% h6 B    test    ax,ax
, h! ?3 k$ N* R- G/ o+ @    jnz     SoftICE_Detected# o  j: Z; L/ D

- C8 q+ R: l# T$ n4 A, o& [) |, ____________________________________________________________________________
$ K4 X9 @: J& b! i5 i. ~# ~8 N  }" o% A% W, _3 H9 ?
Method 04, I6 E5 @  M/ d
=========" a- {. i' W( [

8 {" s* ~7 Y, X# Y5 j+ R2 fMethod identical to the preceding one except that it seeks the ID of SoftICE, K0 m6 ^; n0 a$ i
GFX VxD.$ |+ K% K5 P4 e# s
* V9 {# B4 ?6 G" p& |
    xor     di,di. i+ W% ]1 y) I/ V: O3 }
    mov     es,di+ R7 Z: g( x7 t+ a) r' r
    mov     ax, 1684h       - p; ]: P. s/ t! ]2 Q) M
    mov     bx, 7a5Fh       ; VxD ID of SIWVID
5 I% I9 |* ^* A! d* A  }' {7 `    int     2fh
- {' P6 `2 [2 S5 w    mov     ax, es          ; ES:DI -&gt; VxD API entry point
* Q4 [8 Z' Y  ?    add     ax, di# T. _8 X# Y9 _
    test    ax,ax
2 t( \; R. g  T' n& _" |6 s    jnz     SoftICE_Detected
) B5 M! R3 k8 b9 w4 v; L
$ t& C& ?  w4 R/ n" y( E__________________________________________________________________________; `( p) o- M9 D) r* p2 C! r
0 s2 \* j0 _  ~4 e& m" T
' ~, l3 R. k4 m! R+ p& O$ j' S
Method 05
7 B* i6 d" U8 `0 @=========9 ~6 Z7 i+ b# |- A7 _  d6 {* r

) P$ ]7 I% r( Z; N. c5 M; P6 eMethod seeking the 'magic number' 0F386h returned (in ax) by all system
6 q+ }7 A+ J- x9 s3 u1 I! Idebugger. It calls the int 41h, function 4Fh.8 i/ V1 S- k2 z. L7 ?, f
There are several alternatives.  ( E0 K& t8 ?  }$ j5 s' d' |; n
0 _" S( g8 ^) u0 I8 T# m3 \
The following one is the simplest:
7 \1 p3 j$ ^& f2 a
8 s1 G* e/ I0 W' M+ {    mov     ax,4fh7 S! |- H7 A: `  r3 E
    int     41h
$ U6 i* t6 l+ R3 E* k, p    cmp     ax, 0F386
( M3 v  u9 H% s3 l" k, M    jz      SoftICE_detected8 R9 N+ x6 T& V% |) ^

) d/ l8 t8 K( M2 k
" ]( H" P/ J! h: hNext method as well as the following one are 2 examples from Stone's - p6 x& s5 ?7 {
"stn-wid.zip" (www.cracking.net):
- P0 P. `. b/ o2 N8 i: b
. A! A- D; W) T9 @  {/ s! w    mov     bx, cs
# F' d: b9 ^. A2 m+ q    lea     dx, int41handler2: n8 m- |# l; F6 C( L
    xchg    dx, es:[41h*4]
# B# W# U1 L8 D1 q3 Q" ^4 y    xchg    bx, es:[41h*4+2]' @+ C1 r; D+ P: L
    mov     ax,4fh: ?0 m" w8 \# `# Q
    int     41h
. @1 L/ {" X" o+ x! s+ j1 ]4 B    xchg    dx, es:[41h*4]
  _9 Q  i; K9 G4 U- q( N# O" P    xchg    bx, es:[41h*4+2]
- t6 ~  e# p! e    cmp     ax, 0f386h- w" L# ~5 _2 A/ I4 x' G
    jz      SoftICE_detected" D) ^- D5 Q( h' g& p/ w7 B

4 o% K. B9 i; X, a* N' j1 |& R  kint41handler2 PROC
" I* T& i* q) Y5 |9 E    iret; F: n% @" y5 G# R, m
int41handler2 ENDP2 J* w1 ]& n  e& @# }

- T6 K2 p3 v8 g" z" c. h) w
$ C) x. B3 {! @; [, x$ y_________________________________________________________________________" \; S/ q. M2 U7 t- O) `

- u" a8 h, t3 q6 [- C/ e. n4 ~4 {2 w
Method 06
$ Z2 C# r. A: j0 b" b9 L0 a, g+ o=========
, ?, D+ k2 W) ], d2 ~8 d) U- Y8 Y
' W; }/ W4 `1 s  P
- s1 l1 ^6 e4 i8 i0 m5 b0 @2nd method similar to the preceding one but more difficult to detect:
" F' ^+ Y# n& u7 m& z8 P/ V; W6 r$ [  }% c  Q
9 V& _; n0 m6 \: o
int41handler PROC& y4 S& Y5 e1 ~. w1 o  U# L
    mov     cl,al
- `8 b; A# q+ d2 E+ ]* D    iret. y9 l% Y- ^; \4 i" m% J7 ?. F  y
int41handler ENDP/ m- m( l/ G' h, }/ c0 u# ]1 @* Y6 ]- O
$ J7 y; W0 t0 J  S& `
7 N7 f) A. B& E9 V, k3 C
    xor     ax,ax
  i2 R1 o6 i% W) f$ c  z! u    mov     es,ax2 |) h- `) B4 }# \
    mov     bx, cs
9 {6 [9 J$ u0 q& E2 X& \. M- P    lea     dx, int41handler# {( j! G4 ~3 t% {1 T; }
    xchg    dx, es:[41h*4]8 e: A8 x5 n5 |" W! m
    xchg    bx, es:[41h*4+2]
. g% h* L- D2 U' I9 S6 {4 s2 J. W    in      al, 40h
! `# y/ n2 G- L* R1 O. l& v    xor     cx,cx' G* y5 @+ b4 A! G6 ^5 o/ T
    int     41h' z2 V& b8 w' b/ k* D( \2 i# {1 M
    xchg    dx, es:[41h*4]8 G! p' O4 c2 n
    xchg    bx, es:[41h*4+2]% L4 D' g/ T: A! {4 n% k
    cmp     cl,al+ ~5 \' ^% Z' w9 @2 S
    jnz     SoftICE_detected- d  m% Z: x3 m1 @: U% E  n( V' g' u

/ C$ O$ _: F4 @_________________________________________________________________________% U, {3 E( h) J) X2 [. u  c0 q. P9 r
  c5 d- ~- s( M$ \
Method 07
; n- ~+ @3 |4 {$ C0 [=========
: b+ H% D" O; T7 C9 e7 I
, t3 y3 d! Z: `) X- l/ t1 q$ @Method of detection of the WinICE handler in the int68h (V86)
, @, W+ ~% H7 q0 y5 [! |( y
& I2 E; E$ X2 N4 Z9 S+ j8 _) O" Q$ T    mov     ah,43h, @% N6 y8 h& V& N5 Q5 `4 O2 p
    int     68h
, O% m! y1 Z! D: F# N" E    cmp     ax,0F386h
8 u% d6 `' x$ S    jz      SoftICE_Detected3 v& m  R" D; U0 ~! }1 E

2 U5 `+ K2 a, `/ M, B( w
  C: o7 i5 M' D. |( u; I, p=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit. U  [  m: A$ @
   app like this:
' Q% ^" I& S$ S# m! z6 o  |
! Q$ a3 E! f* A3 i4 R   BPX exec_int if ax==68
8 D9 w& S3 N/ L   (function called is located at byte ptr [ebp+1Dh] and client eip is
+ N' p; T% V- {* v' E2 Q  o   located at [ebp+48h] for 32Bit apps)0 i, m2 a$ z+ |% q* U5 ]3 L
__________________________________________________________________________0 |, O- N8 J3 j6 G2 O3 o, s1 I4 K

4 c& \4 i8 \$ t3 i0 X- f% H/ \& S, \9 t4 B' C! @! O% g
Method 08
8 o. K  h  F. z# @# I. [/ [$ h=========
" U) e, ]3 x" f+ O- |3 P7 e2 {8 i! M  \: @
It is not a method of detection of SoftICE but a possibility to crash the
4 w, a% }8 f/ Qsystem by intercepting int 01h and int 03h and redirecting them to another
, Z& I. `; C) @; Wroutine.# ?/ r% R/ i: p4 B
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points4 F$ |8 @4 y7 F6 X
to the new routine to execute (hangs computer...)
2 \* t4 P' \* f1 f/ w5 ?) e& ~* i: Q, u9 i& l6 z  y* c1 G
    mov     ah, 25h( h% g# N8 C; C7 x6 l- [# G
    mov     al, Int_Number (01h or 03h). l. z  t: x. S9 S# E
    mov     dx, offset New_Int_Routine6 [, E" A- T' n/ u; N* Z- b. s- y
    int     21h8 X5 A2 r5 o0 C, R" F2 J7 t

7 P' G4 L4 z" t% \# Q0 L__________________________________________________________________________
9 K- J) A; A# @- E
- i9 z# V5 h, f) v7 FMethod 09, ]3 H5 I- G& |# R: y' R
=========8 G5 F) @3 D5 J  [
* J% i1 u- h+ |! `4 N: I
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only( v- u; L/ }- l, b: V# [
performed in ring0 (VxD or a ring3 app using the VxdCall).
+ @) ^8 B+ T: Q/ z2 s% zThe Get_DDB service is used to determine whether or not a VxD is installed* B% h- _# E" D5 y1 p+ x5 V, E
for the specified device and returns a Device Description Block (in ecx) for
( Z/ x9 F+ Z: V, H$ r1 e! Z! athat device if it is installed.
! M8 x5 Y& @9 s/ T: ~0 m2 ]  U/ \- K3 v: Y9 e
   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID* J2 C. J' H$ y0 n7 T3 \: ^9 |" t% M' T
   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)! m* p) ?0 B" ]% Z" k6 J. `# e, l
   VMMCall Get_DDB; I$ f, W, M7 G6 [( ^
   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed
2 B4 X, b+ S! @1 g
6 g9 |7 j! Q1 x% W) K) mNote as well that you can easily detect this method with SoftICE:- z7 u2 l6 }7 s& [" r2 M( M
   bpx Get_DDB if ax==0202 || ax==7a5fh; e5 h# P8 U* P5 ^8 O' W( g
8 O+ `% W7 s$ T. P3 H( R
__________________________________________________________________________
6 I# L  r7 p& {+ i. v6 Z. Z7 Z% p( o, P4 V, ]9 B! C
Method 10
6 O+ `! I: p3 `=========
9 E7 [* k- @0 g7 ?& l
. w+ {2 ^' `! a. ~=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with# v0 P2 F! o. T9 M! O
  SoftICE while the option is enable!!3 J) x$ _# Q  F. T. v

; \3 w9 {7 K* u1 l$ hThis trick is very efficient:
7 F: X% d8 |7 A( S+ K% lby checking the Debug Registers, you can detect if SoftICE is loaded
: J0 E1 X) [& \' M, d(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if) F8 y; d+ X- X$ {, J2 Z
there are some memory breakpoints set (dr0 to dr3) simply by reading their
  X8 k1 }+ E, X/ [- B" pvalue (in ring0 only). Values can be manipulated and or changed as well
- D* f. N3 h, `; O(clearing BPMs for instance)4 p8 J3 ?3 `0 w5 b

8 A4 C. Q2 e( @3 f+ O) [2 U0 p$ ~__________________________________________________________________________
' G8 _* k8 {' Z% s' p
5 x) J3 `9 T9 D, ^% ]; a8 kMethod 11
6 v& n+ f9 j" j* U& ~=========
+ G. b, y4 k7 N3 Z
) R5 S6 ^2 ~. g, p( \8 L" b5 ~This method is most known as 'MeltICE' because it has been freely distributed2 ~& d1 K/ f. Q5 T1 V" x* E7 @
via www.winfiles.com. However it was first used by NuMega people to allow
2 u7 w( \4 K# S$ F: p6 v! h; B/ A+ ?Symbol Loader to check if SoftICE was active or not (the code is located
8 k9 p/ z& }" i6 Jinside nmtrans.dll).
; i( R! B' V0 M( b& E$ Y2 N  v% u  ]5 s& l
The way it works is very simple:! E( ?0 L; i1 B) Z) C, O
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
& j( ]# O8 i$ n2 A6 KWinNT) with the CreateFileA API.
- r8 v# P) J% z& H; {$ g; [2 Q. ]% ^# U. ]" F
Here is a sample (checking for 'SICE'):
1 y! w7 u, }) b8 ]# u
( T* Y' U* v+ v( nBOOL IsSoftIce95Loaded()" l* X+ W) s" }, ?% ~1 E  k
{# r* m' a' h9 Q; |1 m; j
   HANDLE hFile;  + A& w' o% W" i8 Y
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
6 s# _+ i: l' h  V# |                      FILE_SHARE_READ | FILE_SHARE_WRITE,4 ~3 p$ f, u( e8 Y
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);, Q* v/ B: y0 z* p
   if( hFile != INVALID_HANDLE_VALUE )
7 G, ~! f6 X& x# N* l   {
, y5 `: Z5 n/ }0 X( `, p9 J7 w( p      CloseHandle(hFile);) j! m' H) E  a3 |& a& s3 ]  J9 _
      return TRUE;
; H$ l& Y+ ~3 b  ~+ c  S: T/ C* M: H   }
1 J" t* t' A, H" e6 R! \4 f9 s   return FALSE;
# X2 U/ I) Z  B. w/ l- b) g* h, m}
$ M$ u. H8 O$ A+ T* z7 ?! V' _5 t
4 v1 p! O1 d+ z$ e/ X3 u) WAlthough this trick calls the CreateFileA function, don't even expect to be
. I* d8 p' x. G* `. uable to intercept it by installing a IFS hook: it will not work, no way!
% L9 \- x+ ]) X' X& fIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
2 C2 f2 l$ w$ i8 Hservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
4 P7 W2 d. s; ~6 K' Jand then browse the DDB list until it find the VxD and its DDB_Control_Proc0 P% N3 e' n+ h1 R/ P7 c
field." W2 ]( C" U& x1 Y: `1 j9 f
In fact, its purpose is not to load/unload VxDs but only to send a 3 A! }' q; t5 V5 q! \
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
8 Z# v* M! M( q5 O% ?; q9 oto the VxD Control_Dispatch proc (how the hell a shareware soft could try
% h2 ]0 o& r- @* [1 W1 b/ wto load/unload a non-dynamically loadable driver such as SoftICE ;-).8 w9 ]: H% j( n0 W1 g" e. h
If the VxD is loaded, it will always clear eax and the Carry flag to allow
: c; V. t( f$ M/ Tits handle to be opened and then, will be detected.
" G  x$ x5 ^' _You can check that simply by hooking Winice.exe control proc entry point( P7 {: }! O4 x, e
while running MeltICE.
, V1 g( v, B5 W  f% ~$ S: h# [- {6 d: [/ y

6 o1 F( L$ m3 T6 Q+ H  00401067:  push      00402025    ; \\.\SICE3 f6 v1 D) R' F. O( w, Z
  0040106C:  call      CreateFileA
1 Q+ G4 \/ J+ ~1 j/ ?# a. ?  00401071:  cmp       eax,-001
  j: t0 J/ k4 Y" N2 I; F  00401074:  je        00401091
# g* L2 @9 V) ]
5 X, G6 G) K) S( }2 I
1 @* f* K' ~* q* R- kThere could be hundreds of BPX you could use to detect this trick.
+ F9 L1 C1 ]. E+ I$ q9 ~1 K-The most classical one is:
7 p8 t8 J0 v5 B2 O  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||+ ]- }9 h/ s" }
    *(esp-&gt;4+4)=='NTIC'
) l* D- f# Q0 ~( w! m  M: M# Y% T1 E
-The most exotic ones (could be very slooooow :-(4 J" B. h$ Y" I9 A8 v! u" S
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  
8 x) G9 U. Y- }8 Z3 @     ;will break 3 times :-(
. t; W! U/ T6 Z* f* _9 Y' V1 U- @& V) w3 _
-or (a bit) faster:
, ?8 q5 U9 ~  y8 _( V+ [3 g   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
. @  L2 p& |+ j) a' f5 I( @9 r* F! F- E# n- u! r
   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  
+ F! W) U, `$ ?     ;will break 3 times :-(
! D2 q5 U* Z  O: T. j! m" D+ ^& j8 F" k
-Much faster:$ J) @- Z5 j1 s- ~7 O
   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'
7 ?, I& R$ D* z, V$ a0 g7 R( W. \- y
3 g( g; M# h2 z- v& {Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
6 j: q" {" y9 U! r, Zfunction to do the same job:
# y4 v5 W9 `/ {& v% v8 z
0 f* |& r3 H+ W- I5 \   push    00                        ; OF_READ9 I6 a- O: w; L& }9 V
   mov     eax,[00656634]            ; '\\.\SICE',0/ Y2 K7 W# F, H# [% C
   push    eax
% Z5 O. \& ~, J+ M, v   call    KERNEL32!_lopen
$ d' |9 G  o+ Z4 l* Z$ G$ {   inc     eax
$ r; \9 y+ B$ R   jnz     00650589                  ; detected
& l- C% B8 \* e7 }+ e. ~   push    00                        ; OF_READ
4 O. W; R/ o6 p: g5 a8 l3 r   mov     eax,[00656638]            ; '\\.\SICE'
. {0 \4 S' Y; e( [0 S2 ^% Y! s   push    eax
& k& i+ `$ ?5 q& s   call    KERNEL32!_lopen! `$ S. F7 s, a4 o* h9 s, c
   inc     eax; F9 q* A9 F/ A; P: R6 o& N
   jz      006505ae                  ; not detected
( f& T" u) n5 `, V1 x7 o+ }
4 ]  r# v/ \1 c7 i0 I: v' C" X8 h& f% |  }
__________________________________________________________________________
6 f7 s9 ^) t1 g5 z5 e) ?/ y. l5 G. B' V
Method 12
! K( o& {1 D& a* U% ?=========
# G" X) N* b9 k3 a, N+ ]5 V% U$ h9 N' U& b0 f
This trick is similar to int41h/4fh Debugger installation check (code 05
: S/ x! I2 E8 a3 H  x$ r6 V&amp; 06) but very limited because it's only available for Win95/98 (not NT)
$ c8 T. z, A# x4 R: L6 [) V2 _as it uses the VxDCall backdoor. This detection was found in Bleem Demo.$ Y: W) {3 W1 t2 x1 P* K4 F+ U, h
$ W: {! ]+ E5 f0 L
   push  0000004fh         ; function 4fh
$ v7 J( y- Z: F+ u) s, Z   push  002a002ah         ; high word specifies which VxD (VWIN32)3 S! \! [, w: D; V: e5 I
                           ; low word specifies which service8 ^0 K. p7 x% c; @. U
                             (VWIN32_Int41Dispatch), t: z8 b, G6 }) x0 \$ J1 i- o& b7 U
   call  Kernel32!ORD_001  ; VxdCall: H4 W; y2 \2 {; c4 ?
   cmp   ax, 0f386h        ; magic number returned by system debuggers4 ]  x& W6 v% A" w: d# a1 b7 j
   jz    SoftICE_detected  I% D# H: b/ c( ~

+ W7 V# t" E* M# Q2 e. E3 IHere again, several ways to detect it:
- n) d& z/ B( o( J
) o% o6 o" I" |$ H8 ?    BPINT 41 if ax==4f
: g2 ]  W2 v# R% C' l0 G2 G5 T2 A9 W/ G# C* G$ f) L, f1 h. d+ J3 ?
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one, _9 m  m4 ~% K9 X# i6 r

( T4 I+ d0 W* q. ~  x    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
/ v- U: l$ i2 ^, q0 X7 @) Y
: M" b# v5 b% x1 |4 x5 P5 e. _    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!
' X3 G' k- b8 T* J8 z6 H# L) ^9 j2 l4 A# J/ z+ V
__________________________________________________________________________9 J  B# z6 I! a

7 n0 U: d7 A7 M: P# rMethod 13
% Y- I4 Z* g& q% h, T4 m0 g=========3 d3 F4 u* P2 S3 X3 p( [
- Q5 g& J2 I% N4 t
Not a real method of detection, but a good way to know if SoftICE is
/ _2 a1 m0 h% X. r  Winstalled on a computer and to locate its installation directory.+ a( X! S1 X9 [  i. Y7 z
It is used by few softs which access the following registry keys (usually #2) :! z4 m3 @5 W" V& B- J6 D" X% O

6 g( y9 J: i0 L-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
! T, N4 m$ o3 {\Uninstall\SoftICE4 Q& K# c6 a9 {3 b
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
9 m, j3 c: U0 h" }" ?% ~-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
/ }7 m- ?5 p! y# y" c! b9 U' c\App Paths\Loader32.Exe
# W' X" t/ s' l% }3 w! o
" s6 q# U9 Y3 X" K% g8 F! F
& e! W+ Y( [# b. @# {Note that some nasty apps could then erase all files from SoftICE directory
4 v: d- I3 N# R" E; N(I faced that once :-(
' L$ h0 E: y% p# p$ v! z! b9 X) F/ W$ K4 ]
Useful breakpoint to detect it:! T% F5 ~9 B: s5 Q( C1 d

: S; G: m- m/ b2 i6 D  L( E     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
: M. j0 |& e$ A/ o+ ?3 g2 f# K8 o9 r& j! R% s
__________________________________________________________________________3 D, Y# H4 g/ v, W' L2 R6 F
/ p8 j% J) t& _  s* @( v- l
, F5 O% }% x, h3 K* U6 A5 s$ V
Method 14 4 M/ }7 w. b/ H9 P& f* t
=========+ [% C9 p8 u* t

; g7 ^& e% W& X. w. xA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose* b8 p2 A) d' F% t
is to determines whether a debugger is running on your system (ring0 only).
- i  G% b& d% h7 `% B( o+ e) ~0 N1 A+ ]! r+ p* ?0 ~) ]- k% _6 M  P
   VMMCall Test_Debug_Installed
: e' z( n. S: ^2 D% W# ]' g; p   je      not_installed
/ w! c* g1 B4 ]( s+ V3 a$ C1 O( q. L+ n3 ^# Y
This service just checks a flag.
( L0 I$ R7 Z$ J9 T* m</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关注公众号

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

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

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