找回密码
 注册

QQ登录

只需一步,快速开始

About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
$ h  @  l; R( Y+ J! r, {' A& Z; H<TBODY>
% U8 N) k0 Z- n" o<TR>" G. u% @: \. q: L: x
<TD><PRE>Method 01
* _& G  m# M$ [& m) a6 S=========
) N/ m- }' \9 n
6 v9 s+ k. C. f3 J# X7 ^This method of detection of SoftICE (as well as the following one) is+ i6 {" a: {7 W# C3 U. p8 o
used by the majority of packers/encryptors found on Internet.
" Q, n, f6 W" ?  h  @4 I% Z/ ?0 B7 B3 dIt seeks the signature of BoundsChecker in SoftICE
1 B( \5 s5 b% a* }( l+ }: I# u4 E: k8 B, u4 W# m
    mov     ebp, 04243484Bh        ; 'BCHK'
, S# l- y4 w+ d    mov     ax, 04h# E6 V# r) b! |5 h
    int     3      
8 l- M6 Y4 k6 W/ H    cmp     al,4
9 i/ J8 T1 \2 T2 U' [    jnz     SoftICE_Detected
8 M# o7 I& {  F. S% t4 h' q( D9 t- N5 ]& G& B4 L% P
___________________________________________________________________________
+ |+ u9 P+ n% {2 D& e" `% K
4 N# x8 o. ^0 |Method 02
. k2 b+ `! Q7 {=========, |' m; p7 X9 [+ [

9 G- e8 W( \2 r2 N; ]1 N3 ZStill a method very much used (perhaps the most frequent one).  It is used
  R5 u" X6 B- ]/ S, C9 |$ Eto get SoftICE 'Back Door commands' which gives infos on Breakpoints,; w* q" l* f! @/ G
or execute SoftICE commands...1 s; b- Z/ L- S( [! y  r
It is also used to crash SoftICE and to force it to execute any commands3 k+ d3 x3 I' E4 I& [6 E/ v
(HBOOT...) :-((  
0 V2 x6 |% n6 W" \4 `& D8 g* D  x/ }+ Q7 t$ r. \
Here is a quick description:
1 ]2 s8 p8 N+ [; Y! r-AX = 0910h   (Display string in SIce windows)9 Y" V1 Q- x0 H* w
-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)5 h0 T6 |, r% G7 J) A& N; B
-AX = 0912h   (Get breakpoint infos); B- G0 G5 B  `
-AX = 0913h   (Set Sice breakpoints)
' x9 e+ b/ J# u) K-AX = 0914h   (Remove SIce breakoints)
, a, Y* G% \% m" r; c
5 `$ X$ Z6 U! q& {! X' U1 JEach time you'll meet this trick, you'll see:
! A3 e- g! Z: s1 N# f# ^$ G  v3 G2 z-SI = 4647h! p, W# L# ~5 i" N
-DI = 4A4Dh
; b- r, Q1 Z! p2 E* G+ [1 GWhich are the 'magic values' used by SoftIce.1 [& a& N; W/ y2 n
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
8 S# y9 ~9 [0 J, A
$ \* Y7 b$ [$ c# T4 j" S* {# [& A9 oHere is one example from the file "Haspinst.exe" which is the dongle HASP+ q# I: p+ r& W+ u5 S1 Q
Envelope utility use to protect DOS applications:% t8 _3 K$ R/ ?8 T

/ ?0 H) g8 N" o; h, ?" H2 N4 O
5 X0 \/ B# C+ p# c( L1 \4 v$ z- y4C19:0095   MOV    AX,0911  ; execute command.
6 |* s2 c  B2 P4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).+ Q$ u% g, y& X) E0 ^
4C19:009A   MOV    SI,4647  ; 1st magic value.
( V# M/ l! W% x6 b( Q6 k4C19:009D   MOV    DI,4A4D  ; 2nd magic value.
: C8 ]# b3 z$ k- y  S  d5 r4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
; K3 X6 I. z5 u( a' E( f% L4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute
$ N; s6 B5 D* e4C19:00A4   INC    CX
# x  j5 J- U+ n2 i8 b6 ^4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute
) T$ h: D# f$ k, H( v. r4 H4C19:00A8   JB     0095     ; 6 different commands.
' s2 g! n2 R  c5 ^% T6 X* L, L& L9 P9 \5 _4C19:00AA   JMP    0002     ; Bad_Guy jmp back.8 ~; [# n4 X& G6 F* m. g+ @& x- A: K
4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)
* d$ P; T* u1 S, n  `) \; M
, s! L# S& \* D! ^6 t0 R4 xThe program will execute 6 different SIce commands located at ds:dx, which
6 _7 [  a7 C; H1 i0 c6 k& P" C0 G: ?are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
. ^8 W0 E8 T& D5 Z
3 l& c4 N) F) R* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.- B2 d) h6 K( i( L
___________________________________________________________________________6 D2 ^; a, Q1 n& L' M2 G

5 ]- a. O+ `6 \: L
- `/ c) a3 M" E" `7 I6 q0 e" |8 JMethod 037 z) @; i. C1 r* ~+ t7 l
=========2 I4 ~% f2 p0 P7 u0 d! L

/ J. r4 k0 [$ Y  R6 nLess used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h0 [. ?- G# l6 d8 C1 A  e
(API Get entry point)
( b$ y8 @+ S- G) q" e4 X9 Q        
! i# G& g; I) c
' l: n" _% i+ D) ~( N& ?    xor     di,di, r. q2 Z, D+ m5 P
    mov     es,di
- ^+ i' A  [6 _3 d/ m. R" }    mov     ax, 1684h       ; T* `, w# P: i& E& M9 w
    mov     bx, 0202h       ; VxD ID of winice
1 A7 x! t6 S4 g0 ~* P8 b    int     2Fh
% z( a% ?# O: x6 Y$ H- G    mov     ax, es          ; ES:DI -&gt; VxD API entry point
% x3 U. D& d3 k- V/ `0 R# h    add     ax, di
3 N, b: \% t7 c% ?8 z, U  T# H. p6 T    test    ax,ax' N5 u7 q2 v7 @( G% [! w+ F4 `
    jnz     SoftICE_Detected
5 s/ G0 X& c& y
. \/ c* ~, F. _& u) W___________________________________________________________________________
) h9 l: d' ~& f  \2 j; E6 r. m$ {: \! {* U% u4 @9 _/ h
Method 04
$ L# k1 ~* @8 H9 \+ x5 `=========  W, @+ g1 v* p( F# @5 [+ F# ~4 X$ S
% F" p0 _& I( x  Y9 A. w0 S
Method identical to the preceding one except that it seeks the ID of SoftICE
; m3 t8 H! E# x$ [GFX VxD.
5 Q" f% ^, r! p" s) s% W5 S4 O2 S# {5 g4 K8 z
    xor     di,di. L9 E8 ~+ P5 W$ |9 _
    mov     es,di9 T+ `% X& a9 b, E5 C) _
    mov     ax, 1684h       % b4 L1 V; x$ O( k( s
    mov     bx, 7a5Fh       ; VxD ID of SIWVID
" `0 Q3 A' C* o! Z4 h* T7 T5 z    int     2fh1 \% `( t% V# c/ c' I  X# H
    mov     ax, es          ; ES:DI -&gt; VxD API entry point
; m: P4 X* z2 ^0 Z    add     ax, di$ I. }! b, X* V/ Q" h& y, k
    test    ax,ax: r! Y; d% V6 G" ?9 y
    jnz     SoftICE_Detected, Z  }8 _, W$ X# o& K) c
/ o( x. y# e0 Y. R/ W
__________________________________________________________________________
+ E( f: R% p5 `- Z: C5 u% Y
- v) Y1 k' q/ f/ {# i
* `) [  c3 T  t9 F" y% S7 rMethod 05
0 v6 s. y/ R" i% Y=========/ v* [( I# p+ |6 f( X- _

  T* M5 V+ T/ p5 `& A( T1 B0 ^Method seeking the 'magic number' 0F386h returned (in ax) by all system$ T( l) ~% N; q6 L
debugger. It calls the int 41h, function 4Fh.
1 ~: r# a! K' M9 kThere are several alternatives.  
8 ]; g. L- G7 D$ P$ v: j' D% b* {3 n/ O/ ]( J
The following one is the simplest:
% t7 O% ~3 P0 @. y+ T& ]( S+ N- M/ w" Q7 v
    mov     ax,4fh2 t2 F, x- R8 I( j( Z
    int     41h: b3 O9 ]' j+ ~! ]; [
    cmp     ax, 0F386
6 O* _' R6 S) F1 u* B4 O    jz      SoftICE_detected3 g8 N  Z; l, O' \; a9 _
- v/ @) @) p1 x6 m

$ ~) H9 s! x/ B6 HNext method as well as the following one are 2 examples from Stone's 3 p, M/ Z0 U1 [) F# a/ \' {# l  Q
"stn-wid.zip" (www.cracking.net):9 d9 ]- u, c5 P+ H/ @) [/ c

  a. [# i- ~" y5 q% n    mov     bx, cs- X; Q+ G/ C: T. P% Z
    lea     dx, int41handler29 [$ O  A$ @- h8 @5 Q
    xchg    dx, es:[41h*4]
! S& |6 X8 p* S" \6 ^    xchg    bx, es:[41h*4+2]
+ Q" [) K- W8 ]    mov     ax,4fh
/ ?/ e  t9 w+ d4 h2 @    int     41h& m# c5 K- \; ]+ O' T  i# U1 Y2 @
    xchg    dx, es:[41h*4]9 G6 q/ t/ e$ e) G5 u
    xchg    bx, es:[41h*4+2]
4 L" `" \8 m5 b" i* X6 r4 k3 T    cmp     ax, 0f386h5 x& ^7 V8 f* {& B/ o
    jz      SoftICE_detected0 k2 |; P3 G* f; b; F6 s
- ?- B/ _, I% `" U
int41handler2 PROC
; A, H$ E! }6 U  X# }4 j+ q( |% @3 y    iret
4 p( ~2 j, w, K0 l- F7 Zint41handler2 ENDP5 d6 ]: L6 i$ b. Z# @5 R- {$ z

1 n- `3 t( q7 D) Q% j3 T/ {) Y* S
6 F8 _1 c% i0 g/ n: N8 c( @_________________________________________________________________________, o6 l5 a9 X, L6 r% [$ ?
; _/ h7 ^8 f) A+ Y
# A0 S% o* L8 H! m6 x
Method 061 G" w1 ~0 z3 @% E' U3 E
=========
- L, }+ a6 I4 ]) F
. [9 @$ M5 G* ?# ^1 [1 F. B
" S( |. ]0 Z* B, J8 N8 W9 l2nd method similar to the preceding one but more difficult to detect:
3 i3 A: k: e: L: e) Y- b( u( ?. R& x

0 H* X! Z! g' L2 rint41handler PROC
1 X0 |2 s' Q- y5 I" V    mov     cl,al6 j- N0 j$ s0 [
    iret
8 b/ x4 h* g; fint41handler ENDP6 [3 E+ [! a5 o# S
, L7 O$ K' t# D" z& _5 L
* {* O2 C0 Y# K* `% ^7 V( M
    xor     ax,ax5 ]9 |: V  k' Y8 P5 l9 @) i0 z9 ?
    mov     es,ax- C! _( V  s" Z0 K
    mov     bx, cs
/ V+ e" S/ k2 Z/ z6 o6 [2 \    lea     dx, int41handler0 K8 G  w% J4 R* q' U
    xchg    dx, es:[41h*4]
* x- v% ~6 t5 V3 l! r$ A" f7 y    xchg    bx, es:[41h*4+2]4 r4 `& n5 A) x8 t& k4 Z
    in      al, 40h/ t' k. t' l3 b& F) ?
    xor     cx,cx( S( o: r/ t, ~% O0 o' a
    int     41h
* H0 ~1 q) a2 D6 P    xchg    dx, es:[41h*4]
) A3 T1 {6 l$ G' K, y    xchg    bx, es:[41h*4+2]
# p6 g' F- Q5 W    cmp     cl,al
6 ^$ o" V0 D4 ^    jnz     SoftICE_detected: N' |/ N" A' e. u. H4 m
- y1 @% z% |+ I7 ?" Q
_________________________________________________________________________
' Q4 o9 ~. `$ h5 q: g( ]6 R
/ Q7 J8 l9 a! A% h( O. iMethod 07
% D/ D- U% k$ @=========' p8 Z( l+ v8 [
( C; t( g; _, D% x/ S' g
Method of detection of the WinICE handler in the int68h (V86)/ e0 U  T7 F1 K2 C1 e
8 ^) D4 n. G* D& }3 c; I
    mov     ah,43h6 q- Z' H+ W" W% l
    int     68h
9 A2 Z' j/ z, w! o! S0 l    cmp     ax,0F386h/ c. V1 D2 D0 H0 `1 G! F% U+ ?
    jz      SoftICE_Detected
2 Y) _; n1 }7 `7 _% t" {
- E. ~! v, A5 r7 q& O: D9 W& L
4 m3 F! N5 Y/ V3 ~7 x, |  |=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit+ n# ]+ C( S' u: K' u* {- |5 ]: ?
   app like this:. }" b5 [! R+ D& d' `) y

, n3 i  D% ^/ y9 q, I! I& D   BPX exec_int if ax==68
) x3 J$ ^" X, q" h; V- j. k   (function called is located at byte ptr [ebp+1Dh] and client eip is
! p+ a! b- n: }, T   located at [ebp+48h] for 32Bit apps)
& M2 S/ Z- y  ~' m3 x__________________________________________________________________________' I& M( b" l- Q" w# \  A4 p. J9 F
) j5 @" G" }' Q' ~" \( c0 m

, q4 c3 |) t( JMethod 08! F6 D7 J6 ?9 v3 @# J0 z2 y
=========. d7 s( l2 A; O
) [# I7 P$ R  V) d! L5 n0 @
It is not a method of detection of SoftICE but a possibility to crash the/ v/ `# F1 o8 q) Z6 M5 v- C
system by intercepting int 01h and int 03h and redirecting them to another, f; [) V$ ]; w7 V5 x# M9 u& j
routine.) S+ ~0 i! g$ L1 t, U0 Q" B
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points0 S, m2 g$ c2 m
to the new routine to execute (hangs computer...)
2 Y# d3 \. O. O9 @" ~& o5 X! |& x& b- e  r0 i- U/ _1 [; Q' H  e
    mov     ah, 25h
* J. T; R$ V, f* l7 V& ?" d/ S    mov     al, Int_Number (01h or 03h)
6 Q  V7 M0 W) R2 U: l1 t$ c    mov     dx, offset New_Int_Routine& z( I+ ]: G1 a0 R
    int     21h7 N0 M- |+ o. t3 a/ E) Z% {9 I2 n

1 J; Y( g! M0 {! g, I& H__________________________________________________________________________) U  G' W& Q( _
6 M+ Z  ~1 z- {& E
Method 09
) e1 i! O1 R1 }: v, j0 X5 C=========+ {  ?1 g1 P% v7 y) B( E6 b

. V/ q4 B/ Z7 W& ~0 {This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only: n+ x, R8 X  E5 |1 }
performed in ring0 (VxD or a ring3 app using the VxdCall).& S# f1 y& @# G$ h5 U
The Get_DDB service is used to determine whether or not a VxD is installed2 q; f) L- T# ^% Z9 j9 F* X
for the specified device and returns a Device Description Block (in ecx) for
3 X2 i- x# ^& x& Lthat device if it is installed.7 a/ D+ l5 w6 |8 K8 Y4 C+ @9 M
7 {2 w9 h, q( [. Z8 Q2 ^9 h
   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID
; ^0 h- L5 i5 @# K   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)8 b5 r5 ~; ^. v/ J* c
   VMMCall Get_DDB
$ o3 Z$ a/ q+ T+ E: k/ [- I' v   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed
" B* Y8 U# ^# z9 q( q9 h: G1 c  f/ v. U/ t7 C* k
Note as well that you can easily detect this method with SoftICE:- @8 Z$ g. m' V+ L4 v" ^& S
   bpx Get_DDB if ax==0202 || ax==7a5fh6 d# q2 ]2 l0 H
4 e9 P0 D- c2 Y8 a
__________________________________________________________________________
: J/ I2 V9 [$ \3 M9 [9 O1 N: [- N& k% \7 J) [# L/ m
Method 10
, U. @& H$ C9 n. i7 G=========" [; G, x) w* P7 L2 ~, J. {

, t# p/ `. R+ Q3 Y1 y=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with
- o/ @- L( E- L! \2 V  SoftICE while the option is enable!!
# c5 t5 Y, v+ o" u& T: Q- E- c7 ^* u: \
This trick is very efficient:3 G5 e8 d4 |+ R2 t7 j
by checking the Debug Registers, you can detect if SoftICE is loaded- {0 e7 o6 f$ B2 s: K' }
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
7 y& G8 p0 {: a2 }$ T; c% [; nthere are some memory breakpoints set (dr0 to dr3) simply by reading their3 g+ w* B! z: x; p4 ^$ H
value (in ring0 only). Values can be manipulated and or changed as well
% F# l7 K3 H. s7 m$ c2 G5 _, T. n(clearing BPMs for instance)( V6 z& S& P0 O' }& O1 `

  x3 G& \" F7 z+ z! U7 s__________________________________________________________________________0 G% P, y7 ?1 |6 S9 ~
* W1 X+ r2 ^& D9 [/ r! b4 Y2 w
Method 11
% T, w9 _% {4 Y4 p/ V7 a2 M- ~=========5 f$ P* U  e/ a5 J. f% g

! }+ [5 e! h- w; r  UThis method is most known as 'MeltICE' because it has been freely distributed
6 G* }! D6 X" n( kvia www.winfiles.com. However it was first used by NuMega people to allow
- V! S/ U# N3 O2 q( JSymbol Loader to check if SoftICE was active or not (the code is located) ~1 J% T! ]; o# e: p: H  ]
inside nmtrans.dll).& e( ?- q7 V) a' c: {0 v4 t

7 a& n1 P. Q4 ^' xThe way it works is very simple:+ a, r! x- U. c( ~' A% B
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for) y2 u3 z0 w0 t: ]! ]
WinNT) with the CreateFileA API.- Y: z0 d7 N$ l* c1 o; g3 o
1 W+ r+ _7 c& Q6 Q9 N5 j: s6 m
Here is a sample (checking for 'SICE'):/ B. @' D7 B7 w0 s2 p! L# i
- y, L6 v" s' ^! R
BOOL IsSoftIce95Loaded()
/ ^( q" @# s+ W6 Z/ ^6 N{5 S+ C% C3 A! F& Y1 M, i
   HANDLE hFile;  
3 R" {! ]9 N0 z7 P$ _0 [   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,/ t4 w3 q% L4 d  m3 K
                      FILE_SHARE_READ | FILE_SHARE_WRITE,
# L% @% O4 Z$ `( u* Y                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);# E0 P+ p+ o* X; M1 J. `! r: P
   if( hFile != INVALID_HANDLE_VALUE )
! l8 I5 Y2 _, y% N   {
9 `0 t7 Q! I5 P- e      CloseHandle(hFile);
+ L. K+ S) F$ B$ Z3 i& ?      return TRUE;* X# J* ]% _  {4 B9 y
   }
$ e- I) D& l# m! F8 K   return FALSE;0 |6 V5 M# B- u- f
}
' f: I; x  l7 H' [& V) Q
/ O& F) [2 G1 S# _& O7 ?; yAlthough this trick calls the CreateFileA function, don't even expect to be
0 k; F7 Z( H4 S& F$ xable to intercept it by installing a IFS hook: it will not work, no way!
: G! y$ ?, }" n0 |In fact, after the call to CreateFileA it will get through VWIN32 0x001F
% ~! ?1 ]. j& @" A% x- kservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
$ d( u- P1 V# l, C! k% {and then browse the DDB list until it find the VxD and its DDB_Control_Proc
: v' ~2 s" O$ }' g& `1 g- j: nfield.
, \4 y+ i. K, b6 `In fact, its purpose is not to load/unload VxDs but only to send a
6 W+ q/ B/ ^1 z4 yW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
: ]; w0 c# o: I# w/ v# ]7 Kto the VxD Control_Dispatch proc (how the hell a shareware soft could try
& P/ K) _* h( D7 gto load/unload a non-dynamically loadable driver such as SoftICE ;-).
- E! N0 s3 m/ J5 t2 \. BIf the VxD is loaded, it will always clear eax and the Carry flag to allow: T: ?' W4 S3 Q5 @& x6 |
its handle to be opened and then, will be detected.
9 ]& I2 F+ e' ]+ j# P8 G$ @4 v, j0 e; ]You can check that simply by hooking Winice.exe control proc entry point
' i# |, d. i, y( hwhile running MeltICE., h. x! P  g7 F: v* x. x5 j/ I

7 w# F4 W7 v; T# @# d0 h  A' y; c  ]0 l' {2 D( k# C2 S6 C
  00401067:  push      00402025    ; \\.\SICE5 }  k7 j) y) F0 H* B; j$ a
  0040106C:  call      CreateFileA
! v9 f$ x2 S2 `9 n+ S- }. U" {7 C. G  00401071:  cmp       eax,-0015 h) D% X4 R  u9 l! p
  00401074:  je        00401091
; q& Q- `9 t% a4 L5 W6 [3 N
( V3 X  G6 e; _! [8 [5 \- c. \+ C0 `* ~, l8 O& C& @" j1 Z6 m7 \
There could be hundreds of BPX you could use to detect this trick.
$ R# a% d$ g' E& Q+ B-The most classical one is:  r$ @/ z8 b, `
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||! {" Z, `. z! l/ D/ |# [! _: G
    *(esp-&gt;4+4)=='NTIC'
2 v# _. L8 }' Z3 Y4 R. r2 e/ Y  c% d3 M* f( ^, g& t
-The most exotic ones (could be very slooooow :-(  a8 s, A0 c4 f. B( x
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  1 N  a4 r& j9 j" v6 r% j5 d* O, s2 A
     ;will break 3 times :-(
# }/ c6 E) W' \1 c! j- f2 L" K) H) F" T% [3 Z' T; l: W
-or (a bit) faster:
- [7 r" j; K' |% H; {$ G+ c   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')9 c( _8 \* ]( v! L$ {& U

6 L% D0 R3 n0 O* `9 V0 q   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  / w7 ~3 H: T) W3 n
     ;will break 3 times :-(
" }) L/ h( I9 P1 c, U/ u: q
( y) _7 [; S7 Y, m  u, T) Q-Much faster:4 L6 {7 k+ K. q1 {6 }8 G9 o
   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'
: _0 p8 a: `2 P. `4 S! X; `' N; g" z% h
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
5 Y1 l; {8 m! B0 {; X5 Nfunction to do the same job:
7 t- L# v1 H0 l( z/ v3 N# K. ^; k5 }, ]  A8 B- G
   push    00                        ; OF_READ" E* `6 u, v- {9 |7 E+ Y' H9 w
   mov     eax,[00656634]            ; '\\.\SICE',0# [# j  b4 {3 n& A9 x& p
   push    eax
; ^8 H6 v1 h$ B: t* j1 O   call    KERNEL32!_lopen
9 Y+ b* ~! u% A# r+ k, c   inc     eax/ b; H" d& L" d1 \; m
   jnz     00650589                  ; detected6 A7 H& c& `( R# f3 i% l9 o4 K: P8 D: V
   push    00                        ; OF_READ
- \5 f% x/ D2 S9 z5 Y$ B   mov     eax,[00656638]            ; '\\.\SICE'
, t% Z% w3 p, `% `0 U8 X8 o0 K   push    eax
' c0 Q7 b( R/ w- D$ ]$ m' @# s   call    KERNEL32!_lopen2 g1 L% A" E. C+ V. _/ B) h5 H2 E
   inc     eax1 Y- _9 ]  o  n: ~' a! I' @
   jz      006505ae                  ; not detected2 I, j  v& G- l3 e/ X
# v: k6 y* P% E. m+ X# X6 i7 u
$ C, a2 Y4 k* j
__________________________________________________________________________- s1 _" r3 U+ c
) `3 c+ `! i9 N' ]9 J
Method 12
1 l5 H' b* |# A5 ~9 s5 l=========) S7 ?2 S! D! _  @

" v7 _9 m4 A2 mThis trick is similar to int41h/4fh Debugger installation check (code 05) p7 N8 F3 H) Y& j. Z+ h
&amp; 06) but very limited because it's only available for Win95/98 (not NT)
. ]* F9 e$ L0 R# R5 w8 _as it uses the VxDCall backdoor. This detection was found in Bleem Demo.6 g' L  R1 [* r! m

3 k) H0 W: `5 b& U, J) E  l0 B/ r* X* V   push  0000004fh         ; function 4fh
* K5 N5 r9 N$ r1 f  d1 x   push  002a002ah         ; high word specifies which VxD (VWIN32)5 }, p. ^6 }9 m* k, X" B: [
                           ; low word specifies which service
6 B% r) m! s4 s  z, O3 n; R                             (VWIN32_Int41Dispatch)
! y# A1 u( s. X; O2 g   call  Kernel32!ORD_001  ; VxdCall
5 R1 w1 D' d+ e   cmp   ax, 0f386h        ; magic number returned by system debuggers: `& ]. T1 S0 v  G& [
   jz    SoftICE_detected- _5 Q! w5 R& V" g( j3 _, r0 U

' B  s  F7 p5 q; ~' `Here again, several ways to detect it:
) H8 Q) a% f+ V* q
% {. i" e0 W1 J6 G8 |) o! }    BPINT 41 if ax==4f
$ u* J/ G+ I: V( g: J  \
$ G8 }% f! d6 l1 U/ }    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one
/ R7 Y( W5 [4 ?. |! u+ i1 ^, v6 ]' q
    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
6 u- M) I7 |' |0 M4 c9 c( }7 r+ k2 J9 o+ {! p9 I2 U: ]
    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!
4 h4 W1 @  Z8 ~) M! D+ d9 u, K6 m7 s3 y8 w) w/ {
__________________________________________________________________________
8 W& J$ E4 O: e# X% H5 K! {4 U: ?7 P: u6 e. V" d  b
Method 13
- _  e/ v- e4 B=========
, U9 }$ y6 m! y$ J6 s0 g
8 u) U1 t1 l( U  x3 R* Y# @Not a real method of detection, but a good way to know if SoftICE is3 z+ r3 j7 W( q; V2 }' g3 p
installed on a computer and to locate its installation directory.
7 A; B" O7 t3 R& k% t' oIt is used by few softs which access the following registry keys (usually #2) :$ j( K# k1 v* p' p* Z) A  @, V; C2 r% d

  u2 |5 W. F# ~1 a$ Q-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
0 _5 A! d, P+ R+ Q! `! \\Uninstall\SoftICE
, Z( u9 Z+ n, t+ n5 k" Q-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE# n) o" J4 Q! ?9 ^9 \: N, i/ Z
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion& ~5 N, q% v7 P6 z
\App Paths\Loader32.Exe- h, e4 A7 F' x: E  \
5 f$ O# J, @! B% C
2 U$ \. Z& ]& \
Note that some nasty apps could then erase all files from SoftICE directory- v; x6 j% a2 u9 F/ M, j
(I faced that once :-(
' t' f' _% X0 o3 t% Q7 I+ p0 K0 K, v+ D) c3 x. N& Y; |. y2 X5 V
Useful breakpoint to detect it:8 i( q' q7 W6 k; e4 G
0 `) X( f5 H5 k1 i5 R+ ]: ~% B/ x
     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
/ C$ k( o0 }3 ~! ~) _
) s/ U& ~  g3 F__________________________________________________________________________$ g/ S6 J1 W3 d  Z

2 F( i( R% }5 Z2 h) w; k; f4 D8 J7 B- F0 [) [
Method 14 + ~- G6 |0 M3 Q1 @. R' e
=========6 X! U" O/ q+ X" {6 q" A& V! p. F
0 c) R( ]5 A+ Y. W
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
* y2 [- W' ]: o2 vis to determines whether a debugger is running on your system (ring0 only).
: e! g0 w6 w0 ^1 \! _
; W2 t: u9 L, |* q! M- k   VMMCall Test_Debug_Installed) n8 @( ~  M0 ?! d# z
   je      not_installed
. n% j' S: t( E. j& }& s  `/ Y! `7 K
This service just checks a flag.
+ ]( b) [9 d, x9 p0 D( x</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-8-10 21:43

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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