找回密码
 注册

QQ登录

只需一步,快速开始

About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
! T. ~; [7 J9 s; c' b% L( [( Y<TBODY>
- U9 l- S' v  j. `! g<TR>
% q2 _8 }$ h" r; g0 g<TD><PRE>Method 01 # G/ r3 ^  u. p$ i
=========( X3 C) P( z8 N8 b$ p
% e# p% ^" C, `2 v' D/ Q
This method of detection of SoftICE (as well as the following one) is
  |) Z4 ]% e8 H5 ?  Uused by the majority of packers/encryptors found on Internet.
( V7 C+ q; Z/ s6 O" @It seeks the signature of BoundsChecker in SoftICE5 x: ?" F: p2 L8 W9 B1 o

& C% m: N' L* T, s" g+ K5 Y. Q    mov     ebp, 04243484Bh        ; 'BCHK'
1 K" g; B5 E1 F# b  F    mov     ax, 04h
  I( e2 m9 D3 m$ F, s" w" [" N- Y    int     3      
3 z) p1 N; f2 s; h    cmp     al,48 I2 }- J; }& r% @2 ~8 O8 V
    jnz     SoftICE_Detected- o4 ^7 _6 W3 a
& x; [( H2 B6 Q
___________________________________________________________________________
7 ^6 X( K( s9 c, H5 O
9 H9 N' _* D* \* N- r3 \! T) |) I" mMethod 02; c* m: n9 k  X5 o) k/ v. `, n) u
=========
- r, V" H6 K- r5 d: o2 a1 D7 c: O& u7 q1 A7 s. m* K0 B$ ^
Still a method very much used (perhaps the most frequent one).  It is used: L! B. P0 l* F. e* Y) g
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,0 U) M8 y6 j" s5 u* B! \
or execute SoftICE commands...+ ], k: ]( D0 c1 M1 P* Y( p
It is also used to crash SoftICE and to force it to execute any commands
# J! U; v' ^4 c3 R; H' C(HBOOT...) :-((  
* S5 X# G# H% S. N
7 r# Q; @$ n! P6 q" j8 SHere is a quick description:
* y. E8 E( F. k, j% e: m% b) K4 {-AX = 0910h   (Display string in SIce windows)
. z! n# E# \. j& Z, l% a) G+ h9 w; J-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)
7 A& X9 v; ]# M  M" {: @3 }8 A-AX = 0912h   (Get breakpoint infos)
; C# |( K" @( L" I8 Z' V-AX = 0913h   (Set Sice breakpoints)* F# V- X8 g5 R, n1 C+ m
-AX = 0914h   (Remove SIce breakoints)
+ V7 a1 h: E: [
9 R" R: {3 H. o( a5 v% |1 K8 T9 V* ^Each time you'll meet this trick, you'll see:- ~8 R) E9 k, A& o
-SI = 4647h
/ e; M- x6 E+ H5 f' j-DI = 4A4Dh$ F( Y' u3 x1 U$ _) ?: R% M1 j
Which are the 'magic values' used by SoftIce.
0 k$ o+ m" r- v/ m/ G# TFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
3 f4 v3 B% K6 B3 V2 ?: l
3 H0 K' l1 X7 X9 w, a% \, H! `. v+ bHere is one example from the file "Haspinst.exe" which is the dongle HASP
# @/ a- k" @& b5 A( h! U3 iEnvelope utility use to protect DOS applications:
) n6 s: J9 Z6 d# X6 [4 @1 W6 t! W4 c9 v

" D0 x' r+ t; h$ d' d; }4C19:0095   MOV    AX,0911  ; execute command.( x! @% a' n/ F' P2 H7 g
4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below)., W8 F( C- a6 F; m9 z5 ]
4C19:009A   MOV    SI,4647  ; 1st magic value.
" R5 {% ^- @% f. k4C19:009D   MOV    DI,4A4D  ; 2nd magic value.
/ p* }# m* {3 j! M. Y& C4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
1 L8 e0 S0 B' T  B  M- H( N  H4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute& `/ P) m& M" J" K3 c1 |: x
4C19:00A4   INC    CX/ `& v' C0 [/ s4 {) C- q- O+ o
4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute( G9 N8 z+ B9 S6 ^# r" A' t6 t  p
4C19:00A8   JB     0095     ; 6 different commands.
. ]1 [5 Q5 d: d: @9 w4C19:00AA   JMP    0002     ; Bad_Guy jmp back.8 ]# {/ h1 Z& T) s( d# h$ F1 D
4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)/ W' K& F! Z& \1 N" _

2 I9 ]- O1 I1 b/ x- Q- J8 J$ ZThe program will execute 6 different SIce commands located at ds:dx, which
; a; }  `- R! P7 I- E! f6 R9 J' {are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
$ _  \: e2 O. Z6 ?: U! ?- |. n/ Y  ?+ I% W  P. r: U* S
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
2 K9 Z- j1 H1 ^  Q. L; a, a/ m; T___________________________________________________________________________
# d9 S; R: c  }. h0 E  U3 N% Z! b3 f  o% M0 @
4 P( L3 L& @  r9 H
Method 03
* ?  @+ b% G! V  f! u3 `' J/ y  p% T=========
% K# P' W; _' s: ]; W! w3 V. f. Z/ E5 J3 {7 E: Z4 u5 F
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h9 S' T2 `9 Y. z5 H( H
(API Get entry point)# q; I; ]/ L1 O) z  i
          \2 l# w/ }* q+ l  o% B0 }

, j$ g$ `( O: ?9 ^+ `+ }4 H! J    xor     di,di
4 q" @- @* o* ^# `. t    mov     es,di# i( Y% O, D4 l6 s, W1 r% z/ C. ]
    mov     ax, 1684h       * h) R/ m8 x, h  r7 ?8 e9 ]# j
    mov     bx, 0202h       ; VxD ID of winice
9 ~5 K. V  J, o( V    int     2Fh
4 L0 I6 x6 c7 Z! `4 E    mov     ax, es          ; ES:DI -&gt; VxD API entry point
" Z1 P$ `" w; G7 F8 }    add     ax, di7 u" N) i1 d8 r" f5 I6 R3 z( r
    test    ax,ax
: v" z# v4 O$ C" t# s  v    jnz     SoftICE_Detected
" q8 {0 c' w* R9 t5 A. U6 q
( T: Y! d+ U  I# f( r' J___________________________________________________________________________
( D. F0 \* \! t6 Y# g9 G$ t7 k5 }3 M
Method 04
/ x% r9 `( N6 }3 F/ g/ M9 A" e: Z1 ?: }=========
. h, f! ?; Z; f
; V% c) h5 ^/ i/ h; I3 `% e' f2 r- eMethod identical to the preceding one except that it seeks the ID of SoftICE* t  S9 q) J4 c3 e8 a3 _2 {4 E0 R+ A
GFX VxD.
2 o2 Y0 y/ {7 N" k  V' @! I
2 C) M$ z6 w3 [6 G$ |- y9 k    xor     di,di; Y% H2 {1 a# O0 Z$ b. r
    mov     es,di
* a- u6 \0 L) j' r6 X) {    mov     ax, 1684h       2 {% q4 G% M3 H
    mov     bx, 7a5Fh       ; VxD ID of SIWVID
7 K* v* s$ G3 M5 ?0 _4 v    int     2fh1 Z- q$ j  j; `& M
    mov     ax, es          ; ES:DI -&gt; VxD API entry point5 W2 K1 R# i3 O. O  Y5 n1 ?% k" S
    add     ax, di
  W4 l6 z! l  K    test    ax,ax5 a. B- k! d5 v! B2 h$ Q# V/ J
    jnz     SoftICE_Detected
. T* P2 `; I; R4 S& Z# E6 Y' @0 a1 P6 `/ F5 P; `( ~8 F
__________________________________________________________________________' b( {5 N3 {' ?0 ]  J, U! y# R

) i9 w0 K4 Z; R/ E
2 f) f8 J# y! q7 H  c+ Z/ J% pMethod 05- q7 |) x( ~- G; _* l4 H' f
=========
6 B7 h; U, W, }/ h5 @, R
2 K" Y" \' F0 S+ l/ Y9 IMethod seeking the 'magic number' 0F386h returned (in ax) by all system
8 F7 R" o( _/ O, ~& H9 |debugger. It calls the int 41h, function 4Fh.4 F; I0 `: v9 x- t* C
There are several alternatives.  
7 W" }) }; f( I: {5 i' c, E  s; ]( K1 y3 Z0 e0 a; ?3 K
The following one is the simplest:+ f: K0 e' H; |- J# p
8 a( t/ A9 N& ~
    mov     ax,4fh3 R. _9 A2 x) T# Q0 V" m) X+ g
    int     41h
7 g; M( o2 w9 |7 H) ^7 M    cmp     ax, 0F386
2 D0 y2 Y4 i, k( b7 Q# s. a    jz      SoftICE_detected; L. o  m! q4 c4 C0 i7 ^5 L6 s
1 H: ~+ N! M; d1 P

4 u* @1 a( M# {& N; y! c# xNext method as well as the following one are 2 examples from Stone's 1 ]8 A* Y+ w/ z  l7 S* Q1 L9 L
"stn-wid.zip" (www.cracking.net):
% k' p! o( x+ h$ i8 r/ X/ p1 n, c. \! O$ O  B) v
    mov     bx, cs
9 S$ }2 E+ \( w6 Y/ o6 [- J    lea     dx, int41handler2
! y! ]" m" U0 W. V, Z    xchg    dx, es:[41h*4]
  D, ~/ r9 X+ P* [) S) Z0 g6 N    xchg    bx, es:[41h*4+2]
# Q6 S9 U# G" \6 e* }' Z) Y    mov     ax,4fh
. b- ~6 f0 Q  `  O2 n    int     41h/ f& X" v5 {. j) D
    xchg    dx, es:[41h*4]! P" o# }7 j3 W
    xchg    bx, es:[41h*4+2]% j8 q+ l' i' j1 S8 f
    cmp     ax, 0f386h9 c8 _+ B5 j" z8 R6 I9 Y
    jz      SoftICE_detected2 p, l5 s) N/ B

5 ^& s- e6 U( I) l$ {+ A, `- W; Sint41handler2 PROC
/ W% |3 ~* O! q/ E    iret" ~. O  \; Q  `& L! @6 K5 \
int41handler2 ENDP2 R8 D3 J/ ^; ^5 ^+ v

0 @+ l" ?. @9 v+ d& g
; O) G* j2 e$ l_________________________________________________________________________
/ t5 p* j1 @! f6 {" x$ r2 f8 U, M8 @; _, n

  ]# p  K  A" d: O/ nMethod 061 u" t  \/ H. C% n# I: p/ }
=========2 o2 y, S0 a  O" ^7 ^8 C8 p6 ?
7 e8 x( O5 W9 j) A
# i6 u- ]8 k8 e, s. }
2nd method similar to the preceding one but more difficult to detect:4 R9 y: u$ P( i) B% w) J
# m0 s* {$ c/ q6 X

" h! v0 X$ |# T. ~. Mint41handler PROC
1 H+ y: k) G' t$ N/ n! b    mov     cl,al% M8 k4 U  ~9 k' u
    iret
* i5 f; q2 Z! [  G- v9 Tint41handler ENDP4 n4 F# l5 U1 v; s! ]% `7 J- @. C4 p4 }

- k( O* R  q7 a9 Q: b0 g. E& K- V! Y) m0 u  U
    xor     ax,ax
7 I8 f; |% e& W+ w7 R    mov     es,ax! w' J& o1 V2 L2 A, o
    mov     bx, cs, ]( k. ^- b2 L
    lea     dx, int41handler
/ b# u6 n/ F3 q6 w    xchg    dx, es:[41h*4]
$ e! Q8 ~) R" f( z  t: z    xchg    bx, es:[41h*4+2]! A! W/ r6 i' Y3 h3 |
    in      al, 40h9 S) D5 F  C9 Q. v
    xor     cx,cx
* f. z3 R2 ~' w" f    int     41h6 ~# e9 y/ A- g1 B; b8 E
    xchg    dx, es:[41h*4]
6 i. _# J7 w6 S5 U) G    xchg    bx, es:[41h*4+2]
- J0 {( i# R" b3 r/ N1 ~2 Q9 B* Z    cmp     cl,al3 h5 p: [" }% I# u
    jnz     SoftICE_detected
1 e5 h3 o5 e$ u( R4 r) W- e) O4 \, Q5 D4 l( E8 K$ Z' E
_________________________________________________________________________& w- h2 a0 k3 `$ L2 s" R' ?

- x: ~( v6 k* `) D( D4 }Method 07
0 {' x2 K  W  O=========
- R/ H! q2 X! j+ c3 r$ w5 |+ o6 K2 r7 P4 e+ T9 B
Method of detection of the WinICE handler in the int68h (V86)2 m1 N2 [  [1 d9 w, G* s9 r  k2 P8 u

, X. R# ~) P! Q" }( S    mov     ah,43h. D" F5 o) O. q3 c5 f) c* S1 Z* T3 p
    int     68h1 W; o2 B7 B  U( W5 ]& ]
    cmp     ax,0F386h
" `2 f. I: [! Y5 S. J$ s- e    jz      SoftICE_Detected: d5 I5 C! I: w+ @; }
8 {8 V% t1 N: [

* g" z/ x0 \7 z, P/ ]! A=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit( y0 L/ J9 c: R7 n. A
   app like this:/ h1 l% p( @. R7 m* f2 Y6 l3 |- W* m% W
8 y, C! M2 K. N* e5 y! P
   BPX exec_int if ax==68. L" F3 ]( E+ B0 v8 U2 x6 D
   (function called is located at byte ptr [ebp+1Dh] and client eip is# y) y* S" q+ {% ]8 _
   located at [ebp+48h] for 32Bit apps)
- `% |; Y! h/ g9 I/ S( t0 b: E__________________________________________________________________________
; e$ m$ g! B2 ~7 O4 W' _1 }  H7 \$ O) J  M8 ]  o
' u- T/ C8 D1 s8 Y, P
Method 08
4 y# G+ X" x* Q& p& h* _=========
4 Y7 C3 t! h/ j% X: m: I+ G- ?$ e, E/ ^+ z5 A% k
It is not a method of detection of SoftICE but a possibility to crash the* ?. I5 `( H, E& \; s5 s: W. T
system by intercepting int 01h and int 03h and redirecting them to another8 w; s, d5 t$ r& Q: ^- S" s! Y
routine.7 m8 Q" P$ ]' }; n. ^1 D# ]
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
4 m+ z% N' @7 U+ ?- Yto the new routine to execute (hangs computer...)4 }9 o1 W' D- }

; S  A4 l, ?; s% h9 E  s- X    mov     ah, 25h8 D; D* _3 {% k$ V. }2 J
    mov     al, Int_Number (01h or 03h)
/ N) O  @) a, {1 X+ y    mov     dx, offset New_Int_Routine
  t7 d: P6 D$ N  Z9 g, u    int     21h, ^& {5 c3 w1 n8 s# N& i- V) T

$ K# Q+ i& T0 [8 Q$ I: U: y__________________________________________________________________________: i, K- J3 O8 I. ~3 P$ d

& E7 @7 U! a9 p$ X1 wMethod 09* m9 x/ k9 x" m4 u
=========6 p5 x7 c# m. |9 v9 J+ Z

5 `2 Q% b9 i3 e& h6 t, u$ j+ AThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only) a4 `/ I" _/ v$ w0 H
performed in ring0 (VxD or a ring3 app using the VxdCall).3 l; k5 o1 v9 y* k% X
The Get_DDB service is used to determine whether or not a VxD is installed
% Y& R6 L9 S4 Q3 o. B: ffor the specified device and returns a Device Description Block (in ecx) for( [$ I8 n) ~# G
that device if it is installed.
6 g1 U& m2 B, S/ @3 D* c' C. o% d! T6 p$ D6 |0 d% I
   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID
$ e) b8 C! i6 g6 M   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
: B8 i' E2 [4 j' [6 @3 J   VMMCall Get_DDB& o5 ^0 g+ M9 R3 W4 A# B
   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed
4 c5 x$ f" n8 n  C# I5 W$ b! m; W% j# y6 w, k7 B& e0 N
Note as well that you can easily detect this method with SoftICE:
5 U6 z9 I8 o# W7 X3 d' o   bpx Get_DDB if ax==0202 || ax==7a5fh
+ D  H# w" r0 ^- `8 Y* \
# x7 a+ V. Q( i* ?__________________________________________________________________________5 q  Y. Q% P0 u2 @  h" L

& }6 k  ?, O9 B+ l) P+ JMethod 10
- |  J& u0 b% t% A=========5 |- K- A( y" o# w

4 a6 o; t* P  Q8 M% g) h0 Q) L=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with
' |' V3 S* r- h( k  SoftICE while the option is enable!!; b; u7 D. @, ?% h9 e% N; l
7 |$ i# |; X3 f8 H  z; k, ~) A1 P
This trick is very efficient:( p1 S! b  W) a. G+ R" J- s
by checking the Debug Registers, you can detect if SoftICE is loaded
, n/ p$ [/ n8 e% i(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
. @/ d" S/ T3 @: W6 W& o) Tthere are some memory breakpoints set (dr0 to dr3) simply by reading their7 K9 B  t& L/ `% X# W5 R7 |' W
value (in ring0 only). Values can be manipulated and or changed as well
8 g- v5 y) J( Y(clearing BPMs for instance)
0 f1 A2 X& E( m: ?( D0 V' E$ U0 M: k# N7 L
__________________________________________________________________________
& e# q" t: f1 m' p) P' G4 a4 v2 m$ ?: l% i! }
Method 11+ ]2 \: \4 {" h! x% x' }; f0 y
=========
; N) n, f) y# |) c2 L
. ?# s  Y% e) T, ~5 h9 z3 g5 Z& L9 wThis method is most known as 'MeltICE' because it has been freely distributed
0 f5 P9 R0 k3 ]1 M1 X1 [* Hvia www.winfiles.com. However it was first used by NuMega people to allow
+ }5 ?  Q4 D: T' U4 G. h" K2 WSymbol Loader to check if SoftICE was active or not (the code is located& {$ n% w6 y* L' W% O) Y
inside nmtrans.dll).
3 j: r2 s. A/ q- E' H5 _  o, o
. t, e% c0 Y+ u* w* @4 T6 |The way it works is very simple:6 A0 d  Q' D; U( J, T: _) T
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for! {& G7 O/ p2 P/ A
WinNT) with the CreateFileA API.
  u; }3 W, ]5 y. B
: t6 _  A7 v+ x! E% J9 \Here is a sample (checking for 'SICE'):
5 [" y  b+ O- O* U, L* |! I$ Z. u$ Q) y/ z  W
BOOL IsSoftIce95Loaded()
5 N. g4 S5 Z/ l* B( z( y{
) ~: }' j- b2 f7 q4 O" g   HANDLE hFile;  1 b: v$ t* }7 _7 a+ W( T9 d3 J
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,+ H$ Y0 Z! @% k  y8 M! q9 j) A! N4 V
                      FILE_SHARE_READ | FILE_SHARE_WRITE,  [9 M6 Q7 D) A( E# V" Y, v
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
7 M1 L: F7 O. H) i; b   if( hFile != INVALID_HANDLE_VALUE ); s1 S- |& D$ }  Y1 C8 U
   {% R" K: m% k: `% C- D& ?0 v9 x' \( i
      CloseHandle(hFile);: E+ X* E$ W& i) r8 x0 T/ _
      return TRUE;
$ G1 |& H; a5 p- t; V   }, _) S& x0 c7 [. {% g  Q. b/ E
   return FALSE;
2 G- d% N2 J6 C' j6 ^8 b: y$ k4 E}  F/ w5 r5 W4 i
+ s( h! E2 |$ j0 }$ D
Although this trick calls the CreateFileA function, don't even expect to be
" j& M/ _  s. X! t. |2 z$ G& G7 Sable to intercept it by installing a IFS hook: it will not work, no way!2 L3 u% I$ O# W; ^
In fact, after the call to CreateFileA it will get through VWIN32 0x001F2 a# @( g" `  z# @$ }. B
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function); D- s; S! Z4 `& ~# T0 c
and then browse the DDB list until it find the VxD and its DDB_Control_Proc, Z( ~/ w4 D( ?  `* ?9 R9 R
field.
7 Y/ U9 e, h9 I, w1 ]# _In fact, its purpose is not to load/unload VxDs but only to send a
6 D2 P' H6 R6 H/ {  @W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)& f& [6 ^- ]1 s- T5 \. i1 b
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
3 `9 V% }8 b! E( o, R3 M! X' V) }to load/unload a non-dynamically loadable driver such as SoftICE ;-).
* \% U7 G: O6 r' t5 \& XIf the VxD is loaded, it will always clear eax and the Carry flag to allow
/ b- C) k8 _. s7 `6 ~! c# sits handle to be opened and then, will be detected.
  {3 I+ q. {0 I+ R- e4 HYou can check that simply by hooking Winice.exe control proc entry point  L/ L/ N+ f: Q( |
while running MeltICE.5 c8 O3 q" Q' Y/ B0 C" I

$ u# S* X" ]2 y; O  M' ?' {/ }8 t
* i6 D' M- D: ~; Y# l+ x  00401067:  push      00402025    ; \\.\SICE
# g& X# e/ P6 E( U" Y  0040106C:  call      CreateFileA
  T( B' [3 Y) g" c0 S( D  00401071:  cmp       eax,-001
( k8 j7 \& c* Y$ ]1 N# ^  00401074:  je        00401091
8 K% e0 {" l" W4 w3 E4 }& a$ h# H! `0 }7 R4 w* `

' H5 u: x. b- G) ?; e# l" Z  y0 pThere could be hundreds of BPX you could use to detect this trick.
6 j& e* j& t, D2 `" Q-The most classical one is:. p4 ^' ^0 s. ?' R! q* a
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||+ _. X) \1 k# T
    *(esp-&gt;4+4)=='NTIC'2 h' S" T" S5 l/ n* @5 X' E
6 u* q% ^$ d8 t& q) I7 F# o! C
-The most exotic ones (could be very slooooow :-(
- S& i" |3 R/ ?1 R% s   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  
& j3 |# a3 o4 K  K' F     ;will break 3 times :-(7 m8 s' P" C9 K7 r. ?5 s

/ _* M( \% [' X4 g0 I: {  s. J-or (a bit) faster: - f5 q" j) ?, z8 I5 ?1 b$ A5 {" o
   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')$ C& Q8 d6 N8 k9 g+ n( ~
( A6 C% x9 n, r6 ]% t. y3 e- c
   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  
2 t' t# O; B: t8 X% `     ;will break 3 times :-(
% O' N- U: D( }
  j  P9 V9 v3 M* e! J' C8 Z9 a-Much faster:
, a$ Y2 N  M% ?   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'/ s2 a0 r- Y6 B2 w( V5 Q& b

* s; |) w$ I: w  |* ZNote also that some programs (like AZPR3.00) use de old 16-bit _lopen: G6 T4 I! F! c0 l
function to do the same job:6 D( \7 T. _* N9 T
" ~2 Y! g. L2 n- N3 _; v. p
   push    00                        ; OF_READ/ N( v4 l* d1 p" B
   mov     eax,[00656634]            ; '\\.\SICE',0
* S# g, Q7 i$ _7 o4 ?  X6 F3 L   push    eax$ S! [9 p3 r6 s
   call    KERNEL32!_lopen/ X7 K& y0 j7 d, X; A# e  N  w; l" k
   inc     eax
& j. e. i2 G* s+ G. e. U7 C5 ~* I& {   jnz     00650589                  ; detected% \- D' H& Y! H) r
   push    00                        ; OF_READ
/ \6 m" y  |$ G5 P: P# q5 K2 i4 F   mov     eax,[00656638]            ; '\\.\SICE'; a! b9 {& ?" P" ]9 i7 ^' ~5 b
   push    eax9 O2 P% D- a% a" E2 O2 [/ z
   call    KERNEL32!_lopen" k6 g$ D+ U! a9 m2 g- T1 t
   inc     eax
8 J$ Q+ s" K+ q# y% p   jz      006505ae                  ; not detected
6 o2 Q9 ]% r, i; U5 g$ B$ y8 E+ l# u; F) N! I" i, Y
4 X  e8 {3 J! x+ v1 J0 j' O6 |
__________________________________________________________________________
# S. _- I, q, v+ z* p9 t+ r7 L  H( ]9 o8 v* O$ _& ^# Z
Method 12
3 Z. U( T6 F- @% M) A) R( o8 q1 G=========
& }" Y+ L7 A+ c. k- \  n- y0 a3 L
. o& x! X/ d# J7 X3 wThis trick is similar to int41h/4fh Debugger installation check (code 05& t, h8 z" [. J
&amp; 06) but very limited because it's only available for Win95/98 (not NT)1 c) K% I( y, m  p8 h/ X
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.+ T; t/ Q& k: V) t( ]$ k

2 Q/ J/ G4 C: Z% i& ?   push  0000004fh         ; function 4fh2 W1 |0 c) u* r8 \% C  d1 @
   push  002a002ah         ; high word specifies which VxD (VWIN32)& _1 N: y1 G3 ^# C
                           ; low word specifies which service1 E, k; t  f0 F: ^$ S
                             (VWIN32_Int41Dispatch)* i  s+ I- s, F2 v* w& \
   call  Kernel32!ORD_001  ; VxdCall
+ \% r, Q4 E2 ~8 F% L   cmp   ax, 0f386h        ; magic number returned by system debuggers) e9 Y$ S( N, ?+ z9 s
   jz    SoftICE_detected  Y# l- S' X' q1 G
8 r: S# Y. k5 M% z) i, e& q
Here again, several ways to detect it:+ f2 {; B% D+ H
2 n, Z6 z7 D; X( V( `$ X
    BPINT 41 if ax==4f
; K1 V! q$ v' U) s2 D
  _; J5 Q4 z) d& `6 i    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one8 G; t" m" Z! J% X) j! y% I& B4 L
+ [2 d! M7 u% v6 e: W9 m
    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A6 I' p2 o: K0 O% Z7 K6 C
- p/ V8 ]3 Y0 g/ X$ j
    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!
8 \! K7 q, P* a% ?9 S5 [3 H
. s! ]) j+ e" Y: [__________________________________________________________________________- x1 Y+ `* G/ B5 m

1 _3 y0 w! i) a1 T; \Method 13
; a* b1 J! `% S9 U=========  N5 R/ a4 {2 q6 d
, N. u3 W6 o  {% [  L3 ^( r  K4 S
Not a real method of detection, but a good way to know if SoftICE is
3 |! Z' ~5 c  R. T" Binstalled on a computer and to locate its installation directory.
- C7 H" e* r" N5 ?1 W+ gIt is used by few softs which access the following registry keys (usually #2) :0 o4 g$ c! X# h/ H* e' l
% V1 U4 M/ L1 M+ C! d( e* g
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion$ y; Q/ B8 A) I# P( ?! t
\Uninstall\SoftICE0 X9 {- y2 D1 b8 c5 I7 c, M6 j* b
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
% t. `% I* J1 W! d# J/ s-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion3 p$ R  z: G% q+ {* r
\App Paths\Loader32.Exe2 @6 C4 `5 l! R9 a1 W7 Z

! N" ^9 d  D  v3 V  R& Z$ z
2 Z( i; S( a& QNote that some nasty apps could then erase all files from SoftICE directory
8 t  ]- Z( J0 \2 Z(I faced that once :-(
6 G1 f3 e; w3 _5 l, V9 z  z  w
" M$ D+ @* k' V% }0 zUseful breakpoint to detect it:  c6 s0 B- [7 |/ W- K3 x

. @1 a2 O/ r5 V* M     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'7 R: o* D: f8 ?0 I" G: M5 Y, T0 ]
: K$ m9 n' H* A$ j
__________________________________________________________________________
: y. H6 [0 o2 O* N! }# [. a7 ]1 O* |
/ ?% q% j& ^) F
& H$ g! V; s+ W) l6 ]* YMethod 14 ) I- b1 N" Z, Y0 k, X2 ~8 _& U/ G
=========, v7 Q6 O6 P5 j
" Y/ n0 W+ @" o' O9 q
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose: h' ~3 z3 W1 h8 ^
is to determines whether a debugger is running on your system (ring0 only).
% U, u0 f5 ?9 Y: m/ d. A5 N$ ~: C# v
   VMMCall Test_Debug_Installed
4 q# l+ G; Y4 l7 |   je      not_installed5 l) K" H- W' {! O; X. L

( ^: l) l! A: N- N! O% {6 e: V' KThis service just checks a flag.. n) D+ U1 D: z& ?0 Q: m+ i  U
</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-7-22 13:02

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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