找回密码
 注册

QQ登录

只需一步,快速开始

About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>/ a0 ~: R: \9 X/ r. y1 i
<TBODY>, j' H+ v9 O$ @! W2 |( f# |
<TR>: ~& l$ u! |' {2 U8 g
<TD><PRE>Method 01 . X* O- v/ J% S9 m
=========; D1 N9 Q/ g- D  y# K0 ~. `* D& a

5 N$ u# a  A) R: U* KThis method of detection of SoftICE (as well as the following one) is
, }& n0 p* _: B3 ]used by the majority of packers/encryptors found on Internet.; K" [$ d! U8 O* [' V, A
It seeks the signature of BoundsChecker in SoftICE
- P! o1 K3 k4 N8 O+ s* d9 [% r/ s, H$ z/ B1 H* ^: o
    mov     ebp, 04243484Bh        ; 'BCHK'  F6 h# J: M8 V: k' B
    mov     ax, 04h
* x, W; U% j' u$ Z    int     3      
! B4 [% B* ~/ B$ m! {& Q    cmp     al,4: I  D$ U, Q7 t" Q* L( v
    jnz     SoftICE_Detected
9 L4 y" O4 o% h+ N: u
' g$ J; Y3 v8 L5 \# s- m) l$ E; H: N___________________________________________________________________________
' ^! p0 _$ i8 t0 T4 p, P
. q$ B9 [0 p" ?$ L% L! ZMethod 02
5 r' I" G* _1 r" K5 K=========) U: C7 I- l' L$ w+ o5 c

" c9 y' G3 j  J& cStill a method very much used (perhaps the most frequent one).  It is used/ U+ ~; f8 P8 ^( U% K9 g$ J
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
- x$ q+ _( ]& N/ c. L4 U9 q$ xor execute SoftICE commands...
8 j+ v7 {# i( d6 n9 x! A6 ?9 y3 R) IIt is also used to crash SoftICE and to force it to execute any commands5 D. \# b$ E3 m2 v: a7 b1 X
(HBOOT...) :-((  ) I2 s% c5 ]6 z/ f2 T: w6 @( g

) K( o- p" p2 ]" X( X) k' JHere is a quick description:; ]( u3 W# q% L4 e( w/ f
-AX = 0910h   (Display string in SIce windows); k4 k2 @1 j  O, w8 x8 b- S' I2 i
-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)
. n' q- q& ?/ y-AX = 0912h   (Get breakpoint infos)9 r$ ]. l2 G3 D4 v9 a# R: X
-AX = 0913h   (Set Sice breakpoints)! j" ?: j2 k* s: K1 z
-AX = 0914h   (Remove SIce breakoints)3 y+ c' o: }5 [
( H6 ^8 o# B7 o* ~$ G: J; W6 \
Each time you'll meet this trick, you'll see:7 z, \6 ?1 z+ F# d2 y
-SI = 4647h* Z  L- V$ S7 ^+ ]  q# f
-DI = 4A4Dh+ V( f, X9 G; `9 w- ^
Which are the 'magic values' used by SoftIce.7 k9 Y2 F0 ~5 R1 t/ t' g" _
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.4 W- o/ G4 o" ~; g( I+ ^/ X- e/ K
+ O% K4 ^- d/ P! ?
Here is one example from the file "Haspinst.exe" which is the dongle HASP
2 S- x% S& E/ c7 K: WEnvelope utility use to protect DOS applications:
3 s3 M, R) y9 _' z, ?# h: v- `# a8 e
2 }6 o9 L" P' ]' ^: \) Z8 x
4C19:0095   MOV    AX,0911  ; execute command.
& U0 }8 t( n5 ^! O/ {4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).& ~3 x% l& P; B, X$ M2 \
4C19:009A   MOV    SI,4647  ; 1st magic value.
" p2 O/ t! t' a5 N! @4C19:009D   MOV    DI,4A4D  ; 2nd magic value.
: o/ n: y( W4 a6 ?: G4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
% f. _" y+ C2 y: A2 k; J: o4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute& p. O0 \: X2 b
4C19:00A4   INC    CX# p: Z7 W; \- t1 K$ D" g
4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute6 |; s) ?* r- ~
4C19:00A8   JB     0095     ; 6 different commands.6 p$ `* |0 P9 w5 ]$ i- p- ~
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
7 g6 Y5 ]- f" G4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)
: A; X2 y* B. ?! L4 r' D2 d$ Y1 i
. G9 h4 \5 p7 r+ K: cThe program will execute 6 different SIce commands located at ds:dx, which
" e/ I/ Z6 H! F; E  C+ m; c8 c# oare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
/ E' V/ G- y0 Z, w& P% d/ Q( q1 h2 N+ r7 a  X0 U
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
. n: R2 b8 y1 o/ v$ P( F. L1 j___________________________________________________________________________
% q. v) O9 |' {+ c* k3 e5 w: g* i' J! q  ^- @: n# [

0 _$ ~! x* b: IMethod 034 I( d, I' H( k# V
=========
% L$ ~& d! E5 V+ J/ ?/ j) Q
( t0 A& `) F' t% V& S" S8 |Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h9 t6 Z' L" K0 k; C
(API Get entry point)
  A+ w7 f% m- k) f0 I" ]1 B# Q) O        
5 K' b8 t  c8 D$ \0 h& C2 l) l# |3 _1 v" j( F% V
    xor     di,di) E1 |2 _+ u$ [5 |3 n
    mov     es,di7 \; l. I9 l% W) R" @, P% b: B
    mov     ax, 1684h       % D# @9 R# Q6 |) Y
    mov     bx, 0202h       ; VxD ID of winice8 p' j2 D/ ^5 z7 g! H, `
    int     2Fh
; ?' }) {0 K( r    mov     ax, es          ; ES:DI -&gt; VxD API entry point- q! @: v0 v* y: E% I+ O1 a+ t
    add     ax, di
  F* H5 {) T( d3 ~    test    ax,ax
7 g7 P# d/ ^/ Q2 d    jnz     SoftICE_Detected
/ O4 @0 ^9 i" ]3 M
5 a' W0 {) y+ |: ?6 S" H% F% @___________________________________________________________________________
* a( F0 u% l2 T$ c- _; N& |2 Q& M! D' _1 K
Method 04
0 }+ p1 @+ Z0 C2 `, D) N: h=========
! W0 B. b3 X, F) X* ?: V
1 J* Z2 B4 d! X6 m+ D5 J! |Method identical to the preceding one except that it seeks the ID of SoftICE
' g4 ?5 G" j5 @, c2 I  ]9 FGFX VxD.$ Q+ K4 ^0 Y! [& }# F/ ~

9 ~0 Y! _$ s/ _( k/ X7 W- {* r4 r    xor     di,di
% }' [8 o; |7 |% c( h+ |! u  e    mov     es,di
  H5 [8 ~" K; Q    mov     ax, 1684h      
( d; F; W) a! _1 R    mov     bx, 7a5Fh       ; VxD ID of SIWVID
2 k8 o; z9 n9 L8 z3 B    int     2fh5 r6 Y0 B: e0 n2 f$ z, n# S( \
    mov     ax, es          ; ES:DI -&gt; VxD API entry point9 V0 M; _9 C4 r4 m8 Y7 }
    add     ax, di  j$ d. H- X' r  j$ V, p* v: P8 H% @
    test    ax,ax
" e- V# e" U( _4 a; ?$ V    jnz     SoftICE_Detected
' h) }; U0 c4 c$ G" ^# n( X8 S2 b+ T0 B$ ~$ ~' V
__________________________________________________________________________
0 F! b* m5 g4 N" q  e7 a8 H1 e& [  k

0 V' V( L/ N: W# o# wMethod 05% t& \8 o) h! n' T6 ^4 I
=========
* T5 }. e2 ^3 Y2 |# o) Z( ~" S. [+ {$ O9 `, v
Method seeking the 'magic number' 0F386h returned (in ax) by all system9 ?8 n# k# q' i; o) q3 c
debugger. It calls the int 41h, function 4Fh.( n. j; i- K- A: D
There are several alternatives.  
3 J/ `3 l8 |: W* S: k- L
9 Y5 W6 c- u) fThe following one is the simplest:
# ]  t, D8 E" O0 P5 b+ e6 V! {4 K, f; |) h# w, `
    mov     ax,4fh
' c& B+ t* U: E& N1 r+ Y- q( `4 K    int     41h. J1 w) c5 x  D! k/ G% y
    cmp     ax, 0F386$ q1 A* g/ q; D9 f6 Y1 r, Q8 w& P  n
    jz      SoftICE_detected
% U9 B* k1 S! ]; Q$ _
, a+ z( Z0 M/ `
* J- j' b: y2 ]: |Next method as well as the following one are 2 examples from Stone's ' g$ @8 p( E7 S5 k' n
"stn-wid.zip" (www.cracking.net):
! G" L7 N; s; [* n' L( ]2 w6 G0 ?0 c8 M! r$ a* Q6 c6 z" j
    mov     bx, cs
5 Z+ K0 `& F8 g3 g6 K; A    lea     dx, int41handler2( a  \1 H# l+ L0 i3 ?
    xchg    dx, es:[41h*4]! S. r" {( [8 V3 @! ?* u
    xchg    bx, es:[41h*4+2]
+ d& _% ~  S6 H: Q- W4 ]: B; ~  Y    mov     ax,4fh
3 G6 f3 s4 T8 b4 s/ G    int     41h
; P+ b/ c# B8 [+ d- ^9 ^2 T7 N! u    xchg    dx, es:[41h*4]4 ?. r  w" m# s* q% G
    xchg    bx, es:[41h*4+2]
2 f5 u- }% B: j/ h. J: w0 O: p, w    cmp     ax, 0f386h
& \. q5 @  H' X3 K% x* C! z( {" G    jz      SoftICE_detected1 i' g# h( b' D9 W" n! T

, o& D9 H8 U( e9 c! l/ P8 G6 x; B8 Vint41handler2 PROC- G- h' U% b: }
    iret" z+ K2 Q; T$ j* m& _6 ?( q" T2 W- {
int41handler2 ENDP1 R9 G1 D& ?* A* \0 T. K

' t% V) z) ?8 c  t. p6 ?
- c7 |; Q3 l- R# m5 g7 V2 S_________________________________________________________________________
! Y' ~0 n1 q5 A1 R. _1 I+ k: {5 b4 H; Q

+ r* n, ]5 J! F' C% JMethod 06# U5 j1 q; r# Z
=========9 K1 @2 r2 b: Y. Q" Y; l' D: Z

2 q& M& N1 F7 U# q' f- j$ ~- e% _9 _* t# S( I+ N/ h- I
2nd method similar to the preceding one but more difficult to detect:
  S9 ^8 N) Y( }; R$ L
( [# ], c6 @. V% |
0 K* k" F4 @: k+ F8 _* aint41handler PROC
4 a( F" M" u, J% U' N' J    mov     cl,al: P8 k! s: h2 }- B2 ^: ~1 Z. c% N
    iret
  I; U" [" H" D8 y. t- C4 Iint41handler ENDP
8 i4 _3 u2 }4 h- R8 f4 Q$ Z2 w  Z# b6 O2 M7 x

4 K- g, S; d5 O. E) s    xor     ax,ax/ o' q; p+ A* e3 r/ B
    mov     es,ax
) c& K3 j) I" h/ Y    mov     bx, cs
& x" w9 I4 ?& f+ M  L2 G    lea     dx, int41handler" j* f& v4 d! T+ `7 y* ~
    xchg    dx, es:[41h*4]4 S& t" r3 O; K/ W" N& y7 s
    xchg    bx, es:[41h*4+2]
  `' n. a# a2 p7 K* X    in      al, 40h5 m& ^2 ^  p* P* n
    xor     cx,cx' p8 v# `( h1 H- n% S
    int     41h
; ]) K+ B4 e* T& E& I    xchg    dx, es:[41h*4]% x% F! G+ n1 _* W
    xchg    bx, es:[41h*4+2]
2 E! B7 V& \8 J    cmp     cl,al9 o+ r* Y- ^) X2 _% d
    jnz     SoftICE_detected. Q8 u/ r7 @1 D( s( r. ?2 M7 B/ m) W
2 b5 U4 o) h8 _" Z9 a
_________________________________________________________________________
$ Z/ s$ g& @0 }/ m, M/ S! o0 v, y2 Z9 ~' x0 e2 j8 G
Method 07
2 e! N2 D& p4 K/ z7 `1 M  ^=========
) E/ h8 o0 Y( W- C+ i7 y6 p# f! o$ j8 Q
Method of detection of the WinICE handler in the int68h (V86)' c6 H- X- Q  f( h7 S
8 c0 B/ f# }- \% f$ A
    mov     ah,43h
0 t2 E- w( i7 d+ M    int     68h9 M* |' r5 n. @) V5 i3 Y! D
    cmp     ax,0F386h7 c, }7 f8 V. q" x' L3 @
    jz      SoftICE_Detected
$ C) d, t5 G/ m0 B: S2 Q6 y( k; |/ A: C$ j- ^2 V& d3 _* V! m

$ \- P. q3 D0 m  O=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
2 ~5 ?0 _9 D  @: h) Q6 `6 G   app like this:
% H/ K0 \; W9 A- p; P' y. G) e/ o; h) u: `- V, ]" Y1 b
   BPX exec_int if ax==68# B/ E2 D# X% X. y+ d
   (function called is located at byte ptr [ebp+1Dh] and client eip is+ \5 v1 s$ ^4 s
   located at [ebp+48h] for 32Bit apps)
+ Y) x- p  l. h# ?1 P: Y2 W( S. j__________________________________________________________________________
& {4 _2 l3 S1 p8 R- R; O' @' J( X/ x/ |+ W+ S, B6 ]5 [, t
2 B% K- p( W9 l6 u! B( `5 |% E7 v
Method 08
# J: v* A. z6 Y  i) F1 B& T=========
6 D& p) I0 e1 I3 q7 M, d
  Z/ ?. Y% m  U; L( F7 QIt is not a method of detection of SoftICE but a possibility to crash the% J+ O4 G: e6 S/ g3 v) T7 n; ^4 a
system by intercepting int 01h and int 03h and redirecting them to another6 n0 \0 w/ ]4 c/ [
routine.
; w+ C. T+ ?* ^; u9 y; Y# lIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
( y6 X7 n) Y1 k4 S- v/ B5 dto the new routine to execute (hangs computer...)
" x/ S, T6 I4 F: L; {5 ~5 s3 j
' {! u) I6 E$ k+ K4 n8 _# I    mov     ah, 25h8 \( u/ B* w6 N) R) @+ c' D  P- D
    mov     al, Int_Number (01h or 03h)
: a6 s  {: A9 @( V6 I% n" J& Y% g( S    mov     dx, offset New_Int_Routine; Y4 ]) i& D  e  n/ ]8 D2 u
    int     21h
  Y. L; }: z. R; Q% l5 m7 t# G! R; m# ]' F$ p8 d  w
__________________________________________________________________________1 [/ k/ H' F  t. f+ m

. [3 ^$ \* a% r  q4 v! j) HMethod 09# |+ ~1 M5 S9 ], ~/ C8 L* `1 E
=========
8 {3 E0 C' u/ S/ D; l2 v/ q8 P2 H9 F& S# d; w/ }$ X5 W  h, g
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
; F0 ?" q& u, u% Aperformed in ring0 (VxD or a ring3 app using the VxdCall).
( H3 H$ C0 z# Y. s9 c# z% |/ xThe Get_DDB service is used to determine whether or not a VxD is installed+ M, ^  c- Z. I6 r1 u4 W. v5 |3 O
for the specified device and returns a Device Description Block (in ecx) for
. L3 Q6 i6 F8 k6 j  jthat device if it is installed.( F' r: \; H4 q3 C
$ j' `4 k5 K& {8 F- ~
   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID0 M( b* |; v  P( y* C- e
   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)7 o( I+ \3 ]% ^- u
   VMMCall Get_DDB3 _' A/ |- h' e. p. t8 _
   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed
+ B$ W" ^9 A2 `: v1 q( R. F5 ~
. ?( f% s) N0 ~5 ~# `; m7 G# `, U' G" kNote as well that you can easily detect this method with SoftICE:' J# K3 a1 M) V# ^
   bpx Get_DDB if ax==0202 || ax==7a5fh
) l3 I, s" z! Y- @: N+ U9 P) I' x% @; M- I
__________________________________________________________________________& V% X- T" i; F8 @) {

4 A% V* u% F9 H5 P! P/ [" ?Method 10. c) }* c* k: o' l/ b
=========
$ g2 O$ k' i  _! @3 _8 b; I$ {# N, _
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with' I+ P& t0 t2 Q  m& K9 Z- `- ~# t( w* m
  SoftICE while the option is enable!!( _0 R- s7 y% R0 i0 x5 O* e
8 E% \8 I, Q: K# S* T1 X
This trick is very efficient:
. Q. l7 r) y1 iby checking the Debug Registers, you can detect if SoftICE is loaded$ p& b$ F: V$ `- N; j) ~: n
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if3 C1 R8 c3 w) V3 A
there are some memory breakpoints set (dr0 to dr3) simply by reading their2 m: i/ d* {7 K5 A' ?* O( G( H. M
value (in ring0 only). Values can be manipulated and or changed as well
1 D' `: _' ?5 r( N(clearing BPMs for instance)* c3 @& Z/ Y, \. C8 q3 `
6 A) D2 f# W# u, `5 o! v
__________________________________________________________________________
" [! S5 E3 x' P; w. |
% Z7 O* K2 ]8 l" R+ g. \$ h; g/ O* D, jMethod 112 F$ m' J5 [3 z' l; C& d6 _0 B
=========
. A1 C+ e! n+ P9 ]' b: N7 W1 i1 F1 `4 |& l. W5 L: r; q! v
This method is most known as 'MeltICE' because it has been freely distributed$ ]" U7 M, m) l/ b' {) g1 O
via www.winfiles.com. However it was first used by NuMega people to allow
8 T0 M1 f- L" {Symbol Loader to check if SoftICE was active or not (the code is located
# z4 I3 N  |% Qinside nmtrans.dll).
: N# e/ n4 B2 M3 i5 ^8 p! y7 o" y( r1 c/ |
The way it works is very simple:) E% S! F( r& e' r0 [
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for8 B; u1 H% A* g  k# l
WinNT) with the CreateFileA API.% m2 ^" d! I; X( e

& G' d* c$ J8 e( `. o. r# V% w" J# aHere is a sample (checking for 'SICE'):1 U1 |; R. K2 b% P6 h2 u

, F" Q4 d. Z5 |BOOL IsSoftIce95Loaded()
% n9 b2 e" ^0 u3 E" m{+ a. E6 c  u# i! U: J& a
   HANDLE hFile;  ; R, S: k/ i+ I3 C" M% E
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,' c% I9 Y" \, K5 |$ u4 z
                      FILE_SHARE_READ | FILE_SHARE_WRITE,2 t, J+ W% H* `8 r! p# \
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);7 I1 Y+ K# e2 Z2 @
   if( hFile != INVALID_HANDLE_VALUE )& Q3 ^, i* R7 G6 A! F
   {
4 S- `- ?8 U6 V* f      CloseHandle(hFile);
  s$ H, z' B. t2 r3 Q      return TRUE;( Z0 a1 b& e2 Z$ F2 W) W  W
   }$ J0 p0 G( S2 g! X% |  I. J+ v$ d
   return FALSE;: J) V3 Y/ {- z' u+ F
}! G$ E4 J! U7 I

& p% F" ^* v5 z7 i! o! ^# [Although this trick calls the CreateFileA function, don't even expect to be7 n+ ^. g8 ~- O5 G# R
able to intercept it by installing a IFS hook: it will not work, no way!
& x0 P0 E! ^6 s7 _% DIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
5 B5 Y: n3 k- V3 l0 ?3 U  Mservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
/ x, D) f' p. y: d; h+ h  |and then browse the DDB list until it find the VxD and its DDB_Control_Proc
$ G6 d& H( @$ q/ I2 _field.2 j( f) J, s8 j% b0 m
In fact, its purpose is not to load/unload VxDs but only to send a
( \1 n8 |6 g( Q0 i1 mW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
3 H, ]+ \% ^. S8 R9 \! H2 G$ tto the VxD Control_Dispatch proc (how the hell a shareware soft could try
" R. k9 q" f! h. A1 u2 r( \to load/unload a non-dynamically loadable driver such as SoftICE ;-).9 T0 S+ w" k8 E7 h0 i0 _3 U
If the VxD is loaded, it will always clear eax and the Carry flag to allow1 c% S7 {, i( Y8 \8 ?9 F
its handle to be opened and then, will be detected./ x6 I# @( l& Y. o! N; C
You can check that simply by hooking Winice.exe control proc entry point
, U% m- R" a* y* d+ q4 n# twhile running MeltICE.! G, E# m% y  H0 ?, j* C0 K
0 G! B7 p; ]! K" E& T9 a/ @& I
! ?; }, `$ I- ]% {
  00401067:  push      00402025    ; \\.\SICE
1 W% B! a! ~+ f, `7 D  0040106C:  call      CreateFileA$ |9 {, S7 Y% R6 M
  00401071:  cmp       eax,-001
, e/ F$ Z* C2 j7 u6 g  00401074:  je        004010914 Z' H# z+ j2 Y& }% [
1 O; Z8 ^8 E, E2 O8 e1 P- E9 x# X7 O4 r* t

9 E6 h/ M' i$ M4 U, jThere could be hundreds of BPX you could use to detect this trick.
2 V. v, i% s$ n# n-The most classical one is:: z2 g' e+ m: R! X- `, A8 k# ^
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||# u3 y  H6 ]' N" }' T- j
    *(esp-&gt;4+4)=='NTIC'
: |% i" C& P' C1 ]9 U1 J
# m+ o' b9 o$ j-The most exotic ones (could be very slooooow :-(; O- ]  N! G! f4 z' ^7 @5 Q
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  7 E: p2 Q3 ?' z# [( C: a
     ;will break 3 times :-(
8 ~' r* X+ ~+ M' G& @) t: g
0 G8 I( z. \6 m; P: l/ `-or (a bit) faster:
2 \, @+ K0 s6 J/ H+ e2 O) Y1 I4 }- x   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
2 p+ E7 {" T' h1 }8 \& ~& u1 k
, ^8 {) i) _& V; {! @   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  
- }' s' `6 O) }2 d5 H; ?* P' o6 f     ;will break 3 times :-(9 R9 J& s% p* Z$ ~3 _# N+ j
( `5 _/ [8 I- `( l
-Much faster:
, L+ {8 v! f0 K3 {) w6 R   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV') E& d) U" x9 _3 d8 S& I

6 |+ g. h; R2 l; I' [Note also that some programs (like AZPR3.00) use de old 16-bit _lopen' @& h+ w/ c$ ~
function to do the same job:- \. P0 h$ ]/ T5 H% N  @( Q+ M
- E) ~+ l9 \! ^3 F( @5 @& H+ K# B
   push    00                        ; OF_READ6 l' c+ j0 q+ o6 l7 T1 ^* |
   mov     eax,[00656634]            ; '\\.\SICE',04 e7 n6 C& d9 g; e
   push    eax
! ]7 k* o/ B5 s* C. G   call    KERNEL32!_lopen
4 `& w& R/ G6 G+ L+ Y   inc     eax) Q/ p" D/ I  A1 W
   jnz     00650589                  ; detected
; ~# d; q0 }1 K& \; @) I   push    00                        ; OF_READ
5 r% {7 q4 m  h; [% g; {& R/ p   mov     eax,[00656638]            ; '\\.\SICE'# U) v, `3 k" H8 N" X
   push    eax& G) m. r) k3 p3 J- P" w
   call    KERNEL32!_lopen
4 s) R& y2 a- v  {' n   inc     eax
* P' ]3 R9 q2 u( E   jz      006505ae                  ; not detected1 v' h- x- r% m" s+ P8 A8 ]
$ f9 w3 v0 h# i) |

' w* G* G3 Q5 G% `8 I# t, s__________________________________________________________________________
6 o) e+ U* ?) F) k/ }8 S: \. n# ?( {
Method 126 _. V/ j5 e$ \: L
=========
- X# U# u. \* n3 Q& b; J6 K$ j- r' k
This trick is similar to int41h/4fh Debugger installation check (code 053 G# W% m5 ^0 ?, C
&amp; 06) but very limited because it's only available for Win95/98 (not NT)
. ]* ]+ v; ]0 B0 W6 C* ?as it uses the VxDCall backdoor. This detection was found in Bleem Demo.* o& u: D3 g" X  J" F6 T3 `) m
/ Y$ ]2 F2 l! B$ G8 o! m
   push  0000004fh         ; function 4fh
1 I2 H  j9 q$ u   push  002a002ah         ; high word specifies which VxD (VWIN32)
, \5 v7 ^4 F& Y. Y* |                           ; low word specifies which service; D) w+ y/ q* b) w1 q1 G* R+ \
                             (VWIN32_Int41Dispatch)
6 |# k# B% |1 z$ _  n1 U; U   call  Kernel32!ORD_001  ; VxdCall$ u! S' {* Q# ?, i4 L" }7 z2 T: w
   cmp   ax, 0f386h        ; magic number returned by system debuggers; C0 B! J2 e1 w# I0 w
   jz    SoftICE_detected
+ _/ j* m# J  Z$ Y! Q8 W/ g$ G7 s- J* L6 P% @/ @' I1 R+ ^
Here again, several ways to detect it:
+ d2 r( N9 d1 V) o# {5 i9 d4 ^: y- @. G( L
    BPINT 41 if ax==4f
- t. R1 z& w% ^$ ^& @$ U( o  {6 d! x8 Y
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one
- X0 {; V. f7 S& i5 @
7 b9 J$ }3 y' ~8 \    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
$ _0 j% ?% q/ l" N6 I0 _
+ \) X* f# r  D! \% N4 E* h7 s% y    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!  _' e9 m- a( K

0 p$ o5 ^0 v; M__________________________________________________________________________  I1 ?: T( Q, b; h+ X, Q
5 [+ O) r) {, C* f4 K1 p$ z
Method 13
5 `8 M8 q1 v' i3 R* r" x; ^=========0 w) K3 V+ c. r* a: c/ h
4 R; x( A. q9 E. C
Not a real method of detection, but a good way to know if SoftICE is
5 U1 p( |2 `! J0 @* I3 [5 N* ^installed on a computer and to locate its installation directory.. ^# Z. y2 O) ^$ X5 s5 t3 d
It is used by few softs which access the following registry keys (usually #2) :4 c( y; }' y* z; @% r2 _: n

* I# y; V* i6 ]' O2 O* l1 m$ p-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion: t: z/ M1 y' y; h0 G! _1 P
\Uninstall\SoftICE
/ O& L0 F) q( z! q) s7 ?-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE$ z0 \0 h+ Z4 A$ U
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
' y0 c% \; I% ~. [/ f\App Paths\Loader32.Exe0 b, A2 h4 c3 A& y5 q- d7 B

1 t  r. b6 ~2 Y1 L5 R6 S( W
1 C2 ^& P  q/ K+ V! mNote that some nasty apps could then erase all files from SoftICE directory( _' v) x" x: D
(I faced that once :-(
/ X% h6 f' T/ A+ ~# M" t
2 b; S; w+ J- V1 ZUseful breakpoint to detect it:
5 i3 M" z: v: h5 G" P2 A  j# H9 \* {
% R- s" d  [+ m     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'4 Z, S, z  T, i% f) a3 O6 U

* K; |/ O4 X7 p3 L) H__________________________________________________________________________! a( Q3 Y4 l4 J7 s

. n  x5 d$ U& d! `" T: m/ w. E5 k" v9 m# e9 U- s; W
Method 14 8 n; T" Y* A" f8 S: M0 X
=========
5 I' P1 q9 a! h- ?4 k0 u& C  t7 [6 v. i3 T8 R& \% X! d- b
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
8 e4 t$ k+ n% d6 b$ z& v2 u8 Mis to determines whether a debugger is running on your system (ring0 only).
: T3 g! g6 _1 k/ X
$ s% ^% ]! A6 f' J* P$ P   VMMCall Test_Debug_Installed
5 B6 v8 r3 V# [* r3 `; Q3 a% ]: Q. r   je      not_installed% @. b: }' c# J9 a$ i: |

. L4 }! L) Y0 r: AThis service just checks a flag.5 E+ I: s8 V6 |" E2 e
</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-1-13 07:24

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

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