About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>: z& |3 Q/ P6 I+ {7 \2 p: f. b9 w
<TBODY>
. a! ]5 |" e2 U' e<TR>3 ?6 ?" {( r, X1 x, O$ }) J( A
<TD><PRE>Method 01 0 z: C! @/ ?- M% T
=========
7 d0 Q& Q/ i% k
! `  q; m! A- P7 PThis method of detection of SoftICE (as well as the following one) is
; Z3 D% |' F, C6 gused by the majority of packers/encryptors found on Internet.) R- E6 `3 A: M7 Q7 V; X
It seeks the signature of BoundsChecker in SoftICE
! P) E4 k) {+ c1 i7 i+ P! U9 ]
) b% N# u+ N2 C& u. `    mov     ebp, 04243484Bh        ; 'BCHK', x# K; S3 I7 o! u3 I
    mov     ax, 04h$ [( U# l. s7 _
    int     3       6 m8 ~8 x. n4 f: ?( z; n
    cmp     al,4" O4 d! L, c8 X# d  H
    jnz     SoftICE_Detected
+ ^/ ~4 b* Q/ M# R" E9 ~) M, p0 e! a8 a6 k) k+ U
___________________________________________________________________________5 h' g3 @0 h1 a$ y. c! D, a
: B, b* i  r- _- L. n, H
Method 02
8 R# }9 z- \6 q. e3 [" G; G=========
6 a1 Q7 }0 |, N. |1 N2 i1 \3 a: d) u2 f! ^8 l# c) A( J  X
Still a method very much used (perhaps the most frequent one).  It is used
. ~" y1 j; k% k0 lto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
, j! ]  s6 k$ V/ L; e. h' bor execute SoftICE commands...
, g8 I) P9 m1 w7 S. n. y- \! ]It is also used to crash SoftICE and to force it to execute any commands3 C3 s' W; n, G8 n
(HBOOT...) :-((  / {5 L, u7 Y6 C/ A

! p- x" K7 N0 d' xHere is a quick description:! {' U- H6 f; K1 ^! H3 R
-AX = 0910h   (Display string in SIce windows)# E/ r- h* K; O# y' r/ k* r9 a* ?
-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)
2 ~4 o! q: N* f$ a! U5 Y7 L-AX = 0912h   (Get breakpoint infos)# |" g# L, c* s! ?
-AX = 0913h   (Set Sice breakpoints)/ i; j$ K' |# ]' i) }8 J& p3 G
-AX = 0914h   (Remove SIce breakoints): h0 @, M# ~5 }- I  ^  N5 a7 d) X
" K0 Q$ g- G* l' Y6 A
Each time you'll meet this trick, you'll see:% ?( W" O1 U* l! d( R  q+ }) N" H
-SI = 4647h
# U- O- N, J9 C' k-DI = 4A4Dh
, J5 U/ N0 z9 J- m, S0 ~) L2 {Which are the 'magic values' used by SoftIce.' G! t: n5 D, U0 O6 N7 V( H6 w4 n' [
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.+ m( ^' P2 @6 X
; y5 Q% w" I  ~1 U7 W
Here is one example from the file "Haspinst.exe" which is the dongle HASP/ U5 ^8 @4 D8 L
Envelope utility use to protect DOS applications:
/ B, Y; t* W9 ?3 I( m0 m0 C0 V$ i+ D6 U- _; H4 x
- d) B( W* L4 A1 [! w' C: K
4C19:0095   MOV    AX,0911  ; execute command.. w0 P+ N. r% G+ t0 S% r  ~' H
4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).& ^! [' H( E. f' ~9 L1 j, z
4C19:009A   MOV    SI,4647  ; 1st magic value.
3 n! W$ n+ n. j: W$ ]4C19:009D   MOV    DI,4A4D  ; 2nd magic value.+ O/ `) B0 U0 r
4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
& K' J) d+ a  D( {) S4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute
& O  K% T  D: e# |2 _* A4C19:00A4   INC    CX
  t5 I, x% T8 P4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute1 f1 w& C5 ]- g6 C3 N( E; V0 A
4C19:00A8   JB     0095     ; 6 different commands.
" e9 y' q! Z! T5 q! n3 X4 l4C19:00AA   JMP    0002     ; Bad_Guy jmp back.# m% R$ F2 i2 t3 }( Y4 C
4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)
: G- \8 Z3 @5 ^! z& b" O
  \( G+ U2 J& I" \+ K( O5 h4 }The program will execute 6 different SIce commands located at ds:dx, which3 e) Y) D; B# D# Z3 M3 g1 N% t
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.% q9 [" x: h% j& ^) Q
+ b/ D* t) U, p; X: f
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.- w6 c6 g8 f$ [; S5 p) y+ \
___________________________________________________________________________' Q7 ]" {9 M( `1 N' }+ u

- L- b. d  f5 P, T5 G* W, t) A6 k9 N0 Q  F. [! c" r# |2 X5 J" e
Method 032 s- F. h! s8 e/ B3 }8 r2 B
=========6 J7 a/ S  z& k9 K2 r

4 g( Z' g8 a. b2 ]+ jLess used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
9 F' G- {, `9 G4 \. {9 P1 i7 n(API Get entry point)7 b8 L* u3 U1 f: I% ~! Q1 A
        2 x. ^: ^4 }% P) ?! a. ?# t
1 ~; R# k, H* Y/ d% x$ r, a4 Z3 \
    xor     di,di
- C; I8 ]2 w; P; Y; p* i    mov     es,di
* K. m7 Y- q8 \4 k. w7 s    mov     ax, 1684h      
- u1 l) I; E! v6 G; B, T$ Z    mov     bx, 0202h       ; VxD ID of winice
5 q* |# }2 y) q4 m    int     2Fh
. a& ]9 y5 z) J2 S0 \    mov     ax, es          ; ES:DI -&gt; VxD API entry point
- S7 x$ s# l) y# s  G    add     ax, di
! ]: B" A$ M$ n    test    ax,ax
1 T( X& L# ?( _  Y& @6 T0 M0 M% s    jnz     SoftICE_Detected, h% \& Q9 W9 X0 Y0 i% c

' ?7 K% r% ~7 f8 j3 }( f) O; ____________________________________________________________________________8 [* e0 Q7 W/ w( n8 W, F2 Y* H
3 ~2 W5 [0 {# N. i6 [
Method 04
" {* H! c, w! Z. C* h=========: F, t, C! z' w7 s4 }7 M

: R* ^; l: N0 e- r3 TMethod identical to the preceding one except that it seeks the ID of SoftICE$ Z& F* \7 O+ S# l
GFX VxD.
, N3 v+ X3 x, p/ s% e3 @
& d% e0 H- p- K5 R- p8 o7 J$ W* o    xor     di,di
6 ~2 O5 t+ f' ]) q    mov     es,di
0 O+ V& A, ^, X6 s) F" e2 j    mov     ax, 1684h      
1 R' r4 s* V" I% G- r    mov     bx, 7a5Fh       ; VxD ID of SIWVID
9 ^/ r7 I0 y( X$ O) k    int     2fh( d2 l+ `# v6 x& u/ k/ I- p2 N* k
    mov     ax, es          ; ES:DI -&gt; VxD API entry point
, X  g- G& C! @( L$ f! t    add     ax, di$ `" x, {- {& D. J% Q) V
    test    ax,ax
+ V' F4 K! }; n  m7 e7 O    jnz     SoftICE_Detected
+ Y. v1 X4 K; I9 j4 \" j, q
# ~4 S) l$ t9 j) h; i7 r__________________________________________________________________________, }+ h& G8 D! d3 K$ S9 X  ~

* e" C% R9 _. m0 n/ c# x% U. W
- |7 p# ?3 ?8 B9 F  ?Method 05
! a  {/ c+ u* `, X& Y' d=========
: R& g) F- \5 ~( O( Z0 E/ E: i/ V$ ~! A& V5 J; {
Method seeking the 'magic number' 0F386h returned (in ax) by all system9 ?' g& M7 d7 K$ |; ?% Z6 @( P: c- `
debugger. It calls the int 41h, function 4Fh., d3 N. x: \5 d
There are several alternatives.  4 \3 s" V  a9 S' o2 Q! F

1 x- m, \! }" z, {) W' t$ V' n3 IThe following one is the simplest:
" b1 ~9 Q- o9 d. J- [$ \7 H5 S' T# U; V
    mov     ax,4fh
5 ?+ i8 f  G$ \8 S    int     41h& p, ^6 I. B" `6 S. L# P1 U
    cmp     ax, 0F3866 n# q4 W0 i$ }. |
    jz      SoftICE_detected
- C( X* H4 K  u9 n" D$ k. x! R0 G& s0 F* I3 s3 w

( S, Q6 R' y0 s. X6 c; VNext method as well as the following one are 2 examples from Stone's
6 l  }# N# x* j: N# [) R"stn-wid.zip" (www.cracking.net):3 d# P; k) b5 e/ K, R) q& p
6 a! R% W% K2 @+ \: I
    mov     bx, cs/ P3 O" t3 \9 A1 Q1 I( b  {
    lea     dx, int41handler22 J, l: S% P. R; A! Y$ Y4 }; T
    xchg    dx, es:[41h*4]
+ q9 l8 ?3 p2 C5 ?% K+ K& c, h    xchg    bx, es:[41h*4+2]# j7 I6 c' d4 m# B% ]& ~
    mov     ax,4fh2 T; D) {% k3 Z; _% l' I: L4 }& n' I
    int     41h$ X" H! B. k. S
    xchg    dx, es:[41h*4]
* B+ R. V, `0 q" v' ]6 G' H$ g    xchg    bx, es:[41h*4+2]& i3 T( u" i, ]1 d7 |% |. |1 h# Q
    cmp     ax, 0f386h
% O$ ^' C" t. m  ~    jz      SoftICE_detected4 J7 p- ~0 O) \. m6 x2 k, V

; @* |( m8 B3 H% B* X9 Bint41handler2 PROC; y# C: }5 B# d6 c# ?' u
    iret
) Z" W0 l# H* @7 G! Kint41handler2 ENDP0 f# _8 v; _  s1 i1 k
2 P0 g% l$ m# d0 e; s0 u# h5 N0 y

* s) U: F& N; M# p, a_________________________________________________________________________% F' X3 D4 F: Q1 N5 T& @

* I$ c; q( g) H7 T$ ^2 Y
" L5 q6 _1 b! P( R% \! }# }Method 066 W) e. |% ^' K& U) i! J
=========3 @/ K+ V. d' Y# M* {; c
; U+ E1 `2 o% t; [
  H8 O( }0 p# s1 ]; u. U" j- }
2nd method similar to the preceding one but more difficult to detect:0 n. m: N1 o: ]

$ x3 e! _/ K5 v2 [* _7 ?: k+ G7 Q
# u( T" Q" E7 g3 e* |int41handler PROC
" V* S( p' o3 s) H    mov     cl,al6 ?* S- a5 F4 F4 z  T
    iret6 z6 p( f! j. p+ Q$ d: q+ R
int41handler ENDP
! ?, Q9 l2 Y" s& h4 ?
/ k$ w% F/ H% T5 L. M: l
2 |- c& g/ k! A7 _! G: E8 |4 V    xor     ax,ax
5 O% P5 Q8 o: v* \: d9 W9 r; @    mov     es,ax& r# u" l" c, R; S) j4 j* k
    mov     bx, cs
& J) s/ B. J5 R. w! _+ q$ w    lea     dx, int41handler
' F& O, h0 f3 \) O    xchg    dx, es:[41h*4]
% H; |" }" t5 J" V5 C3 [6 P    xchg    bx, es:[41h*4+2]
" f, P/ D* B6 C1 _5 D$ E; o    in      al, 40h8 e$ m1 U+ l+ q
    xor     cx,cx% j. }+ Z' M- P3 J9 k& L
    int     41h% ?* L4 }( |( U3 [8 V$ Z4 p
    xchg    dx, es:[41h*4]
, q1 Z& e- w1 W4 V4 s  t( C( {    xchg    bx, es:[41h*4+2]" q  o7 t0 G" m7 {; X7 [, H
    cmp     cl,al  ^6 g4 c9 ?8 P. C- ~8 ]  O2 O
    jnz     SoftICE_detected5 y' h; y0 L" A1 t; r$ I
. w" k' I) h6 R$ M/ ~
_________________________________________________________________________
& N. }, M( v9 I- b/ H' A- C' @2 I, f8 E) s' G; F2 a# ], B) K# D
Method 07
; _# n& t# f* j=========
6 I( N: c2 l% l" J+ v6 A4 n$ q9 i  w8 z% E! C9 X
Method of detection of the WinICE handler in the int68h (V86)1 j% C* g# |5 _

3 {1 p! u$ `+ N0 n& v% a    mov     ah,43h& l/ f; ?! M9 R2 J6 O1 w0 S" M
    int     68h
9 ~- S6 t9 l& a' {    cmp     ax,0F386h
; f# `2 ?, K2 }' P3 N    jz      SoftICE_Detected) g) M0 Q( O. E" ~* E# F  {
& x: u# V$ j# T- @6 a9 H3 |

1 P0 j9 Q/ @4 i+ D=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
9 `# C& I6 O& h' b* t# x, u   app like this:/ E8 ?) ]6 z" x" T9 s1 c; O
, _8 @; _/ K) [: ^8 G- L: E1 ~
   BPX exec_int if ax==680 g1 ^- X; g- \; |
   (function called is located at byte ptr [ebp+1Dh] and client eip is' Z1 Y! X! G3 _* D
   located at [ebp+48h] for 32Bit apps)2 R. c$ D6 l3 \$ q
__________________________________________________________________________  |6 A! N9 R( V6 I! ]
; u1 x$ z3 [8 `2 g4 d5 k! ~  a" ~

3 m% h7 n3 K( a3 _Method 08
! x* b* }7 s) s/ ]5 \1 _=========# z6 C9 V8 f& x# m7 P* {' T

3 R& r& C6 ~2 {# pIt is not a method of detection of SoftICE but a possibility to crash the
) a) j, z6 B+ {4 D+ @system by intercepting int 01h and int 03h and redirecting them to another
( `) @) a. S1 H0 zroutine.
, d% p7 G; o' o2 H& T& ~It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points- \- ^2 p/ j! w4 Z/ E; R3 v5 `
to the new routine to execute (hangs computer...)4 W6 j. Z, A* k# @
, Y" N, n- H2 }! P
    mov     ah, 25h
0 U! f) m( }; t' c& @( E    mov     al, Int_Number (01h or 03h). {0 P# @  w, B
    mov     dx, offset New_Int_Routine
8 x. `; K! V1 `* u" ^: Z" V  Q    int     21h
2 }# e; D* a& ?5 Q. c& a* ~6 i" T) b% A
__________________________________________________________________________
/ L( a/ A4 p6 l; t0 V4 ?
& w& A8 v3 f! i4 q4 W7 FMethod 09
2 h5 J  o5 _7 {=========" L* p$ e1 |% Z
- i$ I( y7 ]) }
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
, L! ^- s& d' Xperformed in ring0 (VxD or a ring3 app using the VxdCall).
5 j# D" w- [$ x6 I& KThe Get_DDB service is used to determine whether or not a VxD is installed' R0 E2 Y" m8 Q7 \" g7 R: M
for the specified device and returns a Device Description Block (in ecx) for5 `0 c+ p! \# R
that device if it is installed.& P2 r; D0 d+ ~( C. w
$ |, l# M, r/ O" z8 h4 G8 O
   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID
: b( n6 F5 h" W. |- m; J+ U& \   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
% f" f: w, V% q   VMMCall Get_DDB8 q1 {# }9 V; N  T2 j
   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed8 a# h* j/ j! N$ l

8 J5 Y6 i2 B, }+ PNote as well that you can easily detect this method with SoftICE:5 t4 ~: o. p" G; F6 X) v1 L/ l( |) @  Q! X
   bpx Get_DDB if ax==0202 || ax==7a5fh
# F) h: V; j& m
: g: U& v/ C9 }# o__________________________________________________________________________& \5 U$ z+ M" O/ S% H

( }6 r9 Y4 g6 n  ]Method 10# \" n* l3 `  }  I/ W
=========
9 x  @+ b1 h; {  O6 o8 {8 K4 y  A, ]- H) O" b0 ?$ g
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with" j3 n$ y) {) m, j* s/ |
  SoftICE while the option is enable!!- [! x: ~8 y7 I/ R; o( N- o

) s% c" G+ X  j0 R6 m; U4 S/ }. H7 \This trick is very efficient:
2 c' ?: w6 Y9 m5 N5 o) d( Jby checking the Debug Registers, you can detect if SoftICE is loaded
  F  ~# W# O6 K+ N: r* h9 i' h(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
; q8 k, }! N8 W. J1 Z9 b' pthere are some memory breakpoints set (dr0 to dr3) simply by reading their/ t$ `- J+ f  g- U1 i  c9 o/ Q
value (in ring0 only). Values can be manipulated and or changed as well/ o. k2 b( Z3 `0 L0 a! ~; b
(clearing BPMs for instance)
/ a" q- E6 @/ z  i% {& m" F+ F2 ?) P6 g5 k
__________________________________________________________________________
/ Z! i3 j9 e' b6 N- m8 g5 J  z+ j* f* o: I9 ~/ @
Method 11, Q) b( {8 q* E, c
=========) y6 D( c/ N+ ?- }) w

1 C; |8 e& K& WThis method is most known as 'MeltICE' because it has been freely distributed
8 s: ~' g. }0 Q" w# V) F' Lvia www.winfiles.com. However it was first used by NuMega people to allow
- j1 `; M+ }$ ^( L. d9 H$ X+ ASymbol Loader to check if SoftICE was active or not (the code is located
; |) `# e9 S% T5 Sinside nmtrans.dll).# C) o" X5 \3 ?" [9 p

9 d2 P7 k1 L! X$ y6 K! ~The way it works is very simple:
8 f. u0 k5 @8 g6 F- fIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
& k" v/ \) }3 v5 j7 A9 m. TWinNT) with the CreateFileA API.
- W% c; o/ c+ ]( ]. J) d  v% m, F9 n1 q* g0 `0 L& U
Here is a sample (checking for 'SICE'):9 P6 k% P( i: c  |1 a0 a
) M# D7 @8 a4 b/ ]  J0 }5 q( Z
BOOL IsSoftIce95Loaded()
9 L. G% K/ ?2 o8 J8 K{
2 u4 P7 O8 d4 X   HANDLE hFile;  
/ v' C7 V8 K) I   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
. b% b0 o: ~  o6 ]3 v( g                      FILE_SHARE_READ | FILE_SHARE_WRITE,& N. n& O7 S8 N9 A; M  N- g
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
, Z# K# a* a: e" y# y0 Q. G   if( hFile != INVALID_HANDLE_VALUE )+ z* r+ b4 j) n& m- f
   {
3 B& g' F" t! i4 H2 c      CloseHandle(hFile);
: A! u6 X8 p7 E' o1 S3 |      return TRUE;
( V8 S0 r, u/ c   }- v/ K$ \" m! D% b3 ^9 O. d' ?
   return FALSE;
' `/ `: E) v. s}
; Y$ I8 L* H; U! h+ Y- e  j6 t6 l& D! S* I) F8 s) w
Although this trick calls the CreateFileA function, don't even expect to be+ O: O3 |0 k6 z2 t6 Q4 F
able to intercept it by installing a IFS hook: it will not work, no way!
0 T! a& p( o0 T8 c3 J/ }+ Z. MIn fact, after the call to CreateFileA it will get through VWIN32 0x001F, A. n+ E! {% @. i
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
+ E8 g, G: u% tand then browse the DDB list until it find the VxD and its DDB_Control_Proc, O& `4 D9 N5 ]9 i  O
field.. i, D; ]$ @4 W" s
In fact, its purpose is not to load/unload VxDs but only to send a & v8 b! t2 i1 g) l
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)4 |( Q9 F. R5 _( d' k
to the VxD Control_Dispatch proc (how the hell a shareware soft could try5 e" H# L. N  p! F' i1 S5 P+ {
to load/unload a non-dynamically loadable driver such as SoftICE ;-).* y; ~7 H0 j/ n
If the VxD is loaded, it will always clear eax and the Carry flag to allow4 ]$ n( ]4 ~; d, j8 L3 p3 d
its handle to be opened and then, will be detected.
; f% ~% ^; L; j% pYou can check that simply by hooking Winice.exe control proc entry point/ Z! P, T& {& @( h; `% \7 E
while running MeltICE.( e( e# A# ~5 q9 C$ U$ |/ ]

7 V" W/ y6 Z+ e9 N2 I: G! k$ U; u/ U5 [8 x3 e$ t
  00401067:  push      00402025    ; \\.\SICE
6 ?0 I+ f* h% [. q: L" c  0040106C:  call      CreateFileA: b$ [0 w& N% ]$ p+ L. b0 r
  00401071:  cmp       eax,-001, ^; h/ ]. @% O% N
  00401074:  je        00401091
+ Z: B6 s9 @! D$ r* h- D8 z2 ~4 J; n, f/ _
1 L( u# W0 t" R5 M' Q# @: o
There could be hundreds of BPX you could use to detect this trick.
6 w5 {4 U6 O9 ~-The most classical one is:, U6 P/ F8 U8 p8 [+ N. M
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||9 [4 D& J6 t$ |- K6 {9 U
    *(esp-&gt;4+4)=='NTIC'5 y  m0 X: |8 h5 S" v1 W5 w

9 `  t6 _! ~0 X! l0 j! a-The most exotic ones (could be very slooooow :-(
+ Y  B% f# K" W" l$ W; X   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  
2 }# g4 b7 i: r$ {3 u     ;will break 3 times :-(
& U. _" K7 ?5 W3 `5 {) B8 Z
# p: }& u- z3 m+ o: h+ U-or (a bit) faster:
% q) j( C% m/ Y& @) b  T: j   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
  S' k; ^2 v4 S1 {; P. z3 L6 {# o* u* g: n$ q& V( M1 F
   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  ' [* N( f/ ?: J' k4 }- ~! D! Z
     ;will break 3 times :-(
) R6 G+ `2 z  g/ N7 t6 i$ J& o* d* _3 d
-Much faster:
; U1 c; F, O; f8 A1 B3 A- z   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'2 b# u3 F9 G( y. }2 b2 r

3 f, [. b1 S& VNote also that some programs (like AZPR3.00) use de old 16-bit _lopen3 P7 M1 g; F4 ~# x
function to do the same job:
& `. _' _6 z& K/ Y
2 d, w- T: k8 ?% W# I% Q' K7 e4 |3 o   push    00                        ; OF_READ; d  {# f$ N" H
   mov     eax,[00656634]            ; '\\.\SICE',03 k0 M- O5 E8 H
   push    eax* t" Q$ ^; ^1 b$ d9 W7 Y% m
   call    KERNEL32!_lopen
' F" L. ^3 E  H, I* b: i# d   inc     eax
# t7 H/ Q& A9 m) L7 H   jnz     00650589                  ; detected
# q; c, J8 f2 t3 O) T3 w& F   push    00                        ; OF_READ6 u& @$ K! n8 _3 q& y9 q- a
   mov     eax,[00656638]            ; '\\.\SICE'( ~+ x1 M( e. Z# ~, w7 J
   push    eax4 t5 w5 R+ g, j* _7 a
   call    KERNEL32!_lopen
- a+ V$ H: O) L$ @   inc     eax
8 w9 J2 Q* P7 q& m   jz      006505ae                  ; not detected
# o: [8 C; c$ w, P+ T8 H- W7 \+ c0 o! ~6 `; d. G) X. ~) h4 `

" f) [! ~- \6 @1 G) L__________________________________________________________________________6 h  l, m- D" y5 O0 k  n

3 u) p. o% Y; oMethod 129 S; {7 o' M. C+ C2 Y: W% l
=========
" {- P  B; h1 O
$ f: g8 _& A4 R+ w6 eThis trick is similar to int41h/4fh Debugger installation check (code 05
5 r0 z( B+ f; F&amp; 06) but very limited because it's only available for Win95/98 (not NT)) ]7 |; y3 r9 m8 j. f
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.' Z& v* B1 t$ X- K+ `* i

- n- p* f# k% }, j) {. K8 O) Y   push  0000004fh         ; function 4fh( ?  i; T+ r4 f: m  M; r" f
   push  002a002ah         ; high word specifies which VxD (VWIN32)% ?! R9 t" r% u, W+ S# X* e. k0 R
                           ; low word specifies which service
9 _" x4 l9 |& ]- ]# s. B2 _                             (VWIN32_Int41Dispatch)! f- w% C. f7 A2 ^
   call  Kernel32!ORD_001  ; VxdCall
! g) O- |7 j) I9 _1 g$ r# w   cmp   ax, 0f386h        ; magic number returned by system debuggers
" Z& g" x' W7 b   jz    SoftICE_detected6 X2 n6 t, U! Y: {

2 i7 a" J+ {$ P8 ?$ }* P9 B# lHere again, several ways to detect it:
. G- a9 A! a# `6 K  S, b
* v/ N) `" S2 D1 H4 c    BPINT 41 if ax==4f
- v+ m! _& b# W; e2 _2 q5 ~( S8 r7 [9 m0 N
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one
2 `  f$ y) Z3 y& j4 V8 r4 Z
0 j) Q' V, J* V1 H3 u! c( E    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
3 I; p; ~% E6 C3 N: Z: L1 F" i
8 r) j! s2 |# T: n    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!( y3 a' c( H+ S% b5 [: Z) e

, |9 m7 y1 w8 K# _3 g! n: d2 F; I__________________________________________________________________________3 C: v+ C& p8 v6 s

' T9 L* h$ E0 \4 |( ]Method 13  R1 x  w0 u6 B. s- H+ }/ ~
=========
, `7 k% n) y6 b7 I! E# ~
8 \+ n- g5 s2 q& T" k) t6 |9 JNot a real method of detection, but a good way to know if SoftICE is" ], c/ z1 W/ B1 l5 k- G
installed on a computer and to locate its installation directory.
: P. L! Q8 _1 U! V& N# ~It is used by few softs which access the following registry keys (usually #2) :7 V& x6 t# \; \8 F5 D5 w5 g

2 W- s7 H' T9 y-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion5 D3 L& W$ d2 U8 n) K9 r
\Uninstall\SoftICE7 |' N5 |1 O4 {' @# u5 ?( h/ k
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
; Y7 w* h4 ~* ]+ n) i; p: C3 m) i( q-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion6 K% P! Q6 ?) s
\App Paths\Loader32.Exe
. @* w" A$ q* M% J  i! p" Y0 y/ N, s( c9 @/ n4 T+ D# p- ?

" D) P1 X8 W8 [Note that some nasty apps could then erase all files from SoftICE directory& a# P7 I. {) [: ?3 u0 B* ~
(I faced that once :-() d! Y9 S% k( X

; `/ J% }1 X: ^2 pUseful breakpoint to detect it:
# @! k$ |6 R& W5 n. l
  B3 K# c" f/ S) X1 l+ `- k     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
  s$ H! H2 G$ j3 ?9 |: r* q3 j8 k0 P7 ?# `1 i! }' Q
__________________________________________________________________________+ |, \! E9 o" i5 H6 V( l3 T
: J% ?5 S) v/ `" F
& U: e# [4 k$ z- F
Method 14
. G$ Z$ T, {1 c: |" L" f=========
7 D: A8 I8 ]' N, D5 S( ^5 u7 V& m1 w1 K3 v/ A# P% i" H
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
, D: s3 f3 e0 M6 jis to determines whether a debugger is running on your system (ring0 only).
7 R8 F% `) T  [+ I- `+ O" V& U
# ?# R$ ~1 H( }0 x- ]   VMMCall Test_Debug_Installed
9 q; j2 w( E" o" r0 b   je      not_installed
6 C, o* q' A; D$ @
$ R; R5 _0 `) x* Y, l- dThis service just checks a flag.7 k  v. J! ^/ Y; l& @# f' Z
</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关注公众号

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

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

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