About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
: X) r9 ~3 Y( P% y- T$ |<TBODY>, U) G+ r0 `" r
<TR>
: H% x4 q" h/ i8 Z<TD><PRE>Method 01
4 g1 l5 x' T  K4 d% H  t; J/ ]=========( ^4 E' n4 ^' U8 |5 E( X
$ x) L3 Y) j/ D8 ?
This method of detection of SoftICE (as well as the following one) is( T$ F* \( ^- z
used by the majority of packers/encryptors found on Internet.4 c' `' T$ B# Y- g
It seeks the signature of BoundsChecker in SoftICE6 |2 R0 k6 _4 w3 d
+ R! a. W4 U/ w& {$ ^" ?* g: `
    mov     ebp, 04243484Bh        ; 'BCHK'
) O9 P- Z/ m2 R    mov     ax, 04h
; ^6 b% i. X6 }% ]9 C) G! `9 f- x+ b    int     3      
5 J2 G+ s8 _% p1 I2 d    cmp     al,4! q0 k: e4 J. f' w! S/ z' m, H
    jnz     SoftICE_Detected
& C! A# \9 O% `7 Y7 o3 d% w- O3 d# e% v- G$ M& U8 R) m
___________________________________________________________________________
" _7 L# a0 X8 F  a& _% H, B5 z6 Y0 X, E9 N6 J! m( s
Method 02
+ I  |2 M1 B; [; A+ B4 [% o=========) Z  v5 y' ~% C6 J& V, T
# d7 [* |0 r% w1 K  O
Still a method very much used (perhaps the most frequent one).  It is used) s0 E; S( Y$ T) A, g9 j: N
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,1 {) i; N8 s& z7 Y8 J8 M( g
or execute SoftICE commands...5 x% A* J" C4 }$ M; D
It is also used to crash SoftICE and to force it to execute any commands
+ P# p% k! W2 m/ G) v# @) C! ](HBOOT...) :-((  % O) x: A0 r5 K/ ?, ^3 v7 f. K9 g

) S4 f. G8 x! C/ M5 E. {Here is a quick description:2 m, ]6 M2 w+ c. M, k7 p% j: H7 Y0 W2 O
-AX = 0910h   (Display string in SIce windows)+ u+ u9 w# C& D
-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)
' h3 }  J) ?) D8 e-AX = 0912h   (Get breakpoint infos)
! r+ j" W. r4 ?% U- v-AX = 0913h   (Set Sice breakpoints)
3 ~3 f/ z% C4 _8 `+ b/ F-AX = 0914h   (Remove SIce breakoints)
7 q  V8 E& e$ X0 {! I
0 e/ B0 m9 B7 w1 T' eEach time you'll meet this trick, you'll see:
4 D8 x$ g6 t; E0 |1 G-SI = 4647h
6 O, u* p" e7 Y7 n2 P( |-DI = 4A4Dh
0 ~3 p7 M' H! _+ X' v1 F( C) ^Which are the 'magic values' used by SoftIce.
9 O5 y1 c4 \) `7 T$ U& fFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
6 g5 A- c1 n9 r' i% f  ]: n6 m
" m0 n) O" [- e) fHere is one example from the file "Haspinst.exe" which is the dongle HASP! E" @" X3 }' E2 d: d" J; W1 }
Envelope utility use to protect DOS applications:
8 {) u( T* ^* t  l9 h3 @$ w, J% Y' y
) ~: @& w, Z( b; ^3 J- D* f
4C19:0095   MOV    AX,0911  ; execute command.: |9 j# r1 r$ G2 U0 g; m
4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).- y; x5 e( n& C- y$ |$ e# b9 |% c
4C19:009A   MOV    SI,4647  ; 1st magic value.8 O" ]$ z, ~, K. u) N  ?" ^4 X
4C19:009D   MOV    DI,4A4D  ; 2nd magic value.
: e. G# a2 r2 k& J4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
& _! G  X4 Y- |! A4 @% H. b$ O4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute2 M  z% J. K5 d" _% Z& l" v0 e2 f
4C19:00A4   INC    CX
- H' J8 f0 r# D. M7 ~$ G: a6 t4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute
, j6 t; O* x: V/ k4C19:00A8   JB     0095     ; 6 different commands.
& D4 A4 {! }. J* U4C19:00AA   JMP    0002     ; Bad_Guy jmp back.- d" u# C1 b5 W; g; R
4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)
. J0 s5 a7 j, ?- s7 L* H+ I( t5 v. G5 R6 d# W5 M; J  q1 n; _9 G
The program will execute 6 different SIce commands located at ds:dx, which
; d5 P3 C0 }! \, xare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.# s( f# r9 w3 P& N4 d  u

" Z$ e; T+ L# n8 F( P0 {" E! U* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
& n* n$ B3 d) e4 q& g1 c# V___________________________________________________________________________  l) m' t- d( ~  j) N1 _

* o0 X5 v& Y* c+ x4 S& d2 d" K( {6 P
Method 03" i8 a7 `5 E! a" c5 }* b( ]
=========5 G  U9 }& W0 ?( P6 K

, j+ s# G7 m1 d2 ALess used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
( a& x* y* ~( K9 X- D5 W. V  q' {, g1 v(API Get entry point)+ u  }% W! m" Z3 {" j( Q; \
        
6 F( S2 F8 b% B( u6 k3 _7 l  m) m
    xor     di,di) e8 `& U; v. \5 T2 V! S
    mov     es,di
! ~0 W' l$ h6 {3 s0 r    mov     ax, 1684h      
' j" ]9 q  w+ W" v! i    mov     bx, 0202h       ; VxD ID of winice. w0 l4 |. K( B6 f5 l' R, \" z
    int     2Fh
9 o) D3 {' @$ d7 n    mov     ax, es          ; ES:DI -&gt; VxD API entry point
6 p" _4 W+ n9 L7 E% j9 Y% I    add     ax, di' l% k& Q7 s- K
    test    ax,ax
: D( D+ a! A0 G. A! S7 z1 |    jnz     SoftICE_Detected. j% @! w& ?( [" J) ~
. e5 k; _8 d% k( f
___________________________________________________________________________# }* ~  y# k( K+ {. W' S

6 I, Y4 u, k, S) ~2 k, PMethod 040 \6 q$ w$ W* W/ {( M2 x! J
=========# x, P6 W" N) p. @6 l7 k, ]

0 ^, A1 F) v$ B% k0 xMethod identical to the preceding one except that it seeks the ID of SoftICE
' R; V) z) ]' L% O2 m' jGFX VxD.  S2 @& f: _' @8 u7 ?$ I6 m% e

) q8 J" n$ x) ^    xor     di,di/ Y$ y8 w  e' U
    mov     es,di4 u2 J9 b" F% d: @" P8 b
    mov     ax, 1684h       ) L. }# Q( V6 r  H  u
    mov     bx, 7a5Fh       ; VxD ID of SIWVID9 k8 e, C1 {9 \. Z$ u4 b
    int     2fh
+ U1 G+ f2 J: }# e/ w; S) C2 a    mov     ax, es          ; ES:DI -&gt; VxD API entry point
; O' [. B0 O% d/ K& o  C" {    add     ax, di
, J$ f# P- g' @' c    test    ax,ax
. s& A5 }* ^7 o; Y0 R5 z    jnz     SoftICE_Detected
2 S- ?& d: Y3 f/ x- N6 r
( i1 @! G: X* l3 U  [) h7 Q__________________________________________________________________________% m) e3 H+ v5 K7 Y
2 I8 ]$ j# ^0 o$ f6 B, r2 E
8 t) F; T& b1 o9 I# d3 y$ G& Z, \
Method 05" e$ R' k. v7 Q* g& g; v/ `  R" c
=========
7 }8 I/ ^1 \% G0 N, L; J
$ U. k! ]3 g6 W, S( M4 u; tMethod seeking the 'magic number' 0F386h returned (in ax) by all system- l0 l$ ]8 f- ]' U
debugger. It calls the int 41h, function 4Fh.( H( H8 B4 P5 [1 V' k8 }6 H
There are several alternatives.  
; e3 y, ~4 p1 {1 o0 v2 [% N
0 K* t& Z* c0 pThe following one is the simplest:0 S8 I' q9 p$ `
7 M+ \( r% N5 P. v4 B# Y! V/ O
    mov     ax,4fh: K# n. D, p' m6 x  `: A# e0 A
    int     41h( ]. O  z/ O. i7 C
    cmp     ax, 0F386
3 _0 w+ |3 b$ p2 k! V    jz      SoftICE_detected, p$ ?1 T2 F' Z9 W

% Z. m4 c- O4 x; }: t4 i' t: N1 \
Next method as well as the following one are 2 examples from Stone's 1 u4 h- O; b* j+ s
"stn-wid.zip" (www.cracking.net):
( t+ p0 T. Z9 F3 T) r! y, [+ g2 @* d
8 G1 u9 l. t3 A2 s* B    mov     bx, cs
9 ^/ M# S* c8 E. k" A2 {    lea     dx, int41handler2
( F2 f& D; R4 a6 g    xchg    dx, es:[41h*4]2 ?+ d8 H- h2 y1 B
    xchg    bx, es:[41h*4+2]
  h! l$ b. x) C5 ^. \( x& U( H    mov     ax,4fh
  D- O! i$ i3 L$ |) B6 z3 j- j/ u    int     41h2 S3 t4 }: a; Q- z* V
    xchg    dx, es:[41h*4]
, Y0 c* y  ]' T- o3 Z) |    xchg    bx, es:[41h*4+2]
/ I4 Q6 f. Z; c# h  D# }    cmp     ax, 0f386h& J; G) P5 s, |& T9 v7 v
    jz      SoftICE_detected5 z* S/ Z* K5 q! y3 g  y* H2 a, V
6 M3 G6 N7 j' ^* e( c6 G
int41handler2 PROC
+ ^: V, r! b# c- ]    iret2 J* ^/ g8 U& O: c& S% a
int41handler2 ENDP
4 x7 R! Z/ e# ^% x* R1 A4 }
) l# B/ _- T$ u5 W2 a
+ W& l. V& n; u8 ?5 f1 b8 r_________________________________________________________________________
5 r2 @' }# H' n# H) B1 u2 j1 U# P1 v& N

# f) l5 w2 d6 z4 P/ TMethod 06! D' i  K% T* u# g; `) q( _* h$ \& u
=========# P% h. W5 Q7 t+ F% u* V/ M

. t8 d3 k# T; o- R# [# y% W# j% ^& X; \9 S' w2 _/ V, s
2nd method similar to the preceding one but more difficult to detect:
3 u9 c, e! R4 b, @5 P& a5 f; t$ U# N$ p6 c, _0 `& f
" l5 v% N2 `4 j1 \+ n/ `
int41handler PROC0 Q& O5 v" l4 i
    mov     cl,al
& `! q( j6 b8 ^# u& z% I3 ?2 Z    iret4 I" c* ]9 l+ c2 r; t
int41handler ENDP% o% A# y% f! @0 Z
! k+ N+ l4 I9 U4 H! c

; f" o) H2 _4 }' ]0 h6 D3 ^    xor     ax,ax  E' X7 U4 ]) J
    mov     es,ax- V8 f9 m# r: Q: W6 `$ N
    mov     bx, cs
# }' s( `" p. X: I! @    lea     dx, int41handler& B6 q% k. I6 D' @/ g/ y
    xchg    dx, es:[41h*4]
; ~1 J# p# s6 _$ e& @    xchg    bx, es:[41h*4+2]. u7 }1 ~3 {4 M8 W# B7 c
    in      al, 40h
( Y% l: z2 m/ c    xor     cx,cx
7 d3 ~, A0 q" i/ }' P- [    int     41h) C( b* e( Y% b2 f$ z! ^
    xchg    dx, es:[41h*4]+ O: ]% Y* [8 K& d  J
    xchg    bx, es:[41h*4+2]9 l! E, C4 a; ]/ p. g
    cmp     cl,al+ B1 Q; s9 U% e$ m. p' I; k4 V2 L
    jnz     SoftICE_detected5 ^) C- L, O/ M& J9 x

( L7 l1 ^: K) u" |0 {5 C_________________________________________________________________________
0 z. O* U7 i5 s; q: M+ W/ O! U
7 b% B2 B# ?* zMethod 074 S) J& U( E0 q
=========
& _: \* h+ K. X7 \- U2 e" `, [# j, N8 d  U# x3 ^# `
Method of detection of the WinICE handler in the int68h (V86)* p2 M7 J( \8 F$ E: Q

, \0 J5 Y& ^0 T& f0 f    mov     ah,43h
% I) X0 z: M$ Y( C2 W3 j    int     68h: F1 a: N2 w# R2 L9 }1 L( v
    cmp     ax,0F386h
/ O' M( {6 D2 W* j& U1 B& a    jz      SoftICE_Detected+ o: }# U8 @- D
. @  K/ y4 l2 w0 {
; U7 i: b# C* `/ G" B9 F4 e
=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit& R1 {7 ]& \* S. c; j# ~) I4 A
   app like this:4 c: V) P8 ^) d3 H. ~5 k
+ P7 B3 m- T( R6 R0 }
   BPX exec_int if ax==68
8 C* U" o$ f( Z' P+ i( U" W   (function called is located at byte ptr [ebp+1Dh] and client eip is
7 I8 U0 Y( D' h" g+ U5 }5 m   located at [ebp+48h] for 32Bit apps)
5 \* V& I; |" c1 c4 ]0 ]' c( O__________________________________________________________________________4 Z+ L6 p2 g* P" P
$ _" ?+ ?. v% ^! m* ~
& B, i! s6 f, n
Method 08
2 f8 I' P. G3 V2 |1 r6 d: `; s=========7 t: p9 l6 ]: w- K6 A/ M

9 r* x/ O% ]7 o3 tIt is not a method of detection of SoftICE but a possibility to crash the! A3 }9 A* S8 T
system by intercepting int 01h and int 03h and redirecting them to another
2 ~6 _9 P! Z$ b; U% J: Broutine., t& v  z3 }) H" g+ J2 ?4 o
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
# K! J0 i2 {- a- \( {+ Gto the new routine to execute (hangs computer...)
* a) m; }% D7 [3 m& @6 S. K/ x
5 J( v3 r- [4 j5 M# i! n4 Z9 Y' Y    mov     ah, 25h; E( Y" x0 ^- W4 J: R
    mov     al, Int_Number (01h or 03h)
; a" j# C% ?$ O3 U$ v4 t7 h8 \    mov     dx, offset New_Int_Routine
" c1 f/ Q2 g& @- p/ I$ h    int     21h) F; p3 P2 _' W* ~0 C6 Q  g" }; H" p5 j

4 f- c0 q. {9 @0 K' X2 a__________________________________________________________________________
4 B# U  T) p5 \' k# I6 f8 y, F6 k! A- ~! @# ~. I$ {
Method 09: t3 J2 A, E/ o, N/ ?6 N) c
=========
8 |0 G6 g* T5 [5 r4 `4 D2 C; A+ M% {  ^
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
! M" _; ?/ }# L/ p/ dperformed in ring0 (VxD or a ring3 app using the VxdCall).
, ]' t+ C: N" W8 y1 TThe Get_DDB service is used to determine whether or not a VxD is installed5 A( ]$ h) d1 j1 E
for the specified device and returns a Device Description Block (in ecx) for
$ G& S. B! ]5 f5 A) P% ]6 V) i' {: O8 gthat device if it is installed.
; A5 K2 v) M, r. {) v1 l. j( |8 y% |) `- b2 a! w
   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID1 g8 B) Z+ @# W0 q. }
   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)) ]  {" j% y6 u; x8 F
   VMMCall Get_DDB
/ ^2 C2 [  F! ^   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed
4 K: e8 k6 t% [9 S
6 A7 M6 ]2 r$ JNote as well that you can easily detect this method with SoftICE:
6 F! }6 Q9 d* {   bpx Get_DDB if ax==0202 || ax==7a5fh
" ^7 f( b- l# _& X/ y8 F5 V2 D, p
8 a. T7 n+ w: }5 r7 K__________________________________________________________________________
2 |! c% }; z# ]& i
3 s4 i/ B! P6 p2 ^! l5 |+ W6 AMethod 10
8 j0 V% A/ [3 p. C2 r6 u=========7 v! a$ u1 F+ ?& N2 o. \  v7 ?0 s
( C7 I4 ?- `% i9 C
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with
. H) Y8 z! _3 g0 p' u  SoftICE while the option is enable!!( U& I4 P5 s% T! V$ S3 }

2 L( O3 C+ N0 Z1 U4 |9 Z3 Z- T* ]5 _& ZThis trick is very efficient:. c+ n1 A; a# Q& Y& P+ q  G
by checking the Debug Registers, you can detect if SoftICE is loaded" n; h0 g' K: ?
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if6 A4 L2 f- y4 Y& h
there are some memory breakpoints set (dr0 to dr3) simply by reading their. x% H" h$ J# t5 _
value (in ring0 only). Values can be manipulated and or changed as well
4 ]# @+ @- Q$ D1 |(clearing BPMs for instance)
2 _% i4 R( k7 T
4 ?1 a# O4 s9 k- {, i. N0 f__________________________________________________________________________) ~6 t# {6 Y: Z, [$ T

* L; f" L0 Y7 n/ i( P+ W! |/ ZMethod 11
& i% D: j  i+ Z0 b' O) \! J- {8 E; N* E( s=========
% o  `, m) {' b7 G6 c2 E. I% @4 [
This method is most known as 'MeltICE' because it has been freely distributed
$ m4 G2 z# W. A2 {, o; s, ~via www.winfiles.com. However it was first used by NuMega people to allow/ v; q/ y4 s8 i* l3 E+ e
Symbol Loader to check if SoftICE was active or not (the code is located
% B' y0 p# B( o# k, |inside nmtrans.dll).
3 p  S$ y& z5 P) z
, R+ F- p! I3 P, _$ r: F  O8 _The way it works is very simple:8 J5 O- o* B" I; Q, l/ `1 A" {6 a
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
2 z: I$ ^8 g* ]3 ]3 P: rWinNT) with the CreateFileA API.; T2 y) c/ _4 |) G# f9 {/ d. m$ r0 z

& v. a/ `  \# P; gHere is a sample (checking for 'SICE'):, S9 H: h- x. v" L6 ~  O) S. N3 q  o

* b3 X. b1 n, q) j6 u6 c+ CBOOL IsSoftIce95Loaded()  d% v. g) x, D- m
{2 x/ ~: D1 o' `7 f6 |% u
   HANDLE hFile;  
# ]; ]! Z0 C: I9 m0 y' q* G   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
6 Q$ \9 p; ]: A- f                      FILE_SHARE_READ | FILE_SHARE_WRITE,
2 P* ^4 z* H* s5 I8 ~( Z                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
) K3 q9 O" q. U' N* o   if( hFile != INVALID_HANDLE_VALUE )
; a/ t( w: R: s/ ~0 H2 j/ C$ B: b6 C   {
( M1 i+ }0 E  ~      CloseHandle(hFile);
5 k, K4 q' q8 i/ `      return TRUE;
; N6 Y) v" E, j$ A* t   }
8 }' F) i; j7 T2 V5 Z- U   return FALSE;
* V$ \4 g6 E: T7 r8 ]8 j/ }}  S! d" |, b3 Y

9 j/ n" v: c( |/ f* Y# E( I8 qAlthough this trick calls the CreateFileA function, don't even expect to be
5 \. K/ S" V; ?' M5 O+ P0 zable to intercept it by installing a IFS hook: it will not work, no way!
* k" P; N* n) T. r+ PIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
& D3 _8 E$ ~+ \- X- Q, Z- Zservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
5 n& R/ _7 _8 G5 kand then browse the DDB list until it find the VxD and its DDB_Control_Proc
3 `0 H% W' T1 Q. Y; e3 x1 p, kfield.% X! K6 [8 |+ ]7 [" Q9 ~8 Y* t) L
In fact, its purpose is not to load/unload VxDs but only to send a
; S4 m2 g7 M) NW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)- o3 a4 q4 I4 F
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
+ R( L' }  Z4 p6 R+ A  l0 @. b3 Sto load/unload a non-dynamically loadable driver such as SoftICE ;-).% n# A5 k/ `4 H( i4 w3 X' ?$ k
If the VxD is loaded, it will always clear eax and the Carry flag to allow
9 w: J+ Y' [; q- h8 Rits handle to be opened and then, will be detected.1 i9 n+ F2 |# s0 I
You can check that simply by hooking Winice.exe control proc entry point
$ |# I+ ]5 \7 _while running MeltICE.
4 C1 }% K" i, K
7 x' k1 P7 k8 t' u$ u0 a6 F# Y8 u9 s) d( \; w; t$ V
  00401067:  push      00402025    ; \\.\SICE6 o& B8 q% s4 v7 J. F
  0040106C:  call      CreateFileA/ a0 f# p0 H( |6 }  r/ C
  00401071:  cmp       eax,-0019 s5 }  f$ b" f: q: e9 g. `% w# W
  00401074:  je        00401091
+ D9 z, B1 T$ _' s, n. v# c3 B  y! d. u  e  d) ^* U$ Y/ f
, V2 d" k2 R$ r$ v1 i% K
There could be hundreds of BPX you could use to detect this trick.- x4 Q5 C# ?: \  b9 H
-The most classical one is:; S* s- {6 l  G3 Y2 Z* K
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||1 S) P3 P9 g9 F/ C8 H( h
    *(esp-&gt;4+4)=='NTIC'" Y  P/ G. N& R9 c1 N5 l

) {1 k6 s! a4 n5 _$ t* I. ], x0 e-The most exotic ones (could be very slooooow :-(
+ t, |9 g* }& C   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  
$ e: N3 c! Q5 p) \& e" |3 N     ;will break 3 times :-(1 c3 v1 t4 C1 L; Z# Q
% G1 j. k8 m" h' |  J
-or (a bit) faster: & Y7 p% Y/ C; V1 {
   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
2 Q1 m( D$ p5 Z2 ^% g* L: A: M- f* H0 w: Y9 u5 B6 N
   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  
' V5 _/ K2 b  D" P4 d. R     ;will break 3 times :-(
9 N7 i7 Z3 ^5 \, f$ v3 n! k% s( e
: Y% V! s- `2 Z5 D' {9 H- t-Much faster:  t& M7 Y" ]- w' d  g
   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'; I# W2 S6 |! R- F
7 h8 u: H! j: Z; w6 i; S4 Q
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen7 f& l+ K9 b/ x7 |* j3 D; L# o
function to do the same job:
, y- y7 [0 ~1 T7 J/ u! o# f8 n, i1 |% T- x- n: h
   push    00                        ; OF_READ
1 P( f: S5 ?+ Q" m) {! r: t   mov     eax,[00656634]            ; '\\.\SICE',0, f6 |/ Y/ N* v1 M" K
   push    eax
8 D; N$ `( j$ j* @" p( S$ b/ v   call    KERNEL32!_lopen
6 L% B/ X; c! J! B   inc     eax  c+ Z0 H) q/ Q6 k  ~& i/ A" q
   jnz     00650589                  ; detected! T$ g. v% Z% [4 N/ }1 n
   push    00                        ; OF_READ
" u4 |( j3 T9 e. d! G- |, I, i" x   mov     eax,[00656638]            ; '\\.\SICE'6 V8 E' Q. b/ ?$ b+ U! {/ x6 r7 R
   push    eax
8 |: e. K5 Q7 D! O   call    KERNEL32!_lopen
- A& z4 a0 S! l8 K- I   inc     eax
4 P. H# w6 N/ l9 O  D0 \0 I8 f   jz      006505ae                  ; not detected+ z6 Y4 A' r8 m

( V8 a* c+ l: ~" }
2 x6 b% z) I& A+ \% q__________________________________________________________________________: W/ h$ D8 }. ^7 T

, L; a" K" G$ }# HMethod 12
+ }. Q3 [" k  t4 t, L' d& c! E=========1 o. H8 f, ]2 n7 V( `( u
- w. M1 n9 \+ T0 ^6 C; A
This trick is similar to int41h/4fh Debugger installation check (code 05
8 d1 H7 @- R) ]6 \  ?1 g; B6 a  W&amp; 06) but very limited because it's only available for Win95/98 (not NT)
4 z9 X; {/ s1 H/ i7 }6 @as it uses the VxDCall backdoor. This detection was found in Bleem Demo.$ ~4 L+ T; |# k! |& Y& A+ L9 q

& Y6 Z) G  h9 y/ K5 M. M2 Q( t5 p3 i   push  0000004fh         ; function 4fh9 ?) o( M+ |: N6 c/ M
   push  002a002ah         ; high word specifies which VxD (VWIN32); t0 e3 c1 C6 K
                           ; low word specifies which service$ p, s" W$ A3 S- A5 L
                             (VWIN32_Int41Dispatch)
4 W8 ]) ~! d6 w/ p5 E   call  Kernel32!ORD_001  ; VxdCall1 c$ g- y" E# r8 A0 d
   cmp   ax, 0f386h        ; magic number returned by system debuggers
3 B' q% u  \+ d' q  c   jz    SoftICE_detected7 T& Q' B5 z. m. Z% p% d

2 P5 ^0 m+ G/ M2 M  {5 h# q4 wHere again, several ways to detect it:
5 G7 D) [0 m' H* Y; }7 V4 @4 N# Q4 y6 X9 m! R! i& q* n3 C
    BPINT 41 if ax==4f
" R) U; Q0 o& G- s, M* }  _) P
- |2 ^4 }  ^. R8 S# k    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one8 F* `# j# }* U% `
& Y" q# H; m1 M1 E
    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A. f) {- ]3 j9 X! I% x, E$ A; Y

4 ?, A1 V3 X- Q( e) W& h7 h    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!3 c! Q- K  |5 [" D2 C9 k% K5 e
: x# P; U  E  E0 m+ D2 @& P5 D- @
__________________________________________________________________________
6 f4 t& |: P3 v% o- q3 j; k: V
1 g% @6 I1 @7 k- G2 `0 h" X. UMethod 13" f* h, q) A  |. |  \" r- d
=========( g4 \' r/ e: |
! W4 c% G9 t; X/ R
Not a real method of detection, but a good way to know if SoftICE is
9 T8 b. Q9 F1 sinstalled on a computer and to locate its installation directory.
( e" r- Q% u5 s# f9 }5 ~It is used by few softs which access the following registry keys (usually #2) :# j9 n1 k# k0 @3 C

6 z' s- t$ H, b$ [$ G; F! D-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
: V# n# _. M5 P% t5 X7 s6 ?\Uninstall\SoftICE, E% Y& r; d4 X7 {% N' J! h9 A
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
. _' Y6 e7 G$ s3 F-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion, k1 S7 @) D9 q
\App Paths\Loader32.Exe' M/ P; _3 m8 D+ ?- y. ~4 I
: U) U) P- z. @, F$ B

+ H+ G2 |$ E0 N) r% o. vNote that some nasty apps could then erase all files from SoftICE directory
0 @0 |, u$ B% m. Y: J(I faced that once :-(
, r( I; `5 O5 @- u/ E* k" w
5 ?. L& `9 L; _9 h! O& eUseful breakpoint to detect it:: |# n1 o6 x( K# K
9 A* C1 W7 _9 H: ~
     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'0 @: g$ c/ D$ P# R$ y3 G* }
4 y5 k" T3 A5 [% j
__________________________________________________________________________0 _. b. m' S3 C3 m& y9 U& ]
  O3 h. c( b0 |) K& n3 b

# h! y! S: o6 ~. X& K  }Method 14
. n& ?3 ?/ W# \7 D* ~# M4 b=========
. c( C  Q* O6 m' G
7 U" S( c5 q3 t2 }+ Q  ZA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose+ v, R- V; B9 p0 v/ [
is to determines whether a debugger is running on your system (ring0 only).
8 k8 I( T0 ]. b  q# \: K! x- {" ?7 T
! i, Z3 I; Q. |5 c   VMMCall Test_Debug_Installed& g* G* f% I/ Q4 u* H3 D9 h0 `
   je      not_installed
2 Y# V2 w( z" q+ Z
1 J6 w7 ^; \  }1 h" \- o  t4 e1 v4 iThis service just checks a flag., h  k8 j$ x- P3 r9 ?4 U8 M
</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关注公众号

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

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

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