About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
3 H* m& D: O6 u# Y<TBODY>
& ?/ c3 S1 i3 W2 |( e8 L<TR>
  W# W" E6 n- P1 G6 W* Q<TD><PRE>Method 01
1 U5 P/ n+ P6 c. O7 G=========. o* _. o, I( ^7 K" E( p" {6 a$ V  W
; o* N% T! U' {) v, [$ O/ i5 _- n/ z# r
This method of detection of SoftICE (as well as the following one) is
; r, U' X2 d1 x; x9 `used by the majority of packers/encryptors found on Internet.
  _5 ]% B7 L) n! lIt seeks the signature of BoundsChecker in SoftICE1 i: S5 i4 T  ^2 e7 N/ h
, H+ n1 e: z, U# y0 T; W
    mov     ebp, 04243484Bh        ; 'BCHK'
1 K% s& P& @& ~; s    mov     ax, 04h
; S, E& C. S* B* W4 \" o    int     3      
8 }' L- [8 w2 O* D$ b2 s2 s, v    cmp     al,4& p* ]8 _  v: _% O* u/ q+ n
    jnz     SoftICE_Detected
& k$ \- r; ?+ p! J  H/ R5 n& ?) F7 l6 a1 v; Q$ W
___________________________________________________________________________- c- ?+ w+ o8 \# d9 `! Q; [( u

9 A* C8 j4 G# CMethod 023 b; A- g3 K/ ^* O+ Q  x, O
=========
0 u: ^& m5 q5 M) }- H7 N7 e( f% V4 Y7 q" P- x$ i& {
Still a method very much used (perhaps the most frequent one).  It is used$ J0 \0 B- d5 K/ g4 C' s! m
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,& C) z& m% Z& U1 \' A0 S  v; O
or execute SoftICE commands...
" t% q, ?% Y, n! dIt is also used to crash SoftICE and to force it to execute any commands
+ T) ?2 t1 d% o# r+ G+ K6 P(HBOOT...) :-((  
% R/ x7 O4 t. \# q. Y: y6 C$ Y# P
6 T. U% t6 @8 ]+ c, O) h: s/ ]Here is a quick description:* {  l* M2 b6 d9 T- C+ t
-AX = 0910h   (Display string in SIce windows): K" c4 R8 B% q( }
-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)
" i" U$ C% n7 m8 N; y1 G0 ]3 t2 A-AX = 0912h   (Get breakpoint infos)
) M$ Z4 O7 D% E" j  T+ A-AX = 0913h   (Set Sice breakpoints)
3 s8 S. S1 l; b! {: t-AX = 0914h   (Remove SIce breakoints)9 b/ n( }) a4 a
5 i0 `9 {& ]& M# @' Q( p+ z
Each time you'll meet this trick, you'll see:8 m2 w! G8 V+ @/ i- e
-SI = 4647h
3 X* A# D4 B$ D. [8 O" t-DI = 4A4Dh
/ k) \) q: ]# F4 q+ |Which are the 'magic values' used by SoftIce.
, j. y3 P% f  O& r/ n# s8 _1 XFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.. W4 f; {+ F  f* O% V, _( }4 L
$ h1 s1 j7 D- F  ?  n
Here is one example from the file "Haspinst.exe" which is the dongle HASP
) W2 y' y( a/ b: Z, [Envelope utility use to protect DOS applications:$ k7 z2 h& ^; x/ s

  {7 G) J' a4 T4 J( F9 l
4 u8 r7 z6 A5 o/ M4C19:0095   MOV    AX,0911  ; execute command.
2 x- k* l2 m  S+ _) u. r5 e4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
  l' |$ Z9 u. `& U, ?( V4C19:009A   MOV    SI,4647  ; 1st magic value.& N9 O+ }' ^( _9 U6 M
4C19:009D   MOV    DI,4A4D  ; 2nd magic value.5 z; K5 w# u* @, q* W9 w+ K
4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
9 b$ H9 Q& W  c4 ]9 ^4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute1 s5 S9 s+ |" f( T
4C19:00A4   INC    CX
2 D7 j: S2 |- }: e, C& {4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute) y" m* z  Y0 x- i
4C19:00A8   JB     0095     ; 6 different commands.) S' X2 k! q/ t' a
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
' Z" n: q. L: R# `2 R4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :): H$ M9 L+ x; ?/ x$ b! q

; }3 {( F  ~' q( m( T* w& g3 wThe program will execute 6 different SIce commands located at ds:dx, which& P! s. N  z4 @2 v3 m$ _
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.  A4 {/ o! o1 T3 B

6 F( o- }# A/ B( }' A' a& [6 u; h* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
, v$ H( K  |# ?: W1 [+ `9 {___________________________________________________________________________1 Y4 e: R3 t  h
8 Y* L) ~- m) i" o1 ]
- ~+ _0 H% ]  [0 o, ^* [
Method 03
8 N. T3 n2 f* |" @=========
* s& a( M/ K9 U. |/ S8 o: W: n3 X
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
0 B! P# A# J$ i/ G  T7 B(API Get entry point)
* n5 J2 Z+ K( o9 n        5 f% a6 ]+ |( @) t. N8 F& u

3 ?, U7 ^+ S5 c4 h9 |9 p; r' |    xor     di,di
. E5 J% p$ j/ R6 z    mov     es,di
6 S3 P& v$ j! }' O; A    mov     ax, 1684h       2 ~" A$ Z" z* W
    mov     bx, 0202h       ; VxD ID of winice, B& m& W0 L7 u. |* ~) c0 x# ^' Q
    int     2Fh$ M* ?6 e$ D- C
    mov     ax, es          ; ES:DI -&gt; VxD API entry point
# c8 F0 Q$ ]1 i4 n" {    add     ax, di
6 [7 x+ r' j0 `5 g8 L" l! y2 k: s: x    test    ax,ax
# n' {+ D/ V3 H9 L* h- e    jnz     SoftICE_Detected
( t4 p. s! q/ D
; N9 ^1 m# f7 }+ p  s4 A___________________________________________________________________________
6 [' J6 E  D$ F* A2 v6 N& S
! G& ?; Q( p7 C2 E( c" B; |Method 04- A: |! l3 f5 y$ u$ c, ?; q
=========
8 X+ f& U  q7 B% n* ]4 k
0 M* _9 v; R. K8 P% |( e5 c7 TMethod identical to the preceding one except that it seeks the ID of SoftICE
  d' h( s! W# Y1 L! kGFX VxD.
: c: @" O, d8 z$ m
, x! j$ p0 b* a# B4 q3 A    xor     di,di3 }2 a! t1 C" J+ Z( D0 M
    mov     es,di
- L9 u9 K% t. A    mov     ax, 1684h      
/ D+ |) W0 w, e& m" v3 `5 W0 q  T    mov     bx, 7a5Fh       ; VxD ID of SIWVID
! l7 W1 ~9 e0 L5 i/ t( I) H    int     2fh3 ~, C; v* g8 U* C& ~
    mov     ax, es          ; ES:DI -&gt; VxD API entry point
" ^2 s( t  h1 U2 F3 |    add     ax, di3 v* n% T8 ^8 w5 Z& S
    test    ax,ax6 r7 ~& F& \' K% e9 A  ?
    jnz     SoftICE_Detected2 k( W& o+ c( u- g
- y1 l( [! x4 \! n
__________________________________________________________________________
5 d- l. ~$ f- q4 H
8 r) |" J$ z9 N; ?4 n, @& f
& f9 n7 h+ a8 Q! @& I1 ^Method 05! [- Q; J5 `, e- W% q8 T- T0 w8 g
=========; Q) r; {/ T3 q/ M

3 ?9 c8 Q) V$ DMethod seeking the 'magic number' 0F386h returned (in ax) by all system2 f  n) m9 p% R
debugger. It calls the int 41h, function 4Fh.
2 l+ N4 f/ I& I9 ZThere are several alternatives.  
  j7 v- R- O: ]3 h  _" a! L( Q
  F6 H' a, }+ g$ cThe following one is the simplest:
( B+ |% u5 b& t% B$ X! W6 a" \+ M; `+ P* ?4 r" ?
    mov     ax,4fh
/ f# s/ I/ K- {8 ~    int     41h7 C$ p1 a. ]2 x( H6 s
    cmp     ax, 0F386
( m* C) K; W. b/ ~' h    jz      SoftICE_detected0 h. g5 @- `9 @# f8 I( M
% T8 |' C3 }* @; D2 e

- k2 ]/ P0 m! PNext method as well as the following one are 2 examples from Stone's
/ I8 j$ ~+ n4 C( y0 R"stn-wid.zip" (www.cracking.net):; u9 k# s+ M# V: ]8 z% ^, _
  f  k# D! j) ]6 o0 g6 I
    mov     bx, cs
6 ?8 S( k) S$ j* O8 u& o# Y) m& u    lea     dx, int41handler2
3 s. S1 X2 F/ ~4 @& T- b    xchg    dx, es:[41h*4]
# Y8 j) k4 B. o& N6 f! t. K    xchg    bx, es:[41h*4+2]& G9 [; P" a% u5 a. d; a) h
    mov     ax,4fh
. A( J- H/ ]+ U5 k    int     41h
! W  X; M0 v9 ]    xchg    dx, es:[41h*4]$ j7 O$ q2 ]% K/ q+ v8 d
    xchg    bx, es:[41h*4+2]
3 c; S- i- E: m# N4 b) Q9 u" o# A    cmp     ax, 0f386h/ c/ |! w; o: R- L" H' C: c( A
    jz      SoftICE_detected
7 p  ^- e5 C/ k- q% ~% |2 O
" c6 e9 W# x& ^int41handler2 PROC: y0 ?: r. w9 s. C2 Y
    iret
; T2 \  x, ~& Z' Y; G$ aint41handler2 ENDP
8 R! }: l8 C" Q% }* `6 n) `4 M5 ^; m* U! a; b9 v
$ a) L, A9 F  p* ]/ P" }
_________________________________________________________________________8 x7 i# P: M& e- ], z4 k$ ^* F6 r6 h
/ G% D/ A5 m5 Y

. L9 y2 K. g1 ^! u8 e( E6 TMethod 06: m" p0 _0 J/ `( Z$ j' H
=========% u! M1 h7 S5 g0 [
' N  C4 _3 C& k6 J+ w! \
% [7 r3 M* d* \" I8 z" Y- D
2nd method similar to the preceding one but more difficult to detect:2 p  |: A& o( p9 P; N& F5 W% V/ K

6 Z3 M# I+ [* H& Z% s
# I' W; z( `! l* w+ H1 i  t$ k) Bint41handler PROC' o+ B; W( t" b# A. a! g1 G  @2 w6 c" n
    mov     cl,al
$ ^8 `; Q  [9 G- {. k( ^7 f    iret
, S+ U( i% b: X9 Dint41handler ENDP
6 ^" t$ M1 h  T# h
( g1 [# |. z0 p6 J
% \0 G' ]  J6 h( m5 L7 {5 j    xor     ax,ax. |/ x% f+ g0 h/ ^3 o+ Q
    mov     es,ax
( F2 T2 P( |6 p: s1 ^0 i    mov     bx, cs: d7 v! s; A: c$ D
    lea     dx, int41handler# @! y8 j; F. k8 @, x2 c9 _9 m
    xchg    dx, es:[41h*4]7 \( U7 g7 I5 |) J$ z: x
    xchg    bx, es:[41h*4+2]6 Z4 u% u$ g3 |) |1 M
    in      al, 40h9 j# w, ^# f! G
    xor     cx,cx
% w) k6 c& o2 e$ [6 M5 u- e! Y    int     41h- w7 A' B- a" j% L1 [- k
    xchg    dx, es:[41h*4]
: y& M/ k& k1 \8 t) Q& x    xchg    bx, es:[41h*4+2]3 M9 G6 l- ~3 g4 i
    cmp     cl,al) H) p& q! t/ b! ?
    jnz     SoftICE_detected
$ m4 a: H! f+ Y: w0 c- {0 G# s+ E, D0 d
_________________________________________________________________________9 A! z) N) r) N0 X" k' T
- Q/ P8 C5 q' X- B- i0 c  i& [' Z
Method 07( F) w& C  {1 O/ l1 a3 ]" B, j
=========* Y8 C" A$ R) X0 {2 @" c
7 r3 K1 |; p8 Y9 i. i
Method of detection of the WinICE handler in the int68h (V86)
. Y6 C7 r. H0 g7 M* E1 H6 J& P3 r5 b' [% d$ w$ u1 a0 G
    mov     ah,43h
1 z) t0 e8 R0 n5 B% V    int     68h
. A/ ~9 S8 l$ F5 O    cmp     ax,0F386h
1 T6 }4 A7 E4 W# h. H# z    jz      SoftICE_Detected
: Z1 b0 \- i4 Y, l/ d
# j$ {* C! t5 Z$ f8 O( H  h8 N8 ~* s1 N/ [' g
=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit+ f" ?$ n+ _( k2 I* }* l+ I* K
   app like this:
9 Q9 S* r4 K/ Q' _& W4 y/ x- y, v, T
   BPX exec_int if ax==68/ g( A/ `4 s# r: \
   (function called is located at byte ptr [ebp+1Dh] and client eip is
, U$ Y: Z' G0 \. S2 p1 a( I   located at [ebp+48h] for 32Bit apps)8 S5 s; V8 n) V7 N, _. P
__________________________________________________________________________( S( M6 Q  P2 q& F1 Z9 {: G
: j1 b$ Z2 [3 g% |+ ?* I

/ z! A) v$ ~9 K4 w2 F- UMethod 081 b  p% @- f6 _4 I7 p
=========& U- Q5 B6 g* ]8 x8 Q1 V
+ E; k9 I+ H1 L4 `
It is not a method of detection of SoftICE but a possibility to crash the
6 |$ u% T8 ]# ~/ d2 K. I6 X  Fsystem by intercepting int 01h and int 03h and redirecting them to another
6 K) y" o' ^4 E' a9 T2 \# I: hroutine.7 M  r- d& Z/ J* I
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
( E9 h! }/ N3 Z" c0 U. d" h8 Xto the new routine to execute (hangs computer...)
( ^6 L" {# T1 s; c! @5 g  d+ G: u4 @: J6 N; ]( c3 z1 h, N! i
    mov     ah, 25h4 e& L( P" [" R% ]4 s3 s3 _
    mov     al, Int_Number (01h or 03h)$ F/ T" m6 ]9 y
    mov     dx, offset New_Int_Routine
+ g  _0 @1 T( J    int     21h) t+ G/ e, d# N; h. a

& f0 J& S5 r9 H7 @__________________________________________________________________________
7 a% x7 q1 U: \8 X( Y& `  |
' Q/ b% |3 x. Q3 S5 @: X4 T! w" kMethod 098 A5 z; j1 K' F" p
=========
& G: n4 o2 F1 a
0 C' c9 k, s) J# a- D# h6 TThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
& d1 w$ L9 ]3 v/ vperformed in ring0 (VxD or a ring3 app using the VxdCall).5 `: r3 P2 c; A9 s1 r! G# o
The Get_DDB service is used to determine whether or not a VxD is installed
2 Y* I+ Z" P4 G7 U# X+ r* rfor the specified device and returns a Device Description Block (in ecx) for% G2 s6 X7 `) g: N2 U
that device if it is installed./ O4 C8 b- S4 `6 S) V+ Q  F

5 m4 H7 W" `2 q) n+ O$ Y2 i& [( m   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID' q% K& M1 X9 D
   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
  g" }; ?" }/ I$ |, V  k/ F   VMMCall Get_DDB" B+ @9 j0 {* E$ |. Y
   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed
" E$ ~+ M) P, |8 p& [& ^* \9 o0 x& g; Z8 _" `$ p% _. a+ q
Note as well that you can easily detect this method with SoftICE:' O; _( ]5 N. g& H3 u
   bpx Get_DDB if ax==0202 || ax==7a5fh
( {- q) c7 v3 T. i% f1 e0 f" g% T/ J  [8 ~& e( C- ?  i
__________________________________________________________________________
1 T, r$ x% N) p  g% E; U" l8 r1 ^7 m! f
Method 10# U+ n/ G% V3 b6 w. Q4 b' ~
=========
( x9 A7 l% r8 I9 J  l6 Q2 t! D) O6 r' n* [1 W6 i+ W3 t
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with
* Y) T! L+ k; R9 H2 m# B; H, ?7 O5 T  SoftICE while the option is enable!!
1 |; n2 S+ Y. S$ J  a- c$ z- \+ Q& |* s% ~6 C) l* p, f  E
This trick is very efficient:, A& b$ u  z! ^- B+ ~2 ]
by checking the Debug Registers, you can detect if SoftICE is loaded
' K$ P) c: W# ~(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if5 L! C- e/ {+ \0 i
there are some memory breakpoints set (dr0 to dr3) simply by reading their
( @1 I% H1 v9 `" C  Y4 j% n& U2 ]: gvalue (in ring0 only). Values can be manipulated and or changed as well4 w! r: u" V0 X
(clearing BPMs for instance), `& C% h; y( w# D
" z/ S/ s2 r0 l( D4 z3 h3 {
__________________________________________________________________________$ R- Q2 d+ l6 R4 w4 ^2 d# |
. P, U4 S* E* Z
Method 11
7 _& u; f( `# m7 |  }=========
# d' G/ q! _! R1 ~/ W0 Q7 Q# T' A8 h5 t9 I
This method is most known as 'MeltICE' because it has been freely distributed
8 e0 l3 x) E# A: w! s, P5 a1 d% Mvia www.winfiles.com. However it was first used by NuMega people to allow) [+ a- J. h) l  |0 @3 h8 _) @
Symbol Loader to check if SoftICE was active or not (the code is located# ^6 {# C/ B1 d
inside nmtrans.dll).$ W2 x0 O- a) s+ \+ N* l7 C  `
& r. E% a% P  ^0 Z7 `9 ]8 c9 K- x& R" q
The way it works is very simple:
" M0 e* h: N8 v2 OIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
9 x/ @: t8 t( v  RWinNT) with the CreateFileA API.
- T5 J, l. c& H+ s# M8 y+ Q6 q+ ~$ _
Here is a sample (checking for 'SICE'):
: k5 T1 S! B9 h3 H" J" r+ B5 U% M$ J% [7 n* f  I7 [7 a
BOOL IsSoftIce95Loaded()1 N7 m* A6 I& [- X3 ~
{/ p% Z* Y. I  F" S8 H# J2 M
   HANDLE hFile;  8 G, Q9 D8 H8 b+ l  q' h0 Q, X, ~' L1 j
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,; t8 v) o/ |  u4 W4 _
                      FILE_SHARE_READ | FILE_SHARE_WRITE,
! H. I6 R) U. s7 J: g                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
6 B/ j7 Q% K* e9 ]/ J" K9 s   if( hFile != INVALID_HANDLE_VALUE )5 A) l9 B$ ^. @
   {
! f) m+ b1 N: u6 O" O! [. l$ C& R" n      CloseHandle(hFile);
' Y3 @3 z9 y+ M- H! R0 D      return TRUE;7 ?$ K3 _7 T( g" r- n" P+ t
   }
' @; y: C, ~0 b' |3 U9 H- Z2 s   return FALSE;' p/ H/ }# T$ m- k1 l1 ?# [
}
: n5 \4 O) v3 Q2 C$ A6 N; {  ?2 A: x, O
Although this trick calls the CreateFileA function, don't even expect to be5 V" m& L' ~; q) p
able to intercept it by installing a IFS hook: it will not work, no way!5 z/ F+ Z/ d; G
In fact, after the call to CreateFileA it will get through VWIN32 0x001F$ a" o& Z' ]% ^  ]
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
* t2 `$ e4 ~9 n2 T* d, Mand then browse the DDB list until it find the VxD and its DDB_Control_Proc
6 G" A+ X( N9 j+ e4 L! Pfield.* A2 h, |7 N" J7 ~: ~2 r
In fact, its purpose is not to load/unload VxDs but only to send a 9 R5 }' p- C* l9 [
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)5 c" _- Z6 h' P; r  w3 [
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
  n) T2 D; ^. L4 p) gto load/unload a non-dynamically loadable driver such as SoftICE ;-).
6 f& p: T, U4 m/ W0 D# C" OIf the VxD is loaded, it will always clear eax and the Carry flag to allow. b8 T7 [( x  ?, V: v1 k& u) t. ~. U; c
its handle to be opened and then, will be detected.- m  h7 V( [; `9 K5 ?% Q) E: [
You can check that simply by hooking Winice.exe control proc entry point
' z; H( b2 j1 B, p* w8 r  Ewhile running MeltICE.( M0 M* G- |$ g5 d' E: w# e
8 p7 W# y0 o- E% Y; H% Q' {
2 ]2 j# y. b3 \
  00401067:  push      00402025    ; \\.\SICE2 G6 O9 R& Q/ J& z: w; H0 J1 s) w
  0040106C:  call      CreateFileA
, |1 L3 {! v5 V6 [  00401071:  cmp       eax,-001) t* P- m  l, i! P$ v/ `) r+ C
  00401074:  je        00401091, ?+ ], C) o8 N( S7 D. y1 k3 y, a& h
+ i. Z3 X# ~8 E. h; Z) ]- s/ j

0 E4 L- ^7 N# f( \9 I  w: B7 d# UThere could be hundreds of BPX you could use to detect this trick.
/ G8 U5 p! R. e5 w% q  d, `8 T" d& D-The most classical one is:
! ^" s% C$ c4 _& b  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
' l! M3 U$ g0 s1 X, h' W' O    *(esp-&gt;4+4)=='NTIC'- k+ `# f7 z  s
" {2 m0 v0 l; O
-The most exotic ones (could be very slooooow :-(# ?% n! \& b1 y( q
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  
1 u. V' m3 K' s! k9 C/ N$ z     ;will break 3 times :-(
4 k2 q/ V& n9 k4 ^# @
# F% ]% ^( o& y& b4 u2 Y. ^-or (a bit) faster:
# Y( j  I" O2 k2 q   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
  ]  R4 U: L! Z; q0 Y5 D% D& K4 r2 D; H& e( y: @
   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  ! N4 c$ ~7 c+ P/ M  t5 z
     ;will break 3 times :-(
1 ?, z. o$ f, K8 m& X
' L) ^8 ]# ^0 B7 t-Much faster:& f: L; |8 f; h2 A3 v, h4 z
   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV': L. @/ t& W: C
. s  Q: \5 Q1 Q+ ]: M$ U
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen+ w# A7 S( B7 V. S% i% u+ u+ S
function to do the same job:5 z' q, ~  v, Q  N3 g

" Z# S2 s1 I! W& v* _   push    00                        ; OF_READ
  d, T& m" S' p1 l; q" T0 {   mov     eax,[00656634]            ; '\\.\SICE',0
5 @$ w. r* `6 v6 k9 B. i7 k   push    eax. g. O2 ^9 t& m2 R6 _
   call    KERNEL32!_lopen, p# E/ ?8 o) g% I. m0 Z$ K
   inc     eax! U! b! a+ c" I0 L; y0 {
   jnz     00650589                  ; detected* s1 d8 ]. s/ q) y3 C3 z' I
   push    00                        ; OF_READ
3 F! p& V% E6 \2 M& B2 R   mov     eax,[00656638]            ; '\\.\SICE'( e4 I1 U. u5 [
   push    eax
/ W& z2 u6 f3 }% C9 G$ X% W   call    KERNEL32!_lopen
9 K9 `, y; @. A! ?( `7 A! Q/ Z   inc     eax
% ?; C. l4 V; I, m   jz      006505ae                  ; not detected
4 `/ I* |6 m7 m6 V8 e; H/ b/ j  X! C- y7 K' d
- M  k- ?+ j! u. `4 _) I
__________________________________________________________________________
2 E' e1 ]6 g7 v5 n& k* l" d% R& Y. |, |! H  j2 e% t) D2 M
Method 12
: z& _$ @4 _. r8 L  u=========5 }' A4 \# S* X: V7 }* l
3 F" [! i& k9 V7 X7 `1 L5 F9 q
This trick is similar to int41h/4fh Debugger installation check (code 05
7 s4 v2 d6 B# B% s&amp; 06) but very limited because it's only available for Win95/98 (not NT)
- m' B$ Q9 o# d1 Gas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
; F& E4 H2 V9 v' m& X: W+ g: L
   push  0000004fh         ; function 4fh
0 b& T, W1 s; j! T2 Z! }1 ^3 E( {   push  002a002ah         ; high word specifies which VxD (VWIN32)( |+ u6 O% k% M! k" e& N
                           ; low word specifies which service
) \0 |5 A* N' p. L/ x                             (VWIN32_Int41Dispatch)$ e# P$ V4 d; ]* R( x% M
   call  Kernel32!ORD_001  ; VxdCall
0 q4 {8 i" N+ G   cmp   ax, 0f386h        ; magic number returned by system debuggers& ^2 [% `( r; Q! G) U1 Q4 z
   jz    SoftICE_detected
0 [1 K" O4 q5 P8 E2 t' Y/ E" U2 |) c9 F7 {# {5 j
Here again, several ways to detect it:/ S4 }) K. }4 ~4 K1 D

& o8 B; ~* U7 ^9 K0 O    BPINT 41 if ax==4f7 t* g( T9 n9 K' P. r- z

8 f2 U2 K1 a1 R) _$ g2 M9 N    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one( r! q* J! ^( g( Z4 w$ s6 H7 I
5 I! a0 q" y. T, o9 [' G  W! G, ?
    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A$ M0 ~1 C2 M0 t: ?3 E6 ?
, {) Q4 }; {+ A& `  E( ]) @$ C
    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!9 q4 u$ j& o( I) G6 Z

& P7 d9 w0 `  y& R3 ~4 `__________________________________________________________________________% a2 M: v- o/ B- w% W/ M. `

5 A. m9 L5 Z6 {0 f; UMethod 13- X( _0 y; g% m* i( y: m
=========5 j' c2 r( _& l% U5 a2 g& |3 S

; t4 v2 n$ f  r4 Y: V+ }# U! VNot a real method of detection, but a good way to know if SoftICE is
0 N0 X& F; g0 r. v% w1 ainstalled on a computer and to locate its installation directory.
" o& s6 q0 S4 x, oIt is used by few softs which access the following registry keys (usually #2) :. S0 E6 [  n+ e2 o. u' b# `- A

  V4 x! \, Q2 l% J-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion1 U, _5 N0 M( n3 W. a$ W4 N
\Uninstall\SoftICE
: u; w- T; Z2 Y% R! e-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
! f: b# F! s" \' k3 _0 e8 u-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion8 ?6 G* n: T/ i
\App Paths\Loader32.Exe$ q% l- a6 C( l, Z
% H. {" b6 y$ P" d& u8 A  R
! q3 s9 k3 e( A# i, M7 X, t) a
Note that some nasty apps could then erase all files from SoftICE directory7 u' s2 h' d- q( T+ ~
(I faced that once :-(
6 m2 w9 I! d: C
( ~7 N/ T  r8 p9 fUseful breakpoint to detect it:
& _% T( G  A8 r: q6 M; W; G2 q2 J
6 T6 |7 U: A% K5 j6 I     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
( r2 {1 I2 K6 z
( ?: z2 `$ \' O__________________________________________________________________________
( @4 r: V( m8 J  ^; A" F
" m: D( N" w5 E6 h& B
1 u7 d; Z3 N" fMethod 14 + x! k; e1 l% r- }
=========
0 `" x* E% j# m: g( \3 p: c0 Y1 [' m4 t- W5 B6 X
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose. O5 H! P) u. b
is to determines whether a debugger is running on your system (ring0 only).
  I5 {+ I- n& Z+ N4 k  B8 \' D$ x; X# \- k& Z1 }  n
   VMMCall Test_Debug_Installed
' f' @+ n! a; b6 Y6 k   je      not_installed
. e6 y5 g% S% e$ O$ R6 q, s4 z- i+ [# x: L! j0 O# |
This service just checks a flag.
" [  G% Q3 G1 y/ H: T( K" X</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关注公众号

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

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

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