找回密码
 注册

QQ登录

只需一步,快速开始

About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>3 S6 u1 Y0 R" s% `+ d3 @
<TBODY>
' N5 m5 y5 B: c  Q& }& B<TR>1 ?: R* v" e: c9 A. _# y
<TD><PRE>Method 01 + C; H2 E5 {& s8 d; v
=========* T6 b' e9 @( c6 I# H0 f8 f, Y7 ^+ R

. D" A! W& w% wThis method of detection of SoftICE (as well as the following one) is: U/ A, p# N  }9 K" v6 m3 _* _
used by the majority of packers/encryptors found on Internet.: d$ v( L7 N1 Z# g5 [: d: e& p
It seeks the signature of BoundsChecker in SoftICE
' O$ s4 }- [# B1 E( G' Z2 b: a
* [$ B) Z5 r, [4 |0 Z    mov     ebp, 04243484Bh        ; 'BCHK'5 d1 w5 C9 B) g- Q. s) V
    mov     ax, 04h
7 s- w9 e' H( v    int     3       0 b) }2 b6 K# Q5 b9 H, P( w
    cmp     al,4
! v- F4 y5 u; g( @    jnz     SoftICE_Detected
& s3 p; p; H. @+ ~! J( V$ y2 i8 F. X; n# S* j/ U; t
___________________________________________________________________________
6 e" u, n# D% K# c) _% F: w4 O. J- n- K/ ?8 g" N9 T1 Q
Method 02
- _7 [/ _- P0 n) V  F=========7 g  D% |% P9 r5 |9 q: g6 R( d

3 F) W  h+ x$ JStill a method very much used (perhaps the most frequent one).  It is used" n+ X6 r( x* _' j
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,- _- X$ L7 t- a$ e* r8 B
or execute SoftICE commands.../ i) q: U; A7 ]. e
It is also used to crash SoftICE and to force it to execute any commands, l) S' O1 k# y; n
(HBOOT...) :-((  6 r: Q) }0 Q+ c& M# u: [
" f/ q3 P4 T- _- u: c( q) z0 A
Here is a quick description:2 j6 _8 {0 u$ s9 I
-AX = 0910h   (Display string in SIce windows)+ F; p6 }8 t- q, E- A
-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)
3 N% i* i  G( M; ]0 P3 L9 z-AX = 0912h   (Get breakpoint infos)& Y) @5 G0 B- f- k5 {( e$ j
-AX = 0913h   (Set Sice breakpoints)) U0 S9 Q/ i, F  x, d
-AX = 0914h   (Remove SIce breakoints)$ u% U  W; D  R2 e
' j) O* d% ^/ D3 H
Each time you'll meet this trick, you'll see:
( [# Q( h  t9 C* V" h% U: ?$ E-SI = 4647h
8 z" q% I! L  u* ^0 \, S7 F) h-DI = 4A4Dh2 |- H0 _4 w6 T! G2 a1 n/ g
Which are the 'magic values' used by SoftIce.! J5 k% o$ \  i7 F( @- v9 h
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
, Q; G9 M2 K$ p: V+ b
5 m( a4 _! b1 N, e, H& D) R/ uHere is one example from the file "Haspinst.exe" which is the dongle HASP# Q! S: n7 m5 a$ e' j* F9 J
Envelope utility use to protect DOS applications:
# F; {  e/ W% `  Z- L
9 @& ~0 g6 T. a
. i9 L2 \' A' B9 R" R* ^5 t4C19:0095   MOV    AX,0911  ; execute command.2 ~& y3 L# M/ m& b
4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).5 `' h$ t  d1 J: @9 Q! l0 t
4C19:009A   MOV    SI,4647  ; 1st magic value." @8 f6 v0 B$ |
4C19:009D   MOV    DI,4A4D  ; 2nd magic value.: L  @. V% |3 Q: Y- Y" [
4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*); }, i9 n" j, C/ O# i% r0 u
4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute) G* A/ B( N8 g/ B# i. T" K
4C19:00A4   INC    CX  {" G" s$ V7 k1 z
4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute
8 Q2 q' ]$ D+ l0 q4C19:00A8   JB     0095     ; 6 different commands.
& g% U$ S# A6 Z0 f! [4C19:00AA   JMP    0002     ; Bad_Guy jmp back.# K# Y: Z5 y" J+ ]5 `
4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)
5 U2 d/ P2 X! q  C  e& Z
0 p  ?2 y  }6 y7 GThe program will execute 6 different SIce commands located at ds:dx, which
0 U5 k4 ]& v* i2 Kare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
1 J! P4 u# o7 r, V# z' f. p' ]3 }# u0 ~& j# w9 H( }
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
9 \: I' S* _3 L9 S. O___________________________________________________________________________% h" A+ w; m( i
: Q5 V7 i6 n2 _: F) u7 j
( E3 q* t! S# q5 G; B
Method 03* Q+ W: F; s& k* N
=========, s3 m; k  @6 |' l$ {

' o) P9 M( R9 S6 q6 R# y2 \5 ~Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
1 Y* {: n6 |* X3 J9 H: V8 v! s/ s(API Get entry point)3 H: {4 F+ p4 k7 c- h8 r/ C
        
' V0 c7 G& O1 f! Z- G7 w% P4 \% A$ A! y1 u
    xor     di,di5 t0 \$ \- r( f& l2 P
    mov     es,di( k  x# y7 x3 O3 z: `6 k. J7 W
    mov     ax, 1684h      
" R8 I( ^: @5 s* s$ [8 Q    mov     bx, 0202h       ; VxD ID of winice+ A! H2 }$ {6 h* ]0 @; T
    int     2Fh
* G9 D1 `8 S: W( s" |2 d$ s4 j  H' ?    mov     ax, es          ; ES:DI -&gt; VxD API entry point9 Z- A7 g9 I2 q2 ]5 h; P" `
    add     ax, di
* R' t& U' l/ z5 P. D% o    test    ax,ax
, J$ t3 ~- [1 R0 B    jnz     SoftICE_Detected. o6 a7 V  f- D, I/ ?9 V  P* F

+ k# a- d2 n1 a0 Q___________________________________________________________________________/ \  `( L7 b  b9 S" u7 w, `- d

4 Y; O- W6 E# sMethod 04) ^) K3 G( [4 x) r
=========
8 W# |: f5 n4 e0 X
/ q5 R6 D7 h: `. a; i1 [3 `Method identical to the preceding one except that it seeks the ID of SoftICE
+ k# R1 i9 ^' `( J% NGFX VxD.
/ ^; {  {0 b) @. y
9 x! G, }0 h$ f$ d% Z& `    xor     di,di7 o$ n8 D: u( T0 M- V& w
    mov     es,di
( S( ?: b* D2 T    mov     ax, 1684h      
$ j* b8 f) |, C    mov     bx, 7a5Fh       ; VxD ID of SIWVID
- q+ o* a6 e8 l, F    int     2fh7 D8 a4 H+ m3 z# M$ C
    mov     ax, es          ; ES:DI -&gt; VxD API entry point$ v& n8 }2 r/ N8 X+ T/ \% k
    add     ax, di
% U. s- A* {9 p( x" A2 U4 c( M    test    ax,ax+ D5 }: T9 j, r  _6 N2 M6 V0 i
    jnz     SoftICE_Detected7 s6 j1 U: B# c8 K  ~2 j

8 G/ G) r5 r( n2 y! q5 }__________________________________________________________________________
- |  `5 B' M2 [: E9 f/ c  R
, W1 c. @5 X1 U$ h% P) `9 G, T* p" {# N3 n  b. T4 d
Method 05
. ~" H" N* e7 I1 Q: p/ s. h& Y=========
2 X' ?& w( B3 u: x8 A7 b) g0 \' e; N" q2 e
Method seeking the 'magic number' 0F386h returned (in ax) by all system
+ d. `; h1 R0 K8 Zdebugger. It calls the int 41h, function 4Fh.' U. C, O- [4 h" A; `! g
There are several alternatives.  - m  K7 [* V( k! E
+ K% O5 M2 W7 N4 k- |: Q5 q
The following one is the simplest:: Y) w3 z3 @- Z$ p) T1 t
3 ?* r0 w/ T4 R/ c
    mov     ax,4fh( x! g+ B% F8 H; ~, H' c9 A
    int     41h5 e: E% d) }$ r  \
    cmp     ax, 0F386
- Q6 S- d' x8 D    jz      SoftICE_detected4 e9 M, ]1 s# K; H

0 s; D: v% u7 X/ P$ j1 i# r; j  C
7 y) k1 s4 Y; _) hNext method as well as the following one are 2 examples from Stone's
" b3 n: p  y8 r3 c: N$ @. H/ H' S3 `"stn-wid.zip" (www.cracking.net):
1 n8 Z  o( |! @: i5 t9 s0 I$ A5 \- R! d' D8 Q9 K
    mov     bx, cs
1 v" {$ t( I9 \    lea     dx, int41handler2/ p1 Z" `/ C* I: g8 E/ ?
    xchg    dx, es:[41h*4]! o( S( N/ }  Y) b2 c# d+ Q; ^: u
    xchg    bx, es:[41h*4+2]. e. ?' D1 s* c/ c; c! f
    mov     ax,4fh
2 v" I( J) l8 G- u    int     41h% `  q7 _4 o) ^- i# _* D* A
    xchg    dx, es:[41h*4]2 z! v: D1 R$ B
    xchg    bx, es:[41h*4+2]
+ U* B" N* z0 S  C/ a    cmp     ax, 0f386h: B" V0 Z) u: U1 C
    jz      SoftICE_detected
4 B, X9 q8 c8 ?2 H! C& k, a: K# s, L" U4 \
int41handler2 PROC
4 |: {5 P: ~9 [" T1 k) `    iret
& J" v2 b0 n) Qint41handler2 ENDP) O# q5 S/ W5 e! z) E, x" Z$ W2 h
1 T5 v; A, {7 r4 `1 m
, N, w5 g. k( y6 {
_________________________________________________________________________/ W( A; j4 Z: A4 [  r
+ N$ {# ]$ B5 y, D, J5 p
( K# s; G; Q, e& ^# d
Method 064 z; Y! v7 Y; {$ G* S* h
=========8 o: S) K+ k6 n  u' L4 f$ k- Y% ^

% x: ]" _  e# k& R  Z' W7 M1 A; H  S. {/ B; ~9 |
2nd method similar to the preceding one but more difficult to detect:6 W% D: }+ @- M  ^3 E& @" y) ]+ m4 ]

8 _$ T  Y$ G* m, J) }2 P
" l6 k* t8 k3 i+ q, s2 s" T# lint41handler PROC
3 M9 U7 d8 r) m( h) R! @    mov     cl,al- p. L  b- @. o8 x$ ~
    iret
6 I7 Q: m$ Z& n# [0 W, s  i9 S4 qint41handler ENDP
1 g, e+ y! K7 u2 j0 ~7 Q
! l4 }1 k  u5 p1 V0 @$ v1 f8 [# x; |! m( M
    xor     ax,ax8 W5 Q5 J1 U1 E
    mov     es,ax0 @) r* R" U1 ]
    mov     bx, cs! R2 H( K2 }! K$ d( I+ O
    lea     dx, int41handler
+ z# Z' V: E! V9 u/ M. Q    xchg    dx, es:[41h*4]8 J$ \% Y6 u0 \
    xchg    bx, es:[41h*4+2]3 z  T! g4 k4 W' n# ~9 K3 c
    in      al, 40h6 [+ H" [+ o6 ?6 Z5 F4 f
    xor     cx,cx- |/ C/ a8 ^! f3 O/ T( L
    int     41h/ h, d' I; e2 x' G" H
    xchg    dx, es:[41h*4]( P# h7 Q  O7 s0 |: w2 K
    xchg    bx, es:[41h*4+2]
  F' H2 ~6 `, P! D    cmp     cl,al6 P( _; R! w- E7 F# L4 I, G' u
    jnz     SoftICE_detected
0 r( A, b0 N8 E7 n& F8 y4 s* m' }* G# K1 [" j. c
_________________________________________________________________________2 E3 S8 c) Z+ f# B) \) d

) E4 {" y& `  a* l9 Y& s. RMethod 07
- k5 B9 c( K4 ^=========
- C; p+ C) z# x3 k
3 s# P7 K9 ^; B# @- zMethod of detection of the WinICE handler in the int68h (V86)
( J' |. ]( }( N9 ~: E5 E8 W- R6 b
/ k" {  u- Z. W  X    mov     ah,43h/ w5 {( |/ _6 x% A
    int     68h: E! Y+ s# A9 v% w; m% V+ s- S
    cmp     ax,0F386h
, c1 T2 K% T# L: o5 q7 y4 e    jz      SoftICE_Detected3 i) g; R( I% d4 D$ @4 `
5 l6 }' R+ }- T

+ l) L; M* q$ S! j=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit& ^+ z! y$ P  W
   app like this:8 t; ^- ^. S! T/ t" E
( X+ P/ o- r5 u
   BPX exec_int if ax==683 a8 G& e; r  M, E1 V
   (function called is located at byte ptr [ebp+1Dh] and client eip is
0 Q/ |3 l2 }! h8 h   located at [ebp+48h] for 32Bit apps)% |) A. k! x/ K, ~4 Z4 F" ]( t& T
__________________________________________________________________________
$ x2 E/ o5 F' N  A: u" d* O5 W$ B: X* |
: j- b: D' }, @5 E. ^, S: H  \) X
Method 08! G( N5 k" s5 V' q  g3 ^- G: L3 y
=========
# Q+ J" b0 j; j! q3 M9 {. Z8 r( ?. U+ C
It is not a method of detection of SoftICE but a possibility to crash the# `% W; x1 i) V  |2 R# Y
system by intercepting int 01h and int 03h and redirecting them to another  ]" `7 ~) R4 u) t/ h* X) D; I
routine.
6 U# K- x( G; jIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points9 m4 r. T5 M1 D. j1 k
to the new routine to execute (hangs computer...)' T9 [' i" S$ G# S: k  @- z
2 w' v6 N+ f" w( Q: i1 ~) Z2 c) A
    mov     ah, 25h
( y# n* Q4 ^5 E    mov     al, Int_Number (01h or 03h)
' \2 D: h. V% ~4 k    mov     dx, offset New_Int_Routine3 L( M  k2 F3 t, `5 d
    int     21h2 M7 H9 |1 M+ s" ^; h0 o* X

0 A: }- Q) X7 F0 d__________________________________________________________________________6 \* R' u0 c# d1 ^8 Q; {3 \

- {- L, y' k) w2 {4 W" UMethod 09
: S# C) t4 B1 I( b=========
! F; I5 Q$ N$ d
& N: L; {6 m% Y$ S% xThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only7 M  r# k! K5 k- Z  e% H
performed in ring0 (VxD or a ring3 app using the VxdCall).
$ o0 N+ X: w3 ?1 _( k5 b0 [The Get_DDB service is used to determine whether or not a VxD is installed
1 h- p, S5 @4 H8 f0 ]+ b8 I5 {for the specified device and returns a Device Description Block (in ecx) for
+ ?( |+ }5 z2 D: y3 ^that device if it is installed.3 U: c9 e' m# r8 j1 a5 ~+ E: ~( r; P
% C* Z! }( t; e
   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID/ }* @! M; v9 s7 Z9 u
   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)' v% p5 j, {4 o2 Q; Q
   VMMCall Get_DDB9 ^1 d) k4 @' W# D% q+ a  q' ^& H
   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed" {4 S/ A$ q5 z# ^; l; o

: ?) k- B9 }1 lNote as well that you can easily detect this method with SoftICE:
: b0 u. y, s) E, A   bpx Get_DDB if ax==0202 || ax==7a5fh
$ w0 S) ]$ Q1 u4 d& ?2 q. u* N  \5 f! K2 e, _7 ^% O
__________________________________________________________________________# `9 Q3 z- B* [9 ~
; j" B- N; O5 s. M
Method 10
! d) }  }# d8 }. Y$ @; X; A=========
9 x. s: b4 f4 F) R# P+ w$ R+ z/ M) O
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with
& W: G% |9 @5 h  SoftICE while the option is enable!!/ q7 j$ ]5 j1 @2 N5 \. V( m4 U

5 {: R: s) C( H8 lThis trick is very efficient:! z. C6 P( b! g3 J- L- t: Y
by checking the Debug Registers, you can detect if SoftICE is loaded
- f5 L$ p# v2 K1 u(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if. p4 A1 n) D9 H# w6 E: ^
there are some memory breakpoints set (dr0 to dr3) simply by reading their
- y* {  D) c/ c; b( Ivalue (in ring0 only). Values can be manipulated and or changed as well
; j; c1 V8 V' `* E2 n/ j8 q; [(clearing BPMs for instance)% E1 {9 w$ Y) [8 h

8 s2 r6 l! N. ]+ x, y2 S4 M; V__________________________________________________________________________. y$ P. a1 a8 J- V+ ^. g
6 W) K' z. }0 b2 F" K" X2 _
Method 11
" W0 j# ^" T) J# {. H2 y6 P=========- P& ^0 r& e4 G' q6 U2 |$ v! I

& @$ [( @( e7 QThis method is most known as 'MeltICE' because it has been freely distributed
4 k" [* U% g2 e0 Z. evia www.winfiles.com. However it was first used by NuMega people to allow$ x! H  |9 i) O  }) e" W1 t
Symbol Loader to check if SoftICE was active or not (the code is located
8 K1 L' i9 c, w/ u% O' Y$ C0 Cinside nmtrans.dll).; E! o! {9 V* C) y1 p/ `
7 Y6 ?8 r; C) w1 a. w" U
The way it works is very simple:
! I: X; y4 P' M) jIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for, C* I; [: m, F
WinNT) with the CreateFileA API.# K/ M4 y2 ~! p" k

- U, i# b, i% l* |. N+ {Here is a sample (checking for 'SICE'):
: y) r! c/ E) r) ]5 U' [
" ~/ Z+ y  g, M% q! dBOOL IsSoftIce95Loaded()8 g0 r3 T$ E; q5 B6 U6 j% ^( g5 L
{  S9 t! |, ~2 O4 g
   HANDLE hFile;  
7 @0 m4 p) G4 R6 w* M. o   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
! p" x: b* ?, B6 Y' T% k                      FILE_SHARE_READ | FILE_SHARE_WRITE,
( u3 X. M; Q1 ?) G9 |& I4 f                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);3 b8 N# a8 |1 H
   if( hFile != INVALID_HANDLE_VALUE )
" n# o( y1 m( s1 C3 W   {
5 F8 E; p: w5 A0 g      CloseHandle(hFile);
" y8 ^/ c- }/ a; B9 k! O      return TRUE;
6 w# X9 Y; r$ E   }
* F, j1 P; a( C% k3 n; l   return FALSE;* f, m4 O( j2 C' a0 K  t5 W' ^
}
$ e) F$ B2 }8 ^7 [1 T. O& s) Z+ A& _, @" s4 _0 X6 D: K( c, v
Although this trick calls the CreateFileA function, don't even expect to be3 R6 H- z3 z# L' I0 ~
able to intercept it by installing a IFS hook: it will not work, no way!6 X- h/ h2 A" M: x
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
9 x4 [& i4 s- A  W9 n5 U/ }3 Zservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
7 t' y  n! f4 L- b( c4 Land then browse the DDB list until it find the VxD and its DDB_Control_Proc1 q% `+ Y* R) |8 a& H
field.+ j" }4 Z- ^( N2 q/ y8 E
In fact, its purpose is not to load/unload VxDs but only to send a
7 i% m) e/ o. B3 D6 xW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)) t+ X* S* P% k' I
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
! W: E; O+ Z  Yto load/unload a non-dynamically loadable driver such as SoftICE ;-).; C9 F$ V* ^% s
If the VxD is loaded, it will always clear eax and the Carry flag to allow0 e: b9 k/ N% e. J/ ]- H' d9 g/ t4 j
its handle to be opened and then, will be detected.
0 g, [* b/ g6 C. X( g5 j, t4 VYou can check that simply by hooking Winice.exe control proc entry point
% i0 W" X6 F2 S0 m+ S, dwhile running MeltICE.& P3 ~/ ~1 K6 t9 i- U2 j
7 f' [% m: F' Z; b: B# `

! M& l6 D2 T9 q1 X4 g  00401067:  push      00402025    ; \\.\SICE
3 r/ v- B8 @3 h4 x7 k+ |  0040106C:  call      CreateFileA1 R8 ]( q' p9 S
  00401071:  cmp       eax,-0016 `' _( E9 f$ |$ V
  00401074:  je        00401091
) d8 W3 H. ]3 ]3 j5 F; V- y- ]( U6 h; a+ `" u. m1 T0 w
# d, ?! h. r9 }0 D9 I$ O; V
There could be hundreds of BPX you could use to detect this trick.
) }+ J0 U3 q! D' N6 l7 O-The most classical one is:  f: @% V$ A2 ?9 U5 G2 y
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
* V- l1 x  Z0 }+ j  E: a    *(esp-&gt;4+4)=='NTIC'" c- h2 Z: w6 u
# b# y+ F* a6 |+ s$ h0 |
-The most exotic ones (could be very slooooow :-(6 m2 }: `: h( }4 d5 s- Y; [
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  4 B; L8 z, ~* a0 x
     ;will break 3 times :-(1 \/ T) H1 q2 C

# }9 i" p- D# s; h7 s-or (a bit) faster: 6 K; {2 T  s; w# d2 w2 m7 r
   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
7 v' Z; A% g4 N+ C% J9 }! o0 s/ q! N# c
   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  
( Z+ g7 H: G2 i. X' \     ;will break 3 times :-(
2 y& q9 R4 m7 A& k: ~
/ o3 B; V/ z5 M! ?% X1 S- e( _7 {-Much faster:
8 w: d9 y  `5 k' f" H3 j1 o   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'
7 P* y! A" v- G: c/ L
9 ^  y8 Q4 q* x6 [Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
  r( n+ x( d! }& a: x4 R6 efunction to do the same job:
- K/ \8 T. H1 \) [( g2 P0 `; J; M( M# w  ^6 Y% _& b7 L
   push    00                        ; OF_READ/ M8 ]/ G- F4 m: S# Z
   mov     eax,[00656634]            ; '\\.\SICE',01 \& @; i% }- {7 s  l
   push    eax% v5 I( `1 R% \7 a
   call    KERNEL32!_lopen
1 h5 m1 [8 R$ t5 b, X/ w   inc     eax; W5 p. j* n$ a; q
   jnz     00650589                  ; detected
" m# U8 T8 p4 W/ }3 @   push    00                        ; OF_READ& A! \& d9 j+ L7 s
   mov     eax,[00656638]            ; '\\.\SICE'( f8 U9 X1 D! N: d
   push    eax4 c1 t! k% L. b6 ~) M1 m9 V: W5 J( C
   call    KERNEL32!_lopen. o2 ]& E' y. Z6 t
   inc     eax
& ?* p/ E* C  g: b   jz      006505ae                  ; not detected$ c; w" i& u2 R8 W

: H7 a8 X! n; j( U% u) }) M% ^3 f' x3 Y& N. O& S0 e# I$ H, B( E
__________________________________________________________________________
  m6 m( G- f( G' E8 q) c# v8 g9 w/ h
Method 129 N6 W5 I% T6 i9 @
=========
1 a7 z4 e/ ?& Y( ^. E1 n3 [. C2 @4 g- {
This trick is similar to int41h/4fh Debugger installation check (code 05
7 k5 M- K  d9 }: a  c&amp; 06) but very limited because it's only available for Win95/98 (not NT)- Y; L, P# H" ~+ y6 _
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.: g# l( g8 |/ C3 S& _. p' B

7 g; \% j+ H! q   push  0000004fh         ; function 4fh/ W2 W0 i7 I* w# _5 W/ B, z2 V
   push  002a002ah         ; high word specifies which VxD (VWIN32)
# ?0 i! M0 Q, g2 w                           ; low word specifies which service1 H+ P, R2 ~6 J, y3 O
                             (VWIN32_Int41Dispatch)' |+ l+ x9 S- \. v& q
   call  Kernel32!ORD_001  ; VxdCall
$ K/ h8 k! a+ L! v5 X! C2 u   cmp   ax, 0f386h        ; magic number returned by system debuggers
* X2 t2 E% N- v$ h: p7 Z   jz    SoftICE_detected( k' u$ H: u5 o& u& V1 l
' f% F. G. _+ _* i1 L% D% F
Here again, several ways to detect it:
* g8 ^3 N3 E/ b) F8 R0 u( G4 U$ }5 B- G' {' d6 s
    BPINT 41 if ax==4f
) n3 e% R( {6 u) U
; C) }& B! H: ]9 _    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one9 v6 k: s& @! ^0 A) L4 d

9 D+ J/ ^4 O# l4 f8 \+ Q: C    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
0 l2 z' l9 e( L3 _* e
( Z" h$ }; R+ ]% z+ r    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!
* |5 O1 H6 `" G+ o6 N+ ~7 F1 b0 g# L# ?9 C0 q2 p- d/ a2 J
__________________________________________________________________________$ C/ t& c/ u: Q- ^9 R

+ ]' N5 S1 m( bMethod 13) B( ~! M5 v% x+ R7 t) \2 j
=========: T9 _  q9 n, G, |( b5 m
& Y' S) A* W) l
Not a real method of detection, but a good way to know if SoftICE is
  z( [) b" c) i7 sinstalled on a computer and to locate its installation directory.
& C/ G! ]5 ]8 I) V5 eIt is used by few softs which access the following registry keys (usually #2) :
$ a$ u7 A+ T& e! y9 r8 a" r6 K7 v; A- O$ T7 G( a- K
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
1 W9 h9 U. u& g: R3 ~  y; e\Uninstall\SoftICE
5 Q2 p2 ?* I& N0 K. j, F-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
  Z4 g* o+ Y  A! @; T. J* @4 F-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
# E$ c3 W: I9 F' E  [; ]5 v\App Paths\Loader32.Exe- Q' T# b- e  V5 A3 O
% [. K+ I7 t5 \  s

& k+ S6 Y3 l5 w/ A# L% H: u( x& RNote that some nasty apps could then erase all files from SoftICE directory
/ e! _. _, [2 d2 S(I faced that once :-(
, o8 E3 s% g* t1 ]/ e9 S0 `: h' d; d1 d, l, t! u6 s2 O
Useful breakpoint to detect it:
8 ?- m5 H. l- c4 G- \8 y
2 {! A$ C" y. P5 G& \     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
; H( ]- U1 V; e
9 t0 \# D  X+ U2 u1 _% @__________________________________________________________________________
4 _! o7 P; N' c  u
+ m7 D( C8 H: H8 v2 t% l1 J8 F7 T$ }$ b% J
Method 14
1 O- C8 w2 Y  |4 B! F) j; H=========  P4 D3 ~. R6 Z  ?/ ~
- e8 R/ t$ N9 B$ N
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
- S( S4 Q# Z* U; d. }0 _is to determines whether a debugger is running on your system (ring0 only).
" l; ^1 L2 ]7 K7 W1 i  E; r& ^% W' G. q
   VMMCall Test_Debug_Installed
0 G% s/ o! Y' e& C  I" F% N   je      not_installed. j- l0 ]  O. }6 i' o" v

- `1 R& P1 {# y  Z  PThis service just checks a flag./ ]$ O" M# _1 n1 t; B, q
</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-7-31 21:45

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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