About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
' o! K; C/ h1 r: r8 ^8 t! s9 i<TBODY>
& g" I/ G7 `7 @) K<TR>
6 t1 v+ O. j1 r  |<TD><PRE>Method 01
- U/ o  P" l; d* p) G( o8 O9 @3 ]0 K=========  g) d3 A( q5 Y" z3 Q- H3 {

( c4 U# o; ~' R$ h  OThis method of detection of SoftICE (as well as the following one) is
. W' x6 G' V. O" Vused by the majority of packers/encryptors found on Internet.
% d7 S1 N: K: U; ~: g; D6 L' J' xIt seeks the signature of BoundsChecker in SoftICE
8 W; `2 S, m, W+ I: |
1 F4 ~( ~# Q( m6 \' W' }% K    mov     ebp, 04243484Bh        ; 'BCHK'% z& y! l/ z# q: C3 Z% b; `9 j
    mov     ax, 04h
- v: a9 N; W5 x) u: ]2 B    int     3       / c- J& q0 Y/ P7 p; S
    cmp     al,4# w  W2 i; A1 }! m' R8 w, s
    jnz     SoftICE_Detected2 u+ y* S. T: ]6 S6 ?

* g% e! ?/ Q, Q5 B( A% Q___________________________________________________________________________
. }( Y4 ^! c2 P5 Y2 }; W! D7 b8 Y% Z2 M' [' K1 U( }6 D& V6 @
Method 025 p+ x* U; [" x/ }- Z5 f
=========$ _0 U, H5 a, R9 J# G$ |2 I
/ G7 x  _$ K: P. D* m
Still a method very much used (perhaps the most frequent one).  It is used
0 p5 s- K4 o* qto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
  o# A% r, n" t: s  _or execute SoftICE commands...
' s( v- p4 ~. W$ ?! Q% S% O# E* Z" I# uIt is also used to crash SoftICE and to force it to execute any commands
- @' S3 O+ J- k(HBOOT...) :-((  ; O1 B' l. s# o3 j$ z& f4 W/ B8 y; d- i

% i; x, a% N/ I9 MHere is a quick description:+ A4 Q) s- |: j% B
-AX = 0910h   (Display string in SIce windows)
1 s5 U3 ]% f! i8 m  Z-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx): v7 }% N8 C0 q3 x. U9 u3 n
-AX = 0912h   (Get breakpoint infos)
+ m8 o/ d- t2 ^1 W5 E4 [6 U-AX = 0913h   (Set Sice breakpoints)4 K9 i7 o9 H' s/ x
-AX = 0914h   (Remove SIce breakoints)
& F! |* n! x; T/ O! P% y' u& n9 {
1 K' u, B$ X+ W) }6 SEach time you'll meet this trick, you'll see:* E. F, X4 F  Z* N9 R1 _* x) n
-SI = 4647h
' m6 E  U  E7 [, e7 j-DI = 4A4Dh" X- x4 o" e  z3 T' U2 H
Which are the 'magic values' used by SoftIce.1 U6 i. m+ Z( f. j7 K# Q
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
; e& e0 C6 Z# \2 p1 _. B- Q
& i: ]' I8 m: F( ^, h# Z) LHere is one example from the file "Haspinst.exe" which is the dongle HASP6 q: s. \: q6 p0 L) o
Envelope utility use to protect DOS applications:
( s$ d' V: K  P/ w) C1 |: j. U- \  H2 B8 D

0 P1 E. k9 l& _8 l% S& w) v4C19:0095   MOV    AX,0911  ; execute command.
0 i8 N2 n# |" ~4 @2 |4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below)., ?9 f2 d  I* Z2 w
4C19:009A   MOV    SI,4647  ; 1st magic value.
+ p+ H9 K8 K1 L& Z1 O4C19:009D   MOV    DI,4A4D  ; 2nd magic value.3 D" ~, T, }) F& Z, S1 j$ U
4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
/ l: O7 U$ e1 J, `0 x7 Q. F2 ?4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute) s) s: L2 k% o( K; x' `7 U
4C19:00A4   INC    CX
  U: {) ^" v6 W8 W$ v4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute* I, ?* ]( i  P: M: n0 ?1 f
4C19:00A8   JB     0095     ; 6 different commands.
9 y+ i$ E" ^9 T, K- |( M; U& {4C19:00AA   JMP    0002     ; Bad_Guy jmp back.$ K3 D: O  y2 g: s8 f) u0 C
4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)
. q. T) T: ?2 F6 e0 e8 j" t8 ?+ y0 I8 H
The program will execute 6 different SIce commands located at ds:dx, which
; z3 ]6 Y5 r: c: {" Lare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
2 X! N9 T/ Y2 `9 S$ `# a. w4 V9 n# c0 s
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
4 _3 I! O, `) \/ V___________________________________________________________________________
  w6 r# N9 j, r& a+ c% W8 o
1 j- Q! D# o% y& p  o, D- R1 p
9 m! y# e5 T* l2 \Method 03$ ^1 p8 H; ]! A/ o4 u4 E% h/ O
=========
8 U) {" s% ?" Y7 N4 f
' @' z8 A5 f. Q- F. N5 JLess used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h+ }& O/ T, d$ b& _; F( r( C" E
(API Get entry point)
) j& O5 E2 M9 B6 P        
4 B/ K$ A/ y8 M" ]& H' }0 ], w1 e+ t' j* D* y
    xor     di,di
1 i. G/ c& Y) c# h, X8 z+ D    mov     es,di
- F% Z- U+ V8 N- u  O, }' q    mov     ax, 1684h       5 t: p- h+ q  p
    mov     bx, 0202h       ; VxD ID of winice
8 O8 u8 k( z7 O7 ]* |% p1 v  t+ E    int     2Fh; J5 G% y9 i& x& C. K
    mov     ax, es          ; ES:DI -&gt; VxD API entry point& S6 W1 ]9 t" X
    add     ax, di
- s& [# v% B2 Q+ t1 T. h    test    ax,ax) T  |  J$ f+ G+ H2 y% o* R+ ?
    jnz     SoftICE_Detected  _; I( X; L2 ~; E! F

7 P) l7 o7 M" }4 x: y___________________________________________________________________________
' e  N$ }0 l2 O' d0 c7 V6 h7 _3 z, L) b0 \. i8 j
Method 044 d3 `' Y) i4 e7 V  I% I4 a/ ^5 H
=========
6 o7 R2 ]' r* t' j+ d0 T
  `7 ~# j  o1 r% PMethod identical to the preceding one except that it seeks the ID of SoftICE
3 J6 b- Q4 _& k) p& s7 [& Y- yGFX VxD.7 v* q7 D  C4 V. k9 M3 P5 `$ f

7 D: j/ K* F# A0 Y8 l    xor     di,di
% t# w5 |1 p3 q- p: `, P    mov     es,di
" u+ g: @" m  k- W' P    mov     ax, 1684h       " n0 u$ B( Z/ Z
    mov     bx, 7a5Fh       ; VxD ID of SIWVID1 J3 n. B- @& c5 _; C7 o
    int     2fh
# k& ]$ X5 ^" s    mov     ax, es          ; ES:DI -&gt; VxD API entry point9 z( F7 a, O5 P: p, `
    add     ax, di
7 }1 ]: d: P; i% [    test    ax,ax
) D7 e; ?& U6 y# i5 W+ U    jnz     SoftICE_Detected
3 I* R% [$ j+ _4 d5 _* l+ c0 F
* O# s& }$ x0 y- f__________________________________________________________________________; A. O8 {$ X$ ?" B$ a
" E5 H7 w! z6 {5 y8 `
* b" W# D  ^/ {% [- X7 m
Method 05
, O, k* |% K  E' |; {: i; s=========6 t" K& ?% }1 F; r* M

" w4 W1 X; M$ R( x! RMethod seeking the 'magic number' 0F386h returned (in ax) by all system
) u3 A" n5 Q3 }) y+ ?9 J8 T$ V2 D' g- wdebugger. It calls the int 41h, function 4Fh.# e4 Y7 Z# b  }6 j- V) B
There are several alternatives.  
' S0 V; Q6 j- `( ^5 b4 Y
4 `$ x+ R/ g9 p# ^0 |/ IThe following one is the simplest:( H! n3 x0 m% `5 v; q

% h$ S! J: d: a  m! f    mov     ax,4fh0 z; q2 ~% ]9 Z. Y1 G1 H; a; U
    int     41h" Q; j& h; e# k1 p  I% O
    cmp     ax, 0F386
* G( @/ O7 _; K9 [; c: {2 H2 m9 n    jz      SoftICE_detected) l1 K0 R6 P0 u: e; a

& |( B3 {/ G1 [& X: ^: N: |3 c" g9 ]* Z& i' {0 {' j
Next method as well as the following one are 2 examples from Stone's " f( q; G9 `+ y, n' w
"stn-wid.zip" (www.cracking.net):& E! p' Y( }" w# m) x9 f
* b4 _& T2 ]. i9 U1 M$ }) C
    mov     bx, cs
2 _1 c0 R" f6 A' j5 O' [    lea     dx, int41handler2
' R9 A1 F# L: V/ \  o: H    xchg    dx, es:[41h*4]8 P( Y+ g& P% s
    xchg    bx, es:[41h*4+2]
5 O: Y% U: f0 C    mov     ax,4fh
. G; x! M( {. N1 L2 E7 T0 ^    int     41h
* M3 v0 |, s# o4 |8 S    xchg    dx, es:[41h*4]3 r! Z/ V8 p0 s3 X9 g
    xchg    bx, es:[41h*4+2]1 M% u/ K* w, {1 d6 V. p* w
    cmp     ax, 0f386h5 I- V+ d# o/ t4 m
    jz      SoftICE_detected( {- M3 n$ K% ?! V9 G: G

) t+ U! O2 H( C) R1 Z% ?int41handler2 PROC8 Z$ Y0 Q0 s3 I0 r0 z% s# }
    iret
6 d, P& a# z' J# K& k; S6 ^+ Rint41handler2 ENDP  y/ Q, u# l& u% r  ^$ H

1 E+ q: _% \6 t2 g: v
/ D- d0 P' ?1 h( Z8 L_________________________________________________________________________
7 x2 Y6 ?4 q, T8 `5 o0 X, n, C7 t7 M$ y" v7 D6 O

5 _/ u8 z! S3 N3 ^7 H9 xMethod 06
6 e/ u, W: F2 {) A) _9 v! c=========3 T1 L5 o1 R$ b- x& T& Y" ^5 N
5 j9 Q+ ], m0 i: D# w0 I; L

# v/ K$ L, G1 C! p7 j5 C2nd method similar to the preceding one but more difficult to detect:
6 a. a7 V$ Y0 l3 k( ?8 I% ]$ ?- Y1 i7 e
8 q- R  W; u& Q! S; f
int41handler PROC; j- R6 m" b# X) H+ |2 Q2 z
    mov     cl,al  k1 a. y$ J0 j, O7 _+ S
    iret( E( Q8 S" p2 _9 N" s- U
int41handler ENDP* ^' S3 o2 j- Q1 F7 p
9 G; H7 @9 p- X, f( b3 F

6 I3 a) N2 M8 }9 b    xor     ax,ax1 u/ D0 x* M$ g' \  A1 i
    mov     es,ax
% T) b! o2 n9 I9 q5 I5 a1 j0 \    mov     bx, cs, t  W$ x3 Y+ |3 h! {! A/ u
    lea     dx, int41handler
9 H2 ?  o* x+ o! Q/ {( y  l    xchg    dx, es:[41h*4]
( l1 R) ^5 F  q9 e2 e    xchg    bx, es:[41h*4+2]- w* _* K3 H- J  U& B, B8 ?
    in      al, 40h* o" J' R3 ?' v5 a2 L
    xor     cx,cx: {; o1 o% w, W' A1 D4 D& V
    int     41h; E! _: u+ b  p! ^1 A) G
    xchg    dx, es:[41h*4]
: v, ~1 F) [7 u1 E' c% b. K$ X0 |    xchg    bx, es:[41h*4+2]
6 S1 z/ [: F1 J. F$ i    cmp     cl,al) d6 S  x! `: T/ o1 s6 {+ O4 F1 W
    jnz     SoftICE_detected. J2 g0 J$ I7 K; m
" c- O5 Z; `" u' p. R% }7 |& f1 P
_________________________________________________________________________! l$ U8 J, {* |2 Y0 b5 V4 |

3 p  A& ]4 {7 q0 @: U3 z+ z; L$ ZMethod 07
( w" _/ x+ S( B0 x9 h  X=========( s' q- i% J9 _+ l. ]/ f. @5 }
* Y. ^+ H& R6 }+ @3 l$ [
Method of detection of the WinICE handler in the int68h (V86)
0 T( Z. X; O( g" \, r
' s) ]6 B. u/ o    mov     ah,43h6 p2 w( E) ?3 L
    int     68h% ~) e) H  s8 L9 q' o  E+ O* T5 F
    cmp     ax,0F386h
7 J8 _/ B4 J# w  I4 Q& T2 {7 u    jz      SoftICE_Detected; h* L5 E) T* b

1 z. I4 @( t) ~- W0 \$ _0 N! e& u8 W; Y! q
=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
( g4 C: M7 \" N   app like this:) `9 Y- t, E* f0 ^

* {5 S& v9 d: t) L5 b6 U6 W3 }   BPX exec_int if ax==68$ p( L9 A% u7 @8 B5 B) T, a
   (function called is located at byte ptr [ebp+1Dh] and client eip is
: G; x4 d. J# D0 G1 B4 L0 P   located at [ebp+48h] for 32Bit apps)
  f6 ~9 i7 [- r! S) g* c__________________________________________________________________________
" r8 Z) s/ Z* Z2 z- _* ^) x' }, f: _3 N7 d$ G
1 q; r" z- c% d  a% Q9 b0 [
Method 08$ {+ Z! y* i/ `$ {
=========
3 Z* @- G9 s1 l. d& M) o% H) C
. X- Z+ X* s/ n( N9 F/ |/ V2 e& E* vIt is not a method of detection of SoftICE but a possibility to crash the
" Q* w* W3 ^# N* a# e8 Qsystem by intercepting int 01h and int 03h and redirecting them to another, ^, Y' W5 h0 x8 B7 f, y  O
routine.
2 {7 v% D# B: A+ X% GIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points" U& |/ J6 i' |- ?7 v, E
to the new routine to execute (hangs computer...)8 H# v1 [$ r+ N4 f

6 h1 o: R1 E! N1 D3 H; {    mov     ah, 25h8 v0 B0 y, J8 G2 c7 h+ p' }
    mov     al, Int_Number (01h or 03h)
, }+ Z4 U' V4 [6 M" X% o6 a$ P8 Q    mov     dx, offset New_Int_Routine
0 ~/ `1 H0 i# J* G5 c( {    int     21h4 v! W9 \+ g& r5 G3 b
$ J; \$ S0 e6 \% t4 h; f3 t8 E0 U
__________________________________________________________________________
3 N$ l6 b+ ~: c0 ^' Q- r: A& B
' Q' S. Y' q& d! q5 B/ }7 kMethod 09
8 g7 D- D, _/ @6 p9 c" v=========  z  X* _4 \1 m0 C

# W8 a# C+ k( ?; l5 B# RThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
9 N/ |/ h$ j, S* Lperformed in ring0 (VxD or a ring3 app using the VxdCall).
" P3 j* P& m9 W& D7 LThe Get_DDB service is used to determine whether or not a VxD is installed/ }6 V+ R: L, |4 O# W1 O) e
for the specified device and returns a Device Description Block (in ecx) for8 q8 e7 o- g- N1 |! O! H
that device if it is installed.1 v8 U9 ]8 {% |

3 n! N3 H' x1 t$ t   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID; `( i: p+ o: d' i2 S
   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
- n0 G# X* }+ Q: x; x; ]5 \   VMMCall Get_DDB0 x! Y% Q6 h: E9 u1 t7 K
   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed% Y5 ]; z! p! N4 E! B# Y0 W/ j, V
0 z+ V( _! v, F! R  k* k) S
Note as well that you can easily detect this method with SoftICE:
' m4 X  |( \/ l   bpx Get_DDB if ax==0202 || ax==7a5fh$ B" K2 a7 j/ y# F8 _$ P0 p! O

0 u8 R; Q/ \* \0 f" D__________________________________________________________________________
: Y. Q" \0 Q! T/ }. N$ u' z6 b5 J7 E- s2 d; l- l4 M' Y. j) I
Method 10
( I9 s4 ~& l5 ]1 I=========6 ^6 i2 G/ E( {4 Y

6 O+ X, y/ Q5 c0 H8 X5 L. i=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with  e! j7 C  K4 {1 X
  SoftICE while the option is enable!!# y3 ]' g& S/ _4 C0 F! j
# F+ a$ [8 d; k( W$ q& j* g2 G2 X
This trick is very efficient:
* X7 p, C; L  ~: E/ `: R; Q% N' Xby checking the Debug Registers, you can detect if SoftICE is loaded+ J8 G& d5 p' `& P. M6 r- `- I2 X
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if: @) E) ?3 O8 `3 S
there are some memory breakpoints set (dr0 to dr3) simply by reading their
, P- M, F; M/ D- N4 q( Wvalue (in ring0 only). Values can be manipulated and or changed as well
5 n+ q: S7 g% u" q& J9 f# e(clearing BPMs for instance)
) i; h. G' x5 Q! v1 |! y* r2 p2 h6 |% H, X
__________________________________________________________________________; s: O# N% Z' s# w8 S- l

% A& {3 D8 Y2 t& J" RMethod 11
% J7 j) L. M0 ^+ X. N: ?8 V=========( _$ G/ A# M5 T7 g
& s4 _$ ^, D/ ?8 z8 q# ^
This method is most known as 'MeltICE' because it has been freely distributed3 S6 }, c$ v# S5 R" ~9 H
via www.winfiles.com. However it was first used by NuMega people to allow- l. R) p  D  N2 k( G
Symbol Loader to check if SoftICE was active or not (the code is located
& a9 Q. L. n0 s; v4 ?inside nmtrans.dll).
. l/ ?( Q- L' f& t1 i$ k5 q" T) s
The way it works is very simple:3 z) m" B- ~& M3 x, u8 X: _1 k0 i4 k
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
. s; |8 c9 e: P3 l* uWinNT) with the CreateFileA API.
# a1 q) D# w5 K( ^4 h( Z
) o' N( Q: f) F( [( I4 K4 _4 tHere is a sample (checking for 'SICE'):! J0 m3 D& A/ n

; B: N$ l2 w5 @/ @$ Y% ?BOOL IsSoftIce95Loaded()
/ K$ g- Y% I* r7 T8 `{
( ^4 m( W# d9 d* J- L) s   HANDLE hFile;    V2 y% S, X2 _$ ?- V/ ^
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE," d* ]+ l  c) F5 ]1 s
                      FILE_SHARE_READ | FILE_SHARE_WRITE,
8 l: u, U+ ^+ ~1 d                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
1 I6 }8 f( F  b8 R: b   if( hFile != INVALID_HANDLE_VALUE )
# Z3 _) c# M) F, k   {0 b) I3 u1 r1 D2 Q2 e, F, i3 [; F
      CloseHandle(hFile);
" `* n% O: I# ?/ l8 t      return TRUE;
6 B7 j5 w) i7 x+ P3 s   }8 i: y/ g0 {- Q, h; E+ i$ w, c$ I9 U
   return FALSE;) l3 m4 J) u+ J
}' x) `# A6 F9 h& @* l+ K

- j& |$ H& [1 H/ M, F# @; f, cAlthough this trick calls the CreateFileA function, don't even expect to be
* D$ [0 }- M( W% U% V- s/ h( w; Hable to intercept it by installing a IFS hook: it will not work, no way!
, n' e7 C+ J: a$ t! ?  f! DIn fact, after the call to CreateFileA it will get through VWIN32 0x001F4 a: M/ _8 P$ P5 J) o5 O
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)3 K4 y$ Q. @5 H& I, M
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
1 Q8 f; b0 j0 g( t: z& f; U- X! nfield.
( B* ~2 g- N% L" `2 ^* F$ ^In fact, its purpose is not to load/unload VxDs but only to send a
3 x0 m; D& a+ z+ ?* t' `) F3 E% @W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)" O+ L& Z# n  K& w$ \$ F* z" Q, e
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
6 Y* k7 t, Z3 l" G% }# xto load/unload a non-dynamically loadable driver such as SoftICE ;-).4 K. m$ r/ R$ N0 o# c; i
If the VxD is loaded, it will always clear eax and the Carry flag to allow
  F9 |. N3 R, i! t6 [its handle to be opened and then, will be detected.
! U" r% M4 s9 |1 ~- iYou can check that simply by hooking Winice.exe control proc entry point1 J4 m- y2 e% |; K) S( x. [
while running MeltICE.
2 z% O0 |  T7 d" z6 [9 S# r# |, V3 i5 N7 n4 L' M# }, Q- Q: Z3 k: O
, W& I0 R" x2 B3 g$ q5 _
  00401067:  push      00402025    ; \\.\SICE
! U+ X5 P$ G: s1 Z4 k  0040106C:  call      CreateFileA
+ h: `8 }# B- u. ~  00401071:  cmp       eax,-001
! o$ e" A. i( f- R+ ^  00401074:  je        00401091) a( @) N9 i1 y- I& P- U6 f
( h0 K6 v! Z; o/ n# o
1 _* |! K3 W; z, H" R
There could be hundreds of BPX you could use to detect this trick.
. u- V/ g: h4 p& `- P-The most classical one is:5 }" q) _$ o- y3 o$ L
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||% {: J, `5 b* r4 t% N
    *(esp-&gt;4+4)=='NTIC'
) m2 ?( @% {" v, D( s
; |3 j1 W( x: o-The most exotic ones (could be very slooooow :-(0 k" \, O) G/ w" U8 f* Q' l! {
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  
  X' D3 ?7 N) ^1 j     ;will break 3 times :-(
4 g( ~4 s2 Y" V5 P9 R7 [: R
( f& x9 P% L& x9 S-or (a bit) faster:
, I; l7 B5 d+ t   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')0 I7 m& i6 D4 B# `9 X. z. e

1 z3 t2 \4 t) y1 i! F. W1 h1 l   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  
2 j9 h/ `: h( G6 l4 H     ;will break 3 times :-(: b" D# g% `, _1 K/ E: H
2 N6 g, h$ c' W/ _- |3 R
-Much faster:
! |1 D7 Q8 }: g6 V) e" y   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV') ^, _" T+ d; X, P, S
# F8 p4 }3 x& L- u' y' S% E+ M. K
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
2 {7 m7 y9 E2 {" bfunction to do the same job:
5 r  p1 ~# Z8 ]  t* M
/ ^( {- M" T, p: _3 D   push    00                        ; OF_READ
9 l0 D/ E2 @- k7 r) C1 |   mov     eax,[00656634]            ; '\\.\SICE',0
+ A* k# Z6 g3 Z7 N" {2 t   push    eax5 c: E% x- V% _2 _' K
   call    KERNEL32!_lopen
( V7 G6 h. z, Y9 ^9 h0 p3 m3 s   inc     eax
6 j; N2 ], z  ]% _% R) y. T$ v   jnz     00650589                  ; detected  x  F( Z/ w' \, U
   push    00                        ; OF_READ2 _) `% M% v: r' X% v. l
   mov     eax,[00656638]            ; '\\.\SICE'8 u" ]0 ~% ^. m6 {" }& ^; G
   push    eax
  N2 g# P; u& s* Z, M) s' A   call    KERNEL32!_lopen3 W4 l. r+ j& m7 w3 x6 w8 p% S
   inc     eax0 n$ Z1 e2 J4 T$ p; j. H" q! ?
   jz      006505ae                  ; not detected# I/ o( b# P! f3 W
; a" \. |6 [! m. H% L0 u' n

. X$ F6 d. O, M. H, S2 w__________________________________________________________________________9 G0 `$ B3 q( I
) L3 c( c' ^) }0 ^2 U8 \% Z
Method 12. x1 L0 ?5 d8 ~8 Q$ P
=========/ n2 X  K3 D8 Y

/ P( V- {$ z" ?, {5 MThis trick is similar to int41h/4fh Debugger installation check (code 05& G+ |% N+ d6 q0 {7 L+ n7 [. C
&amp; 06) but very limited because it's only available for Win95/98 (not NT)
3 A3 w. M; a3 r) n% G' G- k( a, Fas it uses the VxDCall backdoor. This detection was found in Bleem Demo.! k, r8 r# B8 x) t; m: B
0 ~  U$ j- d( p, I4 S
   push  0000004fh         ; function 4fh
* f3 h; g; w, y$ W; f   push  002a002ah         ; high word specifies which VxD (VWIN32)
4 H" ]0 x6 Q5 o. o" Y. R; ?2 m6 h                           ; low word specifies which service
9 t2 T, X$ }2 C/ }& D                             (VWIN32_Int41Dispatch)  l% w7 m4 p  R! ]" Q: E6 m
   call  Kernel32!ORD_001  ; VxdCall5 ?  v1 o% U: |' a& ]! a
   cmp   ax, 0f386h        ; magic number returned by system debuggers
3 K, M. L, s& b5 N2 g+ ~& u% p6 Y2 r   jz    SoftICE_detected6 E/ z3 z7 ]5 A( T- T2 H
7 x$ l2 w% v( L3 @# x% f) E
Here again, several ways to detect it:
/ c5 |! a4 o8 ~3 k9 V% o9 ]0 m
. v9 Z( D$ @* z9 l3 \0 T    BPINT 41 if ax==4f8 _5 y- X9 E9 U6 W

$ J- \0 [# p0 H5 q2 _) P1 R2 L- {    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one1 Z/ [+ n" E% T8 T0 ?' @5 c

4 r* f! G3 J# [+ ?  n# u  S    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A  `4 E/ e) m0 n5 w+ a0 A8 B$ w

* C) P+ a$ b  p* K' P% X  E8 v    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!" G& j9 A" G9 E  o8 f2 }% b
# D4 F& g$ O3 T
__________________________________________________________________________
5 Z' p6 x5 |4 w) k. k8 I' B! E/ z$ U$ i
Method 13
- u0 ~& F  K3 f( }# h5 z: ~2 P=========6 w% e/ F" K- a+ V

$ _; B9 O& p3 s" JNot a real method of detection, but a good way to know if SoftICE is
, U: M& V7 \( J3 zinstalled on a computer and to locate its installation directory.
& s  d4 n- _" f- w6 H: {It is used by few softs which access the following registry keys (usually #2) :; O- c1 r( ?2 h
$ d) v6 Y- T- ~& a) B; ~
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
4 ~1 ?$ {1 k* p) x" B- c3 T: g\Uninstall\SoftICE8 M; {4 A/ L, I# a+ _9 }% v$ C
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE1 ^3 }, E0 v! F7 j
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
- d5 t' B' T: Y- k2 u\App Paths\Loader32.Exe
) w  o/ g& j3 E6 b# \  S- x+ R) x9 n$ d

" b; |( C- i# KNote that some nasty apps could then erase all files from SoftICE directory
$ _3 m8 g- R8 d0 X* s  q* U+ S* Y" v(I faced that once :-(
7 T. L' x8 K3 p# \- Q6 ^4 }, G% y) I0 m' I: V
Useful breakpoint to detect it:/ C+ A8 l! G( h( {8 R
: O. \' C1 W9 t
     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'6 ^8 f" k3 k* {7 `' f$ L/ c2 W

! l: E& Y2 v; I. ~$ b: J& s3 W__________________________________________________________________________3 L& u0 h* E$ a1 I4 S4 o) w
4 D9 n5 X. b4 Y% l6 `

/ c  |' i& L/ v" N5 }5 j$ R7 BMethod 14 ; Z8 e: i  m# z+ R
=========; l2 K7 A, [+ n# q9 @& @' N
, e6 d* X$ `$ N8 }
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
) ^6 b+ j) T5 I! c! N: S7 {is to determines whether a debugger is running on your system (ring0 only).9 h. o) Y8 j( L8 U3 z

) {9 ?' H& Z( F8 _7 O0 ]2 k' n& A   VMMCall Test_Debug_Installed
% v' Z6 S) V8 O5 ?; L5 X/ A  {4 g8 ^   je      not_installed
1 Z8 ]" y' a, Q5 X5 i, f# @0 h* M8 ]6 R4 G& V5 X+ M; b4 I
This service just checks a flag.
! c1 v1 d& G2 g8 `7 u</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关注公众号

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

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

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