找回密码
 注册

QQ登录

只需一步,快速开始

About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>7 V# A' v7 i7 c4 ^0 r9 ~
<TBODY>  ^& f$ t' J* m' b
<TR>
$ p1 G# Q' x6 Z7 j<TD><PRE>Method 01
# V7 h' \" G# i3 y4 s=========
  {9 a; |6 [# f5 A" |" u) v' o! v6 e0 L' i; N9 j5 i4 c# q1 w
This method of detection of SoftICE (as well as the following one) is
, W$ U3 V. Y' P! n. Gused by the majority of packers/encryptors found on Internet.
3 T8 D! O$ H+ k, ^It seeks the signature of BoundsChecker in SoftICE# }, }) p  {0 r4 u

) n9 a; M; G% h, _7 k% g    mov     ebp, 04243484Bh        ; 'BCHK'
% K, u  E( G# `2 S. E1 \2 N    mov     ax, 04h: V4 |' P- s/ a' @% K! f
    int     3       2 i2 B. N7 k6 g2 u" [9 L1 [
    cmp     al,4
: p" o2 I! A9 y' n# i) l    jnz     SoftICE_Detected2 q5 [( |) ^+ E
- ~& x. S; b/ \# C# |2 u6 Q+ ^
___________________________________________________________________________0 c- o( T  R; C3 S& r2 P# p; Y7 E
0 S0 n9 B, t+ ]/ [% q5 n
Method 02
& R; X) l; z' ~' u# p0 d7 G  m% P=========8 ~! W* |& u; i! H+ V

( F& z2 W/ l: C4 H, i4 g# E5 OStill a method very much used (perhaps the most frequent one).  It is used- o; Z' ~+ L- n7 O/ Y
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,5 m: M1 |1 j% P6 n) }% N
or execute SoftICE commands...
  Q2 B( R( q( F& hIt is also used to crash SoftICE and to force it to execute any commands
# @9 b* o- k  O- _( c3 ](HBOOT...) :-((  4 V" _! q  C0 C7 S: Z2 D2 N
- L2 u! [# S+ T" b5 d) l4 g
Here is a quick description:  S9 K6 K, b% D
-AX = 0910h   (Display string in SIce windows)( }8 n% e: n, V# Z3 `7 [4 C
-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)
. H7 l! m" ~: \6 N, N# g-AX = 0912h   (Get breakpoint infos)
  L5 i$ T) @+ g# Z9 h' n& B; Y-AX = 0913h   (Set Sice breakpoints)
, ~/ Y+ g" C; a! m0 Y-AX = 0914h   (Remove SIce breakoints)
$ U$ {( u1 {6 i# R3 {
) \4 R4 E7 P' e5 P" KEach time you'll meet this trick, you'll see:+ m9 c! i& s, q6 g% d
-SI = 4647h) u. e: z& K' J7 Z) N* l
-DI = 4A4Dh
; y$ E' d+ y& C$ `- F1 q7 ?Which are the 'magic values' used by SoftIce.
/ h, l! k: [+ p( GFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.6 g$ s7 W) m8 {  k' X' K
; F* \, ?  g+ J# l* c! Z
Here is one example from the file "Haspinst.exe" which is the dongle HASP
5 C, e4 B/ d' {9 fEnvelope utility use to protect DOS applications:
& ?6 r& Q% }; Z; H  E6 P# H6 p1 ~; G4 y5 g7 ]# t

/ n& J' @# o' m7 b3 j; _% L4C19:0095   MOV    AX,0911  ; execute command.
$ X" ]3 [/ n7 i' k" N, b$ B4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).. x  [9 ~9 I! w' W
4C19:009A   MOV    SI,4647  ; 1st magic value.- \9 T  B/ B9 }$ {! t
4C19:009D   MOV    DI,4A4D  ; 2nd magic value.1 a5 g- R- n5 ]  Q7 Y) W
4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
  Z. `: C: I7 E( ~4 G4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute
, Y% r. t9 k% Z* J4C19:00A4   INC    CX: |( k4 Y  \0 Q) o, S0 y; b
4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute
9 C! |; Z6 v7 G' A; P2 k8 q4C19:00A8   JB     0095     ; 6 different commands.
! m# ^) R7 ?# m/ D+ T4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
* \. v1 _2 ]9 s' g4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)
2 d5 s8 S! w* s& k  l) F4 w2 E
. z. k3 `3 g( O+ Y4 aThe program will execute 6 different SIce commands located at ds:dx, which; v" V* ]6 u$ V. X5 {, Q0 G
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.0 A2 |5 n# R7 R$ |$ Q1 B- f: {" C
7 ?$ Y! @+ T( \0 V% x( ^
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
# c7 M0 x. `) C& v# c' }___________________________________________________________________________# V  Q# c* |3 b& w0 ~
( i5 W- k- R' f: \  H. F0 Q

7 U: g1 [* ?: fMethod 03$ |8 {4 h6 O1 P0 f4 H
=========
: v2 k. B( M, y, \5 O
. U5 r2 O0 _; I) `4 N& G. K2 aLess used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h% Y% }4 @# _4 J9 Y9 M) G0 F
(API Get entry point): R6 x/ G& v) n; Z
        " \3 p/ K8 I* \7 s8 i% c

0 W9 f) x) O' G6 }5 u2 A- {0 y    xor     di,di) Z+ E* x8 h6 {, |
    mov     es,di( I0 J* A5 B. p' e: r% w  e9 y" b; O
    mov     ax, 1684h       # m. l9 l4 O( V0 R" T3 @
    mov     bx, 0202h       ; VxD ID of winice) E2 ?9 Q1 T. O% x( D3 l
    int     2Fh$ K1 l- K0 h: g* M1 c& v/ F( m
    mov     ax, es          ; ES:DI -&gt; VxD API entry point1 J' D5 v; z2 v. y" n9 e8 B5 L
    add     ax, di
! Q; @, T! U+ H    test    ax,ax
% \- t  p, X* }' w* J    jnz     SoftICE_Detected
+ p  ~0 q: J3 Z$ w1 ?2 j8 ]; U5 Y2 x. ?
% O% g2 F/ W. l9 J) ~5 ?___________________________________________________________________________
- c+ o6 k* @1 g+ k# T, ]! h1 c$ C. R3 n- j' v0 r
Method 04
5 j3 e2 p" G2 ~# t=========( i# j4 t' t. h0 i( l7 ]& F4 s+ @

( ?) g3 k* r: S: C5 v# SMethod identical to the preceding one except that it seeks the ID of SoftICE
# R1 E4 Z0 U! N! [# ZGFX VxD.
/ n( H% b: r9 M
8 P& l- l6 Z8 j, z    xor     di,di
5 A, T% N  |; I6 y" \, p& ?    mov     es,di' ]. @7 o" S' r2 s( L, R2 W! H
    mov     ax, 1684h      
, ~4 h- _+ C; Y+ o    mov     bx, 7a5Fh       ; VxD ID of SIWVID
! K# q% s- f5 w* U8 p" J5 U' ?    int     2fh
# \3 H5 W: c' q+ [! m% b: Y9 r6 h    mov     ax, es          ; ES:DI -&gt; VxD API entry point
/ S0 H& d# q$ C    add     ax, di
- g8 C  v2 `7 r- K) f3 `6 ?    test    ax,ax6 k% }9 k) r9 _% A/ K
    jnz     SoftICE_Detected1 ]; Q' V# L* z6 c% |- F
# c$ ?7 o8 a0 }8 ~7 @
__________________________________________________________________________
5 j3 n, Z8 z* @: U7 n" B7 }% E  `% e* w* x7 |8 N: i

, [% c6 H; c$ ?: RMethod 05
% K. T7 M' }' Z6 g=========- {3 n4 U  Z6 f9 ^+ L

( I. f/ B) y8 ?0 _; dMethod seeking the 'magic number' 0F386h returned (in ax) by all system
3 c+ q$ O7 G+ P# t' \8 Ydebugger. It calls the int 41h, function 4Fh.
1 O; t5 [: T! z7 \/ i+ R' aThere are several alternatives.  / g+ V" m) D( S' h

% m0 s4 d  N4 }The following one is the simplest:" w4 B) H1 [' C8 G; o; [3 k
5 R& W8 ?# U9 ~1 P  i5 G
    mov     ax,4fh) S0 m" J1 X% T+ E
    int     41h4 ]1 H8 P  A' a* d4 n! y* v
    cmp     ax, 0F386* B; G( I8 F0 `" W" J7 G
    jz      SoftICE_detected
& a- p: a8 P8 v: Z* W8 ]) c" d3 ?5 A+ N' o) G( o
; I) e' ]' H$ |5 n% T# D8 Y8 |
Next method as well as the following one are 2 examples from Stone's ) {& v0 \9 j4 h& d- j
"stn-wid.zip" (www.cracking.net):
: t. M+ {7 K9 V! N& v; o9 v
. d6 Z0 w) k4 h1 c2 b    mov     bx, cs' S- |. W6 i3 B  A& {; f: A3 r
    lea     dx, int41handler2
- J7 G6 e: l- j- y, a9 l1 o5 F    xchg    dx, es:[41h*4]  |9 d  z- G' M1 ?% X
    xchg    bx, es:[41h*4+2]
) V3 o. U6 z8 @# i8 C" U  n    mov     ax,4fh% E, n9 `  z. }- E$ T; x: I; @% j
    int     41h4 ~5 s2 ]; ^4 ?7 q. X& b
    xchg    dx, es:[41h*4]% n) v+ q$ k. p
    xchg    bx, es:[41h*4+2]( P# ?! K0 G/ z1 x8 z9 P$ C
    cmp     ax, 0f386h9 c. k- T9 K4 S7 M
    jz      SoftICE_detected
7 y( R) Q3 B" X2 o8 L7 L
  {4 g: C3 V% d* ]" bint41handler2 PROC
7 [' O# h+ N) _6 q  m    iret
9 s5 F" I6 V; q: V9 x* t8 iint41handler2 ENDP  b3 V4 g: ]4 k; G6 Y
" Y, P4 k6 u* m7 x" ?* i
! z/ u' |$ Z  P2 K! Z
_________________________________________________________________________  ~5 Y. ]4 c$ s- ~8 v) w
4 A) s+ H6 X: U' f2 ]

. _  m7 R$ g6 D$ f( BMethod 06
/ A' b+ T( I: p4 C6 K: k1 H/ Z=========/ C! U  j: n, w: Y, z
. P! n* o- _( D' }9 a

' |4 P& G/ i% R4 ^2nd method similar to the preceding one but more difficult to detect:
+ Z- \: [; ]) Y4 W- a- r: d) I6 R: m- a: C: g0 g
9 n6 ]7 L0 D* u/ r4 D
int41handler PROC  @+ q+ U! q5 O, v8 s% Y
    mov     cl,al6 J( @3 n" D2 T& g, @; I' T
    iret6 c8 o$ v' y- j% S# w( n4 L7 |- n% K
int41handler ENDP
" k5 \. D% j2 B5 G
/ E$ N0 v0 w2 g! v. X' s4 L, y6 Y+ F
    xor     ax,ax
& c! s1 M4 Q  Q    mov     es,ax
/ L: @, v, H; W/ g    mov     bx, cs' u+ V9 k# V, g* I% T6 \( X. L
    lea     dx, int41handler
4 @3 j! X, ~( X6 A/ Z" M' _    xchg    dx, es:[41h*4]! p. h  }1 X- D6 n$ k; W: y
    xchg    bx, es:[41h*4+2]
1 v# e( D6 R2 k, F    in      al, 40h5 g& e2 f: f. m. S* [" \) H6 }
    xor     cx,cx
) Q, [2 U0 M, D6 `( v" y6 ~6 p" y5 g    int     41h
( Y+ @+ {; z: Z& c3 ?    xchg    dx, es:[41h*4]( U  i: Z( l8 Y. Z
    xchg    bx, es:[41h*4+2]- M1 n7 d' S( Q) b8 N4 w
    cmp     cl,al2 U) [5 a* L$ n: }
    jnz     SoftICE_detected
3 S6 |! N$ r# z
5 }3 s4 t7 G4 b% h  B" P_________________________________________________________________________6 U( K/ @( |% d- ^0 `- s9 f

; S1 J  k7 o) rMethod 07
/ [  b% Z' O" V7 c=========
+ j2 i% W3 A: X7 V7 x- C8 _! Q8 J0 R! x4 O
Method of detection of the WinICE handler in the int68h (V86)$ p; R) D/ y+ J+ z' W% d

) V0 {! E2 y; l: F' l7 `    mov     ah,43h7 {& D, Y' @2 c! o7 j4 c
    int     68h, f8 V  P. ?. F. z$ }
    cmp     ax,0F386h% Z4 t  v: U$ w0 m3 \) }
    jz      SoftICE_Detected- P( f6 U3 d: K4 t. C
& E9 n  ]/ x( d/ v

6 ]+ [4 t. n! ~=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
5 D  r. Q# \& D- ^8 B  |2 Q6 B  H   app like this:! r3 G9 M& w' q/ \

5 ]- ]1 B7 x% Q- k' }; Z, q   BPX exec_int if ax==68/ C5 f1 J- j9 v  h
   (function called is located at byte ptr [ebp+1Dh] and client eip is' R' U" Q; g0 g
   located at [ebp+48h] for 32Bit apps)4 [* O7 `1 ?  ?% P) x1 ?$ y
__________________________________________________________________________
& {2 F5 J6 u5 P: [! [# N4 L- A  c
9 i4 B* A8 S8 G* \% C. E  \
Method 08
: s6 ]/ W% u9 P: R- a- }=========
2 C, _$ E: K, E. B1 W% Y2 Y+ d1 Y, x1 }9 Y/ C( [: o6 J
It is not a method of detection of SoftICE but a possibility to crash the1 l1 ]& @0 Z. G% g
system by intercepting int 01h and int 03h and redirecting them to another. K9 o  |! ^" U0 p; a9 ]* k  P
routine.
' n  r3 h) T6 S4 QIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points! ^  d" }* Z. k& @; [. g6 D' T; V! D
to the new routine to execute (hangs computer...): ~6 v1 p; v9 F/ e& F. ^( _8 }* Q

3 [' x1 a. {5 [1 |; l) j    mov     ah, 25h1 w$ P" y  ^" R# F8 I+ A& y
    mov     al, Int_Number (01h or 03h)2 j6 ~3 M) Y! e" a" d3 M
    mov     dx, offset New_Int_Routine: R& c1 D2 K6 |. H( V
    int     21h3 b6 R+ v8 J3 o5 G' h

1 [' P/ r$ A% i6 x9 W' k__________________________________________________________________________
( ~) f# H! ?- l; {$ \' w0 B" |% O& Y' v0 }1 P6 k# C
Method 09
0 p* @" z4 `7 `$ G7 I1 \=========
) ^( m: S& v1 h3 }3 M! v
$ S1 I5 l8 z: v# eThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
/ t4 k8 H) D# hperformed in ring0 (VxD or a ring3 app using the VxdCall).& V; G" F- C- U$ u
The Get_DDB service is used to determine whether or not a VxD is installed
" P$ F8 j8 [: D1 t" ?1 {; Ffor the specified device and returns a Device Description Block (in ecx) for5 a& k! u' K; g2 S3 `1 W
that device if it is installed.! i* a  Z1 t( o6 s; t! o

* b2 H6 T: J0 y) ]8 e" g( y   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID
- D* F3 e: j& }2 L   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
% u- T0 o( E5 }! w   VMMCall Get_DDB
! t. i1 K. ^8 o) ?+ v; p& w* `0 f   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed
) k5 E% a4 Q  v2 I8 n6 C/ z/ |3 J  n+ @' c" O. Y' h" |2 P
Note as well that you can easily detect this method with SoftICE:
5 T6 V( }- T3 K   bpx Get_DDB if ax==0202 || ax==7a5fh
9 l2 R6 F# ^( O, j
' }+ H$ g# g: l* m! z0 k__________________________________________________________________________
) A- N7 v/ g7 `( i. P
1 F. d9 b3 T( x& z! G0 XMethod 10
# K+ B+ ^, A1 t8 W% s' j, D=========) i7 v. k8 h8 ?9 P! m4 Y  m
5 S- N& X' b2 E+ K% x* s+ ~
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with" N1 M! X" P1 ~; m
  SoftICE while the option is enable!!' o$ {0 a% }/ q: U7 M6 m0 ~# Z

2 [9 W0 g, W1 K' g3 V$ k2 \This trick is very efficient:
! l7 ]- U2 j. \" G3 Gby checking the Debug Registers, you can detect if SoftICE is loaded
2 G' T' j) @) p1 H4 U1 H& }(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
) I3 a* k; v; a$ e# ], L7 qthere are some memory breakpoints set (dr0 to dr3) simply by reading their
+ N& A" |2 h$ m8 Y3 [5 cvalue (in ring0 only). Values can be manipulated and or changed as well
: W1 l2 b, W1 \8 ]7 r+ z5 ~! y3 l(clearing BPMs for instance): |& S" \$ [0 M8 x

5 B7 S. i% Z% J5 L, B/ x( Z__________________________________________________________________________
! B( L  r& f* e) h, [3 S3 X" O9 l+ X; @* K& _: G; `6 U. j% ]# ?9 n
Method 11
' H% r5 v+ ~7 c=========  W. b& z$ G, h4 O

# o( N. X7 i; b9 AThis method is most known as 'MeltICE' because it has been freely distributed
% p( t. Z* w1 K" u4 F: u7 Xvia www.winfiles.com. However it was first used by NuMega people to allow4 |2 Z0 s( o' G0 c" B2 r
Symbol Loader to check if SoftICE was active or not (the code is located
7 J% L5 t/ G$ x& S( Tinside nmtrans.dll).; `, ?1 {- A% S

6 [( D$ Z3 w; `. M/ |& |The way it works is very simple:
  s8 J; n0 {6 x7 [, `It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
* ^, p: W2 S1 w( K; w7 JWinNT) with the CreateFileA API.) o4 ?7 B( F6 u% V
7 ?4 X8 |$ \3 D8 _
Here is a sample (checking for 'SICE'):
, ?0 ]: @! |& K, i  z* E: O
5 B; Z6 v8 X1 b% ^0 B% \: XBOOL IsSoftIce95Loaded()
& |0 ^  Y2 \4 d# Z- g& ^, Y{# t( Q/ n  M2 {/ T% g
   HANDLE hFile;  
  ~! P9 X; s! o6 u7 M' I, m   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,5 k5 z7 Q% [* k' ]3 U6 v$ I
                      FILE_SHARE_READ | FILE_SHARE_WRITE,* L# \6 E& \! T! K- W7 b' C
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);8 t" O5 W  }/ c$ j; G0 G
   if( hFile != INVALID_HANDLE_VALUE )
+ s. j4 T  a) a5 F' ^& i5 ~   {( x2 B5 w& ]( o$ a/ X
      CloseHandle(hFile);
1 l7 z# s; w+ X5 h      return TRUE;
( B5 L" e3 O1 T   }  W1 R: _/ j, C
   return FALSE;
0 R$ ~) Z) r3 h' d! u: f}
0 O* F/ L1 C3 w- Q/ [% V) m8 Z& b& Z9 X! ~. F2 _) m1 \
Although this trick calls the CreateFileA function, don't even expect to be( b7 G) _- W, U% K5 C# @# h
able to intercept it by installing a IFS hook: it will not work, no way!) N5 ^, W' ?6 {8 \6 K
In fact, after the call to CreateFileA it will get through VWIN32 0x001F5 J1 M4 S, m2 ?8 z  {
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
2 N; F# T, K2 W0 V& C3 p8 H( P; n' {and then browse the DDB list until it find the VxD and its DDB_Control_Proc: N1 P. t  J9 T+ ^# `; V5 ?. U
field.+ A0 T3 |( z7 D/ p/ k
In fact, its purpose is not to load/unload VxDs but only to send a
3 b) u0 f% A6 T: _; \+ qW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
0 k  @& L3 K, N; [4 sto the VxD Control_Dispatch proc (how the hell a shareware soft could try
3 c+ B, N  k* ?  l# H4 ~/ Sto load/unload a non-dynamically loadable driver such as SoftICE ;-).
+ Y' ]/ Z9 R$ ]If the VxD is loaded, it will always clear eax and the Carry flag to allow8 f4 k7 Q; I6 o# n/ B
its handle to be opened and then, will be detected.
. O$ ]/ }! \! A  u9 o0 a( |You can check that simply by hooking Winice.exe control proc entry point1 w7 H6 K8 A, T* q, e
while running MeltICE.
, d; ~7 z. w- [" c1 l8 i7 |" c1 [6 z" m: l: I

/ e) L7 S7 @+ Y( Z  00401067:  push      00402025    ; \\.\SICE5 O; S  M% i+ M0 G
  0040106C:  call      CreateFileA8 ]+ i% \  t: {, Q
  00401071:  cmp       eax,-001
4 b! ?. v( N  e  00401074:  je        00401091
1 V5 G6 i! c( G1 i
+ Q0 D7 z, P8 @6 u2 j5 ?2 ~* y! t0 d5 U7 Y9 v8 I
There could be hundreds of BPX you could use to detect this trick.9 k, d" x/ ~5 D( s  Z$ A
-The most classical one is:
3 K& z* G& `5 z- o8 b( N2 w  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
- ~4 D9 z4 h2 [! M% k$ k8 F    *(esp-&gt;4+4)=='NTIC'. B: S) o$ |! [2 b" W6 Y
, j' t; W' s2 \, j6 i3 d5 ]6 K  J& O6 ?5 R
-The most exotic ones (could be very slooooow :-(
2 N$ n& m) V! {% Q   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  
6 g' O- Z, p3 U  c     ;will break 3 times :-(2 |% ?2 V# I0 @3 S3 M) M

( Y! m! |& I8 r7 O8 f-or (a bit) faster: - s9 v; }$ x/ P5 N2 Z3 A
   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')8 ~8 ]" a" h4 X2 g( C

- Z  _& U$ V0 G   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  1 k* V. Z/ l9 Q, {: _
     ;will break 3 times :-(( v1 B  S7 k2 `
4 X9 @8 V( l  ^- s+ F' t
-Much faster:
2 ~4 z. q3 A0 E   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'
) `  ~8 k/ q. I8 n) _; U
3 ^6 u) L9 u4 WNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
1 t4 ^$ F( u9 ^3 P4 Z; xfunction to do the same job:
* r. c! o0 h/ ~0 P! H9 ~9 u' Z# n! T! Y7 g+ J. S
   push    00                        ; OF_READ
& F% q. R( s7 D9 C0 p8 [& {   mov     eax,[00656634]            ; '\\.\SICE',0# t: \. ~) b% S4 Y
   push    eax' n, z& E0 @& M9 n
   call    KERNEL32!_lopen; a. V2 \, u9 f
   inc     eax* _8 f2 m1 F8 U' Q: a
   jnz     00650589                  ; detected$ n( q0 _* l, v, v' C  f/ I
   push    00                        ; OF_READ
' X9 E; Y% A" t1 I( e   mov     eax,[00656638]            ; '\\.\SICE'4 h  V2 b0 \7 j+ w& p$ c) J
   push    eax
* R  T' W6 r2 y! `1 @  y+ v4 ^$ a1 Q   call    KERNEL32!_lopen3 }- N- z4 Y6 i
   inc     eax
" R; O  @7 S2 E4 T3 n   jz      006505ae                  ; not detected( c& l: H, ~( A& Q& [
$ ]- S  j- U, }) a

1 I& X0 R' I# p4 ?__________________________________________________________________________6 I" F/ _+ B) z2 y" Q9 K: q. V
7 u# r5 I6 ?9 S; V) W  J( O7 @
Method 12, h0 C1 \7 I5 |$ }1 q
=========
" s8 ~( p) n. G' R5 d: c1 j
, n, P2 {' V; J+ a  u+ ]& ?, S% xThis trick is similar to int41h/4fh Debugger installation check (code 05
+ J2 p* w- u6 O% ^! _9 y% C&amp; 06) but very limited because it's only available for Win95/98 (not NT)
  L9 \8 w7 i; |/ \7 e% X3 ~# qas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
6 a# [8 ]: v- n& D, ?& G
# v, e+ |& B# E2 P' o) q: Z   push  0000004fh         ; function 4fh; q, ]- v4 K0 p# f: J; A
   push  002a002ah         ; high word specifies which VxD (VWIN32)/ k3 _$ p0 q' i0 {; x2 L; `
                           ; low word specifies which service2 S3 M" k8 u9 ^, U
                             (VWIN32_Int41Dispatch)
# C% |0 Z$ i6 Z5 G: q! l   call  Kernel32!ORD_001  ; VxdCall+ V2 u) }$ N: T
   cmp   ax, 0f386h        ; magic number returned by system debuggers
* F+ E! C6 B: x8 M+ n! B   jz    SoftICE_detected
5 O  |% m  K6 i/ t) z
7 @- ^2 m8 x6 A$ \( R; L4 fHere again, several ways to detect it:( X. u9 ?! Q5 v, L+ I/ y  j6 |
7 w) `2 [% g( _9 a2 s
    BPINT 41 if ax==4f# M2 q. E  u) j* h/ g% T! k
  t: Q, Y# M$ R9 q3 n1 b
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one0 u+ I+ x4 ?8 o7 Y' i' [* g* `' ~+ b) ^2 {
" q. ^* t! g: D6 R
    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A. b: v; [& P" \0 f, `0 f

0 O4 U, ]5 s1 j1 z4 D; M' f    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!2 G) v7 p: j' h# P' ?# C2 p
8 G8 O9 g: z, E) p2 C3 _
__________________________________________________________________________/ _! A- g8 i% u- l: H2 s8 v
6 P  S. E- h# e) p9 K- |  [* r
Method 13
& U( V3 y  A3 e" j, k# l=========, \1 \9 b( f: y0 A2 i4 p6 K9 [
5 K5 C! f% ~3 o3 X0 N2 ~! L6 A2 X
Not a real method of detection, but a good way to know if SoftICE is
5 X3 |* A. ~6 z* ]installed on a computer and to locate its installation directory.
/ K( [: @8 p7 A" A3 iIt is used by few softs which access the following registry keys (usually #2) :: l4 C% f2 u' U( A" {

/ N9 M; I4 U0 r1 m" V-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion3 c" O, |( ?% ?5 |9 z
\Uninstall\SoftICE
2 X: e, L. u' Z0 }-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
6 @* z6 W/ w: G/ P9 v; S# O. e. ?-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion' Q" V  z9 m. I. U/ L
\App Paths\Loader32.Exe" H! L6 r" D7 C3 a6 q
( o* i5 T1 D% f

- o9 q! ]$ U. ?1 L5 s7 q$ c/ TNote that some nasty apps could then erase all files from SoftICE directory$ O: w/ I& n4 s$ l! I
(I faced that once :-(/ K+ I5 N& T  P6 x9 }# r" q& e. [

/ B7 v0 K. R; Z. ^# D7 A0 lUseful breakpoint to detect it:* l" t* N& o8 ]) @( r3 P3 n& p1 J

7 a! r0 A* |8 I4 O, c     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
: o$ [# d' z* [
' E4 \, t2 l5 H) h) ^9 q8 [__________________________________________________________________________. }; Z4 X! n. Q: _4 l6 z7 t

& ~7 f! m) N$ @4 H5 g, O" X0 J' t- W( P7 f$ E3 Q
Method 14
1 A; p  h0 H! R3 Q* I=========
3 o1 F; U4 S' u8 y+ O5 V* d+ Y2 N; g3 {3 O
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
! m8 b# J( {7 {9 P* }! Dis to determines whether a debugger is running on your system (ring0 only).
! j  {, a5 ?. a! `; @6 Z. u9 S6 N' [
   VMMCall Test_Debug_Installed
+ A" F, W7 [( m$ L; Q   je      not_installed: @! C. D" f( ]0 N! [$ g; }( W' O

& A& f/ n- o7 `( A2 hThis service just checks a flag.
) B  V" {9 T9 e+ E/ v" g- `3 i. z0 P</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-8-9 13:41

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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