找回密码
 注册

QQ登录

只需一步,快速开始

About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
$ Z2 G3 g) g- A! ?3 e<TBODY>
# n1 k# G" u% J$ ?9 _0 v<TR>
$ r4 @& N8 a3 A! v<TD><PRE>Method 01 6 A. Q/ ^( I0 s2 k0 U8 i" g: [5 _: q" ^
=========5 P0 L% T) S/ _! C& a% [
& M1 r- C2 f) O. U
This method of detection of SoftICE (as well as the following one) is" {2 {, u! I6 a: [3 P5 m
used by the majority of packers/encryptors found on Internet., R/ }4 m; W9 F6 ^
It seeks the signature of BoundsChecker in SoftICE
% N  j/ [- v1 c3 e+ g
6 z' M; N& Y$ z* Y6 S' ~; C    mov     ebp, 04243484Bh        ; 'BCHK'& u3 b- _3 h/ m* N: ]( i2 `
    mov     ax, 04h: F; b3 }8 p: z+ Z5 b
    int     3      
+ d1 u6 [" w- h+ y: d# l* T4 I    cmp     al,4" l' u2 O4 R0 a6 O& k9 N/ T
    jnz     SoftICE_Detected
! h8 M- u% q$ y0 b  P( \
  \% ]' w+ ~3 j: e8 t___________________________________________________________________________  f! y2 V) Z! U2 x. d- j1 t

7 Q. i' F) p6 i% hMethod 025 R* j7 e2 V& W  [/ e- ~
=========
2 P( o+ ]% s" I- Q' E7 w. g* D6 `* e$ Y, {
Still a method very much used (perhaps the most frequent one).  It is used
2 m- r8 q; q0 x8 |, Q1 ~2 e; ^to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
: {- X; a) A% S  {or execute SoftICE commands...+ T9 V/ w* g* ~! d; G) l
It is also used to crash SoftICE and to force it to execute any commands
9 u; P8 W/ ~" \! u/ r8 N4 i(HBOOT...) :-((  
" n8 \& C. m6 t) K1 \3 A7 o' p4 ^
4 a% g8 H# U% }9 I0 r5 OHere is a quick description:
! q0 y/ p0 t: j- H/ h-AX = 0910h   (Display string in SIce windows)
/ }4 z" j9 U( p( A7 Z3 K-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)6 M- B) E' K0 X9 E" K
-AX = 0912h   (Get breakpoint infos)0 H) j+ S& a: U! S8 A
-AX = 0913h   (Set Sice breakpoints)/ H4 h& e% g4 ^3 m  P# W1 C
-AX = 0914h   (Remove SIce breakoints)
1 L4 }7 F$ M6 }% i, a: {! B
& M& E9 B, Z; l& K6 nEach time you'll meet this trick, you'll see:
' Y/ R7 N, n* H& D2 ~-SI = 4647h! _5 d2 \8 `3 y4 x% h) l  R
-DI = 4A4Dh3 U5 x  t) `. N' ?6 Q$ {
Which are the 'magic values' used by SoftIce.
, e- y% J; `; Y9 h( p9 ?+ m/ WFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.; d6 Q/ y% Y8 n1 x0 ]! y

- d8 ?8 t5 e4 k6 F) AHere is one example from the file "Haspinst.exe" which is the dongle HASP$ f# W, `, H" Z# L# o: h
Envelope utility use to protect DOS applications:. \3 e! ^6 N4 C: Z

" `& [" Y% V) O" T; v- Z7 V3 m2 @; s; X! r- F
4C19:0095   MOV    AX,0911  ; execute command., Q& Y" o0 u8 P; h+ U
4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
9 H# H/ X" M+ x! W: m* D: Y: k4C19:009A   MOV    SI,4647  ; 1st magic value.
1 }* ^& n  N" O. X4C19:009D   MOV    DI,4A4D  ; 2nd magic value.
  U5 c" F) n# x4 j+ {4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)5 k0 ~) O9 j# O. H
4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute& }7 N1 J9 Y4 i$ f
4C19:00A4   INC    CX
5 I! M5 _0 f. y8 a7 \4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute8 {' Q0 L% r5 e  _
4C19:00A8   JB     0095     ; 6 different commands.
: z! b- P( q8 _* T1 E9 F) q4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
7 v. T- p( ~( K4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)
7 r, ^" F, t- N" z3 y: |* Y( B" x. q0 _2 R1 D) w7 o9 W3 ^* @
The program will execute 6 different SIce commands located at ds:dx, which  F0 G3 I0 ~* p7 Z3 I3 M7 y
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
1 w4 R6 g: P) R$ }& q4 E* }. b- ^% [) J- G! z0 w1 M
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
% P4 R2 ~& S& P9 V___________________________________________________________________________# @4 x9 Q# Q, `8 ?/ d0 |0 e
2 M( b+ @, L2 g; q& }
6 o3 n3 i2 p# b* f# L: g  d' j. Q
Method 03
' A' R7 s$ i4 w+ Q# p* F=========! P9 n# V9 h1 [0 `
. P6 b7 v) L1 L: `
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h; y4 e' C# Q* ]* v! i4 q9 B
(API Get entry point)/ x0 i1 i# `7 s7 l9 [! A* g
        
% P4 A% ^0 {: q( l- p+ d8 u9 T2 e$ z
4 w# ]' h- C. H9 z    xor     di,di
, j. N! X9 J1 X' s9 g    mov     es,di+ q+ R9 k9 p- P, T& H/ q8 S1 f- H
    mov     ax, 1684h       # M- e$ O7 a9 a# U+ n
    mov     bx, 0202h       ; VxD ID of winice
( Z/ b! |5 c$ V8 X2 _! @    int     2Fh. g, j8 @1 Y" r( a# e$ O: n
    mov     ax, es          ; ES:DI -&gt; VxD API entry point
$ Y1 c2 ^4 Q9 y' X! b% [    add     ax, di
1 H3 e' {" L+ e    test    ax,ax1 r; k- @9 O/ M1 B5 N
    jnz     SoftICE_Detected* }: [! f$ d. o( b* a
4 K0 K8 ]3 h. M2 D
___________________________________________________________________________9 y/ Y' j  U; c9 \* c0 m1 b% P

0 o5 {7 ?0 {1 w0 h* XMethod 04# M5 \: D* k2 O
=========% m& F, K6 g4 r4 p
3 \! P* d) I( [3 Z, Q3 J
Method identical to the preceding one except that it seeks the ID of SoftICE2 r! C$ Z/ W0 _2 w( {
GFX VxD.
/ o9 L* f5 `% h; t8 f' q# [4 f) ~4 B% K( J- F
    xor     di,di
- \. b+ d1 W& h0 I; t$ Y5 e* R" |% }    mov     es,di
, A; B' b; U% Y) b, o$ \    mov     ax, 1684h      
7 ?7 o8 G- A; ]5 I4 k9 L7 {    mov     bx, 7a5Fh       ; VxD ID of SIWVID
0 K% ?: M( d0 G, ?    int     2fh; w  s' }( L3 ?( k0 t. m- W
    mov     ax, es          ; ES:DI -&gt; VxD API entry point; v# m+ h, ~0 Y0 t3 C
    add     ax, di3 n3 `( Z/ L; {/ a
    test    ax,ax
8 C2 U3 b! ~1 o3 h( G) b* I    jnz     SoftICE_Detected- w+ G7 S" r1 w& r9 |& ]" H$ a4 A9 T0 \

; B0 P4 [; W& \__________________________________________________________________________
3 d5 A1 C5 T: V! I# d( q8 @: \' n$ n- l. _1 y# k% l5 ]1 J8 o9 z1 w1 b
7 V: m% X& K, I) Q
Method 057 l" S* p6 z1 i! e0 k) D6 h* [2 v9 I: d
=========
  d( s0 l/ ~" T5 K/ c9 ~
" k1 `- n7 ^3 ?3 J. LMethod seeking the 'magic number' 0F386h returned (in ax) by all system
6 x( q. J! J* `debugger. It calls the int 41h, function 4Fh.- h; T! n( f0 D' s5 Q4 {4 ?
There are several alternatives.  
- j' j+ w* n- e9 V! J8 }2 @( d! h! ?/ X4 S% H
The following one is the simplest:- m0 D0 c. j) D3 ]4 z

) o( a0 s/ _/ Y0 `9 p    mov     ax,4fh- @1 X( S" S# `' S7 |, X$ j
    int     41h/ `8 T% j; Z# p( H, Z% C0 u
    cmp     ax, 0F3860 Q; z: F" D) s2 R
    jz      SoftICE_detected0 k# m4 X7 {( B6 _
5 u, P0 N/ e2 P1 q4 }3 }

# a8 i* }% Y. ENext method as well as the following one are 2 examples from Stone's
+ K. N2 y7 D9 P$ q; y"stn-wid.zip" (www.cracking.net):
! h3 M0 P1 `5 J+ i, Y2 x' u
0 O# N9 p. Q5 e" K, A    mov     bx, cs" V7 }8 G6 F/ _2 f, e
    lea     dx, int41handler2
# C: P3 X# H% v! ~    xchg    dx, es:[41h*4], W1 Z. ?5 T, |8 t
    xchg    bx, es:[41h*4+2]
5 @" l5 _8 z; p7 P1 m4 @    mov     ax,4fh
& q: _! I$ r: M( K' i4 e) k" n# M    int     41h
. D/ A. m; Y% S    xchg    dx, es:[41h*4]
- m) i$ X7 H! @. T5 g* n    xchg    bx, es:[41h*4+2]
# S* I8 X+ R* ~# T" M    cmp     ax, 0f386h
  Q/ D. u6 C2 c- i6 U/ y$ T( P    jz      SoftICE_detected
, P5 A1 u( u; b, w2 E0 H' x
+ S* C( d8 C9 e5 R* m: jint41handler2 PROC7 |- @( A/ O# r3 ^- l
    iret
4 Q8 p" A( V: C, N- Uint41handler2 ENDP5 c' Z; B; ]4 d. T2 R! {7 b

/ b1 f$ |3 K8 \/ F( Q
8 K4 P0 L- J! G1 K* K5 O_________________________________________________________________________& n" c- F, d" [  m" ?5 l. H% n- I
, ^# W4 y# W. ~+ G6 F) L" n

$ \; ^1 i% R! U6 @Method 06
$ {  m# ?; q' }=========' L, u; R  X8 p, ^

# @9 B  ?& p1 q8 N  A3 b
) B6 Z' M* h3 Q* y$ i  W2nd method similar to the preceding one but more difficult to detect:
% l5 c# n. R6 l! ?5 K! _/ @: w8 L! ?- @; r) B8 M  Z

/ D: O% c- P" T1 y( hint41handler PROC6 O/ j/ S; \1 V! o. k4 o9 H( R
    mov     cl,al/ Q7 G2 [- X, ~7 _8 h1 s
    iret$ m. @$ [) t; G, x8 ~/ u# v1 {
int41handler ENDP
, c3 L  I' t% s) x, W- I
, p# |+ G$ M3 Y- _: d5 n" Z+ u7 \" |1 S- t) K
    xor     ax,ax
' q9 L% [0 X. u3 P' q    mov     es,ax: D8 {* A7 r  {! b0 q
    mov     bx, cs
/ r, ?$ b, n- B* h6 V4 |    lea     dx, int41handler: r0 i" d* ]) D+ m4 K, I8 j
    xchg    dx, es:[41h*4]
! M7 R8 ~" G9 B& K" `+ f  R  ?    xchg    bx, es:[41h*4+2]
: C/ x# k- }4 m( m" x, z. A    in      al, 40h* i2 y3 X3 j9 ?# O6 f* ~  O
    xor     cx,cx
5 g' a- m' o# L* |8 x" R    int     41h/ n- z4 o7 l4 d4 Q( V
    xchg    dx, es:[41h*4]
2 Z: b* T: o' J+ g; w4 Z    xchg    bx, es:[41h*4+2]& v& i3 c( H7 y" ^- c
    cmp     cl,al% r- f1 Z0 Q' K3 b$ m, l2 |
    jnz     SoftICE_detected5 s1 s( B1 A, [) I6 G- v# o5 l

# k' w8 G- ~5 S/ U% i_________________________________________________________________________5 \" I5 O8 L) _+ R

) p7 |! A  @5 P7 O  S- FMethod 07
, l) Z1 p# i6 p' s0 @0 f=========
6 U% p, B$ b' G. S4 \( ?# K: ]5 [0 w4 [* j8 Z4 V, k5 v0 ~+ B
Method of detection of the WinICE handler in the int68h (V86)' i- P1 ]3 \( b# {% o& J7 s
$ J$ B5 Z7 O" i$ D, i" ~& K- y
    mov     ah,43h
  [# S# j& S, {, K3 j' X    int     68h
+ ?( o( s. ^+ h' f    cmp     ax,0F386h
, |2 n2 K4 ~! u1 f6 S1 k, {/ y1 X6 l    jz      SoftICE_Detected0 B+ P" Z$ E# g4 s( A* r

" X1 |4 J5 W6 a3 n$ {3 D9 P# `. j8 ?
=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit. [2 h( j8 M1 a- w& V
   app like this:7 L, ?7 {& n" ^! R9 i7 X1 }2 g

  S) n! Z1 F7 e% @& {: B5 w   BPX exec_int if ax==68
( b, h/ l. X5 t) D& G0 X; z  v   (function called is located at byte ptr [ebp+1Dh] and client eip is
7 k: [+ b  {9 H5 n7 b   located at [ebp+48h] for 32Bit apps)  ~+ R; O) n. ]9 ^
__________________________________________________________________________# ~: F) U0 C& [, f1 d
! n. x$ V# y9 e0 e% @8 y
! K; N0 B- K* P+ L# t
Method 08
7 S) s! o0 i9 k: {+ v! n6 r2 Z=========6 |% K$ }3 p6 k  L6 J9 @
0 W  b: h  k. E# [4 _. {8 _2 k& n8 I, T
It is not a method of detection of SoftICE but a possibility to crash the- o$ ]: ?  p' s" X5 N2 J) V
system by intercepting int 01h and int 03h and redirecting them to another! s2 i0 j3 U' `! w0 k
routine./ R% S: ~4 T1 Z% ^. j  K* g4 {; r
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points, [! x" L) H$ z0 E# t4 v
to the new routine to execute (hangs computer...)$ g! ]6 B* w# h0 M- r1 P
8 S- ?  z) E3 ~% z4 ?
    mov     ah, 25h
# S! s/ c6 b0 e8 }    mov     al, Int_Number (01h or 03h)
- M9 l6 I( c2 |2 s    mov     dx, offset New_Int_Routine6 I5 G9 d' ]# F# F4 `9 T$ S+ U, r
    int     21h
/ W- V9 y. w. C- n4 O. _. E
2 ~5 b1 ]& K  B0 d. j! h__________________________________________________________________________4 |. Y! d+ C) m6 z/ p2 {# R9 V

' X- t; @0 X- U5 UMethod 091 M# k* h8 D4 T+ P: O
=========
% Q: d. n- n/ d2 a0 c. Z; c0 a  H) f- ^# l) `3 w
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
. s+ \- |$ a* u7 v- a# H, N/ Kperformed in ring0 (VxD or a ring3 app using the VxdCall).5 }8 E$ K- a5 U: B
The Get_DDB service is used to determine whether or not a VxD is installed
; z# C8 Z& G) D) a. \- Vfor the specified device and returns a Device Description Block (in ecx) for2 }9 o- m% X$ }5 @. N& W, c$ w3 b7 j
that device if it is installed.1 k: e/ F2 |: l' W: ?- U0 n3 [" I

+ A! o( J5 b8 O   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID5 F$ }' e  Q5 p8 W. }5 W3 L
   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
4 B; i9 t7 r% B. P   VMMCall Get_DDB8 e6 V* R0 w7 d9 U: W
   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed
$ ]; m2 t( J/ |) L: s0 m$ m# {) W! A/ x: G5 V1 {, F3 J1 E
Note as well that you can easily detect this method with SoftICE:0 A, Y3 ^( L- K8 u1 E9 {- h5 D1 D7 g
   bpx Get_DDB if ax==0202 || ax==7a5fh- S/ l0 d, P! g  e) w/ H
% |- c% H+ X( E: |- D$ \: p- P
__________________________________________________________________________" L4 B  ]( I$ c/ ?+ H! I
4 C% J0 v' X. Z7 L) o* [$ d
Method 10& V% O) }# k, k& F8 q9 s$ Z' ]7 u
=========
: L. ^4 q  L+ N  l# ^, f- e# u& \4 k+ `4 S% _& C/ A1 j+ u5 }% y/ C
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with
/ L8 r: t; f6 x  SoftICE while the option is enable!!9 c7 n- b% h/ b) L/ U9 |

' n. h) k5 i/ `- L* X5 S! ]This trick is very efficient:
+ v' ]% s* D% n# _3 c: C/ B5 b  [by checking the Debug Registers, you can detect if SoftICE is loaded
6 |! Y8 T- |$ _$ R(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if4 ?3 D1 Z" f1 t& q
there are some memory breakpoints set (dr0 to dr3) simply by reading their
0 j; q" U$ I0 {! g. j0 {, z* pvalue (in ring0 only). Values can be manipulated and or changed as well: |# Y  V3 w9 V; ~0 F- F  P' @! T
(clearing BPMs for instance)
- g+ N) `9 h) R# ~) F$ ^9 W( f" `& m1 N3 P/ I% t% Q  T3 d
__________________________________________________________________________% v# E! L# {" C' w
6 O0 j" m8 p$ z/ @% ~. l4 U
Method 11
0 {; O- ^% c* b, J9 b8 }=========
  G+ i5 `& N) h3 x
! j! e) J% \4 n8 O- bThis method is most known as 'MeltICE' because it has been freely distributed
# e1 a7 P9 {( l! a* Nvia www.winfiles.com. However it was first used by NuMega people to allow
2 q1 g; b" P: t; R- v5 F0 F2 eSymbol Loader to check if SoftICE was active or not (the code is located' u( a9 o* y# ?; ^- q
inside nmtrans.dll).
2 J6 T* E0 `3 \$ X; s. w9 ?* I1 N, @4 L% K7 S
The way it works is very simple:
- z; X6 z0 ^% T( i3 @( zIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
2 S! A9 V: [; b' V# GWinNT) with the CreateFileA API.
  W* m9 p, B, v& V
/ Y* x2 ^: _7 {& xHere is a sample (checking for 'SICE'):8 W/ b7 W( q* i  G8 h9 z8 M' p

% p+ D6 x& C& w# p0 B" ^) U1 G6 jBOOL IsSoftIce95Loaded()
" W5 i5 {8 w, v( T" i4 `5 i: i{* w- x# |, s7 Q: y- B4 c  I
   HANDLE hFile;  2 E4 h( M  W. h% @) i
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,  m2 e* M8 C4 s" e& G
                      FILE_SHARE_READ | FILE_SHARE_WRITE,! c1 T6 ~! d5 C# E* h/ K: D6 `9 a
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
. k3 e# r* I- ]3 k   if( hFile != INVALID_HANDLE_VALUE )
+ w% f6 F1 ?. Q   {! s+ c: X* r  _6 m9 h  A% A
      CloseHandle(hFile);7 R) n/ G7 V* T6 p
      return TRUE;
" ?) W- q; s7 ~' w8 n, J   }
0 I. e; y, ~( J6 E2 [, G   return FALSE;; E2 x) g) V: R; u! {' f
}
; h8 Z$ Q2 L& \3 X+ w6 X% n3 c, X! x- M: e) T9 j" |- h
Although this trick calls the CreateFileA function, don't even expect to be
- ], O, v; u9 ]0 R; ]% s$ Yable to intercept it by installing a IFS hook: it will not work, no way!9 _# H2 M: j, M- _$ d
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
! o: [0 z9 G( D$ i* ^; M* C9 \4 eservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
% V# ?* d; {+ K* ~  q! }and then browse the DDB list until it find the VxD and its DDB_Control_Proc
3 {/ l3 L. l# e5 Qfield.
, a+ S7 W" \" ~9 T9 R; CIn fact, its purpose is not to load/unload VxDs but only to send a
$ |! o' P4 u- P: O/ dW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)) m% n0 [+ {1 `7 [! y( \
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
' H+ @( f/ V; ~% @& j  \" o/ r/ Pto load/unload a non-dynamically loadable driver such as SoftICE ;-).: i: X- ?/ k; V6 c2 q$ s6 @) U
If the VxD is loaded, it will always clear eax and the Carry flag to allow; g2 F$ ?, P2 F7 m8 Z
its handle to be opened and then, will be detected.7 p( H; f) C1 S" B
You can check that simply by hooking Winice.exe control proc entry point4 [0 `/ J5 v! ~. s1 m! [8 R
while running MeltICE.% B9 T$ r- i  v0 t6 X4 T

# V: d1 N, a' ?3 u# Y
: E/ b  y5 C6 E$ W: k  00401067:  push      00402025    ; \\.\SICE
, Y$ r# v! M# ]$ ?# o/ F' _, ^  0040106C:  call      CreateFileA/ ^& m4 d* u: e0 r8 x7 T
  00401071:  cmp       eax,-001. ^* s/ t, i% z6 k" `  v
  00401074:  je        00401091
' \7 u9 Z" ]( q+ J: Y; c" S' f& n4 a0 [8 v; @' D
) h" @! z' m6 D9 A. @7 i; w
There could be hundreds of BPX you could use to detect this trick.
8 B3 U1 h2 ?6 z7 K; [+ i* D-The most classical one is:
: Z* V0 F: L4 K8 G& o0 E) \: L  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
  o' T& l! @; F% C  o: n3 ~    *(esp-&gt;4+4)=='NTIC'
2 z; i  t' H3 O- z/ x$ G! E$ T/ W! @, [& z, |
-The most exotic ones (could be very slooooow :-(
7 f" I& Y7 }- p5 s! [   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  3 l$ ]' D; _: c) o( H" P3 W
     ;will break 3 times :-(- y! F2 g1 y, G( c4 y% W' I

. z4 k& f) m8 g" i-or (a bit) faster:
0 `' [8 c0 d5 v   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')( m/ |: e. u/ _! l; C
1 i  y+ M8 K, v6 W
   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  / u8 W0 S7 R  r1 M* l
     ;will break 3 times :-(
* O  v9 ^- p: T" N% @9 @
7 Y1 g) H1 V* U* P( @-Much faster:
- N8 S1 ?, f  s' C8 e4 k) M3 E   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'
! h% E/ {9 ?" T. S5 P0 g0 h* B
  _) w( W8 w9 p  v% D$ C( Z, O5 l% _Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
) L' g* I5 i& r# W6 a6 w) afunction to do the same job:. I2 t. V; m+ X3 x( ~
- \! L7 [3 p0 x  U
   push    00                        ; OF_READ
! `2 D0 j# m; n$ w- I; L) b   mov     eax,[00656634]            ; '\\.\SICE',0
! n+ ^8 g. n% t% Z2 ]0 e" G   push    eax1 n3 ?/ S2 q7 o2 z+ C
   call    KERNEL32!_lopen
6 i  [% Q+ P% H# O9 T" q2 V   inc     eax
1 n# ]9 X, X6 B& E) d5 c6 w% o   jnz     00650589                  ; detected
$ J  K; Z9 M$ A6 H4 g   push    00                        ; OF_READ
% m+ ], [, L( f9 B8 m$ K* b   mov     eax,[00656638]            ; '\\.\SICE'5 x1 R. s% H. K7 l6 C# }$ t* s& g$ U
   push    eax
; A: o" ~6 A" }$ p9 o) Y- L3 A8 ~   call    KERNEL32!_lopen: s/ v5 k8 D0 Z" @/ C
   inc     eax: s0 C( E- \; B; f5 C
   jz      006505ae                  ; not detected
5 m: u; A9 q: r$ A" u* W9 H% T; a+ f' @" w1 T* E5 A

) H" D0 s5 l: X! K# r9 n, |# T7 k2 q__________________________________________________________________________  e0 d& N7 Y1 h: G
& l/ s, V9 x1 l
Method 12
: P. ~+ v. ~* F/ \=========
: ]7 o, U: j' n, N8 |( z1 R: \$ W! l% v- h
This trick is similar to int41h/4fh Debugger installation check (code 05" m3 @) T# R& F
&amp; 06) but very limited because it's only available for Win95/98 (not NT)2 |; _& u# _1 A6 j  g
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
$ x6 Q# h' F( U$ ?2 G! L4 {, C& e$ m: h
   push  0000004fh         ; function 4fh
& {- x6 ]3 E7 v# f" [3 a   push  002a002ah         ; high word specifies which VxD (VWIN32)/ a) Y1 j8 i0 M
                           ; low word specifies which service
4 f+ D2 k- |( \2 x) t5 ~3 Y                             (VWIN32_Int41Dispatch)8 u8 A! ^4 n# \& K& k& D
   call  Kernel32!ORD_001  ; VxdCall
# C! M  [8 W4 S   cmp   ax, 0f386h        ; magic number returned by system debuggers. U" B5 B7 W$ N2 G0 G
   jz    SoftICE_detected( r# j" J1 y9 L+ z0 J/ A
1 G+ T3 e" L+ f8 T% |: w
Here again, several ways to detect it:- V* S, Z6 Y$ T; u/ i
5 B$ A2 P7 p% K$ i2 y4 k
    BPINT 41 if ax==4f
& M. L$ S# L8 ]
' d( j7 r& ^% H( T    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one
- o& h# D: F, y* ^+ h$ Q
/ a9 @( Z- d+ j, [/ }    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A: @& T) M% W  O+ P6 Q! Q5 x
0 w/ z! L9 i+ R' i
    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!2 L# b" H! P# k4 F

) v8 f5 B: U' C2 \  {6 C' u__________________________________________________________________________; C! R2 J" W1 V$ Y3 Y' B

! n: w- f* p& O" ]5 jMethod 13
( L* I* p/ g/ g" _=========: P& C+ E5 W/ p3 [8 a) Y8 @0 K

5 v1 Y9 w1 n# U$ ^Not a real method of detection, but a good way to know if SoftICE is
0 F0 u1 ^& c4 ?; k4 a# @* Oinstalled on a computer and to locate its installation directory." F$ Y2 Y) q1 |0 w2 t
It is used by few softs which access the following registry keys (usually #2) :
5 q  `8 r1 o) w; e" Q5 N0 x9 h
4 `+ F+ b* Z: z* W% X* j-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
# {) U# g# |1 z& x5 j0 L\Uninstall\SoftICE
2 n: u1 C9 z4 V0 j5 E! x-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
% y$ D0 c; |" Y-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
8 ~5 [. B, I- c1 Y8 u  A% L. Z* p\App Paths\Loader32.Exe- |4 H) g5 h! J& H6 B# {

+ I& e6 L8 [1 e3 F9 j# o- D7 Q/ ~8 ?) Q5 `- B. Y
Note that some nasty apps could then erase all files from SoftICE directory$ ^, |7 Z$ O/ h: u1 N1 }# r: v
(I faced that once :-(4 _3 \: d: k' Y7 f

0 B. D, \: f: m! E+ yUseful breakpoint to detect it:
* x  ~/ k$ w1 \5 Z! s
* V3 m. |+ E$ ]     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
* `- e6 N2 F4 K* E. l* ~- p  a6 |
; I# h! M# ^6 e1 ?__________________________________________________________________________
+ w5 P; e: u- r) j. P* ^* I2 j) m3 v

( W/ P6 |0 F9 d4 pMethod 14
( F( m0 r' t) s  F=========+ _2 R  p9 T: n# o# z
- ]. t) j: w. `. f! e, q/ D3 F. _
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose. z& B1 q$ i8 Q# N+ k' O3 ?7 _
is to determines whether a debugger is running on your system (ring0 only).) Z) P5 I  b% z5 r. ~8 P

$ R) L. V' x/ n& x* g- b% w   VMMCall Test_Debug_Installed3 o7 o' P% t" y" Q% W6 q
   je      not_installed
( {6 y0 S8 H% x0 s8 f% ]$ P2 n) S: `2 D9 ?1 U
This service just checks a flag.
& Y1 n; O) T8 D7 Y5 e/ B</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-8-3 02:06

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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