About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
; u# }5 @( E5 C' s<TBODY>
/ u0 p: h6 s! r# P! D* u% f<TR>! Q0 N6 M$ d. T) P1 P
<TD><PRE>Method 01
: Q% b- F) J. y9 A6 S: q=========
! u% @  h4 J5 ?) N' D( W' ]- e' p( {, n" D0 {, `- B
This method of detection of SoftICE (as well as the following one) is  ^. P4 ^) o. B
used by the majority of packers/encryptors found on Internet.7 l& F, g, w$ Y7 I& v. v" h3 D
It seeks the signature of BoundsChecker in SoftICE
! t, E- V2 T5 x1 {5 R
2 R8 F4 k% k+ k! c1 p    mov     ebp, 04243484Bh        ; 'BCHK'5 Q+ M" K4 U, g  [* P
    mov     ax, 04h- P5 K+ w0 S7 o+ c
    int     3       % q) J. `, [. n! O
    cmp     al,4
$ N" i% n6 ^0 _- q  i    jnz     SoftICE_Detected) l' d1 w' y4 N" k  K

/ @) X# t0 L/ D- j8 k( l___________________________________________________________________________
. e6 E, C1 K' s; u: H8 M  s; v( D4 a
Method 02
6 p5 c9 n# q2 i2 Y7 ]) e=========
8 |& ]- ]9 O7 g" v5 [- ~- @
5 s1 P5 W, W- C: v0 M# OStill a method very much used (perhaps the most frequent one).  It is used/ d7 n) _- {2 j! y* N
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
( U2 {8 j) L: B1 n  E: W6 Yor execute SoftICE commands...% L2 V; x, `8 a
It is also used to crash SoftICE and to force it to execute any commands
- a$ Z8 l/ N( c5 z2 k' J(HBOOT...) :-((  5 o8 w1 }; R1 B% f9 U( d5 ]* W3 ?
/ R! z: ^2 G# j/ d
Here is a quick description:! j+ ^5 [- v( {: W$ \
-AX = 0910h   (Display string in SIce windows). K! S6 l/ {3 ]# }" z9 O
-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)
2 q. b% v% n9 P# _- B* y4 s% w2 A-AX = 0912h   (Get breakpoint infos)
% s0 F% e) f8 N5 I. _6 o& l-AX = 0913h   (Set Sice breakpoints)
% y" U- k+ L# O5 r9 |+ q7 P7 S-AX = 0914h   (Remove SIce breakoints)
2 H. e0 {1 i5 {6 u
1 A$ w9 {& N2 v: u9 y: {Each time you'll meet this trick, you'll see:3 M6 D( [4 r# o4 y2 e; ~$ Z
-SI = 4647h/ }' I- N" t) }5 W
-DI = 4A4Dh
  A8 X% L) s( Q' GWhich are the 'magic values' used by SoftIce.
6 Y% K6 p) M# Q# AFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
* s( L$ \6 t. d) k1 z0 X( X# B
" z; I& r" ~* u  `Here is one example from the file "Haspinst.exe" which is the dongle HASP
2 O( }4 V2 \3 @( j+ _# M) Y. x- rEnvelope utility use to protect DOS applications:
% C) Y" Z  c$ g2 r  q. h8 I2 Q" X  _  X6 k/ Q2 x% }1 D$ O
- n& ?4 R' ^) W# p$ R$ K3 ~
4C19:0095   MOV    AX,0911  ; execute command.
. T1 V2 w* j* A& j1 }4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
. z% T9 k5 S) ?. \! R6 B4C19:009A   MOV    SI,4647  ; 1st magic value./ U  r4 e3 l& i6 y( p/ ?" w
4C19:009D   MOV    DI,4A4D  ; 2nd magic value.5 e( b  r9 {) v  Y
4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
+ m4 M# X0 t1 R' m4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute
/ b4 u9 {- _4 F% b: e' _4C19:00A4   INC    CX
6 M; @2 e5 F& J& c+ z' m  O4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute
" G# i6 e1 q$ ?7 C! f2 [4 |2 d4C19:00A8   JB     0095     ; 6 different commands.' U: e3 ]! u) \* Y7 _) K
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
5 h& k+ N+ a4 [/ R3 G4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)
% l: U. M; j7 K( F  c7 @# S$ @# g7 W" D/ q: |% P
The program will execute 6 different SIce commands located at ds:dx, which2 _# X3 V! b5 E% y" G3 W7 }6 Y
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.4 c/ a; A, ?; N, t. `/ j' c0 J& k

2 u" y3 L& e/ {5 @' V7 N* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded./ K5 X: q3 t) Y
___________________________________________________________________________
7 U' X  E$ [3 d7 c$ k& j
' t. K7 I2 o& c! \, C" l
3 p. W. b, J7 YMethod 039 C  W" f5 t+ q
=========5 c: j7 C7 c* a0 k" ^# V9 B

  A0 c5 A* j3 v( z1 RLess used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
5 K6 z) J# d* R& J7 @(API Get entry point)' B5 Q$ a' N7 v+ o
        
' r; K4 z" H' K' V4 U$ q& `+ M, U  j, L; N. G8 ?# d
    xor     di,di9 c) Z. U: G. Z4 Z9 h" F- D
    mov     es,di
  ^+ @2 H8 B) x    mov     ax, 1684h      
4 d& S2 ~* d9 z* V    mov     bx, 0202h       ; VxD ID of winice4 K) L, J6 G2 n, R, u0 K% n. V
    int     2Fh0 B# j) i+ K9 P& x$ a! F! |
    mov     ax, es          ; ES:DI -&gt; VxD API entry point
6 G8 k% s9 h4 E. U! V1 C! A; M    add     ax, di
8 m; E, {8 O" R8 V    test    ax,ax/ f' Z5 z  [5 l. c& }
    jnz     SoftICE_Detected
% B/ Z7 v1 ~- Z* A% S+ V$ {8 Y0 d; j( d2 N6 _7 G3 ~4 Y. E
___________________________________________________________________________1 E8 O3 V  q6 S# ~
) t$ u; w" Y* y( b4 U5 ]2 R
Method 046 P+ u4 n' y* ]8 u. e' l6 _' }
=========- p$ s* b( r3 `" _8 b! `/ }

& Z4 _6 ]7 O: S3 b' t. N5 sMethod identical to the preceding one except that it seeks the ID of SoftICE% u2 S" ^% h9 E$ R' K6 y- k# _
GFX VxD.
& w  N( P+ C8 N9 w9 z
' S- U+ Z* R: y3 [    xor     di,di1 T# l# T" q: s3 ~0 u
    mov     es,di
* d# i5 U/ B7 j4 `    mov     ax, 1684h       9 b- x# @7 z: S( V
    mov     bx, 7a5Fh       ; VxD ID of SIWVID
) i- @- \5 j4 x$ m    int     2fh
4 K3 y/ D& C- i    mov     ax, es          ; ES:DI -&gt; VxD API entry point" F/ ]! J. x2 X* q" H& `# }3 s6 s
    add     ax, di! R' [7 V- V. y$ M/ m5 A  B. z
    test    ax,ax9 q7 F% W# q+ D; t; v
    jnz     SoftICE_Detected# r; P/ j2 w. d% [2 r* o
# @% \' I1 a0 k, A
__________________________________________________________________________
1 f) J6 z: a/ [, S  z: g( {+ S, |7 y
9 }: [# d% x. b& X, N
2 x7 S7 z- s$ B- s+ M: KMethod 05# z( e7 N" V) Y3 p* _: Z( ?' R
=========
5 W8 h2 F; ]( [. V! C3 K1 X' i
& {0 p0 P* E6 h  I7 \Method seeking the 'magic number' 0F386h returned (in ax) by all system
4 N# p; c$ M) d, y+ edebugger. It calls the int 41h, function 4Fh.
6 w. n# U% ^+ Y2 x4 \3 AThere are several alternatives.  
  q9 k8 A2 X' k; Q" i4 O  W, l6 F/ |: e! M2 [8 l
The following one is the simplest:& t  S; {, ^/ P1 m/ f6 a

" K5 s% I. \9 F" `( z& j* h- ~    mov     ax,4fh* l" I% ]4 V8 g7 c
    int     41h
& K+ a+ d4 h) G& t    cmp     ax, 0F386* l2 s; k0 ]5 x' z
    jz      SoftICE_detected7 N& t4 ^7 N1 j6 E# ^
% {! O1 o3 `8 Y; w

/ {7 u6 f; C; X- b, `Next method as well as the following one are 2 examples from Stone's
1 o8 {7 {- g& A1 B" _  l"stn-wid.zip" (www.cracking.net):
" x: [& F% w7 v$ J0 P( z4 z" n% a' H* b% v& i
    mov     bx, cs
5 F, k; P0 l0 U4 `& S% T    lea     dx, int41handler28 D; _( ?2 R# y5 j  ?
    xchg    dx, es:[41h*4]
2 q' R! N0 b! @5 p  f$ X$ B7 q4 S    xchg    bx, es:[41h*4+2]
2 Z& N9 {% V$ s& ?    mov     ax,4fh9 J) B) \. H3 b9 N& ]0 D4 D" [
    int     41h
: r  a6 K( i* s5 r    xchg    dx, es:[41h*4]0 L" ]( ^  c+ Z  h; P
    xchg    bx, es:[41h*4+2]0 {5 [* x; z0 }; d4 z
    cmp     ax, 0f386h! u& J5 m0 k+ d" n- z
    jz      SoftICE_detected
8 C* e+ X, j/ b
- s9 R% a0 w0 \; [int41handler2 PROC
% O% `* O2 U- \- G9 A6 g    iret& g' p3 w" J' z# k+ n+ `
int41handler2 ENDP8 d, H9 D' _' w2 W$ n! c5 \
% ~' m2 n/ p# n" [

9 A- \2 n' ?$ N9 q: I$ }4 r_________________________________________________________________________9 y# ^% a1 C2 d1 H
. ]: v+ J9 d) F8 k3 l, e0 b
, U# V' S" P% H  _
Method 068 O5 P) f4 i( E9 S+ A
=========, q( w1 }; u5 _4 p5 B4 A

# H* N6 Y$ I, J- ]7 C
7 ?  n5 B: o! u+ q, I* N' q0 q2nd method similar to the preceding one but more difficult to detect:
; d& R, {: ~0 D+ u. I$ d! q% y# [( D0 e$ v4 {
1 d$ ^2 V% Z) R2 V
int41handler PROC; z& e9 [& W1 @( s4 V6 A
    mov     cl,al) g$ a% d: V$ v& W
    iret
1 G- Q" @: _# ^1 c& Vint41handler ENDP
9 O1 O+ l/ D0 b
! h" H  x% L: l( o( O; x/ I9 [1 q" z- x+ v
    xor     ax,ax% R* a6 N' i' }, v2 a& k$ V+ \7 V
    mov     es,ax
) L1 X0 P  B  q- S5 v  Z) u    mov     bx, cs9 c* ^$ Q6 O5 K  p) \6 r
    lea     dx, int41handler$ T- U) R0 F% v, T& c; O. q8 G
    xchg    dx, es:[41h*4]! S- B; }8 X' k& h* P
    xchg    bx, es:[41h*4+2]
% E+ Q7 s) L* \$ T  Y8 z# b    in      al, 40h/ ^1 `5 k' }' {3 \" G
    xor     cx,cx
! k5 T' L8 _; N    int     41h
% L: c! Y1 c$ H5 ~    xchg    dx, es:[41h*4]4 ?  `0 a% S3 r% {# Z# V/ M
    xchg    bx, es:[41h*4+2]+ V4 U. p# m; r% z/ \/ e$ l$ u
    cmp     cl,al
, v) B9 i7 q1 e# H: h* O: T5 A    jnz     SoftICE_detected
% a2 j* i  ?; I' C+ l+ R2 m
' @% X8 |; `" w' }7 o7 U9 v_________________________________________________________________________
% z- \0 D! v/ q  w
" Q( K7 F5 p3 K$ }  P/ SMethod 07
5 t* G, }0 V! e+ X! F) M# a=========
$ {9 J. @  K( ^4 t6 N& v7 B, f! L* B4 h6 n$ K
Method of detection of the WinICE handler in the int68h (V86)! }& y7 o/ U* ~( v, V) A
$ D( V; F: A& c3 ?+ z  ~
    mov     ah,43h7 c2 f2 s; U$ q2 W8 ?
    int     68h
; v8 n+ d6 b# c3 r+ \& Z8 w- x    cmp     ax,0F386h( C6 M* @' O  W; z- u7 r
    jz      SoftICE_Detected/ ^9 w  v+ P) l3 G  [- I

1 j  Y0 m* T& Y7 A7 K  W+ D9 q, o
" [! g# U4 M& ?8 q1 Z' y=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
. p7 {9 X- J: |6 S: I' {1 b   app like this:
  S% o% a' n" Y7 Y2 A  c/ i  u7 P  n+ N# v; A+ W
   BPX exec_int if ax==68; Z  h& I. _! f7 a6 G6 N
   (function called is located at byte ptr [ebp+1Dh] and client eip is+ d7 r) q1 k. k. U9 \
   located at [ebp+48h] for 32Bit apps)+ \8 Y, ?" B' i, \9 v2 j! J' t
__________________________________________________________________________
# f: I- g: ]- E/ r' Z; p9 z. `$ r$ Y' [1 L% `
( M2 e& y; X( L) D
Method 08; ~! a/ e7 i  n% E9 ~! x/ u, D
=========
5 a' f9 J( f/ |5 _: w5 t2 T# F5 w2 e8 }2 }2 I; m
It is not a method of detection of SoftICE but a possibility to crash the5 F7 |" X% u7 g  \
system by intercepting int 01h and int 03h and redirecting them to another! R1 K! E# q6 u0 ^) v9 K
routine.( B( q  z. z! p$ x* l7 F
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points, U8 ~' M8 @' ?* Y6 Z) }! U/ H
to the new routine to execute (hangs computer...)
) B3 O5 e7 G9 t( @
6 X: U7 u! O4 E, ~  U% y4 c    mov     ah, 25h
2 \0 A" w  V! Q# h4 ?    mov     al, Int_Number (01h or 03h)( ?' }7 D$ _& E1 v
    mov     dx, offset New_Int_Routine% q% d  q9 C$ k' L" q, j
    int     21h
$ Y6 R! v4 F# N' w, R8 c+ X8 d$ z9 a/ x/ S! y
__________________________________________________________________________
. z5 z6 g. Q. |0 ]  D* Q- ]" @% A1 F; B: I9 ^
Method 09
7 B) u+ s1 e4 {5 ^- w+ x) s=========
  S; g: T1 ~3 Y( K
+ T1 i7 A* N% O& vThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
) n+ V  A1 q! D6 n4 Yperformed in ring0 (VxD or a ring3 app using the VxdCall).
- y/ [7 H% f9 V# y( }8 TThe Get_DDB service is used to determine whether or not a VxD is installed$ }, h! `- \+ N, @+ t- t: R
for the specified device and returns a Device Description Block (in ecx) for0 \* ~8 \) u9 q; W7 M
that device if it is installed." [7 Y* c6 }. w% `/ h
1 y3 g+ h2 N, y9 E
   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID
/ f( A$ c/ h! I   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
4 ?8 m% {6 j6 g5 a   VMMCall Get_DDB/ w' S% |. `- ^$ J; ~
   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed
& P9 R) e& f  O- |$ v# ^- a7 s  n
! {2 j3 h6 g; h% J) w3 p5 jNote as well that you can easily detect this method with SoftICE:: D' I3 x+ }- S& Q# E  o1 @/ Q8 J
   bpx Get_DDB if ax==0202 || ax==7a5fh; f2 D9 |% \4 C' ?: _" t
9 r- {9 [  T& ^
__________________________________________________________________________
& u: a6 u5 w2 o: B
, d; R0 i- n) S4 I- s5 nMethod 10, n6 D0 x$ M8 n, i
=========. K. g, W" I& L. J, D9 q
$ R5 \% f) Z6 E) b) v
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with* x9 g4 K# Y4 N+ S0 z2 e# A
  SoftICE while the option is enable!!- u: \5 [. v; U. ?% z7 w% [/ V  R/ U
" A* Y4 e" P: `- m
This trick is very efficient:
% I! N% e% }3 I4 m; Eby checking the Debug Registers, you can detect if SoftICE is loaded
! ^9 ^/ R# Y9 E8 k' {(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if1 Z0 k$ H& g+ b$ q+ \  A# r. E1 Q/ m3 t
there are some memory breakpoints set (dr0 to dr3) simply by reading their* w5 ~9 A3 @& I  t3 e1 ?  K4 n
value (in ring0 only). Values can be manipulated and or changed as well
' W5 {. ?# S* s7 ]0 c" q(clearing BPMs for instance)
6 t/ c- v7 e2 m2 y  \7 w( T
5 m4 r3 H4 ~) L. {4 q__________________________________________________________________________
9 u5 D9 ?/ r. S/ w1 P& x7 t9 C' g2 r1 \4 p+ \+ p% H
Method 11
3 n: k' [  y* X4 Y( l5 a2 B=========
  y; U3 x1 ]! Q' J$ i: D. }' S, A4 `/ O) y
This method is most known as 'MeltICE' because it has been freely distributed/ V: Z4 Q2 Z5 ~/ {
via www.winfiles.com. However it was first used by NuMega people to allow7 x0 J: J& i; B; m# N$ h- P
Symbol Loader to check if SoftICE was active or not (the code is located' F! J% Q# J: b$ r
inside nmtrans.dll).
0 T2 q" {& Q+ Q( M5 Y6 d$ U( H$ Z& x, ?: F0 C
The way it works is very simple:. o3 Z$ A; A3 P! R4 a3 m
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
: _0 T6 Z0 I) P2 |( W/ J0 QWinNT) with the CreateFileA API.
+ s, t. m0 _/ k
  ^  k4 U7 b$ G1 L7 A- v, THere is a sample (checking for 'SICE'):7 B/ [. e; s2 g; U& L# N2 K4 ]. l
+ p( V6 |. W( k- t9 M3 d
BOOL IsSoftIce95Loaded()! t( A) i5 B6 z2 Z: }
{
, \; r9 P2 y: G! {: _- p0 A/ P; |   HANDLE hFile;  
  Q5 S1 h4 y; K6 |' M7 t' r. i5 M   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
! D6 c8 K3 [3 T4 u6 i" L( I9 B/ _                      FILE_SHARE_READ | FILE_SHARE_WRITE,4 w9 A* z  S/ l" t- ^
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);6 Y4 \% D8 X: N+ I
   if( hFile != INVALID_HANDLE_VALUE )
- ?4 h( m3 v3 m  q9 w( i   {2 J, U/ Q# ?5 Q
      CloseHandle(hFile);
  M, v, O/ X2 p* L: a# e/ {$ m$ a      return TRUE;
4 p+ w9 I3 O0 Y, A) b   }* r9 _# P# h( K4 B- W9 S
   return FALSE;- T) v4 D, J: [7 W: F0 K" l0 m
}- R; \; Z+ V1 n& U$ o- @6 R

9 a* _5 c  R' s/ E( \+ G6 lAlthough this trick calls the CreateFileA function, don't even expect to be# G' N' G4 H$ o" w: f7 p2 D. Z0 U
able to intercept it by installing a IFS hook: it will not work, no way!6 h) d. k7 Q% R2 V
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
8 o: |1 L; J- @. `. X; Nservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)0 k. Z8 j- L! Y
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
* T; T4 I* ^5 V. ^0 l! Y8 Wfield.$ {0 k  P3 v3 N! s5 |7 r+ x" O; Y
In fact, its purpose is not to load/unload VxDs but only to send a
% `0 x' G5 p9 L& B- ?7 K2 ?0 BW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
2 v* c! [9 u( b% [0 {& i5 Yto the VxD Control_Dispatch proc (how the hell a shareware soft could try
. b1 v6 q" E' L6 c$ [3 @! \; @to load/unload a non-dynamically loadable driver such as SoftICE ;-).- p" b: M" O: m$ d/ b
If the VxD is loaded, it will always clear eax and the Carry flag to allow
; O; `" F1 ?6 T/ Yits handle to be opened and then, will be detected.
7 q. Z& G8 w( Q" Y5 V+ PYou can check that simply by hooking Winice.exe control proc entry point
  X6 J, ]# j9 G. A" N. _; C! \while running MeltICE., C2 m. p( p. h; k9 W

- H6 W; {; N# f$ }6 A8 F6 I9 j0 `6 q
  00401067:  push      00402025    ; \\.\SICE
* V$ b9 x& O0 e8 j2 a$ [  0040106C:  call      CreateFileA: a: w* g1 h+ b6 w
  00401071:  cmp       eax,-001
; J# g# P4 m6 p8 k/ A" x9 T  00401074:  je        00401091
' g$ M9 `- x6 X5 V) c3 d5 z# z- J. t; w" M4 {
* ]5 _1 T" h2 _0 l
There could be hundreds of BPX you could use to detect this trick.
: O3 `' r% J. _% E: `-The most classical one is:
. E2 _- V8 `6 L: z  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
- A" T& {! F( E* \: \    *(esp-&gt;4+4)=='NTIC'
8 c1 K$ V) G: M" j/ R# ]9 [2 A# r0 N( Q8 q2 f
-The most exotic ones (could be very slooooow :-(
  d0 \1 y+ |+ k  V. y   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  
; n# e$ T8 f- ^- h) |# ~7 G7 \     ;will break 3 times :-(
, F9 d; J. t: f9 }& E$ {
+ D, ?" i/ M0 r( {-or (a bit) faster: : e! A7 O4 |4 D
   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')9 F1 O  ~. ~9 d; G% M
% T# M9 }' _1 U% ^2 B+ }- d" Q
   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  
2 b7 C$ G' ~! S9 g1 z' c     ;will break 3 times :-(3 H& V9 a6 `1 [) K( {5 G

6 F; I% G% M+ X7 }- t9 `-Much faster:
2 j+ h: i: V; Y   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'
! C8 f. J5 U3 Z7 a& m$ \, M! M( C: E9 _# Y- |! ~
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen- d9 s; z% c# l" U) h7 D
function to do the same job:
' w- Z& c3 _5 g  S6 U* |% ?9 J0 _+ S# i
   push    00                        ; OF_READ
0 a' q; z1 l3 ^5 k( j; F& k   mov     eax,[00656634]            ; '\\.\SICE',04 u: `( L! s( ^2 c  }3 \* [
   push    eax
- U% N* r& ]- U; G7 \# \- _! y   call    KERNEL32!_lopen
# a5 g/ b7 L2 G2 O' W   inc     eax
, f  d( c. j: y4 d: m( u   jnz     00650589                  ; detected
- d  d- r* q8 E4 p# k   push    00                        ; OF_READ2 Y" Y9 o. c# f/ n1 |
   mov     eax,[00656638]            ; '\\.\SICE'
4 q( e# b/ U5 t+ \   push    eax" M  s2 s8 @& v& J. X
   call    KERNEL32!_lopen1 ~' L1 X% A9 S9 {. u! h  L. d
   inc     eax
  k( _+ ^' H- S6 W- W1 w   jz      006505ae                  ; not detected
3 i. t: h! ]* y% O% [  |, I3 ]4 `3 \/ D) Y) j
  |) b6 f- Y+ i4 {
__________________________________________________________________________
$ w) P. f8 V* ~3 X6 [  ?
% F$ }# ^3 L1 D/ |Method 12
. A# N; Z5 P6 R( _=========/ @) p; e7 S7 l/ q2 s: a  {
9 D. s7 N0 r3 Z, }' ^0 `
This trick is similar to int41h/4fh Debugger installation check (code 05* F5 d* \8 x" z% [0 L$ ]* x: L
&amp; 06) but very limited because it's only available for Win95/98 (not NT)
8 B3 p& v" b& K# b1 Z; U) bas it uses the VxDCall backdoor. This detection was found in Bleem Demo.- B, L1 V/ d' ?+ ~$ X: Q5 J3 N/ D

8 u7 ]4 z, X5 `* x" f   push  0000004fh         ; function 4fh" [& S4 ^5 d$ v4 C
   push  002a002ah         ; high word specifies which VxD (VWIN32)
& D$ s& A& [  O. m" d                           ; low word specifies which service
' N  s2 u! |; j$ H5 E' B- d                             (VWIN32_Int41Dispatch); R5 N) i& f: a/ X7 @! M) h
   call  Kernel32!ORD_001  ; VxdCall
% _5 P0 P# U7 [' M+ n9 b! D& ~   cmp   ax, 0f386h        ; magic number returned by system debuggers
) u( K0 d! z/ x& {* K/ _6 c5 ~/ m" N- T1 S   jz    SoftICE_detected8 C  D- {2 _6 z. v2 y

  f+ E, r5 v* f# XHere again, several ways to detect it:6 w. m# p6 E! h  N& A2 l- R

1 J, R% @# x6 X/ j4 x    BPINT 41 if ax==4f& F4 R) A6 U* h% r: p1 o1 t- P

1 _5 w- q0 w) U2 u1 Q0 E    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one
# P1 ~/ ~: O, x0 x
, d& ~% @+ q/ Q& @    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
  A( @( |& k% [! L, G! Q1 M% F. @/ ^: I( B* X( v: n/ p
    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!! z$ \  L4 m# N! \% V3 B

( |4 _9 Q9 t3 }) z3 v' |__________________________________________________________________________" h: ^: x( c- S, D2 N* U9 L. l

8 n) r  d- R1 U2 x( vMethod 13! I; z2 f  e2 j# M3 a
=========- V- k4 @0 }& G

1 V9 k# f  P0 m$ x% INot a real method of detection, but a good way to know if SoftICE is
; G. C- a, r" G2 {7 D* D, linstalled on a computer and to locate its installation directory.9 I/ w  B& s6 M4 R) M
It is used by few softs which access the following registry keys (usually #2) :6 u  f( o6 ^- T) Q. V. H( L

6 i( L' T8 G  c2 `$ c" b/ A' f-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
: M8 B5 ?! {! E: `4 l\Uninstall\SoftICE# v2 h& K+ T" y7 w# {  ~, v1 I
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE. W  s; b! R, S4 D
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion! Q. t7 J9 P9 {5 [- y/ `& [
\App Paths\Loader32.Exe
2 s6 Q; o' p! Z0 K, z
+ @& z: N& G  ?* }1 ]! m, ]8 p
! Y, p8 H4 a" {* q) {Note that some nasty apps could then erase all files from SoftICE directory" F, ]) B- a9 I' O1 e, m: ?( m
(I faced that once :-(
1 C9 T  w5 \# ]# x" u0 C! y& t9 K4 i0 Z* O5 ~8 I/ {  }( W( ?
Useful breakpoint to detect it:
- A3 \' p& K1 a8 [
' r2 P5 j% `+ H     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'6 l3 ]. @/ l6 F% Y7 \2 t0 r9 [

+ d+ A+ e3 u( p$ h__________________________________________________________________________4 s# k1 ^0 Z) l

' R5 D; g$ p* ~: A6 m- S2 p  t! ]3 H7 C( a2 _
Method 14 5 c5 X" W, R9 O3 V% M4 k0 w* V; ^
=========
8 R% W5 Z5 r5 o, @& p" M2 ~  K& X  i" y# d3 `* n5 c+ ^8 R% [( a2 D
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose( L7 b; b3 Y" A* n- P( h
is to determines whether a debugger is running on your system (ring0 only).
" G1 e4 t5 x6 G5 X
$ j2 q& Q  `* _. U6 A) J   VMMCall Test_Debug_Installed1 `: a6 ~6 Q* _+ j6 W) i  Y& x
   je      not_installed# i: W  d% ]; a3 O
+ W; h+ b9 ~- v1 D0 t
This service just checks a flag.
* V, j( j* @9 a# _$ x2 e</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关注公众号

相关侵权、举报、投诉及建议等,请发 E-mail:admin@discuz.vip

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.|鲁ICP备19052200号-1

在本版发帖
关注公众号
QQ客服返回顶部