About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
8 Y2 v5 @6 I  F! m7 m/ v7 r- k* Q<TBODY>  \% g( t: x' J( D6 H) F; t
<TR>
7 q* j; ?# K6 D0 Z<TD><PRE>Method 01
9 Y& l# ~/ r+ B' `+ i. t! f" ?=========9 r+ J3 F' d# d8 Q0 H6 W

. f4 F' w8 H. l1 K1 G/ y$ nThis method of detection of SoftICE (as well as the following one) is
8 K! B; A) e9 R( ^4 L& n6 g; e8 Hused by the majority of packers/encryptors found on Internet.
6 C) ^/ J8 A' k/ W0 f/ cIt seeks the signature of BoundsChecker in SoftICE4 d2 i  C- [) N6 a1 y4 l
& J; ]; u% X# q$ V7 s. A) L
    mov     ebp, 04243484Bh        ; 'BCHK'1 U: }" v  f2 U& c
    mov     ax, 04h
# v8 g# v0 b9 N! K    int     3      
" q/ B- W4 \2 c6 W    cmp     al,4) z/ B( Q# l- ~$ [+ t9 P( `
    jnz     SoftICE_Detected
' E5 Z9 J6 J: [2 n
. a: L0 M& V, [* S. h: E9 t___________________________________________________________________________
# ]8 q/ S6 M- Z# Z8 W2 g3 J7 {5 Z& C9 C- e, {4 H9 Z+ U; Z6 g8 I
Method 02
6 o0 |% T) _( \6 _& \=========* J* {" V- \& I7 S5 |1 I
( C2 B* [  Y, G# z6 u% H0 j; e
Still a method very much used (perhaps the most frequent one).  It is used7 @* T/ T; i# j' O! p# I. p1 G
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
6 }8 J2 n& I5 u" J: i( R- Y; ~" l% Ior execute SoftICE commands...
: M9 o: f% R' [5 gIt is also used to crash SoftICE and to force it to execute any commands
2 v3 z9 m' z+ [( l/ v(HBOOT...) :-((  
! x! a/ ]# X* ?5 b9 a4 c/ c% M1 O+ Y4 n& V
Here is a quick description:
' G% Z0 v: g! G4 Z( l& l7 }" Z! |; S-AX = 0910h   (Display string in SIce windows)
  B- m! H( D6 @' w4 u-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)
5 S" j( f% j$ \$ \-AX = 0912h   (Get breakpoint infos); q. R( _& v+ U
-AX = 0913h   (Set Sice breakpoints)
4 i+ V+ B- Y7 K  z, S-AX = 0914h   (Remove SIce breakoints)
9 e6 z* w% |% C2 Q; d2 g# r9 V: }( X- f% n5 S: S  R  F; F
Each time you'll meet this trick, you'll see:. C, X5 Z9 ]1 i" }" d0 R
-SI = 4647h
9 J1 }8 K+ U6 J  D0 K. @5 G1 R-DI = 4A4Dh
3 {, e; c. P- e( t6 S) w3 aWhich are the 'magic values' used by SoftIce.
; Y- x& m7 m, g1 i5 N' nFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
* M/ n5 c$ @. F+ b! i/ v& X8 X+ k$ Z+ x* C' I
Here is one example from the file "Haspinst.exe" which is the dongle HASP
" `0 K9 k: R/ T0 E2 Q" D' SEnvelope utility use to protect DOS applications:& h# w3 E! l5 _8 z: e

( Y' |# P! E3 J( U* m& R% _. w. w* p7 x" J) ^! {
4C19:0095   MOV    AX,0911  ; execute command.: A' m0 }5 m5 O7 I. @
4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
$ s9 U% y# G3 M4C19:009A   MOV    SI,4647  ; 1st magic value.
0 j0 U2 I$ O! T; x) z4C19:009D   MOV    DI,4A4D  ; 2nd magic value.
5 `% S! t. H( I& n9 Y4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)( H# ^/ v* P4 n0 J( g6 h( k, u
4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute
; [: V3 e5 j7 {8 c- y: \2 f. s4C19:00A4   INC    CX
, N! E9 L" N* T4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute: @+ c1 e  _+ N
4C19:00A8   JB     0095     ; 6 different commands.3 {3 o7 g6 P. M9 D' [1 s
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
8 l  q, c# E1 f8 B- F. l) v( }: F4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)
# c8 H5 M* \, i3 o8 i0 [0 T$ m8 k! y: n+ ]* n2 T
The program will execute 6 different SIce commands located at ds:dx, which0 a( w0 d! ^. g. F
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
6 g6 f4 \! Z" d% D5 l7 h+ _
# o& v0 z  a! W4 D  u6 Z1 U5 d* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.' S# r2 v& ~8 k  Y- @: p
___________________________________________________________________________2 h5 [4 ]% x& R9 c, B/ g
7 `1 K- g. }6 Q: }( h% j$ m  H
; z3 [5 [+ o) d# j) n7 }
Method 03
$ }, |9 n; ~. E! H4 |; N5 O/ [=========
( B: e2 i) l6 H) J' }) x- v$ {" u' ?# p2 k1 {/ X, @
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
3 {5 C' M- F9 K% u: g4 ?% W6 w5 w(API Get entry point)
4 E% K8 O: d2 v        
* d9 s/ p9 j+ g# S6 d- K/ C. H1 T1 [4 J9 w
    xor     di,di
5 d9 W4 ~3 I  ]! q3 F    mov     es,di' M0 R7 K  X, @/ ]/ C" N
    mov     ax, 1684h      
  r6 d* n4 `/ J: r2 q5 `; S    mov     bx, 0202h       ; VxD ID of winice
1 q) S# g; L) x* G: Z+ R    int     2Fh
: B$ n9 O' b2 ~- w9 W$ O/ Q    mov     ax, es          ; ES:DI -&gt; VxD API entry point- d( Y$ ^2 ?- t
    add     ax, di
! K: f# j; Y0 Q    test    ax,ax
1 C/ X) g' A8 Q    jnz     SoftICE_Detected
! F# S& e5 ^, q$ k7 `. M3 f0 M9 s( i8 B+ z9 G, j; B6 u8 Y
___________________________________________________________________________
/ l9 h  F- J. R/ m/ T
2 V3 h- o0 M5 m+ NMethod 040 @" o1 P8 \! J3 M
=========. Y: I3 }* k2 \: q

- b% e4 Z# @  o7 v3 ~: A) UMethod identical to the preceding one except that it seeks the ID of SoftICE
7 z5 A1 j6 z* r+ b3 pGFX VxD.
9 }2 r" r1 F) P* K' H* S( [% n: B- q$ M+ R' }" V
    xor     di,di5 }; T# D( {& \) n# U, V1 O
    mov     es,di  Z& s, d% `) V  A% l
    mov     ax, 1684h       * `$ d9 [' D4 b% }/ V
    mov     bx, 7a5Fh       ; VxD ID of SIWVID8 W/ ?  Q, ~! i( U2 S
    int     2fh# }! Z/ G$ ~5 Z# D/ t0 @4 D
    mov     ax, es          ; ES:DI -&gt; VxD API entry point! B5 B4 z, a# i0 ]
    add     ax, di7 C+ C! e0 d9 Q/ N6 F- O# E
    test    ax,ax
+ {9 H) O, x* Z6 n& p    jnz     SoftICE_Detected0 N0 l* `$ y. m: C
' n: l! G" W* }, G
__________________________________________________________________________
3 O+ i. |3 u3 O- n4 D3 R9 c
/ q* C% X! P8 Y/ e4 a% N6 R/ ?: _4 z8 Y' c
Method 05
* }2 x9 \; z. F6 E' }; m=========  n5 U0 r+ y/ X( {  {4 O
5 ]9 Q& `$ R$ U( [8 a! ]6 Z
Method seeking the 'magic number' 0F386h returned (in ax) by all system& s3 ?' g# g: z8 f0 c; F/ `
debugger. It calls the int 41h, function 4Fh.- T  y7 }5 o0 J4 B1 \/ _3 o
There are several alternatives.  ) G8 F' _9 q1 w/ Q' Y7 O; s5 m

+ \- i# ~1 H# t% u0 d* ~The following one is the simplest:: t8 C  J7 Q' r7 k
$ P. N, T4 w2 Z* I% D( P/ V
    mov     ax,4fh" E- Y/ ?4 ]4 V3 E
    int     41h. l3 F6 ~6 C2 f* |3 Z
    cmp     ax, 0F386! Z2 q2 M' d" R$ R6 D2 }; r
    jz      SoftICE_detected
  C- r9 r  {. l: R1 v# a  ^5 C: M# @' E! x; q& \1 z% _+ A. `

& R1 n/ P3 Z9 X5 \2 n2 ?Next method as well as the following one are 2 examples from Stone's
& P3 g3 `( ?( M& e6 r/ m/ T"stn-wid.zip" (www.cracking.net):
+ J6 Y( e: Z/ E5 c4 c; W
4 {( U/ [3 [- k6 s+ l& R! v    mov     bx, cs* D2 p- c* c2 T( Y3 Z0 m& u5 u. D* W
    lea     dx, int41handler2
" B  }( J6 o8 i, Q3 w    xchg    dx, es:[41h*4]6 x  W2 e1 M9 u" g0 e( G  I
    xchg    bx, es:[41h*4+2]
0 ]- k: }& M- e. {    mov     ax,4fh: K  y: R# U& l& U+ V5 V% O( ~
    int     41h( ^% ~0 i2 w  [
    xchg    dx, es:[41h*4]- k% h* q. k4 E6 Z1 S9 Q
    xchg    bx, es:[41h*4+2]
9 ?. a1 V  ^; }6 L    cmp     ax, 0f386h4 D5 Z% M$ p5 R% d2 w" n7 U+ S
    jz      SoftICE_detected; ?0 {/ e* i2 e. Q* R

9 J7 s' }2 x3 R$ L: Dint41handler2 PROC7 N# W" {- ^) M. B0 }
    iret
6 r* V1 v5 @  sint41handler2 ENDP
+ ~3 o2 R; p. H# i6 |; E& e5 {$ Q# H# e; o( r
5 D6 d& G' Z9 A3 d3 }. Y
_________________________________________________________________________
9 k  F# s7 @& S" u0 B' t7 I; b( B  E

* O) O# f* T7 WMethod 06* [6 i! ^$ d; D" Y1 K
=========
7 |/ v6 W. y* c* A1 q3 \" y3 g7 F; ?/ o& |: P% ~$ j9 D- Y
3 G+ Q* m/ S2 ^( A
2nd method similar to the preceding one but more difficult to detect:. ?( w' Y. f# k. S0 v5 _
# A" [% |7 ?5 _4 i$ \  b
  F. t2 P0 E3 u1 _
int41handler PROC
* C3 l( `- w( [    mov     cl,al6 B$ ~: h# _0 y5 l* Z
    iret
% G. ^: c: Z* c' \! b6 ~% N4 pint41handler ENDP
. q- }1 m0 u$ ]& P+ b  {) Z' `% e+ q7 R, {' }' S9 Y* q/ \  @8 e
& c  c2 c) S4 f( z, c
    xor     ax,ax5 Y8 R: b* V% X7 v, ^
    mov     es,ax7 E' a3 B: F: Q! `. N+ K% j2 j$ [
    mov     bx, cs. y' i3 m0 @1 P4 F
    lea     dx, int41handler: v0 X0 V7 k& y/ ~
    xchg    dx, es:[41h*4]7 K" `6 m0 C1 ?( S% b. a; S$ m
    xchg    bx, es:[41h*4+2]
! B0 f" [$ r$ i$ _) ?    in      al, 40h! Q4 |, T2 w8 S: u& x5 ?, q
    xor     cx,cx3 N7 W0 ]7 F8 g
    int     41h8 a7 C# B+ H- S: g7 |% l
    xchg    dx, es:[41h*4]% k& R6 f4 K' X) [
    xchg    bx, es:[41h*4+2]
! K2 V( X; b, r  U' c6 S    cmp     cl,al
, e9 J2 {: n0 [. Z: N8 K8 w    jnz     SoftICE_detected% `2 H, }% @, F9 |% Z+ y2 b* F3 A& j

8 Q! F$ O& \4 N_________________________________________________________________________
$ [3 F* B6 u: y4 I
( w* b  z! L. ?2 T  qMethod 07
5 L  [: R2 I: H& @# N2 B+ R=========3 e) b7 o  }: Y  G+ T1 s8 x; Z3 r

: t/ F1 ?  q- m3 A  ]8 }3 eMethod of detection of the WinICE handler in the int68h (V86)0 r3 L- t9 [0 p- B6 d3 \

' Y: K8 y0 O8 V! ^* m7 C    mov     ah,43h
7 `/ C9 o2 _: E" ?    int     68h4 x; n2 W; [$ L) o, j; v
    cmp     ax,0F386h# ?$ L0 u: K) j6 o0 H
    jz      SoftICE_Detected  c" L7 z/ y2 I0 r
& s9 T2 T. K* ^' `4 d2 T

8 a0 x& m9 P) P& l' l=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
0 h6 n# w- r7 ~! K* M" a4 z& Q- d   app like this:
$ s8 f4 x  d2 R/ g
/ Q( v  _0 u9 P. L* Y7 F0 O   BPX exec_int if ax==68" L! o' X' F/ W4 Q6 |
   (function called is located at byte ptr [ebp+1Dh] and client eip is
! O  l' z/ T. W. l  ~* W4 Q   located at [ebp+48h] for 32Bit apps)
4 g! k+ x9 M% g__________________________________________________________________________: }! a  w) j( _& ~: y! n5 b, w

8 b+ |" y4 v9 Y# o5 R% g; y, U: S6 M$ _3 ?; E2 l
Method 086 x6 N3 f; |/ ^1 D# K
=========7 [; f* ~" Q" I" V# R# c0 J

+ j) x6 J7 j3 H: ?) oIt is not a method of detection of SoftICE but a possibility to crash the4 D, K- e7 k# L) s
system by intercepting int 01h and int 03h and redirecting them to another
1 n7 R( Q  a& w- o/ ~5 V7 C' k6 b, groutine./ V* k( O3 B2 n% g1 Q  u* {
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
% Y7 J& j& ^  X8 qto the new routine to execute (hangs computer...)
; H  m, @) t! l9 C, ?4 D6 L. N9 F. q% X- S3 r) i1 U
    mov     ah, 25h0 Q0 ?/ |! H5 [5 f' f
    mov     al, Int_Number (01h or 03h)) D0 o0 _! M# _
    mov     dx, offset New_Int_Routine+ ^8 k% Q; q4 P1 W* F0 P9 c& ^
    int     21h
/ t) U# I) Y6 G7 \2 m6 q' N# d" @4 o+ c2 y
__________________________________________________________________________
# s. K9 P( H+ X* I$ O$ r# D6 L$ I% U) M( d* c! i5 v; C
Method 09
1 D' t9 Q) z1 B' ], n( A+ C2 N/ P& i=========
8 k( X# E/ A  J1 U! M* |2 X
9 b0 H3 }3 I3 s* ]$ l0 [+ g6 q* [This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
# M5 O% C# w/ l9 r" F! J; e2 Y" v' Rperformed in ring0 (VxD or a ring3 app using the VxdCall).! t# a9 l4 t* q8 w7 V; K
The Get_DDB service is used to determine whether or not a VxD is installed
7 k+ s2 U9 _- o; p* P4 b4 @for the specified device and returns a Device Description Block (in ecx) for' k/ G4 G' r' x2 F/ n6 ~9 t! D
that device if it is installed.  O! j* u* i1 i3 t/ D

) X/ i! p7 r6 ^" p  A/ _! P+ |   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID
: r+ ~5 U6 ]! l) @$ w   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
3 z  L$ v; e7 N$ u   VMMCall Get_DDB5 o7 |4 Q0 h3 W- Y) M
   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed
- W' }9 e; U. |9 l1 W% b6 F
. H0 |$ v4 @* J. z# ENote as well that you can easily detect this method with SoftICE:
/ X9 Y+ g- m# E: Y. W   bpx Get_DDB if ax==0202 || ax==7a5fh
- _& {+ W+ l5 y) a, o6 U# p3 U6 u2 P+ ~- Y- }' s2 z
__________________________________________________________________________
# i/ L( n) b. T" U) o* Y6 d# V' Q( H8 H( g
Method 10( z0 A: r; K& }
=========
) t; J: N1 u0 j; B$ r! r- x& I" f/ ~7 w5 o7 ~. U
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with
: c0 a2 P& H, x3 p  B( N  SoftICE while the option is enable!!( Q  q: }' Q$ J: t4 d
( f& k" d3 M3 R
This trick is very efficient:
) X0 g3 G( W* Y, G; f3 \by checking the Debug Registers, you can detect if SoftICE is loaded
! u% h8 k3 ^) R( A/ d, D(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
  P6 C8 E! Z" Jthere are some memory breakpoints set (dr0 to dr3) simply by reading their. J- t9 S8 u% z$ I; |
value (in ring0 only). Values can be manipulated and or changed as well
/ `2 U4 o0 \/ S$ W0 u. S(clearing BPMs for instance)- E9 `) a, ?: Z$ q' Q4 B

2 k; ]) ]- p6 c# T  q__________________________________________________________________________% d; F$ e* k0 a, g7 d, }5 m

. _" x1 u# o, _$ G- [- c8 YMethod 11
4 W# Y: }% O; n2 ^5 j3 s=========
) {1 w- V, r% g% X6 k( t, ~
- u+ v- B, d0 Q2 sThis method is most known as 'MeltICE' because it has been freely distributed+ S7 n# k5 R, ^$ |) ]( M: ^0 [' {
via www.winfiles.com. However it was first used by NuMega people to allow
0 u- @# A) Q; Z5 m* t, [Symbol Loader to check if SoftICE was active or not (the code is located
1 V6 {* z, F1 v+ {+ ^inside nmtrans.dll).
. ]4 w2 n, P8 I) \3 w3 V5 d
9 E8 P' C$ W2 q1 U: f$ [The way it works is very simple:
3 A1 t0 C6 L9 B% i8 vIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for' D; K, h3 J) c6 Q
WinNT) with the CreateFileA API.5 [8 U" C1 U& r; S& h3 {

  s' A6 u, C! m: V4 zHere is a sample (checking for 'SICE'):
0 U3 {+ l4 t  @4 j
* w2 Q! F1 o) L# G& jBOOL IsSoftIce95Loaded()5 n2 I: e) i( K' D- g# d+ X
{8 N3 K$ U  J& I( ]* M4 {1 L, R
   HANDLE hFile;  
- \+ X$ j' Y3 ]  s$ g: L# y+ i   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
' {9 V' a$ f* S( k                      FILE_SHARE_READ | FILE_SHARE_WRITE,
5 ^8 G! m5 M! z% y) \! t; N  Z  d                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
/ T. @! `; {- D# s2 Y% O   if( hFile != INVALID_HANDLE_VALUE )$ S5 m' U- Z. b6 z
   {3 p$ D$ n( R0 w/ x5 M
      CloseHandle(hFile);
; B0 d, V, S, q+ i      return TRUE;( G2 a* R' I* v+ v7 @
   }/ |, H1 e' L6 P1 A, w; b2 o
   return FALSE;1 j# V# ~- R, Q1 j$ d
}
5 E$ T. n$ R$ O& S6 l; d: m, B; I& U) M: Q; ~
Although this trick calls the CreateFileA function, don't even expect to be) z5 y! ]! z1 [( l3 P- {
able to intercept it by installing a IFS hook: it will not work, no way!" v3 O. l0 l1 ]2 b
In fact, after the call to CreateFileA it will get through VWIN32 0x001F+ M( X* r' J! _' A& Y  M% {
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
, p+ `5 `) i% Iand then browse the DDB list until it find the VxD and its DDB_Control_Proc
; u3 M, Y7 F* U/ x, v1 zfield.; X* ^4 h- Y& V1 {( V- V, o) f/ O
In fact, its purpose is not to load/unload VxDs but only to send a
( l4 G4 C% ]9 K) g8 u4 oW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
) i' M  L: a4 Y( O2 tto the VxD Control_Dispatch proc (how the hell a shareware soft could try
2 T$ R- `: A+ [$ O! J' i" ~/ |. dto load/unload a non-dynamically loadable driver such as SoftICE ;-).& @% k) m" N# `  x; g. e
If the VxD is loaded, it will always clear eax and the Carry flag to allow
( q8 v8 n! x) Gits handle to be opened and then, will be detected.
9 Q/ q, {% p1 S3 g+ u0 [You can check that simply by hooking Winice.exe control proc entry point
9 K+ G* L: |4 uwhile running MeltICE./ i7 r0 u5 D& ]' [

3 m; J7 x! @: J' S: M2 s& T
: C5 {% [$ C8 n( C/ Y* o  00401067:  push      00402025    ; \\.\SICE
3 |" x, Q! m: G. U9 e  0040106C:  call      CreateFileA
4 M5 t6 Q1 O1 r& V$ ~0 e' R  00401071:  cmp       eax,-001# }* s/ _: ^' c7 c6 H. y
  00401074:  je        00401091
3 I, d, r- E) Q: {
1 A4 ]0 i0 P/ x5 [* T" ], D( |& a% S8 x* K& E" |1 y9 @
There could be hundreds of BPX you could use to detect this trick.' {( j$ h) u9 {0 Y2 a
-The most classical one is:
. Q/ T- D  E3 e# ~8 o) c  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
. i+ d' D- J  L3 P3 {! D0 \4 w    *(esp-&gt;4+4)=='NTIC'# o1 n: l6 o7 Q. t$ S' I
" M' D5 l/ k6 `( k. t" u, |
-The most exotic ones (could be very slooooow :-(* D, H- [: P2 O/ }; j% }! b$ l- ^* _
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  
- i" l; A- b4 D' q4 Q& r     ;will break 3 times :-(6 v# C% N& \  q7 H9 u# d4 y+ r8 H# a

0 v0 m9 D3 J: f5 a; _& W-or (a bit) faster:
: d2 }) U0 K( o, u' w/ b   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')1 s, n9 t3 Q7 x2 d
  m5 T* Q  g3 Z. V+ Q
   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  / Y! n1 ~$ K' k
     ;will break 3 times :-(
8 O% M) j/ M8 x2 ?! @, W% T! W/ {$ y" I7 ?( ^3 n
-Much faster:
: ]1 |% z. X/ J) }3 R0 @9 f( A: J   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'# \$ P3 H' H' B" L0 b

; I$ D$ ~! u% V. PNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
8 l5 ]% R" d6 pfunction to do the same job:
! b: H; u. d$ h  I* U4 d1 r* y- C- H: G7 z) c2 ^  ]
   push    00                        ; OF_READ  i. x: r$ q' M$ o, [. Y4 f3 C
   mov     eax,[00656634]            ; '\\.\SICE',0
3 T7 B( j* ^/ h% V& d0 {   push    eax
. W- \/ D0 l# Z; q- W9 D   call    KERNEL32!_lopen  F: M% F1 e3 y3 E8 N* f/ I: H6 l
   inc     eax/ n- \4 O: b8 s1 n" ~, K2 J
   jnz     00650589                  ; detected# ]& Q) V1 ~8 q! ?
   push    00                        ; OF_READ$ }" b0 A/ z0 t
   mov     eax,[00656638]            ; '\\.\SICE'' x2 N5 m* F* O9 L
   push    eax
( u9 J" o  z! w( H1 X: h   call    KERNEL32!_lopen
' v) ?: p. H2 P* x   inc     eax
. i4 _& j5 y! {4 ]   jz      006505ae                  ; not detected# g/ S1 A1 S$ k# u

& a; D1 u6 O5 W; E' C  g
& O3 U, _6 g5 {* ]3 J__________________________________________________________________________& |5 r5 k9 I% a4 X

% l# h8 T' r& `* l, T% OMethod 12
! O0 v2 G# ]# \4 Y=========
1 J9 e* Y7 j0 t9 |- ^# q1 Z) ^. N9 [: [
' I  L( P" F, }5 T& |/ n4 OThis trick is similar to int41h/4fh Debugger installation check (code 05
6 u% B1 ^* d/ }  {&amp; 06) but very limited because it's only available for Win95/98 (not NT)
" r: g: I- K% p) h; B6 D# ~# Fas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
/ h" y1 e- A: b: s# ^3 s! R+ }0 u
* O6 W: e* P0 o; [" G   push  0000004fh         ; function 4fh) y" ^" d; @  ^2 n
   push  002a002ah         ; high word specifies which VxD (VWIN32)  t' X0 |! g# |3 `
                           ; low word specifies which service6 a+ E' Z9 l, k& H0 W; g
                             (VWIN32_Int41Dispatch)" O) A- D0 T4 r, w" P+ T/ A
   call  Kernel32!ORD_001  ; VxdCall6 b& n; Z; W! X1 s( t
   cmp   ax, 0f386h        ; magic number returned by system debuggers
" A. j$ I  C2 T, l1 ^   jz    SoftICE_detected! q* H# n. r9 a! u- m

  `" W+ R9 E0 v9 U0 i3 ]/ ]Here again, several ways to detect it:
0 f3 U' S, X# L4 d
* g3 C& x& Y7 n6 c    BPINT 41 if ax==4f
! k0 t0 [& [2 ~: B
6 T$ v6 r! s+ d1 U( V6 H1 [    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one1 B6 k/ O! Q8 u4 K7 a; j0 ^

6 Y; {5 S4 l6 f2 [2 G    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A) ~, m( X, d, E3 x

# d) }5 m8 r) ], I- I. A    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!
+ _+ T9 k) ?; `1 p6 O( u: }$ r# z; Y" F+ V, a
__________________________________________________________________________7 \" w8 V& T: X- }' R

! x. O9 w2 M- q/ MMethod 13
% f% c5 s2 c" U; o. s=========
2 J) ]; Y$ N5 H, A& U1 i1 t. C& P4 {, {8 ]# R* }; h9 Z
Not a real method of detection, but a good way to know if SoftICE is
) |) \# F7 t! U0 h1 Minstalled on a computer and to locate its installation directory.
! S, m$ f% w- u0 n7 sIt is used by few softs which access the following registry keys (usually #2) :) f# x1 x# x# j* `6 L1 K, P2 v0 a
/ m! S$ D. ~# ?6 ]
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion% g3 K- c6 i9 _# `9 ?* b8 f1 j
\Uninstall\SoftICE& X# p2 f; N  I
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
3 Z3 e7 }; X/ d5 {  ^  q5 w-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion3 p$ p6 A. n! ~! C
\App Paths\Loader32.Exe
2 _' D9 p1 ^2 I4 _
% b, H# _! R  Z! B- P- g. ^& b
$ v% G+ ^$ [; G9 FNote that some nasty apps could then erase all files from SoftICE directory- }( C* A, d* G0 ~8 A
(I faced that once :-(# d: b, {7 z; w; G' |# L) k" @7 U
" E4 k! S; ?7 X8 y) J
Useful breakpoint to detect it:
. X8 G1 x+ U4 j" f, g* j2 k6 g4 H( j0 ?7 J) l
     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'5 d. y, j" b7 ^/ g- D! L
! q7 V1 I4 i$ J4 v* s' F
__________________________________________________________________________
! h5 Q1 z# S* F: `: P3 [/ U3 p: ?! M7 d* l
' K+ ~$ N3 Y8 a+ S- t6 F
Method 14
% ^* |8 s: E, P=========* M. r; a. s9 E- \
# k( h% B1 Q! e2 O. O" Q' B
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
, m6 ~! U3 o- p# |* x/ Cis to determines whether a debugger is running on your system (ring0 only).
; @6 T" y5 M7 [9 [& l# D- ?+ {. W( J% }
   VMMCall Test_Debug_Installed" ~% O. T1 K) a6 \( ]3 v
   je      not_installed0 Q7 o2 d- V0 N/ r3 I
/ z& y$ H/ \$ {. A3 g/ e
This service just checks a flag.
/ i" N* f* W3 e: Y</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关注公众号

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

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

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