找回密码
 注册

QQ登录

只需一步,快速开始

About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
; s' Q" Y- ^! v2 b' J0 ?* n7 Q- }) y<TBODY># W' y) d2 T- O  T, ^7 Y2 N
<TR>0 T! s. g3 e) a4 h/ o7 A
<TD><PRE>Method 01 , W5 w" r2 C) p( n
=========" k& l* Y8 H0 y; E
( v. r( j) b* R4 m
This method of detection of SoftICE (as well as the following one) is
$ h& Y8 A2 m& j6 [& p4 V# tused by the majority of packers/encryptors found on Internet., K6 }, {* \6 J, U' ]& Q- a' v
It seeks the signature of BoundsChecker in SoftICE
, O0 r: [* c, }
0 _6 a! @* J4 m6 W! p+ `    mov     ebp, 04243484Bh        ; 'BCHK'; O% ]5 d% C: K$ M& h! |9 c* G( H
    mov     ax, 04h
( w& o+ T8 Z9 q# {$ N" c! W# T    int     3      
/ c$ j3 Y: Q: l4 I    cmp     al,4$ D  E% K3 s0 \
    jnz     SoftICE_Detected: Q- V0 [. r3 X0 K. T
, g! l0 ^# F$ B. R$ J' o2 a
___________________________________________________________________________
- i% m, q+ I2 _; _7 d0 x- @1 ]  b5 B- U/ }. a2 }
Method 02
: o$ D' Q6 g' Y/ A$ x/ a=========
4 T4 V7 o7 Y/ N' E% b' j0 Y# P5 q- \; T* L
Still a method very much used (perhaps the most frequent one).  It is used
  M' y: U, w4 w- i# i. Eto get SoftICE 'Back Door commands' which gives infos on Breakpoints,' G5 d/ Z2 s) c6 f% t0 X
or execute SoftICE commands...' a( J# D& {) M8 q2 ]/ Y1 }( P
It is also used to crash SoftICE and to force it to execute any commands) z' z: `+ F; u! k7 I' N/ G
(HBOOT...) :-((  5 X0 ]+ s5 J* O( C3 t" L
! g' h& I2 A3 ~) f2 s
Here is a quick description:
/ X# z9 A/ m/ O-AX = 0910h   (Display string in SIce windows)% q2 P- _% i2 p  b
-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)5 X6 P. F4 C4 N) n
-AX = 0912h   (Get breakpoint infos)+ V3 N7 A5 }4 b. j0 ?$ u' R
-AX = 0913h   (Set Sice breakpoints)% Z+ ]  g4 v9 H# o& I+ ?
-AX = 0914h   (Remove SIce breakoints)- m# G4 M; O6 r* o
6 D3 W8 K/ [3 w( K% a# b
Each time you'll meet this trick, you'll see:0 [* u* Q* X0 e* ?" W6 e
-SI = 4647h
: [1 R) W. {7 a1 p5 W-DI = 4A4Dh
9 g+ r: t# T% x; M$ N6 Q5 w4 B8 yWhich are the 'magic values' used by SoftIce.
: f1 E6 v: _1 n$ kFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.) Q$ U0 n7 f6 V  z3 A
4 D4 Z2 m- ~2 f$ x7 ]3 W! i) x9 `4 K
Here is one example from the file "Haspinst.exe" which is the dongle HASP
2 [$ B4 d3 S" k  {1 _3 YEnvelope utility use to protect DOS applications:% x" `9 W+ P! m3 ^' P6 H

9 K" _: J/ ]" q9 y8 B7 e
/ O9 H- \8 [' |% j8 f8 I4C19:0095   MOV    AX,0911  ; execute command.
; d; d8 q+ I  p5 K5 A0 k+ w' E& @4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).3 \# S6 e" O4 r$ Q0 ]+ \
4C19:009A   MOV    SI,4647  ; 1st magic value.* ~/ m9 E/ H2 g8 y& b5 f
4C19:009D   MOV    DI,4A4D  ; 2nd magic value.
$ ?3 e$ p) d/ M4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)' [7 }) V+ h' W* q/ F/ c
4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute
% V+ ?! Z) ?& I& y( T4C19:00A4   INC    CX5 l4 [* {  v  f7 `7 x. Y
4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute4 D% l$ F/ f6 O* M* o4 m9 J
4C19:00A8   JB     0095     ; 6 different commands.. R* l. _  r8 ]# H2 B
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
. V- P0 j, s. d4 I4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)
* C/ t' |' \& H2 `+ u" E: h" z# b% m# ^
The program will execute 6 different SIce commands located at ds:dx, which
* ?; j9 l* [/ L6 T$ q7 a0 {are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.) I. u# v7 {0 J5 z4 J% i/ U+ q

, |5 E: x6 P" `1 J5 [; `* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.8 p4 m" Y+ d4 N5 g& F
___________________________________________________________________________+ E6 A" j8 y, a2 T3 h8 n) @' t

/ U1 u5 v& U8 y. s  F! ~& p
) q9 v& n6 }; O$ B7 @Method 03
4 N! ~1 n, b% ]=========, L9 N) H# Q+ p2 s" I! @# v$ o

9 Y& C# ^+ C8 X" m( eLess used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
* z" n" D& Q$ u- k7 h1 g; U(API Get entry point); z" w4 |) S: _) ~4 H) y) I5 L
        
# J/ f! C& d: G' ~2 p1 j: I
. Q$ w- k- t  u  v! h    xor     di,di( x. ]+ Y+ K! ?
    mov     es,di( ~. B% u/ X2 K: _2 x
    mov     ax, 1684h      
1 d% {) }; c9 ]- P- U/ {1 I( ^& ~    mov     bx, 0202h       ; VxD ID of winice0 n! j2 D- A# i3 o
    int     2Fh/ I5 ~  E6 Z5 ]! y1 `+ ?
    mov     ax, es          ; ES:DI -&gt; VxD API entry point
& v& o' v7 m4 [5 Y* x    add     ax, di' ]0 s' e1 K2 d0 R, ?
    test    ax,ax  x8 ?  G1 J- M; Y+ f
    jnz     SoftICE_Detected, v3 O9 {4 `0 q9 m$ _

2 ~, o. J8 f& Z2 U  |/ d___________________________________________________________________________9 Z( f  L) ^1 p  I: ~/ ?( n1 f3 z

9 S* ?! ?0 @6 Q1 X* \Method 04
/ ~+ h4 l+ k* w, a9 S=========
4 q% v5 x2 Y' g8 w6 D; o; i" t$ S1 Z  z+ ]: A
Method identical to the preceding one except that it seeks the ID of SoftICE
$ C) v" A: z+ O' L( _/ ?% A  IGFX VxD.* H1 n* z) L$ _9 h( O/ k) @, S  p
) v; Z' V8 t3 V# O9 k5 a$ c; e3 U
    xor     di,di% @/ S9 f( e7 c& d: K+ t: L/ V
    mov     es,di1 V# A- K2 C9 Z- F/ P, f
    mov     ax, 1684h      
6 Q% \: P6 }" |; W    mov     bx, 7a5Fh       ; VxD ID of SIWVID
5 M; G$ I# a$ c8 r  Y* V3 W5 ^    int     2fh0 P7 ?6 T% d* g- L1 h0 g1 q
    mov     ax, es          ; ES:DI -&gt; VxD API entry point
2 D3 {; {! t  U' J6 P2 g9 q3 e7 t    add     ax, di
* m" i6 l7 g' z7 |- g# n+ {& {- z    test    ax,ax8 J& f$ c' B0 w- ^. G; o) J- x
    jnz     SoftICE_Detected
! f: S2 f; T* S5 e: K5 G1 c5 w) P) |) ]' g: h! w
__________________________________________________________________________
6 w+ U, q* N) M! N8 |+ x6 F5 ?3 m0 a0 ~) n
7 a( @3 _% Z6 q7 V
Method 05
. O9 e" S$ G# c' s4 M=========+ B$ i( _4 D. T( H5 s, V5 k
2 E# Y8 ?" i( X1 x% e
Method seeking the 'magic number' 0F386h returned (in ax) by all system, ~7 Y: i8 y9 O: F$ U
debugger. It calls the int 41h, function 4Fh.' C" \. [# f# ?0 @
There are several alternatives.  
! L4 F$ t7 G# c( Z; G/ F2 e
2 D2 z% N( M$ H* J. WThe following one is the simplest:. j. _3 w0 d1 R' a% T) Z% P
; E7 m. P1 @" J: k
    mov     ax,4fh3 H. v+ {( J  c% A2 _4 K
    int     41h- y' _& ]3 L& u7 A
    cmp     ax, 0F386+ f* b9 a3 z$ z6 i
    jz      SoftICE_detected
- z, Y5 Y2 L$ ^: R5 W- T
$ ?5 S( Q7 H- u/ [
3 `/ w* x* ^5 E# u! K, ONext method as well as the following one are 2 examples from Stone's - X, ]' M( B$ F7 T+ J
"stn-wid.zip" (www.cracking.net):! O  D! w& A( v
8 t: b" e" f+ M2 ?  b
    mov     bx, cs* f* b6 y* E3 L8 D8 z$ }6 r
    lea     dx, int41handler2
6 O' z9 d) k- k$ G; _0 |: M, m    xchg    dx, es:[41h*4]' _# H- E, h. \; x
    xchg    bx, es:[41h*4+2]
# b$ U% t* T, {/ @2 v* y    mov     ax,4fh3 F- j  h& P( a6 ~& D3 ~- }1 w
    int     41h+ v, U; T  m$ U  P% c% T7 ?
    xchg    dx, es:[41h*4]
* J# G8 `, [$ j4 F) T- G1 i    xchg    bx, es:[41h*4+2]
$ s0 k. f) R+ d: T) g& k    cmp     ax, 0f386h
+ e7 W% F/ k1 d9 p4 H    jz      SoftICE_detected/ G1 R) M1 r% d8 C5 q5 M  @
5 D8 n+ G- V, {; W; s: u5 \- e' @
int41handler2 PROC
' Z$ O( `: J( Q$ U    iret9 o* i8 G2 R. w1 X
int41handler2 ENDP
  m) R" B  I' G' ^2 k, A+ Y; U/ u/ G. V
! B1 L+ j3 [5 a
_________________________________________________________________________
: p- N& h3 ?+ z2 @5 w& f
  a3 i& j8 a$ T& S7 S6 j
% N( A4 z% o) Y8 @: QMethod 06
! d" a$ `9 b+ O& `! O=========
: ]) p( m! z5 I' t- m- Q3 l
- h3 m, O5 `4 G' @2 \) l, o7 c! u  H$ w0 v8 ?
2nd method similar to the preceding one but more difficult to detect:
8 p" H, b& U0 C4 t! Z4 b- r% x4 T% K3 U/ x* Y) e; B3 c' W: b

, B4 k7 X8 C" |0 yint41handler PROC  A& h  z4 K: w  t9 A. e( R$ `  R! M
    mov     cl,al
2 R! D! h# M0 s    iret& Q2 v$ Z3 Z  }9 f
int41handler ENDP: k9 Q0 X' d+ b. q9 X

. D$ d7 R; J# b; |: |2 a' R3 j3 j5 y* ~+ M, l" k
    xor     ax,ax
" @- q7 b* M5 ^    mov     es,ax
! P) E/ m! d8 S4 X    mov     bx, cs0 i; b. L/ N: k4 P- x4 r
    lea     dx, int41handler1 B1 i4 V" o# v. k3 s5 w
    xchg    dx, es:[41h*4]% H! J3 P. Z9 c% A/ u* t# h  F
    xchg    bx, es:[41h*4+2]
& l1 ~! r% o. X& R6 Y5 A    in      al, 40h
" p* g/ `+ E# t7 X; n    xor     cx,cx
  E# T; J/ s5 I7 D* X. ~/ ~    int     41h
( ?* e* H4 u* a    xchg    dx, es:[41h*4]0 v4 o" ?+ c( i4 A, V
    xchg    bx, es:[41h*4+2]% B( H: y6 G% r# k% o3 O* O
    cmp     cl,al% z* v) C5 A3 q( M
    jnz     SoftICE_detected4 n% N( a1 v& v/ U, q* u* P% y9 G

3 D- p* @! v6 d7 `. `_________________________________________________________________________
9 k* F4 Y3 l1 q0 R8 l, t) L  A$ W2 ~  E( N. o3 M2 ]: E1 H
Method 074 E( _+ E! |- m% r1 }- `" g
=========  Z8 `* g% U; P* c: b

9 P) M& v% O+ `: w' i. V3 KMethod of detection of the WinICE handler in the int68h (V86)
7 p6 w, U1 W9 S9 B, k% _  \* N4 t. W9 _
    mov     ah,43h
2 q# B" F: E; c9 r3 k2 L0 G    int     68h
. v$ s0 l4 Q9 P; p, L* u+ y: v/ {    cmp     ax,0F386h
( g3 \9 u8 H) ~' `% o    jz      SoftICE_Detected- V/ Y  ^; u5 I$ e

% k, h8 S% q) r& o) A# l+ h; C1 o7 v8 m+ M% H0 T
=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit+ Y# g" Z1 b0 Q. f2 a8 M1 a: d
   app like this:3 ]! p, w, \. Y. L  }
! i- ~' C9 W6 q
   BPX exec_int if ax==68* Q9 S3 P7 g# X$ Q7 F7 Q
   (function called is located at byte ptr [ebp+1Dh] and client eip is
3 {5 q. p+ g& J* j7 U   located at [ebp+48h] for 32Bit apps)2 D4 E( P0 J$ c7 m3 Q
__________________________________________________________________________7 w, Y% L: E+ c9 X

2 Z$ o+ G1 _4 @) e
# ~$ w8 e8 C4 e% N# }- B9 r- S7 dMethod 08: W* m. O5 f, K. ^0 w
=========
3 L% A+ z  C5 B+ L0 H! R5 N. w- f8 z2 P0 G2 F1 L1 ^  m
It is not a method of detection of SoftICE but a possibility to crash the3 \  s9 N8 s1 b  G/ C( H/ O0 M
system by intercepting int 01h and int 03h and redirecting them to another+ u. n$ E; ?; m& [: E
routine.
5 p' Y* ]5 |% sIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
" }4 s' p; A: p! ~- x  e) {% B7 m7 xto the new routine to execute (hangs computer...)/ p0 q! M# n! Z5 v; d( x9 L' c# h
6 i1 w9 P2 z' K5 R7 D5 Z& o1 M6 q1 }
    mov     ah, 25h
3 Z6 L" D" ~. I! [    mov     al, Int_Number (01h or 03h)
+ T0 `% z0 L! h    mov     dx, offset New_Int_Routine" M) n& s7 _# o- \8 g  T) O; a
    int     21h) j* G7 M# O6 a
0 J  a+ ?: L4 n4 D
__________________________________________________________________________
- }2 M3 I' v# T
, J  i/ v5 b) ^8 ?1 B7 JMethod 09  h  F, f+ w/ s' D
=========/ V' G: L0 ]/ F$ V4 H0 S! b# ]
& q' Y. ~4 `: i( R8 c0 r2 `
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only+ g$ X7 u" T9 ^" G& l
performed in ring0 (VxD or a ring3 app using the VxdCall).
& S( G, n# z: k% A8 YThe Get_DDB service is used to determine whether or not a VxD is installed
- d# S6 U+ p3 d  n/ hfor the specified device and returns a Device Description Block (in ecx) for7 t$ @6 I0 u4 A2 N$ j) H/ a" S: c/ W
that device if it is installed.1 F; U, j5 n/ i

8 e! \+ Y2 D* e- Y   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID9 L* J* f. W+ ?5 G) @$ D7 m
   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)- i5 B/ q  I4 ]) L
   VMMCall Get_DDB
5 F' b  @+ z4 U) x1 L   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed, P, Z+ W3 n4 x$ s! p
3 Z( X" Y  J& y, c, K
Note as well that you can easily detect this method with SoftICE:8 g0 r* f6 `, O) x  {2 J
   bpx Get_DDB if ax==0202 || ax==7a5fh5 _. e6 {1 Z1 p0 ^

3 L% I: F4 k* p) L' g__________________________________________________________________________  i8 z& N8 q) X6 Z% U* y
8 ?' N( D: k- i' d4 Q% E4 i3 g
Method 10
; F/ s% m* V  n0 u& j3 l* i=========
8 g3 z6 q% P: K/ U' Y8 L- {
% v. U) O+ D% r9 G=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with" }; w6 F6 V8 {
  SoftICE while the option is enable!!- V# j% ?& J. h) L
+ D% @: F( Q! c) O' i5 Z4 b
This trick is very efficient:6 W$ R/ E$ c' Q- f9 a
by checking the Debug Registers, you can detect if SoftICE is loaded
2 y' i6 ]& U( z( v(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
" v/ v5 A0 K: v' [there are some memory breakpoints set (dr0 to dr3) simply by reading their
9 G& f' f8 V# n, T0 Evalue (in ring0 only). Values can be manipulated and or changed as well' k7 _1 ?/ W2 i: }+ a
(clearing BPMs for instance)
/ b. z& P3 p' c+ [
8 \' q( q! Q' k  i9 {__________________________________________________________________________
/ p' T& U: v0 {, m( e: i  H5 m2 I" @; N: W; d: X0 x: b# k9 U/ G
Method 11
. V, u+ p2 g+ w% z* \=========
$ ?+ V" p% r& o/ ]& F: Z9 l/ {7 r- Q; Q) n
This method is most known as 'MeltICE' because it has been freely distributed
" K& ?8 O3 f  K& T' B' H3 nvia www.winfiles.com. However it was first used by NuMega people to allow
# K" u6 N' L% b6 ?7 uSymbol Loader to check if SoftICE was active or not (the code is located
+ c0 z4 K7 n  X5 ?# Z0 k9 f9 Linside nmtrans.dll).
9 A  C& A8 J$ T4 H; C6 m9 j3 V. X( M2 m8 j8 @$ o* \
The way it works is very simple:5 P: ?( n& T; a6 N% V/ }
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
' y; S0 P" w0 xWinNT) with the CreateFileA API.
& Y* v! ?$ O5 ~9 K5 n" N1 o$ u6 K& ?6 e* R! R
Here is a sample (checking for 'SICE'):  }, ?* @4 z" t& W

. w% s( }: q( {1 Q% f3 I, f  QBOOL IsSoftIce95Loaded()
0 _5 S! G% g8 O( A3 ]" J{$ F/ y1 h$ r8 y3 }
   HANDLE hFile;  
8 Y! l8 z+ I6 M- n! a3 j& X   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,4 I1 b2 Y9 f4 U) t; O+ G, z
                      FILE_SHARE_READ | FILE_SHARE_WRITE,/ ?0 f( Z8 ^, ?3 r
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
1 ~2 Z9 R! L. Z6 ]- j8 c( v( y! B  x   if( hFile != INVALID_HANDLE_VALUE )
: r1 x, U5 q# f5 N* D8 X" H8 g9 H   {( ^* ^! @, u, k4 }
      CloseHandle(hFile);2 f* G0 h2 q$ _' j
      return TRUE;
8 @! S7 s! r9 n( n8 L& a/ n9 S   }
: x/ w% [. n+ l* n+ z7 a1 t   return FALSE;2 |  y% A/ o! D5 S. `- `2 }
}' M2 S6 x) H( x: _6 x" d: ^+ D
  E. N7 a, Q' a+ ?* t8 N& O6 G/ M
Although this trick calls the CreateFileA function, don't even expect to be
$ J: U" U% ]' y. M" x4 bable to intercept it by installing a IFS hook: it will not work, no way!: B( I$ U2 }- ?0 ^5 F. b8 r
In fact, after the call to CreateFileA it will get through VWIN32 0x001F1 l& Y, d3 M- h- [# l  ?
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
# o: \" Q1 V' V/ Pand then browse the DDB list until it find the VxD and its DDB_Control_Proc# F7 {/ I8 b& Q2 u; w
field.6 O5 u8 d7 Q" n( w" e$ ^
In fact, its purpose is not to load/unload VxDs but only to send a : O" }9 P( f: f. w6 l
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)) L+ l) ]9 i1 R( B* s( Z) e, p+ z; S& W
to the VxD Control_Dispatch proc (how the hell a shareware soft could try3 p* \2 L: O0 O5 C" {" Z
to load/unload a non-dynamically loadable driver such as SoftICE ;-).2 N" j8 S& Q) T$ Q0 F( n$ A
If the VxD is loaded, it will always clear eax and the Carry flag to allow+ ~. [: B! V3 b' S, z. z) v1 J
its handle to be opened and then, will be detected.) G+ c$ M* b( G  L6 j. t" ^- [# {1 y) z3 s
You can check that simply by hooking Winice.exe control proc entry point! X/ P8 m5 I" Q) d: X$ H, @
while running MeltICE.5 k$ N0 ?% Y: E; Z- [& P6 U# U5 C
, O6 c/ o- k. P! r7 ~) {

; m  j' W4 z( G  00401067:  push      00402025    ; \\.\SICE( F3 Q2 l$ }2 Y0 j) Z- Z
  0040106C:  call      CreateFileA
- ^( D, k9 z* L; u" M/ ]  00401071:  cmp       eax,-001" I: {. c0 H5 W0 i% s
  00401074:  je        00401091
/ m3 K3 Y4 [6 Q7 }) C" |7 Y% M) ^, v- e6 i8 w* C
  y, X$ m- t% L7 T
There could be hundreds of BPX you could use to detect this trick.
$ `9 ]6 F) g/ g  y$ y8 U-The most classical one is:/ S" w5 _3 G; h% F
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||) r% F, W6 M- _1 R( d  N4 x0 R
    *(esp-&gt;4+4)=='NTIC'- P3 z4 U' I' r  {: k$ E" p

2 ~3 ]* ~8 p/ f& }8 a+ Q$ d7 G-The most exotic ones (could be very slooooow :-(
) M3 D" x: A; U+ o9 y   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  
$ p9 T! `- y* u4 ~     ;will break 3 times :-(  M+ \% M; S+ ]9 ]: ]
4 h/ L" ?( J# N9 _% U, c
-or (a bit) faster:
3 {$ E6 g" q( s- f   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')4 M% F/ i- u- [% U9 o9 ^  L& w
0 k) @0 H, P: n3 X
   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  
, a5 L# T' C+ o! B     ;will break 3 times :-(
  S  u! d' p6 [* ?4 j1 H) W- D2 ?
-Much faster:& C( |- J* Y/ s2 w! g2 k" c" ?( l
   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'
7 w' _( l; n; Z% j/ x7 C, T
* N$ `2 F/ t" u* Z# b) y: P9 z1 x$ O! NNote also that some programs (like AZPR3.00) use de old 16-bit _lopen5 R' O# ~+ ]9 \. E, H5 E7 s3 y  H
function to do the same job:0 z. O. ~. Q. ^8 g
  x" E, p0 ?" v& x9 j0 X
   push    00                        ; OF_READ2 }0 H7 y6 C6 h4 p3 ^9 g/ f7 F
   mov     eax,[00656634]            ; '\\.\SICE',03 b0 a  E2 Z% R
   push    eax
; y- v5 B" L! V# A& R0 o   call    KERNEL32!_lopen1 T3 u. P& ^$ J* X
   inc     eax0 d/ V( s: M& v/ L7 ]2 |
   jnz     00650589                  ; detected
6 e/ H2 u* s* ]0 Y2 p) {   push    00                        ; OF_READ
( ~% f  M& H+ x7 |   mov     eax,[00656638]            ; '\\.\SICE'7 D5 ^5 M1 ]( Q1 g4 Y
   push    eax
$ K& f8 J9 {; h* \0 ]2 r$ V- e   call    KERNEL32!_lopen5 N9 a' I9 c/ {0 ]1 ^+ j" p
   inc     eax8 H. f5 q9 W5 f: _( @$ |% g
   jz      006505ae                  ; not detected
* J4 ^5 M. f% v8 H7 _" d( y  [7 ]
5 t+ @1 _$ l5 }: S
3 H1 G% j. l* l- h6 x__________________________________________________________________________
/ e9 d7 ^, @- j1 D3 O  t& J. @: L% a+ {& `
Method 12
  t$ Q7 F! t3 y5 T=========
. C9 R; L+ V) \
2 U9 v+ r& E- Z7 X- P& w# c$ `This trick is similar to int41h/4fh Debugger installation check (code 05
& I$ t/ O( F5 x% \&amp; 06) but very limited because it's only available for Win95/98 (not NT)
4 d+ @+ ]- F4 fas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
) L  n* i" S6 K" q0 @/ }' P' z* s3 r: \3 B& g1 f  `: L( Y
   push  0000004fh         ; function 4fh
9 ?/ f. e$ I, k+ M0 \- I5 W   push  002a002ah         ; high word specifies which VxD (VWIN32)$ y. r4 k- q0 {8 |% p- r/ i
                           ; low word specifies which service) u7 s8 L: K- f- t) y
                             (VWIN32_Int41Dispatch)
# v9 t; d  F  D8 t8 t   call  Kernel32!ORD_001  ; VxdCall
( l  ~% ^9 R) k% p& v8 K" W   cmp   ax, 0f386h        ; magic number returned by system debuggers- Q/ ]6 S( m9 V0 c' O
   jz    SoftICE_detected
& G3 T/ I% L- d! ?" l) n" s
- g' e6 m0 d# h4 @; u5 M4 ~+ qHere again, several ways to detect it:
( F. o# u$ y3 J' O: Q2 k, _9 Y# h% o! T
    BPINT 41 if ax==4f
1 N" x+ @- G$ ~. J; R- G# ?' n6 \# X; o( F* c' }
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one
& e( Q9 U. A( X' F( k: m+ r) M+ @  _: E1 p
    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A/ C* V& S- J! _5 P! G  f9 }

  L7 I* k2 R, B2 u* g: r  T" K) H) n; F' Q5 Y    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!
2 D) A/ k% D2 u. ~$ L) a6 r) m* ?, M: g' s
__________________________________________________________________________6 }5 i/ x$ Z- Q6 {) s" i6 l  Z# [1 \

  R7 _9 K/ a( {  M" fMethod 13* [' T5 ^8 n# l
=========
- C( k9 C' n  R0 m, z! G' |5 a  Y1 a7 D
Not a real method of detection, but a good way to know if SoftICE is9 B5 m% ^% p9 @: `
installed on a computer and to locate its installation directory./ D( l8 b# x* M5 ^
It is used by few softs which access the following registry keys (usually #2) :  f* c5 |8 m9 t4 z' N
3 N' u) w" F; t# e
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
6 \& S" w3 R. M- H8 w$ x7 ^7 S2 o1 s\Uninstall\SoftICE. x( I- _- E# d; L4 |
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
6 i, I' E4 ]$ S; o& z1 A# U-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
* c" S# _) S( t* [0 z8 a\App Paths\Loader32.Exe
* _6 _  k3 j3 `1 O4 n
. L! ]; U- a: d
1 X( g+ w! R) T, m% M3 R9 i" BNote that some nasty apps could then erase all files from SoftICE directory" Y7 c9 i( [2 ?7 k$ ~3 Q+ v3 b% T
(I faced that once :-(: L- @9 }6 o9 O

+ y9 z4 N0 F6 ?- d* pUseful breakpoint to detect it:
, y( X; \" w9 d4 H4 D0 n; [! |" C& o; S9 P+ o' p
     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
7 \# j2 j7 N% R) w9 T# B  o4 S8 g5 h7 q
__________________________________________________________________________
" d5 C# x; I# Z  \; g/ T& Y( ^( u/ T7 t
4 b# e8 P1 m" F3 a/ }7 g/ Z2 j6 r6 j
Method 14
* [4 `9 k; Y: _* i=========( n" d1 A: X) q/ S
. L7 A2 k5 U0 ]& q! C! l* I
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose8 G- x! _- {) ?% n! J) z- g
is to determines whether a debugger is running on your system (ring0 only).# u6 x3 S' V+ |! }1 u3 z

9 e9 }. k$ V+ K$ Z9 T/ ]   VMMCall Test_Debug_Installed( O9 A- {( m0 b* y: ^' C# Y
   je      not_installed
0 C- O1 L3 R- g. T' A; t- I0 P+ @0 E2 \+ I6 W2 z+ m
This service just checks a flag.( ]9 T6 _1 [) U* k) d9 e2 N' {) |
</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-7-26 04:10

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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