About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>' y4 n. S7 `7 o9 m* N# x# K
<TBODY>
+ W; |' R# N# Y2 J) C<TR>
+ T: c: L/ c: }<TD><PRE>Method 01 & n/ Y, H9 d* e( j& C, s
=========; v. z1 q7 }( X! _

' F1 d0 e, \- wThis method of detection of SoftICE (as well as the following one) is( e) c0 d9 P* Q
used by the majority of packers/encryptors found on Internet.. C( ^, ^, k  E, |
It seeks the signature of BoundsChecker in SoftICE' i9 Z5 c! a: E7 H: o& I

$ I% a7 W. a& x: ~; _) [    mov     ebp, 04243484Bh        ; 'BCHK'- m# E7 Q: h: M3 ~7 y
    mov     ax, 04h$ g, w$ W2 Q% h# l
    int     3      
$ ?% a1 y2 Q$ u! O! V: F& f    cmp     al,4
0 k: B: ~0 @+ ?8 X9 l2 Z# d: v    jnz     SoftICE_Detected# N% \3 Q3 v" U

* n- t- o! |; g6 n5 M; I___________________________________________________________________________
; g" u5 W1 s* L' P( y; w/ L3 V+ E4 T% h3 p: X+ G
Method 02
/ h! c( v5 L8 u2 F8 w=========
) f' l# G* [2 D; J6 ~( J1 L/ G* o0 z. e% {$ b
Still a method very much used (perhaps the most frequent one).  It is used5 G( U7 P% Q5 Q. Y: V, |
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,: U% ^" B) B4 a9 q) L: t1 ?  V
or execute SoftICE commands...3 d2 h: i3 |9 y9 v7 j9 u
It is also used to crash SoftICE and to force it to execute any commands
) h' J% ?7 ?! N' @4 ](HBOOT...) :-((  1 B$ o- u) S$ R( ]  a5 L4 W& B

& N# w4 y* z" UHere is a quick description:
  y+ S' |: t2 {- ?9 K# `) c$ i-AX = 0910h   (Display string in SIce windows)
; `! c. H9 T, G/ ]6 k! ?-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)4 t3 d: Q, k) ^& {
-AX = 0912h   (Get breakpoint infos)8 J: ?' L: t; ]& p; U; }0 w0 t: L; N
-AX = 0913h   (Set Sice breakpoints)
3 B, e" n% y$ u. U6 U- k! n+ a-AX = 0914h   (Remove SIce breakoints)/ O! Z' ^* Y  @2 D: {* n' L0 P

# A1 J% ~1 s* [# ZEach time you'll meet this trick, you'll see:
4 |2 G/ Q$ ^. V4 o4 }2 ^) C-SI = 4647h* S; b" k" a% Z  b
-DI = 4A4Dh
* k: k7 O# {9 m5 d2 z0 W5 RWhich are the 'magic values' used by SoftIce.$ U4 ?6 t% r3 `5 g/ o; f9 v2 {7 a% S
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.; G$ _' Z& `4 Q2 X, m+ R* p  c5 j! j
0 l# l6 w" q. `& t0 l( {
Here is one example from the file "Haspinst.exe" which is the dongle HASP* w  K% }/ e8 m$ \$ y2 t+ h* \
Envelope utility use to protect DOS applications:  y2 q0 S7 O- j2 \! E! ?
& S: d0 F& x$ @
4 N" Y; K3 ~, A# v3 v. b/ k) ]
4C19:0095   MOV    AX,0911  ; execute command.
$ w: z3 ?* `" c, j% {- G) o; d4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).' ?) }' @4 j: l0 k* y# e
4C19:009A   MOV    SI,4647  ; 1st magic value.
4 B* n; s) l& @* Y4C19:009D   MOV    DI,4A4D  ; 2nd magic value.
& w% q% V# T3 h$ {4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
0 a! f# [2 u0 o4 f; |4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute# j+ F4 L4 T( S- g; S2 z
4C19:00A4   INC    CX
! C  _0 N2 h1 p/ c- I. `( C2 C4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute
7 _+ J, x  e2 L& j2 [8 k, r4C19:00A8   JB     0095     ; 6 different commands.
% S2 A# X2 p4 y' w4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
2 J2 m4 ]+ V" J( `; ]4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)
" z: ?: L/ s: f3 A& R$ {* Q5 u" A& n3 ~
The program will execute 6 different SIce commands located at ds:dx, which8 _, y& K' D& P- k1 h0 A/ g: O
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
. ]3 j2 V3 B" ^) k# V( r- c3 H7 a9 M3 Y- O: @& }! F- Y5 a1 z' e
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.$ `1 N. Q, h8 L2 C- V3 r
___________________________________________________________________________  ?4 m( X8 z- J+ j9 r) X$ k2 c0 ]/ r
1 b( m7 t2 G5 u& G1 s1 @; r

. s5 U& A5 y1 F" y" [Method 03
9 b4 x$ h$ R# y4 j( G6 ~=========9 m8 u9 |1 P- k

2 Y9 q" Z; t4 ^* ?  ILess used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h( g, Q$ _/ X+ J
(API Get entry point)
. R+ t7 I9 L0 M( F1 l' c; C        " f; _( O/ o: Y/ d0 x. X1 r9 a/ y

( L5 B4 H: e& i. T: T6 I    xor     di,di3 c) W8 H+ Z; B: p
    mov     es,di
5 s; n  _- ]1 p( r  \3 w) r    mov     ax, 1684h       ( _+ q* n3 b; {, p
    mov     bx, 0202h       ; VxD ID of winice
* E* W( |9 r* p# F% d    int     2Fh1 V/ r4 l4 W3 _* ~
    mov     ax, es          ; ES:DI -&gt; VxD API entry point
5 Q  B8 C* k, O5 j5 a& g    add     ax, di% f- w: l2 `* }$ b0 W% d. d
    test    ax,ax7 X5 E. U1 ^: J7 o' L9 M6 F
    jnz     SoftICE_Detected
1 B3 Z. M5 x) _; [
1 ^/ R/ N* q4 ?1 N7 c$ `- V3 S- y, |: H___________________________________________________________________________( r! t! }; n3 z0 Y( P: j& }

9 J1 L" K, T0 E3 D* \; O$ YMethod 04& \/ f* [: @- @+ I3 Q
=========' j* j/ H4 C: Y4 U  k5 k$ G) I

% r; R4 V$ V! U, f$ tMethod identical to the preceding one except that it seeks the ID of SoftICE
6 t/ D3 T7 f. q3 S$ q: X- PGFX VxD.
6 ~3 l# T" `' j. q" l* N# j' |. g. Q5 ~3 P  t* |$ R
    xor     di,di
( S3 S, v* j6 V* k% l" {! j9 U    mov     es,di, @% o+ V4 a+ H) E
    mov     ax, 1684h       . Z, C" o) ^3 t- Q+ {. V- c
    mov     bx, 7a5Fh       ; VxD ID of SIWVID
* D) \4 Z( v* n3 P' v& e    int     2fh
* E3 X5 |* a3 h2 o    mov     ax, es          ; ES:DI -&gt; VxD API entry point1 J, q1 u8 l4 h& z) u: j) E0 w
    add     ax, di
1 d: e; ^3 v+ t/ ?    test    ax,ax2 ~" }1 @9 _: v
    jnz     SoftICE_Detected
6 b- Z/ e1 I* {" Y# a. ], K: \4 Z4 U& j& C% C
__________________________________________________________________________
$ t& o- n! L% ~- M* c$ R/ w
2 W0 q( d' N, O( \- G; ]# A: J# u! L* Y& K7 R
Method 057 n0 P5 r, w# o4 \
=========$ Y6 C- y  z; g: Q
8 Y4 `5 E8 P' d% |* z2 e; j
Method seeking the 'magic number' 0F386h returned (in ax) by all system& d( o4 J' q9 u" L
debugger. It calls the int 41h, function 4Fh.$ Z" w9 ^/ d9 v* Q; V# Q1 f2 a
There are several alternatives.  4 I4 _& D1 i  I+ L/ E" D+ z
, l7 `" a" I3 Q
The following one is the simplest:
7 g0 W% m7 [+ m9 _5 }
  t$ I1 t4 p$ ~; |2 e    mov     ax,4fh
+ O# k7 H% `% X3 s3 U    int     41h+ l# a& ~  J0 U# j% @
    cmp     ax, 0F386& I+ {/ [& g3 r
    jz      SoftICE_detected
( V0 f9 I' i! f4 \" g7 E# u
' T4 G8 G0 ^  I, R8 ~* b& o+ I* I; v* e8 q- b
Next method as well as the following one are 2 examples from Stone's
2 t3 P* c& [! Q8 r! K. d"stn-wid.zip" (www.cracking.net):, T* s) i% i. K5 N; U3 C& N) U

  b9 F7 ?3 \8 F! L8 c: d: C    mov     bx, cs3 U" F2 K6 b9 `
    lea     dx, int41handler2
7 f! E4 @" L5 v- J% X  \    xchg    dx, es:[41h*4]# @* l5 g$ B$ G, n1 g
    xchg    bx, es:[41h*4+2]
) Y" c) o/ |! X    mov     ax,4fh
' U7 q" f8 t4 J# X3 \    int     41h
% F8 q9 s3 W0 @: @6 \7 G    xchg    dx, es:[41h*4]
* B) m1 @4 {+ G0 g    xchg    bx, es:[41h*4+2]( I# Y; y3 D. V: ^2 V" f
    cmp     ax, 0f386h* @/ c! Q7 O6 O  t+ @& C4 O6 T: p
    jz      SoftICE_detected0 p3 P* L) l5 u6 K
* A. H9 y4 c9 P9 j* e# q# i$ Y3 ]
int41handler2 PROC8 v- J: J; M9 w+ |2 Q& G
    iret
) C  Z4 U0 E0 L2 ]) `0 E& [! Tint41handler2 ENDP
9 U: t; n! s: }5 f* z0 \& b+ Q* T. w: {! ?1 B
8 j. v; z9 \4 H7 {, y
_________________________________________________________________________' }' z3 h! n+ i3 P  ~
" D) t( K/ v8 [8 d; Q

  Z+ q- I: B# nMethod 067 k( B2 s; k6 V! U4 z/ s8 |
=========
2 c' e# g! Y# G  B5 g! X9 S$ v& R. b* `$ S: b$ }9 I

& {: ~, w, b( A/ k+ [2nd method similar to the preceding one but more difficult to detect:% R4 b- w+ \  P  n+ D/ p# s+ y- l
0 A" k$ p! S! X/ u# Y4 ]

, y: N: o5 t- @5 f, Z  dint41handler PROC
9 U, w8 P) y* y    mov     cl,al
7 U$ V% {. Z0 [    iret9 _" r' ~& W3 a. Q" i4 R
int41handler ENDP/ e, e0 y9 Z- A( @1 c
$ N* E" t4 H+ z- u

6 M! V7 r% _- Q# K$ h0 ?    xor     ax,ax
/ R3 F& a% g# W5 Q    mov     es,ax
. T9 }, }! w% T/ Z4 o+ A) E# p    mov     bx, cs
: @" E  {8 F0 h0 H6 r/ e    lea     dx, int41handler
& b6 ^5 f+ l( O) O/ C& v9 q7 u    xchg    dx, es:[41h*4]  v* ?8 g" O4 o2 w5 h
    xchg    bx, es:[41h*4+2]
  P2 U/ N0 s) A. G    in      al, 40h( ~2 F  w7 x* q) q. j
    xor     cx,cx, U" t+ a" B7 _& e& R: J
    int     41h' ]# x0 B- U& I. ?
    xchg    dx, es:[41h*4]
6 g! f- u1 U2 z( f7 b    xchg    bx, es:[41h*4+2]9 ^7 G7 E4 d3 ?) `" B: k  V
    cmp     cl,al+ Z) l4 Z+ G& A
    jnz     SoftICE_detected, d- I* l$ J) \6 W" z
2 Y  @9 S/ g+ Q6 p+ U+ ]
_________________________________________________________________________
& r) j6 U7 M4 m* P; r. z0 R/ z. }$ O, {* _; T
Method 07
% k9 O" Z1 h& ^' h- [=========3 Z- f7 \+ k. ^1 ^! O) w$ p" [9 a0 K$ g

5 h% p5 X' s5 V( I$ S' DMethod of detection of the WinICE handler in the int68h (V86)) M7 P' |7 k/ N2 f! |5 {$ @1 D
/ ]" S% }, z" y' C% g5 ~# u; ?6 }
    mov     ah,43h# ?  c# k' Q( L9 R% _
    int     68h, K% V0 q# @/ D- `
    cmp     ax,0F386h
& {) i% o8 }+ y! v5 `+ d9 \" v! Z    jz      SoftICE_Detected
% X1 n( E3 X) g8 f8 n/ r" x8 F* M$ i- [0 ?" D. c4 v4 I4 I  ~

) u, P! A! o0 u3 r/ f4 H, @=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
0 H. j( U9 {4 Q   app like this:
. E; Z% e7 ]1 E1 O
( F- u& b5 ?2 B; V" A   BPX exec_int if ax==68
7 d+ n3 H' [; S% E" m   (function called is located at byte ptr [ebp+1Dh] and client eip is
; q$ X5 i9 `  Q1 R6 }% [, ]   located at [ebp+48h] for 32Bit apps)$ y! A- Z3 Y( |; V0 v# n6 Y
__________________________________________________________________________! E) Y6 m) |  L6 e

. c; K! X" b% U4 `0 V: c) R4 h- J, r( r, a
Method 08- u# S1 H2 h* B" W5 `
=========
+ i# `! C0 {$ Q: j+ T! u* I2 M) X9 v5 a0 J& S# k; Q) K
It is not a method of detection of SoftICE but a possibility to crash the" r; `  V( K4 k- b" y2 l) ?
system by intercepting int 01h and int 03h and redirecting them to another- a/ g0 c6 N: n1 m, ?, D; Z& u3 {
routine.8 S/ R# `1 N" i
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
& `" P3 Y. M8 `* q5 b, Bto the new routine to execute (hangs computer...)
% ~; J+ r- X% G8 S6 F/ ~; m! p# n9 v8 O6 m7 p7 a& C5 R2 u8 e0 a0 `, H
    mov     ah, 25h
5 E+ m/ n/ \, a* q9 @1 p    mov     al, Int_Number (01h or 03h)4 c/ H# _. o6 e8 _
    mov     dx, offset New_Int_Routine
. E  i4 ~" r- w, d1 V( j' x    int     21h7 [+ `8 P0 H2 n: [( p9 e0 Q
  `4 _" q7 v. f* W' C; z. @8 h
__________________________________________________________________________* X, Y. ~% b1 T. ?' b

* w% a' f9 h2 J4 P4 x) dMethod 09$ ~- T* ?4 g4 e" U6 T  J
=========, O  `5 w( [  \" v# ?6 a
+ e& M( T* x! F( g1 n1 `5 ]+ p! v
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only5 b' o  H7 _" `: t. w
performed in ring0 (VxD or a ring3 app using the VxdCall).& g* z3 ?, F- Z/ L0 l' I; e3 ~
The Get_DDB service is used to determine whether or not a VxD is installed
1 I8 |6 C' ^) X" F# ifor the specified device and returns a Device Description Block (in ecx) for
8 C8 b" q( u0 E' vthat device if it is installed.
9 d: z/ b; p# d: ^- ~5 F" ]$ W/ v7 m' ^2 s5 g5 Z
   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID" z' M1 t# A8 K  U4 B/ C6 Q* E" J* u  o
   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
: n1 v8 h" Y6 J4 x1 ?0 Q% o+ I4 p* T   VMMCall Get_DDB
+ W; N* y; W4 z* ^; e! K7 y' N   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed! t7 {4 f- K- d# x: c3 t0 Q
" q( y; G9 @3 L- e
Note as well that you can easily detect this method with SoftICE:
8 W2 [2 [# A: c# @9 Y9 ~: k   bpx Get_DDB if ax==0202 || ax==7a5fh) ^: M; U; c5 u2 V, n9 D4 f- F
0 C" k/ |$ z8 \8 R% t
__________________________________________________________________________
% e7 E+ e8 n( }' V4 f, n- ~
% ?/ `5 i$ x: o6 J6 C9 ^  ~: `$ ^! s" {Method 107 k$ Y( k# b( `2 V
=========9 P* t8 H+ ?$ x! o3 g

# m; q) |) c# u+ s$ {, O' P=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with
  e1 R3 q, x1 E" @+ M5 O  SoftICE while the option is enable!!
" W1 `' D3 f% }# i1 ?  E; \5 k' j7 O$ S, L6 Z: f$ L& M
This trick is very efficient:' V4 S" M; {3 u, c0 U$ H
by checking the Debug Registers, you can detect if SoftICE is loaded9 A2 x( ]% ^7 U
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
* ?" M; ~8 t2 k' h' `there are some memory breakpoints set (dr0 to dr3) simply by reading their
' m# g! G4 L" Dvalue (in ring0 only). Values can be manipulated and or changed as well
# Z# _0 c6 M% L' C$ e3 g(clearing BPMs for instance)
- G! L0 h! @1 _) x( U* z# U% T* y) T' _0 p# ]; M5 ?
__________________________________________________________________________# G: i+ q0 j. @" y/ K- I1 b

* q0 O5 F( m" g& @Method 11  u- h% U8 b6 w- s
=========
5 w9 \7 p5 |- w* `3 H' s3 T$ [3 b0 a9 U# r( e$ f
This method is most known as 'MeltICE' because it has been freely distributed6 q% b( a1 ]6 W/ [
via www.winfiles.com. However it was first used by NuMega people to allow
, t1 f" S, a' }0 M+ fSymbol Loader to check if SoftICE was active or not (the code is located
4 v" ?" C! }4 D9 D; minside nmtrans.dll).' w; d1 Z1 p& m% b' Y
' }* B* G5 j: Z8 D) ^0 S4 ?- Q
The way it works is very simple:6 Z3 a( k5 j1 D: z1 x
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for3 ^, O2 t: {$ |' }* t, c  ^
WinNT) with the CreateFileA API./ a- K8 K% }! L. G% X- p) ?

: r$ N$ y, |' S% ^& y' a* ~: t9 SHere is a sample (checking for 'SICE'):8 @( b! P! F$ B2 o/ o

' h8 @8 H) [$ E- ]8 t$ Z8 ?BOOL IsSoftIce95Loaded()( c" v! ^. q  T' p0 q5 G( }
{
+ |2 S7 z% h7 ?. X- ~! o   HANDLE hFile;  ( h* Q) J* H5 ?# w5 V& `& Y
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,& r' @, M: U1 T7 V8 e, ~
                      FILE_SHARE_READ | FILE_SHARE_WRITE,
# q3 ^  Q# k; O; c: Y4 x* I                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
. O6 w' F* Q" b0 }$ c5 y   if( hFile != INVALID_HANDLE_VALUE )
/ F! H0 b; _; B- ~. t   {4 d! i: E2 P. @. Y% g
      CloseHandle(hFile);0 Q( a  J) V3 l# E' [6 r. I/ g
      return TRUE;
. z3 c3 }6 D! q1 O8 \; ?4 g   }1 C9 t/ ~! }% l( ~5 O5 |
   return FALSE;
+ Y+ ~6 J* D. D3 T5 C, {# P}' L) {/ U- m1 f; T( {% L, |

5 e4 G% s% h3 A( L. }+ JAlthough this trick calls the CreateFileA function, don't even expect to be
2 z$ ~/ s; c1 ~( x- O7 r& ~able to intercept it by installing a IFS hook: it will not work, no way!6 i+ `. P0 G8 [  p& ~5 I1 k# [* B( M
In fact, after the call to CreateFileA it will get through VWIN32 0x001F1 U0 F# }. L9 Q( t
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)' x6 E. O/ `5 v/ r& c3 G
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
" a6 x* R# ]9 @. Gfield." U9 F, V$ C* b$ J
In fact, its purpose is not to load/unload VxDs but only to send a
- t& {/ U. ^( c4 Z& Z  zW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)6 S! k0 a! X: R0 ^! Q
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
1 O  F9 q* W6 `% B; L% B' o6 P$ K& jto load/unload a non-dynamically loadable driver such as SoftICE ;-).
9 `7 i3 [9 H& WIf the VxD is loaded, it will always clear eax and the Carry flag to allow% ?4 Y8 X3 Q" i( `6 y, h
its handle to be opened and then, will be detected.; S$ G- b  b: o% O) x1 ~- \! _- T
You can check that simply by hooking Winice.exe control proc entry point& p) V& U' B0 H
while running MeltICE.
, V0 d! F4 t4 H5 n. U$ X' Z2 I

- y. e0 j: R7 k  00401067:  push      00402025    ; \\.\SICE* A# Q; g: A# r/ i0 C1 ^/ ]/ I& g5 S
  0040106C:  call      CreateFileA2 Z% u: w5 C: n0 E9 B
  00401071:  cmp       eax,-0014 i& R! y4 @2 T  t! r0 U( ^
  00401074:  je        00401091/ [- B% Q0 X* {

& x. Z( W4 A* ^. O9 k
* G) C7 G. u; ]9 B* y& F& hThere could be hundreds of BPX you could use to detect this trick.
$ U- B# C" [5 I3 k$ ^-The most classical one is:4 k, x& H$ b6 z, O. n% [: l  D1 B( B
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
' ^  f4 B& M( o, U    *(esp-&gt;4+4)=='NTIC'& Q, g2 s+ R' _3 L% A5 y; ^
0 m% U9 g* U" G2 o
-The most exotic ones (could be very slooooow :-(2 m  S1 A7 X( ]5 _
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  # Y# n9 {7 U+ m9 y0 `
     ;will break 3 times :-(
0 Q3 R4 F5 j3 z) Y; d7 k% h/ `( r7 b+ J
-or (a bit) faster:
4 K- c% g; ?" a, _) W   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')( C8 K& d# _: D6 B( |& N, ]
6 [$ |+ _1 R9 ?/ F2 }! l
   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  ; H4 x/ L  P4 l2 z
     ;will break 3 times :-(
  L3 \6 d" ~: }( \' H7 T2 u( ~, B& z9 x* m! w$ V* e8 `
-Much faster:! D( ?8 f4 K& u5 d$ e4 U
   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'
9 U: Z: s1 u! c! D2 }
! j( g% ~9 E; s" J: kNote also that some programs (like AZPR3.00) use de old 16-bit _lopen& i3 ], U" A- D# n- `
function to do the same job:
* W1 n! K) B3 U5 H: c5 M/ K! W$ j7 `
   push    00                        ; OF_READ! H+ w9 s- y9 C* t
   mov     eax,[00656634]            ; '\\.\SICE',0
! c- M- g  S! I7 t# l! c1 h   push    eax
5 P5 d. J$ Y. y3 z' r   call    KERNEL32!_lopen0 q0 j3 c, H2 z
   inc     eax
7 U+ z& G- t! p9 \' X   jnz     00650589                  ; detected5 a+ \7 s. _& D8 D
   push    00                        ; OF_READ! M$ \6 F. N& v8 ~
   mov     eax,[00656638]            ; '\\.\SICE', J0 B0 P: v7 X
   push    eax5 p0 t8 b6 R2 V: Q* J, K' B
   call    KERNEL32!_lopen
" _$ x2 \2 Q, Z1 X) p3 J1 u2 r* {( H   inc     eax+ K2 p* B/ y% P2 F2 A
   jz      006505ae                  ; not detected( \& R. A6 H0 l6 x: a" J; |1 |: k1 s

; G8 x" S7 C0 H9 b( e# S% w% _* J  I) [
__________________________________________________________________________1 L/ ^9 Q8 }( ]2 O  r8 w6 u  D
+ @. [3 l; ~! X* k9 A. Q7 M
Method 12
5 e9 E* h+ c& U=========
; J4 x7 s. C) e! O( |; E0 |# W
2 Y6 G- V. K6 @; [% ^- _( I! z* aThis trick is similar to int41h/4fh Debugger installation check (code 05+ G. G1 D1 p# d4 ?& C9 o4 T/ R
&amp; 06) but very limited because it's only available for Win95/98 (not NT)" G& q- L* n# V$ v4 G
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
; V$ }  V5 w8 I* w1 }4 @  K; b' `! l% H6 ?6 B
   push  0000004fh         ; function 4fh
" ^" @" W1 f! q! Z+ M! Z1 q, b  o   push  002a002ah         ; high word specifies which VxD (VWIN32)
" q: R5 c, K! M9 p$ z                           ; low word specifies which service7 N8 `- K1 Y. z6 j) A) W+ B7 K% E
                             (VWIN32_Int41Dispatch)4 d3 a" T3 x' I. l
   call  Kernel32!ORD_001  ; VxdCall+ |4 r0 t  V1 ?/ B* g% f6 I
   cmp   ax, 0f386h        ; magic number returned by system debuggers
" e4 h0 T* s! Y5 D( {4 Y   jz    SoftICE_detected
6 ], u8 [( n  U  @- m
3 L5 [5 E9 |9 o; `" NHere again, several ways to detect it:
0 j, v; v' j) u: _" B. M! i4 [: q2 F- C$ ]2 @
    BPINT 41 if ax==4f1 D2 V6 c6 t$ j( p7 F+ r
5 D  \, d" u/ B5 H/ B; q
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one& ~( a' Y8 m6 V) r$ P1 L: ^  b
- W% ~6 g7 R9 r  v# r7 Q- t
    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
/ b2 D: W8 X2 C2 Y( M% B  Q2 A' k+ x* I" p
    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!4 ^, @( F: [) C" b0 A

/ |/ n- J* Z; \& V, \__________________________________________________________________________8 \+ p4 W; n1 _. U2 I+ @

' d9 o2 \8 i( [2 J$ ^Method 13' a; k: Z" ?) h, E3 S
=========
1 I9 w3 h2 f4 Q6 s7 g
3 k5 P& C4 Y8 c8 iNot a real method of detection, but a good way to know if SoftICE is
5 R; w! i" s/ R: X: einstalled on a computer and to locate its installation directory.
& \/ ?4 l" p8 `% I) M. n; PIt is used by few softs which access the following registry keys (usually #2) :
. U/ X, a% `: B$ Y3 W  h# \% U. U" E0 k2 u/ A3 L- R
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
+ z, ^1 ~7 `) w* x\Uninstall\SoftICE
3 }$ Y$ x: M2 c& H; l-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
2 x; `3 e, Q" n9 c1 ]-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion/ R9 B" O4 V) Z+ ^$ t
\App Paths\Loader32.Exe" r; U0 B* [9 o+ S6 y7 o

, R. L: |1 C9 l( j) a. Q/ J7 u. R1 Z; B- o! k0 y4 }
Note that some nasty apps could then erase all files from SoftICE directory
! m) r1 E8 c# h8 q! B9 a3 Q: ?. ^) z(I faced that once :-(& V$ m3 B# d' I# f$ c) E; O9 u

( k( h) Z+ E5 v' f- n3 p. e3 zUseful breakpoint to detect it:' \$ E  p( c) }4 {! \
" ]8 t/ V7 `0 ~( K7 X6 A5 }
     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
- c( d7 ~9 \/ g0 _- X% ?6 T1 p9 n8 z+ z3 }0 L- k8 O* Q# P( x. X
__________________________________________________________________________
$ @( [  o0 D; {( W) X" q2 A+ y4 Z; W! Z1 U3 v# W, Q: b

7 y4 v  \+ l+ N' o7 O0 Q, wMethod 14 5 L. |/ r/ k) N) ?
=========' a# U! C$ n# V) \" A# N0 I+ f. x  R' D
# c5 D. D9 |( s
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
: T; p! s$ z* w7 h* u3 ois to determines whether a debugger is running on your system (ring0 only).
: S+ @0 j  p% x! q7 r) l) l1 U, y" e4 m7 f$ t$ F( F
   VMMCall Test_Debug_Installed6 R/ A3 |$ P! ~; B1 D
   je      not_installed  u# Z: q- }2 M

5 @0 w% x9 Q/ [" y! W4 [( ^; v5 fThis service just checks a flag.0 a+ e/ r9 s8 ?$ D9 v
</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关注公众号

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

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

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