找回密码
 注册

QQ登录

只需一步,快速开始

About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
  m. k. m7 o5 n8 t; d<TBODY>
* s/ Y. U0 R" l+ A) L<TR>4 K  H! x" U9 z2 b$ F
<TD><PRE>Method 01
) _3 v+ U% g! x4 s6 J% u; z7 S4 n=========
5 g: ]# r0 k* c7 J6 z& i0 Y7 y7 ?4 W( [3 E# w" Q7 V& P% V6 c8 _$ Z1 x
This method of detection of SoftICE (as well as the following one) is" h- S; u1 S9 B2 g0 q9 w
used by the majority of packers/encryptors found on Internet.- R+ h: ~& x6 \0 x: p) o' y
It seeks the signature of BoundsChecker in SoftICE2 w3 e5 O5 H0 i7 U1 T# ^8 P' h& x

/ ?$ V- s1 [# ?& K8 J8 h    mov     ebp, 04243484Bh        ; 'BCHK'
4 R, x# z0 s* Y# p! a    mov     ax, 04h
" L. y! b3 ^. k5 m    int     3       1 d4 h" Z6 R+ b/ ~* r
    cmp     al,4
- h, H2 T. Y8 C5 b0 k    jnz     SoftICE_Detected
7 q: F7 S, l% |* U
$ a7 J( t! k5 z" r; b9 F___________________________________________________________________________
7 L. J% p0 l$ E
. s) I7 T$ t1 |+ }Method 024 c' _4 ?, G" O6 Z8 F
=========+ j8 x, K- w6 U1 m" {
  B* N5 a' E; ]# d
Still a method very much used (perhaps the most frequent one).  It is used
/ O: I& Z' g, f! y' x9 A3 Gto get SoftICE 'Back Door commands' which gives infos on Breakpoints,. u, Q9 V6 T$ ]% J8 R# F1 d
or execute SoftICE commands...
6 w, t0 q- d, j  {) y1 |% MIt is also used to crash SoftICE and to force it to execute any commands
* d! s, E) n4 d# x' w& b' D(HBOOT...) :-((  
! v6 Q3 Y/ C  k1 n9 G$ f! \
' l/ T% R( G7 SHere is a quick description:
/ m8 n6 e! E; [9 w-AX = 0910h   (Display string in SIce windows)
, a$ _1 `! J( W9 h-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)
* ]# |' X# V+ |+ e9 \$ t-AX = 0912h   (Get breakpoint infos)
: f( s2 [/ c( s" Y& z-AX = 0913h   (Set Sice breakpoints), I; {& m: x  t/ a4 L" P
-AX = 0914h   (Remove SIce breakoints)  ]1 T; c, s5 B5 o6 t1 c

% U$ h8 X/ H  C/ [" oEach time you'll meet this trick, you'll see:1 t4 D4 J/ w" i  M/ ~
-SI = 4647h
0 ]% K6 z$ S3 C/ \4 b" A-DI = 4A4Dh
( u$ r- ?7 e1 rWhich are the 'magic values' used by SoftIce.
  [  O4 J6 a  [& u  P0 m8 X3 n/ JFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
3 _4 K8 k5 D) S/ D" @0 Z5 l
2 b4 v, T7 v! K0 ]# WHere is one example from the file "Haspinst.exe" which is the dongle HASP
1 M2 e% M1 }9 X- x! _/ [) j$ v$ qEnvelope utility use to protect DOS applications:
6 f% L4 a) E& \
* P1 J  c+ ^- q, J2 n& e5 B2 X8 j3 m9 Y( F& }+ e& ~! e3 S# Z' ^$ m: G
4C19:0095   MOV    AX,0911  ; execute command.
* \( d$ B0 J- q% F4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
+ A$ |" I9 R6 B3 t) [4C19:009A   MOV    SI,4647  ; 1st magic value.; T  O& Z! g. C' x5 [  i
4C19:009D   MOV    DI,4A4D  ; 2nd magic value.
* f; r1 O  Q& ~5 r4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
$ V# {, _! C. H7 u* x. k4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute
! g1 {; t) H7 M; u! ^4C19:00A4   INC    CX! a9 Q: m, l5 |" {( c. c
4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute
# e8 G. {- c" i# |. Y: n4C19:00A8   JB     0095     ; 6 different commands.0 X$ V% z% @- h3 B9 l1 G2 s1 H* \. }
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
5 P$ a, r6 d2 Y6 l4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)
* y+ d: F% X9 @! a1 p- Q6 p, s% E8 p3 m& D* G! G4 L6 ?  G
The program will execute 6 different SIce commands located at ds:dx, which8 M  @4 M- U: r: W
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.% d1 r! P0 Y) r; ^8 V* W

( X- Y' W9 \2 o. _* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
0 ^6 Q4 q" `+ \3 R___________________________________________________________________________& |5 S6 g3 Z7 ~# ^  I
$ h# W" E) R, E, f) D

; T( B3 |: s7 \5 ~) N$ PMethod 038 g- n5 @/ Z# c' f+ p2 Y* p
=========! P7 @9 V8 y9 c7 M1 e. d7 _. H' D' _
) K8 M8 q" \( U+ [
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h- d1 a* U2 j: e2 A& \" n5 l4 W7 P
(API Get entry point)
$ b, [2 i$ f+ \( x3 X2 r        
! j7 e( @9 [9 d" P" X  S) f5 e7 l; V+ a9 X# Q
    xor     di,di
: a1 C2 F/ |, u: L! A    mov     es,di  N" i5 T1 U( Z  R! H
    mov     ax, 1684h       / z8 ~  r: ~# ~. j/ _
    mov     bx, 0202h       ; VxD ID of winice
  A9 o  E' Y* a( s* S0 K    int     2Fh. V' t6 Q* d" [( b/ S9 A
    mov     ax, es          ; ES:DI -&gt; VxD API entry point
: {7 Q2 J* v7 o1 u! o' [    add     ax, di: S' D9 J( i2 I0 ?" _/ e7 Z
    test    ax,ax* R- E9 [8 U( u* w. j) S! @* Y+ R, W
    jnz     SoftICE_Detected
2 Q3 z8 l+ q: s5 N
6 r4 k9 [, @% r+ U6 \+ @___________________________________________________________________________
5 G5 M$ G8 L6 q. c) D% L8 e+ ], ?8 T& H1 ]8 l; A
Method 040 U* {, ]( o& G+ ^& l7 }
=========
! ?/ W0 k# v5 P8 b$ b  N$ q
8 G' |4 B' H* Y9 d! m2 ZMethod identical to the preceding one except that it seeks the ID of SoftICE, B# W0 F/ M* m  G( J
GFX VxD.
2 `2 u: f9 {) T7 |2 T; H, s
9 |: ^" {! E6 X* W7 J5 R% x) F4 l9 q    xor     di,di' W( O( ?/ A  }0 G
    mov     es,di
! f( H$ T- S0 g+ O    mov     ax, 1684h      
5 X, x/ u; ]) s6 D4 l1 T# g1 P    mov     bx, 7a5Fh       ; VxD ID of SIWVID) Z+ ]& r& R3 h
    int     2fh
! `9 Q( A& ~; U3 f$ K# h    mov     ax, es          ; ES:DI -&gt; VxD API entry point
8 k/ `: n2 v5 _* m    add     ax, di
% I; f3 _8 ]9 Y6 N. d) c    test    ax,ax. H; m0 J9 G1 N
    jnz     SoftICE_Detected
$ k' k: P: q9 e& g* _8 a" r
$ B* Z" q- ?/ \3 O( g3 A9 x* ]3 a( K5 r__________________________________________________________________________
' u" }3 p8 P3 M6 l% t$ ]+ A6 Z  v4 E: j; B: `, Q  g3 o3 l

0 o$ s- v  L2 BMethod 056 M/ ^3 T* Z$ B; P
=========9 m. y- ?+ k# L

2 r. L5 x9 }/ x# \* ~  A, J6 zMethod seeking the 'magic number' 0F386h returned (in ax) by all system
: `) z3 q* L3 c4 e) w) V5 q8 {debugger. It calls the int 41h, function 4Fh.
; G5 r, }: V- E2 `  I+ ?) vThere are several alternatives.  
6 E- m) ^* f' a. I4 o+ E# v
9 Q" s; Y5 S5 p! UThe following one is the simplest:
: n2 `1 K$ i& @
; [5 M% ?. A! B  K' g    mov     ax,4fh) `* T8 q: i! C) V6 h/ u
    int     41h
, S' g  g+ Z( y9 I" o    cmp     ax, 0F386
% Z" V) U( b3 Y$ ~9 b    jz      SoftICE_detected
6 i; E. f5 z$ k- N, O5 V4 [
) C6 ^3 s) B% X" g' e: S3 D: |1 o3 c4 Z& c  K& s
Next method as well as the following one are 2 examples from Stone's 3 S6 P) w  e+ v
"stn-wid.zip" (www.cracking.net):
1 L  x6 O; ~/ S0 n: b) c/ D% j- D! @# P# A5 C6 h: Y& X# B
    mov     bx, cs
/ J0 T9 t" g4 R# W    lea     dx, int41handler2
( N: m9 [7 T4 R! H+ z5 A' r; ~- ~# c    xchg    dx, es:[41h*4]
. ?: e+ N" z3 o0 P( O    xchg    bx, es:[41h*4+2]( {3 u, T. w: r- v
    mov     ax,4fh1 R1 s+ m0 t( U% ~. P6 g
    int     41h
* W4 V) P. G$ H1 ?6 Z    xchg    dx, es:[41h*4]
# a, }+ o7 B' `    xchg    bx, es:[41h*4+2]
, J3 d- @( O) F# q9 R$ e    cmp     ax, 0f386h' D: i9 a$ U" t- y0 l
    jz      SoftICE_detected
' @6 V" M1 L. A( ~5 A
5 K8 K2 K5 P5 i0 r& W/ Yint41handler2 PROC
8 i  @9 I3 {) G9 c3 Y    iret
% M8 `* N/ F& M+ N, ^, zint41handler2 ENDP
/ ^2 N* f$ ~( L" e7 A
$ P" A, a. Y" B& f
0 h. }- j, {: ^5 P: u_________________________________________________________________________
( A% e2 A4 U4 o
1 R- t  `8 _: k# u# p! b& C6 C, m' y, c- w. N% m; W
Method 06
, t2 f8 T& E5 m9 r+ ]: q=========
$ ]; M( v1 Q. _4 G8 Z) @9 [; ~: M6 c' ]' N0 [6 q6 S

6 O- L$ q* @8 o2nd method similar to the preceding one but more difficult to detect:* U) G4 F/ s/ M/ \% ]' C
/ Z/ F2 m: o2 H& t
7 w) G( W0 |* L  O8 o
int41handler PROC  S# K7 ^) \3 W, R8 Y: ~- J
    mov     cl,al
& M+ v" u* F. N/ W' m    iret3 N! q3 ]( w& H
int41handler ENDP% X' Y, h3 r) Z+ F! O

6 I6 S2 Z) K: Y* p
" J5 U2 ?$ E- ?6 B. l8 ]    xor     ax,ax
" J8 t  E; H! p1 S) b    mov     es,ax
2 J7 A8 Z7 q- G! y% y    mov     bx, cs
5 ?+ t6 g0 ~) w1 x0 T4 p! s' s    lea     dx, int41handler
  e- b% R( A6 O- B! S# t    xchg    dx, es:[41h*4]
8 h  a0 o& q5 D    xchg    bx, es:[41h*4+2]! Q" V8 n4 D+ V: R
    in      al, 40h
: W& M- ~6 `% F5 B. j    xor     cx,cx* I5 r: s/ w/ [% V2 Z' W
    int     41h
' a2 V$ c) l5 `6 v' K. Z    xchg    dx, es:[41h*4]
* M6 g+ ~6 w& ?3 |0 I3 h    xchg    bx, es:[41h*4+2]: c1 M& c  Y( u" ~
    cmp     cl,al
5 s% }9 |* Q0 X" q, F8 h) }    jnz     SoftICE_detected; j' W6 A5 p/ L/ E" @# j

: V* y7 ^. x4 ~( q) }" D_________________________________________________________________________4 ], }6 P; ?) A* Q

4 t& b) S( d& R% e0 R4 ]/ `Method 07! B- c& v- `1 ?  y, R% X
=========
; Z+ Z/ f( Z3 Z! k
% T: `& ~& @5 k# |Method of detection of the WinICE handler in the int68h (V86)9 S. f. K4 I( m$ r
+ @) _0 O$ u! g4 V; i' M' J" t9 k6 a
    mov     ah,43h
3 ?9 A$ `: q, T$ r; M    int     68h
6 A6 b: ?$ }6 h4 f; [# L, I7 {    cmp     ax,0F386h
5 ~- @  J! y) [9 }" X: U    jz      SoftICE_Detected
9 O: Z1 x0 Y5 h7 d% v9 F$ O( A
* R5 l3 K, Q; g$ H8 G; ?
) a; D& F6 C: ]. X1 @# a/ p=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
- K2 v! N1 [* R1 f0 }1 |   app like this:
. S. ]6 `* M$ E5 B) R8 n4 Z; G7 R' E3 V3 i7 J$ X" ?' _
   BPX exec_int if ax==68
, L1 X: O+ s3 y9 {  F/ n   (function called is located at byte ptr [ebp+1Dh] and client eip is
8 l4 w4 ?, z/ |; c9 a% n6 ~   located at [ebp+48h] for 32Bit apps)
, z# }* F# l! i" ~- q: q__________________________________________________________________________# E. ~) C; w- H' p0 F
0 M9 g$ ^3 _5 B9 F% |' g5 D
! d3 F- L& }3 z7 Y: j3 x
Method 08
- o5 p+ Q) X9 M7 H) y=========
  ~. c$ P9 n) W8 W  l- W/ a) b( m0 Q. `! J3 [  U* T
It is not a method of detection of SoftICE but a possibility to crash the
8 U2 m4 I  l/ f, D2 N& Jsystem by intercepting int 01h and int 03h and redirecting them to another
/ l; h3 L4 X0 y- \1 L6 h0 C0 Xroutine.; G/ W) N0 M6 c3 S9 A$ A. w, ?
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points' t* w# D+ F* A. c
to the new routine to execute (hangs computer...)5 K  d' P1 ^( y8 Q3 t  J9 X+ [
) f; m2 {, u, N# S1 ~
    mov     ah, 25h% d/ n/ k0 l$ i! G7 c3 I9 }, D+ ~
    mov     al, Int_Number (01h or 03h)0 y+ }2 U+ m- W- a" I: q
    mov     dx, offset New_Int_Routine
6 n% n% `! P( b8 _    int     21h
2 m$ @$ F- t- D4 Z' \/ P, }
0 e: {6 d0 Y0 Q4 M__________________________________________________________________________# k5 c' F. B9 X% Z9 c

% g3 X! n/ k0 x4 U# o  d" YMethod 093 D9 P4 |- v; M: E5 F
=========
/ Z+ i1 ~) Z, K6 F. J. A/ z2 Z. k
- S( u8 D" r! fThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
+ C; V5 ]# P& H& O' w  z; {performed in ring0 (VxD or a ring3 app using the VxdCall).' `' X% i: ^8 L- K! o/ j
The Get_DDB service is used to determine whether or not a VxD is installed& q2 g$ ?) h1 Q7 Y2 V
for the specified device and returns a Device Description Block (in ecx) for
. s; r- b7 _! h: D) o! tthat device if it is installed.4 z/ C$ `  f6 c. m0 _! ]  D

' H; J7 C$ j# n, f8 I5 M' D& D   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID. N( y) \& ~; [3 K& a/ b! `
   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
6 w$ B# I, z! |& r& ^" ~8 Z3 P   VMMCall Get_DDB
0 Q3 N8 p/ |; F* _   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed% S1 ~; D! o) L; n$ D3 t
6 k5 m$ {) _# w0 i5 _
Note as well that you can easily detect this method with SoftICE:& G" ^6 f5 U, K9 v9 X2 Q! D
   bpx Get_DDB if ax==0202 || ax==7a5fh$ E5 c. @! _( C# P* O1 T

1 z, B% T% B( N' q. d) g0 G9 h, Q2 T__________________________________________________________________________
' W8 p# w( k# z6 I6 |# H1 r: G8 w; N! q$ y- n" Y
Method 10$ u: y) w0 u5 c/ p, B8 S# b$ N
=========. z) x( U# J9 D" a1 n+ @) f: A
: F7 {& Q7 u8 |
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with
! W  _1 ]3 `/ j, _9 t, \( x  SoftICE while the option is enable!!0 m% G* h( g2 N2 L: x% t7 s: R

9 G. L( \1 h% J# `" }8 c& F# t+ GThis trick is very efficient:8 ]  p  }  q" l. C" I, Z
by checking the Debug Registers, you can detect if SoftICE is loaded6 u0 I  x* N4 ]  ^  L$ U; U
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
8 z; R; b( ~- M# u/ sthere are some memory breakpoints set (dr0 to dr3) simply by reading their- e9 C, K. U! s/ ?' P
value (in ring0 only). Values can be manipulated and or changed as well5 E6 g4 @) i( b, i; B" ^2 I
(clearing BPMs for instance)
- Y# o; x- Z# m- z0 S: C  e- x( \/ _' ~% D* O; e9 A1 F) z- j7 f0 D
__________________________________________________________________________
) Y$ \4 @; u9 z
+ Q* U- i/ E6 W) RMethod 112 ]7 `9 k) u9 |) t5 c
=========! a3 l- G& {2 |* {

7 k1 l- f+ s+ k; |/ FThis method is most known as 'MeltICE' because it has been freely distributed
  |( Z3 y5 d1 y' I0 Uvia www.winfiles.com. However it was first used by NuMega people to allow
# M8 E/ ?4 A" S5 [$ w5 E0 MSymbol Loader to check if SoftICE was active or not (the code is located
# o/ F( z" P1 ?- i2 Y3 kinside nmtrans.dll)., i8 N0 V  R  t3 _. c

9 M! Y% J. p2 X2 e) N6 ZThe way it works is very simple:" J! @; l2 M* I9 r* H5 w% a$ ]4 s
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
% Y/ d) Y( Z1 }; Z# J  YWinNT) with the CreateFileA API.
# a  E7 X# \5 @8 k4 ]# m" f# b* y+ Y9 L' }3 e3 F* ^' O% I
Here is a sample (checking for 'SICE'):
* v* U/ P: c& H) \8 g$ x/ W& Z7 d* A( ?4 t% w' v
BOOL IsSoftIce95Loaded()
3 Z9 s6 ~2 o2 i6 [1 x, O{. Z2 O2 U7 A; e" Q' P
   HANDLE hFile;  ) m4 C  u; h0 O( q5 o/ R4 {
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,, _1 j& @5 Z3 V5 w
                      FILE_SHARE_READ | FILE_SHARE_WRITE,
  U4 d( _( _1 ]  H                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);' H" z5 ~/ M( X1 S
   if( hFile != INVALID_HANDLE_VALUE )
7 A5 _- M$ L( @, m  N   {
. p$ b' j2 ~3 {, ~* L      CloseHandle(hFile);! h' A9 r! |* z& R& r2 s
      return TRUE;
/ F2 M) S8 z% }7 b, C- \1 o; H, E( X   }/ Q; Z* h5 F  |( @7 X  y
   return FALSE;5 S" w2 ^. L: R/ t9 H: P
}
+ w$ d5 [" B' ^, p2 Z; B
7 L' l% d* S; u% IAlthough this trick calls the CreateFileA function, don't even expect to be
# l  |3 Q! W0 p2 S: X8 {9 I! table to intercept it by installing a IFS hook: it will not work, no way!4 `" W8 Z% p* o8 m4 B' l: l1 @/ X! p
In fact, after the call to CreateFileA it will get through VWIN32 0x001F7 O9 S# j+ s; @! i+ E
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
; ^8 x! E4 m( M  @- `5 n8 ]and then browse the DDB list until it find the VxD and its DDB_Control_Proc
- f2 y* v1 u- R+ R) p) hfield.
% P. k: E1 L, |" ~! bIn fact, its purpose is not to load/unload VxDs but only to send a # ~0 q+ q+ T% k
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)* ^5 ^* y" R4 l. V( k' C( s
to the VxD Control_Dispatch proc (how the hell a shareware soft could try  h" m, H6 j7 G
to load/unload a non-dynamically loadable driver such as SoftICE ;-).+ D% B0 R8 o4 P6 t2 u
If the VxD is loaded, it will always clear eax and the Carry flag to allow
3 N, Q# |( M( t' Qits handle to be opened and then, will be detected.& [6 t( c# J7 L2 j1 o2 q5 o6 M
You can check that simply by hooking Winice.exe control proc entry point
$ |" g& x, J; H+ g% g7 q/ f0 Zwhile running MeltICE.
: i% p8 R* [$ G2 b% z4 q: F+ j4 H2 o
, z$ t7 o  V- V& g. Z  M3 D
8 K0 B8 ], Q+ o! R/ _  00401067:  push      00402025    ; \\.\SICE
; A' V! [) O3 f# b  0040106C:  call      CreateFileA' {3 F* M3 R$ A. S
  00401071:  cmp       eax,-001. |& F0 X( ]7 i" V  r
  00401074:  je        00401091
* Q- h+ c; ?, z! X: m  H6 Q& N: E0 O. }' p: ~
' E$ O; w# G2 a# G( b
There could be hundreds of BPX you could use to detect this trick.
- v/ V3 h5 \- j! c& r-The most classical one is:
! L, W9 R! m- r1 F# P, j  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
0 h! n: @) [, H" S* n    *(esp-&gt;4+4)=='NTIC'
9 N8 W1 ?6 Z6 [$ M( Y
+ n, t: _& [7 \5 n7 W-The most exotic ones (could be very slooooow :-(
# g6 s3 J+ \* g  d2 B, z   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  # N1 r& S* P6 B1 b% c7 T
     ;will break 3 times :-(
) w# H* G# J$ ?/ _1 o* N2 R% t+ s! i1 i; Q$ H' k) D
-or (a bit) faster: % X* B+ t  `0 w4 N7 h! P% j$ P6 q
   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
0 I. G! P. J4 i% q" N: p* _8 K+ r" I" J) y7 r; }7 s
   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  
4 L; \+ _! I' }% s9 m     ;will break 3 times :-(
# r9 P* x; b5 a9 ]. h/ G7 w5 I* m; T! V, _" r8 f
-Much faster:
$ k" t9 ]6 d# S7 d+ u4 h+ M   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'/ g, e6 L* P# L: r* }3 J
* _" ]% T" W1 w6 x% B; o9 A
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen+ j( F/ Q, w1 @) V2 U& y
function to do the same job:* t" B" |8 e5 t4 S, B% j

! y1 h0 U/ j8 e  T( d6 W8 m$ J; L   push    00                        ; OF_READ; \3 i/ I4 s# K: ?1 [( R, }4 _- A
   mov     eax,[00656634]            ; '\\.\SICE',0& a( _# n) `' R
   push    eax% W' W- O+ }" y' [  A0 R( x* K+ w
   call    KERNEL32!_lopen
. H# ]( y$ N  G+ X$ Y4 W# v   inc     eax
. {: h4 k; Q8 d) `5 Y  o   jnz     00650589                  ; detected3 N8 X9 e5 d- j; \+ u( W
   push    00                        ; OF_READ
( Q8 \5 c% P, T6 A3 t7 V; ^" b   mov     eax,[00656638]            ; '\\.\SICE'/ T- `' i2 r5 ]; D9 Y0 |0 w& C# i
   push    eax2 N: E0 S/ N6 ]; U, v4 `
   call    KERNEL32!_lopen
4 H( B) j1 q( ^. y) _4 {3 `( ]   inc     eax
1 U  Q5 ^% `- c" D2 v   jz      006505ae                  ; not detected
& ~2 x/ |, J  a
8 s1 X: J; E# O1 x9 g' u% c/ k$ d# j7 Y* O
__________________________________________________________________________
! j" Z* j* ]# n7 `4 W: j- B
+ N/ |* g" a: g# t  F+ AMethod 123 Y4 T) P! z  w7 s. r
=========/ P# ]" M, v. S6 n8 @! e
3 e% }+ X9 s( z5 O2 Z
This trick is similar to int41h/4fh Debugger installation check (code 05! s% \8 s- E8 s) Q% u+ g4 b& r
&amp; 06) but very limited because it's only available for Win95/98 (not NT)
$ `9 d2 N$ h3 L6 g. E$ _- m/ fas it uses the VxDCall backdoor. This detection was found in Bleem Demo.0 ?2 V6 y. Z  p4 d  P; H

- r: g( |9 J- E' m! o5 y0 A. c/ R   push  0000004fh         ; function 4fh# g: e6 Z0 r. x1 m2 {5 B* `  v
   push  002a002ah         ; high word specifies which VxD (VWIN32)" G' ?5 r7 m" C1 m& G
                           ; low word specifies which service# P& W) {& ?" H3 k* P2 Y( j. c
                             (VWIN32_Int41Dispatch)
2 j) u( V4 j+ q" m   call  Kernel32!ORD_001  ; VxdCall
8 D; Z$ j! {0 f1 I5 i4 ^   cmp   ax, 0f386h        ; magic number returned by system debuggers1 {" y' M6 Q) T2 I6 \
   jz    SoftICE_detected
. I# X% s0 _7 G1 {' M! O( Q; ?5 a/ }. W7 x! f. G4 A7 y
Here again, several ways to detect it:
. f* B+ k$ I+ N$ Z; }
6 G9 c6 o& v2 N0 [    BPINT 41 if ax==4f
, L. c4 X! L+ X9 }5 J0 |. f% L, d1 X1 Q3 g% P  T0 h
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one
: n3 b* H# w1 v' |
, d8 k' N+ z  K    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A" M7 r: K  \# G; d3 I

  G) i  [  B" W2 ?4 O7 @9 ?, u    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!" q( T% B2 H$ d2 H  G% S
: ]$ C" |# E( m; k! P+ }$ ?
__________________________________________________________________________
& I5 _+ u4 ?3 P- P4 l. l
7 L; `' c& h0 c4 MMethod 13
1 x0 ?. H0 G- j. G9 b% F1 j: p  s=========3 D$ j0 m0 [  [/ c$ X' q

! P# g4 ?0 |5 E/ L# ~1 p6 {; qNot a real method of detection, but a good way to know if SoftICE is4 T/ r* d% ^" D- E# J4 g/ }
installed on a computer and to locate its installation directory.
7 @, p: Z5 N% W( D$ OIt is used by few softs which access the following registry keys (usually #2) :
0 w2 a3 m" s) a* [! e
( x' Z- k" b: u0 D5 [-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion* I0 d2 z9 V' L. u9 {. ~3 F* a
\Uninstall\SoftICE
; h' r! @: G; T. }/ h8 T# M; ]-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
* z) q* `7 u- Y2 j- Y( w' Q: w-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
+ x; ^6 X+ Q9 g\App Paths\Loader32.Exe8 J( f2 w4 l/ [

) W+ J: Y+ B8 p- j- m- o! I# {2 f: |1 U' k/ x& U" H8 q6 s
Note that some nasty apps could then erase all files from SoftICE directory! H( o; E% C6 F& j- Q( }
(I faced that once :-(- m* \& R  E" k; Q- z, W

- O0 T# r& R0 l2 V% p/ kUseful breakpoint to detect it:
1 l( g& O( f  \% X. T! {7 Q( d
, M  M8 s) |. |% k' ]* ~1 X5 g0 |     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'4 z+ x$ Z8 u! c" l' d! a: m" R

8 o) E9 S) O+ R4 C: w__________________________________________________________________________; L8 M7 `" s2 `. |2 @( Y5 l
/ T" P9 P9 ~7 q1 P. ~4 `
  l" M- N9 D2 G, X+ p) g  a' J
Method 14
( S/ r& \8 t# }, v6 _7 t=========
8 B! m2 A5 a1 g" f# n
5 z' J; x" d: UA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose  r, q  ?+ p- I: ^
is to determines whether a debugger is running on your system (ring0 only).9 W+ o4 S5 z3 e! P& S: l) U4 l
. E# w3 Y( b  S' S, s6 A7 b
   VMMCall Test_Debug_Installed9 Z) V, k5 s4 i# {
   je      not_installed( {& V& y% S5 c* q# u. C
) G1 x( d; z1 H# Y. T8 C
This service just checks a flag.
! j+ }# H7 V% e1 T+ [1 j, M" P+ m</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-8-16 09:23

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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