About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
& ?0 E0 r; R2 D; n) F  F<TBODY>5 |# }  o8 i% I0 @9 P( |% |
<TR>
9 S7 n* P* B; l9 [! U<TD><PRE>Method 01
8 c$ M7 {( ^( [+ d8 F/ O' l1 \=========- S( d- A% o) }  q  Q5 M

3 {& D/ P& m$ g( ^4 O  ?This method of detection of SoftICE (as well as the following one) is# e' Y2 l; [  w$ l
used by the majority of packers/encryptors found on Internet.% x; D$ i  q: y% ?6 M1 H$ u" H
It seeks the signature of BoundsChecker in SoftICE3 \0 v" |$ `' p0 Q3 C
" p7 A2 x& ]4 t
    mov     ebp, 04243484Bh        ; 'BCHK'
* A: D* j, t7 }2 F    mov     ax, 04h
7 C- [4 {7 |0 Y    int     3       ) Q! i: `* e1 B: F: f! q$ D" t
    cmp     al,4
2 U+ C+ d' N) Z    jnz     SoftICE_Detected4 ^, B( [6 I, {  g4 i: H

# y( A4 C- d/ f+ c" v9 S. ^___________________________________________________________________________' t5 l6 o3 K# h" w; h
7 |1 N. E/ W. g# B0 Q
Method 02
1 U2 ^# ?8 Z$ y" ?5 v! [% B: i=========
1 K8 G+ z9 w6 d
! u/ d: D3 ~% I0 sStill a method very much used (perhaps the most frequent one).  It is used6 H4 J  ]3 H. @8 @5 E$ v
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,* f* p5 u9 g6 U* N  o8 C* ]
or execute SoftICE commands...
9 K- P5 Q9 m! W# ^- aIt is also used to crash SoftICE and to force it to execute any commands
6 v" {( _" x/ {! A# i* ^" v" [(HBOOT...) :-((  
% I2 M+ p# ]7 A+ r) k
  X6 C1 [* `) M& W, h8 rHere is a quick description:
8 D  j4 F" k1 M- H' o( |( \-AX = 0910h   (Display string in SIce windows)6 c9 f( m/ A2 A4 y
-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)
6 a. v4 v" f: F' t-AX = 0912h   (Get breakpoint infos)
& J5 \# u/ H* S8 b-AX = 0913h   (Set Sice breakpoints)
2 ~) u6 P6 `  ~7 X2 `$ S- }-AX = 0914h   (Remove SIce breakoints)
9 J& `$ E- u7 A' w3 H; ~' F  A
* g5 U2 ?1 N5 x- e' O( O3 f" yEach time you'll meet this trick, you'll see:
; E5 y3 y8 o! P5 @5 x% e6 i8 X- o2 q-SI = 4647h5 o+ j4 b) I9 u% L( q
-DI = 4A4Dh; A, M3 i/ w* u9 J& A: f% Z* U
Which are the 'magic values' used by SoftIce.
. `. Y$ R/ s/ a! @6 P( \  xFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.2 ^# C/ G8 ~9 d7 U7 p) b& W
7 Q! P0 h! p' \3 z2 f5 T
Here is one example from the file "Haspinst.exe" which is the dongle HASP. ]" q2 C5 t: x: Y1 A$ G+ n
Envelope utility use to protect DOS applications:
, m9 Z% P& q# |) d; @- f  R" d* q# d- `

8 I8 o( d; v; S) L$ s; ?9 x4C19:0095   MOV    AX,0911  ; execute command.; R/ |9 e. a; k4 m! C9 m( a) l
4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
  D6 j3 c+ M6 a) d! V, |4C19:009A   MOV    SI,4647  ; 1st magic value.
+ W: }6 P' {# A, {2 D! S# H2 E! j0 s4C19:009D   MOV    DI,4A4D  ; 2nd magic value.. Q# O  g' h  z$ |' W$ z/ _: E2 c
4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)4 n* J+ h7 |- U2 H# x
4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute+ b- J* g+ ?; Q0 _# Q
4C19:00A4   INC    CX
' \5 e: a! z, n! o0 T5 r+ z4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute
5 F. k; T& }& I( e& p4C19:00A8   JB     0095     ; 6 different commands.
' T+ h0 V  O  b6 u0 x/ g4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
# y, `) H/ I( \* W! j4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)( k3 K2 Y$ D# A# L0 t
0 ]" ^2 q7 |9 W. E  g; O$ D
The program will execute 6 different SIce commands located at ds:dx, which
; E8 D: s# t8 z+ k* m6 j9 a% z5 Yare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
" |" S$ Q; d: {. C* G1 J. S/ k# `' w% n! d9 U9 [! j! C% M
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.- ?' t9 n( w3 t  g- y
___________________________________________________________________________( ]) C) b  I! R$ D: K+ @6 U: U% E

& Y" {  D& ~# t4 I
$ p4 h+ A6 o* I! Z0 UMethod 03  ^) B+ @7 S; s& Q0 n; ~9 A+ R
=========
9 R9 w* o7 D' [, t; A: m2 V9 x2 |/ G) M6 M+ g
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
3 ^. \3 Z/ v+ q9 ~(API Get entry point)) f0 W1 A0 a9 i+ s! R
        - N2 X7 n, g( D& F0 k2 x  F7 h
/ T# T- @# [" J. Z, E
    xor     di,di! L- y7 ^& O" P5 v+ o1 b3 ?# P$ a
    mov     es,di
% M& j. N0 Z1 [; k    mov     ax, 1684h      
- p' ?9 n! ?! n+ z: n2 s0 I' Q3 p    mov     bx, 0202h       ; VxD ID of winice& r" s. ^4 n" U5 I/ N  ]
    int     2Fh
; C2 v2 W# m% X& l2 Q, R+ X. H/ `    mov     ax, es          ; ES:DI -&gt; VxD API entry point1 o# ?( L- S8 K. y$ z( `5 Z
    add     ax, di
- v# q  A: Z% ]+ j  }' y    test    ax,ax+ W$ p: {# t7 B# k
    jnz     SoftICE_Detected2 U+ o$ E5 C& c* A
) `  J+ f. W) q8 v8 i. i" Z. N! V/ q
___________________________________________________________________________% `. `' p0 y* Q! j. e" _
0 W' I2 l) z! ^2 C' Z' i
Method 04
5 C" V2 }. a+ z( @=========
" }# ^- _6 s* S( \% [) k2 q
6 u1 b4 \) q9 YMethod identical to the preceding one except that it seeks the ID of SoftICE
2 J( n4 C8 c) n) N0 uGFX VxD.  E4 ]* |3 z4 S% Q- c8 E
( i$ x/ Z/ A9 S9 c1 K
    xor     di,di! \, e0 a0 G" A) Q
    mov     es,di% y2 u9 G# O, }' m% v
    mov     ax, 1684h       " v. i  p/ _4 D6 _- C& n
    mov     bx, 7a5Fh       ; VxD ID of SIWVID
2 r# r0 ?; O& `, Z8 V; {    int     2fh
& M9 k5 [- W4 b4 e' Y- B% Q    mov     ax, es          ; ES:DI -&gt; VxD API entry point& B" J+ z1 d' `3 Z
    add     ax, di
1 m3 K7 x, {) C/ v, b, Q    test    ax,ax. f; }2 V' {6 A- j. F" Y" P, U" }
    jnz     SoftICE_Detected/ X( q' X8 E! ?* ]* y  L

8 ]) w7 `. |& Z1 a. {9 J__________________________________________________________________________+ u1 @9 S/ b& n) V! u3 j

. Y8 {( R( e9 ~3 c1 Y: P
, P" u3 G8 w* z# c" [( c& }1 B  LMethod 05
( Q* R7 ]" {- W- P& x=========9 h: {- G( i/ P& ~+ [9 f* `

' a3 \% V6 i) [1 N% rMethod seeking the 'magic number' 0F386h returned (in ax) by all system
5 e7 m) @( Q: b$ v# Tdebugger. It calls the int 41h, function 4Fh.
* M/ {! ^6 @" {5 D; ^There are several alternatives.  . C/ O0 a- X) u0 ?0 A* I/ f
5 c, }# V2 x0 H6 ^( {
The following one is the simplest:( ]3 O9 Q3 a) ?

) d* S# B& i9 h    mov     ax,4fh
! n) Q7 j# u2 m; Q    int     41h
6 J5 R8 L: }0 O1 y2 r, ?; B    cmp     ax, 0F3863 T  a1 @) C+ S0 w% ~1 h3 T
    jz      SoftICE_detected  h+ t- C; ~# i" {8 e

; G4 f# C. C" W! D
3 N4 O# s# t; U9 F+ QNext method as well as the following one are 2 examples from Stone's ' \5 ?2 j8 K. d4 W
"stn-wid.zip" (www.cracking.net):3 \2 O# r. N. s! p$ C
  f- Z: p) F5 g% L) q+ h- J
    mov     bx, cs; X3 F- x5 Y- r+ x% y
    lea     dx, int41handler2: K( \" ^: `! N, K5 o3 q
    xchg    dx, es:[41h*4]  v/ u. J5 W+ T) @
    xchg    bx, es:[41h*4+2]
! c4 ~5 \; r. D+ W& B3 a- ]    mov     ax,4fh
6 M3 {# W0 w( O- t% i    int     41h
  A; N6 v% ^6 Z' p    xchg    dx, es:[41h*4]
; U2 k" e2 n- y/ h+ }    xchg    bx, es:[41h*4+2]
- [! F6 c1 X4 E6 w  R- m    cmp     ax, 0f386h) m8 T5 ]- v1 ^3 L$ J0 B5 b
    jz      SoftICE_detected
$ G/ N% p0 t) o% v% N" G* d0 o( h2 e# Q! P
int41handler2 PROC& h7 n, u  z8 C& x. J2 a' R
    iret
, s# n7 |' O1 aint41handler2 ENDP9 F. e$ o0 z' `3 z) e  B

* Q& ]; x6 I- v  Y0 r" G  l* t- m3 A  s2 D$ c
_________________________________________________________________________
5 x9 l" _: t6 H1 F; d/ A! }  k/ s# D) e: S0 l2 v: M/ w
9 F7 ^8 C, M* j9 @/ u( E# n
Method 06) ~. k) n/ I4 c6 v6 W$ z/ F3 u
=========8 w9 R% \5 m- |- w' y7 N
8 n' o- T" Y+ O* ~" |

: y- Q5 V- b' y; N& l+ n( F- s: P2nd method similar to the preceding one but more difficult to detect:) q" w  c3 {; g' {
  i7 |5 D5 E$ l7 `+ E

/ x9 @/ m; J( X8 J) S+ b- cint41handler PROC
0 B: ~& E6 n9 U% W  J! {0 b9 }$ K7 i% L    mov     cl,al- f# {6 L5 P( v/ j& h3 ]7 J0 a
    iret% y5 S7 r4 [: U
int41handler ENDP
  M+ p( J6 A' H0 |' L  g) M) v, T+ O7 r$ C2 c
: T2 Z" b9 R7 [" `; N8 P6 W# \
    xor     ax,ax
6 C5 K% Z- F: h. t1 t. G, U    mov     es,ax- A) u% x* n* N* S, g5 t6 a
    mov     bx, cs3 b0 Q) n+ x2 L  O7 g- D
    lea     dx, int41handler$ A* Y. k( |3 Z# v4 e  S$ ~7 w9 Z
    xchg    dx, es:[41h*4]
' A* g" ]* x8 P+ k* c: Q& i    xchg    bx, es:[41h*4+2]1 L6 K) z; W0 W
    in      al, 40h2 C: H( O, Z! y: @8 I9 {
    xor     cx,cx
- B  g( i- W% V6 b    int     41h( {& j8 k* K$ l$ ?; S
    xchg    dx, es:[41h*4]
0 O" Q; Z; k% r) v    xchg    bx, es:[41h*4+2]
, G7 ~4 M: X' ^& Z5 S    cmp     cl,al
. E8 }8 N" ?3 F7 W* F+ o" T    jnz     SoftICE_detected8 U/ T. {! N, E, ~
4 j# [  F* |8 s# Y* m! |
_________________________________________________________________________
) m% N+ q3 u- I
" j3 T  Y& j, G% ?" s/ {+ k7 ~, [Method 073 M' Z, ^/ I/ x* e6 L8 Z# R
=========
$ J) ~+ d5 ^. N- b  e9 j7 k( S  m' h: U% Q0 N0 d& K5 _
Method of detection of the WinICE handler in the int68h (V86)
# x/ J. I" k7 I# ?+ u
- b- ~# J; o) {: W9 @' o, o    mov     ah,43h: Z7 j" B' Z) d9 w+ s
    int     68h* N: V# O% R/ i- g) ^
    cmp     ax,0F386h
' V1 L5 E( {/ Z    jz      SoftICE_Detected; \4 E2 R6 D' t: R3 I: T8 M
2 K) z/ j. G! p& Y/ C  u5 e
2 H; o# x0 ]5 ]
=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit! W- e  q2 C/ Q3 E: w
   app like this:0 L# r5 k- P. O3 W! }/ h
. ^' a' U* E6 x! t8 a
   BPX exec_int if ax==68
% x  E  b" I% n$ z3 c7 h: _4 a5 D   (function called is located at byte ptr [ebp+1Dh] and client eip is
* d1 F, A( `1 h; i   located at [ebp+48h] for 32Bit apps)" \) u% h3 H+ |8 `( O0 _1 Y
__________________________________________________________________________
9 z( g7 k# q% _8 ^
8 N1 F0 l  f2 a9 G4 F/ Q) {: I/ T
, u) d" ]9 s: [. {" P1 m9 I4 S! XMethod 08
8 m  `/ ?# w' @  z/ c, F0 e=========
. `* h! E% B% X8 G1 @" W7 r
7 M0 X* m  u& T" l) [, GIt is not a method of detection of SoftICE but a possibility to crash the: [9 }) J6 s) c7 V% M1 g
system by intercepting int 01h and int 03h and redirecting them to another$ C; E) M* |" Z+ t# C5 Z' t! {
routine.
. S0 D, u9 G' d" M; S+ ~# fIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points. g+ z/ u; ?" }7 X- X+ k( J; D
to the new routine to execute (hangs computer...)/ p: Q6 k' Y: V, I
; @8 N7 {3 K% `3 o$ h( P
    mov     ah, 25h
- b( l4 s- H2 Z& a( R$ S) Z    mov     al, Int_Number (01h or 03h)
$ ?& ~% B+ ?5 }7 v1 F( G2 T- ^    mov     dx, offset New_Int_Routine
% O. W0 V+ \. h" A1 E: r0 q3 Q    int     21h
& K$ g5 x) a9 A3 J( w7 O7 h$ f6 f! B$ I( p
__________________________________________________________________________, j, r; w' B: K8 @. u

4 T( Y: H) l7 y  ?8 ^6 T" VMethod 095 ]9 @& l; [+ ~& m
=========
/ C4 z  W  P9 Y- Q" z9 s* d- s5 @- D& k; w4 X
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
% e6 l% s3 X, }performed in ring0 (VxD or a ring3 app using the VxdCall).
0 E: ]# Q; ?$ g# u4 qThe Get_DDB service is used to determine whether or not a VxD is installed
! K9 A2 |$ |& ~) s/ E- xfor the specified device and returns a Device Description Block (in ecx) for& J  }# I0 E- o# X: z4 {0 \
that device if it is installed.( K# |2 V; Q' r6 J

0 o9 l' f( L( k1 k1 w   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID
% f6 j: s5 O' _8 s   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)* G6 S  J4 N  @. ]
   VMMCall Get_DDB# A" w1 p. f9 Q( h. M! p
   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed# N! _, e. d# f# \; G
- P/ N! Q; f1 f3 e
Note as well that you can easily detect this method with SoftICE:$ g: i# {" A* a4 B' E% T
   bpx Get_DDB if ax==0202 || ax==7a5fh2 L& C6 u' r7 u1 }: @) `

7 ^( `* y: l- }$ ~__________________________________________________________________________" R, ]6 f$ N) L2 b, I

$ b& V7 f0 D. h( `+ @: UMethod 109 l0 j/ X* X; O+ j- u: e
=========8 [* k, [+ F3 f+ d3 d& Q( o9 }: n& R
0 w* T6 H" z, P$ [% s
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with
. o, D' [" L% g5 M9 c  SoftICE while the option is enable!!6 |' Q0 l3 r1 `

3 ~. f# d' N: h( B, K  sThis trick is very efficient:
/ O' B. V& ^4 k: T: Y& k9 x$ aby checking the Debug Registers, you can detect if SoftICE is loaded  h. {. F+ U: u6 |1 F
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
  I9 ]* n* [* Tthere are some memory breakpoints set (dr0 to dr3) simply by reading their: J4 o8 a" q6 k
value (in ring0 only). Values can be manipulated and or changed as well
0 C1 B8 F  U! L% o+ ~: {- u& e(clearing BPMs for instance). U' V' f% x7 W6 T* s. w2 A1 \
4 F+ a9 X0 ]- X: P  i- }
__________________________________________________________________________
" m+ d$ i# @1 S
5 v- X+ {6 |3 u# o3 f  \, gMethod 11
5 X5 o9 K/ a$ T* y=========1 T: {: E8 W2 N) J

& D6 r( X6 _$ Q" h/ ]This method is most known as 'MeltICE' because it has been freely distributed. `" [  K4 A% ~6 v6 e
via www.winfiles.com. However it was first used by NuMega people to allow  t% l- K3 u$ h  [* k: U
Symbol Loader to check if SoftICE was active or not (the code is located
- a5 ]  p& \" s% G2 Iinside nmtrans.dll).4 O8 ]" {) T" G" F1 Z3 u8 v

+ {# N4 M$ v9 {6 FThe way it works is very simple:
1 y: `3 x) S1 D: m' h4 ?It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for$ t! q% Z% T$ e' b/ j
WinNT) with the CreateFileA API.3 P8 ]* S! s3 C2 g5 R1 G4 K
* i; F+ O( E) w$ [! R6 H* t; P  i
Here is a sample (checking for 'SICE'):- a. o# p0 G' u( U. q' `

- G8 `0 N$ u1 F! r" ?* c+ |BOOL IsSoftIce95Loaded()+ I# X! m  @9 m" }& r! g
{# K! j0 R2 }: d; G& y) n: U. _" ?
   HANDLE hFile;  
, h+ A( J! Y1 W. H   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,; K# g- f8 }9 Y/ _; o
                      FILE_SHARE_READ | FILE_SHARE_WRITE,
" F- y- A1 q! W                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
2 A* t( \/ u; Q; X$ x   if( hFile != INVALID_HANDLE_VALUE )
! d; _9 I) @0 S$ H$ e   {
! M0 j6 z8 ?! Q5 M( i1 W2 O      CloseHandle(hFile);  V$ q+ n% H0 T7 e+ W2 ^2 j3 L
      return TRUE;
1 l1 E' K. q- V. v' t7 x; a7 J$ i% H   }4 t9 A7 x  W' s) X; P1 m
   return FALSE;
3 ~' l$ Q: D; [, E- e}
: t6 L* W' }& Q' H) U2 X6 _5 b0 g* A
Although this trick calls the CreateFileA function, don't even expect to be
# _3 ~' p, w+ c* ]able to intercept it by installing a IFS hook: it will not work, no way!8 s- U3 U5 t  x8 u6 p% n1 C
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
3 N7 y# [/ |  ~# Q6 W* K" Dservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
; t7 ~$ l" |+ K: aand then browse the DDB list until it find the VxD and its DDB_Control_Proc
, p+ @/ }/ i! \+ p* L+ wfield.
* y8 r# r7 n; A. v9 |( C  |- `7 q; s- H0 uIn fact, its purpose is not to load/unload VxDs but only to send a " U4 j' l- P4 D$ L1 C( p. U1 i3 z
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)- X0 ]. Y6 w) |5 X5 Q+ g4 M- e
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
+ v$ g0 t' p  K3 u1 }6 ?to load/unload a non-dynamically loadable driver such as SoftICE ;-).
9 y8 A! m0 D: F: L3 iIf the VxD is loaded, it will always clear eax and the Carry flag to allow5 h: ]' c: l$ Y! J9 g, i6 w/ \
its handle to be opened and then, will be detected.
- V' n2 l4 v/ x5 sYou can check that simply by hooking Winice.exe control proc entry point/ Z2 S- y" }( B' B5 Y4 \
while running MeltICE.! F" }3 N1 c! u
  a- u- I+ k. X" R( Z; ?
% h: y/ W, ~) z+ u( Q6 H8 E& j& @
  00401067:  push      00402025    ; \\.\SICE) v; |( g' ?9 ^* E8 Z9 H
  0040106C:  call      CreateFileA( _, r2 o2 U# I) K" O2 q
  00401071:  cmp       eax,-001
( ^' g* P! a0 |  00401074:  je        00401091
; d8 g/ w! [) f- t  P
& ]0 S! u6 p' b; y: W, c( O/ C9 Q- J7 {9 |8 n: J
There could be hundreds of BPX you could use to detect this trick.
9 A$ U7 F5 l9 N/ x% @' E7 [7 a, g$ t-The most classical one is:+ z/ g' B! Q) i) j2 i
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||, i9 a6 {! L$ x
    *(esp-&gt;4+4)=='NTIC'
* w- U. r0 R; X5 G' F+ D  k- _  `8 Z, c1 T% Z# P" W
-The most exotic ones (could be very slooooow :-(( Y  O& f* f0 I+ ~: }+ `
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  
) h! \4 r6 E' F$ o0 w8 v     ;will break 3 times :-(
! p3 D2 P! ~8 A0 I- b8 }4 m. @; T( I9 M6 B1 w
-or (a bit) faster:
+ v; h0 q/ U* o   BPINT 30 if (*edi=='SICE' || *edi=='SIWV'). ^$ @7 @  l) `
% t. B; u: I" f. C- ]8 V
   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  
0 Z  C. ^4 F$ g' u, G9 P% m     ;will break 3 times :-(
1 q$ S9 ~6 v% _! X: D% k7 h, }' |4 y* K) R" |# G- {
-Much faster:* \5 W' G" R+ t( ]9 v8 E+ |5 x+ V
   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'. b0 J9 y$ A7 R' _
2 p/ l; k6 N. N$ y6 x5 x- j
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen+ _. b# T3 ^4 w7 G  ~% w' h0 _
function to do the same job:
% p6 X# ~' k. l" P3 ?' e4 [: v
8 z7 ?7 m, q! S# G% [) r  I- [9 F   push    00                        ; OF_READ
% B1 n: L) p8 @* {6 Q" T7 j  d$ O  ?1 Y   mov     eax,[00656634]            ; '\\.\SICE',0
! }' e$ [2 i1 K+ ~0 u" S' M   push    eax
) s1 K  F9 k9 E. }! x0 ^8 m# i   call    KERNEL32!_lopen1 d: g* p. d& ]: Z: l
   inc     eax3 ^" `. m, {" Y9 P  e" j
   jnz     00650589                  ; detected6 F3 q' M4 P5 W! G
   push    00                        ; OF_READ
1 |' x3 d3 M. T& Z6 E  @+ F   mov     eax,[00656638]            ; '\\.\SICE'
) L3 t# e6 I2 X" i+ D) g% V' h   push    eax# e$ L. p3 ^% X! b
   call    KERNEL32!_lopen4 a4 o! w+ M  q$ Y2 k
   inc     eax
$ {8 T3 s2 x( F   jz      006505ae                  ; not detected
6 s) }; C1 o" E
+ L" N+ A6 v3 b, H5 c' ~' g- w" o7 I0 F9 G5 q- Y2 P
__________________________________________________________________________
+ P2 {6 p3 p$ r6 f+ I, v! ~5 {9 G% o  W* k& j
Method 129 p9 F/ O$ @! j6 _  _5 y) g$ n
=========
$ p- l, W& j3 O5 g2 O
# e, z+ H. \% q8 y; P. Y$ DThis trick is similar to int41h/4fh Debugger installation check (code 05
3 \3 [- K) \" x4 `! E' F. Y' z&amp; 06) but very limited because it's only available for Win95/98 (not NT)
# c/ c- M6 d: p, ~# f4 e. Cas it uses the VxDCall backdoor. This detection was found in Bleem Demo.9 a  H" q& ]3 R( w

; J2 n7 U+ `3 x1 K" x+ Y   push  0000004fh         ; function 4fh
) Y4 i5 S4 ~6 T+ y0 H) S3 Q   push  002a002ah         ; high word specifies which VxD (VWIN32)
2 V  E: N. i; F& X" y! @" r% c                           ; low word specifies which service5 ^' Z% |/ u' B! e; [$ c
                             (VWIN32_Int41Dispatch)
$ q2 ^, H4 b, C9 `   call  Kernel32!ORD_001  ; VxdCall
1 J4 T, O* H/ e   cmp   ax, 0f386h        ; magic number returned by system debuggers) A) h# L* k: I. N
   jz    SoftICE_detected
0 D# n' H& l4 Q/ p& t2 W
2 U3 c# M7 @& O; J4 ]; i) hHere again, several ways to detect it:
7 D( D5 P; C$ _0 u* t$ K& ~/ d, Y, k; J; ^7 c9 u6 E
    BPINT 41 if ax==4f( {6 V& M0 u: T. H
3 p: B  ^; d6 x6 [9 G# I" ^7 A3 B
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one2 n! A$ T4 ?9 [: s* Y9 O6 b/ _5 [: Z1 N
' ~: a  |2 m  Z
    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A, u/ D" }. A- m2 s
. `! v  X3 F8 w& R* p' h* e7 p1 Q- l3 y# X
    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!/ Y/ P: t6 X1 P

2 v+ I9 O, z) m# o1 C__________________________________________________________________________& d+ C, {4 f6 `

6 w" K6 ~; m7 _3 PMethod 13
  A  L9 b6 N) v5 E2 ^4 [( [=========6 D5 L% [; r/ |. I, w$ T
! U3 X" a' b: U' T4 L; J
Not a real method of detection, but a good way to know if SoftICE is8 ]3 U4 A, _0 ?" I2 J
installed on a computer and to locate its installation directory.+ P9 T0 V- ^; a+ Z2 j
It is used by few softs which access the following registry keys (usually #2) :0 I# {% U+ t2 c

. o7 t" N+ B3 g1 Z+ v* K9 S-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion0 p; e) Z+ t+ P$ ?7 f" b; W# g
\Uninstall\SoftICE
/ u& C' _3 h9 ^7 n-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE. e- _) p4 C8 i, F2 k5 A. T4 E
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
0 T( a1 h% r2 j! @9 `/ @\App Paths\Loader32.Exe- F6 z+ ]( P- b- A. d

; V0 K9 J/ K+ p8 e$ h( f
1 `" h# L0 j* U3 E+ Z6 D  CNote that some nasty apps could then erase all files from SoftICE directory
9 s, A8 K) Y1 N% n/ k' r(I faced that once :-(/ A' G; V( i' v; O
/ f0 y' h8 G6 C& z" R" @8 t; y
Useful breakpoint to detect it:2 L0 ^; R4 X6 k( U0 b' o- [

0 O' |- O$ E( u7 B     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'1 ^. W6 t) t6 x; D0 ?

* e$ r  A* Z8 u__________________________________________________________________________+ Q2 g4 [2 y+ t8 j/ a$ s% ?1 R7 }
# C2 I2 g  l/ ]6 q2 [  d

# h' `2 n8 m9 s, EMethod 14
7 m5 A' P+ T0 l5 ]% T=========
: {+ J5 k2 ^9 ~9 L: F1 a% J
4 |: v" W' z) Z8 v+ a1 {7 pA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose- N( n) y$ G$ K
is to determines whether a debugger is running on your system (ring0 only).
/ u+ w# n% m) y, L# R
% O' B$ c  G/ W% C! Z   VMMCall Test_Debug_Installed
0 R2 a7 ~+ w4 e' v$ N* m% `- P   je      not_installed$ H( `9 E- C- H9 l4 e

" n" I& y5 W. MThis service just checks a flag.# ~8 ]3 I1 H. @. H
</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关注公众号

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

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

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