About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
; H6 K7 q3 K6 o- q  X7 X: t5 M<TBODY>. `! C& [0 V6 \) L" B& p
<TR>
/ f3 r7 [) _2 R' B4 a! q" M% U<TD><PRE>Method 01 1 Q* d% b( k3 w4 e  U# I$ I
=========4 N. l9 V1 T5 ~; S+ x& w
7 ^6 j+ X/ R) c
This method of detection of SoftICE (as well as the following one) is) U: T2 ~% V, b- I6 T9 ]
used by the majority of packers/encryptors found on Internet.
2 r/ \# j/ i: y! gIt seeks the signature of BoundsChecker in SoftICE+ t% d) _* ~6 X/ {; ^5 t+ [

) `" X9 `$ _+ R/ e' T' r8 |7 h" P, |4 O    mov     ebp, 04243484Bh        ; 'BCHK'0 n, n3 R' h, c/ `- D
    mov     ax, 04h+ D6 \0 `- `% K
    int     3      
/ u8 ~- O6 W+ Z, o    cmp     al,4
/ E8 B+ H6 x0 |6 j) [    jnz     SoftICE_Detected
$ o" l7 Q) m+ {1 W
* R/ _( ~4 A0 }% D___________________________________________________________________________
1 W6 z# `5 B# C
% n; ~" R! Z# ?$ o7 WMethod 02& ~% S: w, m: m' h9 Y( R: i% {: c
=========
$ l/ G& s- o& S/ s3 _9 J* y# T0 ?! d0 h) J0 s! @. K
Still a method very much used (perhaps the most frequent one).  It is used
$ C, c3 _2 x8 mto get SoftICE 'Back Door commands' which gives infos on Breakpoints,- q7 ]% z1 h: L- L
or execute SoftICE commands...0 ^- o. ^+ ~9 ~2 ~5 R% a" H
It is also used to crash SoftICE and to force it to execute any commands! n; r5 h9 v' ?" [
(HBOOT...) :-((  
0 X3 N5 r: [% i; B+ f" ?
2 m: F( G" K' I2 HHere is a quick description:
, B% {7 S. r& V1 Q0 V! n-AX = 0910h   (Display string in SIce windows)
9 d' _% [7 r7 u) ~- Z-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)
$ g. r9 _$ p, ?# y; A* k3 u4 s6 p-AX = 0912h   (Get breakpoint infos)  i$ d0 _- J0 R0 A1 B( R1 _8 B6 V5 q
-AX = 0913h   (Set Sice breakpoints)% t4 f* S# z9 F' \( B
-AX = 0914h   (Remove SIce breakoints)0 s2 h: p( i, S$ l8 l& u6 i& V

& K+ ?$ \- Y% e1 f1 [7 TEach time you'll meet this trick, you'll see:5 f5 L8 ], r8 a7 b2 I
-SI = 4647h( \3 T4 e! x! m: U
-DI = 4A4Dh
' z4 T) C- J5 V% s8 p# ]. XWhich are the 'magic values' used by SoftIce.
7 I) e, Z& T# E! [2 c9 ^' K" G4 tFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
9 q8 k" M( e; p. `9 V( n! ]0 a9 f
Here is one example from the file "Haspinst.exe" which is the dongle HASP
6 L& v# }% ?4 A0 o7 B; d- U8 f6 b4 FEnvelope utility use to protect DOS applications:
8 U" G) w. l4 w9 x$ `: k3 f$ A# g6 i: i" u) t9 K0 O! w

8 }# B3 a8 W' [1 {! _/ j4C19:0095   MOV    AX,0911  ; execute command.
: A& f9 u: Q7 ]' N6 p4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).% ~/ ]0 |' M6 V2 c" ~
4C19:009A   MOV    SI,4647  ; 1st magic value.
3 ~+ z. @# O' q9 ?. y4C19:009D   MOV    DI,4A4D  ; 2nd magic value.; V. w5 C. T* D: t* g1 g
4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
$ v& Q3 t7 _6 x0 [0 G; _4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute
3 H5 Q! L* q2 C+ ~4C19:00A4   INC    CX
! }) b0 ]7 k& E5 s% R4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute
1 @% Q' H1 B1 D. U4C19:00A8   JB     0095     ; 6 different commands.! l9 p+ Q" n! u+ ^
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
( \1 m! k6 V5 _3 c4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)* q$ v/ e8 e; t; n0 C5 Y0 ]

3 z  I; I6 [$ f% _The program will execute 6 different SIce commands located at ds:dx, which9 I5 E2 I. I2 a4 z  W6 W9 Q$ v; i
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.# L% c/ W6 Y) {8 g  Q( [

/ M7 B1 M7 `0 E1 b( Q1 n' z/ m7 y* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.4 o: A$ d) Z# q4 [
___________________________________________________________________________4 j$ E% [% T& O: n' I# [

2 F1 C) X2 q7 n; b* \* i. S0 J, W0 F$ [+ x6 J/ A% x3 a$ K+ P8 s$ _; j
Method 03
& ^2 F% P; c0 t  }' Y# i0 \=========
; J/ y- P! q/ [
' p8 Q9 ]; a  OLess used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h6 e0 B. j) R* J; ~6 ~, ]* K
(API Get entry point)
; G) l, m5 |% V        
1 N4 n5 v; p% b4 P, k1 U5 c1 o  H7 _* ~' B, h
    xor     di,di" |- b# B8 L0 i, v/ I
    mov     es,di( x$ ]: u, t) n# q& X8 j
    mov     ax, 1684h       . T. w4 x5 A8 y
    mov     bx, 0202h       ; VxD ID of winice
! Z, e8 @* Y0 V    int     2Fh
; C, C$ w  T/ r* B- C; ]1 C    mov     ax, es          ; ES:DI -&gt; VxD API entry point
: `* b5 F$ `. e8 |3 H3 D5 u5 V$ N( h    add     ax, di$ M/ l5 f% w$ p8 `* y
    test    ax,ax8 D1 W- B+ o# H6 ^
    jnz     SoftICE_Detected
4 T7 H: P9 i2 A: J* ~# y& e  P7 H* p. M! g
___________________________________________________________________________" J' z. x) |( a( u7 L7 v
4 z, D/ z2 y# S' s1 O4 Y4 _  j
Method 04/ O& b9 s& D$ W
=========" _) U( V/ O6 x" [; Z

& g) E- t% G" h* t  B& z5 U- J; PMethod identical to the preceding one except that it seeks the ID of SoftICE1 h! k/ {; A, S% s! X4 z
GFX VxD.9 f2 I: _5 C- }2 R( B

7 V4 U, j, @- C" T( d, w) m    xor     di,di4 F% Z6 t5 Z- Z- ?
    mov     es,di  h8 A4 d" Q* m! j& {7 b
    mov     ax, 1684h       4 }4 v/ B; r' T+ e7 |
    mov     bx, 7a5Fh       ; VxD ID of SIWVID5 }1 j. p+ N. H; {) B- K: o1 [
    int     2fh
9 k% `! w% I# C6 h  I& y* S    mov     ax, es          ; ES:DI -&gt; VxD API entry point2 p6 O5 [* x" k. s) Y0 v/ g4 a
    add     ax, di3 U* N6 ^/ H' I) L1 U, n
    test    ax,ax
- j' R& \% j5 F9 u5 i    jnz     SoftICE_Detected
# x1 C3 v* h% U* m# z, v7 c" t$ z1 |' H" A) a( s/ _
__________________________________________________________________________
1 j& A; q& C& B' T- m1 M/ M. t  [- r
1 B+ @: E& K( X* \* r
Method 05
0 t! J3 d) \' C7 y=========
/ a  ~+ |% S7 |: v1 `3 u! p# N. D+ s8 V  R  g
Method seeking the 'magic number' 0F386h returned (in ax) by all system
  O/ R) o. D3 mdebugger. It calls the int 41h, function 4Fh.- u# L* E, u% V5 v) b9 M
There are several alternatives.  
, x0 W, J6 F% [% |% `( `6 ]% E' |: V  Y! e( `8 l0 i
The following one is the simplest:& L5 o  F% f' c+ K  f; Z
! {, }* V: H( w+ x3 A
    mov     ax,4fh
& I) ^& e' X/ G0 L4 I) [  ]( `    int     41h, H* l) ?# I  m# V8 x8 P  D
    cmp     ax, 0F386
6 ^4 w% `; m: W& _& W    jz      SoftICE_detected
( C) i7 C0 X* v  s' R+ X  U* h$ v! ?1 Y6 y: c) ~
5 I0 _2 `0 G) N: i) T
Next method as well as the following one are 2 examples from Stone's ) u6 d! ]' Z; K, H' z3 o# T
"stn-wid.zip" (www.cracking.net):. e. |. H' P5 B
5 D) ]. v8 L. B2 L
    mov     bx, cs) K. g+ i/ i4 ~; v  S
    lea     dx, int41handler2
" [, C8 p; N$ R7 J2 W    xchg    dx, es:[41h*4]1 q2 N& b+ H2 x0 x) e
    xchg    bx, es:[41h*4+2]
5 l) b6 z' O! H# t    mov     ax,4fh
2 V" V7 Y/ N+ Q5 s+ ]- J6 o    int     41h5 Z- }- m  _0 m5 C' h
    xchg    dx, es:[41h*4]1 L; |% L5 r0 Q8 Q) I, Z( j8 h. `2 S9 Y
    xchg    bx, es:[41h*4+2]
: v- [; `. b6 @* d1 [4 G: h    cmp     ax, 0f386h* t" M6 m& y* j0 n
    jz      SoftICE_detected" U, z. v7 ~/ ~6 Y
5 ]$ a% @2 U1 r' Z/ F9 l! S2 V
int41handler2 PROC
3 l: D) B2 |+ M8 J    iret6 v5 b) `9 F1 K
int41handler2 ENDP# _/ ^. Y- d7 P% O4 Y2 X8 z. y% `

4 y! S' M4 Z8 t, `5 ^4 w: x1 @# E2 b  Y4 C
_________________________________________________________________________
' M0 c' e) P, f5 c# J, ]: c" _) b% L9 `" F0 Y

5 {+ h  k* @7 T3 Y# Q2 [Method 06
- V; w: V4 I" p7 p1 N# Q3 A" C% |7 ^7 F=========* ?# {+ `+ F% v) ~5 T: J, \

9 R, W& Z1 Z3 e2 k
  [0 B  D/ ~) `0 j/ b% K* R2nd method similar to the preceding one but more difficult to detect:
; E) n0 k/ @0 x7 A/ w" [% Q. a
" G% o% N( n# p3 T
" H9 I* q0 e. F: w: fint41handler PROC# s& S# l& G  J! b/ Z: L$ P" h
    mov     cl,al( M( X/ P2 x- X% u6 {, G
    iret( F. Z. l3 v$ Q- C
int41handler ENDP
6 X, M/ p" \& a% p
1 b' R' t' u# L* I
* R7 f1 _5 I8 }    xor     ax,ax) d- S) Y6 D8 M
    mov     es,ax# h% C+ i2 H3 I( f
    mov     bx, cs' q- r$ o! R, v1 e& d: I) ^( d
    lea     dx, int41handler
5 m7 Q. i4 p% \1 R, s    xchg    dx, es:[41h*4]  x! O- ?. b% p7 R
    xchg    bx, es:[41h*4+2]4 |1 q  [& s( d( Y9 Z
    in      al, 40h
9 K2 B6 r1 i' c- h    xor     cx,cx
$ w  R: N( S: I: U    int     41h
" {  x% G3 Y8 N* l1 B; ]    xchg    dx, es:[41h*4]
/ Z6 K+ Z% i8 B, q7 Y  U  o    xchg    bx, es:[41h*4+2]: O( l+ E6 w; X
    cmp     cl,al
" m1 p6 h) u/ b4 n' S    jnz     SoftICE_detected5 J  V5 p$ w3 |! V0 b

7 a3 z$ ?- ?: b0 ^, t; N_________________________________________________________________________
1 Y7 v  n; g* ~: b$ C- f, E) n  C. [1 L0 n' h2 d1 B9 x
Method 07! N0 x# s/ ]9 ^9 r2 A
=========: N/ H" f( Q# J, P) J2 |

7 Z: q/ H! ?) u2 L  R( dMethod of detection of the WinICE handler in the int68h (V86)$ P9 I0 e5 u" J' ~+ t! R
$ {2 Q/ L6 X+ x; x' t8 Y5 {
    mov     ah,43h
6 ^* m  [. j1 b2 e1 J    int     68h
, k3 W7 G+ L9 v+ Z: i# i    cmp     ax,0F386h% b5 O4 I1 W( @. f, h& }
    jz      SoftICE_Detected$ N2 \. k! ^* c% o; o4 A, ?# l7 |+ F6 i
5 Q+ G4 J5 ?4 [& i, O

- B) s% Z2 {- q! i: B% b/ d; L=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit/ R) N- r& M( M. V
   app like this:
3 e3 P0 G2 ~  g, X8 _  E& V$ m9 @
+ c6 I9 Z, W% l2 A   BPX exec_int if ax==68
# v! N3 C. p* M1 x; P& h& N   (function called is located at byte ptr [ebp+1Dh] and client eip is
0 c0 P* y1 K- j+ D( e+ p   located at [ebp+48h] for 32Bit apps)
! v" S* x' h( e, C. O# T4 f__________________________________________________________________________
: ^! Y! p2 r8 ?
3 N5 f/ J- a! {5 |) M7 D$ u4 z. ^
Method 08
/ I  u4 C) t4 r3 Z( K=========2 `  {' D- j4 M
2 d% o5 }& |, k, s
It is not a method of detection of SoftICE but a possibility to crash the
9 e2 i- b6 K7 o% G3 S; z" usystem by intercepting int 01h and int 03h and redirecting them to another4 W6 j* W7 D/ o  W' V; R# g
routine.$ b) }5 r  j" J3 g+ p
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
: D) H6 r' a5 B- k" d  f- W+ Qto the new routine to execute (hangs computer...)" z2 ^2 M2 l/ G! n8 ^- V+ G' Q
, P: o+ {; @% }: u' P
    mov     ah, 25h
- d( |" A4 Y. J: ]! E9 g7 C    mov     al, Int_Number (01h or 03h)
% d  c5 t& l( s0 o& i5 Y    mov     dx, offset New_Int_Routine! G# o' ~) ^/ n$ {) y, ?- ?
    int     21h
4 u; J7 b& d  h3 ]0 _; P; Q/ {6 ]
__________________________________________________________________________
# A2 V3 I: C/ a0 K1 _
: g' N0 S4 f$ l  L- E, f& x# fMethod 094 @' s5 ?* f+ u( P2 z, o. J, F
=========
' J8 ]5 J8 J8 ^. X0 k/ ~
$ x' g, {1 q, V. K# O$ W7 P2 {1 A  @This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only5 g4 S& b1 s! a* v- ?8 v: E" Z9 q6 p0 ~
performed in ring0 (VxD or a ring3 app using the VxdCall).
! t* V+ L  Y# t. i" v. P$ kThe Get_DDB service is used to determine whether or not a VxD is installed
5 [( S5 k; k5 \; f8 Jfor the specified device and returns a Device Description Block (in ecx) for
( K% F* l5 j8 D; ?* y/ Gthat device if it is installed.7 z- ], v$ e. g

, {9 h& m1 B* {! l9 c& x7 C   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID
' A; p! b4 r4 e& J3 B0 F   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
# q5 c; R8 _" {0 C+ Q; t3 m   VMMCall Get_DDB
$ [. H. _% l+ v* a   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed
& B$ \+ z; G/ I# V8 g& P# p4 P1 G) Z+ i+ P( [9 ]
Note as well that you can easily detect this method with SoftICE:* v  d% g! S, f3 x3 m; U# k$ c
   bpx Get_DDB if ax==0202 || ax==7a5fh/ T6 ~! }) C6 W! h" _

/ r( y) I- Z/ o__________________________________________________________________________9 U$ m, _# ~9 e4 S

' ~! J, p  h4 m1 U% U) \+ U' e, xMethod 10$ I! s" i4 l) c: m, F, W
=========
/ e" C2 ~2 A# X
) ^/ l0 ~- Z* e5 J2 ]=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with+ y4 v" s5 F' s9 z- M  u5 R
  SoftICE while the option is enable!!
# b- k* p) t! X5 V, z4 y  w
  A: j0 F0 K! |2 iThis trick is very efficient:, W- H# b$ `' L% u% w- X! Z
by checking the Debug Registers, you can detect if SoftICE is loaded; Z$ \6 e; N( t4 G7 c9 {" W
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
! K2 O6 \/ @3 @0 `" E8 b9 g# }there are some memory breakpoints set (dr0 to dr3) simply by reading their
) b) I( P+ R# Avalue (in ring0 only). Values can be manipulated and or changed as well1 f+ K4 u: ~" K8 c3 s9 A4 z
(clearing BPMs for instance)
3 e* y7 e% H* I- `
' T  r3 y  i& h3 D3 B% [__________________________________________________________________________
/ g/ J6 \- R% H1 {& w2 n' n7 C/ z" a, c& i% I5 r
Method 11
" C7 L8 ~2 V1 j4 r, I6 Z9 J=========
7 J) U4 H! q- B- z3 C! J' |9 Z' D# q% N6 f8 E4 `
This method is most known as 'MeltICE' because it has been freely distributed3 q& B- q5 h/ ^, a! D9 v2 C# x
via www.winfiles.com. However it was first used by NuMega people to allow3 G; L$ J/ C  T
Symbol Loader to check if SoftICE was active or not (the code is located& R' ?1 @  b# O0 l
inside nmtrans.dll).1 g" u8 U9 t' \# q8 x- o

6 Q; D3 M, g1 O" o' v; u  GThe way it works is very simple:
0 }1 ~8 W/ r1 }' j# MIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for5 j+ D6 A; j7 u+ u- F; ~
WinNT) with the CreateFileA API.
% b8 y3 w! S8 K, ~7 }  f/ P% k2 C  K- ]( N
Here is a sample (checking for 'SICE'):2 H; t, J2 B5 a
- _6 B" |3 Z! Y. F1 m
BOOL IsSoftIce95Loaded()5 H% @; q& n0 M8 \, n# B2 F5 i
{" ]* i$ @0 D! N! I
   HANDLE hFile;  & n% U2 D* Z, y- o
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
+ q, v7 B. g3 X7 e9 M/ x                      FILE_SHARE_READ | FILE_SHARE_WRITE,6 T3 q3 a/ U$ s$ ~0 d+ Z& n
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
; |1 c2 w' o1 |) v& c, N! }   if( hFile != INVALID_HANDLE_VALUE )
, w5 }6 i; t: H& ~& G0 P; _( Z3 P   {
& x% g8 L! p) y: E+ ^      CloseHandle(hFile);$ ~/ W: ]  e- d9 L
      return TRUE;
9 T# l) D. K; r& H( l2 T   }
: i# a! t4 v  }- x3 y   return FALSE;
  v8 y: e8 N7 g' c}9 [3 p& K( P' g% I6 ?
' M2 k$ E6 \$ Q/ Z; W$ V
Although this trick calls the CreateFileA function, don't even expect to be
3 ~- |! b4 E( Q* _; n7 s8 g% Aable to intercept it by installing a IFS hook: it will not work, no way!2 r6 u" p% D' `% z5 v
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
: ^3 n) @" B# w: k2 _2 m$ z8 t: uservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)$ s3 v+ g6 b# U2 M9 ]
and then browse the DDB list until it find the VxD and its DDB_Control_Proc/ h7 v- M$ f: d  S1 \5 w/ M2 R
field.
! B7 T. @  o; I4 _  C) \In fact, its purpose is not to load/unload VxDs but only to send a
5 y  w' m6 r5 h' h( g  y: pW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)$ A: d! G$ i, p3 x
to the VxD Control_Dispatch proc (how the hell a shareware soft could try6 e5 X7 j/ _3 R2 D: ^. D
to load/unload a non-dynamically loadable driver such as SoftICE ;-).! p+ H) e) ^1 X' F& i4 f1 Y) u
If the VxD is loaded, it will always clear eax and the Carry flag to allow; n& N8 M7 ]; K. G$ {$ t" q! R
its handle to be opened and then, will be detected.
/ }! g1 r1 @% LYou can check that simply by hooking Winice.exe control proc entry point
0 b" |1 e3 i7 X  L* Jwhile running MeltICE.
) S1 o; ?& ~9 O4 [0 F: N/ E. ~- G$ Y+ [) \; K% o" p# F7 k. }

! X/ n7 _3 D1 b  00401067:  push      00402025    ; \\.\SICE
7 J  s/ R/ c; x/ M; n* J8 F  t  0040106C:  call      CreateFileA
4 N1 `! M1 g' w- j  00401071:  cmp       eax,-0011 ]7 ]6 w2 l9 T  x- A& i' O! H
  00401074:  je        004010911 g( q) f. n# B  J+ h3 R) _0 j/ l
; M4 x) t. B6 r6 T
. f3 j% ~3 z4 [! y6 i6 J: p6 o
There could be hundreds of BPX you could use to detect this trick.
0 v3 ?$ G7 }3 T( C- @2 h* [6 K-The most classical one is:
7 O) i1 {9 U% N/ K- \  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||- b0 V3 p* o( r/ J
    *(esp-&gt;4+4)=='NTIC'
8 Q" u- k& L1 R. c. m
: ^- ?1 a  m1 }-The most exotic ones (could be very slooooow :-(1 K* j! F+ J4 K& A
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  
: M1 ^) s! z0 U( p     ;will break 3 times :-(/ @9 j: L! T: D7 D: p; @
% ~8 ]- r( G) f( \# N# O
-or (a bit) faster:
8 z- W) e& Y0 E1 g   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')2 Z* h- d% A$ z7 D$ ~2 E' d3 ^% W7 Z
# r/ K/ @5 ~( c% m
   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  : S5 c! w6 P, G" ~
     ;will break 3 times :-(
& v4 O2 k8 ]3 K2 a: \" n7 P4 M0 G, N/ E
-Much faster:
2 V2 u& R$ H% L1 k6 P* ~   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'
7 M5 |* E3 \( Z# O
2 p" r% {5 H% s/ p* m, N0 P9 aNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
9 l5 \) F. z" }function to do the same job:% k  H) h' I' |" P# [
5 b+ U  y  O3 }7 u( g5 Z
   push    00                        ; OF_READ, y2 L# n+ B  b0 X# N1 X# }5 P9 z# o
   mov     eax,[00656634]            ; '\\.\SICE',0
' q8 q6 t. q" K2 h, G3 O   push    eax, C# S: e2 O' y
   call    KERNEL32!_lopen+ K! e! G/ Q' g7 u- g  \
   inc     eax2 q% Z9 i1 N2 D9 i1 m, e  Q+ t
   jnz     00650589                  ; detected5 Z* a& E8 r  e8 I) P
   push    00                        ; OF_READ) {* x6 \  y! N0 ?0 H
   mov     eax,[00656638]            ; '\\.\SICE'
$ N1 B2 p1 @) l1 p8 a7 r5 x   push    eax
, y+ B5 ^7 m( I7 j   call    KERNEL32!_lopen2 U5 H7 _; D5 Q5 V7 ~- I
   inc     eax
5 i5 q- ?' e0 @7 }) c   jz      006505ae                  ; not detected
/ a' o% a) t3 `4 P; t3 W
8 u  N- Z6 H. ?( Y6 [. g1 f2 k: D8 [, d
__________________________________________________________________________& k& W" G" ]% j6 |" z& C  e: f& ]

. }5 y, x5 k3 N) T* O( Z) t- iMethod 12
1 k5 D* f9 ^( Z5 v" y$ ]9 l: U=========
8 m5 a. ?, [$ S  d* Y
- [. Z1 f5 i3 I8 U/ O+ k2 x3 ZThis trick is similar to int41h/4fh Debugger installation check (code 05
" @0 d$ F% I8 `  B( S* t* Z&amp; 06) but very limited because it's only available for Win95/98 (not NT)
+ M+ b) S: l' I  {; \( T& J  Qas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
# H: R+ t" W" I: j; F9 l
& Y+ q- v7 o8 z" L8 u   push  0000004fh         ; function 4fh1 [# Z% ~2 z) E) d5 B
   push  002a002ah         ; high word specifies which VxD (VWIN32)6 P2 I4 ]1 j3 W2 `
                           ; low word specifies which service
) }  c# x9 `' L# a' F. }5 T                             (VWIN32_Int41Dispatch). @, m% p7 _5 ]
   call  Kernel32!ORD_001  ; VxdCall0 p& H' O5 J8 O* e! `
   cmp   ax, 0f386h        ; magic number returned by system debuggers+ r8 m6 x+ o0 h* @% T3 Z" e3 t/ I
   jz    SoftICE_detected9 o4 W8 M  {- w& h1 f) j2 D
. e! |8 e3 f: i3 G: A, Q7 T. P
Here again, several ways to detect it:! f; y: D* q7 Z" |

* u, P+ B+ y/ X9 O( N, i& t    BPINT 41 if ax==4f. Q: ]/ C% \2 @; }5 O
; A/ Q% ~/ G8 N% @* U$ D" F
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one
2 S) \+ P7 F; s& Z$ y
+ K: c3 h! s- r: ^0 k2 T6 N    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
  I$ v: |8 j! L4 A( ~$ I
9 W3 h9 @4 M: Q7 P    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!
( Q; r" v0 R2 Y: ^' S5 v! I# s- z9 O0 D' g7 q+ n0 x# ]
__________________________________________________________________________' ~% q2 e8 `4 V7 ]

) ~8 P" s. s( d3 N3 p' BMethod 13
1 \8 a! j7 A5 H9 [=========1 i( j1 r9 _1 O% L; C3 }

  Y! J4 z7 v: |- S: `Not a real method of detection, but a good way to know if SoftICE is* Q! ^. x( i+ ^% j1 Y; B
installed on a computer and to locate its installation directory.& D, p, _, ?7 o: p
It is used by few softs which access the following registry keys (usually #2) :
* W) Z' e' ?" V  a
$ k# x* K9 a, i8 U: k! ?% m8 @-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion$ M# V( H, N3 Q) P
\Uninstall\SoftICE3 ?+ P% y1 w5 M* d7 H6 \2 J. ~+ ]$ o
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE% l; `- ~8 y5 d( y+ g$ U( G1 M8 }, ^: V- B
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
- k0 r0 e5 C3 S. k\App Paths\Loader32.Exe( c) ^! l$ Y* R$ S  j
4 d/ z% \6 D; L9 s

! M  \3 o4 ]- r/ E6 F; [* A* INote that some nasty apps could then erase all files from SoftICE directory5 o* m0 I; y, P; i3 @# J
(I faced that once :-(" d8 L$ l' Y& V* X( [

: I1 l8 k" e! QUseful breakpoint to detect it:. Z" Z; @% O3 G6 R5 R

5 d) }6 Q& N( ~4 F. g6 ?     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
* C9 \: {! e1 y" Z& R0 U# g) g1 N7 B. Q4 [4 g( h
__________________________________________________________________________1 f! q  s9 i; d; `$ F9 [

" x& A5 a2 Z7 X( J' S' H! I- c; v6 `: a! I" _- N1 p6 i: b; B
Method 14 , A: A9 }, V, j( H1 V
=========
) u5 N6 ?1 I0 e! R3 m8 Q7 m8 s( s# ]; c; O9 |7 c1 j
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose5 k% L% x- h! T8 S5 _9 {
is to determines whether a debugger is running on your system (ring0 only).5 \9 x4 |3 k% s& c

9 x6 X7 I. o6 ]8 L   VMMCall Test_Debug_Installed' ^# y# r% f; P2 b4 z% k9 i/ t
   je      not_installed
8 }+ Q+ f4 h1 }5 G* E4 J/ Y
* a8 s) C3 D9 l8 OThis service just checks a flag.$ M4 ]6 w8 b" o/ V+ u; Q* T- n
</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关注公众号

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

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

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