找回密码
 注册

QQ登录

只需一步,快速开始

About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>9 y3 F# k3 E# j1 j# E: y6 k
<TBODY>! q0 I7 W9 C0 K7 V! @$ x, G5 s
<TR>
6 `* \% [+ U) |- l( K# Y<TD><PRE>Method 01
+ H( r4 ]) ]. u3 `=========
' P% ~- e' ~  f+ N/ w) H. k5 r. j! S& x- f! D+ W3 d& W6 L6 h5 D
This method of detection of SoftICE (as well as the following one) is$ R) j" q+ M% M# x
used by the majority of packers/encryptors found on Internet.
4 Z2 f# [, I* X' Y: tIt seeks the signature of BoundsChecker in SoftICE' R2 E( |+ o) i  j+ s
4 o4 T4 O" D# M. A; s
    mov     ebp, 04243484Bh        ; 'BCHK'6 h( u& P* W. V
    mov     ax, 04h  L) {- J7 K# u
    int     3       % ?9 y" ^5 t  n' k
    cmp     al,43 X) q; d5 }/ g3 U
    jnz     SoftICE_Detected
5 `* z# u: B( w) ?* t5 o
% q- d# U' k% {3 D___________________________________________________________________________
5 Y; _# V- c% |; y1 `. W8 `/ z7 x( u
2 T" v$ Z5 }; k" U8 {2 B, \Method 02* m2 G. C/ C6 X1 g# K  i
=========- l: a6 @8 Q: Z5 r3 g: o. o2 i

! d0 q4 w2 @! K: m1 A) {. G3 ^$ ^  \Still a method very much used (perhaps the most frequent one).  It is used
+ @6 j  m- v5 Hto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
% b# G5 u, k9 H6 ~7 a  r' |; Vor execute SoftICE commands..., q, V  [& Y2 s: t. i
It is also used to crash SoftICE and to force it to execute any commands
6 Y6 t+ R1 P0 O(HBOOT...) :-((    Q+ E% S* S/ D5 t1 \& `+ L

* @$ p9 n/ P  W8 a2 j  GHere is a quick description:" X( _9 H5 T# o( q& J. V& H5 Z
-AX = 0910h   (Display string in SIce windows)/ Z; F2 q. z5 H; X5 N
-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)$ g8 D. c& C/ u6 {" K, p
-AX = 0912h   (Get breakpoint infos)- Y3 ~5 |+ B! H4 H4 D
-AX = 0913h   (Set Sice breakpoints)
; f% y) j3 @3 }8 n8 h$ S; J/ a" G' Y-AX = 0914h   (Remove SIce breakoints)
( \1 S7 m6 q: ?
- G5 T- G3 T7 ]3 r3 w! jEach time you'll meet this trick, you'll see:
1 m% m& z8 L2 _! r% ~! B-SI = 4647h
0 D& {' J' e) Z. F4 x9 S-DI = 4A4Dh
5 r- r# y2 h( EWhich are the 'magic values' used by SoftIce.$ j) l$ x( Y: q. k3 J6 p
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
, v+ _! D, V+ ^+ y& w
4 s  `# V0 }* U' d' QHere is one example from the file "Haspinst.exe" which is the dongle HASP' C  ?" C( u+ j5 W5 E6 N. o
Envelope utility use to protect DOS applications:
+ [9 R/ V( L. ?& F& T  a/ d- P9 Y: `

3 H! d* U! }& q' t0 g9 B5 D4C19:0095   MOV    AX,0911  ; execute command.$ U* V0 h# x: }: v! L1 W1 q* V
4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
7 P7 |/ y! y# j# L. d: H4C19:009A   MOV    SI,4647  ; 1st magic value.
/ O& n7 L  c1 [  Q- c0 Y: V- f4C19:009D   MOV    DI,4A4D  ; 2nd magic value.
0 O9 ^" m8 ]$ E( ]* K! m4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
# P4 x! ]0 Q0 K# ^4 x6 c4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute# Z  Z# W2 g, j
4C19:00A4   INC    CX
: D7 M' H) A5 q; M$ z" z4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute4 V% N; M3 T$ T+ a4 L9 p( L
4C19:00A8   JB     0095     ; 6 different commands.
( l7 [8 ?) [. w: d' B5 C4C19:00AA   JMP    0002     ; Bad_Guy jmp back.' X3 ^3 i  W9 _6 S( t3 e% L- s) h
4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)) ^+ I5 }7 I  [( `' A# D

% L" B$ n2 q4 ~The program will execute 6 different SIce commands located at ds:dx, which( v) D3 b5 \( k  f
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
# n% X! M0 @7 j5 f. Z/ l% F9 I0 I) C" R) l; m4 q6 a
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.- H; a0 h: m! O5 P( `
___________________________________________________________________________: c2 }% m$ e2 `: q+ ^1 X3 ?
. K# p; y- r. {

$ N; j4 S  n; m% s- m4 l! CMethod 037 f1 T6 R. j' \* C5 t% h) h
=========
3 N1 H7 Q: @- e/ P6 e7 J4 f* A6 s- H( y8 G$ m  c' G' G9 I! z  z5 [1 ]
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h' ~* ?! X: ^) D8 O
(API Get entry point)
" ~# |! G0 j# ~; f. ~        + d" G0 J0 K/ y. m

8 K  F: X) ]# T$ E, [" v6 H    xor     di,di
% J# n# V5 C) N1 l8 u# H7 J    mov     es,di
0 R( W0 W/ g& B6 |" U& L    mov     ax, 1684h         M3 k0 {& }" v: |# [- w
    mov     bx, 0202h       ; VxD ID of winice
6 |3 E! S; T' M. r  e    int     2Fh$ H+ f8 b& v) s) Z$ w
    mov     ax, es          ; ES:DI -&gt; VxD API entry point
9 G. P" k- Y" b    add     ax, di/ _6 L- h, ^! P
    test    ax,ax! Z" @8 @* a- c0 F
    jnz     SoftICE_Detected
4 `6 ^3 x0 _: ]( {
: c6 b( G5 H/ Q- \* b: |___________________________________________________________________________" ?2 i. I5 M0 O) c
4 b5 I0 u4 Q7 H; v/ Z2 v6 ^2 o
Method 04
& V) _8 Y, q5 U! g3 P, ~( k=========; `) t; q/ c7 [  b! B

6 n4 k4 J! G* u, |7 |# DMethod identical to the preceding one except that it seeks the ID of SoftICE0 ^) \( ~$ r' q" F' v
GFX VxD.
# \7 s/ R" K, V" @1 J" v' G
' w& [/ Y$ M9 Q: k7 Q4 \  V    xor     di,di6 ~. a7 c) |, m; C' z/ Q# ~
    mov     es,di; o  t: k& v, R' {
    mov     ax, 1684h       $ T1 [1 r* x' Q# R: T, |; P
    mov     bx, 7a5Fh       ; VxD ID of SIWVID8 ]% w# S+ {8 A5 b. j: g
    int     2fh6 ^' e* Q$ a5 X* D8 o
    mov     ax, es          ; ES:DI -&gt; VxD API entry point
# S$ W8 x. C- S7 D# Y4 C* c    add     ax, di
# r! O$ \4 Q8 c+ Y+ l5 P+ V# G    test    ax,ax5 w9 [. T+ `6 i6 y! {# o, p, E5 T
    jnz     SoftICE_Detected+ I: c- l' |, S4 h
9 l; b$ U, Q- K( K* {$ {
__________________________________________________________________________
- l2 k. d9 d5 S- j4 \' P; n7 |, A, `  @1 V) x1 Q
! l3 ~% {; @' _" ]
Method 05
- y: {/ d) ?6 ?8 s) |" O) L( l- F' R=========  u7 D( \7 g4 l8 K) z7 M" P

+ s. x2 U- G% k% T; M9 g6 M% oMethod seeking the 'magic number' 0F386h returned (in ax) by all system
# I$ Q) u* e$ Q; T+ g0 K, d4 Tdebugger. It calls the int 41h, function 4Fh.
, s9 k8 v! K% B3 `% K/ rThere are several alternatives.  
! ~- W+ a* w  g' M/ C- w( v
6 L# k9 h# A3 {6 J3 U7 }4 XThe following one is the simplest:
$ T  h& x# L% M7 h
" p/ y1 u0 ]- ~# v  r$ W" c$ B    mov     ax,4fh( ?& R# K3 v; Y6 B# ?
    int     41h
: s* j" v4 ^" U3 b0 F7 _    cmp     ax, 0F3861 ?5 t$ Z% L& Z
    jz      SoftICE_detected
7 v% R. W' i& x& K% [
! q+ M6 u' a- a# E4 K. r4 P5 H
6 @: O' e3 c9 ^Next method as well as the following one are 2 examples from Stone's 1 f, x+ ]2 Z5 R. M  h6 L. v
"stn-wid.zip" (www.cracking.net):3 T. l0 F, y4 f6 {: c

' x3 g4 j- F5 k( I3 [    mov     bx, cs& j. o9 z. E' V4 `  U' Q9 v2 A  y
    lea     dx, int41handler2. W: T$ h9 g# x0 n- D
    xchg    dx, es:[41h*4]
3 w; K, \/ R2 R& H5 d+ p  F    xchg    bx, es:[41h*4+2]+ ^; B/ p9 ~4 m6 I
    mov     ax,4fh
$ |) j1 `& }6 _, P- p: W    int     41h# h% P! z# o7 [/ W' l! f) N3 |
    xchg    dx, es:[41h*4]
4 |2 d* Q: f4 G2 e" S% Y    xchg    bx, es:[41h*4+2]1 T: ]. i- q* F( @8 B
    cmp     ax, 0f386h
: P# [% X2 u" C8 F    jz      SoftICE_detected1 I2 o7 j1 q1 k0 ?+ u0 [9 t. ^; r

7 B6 S7 I7 m5 Nint41handler2 PROC& `( L7 I( S% E) W: B' ?1 v# V
    iret5 A  R  T* j! i  w
int41handler2 ENDP
8 E: R% _; |0 U8 ]) F
9 _! o5 x3 ^( P6 l; p, w. G; O! ~, z& W7 J9 ^) J
_________________________________________________________________________
$ B+ z$ q7 G0 I2 {# j& O8 Q! u3 {7 K  D2 _5 w/ z- H; x' V0 _" j
- C5 R+ a& r  d9 d+ D0 x7 y
Method 068 {1 a/ d& y9 j
=========
/ X5 D/ @$ H8 w: t# I3 E& }4 B8 Z! O& m& q$ J& J

: V9 H5 a& T4 [* |( f2nd method similar to the preceding one but more difficult to detect:
, S" j# `8 f  M' s/ R' j4 z4 Z+ f/ A/ r! ~9 r9 k
5 a) {( v9 ?+ r+ r5 M
int41handler PROC
6 `7 V2 I! R. s# u0 l- G6 r    mov     cl,al
# F. A: S8 b3 s    iret4 r; I" j* y( Q; ^# N4 Z" v
int41handler ENDP
* M/ g+ C1 h/ o2 r. ?
+ S+ |! F& ?& N3 ^6 j7 X0 L5 k( y4 v& @& H
    xor     ax,ax7 E1 P% g' k! ~( d2 O9 R5 U
    mov     es,ax$ O. }  t9 s" `
    mov     bx, cs
4 |5 E! c+ U7 W6 o4 h    lea     dx, int41handler" f. w1 X" ^5 a4 H8 t- ~' D! ]
    xchg    dx, es:[41h*4]
: Z2 ?0 O+ n; z/ N! z9 ?! _0 |- u    xchg    bx, es:[41h*4+2]. U7 P$ f" e& \: H- U0 m
    in      al, 40h
2 J+ n# v. w$ p6 E8 k0 V    xor     cx,cx
3 M9 n" h- r3 U/ J    int     41h8 z$ m; H" n% \( y: _5 x! Z
    xchg    dx, es:[41h*4]0 t+ Y3 r' o2 I! J" e
    xchg    bx, es:[41h*4+2]
/ }- L8 |  \6 _- t/ I    cmp     cl,al' r$ U$ ]# @' @% l7 Y; \
    jnz     SoftICE_detected
& n; c2 U( {2 b$ Q: u+ L' p8 _* o( y5 Y$ G- L
_________________________________________________________________________
1 H! {  Q) b5 @6 K) h1 L* q% X, S
Method 07% M6 C" t' k  x* _+ n( j- L/ S3 R
=========
) J" C3 U( ]! i& F" I; `. b3 V. }2 q& `, }9 _2 a2 }; c; v! Q) k
Method of detection of the WinICE handler in the int68h (V86)  ]8 Y" P* T% Q8 W$ N! F8 h

9 @8 O# V! D9 Z/ w/ q# d    mov     ah,43h; ~) k6 G$ j2 L! \
    int     68h
* G3 |( i  {7 r    cmp     ax,0F386h
2 E/ M7 b" k) c5 ^    jz      SoftICE_Detected$ A. ?  n6 k. c0 B
/ ]2 X: p0 a  x  n7 N& @1 z
5 q- b& v8 b1 T  g
=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
% i4 A* P# v. h  U/ b" M   app like this:8 c* A$ L4 C4 F% h, X7 u
8 Y& a  ]9 Z  r
   BPX exec_int if ax==68
+ m! f+ g: L$ e9 z   (function called is located at byte ptr [ebp+1Dh] and client eip is
( z6 V& }& p2 S7 D5 Y   located at [ebp+48h] for 32Bit apps)
& a8 W: P/ Y0 b: O3 M  l__________________________________________________________________________
  a2 r% a; Z6 B
/ r' P' {" Q6 S1 j! {1 z7 o3 ], v! B( f4 u* `
Method 08
4 ^- C9 B, g) p% V) t0 o=========
- |3 b% [; i4 p3 f1 f. k: i1 p; R- F9 x  x; f4 J
It is not a method of detection of SoftICE but a possibility to crash the; ^1 W' a/ }6 s# ^5 r! M* D
system by intercepting int 01h and int 03h and redirecting them to another4 g7 j, J0 g% c3 e& g
routine.
4 i. Q/ c4 n) h% O+ l* x$ h, h0 zIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
8 k: ^- T- a: ~! d* [) O' vto the new routine to execute (hangs computer...)
. G% k8 C2 [; @5 a; J; {+ [: ]1 j3 F) @
    mov     ah, 25h5 _$ e5 t" q9 f- l
    mov     al, Int_Number (01h or 03h)
2 \0 q- m" ?/ \  B! s    mov     dx, offset New_Int_Routine/ F5 s4 U( p6 }9 j4 q
    int     21h  p# x5 o% ~; w7 e: i/ @3 [2 w

, E4 G! j: C4 G9 E5 h__________________________________________________________________________
. C5 [! }3 f* X; ?' ~9 l* H6 D) Y
0 i: @* R$ b" @Method 09
! T- N. F0 o9 w6 i( ^=========
4 G. A2 B% S: V& Q% C0 o( @' F, l# E
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
  J2 Z9 u% r- D* g, P* Iperformed in ring0 (VxD or a ring3 app using the VxdCall).; P* a  J& P7 ]! G. J/ C7 e
The Get_DDB service is used to determine whether or not a VxD is installed3 E2 J8 S  k" |. v6 y  j" G
for the specified device and returns a Device Description Block (in ecx) for
, x' @0 x) ^2 s9 R: ]" h0 Rthat device if it is installed.  D0 ^0 [& F, O/ D+ ?8 v7 S. s

5 p0 e, q! z9 J2 ^' n   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID
( b  A( t7 D, d" I* A1 R2 P% m2 \   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-); }5 [# Y, b4 p; W, \" N2 v
   VMMCall Get_DDB' _( A3 H8 Z5 f
   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed
$ m* v3 e6 f8 B! |/ ~4 E2 @3 \& j0 _5 W# F  J. C$ c1 L) O9 T
Note as well that you can easily detect this method with SoftICE:
' Z  {& r0 f# X6 y, y1 c3 X9 l   bpx Get_DDB if ax==0202 || ax==7a5fh+ H- i* q/ r: i% p* `
2 K' Q! z: M8 y
__________________________________________________________________________& h% j0 U1 I6 j* A. x+ p' s5 v

% ^  t, b. A! i" Y3 A1 W. {: |Method 106 g: m$ U* O, O: B6 e1 S7 V
=========8 ~& w' n' z5 o( X( j7 _
' |3 _1 B1 r3 t& K2 W
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with
9 M& i: V- q) a. v9 ?; |& H  SoftICE while the option is enable!!- a1 n3 |3 O* G5 V2 B3 b1 K/ B7 s

0 R* z" e! y! Z" ?; l; q: |This trick is very efficient:( n/ F) Z# w. u: Q
by checking the Debug Registers, you can detect if SoftICE is loaded
4 x; z% Y: d. E9 q. O6 n4 D. r/ J(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if" h( d/ [+ A  O7 U9 ^0 ]5 D
there are some memory breakpoints set (dr0 to dr3) simply by reading their
! D; C* ~% }! M% o; \value (in ring0 only). Values can be manipulated and or changed as well$ D+ A! F& K) h/ K0 z; ]8 P$ ~
(clearing BPMs for instance)/ n1 E3 G9 Z% F& a
2 S: L3 s5 t8 ^" ~
__________________________________________________________________________
6 K- R6 t/ s/ ^" y9 k; ]+ p- q0 V3 C6 f5 a
Method 11* X3 I7 }- f; l) S" C( P
=========6 }5 \9 A# K4 a( o3 b8 j
) V6 a/ l% _* [0 o5 x+ A) a
This method is most known as 'MeltICE' because it has been freely distributed
+ Q3 m% X* \' uvia www.winfiles.com. However it was first used by NuMega people to allow, n4 }6 T( W" N: ?( t3 o
Symbol Loader to check if SoftICE was active or not (the code is located% i9 S  `5 H& ^$ b4 r
inside nmtrans.dll).
# j9 X% e' k3 W. O' Y" j7 ?7 p8 ]2 u+ z3 P# y9 j5 o1 P& j
The way it works is very simple:
  n+ h+ H  N# ^4 [0 H+ L5 aIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
6 d- C3 M1 p0 e+ [% r) W1 FWinNT) with the CreateFileA API.
# x1 ~% F) p+ F: w& o
/ V6 w: W7 j' X: k( i: ]) J+ {Here is a sample (checking for 'SICE'):# }7 r! t3 Y* S! w5 `+ }6 v

, d5 _1 g/ r1 }- U! mBOOL IsSoftIce95Loaded()  L3 w7 w) w  T" P: V6 f
{
0 b) ~7 z4 ^$ J" \# c$ p0 x   HANDLE hFile;  - f7 v' p- }- n
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,. \8 K4 S6 O  X8 p( y* t( y
                      FILE_SHARE_READ | FILE_SHARE_WRITE,8 O4 W1 @6 T2 K( }6 g
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
) K* ]% Q; G7 c$ b  D   if( hFile != INVALID_HANDLE_VALUE )
3 a# p4 j4 r+ ]( U: S6 p4 F" ^   {6 b. O8 d& u! }* D- J
      CloseHandle(hFile);
$ ]- w, K- w6 I* y/ i$ I      return TRUE;6 Y2 K  u7 A3 n0 V; s
   }! D: Q7 r% R. ]( @. x# G+ H: b
   return FALSE;
1 a7 _$ C" a* v# {, ?' o9 d' Z}
) ]3 l, O+ ~) C8 G* Q/ p5 _7 q! z& V- C. l
Although this trick calls the CreateFileA function, don't even expect to be( T; C. f1 y- I9 ~# t
able to intercept it by installing a IFS hook: it will not work, no way!
! ~  v2 J! F* q$ i: R% x& T* U& i1 P: BIn fact, after the call to CreateFileA it will get through VWIN32 0x001F( U4 L" @0 @) u9 K
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)+ G! H7 B% T2 S5 n0 n
and then browse the DDB list until it find the VxD and its DDB_Control_Proc* m4 [. {3 J$ a8 m8 B+ u
field.* Q7 d" W# Y; G& ^1 H8 n4 ^) P
In fact, its purpose is not to load/unload VxDs but only to send a
, S, e5 F3 C% K9 x- \9 d% yW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE). I! F# A0 w3 D9 V% k7 {
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
5 `- w( u2 Q  P/ M0 Z, t2 s( eto load/unload a non-dynamically loadable driver such as SoftICE ;-).
& D5 f0 G# ^9 Z. }: K$ ?1 }If the VxD is loaded, it will always clear eax and the Carry flag to allow
$ G, ^" Q9 s# g' h4 Mits handle to be opened and then, will be detected., Q" v3 P: m, Y4 ^: K
You can check that simply by hooking Winice.exe control proc entry point
. W5 _- I: Z( \0 k5 Kwhile running MeltICE.! r2 V2 N) i) V4 i. Y
9 T, V4 H2 B/ T8 J: v" |; ~+ n

: e* I0 q" b1 {$ R7 S  00401067:  push      00402025    ; \\.\SICE6 E- _7 F) e, p% T- h
  0040106C:  call      CreateFileA
  t0 E$ v) f1 _* J0 G  00401071:  cmp       eax,-001
  `$ j& m* k# j4 A6 ~( }$ l  00401074:  je        00401091: J$ H% f5 [$ ?6 u" O5 H

0 ]5 I3 F/ @5 p3 w  G* e9 l3 o# t+ c$ k
There could be hundreds of BPX you could use to detect this trick.! y' a* Q0 b2 W1 `
-The most classical one is:1 Y: ]7 G) }* Q! F/ N
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
  i( U. ?' o1 t4 s# _( w& W    *(esp-&gt;4+4)=='NTIC'+ W/ Z; O% M$ T; k
1 K/ k6 \2 N, O
-The most exotic ones (could be very slooooow :-(
$ G$ l) ?( B) J1 U) {. o; A5 |; k+ M   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  # T' w/ o4 k& z: R& K% N
     ;will break 3 times :-(
6 _: O+ y6 }% w' ^# ]5 Y0 l
- m) V! }* D+ d-or (a bit) faster:   j1 w$ m' J+ g2 M& G5 n
   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
: {, b. \2 c6 x$ [% Y: E
: O' C0 V, S, b7 h7 B' k( P, M   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  
- [0 ?/ Q, x8 G8 U! O     ;will break 3 times :-(
$ N! d7 q: b$ b! x* n) f' Q/ h# ~/ p6 ]2 i- h  x5 a- W
-Much faster:: A' Q9 l9 Q; I! M$ c' ^; ~
   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV', K' p. c; j$ a% r& R" o, E
' s0 k6 Q" y1 @  n$ U
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
/ r3 S3 Q: M% d! t  n; gfunction to do the same job:" _) t" F% X4 R. \$ l" S

1 y3 ?( H( t+ q, h+ B* ]   push    00                        ; OF_READ: j* h: K# \' `- Q$ K- B
   mov     eax,[00656634]            ; '\\.\SICE',0
* r' ?- S( ]" N! Y. p   push    eax
8 y, C# h7 ^5 Q! |4 m7 L& y) L6 p   call    KERNEL32!_lopen9 \: ~1 W( x/ V- |+ ]9 R! i
   inc     eax+ V$ z& D, x3 B/ ^5 Y( ?! S* ~
   jnz     00650589                  ; detected0 O/ ], Z9 g" g
   push    00                        ; OF_READ9 O5 v1 A" v" d* B5 ^1 c) P
   mov     eax,[00656638]            ; '\\.\SICE'
/ [2 K. r. E1 g  x+ O( }3 L5 i   push    eax
( G, h! a$ c3 g% l( ~   call    KERNEL32!_lopen; Y+ K+ \) f: w8 y
   inc     eax
' O! @' u8 s# |8 w6 R   jz      006505ae                  ; not detected7 L, O* D1 `$ ~, o3 b( @' ]

. u0 @0 H; Z; y; M2 l% z$ c" @; I3 f# I/ I; k0 ]
__________________________________________________________________________
2 n( Q( E2 h4 F: Z$ K8 |! f3 m0 @6 e" O
Method 12
( q+ [# v9 ^  L0 ]7 Y  n- Y=========
/ H9 m7 A: @$ x# o; U9 f
; B* l+ Y& F) d$ e" jThis trick is similar to int41h/4fh Debugger installation check (code 057 `; n9 E% z. g! H6 u) I7 f
&amp; 06) but very limited because it's only available for Win95/98 (not NT)( ^3 Y' r* _* K" `8 V* I
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
5 I( `; E; \& c0 U) K. _" Z. o1 H
   push  0000004fh         ; function 4fh; m8 o1 p6 ]5 c
   push  002a002ah         ; high word specifies which VxD (VWIN32)
4 s' Z; Q! E1 L2 f0 V                           ; low word specifies which service
% E- j# s' j# j                             (VWIN32_Int41Dispatch)( z+ L3 }; Y! r- D: Q/ @; C
   call  Kernel32!ORD_001  ; VxdCall
! ]6 Q5 G8 z% e" }6 ]4 O   cmp   ax, 0f386h        ; magic number returned by system debuggers& O: r' |4 W" w+ `' S
   jz    SoftICE_detected3 X; L" x' j! A6 ~% v# z

& @7 F7 g& `  j/ E1 gHere again, several ways to detect it:0 L, n& C1 k: L" Z1 L  R

  @% S5 @, g! \% P) H6 k    BPINT 41 if ax==4f6 n# \* a6 f' E3 K+ }
0 K2 G! y0 b( _* Z9 @9 i5 k. ^, k2 q$ z
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one
+ }/ {  d; O& R8 N. W2 h& ]+ g' b- O3 p" ?) m7 G0 `* A1 N
    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A+ L+ c, b* i9 T+ E
# v8 h' }% S$ K; _# @6 ~% K2 V
    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!
& L+ P% m- Y, }: n, |1 b, q$ a
% v5 B" S9 q2 k7 ?5 z/ j__________________________________________________________________________  c( j2 P# ^3 A. p+ ~. \
/ v) {/ G! s; f. ?+ z( A
Method 13- q# i3 S9 y% d4 z# }2 K
=========
! [0 j+ N8 H6 c
" B* c# `7 y. r4 D( x9 ~3 @Not a real method of detection, but a good way to know if SoftICE is  ?8 q( ^3 o: n  d% ?* l
installed on a computer and to locate its installation directory.
" d) Y) b; v; i  aIt is used by few softs which access the following registry keys (usually #2) :/ f- c% S6 f% c( @/ ?

/ e2 W* X3 C1 r, c-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion8 {, ?6 R5 {. r5 L: D. f
\Uninstall\SoftICE$ E* y2 `" q8 W0 e" k) U5 b6 V
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE1 J4 m  o! K* \, n& r
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion0 {4 \& D- u( i$ u4 E2 k$ Y" x
\App Paths\Loader32.Exe
& v9 f" ?! R: Q2 t! k
# D+ x; f$ I7 t, C( `
6 A; v5 @; j. `6 x1 Q0 I0 LNote that some nasty apps could then erase all files from SoftICE directory% ~) d0 s$ x3 \9 e
(I faced that once :-(
* z0 f6 S. j- e1 h+ C/ Y" u: s: o, a+ r" s
Useful breakpoint to detect it:
3 P) B: z# T& A" V4 S3 a0 R! y8 q- \0 Y; U
     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
0 S) c# O2 j/ A0 g' l! a5 c/ X' k2 e$ p2 f0 f  W" j
__________________________________________________________________________7 D% X9 O9 ?% o/ U- F# \2 h, T
- N" p4 }( S$ q
0 h* z+ z- V- E
Method 14 8 @5 C- g  P8 q3 L& T
=========
" w3 J9 q2 t4 f- S( E- K. f7 Q3 ?
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
$ O! M. L! c% Gis to determines whether a debugger is running on your system (ring0 only).0 o: }+ C6 L( o* X% T2 p+ m' x
# Q: S2 D  h9 ?, O% E1 P
   VMMCall Test_Debug_Installed# R7 A, m( O, v0 c9 Q+ \' G: `
   je      not_installed: X% }, I. }7 `: W- Z: j/ x) y4 q: v

6 t6 n- w8 Z- ~6 r& M: ^' B+ K4 _This service just checks a flag.0 e6 z3 n: Q9 l8 Q$ Q
</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-7-28 18:15

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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