找回密码
 注册

QQ登录

只需一步,快速开始

About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
/ K4 h8 e# j& Z" x; O<TBODY>* L$ q$ N+ X( m  N* n
<TR>
9 m& h( B2 k9 D; W$ B; d  _<TD><PRE>Method 01 6 t- Z( ]& N7 V* i; C
=========
7 C1 P+ f+ l" _1 s9 W4 f8 H' x! E  B' M+ ^4 |# z- M7 p) h/ `
This method of detection of SoftICE (as well as the following one) is' y; r& K8 E- i
used by the majority of packers/encryptors found on Internet.
- l& B! k. `1 M' TIt seeks the signature of BoundsChecker in SoftICE9 {0 Q3 C. F& ~) |& k! }, a
* r: `' {- [! r, m7 p& {% a2 t
    mov     ebp, 04243484Bh        ; 'BCHK'
7 l$ {% E8 C0 r* s- O& A4 B, ]    mov     ax, 04h
; W+ s; }$ W; D' ~    int     3      
% X/ Y" f* ~8 F9 l, D, I    cmp     al,4; N# d: w' [3 r: A2 @2 L
    jnz     SoftICE_Detected
$ g, ^2 d% ?, b" V8 N2 b
% `5 B# C0 f1 R___________________________________________________________________________1 n3 M  ?7 ?: H+ X, K

$ i+ `8 z5 ?/ l* G) }. C1 A- xMethod 02+ |6 W0 }' ~) }
=========
% h; S4 ^. K2 L& @- h3 d4 P: G
. z% _3 g2 ?8 |! i4 sStill a method very much used (perhaps the most frequent one).  It is used! y8 T$ p: t9 Q8 ~- x
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,* @! K+ Y) d' D; p3 ?( |
or execute SoftICE commands...
- ^; x9 y- m" v4 K7 ^3 VIt is also used to crash SoftICE and to force it to execute any commands; e8 v; }7 l" w0 |0 _: \/ n
(HBOOT...) :-((  " d' w% N/ {8 @
; |: D( L, A/ P  _( \
Here is a quick description:6 S7 w, D0 s* W. @8 h
-AX = 0910h   (Display string in SIce windows)5 _! r9 L5 F& V
-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)! o0 r- M0 d4 R; N* A
-AX = 0912h   (Get breakpoint infos)
0 W0 X1 [" t3 f; |# b-AX = 0913h   (Set Sice breakpoints)
. q# H. p/ u; R7 P9 p2 D: i, P-AX = 0914h   (Remove SIce breakoints)
& F/ ]) m: m4 G+ m8 J
& z1 E& D8 D4 `1 z. ~- A" GEach time you'll meet this trick, you'll see:
- I% N* J7 T" B2 l4 j0 T-SI = 4647h
: N# [$ J6 W: V-DI = 4A4Dh7 H' t4 }5 ?' F' s
Which are the 'magic values' used by SoftIce.
( y& F* X1 \' wFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.6 S6 ]  r. g, q! E" a

  ^+ D6 C0 v% jHere is one example from the file "Haspinst.exe" which is the dongle HASP+ `  K8 n5 m, o- ^) E- ?  i& x
Envelope utility use to protect DOS applications:
/ P% s5 W% |! l
) D1 I' _/ u4 S0 o6 C3 R8 z" S" `& Q( u: v9 Y; T# a) `' j2 y& D8 B
4C19:0095   MOV    AX,0911  ; execute command.
  Z% g3 q: {5 c2 I3 f; Y! A3 j8 w4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).4 ?/ V# Y6 S5 j/ t
4C19:009A   MOV    SI,4647  ; 1st magic value.
0 U, F% p4 a8 O+ _# B+ Y# v! o4C19:009D   MOV    DI,4A4D  ; 2nd magic value.. K* y3 ^! S1 G/ U3 l
4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
. l5 Q, F% E1 S4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute  y: n; T9 }# M- N# i
4C19:00A4   INC    CX
1 `0 }* [' V; W8 D& d5 n5 {5 C4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute
: ~7 {2 G" x2 \4C19:00A8   JB     0095     ; 6 different commands.4 [: _# v, X- w4 o8 w: j8 G/ E) q
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.8 {1 @" U; c0 Q4 N. e1 b6 N/ Q/ {
4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :): i. Q! J3 n0 i% X8 L
6 I7 M& Y# a5 d* C& m) {' L  v: F
The program will execute 6 different SIce commands located at ds:dx, which) W& _2 l8 Z0 C" ]( M
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.: u+ B$ `! A. p% m2 D, k

* P/ m: {) r0 h8 Z% F0 ?* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.& W3 `* k2 w/ Z' k
___________________________________________________________________________2 F5 b# F. I+ l
1 |7 l1 K( \( e( d" e+ G+ O

, l7 V0 x- K9 C+ d6 xMethod 037 W( n2 l7 u: [, ?. Q
=========) ^* y( Q3 I; s
8 b: N/ A. w0 f- F* _
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h' v: o! Y/ `2 t( m+ i0 i% S; H8 }
(API Get entry point)
: v- m, Y, s7 L# ?% |4 _8 b        
, F. C! U! ?% ^/ q$ q" {# ?  p$ \$ ?/ T
    xor     di,di' |7 t' V# V8 j& B: f5 k* d; d
    mov     es,di
/ X+ y- e8 o! }7 S0 s3 g$ t    mov     ax, 1684h       8 U1 D* I! O$ R/ R& h' B
    mov     bx, 0202h       ; VxD ID of winice! F% n& V0 A0 ]6 k4 J, s  s9 [
    int     2Fh/ n% H6 C+ e4 _8 Z
    mov     ax, es          ; ES:DI -&gt; VxD API entry point5 C: L+ Q% Q7 Z/ R1 G
    add     ax, di' e7 I6 T! s, h8 o+ `7 H) [8 C
    test    ax,ax& }. a8 X' C$ k/ Y+ \
    jnz     SoftICE_Detected
) ], P! \0 _" s8 m2 T* J3 ]
" k/ P( F( z7 ]; J! X  N___________________________________________________________________________
6 m# [0 Z+ T5 `) I: W( f+ r' u4 F0 ]/ S
Method 04" A" _2 P* L- c+ v
=========. @, D( o' H; p% ~$ }) o
5 J) a8 h. i! ^+ W* Y, [+ N
Method identical to the preceding one except that it seeks the ID of SoftICE* }5 Y0 M% Q% A. w( t9 E
GFX VxD.5 B: q0 t& h5 m/ n
' I: R  L5 s, V
    xor     di,di4 X5 H. r8 J8 ?3 `- z
    mov     es,di, ^1 U! c6 r) G; n% t
    mov     ax, 1684h       5 B5 ^$ u4 a" @0 D6 A. @
    mov     bx, 7a5Fh       ; VxD ID of SIWVID* [+ z7 z/ X! ]) \. X+ n3 g" z& {: U' Z( |
    int     2fh
% x- R7 k& @+ A2 F! u9 X    mov     ax, es          ; ES:DI -&gt; VxD API entry point& X  F2 C- U- N7 ^% \, d7 U0 E
    add     ax, di3 n; Q1 o( u1 n! M
    test    ax,ax
1 W; Y  [, I. _4 D+ w    jnz     SoftICE_Detected0 \+ y* g% T7 o5 O; I, O5 C
2 P. S% m( M* s3 X9 U
__________________________________________________________________________- P7 x. p/ I' w4 ~( j
) _7 _/ c- x5 g% p0 S
1 {: C  r4 s# B! n0 g4 ~
Method 05
# {8 k7 K, X; V; `; e, f=========6 h1 K  S1 s" s  k9 n$ u

8 F, w, _5 P. G2 y" S' uMethod seeking the 'magic number' 0F386h returned (in ax) by all system1 n4 j% F% m( u& N" H1 V1 p# K
debugger. It calls the int 41h, function 4Fh.
4 U" |" K; E1 _, [There are several alternatives.  
4 e0 D; R6 U! B; f  ^' ?1 j6 z# k6 @+ R. \
The following one is the simplest:1 E4 Z* W$ c! O" x+ ^* b
2 s* y, s! v- A5 v
    mov     ax,4fh2 c; x, i! {. T
    int     41h; \! u8 }7 C8 X0 f1 _
    cmp     ax, 0F386
( Y; P: Z% _( L+ W: \! `7 i    jz      SoftICE_detected" X5 `2 s1 o  _
2 b2 h0 r* V/ T9 v0 I
% A/ P1 G) q/ u7 C; t
Next method as well as the following one are 2 examples from Stone's
4 \- I, y# w$ g$ S# C6 |% \+ |"stn-wid.zip" (www.cracking.net):
% t' _/ h- o3 R& K. B
* `  d# N' t2 [    mov     bx, cs
, D2 {: g( r$ `% J0 g" A    lea     dx, int41handler2
; c; M, d0 f# ?& q# y# Y' a! `    xchg    dx, es:[41h*4]
5 Y+ E, Y' C! T9 o. w( B    xchg    bx, es:[41h*4+2]7 N7 @% z0 d+ v
    mov     ax,4fh
4 m: W; K% a. t: Q0 j% w2 O    int     41h
2 T& ~* N' W& ^: \    xchg    dx, es:[41h*4]( j9 o& E6 a; B' o
    xchg    bx, es:[41h*4+2]
8 S3 Y' T+ |. T- |* o4 A1 K* b    cmp     ax, 0f386h
- D1 Q9 x! ~4 K) o9 m: m    jz      SoftICE_detected: S0 I+ i5 o. b9 H
! ?2 C0 C' [  L" [. V: V
int41handler2 PROC
- c2 B; f: Q/ g    iret# K7 t2 B2 h# x! o
int41handler2 ENDP' W8 v% y; d2 L( Y' B: N! C0 X, i
8 O; d( \' N; Y! U2 J) V

9 q5 U6 q: `% K9 ^" X% F7 d5 v* T_________________________________________________________________________! E+ Y$ `& i5 W) E8 N
* S4 r1 z  @+ {  P+ R* Y
; _, o  [3 ^% h9 e3 O( K  q
Method 06
1 ~" T. ^- c% Y2 U=========0 K# {, t0 A. b+ T

: G9 n. H# B( V, K
' l. D+ S. e0 a  ^2nd method similar to the preceding one but more difficult to detect:* ?4 q; S! j; r

7 i# w$ G- k4 a0 \1 G) c2 T( E+ ~2 l  o5 B2 t8 w
int41handler PROC  D* k5 Y" A& x0 v" a. b- g0 v- M
    mov     cl,al
+ ]' J( g! e8 a$ d8 Q' k    iret
5 e4 f2 @3 _2 Q6 \1 _) t) T; a' C" _int41handler ENDP
4 B6 e( r7 p% }$ E/ V; d- P; d6 G! ~7 I
) \" X2 M& }- x, v
    xor     ax,ax; n- s$ }; u  L$ H
    mov     es,ax& |2 r/ U* j3 E$ K5 }6 A- A
    mov     bx, cs" q0 x" _! m6 c6 E2 L
    lea     dx, int41handler. z- d/ u4 D: R  A
    xchg    dx, es:[41h*4]: ~* R# z& o/ C/ S  B& K
    xchg    bx, es:[41h*4+2]. w+ u5 w/ ]! W) [* L
    in      al, 40h
' v2 G$ h' k) {    xor     cx,cx/ v/ B% S3 ~: O" b1 `; ?9 b. Z
    int     41h( J+ I$ i4 w: B- i7 j' \) M
    xchg    dx, es:[41h*4]) n3 D  @; u* L) [0 @+ i) l& i
    xchg    bx, es:[41h*4+2]; H+ O: j/ y6 z# c0 A
    cmp     cl,al
2 t" M  p6 m- Y8 K7 i) R0 B$ y& U    jnz     SoftICE_detected& X( `6 W8 g- P' W" c8 f

  h# q9 L- M& C, _# ?  ]  Y_________________________________________________________________________' }. m9 [/ Y* Z8 \2 P
: ]3 {7 l6 C' b. }/ \, j, i
Method 07: c& F' D  \: s
=========8 d/ v5 D5 i  p' K# u

6 [4 S5 Q  Y5 Y; IMethod of detection of the WinICE handler in the int68h (V86)
3 [! P0 m8 V3 `1 y+ o% ~* F% D- B
    mov     ah,43h
- l/ v1 C! g4 H0 P/ i3 O    int     68h
7 w; V( p' ~3 @, O+ _    cmp     ax,0F386h5 E0 f; z# |- t
    jz      SoftICE_Detected
! j( R4 z# R- ]# Y0 C! |6 n
0 e8 B; k! Q  f$ T& r( L( k6 I5 d  ~# \
=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit+ {- d& V4 T* z& I8 U( S* g0 c
   app like this:) D$ q' Z1 J, V, E( ~. @8 a
1 w8 w0 X* b, u8 J  N
   BPX exec_int if ax==68* A/ d/ \; ?( E- n; f
   (function called is located at byte ptr [ebp+1Dh] and client eip is/ {, a; A. d% N* J% F3 N
   located at [ebp+48h] for 32Bit apps)% I* i4 a! i1 T4 b
__________________________________________________________________________
/ |' t$ U5 s2 j  s; G* I; Y) @$ h) k- X& @. Y# Y7 k
+ E7 H* f( l9 Q$ [! I( R& d8 U
Method 08
( t% q$ k/ h) T7 _  G$ K; T=========; P0 ], i# o* Q7 g
$ B. b0 A/ S# `7 `
It is not a method of detection of SoftICE but a possibility to crash the+ X* Q/ a8 ^0 `4 L& @
system by intercepting int 01h and int 03h and redirecting them to another9 O0 y4 u+ P' g% h
routine.
( @0 D1 B  X5 i' @3 MIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points( X  R: Z* S* \1 M; o, v
to the new routine to execute (hangs computer...); o! q( H; F$ Z4 y, q
/ q# }# ^$ U0 P3 E
    mov     ah, 25h
! q& N2 ?) N/ W: h& ?8 {    mov     al, Int_Number (01h or 03h)% P! l$ ^5 ]" Y% ?* m& B1 M/ w; W& D
    mov     dx, offset New_Int_Routine1 W( ^, W  z. R( J" W  v
    int     21h, T* L' {" f5 c& p* a+ B! x0 w
1 ~' o) Z  f) }6 K
__________________________________________________________________________1 p" o" Q% ?" N3 L5 s2 V4 g0 J
- r; H: C0 t- I
Method 09
0 L6 A% i0 @' h% I1 ?2 b=========
4 d/ I8 `1 e* N% R; r
6 B+ U' G0 _% n. c, H/ RThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
7 {* r1 j4 T- `" Operformed in ring0 (VxD or a ring3 app using the VxdCall).- \7 o8 \% D/ {( @2 g' q
The Get_DDB service is used to determine whether or not a VxD is installed
1 V( t0 u9 r1 d% v, P7 f8 N8 x/ O% vfor the specified device and returns a Device Description Block (in ecx) for
4 V2 e# Y- ?# t* G/ w: Q! `that device if it is installed.
! n% u# o8 C( V; h. p8 p/ v( y' s9 [4 _' b+ t
   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID
8 U% t& L$ ^' u4 u3 x) H2 Y   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)( ~& d8 H% j$ i, ?' i
   VMMCall Get_DDB+ N" Z! M# ~, i) A
   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed
7 s) X: l5 l: r+ a) `8 m" W
, f9 @1 {* D6 @% GNote as well that you can easily detect this method with SoftICE:2 e. m* u! z- l" v$ X2 A
   bpx Get_DDB if ax==0202 || ax==7a5fh# V0 l) Q1 I# m, @2 z
: }( I$ i; _& b6 K0 o' h' i
__________________________________________________________________________
4 q( I4 t9 K* r4 \2 ~
# A. C; x5 Q' N7 _: ?7 VMethod 10
" `/ p5 q/ H' z* s! G/ L=========
: T1 [" X6 X( E, i
" Q9 E3 \4 O, N4 d; w3 v6 V=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with  {' q1 F% {' T: j( H9 x6 U
  SoftICE while the option is enable!!
% H( @1 D" [! l( {* A8 k) l- E$ }
; N; X8 Q: c' I; r, L( W  QThis trick is very efficient:
& @+ R" K9 T9 u, k9 A# jby checking the Debug Registers, you can detect if SoftICE is loaded
8 O* I5 d) H4 `  r5 g% {(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
- V& H. e- F0 [  C- Y6 Mthere are some memory breakpoints set (dr0 to dr3) simply by reading their+ C  W- u5 l! S' P% V
value (in ring0 only). Values can be manipulated and or changed as well/ _+ D; n1 X2 Q  \, G1 M
(clearing BPMs for instance)
( d3 N. S; U7 U4 G7 J# \# ~
/ q4 F# h" F& Y; @7 i! u__________________________________________________________________________6 t. C, H8 m2 Y9 D& t( U. @

8 a2 L3 B0 K6 ZMethod 11
& E, a/ f! C& X% c1 q! {$ k8 J=========- v- J4 f9 b$ L0 |* M9 ]0 [* j) b$ C
& _& L+ [2 Q8 h6 r$ K9 M
This method is most known as 'MeltICE' because it has been freely distributed
8 b' i) ]# J) |6 O4 hvia www.winfiles.com. However it was first used by NuMega people to allow
7 `0 G( ?/ T/ x  t. p8 wSymbol Loader to check if SoftICE was active or not (the code is located
' |' ~4 x6 o: V& ainside nmtrans.dll).4 y) T7 \6 t# B4 f" b

5 E8 `! m( Z6 W4 C9 |5 [( jThe way it works is very simple:
+ E1 ^8 N2 t/ M% h% YIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
) }$ m: y/ v$ Z$ X! A5 r) UWinNT) with the CreateFileA API.
8 G9 V" M7 B4 H% W, @% A* X& L$ a2 k+ F, w. B7 T6 y* w/ C9 u
Here is a sample (checking for 'SICE'):9 l& J* h8 x$ M. v, P
: Y8 c- B" O0 o
BOOL IsSoftIce95Loaded()
% H% }+ Q; p9 B- U  K{- K9 D5 S; f0 T1 R1 }
   HANDLE hFile;  7 {9 B/ |) T- W
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
9 q. Z% _& H" P* o4 g                      FILE_SHARE_READ | FILE_SHARE_WRITE,
6 W5 I9 d  z8 h+ W- Q2 p- I; M                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);2 Z+ u9 s5 T3 ?8 q1 [( s
   if( hFile != INVALID_HANDLE_VALUE )) f* W  n. z% ]8 Z6 I
   {+ y1 o4 L! t# t" E+ T  B; T
      CloseHandle(hFile);
) h/ l( m! B; ^* q1 J      return TRUE;1 w* y: K6 G3 w0 {  L
   }4 D9 ^: o$ I7 y- }( I9 r
   return FALSE;# ~7 g6 Q8 Y* V9 ^# A
}
& S4 ?6 r: ~$ q/ g7 |
) U" Q- {4 K, e! OAlthough this trick calls the CreateFileA function, don't even expect to be
, X" K" ~$ o% qable to intercept it by installing a IFS hook: it will not work, no way!' G! J9 ^3 f( F
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
% e( K$ W) A3 e; j, h% o* oservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
: X. K, S( [6 V/ Vand then browse the DDB list until it find the VxD and its DDB_Control_Proc
! _5 l* r2 M  M, Ofield.
# Z9 Q3 V. n6 b! {; a  NIn fact, its purpose is not to load/unload VxDs but only to send a 5 ?. ]9 w+ ~1 U& S
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE). K5 z7 L7 x! V& ]8 V/ i3 W7 F7 Y# R
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
# t; z2 C, z0 }to load/unload a non-dynamically loadable driver such as SoftICE ;-).& |' i; d( Z3 p
If the VxD is loaded, it will always clear eax and the Carry flag to allow
# }0 I: [; k2 J# V, i/ n+ {its handle to be opened and then, will be detected.2 G/ H  L( {* M+ E
You can check that simply by hooking Winice.exe control proc entry point; `1 `/ x  J4 F& }* o, d
while running MeltICE.; i: h6 x, p1 L' I: k
; V; W4 T3 Q- }5 `. \% {6 u

* ]5 X& E+ ]9 j0 R8 S  00401067:  push      00402025    ; \\.\SICE
9 f7 J: c. _- Z" Z  0040106C:  call      CreateFileA
/ F: _1 k4 `( I, C- i6 s  00401071:  cmp       eax,-001, Q6 ~' p2 U9 B5 @( P) Q; F1 w( K
  00401074:  je        00401091
( J* N7 B/ j# A5 C( G/ c0 Q$ ~; ^( C5 h8 q' R
6 E8 w4 V3 P: T
There could be hundreds of BPX you could use to detect this trick.1 V! J1 y6 {5 l- z1 d
-The most classical one is:5 Y9 o9 J! K, W! _& x1 Y( s. \
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||8 f9 q! E  f' `( _6 j% V
    *(esp-&gt;4+4)=='NTIC'
$ W; P0 R1 ^4 t- l. X: `
+ S: S& i2 `) S0 I7 h-The most exotic ones (could be very slooooow :-(
  a% i  O$ ?9 l+ G& r6 i: P   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  
* s* o- _, _# ^: g7 Y     ;will break 3 times :-(
. G' c. J" K& g* q
! x. Z3 K9 |# R, }: z4 d-or (a bit) faster: * j4 ^. r7 V" a: X. }
   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
' ^2 z% X1 ~) y# Z7 }. Y0 }* }: v$ [) {' y1 g0 V4 s
   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  
3 N5 D- Y. R8 ]' h, v2 D- T     ;will break 3 times :-(
% D; J( z+ L8 z9 s) T2 L, a& }) v3 `3 m- H
-Much faster:
' Y! H2 f1 ^9 _2 V: T1 A- Y   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'
0 I  C) S( L% Y# c  a
0 w* D( Q" X: p5 v5 d( F* iNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
- X6 X# O' t# z2 h: J4 Yfunction to do the same job:4 j/ v1 r& D2 r
0 s; W; n8 s. `" H/ v7 z: r
   push    00                        ; OF_READ8 X% L, z$ T1 z# w+ W. D7 e
   mov     eax,[00656634]            ; '\\.\SICE',0
/ {$ }6 D! p' I: p7 a   push    eax
5 @; ^5 p7 F$ w   call    KERNEL32!_lopen
0 K$ L  s# H+ \6 \! o  r   inc     eax
; o5 `4 S- N. [* w* m; b   jnz     00650589                  ; detected0 t+ s+ X) P8 P+ M* {
   push    00                        ; OF_READ, b0 K/ T- U: [1 F" ]3 |
   mov     eax,[00656638]            ; '\\.\SICE': O* p: |+ R  f4 A* `0 s1 X4 Y2 J
   push    eax! W+ X6 O$ g5 u0 c
   call    KERNEL32!_lopen
2 E* l2 B7 S" d# |3 J- N2 {1 a   inc     eax4 {% ]8 K6 H6 n# _
   jz      006505ae                  ; not detected
9 c& P3 J( \* i, j2 g; n5 }
* b; H/ s# n- T' L
6 Y/ N* u0 O" H1 u9 S__________________________________________________________________________  \' f- K* X/ ]  |
6 M! S( J+ D$ L6 V  g  X
Method 12( n( N& l0 x* b3 f
=========
5 {$ J6 K- x7 R' d; J" D* j& T" q; l& ~2 @3 P# `2 U0 g. m
This trick is similar to int41h/4fh Debugger installation check (code 05
6 G9 R" x1 n5 p6 [&amp; 06) but very limited because it's only available for Win95/98 (not NT), A" w% [# p6 Y
as it uses the VxDCall backdoor. This detection was found in Bleem Demo." ?& F5 o# H# l; h3 S9 _, b
' `& X; N$ P- X9 k4 b
   push  0000004fh         ; function 4fh+ K4 Y3 `* V7 X- P% E
   push  002a002ah         ; high word specifies which VxD (VWIN32)
$ `" q% h# ?5 K                           ; low word specifies which service6 w8 H$ K8 L/ J/ {
                             (VWIN32_Int41Dispatch)& c' u" H+ J) k: }
   call  Kernel32!ORD_001  ; VxdCall
! }( q- b( q3 j( [* Y4 S   cmp   ax, 0f386h        ; magic number returned by system debuggers% P, T: \4 y/ G8 U1 r7 ]
   jz    SoftICE_detected. Y8 Q9 b( [9 g5 b. l4 |
: J  P& ~' i! p- |2 T& f" S
Here again, several ways to detect it:
( o9 n9 t+ S0 l) W" a, c; ?' m
, A: [$ G. j( W4 t( y    BPINT 41 if ax==4f, `% o1 G9 C) p! i3 h7 w/ w

6 p' ]. S7 i2 D3 Z) i    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one
+ E$ n1 j6 y( B7 Q, {# M: Z1 a& p. [
    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
( X; k" @, M& l( {2 d  I9 E% V% R7 q
    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!& v# {* Z1 [1 w

+ p2 Y' i2 ^, o; a& H__________________________________________________________________________) c* [: ^2 _, @! h( O) Q
. B; _( `6 @, @- o4 \5 F  {# l( ~& x
Method 13
1 S0 |5 Z" J1 c% w2 a=========3 p0 v+ M+ w2 l* ]

; o7 N0 C* l- C  }+ ?6 Z, L& Q. V6 cNot a real method of detection, but a good way to know if SoftICE is
$ m0 m2 G# b; T; |installed on a computer and to locate its installation directory.
6 w  f/ U5 A. L7 ^$ @It is used by few softs which access the following registry keys (usually #2) :7 D. m) N. S7 v, Y5 w- A& M; B

9 E* G) S0 K6 e/ z-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
5 Z  M6 N3 s1 p7 r: U+ N  v\Uninstall\SoftICE
6 g0 q( E- b# P5 U. Z" U5 `8 F$ d-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE" M$ v* Y, ]$ D1 X2 h
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion, Q" s, H& N" E1 b  c9 B
\App Paths\Loader32.Exe) x: J8 D( @5 c( f( E
2 W2 g* W1 S5 o8 u2 s' u8 M* Z
' S( u4 H3 d" F0 g$ K8 p9 F
Note that some nasty apps could then erase all files from SoftICE directory
* ^( T3 N" w+ D$ Z, G, L(I faced that once :-(
! G* p5 O7 T9 s  x
( y7 y5 I1 Z& NUseful breakpoint to detect it:
" ^) ?  v7 i6 F1 `& L) E0 Q: a" F9 u* `
     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'% ~& J4 z- _0 \. {, v
8 b3 F1 e% O2 R% ~6 ]( N* |
__________________________________________________________________________8 D) F) |, U8 ?

' J% h; u: O; Y7 V5 H# c- |, ?3 j7 K- b1 G
Method 14 $ f$ i. P- y. a# [9 _. }( Q
=========
( x% M3 {( _6 l5 k6 c* ]0 C/ h
( y# y: D  d6 I9 d& K( VA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
0 \8 _% q; T# x" Pis to determines whether a debugger is running on your system (ring0 only).0 M0 g. u' \  x5 J
9 l, s% ^% S. Z% m* C, W
   VMMCall Test_Debug_Installed
+ _% x" y6 \* t   je      not_installed
) @" m. q! J1 c) q5 ~9 N1 u" ?! K7 r) M& Y4 C5 K
This service just checks a flag.
! |; C" B3 t' I2 @1 j2 Z</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-7-26 09:24

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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