About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>9 s/ V6 d, Q9 L7 r, N  g3 T- S
<TBODY>
9 S" k3 ^5 p2 a% n, s1 o<TR>5 ?. S0 D# g  Q6 ]8 P3 W
<TD><PRE>Method 01
) E# O- j; p- G  M, k=========
* o: C; h+ q0 M+ Z) _/ a; j
; b$ ~* i7 N* bThis method of detection of SoftICE (as well as the following one) is) o& ~4 g4 |5 Q# X' K- A1 I1 T0 x
used by the majority of packers/encryptors found on Internet.' K( {) v- V0 m) `
It seeks the signature of BoundsChecker in SoftICE9 l- y) o  B! U) C
+ a; p7 T3 p8 I, t
    mov     ebp, 04243484Bh        ; 'BCHK'+ _0 n" b  k0 {9 o( Y
    mov     ax, 04h
+ f' u( A) T  H% h7 T. v    int     3      
* v" B; W' u1 V! G" x- I; \9 Y3 `+ J    cmp     al,45 Z& P/ N: h0 @6 l& Z- e$ i
    jnz     SoftICE_Detected
8 ]' W1 A* `) i/ P1 i: K. @+ E( P- Z; R7 m5 @6 ~
___________________________________________________________________________
- {0 A4 e; h9 Z* u6 i1 i5 l! u# ?- N9 e
Method 02  U% R9 H" `; P, r9 J6 I
=========
* ?3 f! i* r* ]2 M% Z# w$ i8 L  g8 I: O" x! s# T" j& \
Still a method very much used (perhaps the most frequent one).  It is used- o" q. d1 |" E4 ~/ E. Y; M$ i
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
  x9 c4 G4 d1 U$ G. _$ eor execute SoftICE commands...
' x. S# a+ T9 N' k$ Q. G1 WIt is also used to crash SoftICE and to force it to execute any commands: Y0 j7 K' }! a7 N3 \1 g: Z3 d  r" I  ?
(HBOOT...) :-((  
4 S& I* r& y8 W# N8 q
5 t1 S2 |) n' I; V1 BHere is a quick description:1 @4 N* I/ b$ ~) `' q( s0 F
-AX = 0910h   (Display string in SIce windows)0 R* H7 [' j0 l+ b) n/ [
-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)
0 k! v( g* @9 j8 s- |: v-AX = 0912h   (Get breakpoint infos)4 O* X# l9 X7 H1 M8 m6 k% ]9 }. u* g" d
-AX = 0913h   (Set Sice breakpoints)$ l  X7 {0 s5 n1 f+ g4 c9 E
-AX = 0914h   (Remove SIce breakoints)4 R6 `; }. I( A# V

! w% h7 k( D; [3 l3 W, g1 \9 j3 OEach time you'll meet this trick, you'll see:+ Z6 \- S; i+ O7 r" d/ m: G" R1 z
-SI = 4647h- }3 X1 y! t$ X8 K: W6 h/ h
-DI = 4A4Dh
2 q( M( ]  d8 F3 xWhich are the 'magic values' used by SoftIce.
. e/ V0 F+ x* L( Z. ]For more informations, see "Ralf Brown Interrupt list" chapter int 03h.7 V; B4 E! ]9 N

% }! c+ y  k5 F) h1 BHere is one example from the file "Haspinst.exe" which is the dongle HASP
* Q! @/ v- l# F' n4 Z  GEnvelope utility use to protect DOS applications:
4 V! k) L4 F/ S
" A! \# f. O; n9 u
: H6 v3 D& _' r' {" C& h4C19:0095   MOV    AX,0911  ; execute command.
- T* I" E/ g) l4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
/ ^6 C. F/ [( g; e% f4C19:009A   MOV    SI,4647  ; 1st magic value.* P# K) x+ z' m# J+ t" W. c$ Q
4C19:009D   MOV    DI,4A4D  ; 2nd magic value.
; y5 Z3 Q. Q1 V/ @4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
+ l1 m- b/ S7 d. ]4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute: a0 [4 H; O$ u+ H" v, R0 L
4C19:00A4   INC    CX8 B$ `; `; z. @+ Z8 h
4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute( M9 Y8 O; t( K, R* Q
4C19:00A8   JB     0095     ; 6 different commands., ^  i* @- m( y+ ]5 U8 n4 Q2 x
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
/ `3 I8 w6 E; {* @7 f& q4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)
& l; O& K) i: o0 D$ x; p! \9 y4 S) v" O4 J1 a
The program will execute 6 different SIce commands located at ds:dx, which
& t0 q  N+ D6 N) Pare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
% Z7 z) U0 q( @8 W  i/ y, Q) P6 v
* D) B" N+ G8 m0 l( y* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.2 W! b  P" s$ J" @9 C! r
___________________________________________________________________________: D9 B4 r& ]- K' a4 w2 S1 o

: n' {1 S- k, d  J, n7 `! }, m" [2 @+ @5 i( u& ^' x7 E/ i
Method 03
4 J: I3 L3 y8 c0 Z0 P! t- @=========3 X5 U1 }! R# K* P5 y' H9 l
6 W) q& c; Y, B* {$ \8 B8 p& t9 l. k
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h7 E2 N( b: y( ~$ W
(API Get entry point); u6 {4 l" T9 P0 i# m1 ^% S
        / U* j$ ^( k2 h$ @

% n' z0 E" G8 f! Y0 G! N$ k    xor     di,di+ S% ?- Q( j. C9 u2 ~  W% C9 S
    mov     es,di  m& ~6 E/ R" i% s% @5 P
    mov     ax, 1684h      
7 p* |* V' A& V    mov     bx, 0202h       ; VxD ID of winice
# J! k( f& [6 {. ]    int     2Fh# @6 h& ~% g4 A
    mov     ax, es          ; ES:DI -&gt; VxD API entry point
; P$ x3 Z. F9 u" e    add     ax, di* R5 S4 s1 T! @( J6 i
    test    ax,ax6 P6 p3 G7 l- o% i. k+ m
    jnz     SoftICE_Detected6 I3 x! j% W' Z  \6 V
- @/ `* L% b) p8 V" i
___________________________________________________________________________! J/ u6 ?2 M% t" S& b/ n

3 e& W6 u4 F" z3 M# V- y. hMethod 048 s' a( c. |  s- t
=========
' S+ m# k) X( o0 a! Q3 x6 G
% Q! V( J8 y1 S* AMethod identical to the preceding one except that it seeks the ID of SoftICE
+ {% P& c- s4 x3 f* A) [, aGFX VxD.
' B, W, s# H/ p' V9 w4 ^* V% e, o
, \" a% L( O, x$ L5 p    xor     di,di
. r! x4 T5 M/ J- b- p    mov     es,di
. B- v" b. Q' H8 W8 ^- @    mov     ax, 1684h       4 J( d" t3 t1 S: ^1 n8 e
    mov     bx, 7a5Fh       ; VxD ID of SIWVID
& T+ N: \% O+ q5 x3 O    int     2fh
2 o- N0 L' z8 K3 ?    mov     ax, es          ; ES:DI -&gt; VxD API entry point; f# @  Q8 }! e: h! r# D
    add     ax, di2 k2 q3 h8 g" m! h
    test    ax,ax6 P! b9 Q4 E) k! ~( Z+ W9 X) L
    jnz     SoftICE_Detected
2 }5 x( h5 [: B  O) a8 M
' O: i) l! ]) }8 [__________________________________________________________________________
+ J9 t* P2 D! J9 n" M
; Y& `" E" S8 i) P9 J" d+ K! f
& J5 G. X' d+ i9 H. qMethod 05
, u8 s4 L) Q0 ^& U/ N1 D=========  H4 j, \/ V$ K4 M' p

1 P# p& T+ z: F1 p3 s  ?Method seeking the 'magic number' 0F386h returned (in ax) by all system
* \$ T* A, \/ V( C7 ^! bdebugger. It calls the int 41h, function 4Fh.0 [/ ^/ I/ q  ~; L+ c
There are several alternatives.  
, {* a7 z' h" S( I/ O
3 z5 F5 t( @) B  X! ^9 `" P8 hThe following one is the simplest:
0 P( }' b0 e* {* W4 T% k
  s2 i( j3 [( v6 Q( W6 O' B& y    mov     ax,4fh/ b6 x3 o- e- @7 X$ I8 N( e
    int     41h
0 G( g' C9 N/ ?* V' F) x. n# Q: ?    cmp     ax, 0F386
5 N8 v! z/ F" z% C* ~1 Q    jz      SoftICE_detected) m- k' j9 J+ D8 y! Z$ |

1 [0 @+ x! ]" C6 @2 D/ N. b
: z( E3 S* |4 sNext method as well as the following one are 2 examples from Stone's
/ l% Z& D& B$ }6 X- q"stn-wid.zip" (www.cracking.net):2 z5 N4 O3 _: ?( k3 _

$ p8 g1 o" n) g& m( ^2 D. ]; q    mov     bx, cs
4 z. c* ^" _9 \/ X$ F' w    lea     dx, int41handler2
( {2 O( \+ z$ y1 B    xchg    dx, es:[41h*4]+ H* |- y8 ?8 V) v8 `( Z
    xchg    bx, es:[41h*4+2]
* a% f9 Y  C" N; E+ \4 ]. P    mov     ax,4fh
0 l3 h! w& X8 l3 v- y- l7 ?0 R  X& t  e    int     41h6 J1 P* ~2 l& N; r; c, ^
    xchg    dx, es:[41h*4]
/ K' O7 h2 Q) j0 q) n7 u) u    xchg    bx, es:[41h*4+2]( o1 [: e; S' Q8 v4 O) X, C; U
    cmp     ax, 0f386h
5 i1 m4 P! l3 V/ z+ f" P; q% ]' J    jz      SoftICE_detected1 d3 c7 U$ q! k: Z; S  A
+ ]/ [$ s1 k4 u5 k& z! C# j; T
int41handler2 PROC9 d( S' ?: ^: b9 Y. e* [
    iret2 O8 ]  P9 m: |# I3 l
int41handler2 ENDP# Z, h" a5 }# W  w( @2 I6 g
; M2 b/ Y( d# b- o5 ^

- D2 F  ?' u# N_________________________________________________________________________$ R6 O7 h- ]: h! R

7 j3 e  _' s# H) u1 e! T; j/ \; Z3 d6 H8 e; U1 d
Method 06
* V- G% c& E- p=========) G" ]# e7 S6 \9 T9 I( J, L, C6 K
  [/ H' ]8 G' u; U6 s* I
; Y4 [, v$ k) X9 X2 S$ E. R" a7 p
2nd method similar to the preceding one but more difficult to detect:' ~2 C, J/ d) K& u2 V/ K5 P- n

8 X+ O1 A, X) H( d6 n$ c/ I, \  N' M7 W8 |, v5 E# q
int41handler PROC' V8 x, ~/ R6 d9 o( o: a: W
    mov     cl,al( f& _  n# [: Q/ [
    iret
' _# w9 ]6 x* E* _# s5 j  vint41handler ENDP6 V0 j  }3 g. x1 p" ?. r
1 b8 [  X! q, i* ^* d8 |- L2 l

' P/ u2 L$ P- I9 I3 S7 C# x% \    xor     ax,ax9 }+ U3 D; ?1 f$ V( f
    mov     es,ax
1 t! b& g& A8 n! h3 b* |" d    mov     bx, cs
9 f+ p2 \0 @8 ~+ ?5 }: [: e    lea     dx, int41handler; T0 a, t' l, r, }- I
    xchg    dx, es:[41h*4]
" ?% M/ s0 |) X0 W    xchg    bx, es:[41h*4+2]! U, U- g. Y2 j$ q
    in      al, 40h+ @) Q$ D: V" ]+ a0 b4 Q
    xor     cx,cx$ \9 j. ^* o1 F! G  G
    int     41h
! n2 b6 O- [6 z* Y    xchg    dx, es:[41h*4]
8 ]+ p. B+ Y; E& a  d    xchg    bx, es:[41h*4+2]
, g. H2 {! r- a1 s1 W    cmp     cl,al8 @1 b; V1 I8 b, f# N: I! H& a% W
    jnz     SoftICE_detected
" X9 n3 l9 ~; w1 t" P; q" Z3 s: J
_________________________________________________________________________4 w( l# G; I5 E. _/ n

4 d/ |/ r0 T6 k. q* g! Y7 qMethod 07
  S7 Y7 N5 A6 C' F=========+ v# \% S5 z6 n

" t" Z: s5 k! s; d0 R9 l* _Method of detection of the WinICE handler in the int68h (V86)& j# y! }3 z$ X% i- x$ \& o1 B

% h" E* d# [- Y4 e$ C    mov     ah,43h/ d" [/ i( L; v0 j1 I# Y, _
    int     68h, z* u+ ^) R: `% u7 ^5 [
    cmp     ax,0F386h
' g6 W% ]  J) e1 ?    jz      SoftICE_Detected: {: |2 G) Q: Y! V  [6 ~3 r  K
6 o6 o4 q7 F( L5 W

/ S3 x+ v& u4 j) [& i=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
: O* _; {6 |& o# r" b& I* a$ A7 i   app like this:
; o$ I( X" W; h! z5 u
* u4 P! B/ ^& x' B  ?' ^   BPX exec_int if ax==68/ Z9 J' \+ U8 w/ j; q3 x4 U8 E
   (function called is located at byte ptr [ebp+1Dh] and client eip is: \( E& K/ M5 P$ H
   located at [ebp+48h] for 32Bit apps)7 Y0 X+ h' G. s8 f( B8 b" m0 c
__________________________________________________________________________. s9 G6 e! v% `& F  `) C# j

/ `# v  c: [  P% a2 H: F( i
7 M) d) q6 A9 zMethod 08) {2 M) X$ S: u/ t* Y" @! b2 g
=========
$ O' m7 U) I& a/ @% h2 G# V6 a
- M- ~2 b2 W, U9 iIt is not a method of detection of SoftICE but a possibility to crash the
9 s' p4 C3 u+ w& D4 msystem by intercepting int 01h and int 03h and redirecting them to another
! n5 J+ q  m. sroutine.
" [4 B% l$ l' z4 l2 s, dIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points3 Q" o8 N3 o8 H) o" s+ Y' M' s
to the new routine to execute (hangs computer...)3 A* I+ ^5 y  A3 u& s
+ }# s: U3 K* Q2 E* l7 c
    mov     ah, 25h7 g" O8 K, }0 J6 r8 U8 V* H
    mov     al, Int_Number (01h or 03h)
7 l% y% Y( F3 ~" r: y/ F    mov     dx, offset New_Int_Routine6 f3 D9 @* {6 H6 r! ^
    int     21h
5 Z4 _! f* R5 q
/ @% V1 ?% M0 s/ d4 E: l  z__________________________________________________________________________
$ D  D& K/ g) L% X, |( `  L
4 J9 y) `5 G& Y! K  eMethod 09' F0 J) V$ e7 y9 J5 k( x! @
=========
$ N7 j9 ]+ \: n5 U( q2 [/ `
; ~( M" _! m* b! M) q" B( g& RThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only8 F3 K6 v0 c. ?
performed in ring0 (VxD or a ring3 app using the VxdCall).
9 W0 |8 t! {1 I. S6 ^The Get_DDB service is used to determine whether or not a VxD is installed0 B" n: x" U, r9 A
for the specified device and returns a Device Description Block (in ecx) for8 o% P6 D! ^' `( T) j( A
that device if it is installed.
9 @  D3 v, ]1 n, Q* R% W) u: |/ n/ w7 X/ _, r7 i9 p$ T) m+ i
   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID2 \4 n5 V) x4 \7 e% u
   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)& s6 W/ I' y- }' h1 J& Z
   VMMCall Get_DDB
, x" M7 C* T+ w& l- ?   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed
5 `4 s, C) h/ h7 _, k0 I2 A
1 i* `1 M/ o% TNote as well that you can easily detect this method with SoftICE:
% }0 {7 t5 t3 {' X( |9 \: w   bpx Get_DDB if ax==0202 || ax==7a5fh
2 W0 W4 I7 O3 o* Y8 [  ?3 v1 R) g# y# w1 a% N
__________________________________________________________________________
9 D! `1 T, f) L! f2 U7 [! R: z9 m3 R4 X4 h3 k% o! b
Method 10; w7 r2 D& p/ Q1 x
=========
& l0 [2 q5 d- ^' }$ N% S" V+ u5 H$ F
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with) l8 H2 X7 j9 g8 V4 ]4 p
  SoftICE while the option is enable!!" h/ ]$ S/ ^: X- N

; e& p* h4 `9 s) IThis trick is very efficient:1 L" F7 j+ W- P. K
by checking the Debug Registers, you can detect if SoftICE is loaded
" |3 W2 d" ~, G* C' y- t(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if3 |4 _0 N! U7 u! Y+ e2 o& ?. `& A& w
there are some memory breakpoints set (dr0 to dr3) simply by reading their' P+ Q5 B# C' {8 T4 z
value (in ring0 only). Values can be manipulated and or changed as well
" _# Z0 W- a. _# a5 h+ Z' e(clearing BPMs for instance)8 K8 T* B" }( W& |* v. \

+ `/ e  L7 ~" n+ ~( x2 J4 {$ B__________________________________________________________________________
8 i/ O3 g" C+ [3 [! Q2 t
. N$ e0 K' n8 f$ N# w3 KMethod 11
$ {8 ^" B$ a. `=========9 s: F. X# r8 E4 ^+ k* O/ z
% K/ D4 X/ r& o, e2 s
This method is most known as 'MeltICE' because it has been freely distributed
0 m( O4 z# ^. [$ y2 |6 g6 \1 ?via www.winfiles.com. However it was first used by NuMega people to allow+ J# ~& ]+ N* p4 q
Symbol Loader to check if SoftICE was active or not (the code is located2 i+ Y7 M5 i9 _( M) A
inside nmtrans.dll).3 w- @4 O$ Z( Z. L: y& l

& _) ^( t& e( P- F: J* c, YThe way it works is very simple:
. i4 `( F/ d, ]6 Q; K$ x; X; hIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for6 O+ B6 h6 O& [0 m, [8 o
WinNT) with the CreateFileA API.5 Y/ n0 a; V1 Z& {+ P$ z5 |

' v% q1 Q% P/ F# _Here is a sample (checking for 'SICE'):6 z  o& V1 N9 c
) i9 _% W' G  a6 h  Z/ c
BOOL IsSoftIce95Loaded()) G0 c3 c% P$ \& h* A5 y
{" x' X+ ]$ v( t. ^& o. G
   HANDLE hFile;  
3 D# R/ S$ y# _8 Y; w% u   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,( V! o4 k$ P) k* }7 |
                      FILE_SHARE_READ | FILE_SHARE_WRITE,+ \7 A6 w4 _3 M6 q9 W9 r8 b
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);/ M' s2 q: q/ C+ U" O- V
   if( hFile != INVALID_HANDLE_VALUE )" [! k# E& R! ^9 \4 ^" D  ?
   {1 A* J$ n4 n8 Y7 e" R
      CloseHandle(hFile);
: T6 }$ v: [4 S( D0 P8 @      return TRUE;; D* x7 ^6 Q& W) X  w
   }5 c; l, {5 B, m3 ?  E$ Z
   return FALSE;/ @7 s7 x6 s% s) s9 T9 }
}
- k7 U) V# ]) X  h. w1 r5 j& n" U& o5 W3 W
Although this trick calls the CreateFileA function, don't even expect to be0 Y8 P. h" U( R: w0 d7 n  R* t
able to intercept it by installing a IFS hook: it will not work, no way!
$ M2 h( N; o  G8 @8 @1 LIn fact, after the call to CreateFileA it will get through VWIN32 0x001F) {  D2 S5 e8 H' f0 f
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
, b5 w6 r" T& @+ Q+ q+ B; Vand then browse the DDB list until it find the VxD and its DDB_Control_Proc
1 E# l/ u, P+ e! E7 D& ], Bfield.: f* h, }5 R( f
In fact, its purpose is not to load/unload VxDs but only to send a , ~- d2 W6 `9 W& q$ `* ?# I
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
& w8 o: D1 x' R) [! g* M4 b, `' Rto the VxD Control_Dispatch proc (how the hell a shareware soft could try
: H0 I7 v. }& @6 m3 [! m6 \% T: oto load/unload a non-dynamically loadable driver such as SoftICE ;-).5 P5 u2 R" h: o& O* v' ~
If the VxD is loaded, it will always clear eax and the Carry flag to allow
+ v1 K7 v, {. b9 oits handle to be opened and then, will be detected.
& z7 u; S) Z9 ~' L9 NYou can check that simply by hooking Winice.exe control proc entry point
* ^+ Z& ]  w* v3 X, ~5 ]6 W( B+ jwhile running MeltICE.
: S) _8 h$ n' D) @4 G6 n( P( G. l* l5 Z0 H- {& C
4 O+ Z) T( D6 n+ a( j6 c. ]' X
  00401067:  push      00402025    ; \\.\SICE9 \( d% Z% }/ L0 V
  0040106C:  call      CreateFileA+ U1 X, m9 i" k( k2 s/ N
  00401071:  cmp       eax,-001% s2 C. E* {2 R# a
  00401074:  je        00401091
+ F5 G/ H. y" }5 u. Z' `; x8 W5 D3 ?( O' r4 S* r3 T
3 i: U( q1 i" |3 k, ?
There could be hundreds of BPX you could use to detect this trick.
- P; D5 y2 v2 q; L/ z2 s4 Q* f-The most classical one is:" s* Z9 j( g' i
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||. `$ W, l4 X$ i# [( O
    *(esp-&gt;4+4)=='NTIC'
3 f: @) V$ p( B! b$ v( N
/ _% R- p; ~& D5 [-The most exotic ones (could be very slooooow :-(3 a* d3 f) _7 v. W& ?0 k, P2 h: S
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  
" t5 {$ e. c2 A" B- F) A- G7 i. R     ;will break 3 times :-(
. @/ I5 N( H6 Z- @
9 h( L( i& [3 z* R-or (a bit) faster: 1 z+ J9 Y+ N: f- j9 M
   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
9 V; h+ L  e) R% i) L8 I
& @  l- z0 H: N2 f9 A2 \$ s& O$ S   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  & v: v! S% F5 h
     ;will break 3 times :-(2 ]8 [3 _' `: a7 T: N& Y! R8 C

7 B: ?& t: W* ~4 R1 K3 j-Much faster:7 Z% |, s% N* h( z3 g* N" _
   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'9 P# n: C: M& i+ R5 R
1 J1 b+ f* d3 f7 A& C( h: w
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
7 W8 S4 ^9 G+ A5 ~$ Bfunction to do the same job:
, K, k' K$ @8 L, q- H, S8 y
. g* z  [2 K; Z+ v& `+ @   push    00                        ; OF_READ& J5 y& c$ K, f) ^. w; E. `! F
   mov     eax,[00656634]            ; '\\.\SICE',0
) E8 t+ `. L4 @0 s% G6 N7 M( f   push    eax* X: Z. d' f0 Y
   call    KERNEL32!_lopen
* t+ ~4 H% ]. @& U   inc     eax  |0 i3 b6 M$ P7 M7 |* v) i0 Y/ M( ~
   jnz     00650589                  ; detected( _, _: L+ D  i5 t
   push    00                        ; OF_READ; N9 A3 m. F, F' j! P$ d+ p2 D
   mov     eax,[00656638]            ; '\\.\SICE'
* T) d5 W1 T- U* s$ Y/ V   push    eax
6 k( ?6 ?) F6 T: e! r4 v: R   call    KERNEL32!_lopen
' n; x& }" L3 y) u: z) Q# A   inc     eax
: V* n7 D" Q: U- `" w9 ~   jz      006505ae                  ; not detected8 R- X# ^) j: I) W. W3 J. L

. {  n/ u) l# l" l9 J& A7 P7 I- Q7 K4 ~' y
__________________________________________________________________________( F# \3 r& p/ T- w) B* B0 Z
5 @) R6 |+ }# v8 @' H, H( O
Method 12
* h" y3 t" g( v  }2 Y1 }=========
% @8 l* X5 S" g3 H! x5 I6 U. A6 S) |1 h5 f8 K3 e/ B6 r
This trick is similar to int41h/4fh Debugger installation check (code 056 E, {& z: ?* B$ u+ ^; [  Q
&amp; 06) but very limited because it's only available for Win95/98 (not NT)0 c- `: D" \& {3 k  P
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
: _9 ~- b7 S2 j. F
& A9 r7 c; s/ a6 w5 Z   push  0000004fh         ; function 4fh" l5 Q& `* j) O. N8 N1 [- b9 j
   push  002a002ah         ; high word specifies which VxD (VWIN32)
, \% i8 v3 `* ^2 X/ Z# `/ ^( m                           ; low word specifies which service0 X( q1 }" W6 x  @+ p
                             (VWIN32_Int41Dispatch)  n/ m' \3 P! K, Q
   call  Kernel32!ORD_001  ; VxdCall( k) _, `0 {" K
   cmp   ax, 0f386h        ; magic number returned by system debuggers
. G, z; L1 i. L; B4 ]8 N: D5 U" P   jz    SoftICE_detected5 O5 m: \' Q$ W+ w3 u
  y/ c7 O" ~. V2 k
Here again, several ways to detect it:8 u4 B- H# O, x6 w: r* q0 p

  ]1 H, u! E) d6 o, G9 R5 U    BPINT 41 if ax==4f
( u3 ?9 y" V# |* O- E% G9 i: _+ B7 d) z# i8 h' Z
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one1 I7 h% G+ H# q$ e6 N

' Z4 P: A% Q; y% a. D! t- P    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A3 ~: _1 i- E$ L( M

: E/ s- T# c* ]! G' D# K. j& ^    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!
$ Z- q- t; G) h7 `" y3 c8 {! B! [# U- p* x! |! k
__________________________________________________________________________
: Z. R. W6 w2 L% y. f) T. b
' s5 m' y5 F! t3 N! ~Method 13
! w) N  T& W2 u: _( P) p0 F=========( f1 a; ?1 U7 j: e/ r
0 ^9 f; M  S' l. s; Q
Not a real method of detection, but a good way to know if SoftICE is
! P9 n* o( G: A5 E3 a  D% U8 P; Jinstalled on a computer and to locate its installation directory.
: k: ^6 `/ Z# j0 b2 _/ A( w: PIt is used by few softs which access the following registry keys (usually #2) :5 t  L4 d) i2 {: j% S/ p! R4 L

! ]4 v8 R; Z- N; J1 g-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
! ^9 r1 x) e8 a$ r' Y6 U& C1 x  O) ?\Uninstall\SoftICE
7 _6 y1 m, t4 m* ~: \6 H-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
/ S3 _1 k- R8 A3 q: c8 x+ g-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion( P# T, ?. g0 Y- _+ C
\App Paths\Loader32.Exe& T6 h9 a8 }. |  {

. T* ~$ ?8 B) X2 l$ O! U# u4 O$ z1 O0 Y
Note that some nasty apps could then erase all files from SoftICE directory( q5 i' F% W5 b0 [9 u7 J
(I faced that once :-(3 l( d1 E; K8 M4 x- F3 }: l

2 ?9 X/ [5 e, ^3 M' N# \Useful breakpoint to detect it:
) U, H; m. K, l1 T$ O; k( X+ v) m4 b- ?/ R
     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
' H7 T6 @0 _& Q8 p3 y/ I8 S
+ ^7 O2 z9 s. x( |9 v* d__________________________________________________________________________
% e- ~5 D+ x8 V1 {; q' I  M& ~1 i2 A6 A2 ?/ P* k4 @" a

7 w/ }3 f6 v* b2 @8 J" i8 q0 o1 bMethod 14 $ \; @* g# y5 }; @# }0 `4 W) U
=========
' S& D* n# b0 y% @# W: ?( q1 R9 M  e& r! t4 W! S0 N
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose" \& w# ?1 ^; b$ o
is to determines whether a debugger is running on your system (ring0 only).
! |3 V% @0 I% @: Z6 e  |- u* t- t% F& K' x4 J2 I0 h0 H  z
   VMMCall Test_Debug_Installed
. A) u1 C1 z& h* y; s   je      not_installed
/ {. d) O+ C" z' ~9 n, F1 l$ t
3 K2 i8 ]" H" I! ?0 H; x# HThis service just checks a flag.
' I  j1 i- i! x0 ?! D+ s* o</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关注公众号

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

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

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