找回密码
 注册

QQ登录

只需一步,快速开始

About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>6 U) U5 a" M5 j* a/ c# g
<TBODY>8 J2 U. @' r7 y0 ~7 R: q( o8 D* S
<TR>
2 j& N3 r3 u6 E3 Y<TD><PRE>Method 01
$ L5 F; e, W) U6 H8 {=========
! D9 K2 [- g9 d0 L$ k* Q
  b' w" Q, K1 D& m3 p/ jThis method of detection of SoftICE (as well as the following one) is5 a7 P* ~2 i0 `9 h
used by the majority of packers/encryptors found on Internet.
7 r2 F' C4 X2 c! E/ \It seeks the signature of BoundsChecker in SoftICE
  c9 K6 Y5 P/ C! L4 `0 ~* K( R) @$ ~7 D" ^2 _% U) {
    mov     ebp, 04243484Bh        ; 'BCHK'8 y8 |/ p  e/ \& ~
    mov     ax, 04h9 |4 K; ^  \$ N& D# G
    int     3      
) v; I( |. Z+ ^$ I1 P    cmp     al,4# o! ?* f1 c  i& S7 ^
    jnz     SoftICE_Detected8 n' m4 |  B) x

% y5 |) d) g4 `- M___________________________________________________________________________
% W  S) k4 W: [1 |- O& N2 ]5 X
4 D& E1 n8 F" l4 o+ ]3 E, YMethod 02
. C% v0 i, F9 }7 q6 s# m3 a2 r7 x=========3 o2 U  ^" I/ i1 y2 \

$ V  k5 a+ A3 }& \, a, nStill a method very much used (perhaps the most frequent one).  It is used$ K( Q" \' C2 {) b) R
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
: N2 B# a0 ^8 mor execute SoftICE commands...3 p& N$ _7 `1 r$ y" L
It is also used to crash SoftICE and to force it to execute any commands
  K7 [6 Y5 z. a4 o. E7 a(HBOOT...) :-((  
( B8 v  ~' ^- ]. j" K9 \  K- h
1 E& c! e6 A7 d/ P/ aHere is a quick description:$ r" {- j2 ?  j! m: ^
-AX = 0910h   (Display string in SIce windows)  O0 N; p' r" K4 h% b
-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)8 h' x- F/ |3 d  m
-AX = 0912h   (Get breakpoint infos)& m, H& T' K' ~) C' i
-AX = 0913h   (Set Sice breakpoints)
& C  f, S$ v- R. J# _-AX = 0914h   (Remove SIce breakoints)
( k* \9 h  k; o3 v6 F2 i2 L
0 \4 |( ]6 C5 S- F2 mEach time you'll meet this trick, you'll see:
. V6 N" X6 |( T  @6 s6 S% Q1 H-SI = 4647h+ h3 a; k7 K% O
-DI = 4A4Dh
1 o* V! K: o( D( MWhich are the 'magic values' used by SoftIce.
9 u0 ~- r6 y+ T2 I1 }0 qFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.8 x4 m$ F  q5 ?, E

; v% `; K: [& hHere is one example from the file "Haspinst.exe" which is the dongle HASP
6 Q; f7 k" Q$ o  X/ LEnvelope utility use to protect DOS applications:
1 I' j( g- Z' K+ `" ~7 Z- t6 G
3 d: \- a% A. y9 L; j, v* ]/ ^2 j( p! J1 ]* B
4C19:0095   MOV    AX,0911  ; execute command.2 Z9 y/ B* i" Q  E3 n. q% n' A
4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below)." d9 e' x/ m: X
4C19:009A   MOV    SI,4647  ; 1st magic value.
0 u, x! J. n/ _4C19:009D   MOV    DI,4A4D  ; 2nd magic value.7 `$ ?: @) D3 ~( p/ Q9 D3 v  C
4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
; C2 n" Q! i- M4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute1 X; F# m' a) |  G4 n& Y
4C19:00A4   INC    CX
8 U- p& S4 p: d4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute$ k1 Q4 R1 W% h& q, Y' n
4C19:00A8   JB     0095     ; 6 different commands.
/ q( `5 ]1 e  T* Q8 r9 ]4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
: H# t3 @9 f/ |" ]& i, q4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)9 k6 @+ K0 v5 t+ g
( X% y7 J- N6 Y4 ~! |1 O
The program will execute 6 different SIce commands located at ds:dx, which
4 V7 c  s1 C' R/ T8 _9 u2 C/ hare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
6 D, z, ?- R1 k! f7 f
& i' |- C1 s, b- x8 L8 _* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.: Z# v8 @8 L" l, w2 i  p6 K
___________________________________________________________________________1 E+ s- T, \$ l8 d1 Q! o( W# w
9 n, q" o$ A* R' F: \7 R
, ?; L% S* }" @9 P5 X2 r  r( i
Method 03( @$ M( o# @! D& s
=========
7 W9 O3 B6 D4 Q1 b
3 B- S8 {- v! N. t# A8 C  [0 ELess used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
% t( B8 i2 h2 [: e& l(API Get entry point)
: s) v) F( c; ]% o4 V' Q  }        
& D! i6 {) ^, z3 v0 a0 [$ X) z4 h. S' V; z: C8 D
    xor     di,di
- [  @9 p5 O5 v4 R    mov     es,di  t! d0 e" o' J- c
    mov     ax, 1684h       , |& ^3 V4 s- m1 O# h
    mov     bx, 0202h       ; VxD ID of winice$ n: C4 |! @9 K6 H4 f
    int     2Fh. X* @& A5 ]5 T$ M+ k# L
    mov     ax, es          ; ES:DI -&gt; VxD API entry point
3 l8 {) |7 v. _    add     ax, di
3 [" C' p$ w5 h7 }/ H$ y    test    ax,ax3 Z, k2 k$ {! N+ K3 a  B$ r
    jnz     SoftICE_Detected7 z7 \: ]2 ]9 K/ o8 y
1 U: b$ k" u% h) U0 s% W: H+ _
___________________________________________________________________________
4 l0 o1 ^. ]0 g: p7 o# t3 y4 [% k% L* X* _6 c$ ^' X% i: U
Method 04$ a. V. ~: q0 I8 T- a3 b2 l
=========
3 u1 O0 ]; _( u1 {* Y" S# @- g* z# z$ ]9 H; q- ^8 X( R
Method identical to the preceding one except that it seeks the ID of SoftICE5 a) ^" k; n7 C4 A
GFX VxD.
' r4 U$ ~; F8 ]" J7 R5 ~/ g. X' y" k! O( t
    xor     di,di) A) V3 @/ Y+ e0 @* Q5 t
    mov     es,di
+ j2 \+ w6 q9 i" c    mov     ax, 1684h       $ i, i" @0 C. {/ s" w5 T9 T/ F
    mov     bx, 7a5Fh       ; VxD ID of SIWVID) y* ?! [5 V  w& {  D2 K& l- Z
    int     2fh) C/ d) s/ [1 Q8 d" n
    mov     ax, es          ; ES:DI -&gt; VxD API entry point. w: q; T3 v" Y8 U/ @( H
    add     ax, di
% j9 L$ E, c+ O) m; i/ S) h2 X* K    test    ax,ax
5 U0 ?+ q7 H- ~3 q) e) t    jnz     SoftICE_Detected
) w' ~$ y- c% G) s" P& v- M
9 X9 @: l+ g9 K/ |__________________________________________________________________________! C$ x0 q+ T$ P% S  p# {, U
  F# X1 f8 Z: X2 n& a) g% _. C; {
, [$ s  t6 Y7 @! p: y
Method 05/ c( a* |: f1 S, y+ Z
=========% t8 Y$ ^% Y5 l; Z9 S  _

; E' |* d. h, U# i( m. AMethod seeking the 'magic number' 0F386h returned (in ax) by all system5 w# ]+ Z* G' B
debugger. It calls the int 41h, function 4Fh.
/ R9 v  Z( v( t- tThere are several alternatives.  + L# [8 H0 S, m6 |

$ h! K3 H* e" B/ k" N6 P* TThe following one is the simplest:3 A# X' C  E' s
. r6 x' K: E3 r. m
    mov     ax,4fh; U; u5 ~0 d' F: _& F+ ?
    int     41h
9 o0 q3 b. p+ k) W5 n0 ?# `    cmp     ax, 0F386
1 y6 V5 ~5 F; r8 P0 C! A    jz      SoftICE_detected  E7 F) R9 _1 @
) x! C7 K* R9 [+ V
3 l/ f# V+ k$ w) }% y
Next method as well as the following one are 2 examples from Stone's 8 q3 M1 D- L$ Z+ f
"stn-wid.zip" (www.cracking.net):
, w2 \2 x& k6 j- b7 ~' n* j% J
! n5 v5 p# t9 a& {2 {" Q: m    mov     bx, cs
4 `6 x2 s! q2 q9 E    lea     dx, int41handler2- q" T$ j! ~2 t
    xchg    dx, es:[41h*4]2 k2 w, |# b1 c6 m. a3 I; P
    xchg    bx, es:[41h*4+2]+ M  i( T6 y, X
    mov     ax,4fh) f3 l. v" h. {$ ~/ J* y
    int     41h
8 |" o3 r. V8 T/ Y6 |" c    xchg    dx, es:[41h*4]
$ \5 _& j5 B1 d    xchg    bx, es:[41h*4+2]  r; S9 b- ~+ d5 ?% v- C3 p5 W
    cmp     ax, 0f386h
, I2 i8 ?5 `( R    jz      SoftICE_detected
5 l7 C) Q  B5 K% Q% r6 i' `3 k$ [% y  J
int41handler2 PROC3 K$ B# V+ {8 }" w1 H% J
    iret0 J$ B% Y# H& U
int41handler2 ENDP
, O/ ~5 E# H4 P- g, a! G/ k1 o2 Y% W* K

5 j( M' w7 {( l( P& x& r, Q: r_________________________________________________________________________
9 Z7 {" K3 g  Z( {8 I3 V5 T. a( u: o, v6 A+ Z( z+ p3 K2 Y

" [5 }& [! r& z$ F7 Z' F% FMethod 06% p) u3 B& D6 o  {" C
=========
* I. X& j9 f. X$ y0 d7 h5 k; Q7 m) Z
* H1 F8 |6 u+ |
2nd method similar to the preceding one but more difficult to detect:
# a" i2 P' h, o4 q: C% t9 x& ?: ~1 ^# m/ v7 x  b8 C3 A2 L
" T7 r2 g8 h" C2 p
int41handler PROC
' z0 _. G* u# t6 ^9 v    mov     cl,al  E4 F9 n" E# n  S
    iret
+ X" M8 w5 R/ a$ X- xint41handler ENDP
- Z2 `( z3 m$ q2 @* }, D% }9 b& Y* I" Y8 I( I* J

, z% R! E: H" K2 Q: r! D    xor     ax,ax
' @' q/ c- Q) R9 U  R    mov     es,ax
6 [  T+ I/ b, @) [    mov     bx, cs
: H4 c2 ]0 Q( e' k3 U4 e% J    lea     dx, int41handler! U7 ~! S) A' }1 K
    xchg    dx, es:[41h*4]( \  K1 v" _6 o5 [* d. w: O0 I
    xchg    bx, es:[41h*4+2]: d( z1 ]- j- H
    in      al, 40h" k8 V' m1 w. @* b
    xor     cx,cx  D% l8 C5 }# ~3 X
    int     41h& B1 d. g2 o+ Q
    xchg    dx, es:[41h*4]+ V9 y; q1 `/ f$ T8 Q  [( d. @1 ]' v
    xchg    bx, es:[41h*4+2]
1 }# [2 w% V4 S# H9 p5 ~( a    cmp     cl,al, V& S8 g4 E! V1 R7 `
    jnz     SoftICE_detected) ~$ x' M0 I0 m0 l+ @* Y' o

4 W$ P: v' |9 r; o3 d; T+ y# s_________________________________________________________________________) b& r% Z' _7 t. ?5 b

, A- C. s2 H; q- pMethod 07
  T  e% R4 f1 G/ \2 V" X: n7 T! K* E=========
5 R3 b$ H8 `+ e! Y' I% v% V! M
7 ~% T9 s( ^+ ?5 z# l% s1 L/ x1 gMethod of detection of the WinICE handler in the int68h (V86)
; D! t5 W: ]& ?; s3 w( D+ p& F% d: Y4 j& P' Y
    mov     ah,43h4 h$ z% W9 N1 {% d  S0 b
    int     68h, j& e/ w; _* Z) d( p" P
    cmp     ax,0F386h
! F2 P) W  ^* ^/ r; S# O" [) H( p    jz      SoftICE_Detected8 P' U* A  ~  [" G
0 W! y( h2 E- ^, l1 c9 u

5 Y7 s) W  ^, W' X) ]=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit& }9 S& m6 t7 I  D* T
   app like this:
. p& R2 d' E; q/ G0 X; }0 E- O! G2 T" \
   BPX exec_int if ax==68
7 t6 L( ?; r4 T- |! u   (function called is located at byte ptr [ebp+1Dh] and client eip is
* v: c( q: C' Q4 w   located at [ebp+48h] for 32Bit apps)' {1 S0 T( L( E' M
__________________________________________________________________________. r4 \2 Z% u6 {5 h  U
% ]6 z7 ?( T" E  R0 y  m

; v7 q9 }9 B6 B& J4 {& T! aMethod 08
  j# }. q( R0 |: g=========: Q9 T! @8 y+ ?: ^! T: i0 m" W

" ?  J4 J- u! w4 a% c  W5 dIt is not a method of detection of SoftICE but a possibility to crash the, b+ O4 n. |# Z8 b  M% ]/ r" [
system by intercepting int 01h and int 03h and redirecting them to another
8 C8 K, n' P6 Y2 |! R; broutine.% T- ]# k6 B7 }0 Y, q7 n
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points9 {* h" n0 @" H4 `- ?
to the new routine to execute (hangs computer...)* |* y# H( r. B
; c* b" M0 u+ i- A5 b- M
    mov     ah, 25h; s1 x7 {5 v0 r/ ?
    mov     al, Int_Number (01h or 03h)
! }" N7 ], |2 H! ~    mov     dx, offset New_Int_Routine1 w0 A% i' r) y& S9 K
    int     21h
4 ~9 Y3 a& _8 h6 e1 f* B
0 j3 N5 h0 y* Z8 V5 {& i__________________________________________________________________________
6 i; D$ j+ E5 X8 J
! f+ _$ s; ?/ R9 G1 XMethod 09! A5 Q4 x5 V& I, H; ]& g. P
=========7 V/ \" g) q3 b9 m, P
$ q% W, v" c% ^6 w4 O: K  y
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only. I6 |6 o' [  m+ }+ U) Q
performed in ring0 (VxD or a ring3 app using the VxdCall).& i) O$ T+ C" m% }6 a. C
The Get_DDB service is used to determine whether or not a VxD is installed
2 o! o" K* r- k% E: cfor the specified device and returns a Device Description Block (in ecx) for
* c; F9 D2 E9 n; j3 b; h) Pthat device if it is installed.
! O" Z+ j& r0 r
2 m% y9 B) M" f% m8 L' G8 U7 T   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID
# H5 ]5 W# f- G6 I   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-): G1 |( g4 N8 c/ \) n1 X4 t
   VMMCall Get_DDB. S2 Y5 `5 v0 K/ X9 K( I* P
   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed. M6 u1 x, b% _* X- P
6 |6 |. [: l8 N+ K1 d6 I. K: J8 q
Note as well that you can easily detect this method with SoftICE:" t* l0 @) G' n/ x7 ~8 e. Z7 O
   bpx Get_DDB if ax==0202 || ax==7a5fh
9 Q8 F- W% j( l0 o7 X+ b
( Z5 w6 \- A3 `% [8 l* }__________________________________________________________________________& K7 K% p0 s; ]+ ^5 c+ I
0 H' ]2 q8 E3 `& h
Method 10& M( U! R+ a) U$ P& v9 @
=========+ U" z/ M/ J& E2 L- Z9 A6 s+ g6 Y! B

' \# K" @. f  Z  w- M' W8 s& ~1 o$ I=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with6 P# Q9 a% b6 N# E
  SoftICE while the option is enable!!9 s' I" Z# N  `6 P3 |8 c9 c4 w/ U
5 z) N% i, ^: J( ~; b, e5 k
This trick is very efficient:' ?$ C, k( k$ F' W# C* u
by checking the Debug Registers, you can detect if SoftICE is loaded/ A% B) I7 y6 u* z' y. I. e" W
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if9 h* y+ k' t+ e2 z% w  ]) A( L# `
there are some memory breakpoints set (dr0 to dr3) simply by reading their) V' d9 }$ B* P. [
value (in ring0 only). Values can be manipulated and or changed as well
3 n, b. I  a" |# m(clearing BPMs for instance)
9 A/ [, q- f/ r: ]4 J
/ q) _1 n) s0 z# \& Q__________________________________________________________________________3 t- p& [, S* w+ K& `" a

! Z5 N* R9 M& S: hMethod 11& R4 V6 J% I5 c1 K
=========) w! A  ]- T, o0 s: d, |

" U- Z1 U! G0 J1 EThis method is most known as 'MeltICE' because it has been freely distributed+ `" Q7 s: ^8 o5 G( ?
via www.winfiles.com. However it was first used by NuMega people to allow
6 w3 w( ]; L1 o5 OSymbol Loader to check if SoftICE was active or not (the code is located3 w8 z3 r  G8 b. r
inside nmtrans.dll)./ _4 d9 f& T. }7 P

0 \  ]! k8 N) C. iThe way it works is very simple:
5 j: X; q- T. u' FIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
4 w  G! z) Z- \* I. n# w3 hWinNT) with the CreateFileA API.
! y# H$ J6 M/ p* J7 i, W' t$ @" _. m. @( \
Here is a sample (checking for 'SICE'):
4 y' X! C6 q8 a6 |& M
  D7 e# S/ H& F- HBOOL IsSoftIce95Loaded()% p3 v) t2 U4 [% g
{
  u" c2 b4 i0 G- M* P  D9 g   HANDLE hFile;  / `( A: t% v5 z$ i* U% c, Q
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,% n/ Y" L; L5 x3 \
                      FILE_SHARE_READ | FILE_SHARE_WRITE,
4 D: ^1 H7 t2 U- F4 n: ]: d+ D' U                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);1 |- ]& x- L% x3 k: ?
   if( hFile != INVALID_HANDLE_VALUE ); w% q0 ~. T( Q  O5 I
   {
6 L3 o% l# M8 `4 m( W4 h. G* i      CloseHandle(hFile);& x' x! U; h6 d* z% i
      return TRUE;6 {" q9 ]' y  c  N
   }
8 h' N7 b! u% E2 R/ k; ?   return FALSE;
% ~$ f2 m0 x$ h}
# J. B7 ^: u" k% U
2 A- ]. r2 B* [Although this trick calls the CreateFileA function, don't even expect to be
6 q" ^6 d9 k  a& X# iable to intercept it by installing a IFS hook: it will not work, no way!
0 B$ V, u$ A/ U9 W3 z7 bIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
: [. @+ c3 O  w1 Y# ?' }- qservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)4 E3 S; j' C0 e8 u. g" w* U
and then browse the DDB list until it find the VxD and its DDB_Control_Proc! N; k4 ^' ?# a, r+ w
field.
7 R/ W1 y: _) f# p/ \! t) {: L0 b- LIn fact, its purpose is not to load/unload VxDs but only to send a
& h$ g" f; v$ g- ^W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
0 x; v* v1 G* C3 Gto the VxD Control_Dispatch proc (how the hell a shareware soft could try
4 v$ V8 F  z* M2 A+ \, Rto load/unload a non-dynamically loadable driver such as SoftICE ;-).
$ D, t0 i3 x; T" {) D; e9 uIf the VxD is loaded, it will always clear eax and the Carry flag to allow( f* N: K4 ], @! e6 v
its handle to be opened and then, will be detected./ p5 k3 R6 q) A$ t7 U0 @# f7 `: M
You can check that simply by hooking Winice.exe control proc entry point, s# w$ P* s- k1 P% s7 ?  s
while running MeltICE.
; n6 ]: ?( I; R) G! d
! s  Z1 K7 M/ n* X; c" y( u% K; F" e9 C8 H$ f
  00401067:  push      00402025    ; \\.\SICE
3 U0 L$ ^1 _7 |! l" c  r, F6 o  0040106C:  call      CreateFileA: g: e# I! n9 K, n6 p
  00401071:  cmp       eax,-001
% w2 M3 Q9 `1 ~2 Y) V0 r+ ]  00401074:  je        00401091, m. l+ A2 `2 j1 J  h: H
. W( S& O$ i/ r* ]6 h% w
4 ?' \2 e9 @5 |9 k3 y' p* n8 ~! D
There could be hundreds of BPX you could use to detect this trick.
- ~( j4 E' v! h* t' n% h-The most classical one is:& [% I* m) R& a5 a
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
/ e6 X6 d* R$ C& L    *(esp-&gt;4+4)=='NTIC'' [0 @# C- V9 @& N' e4 ~2 K
) h6 R2 d, `$ n8 z
-The most exotic ones (could be very slooooow :-(0 x% t$ L5 o' O9 N6 l) t
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  
- D' e1 h* ^5 q7 b     ;will break 3 times :-($ O9 d$ Z7 D/ M
3 ^' v4 Y7 o; J3 @  w
-or (a bit) faster: 2 t' @/ J# A& O  o6 w3 P2 `7 Q
   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')( b/ s$ m. o1 }- a( H3 l5 i
/ `# E( _" Q5 t) n/ x
   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  # _" @! a% x4 W0 F
     ;will break 3 times :-(
; w: n* J7 r0 y' }8 m0 a4 H. p2 z( ?/ o( a( e5 i
-Much faster:
0 L3 y/ i$ m  ]8 c9 f4 ^   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'
6 w- }  J4 S. k5 d/ z0 N
: A2 T5 f: F% @8 J1 D, V. y1 D' `# H: CNote also that some programs (like AZPR3.00) use de old 16-bit _lopen7 N5 x" D3 _  }8 j! ~6 _0 b  M- S2 C
function to do the same job:: T9 y. ^0 P8 M8 e
. H( e& y: ]3 {$ S2 f% D9 u
   push    00                        ; OF_READ
6 d6 Z; _7 t7 h) T3 q   mov     eax,[00656634]            ; '\\.\SICE',01 S$ t! ~6 V0 D: }, ]
   push    eax
4 e5 C- f" Y) M8 D' C   call    KERNEL32!_lopen- X& t& F, ~6 ^2 K
   inc     eax
, r( {' `( z1 z  g1 D/ v   jnz     00650589                  ; detected2 B3 t- H# A# {" y0 i
   push    00                        ; OF_READ
  B! k$ l4 Z* d, c6 ]) l) U7 n% v! T   mov     eax,[00656638]            ; '\\.\SICE'% F" Q3 i5 \/ i; `
   push    eax
) {, @# x% n! |* x- n6 n3 ]   call    KERNEL32!_lopen4 Q# P% f" q6 P7 b
   inc     eax! W0 [0 f  a( W  j. Z1 k( J
   jz      006505ae                  ; not detected
+ B% c. f5 p9 P6 ?+ o/ o( Y1 g/ q# _4 |2 U4 R  `

" J4 p! M& v6 s" t3 d; a  G__________________________________________________________________________
2 ]2 P4 v! e$ `, n6 ?9 j
2 ~# }; Q* G9 hMethod 12. h! Z& p! t3 o
=========
$ f" H4 I/ J# ^7 g# N
8 f& b- ^% Q. F: YThis trick is similar to int41h/4fh Debugger installation check (code 05! Q5 S  U1 N2 G+ a6 r
&amp; 06) but very limited because it's only available for Win95/98 (not NT)
+ u) k& E  J! r: i" v6 X/ Vas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
9 p$ S9 `8 B5 d( f" h0 C2 u
* I8 l! q" ^0 P& s# n   push  0000004fh         ; function 4fh; Q/ P# `2 \; H, z1 C5 V( M: ~
   push  002a002ah         ; high word specifies which VxD (VWIN32)# J/ h+ M  D% c: x  O4 ]& ?
                           ; low word specifies which service" ]! h" ~0 p! C( |; x; l
                             (VWIN32_Int41Dispatch)+ l/ s# p' @' V& r7 v5 }1 w9 e
   call  Kernel32!ORD_001  ; VxdCall5 V) @, l5 g1 s( D8 W
   cmp   ax, 0f386h        ; magic number returned by system debuggers/ i6 o( y% T! g, y' p' W) J5 M& r
   jz    SoftICE_detected4 f3 Q2 [% a4 J  b
2 |; d5 b, W% p6 E6 n0 b- T+ c
Here again, several ways to detect it:- b" J* Q' m4 R

( W3 O! o/ e: E( H    BPINT 41 if ax==4f/ ~; a" _7 s2 t; n
7 A) }9 x3 ?% [  K1 Z* L
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one& i6 \' R  Q! D3 ]$ j, _" N

  H# u/ ]8 O( |' F$ h4 q  D    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A5 B, A$ B* o! W( O/ g: Z
* A' T' O+ y! \6 }
    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!
% ?! k0 F8 M" C
/ P, N9 |9 A3 R__________________________________________________________________________
# }- r) A3 \1 A+ K9 w. K- K0 v. j, X% W6 p; j& Y0 Y6 P
Method 13" F+ M7 G8 W0 V! @  g( |7 x9 I
=========
3 `, \! o7 Q  |; Y% I! `) @$ y3 t+ O) q( S8 d
Not a real method of detection, but a good way to know if SoftICE is
5 a' j2 F9 Z1 a; Z- [installed on a computer and to locate its installation directory.% H' i9 ?6 _: i% m/ G9 D; e5 |
It is used by few softs which access the following registry keys (usually #2) :. |) G) N$ Y% {6 x, F+ `/ z

, S0 f" v* z- D-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
) P  G% M  l( s2 @% a# K" k: }\Uninstall\SoftICE
% Q$ ], ~. r1 Q2 {$ n  D& s-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE; r* a# ^$ S  _& \
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion1 g. d* ]" j9 y7 K4 g
\App Paths\Loader32.Exe
. X( Y% y* b& t- }" x$ x, a5 T3 ]" D5 ~# B% u
) L8 ?3 M, W  N, c( j/ y2 r
Note that some nasty apps could then erase all files from SoftICE directory9 x  B* R( K' ~, Y- N% S
(I faced that once :-(% @# C  [5 t% N2 N
* ^( |3 J+ P# V& j( g; u
Useful breakpoint to detect it:0 N& @/ y- c9 Z2 K) o+ A* Y

) T& W/ I) y7 k& u4 I8 _1 m     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'4 C! D8 N* g6 U- G! X& Y
+ X$ r: _# H( a: c  `. \; S3 v
__________________________________________________________________________
1 I1 D$ m8 s- N9 f$ g- }  ~1 D- n. w3 x6 @9 b8 D

9 r$ [5 M1 ]& Z* j$ vMethod 14
+ j5 a2 ~8 L* W5 ]. b( `! O  h& B=========
1 d% A2 k1 n& p% S5 S4 Y
7 }( K% Z# d4 y- i5 p: u. WA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose7 v! U$ d! x" n. I5 i
is to determines whether a debugger is running on your system (ring0 only).
  w' |: x" ]) @0 [( Q) b
% e8 L( U. G$ s. \; P   VMMCall Test_Debug_Installed! `2 W6 M  r, ~8 V- N' t) l
   je      not_installed8 I3 K" k4 [, R5 w0 L
7 m* r4 E' a  ^4 W! A
This service just checks a flag.
& b' m: G4 A) w$ a& A- p) n</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-8-12 01:55

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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