About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>7 C+ T" k/ e" `8 |
<TBODY>0 H8 D/ i( D3 |1 n
<TR>
2 H# U. l, o) U4 ^" D0 D<TD><PRE>Method 01
+ H  O, x/ M, }! D* X" F=========
4 m5 O! c  V+ u" M
6 t1 E0 C4 i7 B2 r+ G8 ?This method of detection of SoftICE (as well as the following one) is* q( c4 k! V' c
used by the majority of packers/encryptors found on Internet., H. |4 b' b, Z% R
It seeks the signature of BoundsChecker in SoftICE
: Y; U; i7 J  n: e) A+ q! `$ E0 b6 ?" ]! w0 {7 U9 T' v1 c
    mov     ebp, 04243484Bh        ; 'BCHK'; G/ i, F  ~" U& U7 a7 w4 \
    mov     ax, 04h
6 _. P6 L# w8 o; C# \+ r    int     3       & T% O4 Y. b7 L: F5 B9 J
    cmp     al,41 Y4 x: w6 ]5 l
    jnz     SoftICE_Detected' k: H2 ~$ p/ t3 Q1 ]0 v

+ Z% F# R. Q2 M. K  A* ]% N+ V% S___________________________________________________________________________
1 g7 [/ v; u2 H2 [& Z% d! O) k" F6 n% a* A; t5 K
Method 02( G3 i3 \% m. l0 N1 t
=========
( N7 [. z& q9 y. M& m' w) L
/ c1 U! l* ^6 m8 b; T$ Z2 }' R4 BStill a method very much used (perhaps the most frequent one).  It is used) F2 d( Y) e0 V# g
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
! b- J2 `0 ?& tor execute SoftICE commands...2 {, Z/ H8 |: i
It is also used to crash SoftICE and to force it to execute any commands8 ^2 d- Z: b0 X1 T6 r' q
(HBOOT...) :-((  + O4 V& j. h8 N0 [

4 J2 m/ s, l# bHere is a quick description:) S5 h9 c" C, r
-AX = 0910h   (Display string in SIce windows)
/ p! p7 P- _' h$ n-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)
9 K! L' x6 S1 j; n& J7 i6 X: W' x-AX = 0912h   (Get breakpoint infos)
: R+ k; V& g$ V8 v/ h9 Z4 a-AX = 0913h   (Set Sice breakpoints)
4 F* K, W" @, _: n) ^7 W# p0 x-AX = 0914h   (Remove SIce breakoints)
% v: D" a. b$ j* ^6 f! ~' `& G& `: a$ B# [: f* A1 G
Each time you'll meet this trick, you'll see:7 P: |5 ]& _: }' e; |/ U
-SI = 4647h
' `3 u+ _* V9 d' O) O-DI = 4A4Dh
/ @- \; S" t; W( x! c) [( k! hWhich are the 'magic values' used by SoftIce.
/ m# n; t: |( r- m9 E, S" ~( SFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.6 G9 x& D. K+ A+ b) `+ ^) g
8 q8 \: u4 R, S/ b
Here is one example from the file "Haspinst.exe" which is the dongle HASP0 q  D' X4 v! T
Envelope utility use to protect DOS applications:
" e1 v# ^  K7 K5 g  o" _& R: z. m# u- J* t% T
& ?' i* X! p1 A: D) t! F  U
4C19:0095   MOV    AX,0911  ; execute command.. c% Y+ M5 d; s: t2 r6 A* |
4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
* e- a+ a  \0 v. D( v/ g* ^4C19:009A   MOV    SI,4647  ; 1st magic value.
! V: X8 a$ {  L" }4 w6 ]4C19:009D   MOV    DI,4A4D  ; 2nd magic value.* x4 V3 \( b' O4 c' G5 W4 t
4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)1 U0 W6 F# f2 }9 e5 c
4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute! i) c$ a+ J& Q- n
4C19:00A4   INC    CX& R. {8 I% A1 p, y
4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute
* Z4 T) w; V4 f  t4C19:00A8   JB     0095     ; 6 different commands.
) R+ [6 t  K- Q" Z4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
. J4 s% H0 {% M! v4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)3 L2 H7 Z0 X, e# C" C
+ }3 Q' y, u( ?4 l
The program will execute 6 different SIce commands located at ds:dx, which% ?! R3 c! W/ A
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
3 V) {* I4 `" o% }' I
0 @9 D; t$ h! G' T& N$ I! C8 }& P* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
. T! H# Y8 F$ `) t" D' |8 S___________________________________________________________________________
' m' m1 o% t4 g7 U, B, q5 d8 x' F% e

9 {5 q! R( w8 A7 U: RMethod 03! q& |" K$ C  I3 E4 i
=========
  ]: V4 o7 \5 j& E' ^  P
, p! D6 {2 j. w5 j+ p4 r- C  n" `Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h3 f" g: P' w2 j5 g( H0 u
(API Get entry point)" ?2 ~8 v- @3 f/ t1 s6 H) p
        
( K9 P! {0 i! }- G% |6 S( p% Z/ A' y/ H2 ~  X; C' ^! {
    xor     di,di
* T) p! z' E8 F( G+ ?6 z2 R    mov     es,di8 l8 S. f! N8 y1 }
    mov     ax, 1684h       ' ~8 A1 c; I2 E
    mov     bx, 0202h       ; VxD ID of winice  |/ e! M3 f" Y7 g' ^
    int     2Fh$ _4 @3 m+ q7 d% f
    mov     ax, es          ; ES:DI -&gt; VxD API entry point: B$ s+ f. U  i# o/ [: a
    add     ax, di
" Q, O, S6 ]" y; j0 D: O+ v5 O    test    ax,ax
% L& h! j% m$ E& G& X3 F: S/ ^; U    jnz     SoftICE_Detected
8 N8 p; y+ n# ?/ e  X/ ^: v5 J! Q# e$ C: O3 H
___________________________________________________________________________
% r* p2 m! J% V4 g" B, t
, O! B/ g+ Z% d0 s  z2 v0 \& |Method 04, ~& I" d& ]9 s# b) F2 m3 R
=========
# a  g' r8 l- F5 b( @0 z: j) t, i; N3 ]% m0 W6 m$ X; v# Z" D
Method identical to the preceding one except that it seeks the ID of SoftICE- ^: |, y7 b0 b& y8 b5 [5 n% K+ {
GFX VxD.& M$ l' D) f+ \- L) q
- X: j" o+ D1 x% Y
    xor     di,di, s7 z) {$ N% Z1 u# S
    mov     es,di
. V. }$ V" s" g8 Y    mov     ax, 1684h       * k8 E8 F% d2 C+ X$ J
    mov     bx, 7a5Fh       ; VxD ID of SIWVID
' `8 Q# a  N9 c$ r4 h; \    int     2fh# x8 _& z6 {( M" M
    mov     ax, es          ; ES:DI -&gt; VxD API entry point
5 N4 L/ u1 r$ ~. Y# N    add     ax, di
" z* s6 M* Y2 E9 [0 ]    test    ax,ax
# ^+ `) p( ?8 ~  j" p; L0 j    jnz     SoftICE_Detected7 Y; x; S; k* o+ t& u  C* V
! O, a1 `5 r3 ~
__________________________________________________________________________
) }9 w5 d) J. E* l. }7 D1 f& B2 t  F  X& u- J
/ I; b: g* m( R" U) g2 M* n
Method 05+ T( J; O5 _! ~+ n. d; i8 \
=========: I2 v/ d5 L2 v7 w! ]

, y8 o4 Q4 X  {/ v, W; ^Method seeking the 'magic number' 0F386h returned (in ax) by all system
/ P! ~' e7 T: p% u9 adebugger. It calls the int 41h, function 4Fh.+ i2 A9 F( _* j* W
There are several alternatives.  4 k, Q( e/ j- v9 m

2 |5 x) H& {! g5 @6 ]The following one is the simplest:
4 c" M" p- N3 j4 M9 q4 N* [5 a4 S  ~
    mov     ax,4fh. A+ C/ G8 P; {5 z- h
    int     41h& j* i* n. h7 U0 y0 ~4 ^& E
    cmp     ax, 0F3862 w! {9 ~' R1 v3 a* E
    jz      SoftICE_detected9 O; g9 |" d( \( t2 e

& S' C1 Z; y# K+ @4 P0 y, N  u/ q0 j9 @( s
Next method as well as the following one are 2 examples from Stone's
0 c& t3 h+ @' ]6 F1 \. o$ H8 B"stn-wid.zip" (www.cracking.net):
! F9 i% o7 ~5 |9 L5 W; I/ M
( s8 V# y4 u* g6 L+ D    mov     bx, cs
  S8 ~+ n: s# ]; [; Z$ d  S    lea     dx, int41handler2% A4 R  p# ]/ N( S5 k
    xchg    dx, es:[41h*4]
. p' U3 ~# \9 D    xchg    bx, es:[41h*4+2]  d8 k2 j" [/ {7 [
    mov     ax,4fh
, o( @" F4 g& t6 q3 o    int     41h
) P+ s$ E. U  O5 ?    xchg    dx, es:[41h*4]
/ Y# @7 b: h4 ?    xchg    bx, es:[41h*4+2]
) Y( e- t  X, k0 }( |    cmp     ax, 0f386h
8 m: G/ F0 ^, r5 n* G- i5 ^    jz      SoftICE_detected
3 ^9 E& q$ l: }/ T" e9 I+ N$ B- I5 D( d: L
int41handler2 PROC! r) P) Y; d' w5 B% C  P& ~/ y* H( I8 v
    iret* |6 t$ b8 n5 ~  {9 ~- G
int41handler2 ENDP1 U3 a, M1 U' {1 J7 z
3 F3 ?8 U- q( z
2 T4 L% m- R- M
_________________________________________________________________________
% ^: b% l6 n6 @1 G7 @8 H: [9 s  e
3 v& Z: q8 Y  d8 x
Method 061 Z/ m  S% |6 u/ t
=========
# _  x9 {2 N# B$ z# Q: D  i. K3 H
+ L2 F/ O# D8 L
2nd method similar to the preceding one but more difficult to detect:
5 E, k; s  n! Q) X( \
3 n+ ]: W% e! I) }
, u- B; R/ p- ~6 U' i7 V% D- [int41handler PROC* d. k: o$ O% z
    mov     cl,al
; G7 A2 i; V. M/ L    iret
9 u4 L  p8 `8 vint41handler ENDP
: |: j+ q! \& V5 l- _4 p" N5 D0 O
) |9 @* @6 w! _( P
    xor     ax,ax& x- Y; ?; t1 y' e4 k
    mov     es,ax
" ~4 p- t% g/ v, G) [/ j7 C    mov     bx, cs; `+ f3 ~- m4 g( I$ k; O! ?
    lea     dx, int41handler/ H& x; v9 q# A' l
    xchg    dx, es:[41h*4]* X' Q+ M3 u0 s' b# o1 y) X8 j
    xchg    bx, es:[41h*4+2]1 @3 g2 s* |& A* Y- V) O
    in      al, 40h' W, r: r; o1 {
    xor     cx,cx! c" x, p8 T; ?# l; G( g# N
    int     41h
1 C& i9 ^2 c2 T    xchg    dx, es:[41h*4]& t0 |' d: k( z8 v9 c4 {, z- S
    xchg    bx, es:[41h*4+2]
8 q) Z% a& i3 T- F% c( F    cmp     cl,al  a3 o2 S2 d0 f+ h- ^; r9 V
    jnz     SoftICE_detected! L* g% L  W2 k
: F, }" B! g, |+ v1 L; R1 P" u! b
_________________________________________________________________________3 `" _1 R* N" c  |9 _

) p  A4 e% V; s% i4 c4 }2 lMethod 07: a: t/ Z6 F; h. r
=========
3 Y8 V( U  `3 Y( p9 H, r# V2 d& J5 J6 _& a) C8 M
Method of detection of the WinICE handler in the int68h (V86)$ n6 |( B; p4 i- `% L2 [

6 f' ~0 x3 ~; {" q1 j( W7 {0 o* k    mov     ah,43h
' o; n* _/ k8 `6 i8 K* R    int     68h  N5 J" ?1 \6 r
    cmp     ax,0F386h# b0 y  h7 l3 p2 A+ \/ k- W1 j
    jz      SoftICE_Detected8 Q3 V* g! t8 {$ z# W( w

. b' x, R0 j$ l/ n2 [, @$ M* a5 [- x! B$ D! X
=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit$ O9 l- b* t# g% \7 e; ?1 p9 j
   app like this:
; A  [4 f: P4 Z* F' O- G; Q8 s2 S* z1 h- I0 K
   BPX exec_int if ax==68
4 q' F8 O: J. l4 O/ t: w   (function called is located at byte ptr [ebp+1Dh] and client eip is
2 }0 W2 e4 v+ {   located at [ebp+48h] for 32Bit apps)
, ?- B4 Z& V" F: Q8 b7 m__________________________________________________________________________+ B' e6 U2 L& {8 U* q
' a$ N, l0 U) u, V
7 }9 Q+ c+ x& C# T3 ^* y' t4 U
Method 08
' Y  s) V$ A+ n) p. F. \=========
" I1 A7 N5 `3 n
' T. j/ u5 O: Z( F( ^It is not a method of detection of SoftICE but a possibility to crash the
- c6 n6 X& M9 S0 A2 V/ e/ msystem by intercepting int 01h and int 03h and redirecting them to another
  o# P1 n6 ~, z9 w7 `  {  D0 Groutine." Y: G- T7 v. b  U
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
1 R. o. C$ z, l, Vto the new routine to execute (hangs computer...)
/ T/ Z, f8 _5 @: z* |, K4 T' W6 J1 x! N
    mov     ah, 25h
+ r2 |% I2 I; {, U5 g2 t    mov     al, Int_Number (01h or 03h)
; [  f# A8 Q" m1 I    mov     dx, offset New_Int_Routine5 l/ u5 E$ R+ e! d& G" h7 l  k
    int     21h
- z9 g4 V9 W- p8 u# L
* ]3 a- X7 I0 G__________________________________________________________________________
1 r, C" y7 s/ X1 a  l) z/ W, [; B6 I; t$ ?2 ~* ]0 Z0 w
Method 09
4 r6 i- g3 D. d=========/ n7 [5 f3 N; w! H1 Y) Z  B

# I! s# a1 P  n2 ]- LThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only8 f- ?( b0 G5 Z$ k1 Q
performed in ring0 (VxD or a ring3 app using the VxdCall).2 a3 R* k# k, ^6 t" z5 ^
The Get_DDB service is used to determine whether or not a VxD is installed; U9 W+ z- D% p& G! _
for the specified device and returns a Device Description Block (in ecx) for, W4 y& r& T3 Q/ j+ m' C
that device if it is installed.
( E# u, z0 U  Z2 H! R; g7 _4 m% q$ d# T; M
   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID- u4 a& O3 G) R* Q0 f; g
   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)# L, T: Y4 q7 n# _- k' r( u- ]" a
   VMMCall Get_DDB
7 k, v; s  j6 M6 o   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed" V0 Q1 x2 c! G: {& W0 b3 r
# D' S8 s' D. P; F% y8 L! e
Note as well that you can easily detect this method with SoftICE:
: x/ j7 l* ^" ~7 k   bpx Get_DDB if ax==0202 || ax==7a5fh
* q2 K, r* D* h( @% B, q& M2 S# C9 @- O  E2 z6 s$ ~1 q. k
__________________________________________________________________________9 ^% `3 Q1 y* N7 U. C0 J. G8 L" U
. |6 H7 s" d3 }1 |( B3 `6 r  y
Method 10
; G" _3 [3 m! N' y4 k1 @=========* h3 g0 `! U6 v! l5 y6 c6 P

: y6 M; L2 k' e$ y. _5 t* R=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with
+ F8 K/ o2 `" Z. `% }  SoftICE while the option is enable!!
7 E+ n5 Z" E: U* h' A+ O/ Q: T4 {( q; K) K# U2 d$ i9 a: [
This trick is very efficient:
, @* w; ?4 s8 c- M9 ?0 r! h( e( Sby checking the Debug Registers, you can detect if SoftICE is loaded) a: A: n; n" e, {8 E4 A
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if' h! J) r) G, ~7 z9 P' d
there are some memory breakpoints set (dr0 to dr3) simply by reading their  U: e2 e3 y8 Z/ q
value (in ring0 only). Values can be manipulated and or changed as well
) h, n; |/ d. Q(clearing BPMs for instance)  }, @: b3 O# ~( f: h! l

1 s  D0 M  t! _5 T* a, l/ F# y__________________________________________________________________________
- e' Q7 F; P* k5 ~7 E7 a. a7 Y& j" C
Method 11
  K* P( n$ v" Y9 @=========
9 Y( Q$ ^8 P7 z: v5 t) A8 g4 S5 |2 h. j
This method is most known as 'MeltICE' because it has been freely distributed2 X4 P8 M$ L6 i3 r& ~
via www.winfiles.com. However it was first used by NuMega people to allow
2 d+ T. v. e; s% aSymbol Loader to check if SoftICE was active or not (the code is located9 R2 N  Y, ], C) }& T. m
inside nmtrans.dll).
& d  U% h  q( w- u; O  t% P
8 ?$ Z: Z% w; T6 b& QThe way it works is very simple:
5 z. J/ \% a+ S' p) [/ P: PIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
" e" h' ~% `2 l  q: ?! b- @WinNT) with the CreateFileA API.6 ~9 u2 i  V: v! E; M

. ~: g- t" c0 a& l2 D' nHere is a sample (checking for 'SICE'):
& I* y& Q. M6 T( E% _7 s; P6 ]
BOOL IsSoftIce95Loaded()7 \+ j% {  ~# O
{# J! m7 ]- d1 O0 e5 G- p) o
   HANDLE hFile;  - h" q' X; L* I' J
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,1 U. x6 M/ K& @, v5 P, X
                      FILE_SHARE_READ | FILE_SHARE_WRITE,
6 b7 T; x" A' \% U) k- a% c                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);% n) l* a. s/ [
   if( hFile != INVALID_HANDLE_VALUE )
* {# V. N( j: Q0 |4 g( e5 O5 |   {* H6 C/ o: A8 l- O$ Z
      CloseHandle(hFile);
9 q9 o! j7 v! P! p1 ~$ x      return TRUE;
' x! M6 {( Y5 ^2 c   }
7 J/ Y, i) l- F: `2 g   return FALSE;; Q$ V& G' Z3 F
}
# m5 f. K/ l& X) H4 _0 j, q# C# n0 F  [+ ^. N# ^
Although this trick calls the CreateFileA function, don't even expect to be+ ?6 a4 ?4 v" Y2 l4 Q5 e/ s
able to intercept it by installing a IFS hook: it will not work, no way!
+ @- U2 G- B% C7 eIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
- O8 h! q$ S: a; l2 X1 Eservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)- l  i( k& S4 C( K: E* K! [+ N3 |+ E
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
, c, T9 J- q" ]field.
& Q# |/ d) y5 }0 m& XIn fact, its purpose is not to load/unload VxDs but only to send a
' ^+ `) `( ~. ^& ~( hW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)( j: m2 B! K# g5 R" H
to the VxD Control_Dispatch proc (how the hell a shareware soft could try' w9 F8 j! U! C5 h8 I0 w
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
3 ]# t1 @2 L9 }If the VxD is loaded, it will always clear eax and the Carry flag to allow3 x' O; \( H' D/ h
its handle to be opened and then, will be detected./ i, H- k& C2 p6 f  L
You can check that simply by hooking Winice.exe control proc entry point' q+ D" ~' a! F+ w* q
while running MeltICE.
! h) b" {2 U# r7 X7 S* C& l- z+ P7 n
' y$ G* F5 K1 E% Q8 {5 X+ b
  00401067:  push      00402025    ; \\.\SICE# x( ?7 x; ?% A5 C, b4 k* ^# u& U
  0040106C:  call      CreateFileA
3 K7 X/ p: G, L6 X  00401071:  cmp       eax,-0014 f# M2 A- t( }. n& x6 f: d6 v
  00401074:  je        00401091
7 X' X/ @" J2 f  [) m. U+ ^5 V: T( e  A- {4 z3 A6 o- G9 D+ [# K
7 H" D1 I$ N% c4 N
There could be hundreds of BPX you could use to detect this trick.
# c$ V8 d3 d/ i2 J' L/ C1 ^-The most classical one is:% ]9 b2 y& q' U% }
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
4 o  ^8 I  e7 Q' ]+ \    *(esp-&gt;4+4)=='NTIC'/ d, v: I6 o- G+ g4 F2 S

, h, O, u& h# }3 E9 d-The most exotic ones (could be very slooooow :-(4 `1 I. r5 y  }; S* n% t
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  : b/ q: t$ ?+ G& e7 s7 z; I
     ;will break 3 times :-(! L* Z' S' R: }8 H& y; ^

: ~4 o# @) E! Z2 V-or (a bit) faster:
6 C: g) n9 p4 z2 _* |* k6 L9 }   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
- X" O% J0 W9 ?& W! S
5 E/ _2 N$ X# V) R% G5 [6 U" ]   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  
5 w7 z" T7 [& T3 j     ;will break 3 times :-(
. n% b7 i% G: b6 a% b7 ^# [: g& m" Z9 D9 |  o4 c
-Much faster:
, N& l+ l1 W  V( p+ ]8 V' m   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'3 l7 S5 Y# W1 q; d4 {% ]7 S
! r% e; y6 T) d! @% V5 C- k
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen" x  k+ O' X3 {. W' l' h
function to do the same job:
! K& f# h* {: \& G; y, s) j8 [. ~' n: M7 r/ |9 s* ?4 l1 o! C. E/ N
   push    00                        ; OF_READ
+ j# F, }- U5 O( \7 L   mov     eax,[00656634]            ; '\\.\SICE',0
3 k' I0 H+ U. L/ ?0 ~9 `   push    eax9 F& P4 R! P; Q4 b7 t% e8 n7 D
   call    KERNEL32!_lopen
+ E* f4 Z- N0 E- W" I9 ]% R   inc     eax9 b) P7 t7 T& S8 L( d% [
   jnz     00650589                  ; detected
7 F5 R8 M4 f+ j3 ^# [/ S4 U   push    00                        ; OF_READ4 q4 N3 m- y( p' O0 J
   mov     eax,[00656638]            ; '\\.\SICE'
& Q. }' O- F8 y; F. W; w   push    eax. J1 `# D+ Y8 G5 V
   call    KERNEL32!_lopen
$ P% V0 |7 a2 o   inc     eax' H- f" m/ y& N3 x5 y# }+ \* B7 [( n
   jz      006505ae                  ; not detected$ ~# {1 F  N% O* P' V+ {8 I. O: u
$ ]- Q% r9 m; ^* X- Z

8 D6 `* w0 C+ n6 Z__________________________________________________________________________
+ ?% ~$ e+ s9 t; Q
  M& q5 j% |+ K- o; W2 U! e, S+ XMethod 12
4 |$ r) o8 h7 L+ j; ?- A=========
# t( K) U- I) w% a2 Z' ?% G3 n) P) B3 y+ P
This trick is similar to int41h/4fh Debugger installation check (code 05
- W, g- [, |) B&amp; 06) but very limited because it's only available for Win95/98 (not NT)
; H% r( T9 m0 L7 ~& v' q0 b6 Nas it uses the VxDCall backdoor. This detection was found in Bleem Demo.+ c# T  h$ w5 c, O, N

: F! H0 W( i0 g   push  0000004fh         ; function 4fh; E$ S5 Q2 m2 L
   push  002a002ah         ; high word specifies which VxD (VWIN32)0 R$ T0 a3 \- L# t
                           ; low word specifies which service& J! _4 h, G% m% X  x
                             (VWIN32_Int41Dispatch)6 y4 R! V% ~6 C+ K* N
   call  Kernel32!ORD_001  ; VxdCall' c( l0 u" S% k; \& S
   cmp   ax, 0f386h        ; magic number returned by system debuggers) R7 Z2 E& G. G' \" ^( P2 ?& V
   jz    SoftICE_detected
2 p" T3 L0 K1 c; g& N: P0 W- i- k" H/ j$ o
Here again, several ways to detect it:( b; A" l6 M3 ]! ^
8 K- q& T/ r) U2 l* X0 Q1 p5 f
    BPINT 41 if ax==4f
# f% d3 l* J( T' H) @4 m2 W7 A- ~6 j1 e7 T1 p
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one+ g: x/ H: x+ ?; h1 {! u2 c
- }, D; _- d+ \+ A) P
    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
( a; ?% `* F6 \. u) C
- P/ e+ t5 P/ l' ~    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!# E- j, l8 o" L2 h& g$ ~# ?

6 p) K6 a! n8 d, c__________________________________________________________________________
$ G! y3 R; G" B0 p; @7 n% L; o' |! s) `. H% e
Method 13
3 m& D1 }* K0 D9 X' ]  \9 K, v4 i=========
6 d: v- X1 y1 c& K) P; N) F& C8 d/ W; K& C2 `* `1 c
Not a real method of detection, but a good way to know if SoftICE is
' I6 n2 t1 ]8 ninstalled on a computer and to locate its installation directory.
3 B& o) W$ D/ A" KIt is used by few softs which access the following registry keys (usually #2) :
4 V7 e; h. z$ [: `- J+ H" _3 w( ?/ `' }' t2 U4 }
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion6 P( P) _, J" _
\Uninstall\SoftICE
8 g0 _. y1 t/ z7 h* Z: a-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
$ l7 Y7 F7 [1 l- `-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
+ w# o; E. ]1 Z3 s\App Paths\Loader32.Exe
9 @, n  N# L6 U
# E' q1 T3 o. M8 y0 \
9 ?$ x  Z+ X  G. q* nNote that some nasty apps could then erase all files from SoftICE directory
% B  \1 O- `5 H4 n3 H(I faced that once :-(8 |; Y! R" l0 t( F

: A& W" Z( ?  HUseful breakpoint to detect it:
$ O" i2 a9 \: c4 f
5 g2 _/ M( ~; L2 w: P     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'5 r5 I+ I9 O4 \- s4 D5 D

# q$ o, F& u0 h2 W! F__________________________________________________________________________
1 W0 f# s# N6 l  U2 t* J. h, S8 r) l' r6 W7 G1 d% ~: M) ^

9 v* X, \( L7 c' N" kMethod 14
8 Z! s" n# b5 c=========( T$ w- I" v5 G" o8 T: t- {

! f9 H% A1 |1 k2 C2 c, z3 ^( cA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose! o! A% C* Q& H3 s) J
is to determines whether a debugger is running on your system (ring0 only).
  _* L1 j2 s/ d/ h" j! w! n1 L' O, j7 h9 g& _; v* X2 x, G
   VMMCall Test_Debug_Installed
: ^1 {- h# |9 w9 _3 M   je      not_installed& @2 N- [9 l( t% ]* |

6 y5 G  ~' D( wThis service just checks a flag.
$ D0 A2 ^1 J& g& W1 ~3 _' }</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关注公众号

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

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

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