找回密码
 注册

QQ登录

只需一步,快速开始

About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
* q9 i: O6 t+ V. A) g& e  E+ q<TBODY>  z2 }* g! R) R3 k$ `% ]5 w, n+ _
<TR>4 ]5 r8 b3 r2 L- f% F
<TD><PRE>Method 01
' O! a. O9 D9 k, M2 y5 D' h, M1 ]9 u=========
1 o2 V+ v0 U% G+ V' }8 H/ h$ o& R* k8 W; J6 p8 x; B
This method of detection of SoftICE (as well as the following one) is  X7 E' l' L+ q7 O* }5 X; c
used by the majority of packers/encryptors found on Internet.4 ?9 t$ d1 P; e- V; n/ b; k
It seeks the signature of BoundsChecker in SoftICE
' ?$ C+ Y7 V# R
' H, w+ A" ~1 m% q2 @    mov     ebp, 04243484Bh        ; 'BCHK'
  n" F- ?  L" W* [3 B, x0 E    mov     ax, 04h
3 j, S0 H+ Z$ Z    int     3       * C) G- I) e$ q2 T
    cmp     al,4
% n$ O4 G' X( o* N; i7 B4 v    jnz     SoftICE_Detected  ^$ s$ U( h4 B4 v8 W, _

7 Q( A) o2 }& D- G4 y! ?___________________________________________________________________________# C+ b2 X% Y  u" K* _- Z* F

+ @/ m' I, K: {2 dMethod 027 y" e1 n: Y( I( ^8 K3 O$ \$ I
=========4 v0 x) l7 Q4 d- G0 k
; s5 ?4 A; T  y) F; k
Still a method very much used (perhaps the most frequent one).  It is used
, W* }1 Y* Q) n# g% A; \to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
5 G7 N* J* E9 F$ l0 y4 \or execute SoftICE commands...
7 t7 n$ f  U. m$ f6 D0 ZIt is also used to crash SoftICE and to force it to execute any commands! ?$ W8 {( B! s6 ]; e
(HBOOT...) :-((  7 F& v/ s/ i) u/ j: h) [

+ g3 g% }1 N) H$ sHere is a quick description:
1 g8 P! e" N) @5 K9 u0 Y-AX = 0910h   (Display string in SIce windows)
8 ^# g. E5 c5 x8 C, {' d- t5 i: e' h4 W-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)
0 z/ s& L4 L3 W; `/ ?-AX = 0912h   (Get breakpoint infos)
1 i3 Y2 r& ?" B-AX = 0913h   (Set Sice breakpoints): x$ K; W5 W) p/ S) u. v7 c
-AX = 0914h   (Remove SIce breakoints)
" C( W' C' ]4 y. s1 {
; B$ l8 V$ Z, l; gEach time you'll meet this trick, you'll see:5 j8 ^. O1 q1 m9 u
-SI = 4647h) t3 R5 Q  c  H5 s
-DI = 4A4Dh
( G  T* m* [1 ^' U* ^/ w# C$ XWhich are the 'magic values' used by SoftIce.
9 H) ?0 D/ d/ EFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.0 @7 d' ~) S3 m; d2 ]" V( U

0 e" s6 B# Z, y0 I8 H" y1 @Here is one example from the file "Haspinst.exe" which is the dongle HASP
! h+ T0 Z8 V! D7 T+ {Envelope utility use to protect DOS applications:
" V+ l) v7 g0 W+ j  n1 ^7 f0 _/ }9 O% J8 b4 Q/ d- x% j
" C2 I% f8 T4 [0 U
4C19:0095   MOV    AX,0911  ; execute command.0 v7 A( E' G3 O$ J$ N% X* \5 x
4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
1 T' {& G6 T5 b: b4C19:009A   MOV    SI,4647  ; 1st magic value.+ ^4 A& M" k  z0 Q
4C19:009D   MOV    DI,4A4D  ; 2nd magic value.
9 M; t1 L/ \" l4 @% b' i4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)' Y3 u8 R" y) e+ i; l! F! f
4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute! w/ m" @2 ?; k' m$ E8 n
4C19:00A4   INC    CX7 H. q, S, s* [8 o' G
4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute9 a% B, V: C' T5 T7 g& x
4C19:00A8   JB     0095     ; 6 different commands.2 U! V0 a+ ^4 L+ ~- l
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
' L" y( l/ J$ B% J1 a* ]4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)* a9 D. N8 n& V* o# w" V

& Y8 y: ]7 J% f2 f1 g4 KThe program will execute 6 different SIce commands located at ds:dx, which
" u) o3 @& D" s- H6 Gare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.5 P. l( ~6 n) R9 {: s  W7 B8 U) P

) f9 @& a" K0 Y" A# ^+ D# H3 W* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
8 i9 R, h' Q( A: o" r" K___________________________________________________________________________
% F7 N0 u3 s$ D% O2 j2 X
) C4 L# k; v6 {
- j$ L4 ^) l, d* ?2 v. r( UMethod 03
# J1 G, I/ ~9 I=========4 ~6 D. ?( d3 ?2 s! c

  C# t: ^9 C3 _& i* W: f2 Y6 g( Z3 bLess used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h: U6 f- t2 C! B/ y3 q2 ]3 `0 B& \: o  b
(API Get entry point)  V8 a8 _) I2 D: J8 C9 X5 l2 n: f
        
2 D& y! T8 K' a6 j0 h
5 D3 y: U. C4 @1 l2 F* ~    xor     di,di) `4 C" E6 g: @' \
    mov     es,di4 T) b1 ?' v4 V! l
    mov     ax, 1684h      
: t! Y9 Y( S6 W    mov     bx, 0202h       ; VxD ID of winice
0 n. g2 N' V5 B7 s, v    int     2Fh5 }9 Q; q' y& }  c$ f
    mov     ax, es          ; ES:DI -&gt; VxD API entry point
& r1 ?& B8 O5 {8 I  A8 W    add     ax, di
$ j- C1 ~/ m& o3 U    test    ax,ax4 F( u* h9 I' X2 h
    jnz     SoftICE_Detected6 O( w5 g; Y) G6 \9 o
6 U& G1 K; I/ ~2 s& x
___________________________________________________________________________
% E; _- `% h8 H% J" w# N! [3 K' y# N' M% O* T& t6 B8 k0 V5 v
Method 04
0 k2 p& b# x: l+ O7 M7 ]! H; P! [1 C=========( B  U& j4 S# h3 _* W: }$ j

3 s( x9 h9 X3 E. L4 P( s" w+ eMethod identical to the preceding one except that it seeks the ID of SoftICE
$ o$ [) T  q9 d) e2 GGFX VxD.& q2 u9 K% P! A, ~# [

+ s8 z/ i# W! a, r3 c" J" {9 ^    xor     di,di0 Q7 x+ t8 R) s
    mov     es,di, O$ _' q4 G3 x
    mov     ax, 1684h      
* S4 J8 o) m( O$ j/ b! i4 U, D    mov     bx, 7a5Fh       ; VxD ID of SIWVID! b* H1 r8 z$ |( y0 @4 b
    int     2fh* o; e) [, r( C) Y  a2 i. o7 Z, M
    mov     ax, es          ; ES:DI -&gt; VxD API entry point5 E" c5 R6 @; z  ]  v2 d
    add     ax, di
6 Y+ ~5 a' m7 T+ U9 Y$ h0 f    test    ax,ax
. _* G# F% ^( k! M: M4 Y  Q( V    jnz     SoftICE_Detected
/ N! x. ]/ p' Z% \
6 c; n0 \# l! ^/ p* ^; R2 Y__________________________________________________________________________) j8 [4 r- r. j

& [) A( j! ^; I* K/ a# K+ m+ z$ @
Method 05
& Z3 _( H( Z8 L) g% g=========* F4 P) M& O7 Y8 g$ z7 X  F
" ^- `* L7 e  y6 h) u1 |+ n6 \
Method seeking the 'magic number' 0F386h returned (in ax) by all system+ _* U$ `  y5 g# L
debugger. It calls the int 41h, function 4Fh.
% v. c2 `  q' U3 w# ?/ jThere are several alternatives.  
. L. l0 N# F% z+ t' F+ ]; j. d5 Z/ ]. n1 G( B" {- T
The following one is the simplest:
, E! G- f/ `' M" U8 R% c9 |# `' T
) _8 }5 \, v( s% d    mov     ax,4fh0 ?2 P- i' ]+ d8 f5 R2 ~7 w3 X, _
    int     41h6 I% Z) o( f- a6 }; Y( t
    cmp     ax, 0F386
6 [1 `8 F% ~  o/ @) _    jz      SoftICE_detected) [: a7 h  g9 I- @! k/ P. @1 J% `

8 M* X; p) z/ }2 \6 V& M! }& A0 u$ T# c' u9 q4 E
Next method as well as the following one are 2 examples from Stone's + s# w. g' m# A0 G3 O) u* c; {
"stn-wid.zip" (www.cracking.net):
/ I+ `' r! [( Q6 H# k' \2 u7 e/ B1 G% I/ i7 |
    mov     bx, cs
+ N: [" `0 I; v4 _  v    lea     dx, int41handler2
7 d4 [& U4 `$ h6 K    xchg    dx, es:[41h*4]
4 L3 I8 C( m2 u2 o" J    xchg    bx, es:[41h*4+2]
, O! B- W( N, |% H3 ?; s    mov     ax,4fh3 A' c" s( K0 s+ P6 R( P
    int     41h. x  v1 }3 B, e, K* i5 ~1 G' M
    xchg    dx, es:[41h*4]" @8 S( Y* g3 c$ q! B
    xchg    bx, es:[41h*4+2]0 H$ k( l( \/ p
    cmp     ax, 0f386h
& n. o9 u3 D9 o2 \! @6 _4 Y: ~' Z; r    jz      SoftICE_detected
, [4 N- `, X1 ?
. d8 G3 w% J. Tint41handler2 PROC
: C2 u; |. `0 J' I5 d3 D1 c    iret' P  w7 |! ]+ \& x
int41handler2 ENDP% v# z1 y& X! F# F6 k& c6 g

8 H2 P$ [7 g/ p8 U; H# B1 R3 V  r+ n: ^2 h+ j$ |) x- ]
_________________________________________________________________________
" Q6 A" v/ Z$ C
1 w9 A  Y5 q% ^; ?0 [1 P. P7 F8 k+ T, z8 a1 W: c
Method 06/ a- o5 T+ y7 h) W; V" i
=========
: A9 o: C8 @9 K8 z1 O/ _
7 Y3 b9 V% v9 M! l9 J: N4 ~  p. w0 n' q# O$ e# a
2nd method similar to the preceding one but more difficult to detect:& P1 W* B" W1 l( [8 Q- V. |1 _

2 i5 O. g1 z% p) x; S: s! H9 }( {& @$ B4 X9 }7 o
int41handler PROC0 r1 I6 s5 T7 M/ |3 l$ C6 f/ p6 n
    mov     cl,al' I6 d8 e1 t1 `: O
    iret
! }; n8 Y1 M) O9 s; X2 A+ gint41handler ENDP
/ P0 R% F( X9 g+ S, ?* P/ T5 b1 y" g5 f2 N
4 x" y0 f7 C2 f) a3 L$ ]
    xor     ax,ax
" K9 \& q. P8 N) _    mov     es,ax) h, o. X8 E2 {+ V3 L
    mov     bx, cs
7 w# [/ h5 h% M7 I6 I    lea     dx, int41handler
& U7 V3 |' f" P3 Z    xchg    dx, es:[41h*4]
0 Z& D! z) N9 t9 L7 K0 H    xchg    bx, es:[41h*4+2]
$ G" G' f+ H- s    in      al, 40h
' t- N/ T# e+ f    xor     cx,cx* F- @1 |+ Z* W8 e3 e3 c
    int     41h
# z% b9 q. j; ~+ V9 [& G8 I8 s: U    xchg    dx, es:[41h*4]
$ p/ v3 l) J" m9 r6 O) H& r    xchg    bx, es:[41h*4+2]
7 n8 B, K) G  @6 M  L* [# G    cmp     cl,al
8 _; I- u: Q" D    jnz     SoftICE_detected8 W+ C1 g# }1 N5 e; X% Y! w0 }
# g! {4 d5 P  g' G  v- w
_________________________________________________________________________
* O9 f, A' s! |$ z' ^' d3 ~1 I* j- s) m. x4 e0 ~5 j
Method 07- b: N, f4 D9 {% _1 G3 b
=========
; e4 S0 V+ R" D) [
% A  q$ z; u9 l2 A, v6 zMethod of detection of the WinICE handler in the int68h (V86)
8 b( e  I* ?: j+ A' K& M8 W# W2 n2 ~3 O3 Q/ _
    mov     ah,43h7 Z! y0 o& `+ n/ u+ `0 M; A
    int     68h
' ?1 h) n5 ?" A  u0 n9 z- F    cmp     ax,0F386h
' T# o2 |$ `. k. R    jz      SoftICE_Detected
$ p8 g) x! g6 j% Q8 I0 ]: V! ~0 M$ l$ l

5 G" p* y# y9 y0 Q: X5 s=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit1 l# b1 h1 A2 I0 [7 i1 I; j
   app like this:- y/ D6 e; [4 ~1 W
: M3 Q: f) e  r9 _; r
   BPX exec_int if ax==68) J# q8 [7 d+ D; T9 ~3 [
   (function called is located at byte ptr [ebp+1Dh] and client eip is0 X+ `) V9 ]8 W
   located at [ebp+48h] for 32Bit apps)
8 H3 J: t# J# ~$ ^__________________________________________________________________________
) [4 K& x( m8 X9 }3 q4 p4 ?1 ~6 v" t

0 d1 L4 v3 V1 w, kMethod 08
! ?  L( ?5 E. P- M=========" g" J5 W: _' E

; y, ]9 Q9 O" E4 [It is not a method of detection of SoftICE but a possibility to crash the8 r! M2 n( S5 z; [4 A# p
system by intercepting int 01h and int 03h and redirecting them to another3 g  _* I2 o+ \& J+ T! ~( H" K* t
routine.; n# l+ C* \' h( \+ O
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
" ^  @) k: N# X' y& P4 |to the new routine to execute (hangs computer...)3 o, M4 O+ l- a  C' D! n
: {( @6 H( b2 `
    mov     ah, 25h
  q+ A( o0 t5 N/ X8 m/ o    mov     al, Int_Number (01h or 03h)
& V* L) f4 G& q2 E    mov     dx, offset New_Int_Routine
. `: N4 `0 \/ C3 y    int     21h
+ h# X: U) m* ?& h3 n8 l5 h$ a, c! w2 I  N* _' g
__________________________________________________________________________" T- u0 R4 Z# u0 A! l6 X) ^2 c. V
5 N9 A% F8 O4 m& _' `
Method 09
, N5 S/ o' M2 q: C2 W=========
, r" Y( G( D1 h- [: w  G2 x/ x+ n0 c( y1 g" q. }  \
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
/ e! R. Z& g! d; j2 J1 s2 L4 V; pperformed in ring0 (VxD or a ring3 app using the VxdCall).
6 ^. Y& z) D- z+ S8 p- p1 x! cThe Get_DDB service is used to determine whether or not a VxD is installed' x! I) |" u) u2 E1 \& i& k# |
for the specified device and returns a Device Description Block (in ecx) for
; l, Q; L; y/ \" gthat device if it is installed.$ L, k0 z" D/ c" w0 L. h

9 K* W7 m8 H% T" d6 E, S   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID
! _! e9 y8 j5 W% |: a9 X: ]* p4 }   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)  R% G7 r+ l, ?* W: k& O9 x6 N9 h
   VMMCall Get_DDB
- t+ y/ t% ~4 w/ @% U9 D   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed
' ~; i2 l' R5 Y0 F: l+ y3 p2 y7 p' M, @8 I, d2 v2 w
Note as well that you can easily detect this method with SoftICE:
& |: {; w" V8 b1 R' F* m' a  O2 |, r9 D, M+ }   bpx Get_DDB if ax==0202 || ax==7a5fh
) L+ u, N" F6 ~" U6 i; M" K* _, X( {
__________________________________________________________________________
8 ], ]3 z: s( j
9 N  z: I* ^: Y; \0 \4 b, r( X2 W% NMethod 10
0 z( ?$ C1 U7 K5 e=========7 E7 Y- y% t7 s8 h- F" v
3 ]* g$ S9 @& W3 N3 {
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with
$ W& Z9 J& I& ?! X  SoftICE while the option is enable!!
0 t1 G( h4 N# N0 B: X  r" ^6 n# @1 j! K. b  q5 W5 Q
This trick is very efficient:) ~3 m% g6 ~2 [
by checking the Debug Registers, you can detect if SoftICE is loaded  e: T+ }+ g4 P- r) F9 h) g! n( m
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if( \1 y3 I0 S  \( a) B
there are some memory breakpoints set (dr0 to dr3) simply by reading their, C3 ]+ P0 k2 C6 f: S5 n
value (in ring0 only). Values can be manipulated and or changed as well
8 f1 V$ }6 a# l2 T(clearing BPMs for instance)
9 N( u/ X' p' h" O4 \$ F8 m
: c, l3 K, [% V8 [__________________________________________________________________________3 R2 r. @- ]/ i; D4 ]

1 L; X* w! K0 J# F1 a4 ?Method 11' L5 H( @  u8 [2 |; X7 \' R
=========
. L  J- K! P1 ?
/ ^8 \: R# [3 lThis method is most known as 'MeltICE' because it has been freely distributed$ a' f- S. B" w
via www.winfiles.com. However it was first used by NuMega people to allow: b8 s+ `3 O7 o
Symbol Loader to check if SoftICE was active or not (the code is located
9 y3 l- Y! j5 q4 M; ^2 y; X# linside nmtrans.dll).
8 {( h0 Z' C* R! Y9 b1 f4 O5 S. W4 G+ t, ^# P! C
The way it works is very simple:
3 M5 ~/ m% N7 _$ Z+ \It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for5 c# K9 L. y% |1 r( {7 `& p- Q; K6 h
WinNT) with the CreateFileA API.
8 b% k, }; `$ r, ?) M+ g/ ?) _1 v2 K, f8 [$ p
Here is a sample (checking for 'SICE'):
/ z- s3 \; h: \3 p1 A
# H& B0 ]" X8 Q# vBOOL IsSoftIce95Loaded()
, j6 ~* w. E4 C( w{
  C1 a/ a3 G, N& p  K$ z7 g( ?   HANDLE hFile;  1 F2 _( o* b( z" ~4 g, U5 U" \7 a
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
3 _6 }$ q9 ^+ q' e" ?5 N7 N0 Q7 N! _5 Q                      FILE_SHARE_READ | FILE_SHARE_WRITE,# ^# p- K+ t4 W! J
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
0 f1 ?# i; |; q- c   if( hFile != INVALID_HANDLE_VALUE ); c- \6 Y; f: f  D0 k( P
   {
' J& j* _3 `) [* E      CloseHandle(hFile);
! y& @7 \7 l' d! P# R      return TRUE;
5 f1 l. Z# \) U& c8 \   }+ Z: h  Z0 V+ ?8 O; J
   return FALSE;7 Y4 C( \; s( W* }2 W% r
}; J5 B( k  C3 W' ]: f! O( H
- p  s( U- _4 Y6 `2 M! u& N) q
Although this trick calls the CreateFileA function, don't even expect to be
. e$ O0 I9 W2 Y  n/ Jable to intercept it by installing a IFS hook: it will not work, no way!
/ }4 P, j% U7 B3 E2 d  U. I. NIn fact, after the call to CreateFileA it will get through VWIN32 0x001F0 I: v' i5 v7 x+ Z4 x; w6 \2 E
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)& y# b( T6 ^+ r8 x+ u
and then browse the DDB list until it find the VxD and its DDB_Control_Proc3 c3 u8 |/ V& S) j0 q9 J. `
field.
, ~3 w; s2 ]! O! T1 |/ _* NIn fact, its purpose is not to load/unload VxDs but only to send a 7 L5 `" f" Y! N! G$ r( F
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)) I& W) P; |" a. @% P! G
to the VxD Control_Dispatch proc (how the hell a shareware soft could try3 x+ n8 b- I  Y$ c2 `4 E& h
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
9 ], _) ^, W6 J% ?1 A5 C" NIf the VxD is loaded, it will always clear eax and the Carry flag to allow% h( B+ {  t0 H2 u6 ?6 d
its handle to be opened and then, will be detected./ O; |9 V. c) ~* ]) h5 Z
You can check that simply by hooking Winice.exe control proc entry point7 k! ?: g3 n7 P! }; ]# Z
while running MeltICE.
! x: x- J& ^: R) z+ Y0 a4 w2 Q$ o5 Z7 f9 _$ l! ]
8 G, f/ e7 j6 \( R3 N: A. [3 f
  00401067:  push      00402025    ; \\.\SICE
1 K2 `2 w. [- l- N  0040106C:  call      CreateFileA
1 b' I7 ]1 b# {2 r2 i0 x0 p. t5 {  00401071:  cmp       eax,-001% I- u/ N: ]( ?# v/ o
  00401074:  je        00401091- G; x  w2 M- e9 A' @

3 d0 Q- ]7 z2 p9 W: W) d5 y  T
7 B4 r& L8 A) fThere could be hundreds of BPX you could use to detect this trick.
6 N* I! C' g: Q/ k; v, |2 p: ?/ {-The most classical one is:# X3 q+ X0 N0 }  M% s- F0 v
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
2 W0 g, [! k/ U. C+ h    *(esp-&gt;4+4)=='NTIC'( R3 a% Z; D5 B% Y  ]1 r9 D

) C4 p$ R& p- l  b  {-The most exotic ones (could be very slooooow :-(
4 {* `* w! ?/ r/ L$ K   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  ' |& {( e5 \6 i! W  f
     ;will break 3 times :-(" B( b: f9 z& P# S% T

( Y. t% O4 t7 ~-or (a bit) faster:
/ J/ k+ h( m, Q+ z& z5 I   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')' D4 n" m5 i  k2 J

1 i. g% V. ~) L% s1 [   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  : w" e. y5 Q: Q8 D
     ;will break 3 times :-(
) f8 m  v  w& a" i# A, I4 E
8 @5 Q4 V6 R" ^" E9 J, U: i) r-Much faster:
- F. p  q" D: z4 l8 T   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'' _% N6 f+ D/ ?5 Y0 W' e

5 b' R2 g6 o1 N! l4 N- w0 bNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
- k) k& s) t6 R, X" afunction to do the same job:2 x6 z6 {. \1 j- _

4 ?8 O% z( U7 P. ^& ^9 }) {   push    00                        ; OF_READ2 `, J, r( B: C( k; O7 u/ U2 [: O
   mov     eax,[00656634]            ; '\\.\SICE',0; B) C+ \  G" ?4 e" U4 N
   push    eax
' P/ T7 @/ ~: J" U( _: S3 T& B  h   call    KERNEL32!_lopen
2 O) t% N4 [) S   inc     eax
& Y# X9 m& ], [: A   jnz     00650589                  ; detected1 g5 T2 j8 K+ q6 P# K
   push    00                        ; OF_READ0 z' `' }' c  y, H  y
   mov     eax,[00656638]            ; '\\.\SICE'
$ s9 k/ Q2 E: X9 q   push    eax
% I7 L2 h, V; M3 K+ p: V   call    KERNEL32!_lopen
! Y& k; C8 D* w! H( ~   inc     eax
* y" _. F  S) @/ k; O9 c   jz      006505ae                  ; not detected
  ~) O5 c2 X' V. a1 z! m4 w9 G# n9 `9 L
# \1 l- d7 A: s$ _7 d: r& m; E9 H! r
__________________________________________________________________________$ h, L. n. i2 d3 g. _- r, z; Q2 l
- _4 }; \  j) ]6 G* `
Method 12
! R6 R" E1 Z5 z7 @=========
: O4 V& @' c8 P. y! K
: `) z4 _* _! d) L) ~This trick is similar to int41h/4fh Debugger installation check (code 058 \* X2 Q* ^0 z" u9 y
&amp; 06) but very limited because it's only available for Win95/98 (not NT)$ {4 H6 m% |( u4 \( _/ V& G+ y, I
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
# y* j% \$ ~0 F2 o
! C5 Y( `' N) n' w+ q6 J   push  0000004fh         ; function 4fh
9 {7 E% S% w9 ?$ T: f/ j! ]   push  002a002ah         ; high word specifies which VxD (VWIN32)3 E7 x% ~- J5 T  s7 s6 y
                           ; low word specifies which service" U6 G" z3 M( ~3 u6 Q5 S8 I& B
                             (VWIN32_Int41Dispatch)0 P  r5 y7 o1 n0 a* x' T
   call  Kernel32!ORD_001  ; VxdCall/ Y; ]( N# c8 ^2 @( S( N" q7 A# o
   cmp   ax, 0f386h        ; magic number returned by system debuggers, ^( s' |& _0 _! l" X) R, N* y- k
   jz    SoftICE_detected- h( z" [/ `6 M; Q
7 L" Y) \% @( k: [% [
Here again, several ways to detect it:! B' g6 E# j5 C4 l, I
5 z+ n8 S9 L, o5 `
    BPINT 41 if ax==4f( j  s; m9 K; U3 D) ^2 N
. x6 m+ M% M! E* r
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one
4 E1 I5 ]% l+ E$ z' U
1 H" P6 m% B  m5 l$ k4 b    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A; Z9 t1 j$ G. K

  q9 }% s: K3 V( Y    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!1 x" u; W- [1 x% C* f
2 k8 @' ?/ H8 F/ x- @% B
__________________________________________________________________________
9 G* ?( p6 i4 |  p1 G
+ m+ f4 i! v, GMethod 13/ g8 V: g0 a0 }7 H/ J9 z) F
=========
/ K( ?# t# L% N
8 }: H( ]  l) p' \  ENot a real method of detection, but a good way to know if SoftICE is
; ^7 z" \+ v$ U9 xinstalled on a computer and to locate its installation directory.' S+ G( M: y: ^' l0 b
It is used by few softs which access the following registry keys (usually #2) :) S- r5 \! M  V+ M* B
/ g3 m8 t- \. u' N8 p# h$ y
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion0 r; `% f; V" I, r0 P" p* H# @" `
\Uninstall\SoftICE6 p; w  e/ P3 N5 }$ D& h
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE; R" ?% ?. l' g
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion, k6 V, S4 ^' h1 e
\App Paths\Loader32.Exe
' z- p# P) t4 u4 `$ U/ R0 x- y7 |$ ]; |

* V2 h8 n# o! j4 ?7 x& nNote that some nasty apps could then erase all files from SoftICE directory4 {8 N1 _* n  B0 _/ K9 h+ x
(I faced that once :-(
8 q1 }9 t' e3 K: V
! n% V; B2 _9 [/ l0 W6 jUseful breakpoint to detect it:
7 [, i& W3 K- O, `8 i! T9 E- P' v6 M& E( D$ X: Y7 H* K
     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
& ]; M7 m7 r' [" q# H5 U: ^0 f+ m  K/ x! V
__________________________________________________________________________8 I* k& U' q/ m- i4 @0 I
. b, m# ^6 w! ?) i  h

5 ]2 G" m$ @" Q8 mMethod 14 9 }7 B; O' ~2 \+ f( j
=========
5 H' b! D4 S9 O; h/ x3 O2 U$ ~: A$ @8 z% o. t5 \; @
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose; K. x& F8 k8 t* r3 o, Q
is to determines whether a debugger is running on your system (ring0 only).$ x+ S- [+ t! [5 p. \- Y$ F6 Z

  x, t" L6 ]/ f* h   VMMCall Test_Debug_Installed% J5 t9 X% d2 Y# Z0 x7 d) R* Y
   je      not_installed
  T# P: I) R2 ^* H  ^- C0 m& u% ]+ ]0 z+ _) `9 r# z6 F! b! |) K! O
This service just checks a flag.
2 n8 [0 s3 z6 o</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-8-12 17:05

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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