About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>( ?$ X! {2 \' p" f5 I$ P
<TBODY>
/ Z% G; |, w6 f# \) \/ z<TR>4 W' o2 J" T( I; D* o
<TD><PRE>Method 01 1 K. q: Y7 E) E2 ^9 X6 b0 H% s
=========' t' G" ?. z: w8 M; K
4 U0 N6 _* z' O
This method of detection of SoftICE (as well as the following one) is
$ I! ^6 R9 K/ L5 U/ E3 nused by the majority of packers/encryptors found on Internet.2 G) \( [% B- e1 A) ]! @: J
It seeks the signature of BoundsChecker in SoftICE3 \" h$ R  n9 N
7 I# |1 i' @/ [
    mov     ebp, 04243484Bh        ; 'BCHK'. x# V6 G" {( \- K! M8 D. Q& g
    mov     ax, 04h' \: ]8 Y1 o) D* E2 B) Y  p
    int     3       ) b4 H2 M# j6 q7 \; ]7 u
    cmp     al,4: z0 ]( {" m& w/ r( v
    jnz     SoftICE_Detected
  y% l. i$ i* ~' Q5 p, d* @: N- h: }
___________________________________________________________________________3 z0 `( B  r' Z/ Z# ]# Z$ P

6 v' }  R6 G) J0 r2 H7 WMethod 02
2 N9 o( r$ W+ q! Z6 U0 [5 C=========
: ?# K" Z/ F$ E9 {) E$ H& {; b+ S7 A, f+ u! C: B9 k
Still a method very much used (perhaps the most frequent one).  It is used
# J( s6 p( W* \to get SoftICE 'Back Door commands' which gives infos on Breakpoints,/ ~+ w7 k& w9 ~- C* |
or execute SoftICE commands...
9 A! q& E+ c6 D" m- \$ n8 N# v& aIt is also used to crash SoftICE and to force it to execute any commands1 X$ ^. u8 Q$ c( u) R
(HBOOT...) :-((  
) k( J6 f. V+ F5 u
8 k& _, O8 p; Y- w; _- I+ f3 a- ?Here is a quick description:5 Y2 P# Z  Q3 L; t  k! {7 k/ p4 u9 K* P
-AX = 0910h   (Display string in SIce windows)
+ }, E1 z3 d0 b: _9 c-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx), p( S, P. _  b8 H3 V0 I
-AX = 0912h   (Get breakpoint infos)
/ Q2 [6 s  g+ D* f+ B& }% a( S-AX = 0913h   (Set Sice breakpoints)8 }8 |1 i8 Y. L' y8 O  I
-AX = 0914h   (Remove SIce breakoints); Z0 ~2 S! {  b9 y1 i( n2 z6 |
# @) E0 u. X( m3 O' T$ o" O# N
Each time you'll meet this trick, you'll see:
$ X9 U$ |& h9 ?5 n2 U-SI = 4647h
  ?  A/ y# H" K& h# e$ d2 n-DI = 4A4Dh4 k7 n& ?8 R9 s) m1 K1 w& a
Which are the 'magic values' used by SoftIce.
, n$ M  F$ }: d: e5 ]- DFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
, i4 a; l# L; S$ z1 c" }* |8 {' o3 L, c7 c
Here is one example from the file "Haspinst.exe" which is the dongle HASP
4 }( B: Y0 ~: S3 o1 G( N+ {$ OEnvelope utility use to protect DOS applications:
2 m  M: }5 k9 ^" a6 g! ~, q
4 @3 N4 ]1 i  Y! E5 e9 M; F: B: {6 ~% s: r- X, D3 F/ P
4C19:0095   MOV    AX,0911  ; execute command.! G- ?: X3 b/ U0 ~8 W, s
4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
( r: H9 i% q4 N( c4 l4C19:009A   MOV    SI,4647  ; 1st magic value.
1 J# N- f- e* O8 G# V6 t4C19:009D   MOV    DI,4A4D  ; 2nd magic value.2 r3 [  i! S5 z3 V
4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)( w* M* G( ^/ v$ ?, ]; p
4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute. q, d+ s2 j1 Y: G0 f  V
4C19:00A4   INC    CX
1 n9 a( [" a5 Y( q6 p& A4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute3 R; j# o% ^  t- B$ t5 q- F
4C19:00A8   JB     0095     ; 6 different commands.
1 ?3 G  D( M0 T8 V* P' j4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
4 m3 X7 r; S; D6 D$ T- x4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)  z5 h' `+ i8 J4 P1 P

+ B) i, N( P9 L5 }* v+ s( [The program will execute 6 different SIce commands located at ds:dx, which
' a% g) s* _2 h' Gare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.7 U. l! r% y1 K) X7 J
  Y8 K+ j5 K9 ~7 I- {3 t
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.1 s  {& Z, v7 P1 Q$ p
___________________________________________________________________________9 v. H% k- f3 |
: ^# X' X$ e( ?1 T- f

7 I2 {" l! K. B% |: A( y4 d0 DMethod 03
1 Y# i& z7 T- Q=========* B+ I. x' H5 E0 A% g
' v7 l: i: o* ]5 k% G
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h" C; G# q) J( U( T8 S% f8 N
(API Get entry point)
" H' M+ X; x/ \8 D        
0 S+ ]1 a0 y, V. [' T) S( t& [- M( J
; D3 \. D* L6 O    xor     di,di
$ P! z, I. q; E5 j" \    mov     es,di
) H3 x& h0 x& {+ A, L' q    mov     ax, 1684h      
0 p$ \0 ^; g" Y3 P    mov     bx, 0202h       ; VxD ID of winice
( p; O% @4 ~! j! h0 U    int     2Fh' w% F1 I" k8 m
    mov     ax, es          ; ES:DI -&gt; VxD API entry point
" u: t& B2 R6 q1 w; R! J  S    add     ax, di1 u/ W( {0 b& E+ u* q) W
    test    ax,ax
; v8 |: H/ F5 i9 y# g7 c    jnz     SoftICE_Detected
, {0 x* {8 x* s7 P1 p3 N# M' o, ~" I+ |- ]- V+ S& u0 `# v
___________________________________________________________________________
5 H) k' |* z# G& J' r4 {. a
' l3 y' \* _3 cMethod 04
! {/ q1 j! M, a. H4 }=========9 Y8 P/ u" Z& d) m# G
. Y$ a9 I. ]) ]+ y  c
Method identical to the preceding one except that it seeks the ID of SoftICE* |4 V) J. _3 F% A8 i# N
GFX VxD.
; Q8 p, A% V- N- A3 n! U+ R: x9 Y8 [
    xor     di,di% \6 F! B' U2 }: u" x% `9 |
    mov     es,di6 E+ \: v' S+ ^
    mov     ax, 1684h      
' V5 `  B  u6 a7 _/ H& k, d    mov     bx, 7a5Fh       ; VxD ID of SIWVID- }% I9 T; R) i* V7 E& U
    int     2fh9 v  T! x; @; O. J2 b
    mov     ax, es          ; ES:DI -&gt; VxD API entry point
: R  S% R  y( s( T% P# w3 q* J    add     ax, di( ?3 j& F4 E0 O$ p5 K% l/ W
    test    ax,ax
: _4 @# r0 n3 H8 L: }6 {6 @8 |    jnz     SoftICE_Detected) C0 C5 N& j4 B& b
8 J% h5 w5 L6 R8 _1 w
__________________________________________________________________________
7 E4 v& T4 a. E4 J/ [
9 `8 b: ^- O3 [) O# n; ?
) I6 H+ Y; J* Z! aMethod 05  _# b& z- R2 l- _
=========
& m2 w, y. q  u& ^5 q# y* O
5 o; V+ \% L! r3 ~Method seeking the 'magic number' 0F386h returned (in ax) by all system
* e" ?' w) G% S- M6 J6 cdebugger. It calls the int 41h, function 4Fh.& ~1 Q8 ^3 B% |7 T9 T8 ^5 r( N! h  P
There are several alternatives.  
% J/ E( o: |$ L
4 @; \  h% H5 M  ~6 Y! uThe following one is the simplest:6 `/ [) ^* `2 F$ h
, P( z" x9 f3 R! x# S' j
    mov     ax,4fh$ O8 \+ w/ M) O: _1 ^
    int     41h
9 }0 P' @2 ^5 `4 _    cmp     ax, 0F3861 p# Q5 ^6 p: I: X
    jz      SoftICE_detected
: |3 @7 R& b0 n0 J5 ^
+ f, `/ J1 z1 X- n
2 _- m. M# _) l2 ^8 RNext method as well as the following one are 2 examples from Stone's 5 M! c) v2 h, p- K0 B, ?
"stn-wid.zip" (www.cracking.net):  B1 a" `! b2 s' F3 ?4 M; {9 c
6 p$ P5 D# V4 W' X" u% F
    mov     bx, cs' u  G. f; c' Q( }
    lea     dx, int41handler20 Y0 Y1 `* l: x
    xchg    dx, es:[41h*4]- s- [) u5 d  a9 y
    xchg    bx, es:[41h*4+2]
& h. [0 P  f9 Q6 K& |' H5 e    mov     ax,4fh) M2 }- X% [; z, i
    int     41h
3 ~; R# e* B  E- ^* t2 _; A    xchg    dx, es:[41h*4]
2 k9 J& M: [8 p. t5 B    xchg    bx, es:[41h*4+2]
( f9 [+ |4 ?1 K8 k& _& t- [    cmp     ax, 0f386h
' o0 o( _! K6 i# N( {' z7 }  y    jz      SoftICE_detected
) J; m7 G1 n( T$ f7 x5 G0 Q
( Q/ O* q; D- y+ F7 n; K- Zint41handler2 PROC: f1 N* \8 i# }; U+ k
    iret- W" i: f4 v' N9 l+ c" D3 H3 T
int41handler2 ENDP
' p" Y3 H/ p, r. G, _
7 Y( I" s5 \7 X! k$ V# R* d
; p7 C3 w( ]8 `* ~_________________________________________________________________________
% W, L3 M! q7 c2 h$ k+ Y: K$ Y) j8 |/ A; d) ^
! L5 ]# p# |! |
Method 06
3 l8 V7 i7 H, e, O) q! l4 s) n; U7 D=========6 m  T1 {3 a1 g3 d# V7 G

( r( H+ T+ Z& w( u; [
2 o0 I9 h; f+ ~2nd method similar to the preceding one but more difficult to detect:9 c8 U/ j3 B6 r' r4 M! A8 ?- j3 x- x
9 g; J7 K5 f1 G. ^) R4 A& F; M) [0 }5 Z
# W9 Y, m7 e, R) Q
int41handler PROC
9 b8 H( ~' }* N: l* B) [* Q8 ]- ~    mov     cl,al8 K0 h; o6 Z3 k3 c% h
    iret8 Y0 a, T: M; u4 K9 x
int41handler ENDP; R7 j- I4 }2 j: K; T
/ \8 o& r- X' B/ H9 N! G
) T/ l# ^2 G2 X9 Z
    xor     ax,ax
0 e' J" x, \" b, C! v* F0 I    mov     es,ax
, |( q) ~5 m, @" f' A8 Z    mov     bx, cs0 S. l  n% Y( W+ w; n: l
    lea     dx, int41handler
0 E' n% z7 s, ?* Z1 o' x3 K. F    xchg    dx, es:[41h*4]
1 c4 A2 p" L* b3 |! s( C    xchg    bx, es:[41h*4+2]( j" s7 L0 q$ s/ _$ m; r1 q8 y
    in      al, 40h
. R0 k2 ~7 \0 a$ j. u0 _    xor     cx,cx
- w* @8 |4 V* f5 q7 e    int     41h
4 G# Q; c0 ?1 g" B" _' U    xchg    dx, es:[41h*4]2 j5 q" k8 U* y
    xchg    bx, es:[41h*4+2]$ f- ?7 k$ E' N, B' Z
    cmp     cl,al! b' A; _4 n) I" F7 [/ Z
    jnz     SoftICE_detected
4 \! d, w  l& {
( }7 u& s% ?' E2 A3 Q9 B_________________________________________________________________________$ E9 e& V3 ?& p; a

0 H  h  \5 v( E) h' hMethod 07
1 l+ H3 ]& J0 _3 W=========
' `( [+ M" E1 D! X
- Y2 v$ R1 F& w. G. G- ?Method of detection of the WinICE handler in the int68h (V86)) x, M6 G. x: W$ \% n

1 D) k2 t# k# M5 a    mov     ah,43h
7 `' D  v* a+ M" l2 B$ ?9 r    int     68h
& H  e% B- @: E3 ^* }: ~1 R    cmp     ax,0F386h
  E( P6 O( @- }/ U% g9 S. ^    jz      SoftICE_Detected' h* y, q, t$ t. S: K* w

* l8 t2 E3 x$ x7 J  T  {3 @  g0 n% B% h. ]3 |
=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
9 x) q! n% X+ T+ V" H! e   app like this:
& ?: C6 O( N2 r2 J" y5 G
' Y( W# t! q- _  f- m4 w: B# a   BPX exec_int if ax==68
9 y! o8 s8 C( L$ e9 n   (function called is located at byte ptr [ebp+1Dh] and client eip is
2 Q* m' M6 w5 d( n3 u* {  y   located at [ebp+48h] for 32Bit apps)
. _  v9 U: K: ^$ Z+ S) k__________________________________________________________________________
2 I9 n. l0 r, d  ?9 ^' @( h+ t! r( ^8 t% p2 \! p" l/ u5 ^

3 Y' m# h* J5 X: r4 T0 nMethod 08: o1 l/ p. y# P
=========
1 U$ q7 z/ G( v+ v8 R
; Z  J9 W/ c5 s! e* J( t  _It is not a method of detection of SoftICE but a possibility to crash the) n# X; c, B3 j4 `
system by intercepting int 01h and int 03h and redirecting them to another
8 t, `( \! w8 ^% l8 |2 J+ A% proutine.
& ?7 B) C1 u, N2 U4 iIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
( T! X5 _- w3 c, D2 }- `' [to the new routine to execute (hangs computer...)1 k+ l# s5 o- g/ r) b
5 M/ Y" D% C9 }. s% b& s9 S2 v* l* f
    mov     ah, 25h
1 R' l  s) g9 X5 ?" g7 q    mov     al, Int_Number (01h or 03h)
- R# |0 E( B0 z# w" |! r: i    mov     dx, offset New_Int_Routine1 R3 x, G& e5 Q) Y/ t) W
    int     21h+ O3 h# B  J3 H/ o" m, J

* V3 N) ^5 X7 z__________________________________________________________________________
  U0 h9 [6 w2 |7 c! s# v; o0 Y$ o8 k
$ [3 A' L; D9 M$ j' F  c% N/ |5 gMethod 09
1 `, Z$ a' d+ U- u1 V=========# ~! t# }% \- q1 \  f' h3 W

$ S8 l: e- y( c4 v6 s) PThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
% w5 r7 U, _  x; S, J8 b; V- nperformed in ring0 (VxD or a ring3 app using the VxdCall).0 }- V$ K1 g# ~& s8 C) f& k! o: Y
The Get_DDB service is used to determine whether or not a VxD is installed
1 u/ p9 g4 r; N6 w/ lfor the specified device and returns a Device Description Block (in ecx) for
6 @2 c2 n, h8 I% g! Kthat device if it is installed.
2 G  p! I3 _8 C& G0 A2 U+ e- |! n0 b6 ?. F) m+ T
   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID( r  X+ P7 O; h5 e
   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)% `0 u  |1 S" _9 H; I2 c; B
   VMMCall Get_DDB
* f" q2 b5 ?5 A1 X! ?8 Z$ O   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed6 B2 S! g5 h1 k8 r" |, I0 o3 t

. n  K  C5 M! q, sNote as well that you can easily detect this method with SoftICE:
5 Q4 p" S* r+ D) y/ y   bpx Get_DDB if ax==0202 || ax==7a5fh
7 l# }9 f' b* }2 T3 W  h7 y6 L) I$ ^5 J( Q& A( }4 r
__________________________________________________________________________; X+ o+ e7 D2 F! O
5 {5 B1 c' t# d
Method 10
: {+ q/ S) b2 e" Y4 a=========
- M7 g+ E& Q1 j' @# R) Y; J, v# P( j" [; {/ p7 o
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with
7 O1 C, V; j2 `! C4 ]" V+ t  SoftICE while the option is enable!!
4 Y6 ~( y( M  y  w6 ?" L
8 U1 t" u# q! Z; |4 K" k/ o' c( eThis trick is very efficient:
% i) X% M; f7 Z2 q/ \& m( A- aby checking the Debug Registers, you can detect if SoftICE is loaded( `, B9 ^, k" X, Z/ C8 M8 `
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if9 m3 ]: t' J' }. O
there are some memory breakpoints set (dr0 to dr3) simply by reading their
. W; s. v% L4 f. X6 \2 Hvalue (in ring0 only). Values can be manipulated and or changed as well# t/ t4 I5 `# H5 r: }9 O2 ~8 r, q
(clearing BPMs for instance)
$ L/ y, I3 _% s) S7 q4 e4 ?5 R5 v: Y' B9 ~( O
__________________________________________________________________________
- L+ }, I% F) t: e. U0 N& Q* v( j3 H' O
Method 11! `, }9 |7 X' W* u* F& D2 [
=========& X5 N4 U+ T2 X
  ?) T' a$ C7 ^5 N! |
This method is most known as 'MeltICE' because it has been freely distributed
9 }8 D7 l0 H7 t- jvia www.winfiles.com. However it was first used by NuMega people to allow
6 }+ H8 X+ S" y6 e. q) lSymbol Loader to check if SoftICE was active or not (the code is located
# F/ |  g* `3 u: e: finside nmtrans.dll).
" ~" t& z8 b/ {6 e; V/ c. ~# p4 |2 U
The way it works is very simple:: V* h2 R$ O3 [9 O. W
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for6 s% d/ y/ {; B" x; J% ~
WinNT) with the CreateFileA API.4 s$ H8 C3 q# d0 x- o' L* x

; Z: D# u' B# F" N$ ~( gHere is a sample (checking for 'SICE'):
' E* u, L' r+ [! `4 P5 R8 V2 t* ~8 ]1 s
BOOL IsSoftIce95Loaded()* s& ~) B% g( Y& l' }
{& D( d1 ~" z2 C7 J
   HANDLE hFile;  . _+ F0 X. n8 ^1 A# |
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,$ e, B8 K6 X1 I
                      FILE_SHARE_READ | FILE_SHARE_WRITE,
) e5 F* n1 E) s2 s9 f; ^                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
; h, @; C/ p' d# o; p   if( hFile != INVALID_HANDLE_VALUE )
* h: C; R  J( A3 S4 p/ j2 z   {+ f) g5 E( y5 N" h$ C. Z
      CloseHandle(hFile);
. m& _% j9 }# E9 w) ?      return TRUE;( s3 a! @% k5 P9 }* n- _2 D
   }2 ?9 a& U. y, u
   return FALSE;
5 B9 `4 @& e3 h' w2 M  w- B}9 d8 f2 n, b  b
  ?$ Y- A% d8 ]# _/ \
Although this trick calls the CreateFileA function, don't even expect to be" ^* \1 s6 j& `3 h, u3 a
able to intercept it by installing a IFS hook: it will not work, no way!
0 j/ h6 F9 u  ?In fact, after the call to CreateFileA it will get through VWIN32 0x001F
9 K- z! B# r! Q# ~: F3 E0 C8 Sservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)% r" t' }( n4 M$ w4 o" f6 R$ z
and then browse the DDB list until it find the VxD and its DDB_Control_Proc5 T, u0 @* e+ h1 T( b
field.
" [6 u9 t6 e; F! C( o* f0 p3 t. ~In fact, its purpose is not to load/unload VxDs but only to send a
5 G; q1 x) t2 Y& QW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)4 B- J7 c- j, o- V! ~. a
to the VxD Control_Dispatch proc (how the hell a shareware soft could try1 Y0 ]  r7 n* ^
to load/unload a non-dynamically loadable driver such as SoftICE ;-).  k6 C3 d6 _4 T* W+ H: Y$ |( C) w) J
If the VxD is loaded, it will always clear eax and the Carry flag to allow; b0 e6 p- G- p* D* r) H4 _
its handle to be opened and then, will be detected.
9 I  N* A  M) I, {% vYou can check that simply by hooking Winice.exe control proc entry point
2 T- r+ E1 n: {9 M1 a$ dwhile running MeltICE.# V" Y6 a% ?# O& D
" j( e8 g% ^: m. Z

0 Z. U  S- G0 |1 U  00401067:  push      00402025    ; \\.\SICE2 d, o* a. r3 h7 c( x9 z
  0040106C:  call      CreateFileA
* n- L4 X5 P( G$ e) G+ B  00401071:  cmp       eax,-001
; D, c0 {, G. _2 q- y$ Z  00401074:  je        00401091
* I' E5 N3 g# X) j: j" w5 V. ?$ `# G, r0 `/ U6 j& J
0 m3 ?% \; a4 \; G1 e8 |  y
There could be hundreds of BPX you could use to detect this trick.8 V; Z2 D  u. n" [
-The most classical one is:
% p. e3 D1 n/ G5 R5 G* e7 _  ~  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
' ]  f0 f% v: p3 j1 `, L    *(esp-&gt;4+4)=='NTIC'
8 v8 a% ?$ a9 y9 o. {9 D
8 r% z+ j7 e. h-The most exotic ones (could be very slooooow :-(
9 Z: p5 W6 T) _: w$ j7 t, D. S   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  
8 Z0 V3 m# H! z8 k8 m- ?     ;will break 3 times :-(# H& B; e: ~' h2 |) {0 s, N( p  m

7 b% d1 z3 u% @8 Q+ K8 g9 G( H-or (a bit) faster:
+ V; p% y6 `2 h   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')7 L! T9 Y3 P$ p7 }$ C
2 G& `% [+ Z  T# l& m
   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  
7 p! |+ e  j9 R  L: o     ;will break 3 times :-(
8 T, o; g5 G  {1 |
5 m4 E" ^) w( B1 n! R-Much faster:9 s6 y$ L% N. J) z2 B: v  Q9 J
   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'+ j& B  G- r; H$ V2 L+ J

' m* j( K. A" U: H+ r3 GNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
0 u) t2 Q9 W0 {* bfunction to do the same job:5 e6 N! {* _4 P3 O9 q" x

9 Y" @2 J  V: g7 s% D   push    00                        ; OF_READ% I, @$ [* [: P6 u' T
   mov     eax,[00656634]            ; '\\.\SICE',0
+ H1 H+ K2 x# @6 f: Q3 T   push    eax
+ i% `# e1 |' f8 I   call    KERNEL32!_lopen
8 [! x6 q! R0 _2 s5 N   inc     eax" a9 H! l/ y2 t  y1 r/ R! n! E
   jnz     00650589                  ; detected
$ T) G* @. }9 W7 ~3 A   push    00                        ; OF_READ1 O; m$ j+ X/ G5 ]- J% |( M
   mov     eax,[00656638]            ; '\\.\SICE'
# i7 l4 G# |! {" |   push    eax
* V% }7 O( x! w. H   call    KERNEL32!_lopen
' H9 ?  x0 A1 X6 O$ _: l: |9 b8 r; x   inc     eax
" L7 b0 K* W# z) g1 K7 z' s" `  i  p   jz      006505ae                  ; not detected) ]8 Y: v: x& v7 J# W0 \

& S5 E0 B  ^5 {) H% m8 A/ r' @/ p
__________________________________________________________________________& I0 M4 G/ g) y* Y
5 Y; H" B- {! t8 l  k6 ~
Method 12
5 C: x* b2 x* m2 M5 a=========
+ Y9 C1 b3 F7 n& A, k+ C2 J- O) i  E; I3 E
This trick is similar to int41h/4fh Debugger installation check (code 05+ t' {; I/ _# c3 G
&amp; 06) but very limited because it's only available for Win95/98 (not NT)
. P3 @9 [8 s, T2 Was it uses the VxDCall backdoor. This detection was found in Bleem Demo.' J% D) z+ h+ n! U3 L! t2 S( h
& F4 _2 d. o5 R$ u8 j, c1 |
   push  0000004fh         ; function 4fh9 P9 J& M7 p' F- ?. o  I
   push  002a002ah         ; high word specifies which VxD (VWIN32)- h7 E0 J. w* {
                           ; low word specifies which service
: Z, M3 V; j. G: X                             (VWIN32_Int41Dispatch); j: U3 g/ _+ i
   call  Kernel32!ORD_001  ; VxdCall
$ v) r3 M* E9 ~* y   cmp   ax, 0f386h        ; magic number returned by system debuggers
6 j& X+ U2 @5 c7 Y0 ]# f   jz    SoftICE_detected" F. \, j; i# ]6 t8 X+ O, r6 Q

, O1 N6 }- x- b9 C1 f2 T, _5 x2 AHere again, several ways to detect it:
8 @2 G7 j: K  g6 p1 P0 @
. t* V+ I% r5 C    BPINT 41 if ax==4f
3 z& }* [  F2 M: ^- l! L
! Q# B& k; L1 W1 F, \- z: z: H    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one
7 U1 ^% |% r2 q
' l* I. `% ^- ^9 h6 s" n  b, \    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A1 W8 ~9 G, ~4 C) m5 T0 I

8 f" |; A  H9 {, j# p" n: L1 ^    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!
$ \5 _- \5 {& W. F# a& b- e, }# r; A0 R7 ?
__________________________________________________________________________
3 w  a: t4 c, W1 A' W# n8 A5 N3 q2 a' A) i* G/ A7 U. {8 \
Method 135 d/ e. ~+ n  d# A
=========
- j# o4 `6 H! g1 I6 ~5 o3 F
7 @1 m- P6 z, g+ H. T! P) {7 T4 dNot a real method of detection, but a good way to know if SoftICE is  G* c& E# N& [
installed on a computer and to locate its installation directory.
+ {$ B, C0 x" f9 i. o1 h! VIt is used by few softs which access the following registry keys (usually #2) :  i6 s* L8 S: U8 G7 V' c! F

1 v1 }5 B' b, v/ h+ n+ l. N; I-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
4 f3 m, v7 f1 Q1 \/ F' e5 {) e- \$ v\Uninstall\SoftICE* a. A. W& H- S9 k
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
* n0 {8 h/ |* M5 |% ~, f1 u0 X-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
! W) x( G5 o, v8 n0 b  K\App Paths\Loader32.Exe
2 ~+ F. i# }2 U" ~  g- }4 y4 O
7 R# T( q  |" [8 _9 Q( ?! j% i" d9 A% `$ @( c7 L% ^, O
Note that some nasty apps could then erase all files from SoftICE directory
3 L9 \+ V% f; T9 L(I faced that once :-(
8 z; i* l' _' U9 B  y
3 r7 O/ ~7 G0 x& Y) v. X$ LUseful breakpoint to detect it:5 f. S" _2 g% [6 B3 \: w

% e% g% E: Z/ |2 A     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'5 b& ~! x9 ^5 e) @( W: f* i& d
7 |. m, U$ |+ g, r2 Y- z
__________________________________________________________________________$ {5 l1 C  {$ u- B! m, E7 g
/ r, y! k0 D+ g0 m
. p5 E1 F5 {7 F
Method 14 1 z0 L  r1 q' O! ^" M
=========
  q+ y2 E+ c" m2 p/ d. D1 E. T  ?3 E* ]4 y/ W1 D+ B' B
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose( L# |/ J, }4 E& @2 w
is to determines whether a debugger is running on your system (ring0 only).
4 M: X* U' w% ~. l8 m/ `  z9 S/ }4 H
9 ]4 I7 S/ a8 X! {   VMMCall Test_Debug_Installed
0 c- l+ }( z. L9 f; y2 y+ {   je      not_installed
5 w5 s" V% d6 ~% L; t  [+ x2 e6 F* D1 ~; ~
This service just checks a flag.
: p* N( D3 H0 ~</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关注公众号

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

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

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