找回密码
 注册

QQ登录

只需一步,快速开始

About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
' u8 }# p/ D9 C' b- i, I<TBODY>
& ]7 Q7 `* ^  m# \8 I0 t8 p( w<TR>
* R+ n& }+ x3 {+ ?& D( S0 E( K4 C<TD><PRE>Method 01
' Q/ i' M) c/ Y0 a=========) u6 i; ^: S  c3 D

: \4 n" y# i- XThis method of detection of SoftICE (as well as the following one) is
' W; y5 T2 z, `" Zused by the majority of packers/encryptors found on Internet.
1 D, X5 x- X6 @  M" kIt seeks the signature of BoundsChecker in SoftICE/ k3 o/ U, F8 a8 D% t
/ N: ]1 ?6 \7 S+ H8 B
    mov     ebp, 04243484Bh        ; 'BCHK'
0 o, Z% H5 g4 [/ Y9 \7 H    mov     ax, 04h
1 S; t, m3 M" K, E! |# F2 `    int     3       0 q, j* h  M5 k% p
    cmp     al,4
' H/ I. V( L, A, {5 t( P0 K    jnz     SoftICE_Detected7 `4 [2 w- V6 U9 M8 W, R" {
& w$ v9 R7 _4 Z2 ]" P* Q
___________________________________________________________________________" W1 f9 p% Z! i* p; w$ f. ~& c
! V- d3 f0 a/ i+ h$ N* l6 w; l( k
Method 02
7 ?- @. s& n1 I, C8 H% z" v=========: Y6 c# l) e6 s* E
5 r7 ?' V! P' `7 x# v( `& m
Still a method very much used (perhaps the most frequent one).  It is used
7 Q: ]3 @* t8 O+ x. Q% S; S' i% ?to get SoftICE 'Back Door commands' which gives infos on Breakpoints,9 k5 E& S6 ?: b( v. @
or execute SoftICE commands...# o+ r0 T: R% u
It is also used to crash SoftICE and to force it to execute any commands1 q7 I+ h( A6 p. u6 Q* E0 K
(HBOOT...) :-((  6 i! [, I, \! j- U  E3 i- U

. Z- R! f0 O7 c7 k) NHere is a quick description:
  t7 k* A3 n) [) _9 S-AX = 0910h   (Display string in SIce windows)$ U" p7 h' S3 O3 R
-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)
' V5 S0 P6 Q% S$ ?-AX = 0912h   (Get breakpoint infos)5 }+ s$ c' ]( H6 e5 e
-AX = 0913h   (Set Sice breakpoints)9 [5 p; I. M) J: \
-AX = 0914h   (Remove SIce breakoints)
; x2 M: W+ @" n+ \3 L" t2 @& I' ^! f$ r2 \  B, w
Each time you'll meet this trick, you'll see:
) J- x) z  x. y" z8 J-SI = 4647h
# ~; C& Q/ Z  `% d& j8 ]-DI = 4A4Dh# j8 W0 I. n+ @2 c. }
Which are the 'magic values' used by SoftIce.
, M$ z" X8 }: A) k5 ZFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
0 U4 O% \1 T% Q) A7 r7 C( Z5 I8 c5 u$ C" q0 v/ a9 }
Here is one example from the file "Haspinst.exe" which is the dongle HASP
) p3 c8 g% l. |( U  fEnvelope utility use to protect DOS applications:
0 A4 o* c$ `) I0 Q( H4 w0 m" \+ D  u; n
0 k) }- P5 o& n2 R+ L+ O* B
4C19:0095   MOV    AX,0911  ; execute command.
7 H) L0 `+ W" j3 c& H4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
" n3 R3 f% M" d$ z+ g4C19:009A   MOV    SI,4647  ; 1st magic value.8 F& a4 `* z9 P9 X# W! h8 N( W
4C19:009D   MOV    DI,4A4D  ; 2nd magic value.
4 n$ J( {* N3 e+ T$ [7 P8 }4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
6 s( l! [! O! e* J4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute
! u; M( V3 M  Q4C19:00A4   INC    CX! G" z1 l% v- D: u+ L& A6 j' ~
4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute3 V3 ]+ h- E, N* w* q
4C19:00A8   JB     0095     ; 6 different commands.$ C' q; ]1 Y4 q: D
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.# l3 [0 U/ H9 }  F+ e* M
4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)
6 V+ k  s' c! x; W+ ~" l/ Z7 o  x/ z. w# m7 Y: C2 P
The program will execute 6 different SIce commands located at ds:dx, which
2 _! p' L+ ^7 q$ L/ `1 vare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.9 T9 e( }9 m0 T8 |5 U. ~
3 Y3 h+ t1 l5 u  T
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded./ Z! Q' D5 u; ~& o
___________________________________________________________________________
# u: t5 Y; I  m; k; W5 ]+ W% ~
4 k9 [( ?7 u' s9 ]" m: m  o) R+ e$ B( |
Method 03' @7 S" V4 q- F* D. k
=========
9 l2 x- l# ?! X4 M' }9 y
4 j$ p3 X8 ?  H& }' }# FLess used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
5 E( Q! b( G: f# Q(API Get entry point)4 P, z: T6 e" V. P( x
        
3 n$ J+ f( G; Q! e1 g5 I- V! ?+ _/ @
    xor     di,di
  K, F8 S6 F* K& z' H; K( k  {6 |    mov     es,di
5 T3 e. b& V1 Y, M" c    mov     ax, 1684h       - ^8 k/ V3 y" o3 \4 W8 q! g
    mov     bx, 0202h       ; VxD ID of winice4 n' ~% \9 t# W! P8 u8 J8 E
    int     2Fh$ ^; M: k& Z/ q1 a# O; S* W0 B
    mov     ax, es          ; ES:DI -&gt; VxD API entry point& @% T* P( p+ ?1 w' C) ^
    add     ax, di/ l8 N: c  @4 O! D, H% y0 }" n9 S
    test    ax,ax
/ z' p7 [6 g- N    jnz     SoftICE_Detected
5 u* c* Q; N; R, F) u3 j" W8 g# R' X/ c  H( T' q: j
___________________________________________________________________________0 ~2 z8 O, d. I
9 H) |% d9 {2 P) ]  |6 A
Method 04
3 ]" J# t  Y# F, |6 g' Q=========0 C2 W' X; @8 s6 |9 _$ j3 [/ {
2 W$ w9 c3 e8 a; a! Z6 ~
Method identical to the preceding one except that it seeks the ID of SoftICE
, c) T) n0 q7 J1 @# N- W- O& F, _GFX VxD.
" O/ }5 ^0 U. W7 P  i/ w' L; K( W% s: Z: V5 f* T
    xor     di,di* F5 p6 h* O, A# r; K9 K2 q
    mov     es,di
9 _& u9 L1 l# l" w  u$ @8 @! _$ y    mov     ax, 1684h      
( a) _  v& B9 E, V. d+ F    mov     bx, 7a5Fh       ; VxD ID of SIWVID) s- `! U: ^1 |$ T9 M
    int     2fh4 q: i( s& O0 Z$ N2 ?
    mov     ax, es          ; ES:DI -&gt; VxD API entry point" |" }) i) h- B1 o* q9 H
    add     ax, di# O+ |1 g$ Y1 J1 t& U0 s. K# i
    test    ax,ax
( H" c. I3 p/ |* y    jnz     SoftICE_Detected
" R. d$ O' W2 [+ i' P% Y9 G" v# S6 G! J( [& o3 a
__________________________________________________________________________
" ~, h/ }' K( ?* r  E- N; s# X. Y. y! X4 o
, ~2 C' s. Y/ X- j% v! j: N
Method 05
) d1 f/ s: w# f. F=========
3 ]. ~2 j5 F3 F2 i9 X  t  Y) }- B! c# x! c0 h
Method seeking the 'magic number' 0F386h returned (in ax) by all system
/ _5 [. ?8 N4 F, ]% `( pdebugger. It calls the int 41h, function 4Fh.
. `. C8 i. I0 L! rThere are several alternatives.  1 C4 i* ]  C  A# ?  f, _

. |3 ^/ R/ L8 I. l% m3 R% i# {3 ZThe following one is the simplest:; E! w0 ]) s+ V, B& s( a# D- C
' h0 K- u1 k' l
    mov     ax,4fh5 {+ b  d2 G, ^
    int     41h8 z8 z- f2 ^% y0 B6 N& \
    cmp     ax, 0F386
3 i$ Q. [' _# i    jz      SoftICE_detected
1 p% b4 Y! B: o) G5 V: s6 M9 G5 A$ T; W4 m/ x, Z5 G
" D* f: I7 Z; _# Z0 L  @
Next method as well as the following one are 2 examples from Stone's
1 d! M: `/ Q2 ]+ C6 t  i1 r$ N% F"stn-wid.zip" (www.cracking.net):
9 P, Z7 |! _; o! \* d! t  i: U0 M* D# k% `. q8 B2 B
    mov     bx, cs( Y8 R( a& R8 K0 k2 M2 Y
    lea     dx, int41handler2( K" P5 f- G, t2 K& O6 }
    xchg    dx, es:[41h*4]
# B: `5 X: B) v& _    xchg    bx, es:[41h*4+2]0 I2 E1 y8 ?/ u, K
    mov     ax,4fh- e1 v2 h6 N3 ?  p" x
    int     41h* J7 d) |; P% R! Z6 h1 @) ?  K
    xchg    dx, es:[41h*4]# P) s& J! m% r1 x
    xchg    bx, es:[41h*4+2]8 P( n7 F; B2 f; J! V
    cmp     ax, 0f386h
4 _# x: c% y* o0 y6 I    jz      SoftICE_detected9 A. l: @1 d+ Q; F
* r) r. H+ W4 B9 F' m8 b  f2 |
int41handler2 PROC
: M5 [# ?3 s. j1 N4 O0 x+ z    iret8 W5 I/ N  b0 G; U0 |+ f
int41handler2 ENDP/ Q" _2 n6 z. u, f; `
* t1 u3 n1 [4 Q1 y

- i; |% {! u- _- W_________________________________________________________________________; v8 t3 |* e6 J: X' |8 X+ G' J# ]
% R% r: D! s! U

. ~. v& |9 z  e4 z4 UMethod 06% D$ {! z2 m+ Y
=========
- I. z' Y/ S" s6 p5 T9 u7 V2 ?$ D- o$ o, }/ f& W& N

4 H6 |8 x* v. I8 z& C0 D* Y1 k9 h+ q2nd method similar to the preceding one but more difficult to detect:! M& `: l/ ^+ u

! G( m& Z2 I; t2 y$ C: n" D& v6 e3 }, d; E6 h7 _5 ^* }) N
int41handler PROC! f% v3 k3 F# K
    mov     cl,al
' R1 [2 N% V$ T5 o* Y! K5 |) j- |- U    iret  w8 |5 ^& x+ {9 {
int41handler ENDP
- U, T, M7 I* P1 j; ?1 X
. v, @7 ?- L9 h2 ?2 o
4 U) D. A" e( }6 x& }    xor     ax,ax
5 b# N1 z  S. f) f    mov     es,ax
( a' J+ o' m/ S+ F3 m    mov     bx, cs
5 D6 s+ r6 M$ [% F" U: Z. E    lea     dx, int41handler) L- K& C4 _% d) P  m$ ^! e' N
    xchg    dx, es:[41h*4]0 h+ @4 a1 e  H8 x7 }
    xchg    bx, es:[41h*4+2]
1 I2 D' E" k0 i. E    in      al, 40h
( A- |6 i% ~# l) `6 T    xor     cx,cx% A% n% s0 L9 S- C  `
    int     41h5 e# ~7 S: J+ m% ~2 S! S& k
    xchg    dx, es:[41h*4]! f( l" x$ @6 R+ `8 P
    xchg    bx, es:[41h*4+2]
  }" w8 S5 [; o2 J" l& U6 C, f    cmp     cl,al
$ D  E, W+ s( \$ ~* b    jnz     SoftICE_detected
2 M4 K0 h( H0 a* p# n+ m% B* g+ z. G; ^; [
_________________________________________________________________________
/ b1 f) ~! s2 D) a7 G
! b9 b9 t! e' {( E$ m" s0 ]/ ^3 t6 ^Method 07
0 F- u$ @" T4 C& `& M! u# i. V=========
5 H9 n, p( G- Z9 S. B
" E( t, Z$ o3 f7 DMethod of detection of the WinICE handler in the int68h (V86)5 T+ B7 L' E- t% G4 ^# G( s
9 I! |' E7 H% ]! ^
    mov     ah,43h
. f- M" N4 A1 r3 e: x$ k% T    int     68h. _" M0 I% u! V" o4 l
    cmp     ax,0F386h2 d, F8 l3 U! S& c1 U! s
    jz      SoftICE_Detected6 Z  W4 Y. c* c2 R& M! e

7 ~2 w6 ~: K# }! p1 n$ S7 P
1 @, V% d* E- L# g& Y9 {=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit$ B2 @' y% W. D" P
   app like this:
0 s  S8 f* E% E. ?' E* Q
: T! K6 o6 ^5 ^- s; V   BPX exec_int if ax==68
. E: Q2 B* y2 y4 _   (function called is located at byte ptr [ebp+1Dh] and client eip is% H& H4 j5 I6 y( T
   located at [ebp+48h] for 32Bit apps)
/ k) x# z6 j. M: L' K# a__________________________________________________________________________
5 R. i4 {" O, S
% L2 a7 p8 m# x* ]% L/ Z# Y
5 t9 I/ O6 r8 M9 u# D# u9 H1 eMethod 08
! |& j! H" Q% j) q& [- M2 d5 ~+ a=========
1 f6 I- [7 N4 j0 c3 }9 y# Z
1 b! B2 Y5 ~/ U! mIt is not a method of detection of SoftICE but a possibility to crash the2 y2 L9 K& ~$ q2 ~& H
system by intercepting int 01h and int 03h and redirecting them to another
' b( O" A1 ]& y8 ]routine.
7 W! Z* i8 y& Y& ]It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
' F# `( j3 f: G. Lto the new routine to execute (hangs computer...)
+ S- t" E' C. c( j) m5 V& e# D( n6 S, z
    mov     ah, 25h
7 ]  m, Y) D6 H7 R  x    mov     al, Int_Number (01h or 03h)8 k: q, x- R3 N7 _6 e
    mov     dx, offset New_Int_Routine
" H  Q! \7 R+ `. |' b    int     21h7 Y4 o' G% x5 S: }! \$ q

) D: D5 V" `% z! _! ~& f! O__________________________________________________________________________
8 k8 O' ~, {1 O2 E" T. {9 u4 w9 }' q! a7 {
Method 09. `' W  U' N& U" t+ U5 d
=========/ m* J1 u5 K, K: ?, p  j+ [
4 W5 J4 D7 A, i$ V7 G$ n
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only% X5 f& `3 }. t6 Y" }
performed in ring0 (VxD or a ring3 app using the VxdCall).
3 U* Q) z, q" kThe Get_DDB service is used to determine whether or not a VxD is installed) M, {. k/ k7 F# `0 i4 Y" U7 f
for the specified device and returns a Device Description Block (in ecx) for4 w" B6 c6 v0 O5 A8 m5 O
that device if it is installed.
' G- D9 A' z0 b- q* A# p4 D/ N+ @1 j$ i2 Z
   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID% I* R3 {$ {; u( P; l
   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-); _% t( M# F0 D+ |  S
   VMMCall Get_DDB
7 U: O6 b- [! Z, C  h   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed! S' `5 g) \- @& ]( c6 N& h& C
9 y6 H* z9 a: Z
Note as well that you can easily detect this method with SoftICE:
; `, s- x7 q4 x, ^3 i$ p   bpx Get_DDB if ax==0202 || ax==7a5fh
$ F7 e9 A5 J  T6 E& l7 t+ P5 [8 }* e9 x& d5 s
__________________________________________________________________________
4 G& i" p& ]% U  R" w' G% L" Z7 w3 {- R; D# g, t9 `* \4 ~
Method 10) F% \: y1 \1 L
=========
" @5 L* s4 a8 P
* ~, Z6 a# f  C+ S* f=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with7 b' t. y4 W) n! b+ n- Q' c9 O/ T
  SoftICE while the option is enable!!
. j* o7 E: [1 l$ x9 D3 i  w
, R4 o" j4 [+ k) L% w* X/ BThis trick is very efficient:
/ [& F# V6 N5 L( B& Vby checking the Debug Registers, you can detect if SoftICE is loaded
) b# A( n2 u7 l+ `1 G(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if. G+ L) H" W& b  B8 }2 H9 E4 u$ k
there are some memory breakpoints set (dr0 to dr3) simply by reading their
# A- o; Z5 N0 z* T3 d) M; h" R( ?value (in ring0 only). Values can be manipulated and or changed as well0 C" t3 d1 [7 Y8 Q
(clearing BPMs for instance)
& ?+ u5 {8 i& k6 n8 _+ ~/ y& d3 B* y5 b2 z2 k; k* ^- p" Z
__________________________________________________________________________
+ _, H1 S& A+ e4 Q4 R% ]2 ~# c' X8 ]; A/ {
Method 11
) q) p# N9 `4 |/ X9 T* Q5 ]3 d% P=========3 J' I/ v; F8 o

' J) m, K: d1 k! WThis method is most known as 'MeltICE' because it has been freely distributed9 w3 D. O/ a0 m, {/ {
via www.winfiles.com. However it was first used by NuMega people to allow
% z! A  u) c- GSymbol Loader to check if SoftICE was active or not (the code is located
4 H4 V4 u. c3 b+ `& S9 rinside nmtrans.dll).
& Y+ T5 P: u  ?1 @
" ^/ r4 |1 Z/ a4 c; K7 lThe way it works is very simple:' r7 h* M- [0 a! K
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for- ?  s2 ]& t# M( I! A
WinNT) with the CreateFileA API.
1 W3 _" N( I! X& m3 Y& I
- L& O* Z6 m- ]; }) _7 Q* \% jHere is a sample (checking for 'SICE'):
* x8 [8 h4 O  b* M5 {% l( S1 q' v. Z4 L3 m: J+ y: ?$ S6 ]
BOOL IsSoftIce95Loaded()2 c9 ~. |* d4 \' @, s
{4 ?" T% B. z/ E3 ?- L
   HANDLE hFile;  
( V* f0 R" e0 f9 |   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
2 ?" D; ~& P1 R                      FILE_SHARE_READ | FILE_SHARE_WRITE,
& d" P2 [$ k; [9 l2 I8 d* ?                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
2 B8 \! [* N! ?" e, H; \" k   if( hFile != INVALID_HANDLE_VALUE ), P4 @# P( t: h; H
   {9 D! c& h3 p3 |' x3 j6 L
      CloseHandle(hFile);
) |8 l8 P! N7 L. l3 w" K# I      return TRUE;
: N  g% H- l" m3 \/ c   }' T4 c! l* }7 X8 G) Q1 Y/ F1 j( `
   return FALSE;6 t/ A* y: H3 o, o, T' P6 N$ L
}
4 ~2 |" L3 D/ x) z. h5 {, O% f; ]- K# E' }" y
Although this trick calls the CreateFileA function, don't even expect to be
: B! c, T3 j: U: t, w" k" P2 K7 sable to intercept it by installing a IFS hook: it will not work, no way!8 L: D, i! p$ D. e% w
In fact, after the call to CreateFileA it will get through VWIN32 0x001F" x# X5 T4 [) \/ x* V9 u
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
% [  s* V2 y8 w+ d; I6 I0 A6 O5 D% pand then browse the DDB list until it find the VxD and its DDB_Control_Proc- r. z( z" Q; q5 Q
field.' }* Y  ^6 K$ Y+ W5 ]' h+ W
In fact, its purpose is not to load/unload VxDs but only to send a
, c& @% J- ^1 L) v' a% y$ WW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)7 {. l4 C4 t! H
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
" M9 G  b' p2 t1 D- P# E6 X/ p3 lto load/unload a non-dynamically loadable driver such as SoftICE ;-).
. N! |% z& j: P7 V/ PIf the VxD is loaded, it will always clear eax and the Carry flag to allow( I2 i. D, ]* c/ l0 {, `2 F! |$ a
its handle to be opened and then, will be detected.3 ~$ Z/ {( d: a$ D
You can check that simply by hooking Winice.exe control proc entry point
9 K1 J3 n4 T" zwhile running MeltICE.' D9 l% n8 x2 S5 y$ q( M( O! @
9 J: ~. z% a$ Y, {4 h: T' O
" X9 H  F7 |8 [! `; |7 l' P8 T6 f
  00401067:  push      00402025    ; \\.\SICE5 Z/ t- W/ b1 j  _) s
  0040106C:  call      CreateFileA0 A% O1 \7 [) \- {# A: h/ D! Z* r4 h
  00401071:  cmp       eax,-001
! @; j) d. ^0 ^5 e) i# `  00401074:  je        00401091# E! r6 ]* e/ l6 p9 d! B5 I3 s0 G( H
+ m# l' y$ K8 x' S$ C

4 q! ?. h- |/ n5 @' _- QThere could be hundreds of BPX you could use to detect this trick.
# Y6 G& S  B' \; P* f8 I0 A-The most classical one is:1 q/ @4 M6 X& j  Z
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||1 \4 `. e5 ]1 N* K: Z# d! O
    *(esp-&gt;4+4)=='NTIC'; i  C, ^9 g* M

3 K# d, B! l% s; o/ |: Y-The most exotic ones (could be very slooooow :-(2 e8 i7 s+ u# q) U* d
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  
, r, ^4 `4 ~) `* H0 P) |# Y% f     ;will break 3 times :-(
& ]) X1 D8 I2 x5 i
4 {8 v' r* p, }: C, x$ o3 k-or (a bit) faster:
3 X/ h2 u* V/ N6 _* s, [! C0 b   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')9 \1 V2 G; B- K8 C$ m& D
2 J1 }; b4 f1 K0 W$ W( {. I& n0 G
   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  
/ D- S/ [! g8 M; |0 v( H$ Z     ;will break 3 times :-(
7 s( K8 {: j7 `, d& A. j9 ?/ a3 P) c; G% y. F( G2 `- g
-Much faster:; D& K$ [8 G2 M0 L; Q
   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'! {0 [  w$ \1 g8 ~$ r! m
! C5 Q* M3 [; A% \. g+ V
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen% v' C8 \6 [, @2 x+ S1 @; v
function to do the same job:7 E# m, H+ v% N( d$ l8 R5 X) w  x
$ J& s1 Y" x  k" X0 C
   push    00                        ; OF_READ
- W- ^4 P7 S" I2 a   mov     eax,[00656634]            ; '\\.\SICE',05 |+ g  O9 C, q2 G6 c. F  w
   push    eax/ Q& q4 k8 u. `7 h2 v' s, o
   call    KERNEL32!_lopen
. b# e/ D" T) y/ ]) n  |   inc     eax
% D8 d0 a# t$ m" W( D5 F   jnz     00650589                  ; detected' \8 i* u7 `6 C  H2 d
   push    00                        ; OF_READ
6 J" }$ Z* k; f1 m' D# x- U5 Y   mov     eax,[00656638]            ; '\\.\SICE'
+ L- `3 y& }6 X  H4 r   push    eax
- g! e) i2 X* S" _8 K   call    KERNEL32!_lopen  K/ f7 ^  Z- o$ _
   inc     eax* Z! t, E! ^1 o* C9 B
   jz      006505ae                  ; not detected. }( d! B$ I% m4 g
' q$ D$ Y$ ^; q7 q. F

  D4 a. c- q) `# z- p6 ~6 `6 L__________________________________________________________________________3 f/ B9 m! ]" L, _3 D

7 k3 ?) {3 M7 j, G3 T$ ^Method 12
1 o8 R9 \, q  I5 S=========6 o0 ]1 b/ @) [3 ~) |: Y! \
# l* n, y5 `- [% ^( o
This trick is similar to int41h/4fh Debugger installation check (code 05
0 c( t+ [8 n/ S! m' {7 ]&amp; 06) but very limited because it's only available for Win95/98 (not NT)' F3 |. b3 |) J- o# q: g" I+ v* u
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
6 o/ |$ F% Q& v
" {4 l9 F' d# q% n% P   push  0000004fh         ; function 4fh
' o2 o! x3 p7 E, v5 ?6 r3 @* P   push  002a002ah         ; high word specifies which VxD (VWIN32)
; u- E/ y/ l7 u                           ; low word specifies which service8 p" N# P. d. u: t4 D5 U: \: R
                             (VWIN32_Int41Dispatch): M- T" e; [) j; g1 a2 B
   call  Kernel32!ORD_001  ; VxdCall  t: l3 u+ y0 u6 p
   cmp   ax, 0f386h        ; magic number returned by system debuggers- {9 ~& X$ i) d: `" r4 }
   jz    SoftICE_detected6 W; |+ X: Y7 k: }7 n- d

1 g& W: a8 Z4 s, o% S$ W) I2 CHere again, several ways to detect it:
5 K  e5 m. {; \& g  r
; `: ?4 f. a! p+ ^+ J    BPINT 41 if ax==4f
) t, K3 D& V. R- g! Z/ Y* E% P. v, |0 ?+ Q
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one- Q2 W9 h  b6 E# {

" ~4 R4 K8 J& n2 u/ q8 Q0 z    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
( T* `7 Y5 g- j: W! P0 p& J
8 S/ ]4 Y, O2 r. w7 C' Y    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!
; l, F+ N6 d  ]; d0 d6 g: j% S* Y; W# n# d1 G$ d
__________________________________________________________________________
- @3 M: J+ Y$ p3 s8 @; w6 x
! }$ F7 K, M3 ~1 ]Method 13) A& g; J+ J9 G! D/ ^3 P. {1 D
=========
% R, P$ h. j5 [, ?2 }) ]) q! c& d' B# n: ]7 _
Not a real method of detection, but a good way to know if SoftICE is
  T8 G% |4 i2 i( ]4 c# q* tinstalled on a computer and to locate its installation directory.
  G8 e$ f6 Y; Z( P5 N. ?7 RIt is used by few softs which access the following registry keys (usually #2) :
1 {) s! w  N" Y7 T* J7 E
( x: y/ S4 v, r, a( X-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion& X$ Q) Q* j) O6 A8 a, O
\Uninstall\SoftICE
$ \4 n& Z& y8 f1 c' d) i* U-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
$ {+ n. N4 R$ s4 i5 z2 ?1 }-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
6 x, f6 }3 t5 ^! t9 e\App Paths\Loader32.Exe! T+ Z* O5 [4 |& W
0 b1 q( G9 }/ x. k
3 w/ P! O( B! [0 K9 m! w! W
Note that some nasty apps could then erase all files from SoftICE directory
; M, {$ L* ]" O" F, C( ?(I faced that once :-(
* p( F6 a6 i- Q) M* Z- ^
8 I% [5 Y$ Y) e& LUseful breakpoint to detect it:
3 w$ c( v! `( o, Y4 d' U+ c/ }  R! E5 ?) b8 Q2 a: E' L( x* R5 _  r3 [
     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'$ g0 ?, Z3 H  @' j* D

% c; ?1 n1 F* Z0 e3 T) h4 ]__________________________________________________________________________2 y/ l3 m( L' q; b/ F; i
! j& f, \; k" @# }
, t( Z8 }+ K7 v* q6 o/ Z- O0 ]5 }
Method 14 1 }2 g( N! g: t! F  B: q2 _- ^
=========; p# Y% `9 X6 c: ^# C" l

8 n+ W# j' x! ^1 C% AA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
4 R) y) `# D2 [$ |+ bis to determines whether a debugger is running on your system (ring0 only).% e1 L$ F$ E1 K

  w' \0 U, M. O   VMMCall Test_Debug_Installed
/ h% Y# H- ^1 l  T   je      not_installed
4 k+ G! P& m* `/ }  j
5 m8 T+ N0 I* S. A/ [8 HThis service just checks a flag.- P/ K5 X( a* f' R
</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|本地广告联系: QQ:905790666 TEL:13176190456|Archiver|手机版|小黑屋|汶上信息港 ( 鲁ICP备19052200号-1 )

GMT+8, 2025-12-22 05:57

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表