About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
8 O$ e; i# n5 W( k( V, m4 W3 x<TBODY>5 q0 z7 d5 q( R
<TR>0 E5 T. d2 `# H
<TD><PRE>Method 01 ; w5 X- L' w7 b2 L% ?; R+ q/ p+ V
=========# V7 {& q3 L5 n. `& S+ y

% h- M; ]; Z+ l3 u* uThis method of detection of SoftICE (as well as the following one) is6 j, A# H  d8 f
used by the majority of packers/encryptors found on Internet.
" h+ ?% ~1 R' SIt seeks the signature of BoundsChecker in SoftICE1 I3 d2 \0 P$ _* ~) L2 R+ g
( @% V  l0 Z) [
    mov     ebp, 04243484Bh        ; 'BCHK'
* d3 ]1 o4 a6 _$ c; c    mov     ax, 04h
3 z; |9 n: g  \; Z    int     3      
& S: w$ H4 X; H  z9 r1 I- q    cmp     al,48 Z4 Q/ {# e5 Q7 G) Y: D
    jnz     SoftICE_Detected
- b' v9 |, l( [( d. I1 p* o7 i$ |( V- M# E2 a
___________________________________________________________________________
( I* I9 F- Y: W8 a8 j$ i. @; x( [7 k. N" X/ C7 p" B
Method 02
' _8 e7 M' i. h. x/ U0 x* q# }=========
9 e5 ]6 c9 K2 G. k4 }0 W# d5 D& f1 w* S9 I$ w
Still a method very much used (perhaps the most frequent one).  It is used$ J: N9 `' y$ B) p* W# }: J. b
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,, v! [, F$ s, b
or execute SoftICE commands...
8 m' O4 A& l. z5 _0 G6 iIt is also used to crash SoftICE and to force it to execute any commands# ?. y4 B! A1 ~! z+ `) G
(HBOOT...) :-((  
% Y1 C, D* l( t& s: ?& d
1 e# Z  b# ^  l- ~. nHere is a quick description:7 ^  N6 O2 E% ]6 r3 A* `
-AX = 0910h   (Display string in SIce windows)% J5 Y# O. L  W5 t* f$ A+ l( @
-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)
- e. C* G7 v4 l$ j1 v4 v( l$ r# h-AX = 0912h   (Get breakpoint infos)
8 d; k, w5 A, c! n! I) O1 {- D-AX = 0913h   (Set Sice breakpoints)
1 y$ W0 C& A; W, f/ O7 n9 T  p# P- R-AX = 0914h   (Remove SIce breakoints)$ Z# D0 ^" l, m8 L4 c# }# z) U7 D% H

" |0 |1 V# c( i) W7 W5 b2 P, zEach time you'll meet this trick, you'll see:
7 |" [  e  |+ B5 a+ a. \9 {-SI = 4647h
5 s0 `& I' c8 X6 |+ p! D+ r-DI = 4A4Dh
' C# P& c9 O$ I, f4 \Which are the 'magic values' used by SoftIce.3 R! B. w2 E9 |- |+ K
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.( H* R! A* K7 ]

& I3 f0 N' d0 f$ ^  u& SHere is one example from the file "Haspinst.exe" which is the dongle HASP- a' X0 l, I! j2 H" e
Envelope utility use to protect DOS applications:$ p) U. D! s6 S2 j& S

' j5 v9 F% Q$ y- D0 Y$ E: k; _5 i5 w+ v% p$ D4 y, P3 |
4C19:0095   MOV    AX,0911  ; execute command.
0 X1 `1 }+ o4 s: S4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
1 C5 \3 G4 \! X5 n& [+ W4C19:009A   MOV    SI,4647  ; 1st magic value.
6 T. H7 W! v; ^! s4C19:009D   MOV    DI,4A4D  ; 2nd magic value.4 V: x: R5 x' ~
4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
8 [! V" m2 S, O; X/ \) _* x& i4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute  C' v# h+ G9 x1 J9 p
4C19:00A4   INC    CX
& R3 ~% i2 f* L* N1 c" q4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute4 U1 z1 b/ O3 z2 ]5 c! b0 d
4C19:00A8   JB     0095     ; 6 different commands.
. h- L9 [+ P) ^, D  H3 q4 h4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
1 V  q3 J* n0 A7 P) |8 S4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)& f  ]/ F( ~! `2 z# k  f

9 x7 ^7 K- u7 h! G' z0 dThe program will execute 6 different SIce commands located at ds:dx, which
' o2 l& Y; E4 Kare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.2 |# P8 X9 `8 N% {/ z, F

$ X4 K) `1 I5 S/ I1 S* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
. W; @* o( T7 i___________________________________________________________________________
! k& c/ h9 n8 O6 \$ `, o
5 @' H2 d9 |0 S1 k( ?8 y3 Z" ^" [4 v; j. }+ G9 _
Method 03
* G, T% l3 y3 U# X=========
4 \2 h0 f5 V/ O, e5 c) z0 A7 O7 v9 z
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
3 r7 u4 O% @  f5 d) D, o(API Get entry point)
  p# L7 ^/ @$ u$ C" c        6 p5 q$ G& Q2 a& s+ P. z4 B
+ A; I' L7 Y5 E! i& ^
    xor     di,di/ Z  _( m3 y. n0 X" r, i
    mov     es,di
4 Y0 |$ v; M$ e: q. P- j7 i    mov     ax, 1684h      
. U& r. ?+ M. M- g    mov     bx, 0202h       ; VxD ID of winice
3 `0 {4 C2 U; ?/ i9 T2 F    int     2Fh
8 f% U: Y, X3 d+ T/ H    mov     ax, es          ; ES:DI -&gt; VxD API entry point6 c# t1 Z0 U5 n$ K' w
    add     ax, di
9 D1 [7 q4 J0 M; G    test    ax,ax6 n# W/ z9 F& C, J  E+ H) O
    jnz     SoftICE_Detected7 p6 W6 h1 o9 o7 o  K5 i

+ r' P3 U. x8 z" k2 E7 b! \___________________________________________________________________________' {8 S& o, D! u. d2 i# i0 B- Q: p
5 n: ^9 ^& m- J# Y& n8 N" d& P
Method 04
4 u  @, s1 e0 \* B2 [! @=========2 K% O! Y" @- E, c% v' E) i/ w; f  }
' ^8 h  |( \; R+ x
Method identical to the preceding one except that it seeks the ID of SoftICE
. t4 k% e; L7 A5 L" H4 p  Y; yGFX VxD.; u# a1 R' ^, R- d3 m' ?

. p; k+ g. s# F* e* b0 [. r    xor     di,di8 ^/ C) J# s% c7 {# R# G
    mov     es,di
# X1 c) d6 e( @! ^    mov     ax, 1684h      
# x! _5 X3 \% w! r6 G    mov     bx, 7a5Fh       ; VxD ID of SIWVID" H5 I$ R1 l0 k% E) b* n
    int     2fh5 I& @6 m! S5 ^
    mov     ax, es          ; ES:DI -&gt; VxD API entry point
; R$ R5 y* o& A# Z+ ~" E    add     ax, di( k3 v6 t: c& N" E& i- y
    test    ax,ax0 b( i+ k# O  {
    jnz     SoftICE_Detected. W7 H$ Q- P" @/ r

# e* G2 O; {% X+ b4 l  X6 \__________________________________________________________________________
" Q' Y" o) w' T! }+ g" z
: }0 e( U9 [8 l6 n9 @+ a
& J2 g8 @) E* V9 Q0 f$ b1 B- uMethod 05
; q9 P% O; n: y; N=========8 w, [; Q+ J, u4 x% L$ z
5 m. x! W5 {; W& D8 w
Method seeking the 'magic number' 0F386h returned (in ax) by all system
# Y& A) Y$ k) n4 t$ E* A& F) C# ^debugger. It calls the int 41h, function 4Fh.) O/ f/ s* }& z/ X: b6 j
There are several alternatives.  
" D, ?" ^! ^8 C5 q9 Y1 D3 G4 K; b; z: K# g% i0 G
The following one is the simplest:
6 m4 {/ f3 T2 d: d- N: W* O% A2 Z- |# R2 L
    mov     ax,4fh7 i$ j% x! S7 s+ z  @- B" n
    int     41h
( X1 D2 r; g. J: F9 Y    cmp     ax, 0F3868 i/ W* F( Y& h+ |# o7 C
    jz      SoftICE_detected# ?3 t, `$ M$ t8 K

' `. C, ?) p/ v3 c( C, E" \7 b
$ D/ y$ G; T1 B0 D) F3 vNext method as well as the following one are 2 examples from Stone's
7 ^1 k4 a( {+ ~7 {- V  s5 x"stn-wid.zip" (www.cracking.net):! d, Q% j6 L- |, ~" ^4 I
" @+ X& b: g4 o9 P  y
    mov     bx, cs
* O' S, v; z9 I* P3 @1 G+ ~/ ?3 S8 N    lea     dx, int41handler24 m, c: h$ \/ O- k6 ~- a" l
    xchg    dx, es:[41h*4]
- E5 z( ^* `% d9 i    xchg    bx, es:[41h*4+2]
$ O6 K( K6 @/ J: z    mov     ax,4fh
. ]- m& C( X1 h    int     41h; V' \4 p7 [$ w/ w) B4 E+ @# V! ^. l
    xchg    dx, es:[41h*4]
0 ~) }6 ?  p' |    xchg    bx, es:[41h*4+2]
$ O+ E: k) c, y, ~2 v8 k# F0 n, i    cmp     ax, 0f386h
0 U# y5 B. Y& r5 ^/ R1 o    jz      SoftICE_detected$ m9 x( W# A" U5 C( Q

3 A- A6 j7 b( E3 a2 z% N& cint41handler2 PROC/ Y6 l/ v9 v' _1 {
    iret5 c* Z( k6 f4 u2 N9 {
int41handler2 ENDP/ e, N" J2 S0 ?+ t( l1 {# o# r6 f4 G

0 ^& C& r2 h9 X% M' v
, f" H+ f6 A! _0 M1 R_________________________________________________________________________
" J, `' _! L* p: I& ~( b
$ z/ O8 p! F& M. ~1 D5 f8 F8 V
/ O; X1 ^# M# f; i' {( VMethod 06! t9 ], ?* Z7 o" f1 _3 o# N/ {0 f
=========1 @9 v( p- E+ Y0 y2 E7 B5 ~8 i

8 z& Q5 H3 S8 I$ M0 |" y
/ n0 z% h1 G; j. X* ~/ u2nd method similar to the preceding one but more difficult to detect:6 |) B. V6 H; P; u' r' M
7 ?; I9 E4 `1 C
) b5 r" {( ~) e
int41handler PROC) V- T* h* N' Z2 L
    mov     cl,al$ P/ @0 h1 I% R9 K9 z2 {( [' d
    iret' Z$ `: V: _6 u/ X7 ]
int41handler ENDP; c* b- ?" i' G# C( r$ _4 Y6 O9 d

! a/ N" ~3 R+ @3 w% g7 p9 i. }2 D8 I
: ?  |6 W7 k2 o4 E" m* I" h    xor     ax,ax9 I- d5 Y7 a" w1 m$ @; l
    mov     es,ax  o8 |6 o$ L4 l8 O9 B6 Z% l
    mov     bx, cs
9 h& Q" W5 u/ g, T* z9 g    lea     dx, int41handler6 \, ?) O3 @& U! O/ B2 \
    xchg    dx, es:[41h*4]
" J. E2 g4 U6 E' N    xchg    bx, es:[41h*4+2]7 z: @$ D* c/ X. P: _
    in      al, 40h
+ `3 d, e' Q3 s' g* |    xor     cx,cx/ G) _! @/ v# e
    int     41h& a% i1 p" i- Q3 f
    xchg    dx, es:[41h*4]9 k0 |* |  C/ k4 c# p# Y
    xchg    bx, es:[41h*4+2]
. A. N0 R7 D9 i+ S9 q, M+ F" L    cmp     cl,al
. V; c# h5 y* D4 d* O  ]/ \1 N& s) |    jnz     SoftICE_detected
6 x1 a. h3 C* J8 e; R  @: X) R7 I" {& r9 @5 P2 F5 |
_________________________________________________________________________% |9 T" m9 W/ p+ m" X  s! ~& Q* W

7 `  ?- I8 t" K2 BMethod 07& z) i4 u% n. r; f. o( _
=========
* j2 Y: |) v9 l! W  b& D1 z  z0 _( w
Method of detection of the WinICE handler in the int68h (V86)
& }1 ~8 p/ I. L1 f! t+ j+ b4 |  E( o
% Z: L0 D/ u$ j% R/ Y& P  `    mov     ah,43h
. U/ k/ v; c0 ?5 u+ t    int     68h( n$ _9 c' ]- a9 X3 `
    cmp     ax,0F386h; i' E( V! p' x. |
    jz      SoftICE_Detected- L9 r& f0 Z# ^/ e+ l2 `1 X

* ]' I  E* d/ Z, f; D1 X( u4 V
8 ]; L! W/ k! a" {( D; N=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
( S- n* d+ r: r+ w7 C   app like this:# B# s" Q0 Y3 }
5 z6 M- D9 E: _5 e1 M) O
   BPX exec_int if ax==68# Z. b, ^5 F- e- p
   (function called is located at byte ptr [ebp+1Dh] and client eip is
' X* X. d! L9 a+ J$ c/ l   located at [ebp+48h] for 32Bit apps)
, B0 R9 Q2 F" x" S2 M__________________________________________________________________________" J! H3 U3 ]" n* \( c
% |8 n. J/ n; q" w- ]' N

  m" L9 R, P1 K) UMethod 08) [* C* t& G$ L* Q; v
=========- ]+ t. ?8 |- n& l

" O( C# n$ |8 ]; @2 |2 {It is not a method of detection of SoftICE but a possibility to crash the
" T* e& N! T) T# Q, s% Q# P  zsystem by intercepting int 01h and int 03h and redirecting them to another
) P  o3 y; m' }routine.0 J: i5 _0 t& e4 Q
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
# ^& T/ Z+ e5 uto the new routine to execute (hangs computer...)
: U& @8 g, v6 T3 X# X0 G4 u0 ^. Y2 w# D7 m) I! p
    mov     ah, 25h$ T+ R: V" O9 g$ M% ~) x
    mov     al, Int_Number (01h or 03h)0 O$ }" u/ N  I6 i7 P- T& l
    mov     dx, offset New_Int_Routine; d9 H$ D5 A6 Q9 B* S
    int     21h
+ @1 ?( o; n! B; G# ]9 c4 B9 L- u4 H- ~  j. s" a8 y+ k) g* @8 E
__________________________________________________________________________5 M4 K6 c3 t& N6 T

* o& z4 }$ |1 g6 x: W1 JMethod 09
$ `7 p" L; d# W" c+ h( l4 `=========
0 |1 `: M9 f2 t; i& F4 h) s. H( F: x: {9 O
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only5 w* ^0 y: T+ d* B
performed in ring0 (VxD or a ring3 app using the VxdCall).5 y) F$ Z6 y# o
The Get_DDB service is used to determine whether or not a VxD is installed9 c. A7 x$ f* h6 k9 y
for the specified device and returns a Device Description Block (in ecx) for$ K) i, \9 `; h' \/ Y' R6 ~' g6 l, r$ _
that device if it is installed.
& c% u8 T) L: e& S  H3 X6 U$ i$ [- x3 T  z+ f; t1 c
   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID
2 S# N8 L1 u0 z   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-); T8 M) K# }( X; Y- N
   VMMCall Get_DDB
3 G/ a6 \6 D; B( g- A6 r, n   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed
6 r4 S& V$ K3 S) O9 _. |; m8 i9 V$ A/ F. C
Note as well that you can easily detect this method with SoftICE:7 f' b2 n# k) E- T4 D& z
   bpx Get_DDB if ax==0202 || ax==7a5fh
$ I. a, y. ~8 O+ Y6 w, V
7 {6 F0 O& I7 a& g# A6 j. s__________________________________________________________________________
1 \5 g) Q0 }' k* a# o$ d1 ^) ^" H5 Y
Method 10# ]+ K, T+ m/ H! _
=========
$ l1 r/ j) t; n& A/ _$ @/ L  C7 k1 J8 J; H
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with. d# x) @8 R# W8 j7 p0 k9 f1 `' R
  SoftICE while the option is enable!!
4 E' x; D3 B$ |3 z7 G) a8 f. O, J' F; ]- Q, C' S: {/ D4 u
This trick is very efficient:& [0 p: [4 \9 s2 q' P" x, o
by checking the Debug Registers, you can detect if SoftICE is loaded
, ?6 T' q7 {2 O7 y# k* P+ l8 X: k(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if+ ]/ F( A7 C3 Z# Y9 g
there are some memory breakpoints set (dr0 to dr3) simply by reading their# @  K4 C# Y% ^" b/ {) O5 U3 S
value (in ring0 only). Values can be manipulated and or changed as well! b# l& c8 _: L. a( O8 t+ s3 A
(clearing BPMs for instance)5 R1 c1 U, U$ X4 |& U

1 h& @8 B- P; Y__________________________________________________________________________
! \/ o7 ~& z' T
6 O1 f* u( k% ^& O6 ?! z* \+ Q7 O# ]Method 11
! X& ?$ f" n$ u7 p=========- q9 a$ ]1 y8 d( o
3 T8 W- {* j- D
This method is most known as 'MeltICE' because it has been freely distributed
9 |% I8 l4 S3 X8 Y3 d% w- Z4 lvia www.winfiles.com. However it was first used by NuMega people to allow
0 f6 }! z0 h% }& |Symbol Loader to check if SoftICE was active or not (the code is located
& k; _7 f$ p6 Q& x* g2 Y; kinside nmtrans.dll).* Q9 {1 g" C! {! x% B% A
! d; i4 i' B7 @( K1 ^& a0 F! k
The way it works is very simple:3 G) U/ S$ }& I) i. J
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
$ Q$ f4 U' M" H, r! ^) a# p6 T0 jWinNT) with the CreateFileA API.
7 H9 A+ L) K% |% d1 I2 M& ^1 T' w* U. }% X2 M, q2 k
Here is a sample (checking for 'SICE'):, g3 J: G% D- T$ g/ I$ ^

2 o. }7 n+ {1 [. a2 a- O1 @) gBOOL IsSoftIce95Loaded()6 O6 A9 R% ?2 ~2 v
{& f# c8 s0 Z9 C+ u: d* ?
   HANDLE hFile;  
: w9 ^# s  ]* m  e; u+ c$ `   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,- u3 C0 l* A+ o% O7 j4 G
                      FILE_SHARE_READ | FILE_SHARE_WRITE,! `! U- X5 M) x
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);# L! j, U0 R' C5 q& h) ]0 D
   if( hFile != INVALID_HANDLE_VALUE )) W# ~6 b6 d& J( Z
   {- I8 B% C2 q' D! ^) V
      CloseHandle(hFile);! ~" a/ y3 j3 |; W
      return TRUE;6 d9 v6 N/ u; `" N7 h# R
   }
; `. @! z( z* s   return FALSE;
: X! i8 q$ y; T8 i}, @. l" T  ~& j, s0 b5 m

6 A/ U/ l  H1 h( T6 x6 ]. iAlthough this trick calls the CreateFileA function, don't even expect to be: _) f$ Q7 T3 ?% U* ?
able to intercept it by installing a IFS hook: it will not work, no way!
# r1 P' i- b" v' J& eIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
: Z& p' C: e$ U$ K4 P5 y( e7 Sservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
4 {/ A' ?2 F+ h, W5 A7 t+ F9 wand then browse the DDB list until it find the VxD and its DDB_Control_Proc) Q: y- D" U/ u7 x$ ~; \
field.' P8 B8 ?( V$ s3 B, B
In fact, its purpose is not to load/unload VxDs but only to send a
0 Q& I, J3 U' }0 |" TW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)7 l3 g2 s3 i% j5 h/ @( m
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
3 j5 _* ~& s" W( k8 Eto load/unload a non-dynamically loadable driver such as SoftICE ;-).
; V7 y$ }* f; Z* U( t. CIf the VxD is loaded, it will always clear eax and the Carry flag to allow& a" f3 y8 X* b+ q& r5 b. \$ E
its handle to be opened and then, will be detected.0 y% O0 a! w# R- f& o- F
You can check that simply by hooking Winice.exe control proc entry point$ C  ?! W$ f. C) h
while running MeltICE.' u$ s) b6 u1 e3 ]1 X) D" i
9 }  I! L% P9 R9 G7 O+ M  _

3 h2 B7 Z" A, H8 P7 _9 Q9 f  00401067:  push      00402025    ; \\.\SICE
; S- u; i) W" U* D, ^4 t* l  0040106C:  call      CreateFileA
8 l) d! Z, `! ?+ j& t% c3 L. A) G  00401071:  cmp       eax,-001
( c+ c  i, g  S3 y: }& l5 T  00401074:  je        00401091# K2 f* g% J1 g: `

- O$ `% ]& C/ i: @+ N2 W& h' D0 ^
1 h# C7 N" g; Y9 }3 ZThere could be hundreds of BPX you could use to detect this trick.
/ J7 j3 ]4 F. V-The most classical one is:/ R/ R  l1 |* X! l0 U" O% s0 S2 m
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||6 ]6 F  N+ d1 n/ P8 N
    *(esp-&gt;4+4)=='NTIC'9 g# v4 ]( o- [, N$ c) V0 d$ ?
2 o1 {& u+ c5 d* \) k$ }) ^, b, H
-The most exotic ones (could be very slooooow :-(- N4 r' j/ B+ I% O3 p
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  
: t, P4 @2 @3 p' o6 F& q     ;will break 3 times :-(
( P/ B; F( J- A4 P' f% n' _1 M
8 _( u8 C  @* D4 \, ^7 n9 P-or (a bit) faster:
4 J+ U4 H, w( Z0 ]+ X   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
4 A6 X& f3 U5 k& X8 Z; u: f3 {% o2 K5 ^* S+ A) P
   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  
3 A1 ]: ~2 k; s  B& ?5 A- o$ q( z% e     ;will break 3 times :-(- s+ x; s; v$ {" C* V9 j

& K) b0 {, n0 L-Much faster:& I; K+ r. g, ^; c# V+ ^
   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'
! R( Z& I+ T1 d( \( z6 P. K! M- ]# x
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
0 d- c1 H" M6 d8 |& l0 \% Nfunction to do the same job:
" x9 q9 Q0 {5 Z4 j, q% H3 Y, N5 v
( u; d" J5 k  B6 U$ _   push    00                        ; OF_READ+ d$ o" j( {  N& Z: |& g
   mov     eax,[00656634]            ; '\\.\SICE',0
( p) L9 }  R+ ^6 }   push    eax! B3 p% c( y* g9 Y
   call    KERNEL32!_lopen
( n& h+ ~- W" e+ v+ e- ^   inc     eax
( H5 v. G' i& g$ [! V# D* w2 l3 [   jnz     00650589                  ; detected
/ S1 f& T6 b3 L7 U   push    00                        ; OF_READ
. g! N- u* r$ p8 F' r9 y2 y+ N   mov     eax,[00656638]            ; '\\.\SICE'
5 @+ f/ t5 Y" j# W3 z   push    eax
, y' J( K' k5 B& O  [   call    KERNEL32!_lopen
& \' d" [5 _# w7 E2 b+ j. `   inc     eax
6 ~! K5 I5 j0 A3 b* E  k( G# n   jz      006505ae                  ; not detected
% ?! e1 m% X$ X$ @" c+ q: P1 g0 N! K1 W8 c
+ u5 l/ A; |1 }3 N$ B  [
__________________________________________________________________________
, T. L8 [# o; P3 e) P& \) [. U6 _7 K; n, p$ f' W2 F, |/ \, F! n  u
Method 12; ?( `$ B& i; Z; O3 E( v
=========
4 `( C  R# t8 x
8 x/ y# [7 H. i, m" A, j" \' ~This trick is similar to int41h/4fh Debugger installation check (code 05
' b$ p* D! g: x&amp; 06) but very limited because it's only available for Win95/98 (not NT)/ O- z2 P6 C1 I3 X* U: g4 \
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
5 F) j8 H5 P  L% c1 v7 Y$ z; y$ F0 Z2 I" ~/ j
   push  0000004fh         ; function 4fh! n' B, N; Q/ J$ A3 f
   push  002a002ah         ; high word specifies which VxD (VWIN32)
3 Q* d$ D8 O3 v. o                           ; low word specifies which service
- \- \- v! t9 H1 h                             (VWIN32_Int41Dispatch); B4 c4 P" x) Z! Y
   call  Kernel32!ORD_001  ; VxdCall
, Q- H6 M* g2 [, P6 w9 T   cmp   ax, 0f386h        ; magic number returned by system debuggers
3 V/ [8 z+ E2 G( _2 a* B! _   jz    SoftICE_detected
. E3 a+ J  k. t8 |
* V4 w! W: f9 }% ^+ SHere again, several ways to detect it:) m4 s" T% n8 W6 e; g0 ?8 c  s
. P) l9 t+ ~9 |/ T4 ?4 t
    BPINT 41 if ax==4f
; f; I9 h* \6 Z
) N7 O1 I! X5 V- L5 B) R    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one: ?" @/ C: h, ~$ i- X
6 O) Q( F) T" Y6 e( `
    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A3 w- O1 a' i1 d$ P

/ V* D$ C9 c# ]$ L    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!
9 `, @2 ~: {( m' p$ d: M( O0 V& y5 Z) x
__________________________________________________________________________
, J. I. q& i0 w. C' X% F+ P6 g
$ v3 y& x  K& J- s$ D4 HMethod 13
* A5 p6 I% d, l1 ?. A=========
0 t( q1 G3 B0 V5 I
) x) q( l: d( g' W6 sNot a real method of detection, but a good way to know if SoftICE is6 W3 \. I1 W1 L: P
installed on a computer and to locate its installation directory.4 t: f) k) k1 o3 E# A% Y
It is used by few softs which access the following registry keys (usually #2) :5 n3 p7 f, n& `5 W, E
5 M1 h3 f. k9 K* w: n
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
& }8 P$ }0 M9 I1 i\Uninstall\SoftICE( i2 F5 N0 v' G7 d
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
$ r$ G! K) {: O  @7 {( H-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion* i* ~; L' A+ d3 u
\App Paths\Loader32.Exe: N; l! R4 X$ L

# n/ g5 g7 B9 `" e+ \! H# y2 f( g  l/ v% g. p: n/ h! Z! V
Note that some nasty apps could then erase all files from SoftICE directory5 k) @! V; h2 Q8 a3 m: U
(I faced that once :-(
5 j4 I4 {. z9 }0 E, q; p
  v5 b2 C  Q* Q1 K0 b! ^Useful breakpoint to detect it:5 g" z, i# K& G$ ~- }

( l* x6 K/ k* k$ C) `, H     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
+ a' x7 u3 z' v2 \9 f, F
: |2 C, x! e% r9 g1 y, w4 y__________________________________________________________________________
5 J. ~1 M) ]: N; z
9 j/ I+ v9 e1 b2 D9 W/ B: Y5 _- t' P
Method 14 & Z' ?. Y" U* F# x1 o1 n
=========
0 s- X3 X/ V0 G" N  @- `- A
+ ~) c( h* P( t2 @1 R- b0 ]  NA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
; A8 t) A/ q  d' R2 E( sis to determines whether a debugger is running on your system (ring0 only).1 f+ w$ f4 I3 p% Q( s) v

1 A7 G$ r. H. \! O0 }, S   VMMCall Test_Debug_Installed! b, p5 x$ I7 j, h8 q+ P4 D
   je      not_installed
5 i* ~6 b9 K. w1 _* s% G& {* P: }# X' E
This service just checks a flag.
3 J" x* o* w& _1 S: V/ z/ ~4 m</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关注公众号

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

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

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