About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
3 F1 R- c) a# s1 w) O<TBODY>
( O. b$ {' K; ]1 L1 n( w<TR>. I% D, n0 H, C: O2 j0 b. q
<TD><PRE>Method 01 , D, T2 }$ f2 B  C
=========* u1 w* T5 c  g6 \0 `

/ e7 j5 `" k5 N4 I2 d$ V; zThis method of detection of SoftICE (as well as the following one) is
% h: l! V; g6 zused by the majority of packers/encryptors found on Internet.9 h, @& b9 D+ X2 t6 L2 V
It seeks the signature of BoundsChecker in SoftICE
, x; Q" M, t* K/ y& i4 E
/ u& {+ l/ _& t* t3 P* C    mov     ebp, 04243484Bh        ; 'BCHK'- Q2 t+ A; y6 C1 k5 u9 ~) X3 s
    mov     ax, 04h* j3 V, g0 D6 J6 G
    int     3      
) h: O4 Q7 Z+ n, t( b( q6 Z  o    cmp     al,4; e' s( a# ?7 b6 x: D4 f
    jnz     SoftICE_Detected/ Y7 m3 ?+ J1 K& ]9 A  U
, M3 `; d/ N! a; r7 p. |& h
___________________________________________________________________________
3 Z, l0 s4 g5 C1 Y1 t* v' W" a3 p
) h( g; t9 \+ U+ }Method 02
8 y: w$ G3 z9 Q# ~=========
6 H" W/ c9 `5 h- _1 M4 ~
. K* D9 j0 h% C; c" |# y* YStill a method very much used (perhaps the most frequent one).  It is used. C* C6 p9 o9 l5 ]7 S8 M9 z
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
, b3 L8 E; ~" @1 w2 `) y# Y; gor execute SoftICE commands...3 V& g6 Q( R$ }5 M7 E
It is also used to crash SoftICE and to force it to execute any commands
& U' G% }6 X) U) M) e(HBOOT...) :-((    B; ]! m' y/ ]. m

2 @$ u0 N- S1 s8 s$ YHere is a quick description:
* ?& H% j8 y6 F: }. W' r9 j) J-AX = 0910h   (Display string in SIce windows)
# ?2 k3 {+ o2 z, I-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)
% b; S3 L3 V7 s. W$ d/ ~-AX = 0912h   (Get breakpoint infos). ?3 R5 K  h/ g4 e
-AX = 0913h   (Set Sice breakpoints)
6 a9 Y4 H! _) Q! S' }5 n-AX = 0914h   (Remove SIce breakoints)! e4 o/ V% [( H) ?; d, t3 A

9 A" G8 n8 ~3 |$ LEach time you'll meet this trick, you'll see:8 Y4 J% y+ t9 \2 F
-SI = 4647h4 o$ S- x: l- l$ {
-DI = 4A4Dh
4 o  P0 }/ [& O8 VWhich are the 'magic values' used by SoftIce.
) H5 i; s- k- J+ `$ U  jFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.' p5 T9 M3 i  @% R1 Y

& ^" y, o2 a! \* I. x; RHere is one example from the file "Haspinst.exe" which is the dongle HASP
1 v/ O2 J" {' C# IEnvelope utility use to protect DOS applications:/ |3 [( }- K! d& _0 c' w

3 J0 G2 f) c$ O# n" p4 D" u( l# I
7 @/ k  t) o9 y+ O" v% g, w7 U4C19:0095   MOV    AX,0911  ; execute command.
* D" @( w! Q/ ?+ G7 C4 s8 N$ E4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
5 i. h# j9 L6 a2 ]/ k! j; B( r# F4C19:009A   MOV    SI,4647  ; 1st magic value.9 {2 I. N) \" }- g2 U
4C19:009D   MOV    DI,4A4D  ; 2nd magic value.5 X4 O- K5 q* G; f
4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)3 ~! M: S9 V) R$ t
4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute
( _8 I( ~/ n0 y8 u2 J! l4C19:00A4   INC    CX" G" L  `8 x9 `, A  D9 Y, h
4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute
; c' ^0 G4 [) c4C19:00A8   JB     0095     ; 6 different commands.
6 l" V& A4 J3 F& x4C19:00AA   JMP    0002     ; Bad_Guy jmp back.* z) {  F# G* D; F& }% G# N- [- a
4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)
3 P# o3 S2 @3 Y  Y$ j
6 j6 R2 N; u0 U2 w7 KThe program will execute 6 different SIce commands located at ds:dx, which
8 J- W2 k( m. F4 care: LDT, IDT, GDT, TSS, RS, and ...HBOOT.: u- W* \5 n5 i+ E; l9 Y6 T

1 U. R$ x6 Y# e/ x) Q: G7 X* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
9 V! L  F& T% b2 ]4 p___________________________________________________________________________7 h9 a5 p( `2 x; h/ S5 O! n+ e. a
! c8 t$ Z+ _+ I# x! e/ Z$ M
5 [, |: f" a9 h8 ?# {  q
Method 03; V. |& Y1 c4 `, U
=========
' I) w7 ^+ ]- S% V; d
' P. G5 |" W* n) i% u+ t' p" HLess used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
' Q. B0 |5 p( }& N(API Get entry point)$ @& r: ?. M, H: T
        ' l  z. u: y& e6 v

# \8 C- ?" `4 R% S+ L6 t: L    xor     di,di
+ O$ S- c: S5 E7 J, D& R$ C    mov     es,di
+ ^' ?6 K+ R, W7 J) x; |1 _    mov     ax, 1684h       ; J  P+ I$ Q4 s2 c! k0 g5 U! R
    mov     bx, 0202h       ; VxD ID of winice
' y4 o  q& p, N8 t7 t- t    int     2Fh1 S4 C3 e! q+ q9 E$ ?2 _) u3 [
    mov     ax, es          ; ES:DI -&gt; VxD API entry point3 |% p7 L" }8 b! l( C6 o
    add     ax, di
( G6 v7 {  b6 y8 p# M: D    test    ax,ax) A* B) |3 T& u9 d; b
    jnz     SoftICE_Detected
# [4 B6 ]: `5 ^& A7 j9 Q
# j$ D( [" G+ }3 K. H( f' v___________________________________________________________________________
/ d2 H4 R( s: G. a5 y) P; c# P- P( p/ K* u, s
Method 04% l) [* [9 b2 H% ^. P
=========( c  g3 I1 M" {& j
7 j# P3 N" r2 k% d; a4 S
Method identical to the preceding one except that it seeks the ID of SoftICE* M( B% X; z: I
GFX VxD.
& E! Q" W& q# s& B6 ^9 e4 p8 n5 Y* L+ E1 G
    xor     di,di
- Z# S* [2 G9 V, U4 a2 \    mov     es,di
1 i4 |+ E5 z7 x' n: T    mov     ax, 1684h       ! y8 Y/ I& V) q- ?) i  K2 N
    mov     bx, 7a5Fh       ; VxD ID of SIWVID* [6 B' R2 r, P* e  M% a( h
    int     2fh) E0 Q' [/ \. b8 a9 x
    mov     ax, es          ; ES:DI -&gt; VxD API entry point
4 I# Q: _) s. z& H    add     ax, di/ @" S0 L! L) D. }1 [. T
    test    ax,ax
# W1 B# L/ K+ B$ K7 \: i" U# u! G    jnz     SoftICE_Detected
% K: \% V$ c6 @8 w% q- d) K2 J0 v
__________________________________________________________________________% ?+ Y  H8 V$ p& s+ M- D
4 P5 \8 J- H, M$ P7 C% F
! z' @8 h) T* z$ n
Method 05
5 \; S  w8 p- ^9 \. Y=========
# ?& d, e* |. M# D1 J7 C: ~  A0 _6 I4 v
Method seeking the 'magic number' 0F386h returned (in ax) by all system
. d( v: D( v" g% }; zdebugger. It calls the int 41h, function 4Fh.! [5 B" {" R: d5 b0 P* i
There are several alternatives.  " Q0 W" p# U; C' [7 ]* P
$ m' E- c/ G6 V" G: S
The following one is the simplest:3 q  R2 w* ]9 d8 Y2 W7 L! ]
' X) }: d3 A) e; j- @0 T
    mov     ax,4fh
# f( s8 D+ z/ o( ]    int     41h
3 V5 i" C* B- A' \, \; K# `2 w    cmp     ax, 0F386
# g  S# g3 |/ z1 Z$ U" s    jz      SoftICE_detected
7 A* Q( D4 S3 q: C  I% P0 R( k1 Q: s& A/ k" ?' V2 C
1 [  F8 c- V, X1 r
Next method as well as the following one are 2 examples from Stone's ( M  w; u5 r2 h
"stn-wid.zip" (www.cracking.net):
( X8 ?" {: D6 Q" F; ^  O) K
% c0 I5 _8 V- a' t7 R4 b; n" z0 _    mov     bx, cs/ R2 l2 x. i6 ~: ~$ }
    lea     dx, int41handler2+ ?+ Q# @6 e, u) m1 ~
    xchg    dx, es:[41h*4]/ ]6 n9 G9 Y2 s/ L% d7 ]
    xchg    bx, es:[41h*4+2]
0 d/ k5 _* y8 t" b9 [5 }    mov     ax,4fh
5 Y0 W0 Z' ^9 P. P8 J$ }" t' ~    int     41h* |6 [7 v3 u9 l8 T; L: F% \6 u
    xchg    dx, es:[41h*4]
6 u3 Z6 X+ c2 _6 Z; c0 ~. M" |    xchg    bx, es:[41h*4+2]3 n( t# d3 z6 p  G2 p7 w
    cmp     ax, 0f386h
' r1 e* @. }0 r' V0 w1 p) J    jz      SoftICE_detected
, M0 }1 n9 o8 k) y! l* L$ ~0 R. G+ n- e' i7 U
int41handler2 PROC" d" Y) {8 A; M- }: r3 I8 h
    iret$ w! P% N7 b* k7 |4 t. \4 }
int41handler2 ENDP4 L. _5 b4 ?" x1 z

- l) t9 @0 P# V: k6 ?! v/ R, \
/ r& ?0 {0 r5 N; N% u_________________________________________________________________________
' B3 Y: @- C& I. c' _6 c& p8 f; j/ ~" B: _# j8 b6 ~7 V8 v% k( o
( |: S3 u; j! x
Method 06
. S6 \& v( C  s) ^$ P& N% g0 M2 n=========
) z# S1 K0 c3 y6 N
) m( V8 v7 T$ I1 ?9 i3 e- q+ z* B" ]1 T$ o$ w- I1 Y
2nd method similar to the preceding one but more difficult to detect:
1 k8 J+ a3 W7 T6 C' |
7 _$ |7 l. y  q4 J! _# z/ q* x
$ Z1 l. M8 Q/ e" D' [# dint41handler PROC; k: z! T: o9 p
    mov     cl,al9 b/ `, p) }) }
    iret
9 j; n! E4 R) T; @5 N. |int41handler ENDP6 `2 ~5 a( B$ J8 ?

. b9 n0 Y+ b2 R
0 D) F8 k! E1 _; K' Q4 s7 t) Q    xor     ax,ax) W) A8 t% V9 T. x
    mov     es,ax
2 j2 h8 ^. V2 _/ G9 M( u    mov     bx, cs
% d- i8 d. y6 s- i    lea     dx, int41handler4 K& Q- _0 c7 u8 z! |7 ?5 B% K
    xchg    dx, es:[41h*4]/ P3 b* C/ e) {
    xchg    bx, es:[41h*4+2]" N7 W; e/ [1 o( R
    in      al, 40h
. r+ N. C9 z& k    xor     cx,cx; d4 \$ A4 p$ {/ F4 Z# L
    int     41h2 R/ j( S; K  s; m% x$ ^
    xchg    dx, es:[41h*4]1 C9 s# O! y& O
    xchg    bx, es:[41h*4+2]
; Q! y% ?; a# W" @# L    cmp     cl,al- v7 b. N" o& ]* N: |/ Y* `; g- T
    jnz     SoftICE_detected
6 @6 f# N: @# J( g- U2 [" @; G7 l+ ^% Y" }, n: q" k
_________________________________________________________________________# t+ U! S8 w- q; Z

# ]# F+ k. G7 w: ?+ @: lMethod 07; E' c# f$ \; q0 X
=========
- c/ a0 z' [8 X$ x4 W* V: E4 _* B
" i" x7 z: }* L3 p5 v7 `/ B8 iMethod of detection of the WinICE handler in the int68h (V86)- U8 |9 i7 O0 \* s1 E' S. Z

; A( B) f# j4 H5 m  H    mov     ah,43h9 P1 k$ U: s% {! l7 i
    int     68h
9 W$ a! w0 W4 w5 j    cmp     ax,0F386h
1 a9 h$ A/ u/ w9 w: }8 q% l) m    jz      SoftICE_Detected
+ f. ?: Q4 H! I; J; H8 I- O/ o
* Q) R6 k& ~! V4 S; N3 w4 a
9 }- k; ~& |3 ~! ~- o6 T* M* |2 @7 c=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit# n- m3 L8 W8 p4 D, Q
   app like this:
2 x* Q1 f, t  f) Z6 J) p6 Q
* p. C8 c2 w" Y  Y" N4 l   BPX exec_int if ax==68  S  g6 R; R: i
   (function called is located at byte ptr [ebp+1Dh] and client eip is
9 j8 m! G$ c  o" b- {4 k1 L   located at [ebp+48h] for 32Bit apps)3 {9 ]3 O- G$ D: l
__________________________________________________________________________; o# _" N) U$ [3 u& k6 r
7 h  Y0 t( Q8 b$ R6 ?( [, s4 w% c
5 v: b' a  e* h+ {. V) r
Method 08# ~& R0 |4 C! t0 x8 B& K
=========) k+ P" O" \; B2 L! B

9 Z7 H9 v+ Z& ~6 G6 K) q. ^! |# lIt is not a method of detection of SoftICE but a possibility to crash the+ H' L  B* _1 @" n3 G5 A
system by intercepting int 01h and int 03h and redirecting them to another! }6 d2 u/ r. z2 @& K' c, b8 M: [# g
routine.5 T2 ?. \. a( \. M7 D
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points; r: T5 Z& c1 Z  Z6 R+ i% x6 A
to the new routine to execute (hangs computer...)
2 A  u  h3 X  q/ ~* _7 z% {
7 x' n' Z" U& W7 U& \$ n: `+ {( I    mov     ah, 25h( Z& g  S! a! e& y5 H# l. L
    mov     al, Int_Number (01h or 03h)
3 j/ s2 F1 U, v+ h" X2 K    mov     dx, offset New_Int_Routine3 b% v9 x* l6 S, P2 T# B
    int     21h% t5 n4 O- c  n5 ]3 b
; T- A& B$ {0 }8 k3 z3 |3 `
__________________________________________________________________________
2 a& g0 @5 R8 r. j& D# w6 O8 i0 [' A# Y, t
Method 09
/ f: Y7 i6 Z  [3 W=========
7 @. m, J# Q  `1 n8 j) z
3 J8 y3 d/ |) ~7 Q. D3 T2 c& c1 tThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only7 Z, p- A% [- X5 k# d2 ], e5 T4 V/ K# q
performed in ring0 (VxD or a ring3 app using the VxdCall).# V' e, K  A  k9 z
The Get_DDB service is used to determine whether or not a VxD is installed
4 j1 }2 Z! n2 A4 H, Y8 efor the specified device and returns a Device Description Block (in ecx) for; ^, P& Q' n, Z% H# H  R3 m* P* b
that device if it is installed.7 G- k9 S- t  ^: ^
$ N0 ~* F9 a1 N, u
   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID
& n0 K% p$ N5 r4 R% K. \  s1 i   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)0 A+ u, T6 b! y9 D
   VMMCall Get_DDB
0 D0 m) c$ x. @: H( U   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed4 g/ O) C$ Y, \

5 |& D$ f: Y( s  b* kNote as well that you can easily detect this method with SoftICE:
9 ~$ ^/ D  C/ c! S$ s$ r   bpx Get_DDB if ax==0202 || ax==7a5fh
, i9 Z+ _9 }# ^# F, w! T) Q3 |- H* |$ B6 a1 Q# w
__________________________________________________________________________/ w  G$ I! W% {9 P  O

. ^) R, W3 E4 g/ M% w7 cMethod 10- w  w, {, ^. L
=========" ?% }8 c1 [5 x! @7 f$ D% Z

. _9 o' N$ ?+ ^8 n! v9 E- \: e! X9 J=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with* |1 @: f( T9 A: _; n, x* f! \
  SoftICE while the option is enable!!3 s  I. y3 i* j2 }  I9 G1 H
- E, w. z# G! ]. i, c' i
This trick is very efficient:
, w/ `) }9 K. s) n7 `; @5 @4 k$ Qby checking the Debug Registers, you can detect if SoftICE is loaded, @4 u3 m4 \+ q9 V
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
$ X: ?/ U, D1 t- n) ^there are some memory breakpoints set (dr0 to dr3) simply by reading their$ T* u5 E! {4 z
value (in ring0 only). Values can be manipulated and or changed as well
. n! f' k0 `$ t0 N9 ^# O(clearing BPMs for instance). F* U+ ~. [- `+ o2 i
0 o5 p! m' H3 p6 c7 e. k7 y+ M) f5 v
__________________________________________________________________________3 B# G  `* m; c: d
- t' M1 j( I4 R7 Z; e- y- D4 _
Method 11, U4 G8 t  t: i/ J1 S( ]/ e& c
=========! o+ [, T: B8 z$ r5 I& M

* |1 U- d5 \0 S% R. _: V6 uThis method is most known as 'MeltICE' because it has been freely distributed
4 |2 F" v% \$ ~6 f2 c. qvia www.winfiles.com. However it was first used by NuMega people to allow
, u% {$ R  v1 xSymbol Loader to check if SoftICE was active or not (the code is located
: Y9 ?, T7 o) W* a4 [, f1 r, Ninside nmtrans.dll).
: G+ }& C4 F; i* @+ H# e( ~2 t% q- n3 p8 \8 V; F1 |
The way it works is very simple:
& j9 o: g  G& PIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
( E$ G- ~# m$ X7 d+ p; L9 @WinNT) with the CreateFileA API.
% x0 k8 ~5 m' M% v: e" p4 U8 }6 H
Here is a sample (checking for 'SICE'):
% r, B8 @5 `& h7 T  E  F1 n, g1 O: A# O" w
BOOL IsSoftIce95Loaded()9 S' V9 ^3 }4 S( i" x/ S
{- E' ~1 R3 r7 L2 ]) i2 B1 d% z
   HANDLE hFile;  
* T# b! L& P* \   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,( }9 d1 s# C; C8 K, [% D5 U
                      FILE_SHARE_READ | FILE_SHARE_WRITE,
4 C1 c( t6 w/ c0 z) g5 V1 I$ Z4 ]                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
3 O! H4 Q2 ^: ?   if( hFile != INVALID_HANDLE_VALUE )
0 ]8 B$ E) ^5 b' ^  `" u   {
& _% S( C  d$ G! |7 R! V      CloseHandle(hFile);
9 Y, n. O8 R( Q& l: \5 j$ F      return TRUE;
% V  }6 ]5 {  @- y& s1 y   }& K' V3 X  ]7 p3 B2 p4 X
   return FALSE;
, Z' \1 `  q% E9 o}: ]. U0 e& i/ z; ^' k1 ~2 |

; L2 H5 D" |% o5 JAlthough this trick calls the CreateFileA function, don't even expect to be
1 v5 U- F$ r5 \' kable to intercept it by installing a IFS hook: it will not work, no way!
/ r6 `: F) e/ h- t4 IIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
; L* r( h' `- d. i' ?! dservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
( E8 F' d& P) C& r( Jand then browse the DDB list until it find the VxD and its DDB_Control_Proc
" }2 D6 ^4 K$ ^* R/ h! O; K+ \6 Ufield.
6 q# Y: Z1 W; JIn fact, its purpose is not to load/unload VxDs but only to send a & M3 c/ W5 d% W
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
1 M3 N& b2 ^$ |8 o2 D* [" k  _. ]1 Rto the VxD Control_Dispatch proc (how the hell a shareware soft could try3 y/ L9 d5 @4 y) m
to load/unload a non-dynamically loadable driver such as SoftICE ;-).5 [6 q7 U+ J8 x/ }
If the VxD is loaded, it will always clear eax and the Carry flag to allow
& Z) t' O6 b3 [9 q  U/ Tits handle to be opened and then, will be detected.8 p9 b% Q, a9 w* z: l
You can check that simply by hooking Winice.exe control proc entry point
' a3 |: N2 ?+ N* [7 i  Hwhile running MeltICE.
! T' r3 |7 i) ?$ r' ~  j1 @: J8 D4 d9 f9 j' \

& F3 h( M) V' p" C8 ^% E4 n  00401067:  push      00402025    ; \\.\SICE
0 G- S! F" D8 z$ X1 ~7 C  0040106C:  call      CreateFileA' l4 \! \! J8 m( Q) U
  00401071:  cmp       eax,-001$ w, p/ B! }' Y
  00401074:  je        00401091# Z( [' G; X; c  T" n

  m6 w" d7 t  n. @7 ^. d7 c' |* H7 p) M
There could be hundreds of BPX you could use to detect this trick.
1 F- D+ f6 H8 q" G* Q2 W-The most classical one is:5 r) [: ~  \6 U. s, i- Y  ?
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
! X9 N) j9 _: `9 L" Y" u    *(esp-&gt;4+4)=='NTIC'1 n/ q" u9 m3 ^1 t& S- g; ~& Y0 |
' t# [- |- {8 F/ [) ?
-The most exotic ones (could be very slooooow :-(7 L5 a/ C- z5 P7 X- [" i
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  
1 G$ o- {& S! T) @# W0 K     ;will break 3 times :-(
5 p% a- d* r3 v- A( e' k% |( k. W; j# i
-or (a bit) faster: ! E7 T* r) f2 z$ Z' i+ T
   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
3 Z0 l8 ^6 v2 u7 }2 S+ H
6 k; F: _  D! h& F8 B  w   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  ' |: J) ?% ~- B  t2 Q( @. O: b
     ;will break 3 times :-(
& o4 o* Q9 v9 \6 d% j5 V! m  {5 m0 Y4 `/ ]
-Much faster:
& `. O3 @2 D$ D' B   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'! ~  p" a3 X4 M+ W8 c3 r+ G: S9 I8 [

$ K6 y: `2 o' {0 Q6 U3 j- ]Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
  ]0 }4 g/ J$ I3 d# H) Dfunction to do the same job:& `6 g/ N8 T( Y

) Y9 L- |* Y% D6 l   push    00                        ; OF_READ0 u3 x* A( a. t0 @
   mov     eax,[00656634]            ; '\\.\SICE',09 Y2 s4 U, i8 G
   push    eax3 ^; ?% I5 h! t
   call    KERNEL32!_lopen5 t0 b$ Y* D- Q
   inc     eax. N! R5 t* s' \/ H! A
   jnz     00650589                  ; detected& j- G" \& m' B) C* }8 J6 _
   push    00                        ; OF_READ
, q. w! d" r( D" X3 r1 u   mov     eax,[00656638]            ; '\\.\SICE'
) [- V4 x2 i" @+ U0 t   push    eax
+ w# N' `& F' k' h# i   call    KERNEL32!_lopen7 w- p  e8 B0 r- h
   inc     eax
5 E, g/ h! G3 f& z   jz      006505ae                  ; not detected
% z% F3 p, I6 G3 E! F/ Q1 x( l; }
! _. I& h: g& N; W
__________________________________________________________________________% M  l5 [* d3 N; a, z4 Z7 ?
+ O* i4 J9 Q+ e* t, v2 T/ O
Method 12
; [' }: J! V/ u) f/ ^=========
+ I+ }3 X/ w* M$ X1 q
) E- W9 l+ d* f. GThis trick is similar to int41h/4fh Debugger installation check (code 05
& U, J  Y2 Q! N) o4 t8 P2 ^&amp; 06) but very limited because it's only available for Win95/98 (not NT)6 ^  W% s& g( i; Y4 a9 r, ^
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
/ ~# H9 Z+ _8 z% o' L, Z- f# L) T' [
   push  0000004fh         ; function 4fh
8 B% a% `. |  f! ^   push  002a002ah         ; high word specifies which VxD (VWIN32)
! `2 A; Y& A8 V# p, \                           ; low word specifies which service
" m3 h6 |! `) g" M                             (VWIN32_Int41Dispatch)
% C! G7 _: O" ?& @( I   call  Kernel32!ORD_001  ; VxdCall
& M( V! @5 {2 B, ?$ A3 D   cmp   ax, 0f386h        ; magic number returned by system debuggers9 e. A0 k" m6 g5 Q2 S" v" ~
   jz    SoftICE_detected
) ^( p; [2 p( U7 M
+ A& v0 n  r* H) H8 u8 ^Here again, several ways to detect it:7 x7 M2 p# j! A# |, y  H0 b% y3 p

* Q% a- M7 i% @/ ^0 p+ x4 {* `    BPINT 41 if ax==4f# z$ h' m2 x# Z& b8 W0 @* a
- I& Q/ t9 N7 L; V# @9 ]
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one
6 a, y7 }# L! Y* t: F0 M5 {' }- k+ g0 @" P" }% {' [
    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A9 @' n' [2 {: o# `0 M, K, o
6 n4 }6 ~: a; x8 {
    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!& ]3 k/ J, F& Z. O, N# H0 x9 [) M
! H* S% U# x' a2 g3 u- u' E
__________________________________________________________________________
5 f' O1 b) Y$ C1 _+ V" I1 O6 C' O0 ~. P5 X) ^) r. J( K
Method 13
; v& `% ^$ f* G% R, E- c+ J=========; L- e. M- V- p  `
- y, ]# l- Y! m; c# x8 u" N
Not a real method of detection, but a good way to know if SoftICE is
# ^3 A, v* }: B& zinstalled on a computer and to locate its installation directory.
# p% _6 a* p# z6 }# TIt is used by few softs which access the following registry keys (usually #2) :* h9 o& R7 P4 N' u# ^

8 E+ I) h& p9 U-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion! M' u& H& ?( x1 s& _0 o! z1 s
\Uninstall\SoftICE$ s; Q5 k! I* s( G" R2 p( o
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE0 {& Y7 e9 m0 P) i* w7 s
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion: S1 f& p5 a' w* s6 g( g
\App Paths\Loader32.Exe
  R* t9 x2 z/ B" p0 P1 Z( r9 f+ J* U) z' w3 i
' k5 c% T0 ]& O6 B- u+ d# X
Note that some nasty apps could then erase all files from SoftICE directory
0 C; j" X( h! A(I faced that once :-(" v/ A2 S6 g# H/ W- i8 ~$ ?5 {$ g( i

" J1 v/ M, {0 ]! t& Y* k. D9 QUseful breakpoint to detect it:
: f+ e9 m, l% J  t. _7 k3 i1 o
% b4 E0 q: a' K3 X     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
" C, ?& s; }; j" o5 g1 n! I6 r( {+ I1 U1 T9 i4 I8 E
__________________________________________________________________________: q) i2 p) O0 F4 Z! ^) d0 Q3 x

, T0 p; Z; c( @0 u4 Q1 C$ {5 u  |* m9 S" F9 U9 q: |" n- ?  a  w3 w
Method 14
* @3 M% Y) o+ F0 \$ M1 c=========
1 }; O. h+ ^0 Y' Z( S  D: R9 i' s2 @; h% a: o
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose! R# u, k6 L1 B( F$ i+ J5 d7 f7 B
is to determines whether a debugger is running on your system (ring0 only).
! I* b* i  A& O/ S' {  s0 h) X( R; v- \
   VMMCall Test_Debug_Installed' f7 \4 w: N1 L$ x' \( w. b  _
   je      not_installed
& g  ?2 d9 P" V( x
1 ^$ B. w7 I- Y5 O9 I1 f" j" VThis service just checks a flag.$ a3 B' M. c, f. ?1 ]" p0 }
</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关注公众号

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

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

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