找回密码
 注册

QQ登录

只需一步,快速开始

About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
, {+ E# A4 s+ ~  L<TBODY>
1 l, P! P/ {4 R& H- u<TR>  Q9 R) Z; {4 F6 i
<TD><PRE>Method 01 7 G. S- W+ m9 J5 s- j) |
=========7 V/ F- D! R) F4 l3 Q
2 ^5 w; ^" E! I9 n) @
This method of detection of SoftICE (as well as the following one) is# H& u0 V& b0 \4 r' h* b( `/ S* S8 W
used by the majority of packers/encryptors found on Internet.
8 y  _! Q5 t) ~9 L: [  RIt seeks the signature of BoundsChecker in SoftICE! T# S0 l4 w# G" ~6 |6 a& I
; S! `0 V, w% L+ C3 N
    mov     ebp, 04243484Bh        ; 'BCHK'. P# u: p; n  [) q5 K6 E- ?
    mov     ax, 04h
  P+ w% R8 J! Z    int     3      
8 Y$ |+ r. L' {/ f, B    cmp     al,4
! }4 v# P1 s' f: a! B9 S0 l    jnz     SoftICE_Detected
0 A: e0 ~2 c3 R8 e/ m( ]% V  s0 T1 Z3 |, g$ x8 i5 y' ^, N- Y* L# _( t
___________________________________________________________________________$ A6 j$ a1 x4 u5 s( q' I

0 W! v* j; M$ m$ B4 [7 G2 Z/ fMethod 02. p# I9 L0 L& G: i# X
=========" v$ C; r- L" l+ S" i/ h! f1 q$ N) i& Q
1 Z% |* M# j2 F6 Z/ E' s* U& ~
Still a method very much used (perhaps the most frequent one).  It is used! j) h5 N: n$ x5 _
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
, N* k3 @: J- Xor execute SoftICE commands...( K. r, c8 c2 a; G4 S, i4 ?3 _( u
It is also used to crash SoftICE and to force it to execute any commands
* K/ N5 ]9 I" f(HBOOT...) :-((  
. [& x! t' l* r3 w. [8 ?8 j/ Y) ~8 [
# z. |9 q, R" C! CHere is a quick description:
, ]& X8 T3 X, W7 O; v  c-AX = 0910h   (Display string in SIce windows)
: z8 G/ p# I( Y) [  f/ j4 y-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)4 m' I6 K4 I. h* b5 Q5 ?! D
-AX = 0912h   (Get breakpoint infos)5 m* V8 G. z; I) G' F/ A0 C
-AX = 0913h   (Set Sice breakpoints)
: o3 N3 `7 b9 P/ `/ V. h! Q$ s-AX = 0914h   (Remove SIce breakoints)6 ?( G' N* P9 r6 k* ^
& V) [- n% [( e- \+ E7 ^. u0 E
Each time you'll meet this trick, you'll see:
9 g' o" C, C) c% M5 X-SI = 4647h
" n5 A6 B1 [( \% F-DI = 4A4Dh
6 A* m4 z( h; c: s4 t( wWhich are the 'magic values' used by SoftIce.+ i5 _" G2 M9 k! s' [" W4 |% |
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
: e! q" V8 Y; B1 I5 t. X
& X0 G* Z6 N* N0 i+ w/ THere is one example from the file "Haspinst.exe" which is the dongle HASP$ x  f) N! ~: d- o8 c$ {1 A
Envelope utility use to protect DOS applications:) g# }- X  H7 M  y4 _  [# O% B1 v
' p3 W& f, m6 P
% T7 e3 v0 b4 M6 M$ R2 X2 f
4C19:0095   MOV    AX,0911  ; execute command.
. A" x3 S  j9 K2 {4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
: k2 q2 h4 g3 X/ Z% _# _4C19:009A   MOV    SI,4647  ; 1st magic value.
# Y0 \1 W; j1 H+ L- g8 `* ~4C19:009D   MOV    DI,4A4D  ; 2nd magic value.
) V0 c4 W! B' B4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
8 O& T4 U6 d' r4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute
5 W& j& Y3 b, c# g" I# }4C19:00A4   INC    CX$ j# E$ g/ y7 o; M
4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute0 b( h1 k# ?; I  {# I0 @5 F8 a' R
4C19:00A8   JB     0095     ; 6 different commands./ Z' _. s) s/ O& V5 ?& H; y* b" i
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
8 R0 s( z2 I! q! H: @* g+ o! ]1 O4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)$ X0 D1 S9 Q3 a7 q* O& l

1 Y, }7 o" [* E- ^4 VThe program will execute 6 different SIce commands located at ds:dx, which2 R/ o& b4 n, `9 b
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
- c) {- m$ u' ]5 @
" I/ Q3 ]4 Y' d# w* j6 o4 ~. @* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.  S# p0 R# h4 J9 `" k: M0 y* g
___________________________________________________________________________
/ m8 e& D; Q8 u- w: x1 a" ]  f8 L- B

. b+ H9 r. T& C- ^3 {3 xMethod 034 A4 }* l" Y7 v1 t4 F
=========
/ H( h( w: E9 ^0 G* T4 S
1 j  g/ ~. X, QLess used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
: D3 I8 \7 p# c+ M3 U(API Get entry point)
* ~4 }/ [) t+ u+ m0 x        
8 H/ O' s" y! G, |0 k' [: \/ [8 A
5 J5 y: j, E' S) D- j    xor     di,di
- ]% }) y5 K* z! d( ~    mov     es,di! T* Z: H+ L: }
    mov     ax, 1684h       & l4 Q6 F" ~2 }
    mov     bx, 0202h       ; VxD ID of winice
( A$ D, \$ h* ^, g& L- M3 Z6 {  v    int     2Fh
" {3 K- f$ ^4 `8 A4 c8 A5 n    mov     ax, es          ; ES:DI -&gt; VxD API entry point
& z3 Z# |3 n) _+ W. X+ c    add     ax, di' B: k6 }+ H$ Z8 f! C$ }. [
    test    ax,ax/ D* s) F  ?0 l: ~1 V# l- w; T% r
    jnz     SoftICE_Detected: n9 K6 @: d) }% J

- i2 a7 t8 c; n3 M  @8 H___________________________________________________________________________* r6 m$ x, j& h
( h) v9 C( h- h4 x& n
Method 04
" _+ r8 b4 r  E+ V. Y/ t=========
$ n% N* A# E7 l" S* U: M7 f3 i
( Z8 K7 I0 g& F5 s! xMethod identical to the preceding one except that it seeks the ID of SoftICE4 `1 n3 M7 k- |1 E( o$ X% G% S
GFX VxD.  B4 l1 m) X. ^0 F! `6 u; u( q
$ q4 Z2 y: ~' Q% z& \
    xor     di,di
+ o' h) ]1 Q+ I$ r# S& F    mov     es,di
' Z1 b' N0 Q: ]2 M# Y1 v    mov     ax, 1684h       4 M3 V+ H( \- h3 C
    mov     bx, 7a5Fh       ; VxD ID of SIWVID8 t4 M# P0 Y% H1 O' ~1 K: Z
    int     2fh
3 o; n: y% U* l* z5 @$ [    mov     ax, es          ; ES:DI -&gt; VxD API entry point
( j% u( [6 W$ Y# M  Y- }    add     ax, di
! g# X& o5 ?2 c! [% u    test    ax,ax# E5 A+ a" s' h: e
    jnz     SoftICE_Detected8 h0 [" q" e" W5 Y: H1 o$ x

% U8 L  O$ H# w& `__________________________________________________________________________! R. R, Y( N% A& O
; n* }/ N" P8 B* e  m: ~! Z# m

- S0 z  N6 K- ~/ Z6 e" X) l1 zMethod 05; k- a5 b" _$ F3 L& H! @
=========
. Y: c) z2 S6 J5 ^& Q* G/ I8 Z, {! x" G. H+ s# e% ?* K
Method seeking the 'magic number' 0F386h returned (in ax) by all system7 R* z' ?8 E" y: C& E6 n9 F
debugger. It calls the int 41h, function 4Fh.
( ?( a7 a7 U' E3 xThere are several alternatives.  
. X) l& m: |: d) w# s- {
' u* u+ A. E  f9 J$ `1 @The following one is the simplest:
/ I+ Y! k+ s& I/ b
& ^, n$ E) y% c* X    mov     ax,4fh
# [! I7 K0 q9 i; q    int     41h: z8 A/ \. Y9 J% E
    cmp     ax, 0F386
; N  i* X" l+ I    jz      SoftICE_detected
8 B" J0 e' T% P* {1 p/ T
. m$ X) _: u4 l$ A; J
8 c- G5 |- R1 ]; eNext method as well as the following one are 2 examples from Stone's ; o7 t% A) h- k/ [9 O
"stn-wid.zip" (www.cracking.net):) A, N5 K5 N, y% ^7 K! E

7 T" Y1 u3 y/ m# w    mov     bx, cs
% n6 ]& ?) G# V4 B, x# l# j" t% U/ B    lea     dx, int41handler2+ d7 |3 K% r* l
    xchg    dx, es:[41h*4]. u, W! I2 X7 K: j! R& Z
    xchg    bx, es:[41h*4+2]
# A: Y8 w% p8 b    mov     ax,4fh( ]5 V" K/ t9 l' O% |" u9 O" k
    int     41h
8 f3 i: Q* c' x* j$ I    xchg    dx, es:[41h*4]
1 t9 w9 l) i3 Z- |9 Y" x    xchg    bx, es:[41h*4+2]
7 o' P( y4 W' \, f& x6 b    cmp     ax, 0f386h
: d" T: k/ V- E. v9 ]4 |9 m& D/ d+ D    jz      SoftICE_detected6 j: h9 C+ o  i" d
( I( o, {  H! \( \6 x
int41handler2 PROC- Y6 H8 H% w; f! _
    iret. V! N. v, J, h( l. O
int41handler2 ENDP2 y9 F3 U0 Z, X" W- Z- L- N
5 |* b: [  W( x1 ?* a; _9 Q
: J+ t# O: v8 G3 b, w' R
_________________________________________________________________________! e0 B5 m# b6 L
2 Y: D9 d. @/ H, l

8 a! h& @' @( f! ^$ I$ |Method 06
0 }6 a. m1 U) n0 R, {2 L=========
) I$ Y: D. p% U. C- h7 ^( j4 {. Q+ c2 F  ^
. @& c/ E* m( p/ L  p
2nd method similar to the preceding one but more difficult to detect:
  d) `- C* ?- I, ^- y+ j/ _$ G9 k' u

$ a1 p8 b1 g+ x. V2 T* y9 Jint41handler PROC
7 h! @' W  `2 A" v9 F    mov     cl,al
1 j% ?: y* |3 L, ^, w    iret
. d) x0 J" P' s" k- eint41handler ENDP% ~1 v/ N  Q2 b7 h% o# g

5 h% T+ ?' @6 u: [, G/ ]- X0 I( d# p( _
    xor     ax,ax5 K' j+ U5 X/ U2 _
    mov     es,ax' q; R1 b: t2 h7 H& s$ y
    mov     bx, cs! @- a5 i. ^, x9 G  Y
    lea     dx, int41handler) b& R4 }) [! i
    xchg    dx, es:[41h*4]3 }. G0 J8 c# b$ ~; ^
    xchg    bx, es:[41h*4+2]
4 f$ A' f* z9 i    in      al, 40h
' E2 K3 Z, B, |) b1 l    xor     cx,cx8 s7 `1 F/ R" I  i1 a
    int     41h6 P4 Z$ n# w2 K: d; T
    xchg    dx, es:[41h*4]! W4 F8 {  M+ f6 A& k% I7 y" B: o# E
    xchg    bx, es:[41h*4+2]
: n" W! w' i* o    cmp     cl,al2 J) J. O0 |- Z( f9 |% a7 Q, J
    jnz     SoftICE_detected
( t% B& Y( o) H8 n  q% T0 L( s, E7 z- X2 n& o. E
_________________________________________________________________________
( _/ K4 S- R7 ]- V3 i# t8 e6 A% d+ i8 P
7 L! Q% H- {, \1 \& OMethod 07
7 i( G* U! {# o=========
7 W" g$ d6 B- J. a) ^# R3 ^, ~9 Q3 p! _/ A2 X
Method of detection of the WinICE handler in the int68h (V86)
1 V3 w( Q! A! `8 F+ M) ^! _2 W. l" L8 ^# t2 I' @  t, p6 V+ i
    mov     ah,43h
. ~, I" }7 \5 ?8 W7 z5 u/ U3 ~    int     68h6 n# \  Q2 n2 c8 J0 F' b( x# v
    cmp     ax,0F386h! l) M; x* Z9 {* }/ z
    jz      SoftICE_Detected
3 B! _3 o9 B" Q8 k$ r5 h" y  o+ k- U% C. s, p+ D. L
# A. k. n% n5 _
=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
1 R6 X; U2 z1 a   app like this:
# Q3 e& u7 X  R7 G0 J* m/ g# N: n  t* ~5 w8 o$ ^, Q
   BPX exec_int if ax==68
2 k  Q3 a7 `: B* c   (function called is located at byte ptr [ebp+1Dh] and client eip is
: @9 J$ \  K2 M) X1 K( E   located at [ebp+48h] for 32Bit apps)) w6 b; g- ^0 H  H8 e* I! w
__________________________________________________________________________
3 D( U* X" [4 b3 u: Q6 z& W, r  I' z/ x- Q

/ R  _  g: E8 D5 W8 T- PMethod 08
8 C) d+ C0 X! W5 h* T5 f=========) Q+ {7 D9 u- n9 `+ Y/ r0 X
8 {+ F; M  }, V9 i- X7 C4 s' p
It is not a method of detection of SoftICE but a possibility to crash the: _2 Z/ V4 C; A1 H5 m
system by intercepting int 01h and int 03h and redirecting them to another
* R% @; E" S4 L( I5 Z$ nroutine.
0 H5 V4 c) Y% M$ M& gIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
& o: T  }7 L8 _/ y6 V5 r0 B, g5 y4 vto the new routine to execute (hangs computer...)& {. ^$ w  m2 R  a
0 ~# `8 _4 n4 [& x
    mov     ah, 25h
6 I( }( D2 C2 D0 }, t    mov     al, Int_Number (01h or 03h)0 X* h( r) @$ _
    mov     dx, offset New_Int_Routine
+ m' G" F% o+ v" T6 u4 y    int     21h6 p8 U/ i9 e, h; p2 u5 n- Q

9 {; p" \1 W: j1 J7 ]. l* U__________________________________________________________________________( E- d" D; d7 v+ }4 W; Y+ i# w
  r4 v8 u! ?2 \& U: q
Method 096 w5 `* Q8 _4 q" x+ s
=========
% V- [- C7 \9 W& j
1 G- K2 L: |6 M0 M( K: E, FThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
; d4 J2 u+ T- O7 T! K4 O9 b& Xperformed in ring0 (VxD or a ring3 app using the VxdCall).
, i& b& A/ w6 j8 fThe Get_DDB service is used to determine whether or not a VxD is installed; C7 {1 Y, e& B- Z9 i9 h
for the specified device and returns a Device Description Block (in ecx) for3 I  N2 ?$ t1 d9 j
that device if it is installed." }! ?0 i3 e5 B0 `  P/ W

& ]* Z8 G% {' _   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID/ F  k7 y5 l1 F
   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
, k6 b1 P! i# H# V) u   VMMCall Get_DDB
: w) G/ g9 h3 {; [1 p   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed* o# Y; ^: G+ Q# t! n
6 _6 n/ l% d; M) {; l$ x9 k, x
Note as well that you can easily detect this method with SoftICE:( y) K, u7 ?$ |* D
   bpx Get_DDB if ax==0202 || ax==7a5fh
& h: B  G. Q7 q
) m+ v: n3 }6 G. }$ q  P__________________________________________________________________________3 l$ _+ N( w7 E, W3 _
8 ^4 @+ l6 g+ w' v- k; S6 k
Method 10
6 w0 k8 S' p- K% r6 k* B=========
# F' p' O6 v5 B" @) y
6 {5 ^* Z& d9 F=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with
; Z. x8 r2 i5 h0 }$ f) A. E6 Z  SoftICE while the option is enable!!
: W2 _$ z# s+ F- ?0 I+ H
; `# R. y8 G4 t$ Y# A8 [% UThis trick is very efficient:
: `+ B8 R* v+ E3 Lby checking the Debug Registers, you can detect if SoftICE is loaded
6 @# g- o/ ~- g0 }8 [( C; R( A(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if; ]" T6 O7 E. ~
there are some memory breakpoints set (dr0 to dr3) simply by reading their$ Z# B# W5 x( P
value (in ring0 only). Values can be manipulated and or changed as well2 Q! R: o$ U) }% I6 b3 p2 |: ~& `
(clearing BPMs for instance)
" s( X4 [- [1 K4 N' u0 @8 ~( h0 V: Z4 c7 p; e  _* b- |% l
__________________________________________________________________________
+ z8 }7 [2 F. ]6 q7 X% B# D# v6 M3 ~6 w, L7 B+ r
Method 11
' G9 U' |; ]1 G8 R& j" Y% p=========
0 l: R& Y; d+ N8 r+ h3 ~5 c. A# q$ T; X8 J
This method is most known as 'MeltICE' because it has been freely distributed" y3 e$ c% u% m. x+ M+ y
via www.winfiles.com. However it was first used by NuMega people to allow7 L! C( B9 _9 b! w3 }$ F. b& X
Symbol Loader to check if SoftICE was active or not (the code is located
/ C) u! B( @0 _- ^0 Minside nmtrans.dll).
3 w4 h7 X% O8 Z( t( ?! K: f/ u- A' \/ G+ A% _
The way it works is very simple:
+ o  Y. G! S( T2 t1 q% x  HIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for* x5 a6 L; p  Z4 ]
WinNT) with the CreateFileA API.$ k& s; z4 Q6 U1 Z3 U
4 e4 q* n. P6 w5 _
Here is a sample (checking for 'SICE'):' E. B% T, z+ P: Z/ `5 P3 m

( i" J9 C6 a1 J0 hBOOL IsSoftIce95Loaded()/ v) H: S" j* g& E% y% b
{) y$ |( X3 [; u2 r
   HANDLE hFile;  
# q/ `! j3 f% c   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,) [0 Y+ T9 Y1 E, L
                      FILE_SHARE_READ | FILE_SHARE_WRITE,
( m/ p5 v) C& ^! a2 }: Z0 H                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);, \" O3 b5 Q2 C2 g' Y# K9 I6 F9 P
   if( hFile != INVALID_HANDLE_VALUE )
( F; y6 _, K8 x) S( U- G/ k2 d) u   {
4 [* F& m7 H$ B+ M' y2 S* u      CloseHandle(hFile);* q! Q& H/ u; s; ~2 u. e
      return TRUE;* i0 e. ?. A, n5 @" G) U# [
   }
0 V+ \3 s$ N2 z   return FALSE;
* X* B1 |3 y7 ~' F}
2 _# D2 E. ~; R0 o# s" h" f. x. G( a1 v0 g% B  j2 o
Although this trick calls the CreateFileA function, don't even expect to be
$ m4 w! |7 y  E  S) sable to intercept it by installing a IFS hook: it will not work, no way!
* g1 W# `- o. q+ ]& g7 F( E( yIn fact, after the call to CreateFileA it will get through VWIN32 0x001F* K0 v9 w8 Q+ t
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
0 c1 Q4 `5 [: u9 G- Mand then browse the DDB list until it find the VxD and its DDB_Control_Proc! a$ ]" K# Z0 W# n6 ?1 ]4 \
field.
- {1 A2 a; q  j2 l, b5 j7 @8 `In fact, its purpose is not to load/unload VxDs but only to send a
/ J0 D) {/ G$ D6 }W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
% V0 N6 Q+ I3 s2 X/ cto the VxD Control_Dispatch proc (how the hell a shareware soft could try
1 \* h/ m. [( R0 Ato load/unload a non-dynamically loadable driver such as SoftICE ;-).  Q, }! B5 _$ _8 s5 B" v4 `
If the VxD is loaded, it will always clear eax and the Carry flag to allow
' w: U/ c, W8 e! o5 U' t* ~its handle to be opened and then, will be detected.. z6 L5 u) W# C
You can check that simply by hooking Winice.exe control proc entry point1 b( C2 K/ f6 U1 A* M% C
while running MeltICE.
2 y% s+ ]! P; r9 c" Z
  D+ @8 Q/ `1 u; \
% D7 o( ]0 B3 x# E  00401067:  push      00402025    ; \\.\SICE
& t2 c+ G" K  H  0040106C:  call      CreateFileA. W1 z5 m& c7 m3 U1 V1 s: M
  00401071:  cmp       eax,-001
4 n8 V3 [- ]+ z( f  00401074:  je        00401091
4 W& m1 E( [& v. c
7 n4 h$ D$ y" P) K8 W# Z1 o3 W9 C) S% \
There could be hundreds of BPX you could use to detect this trick.
/ F, [' O1 W* M-The most classical one is:
9 U6 P( q0 @# Q2 v  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||6 Z) N0 E1 _6 u- P1 _* @
    *(esp-&gt;4+4)=='NTIC', O6 C9 Y% D2 }- p' s& j
* w: k' n, |. R6 `' @" u$ u5 Q
-The most exotic ones (could be very slooooow :-(% ]. _% }2 _0 L- F1 u
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  
2 E! F5 b" u/ K  k% |     ;will break 3 times :-(
' s' `% L7 ]  {& q. r1 G4 L3 Q2 W# m2 ~+ G4 b
-or (a bit) faster:
4 l- [$ @2 z2 i* \8 P8 @   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
' a0 o) f9 }7 T+ z/ u8 Q4 w6 K9 q0 j9 F9 s$ I9 S8 _0 H
   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  
" ~& X# W, H2 `     ;will break 3 times :-(
5 w0 U. }7 J+ R2 ]. X4 n! {7 H7 k. I; y2 g. R: ]
-Much faster:1 X& M) j8 k' z' p1 p" i2 F# `$ |) \8 C
   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'
3 l1 i- s- e/ l+ ~: Z0 r7 V: Q3 P
% |7 M; {0 R6 l8 XNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
1 J, U+ n: i0 M" Jfunction to do the same job:& [. B: B9 ^6 K, h* @1 ~  M0 L. s5 y  A

- N: u  q+ T3 D* K0 r+ N( o4 q   push    00                        ; OF_READ" K, B$ e+ L, H4 T% c5 U' U
   mov     eax,[00656634]            ; '\\.\SICE',0$ b5 h; S7 _8 L4 I
   push    eax
( ~9 T0 f6 q6 g# c3 O   call    KERNEL32!_lopen0 ?2 r$ E, i3 A9 U+ j5 x! G
   inc     eax
0 {. q) }5 |: V6 a9 _% E6 W   jnz     00650589                  ; detected3 {- W- Z- u6 ~. b) [
   push    00                        ; OF_READ, ?& V$ \; S- j/ M/ f( a
   mov     eax,[00656638]            ; '\\.\SICE'
) B1 c3 o9 h5 u/ U   push    eax
) W1 j8 }( _( F0 ]$ H6 f   call    KERNEL32!_lopen1 {! v- n2 J. y) C2 K; `
   inc     eax0 g  |/ O- H1 j# M' d
   jz      006505ae                  ; not detected9 p6 E$ x/ K# q$ I6 m2 C) J

6 q7 R8 O0 L0 M. @0 F" M
5 \9 z' V* M  ^1 c  ?3 D$ O: |* n__________________________________________________________________________
. h% w& j) \$ L5 Q8 f6 I1 o: |. ^0 z* N- q
Method 12
( t  I+ ]5 {3 k4 K3 l0 o* h=========3 |" |4 L$ z9 I/ a' P0 m
7 a) G& P  _0 u2 X3 n' T
This trick is similar to int41h/4fh Debugger installation check (code 05. y5 D2 j. r7 y  f. ]' U7 R
&amp; 06) but very limited because it's only available for Win95/98 (not NT)  O5 J2 R) s2 u1 E6 G, q- E
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.# N) {& v# j4 T. [* S

8 x; `8 H% @- |& v   push  0000004fh         ; function 4fh
1 {' N; N, g: b- k! Q   push  002a002ah         ; high word specifies which VxD (VWIN32)
1 y, g: }) I, k+ N                           ; low word specifies which service+ P. r) _$ T$ q* U/ ~) H( J
                             (VWIN32_Int41Dispatch)
7 t* Z# p4 x. |" a2 b4 x+ _   call  Kernel32!ORD_001  ; VxdCall
* K3 Y: ~* |; }* p/ q9 \   cmp   ax, 0f386h        ; magic number returned by system debuggers, }" B0 a$ y) _7 Q
   jz    SoftICE_detected
$ @: V" S- S# z- x) u2 d
5 [; m, x8 B6 g" r2 ~Here again, several ways to detect it:3 l9 _) h, X3 V6 w5 G% `

" [9 _9 }2 J: s, R    BPINT 41 if ax==4f3 ^) T7 a  p) `

& k* s& X$ r2 q9 |    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one
0 M6 }2 p* M6 D$ h; o, V9 @* P/ w1 J$ z8 U3 w! E
    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
$ s- C. M2 W) K' v0 w! b9 S! ]
    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!2 L! W" \# C' J2 Q

8 o% M) Q) G" n7 c/ q# _7 [$ L__________________________________________________________________________
+ U2 s$ G# y7 `8 G& s3 K; T2 C+ l
7 {3 W/ f* |4 L! ?Method 13
! L( F# V4 L$ v=========
) A' l& {! |% B1 a# U
4 |4 I  S; @2 J: Z. y8 LNot a real method of detection, but a good way to know if SoftICE is
7 Q, B, k; W- e: v, c, Q7 ~! Qinstalled on a computer and to locate its installation directory.
& ?+ e( x6 L5 C" |3 C, p! r9 p7 Q# \It is used by few softs which access the following registry keys (usually #2) :
/ Y5 N8 A# L* j& s  K3 C. P& ~
" E/ I0 Q' S6 C3 T3 A-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion3 z  C; h) c' {  F% M
\Uninstall\SoftICE
& q1 O) A- H  s, ~* {) A! x1 R-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
3 r7 D8 H, [) W6 v-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion' I! o/ W3 g" P3 O9 G
\App Paths\Loader32.Exe
* C2 X& v* Z4 Q  \/ r+ A, ?4 ]( \
' [# p7 J9 l. g6 p* j5 ?5 ~/ r% B  F; _8 t1 L
Note that some nasty apps could then erase all files from SoftICE directory# w1 Q! e7 D# H) n! }
(I faced that once :-(
% u* u6 j9 b0 {3 e! a
" M( ?& T& r$ i, z$ t5 @Useful breakpoint to detect it:6 K! _5 k* H$ A* C. E& C! S
5 x5 t0 z/ T# @9 }
     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
9 }3 f: C( R9 N6 y- A7 q- P" }' C" E2 f- P
__________________________________________________________________________
, O; T2 i/ {4 L! |# B( s9 R9 w$ z6 r( S' j% K

* k1 L) O: f- D4 b: p) |% vMethod 14
6 N* t  D+ L8 c8 R  ~3 h7 A=========
. I+ |* m/ C- Q+ I
# a, w7 J- ~& W, f5 b0 c: oA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose0 S& |  |9 ?/ b4 g) k
is to determines whether a debugger is running on your system (ring0 only)." ~/ u4 H! ?- t3 z  r* @
4 m6 {2 R8 v4 k) I9 L8 ?: }
   VMMCall Test_Debug_Installed
) l: _  m$ d7 ~% w, y   je      not_installed
1 a+ B! e) _2 r
! l) l- p4 f& hThis service just checks a flag.
9 n) K2 [* V1 E# s& m& ^: z2 ?8 W</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-8-1 16:18

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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