About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>% ]6 G* a- t! a' j) K4 B
<TBODY>
: I- e2 k! T9 x4 F% d4 O<TR>
- t2 c7 c' b0 g9 g4 |" q! h<TD><PRE>Method 01 9 C# z6 \5 Y/ J- S" g# [+ o$ m  P
=========
" n1 m3 ]; ]5 F7 N% E2 R+ r  R3 a. R/ P3 N6 P7 S3 k
This method of detection of SoftICE (as well as the following one) is! p) D5 S1 [  i" S8 U) r2 R
used by the majority of packers/encryptors found on Internet.
3 ^2 _$ V) ^& U- |0 L8 z; }' gIt seeks the signature of BoundsChecker in SoftICE
; f# Y! ^7 e% ]9 o8 w0 t3 b5 a& ]( v  a! g: C  b
    mov     ebp, 04243484Bh        ; 'BCHK'
1 r% ~( m' D( \% h  I" F: `. x! E    mov     ax, 04h0 G2 H& Z& P! C6 V
    int     3       - X) f% X1 Z% v# w
    cmp     al,4
) G# ^1 M* w. G# g    jnz     SoftICE_Detected
- R7 T2 B. g+ [0 [3 u7 ~% v0 h: V8 ~( a& M( n
___________________________________________________________________________' S, r  D. K$ a- s4 Q5 [, D' v
7 I, d# z/ |. e; x3 q
Method 02/ ~/ N  S. ~; Z3 V$ \- _! b
=========
" M0 Q2 {% {1 c8 y
3 |% k, G6 f2 \Still a method very much used (perhaps the most frequent one).  It is used' o* r! }2 I5 @9 \: E( d4 K
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,* N) i* R6 Z* D& X
or execute SoftICE commands...
. F; t6 S$ k, J5 vIt is also used to crash SoftICE and to force it to execute any commands
5 f+ w# M- N1 M6 _- O% v! W(HBOOT...) :-((  
3 ~" K7 [$ {& \- [' D) f4 Q3 O2 I2 m
Here is a quick description:
! d0 P/ @6 F1 d0 a' L2 s-AX = 0910h   (Display string in SIce windows)
& j- E( H; q! c6 A-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx), a, {) p+ G# ?
-AX = 0912h   (Get breakpoint infos)1 i! u& i" T7 P& \
-AX = 0913h   (Set Sice breakpoints)
& C/ U3 d1 K4 {- A-AX = 0914h   (Remove SIce breakoints)
6 q/ u: Y) j$ U% i& i, ^+ {% v0 y' b& ]
Each time you'll meet this trick, you'll see:
4 R) O2 N( ~" b$ Z; N& }-SI = 4647h- l, o; B- ~! H# e( S  n2 e
-DI = 4A4Dh6 I& a: o/ w% O* r  R
Which are the 'magic values' used by SoftIce./ A: U0 A3 Y. G3 |4 |
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
/ u& X6 c, ~; w* E9 v6 f7 l: r+ s% ^: d( a
Here is one example from the file "Haspinst.exe" which is the dongle HASP& J7 L4 A1 I& v* }2 ?3 m0 T. g/ [
Envelope utility use to protect DOS applications:+ H1 B& [0 K, k) y
0 e) S# k" {+ P- y. s$ q* \, f

- f5 u- m: y7 q/ ]0 G4C19:0095   MOV    AX,0911  ; execute command.8 i) ^( c; @7 z/ l6 V9 ~' |
4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).7 X( a4 N( C/ N
4C19:009A   MOV    SI,4647  ; 1st magic value.2 ]2 b7 [# c) X3 |4 A+ I
4C19:009D   MOV    DI,4A4D  ; 2nd magic value.# }% d8 T0 I- E2 q; M: [
4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)1 E' {  C; d) S0 W, V
4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute
& ?0 M4 U1 a1 F# u# V3 |2 B8 ~; D4C19:00A4   INC    CX
5 B& ~& b% k% C5 m, ~1 o! i4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute
& j1 |/ i$ E% E4C19:00A8   JB     0095     ; 6 different commands.
) a" q; ~" X( e+ n8 N9 q4C19:00AA   JMP    0002     ; Bad_Guy jmp back.0 B6 h# E' T" O8 C) U: s5 D9 B) W
4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)% I* I+ e, j" z9 ^

# ?3 S0 ?9 @& x$ A- E/ ^The program will execute 6 different SIce commands located at ds:dx, which
: @5 y- M/ y) nare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
/ b/ D( [/ G1 e. [1 Z- w
( n5 k) P) b2 a8 y$ w* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.2 L; F% B: Y4 f5 d# i# G3 k" ?1 }
___________________________________________________________________________: O7 B; b9 }% `& }8 Y

( G7 @% L" Y2 E4 Z8 s+ l6 U4 v' K. j* L3 i0 \
Method 03* E  V2 q8 ^% f1 ]; N. z" C, Q
=========
( D" q1 G7 U0 v* w& `* b+ h; h7 |7 e7 Q8 X
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h+ m. z  M' @. T( U
(API Get entry point)' j  y, n$ u* `' v, i* U& i8 _
        
- R' O8 `& i4 z
) j! R* M: S+ \( K$ c; ~    xor     di,di, S" f5 G5 \4 ?0 T2 e
    mov     es,di
- e- p: Z5 A0 r9 G    mov     ax, 1684h      
* ?# \. [" L! o! u+ I0 q% J    mov     bx, 0202h       ; VxD ID of winice# @2 W& b' W- Z$ t' i* b2 B) ]
    int     2Fh0 B7 j0 M& `2 ]3 E  |
    mov     ax, es          ; ES:DI -&gt; VxD API entry point
3 P2 d# }+ z& y0 V    add     ax, di
; L- S* ]7 z$ V3 j7 x) d! R    test    ax,ax
$ y' B. [$ w* ^7 d) Q. _5 H    jnz     SoftICE_Detected
2 F; o* T4 B6 C+ ]
# ?5 [/ L! t+ I, h, }' w___________________________________________________________________________
# p7 V4 e& @; `% v
& f; t' H6 b( q; C$ hMethod 04
$ E+ l4 |" r! E( O$ K/ U1 ^8 Y7 o: G=========3 M3 Z& \5 c/ x
, y' B% ~3 x" a* k& [1 x1 J
Method identical to the preceding one except that it seeks the ID of SoftICE
% V3 d0 ]8 P+ H0 UGFX VxD.5 K& W7 i! F1 t5 J& D

8 I. o4 Z; z5 v' v5 d    xor     di,di. ^% Q- n" X: K" ^
    mov     es,di* h0 b# G1 L) M: t8 p, S
    mov     ax, 1684h      
6 X+ H6 h! m, T! ^: d5 J- i* p    mov     bx, 7a5Fh       ; VxD ID of SIWVID
9 f9 F+ Z9 Q( a, `0 o; j  V    int     2fh- H' I8 I# W+ ^1 b  y
    mov     ax, es          ; ES:DI -&gt; VxD API entry point& n8 H/ v1 ^. S, i* |
    add     ax, di# e% ?) n" i2 E. V' O1 f
    test    ax,ax
& r9 j% ]6 @, J1 f3 r# J3 R    jnz     SoftICE_Detected( A' ~2 y0 M& {- i& |) n& a% K
2 H; y  T3 \( {
__________________________________________________________________________
" ]) i- E& A; r8 B" O% x4 }6 t8 B

+ o. U8 L$ E% A9 ~0 z% L2 DMethod 05
0 F& S) U4 G9 @8 A=========
. ]4 C5 W. n, F) y
2 j" y. O. p  t$ F3 c/ AMethod seeking the 'magic number' 0F386h returned (in ax) by all system, w/ Q- ^# w, Z" e% B2 {- V" `5 u
debugger. It calls the int 41h, function 4Fh.
8 p- j5 F: ]/ K8 A- q# C. `There are several alternatives.  
  t! C% n& m  H4 k8 f
0 u) ?' z* f. |" K1 i% \2 sThe following one is the simplest:+ k3 H! K; q/ v! c

# F. r/ E% Z4 P3 h7 S    mov     ax,4fh0 x: z" M1 Q, g1 p) w! w3 J9 X
    int     41h
0 P$ U: l4 C' {+ `9 P% h    cmp     ax, 0F386  T6 W  m1 q: d( k1 h
    jz      SoftICE_detected
" P2 a/ y% T; X) g8 z( V7 X% Q# ^) U: S8 k) i3 s  r! Y

3 _4 A0 f: _: nNext method as well as the following one are 2 examples from Stone's
1 t, b+ Z% d$ b; j4 a/ o0 Z1 K"stn-wid.zip" (www.cracking.net):
% A1 Q2 c$ g' i9 i5 W" B2 ^5 V1 c, V4 z5 o
    mov     bx, cs
7 \- y6 k2 U/ @. r9 ]    lea     dx, int41handler2& `; u" d1 r* p! C
    xchg    dx, es:[41h*4]
9 a/ B  N5 z: r    xchg    bx, es:[41h*4+2]% I! c8 `; |' ]+ a  D" K5 g
    mov     ax,4fh9 R+ m% y4 y3 [5 a
    int     41h
+ ]* j8 l! E2 s    xchg    dx, es:[41h*4]
; M$ O. q+ ~: a- S0 o    xchg    bx, es:[41h*4+2]
/ Y" n) E6 J$ m    cmp     ax, 0f386h
, c# E0 a! }; \  n$ l& x+ z    jz      SoftICE_detected; H. R2 a" V# E  K7 L8 W

$ H8 r2 `9 {& B% k3 iint41handler2 PROC
' [! i" s3 i* q2 d8 E" R    iret
' Y( u& e# U- a- V9 f7 ?int41handler2 ENDP; `  c0 i) P$ V. U. _# ]

0 ]; c" S& k& B* h! J# @$ z% [; A* F$ P8 U' L0 U  e
_________________________________________________________________________
2 \6 C& r% N. V1 @
8 v" |% `8 p% u& S& {" K7 }. H
/ p0 J' f! f6 s) `! ~) dMethod 061 e2 p/ {" u! ?9 e, v8 X
=========- u" j7 ~! t+ j7 u7 B8 J% t
) W% X$ v. ?8 n! N
$ {# h7 ]6 m9 a  ~
2nd method similar to the preceding one but more difficult to detect:4 {& Y% E' k9 X! {( Y

) v& Q% ~+ u8 r/ K5 ^6 b  Z: k& g8 E) Q
int41handler PROC# q& I, i- @5 e- S7 X& L
    mov     cl,al  D9 ]+ q; a7 K  W5 H( G; I
    iret. _3 ]7 v/ E  i, n  F' m3 ], u
int41handler ENDP3 _3 m  I% A- l
& q% T% c9 `0 K7 G/ Z5 B- \, M

! X" E3 u8 H- s  j9 Y3 K1 U0 m    xor     ax,ax
/ t7 w# f1 ~: C# a1 }6 K    mov     es,ax
7 ], }3 z' G" s2 r    mov     bx, cs
) w! ?3 q1 v5 [2 z# M3 {    lea     dx, int41handler
; g7 f# z: }8 k5 T! @& Q: u    xchg    dx, es:[41h*4]) t. Y4 J6 K* y8 N- V* R
    xchg    bx, es:[41h*4+2]
1 N- b# o% h+ P/ d; s2 B    in      al, 40h$ I+ i$ m- Q7 s5 O$ o$ t
    xor     cx,cx2 t0 Z$ @7 _: P& t' T# I6 j( f
    int     41h
; o: z9 y8 G- G5 m1 y    xchg    dx, es:[41h*4]" m2 M5 C3 S, B9 [
    xchg    bx, es:[41h*4+2]1 |- ]1 X9 Y7 U! h% G, c
    cmp     cl,al+ w) G* f$ w8 {* k& y. N- [
    jnz     SoftICE_detected
9 b9 N4 p, \( s3 _8 r) k% Q9 ?: }3 G: c% X
_________________________________________________________________________
" u+ @8 P* n" @  ?7 G9 c/ G' N( ?0 m
0 `0 [; n, d7 Q6 A3 Q# ]  Y7 DMethod 07
2 ?  Q- c4 v/ P- |. G' s$ x=========8 k+ o3 \2 p- z. g8 D) K
4 [( h  g# `6 X' a; }8 b
Method of detection of the WinICE handler in the int68h (V86)  N+ s9 {0 c* w; N1 A3 S) M% n& @
& Y% Z) Q8 P. p* x: n; x6 K
    mov     ah,43h
: U0 b4 |! }0 P2 t' z( y+ e    int     68h
$ ?8 q$ o( H- c: @. ?" R6 X    cmp     ax,0F386h
; ?" X% ~  P1 ~    jz      SoftICE_Detected
" Y) ~; U8 j- x+ I4 T" {
. V5 ]3 A3 w: e# _6 u( @! z* V* v% v# k$ Q. X# h/ r+ A4 Z
=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
" ~6 X# X3 h( n* A, T! Q   app like this:0 E1 M. r5 a( s/ X
) y1 g; H8 |, _
   BPX exec_int if ax==68' i; D3 L; Q0 I9 ?
   (function called is located at byte ptr [ebp+1Dh] and client eip is
: _9 {& s+ t+ U5 a1 v3 m   located at [ebp+48h] for 32Bit apps), d- ]; h1 \! t6 t3 o1 a
__________________________________________________________________________
" c5 N( x6 H$ I) _& h! h1 ~
  i" A& Y, w2 T& q# B4 k! X$ @  N" b, p, c
Method 086 Q* q) M7 Z7 V; k& l6 t0 @
=========
( p4 m/ U+ D, m8 B# q. I
1 R( c  A# g" U6 F2 wIt is not a method of detection of SoftICE but a possibility to crash the4 V2 H0 W) `9 Z! e6 g
system by intercepting int 01h and int 03h and redirecting them to another
3 ?! i, Q5 w: p) ^: A1 Hroutine.7 X: A3 S9 ~  B0 N5 Y' S/ J
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points7 Q0 Z: f/ y% a5 R: T9 h
to the new routine to execute (hangs computer...)9 f( d9 Z& l9 S6 F. |0 P

  \7 i- [, M& O    mov     ah, 25h, B+ A4 u" r' c+ c% @4 E
    mov     al, Int_Number (01h or 03h)
/ S0 W! E' ]8 c# H) w    mov     dx, offset New_Int_Routine7 p0 ~9 c, ^$ j, u. F
    int     21h
+ A5 T* a+ Q( j/ x2 Y
# H; E4 e' z& r2 z9 Z# i1 A. @__________________________________________________________________________5 K: k0 c) z2 @

  R' R; ^0 @/ c( U0 @Method 094 R1 M/ `3 u5 W: p& I& _' u
=========* t0 O; [  m; }* s$ h' G& P

" `1 J& a6 Q( P+ o+ w, m3 YThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only6 |( V4 l1 e3 h6 Y8 ?- S2 K. V8 d7 u
performed in ring0 (VxD or a ring3 app using the VxdCall).
- f( I9 w- |6 L9 |" AThe Get_DDB service is used to determine whether or not a VxD is installed8 ^2 U- ~+ ?# b
for the specified device and returns a Device Description Block (in ecx) for9 w1 A; P8 L$ `$ U
that device if it is installed.
; H+ G/ O9 f8 L' p
) @% u+ t4 |0 I+ j& G; V# {( x   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID
! ^. ~8 A% V- O   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
7 K2 x$ l$ w0 n  D6 L9 K; n( s   VMMCall Get_DDB$ ~8 m/ U3 W$ T- j7 D9 R( u$ O
   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed
) [' Y! V& u4 x2 I3 R# X( ~) \" O3 ?+ u3 D  ]
Note as well that you can easily detect this method with SoftICE:) C7 ]# [3 ~+ k: T3 P
   bpx Get_DDB if ax==0202 || ax==7a5fh
$ Y7 E' m) I2 U$ C4 v* ?. h6 t3 M
: }# d! O6 d) x; X# F__________________________________________________________________________/ o% k+ w6 F- ^$ G# }

9 x2 p8 {6 s! w1 p! Q9 _( W( GMethod 10' A: b! S# u; o, [! e9 ]
=========& A! ~3 e4 T+ G/ O/ c( P( ?5 n
% j- T/ T% U: ^; o2 X, G) N5 O* P
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with
: r4 |- K9 L0 y7 m4 q0 |, n  SoftICE while the option is enable!!6 a* H7 U  V) x7 B7 O) m- ^

5 g. L' }! B) A! hThis trick is very efficient:
4 L, Q8 H; f' tby checking the Debug Registers, you can detect if SoftICE is loaded+ l% N# m% v( k' t- Y. A
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if+ F  q1 {* }% M2 f% f& [
there are some memory breakpoints set (dr0 to dr3) simply by reading their3 j( |3 h. F# K- Z% i' g, \/ Z& j
value (in ring0 only). Values can be manipulated and or changed as well
* y6 b' n# V! v2 M% k(clearing BPMs for instance)
: Y2 t6 I, ~6 J) p
" W' D9 w) E( |8 u__________________________________________________________________________
. E# ?( m% K3 G' R
& I9 t2 n$ O3 U2 t  F0 v) z7 yMethod 11
% Z5 _% {5 ^! ], z- T=========
, T% ]8 V5 W  }6 _' w5 u. c4 u* K, {) e  J
This method is most known as 'MeltICE' because it has been freely distributed, O: b, G/ g  H1 V( s
via www.winfiles.com. However it was first used by NuMega people to allow
7 l/ {5 M. j, C8 c3 A8 Q' hSymbol Loader to check if SoftICE was active or not (the code is located
/ n9 W+ B/ j, o9 X, Q8 ^  Winside nmtrans.dll)., A$ n- ?4 h' V
3 t1 {6 i, @( v4 L4 U( E; J
The way it works is very simple:! m* e/ A1 B& T+ y% [7 x, z9 {
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
1 }/ x& \4 l- K( F) c: V1 VWinNT) with the CreateFileA API.- v9 W( b& \, Y" D" j
4 ^3 Q! K( S$ w: G; |; G
Here is a sample (checking for 'SICE'):
) H5 q$ T. ~# b/ C" K3 A: |2 T7 `7 j+ F: s( S; X* c
BOOL IsSoftIce95Loaded()
- s3 e6 U. @8 ^4 u! @" k{
1 S! O& ^6 h  S* ]2 ^0 D   HANDLE hFile;    {4 _  Y" m+ c8 E% E( W
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,; r+ A4 B$ A0 @2 R% Q* ?* z' c4 W0 |* v
                      FILE_SHARE_READ | FILE_SHARE_WRITE,. J  x4 ]  Q+ K  `5 F5 o6 _
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);4 [) R5 P8 k) }
   if( hFile != INVALID_HANDLE_VALUE )" |9 z0 `- r* Z
   {0 {7 i; g& _- f4 s
      CloseHandle(hFile);
" j5 K2 [4 G$ d5 q, S6 n      return TRUE;9 Y: W( u7 C; v
   }2 P0 g3 x% b/ g/ x/ n
   return FALSE;
6 j6 O! p1 r0 I$ r7 a( {}
$ P) h) D" S- H$ \4 T8 l! X& s' L+ O& @+ C( B
Although this trick calls the CreateFileA function, don't even expect to be1 @* ]2 `. o3 [4 G% N
able to intercept it by installing a IFS hook: it will not work, no way!$ y% X2 N; k$ u) p0 `4 }
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
2 ~; D. d, F5 tservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)3 v# [  o1 C6 U: i: [
and then browse the DDB list until it find the VxD and its DDB_Control_Proc8 ^  [9 l" e, P+ F' m. f; q/ ?
field.
$ `: F2 ]8 U7 ]9 `; P9 ]8 @5 uIn fact, its purpose is not to load/unload VxDs but only to send a
8 S) j" h6 n" M; a* ]W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
7 d) I% A) q* _. u  `" B" \to the VxD Control_Dispatch proc (how the hell a shareware soft could try
% e/ D# g' V; x# N4 ~, x* j6 [to load/unload a non-dynamically loadable driver such as SoftICE ;-).: s1 `" |9 p* g( X9 U1 f! I
If the VxD is loaded, it will always clear eax and the Carry flag to allow3 ~3 q' L6 n( _7 L7 ]. S
its handle to be opened and then, will be detected.
' n! g" N1 T7 c1 @, DYou can check that simply by hooking Winice.exe control proc entry point5 z0 t! O- m' Y9 w, ~
while running MeltICE.5 k% L+ f. C8 P" I3 }
! L! T3 o5 q7 f% V

% {; q. o3 ^6 M8 y" O+ j, r  00401067:  push      00402025    ; \\.\SICE. ?* k0 D+ Z/ S6 [0 ~
  0040106C:  call      CreateFileA
7 V. P* f! c; Z6 W  00401071:  cmp       eax,-001) R; ], R( M( z/ C6 t
  00401074:  je        00401091
/ d; M# e. C; m6 i& X8 d  z: _+ b

" Q8 h  u: M$ r* j  K; n$ ]. z; _There could be hundreds of BPX you could use to detect this trick.3 \6 X( R" d8 a1 [# L
-The most classical one is:
* P1 F+ V( |+ D* J  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
9 }5 A9 ?9 K# a/ a3 ]4 ]; t# _    *(esp-&gt;4+4)=='NTIC'0 E) z' S: N8 F

  u* M* b1 @( X3 U" t-The most exotic ones (could be very slooooow :-(, \1 ]* i' ?: ?  F* S( ?! p
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  : f0 A9 o8 Z) M, ]4 p- I) c" s8 I2 a9 ]
     ;will break 3 times :-(
6 x6 I! q8 N4 v; s% t3 Z3 I/ e$ }3 F2 l: T3 X, T" }
-or (a bit) faster: 7 v/ A5 W6 e0 ]) V. K5 Q
   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')% j) s& L- N. ~+ _/ L; P4 C

* q. H' B4 c" g+ h& V! o* g   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  . e2 |; T% |. O6 x9 \% t7 h3 t
     ;will break 3 times :-(& u5 s% k$ ~! h
7 N6 X% f& C5 W6 u
-Much faster:0 n& P3 I% j( F) y" s% h
   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'4 t! S' Y% Y) _  V' u

) U  h+ u3 A# R/ R7 z, KNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
2 V. o  D) u) l% [. K. Nfunction to do the same job:
. S, C2 U. s" b# {+ u4 Y5 R& Q9 ^: A$ x5 X% S9 i, L  J
   push    00                        ; OF_READ$ V5 N3 W. H7 U1 [/ \& L
   mov     eax,[00656634]            ; '\\.\SICE',0) W: Y7 a3 g/ b, N- ~5 _
   push    eax
+ t( x6 j6 q1 Q5 v   call    KERNEL32!_lopen
6 s. L0 o' v; P6 G& \2 C+ u! H   inc     eax. N0 _( P! Z; B7 o# I! L0 [/ o
   jnz     00650589                  ; detected
$ f6 T' o+ L! p+ h   push    00                        ; OF_READ1 R( `! q7 Z3 Z' y
   mov     eax,[00656638]            ; '\\.\SICE'
5 Z" ~2 {# y$ k8 k. A  k8 [   push    eax
7 Z2 |% O9 ]$ W) {+ S+ f  m   call    KERNEL32!_lopen
* H& i; i' U5 l+ K   inc     eax
' M' j# U$ e" z/ v! |( Y! ~   jz      006505ae                  ; not detected. Q/ I) R4 v6 w# [+ ~6 g5 D2 m
( X3 i3 I& _: h7 K1 ^. h
6 i, w7 A2 G# n) K4 g
__________________________________________________________________________
9 D0 ^( {8 E0 I- h  R; @% A/ T' c, \( n3 n0 x, M3 t6 a
Method 12# y, @1 @& k; v' r  d# I
=========
9 G" V, H6 m! x( B
. Y- ~" @, s4 M  E# xThis trick is similar to int41h/4fh Debugger installation check (code 050 \" ~9 n+ U# p6 [) v( o7 M( X
&amp; 06) but very limited because it's only available for Win95/98 (not NT)
! z. }6 d7 v' Nas it uses the VxDCall backdoor. This detection was found in Bleem Demo.5 S3 k8 w/ M1 H) d  ?

' _. H( t2 F2 x, g! U7 x   push  0000004fh         ; function 4fh% w& P  X2 \& D6 L7 r
   push  002a002ah         ; high word specifies which VxD (VWIN32)
! ^& C" F* q) H$ d                           ; low word specifies which service' `, J( e0 x8 Q& y6 i
                             (VWIN32_Int41Dispatch)
# J+ @! r9 `! o$ n' @  |   call  Kernel32!ORD_001  ; VxdCall8 P" j' w0 V* d$ N6 P
   cmp   ax, 0f386h        ; magic number returned by system debuggers
2 p1 e, ~/ }& i. e   jz    SoftICE_detected5 m2 q0 {; c" ]: q/ O! C% E+ ?7 f

( w4 c4 N1 q! r0 q8 eHere again, several ways to detect it:2 z" ~& T' |* [. h. K! `, u7 y

- w# y3 D1 [) m8 Z- p5 U3 k0 h) U    BPINT 41 if ax==4f. ]+ ?( B* v+ M0 t1 l7 D7 k7 {

, }. S" a, M# y' k7 V5 ?. u; y# f' g    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one) _" L" E, b' U$ x
/ y2 {4 B6 Y' d0 h5 R+ o
    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
/ {8 D- C0 A, D6 `9 \7 S" R
$ ?# ^' ?% E; M& G& i    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!
) }/ P4 k1 P: P' N7 O0 k3 b4 \+ k
__________________________________________________________________________0 n2 B8 f- z7 Z6 q6 M
! h/ @" z2 ?% `' E+ ]' l' {; ~& \
Method 13! o3 }# _9 b- ^6 ^- p+ X5 R# _
=========* c! s* D7 z  R! X6 R/ Z

& c- A2 u! m- a5 g* HNot a real method of detection, but a good way to know if SoftICE is, m9 G5 @) S; O# {1 p. ?
installed on a computer and to locate its installation directory.& E2 [- S1 S4 K- U. U- r% b7 Y
It is used by few softs which access the following registry keys (usually #2) :
/ C5 [9 W9 b$ y" t% t& a
3 P* ~4 Z. h' m7 Y-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
. g4 \. `7 m( U( d* X\Uninstall\SoftICE5 P: s& x2 c, ?' S* C8 s2 S
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE4 S' F( o6 r3 e$ V. r5 G" H
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
  X& m+ z+ o5 Z) R# x\App Paths\Loader32.Exe
+ S# G. s% C2 J+ R5 `* W( W% C
6 t9 O& k% }6 f
7 a/ Z2 a( Q2 [& a5 D! j) \1 VNote that some nasty apps could then erase all files from SoftICE directory
, P( r. [- N5 h/ I3 L- H) d( ]# h(I faced that once :-() D; s8 K9 H9 n3 K  y) f0 T* E# ^
2 u# P8 {3 k( ~( A2 m- x3 D- P5 N
Useful breakpoint to detect it:5 E% {, Q- J; B+ U  z& b- [0 V

$ F  H6 d3 a1 C% U     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'+ c0 i0 x6 d2 k( X4 }3 Z

, O0 v! E+ S+ _! [0 {5 }+ l  M- a__________________________________________________________________________
8 K) k9 ]; Q/ `3 X8 {/ Y4 J
8 Y8 G3 }  m" s' L: l" B. t6 b: x# g" M. a4 f
Method 14 , D: v* j1 i1 {) W. S; l# Q, `8 u: _
=========
' z  L% n% R0 ^' e0 ?/ r( `
* l4 G: R  T$ B  A, _A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
+ B% F; G/ Q9 Q4 P! r+ Dis to determines whether a debugger is running on your system (ring0 only).
$ y0 z4 c. t4 N" r+ o3 ^3 @, {% ^" y
   VMMCall Test_Debug_Installed( d( e3 y# t6 W8 U' h; o: V
   je      not_installed
; w4 q7 w( h( L0 ~$ O, |" \) e% r4 ]" i& V, v& u
This service just checks a flag.
" G, z" i9 O) e</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关注公众号

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

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

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