找回密码
 注册

QQ登录

只需一步,快速开始

About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
' ]; w9 J& ^2 T<TBODY>* s2 r7 ]! M( `  H6 J$ B
<TR>6 C! t$ F3 E4 X4 b" m0 ?
<TD><PRE>Method 01
( V/ G; S% e: M5 R: D% r=========
2 T2 ]; R3 H% M
, X& s. n9 ^* qThis method of detection of SoftICE (as well as the following one) is; _5 C3 L: V6 L, w4 V% w) z$ Z
used by the majority of packers/encryptors found on Internet.
) r) x8 p( A: S* s1 ZIt seeks the signature of BoundsChecker in SoftICE) u3 Z" D* b" P$ n
& Z: R2 B5 H4 J* P
    mov     ebp, 04243484Bh        ; 'BCHK'
! f0 N8 U/ [% S1 E    mov     ax, 04h1 u+ m+ E4 d* a7 L- S7 |; ?
    int     3       7 O+ z' m9 p/ Q1 m
    cmp     al,43 E. ]  k2 o2 Z% F+ x; V, W: }
    jnz     SoftICE_Detected
' q! T" l2 ?" b* ?8 Y! C2 H7 ]( r0 [& R! v2 T0 H
___________________________________________________________________________
# d; @, k/ M1 k4 r5 d/ z) b8 j; c0 R3 T. @5 \
Method 02
9 O' t$ ?+ v8 D6 @* u" X7 P=========
. K5 E% y5 [# g; f, S: P: v+ T4 B, U' v) q$ ^- k+ w' R
Still a method very much used (perhaps the most frequent one).  It is used
5 B) h$ f7 y, \" J" f% jto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
; W+ X! n; v  p4 k! }or execute SoftICE commands...
6 |" O( f% A) t) M  V( F2 K2 z3 ^It is also used to crash SoftICE and to force it to execute any commands( b2 ~% B# A! F- ^
(HBOOT...) :-((  
8 ?0 f7 n1 |9 [, P" U2 l9 |" ]8 l0 v+ O  T: w, n8 }
Here is a quick description:
! O, \  O9 h* F  I-AX = 0910h   (Display string in SIce windows)
+ d! T: ]0 L/ X3 [- A4 ]" H: F& J-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)
3 [5 w1 H( t/ l-AX = 0912h   (Get breakpoint infos)6 d* G6 h3 u( w5 `( s
-AX = 0913h   (Set Sice breakpoints)
8 T- W/ ?) k( a: A/ a! Z# O0 P-AX = 0914h   (Remove SIce breakoints)) A- h- e8 D! b* q8 R

1 T! ?+ U2 K( B/ p& v" aEach time you'll meet this trick, you'll see:/ G# d0 }6 r1 Q" d
-SI = 4647h/ j' d& o9 V, ~. @, f( ?
-DI = 4A4Dh
9 W3 t  V; a! g+ U2 @% zWhich are the 'magic values' used by SoftIce.0 I& T9 N' H0 F; o% ?" r: T7 a  ^
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.* B. P$ f0 R! B4 L

; |& d8 I0 T# q! v, C4 ~) N6 ^Here is one example from the file "Haspinst.exe" which is the dongle HASP
# F* f1 q  B3 Y1 O5 M9 T9 p6 [2 uEnvelope utility use to protect DOS applications:
/ \& ^5 Z. i! S. e4 c  ~( ]. J+ s, Y% m9 X' h' o& ~0 C! _
8 w9 u! Z- ~7 d
4C19:0095   MOV    AX,0911  ; execute command.
: x2 i& H! F2 r- m) ?9 c4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).7 Z0 \( ^6 \9 A3 D- I- ^
4C19:009A   MOV    SI,4647  ; 1st magic value.! Z5 k" n" @' f- D; @& p" ?9 P4 e0 l
4C19:009D   MOV    DI,4A4D  ; 2nd magic value.+ p! n" x2 P. b$ Z) f9 Z+ Y( j
4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
& I% n, S! Y, [6 T4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute
7 P/ l8 u# Q2 t$ `! H4C19:00A4   INC    CX
+ c5 T% O" v( I( G2 c7 K6 e- u3 A4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute0 y7 q6 z- V3 i% q) u, e4 R
4C19:00A8   JB     0095     ; 6 different commands.; {4 n8 f2 r1 t8 `, D7 m
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
+ Z) O% s' f5 I3 f  B4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)! G) v/ ?. r3 p# i. N( [
" L' P* z/ e  f) d9 y( \
The program will execute 6 different SIce commands located at ds:dx, which; Z- t6 [+ ~+ @
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
7 c2 R( C# ~1 a' a2 }/ I2 V) J8 h8 b: M, n. G
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
9 J1 h3 O* w8 a" F# b  e- A___________________________________________________________________________
( A5 y* `4 L; G# j; I
) s2 j- b/ _2 T
! l0 H% {$ z; d; h9 e4 qMethod 03
( y6 [/ J/ }1 u: Z$ i1 p# x=========
9 M, U3 T* ?8 Y/ R  m/ x$ R- S# v4 C; u2 d" n! D" g# N6 ]7 n
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h; E- ]! \+ B( `+ V3 {
(API Get entry point)
' M6 I5 l# r4 L! O7 I        
. n0 v9 {# y0 k+ C, C# i7 G; }) l7 z8 A. o0 }: B7 w( v0 u6 x1 w
    xor     di,di9 |9 k9 ~, y; C) `; n# s
    mov     es,di
8 `3 N3 r  |2 R, V& C& s    mov     ax, 1684h      
0 M1 J+ ~/ X& v: o    mov     bx, 0202h       ; VxD ID of winice) X+ N" c4 v! X
    int     2Fh7 N1 z' i* f  z+ C$ s
    mov     ax, es          ; ES:DI -&gt; VxD API entry point! z1 [+ a& e& l( |; n: N2 `
    add     ax, di
* z9 a/ y* |1 t( \; s4 t  B    test    ax,ax4 @/ y0 w/ c8 {* m+ \
    jnz     SoftICE_Detected
4 E: {8 F0 }- V+ a" ^: Q: n, _* }# s% X
___________________________________________________________________________
# ^- L3 |3 Q& ]8 }% S; N' [
1 X' q% u8 G7 d) e* q  {2 W7 CMethod 04) x( `1 \. _; h  y' L
=========
$ `+ T0 c0 V7 ]$ ~* x( W
7 S1 W2 c2 b, J1 b+ w0 U0 XMethod identical to the preceding one except that it seeks the ID of SoftICE2 n: `  i2 \' I
GFX VxD.5 E8 T6 \  p7 Z/ @

, c! Q1 ^7 Q# H% P8 \    xor     di,di
$ l) ~& B; A7 I( t9 S    mov     es,di
# ^- s! F! k) d. C2 z# Y; r    mov     ax, 1684h      
9 B; ?) L7 _; {, ^    mov     bx, 7a5Fh       ; VxD ID of SIWVID
( o, o# S  \; A, H    int     2fh
6 ^6 b) P( V( T4 d% ?    mov     ax, es          ; ES:DI -&gt; VxD API entry point( N2 D- I6 n( }% t; d
    add     ax, di
- _# d( |1 Y  p5 l# r+ T! @# Q    test    ax,ax- Y* B7 L9 G3 P. f9 l
    jnz     SoftICE_Detected2 B! k* H) A) d6 ^

0 n- S, V& O! d0 A- x3 v__________________________________________________________________________
% H2 }. z& Q9 F) }' l: Q  L: ]2 O2 b8 c

( Z+ i! a+ h) z! ?5 C. ]$ K6 ~Method 05
! k/ m( {) z; O4 }# M9 [- [0 l, ?=========( S2 }$ D/ ~" W+ H

7 K) ^9 A8 A4 h& ?' J( ]Method seeking the 'magic number' 0F386h returned (in ax) by all system
- V/ J- U, S0 I' l6 |2 u& ^: ndebugger. It calls the int 41h, function 4Fh.
3 g' f7 R5 ?) u6 VThere are several alternatives.  
) Y5 V5 w& H& Z* Q0 |) ^& d
8 |" t8 A" X: [6 MThe following one is the simplest:! G5 t( }* @  u2 F
8 u% B! R+ L" w+ c2 |
    mov     ax,4fh1 j# e) f' o  s
    int     41h7 _6 l: z/ q4 G( w0 D4 w9 Q
    cmp     ax, 0F386
. D5 p+ q/ |9 r+ f! ^. j8 V. H# L    jz      SoftICE_detected
* U% v+ ?/ b+ c4 a+ x7 }/ D  A1 r/ I7 L( E
8 o+ N  f0 S/ B, m
Next method as well as the following one are 2 examples from Stone's 8 }( ^2 ]2 n( m7 P3 Z
"stn-wid.zip" (www.cracking.net):/ f5 |& x3 }* n, l

" S# c) Q3 L7 D/ u# I3 q6 x6 I    mov     bx, cs
" e% J9 \3 c, Q$ l6 Q( X( i    lea     dx, int41handler2& m+ W, B- W7 D$ ?/ h  c& v$ _
    xchg    dx, es:[41h*4]; E' R$ Z* K& O1 |! f9 ^; O
    xchg    bx, es:[41h*4+2]# ^* e8 e/ k+ Q4 n7 j$ ~# _
    mov     ax,4fh9 q2 V/ Z! G- B; G: k' r$ ~
    int     41h7 _. |$ z( X# j$ ?
    xchg    dx, es:[41h*4]: l: S! A. f/ @4 K3 c& s3 M
    xchg    bx, es:[41h*4+2]
1 C; H5 o, i1 L# x8 l5 X; y    cmp     ax, 0f386h
* j  U3 c; U. l/ i& n    jz      SoftICE_detected
' N. M( q5 `* g4 E% m# b3 Y! K, Q# M) @- ~- x: m! ?* X
int41handler2 PROC
, `. S# M) n6 t% q, ~9 k# d- b6 I/ d( x    iret. u: b: {( D( q- a3 e% `) |
int41handler2 ENDP
0 W2 j* q# O. Z; S  z( V9 H
( ]# V8 c9 ~) w$ Y. T4 a9 L% U8 A
_________________________________________________________________________
/ p2 c8 X* F9 o$ h7 b! l9 a+ O3 [  V, C; \1 ^' u
& E% {: ~' c/ O1 p) _! R/ N
Method 06
; F) G# {, X  L" V=========
: K2 S/ k' _3 k% B* ^5 E& T& K; ], s9 R
0 ~; x" _2 v! M9 y7 _# B4 y
2nd method similar to the preceding one but more difficult to detect:
( s  O  m6 c. J; l, ?, B, b  ^: r/ w' D! b
3 Y8 p% [& ~0 v0 W
int41handler PROC5 \6 U3 e9 j2 q
    mov     cl,al1 h0 r2 r6 p0 I
    iret
  {" k9 |; B( o3 W1 mint41handler ENDP. T- k* c. z( A9 {. S" v
! {6 P8 P4 o: L! V% K
( q! \; t) M" D( ^5 P, ]+ R+ g  ^' d
    xor     ax,ax! J' F& ?) m- D. Z  l7 _
    mov     es,ax1 _7 x+ a3 Q/ c4 v! u
    mov     bx, cs
: c) d, f% D" H; y( m- V9 d2 L    lea     dx, int41handler
1 @" e* ~, D2 S0 N6 F, x7 ]    xchg    dx, es:[41h*4]& L/ P, _1 B5 l7 P+ d
    xchg    bx, es:[41h*4+2]3 P1 T- G7 {( Z  m3 M- l
    in      al, 40h
! G( b0 }, w: U7 ~  w9 Q- d    xor     cx,cx: S% j4 t! l+ p! O, R
    int     41h
$ `9 {, W* q4 ^6 P) [& |    xchg    dx, es:[41h*4]
& t; V+ }9 E& p& {    xchg    bx, es:[41h*4+2]3 |  g: N/ g2 |3 O
    cmp     cl,al: }" i, Q7 z5 D3 e! y$ g7 g
    jnz     SoftICE_detected  i5 m8 F% i- Y% A" h1 x

) l! c6 }; j9 s- t_________________________________________________________________________$ h5 X% ^* Y, M8 Y0 r  B1 X

4 h% k! p) T/ b& `# E6 o) CMethod 07
: \+ i- j8 ]0 k9 |=========  Z+ g/ m, s% ^$ l, L* T0 ~1 {2 ^1 ?* m
3 v. k- H. ], {' W4 w" A9 n
Method of detection of the WinICE handler in the int68h (V86)' ~, p6 x$ C) T' v
, m$ c3 Z( @3 f" m3 q% ]; F
    mov     ah,43h/ ^6 G9 O& G0 E* e) B" B! c: R, _
    int     68h
$ y8 U- J; P8 i9 r5 I" h* F    cmp     ax,0F386h& @0 X. Y: Z2 z  f2 C1 H+ g
    jz      SoftICE_Detected
- |, A! ^4 V# x/ O! b6 w( Q; w5 `' |
0 ^3 ^4 V: E  S2 [# P
=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
. ^" c, D; ~9 Y) F   app like this:
  y, H0 E' f$ `0 Z  L' {$ P1 a% d, u. `, g* p
   BPX exec_int if ax==681 X, S7 ^' p) O. V, B
   (function called is located at byte ptr [ebp+1Dh] and client eip is4 T0 n( g9 y) s/ e* p- H0 v
   located at [ebp+48h] for 32Bit apps)/ r9 X) W- L# @; Y1 F1 J
__________________________________________________________________________
& Y* m: k: B' O* x* C8 ]; \1 E# w, R9 C7 n, Y& \8 R. b

- l- R1 i* W$ L$ y" a. F& d( rMethod 08
* n$ a- {! ~5 h2 B0 I=========1 d! y1 m1 ?- l/ |
1 R" W+ u( h; b" Z( W
It is not a method of detection of SoftICE but a possibility to crash the+ u; t7 J* E' |: f1 ]
system by intercepting int 01h and int 03h and redirecting them to another
! j" A# q/ ^1 c# X8 uroutine.# p# V- R& D0 C, h
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
1 g: a* t# b' N% d  dto the new routine to execute (hangs computer...)/ T! p( F9 K0 ~% o1 m- R
( {4 ]9 C; [; o" Y, {+ j
    mov     ah, 25h0 R. z# T4 {7 }( @1 a1 [. Y
    mov     al, Int_Number (01h or 03h)3 U& @, ]- T8 Y" f. K, J
    mov     dx, offset New_Int_Routine& [. D* \8 t$ `2 a( D% F$ i
    int     21h
# x- V7 V. {) T$ n( D- D! U$ o7 f" W# M( z3 M7 J# ]$ f8 W( r* _
__________________________________________________________________________
( m/ e! V; d! h) f' G
4 J9 t9 O: L5 [2 I: U1 ^Method 09
5 Z0 X) g+ b& J, T# B=========/ j5 c. B3 n% [* |6 o4 X. a

  ^0 A; T. e+ [! |This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
. r# X9 R. b% o- Hperformed in ring0 (VxD or a ring3 app using the VxdCall).
5 M5 q* C5 @4 Q3 m2 j6 [The Get_DDB service is used to determine whether or not a VxD is installed! d* M) }$ H) y2 O4 y. R( V
for the specified device and returns a Device Description Block (in ecx) for* r+ \/ r& Y& L4 ], Y
that device if it is installed.
) \- \; f% Q, [1 |9 I" p
* m! ]2 \) B+ p' V8 ^/ c   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID5 x' y+ D* U, O; d
   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)5 @4 ]) q+ h5 k2 r
   VMMCall Get_DDB
8 u9 m7 y* X: R1 _5 Z& d  q$ J% l   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed9 I% f/ |& y2 J# l3 A; O
* @  q4 A4 @3 X5 p4 D5 e( Z
Note as well that you can easily detect this method with SoftICE:
, w3 ~) m2 n& k" C& Z+ h! c   bpx Get_DDB if ax==0202 || ax==7a5fh
$ b! I& e' b% b8 r9 ^# |1 E
4 H! \+ T. J: Y, ?__________________________________________________________________________! M3 D: j; F  I3 F4 t  t+ V
7 M3 Z+ t; G, Z/ t' @% ]1 i* ]3 H" D6 ]
Method 10! n1 N0 l/ Z# X3 g2 p- o
=========
( Z/ _* M$ x: n5 H5 Q- P2 @7 f
, p0 ~* b) u, d6 i$ H* d" W=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with4 J6 ~4 D; C# D) H( E2 |8 d& I' S
  SoftICE while the option is enable!!
% B0 M" m7 O& l$ j$ B6 r% X% E" s8 i6 A4 e- U6 @$ {2 q( P7 q! P: E( P
This trick is very efficient:: ]3 P. z' j4 C7 |5 V6 n/ ?
by checking the Debug Registers, you can detect if SoftICE is loaded
6 o/ }  N: f. j* ~% N(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
" X, @' n: K0 M7 Sthere are some memory breakpoints set (dr0 to dr3) simply by reading their0 _5 l0 J# ?- ]* g) M
value (in ring0 only). Values can be manipulated and or changed as well! d) u7 I+ g  D/ x
(clearing BPMs for instance)
6 I9 u$ s; t! [0 t) u* t2 _+ j( i# b3 H/ p
__________________________________________________________________________
( ?4 Y) O# I0 s. b4 P6 N
, e- `* ~0 p+ NMethod 11! t8 P  a6 X$ B' X. u" d% ]
=========" s; v' E: Y- k* `- d3 G+ J
% C$ u8 [/ B! ]0 I. t
This method is most known as 'MeltICE' because it has been freely distributed! T8 }" r' P" E. h
via www.winfiles.com. However it was first used by NuMega people to allow
3 {6 w& f. Q; V. c( S, x: OSymbol Loader to check if SoftICE was active or not (the code is located
+ O  `( u7 F/ d) ?* v* hinside nmtrans.dll).) n4 Z7 S( [2 @  J' g

4 w5 z" Y8 _$ @9 q6 A& [; ]The way it works is very simple:
' u' h  N9 Y" C/ k7 }It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for* i/ ?( ~& y! [
WinNT) with the CreateFileA API.
/ S( c' f  f6 ~1 C, Y# F- R# y" ^+ _- v- y+ S# y& f5 M
Here is a sample (checking for 'SICE'):
) |3 Z- x4 W1 J* Z. z; Q
! F7 N' T# V! P1 ^BOOL IsSoftIce95Loaded()
6 y5 S% z) M( R( Q9 w7 u3 \% Y{; J# j( D2 ]9 y- C$ o2 `
   HANDLE hFile;  
/ h/ \( Z' p: a! z   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,0 j% y1 s) c( _
                      FILE_SHARE_READ | FILE_SHARE_WRITE,
+ T" X: R" C2 j                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
( S% h2 i; s1 K   if( hFile != INVALID_HANDLE_VALUE )
9 w0 e. f7 q0 H" E3 Z+ [   {, t* n. _; n" p, e. v+ Q. E
      CloseHandle(hFile);
: W# m, l& T% r* z1 j% i      return TRUE;
8 l! ^+ G2 q& a' M' e0 ~   }9 e- u* |3 p# \! {! B' [
   return FALSE;
* ?2 z# r2 g  ]; o4 p& P}
& B! y7 V2 K. C. q; Y6 F" L
4 u: v, Q4 e* O* d( {  EAlthough this trick calls the CreateFileA function, don't even expect to be
' r7 S4 M) T$ p# Iable to intercept it by installing a IFS hook: it will not work, no way!
, [3 ^' T& h  @& f( c: uIn fact, after the call to CreateFileA it will get through VWIN32 0x001F7 l( {- F7 n/ B: P6 |1 p
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)9 ]2 L. A/ o0 R5 N" Y9 `7 r% J
and then browse the DDB list until it find the VxD and its DDB_Control_Proc% y! U- v/ w! c6 L, b
field.
4 u7 J( L% u0 m8 G8 M: C! f0 UIn fact, its purpose is not to load/unload VxDs but only to send a
6 C9 P" l: m! J6 o1 }: ~. T9 g0 a4 AW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)" @' T1 ~, e: d
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
; w6 _/ a6 V( u$ `# ?to load/unload a non-dynamically loadable driver such as SoftICE ;-).
, h, z# B# B3 @* A, p  gIf the VxD is loaded, it will always clear eax and the Carry flag to allow
/ K6 F: E  T- X7 s2 Uits handle to be opened and then, will be detected.
; ^5 l6 D0 A% ]) O8 G$ Z! OYou can check that simply by hooking Winice.exe control proc entry point/ q" K! q8 i7 U" ^* \% e. \; G
while running MeltICE.
- C) e/ j8 }2 N6 v
) @5 c' k$ y5 |1 W( c! x: l+ u) |) U) C+ E! k# b
  00401067:  push      00402025    ; \\.\SICE
) }4 d, e" M( y* W4 O8 }7 N  0040106C:  call      CreateFileA
' U& y! ^: i1 Y0 k# z  00401071:  cmp       eax,-0011 m5 q" [+ m- ?  Q! d% T
  00401074:  je        00401091. s$ N9 t9 Q& l7 k; Z
2 J- x1 G9 D, ~5 r
0 a  L# X9 X8 J+ X/ O. k. h* d4 d7 i
There could be hundreds of BPX you could use to detect this trick.! W, H2 V" G( ?% V/ u0 H
-The most classical one is:/ `/ F5 K" w& \4 Q2 s/ n
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||1 Z. Y2 h2 {+ J6 C1 a9 P7 X
    *(esp-&gt;4+4)=='NTIC': t9 Z2 U$ a8 b+ l9 y2 \. k

# n1 W. N: G2 s* S* `/ x-The most exotic ones (could be very slooooow :-(
0 S& X% T& d% X$ c" k% Z& R# c   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  
5 `" V! f0 {' A- P: K9 c$ o& n% Z     ;will break 3 times :-(
7 ]6 d& t6 A2 z" a! v9 O3 N( I* e- D- b) w2 Y( f
-or (a bit) faster: 7 M# ^3 k3 r* `$ M2 `# o
   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')0 T4 C7 J2 K0 E" V( Z/ X4 {
! W  {6 V+ I/ a! v9 g3 @  N9 ^* W
   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  5 u% _. q, i: {+ o9 x* ]  a
     ;will break 3 times :-(
2 ]4 u; e% }2 Q2 f6 r/ d0 e5 P6 f- _2 v
-Much faster:
3 q5 S0 |! t% K" p   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'1 g! i3 H8 T$ C9 X/ f& R0 J
' P0 B5 _) K( d- l0 X3 V
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen. S9 W* f/ C& P, J1 J6 o
function to do the same job:
! N6 v$ h: y0 a# N3 {+ B, R
& D3 b7 [2 [/ J2 i   push    00                        ; OF_READ
1 |/ n" D! G" Q6 A, q   mov     eax,[00656634]            ; '\\.\SICE',0. x$ y3 M# v# H9 F" c0 V+ ~7 k
   push    eax4 t9 M0 Q+ @7 g7 R
   call    KERNEL32!_lopen
9 Z5 ^9 I, x8 x   inc     eax; I& T, X& ~! ?' ?+ W0 Z
   jnz     00650589                  ; detected
' f2 n+ e# Q$ d4 `* n0 [   push    00                        ; OF_READ
) L7 M/ z$ ^7 ?   mov     eax,[00656638]            ; '\\.\SICE'
* J/ O2 u" d6 }( m/ H   push    eax% P& C* L/ `* e+ ]
   call    KERNEL32!_lopen) ~* I! K; N0 X! ]" M9 r
   inc     eax
( k/ j) G5 K9 ^- C3 w9 q   jz      006505ae                  ; not detected
* e% `: D" M: ^9 L1 \. w- a* ?
$ {5 p1 r% y2 d3 [  k6 V$ F' A  p* V1 r: _! @7 W" ^
__________________________________________________________________________! D* D1 ?" q$ b7 C
1 t( o! u, d5 f
Method 12
; f# s: A0 n1 ?! P- J, D=========1 z. u# p, W2 G' B: Q

; R3 p2 H$ N3 r' JThis trick is similar to int41h/4fh Debugger installation check (code 05* @- {" Z( X8 K+ i( M! R
&amp; 06) but very limited because it's only available for Win95/98 (not NT)% ^1 G: H3 v# m! L/ R6 m2 N
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
. s1 \9 V! Z0 L+ K* `3 l1 B. P$ H5 o4 f. @
   push  0000004fh         ; function 4fh! B2 F$ B- G5 R
   push  002a002ah         ; high word specifies which VxD (VWIN32)5 I. b. h8 w% ?& q3 f. U* F4 a
                           ; low word specifies which service( G4 }% |, {: w1 X! H: l
                             (VWIN32_Int41Dispatch)
& T3 ]6 T- b5 h' F) ?4 V; J   call  Kernel32!ORD_001  ; VxdCall1 r8 j7 S/ c6 L9 }, q+ p" _5 e
   cmp   ax, 0f386h        ; magic number returned by system debuggers
0 [7 x4 Q4 ?1 \0 N( u% G$ A$ A! b   jz    SoftICE_detected
& V# y! W$ Y! C5 N1 h: _( p8 ?
8 `4 O" p& n. }% P. ~: mHere again, several ways to detect it:( k' f8 P% @4 j; |

* J$ o$ Q+ g3 Z    BPINT 41 if ax==4f
# N5 w8 ~. O; m" c* I, |1 _9 ?3 o* c" S- r9 B9 u5 s) U. L
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one# F1 t( b& r" D4 O" ?1 F7 F! Q2 @4 E3 t

3 _  |2 r& ?  K1 u. R    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A) y0 G; ~8 k* M: ^% r4 H
2 p" s4 K2 i9 E2 Z' S. {
    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!
7 X0 U2 Q% E( O+ I1 G# v# S! N  O1 ^: e: |4 L5 Z) F/ c. |0 A8 ]
__________________________________________________________________________
" v+ X5 ]/ R" M8 s' _0 s! z
6 P# e0 E5 n3 G; b9 OMethod 13# t) n/ f* m2 q- G. @
=========
2 B- ]2 ?0 v2 ]- k: f7 T% U& ^$ V0 Y7 b) y0 c- A* `9 @
Not a real method of detection, but a good way to know if SoftICE is; I' k/ M3 s* g, H. R8 y8 a% B5 d
installed on a computer and to locate its installation directory.
1 s3 f# s9 ^1 Z) u- U" OIt is used by few softs which access the following registry keys (usually #2) :' k9 Y2 m" d+ K3 V
# w  J4 w" ?, z& _, \. m* K" m/ h" r
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion5 D4 v" g* q9 m" o  X
\Uninstall\SoftICE
; X3 L9 h* B* M" p-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
# J0 O) X' p# m% g0 B& G-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion( _+ i( O3 r% n3 \$ X) U
\App Paths\Loader32.Exe" W: _& W7 g# p* e1 K) r

  F$ y& v0 w& l
, R, b2 x, I8 G- b& ?' M+ T+ e2 sNote that some nasty apps could then erase all files from SoftICE directory% R0 t- E4 t2 `- }) Y7 f; M7 ?2 p
(I faced that once :-(
8 Q& @, G' K9 H8 g5 q$ w
& f. D- p0 `( w. j- M6 yUseful breakpoint to detect it:
% v# }% K% w# r% W+ b$ A+ {$ E1 g' Y
     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
+ I% z' k; K8 \
% p' [  e1 v' \- u% C__________________________________________________________________________
, a8 k/ {5 r0 g1 d, ~
% d2 g* k5 w) X9 `. D6 J( |* M2 g
Method 14 / Y7 F/ h! v  n# Q3 G2 ^; J2 U
=========5 r2 w# Z( H5 F: F2 _$ M$ j
) `- }2 F- A3 q, N
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose# [4 F7 e* G/ W; }: Q, s. Z6 l
is to determines whether a debugger is running on your system (ring0 only).4 }  K: u1 [* L! {( Y2 k" ]
! H( g; i( H6 a5 [0 p
   VMMCall Test_Debug_Installed
# g6 u$ b1 x, u4 M) ~8 H% b   je      not_installed& a- U8 o! l0 K( j5 n# m! Z

: G2 p& a& _& j* i0 N8 rThis service just checks a flag.. ~' L  t+ Z$ f+ \; ^) |
</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-6-8 08:26

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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