About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>* b; m' M4 Z) b' b
<TBODY>
! l% t& D0 e( X8 l7 ?$ D$ \- O<TR>0 B: O4 H4 M" j3 \
<TD><PRE>Method 01
( a8 z- [' D6 T' s9 C% K: p/ `- T' M=========
" p4 z- t- Z2 `* U$ P' K/ f1 w9 E/ Q
This method of detection of SoftICE (as well as the following one) is
/ P3 j, M* n7 I! M8 n( F0 k2 mused by the majority of packers/encryptors found on Internet.8 Z! B5 H6 R0 M% T
It seeks the signature of BoundsChecker in SoftICE5 c" b2 f8 K- a9 m0 b8 s5 b- J

# J" S% o. p6 X- U% ]9 P    mov     ebp, 04243484Bh        ; 'BCHK'
9 K$ Y- T3 q1 |! A3 l  N    mov     ax, 04h$ C* |+ B0 X/ t  e# Y1 Z
    int     3      
" Q9 i0 X2 R. I# @    cmp     al,48 f. a) O9 ~: ]$ _0 M! K
    jnz     SoftICE_Detected
; s) \! R. v/ E% d  A0 u
8 n) t, a; y' B- Z4 ^___________________________________________________________________________1 A* u* V4 @. l' T$ s$ Q
! X( l0 M, y% L' c* E6 v8 m# k/ Y: u
Method 02- F9 ~; U, y9 P7 T8 b
=========
8 J5 j+ n! n7 i" X/ Z  R# I' X7 T) G  K/ ~
Still a method very much used (perhaps the most frequent one).  It is used( P- k4 T3 Z; B0 _; I  n; u2 l
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
6 x4 S, b' [8 }8 a3 C7 t; lor execute SoftICE commands...7 J0 I/ I7 ^) k9 @, e5 D
It is also used to crash SoftICE and to force it to execute any commands8 O6 K( V$ e" h8 A# q7 A
(HBOOT...) :-((  3 }. f' O; G  o3 M
2 O, D# I, O0 S7 Z- n( d: B9 l* X
Here is a quick description:- E7 Z' Q, V9 Q& B& H$ f
-AX = 0910h   (Display string in SIce windows)
, `; ^) U; w" ~# N3 i3 G0 w% j-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)
5 h( Q- S  ]& ~. y" y7 L8 ?-AX = 0912h   (Get breakpoint infos)$ L  j4 ]1 V0 Z! l& z
-AX = 0913h   (Set Sice breakpoints)
6 q8 f; d  c6 N, n2 _-AX = 0914h   (Remove SIce breakoints)
1 `- a  D. C' z0 C( K% q- [- h  k4 c& N9 V! _
Each time you'll meet this trick, you'll see:/ l: a4 E  j. w0 L$ W0 B- Y
-SI = 4647h
" z+ R4 Q, m3 o3 R! \5 @! U' f-DI = 4A4Dh0 R- d0 C  g7 J' ~$ D& D
Which are the 'magic values' used by SoftIce., y  U( H$ Z2 g) P. ~8 M, _, w
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.' |6 J8 u0 d! N8 Z6 o

  P" M% U' W, g0 K& y3 s9 BHere is one example from the file "Haspinst.exe" which is the dongle HASP, D* w* |8 J& M5 _6 b
Envelope utility use to protect DOS applications:
+ ~3 }3 t4 A& t& @' z  ]& Q# B; V* t+ s: v8 x
, F* h1 `; l% Y1 |
4C19:0095   MOV    AX,0911  ; execute command.: x2 Q2 x/ m% @9 U) d! w
4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).( r* ~& B: T" L' b5 b. k& M
4C19:009A   MOV    SI,4647  ; 1st magic value.
  l* N! d# T, ~8 N4 P% u4C19:009D   MOV    DI,4A4D  ; 2nd magic value.
$ I$ P& `( |3 J. L, o3 G4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
4 b% e/ Y& p$ l- c; V5 `4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute2 {# G1 O1 b3 V
4C19:00A4   INC    CX
6 J8 a9 O4 Y. w! E( I2 D4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute
* I% ]$ r3 I' B# \" x# n4C19:00A8   JB     0095     ; 6 different commands.% v# S4 F4 O0 a8 X' M
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
6 {1 t" c% F1 n) C4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)8 V! d/ x/ ^0 h7 v$ Q$ w
0 @* ]( c" F: G/ W2 O- L
The program will execute 6 different SIce commands located at ds:dx, which* w9 y3 C  P# a' P
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.' t* i# {% e, j. W8 D

0 {9 z6 s0 h4 |4 E* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.6 ?8 a0 Y  T+ s" J( G7 g, y
___________________________________________________________________________
& R, m; L+ a+ U# h; J
' J3 c! i, r# s9 N1 @' A
5 T' ]8 B/ q1 }# g  Q* Z" QMethod 03* T2 C. m) c: @& l8 Y8 J, z8 g; P/ C" f
=========
7 m6 ~0 F: N' f; k" I2 c8 `  M4 V6 o# J# i# [0 M( U; t4 l
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
3 W( l$ y: c( a( _, m- X# \(API Get entry point)
, d' u* E& Z+ x* D- C$ ?& |        0 R0 s; \# |6 k" r. l

% n9 A% E9 u7 ?    xor     di,di
3 X3 A. i0 ]- q    mov     es,di
& m+ w9 R0 F; ^/ c+ k" G    mov     ax, 1684h      
* R+ @9 m/ X4 d+ e    mov     bx, 0202h       ; VxD ID of winice9 @/ u, v3 J  n) e7 _) f" ^
    int     2Fh
1 z- ]1 t9 l3 D    mov     ax, es          ; ES:DI -&gt; VxD API entry point. O* R9 J* F0 s( @
    add     ax, di# f9 O& N3 ^7 e9 t2 o
    test    ax,ax
4 v  n2 [& G; g    jnz     SoftICE_Detected
' n% g1 |  u$ W+ l" y8 L) Q( }! v3 R4 k9 X( _% |- _& j) @1 Z! T
___________________________________________________________________________: p+ c; f: a$ M8 Y7 M
. _8 p8 |& P: G9 w: b$ b3 j
Method 04
* J  [5 c& y! }6 X=========
% _) z( I5 R, [* W5 Y8 w7 \7 T5 a
Method identical to the preceding one except that it seeks the ID of SoftICE
) x: Z/ Z; N) E7 y; e9 r& F4 q  z4 L' ^GFX VxD.4 V& U' |# m( }5 `0 k
: T- ^7 E$ \/ f% L4 a
    xor     di,di
8 [$ J+ ~  J3 ?8 Z) N" ?2 x    mov     es,di0 S$ y1 B% {% U! ]  k/ ^" [
    mov     ax, 1684h      
4 F3 e% ^$ g7 Z6 U4 X    mov     bx, 7a5Fh       ; VxD ID of SIWVID
' i( e* m+ k3 |% f. c    int     2fh) w& v9 A# S+ d# g4 [/ S
    mov     ax, es          ; ES:DI -&gt; VxD API entry point/ A' h* X3 h4 E: o
    add     ax, di
5 Y4 J/ ]0 q. w    test    ax,ax
: F0 X# C8 d) E( _0 @; R! g8 ]    jnz     SoftICE_Detected
9 Q, U% T- H% t6 ^6 Z/ [- _: z2 _1 E/ F8 W  B( d$ `
__________________________________________________________________________
& Y5 F6 T! H' k* v( }( Q* J! r
- M. U5 w+ `+ V& H1 q2 i- D9 k% q. l9 H+ |/ s
Method 05) A* x8 m$ T; J0 |( d) E' X
=========7 A7 ]% u+ d1 T' O- |6 K
  A. q; e1 ]$ r  c
Method seeking the 'magic number' 0F386h returned (in ax) by all system" V8 i0 ]+ v) f" y! ~9 b7 t9 J
debugger. It calls the int 41h, function 4Fh.
  \9 s, U! w  z5 ^There are several alternatives.  
* x7 e& V# X1 i: Z
6 S% S' r6 v, i3 q  X) U% }The following one is the simplest:
! M. r7 y) j7 {+ T8 \/ v6 [* x5 m% |7 t4 i2 F# l
    mov     ax,4fh$ [6 S  y2 M* p, l
    int     41h3 }* y, Z7 A# F! v
    cmp     ax, 0F386
+ u/ y; y$ ]8 U1 d    jz      SoftICE_detected/ F  l% a% {, ~: N( g
( T' p! @! N/ t- N! b7 Y* w

7 z6 u, q) A0 u6 TNext method as well as the following one are 2 examples from Stone's
5 ?  H. R; k- B# p0 Q2 t6 e"stn-wid.zip" (www.cracking.net):1 E6 E4 K0 B: `) Q
+ y# _9 Y# d- K) Q  }2 Q6 Q
    mov     bx, cs& H6 t  F9 t& d- u8 m. |
    lea     dx, int41handler2
2 ~1 y1 Q; {% W$ y$ ]" P9 D    xchg    dx, es:[41h*4]/ u, c9 O! Z% J: @
    xchg    bx, es:[41h*4+2]& ]) o( C8 Q$ F
    mov     ax,4fh1 ^. [5 y' \: S  s& B
    int     41h
$ ]* E6 d. t' ~* W# T" Y    xchg    dx, es:[41h*4]
" b: o& i- J! _# `    xchg    bx, es:[41h*4+2]
& _5 x1 {9 X# v1 m7 u    cmp     ax, 0f386h2 e* z2 g: i9 p' r
    jz      SoftICE_detected# G, x# k9 Z& I
2 k3 p+ f. p) [1 ]9 q
int41handler2 PROC
9 s/ i& ~5 l- J0 e" F  v) Y    iret
; g' E: i  l" z+ Nint41handler2 ENDP
8 x2 s- h; v$ C
/ X+ k  c7 K' `( t$ x. g' F5 o7 C2 @( X' b" [
_________________________________________________________________________" [& \! k! R1 Y0 H6 }7 r

: r$ J  W0 a& E/ p( Y7 u. W7 R% r  @7 |5 H6 S; z, N
Method 06  q) E$ L* `  k. W# z4 E
=========. M0 t+ a  I: E' ]. d6 S* i4 {

6 r# Y5 J# @5 F/ g  x/ H( c! w  G  L2 l3 L3 p! U7 p4 {" F
2nd method similar to the preceding one but more difficult to detect:9 x# N4 e. E- N8 `0 k

/ a( X5 @0 N/ i: ^( Q& D# i- A9 e% j
int41handler PROC
/ ?; r4 Y( X4 u: J& X( D. [    mov     cl,al' {3 K& c: Y8 I3 |! l% O: C
    iret
+ `) E$ n5 `% |3 H  Q1 k  jint41handler ENDP+ b/ G. j! w7 @0 g3 R: W" p) o* D
. `! o4 n, A! R5 M
0 C/ R0 @3 p' x; o9 v5 U% U0 ~) y
    xor     ax,ax2 K& i- P3 @* e. K# G$ J# E
    mov     es,ax
/ ^+ D6 M5 ?7 O0 l/ i, Z. j    mov     bx, cs+ x* V( `2 [8 j  N2 C, E- K1 v
    lea     dx, int41handler
, i- j' t8 ~  x    xchg    dx, es:[41h*4]
1 V) N  n) Y! }( D2 _9 r6 q    xchg    bx, es:[41h*4+2]
; \" a  I8 Z8 c! n; g    in      al, 40h4 H- H9 m, l; g9 \( C: j3 h! H
    xor     cx,cx
8 r' f6 e2 q) J# c    int     41h4 w8 M0 w8 v) R# d: f
    xchg    dx, es:[41h*4]
8 P; g; ]% B9 ?# Z, A- e- }& f    xchg    bx, es:[41h*4+2]8 j* [- x  a0 ]! G4 Q
    cmp     cl,al
6 A6 H+ R. [/ R8 X9 b: O    jnz     SoftICE_detected4 P- y. Q; E, r0 J! p; ?

, s" X* ^' s  ~_________________________________________________________________________) x' J. \/ n+ L  I7 w1 h0 z

5 G- Q! ~& \7 Y8 CMethod 07
" Q/ a! n, b0 v1 s! D4 Z=========
6 Z5 m* Y: d7 [1 [6 E+ A  L5 g# }3 L/ E$ _5 B' j+ G- L  E9 }
Method of detection of the WinICE handler in the int68h (V86)/ N' D$ i# t/ @: ?9 Y. M
% F, g/ |( z6 c3 g- l2 c6 Z
    mov     ah,43h3 T/ l5 h  r' r( `7 s+ Y  q
    int     68h  W8 F: f$ g. {& t
    cmp     ax,0F386h4 _$ _% V' V) [( q, G' y
    jz      SoftICE_Detected
& J. k, t: l2 t- m: ~. q" a8 o4 I( C& J
) c: ?+ J  F* h
=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
% `' l- f5 T% i( s5 `   app like this:- X% D3 }; ]) J, ], y

8 X+ Y& ?& t6 r9 V- p# _   BPX exec_int if ax==683 g! k" j$ C' B. G8 O% t
   (function called is located at byte ptr [ebp+1Dh] and client eip is
2 g/ g4 T. L7 ~+ ]1 k9 J   located at [ebp+48h] for 32Bit apps)
7 Q9 }! L/ o8 m, y  G6 e__________________________________________________________________________; {$ A, p1 `  f9 `+ d
$ f) y1 x% r% b  R' T, U) G

3 @" _* Z6 c# Y4 @Method 08
* s& u1 @- r4 ?: z0 \- c0 G=========3 _6 P1 J) s/ B; I: `) A+ e6 H

7 W: o/ \5 g( aIt is not a method of detection of SoftICE but a possibility to crash the2 }% k# v2 C7 g
system by intercepting int 01h and int 03h and redirecting them to another
; y% g1 o3 Z  D" T: Y6 \' S6 Sroutine.
/ T4 F3 y$ @( I: H! ^0 e5 |9 ], hIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
6 J2 [+ G% I" }" s8 d# ?to the new routine to execute (hangs computer...)
1 j3 f" m) {2 T9 l# @0 `0 w" O' V
3 J1 D4 [% ?% F; Q! U. M    mov     ah, 25h
+ f% ~: u& V, T( e4 Y) H7 a1 x    mov     al, Int_Number (01h or 03h)
+ Z* n! P3 f% B4 q/ {    mov     dx, offset New_Int_Routine4 D4 |; e, _& Z7 ~( p" n* _
    int     21h
! ?' r8 {( C5 f. l6 s* q$ m# s" A% z: a4 F1 V! m# a, P
__________________________________________________________________________
- z& H0 h' a$ y& G$ V) H' {3 C# Y) t* Z: f" d
Method 09
0 l- U3 u( x4 p$ S5 C. W' H=========
# i$ o' ?% i$ v6 t) O  g2 t$ a9 S0 c
. R" ^! U6 ?- wThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
5 `" i. ]" c: i2 p! dperformed in ring0 (VxD or a ring3 app using the VxdCall)./ ]% u0 t$ _. o6 |
The Get_DDB service is used to determine whether or not a VxD is installed' [* q% W  ^/ l% q) n
for the specified device and returns a Device Description Block (in ecx) for4 V7 N0 D+ O8 _3 W8 F+ b) g! z0 q) n
that device if it is installed.3 L2 o1 Z0 w% \  l

5 A6 f, M$ f3 w% M- ^4 \   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID
2 g  l- I; K5 k4 f/ a   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)" A. Y0 w$ T7 X% W" {4 y$ g
   VMMCall Get_DDB
! g) c% Z% P! w7 W7 b2 C/ W  P9 ~0 A7 S8 _   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed4 X4 G; I- O# E+ A) K7 v& U

9 d0 D  X4 \" x9 J9 ^% j3 v+ cNote as well that you can easily detect this method with SoftICE:
! E& d4 @# F, A1 s8 n- U   bpx Get_DDB if ax==0202 || ax==7a5fh  [0 R4 o  s- G2 P$ {6 z) c1 H
1 i: F3 b/ m0 F+ i& z2 k
__________________________________________________________________________( Z. ]4 v& [( r' i) i. u' w0 V+ N
/ m' g& p8 V+ Z
Method 10  F( T: h9 k/ S# b, U8 L
=========
& R7 L. S, E7 R1 z3 M6 l' a6 O. P, u
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with4 l8 {) p  k! R9 r
  SoftICE while the option is enable!!
% B, t" c" ^2 p, m6 o/ @
8 Z2 g$ \5 n* i0 T3 tThis trick is very efficient:( `5 t+ s8 l* i* y
by checking the Debug Registers, you can detect if SoftICE is loaded3 d$ k1 n/ g' I: E8 k. m# g+ M
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if5 L6 g/ ^- \8 z% e
there are some memory breakpoints set (dr0 to dr3) simply by reading their- d1 g/ n4 q, t9 b6 C6 d) [( W
value (in ring0 only). Values can be manipulated and or changed as well% j+ N5 s" E% [  Y& f+ K
(clearing BPMs for instance)
8 @% e( w* o5 Q* }. B
8 G+ i/ y) H1 Q& r; Y0 G' c$ a3 |9 U__________________________________________________________________________
/ p0 Y1 Z) |& S) w/ @8 Q
5 G# Q% F$ \$ Q2 v2 I# OMethod 119 l* X7 f; E- d- G. o) g* R- e) r
=========
: M8 Y& p- t. K3 g' D/ p2 _: w* P5 Q
This method is most known as 'MeltICE' because it has been freely distributed  h0 O5 r4 Q1 o4 i" k+ M7 N2 B
via www.winfiles.com. However it was first used by NuMega people to allow; o! i2 C" U, f5 p! x4 Y% N
Symbol Loader to check if SoftICE was active or not (the code is located
9 ]% `4 `. b" E+ G4 X/ _. I( Jinside nmtrans.dll).
$ s7 Q% \1 j' w; T9 w& P5 d5 D; `( Y  f5 o) `# D
The way it works is very simple:
2 g; I* D* x' M# x6 TIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for( A2 N* k$ @, J# X( D
WinNT) with the CreateFileA API.3 _" `; L2 p+ m% u4 D" t0 J

4 e* D% s; Q/ @9 a8 O3 CHere is a sample (checking for 'SICE'):
8 l0 n; o0 H8 ^; f- D2 G' u* N' B/ u( _& B+ {+ |
BOOL IsSoftIce95Loaded()8 t2 m( x1 D4 d0 M
{
8 M/ G- x7 \, [- [8 h$ ]0 p9 g4 H   HANDLE hFile;  
! p1 {$ P' ~8 Q" H/ ?7 Z  V   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,% r4 x% t- X0 d5 r; Y# T: v
                      FILE_SHARE_READ | FILE_SHARE_WRITE,
. @+ u0 h3 o) s# o5 u/ w                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);$ [- |& ~4 D& H3 O7 r8 J4 k
   if( hFile != INVALID_HANDLE_VALUE )* ]$ a: x& a! u+ c! J  J
   {
9 ?8 n0 n+ n# R2 u4 G7 r      CloseHandle(hFile);4 v" ?1 D1 B3 F0 w: m* @! \) T) }, ^
      return TRUE;
. t+ q( o: \2 z/ `. w, Z   }
- A$ B! g, X1 N4 Y   return FALSE;/ z0 f9 p7 O. \4 o$ R
}
0 C4 }' F1 w8 I# L  |" n4 H% |6 b  q% X+ a( T9 `7 @* o% H
Although this trick calls the CreateFileA function, don't even expect to be5 T& i8 u$ s2 p5 l4 W- _1 i
able to intercept it by installing a IFS hook: it will not work, no way!
" m: c# r" L7 n7 W2 l0 ^In fact, after the call to CreateFileA it will get through VWIN32 0x001F
4 ?0 |) j9 E3 ]service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
* L' R- Q; M% k& |and then browse the DDB list until it find the VxD and its DDB_Control_Proc  c3 @( l  O* v3 Q
field.3 ]" P& q/ ~& X) g9 F3 u5 T
In fact, its purpose is not to load/unload VxDs but only to send a - X3 S& z4 n; L( s9 Y/ A
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)8 C0 C7 l) l. ~: \& z& O
to the VxD Control_Dispatch proc (how the hell a shareware soft could try$ ~, x3 T% y$ u) C" L( b, W; A9 ^  ]: Q
to load/unload a non-dynamically loadable driver such as SoftICE ;-).- n0 ~, i2 y# I* b
If the VxD is loaded, it will always clear eax and the Carry flag to allow
0 t6 t% r5 \3 L) v% l5 \4 {8 j2 \% Hits handle to be opened and then, will be detected.
( J1 E( f8 o* SYou can check that simply by hooking Winice.exe control proc entry point$ O) w/ S& j6 S8 u  u! y
while running MeltICE.
" Q: Q: `7 `0 c
- }, |$ j: R2 L' s3 z" M; b8 n
- V' O/ ?0 R# _. i) h5 C: t3 h  00401067:  push      00402025    ; \\.\SICE$ M! r! w9 o3 I4 E% q
  0040106C:  call      CreateFileA
7 M/ H0 f4 g. ]" Q0 o5 l  M9 ?6 B# H  00401071:  cmp       eax,-001
; z2 s7 D! I3 e. L/ t5 v  00401074:  je        00401091: K9 j( B5 i) j& U# a& V* j

8 |  T; Q. }1 I1 g
2 E, }+ D& z" }. IThere could be hundreds of BPX you could use to detect this trick.. j5 Y' Q2 {- w% `1 Y
-The most classical one is:; x7 F; N' y) y  c6 I6 R
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||( f" P0 H% p3 m) D. Y/ z2 K
    *(esp-&gt;4+4)=='NTIC'6 d0 t( t) k& e

* c* f- h1 H$ m-The most exotic ones (could be very slooooow :-(7 w& U9 ^2 P' M& I8 j# m& _8 a: j$ C
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  
; W& I: `6 `9 ^     ;will break 3 times :-(1 P7 ~2 u- I' J

1 l# a+ y5 [; ^3 o' a3 Z* H-or (a bit) faster: % N/ E5 r+ W4 X9 `3 v
   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
/ `1 f7 z% S- ^; C6 B- P
# t) b( K/ Q# M( `6 {% C9 l* K   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  0 ]3 \  K" R5 L
     ;will break 3 times :-(
& y2 Q  ]7 v; A5 V) @* R
% X  X& R3 M% M* Z7 J* g+ ?$ Q-Much faster:! j6 Z) d0 C: M4 m9 T! l. C  g! [
   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'6 Q9 F9 G# G* V2 s) Z% \  S# A, ^
7 Y- e9 X% d5 D5 t
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
; E+ M; z/ S4 ~function to do the same job:
( \/ ?+ ~; z5 A6 E7 D1 y7 `8 A* k* r0 \! u: }4 e3 c$ u' M
   push    00                        ; OF_READ  Y6 @1 E, {' C  P. O
   mov     eax,[00656634]            ; '\\.\SICE',07 i! b' l* u/ L+ I' O
   push    eax
7 S/ m; Q1 g0 e; J+ U1 s   call    KERNEL32!_lopen
! i, J% c- q, _   inc     eax
3 P; `; V/ _8 Q   jnz     00650589                  ; detected' {+ D" T* e, s& R) R
   push    00                        ; OF_READ1 h  X  d4 ~" H2 @; G! {2 S% {
   mov     eax,[00656638]            ; '\\.\SICE'
9 l) {3 D7 ]0 i9 K5 S$ C   push    eax6 u" B- ~, ^: c
   call    KERNEL32!_lopen! Y* U8 }: y( ^  X  y! f
   inc     eax; h5 z" J: x4 e0 L. M6 A
   jz      006505ae                  ; not detected
) S- K9 M* ]; e, |* w! |
6 ]1 H- Y  `2 U$ J+ @$ k) a
8 w( j, ^) p4 v8 [__________________________________________________________________________
* B  ^. m( H2 d2 P& a2 ?, h, U; @9 l& R9 l+ U, m2 Q! d! O0 \
Method 12
1 o1 G8 {- F) A; q+ N=========
+ W6 M% N" b: g& k% ]  {9 ?3 B2 y; o) m" m, f
This trick is similar to int41h/4fh Debugger installation check (code 05& A# {/ j+ S" V+ M2 I
&amp; 06) but very limited because it's only available for Win95/98 (not NT)7 x0 z7 _, A$ D) {
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.5 a$ _' @4 O0 ~$ z

4 y$ H9 H$ |+ W4 L9 A   push  0000004fh         ; function 4fh
9 }* _% }+ z4 c7 A4 Y! a0 o! h" K: {8 b   push  002a002ah         ; high word specifies which VxD (VWIN32)
) @5 V. T1 y; Z: S                           ; low word specifies which service! y& @+ X' Q- f, B% Y
                             (VWIN32_Int41Dispatch)  h2 g$ J% ~, m; M/ [
   call  Kernel32!ORD_001  ; VxdCall& R  i$ R/ {- _& V5 s  M
   cmp   ax, 0f386h        ; magic number returned by system debuggers- E2 V1 W6 A0 d* t: g. p) q# W
   jz    SoftICE_detected& i; Z6 p" @4 t% O; L) o$ i& R

/ G  D$ u5 u: Q9 ~Here again, several ways to detect it:/ g3 W8 a7 H) Z: m% W! h) g
  {( b' Q8 e7 ]/ b1 p4 l
    BPINT 41 if ax==4f+ T& s* Z* @. U9 c( b

* l& R- l& `) s1 B) o7 D    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one* ~, J1 W: A) R- s" k; `

' f) k( N- v- F    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
) g5 ^# I2 c1 \$ G1 ]) D+ h7 i- R( j+ q* P* j
    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!9 A8 p9 @- e2 ^8 w# _3 ?  C# l

9 e1 \+ _0 m7 L/ j( f* a__________________________________________________________________________. @, Q; O0 t8 q4 d2 Z- E
1 a' O' ]9 n! k4 e, y
Method 13% Z+ d4 c# T: ^3 L+ y
=========, ]2 m; m9 Y5 @

( _) N) e' D. Q3 F0 CNot a real method of detection, but a good way to know if SoftICE is
4 F1 Y% B) @+ q# G) C/ Y  U. t9 ]# ]installed on a computer and to locate its installation directory.8 p* D$ I& k1 `( _) M  f
It is used by few softs which access the following registry keys (usually #2) :
4 m/ q  l1 ]* @
% k& v4 z( y3 ]3 P" N8 n-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion( c: A* t" ?% X/ `3 X' P# p
\Uninstall\SoftICE" H' A7 h3 @% `: m4 F
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE8 z9 `8 W% b  r* t. z$ B
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion- l( C# F: t' p. [( h
\App Paths\Loader32.Exe
3 x+ p4 q" m4 m% R1 A% Y2 `' }0 B( D; P$ y

, b. M1 n( H0 p) dNote that some nasty apps could then erase all files from SoftICE directory( m' n' l3 m/ @# a$ X. E
(I faced that once :-($ ~6 o: w( g  y2 t
, ]1 q, {+ D1 C2 f6 U" x9 \3 A/ q
Useful breakpoint to detect it:
# R* G' h! E4 V: r, Y: D0 Q
( e6 k& d2 f  \: g! ~     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'9 Y, b( I% n& z8 ^! F2 H% A1 b
" a% F+ r4 F/ a9 c4 l1 X, k
__________________________________________________________________________$ B8 Y7 N; d3 `

* L; [+ E+ y2 ?- S
$ R9 r4 ]7 E8 u/ E( L: {Method 14
# b1 Q6 i; V/ X=========) j; F4 T' u0 K' b# A" f
, t0 T2 ^" r+ O( f) G2 E, D
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
! C5 ^& ^' ~( w4 |5 his to determines whether a debugger is running on your system (ring0 only).) d1 e$ t8 `6 H: L+ ?/ R

7 _1 _3 y1 F7 ~   VMMCall Test_Debug_Installed
4 _5 y$ W6 ]3 z; P, l6 N8 u2 X) s4 a   je      not_installed
! F4 s' ]* r% T
) A, E* j3 [' KThis service just checks a flag.1 P- a9 x$ Y4 Q' {
</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关注公众号

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

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

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