找回密码
 注册

QQ登录

只需一步,快速开始

About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
: f/ t5 Y5 D$ ^/ V( V<TBODY>
" a# A, X7 i$ R: C<TR>$ O7 M, k2 n5 z
<TD><PRE>Method 01
# G3 C  z, q- b0 G# t2 z- p$ G4 J. {" w=========0 m4 O  ?' [  b8 s( Y" S
+ Z/ y2 _5 K/ b# @6 ]/ {, V
This method of detection of SoftICE (as well as the following one) is3 _9 s" s: y! k3 h# j5 O
used by the majority of packers/encryptors found on Internet.( s1 v6 r: ~+ Z8 l8 m& k' ~
It seeks the signature of BoundsChecker in SoftICE
& g$ c( _- S- k: @- c( ]$ g; k7 G6 _: F# o$ g: s
    mov     ebp, 04243484Bh        ; 'BCHK'
1 t! p6 v8 @, W* ]    mov     ax, 04h1 r; `9 a6 U# y: n
    int     3       6 M+ Z6 M' ?/ `* m1 Z
    cmp     al,45 P, G) n( V: ^/ K' U
    jnz     SoftICE_Detected( J- l. `) Z! ]) o0 D1 Y) o2 D

5 M6 T' C2 d6 C$ d- [. @; E___________________________________________________________________________9 H0 @" X4 d) B8 n8 ?

. O& l! u3 @7 fMethod 02/ X) m/ p5 d$ y" W# V$ S/ T
=========
+ n! p. u+ J  U2 w: j* X: {
% `* \; Z, z1 O( D4 aStill a method very much used (perhaps the most frequent one).  It is used
( \; p  g4 s5 u/ i0 W" h( `, K8 lto get SoftICE 'Back Door commands' which gives infos on Breakpoints,' ?! s/ [. [, v' y2 C* w! C! N
or execute SoftICE commands...; s4 V4 n6 u% }+ M$ t
It is also used to crash SoftICE and to force it to execute any commands
, F# x% d2 M- ~) p, A" u$ v% `% w(HBOOT...) :-((  . k3 N5 o2 `  [' i
( P- d  w4 Z  v& @; D& S) }
Here is a quick description:
$ O+ r$ g) t$ V* F$ k-AX = 0910h   (Display string in SIce windows)" }8 l  r+ J5 P) g( @3 j% d
-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)# J, }. y; N9 h8 f
-AX = 0912h   (Get breakpoint infos)
( c" R! z' I; l' `. X6 Y' L# B-AX = 0913h   (Set Sice breakpoints)" x! n, ]0 P% C: r. z4 D
-AX = 0914h   (Remove SIce breakoints): W0 C) z7 U& u
* J% M+ }4 J; l9 a# C4 `7 V
Each time you'll meet this trick, you'll see:3 i3 T2 Z. ^) U! e
-SI = 4647h
) l4 T" W" ~, b8 v; U4 f-DI = 4A4Dh: i! U5 W; S, o: W7 i
Which are the 'magic values' used by SoftIce.
; k' c- d* t2 P! x* \For more informations, see "Ralf Brown Interrupt list" chapter int 03h.) x  P7 r* N; V0 B
/ B& l, l) q/ d' b, N
Here is one example from the file "Haspinst.exe" which is the dongle HASP# C8 j0 Q8 n# G; u/ m- M
Envelope utility use to protect DOS applications:
; F$ O/ |* N3 w; o9 g" `8 T
6 h) u9 d" F! Q$ k7 i+ r7 P, w0 [0 }7 T
4C19:0095   MOV    AX,0911  ; execute command.6 I% m6 X& L8 V! n% w
4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below)." c% F2 s0 C+ z0 y6 j
4C19:009A   MOV    SI,4647  ; 1st magic value.
/ p; b  |, A! N' Q! u. ^5 a4C19:009D   MOV    DI,4A4D  ; 2nd magic value." o1 n8 Q1 h& G* @6 m- j" v1 x
4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
9 e1 ~# ^$ q3 t2 u6 [  u: F8 R/ R4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute* q4 c( U+ p; T' G( [* W* E
4C19:00A4   INC    CX! _! s( `$ j$ d
4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute
0 U. r2 J; l' [0 K( f, C, `4C19:00A8   JB     0095     ; 6 different commands.( @8 W5 Y. {' t+ y% @9 y" A& m* k) W
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
; U$ V& E7 Z1 P4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)' _+ k( g; _4 q7 f

  D; q, e' w  j- HThe program will execute 6 different SIce commands located at ds:dx, which
$ T; m6 L0 L% D! N, ^0 i: gare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.% k; D; M. [% ~
! }9 Q: f! J2 |3 ~5 ^
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
7 T; z5 L& p6 ?' V___________________________________________________________________________
% @9 e2 j. C4 s' ]
+ a) `6 E6 _0 X9 \+ p( Y  r& ^( f, t5 N2 H3 R6 Z
Method 030 c4 a7 ~0 v$ x9 B. g9 L
=========
) N7 y& f. v$ A! ^) h+ I! M: T1 ?) z+ I6 Z* g  V3 u* C
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h$ a3 I! P$ Y0 w3 ~6 S, H& Z( K: B2 ~
(API Get entry point)$ C1 Z% ~0 ?* M8 d: Z
        
6 c/ F% `7 ?" M6 `6 a4 S2 n6 g2 [6 i
    xor     di,di
; x) K4 u% V. Y; L: Y/ l    mov     es,di
% x7 C& M" [+ q: A2 x0 L. n  P    mov     ax, 1684h         P, e+ F+ M$ ]5 Q
    mov     bx, 0202h       ; VxD ID of winice
- U# O4 j" C4 Q* j4 \    int     2Fh
) v/ c$ K, k! |; F    mov     ax, es          ; ES:DI -&gt; VxD API entry point
7 u* l; V* w$ D0 C) D    add     ax, di
% S, E+ w' a2 u* Y0 }( R( [    test    ax,ax  I% K) ~5 X. }% s: X
    jnz     SoftICE_Detected
% x& t1 s6 V8 h1 z5 z) H, I
0 R3 `9 I- I+ @2 S$ X9 O9 C2 K  V___________________________________________________________________________
$ \/ w% m8 O; H% h) S1 B
( W5 g$ ]- ^5 H5 F2 M! k, mMethod 04
  C5 d* {% [1 K, v=========
1 Y: l6 f- _# s  g- i6 n# a, p' O* D, z  b
Method identical to the preceding one except that it seeks the ID of SoftICE
! G$ D: I  W: _# L2 g( _2 E# O6 F& V4 DGFX VxD.6 t0 C5 B* }$ _. j

8 G+ E) d! F2 _3 k    xor     di,di
7 r2 R. g1 @: q    mov     es,di
& r' i8 `5 {5 x* f! X0 O" [    mov     ax, 1684h      
  Z: F/ ^9 v) D8 M    mov     bx, 7a5Fh       ; VxD ID of SIWVID  k0 Q- E# U& i1 a$ a4 p
    int     2fh3 ]6 j' x/ w, F  x
    mov     ax, es          ; ES:DI -&gt; VxD API entry point/ \% Y  b; [& t
    add     ax, di6 A$ J, k3 z' N) y6 h: ^+ v: f9 p
    test    ax,ax
7 V& l5 U4 t6 A- s    jnz     SoftICE_Detected
& B8 U/ p, O( F3 l: d( {- B9 i- Z, H) `0 \
__________________________________________________________________________/ d) f( k$ K- p0 Z3 ]0 r9 ?

5 A7 V1 O  R6 Y8 q& i6 m  D; `" l
, m% N; C- h4 e# W3 iMethod 05  s4 w1 [- ]+ x# w  [: t
=========& n' ]0 W' A  U; o; U4 s! K) [
4 g6 L2 U4 ?* x2 R
Method seeking the 'magic number' 0F386h returned (in ax) by all system: W) P- b2 ?$ v% T5 |7 R
debugger. It calls the int 41h, function 4Fh.& v8 d% [8 c8 [+ N: B/ `
There are several alternatives.  
& A+ @, h! e& d6 i; d% E& M% B" e- U6 ]- [5 Y* Q5 T% W; h
The following one is the simplest:
/ f. f& C& {  ?0 w& Z2 G# Y
) W: {; B, ~5 Y% [    mov     ax,4fh  M0 L* }; Z3 {  n6 V1 a( O5 r
    int     41h
& N- X$ _8 |# q2 y) `    cmp     ax, 0F386
) c0 ]4 h$ W) W. ~- z, V6 Y0 m    jz      SoftICE_detected0 ^# n5 O: \8 L7 |# P& @% F

, g! u, \, V4 |* d3 p5 a& u7 h4 @/ m1 X
9 F; T' c6 K5 n+ \# aNext method as well as the following one are 2 examples from Stone's # |% }: a. r5 [/ z$ N% T, _
"stn-wid.zip" (www.cracking.net):: N) z2 j  [) c; d
' A5 h* l/ @* C2 |& q
    mov     bx, cs
$ I! X' Y3 }! k( q. o4 _    lea     dx, int41handler2
$ T/ m3 U$ {9 Q, G- U    xchg    dx, es:[41h*4]# R0 z: X' L- `1 F& ^; Y1 E
    xchg    bx, es:[41h*4+2]
9 n* r% \6 T6 E6 p! g    mov     ax,4fh
) w$ H- S. b8 b5 }9 m; g1 z    int     41h$ r" j& F1 W/ P
    xchg    dx, es:[41h*4]
/ O  a- y- n% E( u- Z" H6 M; t6 S    xchg    bx, es:[41h*4+2]
6 ?/ C1 k( ~* B& ^" X& b, B& I    cmp     ax, 0f386h6 M3 o; k0 T' ?6 ~- q
    jz      SoftICE_detected- i$ E, `  f1 X6 g. K

3 G) Q+ U6 p" v; `int41handler2 PROC1 h9 h# R+ _2 B6 r
    iret- m- c7 [4 I& F+ c( w9 f: S6 w$ }
int41handler2 ENDP
3 I& b" ]; N$ F) f# t! t7 y! e; s5 E6 q4 q3 r' M8 F2 a

/ l9 P0 d$ U6 t0 N9 X+ X_________________________________________________________________________
) Q* }: S, @. s7 q5 P$ k0 ^9 X* e3 L& a% i

, |2 P* p$ `! }2 YMethod 069 Y9 L( _5 y; v3 U$ l" b# g. P* U
=========
. E, y1 ]- |1 L/ H; F' z
+ T' |+ ~" [  d: l% t( |0 i# R- W6 h  |$ p1 F$ h8 W
2nd method similar to the preceding one but more difficult to detect:( [  j0 r1 u7 W( x1 Y: j

! p6 J! _$ O' C7 k0 j
$ q- c4 X& f1 hint41handler PROC
  A% l; `3 \6 @! _$ l6 y    mov     cl,al& Z9 `6 s' w- d2 u2 i  U, T0 |# G
    iret) m  ]- l5 w: z  n: o; F2 X; z8 p
int41handler ENDP
: x- `) v1 m3 ?6 H% t& t' s
/ M9 X1 v8 g6 i' W! `2 E- T1 n( B9 j2 f/ G" {2 a9 V& }6 R& E
    xor     ax,ax5 S; n: ^7 A) T. o1 X
    mov     es,ax
7 Q6 y( K1 ?+ \% L' f    mov     bx, cs
) h! X4 ]- U7 n( Z& h    lea     dx, int41handler
" ~0 w0 v' c( x+ i+ C3 u9 K& P0 L    xchg    dx, es:[41h*4]) z' S0 p! A" y0 n9 U% |  a- P# r
    xchg    bx, es:[41h*4+2]4 P$ Y( M3 H# [
    in      al, 40h8 u7 q0 E1 y. o1 S. D
    xor     cx,cx# s6 T$ n0 d+ k" C. b8 z8 {) G0 |' x2 M
    int     41h
  G8 R# N: B: L/ g* y& K$ F    xchg    dx, es:[41h*4]. p' K2 k0 s1 D! s4 x0 W
    xchg    bx, es:[41h*4+2]
2 J7 C7 B6 G& Q% Q8 v6 D6 {6 `- w    cmp     cl,al0 v) _1 B6 V/ m. b6 g4 V
    jnz     SoftICE_detected6 v2 W3 a) D( u0 C+ [
8 X6 |" \7 L; S' C
_________________________________________________________________________% w* F! C- ~% U! P# O& T% S
/ @. G4 Z% X  H6 H
Method 07& C/ w# o0 i+ Z( l
=========
( p. P/ _  s9 o4 B& [! n0 u" Z: S6 F+ m. q1 E. B" Y6 Z& o1 Z
Method of detection of the WinICE handler in the int68h (V86)
% s/ t2 `3 ]+ H0 M, S
- f" o5 F- _( L, J# E3 n- K; D    mov     ah,43h: s) |! F- l, [0 y  d
    int     68h$ n" B6 v7 L% K. z
    cmp     ax,0F386h: u7 N0 K& @6 k0 P8 {4 I+ a
    jz      SoftICE_Detected
0 X; x- [) m2 L" _+ }* d
) G" q# k# }0 W$ |$ R5 i/ @) D. r( I' L/ ~
=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
' X4 c" T1 r8 f$ o' m( x   app like this:  R, ]8 k. w+ i" B7 B, k4 x
1 _2 G- }" s: g
   BPX exec_int if ax==68# g% Y5 h" [, {
   (function called is located at byte ptr [ebp+1Dh] and client eip is
; ?5 {) t  ]: L- C   located at [ebp+48h] for 32Bit apps)
# p: h! q+ O; O1 c. N0 p__________________________________________________________________________
  Q/ h  s# B* v- s/ J: J5 w% ?  B+ u% f7 h. k

+ ~& e* P& |- r( m8 kMethod 08
; O6 S. ?8 G9 u1 r. c4 P=========3 `) h* j% H1 i/ o4 r  M, T

0 B8 p% Y( F/ G0 KIt is not a method of detection of SoftICE but a possibility to crash the  V$ K8 w& X: [* s$ I# T  x
system by intercepting int 01h and int 03h and redirecting them to another& V# W* }/ @2 m; T% i
routine.
& P7 t9 H4 P# F: p4 }4 C3 i8 tIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
4 s& k4 ]/ ~6 p* m# m% xto the new routine to execute (hangs computer...)
# ?+ W* P% Y+ z* V% a
- }  @- P3 B! b8 y. N  h) N/ ]    mov     ah, 25h
$ \$ p9 M. U; F6 x) h    mov     al, Int_Number (01h or 03h)$ F2 E: T, E+ w, v' f' {( O
    mov     dx, offset New_Int_Routine- `3 t2 J. b2 H8 a0 ^
    int     21h
9 y5 T* f0 K9 ^
3 G& |2 F0 |: y0 ?* n, }# w__________________________________________________________________________* C+ w* ]* M6 O
( n% A, c* ^+ a! C' m' K
Method 09+ Q0 Y* {& p; d% e$ f/ Z
=========6 r: h% n3 S- }6 d( ^
' Z# e/ }2 e: E! E
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
* C" r: `7 J& C8 Bperformed in ring0 (VxD or a ring3 app using the VxdCall).# Y2 Y( Y& O5 P9 a. J. A0 c, m; F
The Get_DDB service is used to determine whether or not a VxD is installed! G8 }" {% r8 e/ E( f8 d5 h
for the specified device and returns a Device Description Block (in ecx) for% I! `! `) |7 Y' ?0 T
that device if it is installed.
& M2 p. E# Z) ~! o6 L7 J4 g3 S/ n: a, n9 U) G
   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID
4 x  n* _4 [2 ?   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
7 |" X, [- h! |$ E+ N, M3 k/ v3 q   VMMCall Get_DDB, H3 N+ }, `. c$ G4 a- u5 ]3 s+ o
   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed( \4 N) O( O& H. H2 W0 O9 x# e

, {$ J( g$ h* R# E% I6 I/ y2 i, A* RNote as well that you can easily detect this method with SoftICE:0 j/ N6 Y9 ~+ C" _
   bpx Get_DDB if ax==0202 || ax==7a5fh
7 ~1 Z8 e* Y1 u+ c% N+ c+ ]) G7 j% L  D* g5 {) L
__________________________________________________________________________1 `+ ~2 l, ^* _( x+ X
% `: z8 c: Q, r# m) G3 L( Y
Method 10
4 v1 @- q7 k2 X! p3 j=========
1 B5 u4 {$ P/ [& D
$ Q3 @" o8 a  t) ^=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with
% p0 O; N8 z# W' N  SoftICE while the option is enable!!
  _' Z- w1 G/ n& w: @0 Z$ ], \; [+ b/ S8 i! d; [9 [
This trick is very efficient:8 T8 B' ]* I, M9 n0 Y! B2 H9 c
by checking the Debug Registers, you can detect if SoftICE is loaded
& \# R$ `4 a) J0 A3 \: x7 r(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if6 H, e6 i3 O, J( ]* ~1 V+ G
there are some memory breakpoints set (dr0 to dr3) simply by reading their2 Y% {, r6 r5 J# X, o6 L" D2 [
value (in ring0 only). Values can be manipulated and or changed as well
$ b% n' v( o/ A; E9 P(clearing BPMs for instance)" k) O0 M, C( W. v, E

( O3 e9 F" u1 d2 i. b__________________________________________________________________________6 d/ f9 f  ^" W, ?' \$ R! ?
! t* {$ J' I/ N) h
Method 11
3 O8 S4 R' p+ X; V- |=========
- `. k% ?* R5 L" N: o' w2 G( T, {' s; e  x5 L# B6 q# |
This method is most known as 'MeltICE' because it has been freely distributed* U* {: p7 J1 b3 @5 u2 Q
via www.winfiles.com. However it was first used by NuMega people to allow
, i3 V* o3 U3 e4 tSymbol Loader to check if SoftICE was active or not (the code is located
2 f$ d( o4 f& hinside nmtrans.dll).6 K7 t$ @4 \1 w. I* O: J3 E
( E; ^0 x! I  k  B  \- ?4 ^- n  p
The way it works is very simple:
' U0 \7 I+ J( J2 V, E/ gIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for7 O; a6 p$ ]6 Q
WinNT) with the CreateFileA API.3 h! N3 f3 h) q1 F, S/ P  @
6 V: t! ~& T( W  N0 z
Here is a sample (checking for 'SICE'):
& s0 r% U( |" E7 f' K* v4 Y  f4 j3 q: x+ V
BOOL IsSoftIce95Loaded()' }; f0 G! T6 H# Z4 s1 m
{
( _+ }4 T6 _3 w" z7 M: ^   HANDLE hFile;  
5 ^! N& P+ ~. |: _) [: r   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,$ \8 y4 W7 |, S& y
                      FILE_SHARE_READ | FILE_SHARE_WRITE,- [3 H# k% |8 T# W: r# l6 L. ^8 ~, V
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
( o, X- ^( Y* ~! b% |8 P   if( hFile != INVALID_HANDLE_VALUE )6 `% U( Y" P" @- m( H: i
   {- `# Y! |3 R% e
      CloseHandle(hFile);
+ b$ Y/ z# o2 M1 y      return TRUE;
8 X0 [0 F" }3 x8 ]. Y: U   }
1 m8 O3 V! q2 ~4 Z+ _. u   return FALSE;" E! G7 @$ ~) X, t( w, v
}
1 ^0 p. y6 m) [: v' g
" e$ |; R! s0 H( \- lAlthough this trick calls the CreateFileA function, don't even expect to be% T6 L# l& W- m) W! X
able to intercept it by installing a IFS hook: it will not work, no way!( u' a! L9 T  Z8 w
In fact, after the call to CreateFileA it will get through VWIN32 0x001F2 p0 J& n2 N0 x- A
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
7 U5 d" J+ R$ F7 Y, d  Gand then browse the DDB list until it find the VxD and its DDB_Control_Proc  _; ^( k* U% }( B
field.
& L& u0 q8 l' x% P4 iIn fact, its purpose is not to load/unload VxDs but only to send a
# z2 o- Y6 `5 ]1 `7 JW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
- s, @, K2 g& ], s/ g8 I+ tto the VxD Control_Dispatch proc (how the hell a shareware soft could try
1 K" q, W, M5 u* W& g; wto load/unload a non-dynamically loadable driver such as SoftICE ;-).: T# T$ o( S; ]5 z- u: f
If the VxD is loaded, it will always clear eax and the Carry flag to allow
1 s* a, l' D) d0 N, c6 s# E3 Z+ nits handle to be opened and then, will be detected., |4 \( _- Q$ m6 {1 @
You can check that simply by hooking Winice.exe control proc entry point
2 P/ ~& h: t5 t. Awhile running MeltICE.
) {0 y7 T( W0 ?3 A$ R& x* I
+ j' ]; q7 R! P, f! B7 X  W+ k# ?! Q# C. L+ t" q
  00401067:  push      00402025    ; \\.\SICE
1 K$ r) b" ?0 i5 F$ m2 T. T9 W  0040106C:  call      CreateFileA
- H$ z- E7 V: H& n  00401071:  cmp       eax,-001* k" p) l" L3 P0 \
  00401074:  je        00401091
* M* f% z& H; ^: [3 r/ _$ w$ t- L) F) A) X# v5 O" \

  X& B% ^, A! o, h: u- f5 v/ Q/ IThere could be hundreds of BPX you could use to detect this trick.
! d) J& ~: u5 y- D-The most classical one is:
' Z; {8 t+ b9 g6 b0 o  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
3 j. r, y9 @- {; N9 [. w8 i" J    *(esp-&gt;4+4)=='NTIC': J) J$ z) O2 G' m# z. u

& N- i& N$ ?( ~, h* F! C-The most exotic ones (could be very slooooow :-(+ I. X( k' k+ @" a; f
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  7 e! ?. h/ o) s( s
     ;will break 3 times :-(. m3 x0 y* V& d
% o3 l6 m3 {" n/ I$ T
-or (a bit) faster:
7 i* X( P" A: ?* N5 j& A9 c( E   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')9 {. d' D5 D+ x0 H) v# c, H

/ X: W% A" S4 ]& z6 N   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  ; o- L, }- P4 O0 W1 c$ k9 s
     ;will break 3 times :-(
$ _6 ~. a, T' x8 ?" k
! F/ H/ z, h: L-Much faster:# G: |, E# M( W9 _2 q7 y
   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'; S+ T  W# T3 r- P; q0 y4 l- y
; W: K) c/ u* K7 g9 D; w
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
8 c. z" Z- X! e; \* Tfunction to do the same job:0 X. ?- E2 [: n) l

5 `2 {7 w$ q0 H   push    00                        ; OF_READ0 {0 Y$ c5 ~5 z1 N
   mov     eax,[00656634]            ; '\\.\SICE',0' P8 J6 Z( @8 E- \7 Q- ?' r4 X5 n# o6 [# s
   push    eax5 ^( X; q- s% j
   call    KERNEL32!_lopen
# }, S4 Y4 Z. }( y   inc     eax' a+ z% e7 U" P4 D  U+ K7 c
   jnz     00650589                  ; detected$ m; C' I4 b, v4 n% K6 z, L5 T% I. Y
   push    00                        ; OF_READ
/ Y1 Y6 F  B% V: T   mov     eax,[00656638]            ; '\\.\SICE'
( n+ O  X+ d1 e$ p, t# ?* \   push    eax7 D# {. s) e$ Q5 c; \0 [8 W
   call    KERNEL32!_lopen
5 ]5 @# ~1 `* z( B. M7 I7 Q   inc     eax
: n1 b, z5 X6 ^+ ?' D4 k- |* Z   jz      006505ae                  ; not detected
" \# v! G6 h& [' k* w5 a  ]8 k) j
/ E. [! U5 J# h! J6 v7 i
7 b: y5 a1 m% `) R7 H. p/ p__________________________________________________________________________
! I1 U$ z5 |6 Z- s$ {
3 W) Z) w6 Q5 B+ t& t) UMethod 12
* |5 q2 s' i  Z=========
1 D; S5 k2 D0 q2 ]5 h  P( s1 X8 k' a2 K& w, k, ]
This trick is similar to int41h/4fh Debugger installation check (code 05
/ Q# z. i$ T( k7 q7 C7 R1 o&amp; 06) but very limited because it's only available for Win95/98 (not NT)
0 J* V1 s7 t2 T7 y3 N& N; n7 xas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
+ s# i8 c1 f% T6 h( ]
2 |" ?4 V! E2 ?/ F8 J# p$ G   push  0000004fh         ; function 4fh
" S" g3 p' h7 c6 p1 F   push  002a002ah         ; high word specifies which VxD (VWIN32)  L9 r  j% ^/ B9 u; F
                           ; low word specifies which service1 m( t. {6 ]+ f
                             (VWIN32_Int41Dispatch)$ j3 S  v3 A* u# h, R
   call  Kernel32!ORD_001  ; VxdCall4 o1 F) {! Z& L9 E
   cmp   ax, 0f386h        ; magic number returned by system debuggers6 Z0 e& [4 d0 }4 O# }% w6 P5 ~
   jz    SoftICE_detected7 S2 w  K0 h$ O' x$ `0 b! L3 ?- ?! v

/ P. k% C' @+ K2 O& a  CHere again, several ways to detect it:
7 |5 V" D7 I  E/ p
6 `7 \  c8 {" {8 S! D; c" T    BPINT 41 if ax==4f
$ g- E2 ?2 x! Q! r4 R0 Y
5 H: b( I1 {. n! v& ^    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one
" P, R( W- I: \: C
3 N# ?. O3 z) ]. |  V    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A: |0 |' }+ M9 B8 _! ]
+ k% b+ y) c, }% Z+ b- L4 Z7 Y+ M
    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!
( I) I1 k$ y- U/ j( ~9 s$ l
1 ^9 n: B- P: O__________________________________________________________________________+ ^/ p6 y( p% n

: f! x. x' `1 `9 IMethod 13
; H* D/ L8 u9 ^0 O5 o/ g=========, r/ x" `3 G" d# o
& M; K; r: n: J# e: Y9 n
Not a real method of detection, but a good way to know if SoftICE is
0 Z7 S8 K/ _  j( ]9 x6 _; Ainstalled on a computer and to locate its installation directory.
5 c6 D& S3 }+ [/ p. W/ G, r% Q$ wIt is used by few softs which access the following registry keys (usually #2) :( l9 o. ?: l- r5 j5 K1 F4 J

. Z+ K# A) q  q" y1 M-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion2 n; n  F* M0 V( e+ s
\Uninstall\SoftICE
2 l, t8 r; |* z+ V; O5 s-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
; c& ^8 X5 t3 O2 P) \6 B-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion& f0 u  J6 t3 F7 @# ~: I6 f' B
\App Paths\Loader32.Exe
1 }/ ]6 ?) ?$ H0 u+ k& P( X' z
. X0 x# V5 v3 z! o2 t
% k3 g% l! X2 i* ^/ t) YNote that some nasty apps could then erase all files from SoftICE directory0 G7 n+ h9 p* a0 t# T0 ?: |
(I faced that once :-(  _: a- V, y. k, h) _& _2 T
- l: r! x2 m4 n% a5 [! Y
Useful breakpoint to detect it:$ a7 y0 m0 }. v
; p7 ]+ }# K* W) d- c- `
     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
; v$ s7 ~/ q$ R
. ]0 r( p# e; Z# K6 F__________________________________________________________________________5 b% K, o, v% v$ |5 r) s: h+ q

8 Q/ @( _& P; Z5 q5 I5 P8 T6 U4 y6 q. L4 t7 U
Method 14 & u# E$ P$ k6 V% e  _9 m
=========
& B( a, ?7 {0 G/ H* _0 Q4 p4 B5 X9 Z
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose$ a1 X* H1 Z$ z  A7 t) C! l- w
is to determines whether a debugger is running on your system (ring0 only).% C1 |' f1 S$ b7 B

9 |1 j; l1 Z; V0 O  V* H: s, B, P   VMMCall Test_Debug_Installed  E6 K, o1 n+ a  d+ P/ ^
   je      not_installed$ H. b3 R) M, K* `! z+ V8 n( Z

% s" {& B7 Z) ]8 ]7 v% AThis service just checks a flag.9 _6 ^6 O1 }) `
</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-2-14 05:05

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

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