About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
. U* N3 E/ ~# q7 y: W<TBODY>
  U* p. i9 Q  Z2 h, l2 O. M2 H) M& X% d<TR>1 @4 {+ ?  ~9 J) `: {3 H4 |) n, c
<TD><PRE>Method 01
% Q/ h  Z% d& y. G. q; `. K=========8 T1 X! g1 T: P5 d. k" o
5 m3 r, N$ t% C7 C( ~/ G/ d
This method of detection of SoftICE (as well as the following one) is0 e/ v. ~! w: [4 ]
used by the majority of packers/encryptors found on Internet.
- \5 J' Y) ]" j! F- @! fIt seeks the signature of BoundsChecker in SoftICE
% ~. K( W0 z8 Y( S1 C9 }" ~+ D2 v- P; |. W4 H7 o
    mov     ebp, 04243484Bh        ; 'BCHK'. x: Y7 C2 m" L. j
    mov     ax, 04h  G1 I  G' L. ]$ v3 v9 A
    int     3      
; S/ Y) ~" T! ~% l    cmp     al,4
& G9 t* `9 u, ~# Q, [    jnz     SoftICE_Detected
! F% I, C3 L) g, L3 f' M. x% c+ C) m8 ^
___________________________________________________________________________; `1 C% N$ K5 w; X' e

4 W$ C+ c% Z! {/ r* w. O0 {Method 02
) Z+ w+ ~- x3 I, ~) Z  p=========2 n. J7 B9 o6 N- ~4 s6 q
& c+ K1 E0 Q" m7 M  ]) m
Still a method very much used (perhaps the most frequent one).  It is used
3 o6 i6 `: h; A* y+ J% ^to get SoftICE 'Back Door commands' which gives infos on Breakpoints,% C" n% F. O. g
or execute SoftICE commands...9 n1 r7 o' m- ]8 L5 U" {) ~- z
It is also used to crash SoftICE and to force it to execute any commands6 g1 u! N, s1 ~" ]7 t$ a/ _
(HBOOT...) :-((  
2 i1 D  m% q0 r: j& r6 d/ u0 Z& O/ e0 {, F
Here is a quick description:9 G  n0 K3 q) l. W- A
-AX = 0910h   (Display string in SIce windows)
9 T# o; G( k) @4 B7 ~" S; b7 Y' D$ z-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)5 P/ X" d) s# C# D/ X
-AX = 0912h   (Get breakpoint infos)
+ z7 o( U1 T$ i% C5 B-AX = 0913h   (Set Sice breakpoints)
9 O! x, t$ }  ^3 O/ j. u5 v0 w4 L& y-AX = 0914h   (Remove SIce breakoints)- B! ~! F, ?# O( C+ T
1 j9 G5 I9 o# f& q% {( J: Y2 v, n
Each time you'll meet this trick, you'll see:- \5 d9 n& e9 i# L# v8 ]/ i
-SI = 4647h" e$ U, e, U; I) X& ?) x) D; K' v
-DI = 4A4Dh
9 L8 c' f9 u4 ^! N: EWhich are the 'magic values' used by SoftIce.# j% q% A8 [! F
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
8 A" q* \' u/ F7 U: a: O$ Z5 e5 W5 j. y; u/ }9 B- |5 ^1 z
Here is one example from the file "Haspinst.exe" which is the dongle HASP
; X# w+ |5 H- T2 T; z* ]Envelope utility use to protect DOS applications:
! O# E0 Y4 E4 s. S: @0 s  ^  ?  \! J5 i* q# n

& W+ H9 ^$ h6 ]/ @4C19:0095   MOV    AX,0911  ; execute command.
; D& G0 ], l) k( r# J4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).5 D( F8 d  O7 X" y+ |
4C19:009A   MOV    SI,4647  ; 1st magic value.* F1 a: K6 P" t: e
4C19:009D   MOV    DI,4A4D  ; 2nd magic value.  V  L  l: W9 ?: b+ g+ Y$ I
4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)7 {) D" ?7 R! s
4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute+ L3 \4 l7 V& z5 L
4C19:00A4   INC    CX
* ^) a" H  K7 z! A" n; m( H4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute/ ~; g) o1 a$ V1 l& {* P
4C19:00A8   JB     0095     ; 6 different commands.$ I) g! ?8 N0 a3 O' D0 `2 ]
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
. f$ d  z* E& A$ y4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)
; t" Y& e' ^# \( H- h) c( U
( r5 v/ Y/ Q! v; V6 M! n! R0 hThe program will execute 6 different SIce commands located at ds:dx, which
# g9 d  L  s% B" oare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
2 C0 |$ v! c# e7 m% t
1 c) _, T9 O/ f/ M  L8 S/ C; s, G* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
1 [6 Q/ j+ x1 X6 o8 w$ ^& h% i___________________________________________________________________________
+ H- n4 ?# Q  Q7 x0 P" N% }+ ], ~$ `3 w2 t+ f1 _) k
# T) u. a3 T2 x" e' X; V6 d
Method 03' b% Q. ~6 L# c+ {2 _
=========: L4 {( O) u  ]
8 I, d* T0 v. x9 f3 w5 b$ T
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h2 Z3 m) K; e6 P# C/ @0 Q
(API Get entry point)
# s: t) Y: D+ q2 L) y        5 |3 I) t3 h: A& C" \0 G
7 a0 q+ j3 ^* O+ {- Z* A8 ?' s- U
    xor     di,di
2 C  k1 o* Y/ I  s    mov     es,di# r7 b( n$ M7 N- ~2 K
    mov     ax, 1684h       5 M" h. s2 c  N% V2 b; n" @( q
    mov     bx, 0202h       ; VxD ID of winice' b4 H' D! N& @. V
    int     2Fh
. u  I4 e; l8 w( a    mov     ax, es          ; ES:DI -&gt; VxD API entry point
- |3 T' r$ t- Z) J" P    add     ax, di# C* b, j" \$ h# c
    test    ax,ax* r! l, B, m3 r7 J
    jnz     SoftICE_Detected
: D# u3 i: Y6 [% Z6 R2 C
; M6 [  g# N# f- B3 `+ z___________________________________________________________________________
; }7 K* @( K( |# v  n5 n! H7 ]6 H1 d: e4 s+ p7 Q7 S: Y& p
Method 04# j5 ]% ~0 F9 r2 N9 y
=========
2 l% [# c  m( Y/ ?" ~! O6 |) `% v. O% S7 R: w; u) h$ x( q- m! h
Method identical to the preceding one except that it seeks the ID of SoftICE
4 _8 h8 |% D8 P- PGFX VxD.
- S/ y8 X, a1 u) [* Y: ^! `' P8 |# g# N2 |1 v. Z; q4 Q+ A. w1 s
    xor     di,di
9 B+ M; R7 \9 |) |5 j; o4 H    mov     es,di6 `  N9 y6 T- A* d
    mov     ax, 1684h      
7 x$ n+ F3 W! _    mov     bx, 7a5Fh       ; VxD ID of SIWVID
1 Z6 G) y3 J# `$ E4 {    int     2fh
; u; w) m9 I9 j# p  \    mov     ax, es          ; ES:DI -&gt; VxD API entry point
# p5 @& f/ i5 ~* W. p0 [6 x    add     ax, di, X7 l% i3 @' E% J7 V
    test    ax,ax
1 v7 ]0 w$ x6 p    jnz     SoftICE_Detected
9 C* V& t5 y/ T9 [
) V9 D/ I! n2 `2 ^' B5 @- X+ ?  y* I* z__________________________________________________________________________2 P, j/ _. j' h6 n
% Q& P2 z3 d3 S4 o. T7 N0 l
* W  r8 w2 T) u# k. x
Method 05; g5 j7 H) P6 s. r6 A
=========
8 A; O- u; W: Q# Z
) e& y5 b4 m' t" c$ n9 Z/ U" KMethod seeking the 'magic number' 0F386h returned (in ax) by all system
  B; Z- }: X3 `+ g$ U) `debugger. It calls the int 41h, function 4Fh.& V; K5 F$ c1 K" Y9 y7 x6 J- @
There are several alternatives.  
  [4 w& y! c- y5 v9 x6 I( `( q
/ x0 R, E' z; R1 Z) i  I7 z$ dThe following one is the simplest:/ i. s, R4 K& Y1 C+ V0 w

5 r4 F/ J. \8 a    mov     ax,4fh+ H) _6 h  f& A0 v- H) k( Q
    int     41h
$ {; z* G' Z: s( x" `    cmp     ax, 0F386
6 b5 o1 t  M4 l3 u# a2 A    jz      SoftICE_detected2 E4 G: G/ I$ s- Y  h* t: X

1 }  `  K/ u+ q" W7 D' d
6 j3 f. P" X# m9 J1 T$ v% g3 Y1 TNext method as well as the following one are 2 examples from Stone's , Q: v! n, T3 X8 Z& ?9 V
"stn-wid.zip" (www.cracking.net):
! `- D/ W- G8 r& r$ j
/ n9 x6 V  l+ k$ b: L    mov     bx, cs. O, T2 `. m) k/ ~
    lea     dx, int41handler2: T$ S! @' X0 [# n8 v3 W$ f+ U: P# X8 F
    xchg    dx, es:[41h*4]9 D7 i: H8 S/ `$ t$ X
    xchg    bx, es:[41h*4+2]0 x, X! a: {" M' O
    mov     ax,4fh
6 h5 l% R: c4 s) x; k" D    int     41h' ^) s- w% C! O
    xchg    dx, es:[41h*4]1 K9 K" `$ H0 A! z
    xchg    bx, es:[41h*4+2]
3 A1 _+ ^8 r6 X9 K+ Z    cmp     ax, 0f386h
* G3 W- O6 N3 G/ C    jz      SoftICE_detected
) H+ p. V* q* M' W. p( M1 r  V
* d  ?1 a( K2 w1 k) oint41handler2 PROC
$ _$ J: l3 ^7 U# @    iret
. z" z$ U( G* V/ dint41handler2 ENDP
( Y  z! o) a; S+ r; E# g1 A8 b! B
' C, L# J' h+ d* G/ K5 B! Y. c
( e/ e9 q$ u( E+ {/ a7 [_________________________________________________________________________
- e# `+ q# Z( A& K1 p; c  j7 X+ g! W6 X2 g/ i  W  h
0 T0 P7 ~/ j9 e, d
Method 067 V% V4 r% E5 m
=========& [6 G3 l& ?' i5 H

* r' v' [1 Q/ F3 ]
. i' _2 T; G. S* e" D0 d2nd method similar to the preceding one but more difficult to detect:
6 G3 o/ [; d/ J- }* M# K8 P9 M. A% W% P

: A" u# A. V' p# E- T% G* @int41handler PROC+ D, c5 B4 H! u/ I& u: r
    mov     cl,al
% q$ W# |. N6 X' l% D9 ^6 k, A9 S    iret. k% _& r8 I* \; W( A4 e
int41handler ENDP
' ]# u" O/ G$ ?7 I0 C  M; k% u8 e6 ]" @( r* Z
$ D3 `& i* o7 p4 e3 |: U
    xor     ax,ax9 N$ q3 ?; H6 n! i% J# ~- Y
    mov     es,ax  P/ X, L! |# ^& [3 F8 X: c6 |  h
    mov     bx, cs
4 s3 d. M* ?! ~$ K: R    lea     dx, int41handler
/ x1 Z" J! B) U; ]5 v    xchg    dx, es:[41h*4]5 m; g8 b% x  P& [  y) y
    xchg    bx, es:[41h*4+2]
/ {6 R# U. e4 w- M' R  _; ^5 B1 I    in      al, 40h) C4 v/ Y- i% z2 b% r
    xor     cx,cx
1 T# G& S$ l, P2 E$ z7 T. v9 ~* A    int     41h7 d# D- B$ r% s+ u, j! A$ T
    xchg    dx, es:[41h*4]
; W' r" ?' j( t4 [8 H: P    xchg    bx, es:[41h*4+2]
0 O* A6 t* K* F# c- n$ ?    cmp     cl,al: S  h4 K7 s( w3 g0 {5 O9 p
    jnz     SoftICE_detected: c  W+ e% _0 d6 a; z# {  x

. ~7 I: c8 P' j2 E- @( [  _) ~_________________________________________________________________________
5 R  R7 R& r. q# e+ M5 a5 f: i& c) x: x' o( _
Method 07( I: m( t  N4 b$ C: u3 m) n
=========# r* Y: |, m1 h6 i8 E! X5 z8 g

" v7 b+ u6 B0 o4 Z4 `: J* x, m' E9 tMethod of detection of the WinICE handler in the int68h (V86)
( v! ^6 {/ i1 s& r, ^% q* {& p4 V  k; H6 Q0 F
    mov     ah,43h4 X, H$ i2 ?# i& n7 t
    int     68h
- \( o$ }- ?7 u$ P7 L0 v, Q    cmp     ax,0F386h& G! X% {% L" R/ G) C' D( ^! B
    jz      SoftICE_Detected
% ?0 N' G" N+ f" \# P1 }0 d2 n# m" A
! J! I1 m/ z; @- `* T  j* ~
=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit: d5 m7 d) g/ e! P; {) v
   app like this:
& |3 y3 C. c. Y2 {, x
* `) q2 X- U1 K! ~- i   BPX exec_int if ax==68
3 d' S7 P) z4 P/ b   (function called is located at byte ptr [ebp+1Dh] and client eip is
" z& `2 t: O' b) q& z. r% T# v   located at [ebp+48h] for 32Bit apps)
0 ^: A+ f  n9 V' e; C$ O: B) I5 B__________________________________________________________________________
/ c( Z  e( b) x! }% Q. C! U3 j* W1 K4 m- m
) `) _' @8 ?# c
Method 08
% X& ~% @. Q9 {# }; v0 Z) G=========% q% J  H1 z  q

" {  v- J, X. [It is not a method of detection of SoftICE but a possibility to crash the
' z* o* M4 y7 e/ ^' jsystem by intercepting int 01h and int 03h and redirecting them to another
/ c# p- b  D% f) r  G9 o4 hroutine.
  a; h- x1 ]6 rIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
' q6 z7 e8 W: S  Kto the new routine to execute (hangs computer...)) j# p$ m- ]& w3 @% E
4 d+ z( y3 }; \7 J4 w
    mov     ah, 25h3 b2 z+ ?* X: M. F# s) h! _
    mov     al, Int_Number (01h or 03h)* r7 ?; e7 P4 Y' F0 a* S+ o  \; T/ F
    mov     dx, offset New_Int_Routine
& K# H6 \+ Q3 s' Z    int     21h
1 i+ g, m4 |- z& F) Y; X- R9 E3 [
/ ]6 \6 [2 Q+ Y- S* e$ w__________________________________________________________________________
. X& ^6 p7 x! S7 O- W. I1 V6 ]5 p& y- J; O& `* \) E
Method 09
' F$ G( A1 J7 z+ M6 J=========( Q& Y) M2 L1 k$ X# C
  E9 _/ P8 h+ r. y
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only* U4 B- x  z  d$ e, w
performed in ring0 (VxD or a ring3 app using the VxdCall).- u' R7 ~) d4 M* p1 P& f
The Get_DDB service is used to determine whether or not a VxD is installed
/ M1 q6 M+ V0 @+ P+ G- Dfor the specified device and returns a Device Description Block (in ecx) for
2 h7 T7 L. x* q+ k1 R3 z7 }  Dthat device if it is installed.
" ^! w, b% f$ b" Q
: s5 |( [+ m9 ?9 a! r% R+ M' x   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID
6 g' l$ N4 r0 {/ c   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)' o% m# n6 [" h0 V. l$ h) w
   VMMCall Get_DDB/ H) k, B/ X9 x( L5 b
   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed. L/ ]+ S7 j1 w( l! N
. m$ I% b# u& t! x9 R! |4 B6 `# t
Note as well that you can easily detect this method with SoftICE:
1 i% N5 g+ f$ g1 L: z  _" x1 v1 X   bpx Get_DDB if ax==0202 || ax==7a5fh
; e, G7 ]8 t" c1 z; A2 g+ |
; d* d4 m1 H: [. S; t+ S$ U# `__________________________________________________________________________6 u  O. D9 E& b6 I

7 w, R1 x, b- @7 ^- eMethod 10
6 T7 r$ l3 G" \=========
$ n) b/ m0 f$ L" r1 O) i$ O. b) N
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with1 r& m+ ?- e3 T/ @
  SoftICE while the option is enable!!
8 Z9 [  X1 {' ?# {1 q( k7 E6 r, I6 w7 {$ J* }& Z
This trick is very efficient:
/ n* E# ^: Z$ e* }0 Rby checking the Debug Registers, you can detect if SoftICE is loaded# i$ Z' b% A2 n( X. e8 i1 o7 m- F% _
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
2 E4 ^) Y! R5 Q0 l& M$ |there are some memory breakpoints set (dr0 to dr3) simply by reading their% J' q% b* Q% c
value (in ring0 only). Values can be manipulated and or changed as well
: s/ @1 s( ?1 v& y0 v(clearing BPMs for instance)$ P) s4 o- I( w; R$ r# B* Z0 ~3 B
, g* r2 T' W- ~. u  R4 G  i
__________________________________________________________________________
, T6 y2 L, ]) o9 Q
8 B- C  e+ M9 t( e. ^5 vMethod 11
% P. n4 i( }- c0 w9 t) Q=========
9 x, i. j* G9 R# a4 Q
6 T: [6 |2 L( w1 aThis method is most known as 'MeltICE' because it has been freely distributed
) U- Y. A* `+ c: j. ~+ P$ `; Dvia www.winfiles.com. However it was first used by NuMega people to allow
. R* h& N( _, P4 g) _; eSymbol Loader to check if SoftICE was active or not (the code is located! s# P5 U8 v& U6 E+ T% t# ^
inside nmtrans.dll).
' p3 C" [+ R5 k% f; w4 f
: e2 H' A6 ~" A$ G+ rThe way it works is very simple:, _4 w+ Y: ]: U# a
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
, C3 m" y( [+ o4 \/ G/ L+ OWinNT) with the CreateFileA API.! ?! m& M& W4 K! |3 }
$ i8 o  m) g. T2 u1 p3 ^8 H
Here is a sample (checking for 'SICE'):/ \/ G7 M& O% e1 y+ Q# X, k
) w9 Y( d2 G+ Q1 o
BOOL IsSoftIce95Loaded(); g' [4 W! x, p( F, P6 c4 `
{8 D; _4 Y% N$ |/ R( `3 x. _
   HANDLE hFile;  & r8 F) C) w1 q$ `$ s' B
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
: @4 D1 h4 Z# t! {0 p4 O/ l+ h                      FILE_SHARE_READ | FILE_SHARE_WRITE,3 e8 F. s. H) \* c
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
: T  Q: L3 b# J7 z$ a0 [   if( hFile != INVALID_HANDLE_VALUE )5 X* z& P% s0 D, G+ g3 k* T/ k
   {
3 A- Q/ [+ O, ?6 V5 \      CloseHandle(hFile);/ V( _" U; X8 n
      return TRUE;
9 o( m, w* i' `   }
+ X  Y9 z# r! f+ x  |; ~+ B   return FALSE;$ z2 T2 B2 v# h% i
}
, _2 ~, x8 c; Q! g. E: I5 D
' f/ M. a: q' m2 K0 [* y* d) yAlthough this trick calls the CreateFileA function, don't even expect to be
( n! e. z: U3 O+ l8 `  N: \able to intercept it by installing a IFS hook: it will not work, no way!$ m% C* G: B" Q8 \! X2 w
In fact, after the call to CreateFileA it will get through VWIN32 0x001F: [" w6 l1 n0 I: I
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)7 U0 ^" [& ^% V3 p- H6 w  p- U- Q# l
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
' X" y4 U/ E* H! h; yfield./ `5 W8 @6 d" U, q3 b) n
In fact, its purpose is not to load/unload VxDs but only to send a - Z6 f% G9 n; f3 }( m! S
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
5 S' C5 z+ }; q$ u# Yto the VxD Control_Dispatch proc (how the hell a shareware soft could try" H6 B1 b# D" @" z/ e: m
to load/unload a non-dynamically loadable driver such as SoftICE ;-).  Z# |) t0 @% I& ^- ^/ t% z* y
If the VxD is loaded, it will always clear eax and the Carry flag to allow. C& U* r9 x4 K
its handle to be opened and then, will be detected." k2 _# A, A# T+ ^% P
You can check that simply by hooking Winice.exe control proc entry point; j( m# o  M- ?  r/ u  O
while running MeltICE.% O, h; V6 S$ G

8 O. |/ j- E" m; J  Y/ \
7 z. X! a+ d4 Z1 z0 L, p' D5 S  00401067:  push      00402025    ; \\.\SICE
& o# T* {; M( S) d. f" z2 U  0040106C:  call      CreateFileA
; Y* D" z* r2 k8 q. c3 p  00401071:  cmp       eax,-001; K# F! O5 D3 O; T- j( m
  00401074:  je        00401091
7 p4 j& [5 ?7 Q* |. N' ?. {
- b0 F& x9 @( Q8 I/ c5 J/ d
& h) Q0 r) o( L. V4 E$ b$ tThere could be hundreds of BPX you could use to detect this trick.
* N, H/ ?$ G, A  X-The most classical one is:
% [6 @' I; j. ]  V* Y2 X  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||( S' ?+ m8 Y) Y- {; }2 K
    *(esp-&gt;4+4)=='NTIC'+ c. y& v' T3 K

" c# _% ?* ]8 N-The most exotic ones (could be very slooooow :-(, ~' F+ r# Q6 B! H6 u  r. l
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  8 ]+ v$ f# q; y4 \
     ;will break 3 times :-(/ ^0 h2 r3 a, @2 w! f
. |: p. \, E4 a+ I4 c. G/ ~! m
-or (a bit) faster: 9 X: _- ~: U5 R+ h. E
   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
6 J. ~) q- B9 D& C/ |' h' {' M3 m2 x1 ^
   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  # M* M# |/ p% _4 ]* r/ m% D
     ;will break 3 times :-(6 T* V5 D2 D" G5 Q, _9 j* r
) {. C8 g% {* i9 ^
-Much faster:
) Y. j7 D5 r( ?* @) c3 M8 ^  }   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV') L4 P8 x: r& a; H

3 i5 G2 B# c6 U1 V$ b, F1 iNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
* b" b, b. r4 k4 x) F6 {function to do the same job:
8 d3 V8 |+ u' m/ ]( e+ G7 c3 y- }5 \9 j: {. d% D
   push    00                        ; OF_READ
5 Z. D: V3 V# V4 t   mov     eax,[00656634]            ; '\\.\SICE',0
8 i. U' z" l5 Z( f7 p6 y6 C   push    eax
% N9 F3 U( i  T3 A  ~7 o0 _2 j   call    KERNEL32!_lopen5 l. T* L' b5 S) o1 d) q9 f
   inc     eax2 p5 [  H" Q8 u+ l+ P
   jnz     00650589                  ; detected. M' I% s, o1 l* Z
   push    00                        ; OF_READ
: P& @5 l0 }4 X4 ^7 J5 J   mov     eax,[00656638]            ; '\\.\SICE'
1 U: f3 x$ r/ g5 }8 }   push    eax
# W" T2 g3 I! J8 G" i   call    KERNEL32!_lopen$ r& P+ H+ W' p
   inc     eax, `+ F8 r# c) M& e( Q7 x9 L# V
   jz      006505ae                  ; not detected
5 u7 m! |# H. g
: X6 q9 ?. F& e7 O7 c* _" S; e/ f
1 U: @7 V6 C6 P8 ?7 L6 X  y9 t__________________________________________________________________________
3 g6 v7 u% i$ U& x, s$ M2 k7 O0 l5 h, a3 G  u5 I' w
Method 12( X1 T+ {/ h* E6 C
=========% m7 G9 G" t/ d
) S( }5 G% z+ u
This trick is similar to int41h/4fh Debugger installation check (code 05
/ d' P6 y/ M6 j- a9 ^7 L& ?&amp; 06) but very limited because it's only available for Win95/98 (not NT)
2 ~+ b7 z  J8 _2 M6 ~6 L2 i/ `as it uses the VxDCall backdoor. This detection was found in Bleem Demo.8 K/ H  I. z6 D  j& D$ z4 S8 K

# }& ~; _. c- m1 C( F5 w) |: U   push  0000004fh         ; function 4fh" n: P; x3 C3 M. a( g+ r) p2 k
   push  002a002ah         ; high word specifies which VxD (VWIN32)
. B; R4 Y" E# x9 Q) z+ f7 F                           ; low word specifies which service
2 C7 |1 `4 l( P4 F( T                             (VWIN32_Int41Dispatch)
  _, _- g, u8 |9 D5 [% P! u/ l   call  Kernel32!ORD_001  ; VxdCall
& G& c& V; }" T! A   cmp   ax, 0f386h        ; magic number returned by system debuggers
; L0 m. H. _) K; ]% ~) }2 N' [+ G7 F5 D   jz    SoftICE_detected
/ d* }# z1 V% H0 Y2 O, V
, S( Q& Z) D2 F% H' OHere again, several ways to detect it:8 K/ }0 x, |) c
2 h- o& {5 n5 U8 @8 z
    BPINT 41 if ax==4f; f3 R5 D  Y7 Q9 P

8 R2 Z. Y/ m( N: X& R    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one9 s) J8 I2 B8 O' n

) _  u/ j! K0 i& [4 u* @# ?0 ]    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
( z: k) U/ ^  J* n; b) ^+ W0 a
4 J5 }8 z& N- H6 L% P! k    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!& j% |- [5 g% G, c( @' c5 G. R) m8 d
' R! R  {  _/ _( X/ H; l2 G
__________________________________________________________________________" @1 E& T% y  {* @% u7 ?

# |" r4 X- ?3 y8 C  rMethod 130 b+ d+ K2 l* h3 I; ]/ |. t* K3 T: s
=========
) e6 t4 v8 m& T( M9 A- H- P' o" q6 W( J( h
Not a real method of detection, but a good way to know if SoftICE is
  ^# w" y4 M7 b: R# w. e) q8 tinstalled on a computer and to locate its installation directory.
# d6 v. }" m7 m0 B" M1 h  n) dIt is used by few softs which access the following registry keys (usually #2) :! P  T: q* b7 c

9 E4 ~5 T0 F7 \9 r1 {- w4 g0 D-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion, g2 h" |: A9 }  }! O2 Z/ |6 f. Q
\Uninstall\SoftICE; T# {! U' M) p8 D  K
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE. ]0 x" U! l  P$ Z; g0 }* g5 z  |
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
& i7 _  Z4 m# _! W$ i0 ~\App Paths\Loader32.Exe2 ~% a) e3 ~& n; F# A! f8 z

" ?% x, u/ ~  t; K) M+ [
) p; I/ O. n' k9 Z+ R, `7 T! [3 VNote that some nasty apps could then erase all files from SoftICE directory
) n3 `9 ~: a. ]; N7 V(I faced that once :-(( t: Z* I) t# E0 [0 I  A% G3 I
1 o5 L, n! \! i- D0 w4 r* H
Useful breakpoint to detect it:
, v( K6 y/ h+ W! |& b
% R! k1 ^3 R" f. t( u     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE') N+ F9 l6 c; b

: o3 H, G3 p. o0 I2 r' i9 Z__________________________________________________________________________9 s& {1 h) p" D. Y6 M

+ M& p# {- ]: H0 E( d' y9 z1 G$ {1 d0 p! S
Method 14 * I* y3 r. a' L# a1 M5 }+ x  T
=========
' ~+ P+ K+ r* _
4 x+ r% p$ w) Q# rA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose' g* s2 A* e$ q+ |8 i1 Z/ _
is to determines whether a debugger is running on your system (ring0 only).
/ H, x+ F1 T: Y5 G# }: d3 b, L
. x3 }& \* @% _5 F# e" O   VMMCall Test_Debug_Installed
4 Y5 c% H9 d3 I. |" p   je      not_installed. e0 o4 e7 j" N  J8 ?7 ~+ J5 l
5 w% N* q9 A' }6 u! W( a
This service just checks a flag.# f6 a) G  K% W. y6 G
</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关注公众号

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

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

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