About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
1 b3 g2 ]; q- u: q0 v1 P<TBODY>3 ~, T1 j4 L! G+ d, v- d' I
<TR>2 ]/ l: [; _, \4 J7 W5 p* L
<TD><PRE>Method 01
* B: `4 l3 p6 U; I=========" v3 @" b8 T4 C

" d  A0 V$ v) E6 A  u: L1 W; oThis method of detection of SoftICE (as well as the following one) is
1 ?1 m  m* h; Sused by the majority of packers/encryptors found on Internet.& f. u; D+ m* ^& O' A8 m4 B5 v% g, C2 l
It seeks the signature of BoundsChecker in SoftICE
! K& `5 B6 f' F4 G* y: A+ w! ~
: P9 p: y" ^0 f5 U4 h5 b    mov     ebp, 04243484Bh        ; 'BCHK'3 [, X9 l/ p1 Y
    mov     ax, 04h
9 }0 S! r) ?* A( k5 V7 ]: q    int     3       * _! X6 U/ ?; g
    cmp     al,4
+ ]7 d, e5 T  `( G' Q) F    jnz     SoftICE_Detected
' Q6 l6 e5 [, f- a4 o+ A, w& p! [, M' @$ p. |$ V3 {2 G
___________________________________________________________________________
. u" F! u$ Y# c8 s+ o  _  |- P- C$ c  j9 c! q  k- r. f; f- H
Method 02$ ~! ^6 a2 N/ @! \$ }
=========
3 w3 X# ]& B% [! K7 J
7 _1 m9 q1 X9 u* B, R  {# o* pStill a method very much used (perhaps the most frequent one).  It is used
" b2 a+ X# p, R, J* k. @to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
( m0 \* a9 x3 e  S, @1 eor execute SoftICE commands...
2 v9 m- n* \' k  u9 |It is also used to crash SoftICE and to force it to execute any commands
3 Y: W( d% `( s0 U: m! E(HBOOT...) :-((  
5 j5 L8 n7 d) E5 Y7 ?  H% W1 G3 F  h5 e9 w7 {( f; l5 M& p% Q
Here is a quick description:% \/ `2 L' C9 M- r+ f- @8 g
-AX = 0910h   (Display string in SIce windows). q* K8 |( B& o! U: P/ J
-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)# k2 N2 w1 Z6 J* N" h1 T
-AX = 0912h   (Get breakpoint infos)2 `4 u/ r2 t( O* v1 j+ c9 }( b/ a3 J
-AX = 0913h   (Set Sice breakpoints)' {6 L7 c4 j; j4 q) P2 i% k. Q3 g
-AX = 0914h   (Remove SIce breakoints)
9 G, v. Q) r. D" b5 N( n6 _( J) u$ w9 R
Each time you'll meet this trick, you'll see:
) N" \* t* S9 |7 F9 m: ^1 {  [  Q-SI = 4647h
3 H' S& P* ~% M* Y4 M-DI = 4A4Dh0 T! K: x  X5 N4 @7 P
Which are the 'magic values' used by SoftIce.
0 Z  j0 I: N: h  i* E; i+ s0 oFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.6 ?- ~. n. C" C* a5 r
% B6 ]# v4 y3 G/ x6 F7 b
Here is one example from the file "Haspinst.exe" which is the dongle HASP: X' t+ j1 D# B6 R
Envelope utility use to protect DOS applications:3 |' H7 d4 L" {8 E* e7 k
" O7 p2 p9 M6 r
' o1 n9 k7 Q' [
4C19:0095   MOV    AX,0911  ; execute command.
+ j4 z, _" E# Q* w0 v8 k4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
* B$ K/ |! E. p9 U8 {4C19:009A   MOV    SI,4647  ; 1st magic value.9 R" C/ `, v; _, r# w, f' H
4C19:009D   MOV    DI,4A4D  ; 2nd magic value.6 _4 x5 r2 T* j8 m) u) z: w
4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
1 M* R3 \- V. h4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute6 [( P' p% H$ {/ R5 V
4C19:00A4   INC    CX7 ]- o# h, U9 B5 w
4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute
: v, b! ?% _9 z* F4C19:00A8   JB     0095     ; 6 different commands.. r- }& i7 w/ }, i& C- d. N
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.1 |7 Z& H! l" G. E
4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)- h, f2 F% M+ @! z
% J. Q& ^# O* N9 y
The program will execute 6 different SIce commands located at ds:dx, which
" O6 ~6 y9 w  A: Iare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
. ]) s+ C# b! h3 O! M$ q# `& ^; _+ l6 \) B7 k! I* g7 m1 _6 p$ d; R  v
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
" R/ ]9 T0 f6 ?6 y/ ^___________________________________________________________________________- w! K* J' ]# l* G! x

& }' p3 y8 a7 s% k+ H. z3 i5 A: s) b2 m
Method 03
4 U$ L, R& G1 q2 D=========/ A) p7 S; \; U) A0 B( U- A$ [
! j1 ^9 M$ I/ h5 ~$ e- j
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
% @* ~' T+ X; K0 X* l1 L! ]$ j2 F  G(API Get entry point)
, i3 G$ o2 s. T" N8 e) p0 |        - n1 \4 K7 R9 U9 Z7 h

. {1 B. n! [3 L# k5 q# T    xor     di,di
( ^( D4 z2 }* Y. E( _    mov     es,di
  P8 Y4 E1 G6 u1 a/ O$ P    mov     ax, 1684h      
4 j8 C3 p5 {/ d' w    mov     bx, 0202h       ; VxD ID of winice* C' v# j% e' {
    int     2Fh
' [; h; k4 r, L, H" n    mov     ax, es          ; ES:DI -&gt; VxD API entry point1 y! g; I* \* E! A$ [( l1 `  Q
    add     ax, di
0 e5 _7 }$ _5 O    test    ax,ax: @: ~1 N* y' ~+ R+ o' r
    jnz     SoftICE_Detected
+ T9 x' u8 ^. s5 ^& p- o3 p$ }4 g4 U5 a
___________________________________________________________________________
1 \. s5 k& e2 ?9 b# D+ K: R+ ?5 T
4 q6 c! z2 y" I- f0 [" DMethod 04
  P  ?' i7 `3 q, Z& V' U/ ^=========  d+ o2 H8 O/ ^

% O& `1 l8 j- U0 D4 I1 a. G8 cMethod identical to the preceding one except that it seeks the ID of SoftICE( M2 H$ M+ h1 y; n: v6 g/ Q7 N
GFX VxD.) D# p, O! T1 y2 X) c( z# ~
; \* u: H9 \  L) X" {" G
    xor     di,di
( Q9 |- ]" U' ~+ [# X5 z" B$ A3 ]4 s    mov     es,di
+ x% O: X6 h2 U, A    mov     ax, 1684h      
# x. y- u7 \) J1 y" ^( O8 d' m7 `6 d    mov     bx, 7a5Fh       ; VxD ID of SIWVID) V1 H2 o% N2 y, F5 E* ]
    int     2fh2 x' v$ d$ s/ w& A$ I7 p
    mov     ax, es          ; ES:DI -&gt; VxD API entry point
( ]  k* ^; A% h" o( H0 z( I    add     ax, di
+ ^; n3 p  _6 f- Q/ g    test    ax,ax. X. V/ v$ P: ]3 O# A, E  o  |4 d
    jnz     SoftICE_Detected% w, q% O. q: M- @& J2 F

) l- a, I. n+ X+ }. O__________________________________________________________________________. c( K. s; J" j
8 {9 I; A: I8 v+ w" Y" N

0 J# g0 K* Z6 ?( U! i7 k+ HMethod 058 V- |& M; q) T0 [. a4 K2 ~5 X7 i
=========) P  @( O/ Q3 X2 M, u( L
# m* Q2 O7 _( B2 p0 i- W% r* X, X
Method seeking the 'magic number' 0F386h returned (in ax) by all system/ }$ `/ s) I: @( Z5 I, Z9 R
debugger. It calls the int 41h, function 4Fh.( T9 Q0 T0 P) [  e
There are several alternatives.  * ^9 C9 r( ]$ ~' X& U

$ ~! R( d# j( B; E) y6 n( W- f( DThe following one is the simplest:
- D* f( u7 b* L' I% b9 Y- m) j/ h  A' A- G: T
    mov     ax,4fh
' r4 y* r; y: `8 m8 y- H2 ?    int     41h
. x' x. M' I9 p0 ^    cmp     ax, 0F386/ u9 j9 G  S& C* O4 F1 X
    jz      SoftICE_detected
: {& d2 U6 \' n% [4 s/ ~- ]$ W7 @4 F  v4 v. \$ g5 w& e$ D3 L

# A8 v& \/ O+ u7 |+ A! tNext method as well as the following one are 2 examples from Stone's 9 i. X/ o- J' E9 a
"stn-wid.zip" (www.cracking.net):* o: T( F( H& I2 W, o

& x* \1 g( K  n* I    mov     bx, cs
- M. C  U' q/ F    lea     dx, int41handler2& H% a7 P* u- ^5 v" `
    xchg    dx, es:[41h*4]( n( L# M% H* y9 {. Y
    xchg    bx, es:[41h*4+2]! ]/ \$ y/ U$ b$ L- u
    mov     ax,4fh
: K* m; X! S' @  U& L    int     41h9 ]& ~+ i" \$ A# [1 }
    xchg    dx, es:[41h*4]
, U6 S: T3 X/ v- ?" }5 M  j    xchg    bx, es:[41h*4+2]4 c* V1 s6 I  ?; B0 y
    cmp     ax, 0f386h( c6 m& g% A$ ~$ Z9 m4 R( i
    jz      SoftICE_detected; n2 k. C6 L4 N! C! B) r2 ?* {* Y1 ]

1 f. w  w2 P& _, Zint41handler2 PROC2 ]: A. r7 z) c0 T/ I5 @4 m
    iret
/ _+ e1 V4 j; I( l* N4 n# B6 A* Iint41handler2 ENDP
! U; O, I1 I3 Q& g) A1 ~/ W
/ q4 i% S! v4 g$ B* y+ J$ ]0 z5 [
7 g- K2 t) B- S: b& A_________________________________________________________________________1 n" K( S: i9 z* Z' r4 V

% o1 I* t9 }3 K% H: m6 R& b3 T7 \: j5 _0 v4 E- I
Method 06( A! j+ [& K: B6 n- g; m
=========8 E3 @% r3 ]2 ~3 U6 w8 q

3 G7 H1 x7 ]- l4 B& [  l! X; O/ E
; `8 B# L9 j  n. R2 g* H9 b5 k2nd method similar to the preceding one but more difficult to detect:; V8 @- Q* u5 C* X8 p

& v5 V5 G: d+ @" q  w! n  y
3 _" t$ E; _& I5 \1 Wint41handler PROC
/ A& F* c7 T! x& f+ X* i    mov     cl,al
  U- o6 a; t& {* F$ F! Y    iret
8 J0 b' I5 _0 Eint41handler ENDP
8 y7 @' r  S: y2 i! t# t  _7 E
/ m- a- O7 \, Y; N& M6 i; W5 z6 L( q8 _7 |1 C$ Y% F# N
    xor     ax,ax
+ z( }( X8 G1 g$ }1 E    mov     es,ax
0 k. i: b1 N1 d& C4 F    mov     bx, cs* J( ^" g& @& [8 }" O, _
    lea     dx, int41handler
  o( T2 d+ t+ u6 @+ d    xchg    dx, es:[41h*4]
) L" r% ^7 `% C- ]' B* q    xchg    bx, es:[41h*4+2]
4 A7 o  m7 K4 T- G    in      al, 40h1 Y" y; @: t7 c$ l
    xor     cx,cx/ F7 S0 o4 B! X$ x0 f5 v
    int     41h
+ N. {2 c% X) F9 [7 f7 E4 s, ^& z; J    xchg    dx, es:[41h*4]' C. |. ^3 T6 W6 C; F
    xchg    bx, es:[41h*4+2]
- `9 G, ?! p) k    cmp     cl,al
" ~% a. J: K' J0 Z- B    jnz     SoftICE_detected
8 b1 W4 c# Z1 N4 s9 M6 i1 C8 H% {0 D9 t" d
_________________________________________________________________________
5 z  w; q" d& J# w) y, [$ q/ G
3 }' a% m* j7 i) yMethod 071 o$ w5 t  V4 T2 _; B$ Y/ D
=========7 P( a9 i! W& y2 p- u1 A: F

% ~& U/ E4 o4 c" K$ a3 }. R& OMethod of detection of the WinICE handler in the int68h (V86)
. _9 C( _% f  Q$ x! Y
' ^, a2 p) |+ f3 M0 T1 D* Y, y  s    mov     ah,43h3 t4 O/ X! s: h# ]7 P
    int     68h8 H) \8 P3 v7 C- \
    cmp     ax,0F386h
1 x9 V& ?! b3 _8 G- @$ ?* B( w4 U    jz      SoftICE_Detected+ A9 J" W0 ?. l

% T1 l) {8 W. P* `3 g4 r
6 r& s# R2 g) Z=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
6 I4 q# R/ ]9 l0 C! T   app like this:& T& Z) ^( C9 `: Z: a
8 B3 l# G( h% r7 |: s' z* g
   BPX exec_int if ax==68
% _/ i+ C% V1 t% x0 v# C0 d2 v0 y* z0 {   (function called is located at byte ptr [ebp+1Dh] and client eip is* @9 b! V6 J7 L+ V- q2 ~- Z/ e) r4 Q
   located at [ebp+48h] for 32Bit apps); V/ N: M# w% `& I8 }
__________________________________________________________________________& J" r# D7 m: V! E
/ _: P! D( B; A: X

% Q) r- j" m, j9 TMethod 08
8 N+ I4 A+ N7 u: J8 [9 G) _=========
  C8 ?& w% H7 o) m8 E* w: H8 f
/ {/ L' ~4 r" M3 G- L- k3 ]It is not a method of detection of SoftICE but a possibility to crash the
% }* Q9 R" I% D! |2 Psystem by intercepting int 01h and int 03h and redirecting them to another
/ I! m9 e% O9 _/ P* W" sroutine.( @+ K' Y$ M7 p8 R: G% u: s; C
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
; w- i5 E, x  p2 }! m' g8 E6 Ato the new routine to execute (hangs computer...)' F5 e- X9 N% I, ]8 H  x
3 U! X' [2 O# E6 ~
    mov     ah, 25h" I3 C- r- z* ^3 G
    mov     al, Int_Number (01h or 03h)+ q' n7 l1 @/ w! I
    mov     dx, offset New_Int_Routine( e  J$ L, M+ H
    int     21h
4 e" |; V* c" D" M% C" k' @
* e; w! b4 ^5 I4 P0 h1 T2 {% @2 l__________________________________________________________________________
' ?1 |) q" q/ n  V5 K$ j3 X) h1 h0 L  g) _" F- [2 z
Method 09
% Z3 q/ W; s9 M1 x) O' R0 M=========
4 x$ g  L1 q( L$ v3 ]/ [
: P; D5 i- F) W% CThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
6 o1 u3 q( n0 u0 m4 Pperformed in ring0 (VxD or a ring3 app using the VxdCall).7 t" \) I9 K  L0 E+ }
The Get_DDB service is used to determine whether or not a VxD is installed
: ^! }0 Z0 b. r" X8 A  Q0 afor the specified device and returns a Device Description Block (in ecx) for
# v7 E+ x; S8 F- \/ u5 k! R7 qthat device if it is installed.! \* D8 z4 ?, W0 i: r0 p3 {
, h+ }7 h+ ~# g$ q" d6 ~8 L
   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID( [" B) H& b6 U6 y& K) t8 M
   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
; j5 U( Y( [7 x   VMMCall Get_DDB; g2 U3 d( V* P- G$ M
   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed. G6 v9 J, I" p0 Y: N% @
; M* A" z  N7 S: `, J
Note as well that you can easily detect this method with SoftICE:
7 T' e+ m( ~# Q0 h6 Q/ P2 ^   bpx Get_DDB if ax==0202 || ax==7a5fh. t9 z7 g( I2 l( c& S

& ]4 \: _  Z; Y__________________________________________________________________________
4 h5 x' w! n- y0 R
) q) S! C! k5 W0 b2 i4 }# yMethod 10
4 C  \5 L" ~; M" |$ F" m" [=========7 @; d) a  E, |/ J3 I5 X/ A# [7 P% H

5 \9 C- ]0 l! ?=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with7 E1 `2 k! H4 h* V
  SoftICE while the option is enable!!# {3 ~6 f3 a6 I2 k9 E
3 x2 q2 j& n" @0 N, N3 P1 \. C
This trick is very efficient:  B, i6 i( {) A; A( {3 s  u* ]
by checking the Debug Registers, you can detect if SoftICE is loaded, l* T$ o( H  o# e
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if  T" H3 Z' j) X% B$ k& E
there are some memory breakpoints set (dr0 to dr3) simply by reading their# @$ _! k- }, d
value (in ring0 only). Values can be manipulated and or changed as well$ K: I$ R  \" q! _* E2 _
(clearing BPMs for instance)3 h) o1 n( G2 M3 p7 Q" q8 C/ g5 I9 d, B
7 b  `+ ?$ r3 |* R/ Y$ t, [; F
__________________________________________________________________________
; X% I' O) H& m) X0 p$ J3 s/ z" Z. e$ }; s( h& }9 j# [
Method 11
7 G9 ~* ?+ D$ P( a" f=========$ ]# z5 f. z9 p/ U

0 J+ n9 K3 ^1 A0 ]This method is most known as 'MeltICE' because it has been freely distributed
6 t: x* i* ]9 }1 x# b3 ~3 ]via www.winfiles.com. However it was first used by NuMega people to allow
( V) o/ G  d# x/ iSymbol Loader to check if SoftICE was active or not (the code is located
% k% D- X5 H6 Q# ^/ f! c7 U* }9 hinside nmtrans.dll).3 Q; }! u, Q$ y$ `7 Y6 o" Y
( B2 w0 x3 M% N# M
The way it works is very simple:7 t3 F! `4 Y" P
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for. W! l  u( Z7 V3 m9 K9 H
WinNT) with the CreateFileA API.
8 e+ X7 }- T1 x" v
* K( Z) N  _0 A  @+ a' R) ^7 HHere is a sample (checking for 'SICE'):2 V* ?2 x: a+ G
$ [" ]% q2 T( j# `4 ]
BOOL IsSoftIce95Loaded()
: ]' `* t2 c/ ^  j4 i* F! \{; N) w9 a1 Z$ c* A
   HANDLE hFile;  7 @0 g7 t  m: y9 `8 Q& e( S
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
; u# u: `0 n3 `, I  B) s                      FILE_SHARE_READ | FILE_SHARE_WRITE,
! ]" W9 V: R$ N% ]# i( c8 A                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);: r  C5 O7 @# A7 r) d5 K! }
   if( hFile != INVALID_HANDLE_VALUE )0 }0 s% W( c# H/ O% j; ?
   {
) y4 u1 X$ [& c2 X  c      CloseHandle(hFile);
7 l3 a1 ]# I9 y$ c' p( ?! f/ ?      return TRUE;
/ p9 e& f! o$ C5 l! |   }9 ^* p# d; z+ [1 ]$ o
   return FALSE;
* G0 p& U( ]5 I6 J}+ J# ~8 K9 `! G+ p7 ^5 W2 M$ X

, _2 J! c9 I: z- }Although this trick calls the CreateFileA function, don't even expect to be. \! P: N  t  a" J& L( I* S5 S
able to intercept it by installing a IFS hook: it will not work, no way!/ b  @# t% F" t4 ~, Z
In fact, after the call to CreateFileA it will get through VWIN32 0x001F( A5 l6 n  j( j' F4 W) X! D2 i/ [
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
, O; n  i) G" H4 x: l: d: N2 ]and then browse the DDB list until it find the VxD and its DDB_Control_Proc
8 v4 F; y) x1 q& I' K2 E. `field.
+ n# F: }, [5 h8 K: k! x& [In fact, its purpose is not to load/unload VxDs but only to send a
5 b0 o3 T$ m- x  J! D& K8 uW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)1 Q" f7 E# j& E8 w2 N6 c9 s
to the VxD Control_Dispatch proc (how the hell a shareware soft could try; u1 c* c" k- E! v0 |: s
to load/unload a non-dynamically loadable driver such as SoftICE ;-).0 z4 P5 Z$ n' p9 l
If the VxD is loaded, it will always clear eax and the Carry flag to allow8 A. U8 _! F8 D
its handle to be opened and then, will be detected.& i8 R$ H* K) K) z- n
You can check that simply by hooking Winice.exe control proc entry point
, F3 v) F3 q) B7 D% l  Rwhile running MeltICE.
: a$ t; [% T  i' c8 [* L" G/ d+ b2 H; }! @8 d$ s9 x
7 |# l* I- U. e( u. I4 f$ h1 t# ~
  00401067:  push      00402025    ; \\.\SICE( U, G  ^' H% n- f, K
  0040106C:  call      CreateFileA. y( p* {& \$ Q8 ?9 V! z& G
  00401071:  cmp       eax,-001
' x/ A5 K0 v7 [9 i$ M6 K  n# }  00401074:  je        00401091
( w8 A) I3 l  ]3 @6 ]
" r6 ^3 B( l" T" p3 s( Z0 d# a* k" x& [: }9 M
There could be hundreds of BPX you could use to detect this trick.
$ X! f4 g6 q* ~- u  a-The most classical one is:
* G* J; h% U' \/ T  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||$ I  ~9 X) ?  C  T; I. T; D" r
    *(esp-&gt;4+4)=='NTIC'0 G. l8 s% i2 Z! v/ H6 \3 i

; @5 r; a6 i8 @/ f% ~-The most exotic ones (could be very slooooow :-(
( C2 b/ `8 [! r* U6 N$ }/ H. r   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  1 Y$ o, G3 o/ q; e' t
     ;will break 3 times :-(
* S3 t2 i6 ?0 S1 d* P* [0 ~$ A$ n7 w' O+ s$ p
-or (a bit) faster:
, B. q: M7 |7 k. G. G7 A4 }- {# Z2 `  G   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
) ?& d. f) D  @1 F0 g2 L% P% I- a  |! B; m
   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  6 p: ~3 R2 A. Z# Y( x& n( l
     ;will break 3 times :-(' A3 i4 q; ~* r  o8 E

  P6 K' l' n( s7 a6 J-Much faster:
, t! w3 _/ K  s7 P0 W* B& u' h- A   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'
) }! |+ O9 c" t0 t! `  Q
" p, |, J$ U5 x( ANote also that some programs (like AZPR3.00) use de old 16-bit _lopen
3 P2 a) z3 A+ c. n7 _$ ]function to do the same job:
2 n2 ]1 W8 g! m" J
# _0 O& x0 d1 P3 t& r4 J   push    00                        ; OF_READ3 v. G: Q  J! {! A/ T
   mov     eax,[00656634]            ; '\\.\SICE',0
% m6 @' [' {: k% t, V- @# a   push    eax" ^% y1 z" ~+ Q' G; G
   call    KERNEL32!_lopen
# F+ @" u  v$ S0 r   inc     eax
  R: u1 }5 O4 L, w- [$ r   jnz     00650589                  ; detected
2 [- g5 B+ D9 y( R- l; @   push    00                        ; OF_READ
- \$ \7 m1 Y4 j# J4 B3 h   mov     eax,[00656638]            ; '\\.\SICE'( i* A5 A4 x6 D1 X6 m* V# |
   push    eax2 M3 T) ~; z5 ?  E! d" S
   call    KERNEL32!_lopen
6 k$ T- c  n$ ?; X" r) }   inc     eax
' T+ _( N* K, v& y) m& J* d7 J   jz      006505ae                  ; not detected
. X$ b% Y1 X$ g- a+ X4 c  ]' C: z. p* D- h
/ p0 c7 k, O  L7 A# c
__________________________________________________________________________
# N) p, ]& h& d: w) h. b5 }. K5 l. \& E7 u
Method 12
  b2 k) z$ H  x! T) D=========1 X, [' E8 B  a/ w( }7 _2 s

4 y" v3 K+ u! ~This trick is similar to int41h/4fh Debugger installation check (code 05; W1 Y1 v; j' l! k" ^! t
&amp; 06) but very limited because it's only available for Win95/98 (not NT)
; v$ H1 _1 s* u2 {, s9 u4 vas it uses the VxDCall backdoor. This detection was found in Bleem Demo.# A* L% Y7 Z5 ~/ m9 T1 z9 u) y
- ?$ @; _6 k  S' g% k
   push  0000004fh         ; function 4fh
7 t8 x: C: K6 |5 G   push  002a002ah         ; high word specifies which VxD (VWIN32)/ j% ]/ s! [  c, j  h- b& a* P
                           ; low word specifies which service$ N0 |/ w, `# g) b
                             (VWIN32_Int41Dispatch)) b! j' f# I; X! w. }
   call  Kernel32!ORD_001  ; VxdCall# G* R2 }$ |/ ~. z; d' M
   cmp   ax, 0f386h        ; magic number returned by system debuggers
0 A/ L6 U0 {- B8 y+ p8 r1 t   jz    SoftICE_detected
: S4 }% r. L% Y: i7 g1 z( T+ G; q- q( J: a) V3 h4 G
Here again, several ways to detect it:
% H2 d; V& ]$ a  y
" J4 r" F4 R, a$ ^    BPINT 41 if ax==4f
: z# E2 L+ D. U! P* ~) y) R8 z! k* E: H: I
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one
* i' S! R  u# d8 B7 L" r9 u9 m* z  D( B" L# K1 \) X2 M; j! k
    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A7 q" K9 t+ z$ o7 E. p

2 p6 A1 _/ d, v' B    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!
2 K! C( R% q5 x8 v6 o8 t: a
3 {2 _: c  }* {& E/ l# s" e6 Y* f__________________________________________________________________________4 }+ H4 Q" V5 I0 f( E9 o8 Z8 I4 j; x+ ?4 ]

, i- N( B3 U: A& B" RMethod 13+ K5 i2 O% C6 `$ M" v# @4 ]4 B
=========7 w  N% u' I  F7 o, C3 p. r. F
/ f8 u/ C" f( q) @/ \! g9 y
Not a real method of detection, but a good way to know if SoftICE is- G% G0 M% W4 Z+ h& T8 |
installed on a computer and to locate its installation directory.2 r7 a! L1 h1 {9 O1 o
It is used by few softs which access the following registry keys (usually #2) :7 _# `# U" m) ?, L" Q! q3 n) q
( s% t! R8 z1 x, Q7 C+ |" `+ b* S
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion% f8 g9 h0 u0 G0 k
\Uninstall\SoftICE3 c. |9 n# G' U% I/ y
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
/ O$ x6 U+ y( }2 D( P' m  x-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion9 T) q# A: k1 P5 o) R
\App Paths\Loader32.Exe7 f  G* Z1 d8 t/ }3 z

( v  w- H/ h: _8 A6 [3 h1 J% c  c5 d1 q
Note that some nasty apps could then erase all files from SoftICE directory
" T. w' z, ?( `2 Y+ a(I faced that once :-(0 f! E1 V" j1 `3 f/ J5 t* a) I* P
% ?! E5 x) J. L! Q6 ~
Useful breakpoint to detect it:
6 ?3 e+ z; x9 ^+ a' F  N) X6 r2 ^
% e  X( o' f: x( d, V2 I+ [6 Z     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
7 i8 @- ~& i0 c
: b( K) ?' b. E8 Q" G__________________________________________________________________________3 ?7 `- V2 t% C7 l- W& U/ A

& G( A4 y' z4 |' V/ D: i# n' w: ]  o& a8 t2 b, d$ i5 m
Method 14 : O( K  i. d/ t) ^! [
=========
6 y' I9 j# i" S8 W, Q
* C" G1 w3 f9 `( F" g7 d# MA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
% d2 |3 O7 j$ B- Tis to determines whether a debugger is running on your system (ring0 only).
2 i! N# _- l" B% ]/ {* ?) G9 h! T3 d8 F
   VMMCall Test_Debug_Installed. N: s" p0 [, D& v" r
   je      not_installed
( s# p! x- K; G$ s9 n0 v0 s0 j/ m" D; l. j' @) h! f; O2 b
This service just checks a flag.
9 F7 x4 b4 J1 X" p4 i, f0 m</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关注公众号

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

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

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