About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>0 u+ ^2 ?/ E. A# T; s! l6 U
<TBODY>* l" x7 q5 @- L/ [
<TR>
5 g+ h; R3 @2 o<TD><PRE>Method 01 & i7 r1 V2 d* F' R( h
=========
6 c$ z; R) Y. }  x: {# h3 |0 S5 k- N) l# L8 w  T0 ?3 z8 u# V
This method of detection of SoftICE (as well as the following one) is
/ o! Q, J2 J* pused by the majority of packers/encryptors found on Internet.# I" m! n: g. G! I( k/ O
It seeks the signature of BoundsChecker in SoftICE+ H  Y# P; p4 P4 l8 n

5 C* w9 u- l4 {! O8 j% V    mov     ebp, 04243484Bh        ; 'BCHK'
+ t2 V2 _1 B# B4 R    mov     ax, 04h7 z/ J5 [/ E. G; c
    int     3      
: e; }/ t) g) _) ~5 x    cmp     al,48 A& v; I0 }# L9 I+ V. E
    jnz     SoftICE_Detected
9 L/ F8 }. K/ R9 K" `& Z* ~) v2 i+ k/ @0 Z
___________________________________________________________________________
+ I+ E9 z, v' I  _: l! D2 q3 D0 |
5 Q) g7 C% T% z. v% wMethod 02' g+ }+ R# t: S, R, T2 W# A
=========
3 o: H) |8 L) e$ `2 J# H4 h% ?. v4 O$ R: Z5 p% \4 T' |
Still a method very much used (perhaps the most frequent one).  It is used# ]; r3 @4 Z; R% U
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,4 R; l& F; ?: p- v
or execute SoftICE commands...
- f' G3 K, e0 I! iIt is also used to crash SoftICE and to force it to execute any commands- c% L7 ~2 M# P5 f
(HBOOT...) :-((  
) z6 Y" U% e- g# \9 E( [/ e8 D5 l% P
Here is a quick description:
! y# W( d% Q0 \$ o) l8 C0 O/ c  ^-AX = 0910h   (Display string in SIce windows)
( D/ }) O; J! O- |! `& \, V-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)
( s% a( J1 w3 }+ U# u-AX = 0912h   (Get breakpoint infos)
6 z, N6 \  z3 q* u: ]-AX = 0913h   (Set Sice breakpoints)
0 @. {) j( b; ~' x0 {" C-AX = 0914h   (Remove SIce breakoints); ?  y3 ^5 Z, \$ g* c: p/ h: Z; ~

% B) j1 s1 I* ~8 R- _Each time you'll meet this trick, you'll see:; q" k) f; j5 F6 f+ `
-SI = 4647h( h* K/ @6 W9 z2 s4 d
-DI = 4A4Dh
9 U5 U( x: y5 h8 H- nWhich are the 'magic values' used by SoftIce.
; h4 H: r+ ~" D8 S+ QFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
; ?9 ~  K% n" R% i/ U6 Z2 B
3 T# V, b9 x6 y; s( j; U$ \Here is one example from the file "Haspinst.exe" which is the dongle HASP! Z% ~5 y9 D4 c
Envelope utility use to protect DOS applications:( U5 ]9 S; J3 a

+ K+ R6 @  }! O# S
' _$ r/ a' K. Z6 l4C19:0095   MOV    AX,0911  ; execute command.
  ?. j2 s, H8 _2 E" E2 _4 J4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).# W; s( O- A" `4 [  D
4C19:009A   MOV    SI,4647  ; 1st magic value.
; Q4 W! g. j  z/ E, B$ A6 K4C19:009D   MOV    DI,4A4D  ; 2nd magic value.; E0 Y2 J! h. d, v
4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*). d! j7 Z( f, t- F
4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute
% ?. W1 ^8 Q$ k/ E0 |, m4C19:00A4   INC    CX
  H* g! U; p- p, W4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute
  y; W, R( k+ y4C19:00A8   JB     0095     ; 6 different commands.
+ ]5 ^- B1 k5 f9 v! a, g1 B4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
. r$ b/ I$ ^! |" |2 F, \/ o/ Y" s4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)
' f; f3 l  H7 t  j9 {$ Y. B( D" H9 }9 z; u5 [$ H# g6 t
The program will execute 6 different SIce commands located at ds:dx, which
1 j5 D( _( i  Bare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.8 B1 C" O' k- H& ?( P
( g. _% I$ q" W2 P& v/ u4 T
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.' e- a% y9 _6 n  F6 R( P: v
___________________________________________________________________________* w/ d0 D, b4 L6 M5 w- ~

$ ]1 j2 `8 R! p
2 n% D7 a7 p) n" ^5 E( s- P6 bMethod 03
/ o. I% V$ n: W/ H=========2 I* a' H- Z/ s, L; ]4 O2 \

' G* ]; x4 B4 X, VLess used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
$ g. ]5 I% n- N. k' f  y" \(API Get entry point)
4 G$ \: u- b, |0 ]! o- g        " g6 h% S6 V/ T
  _: ~# D* l' m2 ?% D4 C
    xor     di,di
3 f; J  b# A5 C9 K3 E    mov     es,di- s( d0 o  m+ s/ A  C) R
    mov     ax, 1684h      
! V$ B. g( X& `9 C% A/ C" z    mov     bx, 0202h       ; VxD ID of winice5 ?; T2 E! P" K( e; G4 W# G
    int     2Fh; V+ q9 A4 p. b7 M( w3 X
    mov     ax, es          ; ES:DI -&gt; VxD API entry point
9 I# W  t- l; f0 S    add     ax, di" z4 n$ ^  F3 O+ W  u" M
    test    ax,ax0 v6 ?( g; I6 i5 n; M
    jnz     SoftICE_Detected
+ a% F( m/ t/ e2 Y/ |2 G8 w" N2 \, f
___________________________________________________________________________( B- M  O0 ?; F6 f# H- O: _" ]1 Q$ s
7 Q5 _1 l6 u, U5 K; b! ]) J: U6 [
Method 04& R3 k9 [  l5 T8 f
=========' I# P9 c8 j2 i' F

$ H4 `) _8 g6 d# Z0 k. Q0 mMethod identical to the preceding one except that it seeks the ID of SoftICE
# `+ [* T. o/ ?' _5 \6 mGFX VxD.* V. j; Z, P! C( x

4 ~" {" B+ O! ]    xor     di,di
9 U# U( R' j% o! x    mov     es,di
/ w2 m, j8 L! t7 ^+ I0 l    mov     ax, 1684h      
, N& n4 e8 |; L. Q5 `9 a    mov     bx, 7a5Fh       ; VxD ID of SIWVID( Y4 j  ]1 g; S# j0 @0 ~: [+ M- s' ?0 @
    int     2fh) X& J. d1 _! G/ k" [/ l, O5 D
    mov     ax, es          ; ES:DI -&gt; VxD API entry point
* R0 N* z: s7 X4 k( o; M4 t    add     ax, di
( b4 D" N* B; D    test    ax,ax/ _; G2 x  v2 ?" |2 e
    jnz     SoftICE_Detected( v, p* V# ]& H2 Q" H1 j
% [2 t9 y7 d; C) \
__________________________________________________________________________* e2 e8 @  [( V8 d
6 L; P( d9 r8 H3 g: @$ @: V
7 L; x" g- }& ?6 X# Q' B8 @: m
Method 05
  s4 b5 r$ j, D( c# o/ _=========& F8 J6 |% v6 g7 E

! p! e. Y4 x, v, d% NMethod seeking the 'magic number' 0F386h returned (in ax) by all system# @" x* R% [; Y6 M8 s# ^( Z
debugger. It calls the int 41h, function 4Fh.! J5 d! `7 K2 m# V9 P
There are several alternatives.  
+ P9 ~' r: k; |, M
- ^& T! |& C7 O9 w4 S6 d1 ^" xThe following one is the simplest:
/ H4 _: ?- M* i' p- {8 h4 {: `% S. u9 v/ i9 I* u
    mov     ax,4fh
( ]% @% t9 ]; o8 t! @& N$ R3 F' b    int     41h
6 ~7 n* b' u$ @( A: e    cmp     ax, 0F386% `9 Q/ F6 W# Q+ A: [
    jz      SoftICE_detected
1 ?! a' {. J9 r5 T4 O0 z* j9 }
& o  ], I9 X; @1 @
7 q9 `: U! ?- n0 b/ v% A: V/ G; bNext method as well as the following one are 2 examples from Stone's
5 y; [6 x  H6 Q9 v7 W4 p$ F  V) p"stn-wid.zip" (www.cracking.net):" s& k$ I8 \1 Z9 Z

: ?5 e& l# K* y) @& N# y/ ~    mov     bx, cs9 p+ B/ Z  t4 W: g+ l* l9 w, Z
    lea     dx, int41handler2
- Y& a: ~/ M+ ]    xchg    dx, es:[41h*4]
% A# v- \2 F- X    xchg    bx, es:[41h*4+2]/ ^. |; W; \1 i' Q0 r% p6 N
    mov     ax,4fh
7 B$ [2 r; l* \( \9 g    int     41h
3 ~! n. g1 p6 r! }3 w# ]" u    xchg    dx, es:[41h*4]" d# Q6 g6 l/ S
    xchg    bx, es:[41h*4+2]
0 r+ f# M( V+ f    cmp     ax, 0f386h0 j. }, e8 v. y% v+ t6 L
    jz      SoftICE_detected
( X! ]" t) R+ t: p5 j
3 a( G# s# \. X: [int41handler2 PROC
4 ^) C7 n+ I6 Z9 {    iret; z% S. c3 o" g- l  n
int41handler2 ENDP9 u( I: C- N  r5 y3 D$ E6 x# K( b
8 L1 A: O% |' y5 Z9 R
/ g- N8 B, H0 }% d1 l: p1 w
_________________________________________________________________________
- z2 n! Y4 X+ A! T, E3 ]+ k
) q8 ~" z* j2 b9 [
6 w" R$ z3 U! j& _" D8 ]* q. q( kMethod 06# j5 x) X, ~; c+ K& {; E! S  g
=========
. j3 p  i3 J3 x, K9 n
( K$ U. N& f# }% [! e5 d( e1 }9 O3 R+ Z8 z* O6 h
2nd method similar to the preceding one but more difficult to detect:5 a$ f* k6 ^: X

6 r" E- s) {- V2 b" W2 q
2 z! N, z# {8 q9 h" qint41handler PROC: y3 v, D/ [. T( q; |
    mov     cl,al
6 C$ O7 @- m8 ^; y. F    iret- c: ]9 w# \8 m7 i5 X  V
int41handler ENDP
1 }# L0 P& }# B* d  d, C* L7 F2 c! K) Y: I

( l' q% H7 B1 H- K- M7 g    xor     ax,ax7 D  L4 U! x( L! b' p5 y
    mov     es,ax
9 p4 s* s. R. a( M: o    mov     bx, cs7 `6 W$ `$ V( |% }" I; ?# `! I" \
    lea     dx, int41handler
. y) _6 X7 p' g! }. ?    xchg    dx, es:[41h*4]
. }0 R# [) }+ q' ~    xchg    bx, es:[41h*4+2]- f3 U% {" R: T/ l3 u
    in      al, 40h/ i) U0 L) M9 e7 [. a8 L
    xor     cx,cx: g! a, [# o/ e8 N* ?4 @: I
    int     41h
$ ~  v: O6 K2 r6 f' L, S8 p# s    xchg    dx, es:[41h*4]
" S! W# o2 f: c& r' f7 Z! d    xchg    bx, es:[41h*4+2]
; X" B3 `( }7 A9 U7 }! z    cmp     cl,al9 q3 n4 X! o6 t2 W
    jnz     SoftICE_detected# W& z* f. h5 Y' k5 a- H: F3 W

9 u9 R- J& K* R; w# v_________________________________________________________________________* X. k# s6 H# l4 V3 _4 y- t
3 c8 y% k. \. z; y% D+ V* t- c. q4 R  r
Method 07, i/ q- J) Y) h) W) O
=========
1 w; R+ B7 w8 n
, o8 P% y1 {/ V7 ]Method of detection of the WinICE handler in the int68h (V86)4 a$ i$ X2 r5 t- R  n
/ A) N" U( ], T
    mov     ah,43h' x% D9 ~6 p3 A0 w/ f
    int     68h. L; w) K4 \6 c. E1 {
    cmp     ax,0F386h) l( b7 v5 I: a$ I
    jz      SoftICE_Detected
" o. U2 c1 f5 \$ d' Q, Z! Y- K3 N
# s9 G. U/ A+ I# D  M( ^2 ?0 H9 J" I
=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit, S# Q; v0 W8 ]9 I) c
   app like this:
: c+ ^2 @% B- D0 K% R4 |
9 K5 x  [1 }4 G' @/ W" c   BPX exec_int if ax==68
1 L/ q! A1 o$ r% @/ O4 V9 {  i4 h   (function called is located at byte ptr [ebp+1Dh] and client eip is7 ]; e$ @0 @# F6 O9 a4 w. d
   located at [ebp+48h] for 32Bit apps): ~6 W! h% O8 j" p
__________________________________________________________________________
- K" b: q; f' ~( b8 d5 W+ v1 O% x/ v# M
* f3 ]9 p: @+ j# r
Method 08
4 h# {: S5 {9 o2 t# x9 {- Q/ f" {=========
: w4 g6 q0 X: F0 z) b) P' }7 k: [2 c6 \0 Y& X( U4 @/ q
It is not a method of detection of SoftICE but a possibility to crash the, D8 N) ^+ r; E3 Y
system by intercepting int 01h and int 03h and redirecting them to another5 [3 d5 G1 f3 z/ @7 I$ S) x( t
routine.* j" e) ^+ {2 ?. P  o- F6 t0 _
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points. y5 b4 ~. S& U1 Y& }$ ^+ P
to the new routine to execute (hangs computer...)
& W; @: F* I  R* w9 r" E0 T' }1 N( n2 A' U
    mov     ah, 25h3 q9 S6 f2 }4 f, G! w. |, V7 {6 A
    mov     al, Int_Number (01h or 03h)' N5 q4 B2 P3 h& l
    mov     dx, offset New_Int_Routine
3 Y2 ~3 L- b8 |/ S    int     21h$ G1 [+ E, {( O

2 e# g& G% M$ Z, W" h__________________________________________________________________________
1 a8 n8 b# e% W3 x- \' f- i
9 D5 W+ a! t8 ~! d1 I2 P. q2 cMethod 09
( N1 k3 B  v- b4 l; `. n* }=========/ B! B" j2 ]/ c6 I+ M

* E, H' b# z1 |8 ^2 lThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only1 ]/ u7 }4 h7 u5 A" V  W% `
performed in ring0 (VxD or a ring3 app using the VxdCall)., C# t0 X0 V; e5 m1 `$ K3 B
The Get_DDB service is used to determine whether or not a VxD is installed
6 p+ Z; e" Y3 Q# T+ ~for the specified device and returns a Device Description Block (in ecx) for
4 D$ w$ ?  Z' p% w5 tthat device if it is installed.1 x1 Z" X+ B" w% R

: l0 j( G( b5 ]5 x/ Y5 o   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID( X7 t8 c! e" S; B+ Z7 R/ N
   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
) J/ B6 }, _" \# s( `! m   VMMCall Get_DDB( L7 `, {$ V$ N: q1 J" u. m
   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed( {4 o, F8 ?" \$ b

7 y- i. n+ b+ s* Y6 D3 l9 Y" _Note as well that you can easily detect this method with SoftICE:
7 S1 a$ B/ V4 Y5 `   bpx Get_DDB if ax==0202 || ax==7a5fh1 E' P4 _. A- H' _" U/ L/ G
7 U+ B' D$ i7 q& h. Z4 u
__________________________________________________________________________
5 N4 Q) n! O) S. c* G0 T0 m$ M
Method 10
% `$ z% p) w4 z, L=========7 @  V" i% A3 e1 W7 S3 b" Q
. K7 g; Z8 {! h+ ?7 D! n
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with* Z# Z" P5 [, r. v1 e7 A- D
  SoftICE while the option is enable!!; L0 J. V* b) f

  Q0 P4 Z1 F5 J, ^% MThis trick is very efficient:
: l- i, ]. t, |& l) E6 \by checking the Debug Registers, you can detect if SoftICE is loaded
- ]7 E9 U0 r5 L8 U(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
9 f3 ?* T, S, z% Kthere are some memory breakpoints set (dr0 to dr3) simply by reading their2 X+ y: [9 a( t# K; q  {# K7 K
value (in ring0 only). Values can be manipulated and or changed as well& o  a# i. R; p, E2 y
(clearing BPMs for instance)
3 }, }& Y" U# S. h1 k0 ^( Q& v0 K$ [! @* e' v  O
__________________________________________________________________________- _2 o$ F8 m- R

7 R3 g$ ~6 R6 S* GMethod 115 `7 P+ T+ h7 `" z- v. u5 T; ^/ D( f1 d
=========7 I: \9 m3 {! a7 w- w9 G
/ p: e& j% }6 c0 s9 O% Y
This method is most known as 'MeltICE' because it has been freely distributed- C; q! A- M* E
via www.winfiles.com. However it was first used by NuMega people to allow
% a: |9 y" o7 }- w2 z! }- FSymbol Loader to check if SoftICE was active or not (the code is located
4 U7 e" t1 G5 x. a9 j) g; ainside nmtrans.dll).
9 V: L9 k0 h5 N9 ?- P; E3 k8 c7 V8 l. j% t, {' @
The way it works is very simple:) Q, B! `2 z& M' e) @8 y, ]" B
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for* V$ {( C* d( ]2 A( }% ^
WinNT) with the CreateFileA API.
, j1 f* q+ n6 p/ n% v; k0 f( M4 D% v. p
Here is a sample (checking for 'SICE'):
& r7 l" p0 R! S* C# g
- Y0 t5 l2 [5 k" l* dBOOL IsSoftIce95Loaded()
0 g! \+ n( e! n4 J{; e# P9 }$ @+ I0 }
   HANDLE hFile;  8 V& W0 W/ g0 M% H1 V
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
; ^% `7 r( i2 @                      FILE_SHARE_READ | FILE_SHARE_WRITE,
* |* P7 O; S1 I: r9 ~                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);& Y1 r8 k& K) u  u3 J
   if( hFile != INVALID_HANDLE_VALUE )
! @/ X: w" f1 D1 a$ V# j6 S/ J   {1 d7 m: d6 y1 R
      CloseHandle(hFile);% }  o3 H" Q, m- Z2 o9 i
      return TRUE;
2 x+ }( }7 @* y, W" u& Q+ a   }
6 O4 A4 L7 r, g* }+ C, d0 ~   return FALSE;
& S0 b! H- a5 ]9 Q0 |4 j& e}
- r4 W! j/ I7 C0 n) ^- N+ O! H. @$ t
Although this trick calls the CreateFileA function, don't even expect to be9 p9 l: v+ ^$ G' ~- C
able to intercept it by installing a IFS hook: it will not work, no way!
- q/ }' \. U5 j% l& bIn fact, after the call to CreateFileA it will get through VWIN32 0x001F( p+ g- k; i) @) A
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
8 S$ j2 a3 y. o% i3 F, Z# W  Yand then browse the DDB list until it find the VxD and its DDB_Control_Proc- h# O1 a, J% ^8 F2 u
field.
$ s! N  I9 m/ o" {  a8 MIn fact, its purpose is not to load/unload VxDs but only to send a
9 F7 @! o, M, k' |" j4 W( _W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
0 N2 a1 `+ o8 v- J  _9 L  Jto the VxD Control_Dispatch proc (how the hell a shareware soft could try/ K# n: ]: M, K% u7 @2 z% @
to load/unload a non-dynamically loadable driver such as SoftICE ;-)., M/ A1 ^, W) m' y( y6 v7 V  {
If the VxD is loaded, it will always clear eax and the Carry flag to allow
# J! O: ~/ `* D. u5 R- nits handle to be opened and then, will be detected.
( ~9 O* M  \3 X1 E1 t$ TYou can check that simply by hooking Winice.exe control proc entry point
$ u: Z, f( k0 vwhile running MeltICE.
$ I" K& {7 O) B% p( n/ d, [3 A' T
$ v1 g4 O6 B$ X+ j. j* Y/ g: q, x& v0 Q# O  N# z' |% C
  00401067:  push      00402025    ; \\.\SICE" U3 m8 b% @1 K4 q
  0040106C:  call      CreateFileA
! f' j/ I- T& S- T6 p5 {  00401071:  cmp       eax,-001& p; K1 R# @8 V
  00401074:  je        00401091
% V# M  v3 ~0 a  j9 U7 p& e0 X
3 a+ }( C, E+ `9 y
: z$ F/ b: h9 ^" s& I1 H: pThere could be hundreds of BPX you could use to detect this trick.
3 P% v# g6 K' a% n+ _-The most classical one is:' v& G9 q- X% O. B) p
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
3 j/ _! {4 I' c    *(esp-&gt;4+4)=='NTIC'/ z% J/ @, N$ u/ V7 H% i
4 y8 O/ @& F& h
-The most exotic ones (could be very slooooow :-(
! s# d/ L3 g2 g& g# w$ W% ]   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  
) Z5 A: ~& _$ A2 \" h: Z  \! S     ;will break 3 times :-(2 a* Q" h* P: l: l+ Y- V( `8 A* ?: c

4 j" x) Y% D! P. S; S9 q- q8 p' r3 `-or (a bit) faster:
  g3 H. z/ ~- O   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')7 U. e' m0 H  ^9 q

6 p, u! }" v8 B7 Z   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  2 }$ }( g2 t1 N; G$ {8 M/ A& N
     ;will break 3 times :-(
! @9 d4 g+ _8 t* o* d
& f" V  Q" E) s( y' X" Y-Much faster:7 C  ?6 s& d0 t3 p. w7 r
   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'5 G7 N9 N8 i3 q+ }4 T+ W
' r) f& [/ U: }, p
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen2 v! V- D: q! F" C% ^  e# F
function to do the same job:' C, Z3 j0 x/ K' n6 H: G: _& N
% p+ x& v& ?# v+ D/ C' c7 N
   push    00                        ; OF_READ
2 I8 G5 C5 l/ Q- B0 U4 V1 x   mov     eax,[00656634]            ; '\\.\SICE',0
# h  N  A6 b' W" T   push    eax
5 V# _; ?2 B5 U! w6 h9 t6 ?   call    KERNEL32!_lopen
6 H% x; S$ j  R7 M+ q% E7 g4 T   inc     eax
% Y2 w$ E2 I" Z% I  w# h- z   jnz     00650589                  ; detected
( g# h( j" i, ]9 W6 |   push    00                        ; OF_READ
' o" b. D4 m: M/ V, c   mov     eax,[00656638]            ; '\\.\SICE'8 z0 c+ G: V9 l9 h' z; H
   push    eax
; m' y8 s# X, V( d   call    KERNEL32!_lopen
6 I! T9 j+ Z8 |   inc     eax* k. I. F( ]  p' q. y1 A* B$ u# V* \
   jz      006505ae                  ; not detected; A% J2 F6 K2 y% ~/ G5 q" R
6 f6 p. {4 H/ h

0 i' `4 q7 b  Y9 \8 e# ]  T__________________________________________________________________________
* h, o* `& j% e, t$ J* T+ V6 s+ S. ~3 ^
Method 12
& A+ x( m) b. V: Y=========
9 y+ Z& o% I& G/ C' P
" r+ q# |7 J% m2 w# qThis trick is similar to int41h/4fh Debugger installation check (code 059 _2 y9 H: w: l3 i4 v4 J/ x
&amp; 06) but very limited because it's only available for Win95/98 (not NT)+ o, L3 g& w* d/ i4 ]
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.3 P* i, m. |9 E) e1 o
- g3 Y/ C  l& m# l! M% |
   push  0000004fh         ; function 4fh; i0 N* F, g  I" a! r5 |& C; M
   push  002a002ah         ; high word specifies which VxD (VWIN32)  B& u" S% l( x  f0 c
                           ; low word specifies which service, I/ l, q' Z. n0 x. G, V: R
                             (VWIN32_Int41Dispatch)) N1 K' `$ Z$ u5 p9 C- e( d1 r( _
   call  Kernel32!ORD_001  ; VxdCall8 l' B9 b# C7 G
   cmp   ax, 0f386h        ; magic number returned by system debuggers! ]; Z9 ^4 A3 F6 W6 E$ A9 \' j
   jz    SoftICE_detected
1 m( k2 a; z7 ?8 W! l8 T: I# A" V. M* f' K8 M' R
Here again, several ways to detect it:) v( Q1 N5 ^" g  A7 e

, x; D2 G" B1 l3 B0 Z    BPINT 41 if ax==4f8 h! D7 m1 P9 M% \7 |# p! J9 e" L

* b+ G& l; n( ?0 W    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one& D" s0 f0 ^" A- y
% @& Q0 Y9 O8 w4 ]" A' y
    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A3 j  n( S/ a! q' x
) a; z0 U, n" [& T; O- I
    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!6 T* S9 C/ H; E8 X3 E8 H

& t/ [( w9 l0 ^__________________________________________________________________________7 b" ^  }! m- ?) E! X3 _
2 C. k& i7 G7 U
Method 13
) y9 M- v5 _3 @2 j" w=========
$ t2 \3 I7 ^- t4 t+ |
0 p- G) z% h- _- X4 F( SNot a real method of detection, but a good way to know if SoftICE is, J5 O( Q5 I. _2 X* s/ d/ \+ J8 g
installed on a computer and to locate its installation directory.
& ~& U6 S; M, L- M0 UIt is used by few softs which access the following registry keys (usually #2) :9 H  {# [4 j4 a" h1 ]/ {
% R# q( ^+ M& l9 n' a
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
% M6 @1 X" i  p' C( X1 q* ~\Uninstall\SoftICE3 b! Z- R( J9 Z/ R! M
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE- ]. T8 k- B3 S4 `& d3 n
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion! `( O, \4 g4 d) y' S
\App Paths\Loader32.Exe
7 [8 M; V$ B# }$ @. |/ M  X( g6 {

7 a. m. E/ v6 P; ]Note that some nasty apps could then erase all files from SoftICE directory
5 b9 \0 d6 v- W+ W4 A(I faced that once :-(
1 _+ }$ P, B1 P$ ?( z0 t5 X5 c4 W4 Y7 {& Y$ |( L8 ]5 X; [+ n/ K# q. R
Useful breakpoint to detect it:
" s; i, q0 p* ~; B2 y5 S
: B7 G3 F6 c0 S$ K/ k/ A     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'& E$ S, e' t8 J4 c3 [2 k% \
" c. v, o3 D, Q6 A% ~! D' u( G: s
__________________________________________________________________________
) f1 t1 g: e3 s: C' ^9 l4 s% H- n* v4 m; P$ A6 Y" h2 g( C3 T
$ ]- N! d8 u+ j3 X; m" ^
Method 14
5 M! f8 H" _& e=========
6 q4 B/ w2 z6 V4 ]- N4 P  r  a, g* B, E) t3 E9 v" ?
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
  r. E; T9 l- A( I2 O/ d- k% uis to determines whether a debugger is running on your system (ring0 only).
. M( D) m1 g# l* B9 g$ ~  @1 K. N4 K' w8 A7 V0 {9 G
   VMMCall Test_Debug_Installed* x/ I- ]% }* ^7 v: n: `
   je      not_installed
, \. s' Z/ r+ ?" a7 O% J2 ]& V* D9 U7 Z
This service just checks a flag.
* E5 L/ Y: z  _2 x( y</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关注公众号

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

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

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