找回密码
 注册

QQ登录

只需一步,快速开始

About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>: C7 n/ A: R/ K  X. O
<TBODY>
5 [# i7 g7 J3 R+ ~<TR>; b2 k6 t& m1 M
<TD><PRE>Method 01 2 l9 y  t/ g4 \6 S6 _& C
=========* {( y( g) e0 k7 C7 B' f1 N8 R; J+ p
/ I2 v- z9 X; z& m7 X
This method of detection of SoftICE (as well as the following one) is% R8 Y9 i5 U3 K& r8 t7 y
used by the majority of packers/encryptors found on Internet.' A) w4 O% y4 f. a
It seeks the signature of BoundsChecker in SoftICE
" @9 ?; R& x  p4 n
* z" z6 y* m) ]0 Z- O# Q$ q9 V    mov     ebp, 04243484Bh        ; 'BCHK'
2 \, t! d- |; _% [    mov     ax, 04h
9 K2 v$ K' {* h! u" b' @    int     3       1 e+ q  Q# e( u0 Q
    cmp     al,4; I1 o. D  X( A8 X& a- y
    jnz     SoftICE_Detected
9 G0 k( j, A, h* ?+ A+ e* }8 T7 p; O; W. g
___________________________________________________________________________
7 o  }  O! I5 G7 D$ u' [7 ~: E, h# ]1 B
Method 02
0 T9 E& u2 u, \  y9 x) P=========
' d* z' Y  f+ N$ i
# \7 i$ U( J/ k) @Still a method very much used (perhaps the most frequent one).  It is used$ h/ M- [: J" E2 `1 q# t
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
; y* v% D' _! a$ Zor execute SoftICE commands...
' f" |8 O5 l. `: o5 s9 KIt is also used to crash SoftICE and to force it to execute any commands
" ^% V+ [( T& T* k: t(HBOOT...) :-((  4 G- d; M9 A2 x  f7 Z6 b3 U- e2 A
; r) T2 ?6 W. z2 v7 @, b
Here is a quick description:
$ r7 q3 b: J. d0 Z-AX = 0910h   (Display string in SIce windows)8 X" x% w. @8 b& O; s! ?7 }9 p6 U
-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)
  j( W4 }! g/ {4 [3 b# p$ X" }1 x  i-AX = 0912h   (Get breakpoint infos)
% s8 M( E" |& T/ Z4 |-AX = 0913h   (Set Sice breakpoints)" c+ m9 Y% @: [: o
-AX = 0914h   (Remove SIce breakoints)
1 y, l* r8 i- U& X
: ~$ r/ r( c8 U7 B; iEach time you'll meet this trick, you'll see:
! q- T. v4 A8 d" u-SI = 4647h# y* k/ @- E8 h
-DI = 4A4Dh
5 |0 T( ?$ B* R. mWhich are the 'magic values' used by SoftIce.9 S+ _3 B  V7 y& V
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
/ s: w. O8 C  u4 f  d2 U' M+ f7 ?8 O5 h( ?
Here is one example from the file "Haspinst.exe" which is the dongle HASP! ~+ _; k3 i; H4 A& _" ^
Envelope utility use to protect DOS applications:
; W# p5 A1 i# q3 m. l
/ }) u5 y5 |7 ~3 O! L+ w
) I, V8 z' b7 n! ?" e2 {) m$ q4C19:0095   MOV    AX,0911  ; execute command.
! X" y- \" O  w  }( b2 f4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).  ]/ ^, Q& a" I  U: N+ p* X3 Z
4C19:009A   MOV    SI,4647  ; 1st magic value.0 p8 C" \2 G5 S% g# G- q4 u- V
4C19:009D   MOV    DI,4A4D  ; 2nd magic value.2 E& y+ Z6 @5 z" k3 h
4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
& O: f3 F* \; T5 V. p; C4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute$ K+ z  `" K, j; e  F' @
4C19:00A4   INC    CX
) f2 n) k4 _6 ]$ i4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute" r1 ~; `. i! t
4C19:00A8   JB     0095     ; 6 different commands.
$ X: L6 o+ z1 V# _9 F4C19:00AA   JMP    0002     ; Bad_Guy jmp back.5 ~" r( B& e, |/ _9 J! a1 I
4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)6 I) F/ s, c+ b4 a! h9 z* X
5 H1 Y5 |' N1 W' e8 U
The program will execute 6 different SIce commands located at ds:dx, which5 D8 S- ?9 x: T7 E+ l9 h& {
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.1 s/ }  F3 s9 r

. d7 g" j+ @7 e8 F* B8 b! r5 q* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
- v7 G2 `. w" L. A___________________________________________________________________________$ ]# ~% c7 R) K& q6 g  c
5 E8 c! q& I2 w2 d9 |

* f: s4 i- N+ K( ?/ |1 VMethod 03
& d+ B% S* L) C4 r0 T& g=========& t. o7 Z" u. x5 }+ m5 @$ g
% ]+ G2 T* ^2 M2 N& m! C. \9 |
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h* R$ a7 f) s2 u( E+ U
(API Get entry point). E: o: u# v, F& r$ q. f
        
: ]2 N+ @4 f2 C7 G$ u1 C* J3 X1 V7 Q) _! l
    xor     di,di- g  e$ A7 h+ m1 D
    mov     es,di' ], G  B* G- g" p+ `% @
    mov     ax, 1684h      
' l3 c. T7 k/ Z$ K* a  [# w    mov     bx, 0202h       ; VxD ID of winice0 Z$ D' `; Z) g
    int     2Fh
) ]1 Z. M/ H5 G& `    mov     ax, es          ; ES:DI -&gt; VxD API entry point4 B* M5 `/ r: `; P" r
    add     ax, di' }+ `6 b9 V' [: W8 u$ u
    test    ax,ax- O) C, C9 V+ }* V
    jnz     SoftICE_Detected9 {( R2 W8 w/ H  i

+ T; A2 p& y/ C9 N5 q) r+ V___________________________________________________________________________
+ N6 d0 F7 k' ~' h
" ^' ]3 K+ V0 ~, k+ @Method 04
" c0 L% N0 r. i% j5 a2 \% X( a=========9 J, R/ [3 H$ ^: I

) f/ x& I; N: y8 m3 {6 @2 l# ]6 @+ ?Method identical to the preceding one except that it seeks the ID of SoftICE
* |2 A. [: ?/ c2 ^GFX VxD." Z" S; x$ l4 z
. N# Q; @$ T& p5 O5 w
    xor     di,di
, Y( O" w  [6 A, ~+ S    mov     es,di8 _# H8 l9 {% b7 Y+ D
    mov     ax, 1684h      
8 P0 \+ q- w+ J- M( h    mov     bx, 7a5Fh       ; VxD ID of SIWVID
: D0 P" \/ y9 B. m    int     2fh
5 F0 N7 G! d! U5 G# |; H    mov     ax, es          ; ES:DI -&gt; VxD API entry point! |0 I: B& e" H! j/ u- E
    add     ax, di9 d* m* m% ?# u! i& G
    test    ax,ax
2 `' W' [3 M+ d8 ~    jnz     SoftICE_Detected
6 ^$ l. V! c! b' y4 I: X
7 Q: T8 S7 @- ^+ Z' @% f" o" c__________________________________________________________________________; ]/ w' o3 p; y& v/ V# G2 K
  o/ o/ s/ U- K* T$ H: N

7 [, i0 m  w' C  T$ `+ tMethod 05! r8 _1 l9 M* F( T) w7 j* X1 x8 C
=========- `) \5 E2 p- {9 Z
6 t" _8 V) c% l# S
Method seeking the 'magic number' 0F386h returned (in ax) by all system
6 W$ D' ]0 h" A0 A% q2 fdebugger. It calls the int 41h, function 4Fh." I( }: B. h" G" Z$ ~  \
There are several alternatives.  1 G1 ^3 i3 G$ \: z" f
' E# J! u* q0 q6 p" o' J; B' A
The following one is the simplest:$ b6 N8 Q, S8 ~

0 J  o; A$ O$ n* X- J$ U) t    mov     ax,4fh' h+ y! {7 a" k3 }# y
    int     41h
  S/ W2 i/ V/ e5 n  R2 r# a    cmp     ax, 0F3869 b4 E" U7 S# f, x
    jz      SoftICE_detected: H  q7 ^9 e: x8 s" t
8 K  ]6 z9 a9 `8 c, C
9 w6 ^5 M' |" J4 C: |3 s7 {
Next method as well as the following one are 2 examples from Stone's
  @0 I, N9 b, X4 X, l% N"stn-wid.zip" (www.cracking.net):" K; _9 r+ G3 C
: g# g7 ]& v9 r0 N8 R$ m
    mov     bx, cs
5 m( p2 o9 u; X$ p    lea     dx, int41handler2
9 D; J' Z7 O5 q3 c; }    xchg    dx, es:[41h*4]
4 x/ w8 N" I) B' S2 T9 X    xchg    bx, es:[41h*4+2]
. X4 D+ i5 [+ f! A. _0 W    mov     ax,4fh% a4 }% H4 o5 b2 e# r
    int     41h
) {/ M; k/ N& P" Z, [6 ?) P8 \    xchg    dx, es:[41h*4]! K3 q# V5 U# V' w, C1 V  K# i
    xchg    bx, es:[41h*4+2]
3 j+ A0 P% Q5 U% {  N1 A% \    cmp     ax, 0f386h
' F: P% P/ u: F9 {' ?  q. [    jz      SoftICE_detected' U0 k. v6 v- m5 t: E
8 O4 F6 h1 @5 _+ d
int41handler2 PROC
( k; h8 f) s0 G. E    iret
4 N. }4 U3 K+ o  {int41handler2 ENDP: E1 e; ^  s, c8 H
% N+ c1 L; j- s
( }% s6 c5 f& l4 p' \$ O; @  w9 n% {
_________________________________________________________________________
, |' i& q5 T. O* A' E) j) ^
; _3 E! o$ E9 G5 m7 b* y% `
, _+ H, L6 {2 i/ uMethod 06
2 O+ F  _2 s6 O1 G8 c4 l=========
" E; W( t4 Q2 |! v* J" G+ o$ {. G$ Z/ [7 K) e9 ^' [1 C7 g
) K& l$ L# r+ C: \3 B7 o$ o
2nd method similar to the preceding one but more difficult to detect:
) P. w; i5 k4 V* ~) r7 K/ g
# ^+ w- O& H! O/ G5 \$ _+ g" n& r. E; H" _4 l% K( a; l
int41handler PROC
" \) L1 `6 ^6 d# c) F0 N3 I    mov     cl,al
% x" s. p( F1 s, y2 b3 @; o    iret' S  j6 T  z* D, D4 L! r
int41handler ENDP
) l7 S% |. l1 E8 j  h/ ]! E9 h2 a+ P1 D, w/ G4 u7 Y' O
9 H/ ?" k3 Y! B8 R1 g" B0 ?
    xor     ax,ax
% `% O# X' L# x' Q# N) m& ~    mov     es,ax
) Q: M& k- o) P! l" ~5 A    mov     bx, cs
6 q; y3 j8 X8 C' E    lea     dx, int41handler0 n2 u$ Y! j, o. K
    xchg    dx, es:[41h*4]
: ]5 f' f2 n2 J# T9 v2 q2 L    xchg    bx, es:[41h*4+2]
7 _' u/ N2 T; R  x" o, g    in      al, 40h
' l& z# R+ `' O3 j  v7 l    xor     cx,cx
( {9 p% A8 f/ w4 O; w" ~    int     41h' D' z& A% e: k; x
    xchg    dx, es:[41h*4]) [* y  ]. b- F! R$ F+ Z
    xchg    bx, es:[41h*4+2]
6 Y: G4 E8 c: |9 \. @    cmp     cl,al
: T$ Q  q* O: k    jnz     SoftICE_detected% a& f1 W3 W& ?; n& Z
* u9 \& E1 m. K1 v: U  ?( _
_________________________________________________________________________$ r% @9 Z5 p. f1 @* _

' f5 ]7 U, r2 y- y/ eMethod 07
$ K0 }7 V' {9 \/ p, Q; d) E1 e, X2 Z=========6 ^' z, l* k" g  n$ w
* \  }* L* K4 `, T+ I5 M3 j
Method of detection of the WinICE handler in the int68h (V86), K, c' A5 t% y$ S' T) J! y

9 K9 Q% E1 R$ x1 f    mov     ah,43h
7 ]. l3 A7 H1 g    int     68h
/ ^( ^; Q( ]4 o7 Y7 ^9 p) e' M    cmp     ax,0F386h
" i3 J1 w- k# W! B9 G    jz      SoftICE_Detected
9 a* a' r$ q# X4 {9 a  v7 P8 L
2 G3 N# |' C# @+ R- L8 C  a! @) B" X" {/ E/ Z2 P7 d: c
=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit$ i% F/ M) x# ?' N" y% a
   app like this:
4 p: |3 G$ Z, j1 w6 s
. y! J! S5 P7 d* @3 t$ `& B5 v# x   BPX exec_int if ax==68* W) L$ {3 M# k: D( `, I. v, W
   (function called is located at byte ptr [ebp+1Dh] and client eip is" E2 M" N" A& W2 A/ Y, C/ P3 G
   located at [ebp+48h] for 32Bit apps)4 o/ J. g$ S. B7 }' i  j% ]
__________________________________________________________________________( z0 B* G. b7 J  x: C
* b8 c9 A  W0 O. X# ^' x+ [
8 S' w( Y- a1 p" D
Method 081 N/ e3 z5 U* [: V
=========2 Y$ `, I" p: K& H* g
9 q+ @$ k" a" O' y/ @
It is not a method of detection of SoftICE but a possibility to crash the) M- E5 c7 b% }* J. |- v$ J
system by intercepting int 01h and int 03h and redirecting them to another
  w  H8 k6 x. P8 x( ?* ]$ ^5 W; A6 m6 Kroutine.' F; A: X: |: X( }5 ?( b: _$ E
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
5 a' t3 c8 f+ Q! Xto the new routine to execute (hangs computer...)/ ]3 P# ]) v7 g5 p8 [! W2 u2 X
6 ]7 a" z# v" n. S/ Z
    mov     ah, 25h
, N! o3 F( Y/ X* Z0 p    mov     al, Int_Number (01h or 03h)$ a  [$ n' r; O4 y( K4 f. }
    mov     dx, offset New_Int_Routine
' s  p% y( l) e& l7 p    int     21h: f6 f8 [! b+ y+ C* _

4 H: g1 D7 Y5 b  I" [5 S__________________________________________________________________________
% ?3 s( V. S2 {1 ?0 e
/ b7 R* _# k2 D; I2 v/ MMethod 091 |, E! A0 L% b8 Y
=========
9 w7 b* [2 g/ |
9 V1 A, x+ ^' y7 Y/ ~2 u2 U+ V: L) _This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
; R" ?2 f0 L( Z* O8 `performed in ring0 (VxD or a ring3 app using the VxdCall).
6 y, `# d, T/ EThe Get_DDB service is used to determine whether or not a VxD is installed2 r1 Q4 [$ A& v, g
for the specified device and returns a Device Description Block (in ecx) for$ e2 d) N5 _3 t6 G# C( ^
that device if it is installed.3 p/ d' `& U" F9 {" Y6 I1 y

$ D5 }! ?" ~+ ~. A; f3 |/ m  o   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID
) c) k3 u- k- {7 |& S   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
2 E, a& U# _. ?& |# D6 Y7 K9 U5 e   VMMCall Get_DDB
  a- G! K3 Z/ y0 I+ N8 s4 }   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed; o6 Q  N  }# M8 N2 e! y
: o4 I+ X8 u: z& M1 @; B3 B4 f: F
Note as well that you can easily detect this method with SoftICE:
1 h2 ]; O1 }/ \4 L0 i   bpx Get_DDB if ax==0202 || ax==7a5fh: m, i- ^% E+ l, c. @

- D, ?0 t; X2 R$ x__________________________________________________________________________% f" Z; n& Q/ e$ O5 s
. a# x6 \) X' u1 `
Method 10
/ _$ d& J5 s; V=========
, D6 [% r- w/ L1 k. C- F  [  R4 ]* W
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with
4 [- l. U, O; D7 p2 j, G& f  SoftICE while the option is enable!!% c5 F8 ]1 ~% P/ Z# t* f
9 I8 k, H5 M4 P! m3 D3 N
This trick is very efficient:/ ~2 j* B. g0 `0 ?3 ]' k$ X! [: h
by checking the Debug Registers, you can detect if SoftICE is loaded
8 a. ?2 u- L+ S  T( c9 l3 b4 Z(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if( e# c4 y% P- g
there are some memory breakpoints set (dr0 to dr3) simply by reading their5 o- R3 J8 N+ j- y8 c
value (in ring0 only). Values can be manipulated and or changed as well
' T9 e* y$ Q- l, l# b' _; T4 I(clearing BPMs for instance)
1 ]' A% r5 c' C, |' S/ E& E+ K8 E: s6 {
__________________________________________________________________________1 O9 L/ F( a4 b3 u  g: O* U

# w4 f) c& f% h' h% g5 }Method 11% I7 x, t1 }  ~1 S, ]) k  b: o+ K" e
=========
* Y  T0 T4 _. [% E3 Q* x/ E" v0 m, u$ A. |* [; i; ?
This method is most known as 'MeltICE' because it has been freely distributed( `5 M* `$ e8 _3 x% N. D* D/ R
via www.winfiles.com. However it was first used by NuMega people to allow
. W) r3 K+ v* p7 h' n3 ZSymbol Loader to check if SoftICE was active or not (the code is located
& x: O9 P, `1 r5 [/ xinside nmtrans.dll).: D8 H) [8 I+ d1 ~+ z; l$ F' ]
: @  O8 A7 \% y& J
The way it works is very simple:9 p/ E+ p# o3 H+ N4 R3 n
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
3 z; @+ A9 |/ N: u; L4 [* SWinNT) with the CreateFileA API.5 J. [# ]. |4 @1 n' |3 g% b

5 r( d0 ?" D  _9 j8 n8 ]8 pHere is a sample (checking for 'SICE'):9 g/ l+ n. R' x& L9 T! d8 {
' q! s' F' p0 w1 }6 }
BOOL IsSoftIce95Loaded()
$ [. X& F. b0 K6 P{: N7 V  i+ q( v
   HANDLE hFile;  
8 g% r+ m$ Q  d: O6 X   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,( S7 u2 E* l3 [
                      FILE_SHARE_READ | FILE_SHARE_WRITE,
2 T0 o: Y2 E8 r6 x- u* B                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
, G; B8 @5 b9 E   if( hFile != INVALID_HANDLE_VALUE )/ e/ W+ q7 X' K) {
   {
0 G) z0 }; k1 C( a      CloseHandle(hFile);5 D% ~3 B0 ]7 M" ~1 L
      return TRUE;( D8 g- ?& _( T) i5 a$ ]  {" l
   }
; [: K+ C" }( T8 s% ~4 z% r# m: t   return FALSE;) g6 v  X4 s6 u2 x! q- r
}" r# a( ~/ y$ ]* N# }
+ F- {  r7 c* I+ k. A2 J7 {
Although this trick calls the CreateFileA function, don't even expect to be' `, O; W& y, S4 D& e
able to intercept it by installing a IFS hook: it will not work, no way!3 b& ^6 b4 I8 b( u$ s" Y, j/ J
In fact, after the call to CreateFileA it will get through VWIN32 0x001F6 [% Z+ I* {6 d  n! k4 r& \
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
( k0 A# ]; z0 S0 E4 L6 Cand then browse the DDB list until it find the VxD and its DDB_Control_Proc# F+ S) t* b4 x1 G
field.
% d4 J6 k7 t7 F  |: A8 ?In fact, its purpose is not to load/unload VxDs but only to send a 2 X' M$ `- @7 |9 Q1 ~
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
2 D8 f: V9 f) L3 Y: ]to the VxD Control_Dispatch proc (how the hell a shareware soft could try$ b( ^0 W+ B. J  m
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
% {- {1 d$ y8 J6 q1 |6 ^/ zIf the VxD is loaded, it will always clear eax and the Carry flag to allow) N) d: \$ c$ y3 K5 q; y
its handle to be opened and then, will be detected.& n7 C. }4 c) u( O$ T  l
You can check that simply by hooking Winice.exe control proc entry point1 Q4 s2 K" z# D4 C
while running MeltICE.6 ~. }8 L2 W3 ^. h  H

# q2 \8 I% P  ^9 n3 Q2 n
: V, H# e+ ^& @  00401067:  push      00402025    ; \\.\SICE
9 s  f4 N2 i  O: n4 r5 g7 i8 Y% L  0040106C:  call      CreateFileA* M* f8 ?# i6 ^
  00401071:  cmp       eax,-001% x% V1 ~; L/ Z6 m. C2 L: m+ \' l
  00401074:  je        00401091
) s3 a# d! T. m
4 i9 g+ i* N" R6 u
8 t( E1 Z; _" @5 TThere could be hundreds of BPX you could use to detect this trick.
9 C, h1 e  y, t- o-The most classical one is:' X  q) _/ ^( J1 g0 a
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||+ A7 L/ Y6 r! ^2 M% X2 g% [
    *(esp-&gt;4+4)=='NTIC'8 O7 R: h5 I. ~  d
, s: S# l' l" H! \( Y) E4 y
-The most exotic ones (could be very slooooow :-(& }8 V# H8 n5 c& U! q! `
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  
0 S5 U- C) G, n4 h     ;will break 3 times :-(5 `3 y/ K0 a- q  ?' y
. M+ h* a; }: D4 G; W
-or (a bit) faster:
# N9 `' ]( R! M5 R( ]4 J   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
4 Z# s, A! f4 j) X' L1 E2 ?' e! c$ G! A2 _7 Z7 _
   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  5 l6 h+ Q- m8 Z
     ;will break 3 times :-(
; y" u1 W8 y! o+ J  K6 \" c% d5 j1 H( x% x; S
-Much faster:
& [8 s4 o# {5 W   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'
- @. S. x: s$ c- B2 |& T2 w
+ A9 G, p0 e& }# i, k  uNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
& J! S  k! y% V/ d1 Gfunction to do the same job:" b9 Z, e8 A% N2 u$ Z5 f
) P. K& P% D" p8 O/ @" w. c$ u6 K; w( S
   push    00                        ; OF_READ
  K( a( H& C4 e5 {) q   mov     eax,[00656634]            ; '\\.\SICE',0
6 ?2 O6 t5 B8 I% g% e   push    eax
( Y0 p* ?! @$ P9 U   call    KERNEL32!_lopen
$ E8 E: U3 H/ m5 ?1 O1 G   inc     eax
5 m* v) A5 y+ {* Y3 n& h* s   jnz     00650589                  ; detected
$ f9 X% C9 l" E5 W% ~! p' l" r% f& S   push    00                        ; OF_READ3 @2 F/ k: h; E- a& J  M& V) Z% q
   mov     eax,[00656638]            ; '\\.\SICE'. y. i7 K+ C/ _0 H" ^! f0 r4 ]' b: ~
   push    eax' G: |3 u9 m' {
   call    KERNEL32!_lopen
0 c- u9 K8 V% A6 U   inc     eax$ {; ~8 E  R! o; S0 q
   jz      006505ae                  ; not detected, G+ }, _2 u, L! \- v

7 H0 E& @9 o; t2 x' s# E! _, Y! }) D) b5 c$ L, A1 Y
__________________________________________________________________________6 R, l' f) b9 Y+ @% |; p: ?

$ D' [: q/ f. C$ O8 Q4 N9 N) F, L3 TMethod 12
4 F1 e; R: E, c=========
9 K2 r1 F: b. p( \3 p+ w, B
! U8 d2 G0 \7 h) j8 _6 cThis trick is similar to int41h/4fh Debugger installation check (code 05
% V5 t# n2 `7 ~2 i7 K% y2 i3 w&amp; 06) but very limited because it's only available for Win95/98 (not NT): X3 n" m. j. ^, _- \
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.; O' `/ p$ s" i9 A" `# Y) M

, a+ L: z0 n: |! ~   push  0000004fh         ; function 4fh7 ?4 {# e" e' J/ X* L
   push  002a002ah         ; high word specifies which VxD (VWIN32)
$ \- Q. N1 ?& v6 N# O                           ; low word specifies which service
! [8 D5 B, K2 G" A9 F" }                             (VWIN32_Int41Dispatch)
4 L( ?1 u6 W& m8 R- w   call  Kernel32!ORD_001  ; VxdCall
, m6 E" x- C; U- @3 J+ [6 Z) a   cmp   ax, 0f386h        ; magic number returned by system debuggers
  g* P# o7 Q( O, w* y, M0 m   jz    SoftICE_detected
' P( q1 H: @: `: u. L7 I9 w5 L# E( R+ y1 E* l( b/ _& v6 q; @+ O6 c- t
Here again, several ways to detect it:
6 I/ @$ u) Q/ c" F
7 Q6 O: r# B6 l/ E9 {* Z6 S1 A) }& c    BPINT 41 if ax==4f
% B: c2 a, r$ Z+ F, z8 @" ~# _
2 [9 U* v% A( y- i/ }) g    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one( L/ V: R  X# X6 t

* }# i6 M. N4 x6 z6 R% ]3 B: W    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A1 O5 s8 f* a1 E
, N1 t' N' M) \; O1 \
    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!' \$ p( A# N% u9 a

2 N; W, @" l; P5 c" {7 n__________________________________________________________________________5 a, j$ z! z- w; O) Q! A
! |) F) K" n, i* k  H0 ?/ F1 a; l
Method 13& _1 v: j3 _  Q  e* g
=========
- X! S1 R/ l& h- M% S( D, e7 o$ T* w2 f, q
Not a real method of detection, but a good way to know if SoftICE is3 I: h% S; Q9 i6 I
installed on a computer and to locate its installation directory.2 S1 T4 Q1 b2 {  \* T5 m/ Q: a
It is used by few softs which access the following registry keys (usually #2) :( V- |/ B$ _3 I
3 B  j: Z0 _, O5 f& T+ S' Z
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
( q+ o  t) y. A4 A8 V" a\Uninstall\SoftICE
" Q) f2 j& G  C-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE' O* k  u8 [) i' \3 @. N  ]9 C" a' p
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion, v' P6 f/ S5 j; m0 u3 l3 _
\App Paths\Loader32.Exe
# B% P4 f2 O2 c4 H+ `& S$ D1 n* S, Q2 C
3 R. Q6 e. o' O8 c" l2 u5 ~
Note that some nasty apps could then erase all files from SoftICE directory
" _4 ^# f- a0 F  [" D(I faced that once :-(2 n6 }' t% W- t' p

, r0 T- B0 i& ]+ T1 wUseful breakpoint to detect it:
1 d/ ~, F5 ~/ V8 z: O* V; u3 A# ?6 w) v1 e0 ], `! q+ ]
     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'+ _- I/ l( |6 k; [

! u7 I% V) q* w( ~__________________________________________________________________________
4 c3 ~' W* F9 a# U: X- y
' H/ o- r5 B3 W0 `% A/ Q2 M  H7 N- U
Method 14 + ]+ K% ~4 C+ [  j
=========+ d* C4 Z3 a3 y: b, g3 }* b, p( J
# l5 _8 o0 j  X7 f& x5 n
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose$ I- d2 B; b4 E: q, ~
is to determines whether a debugger is running on your system (ring0 only).
0 p5 K* ~: b# @
$ l) d( a9 b* g- e( c* p   VMMCall Test_Debug_Installed$ U) d+ O" I$ `, Y9 o  t
   je      not_installed
' |: K/ K, T/ ^' ^* g
2 ^* R9 E2 r4 n9 ?% e. FThis service just checks a flag." @/ i/ c9 K% m- ~: Y: Y! b3 `
</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-5-11 08:54

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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