找回密码
 注册

QQ登录

只需一步,快速开始

About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>; r5 i2 a/ L1 [3 W5 U
<TBODY>. W4 }+ S5 d8 t. Y+ z1 {) K; l
<TR>
  \" h" N' f5 Z3 K, J<TD><PRE>Method 01 & [& \8 k' H7 q* p
=========
" h" S! ^9 V, i3 o6 ?: ^( ]6 [$ E5 B& P+ i
This method of detection of SoftICE (as well as the following one) is
% t/ D% m' D! J. tused by the majority of packers/encryptors found on Internet.% _& j: B0 I! Q) D8 u8 n
It seeks the signature of BoundsChecker in SoftICE
5 N+ s6 ^6 j" }. e3 d3 U, E* o0 h/ m6 S. R' P0 G% S3 s& X/ T" L5 K2 O
    mov     ebp, 04243484Bh        ; 'BCHK'% B( l' K$ b, }: ^2 ]2 C: X; E
    mov     ax, 04h
' x, ?  d" b" o0 S+ G5 @8 E    int     3      
- F5 p/ O% |+ K$ J& ?1 q    cmp     al,4
5 O) Q& ?" P1 S    jnz     SoftICE_Detected
& K/ ?# s; y* O+ c) d- G7 K6 z4 r
7 M) l1 l9 w7 [1 k; D: Z___________________________________________________________________________2 T! y! V: ~, M% U
4 |6 Z5 u3 V% E; ]- h
Method 02: g8 J' W# e8 }
=========( S) U. e3 ]4 \/ g) u/ r( k# O( ?
  `7 Z# ]+ w8 }. \  J) e
Still a method very much used (perhaps the most frequent one).  It is used9 T2 Z# K; @& X) i: O& X! |; `
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,/ T+ z& d# t" a' X
or execute SoftICE commands...
% h8 U5 L* a  M6 y/ pIt is also used to crash SoftICE and to force it to execute any commands3 i  ?$ `7 k  E
(HBOOT...) :-((  
* P& f! Y/ _1 y& r* F# C; {0 g0 m  b- D$ f' ?
Here is a quick description:
# K" t* ~8 s/ D-AX = 0910h   (Display string in SIce windows)
' e4 p4 {: s  _) ?. g-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)
4 O- C/ M/ I' s8 F" d0 M9 g-AX = 0912h   (Get breakpoint infos)4 c, p; l, O5 J: v- T9 Z' [
-AX = 0913h   (Set Sice breakpoints)
9 Z0 R( e3 @4 a-AX = 0914h   (Remove SIce breakoints)9 w: [$ k/ V# s8 d' G
9 I' v8 B" i7 e+ s' n, N
Each time you'll meet this trick, you'll see:6 t2 w8 ]8 e) u2 z! X4 ~
-SI = 4647h  \, b  g9 V* a2 \$ l
-DI = 4A4Dh
; G. q6 ^7 L6 w+ C$ q+ jWhich are the 'magic values' used by SoftIce.
5 E. C" q1 v- S/ U# @1 c( A2 GFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
+ F/ G$ b4 j" n- ?8 S4 w0 Z. T" U+ x) c( p3 ?& O: F0 r! Q/ b
Here is one example from the file "Haspinst.exe" which is the dongle HASP
! `8 f7 y. G" q5 y" a' w. ~Envelope utility use to protect DOS applications:
+ ?+ X- `* T. v. O: f
. c9 a- `. z: r, O. `0 i9 [' M
( w7 z! @3 L7 o2 ?! \& [& W) X4C19:0095   MOV    AX,0911  ; execute command.
  a. A, |0 r  R1 w' D8 F" y4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below)., j+ y5 P3 Z% ~
4C19:009A   MOV    SI,4647  ; 1st magic value.
" t0 z! t# Z" o1 z4C19:009D   MOV    DI,4A4D  ; 2nd magic value.5 a: Q3 Y: Q: O1 u6 X
4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
+ F6 n8 v2 Q6 ]# E4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute
0 v) Z5 O+ |9 P8 v3 \6 l4C19:00A4   INC    CX; n$ c/ T5 o4 f/ S6 N
4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute
0 d" B  s9 z8 U2 b2 ~4C19:00A8   JB     0095     ; 6 different commands.
% ~7 m' S5 J/ X; P0 Z3 n4C19:00AA   JMP    0002     ; Bad_Guy jmp back.7 Z4 h$ ]! @4 Q' b. g1 l0 Y
4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)7 z/ k. W& q3 u

3 ]  P) ?" W' `$ lThe program will execute 6 different SIce commands located at ds:dx, which& w( G; W% J. s3 l( J
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.  ?. _" ^8 J2 i, B9 _
" Q1 s5 Y) Z: C% ]$ |  k1 |2 B
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.. H# T$ C0 K& P# [9 i) S) J
___________________________________________________________________________
# R- q6 }. X! W2 j
3 `7 s/ D3 u  H; a( z2 W' P5 z% T( u$ d- ]8 @
Method 039 s) O2 W/ C# N- U, |: k5 p
=========8 r  a9 k7 e* A1 \" \) b
, I6 Q$ h1 I+ S, ?% R
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
- x; m1 h2 y! ^3 p(API Get entry point)9 @, h1 a6 y" G9 D; s+ c5 Q
        
' I9 j0 O$ U, F1 s; c- a$ }& o$ W' V% _: M
    xor     di,di
; @6 v7 j8 O- x& R' j$ m4 C    mov     es,di
0 w# w$ v& y+ M$ K3 N    mov     ax, 1684h      
; a  r" R+ h" D, p- g5 \    mov     bx, 0202h       ; VxD ID of winice/ }) L1 \8 ]' w/ l" o  I
    int     2Fh
0 o/ c9 O( E- i. e6 h% J& v    mov     ax, es          ; ES:DI -&gt; VxD API entry point
- e( o% j/ Q1 U; y    add     ax, di
! H" T  [+ M* Y: _    test    ax,ax
6 x2 A0 m+ O7 O* v6 ~( u. @0 O! D    jnz     SoftICE_Detected, ?% D2 Z" p5 R- Y3 i

7 }' c! c- |0 M8 x7 T- Q___________________________________________________________________________
7 c- k4 z1 M& Q6 @  A& i" C& I4 z6 n4 Y) k; n
Method 04
/ t4 m1 [( \' ~; x4 B# F2 \- z( [=========7 A- e8 |8 U5 u+ C

: O; {; k4 _  J& Y: {  B8 V' nMethod identical to the preceding one except that it seeks the ID of SoftICE  `) |: Q0 t; A: `
GFX VxD.# e+ i8 @2 e- f; C. i
+ k. V1 \  U# s7 S( y5 ?3 `; p. E
    xor     di,di( _6 r% S$ h7 b0 T
    mov     es,di' n2 o5 U( g; ^5 p" l
    mov     ax, 1684h       & i& L, }! x# E2 @
    mov     bx, 7a5Fh       ; VxD ID of SIWVID
4 g/ a: c) z' W0 Q    int     2fh
' i- E6 R7 @1 ]- ~6 ~. x    mov     ax, es          ; ES:DI -&gt; VxD API entry point/ p/ I# r6 v* ?# T* v* [5 D
    add     ax, di2 A- [7 @; x$ p) K3 ?3 j& _4 R1 M7 \
    test    ax,ax) W+ J$ x3 O' L7 R! |
    jnz     SoftICE_Detected
; D3 o2 R1 q2 T  ]7 t0 H# X2 X3 a/ X& {% R
__________________________________________________________________________8 u  u5 `1 R, p. F$ a1 Y# v8 k0 b
6 p- p# ?, a) ?

6 ~/ P+ A( s; ?' h; tMethod 054 d- @- {3 h" X
=========# O; d! S6 C; e5 [

- z) n# b3 W7 Q# ]+ z$ qMethod seeking the 'magic number' 0F386h returned (in ax) by all system( E: g4 |6 U7 A5 v% B4 E5 A
debugger. It calls the int 41h, function 4Fh.
% }1 d" {3 X  D0 \& d. u, _; jThere are several alternatives.  1 g6 s9 d4 p; e# Q% T. c; ^
; y6 m" b' K1 O' `1 a! H9 Y5 Z
The following one is the simplest:
9 k% f1 Q  ~: O; K
, _& S# O$ F0 a8 |6 m    mov     ax,4fh
2 _& @" [. p4 }: ]9 m2 v    int     41h6 Z, G% S$ |' [, S
    cmp     ax, 0F386
8 |1 L3 [1 M" e, @; g    jz      SoftICE_detected. E$ d+ ~9 D1 j+ {
/ X6 J$ f6 l% c, @
) u* y' Z( s! L* s( h4 U% S
Next method as well as the following one are 2 examples from Stone's
& B: s) t( P6 l7 S6 v"stn-wid.zip" (www.cracking.net):
$ z0 h7 x+ h4 a) ~* U; m. ~- E  _5 W, l3 S6 r1 |1 N1 v
    mov     bx, cs, m, h. U8 z9 e0 u
    lea     dx, int41handler29 c1 H! Y, ^! k" X; C$ O( r) p- o) p
    xchg    dx, es:[41h*4]  T9 I+ A3 i, R" x) G7 Z/ Y& S2 V
    xchg    bx, es:[41h*4+2]4 P& T8 ^- D2 y: ^5 T9 K
    mov     ax,4fh
* K" Y7 O, |9 Y: w3 y# Y    int     41h/ g+ q* c% m! ?8 k
    xchg    dx, es:[41h*4]
- K/ v2 Y# g' A! q& B0 c. m7 F    xchg    bx, es:[41h*4+2]
7 P4 ^" w% S2 L, N2 W/ J5 |    cmp     ax, 0f386h
$ O! \# E, w5 [, L% |( l7 O& N    jz      SoftICE_detected2 e0 \+ L5 ?0 s- l

. v8 G/ y1 I( s/ T: \  Qint41handler2 PROC/ a4 H+ d) i5 m1 M- G8 U4 D* B
    iret
' t8 {* e+ ^1 O+ c. sint41handler2 ENDP
- r2 n' G: M0 }4 h& L$ W1 I) S/ u$ d
/ |* B7 h7 F& a: v) f7 m) y" o, R: k& s$ q5 q5 c) W6 q
_________________________________________________________________________, r' Z6 p/ F( G# B% s8 m, P* \! C. T
; O% w5 B1 j" F8 ?7 z" Y" ~

, H1 d, Q# B2 l" X' mMethod 06
. [9 k( V' D& Q7 r- K) K8 [# y=========
# Z1 f9 ^+ t6 g5 v+ x9 ?- D2 K  K, A7 e0 b3 d! j# H4 |2 }
4 ^; E' c' N+ Z' W8 R' f9 r
2nd method similar to the preceding one but more difficult to detect:
' W2 W! Y! M8 ?5 E) w& ]$ M, w1 [$ I* `3 Q: v, _
0 u- K1 q1 [% ?: {# d
int41handler PROC% a1 w" v) t6 N7 |
    mov     cl,al
3 u3 D  G6 [8 e) B; W& g/ j" B    iret
/ j2 i  P% U4 \# u. k8 Q/ S& Mint41handler ENDP
- H  b/ v3 [+ b% ^# e# z
+ \" C# X# m5 T  \- O" ]& U0 v8 l
    xor     ax,ax
7 ]- m4 B' [0 E& B    mov     es,ax: d6 I& U3 n+ S1 k2 c5 b% O: u
    mov     bx, cs
- b: V1 Z* [1 g" `; K$ Z) @    lea     dx, int41handler# O8 m6 T. |' _" f
    xchg    dx, es:[41h*4]2 i# I* n  D* B
    xchg    bx, es:[41h*4+2]
; `: z6 I9 N* Y' X2 T" _5 w7 R3 y    in      al, 40h* f; {, [8 a" W! e- a9 O
    xor     cx,cx
* F$ L2 a( _5 s; r0 v    int     41h
  \6 S9 o. C, I- t4 e- ]3 a    xchg    dx, es:[41h*4]
/ R$ |* k! M! y! Y5 m, o9 w    xchg    bx, es:[41h*4+2]
& p/ d7 M! D4 W% Y  e* r    cmp     cl,al6 w" \1 G0 R  \* v4 i
    jnz     SoftICE_detected
" [6 W. u% u4 d1 L. u7 A! c/ f
: Y: r  q9 E# Z1 I_________________________________________________________________________
; b) L5 g) x! O0 m, ?" p4 F
+ b3 ]+ ~3 @! g6 |) {Method 07" u, A# R+ N1 F5 S
=========
& w' g; U8 s, K$ G5 R8 j: I8 i6 P
2 a  B/ B1 \0 H* [% L* D3 R6 c  j! VMethod of detection of the WinICE handler in the int68h (V86)2 Z" ?( p3 H6 }9 y
2 ~8 q- p% J0 B
    mov     ah,43h$ v: m+ Y, _5 R6 w6 E
    int     68h
3 V6 q) T2 ~% ?* R& |& U9 A1 w. m    cmp     ax,0F386h4 v; A6 k: T; N/ C5 l% W9 L
    jz      SoftICE_Detected
) {) @2 x; O4 G/ Q
/ k4 }+ n: w. y. c! f6 S. J4 g5 G) S/ J" ?9 h3 {
=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit* {; i9 y' T2 j8 ]+ a9 N7 W! t" `
   app like this:
# Y3 W' N" x* [* Y, Z
- N9 U: y; ~$ K3 C- Z" e   BPX exec_int if ax==689 O* q' I8 R# I3 y" j
   (function called is located at byte ptr [ebp+1Dh] and client eip is
8 w# v# J+ L# O, b   located at [ebp+48h] for 32Bit apps)' n$ ~- n6 c' C9 Y, o7 o  ]1 E
__________________________________________________________________________
1 c1 a2 `8 G: j
5 }- D8 k' I7 O4 P1 V! B
, ]$ U) R+ s! O- s+ u  c* M7 R' k+ aMethod 08
" B' b) w# R' C  h* U  C=========5 ]6 F8 s& A* e! t
; g7 H% l: K8 p
It is not a method of detection of SoftICE but a possibility to crash the
0 M$ i5 J& s) ]8 P$ d0 Z. {system by intercepting int 01h and int 03h and redirecting them to another& D- a6 ?( B9 L0 k6 b4 i  p
routine.
. a4 g' e4 G1 O" n* v6 @It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
/ N/ a. m# K. R  t5 Ito the new routine to execute (hangs computer...). M! n9 G& s& l" b1 o/ l$ z
: g8 B% ]+ ?4 b; b0 i2 q
    mov     ah, 25h
, A+ g9 j, Y0 N! d! ?" ^    mov     al, Int_Number (01h or 03h)
: A' c5 V; V  ~4 T1 D6 K    mov     dx, offset New_Int_Routine% i7 v- m+ k. s, {  F) o2 m
    int     21h
  j  ?( {6 g4 t) _2 V
$ C: i! O& w7 J' q( c1 n__________________________________________________________________________
  ]2 F% n% q. ?3 c6 @
" v1 _5 O! W" R0 b" u, v/ ~$ B( PMethod 09
5 f0 Q1 m( T6 x; E/ t$ Q1 y( p$ G=========
- T6 L8 I" T) \6 z$ Z5 y# `; A) P6 x/ e9 D. Q0 L. ^( D
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
% Y8 ]- k; W4 I. J7 n, g& ?performed in ring0 (VxD or a ring3 app using the VxdCall).: \- n1 o3 ?5 z; e3 L' x  I
The Get_DDB service is used to determine whether or not a VxD is installed
3 i& o  D3 |) ^) Afor the specified device and returns a Device Description Block (in ecx) for+ \- g  G9 t; ~9 D  A
that device if it is installed.+ S- W9 L% H$ k" u, z* q) U9 ?
" M8 B, ?$ {  V" V0 G: T5 z8 j" c
   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID1 J& K, ?2 r# `2 W( ^
   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)7 B; T- l9 @% _5 ]0 y9 s2 C4 H
   VMMCall Get_DDB
! \) B9 y2 G7 D# Z) v4 K   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed( X; X. @0 O( a, h

6 E7 G2 j& \; u( ]; ?/ _. L0 ONote as well that you can easily detect this method with SoftICE:; \. \; T! P) V& O
   bpx Get_DDB if ax==0202 || ax==7a5fh- t$ q/ H4 Z: P; C
* p) z6 P* V! g
__________________________________________________________________________
+ l0 f) F- k) W& P3 q1 G
  K2 a2 l$ w; H& G& ~- P& k3 QMethod 10
& b* S8 ^8 m  N" X4 h2 H; d- r" \=========
! X* V! R- X% ?8 X- m
" E/ `3 _+ b, r  x=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with
7 G0 Y& `1 q- X! _+ a# J3 E' u  SoftICE while the option is enable!!
' o2 L/ Y( V2 m2 l, y" ^- V% S- `. ?! W+ ^# b
This trick is very efficient:4 Q8 E# G& m4 i9 B. d' [
by checking the Debug Registers, you can detect if SoftICE is loaded# q5 C' z: v) F- N6 T8 ]) ~
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if3 D9 |. I) C% p0 z
there are some memory breakpoints set (dr0 to dr3) simply by reading their2 o8 g+ h5 ~6 _  F0 J4 X
value (in ring0 only). Values can be manipulated and or changed as well
" l* n, y2 w# Y(clearing BPMs for instance)
& ?$ ^9 z. ^6 Z: H& r5 l; K5 @+ L/ d& M2 f4 m
__________________________________________________________________________) l9 O- q) z/ |' ~7 R

0 H: J9 [# u! Y: ~* EMethod 11
7 ]3 o! A* U, H4 K* Q( A, Y0 D=========
' P" \6 t" H- `: H" l7 @
3 F8 \* z- k8 z7 B1 {This method is most known as 'MeltICE' because it has been freely distributed  a/ s9 h: ~) |8 U/ _. }/ `
via www.winfiles.com. However it was first used by NuMega people to allow
+ ~  q( ~  x" Q0 D. [1 W7 e# p2 `Symbol Loader to check if SoftICE was active or not (the code is located0 Q0 f8 ~, ~# a& f
inside nmtrans.dll).+ ?. @- w& v0 L+ K: e% S0 \' ~2 `
& k# P( J6 K- b: d2 p+ T- H' Y+ h1 O
The way it works is very simple:: w( [, L6 ]) Z* k# H0 g
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for0 g$ X( D9 S/ `: R
WinNT) with the CreateFileA API.# e. b4 }; w* d/ U( a
8 d4 D. O% t5 c5 s/ T
Here is a sample (checking for 'SICE'):* d! R1 {, `+ s
; f+ V6 T) K' G+ a
BOOL IsSoftIce95Loaded()
4 |) |0 O: D  y% t3 N{
, H' `) f6 D& e   HANDLE hFile;  
; n) Q4 v0 W5 Q  L9 _$ O* f   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,) V! h" I  H& V/ o( h
                      FILE_SHARE_READ | FILE_SHARE_WRITE,+ o; w7 t/ ]1 f. d) C: V. v+ x& |
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
$ f) t5 d8 X: S   if( hFile != INVALID_HANDLE_VALUE )" Y' n# I1 u/ R
   {
, }* y+ ~, U: ]6 }; L; Q      CloseHandle(hFile);
; O" l' p: k% p. Z1 |( q. [* k      return TRUE;
) p0 G5 C' |' v" _   }/ v2 T3 T' c) }( N/ q
   return FALSE;# I; T+ w. q& S$ _
}
9 t5 P6 P3 b0 {' K  g& n% o+ Y, ?& g2 q' ?( X" I5 q& v# F
Although this trick calls the CreateFileA function, don't even expect to be
4 b' @; f) b  I7 q: |+ A6 {able to intercept it by installing a IFS hook: it will not work, no way!
- `) Q* I- {0 Y* N4 g& M9 M' jIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
8 i  F1 J& m6 A+ mservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
7 y6 S: ]! e3 b7 [' D  Yand then browse the DDB list until it find the VxD and its DDB_Control_Proc
( `! ~1 t5 k, lfield., k8 j( ^$ ~% D( ~
In fact, its purpose is not to load/unload VxDs but only to send a
' z5 L. D# M( Y2 }W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
: {' M5 r  ?: q1 O! Ito the VxD Control_Dispatch proc (how the hell a shareware soft could try% t! z7 r- B. m" p5 y& k
to load/unload a non-dynamically loadable driver such as SoftICE ;-).  y, _2 i: i) B  T8 M% T/ ^4 t
If the VxD is loaded, it will always clear eax and the Carry flag to allow9 l& j0 u" K* D9 I8 b+ |; H: O
its handle to be opened and then, will be detected.  b5 @) l5 Q+ n2 F3 K' m( x
You can check that simply by hooking Winice.exe control proc entry point
. p. u4 l- _: V" n; W- Q- Jwhile running MeltICE.
- S) A; k1 |( W" l+ d* k( S* v" I2 J" V* H2 _$ a8 X, X

8 b! Q5 L9 M+ r" |  00401067:  push      00402025    ; \\.\SICE
* y: ]3 a; H$ ?9 R  0040106C:  call      CreateFileA
  h$ ^- D) i- k  00401071:  cmp       eax,-0013 u  F2 L4 a) h4 Q1 u
  00401074:  je        00401091* g, S7 t! ^4 b) W

+ H0 X$ ^$ [$ ~) T; s; ]( w0 S  C2 `
: V) l$ I7 X7 `- m. NThere could be hundreds of BPX you could use to detect this trick.
1 `+ d. ^5 ~, ?: {5 {( |-The most classical one is:
9 O& |/ ]% h/ f$ X1 b* S  C  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||! a1 N' j! `4 m, e$ P8 y/ _, a
    *(esp-&gt;4+4)=='NTIC'
, \% J8 H$ q. g2 f
/ n4 }  w: p8 G+ h9 R+ m; @-The most exotic ones (could be very slooooow :-(
/ [% @$ @; V' e, y# z   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  ! ]$ o2 T# V6 |" [4 S+ @
     ;will break 3 times :-(: u& C& ?: `% l$ Y
( U5 n4 P2 W, Z' C6 l
-or (a bit) faster:
  k: w2 H- S, \& Y2 o5 Q+ A) n   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')* w% Y, y, q8 E- R* p
% C. k  u: L8 x6 F) k: s
   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  ( k. a9 X  }0 K0 [* |
     ;will break 3 times :-(2 i8 O- [. \6 X

4 _3 K3 y% z6 @# a# F" u9 ~4 E9 C-Much faster:
: R' {; J8 I- A' ?/ j" m! [, Z0 N   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'( _5 a/ ?( }: N+ T, v! a

5 A5 n. u1 R$ U( h$ x5 lNote also that some programs (like AZPR3.00) use de old 16-bit _lopen, B7 X$ w3 Z0 `  P
function to do the same job:
, I+ h* }) p& t8 L. a7 G" ]2 W. Q; N. K" [9 S
   push    00                        ; OF_READ' I3 p  a( e" z7 @4 C& [* r
   mov     eax,[00656634]            ; '\\.\SICE',0" o! T' x4 o; u- u  T
   push    eax$ k/ f' E1 W( u$ f3 r! O: p" D* @; W
   call    KERNEL32!_lopen
; @9 J8 `! m: a   inc     eax) \; a3 Y+ c8 j  h/ E
   jnz     00650589                  ; detected2 V% P1 |2 [' J4 o/ G6 ]
   push    00                        ; OF_READ$ p* }9 o5 s7 d# q7 I
   mov     eax,[00656638]            ; '\\.\SICE'; w& j1 c; ?& M" e  c. |" W
   push    eax4 [( ]4 u6 o1 d0 O  S
   call    KERNEL32!_lopen2 I0 }+ K" g& u+ h* w) X2 [3 ]% |) _& z
   inc     eax
. i; B& z% r) s( D   jz      006505ae                  ; not detected
- b- T: _' j' I2 n4 n& g6 h" K7 o" O" @# G
: y  h8 l) m$ w# F. T& `' \3 [
__________________________________________________________________________8 k5 N$ G( R# o$ A; ?2 d

% H) n5 |% H4 [) D( LMethod 12
9 ]- h3 h8 Z- }3 Q* j4 `=========
# u  _8 {  I  |' I9 X
& V" W' @" b) q9 qThis trick is similar to int41h/4fh Debugger installation check (code 05* H  j5 g7 z' L; S( F
&amp; 06) but very limited because it's only available for Win95/98 (not NT)
, c; t; T  f4 x2 n1 K; Cas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
- l$ j3 f) B0 @5 y# O( R0 b2 `+ @5 B2 [& z- p! z, V5 F. T/ _
   push  0000004fh         ; function 4fh3 T+ u3 D) g3 v0 S' U9 |6 y
   push  002a002ah         ; high word specifies which VxD (VWIN32)
- s  h$ _. L' J) f" V                           ; low word specifies which service
. m+ N/ M0 `1 k                             (VWIN32_Int41Dispatch)
* D/ o' h- x* A   call  Kernel32!ORD_001  ; VxdCall7 J! Y2 p4 f- i4 S5 ^* _$ E
   cmp   ax, 0f386h        ; magic number returned by system debuggers
1 J$ r4 W: {& E+ D6 Z, H8 z   jz    SoftICE_detected" D2 x0 E% s; L; d, M6 b

& @- ?2 J; N, s# n  D( u9 MHere again, several ways to detect it:
3 b! f6 J& M9 |  ~+ Y7 l) V0 ?8 s8 Y) G( }* C
    BPINT 41 if ax==4f3 a' G6 I0 p% a4 M9 L/ Q( k: p0 V
+ _- {% h6 T/ k! h1 g
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one
5 N* p, p' b1 w0 N1 ~) Y* k! g1 j$ j, a8 @6 N6 ]1 F* B
    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A. e$ e  @( _6 Q! E
2 ~" N. Z8 W6 |5 \, p" I3 s; \
    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!2 a* ]2 t) v' U# G
3 ^1 g4 T0 U9 Q! [7 L2 k4 f9 r
__________________________________________________________________________( g/ }( R/ l9 ~7 x; b+ k# q  g

5 \/ b4 j# I3 N% h# I# P6 WMethod 13
" x* \! j/ |0 P$ T$ K2 s) `: t=========9 L0 ^4 F3 K7 y% P+ U) _3 [

4 i! F$ F. [7 {5 z7 r, f! Y: j  L+ uNot a real method of detection, but a good way to know if SoftICE is4 z& v; Q( |& Y, i( r
installed on a computer and to locate its installation directory.
) T! T' g% [+ A$ W" s" N1 \2 dIt is used by few softs which access the following registry keys (usually #2) :4 s( X/ B2 v7 y) K& H. i" s0 i5 a

- D+ ?+ v' [, b  h- u6 T# L& g-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
1 n4 v- b. p6 B( i2 b\Uninstall\SoftICE
* {/ U$ Y. c4 y" M-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE5 ?) L6 ^7 l2 i2 i3 G" @. `6 _
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion9 c: T6 I% T- p/ R2 p( G
\App Paths\Loader32.Exe! @8 a  i4 o- ~1 n
* c& ?3 `! d1 [1 G
' j4 Y2 r$ {+ J
Note that some nasty apps could then erase all files from SoftICE directory1 d1 A. U3 p# w1 |
(I faced that once :-(
4 c& [0 E1 W# V! A7 Z- ]: z( H/ r; b3 E' Y0 Q
Useful breakpoint to detect it:1 s( d. `4 _$ i$ B4 z8 X
0 X- J1 }! S/ R5 P/ f6 q( j- f
     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
5 ~( k3 w3 F# z2 `. t
! k1 U# C2 l( ]+ \+ J6 G* X- z__________________________________________________________________________
3 L1 V/ P: v  a3 H1 {# E9 L, M% f
2 {! l/ }) }: Q
  M' F' }" Q: M( b9 G. MMethod 14
- l& h8 u" S( S3 Q  r0 K- u=========6 d+ n- g4 v3 x' E' v9 a% Z. [
* ?) H& R! X, P  S9 Q3 R
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
4 b; {7 w# m1 J# U2 \is to determines whether a debugger is running on your system (ring0 only).
! v2 L$ Q& n/ W# i7 [( G; v, `3 B6 F  Q: E- W
   VMMCall Test_Debug_Installed
5 \* S) i+ e( C/ A   je      not_installed& J; v) a* |4 b9 h

1 t+ \, T% z3 bThis service just checks a flag.
* `7 h+ ]! Q1 G+ F</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-7-25 13:23

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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