About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>% M% P2 c( T" t1 k$ j
<TBODY>
* J+ r9 k7 Q/ w) W+ s<TR>6 A! ?" H) d; Y* ]6 k, }
<TD><PRE>Method 01 2 n! ?+ I) I/ N6 |2 i. m
=========% W# s) o* y4 \/ ]8 s8 \/ c* R

2 g( n4 v5 h3 B+ kThis method of detection of SoftICE (as well as the following one) is
- k/ ?3 x% ^% T8 H% \- r" _used by the majority of packers/encryptors found on Internet.
+ N6 Y+ H) [2 u8 V0 R9 r. g4 a3 R# FIt seeks the signature of BoundsChecker in SoftICE, B, e- o, o6 f# ^# L5 R
$ O. M, e; V( Q5 S
    mov     ebp, 04243484Bh        ; 'BCHK'
/ j! S9 J* z" V3 M    mov     ax, 04h" w5 I. B, p* f3 k: S. }/ x) J6 D
    int     3       & s; j) }- o& F
    cmp     al,4
8 A/ x) E0 a) L* }5 |' J8 y) d    jnz     SoftICE_Detected
8 G. Y, s% X" i7 G' u
2 G6 @: N# R, O/ J3 S/ N___________________________________________________________________________- Z! ]! r5 u5 \% |  K6 y, t
* x* R5 z9 d" ?& o5 T  U
Method 02
9 ^- A3 i$ C% u) R=========
9 M# r5 N. M7 _3 t7 i# L6 P: i. |: m$ a; n2 j/ }6 e
Still a method very much used (perhaps the most frequent one).  It is used9 k% Z4 Q) H% w8 e
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
& L7 @* Y0 N+ [( @or execute SoftICE commands...
3 ^; t4 r" d* }: [8 AIt is also used to crash SoftICE and to force it to execute any commands$ Z+ x/ x3 Q( n
(HBOOT...) :-((  
1 K+ e0 C0 k6 F$ I" r1 |" F- r) D1 c& z# ?/ g3 c: {
Here is a quick description:
+ ~5 S4 l( A- ~* b2 S-AX = 0910h   (Display string in SIce windows)
! ^% L% Z. B; B6 o/ w+ J( m-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx): W3 @7 D6 ?" U, K
-AX = 0912h   (Get breakpoint infos)
/ j! N, C9 v  j( V-AX = 0913h   (Set Sice breakpoints)
" }+ D$ ^: ]) D7 T. c% U-AX = 0914h   (Remove SIce breakoints)
, d8 w* ^; ?2 m# ?8 A/ E/ D) _* ?) C$ p: N7 H" }0 n, z9 [7 v
Each time you'll meet this trick, you'll see:# l3 P1 h1 h+ K
-SI = 4647h* X) K+ U6 `2 Q' ]0 x8 i
-DI = 4A4Dh- N3 Z0 h3 |, }" w6 H
Which are the 'magic values' used by SoftIce.
; {5 ?% |1 b% Q) J) fFor more informations, see "Ralf Brown Interrupt list" chapter int 03h., ^( E3 R, \' e% n, C

9 f3 \& w/ n% U, s1 o: rHere is one example from the file "Haspinst.exe" which is the dongle HASP
1 V' |2 y4 ^$ Z. j% U4 j: _6 Y$ \Envelope utility use to protect DOS applications:
+ s( [; r" g' b+ F8 q, ~; ]' u( {/ d) j! `  b8 j

8 k, c$ R7 ~. S/ r. e& U4C19:0095   MOV    AX,0911  ; execute command.$ n9 f* F0 a' \1 w' h
4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below)." s* \; i3 k  Y7 x" Y( V( m* @
4C19:009A   MOV    SI,4647  ; 1st magic value.
; l! n6 R& p% S4 z2 h4C19:009D   MOV    DI,4A4D  ; 2nd magic value.
8 Z, a' h2 V3 z4 A& f0 y) M4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)  w2 \9 \4 v* x% \
4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute- _; z- r' |6 t- n
4C19:00A4   INC    CX5 s3 T# Y3 _5 E
4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute2 ^5 o# d- ^$ w- }4 U, k
4C19:00A8   JB     0095     ; 6 different commands.( L# [! P3 o* w6 q7 p+ V) a
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
) c( o5 J2 L4 P$ {# p4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)
. @6 {/ {2 h9 w( X4 s
0 x: J, g, q! S6 QThe program will execute 6 different SIce commands located at ds:dx, which
' s& D; g' M, b1 Y) Oare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
$ o& h3 s/ G2 @( `, e& P
% X. S: R1 Q# }9 F  c, F* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
) T1 s! w% d$ H. y___________________________________________________________________________/ j( C2 K: o+ ~
; a/ e" p/ ~  X8 D$ V  O
) V+ h% [& v- c5 i# ]0 ~
Method 03* b  b' d' a, b4 K
=========
; J/ h8 o1 u$ l$ K; j1 g! ]/ h) h3 w- N9 K  Z
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h7 G7 A& I0 p/ X6 o
(API Get entry point)0 P  i& |1 E0 L2 y7 S
        
! f! q! `* u5 D! T, `- h3 Q  c9 l5 J: W9 N3 G/ D1 h) D+ T! E. h
    xor     di,di
* N# e: Y* y6 q# d    mov     es,di5 z* D; Z  M, `. p, {* s
    mov     ax, 1684h       : k- b; v, m- {% Q& W
    mov     bx, 0202h       ; VxD ID of winice
+ W+ K8 [% H9 M8 w2 d. b9 Z    int     2Fh" Y& H2 v" v# \( _" H
    mov     ax, es          ; ES:DI -&gt; VxD API entry point
  S* g! t1 y% r: @    add     ax, di
. b( S: @+ Z& q; O, G: Z    test    ax,ax
( K7 h; @, N( m  v3 A    jnz     SoftICE_Detected
# H( _  D4 s9 V, I! e  ^
" G6 B* ]+ l5 V# T0 |___________________________________________________________________________0 g! i  n" V9 @3 V

2 k7 D/ r2 M) I* mMethod 04
+ ~; W! m0 S# F9 x1 R: C=========
2 |$ u* Q8 l; E9 v; r9 E$ i8 v: b' ^7 q7 L% d
Method identical to the preceding one except that it seeks the ID of SoftICE
$ B+ E' X) O: y: x2 bGFX VxD.
1 g) W, [# y; ~' `
9 l; i' G! |" z1 w/ ]' w    xor     di,di) r$ @6 b' l6 I( a6 [, ^6 W
    mov     es,di
7 P1 y! Q7 p2 f/ V    mov     ax, 1684h       , g% N- |+ y! v& U
    mov     bx, 7a5Fh       ; VxD ID of SIWVID1 c5 ?: b) @9 x( j0 v4 n7 `0 U
    int     2fh
, [3 D6 f( F8 H5 R% b. V    mov     ax, es          ; ES:DI -&gt; VxD API entry point
9 g9 R! U& V, w* g* U& A) U    add     ax, di
' y, o8 i, X  ]/ H    test    ax,ax0 ~( L2 \/ H' q8 n7 K0 R
    jnz     SoftICE_Detected. H7 D9 g) |; t; {" b
; X! i* C9 \- A# y& _/ H
__________________________________________________________________________2 [" n/ ?# s2 q0 l

7 d. P9 h$ d6 o' S% _4 Q' }# @0 U0 D) A  }7 ~
Method 05
) \4 ?3 C3 S6 `" K. {=========
8 z& o3 d: J" ~3 _7 }" g# Z) M) _5 N( t9 M
Method seeking the 'magic number' 0F386h returned (in ax) by all system
# G! x% U& P+ n! N2 A5 ^+ k8 Odebugger. It calls the int 41h, function 4Fh.
4 C  _& e, K) H0 t4 R# a: Z- @There are several alternatives.  
( g( z, V4 i0 Q0 Q" T
7 p* M- [2 n) \1 p) B4 {. D& o8 kThe following one is the simplest:0 A" q8 f- E9 @, r

3 n% m2 _' Q/ D    mov     ax,4fh
- l+ N1 t8 l# ]' a9 C* W% Y, F    int     41h! E8 R' r% ^0 k
    cmp     ax, 0F3866 U, l6 P  \! a0 `1 t; c& x
    jz      SoftICE_detected
! w! ~; s6 B0 B( m9 Q
) a( ]& c: \6 g- o5 s) P3 C$ X, h4 b  f" ^2 q+ c
Next method as well as the following one are 2 examples from Stone's
, H8 E, a) O( s- d8 ?, o$ b"stn-wid.zip" (www.cracking.net):6 U- Z9 d$ s; q/ A7 a
) \3 D* |. h  @. M+ B( j& k6 f
    mov     bx, cs! \7 T, r1 V2 w3 J* F( A% W2 N/ H
    lea     dx, int41handler2
& G: Q! T# @, v! y: Q. f! E, }    xchg    dx, es:[41h*4]5 C0 X' I0 P' T; @/ }6 O
    xchg    bx, es:[41h*4+2]
- [; g9 r2 `) t; R    mov     ax,4fh
( v  q- W: `9 p. C% S6 N    int     41h' `" m' u% c/ v
    xchg    dx, es:[41h*4]. D) U3 B' q: j  y0 P
    xchg    bx, es:[41h*4+2]
$ `  ^( x: F0 F5 I4 g9 \    cmp     ax, 0f386h7 X& f/ ]% @( y6 G3 ?5 R/ D3 `, R
    jz      SoftICE_detected
& @: {3 w6 L: C* i/ |! }) {3 T) L: a0 c- n/ R* Y
int41handler2 PROC
# V* V5 G& c+ E* f" c4 Z    iret
6 E, w; p1 ?3 U0 f3 N7 nint41handler2 ENDP. P5 A$ A2 C6 s% ?4 Z
* m2 O) T7 G$ K0 D6 A& ]

+ O% L$ h& ]) x7 p( l' k9 v. |7 ?6 x_________________________________________________________________________
) ]/ ?! A5 W4 s. D* w
8 s! G! s' @/ V4 R7 F
2 ?% @7 u) D! G5 l! ~. B/ X& ^, fMethod 06$ ?, D8 t" ]2 p- g
=========
8 b5 N* m. o' \3 q  i8 M3 v7 [" G& }: N: ~$ u
! a3 @% E% h- i
2nd method similar to the preceding one but more difficult to detect:$ ]6 R. w7 s, f) O: ?& F

; ?7 ]  g7 G2 V& Q5 c8 b4 Z
* w# @, F- F6 i2 Hint41handler PROC
! u( m# r+ K* H6 }    mov     cl,al
% h3 F2 c" _4 \( h$ y    iret
) }" e6 p2 \9 g4 W2 dint41handler ENDP
  Z$ u. y# ?& u- U
. P- v8 V0 G2 K1 H, k- L1 N6 h0 X# i. X( R8 J' [0 w( Q( D; ~9 k
    xor     ax,ax
. r& y: P' ~  J* }7 z0 i" Q    mov     es,ax4 Q4 n3 A# o. r3 J; W! o
    mov     bx, cs
6 ]  n) ?+ r* Q+ I    lea     dx, int41handler
) K) M( d) y6 m% H8 D5 w  e    xchg    dx, es:[41h*4]
/ k' {' d9 Q9 z% g* s' j) b" g    xchg    bx, es:[41h*4+2]
! ^  ?: H+ H; q  c$ O# B    in      al, 40h9 j& ?5 `$ W3 V
    xor     cx,cx2 m3 Y1 T) G/ v6 V
    int     41h
: U, L! |- C6 G$ x    xchg    dx, es:[41h*4]; T) K1 g- A1 B' A3 v2 m
    xchg    bx, es:[41h*4+2]
3 `, f; L" K' d6 E7 T3 }    cmp     cl,al
+ P/ T1 O# D, Z' c3 k- Y7 ]    jnz     SoftICE_detected
" X9 s+ B2 Z+ `6 d, G: p3 \/ T
5 Q8 d. C9 d" T! v. J_________________________________________________________________________6 G8 d/ p! l1 f

4 c: i7 o2 V- W" JMethod 078 I, s& d, }6 q4 ?9 X7 l9 H
=========/ b! w2 A+ t" v& I" X# l! V
5 {0 @% W2 O, o4 ]/ m3 d( |
Method of detection of the WinICE handler in the int68h (V86)& i" u" @% m: A7 G5 j2 a; g
- y% r( _, m) j0 Y* H. f( m# K
    mov     ah,43h7 A$ B' `, m7 \0 x1 I
    int     68h
2 r9 [/ F- }4 G! ~. N9 r' m- I    cmp     ax,0F386h7 P& c5 h; b" ^5 }( R1 P1 L
    jz      SoftICE_Detected6 y4 Z! B9 a* v8 E3 r7 v

& v" h, c8 q  I3 C) J
9 X. w9 ^$ F3 C$ {  n=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit! a4 ]5 m- n( }" L, H) [) ?
   app like this:2 m7 g! X1 [5 M

' }( _2 X: N9 ]   BPX exec_int if ax==683 A* }: }* ^" G5 v8 Z/ [
   (function called is located at byte ptr [ebp+1Dh] and client eip is
& i, s. k, {( d8 O   located at [ebp+48h] for 32Bit apps)
+ K( {9 y: j, S/ t+ G2 h6 G# }: x__________________________________________________________________________; K2 N" A5 E/ q/ v9 l
" U( }1 L1 u& N- B$ S  K+ n& `

, S/ E5 e) o# @) M4 F9 l/ x) s& MMethod 08
; ^1 v  J: X* _=========
; o9 C  g$ p( O% L
' ^4 Y( n8 o$ K) J+ [! u7 K4 o) a" u8 [It is not a method of detection of SoftICE but a possibility to crash the
: }. S: |5 v$ Jsystem by intercepting int 01h and int 03h and redirecting them to another
; m& Q' o: [  t8 S2 G) f6 proutine.
) G* A$ x; h" c, E" B3 \3 a! O- yIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points4 I7 i4 B- S0 z0 q4 z5 z
to the new routine to execute (hangs computer...)
0 f. {1 Y/ n% H5 W  e) K2 @3 }  f* H& d( r
    mov     ah, 25h
8 C# {6 E$ y/ Q    mov     al, Int_Number (01h or 03h)5 i% U0 v, I. o
    mov     dx, offset New_Int_Routine
, f# @! N; a# b4 ~1 T) k* g    int     21h- q6 F3 H$ _/ o% q. f2 @

; ^" d! f: P+ Z) ?__________________________________________________________________________; Z; h4 v' i" q/ n4 F
: U6 C/ U' q0 B! ~! P  U
Method 096 B. `! {* o1 }
=========+ K9 H' o! R9 I* A1 s
# E  r9 O6 X; m  i7 }
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only5 i4 q- T% c7 Z+ G" n( [
performed in ring0 (VxD or a ring3 app using the VxdCall).
2 a" |, U. R' l1 g2 RThe Get_DDB service is used to determine whether or not a VxD is installed7 s0 }8 ?; Z) D
for the specified device and returns a Device Description Block (in ecx) for$ \" Z  E6 F( z. f# F" W
that device if it is installed.& x, z/ m/ e" _: ]; T7 p* Q

6 U% |/ N+ x1 d! V   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID
  C! ?. F& ~7 S5 {/ F4 n% i4 J  ?! K: Z   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
9 o0 M( ?  l/ b1 F   VMMCall Get_DDB
( d$ Q& A) h# w( e. k3 ?   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed% _: [. c* C2 u" E4 l

* w# \# V" c- g& {# I( KNote as well that you can easily detect this method with SoftICE:% l, F; F- Z; A6 e% j
   bpx Get_DDB if ax==0202 || ax==7a5fh0 d) ^, d' t$ b6 W% A( U& E
3 q# r" w: N9 r7 ]. J) g2 E
__________________________________________________________________________. n# y5 H! H6 F! p
4 W' G$ h! _' k# c5 W* V
Method 105 M7 @2 w2 c- A% V/ j
=========& c6 y$ c( g# Q& d
% n; G2 f4 ]9 r0 i
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with
. x) Z* }$ @0 K  K7 ~  SoftICE while the option is enable!!
$ ^0 A4 e" q/ w- o
# D$ U% P$ ?7 k0 W. ?This trick is very efficient:
) L. {5 {) J" u: oby checking the Debug Registers, you can detect if SoftICE is loaded
: w$ K, T5 i/ \' O) \(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if+ B. ^1 ]% s! e, a. p
there are some memory breakpoints set (dr0 to dr3) simply by reading their
+ P/ B1 V* B6 B+ k; N: nvalue (in ring0 only). Values can be manipulated and or changed as well
- C2 K8 W: t3 S3 d1 r" x: H  O(clearing BPMs for instance)
; X2 K& h3 l# P/ A- }: a& X% s+ ?) E) K! o! i& F+ @
__________________________________________________________________________
( A0 \6 G  z0 Q
+ Z% {7 R3 q8 D' Q& YMethod 11
- K* t! k& a4 M1 q! a; j. u=========
9 H; L/ q" O( f2 m+ b0 ]" j6 A" y* E* L7 |2 I
This method is most known as 'MeltICE' because it has been freely distributed
: y8 l( d8 h) v5 y6 Kvia www.winfiles.com. However it was first used by NuMega people to allow* j: D! G1 Y1 e8 U& `; s0 }6 l0 U
Symbol Loader to check if SoftICE was active or not (the code is located
5 h/ s8 A0 x' minside nmtrans.dll).8 _9 N. a$ Y( d5 X+ m5 `) f/ \3 e
+ t: V4 ]. S8 M: a1 A( L
The way it works is very simple:4 Y0 b, b1 G, i
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for- B. R, S) t5 @, j, Z2 ]% _
WinNT) with the CreateFileA API.
5 ]9 [3 E8 E2 b  J4 d
5 s3 G0 O$ u0 p* g- g! jHere is a sample (checking for 'SICE'):% [# {5 A2 o2 ?

( x0 C( g1 t# Z/ L* x$ MBOOL IsSoftIce95Loaded()1 i: H: q& V, p: q; P3 n; d5 w3 W/ G
{% x2 f) p2 E3 w+ f' A: D4 _+ t3 |1 J
   HANDLE hFile;  
( e% T. E7 k3 ~8 }. |   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
2 f0 y% `$ a; W0 H: F                      FILE_SHARE_READ | FILE_SHARE_WRITE,2 n& e6 Q+ ]* z. [* [) V6 S" C5 x! {1 i
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
0 H) [4 F' p) T3 n+ c   if( hFile != INVALID_HANDLE_VALUE )4 Q% V# U+ k# L' d1 ?, `6 t
   {
/ i, Z& {# e5 @$ c" l# P0 A- R      CloseHandle(hFile);1 Z5 M- I/ X2 d/ J+ c
      return TRUE;
8 A7 a' P9 ]4 _$ @4 w* j0 t+ e   }
" h% N5 h0 p! o; t% {3 p0 H   return FALSE;$ A4 F2 m) r) O: |; J) ^+ `- W, u
}3 }8 u: Y3 u0 G; ~6 A7 s; P; v; p
, k3 F% ~- P. h7 N  |0 ]
Although this trick calls the CreateFileA function, don't even expect to be
! }0 G" @& O+ L; rable to intercept it by installing a IFS hook: it will not work, no way!1 q0 @  _3 f4 j4 Q/ }! Z9 n, V. s
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
( I6 Y+ Y# M0 T: Qservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)/ t* Z  E5 j" p8 e* C
and then browse the DDB list until it find the VxD and its DDB_Control_Proc1 p$ h. o2 H- T8 e  M
field.
( h9 h6 d) u4 N3 M3 hIn fact, its purpose is not to load/unload VxDs but only to send a
: m9 Z, Y$ F/ _2 i$ YW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)4 D/ T  o% K! R% i% @* @, }
to the VxD Control_Dispatch proc (how the hell a shareware soft could try7 C# z4 H* A, k- e, |
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
( O4 l: i) O$ N: y, x2 vIf the VxD is loaded, it will always clear eax and the Carry flag to allow7 [1 Q$ t( q" r9 ~2 i5 I5 k9 S
its handle to be opened and then, will be detected.
) l  y) ]  j0 V$ j) [/ C" a  C1 jYou can check that simply by hooking Winice.exe control proc entry point
8 F4 f" k3 q! U8 d; y0 E, gwhile running MeltICE.( y0 L7 n5 e/ H: C) `0 d* V3 |

( ^9 X4 L5 ^: I; o2 m: u4 J3 i
, L& R/ _& p9 x1 z. D4 x1 ~7 h9 |% Q  00401067:  push      00402025    ; \\.\SICE) |/ _. l0 Q* L5 C8 i$ O
  0040106C:  call      CreateFileA
* l: ^8 U% t, j8 ]8 t) o7 f  00401071:  cmp       eax,-001
( q& }5 m/ x8 g1 X+ w  00401074:  je        00401091
- l% M2 r% X% H( `- ^! P( }( ^' `& T, T
$ O3 i7 y" q3 I) F
There could be hundreds of BPX you could use to detect this trick.
6 c0 `: u. E& o! l-The most classical one is:
- ~# {' z! E+ {+ ^  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
: z! X$ ]! G! E6 `! S$ i5 ?1 w    *(esp-&gt;4+4)=='NTIC'% S' D9 ^5 |+ ^3 M

' K, b/ q& s0 ?( A. |& q6 \-The most exotic ones (could be very slooooow :-(
9 V0 D1 l/ I' A" x( |% @   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  . Z4 U, h5 I4 f6 p4 a6 j
     ;will break 3 times :-(
- X- ]" y! u3 m8 Q* x. d: |
3 }. p/ y, r. i/ a. z-or (a bit) faster:
" J% v2 a4 @' J1 c) k; w   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')' [$ r9 U/ |# }0 T) M0 d: q
$ K2 S. I  V% X4 O' t- W
   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  
1 M2 V3 R2 B, i" R     ;will break 3 times :-(; s& x( ?$ v& Z- A7 o1 _

( l; T, O* t* P' N, L-Much faster:" y3 S0 J# S$ |) m5 `9 v+ f7 w
   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'! L) P+ |1 u& L! K* {
. u% Y. v) @& \1 ?4 K. R2 ~
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
! z. |4 O. J! s9 ?! ~4 zfunction to do the same job:/ ^. O. b* a/ F- C: P2 V

/ u  \  }3 D; M$ c# N& k/ l/ @( |   push    00                        ; OF_READ
5 e" W# K5 I( ^  f   mov     eax,[00656634]            ; '\\.\SICE',0
7 w5 U& X& j& [$ r   push    eax- Y) h, B5 y7 z: @7 J5 x
   call    KERNEL32!_lopen( u' a; U6 @. z& s
   inc     eax
' t8 e+ \. s9 _6 T; V. Z   jnz     00650589                  ; detected
9 W1 e: T' J8 g# _   push    00                        ; OF_READ8 L: [4 v! p" s  G7 w# M
   mov     eax,[00656638]            ; '\\.\SICE'
' |& |, t' R2 S5 [2 V3 _   push    eax" Z/ ~  v, u% v1 D1 h' v
   call    KERNEL32!_lopen
& t  O' ~6 K& n1 r. i$ }5 V- r   inc     eax
* R9 j8 }  w/ Q# |" X" E8 ?   jz      006505ae                  ; not detected6 \5 L& M9 L# @( T
! y1 M% w3 {, `1 ?% X  R

3 J( y' ]3 n7 @__________________________________________________________________________0 J7 {8 L2 ~  Y+ p/ c! b8 j
/ v4 H) {% G# C. ?1 q: H6 }
Method 122 s* Q8 T( q; m/ s& t: ?0 g
=========
! h1 c7 W% v' `7 Z. U; x% m% ?, g4 @
; Q9 F5 A9 k: b4 j2 S7 kThis trick is similar to int41h/4fh Debugger installation check (code 05
3 Q4 `4 C) D5 G7 V$ Z&amp; 06) but very limited because it's only available for Win95/98 (not NT)1 ^! Y* G: a: q  G+ U" E# r, l
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
' U6 ~) E3 W2 |* d
- C) ^  x7 Y) F+ b% e5 {+ w- K   push  0000004fh         ; function 4fh! G/ |! l# K1 m! Y! P: [  C
   push  002a002ah         ; high word specifies which VxD (VWIN32)$ V  n: b# `. a+ |
                           ; low word specifies which service/ r, b0 A. g% {& V  J
                             (VWIN32_Int41Dispatch)8 t# }5 b) x6 @0 d* L
   call  Kernel32!ORD_001  ; VxdCall" f: N! J& a8 T& q# m
   cmp   ax, 0f386h        ; magic number returned by system debuggers
: z/ c" V8 N2 L   jz    SoftICE_detected8 }; Y  A/ [* A" U) u, W

2 _+ T( n  M" v! o# vHere again, several ways to detect it:
: c% H' }& b2 M
  g# }% A4 |/ t* f    BPINT 41 if ax==4f
, ?) U1 }% _- c8 }. _% a1 g6 Q0 }% j2 Q4 C
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one; l" ^5 G' O& L  `+ ?. r- \4 k
6 z5 |9 Y- F1 I7 f; C0 x2 t
    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A9 B6 e. S3 F. x# M

; Z/ ]+ y, P6 `* S5 ]3 w    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!- J: l& w4 [7 S/ G4 a6 u; s
1 K2 Q% _3 D( e$ W2 V) V
__________________________________________________________________________" T- n% N: N" r4 F5 Z; t
, L% f9 S; z5 L7 o
Method 134 r& d3 d* O1 L9 N
=========, b7 P" Y/ I5 z% ~
7 J7 V( A, X& X& R
Not a real method of detection, but a good way to know if SoftICE is' j: z4 E( t) p8 L
installed on a computer and to locate its installation directory.
+ j* t2 w4 w8 ~: y5 MIt is used by few softs which access the following registry keys (usually #2) :
* K4 \: V# ]5 |) H. h  ?( z# i& B7 I
/ ^4 ^9 ]8 h' X( [# H9 X-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion! f& R9 W0 s% D' `' L. N3 a
\Uninstall\SoftICE2 ]5 F4 b6 i& c2 ]: y4 Z
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
0 l5 I5 E6 ~7 p3 ]: ~, G-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion5 P, l3 W( @6 Y! h, g9 f
\App Paths\Loader32.Exe
# D& d9 {) I) q" [0 \1 n0 h+ P2 u! j* J% _' K/ X; g
- v+ m9 S2 [4 [
Note that some nasty apps could then erase all files from SoftICE directory
" }4 ~% b5 a# `$ T# }( n& [' n(I faced that once :-(
# @) c# T8 j: w8 w$ C5 \
) B4 u  M% r1 Q* I* cUseful breakpoint to detect it:& m: ^+ n  e' s0 S" v% d( P  M
+ K. |# v: d+ z8 v. c$ a
     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
6 H* }  t6 }3 C5 d* W, Q0 o8 ?. U  i3 I& P3 V  ]
__________________________________________________________________________: x+ q6 ?* X5 D
6 u* Y  k2 ~( ]1 y* E9 J
' x# N# Q4 O8 [5 I* m$ C
Method 14 ( q7 B0 M( @. H1 _( O. n
=========  Y$ _+ Q, [  b
. f; @7 d. J& ~
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
8 a1 _& U" [7 [is to determines whether a debugger is running on your system (ring0 only).
0 _5 {2 m# `8 z* d, O+ J1 i: J7 o  @
   VMMCall Test_Debug_Installed7 Z; J" E' S8 h; X
   je      not_installed
- L/ v% V) x* U; J/ C8 K! C. h5 h% [+ ~% g
This service just checks a flag.
9 U: p- u- G9 g5 `, G</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关注公众号

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

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

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