About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
$ Z$ N% U( z/ f: T( \4 x7 ]<TBODY>
- Z" q, X8 K- s$ m+ Q<TR>3 T# ^/ Z% M: _! D# i6 t
<TD><PRE>Method 01 ( J; O% V# c6 m3 C1 u7 O
=========, K4 n1 p9 |  U% z3 H: ]

: I" F9 n" _* ]. u) ^! WThis method of detection of SoftICE (as well as the following one) is
+ Y7 C; Y. j3 v( Jused by the majority of packers/encryptors found on Internet.
) S  G% }8 b* s+ e9 {4 dIt seeks the signature of BoundsChecker in SoftICE
, G: x, e3 Q& Z/ I9 u- |9 K: Z8 n8 `6 M! L+ @
    mov     ebp, 04243484Bh        ; 'BCHK'
; Z, ?0 [1 J5 P0 M8 T( D2 M7 L6 T    mov     ax, 04h$ N/ {2 g: S  k3 g4 ~" e
    int     3      
9 t0 c& }9 D  m    cmp     al,4
0 D% _! q$ l; }  D) u    jnz     SoftICE_Detected6 v( |0 t3 R& |% `; t

& A9 f, r; k1 Y4 e6 t___________________________________________________________________________
# H- r8 ~, Y. M3 v" d
2 ]8 ~4 ]! D: FMethod 02
, a! Z7 {1 o2 z7 V% k1 _8 ^=========
/ I7 z3 Z' d: ?8 d# _, l: D$ s- N) v  j. C+ d" t$ I
Still a method very much used (perhaps the most frequent one).  It is used# f  N# J/ Q+ |2 X( T( R; x5 U5 c0 c
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
2 {* D/ O# ~. L) ]: f# |$ ior execute SoftICE commands...* |' }5 R0 k6 n1 e
It is also used to crash SoftICE and to force it to execute any commands
! X$ ^/ m0 Q/ Q2 F(HBOOT...) :-((  : i4 K, n" K* N+ v

* d! U' c) n# d: dHere is a quick description:
6 Q0 E1 {0 H0 a; c-AX = 0910h   (Display string in SIce windows)
7 t: c9 K+ B! u-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)% O5 Z( ]% p, g6 l9 [
-AX = 0912h   (Get breakpoint infos)5 U1 ^" n9 n0 k$ V  _) _
-AX = 0913h   (Set Sice breakpoints); g2 _) b/ U- O6 Q: F* T; |
-AX = 0914h   (Remove SIce breakoints)
+ G. O; L  ^2 Q. J. P2 k6 z" E: j- ?4 J! A1 u3 l: t
Each time you'll meet this trick, you'll see:
; U) @6 w2 i) k/ X  T8 \-SI = 4647h
1 I* d$ t# E  g-DI = 4A4Dh
: O: z& s% v- o9 X/ VWhich are the 'magic values' used by SoftIce.- s& t7 c: e/ y( s8 h* w
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.+ ~, E+ D  M0 A1 i* d0 `
+ q0 T5 j- N3 q% W6 }
Here is one example from the file "Haspinst.exe" which is the dongle HASP6 N( c6 l! B9 p9 U: |
Envelope utility use to protect DOS applications:4 B' n8 e6 [6 C: G' _& w
6 g/ d, p0 {/ x5 P' d3 f7 U" W

8 g) c9 r* E" w4C19:0095   MOV    AX,0911  ; execute command.
( e( ~+ ?2 V4 X$ k; A+ Z4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
. n( t  g" t- ^! X( E3 R4C19:009A   MOV    SI,4647  ; 1st magic value.
; ~8 S, y8 h3 j0 ^# y4C19:009D   MOV    DI,4A4D  ; 2nd magic value.
# y+ w3 b9 K7 d1 ?! ]5 {2 H7 c4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)4 ^3 x& s2 g# d- _1 [& m" J) O" f
4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute' V) k* u, ~' A3 ^
4C19:00A4   INC    CX
( E3 c. U% k: L! H6 {; V1 M4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute
8 c' z: R* z. I  @( s' V4C19:00A8   JB     0095     ; 6 different commands.7 U% J0 s1 s7 T0 Z8 x
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
  k  V; b& C/ ?- x% g4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)
8 y5 e/ C$ r8 l: U
- t# Y6 z5 _9 U- }The program will execute 6 different SIce commands located at ds:dx, which2 L# N, V, J9 v6 M/ e
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
4 w1 g/ ~: z6 ^( ]: ]0 T) M/ v; t3 ~
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
7 e1 p1 [7 V! I/ h- [* f; r___________________________________________________________________________
. p* z/ o  I) u& x0 H' j9 C$ W8 d3 g# f$ R1 y/ Z
$ D& i1 n: y/ C
Method 03
$ L7 x4 X( K0 R8 \. I) S=========( H# ^- z$ t( s. e$ C8 ?: X* {
" y1 R" U$ J: L6 D) z
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
% r4 m/ B+ G& c4 ~5 K(API Get entry point)
4 T: d8 r- A% @/ m: }        
0 L- l; h: G$ U* @) ]3 ^
2 ~. x4 Z% F9 U2 n$ Q) }! x  @' u/ R    xor     di,di
% ~4 u$ K% @) w3 C7 K) w- v    mov     es,di5 @+ s' p9 G) O
    mov     ax, 1684h       / k2 e0 `9 A3 }: I
    mov     bx, 0202h       ; VxD ID of winice/ }/ ~+ x* Q% F8 ^* ~4 A  H
    int     2Fh) X0 t1 z! @6 j: g% R& y
    mov     ax, es          ; ES:DI -&gt; VxD API entry point2 r* q1 E7 v1 Z, C
    add     ax, di
3 ]! M1 [+ V' V% w    test    ax,ax
% X: G& u, P. _. }    jnz     SoftICE_Detected! ?( `  |( k. K; I" _9 A% W

7 K8 E3 i  p' [6 }, i  J___________________________________________________________________________1 I) q* ^: b1 A, ]' N; k4 ]* i

, [6 z4 s. Z- J7 A; bMethod 04
/ B4 T. z: a5 j( |=========/ @  t) B) _& M! C( {
0 f. p" X# h- y% u" p& A8 D
Method identical to the preceding one except that it seeks the ID of SoftICE
' W/ `  G: [1 R: A( `GFX VxD.
+ [" Y0 [' ~+ }& j, _4 h% U3 J7 r7 V% ^! K, {! n
    xor     di,di9 o  {/ L( f4 x  I8 C# \% d
    mov     es,di, [8 ?$ c8 f1 [$ z' H3 G
    mov     ax, 1684h       5 J% d& O! E/ {2 v5 z& y& k
    mov     bx, 7a5Fh       ; VxD ID of SIWVID
. A/ Y: @9 t6 q( D$ L    int     2fh7 b1 u. k4 s2 O5 D* [
    mov     ax, es          ; ES:DI -&gt; VxD API entry point
; C' Z9 W1 F& q/ I  J    add     ax, di" D+ K: a; A2 Q* S
    test    ax,ax" H. I( o; a- ]% ?/ h
    jnz     SoftICE_Detected: W  ^9 B+ g+ K7 Q- ?; Q
( ~2 K4 L: A# f$ C" i- y( T
__________________________________________________________________________& o; s7 K& m6 r
% L, o& @1 z* z3 B! U! @9 s2 S
. U# a1 r, h# O: ^2 i2 _
Method 05" p& ~) ^+ L( H# P! x7 z
=========" f4 n7 R) \( w6 [: [1 E( i; I2 d
* U# U4 n/ H( v. M! p5 a/ |2 {
Method seeking the 'magic number' 0F386h returned (in ax) by all system2 `9 p/ ]4 h$ j! S% l( |
debugger. It calls the int 41h, function 4Fh.% E) H, l& U: j- W! ~" d3 m
There are several alternatives.  
7 g% W0 {% p2 ^# o" i5 ?& L) ^7 L4 \3 M
The following one is the simplest:
9 a2 K* a$ u- W$ p! Y. o+ C- T# L4 C# ^. l' J
    mov     ax,4fh
' W6 C6 M, v( m' U9 e. B2 `    int     41h1 }' b' ?6 z9 L7 w/ v
    cmp     ax, 0F386
4 [$ e! o* \2 P$ O. A' \    jz      SoftICE_detected
8 [% L1 t5 W1 d- e6 P; T; x# ?7 [: x" Y
6 z3 V/ h1 t4 v; V$ {
Next method as well as the following one are 2 examples from Stone's
' d1 V2 ^% T  W6 @  f3 q"stn-wid.zip" (www.cracking.net):
, V% T1 P( P1 S: h% B1 Y2 h; R3 @
  d# L3 o2 |) o5 S    mov     bx, cs& F/ Z" m# [% g0 w8 Z
    lea     dx, int41handler2
( x8 w0 M& p- K7 o- S) L( F  Y    xchg    dx, es:[41h*4]1 r( }6 D/ ~) V8 [+ d
    xchg    bx, es:[41h*4+2]
1 ?$ v6 |% m. n: O/ {    mov     ax,4fh& |# _' X6 I$ H. D+ ]( u" ]8 V9 t
    int     41h$ V* ^5 C  C) R9 ~  @% v- f' r$ Z
    xchg    dx, es:[41h*4]3 Z) p/ V' y0 s
    xchg    bx, es:[41h*4+2]
6 w7 L9 J( I4 b) P3 C  J' d    cmp     ax, 0f386h
; V- G, x$ T5 S# ?: ~    jz      SoftICE_detected
3 U, B5 L2 p7 R9 s# }
6 X: d; I& b/ D( V9 w% s+ _; J; k' Gint41handler2 PROC
8 p' P4 ]8 U7 E6 ]    iret" O2 Y) s" K3 A3 Y2 R7 ]" w' a
int41handler2 ENDP) O/ {9 O# N# R2 h
5 g! `) u3 U/ P2 B( X

  I$ [% V. ~8 N6 g/ e" d- @_________________________________________________________________________: X9 f( K# u5 b; u

* x# `6 b5 f4 o4 [
/ r+ V5 a* j5 `9 E/ s/ [Method 06' c$ A& s- R& ]" P) [% T6 f
=========2 m6 _# ]# S6 h; A" ]- e

8 e8 z  h) y7 G6 ^% ?/ `6 s; Q6 C- ?$ f. Q$ q3 A
2nd method similar to the preceding one but more difficult to detect:9 h: E/ @! H8 T0 N

0 N( P) W6 y& y" W: Z6 q3 J% t1 p) g, E+ r
int41handler PROC
" m- y5 F- H+ I; u1 l3 k- B1 S6 b    mov     cl,al: X$ Y3 j" l2 [" A( N
    iret' d' P0 H, y5 Y# L2 V* j  a
int41handler ENDP
5 F1 y2 v" R0 z7 n* K1 P' c* {; J* V8 h

/ a3 s' O0 c( h4 N, ^/ t9 u    xor     ax,ax1 q6 E/ L8 h  W+ g5 Q$ M) t
    mov     es,ax
( [5 E* ~7 j7 B7 q# V) k    mov     bx, cs: `' m+ Y/ c; D- d
    lea     dx, int41handler: G: a( _8 c4 G( U" Y
    xchg    dx, es:[41h*4]  m1 \! O% L# f# N* e) C
    xchg    bx, es:[41h*4+2]/ i1 W9 q- ^. m  e
    in      al, 40h0 M( g: c# M% Q
    xor     cx,cx' \1 x4 M+ C' ]5 F  S+ Y1 |( K3 r
    int     41h  c2 f) u4 f5 \* I. X
    xchg    dx, es:[41h*4]
; {( c' R# @* G( E. Q. Z" k    xchg    bx, es:[41h*4+2]
, W0 i- W, i; Z8 }: w4 d- F    cmp     cl,al2 W  L. k1 t- K
    jnz     SoftICE_detected
+ q# B2 W2 Z* h; i& @$ U, E  ~4 b
_________________________________________________________________________
& s4 Z9 P, z9 a+ {, A" x9 q% `0 f# ?/ Q+ U8 M" E/ E0 C
Method 07( g/ u; f% Z& p! c$ E- n0 A
=========8 j$ ~4 K( M/ u2 P' A9 O% J
' c0 H) w1 h3 n; Y2 ~) Z
Method of detection of the WinICE handler in the int68h (V86)* v9 E8 q/ V0 j6 L' {
/ a4 s- R4 j- _! A5 h! b( o
    mov     ah,43h( `2 i9 B. e- A/ G
    int     68h
) i' ]) {2 N7 Y9 \    cmp     ax,0F386h+ z! I0 @6 W4 X, x0 L# }
    jz      SoftICE_Detected, t/ L& c- e2 T6 x% p" X' o
) r7 B! g$ S: t# n- i5 o7 l
. t  {7 V7 w9 Y+ d$ r" \% i, C4 t5 I/ y
=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
8 Q5 i3 s! `7 z! p" w   app like this:
' l2 `0 ]: z! u+ o
. \8 y. Z9 H7 {, a( X   BPX exec_int if ax==68
7 W3 N6 b, U2 S   (function called is located at byte ptr [ebp+1Dh] and client eip is" s( z5 _( d7 C# y+ ^
   located at [ebp+48h] for 32Bit apps)6 Z% P7 l- Z: ^. [- s3 f
__________________________________________________________________________
2 b4 q1 d. p+ Y- s) b0 |- |4 Z& \- u; r' P* i. z. }

4 T& W9 [# P" J& P0 CMethod 08$ {; L' G# ?: Q' Y; _
=========( r9 c6 w- S/ v, W' \

6 m/ q# E5 E' A3 CIt is not a method of detection of SoftICE but a possibility to crash the3 X& o8 k5 C7 t( j6 Q$ ^
system by intercepting int 01h and int 03h and redirecting them to another
- w7 {) C1 ^! R; o! droutine.
. {: z: d# Q/ [+ V2 c: C1 _8 f+ ~, PIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
  R( @8 I( Z: r" \( Fto the new routine to execute (hangs computer...)
, J0 F: b. P; s( Q- l
( D4 `/ M5 |9 d7 R    mov     ah, 25h8 m* l* q4 P% I/ u
    mov     al, Int_Number (01h or 03h)7 ]3 O/ A$ |5 P& d+ \" m1 `
    mov     dx, offset New_Int_Routine
, P; t0 ]# W+ w* H3 p- t& b; F    int     21h% _& s. m: V0 f) F) T5 P

, [1 m3 t0 {; P: v__________________________________________________________________________
" S# O/ {/ ?( G% p# L9 G# F9 \+ f+ P: o8 {9 c+ A/ G9 H, E
Method 09, Y, Y/ L7 a6 Y1 B
=========$ i- C4 r2 `# N9 A$ ]$ s, N
( S- J# d- P# ?, {2 l
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
, r7 q: F/ i/ b! \performed in ring0 (VxD or a ring3 app using the VxdCall).
* z" [: Z! X: M+ K' f! z' YThe Get_DDB service is used to determine whether or not a VxD is installed, ~0 a9 B! {6 l' S
for the specified device and returns a Device Description Block (in ecx) for
" M# o- f. X. L0 ^; Q/ kthat device if it is installed.
2 g6 d& ?1 x/ C2 j* M- b
- f  @5 K/ x1 R0 q- G) _1 Y   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID( k7 {# M; `  A& V0 D: N
   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)$ f7 g/ P( {: [; X+ p: b* {4 n
   VMMCall Get_DDB: A5 t' N3 F& C2 P& }* A* o
   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed' G( \7 |" G. O/ R: Q. q
* |/ t0 Z7 j7 k  F- }$ D/ x' q
Note as well that you can easily detect this method with SoftICE:
; y5 ~3 @2 @! g2 u# k1 A+ g   bpx Get_DDB if ax==0202 || ax==7a5fh" O" q) G: x! z+ M1 C; d& R8 R
3 D6 j# j. V* L$ H& w; d2 T
__________________________________________________________________________
$ n9 G7 s: @4 Y# t5 _- e2 u
" Y: r3 ]1 x  Y8 KMethod 10  a9 Q# b# }5 C# A
=========
6 P6 D/ s. g& A+ W; Y/ [0 m
$ |( p! O( T/ j# e=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with, z9 N4 X4 [  P' s. H0 w
  SoftICE while the option is enable!!
2 w, ]9 m  F3 L; |8 x/ i; V. w0 |/ q: z7 h+ B. p4 F9 E% g
This trick is very efficient:
, I- n8 X' Y5 t/ `' y* r; Qby checking the Debug Registers, you can detect if SoftICE is loaded
9 t  F  ^0 A3 n/ _3 N) e' J(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
* B9 m' N8 \5 l6 c$ A# G( Qthere are some memory breakpoints set (dr0 to dr3) simply by reading their* |8 p; h4 S' z; `
value (in ring0 only). Values can be manipulated and or changed as well
7 M  ^! e+ {, E5 n2 N(clearing BPMs for instance)
; h4 o4 D2 \" w2 r6 W. E, X8 f! M2 n/ W0 O7 N
__________________________________________________________________________
$ W( v! o4 J& E$ y; P
- X7 E8 q- Q& e" y* x8 lMethod 11! {4 `& Q2 W) U0 ^+ L
=========* q7 @0 f4 F: r
% ^- p- G' u2 h& o: J3 ?6 Q) s
This method is most known as 'MeltICE' because it has been freely distributed5 t* p" ~& H( W" }, ?
via www.winfiles.com. However it was first used by NuMega people to allow+ P+ [) A: v/ L( @! R6 P
Symbol Loader to check if SoftICE was active or not (the code is located6 x0 }7 ]' O& N/ Y* U& L
inside nmtrans.dll).
! o, V) P9 R, n2 F5 x/ ?# @, z) @- }5 Q5 d7 d* S
The way it works is very simple:& u3 Z9 E' t% }! {- n. g
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for) C8 ]7 ^9 F8 G/ A
WinNT) with the CreateFileA API.
; Y3 D1 h0 a& n+ s: V! e8 \
. Y3 |) y2 J' ^" ?Here is a sample (checking for 'SICE'):
0 G( b: m! r+ K) a( W* D. \9 V6 [1 I, X/ Z
BOOL IsSoftIce95Loaded()
1 @: s' H/ I+ h4 c7 H1 Q{
( j& ~% j& E' @, j   HANDLE hFile;  & w; o  ]" v7 V
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,: V- s  d& K2 y0 O! [7 R
                      FILE_SHARE_READ | FILE_SHARE_WRITE,
* L( q: r4 q% b# O5 w2 r                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
4 h2 Z- S! D" w  B& S' U   if( hFile != INVALID_HANDLE_VALUE )' P+ L$ A/ G+ {9 m  N) @; J8 Q
   {
6 `9 V6 Y! @3 _4 t6 n# A" _. f      CloseHandle(hFile);
0 U0 L/ N3 R( A6 \1 o      return TRUE;
6 ~. ?2 n5 L: g! M# n: v   }
& s- J6 w: T0 _- e   return FALSE;
  y& Q# P- l; b' G5 J1 u}2 `+ w8 ^0 n3 }) b1 c8 }$ ~

: c" Y: n) V& r* ]: A8 ^Although this trick calls the CreateFileA function, don't even expect to be
3 P3 ]8 e' G3 ]3 [able to intercept it by installing a IFS hook: it will not work, no way!* v  d: r! a$ X: X, [
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
0 Z' y0 s- [! Iservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
1 v9 r. `) Q# Z! qand then browse the DDB list until it find the VxD and its DDB_Control_Proc' \0 d5 p8 q6 N
field.8 D9 z3 T$ I" \& G. o7 r3 x
In fact, its purpose is not to load/unload VxDs but only to send a
( Z: z8 L' w  mW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
3 z3 D; d; s5 l: zto the VxD Control_Dispatch proc (how the hell a shareware soft could try
1 ^7 f9 Z% N- k4 j+ U$ ]5 l# Mto load/unload a non-dynamically loadable driver such as SoftICE ;-).% Y8 f; F! k' n8 o3 m
If the VxD is loaded, it will always clear eax and the Carry flag to allow- H4 G8 j6 l/ c" {: m$ I( A$ Y
its handle to be opened and then, will be detected.' N8 y0 p9 W" |, ]
You can check that simply by hooking Winice.exe control proc entry point
, g. P6 r& R. `4 Rwhile running MeltICE.8 C9 ?4 A9 V, k

5 z0 H! Q* W" D) A6 ^
- A( I5 n. w% E  00401067:  push      00402025    ; \\.\SICE: L& c8 _/ z& S: C7 Z
  0040106C:  call      CreateFileA' L: G  V' t  L1 Y+ S4 W) n5 r) S
  00401071:  cmp       eax,-001
. L* O0 v% K% E  00401074:  je        00401091! l; i/ o3 A+ ~9 l: Z
" L  v! x4 {* p- B

* G: N3 v* H3 NThere could be hundreds of BPX you could use to detect this trick.% n5 L1 a& s9 r8 q& S- l6 C" S
-The most classical one is:  }$ F1 N" ^' @* D5 \5 t/ o
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
' ~  E8 g  E- P+ O% D$ a. d& B' X5 a    *(esp-&gt;4+4)=='NTIC'
5 ^0 y4 h( V" e/ X* S* n1 F7 u  O3 t" w) o3 ]# N/ h7 W& f! p
-The most exotic ones (could be very slooooow :-(& ~  i9 a. R- L+ v# l
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  2 m2 w3 V$ N3 e9 ~3 J
     ;will break 3 times :-(3 l& ~1 v( E9 t* W
* n7 i4 _5 x6 F$ z8 b& ~  N4 U# c
-or (a bit) faster: + Y1 f' W$ S! K$ t6 [1 ~: N) n" C
   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
" P- x5 [; G% \3 v9 a+ q& t: ]
# j, n! Y+ R+ C/ ?6 S: S9 B" F   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  
: f# ~! @7 r% g) S. f9 L  m     ;will break 3 times :-(( j" {" R: a: u; m

* V/ t$ x. {# f-Much faster:
8 H/ e; c9 h& T4 a2 l4 n   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'  ^" \8 W" U, B
1 \- n6 p( R7 d# Z$ M0 {
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
, A1 }+ \5 [$ N1 ]7 wfunction to do the same job:& z: q: @) @/ k$ G! o! |% H
4 y) T/ w0 _# _; z; h
   push    00                        ; OF_READ
- d3 o$ G. g( r  B! G4 y2 Q   mov     eax,[00656634]            ; '\\.\SICE',0
/ y" ^. L* l! q" m$ K6 Y% |   push    eax  g7 W* u3 Q& b2 C  j: s
   call    KERNEL32!_lopen& R" s' x  T! B" w3 p/ R2 T
   inc     eax
6 W. Y$ V/ ?& t( @4 Y8 M4 p   jnz     00650589                  ; detected3 C+ _5 O' n" y9 K6 x% a( Q
   push    00                        ; OF_READ
3 c% s: z! E( E% [   mov     eax,[00656638]            ; '\\.\SICE'9 y1 V6 w: f4 Q2 ~  _8 }
   push    eax7 M9 i  \5 W% S$ y+ I1 s  s4 k+ T
   call    KERNEL32!_lopen9 m; Z- ]4 M2 p4 ~
   inc     eax
6 h: i6 U( j! Z1 z   jz      006505ae                  ; not detected5 r! f( ]+ v! h
, u. r* ?/ w3 M4 s. F2 ^" [9 r

: s/ G/ O$ G* D4 I__________________________________________________________________________6 V3 l$ h% M, |' u" Q, A" z3 F

) z3 K5 H6 O* ]7 U) h$ l( g$ mMethod 12. ~! u- V7 M, _0 Q2 j
=========
( ~% v8 v7 i, [4 v7 d3 x; C6 a; n# T7 h" k
This trick is similar to int41h/4fh Debugger installation check (code 054 W( U; u' m3 B2 t) F: \
&amp; 06) but very limited because it's only available for Win95/98 (not NT)
& @$ I. J9 {7 s' R! D8 was it uses the VxDCall backdoor. This detection was found in Bleem Demo.$ e' Z7 y' ]9 Z) x1 I
- j0 d7 y' A. L% i4 E3 l$ t
   push  0000004fh         ; function 4fh
) |7 e4 M. G+ C3 Q% K& m  N0 J( U   push  002a002ah         ; high word specifies which VxD (VWIN32)4 Y( }! I2 G9 ^1 D. T2 e
                           ; low word specifies which service
- V0 j1 v  a# [, p" h                             (VWIN32_Int41Dispatch)' Z% `& M, T( i" D. ~- a
   call  Kernel32!ORD_001  ; VxdCall
( g- G3 B! n. I: \- O# K   cmp   ax, 0f386h        ; magic number returned by system debuggers7 a* g4 F; Z: \8 u4 S# d3 E
   jz    SoftICE_detected
" {: m! O* q& A* E, \% x+ `' B
Here again, several ways to detect it:/ h* G( E6 Y1 u+ s4 f% M% Z
! n: u8 i6 @' C% H! k
    BPINT 41 if ax==4f
# T$ v5 y5 X  U# F/ i* F7 N: _; y# O# S0 T. ?/ |
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one1 Z$ J3 S  G; c: o* j' ]  j

6 m) k) z5 G4 O* ]: [" ?0 j: T' S# |    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
1 T+ B# i, j( D4 q) e6 S/ Q4 {; c; K
    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!- ^; X9 b+ f; {" ?8 E8 @( ^8 N0 V
$ G2 p* V1 f' [
__________________________________________________________________________5 M6 G2 Y% F0 ]% J# h

" D4 N; ~% K8 @/ g" L1 G* V" J5 Q, YMethod 13' W1 g7 a7 G( w! \, ^
=========
! ?$ j# Z; F; w/ e1 }6 r" l! O' L. b- ~$ {: p7 f
Not a real method of detection, but a good way to know if SoftICE is5 b1 {  l& a0 F! B1 X# ], H
installed on a computer and to locate its installation directory.
! m) Q" ]% R; L0 i7 qIt is used by few softs which access the following registry keys (usually #2) :
5 B0 I, A) K( c7 M: f
, l1 d' w/ ^1 G' H-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
6 c8 A% g0 w9 \- V/ X1 `  x# B( `& D3 d\Uninstall\SoftICE5 z3 R8 `' c6 Y5 _1 e, z
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
$ e& K5 e. a0 n- o9 S-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
8 c! k# Y, l" d- b7 ~\App Paths\Loader32.Exe
$ o# F+ h- |9 m* k$ V; L
& c3 c$ y6 t, V( C! X5 M0 Q* ]- n8 ^* K0 ^
Note that some nasty apps could then erase all files from SoftICE directory
; ~6 k5 f! T# r8 j5 z(I faced that once :-(# T, p0 d7 b0 O- u8 [# B3 g' y

6 b! u  S1 ]. J' Y2 sUseful breakpoint to detect it:2 v4 a( L# P, g. x

' ]) C# W5 y8 y2 ]! Y     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'& I, n0 C" O3 q8 n7 C3 f
+ ~  d& i% \+ }
__________________________________________________________________________
# u6 `$ B# p! K/ y5 P6 C7 j* _
' D3 O# A% D# p# s4 ~4 z6 \
+ ]" y# J* F6 z! D/ vMethod 14
* g( k8 h' C7 V- D! B" e=========
  S3 C0 X' {0 `$ \7 J9 g
1 L8 Y+ A3 `% f. c% A2 cA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose3 e7 r2 A; p4 K' t! S
is to determines whether a debugger is running on your system (ring0 only)./ v% q; k. b8 x* J- H
7 O7 m- ~5 R5 i  t- i, r
   VMMCall Test_Debug_Installed
& m5 \: E, s( v. J# ?   je      not_installed3 Y7 q" H3 f: h) e: `% \

1 f! g0 w4 X& i0 O& B1 h' n% g! BThis service just checks a flag.3 P( a; }# L. l. P" g  a
</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关注公众号

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

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

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