About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>2 u# L8 C1 K& L/ ?
<TBODY>) H. [" q- A4 `, k+ n" ]9 t4 Q4 A
<TR>
! F4 X7 Q! {2 G/ f9 E<TD><PRE>Method 01 : v% F1 u( R4 u4 `7 \) h
=========% ]  d/ A4 ^3 v% o1 e

" a+ P0 y' v: L: z' gThis method of detection of SoftICE (as well as the following one) is/ \. U7 S3 n3 }" l
used by the majority of packers/encryptors found on Internet.
; {' Z0 T+ x7 A3 @, j( p/ i5 LIt seeks the signature of BoundsChecker in SoftICE9 A! Q; s. u! I7 m; x

' p+ |- J# h% ~" d    mov     ebp, 04243484Bh        ; 'BCHK'
3 x& @9 g- J  o9 U- w    mov     ax, 04h
: {8 }0 H; E- B" |0 O    int     3       6 }* [3 X' f. n, A. @  C# j
    cmp     al,4( l8 y9 J) F9 h
    jnz     SoftICE_Detected
* `; F! U' r: [. Z5 k9 Q  {( X: ^- D  R, t' U" ]2 K& ~; O
___________________________________________________________________________, }9 o# j- p$ N

. C8 y3 E0 b  [9 oMethod 02
, x/ X, U3 J5 e=========8 Q1 V2 @* P8 Q/ Q6 z( o9 U/ E9 j
* V) x1 Z1 l$ a, }' |- B# X8 h$ \% ]8 o
Still a method very much used (perhaps the most frequent one).  It is used
0 t* R# n* l/ G9 |) T2 ]- P3 ito get SoftICE 'Back Door commands' which gives infos on Breakpoints,5 }  n) ~: e5 V
or execute SoftICE commands...
+ d, E- `0 ?- `8 a" R8 BIt is also used to crash SoftICE and to force it to execute any commands
& E# y7 m( T+ w6 s$ p( H(HBOOT...) :-((  
3 J  W+ V1 l0 m$ D- {/ y( M7 v: p) }; m  q. s# f7 C& E
Here is a quick description:
3 R+ K6 \$ u) {2 ]/ X3 Q& J8 z-AX = 0910h   (Display string in SIce windows)
' P+ A: Z2 A( V* c; L: r% |/ `$ A) J- O-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)& l9 z! w* m& T) v  t
-AX = 0912h   (Get breakpoint infos)
# i4 N, F, B- P2 R-AX = 0913h   (Set Sice breakpoints)
5 C, ?2 `* w* x; g. F) l-AX = 0914h   (Remove SIce breakoints)( @) E- ]8 @& Q, n1 x: j1 y
# _% d/ [1 B, o& J: i0 {' c3 }
Each time you'll meet this trick, you'll see:3 {* E$ T( N6 l3 V
-SI = 4647h
" e7 s6 P! ^1 n1 h- w+ S1 Y3 L: @, M-DI = 4A4Dh
" A# h3 J  A& e1 j" E" o+ A9 FWhich are the 'magic values' used by SoftIce.
3 W9 f& m. o; c: S6 J- BFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
8 }) x6 `3 g2 N1 s0 C$ H) J& S  ~' T% u2 {" I  J; R, E8 T& c
Here is one example from the file "Haspinst.exe" which is the dongle HASP' O) _, v  \0 Y
Envelope utility use to protect DOS applications:
6 v$ t0 c$ `/ r/ V/ ?& F0 b9 c6 `! }) ^3 b; S& M
: v: V7 P4 a* ^
4C19:0095   MOV    AX,0911  ; execute command.
$ i! e. x  K! ?7 R' q# b  E+ |. Z3 y. L' ?4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).& D% w" @; p$ j; \* T* ^5 H
4C19:009A   MOV    SI,4647  ; 1st magic value.
* E1 N1 X* j4 |  f* Z! H( @1 T; b4C19:009D   MOV    DI,4A4D  ; 2nd magic value.
2 t' L$ C5 D: Q) Q- A; D4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
6 v3 z9 [5 _- r: h( B8 Z4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute
* f4 T* e( t1 f, \4C19:00A4   INC    CX
3 p2 V! x3 h* a4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute
. N5 J! P( g% j4 ?4C19:00A8   JB     0095     ; 6 different commands.% e8 {, O, W- y( Q* R
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
+ h- d3 G# i( ]4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)
7 x5 [7 V5 \' ]% D/ r) a" P* v9 n; N8 l. p& m' q
The program will execute 6 different SIce commands located at ds:dx, which# c- n/ z& O+ `1 f/ @  Z0 U
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
! e% ?$ D+ X' d1 b' h0 p/ W# `8 \3 P5 y7 y$ {! \! j- ]
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.) g6 h; }3 M$ Q+ ?, {: j
___________________________________________________________________________
9 X. |* s! B% ^& Y* ~  A: s
9 H! B+ C8 ?! B5 u- L0 r
6 X) @0 W1 J; [# R1 a" tMethod 03" J: R4 d* Y/ ]3 z3 o( Q8 V8 D/ S
=========
, Z, |* W% f3 x; t( u. H0 ~) n5 u5 r/ M8 z8 h* p& W# \, v
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
9 ]. V7 T" F7 S0 r- _(API Get entry point)3 y3 F2 Q0 N' N) F: v1 Y1 z' ?
        : s. t+ R0 z7 N9 \  D+ W
; w$ v( [( T( p
    xor     di,di
8 d+ k1 ~; a, H    mov     es,di$ Y( b/ \4 C# b& w
    mov     ax, 1684h      
7 l& e4 e: Z! H2 @7 N    mov     bx, 0202h       ; VxD ID of winice* y0 }" n1 Z3 n5 d3 v( o% t
    int     2Fh
9 I& O8 G1 j9 I" C9 J  b# k    mov     ax, es          ; ES:DI -&gt; VxD API entry point% C3 U; P6 z0 S5 l2 v
    add     ax, di
0 P; D& o4 n6 Z7 V" K    test    ax,ax
) ^+ H% {- d- D    jnz     SoftICE_Detected
. r# M7 B& S  a8 R# A
) |, P3 v; i, V) K___________________________________________________________________________
5 f& i1 Q- g4 Y% j6 Q# y+ L5 ]9 c0 d8 n
Method 044 n. Y- B/ t6 r. n# {
=========& N" F  R" j0 \5 b/ A

% h  j( t+ S. H7 AMethod identical to the preceding one except that it seeks the ID of SoftICE
3 S2 [2 ~# a/ a1 K9 V. M$ D) E1 UGFX VxD.' d; J( m8 a0 @% m$ m# k
/ D2 `4 T' O6 u; P( l0 l
    xor     di,di3 W) [# U2 ]9 n/ c3 M
    mov     es,di
* r6 g8 E+ j- x3 y. f# V( u% s  A  e    mov     ax, 1684h       - V$ H3 Z0 V9 n3 z, a
    mov     bx, 7a5Fh       ; VxD ID of SIWVID3 K: Z2 w8 p. H0 @+ N/ W8 w
    int     2fh$ l8 V) ^8 p% S3 `. C
    mov     ax, es          ; ES:DI -&gt; VxD API entry point: @! O$ ~4 j7 w: W; l6 n" F# O0 K9 K
    add     ax, di8 ]! ~# {" b" w$ z% K
    test    ax,ax; t  K5 Q! A) O/ [9 c  o
    jnz     SoftICE_Detected6 D$ K( D) E: U6 _4 _( l8 |
9 D/ _' L+ P% z5 @( S
__________________________________________________________________________5 o- E$ C  V& j0 v) Q! [

) ?4 w3 |; B: a0 O% c: A
: z5 v/ S# Y5 gMethod 05
! ]# e6 E& i) ~+ ^; Y=========
; `4 o0 }0 j8 W  e8 b
$ {  K8 l; g- y& I/ qMethod seeking the 'magic number' 0F386h returned (in ax) by all system
& J( |6 j2 u) z% q6 idebugger. It calls the int 41h, function 4Fh.
2 D; N! t4 ]( `# D  J: CThere are several alternatives.  # S( y. q, W) d& z8 F+ ^
( S* ?) B% p/ U4 B
The following one is the simplest:0 n* n3 ~( O/ ]' G. n/ i

1 x* g" C2 l2 q7 L    mov     ax,4fh; e* t* s$ Z0 g* r
    int     41h
2 z# w) l  Z6 c8 K7 z    cmp     ax, 0F386
1 s% Y' p5 s6 W8 w* l9 A# Z    jz      SoftICE_detected5 _( x, j" S* C1 g) R! v
- ~2 P% y& c. d5 S1 Y; ^

1 s0 O1 K8 f) ^2 i8 z% d  YNext method as well as the following one are 2 examples from Stone's
' P9 S3 ?# f1 t5 ?( i! M5 Q"stn-wid.zip" (www.cracking.net):
- @; q' E9 S' D* b8 g( s' Q0 |8 c4 u
9 p) W1 m8 t/ ~$ o) y$ t    mov     bx, cs
1 Y) n7 A6 a$ b0 X    lea     dx, int41handler20 I/ `6 S+ Q+ Y1 k/ |/ l( r
    xchg    dx, es:[41h*4]
6 _2 z+ Z, _" I9 d* K) Z    xchg    bx, es:[41h*4+2]  ^9 i, _1 ]: K. K& O' e
    mov     ax,4fh5 T/ C) ?% y4 Z% j
    int     41h
3 y, o/ h/ p% j    xchg    dx, es:[41h*4]1 ~) H" O9 G) H
    xchg    bx, es:[41h*4+2]
2 u" g. t3 v) G0 i+ E/ B    cmp     ax, 0f386h
& P4 e0 i1 B6 ?* I* _- ]    jz      SoftICE_detected5 b( {$ f- }/ }4 H2 x! \

( S7 u+ G! n3 Pint41handler2 PROC! K6 j$ J2 C9 H
    iret  A* @  P7 z9 a: x1 N
int41handler2 ENDP
, _, R6 \" Q; ?0 f7 {% A
" Y. W1 g' Z4 X) `
' G% L3 e8 P( H5 @# a& v_________________________________________________________________________! c. V1 {$ V0 L* l, o

) w7 ^4 J" x# `4 v) K$ m$ @' E! g9 J& T& j
Method 06& d8 ?7 A) H, ]% c$ F
=========
: e- N7 `$ @9 }, E& j9 H: _
) Z& h( @" {" Q2 h2 ~5 N# a8 ]& j( y0 v5 v( o
2nd method similar to the preceding one but more difficult to detect:9 Z* j4 l) _; `' c9 w- t

+ ~$ \- `/ j+ V6 q1 i/ P) N; _3 l+ d8 Z" y( U7 {9 e
int41handler PROC
: t. Q) |3 Q4 a; z( @    mov     cl,al, S+ N( K8 g( }" X1 F6 S
    iret
, Z# d7 P5 {* I6 O8 A" ]) rint41handler ENDP$ X4 t3 M: F/ ?
' I0 M7 L6 u9 z4 P% }: t

1 M: n- m1 f4 k( y& n8 M1 C    xor     ax,ax
  ?; [% ]$ D9 K7 J4 G2 h' t    mov     es,ax
$ @0 y1 _( G+ q- m    mov     bx, cs1 t! ~( a# E2 y/ ?
    lea     dx, int41handler
! i2 f% ^4 W* Z1 r: {# P    xchg    dx, es:[41h*4]3 b: O0 F8 g8 a1 V/ b
    xchg    bx, es:[41h*4+2]- ]5 F( \5 x# ?2 u
    in      al, 40h
/ N; Q; y. V* g+ s1 v& \7 @    xor     cx,cx
+ W3 c- k4 I1 F  n7 f; n    int     41h
( N0 r# I/ y! H8 c    xchg    dx, es:[41h*4]; R( o/ Q$ w4 t& ~
    xchg    bx, es:[41h*4+2]
2 K& X' @" n' j, ]7 Q1 u2 y    cmp     cl,al* [; _( \" s4 S
    jnz     SoftICE_detected
9 z, f; s$ s) H" U) k
  u' \8 s6 t9 K! p_________________________________________________________________________$ h0 w: P' y& ]  l

/ ?1 }3 [$ w0 l& a$ [7 hMethod 07, F8 P# E. c+ G; {& d% V! {
=========
' }" x4 Q" J' C7 O2 J9 M; q! w4 n7 V& i
Method of detection of the WinICE handler in the int68h (V86), R: [) M8 z3 [3 D
& A& c; R; T8 Y  m( I; w: G) U* `
    mov     ah,43h
0 p. n6 |" \9 k8 h% H! X1 [    int     68h
2 s  P! M4 N& N; e/ B    cmp     ax,0F386h
1 m/ o0 E2 d0 B! R" b2 u    jz      SoftICE_Detected
* Q0 H5 v8 ]$ M/ x( v8 @( U+ g! F9 E% y
9 F: S- Y5 ?# @5 {- N  ?& d5 F$ `( y9 l
=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit, Z. Y1 T0 X: x9 b# ~7 E8 l7 S" }
   app like this:. i0 m0 t0 i! K2 S) _1 H6 I& C

# }6 G" |# ]9 W; z  R% _- `( J   BPX exec_int if ax==68
" l% q- }5 \' T  n4 n3 S* t/ J   (function called is located at byte ptr [ebp+1Dh] and client eip is
% I# h0 ~# Q: N2 z/ E7 A   located at [ebp+48h] for 32Bit apps)
1 A% g$ t$ Z8 |: O__________________________________________________________________________
6 o" h5 H0 D* \, a$ A7 y9 e* B4 t* b
1 X) k: F$ h, z& r; g. r" g8 l  K* n+ L. ~! H2 I3 Y
Method 08
& k+ |$ M% j+ n* V/ q& @, z3 o=========  W  l3 l+ c; _% U# G8 F: f) H. T

: `+ f" u$ I# a! Y" DIt is not a method of detection of SoftICE but a possibility to crash the
: Q. a- _3 B8 X- L& h6 o( Psystem by intercepting int 01h and int 03h and redirecting them to another
7 I+ y+ g' u) w/ l0 x5 wroutine.
' D' y* Z, A& G# M2 x% uIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
, G9 i; a$ \: Vto the new routine to execute (hangs computer...)! e5 l+ h8 \3 G+ U$ F
  b9 b# |: ?/ T; T& e. w  `" L! y
    mov     ah, 25h  v6 A( g* ?; j0 f5 F0 y( I
    mov     al, Int_Number (01h or 03h)
5 N/ ~0 g! C- U% J  z/ E6 ]    mov     dx, offset New_Int_Routine
* U; @+ ~4 T% E    int     21h( |2 @' H0 i( X, @4 G7 O

8 {7 K# f% b' @  t__________________________________________________________________________5 H1 b+ q* Z0 g1 ]( c6 O
* A7 O* r; Q: r3 i
Method 09
$ I# _3 B: |# X3 X: f$ e: s=========. S6 ^5 ~% z: L) Q8 X
1 m; x3 W1 [. F; q/ K
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only! O3 `# _' W8 t) O) J
performed in ring0 (VxD or a ring3 app using the VxdCall).3 ?. _/ i1 k9 N( M; b- b
The Get_DDB service is used to determine whether or not a VxD is installed
* A# J& t) y6 v% bfor the specified device and returns a Device Description Block (in ecx) for
' e5 s$ L# j. ]8 T9 o! n/ dthat device if it is installed.* f' a' D" d* c- c

+ i+ N: k6 o1 |: p  B" k   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID/ S" S) n0 H0 _4 V3 M4 ~
   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)  ?6 @* N: y& K# z8 }& q
   VMMCall Get_DDB
- @8 P! u3 W+ C, J+ z& Y" o' d   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed
5 G$ P& s4 b! L8 e
2 J( w& J4 r2 K9 v, ]Note as well that you can easily detect this method with SoftICE:
3 ~+ M  U$ X. p9 A. x   bpx Get_DDB if ax==0202 || ax==7a5fh' [& `5 K. J" K( m" Q' w% W

6 R8 I2 P* @& ^9 s: w__________________________________________________________________________) ~; R- @3 m# `% n8 n$ Z

. u( m5 M  L& Q2 ~" q' bMethod 10
7 y4 |) q1 l9 \2 f. C' K=========9 Q# ?# P! S; B

. i) U; k; i  Z6 i. k=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with
& }1 y' R  ?# [* }2 J  SoftICE while the option is enable!!4 G: U* P. T  l! }: i7 `
' q) l6 ?) f& b: Z* U
This trick is very efficient:! c9 s, E- R7 `
by checking the Debug Registers, you can detect if SoftICE is loaded3 A7 b7 \) v/ L
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if' l8 b2 T& [& G) @6 V- w; b
there are some memory breakpoints set (dr0 to dr3) simply by reading their
0 M: q$ Y3 |4 U0 `! u) I# Xvalue (in ring0 only). Values can be manipulated and or changed as well
' D# x. R" h7 y( b(clearing BPMs for instance)" r4 d& M1 R* B8 S& z$ `$ M

* c2 E: Q$ y$ |7 S8 ?__________________________________________________________________________
9 ^( ?; ]2 b" K: q! `* T1 k8 o: i9 N  a* Y
Method 11
  v  P3 X( w4 Y" }+ X1 ~  e- W=========
6 j1 G3 ~3 D% X% ~" M( e, D' q7 D$ J3 ]
This method is most known as 'MeltICE' because it has been freely distributed* X3 F+ d6 y8 n) s6 V% d4 h) T
via www.winfiles.com. However it was first used by NuMega people to allow- @1 a* {* G: O0 J3 T3 _
Symbol Loader to check if SoftICE was active or not (the code is located# {& y. r! R9 D7 d/ F9 N) L
inside nmtrans.dll).6 l" z2 n9 z9 N) {
9 T% b5 Q/ z% w
The way it works is very simple:7 W- c- M6 Y& x8 U
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
$ x5 t/ f0 b5 b% u9 o( VWinNT) with the CreateFileA API.
( ?( t# t( f+ F# h! P; w) \
. F8 \1 m+ O. q0 H4 B2 t- hHere is a sample (checking for 'SICE'):
. `. b2 K5 ?- V6 e- W% K% x* n+ L; Q1 }0 ^' b' S
BOOL IsSoftIce95Loaded()
2 k5 p  z, x, j2 k{
2 D1 [9 z4 {/ o& [( ?! ~   HANDLE hFile;  
4 A- m; O+ `2 E3 Z7 }   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,9 G' Z! X7 J9 Z, C# C
                      FILE_SHARE_READ | FILE_SHARE_WRITE,0 `/ E! n: s  ^* a1 r5 m( O' y
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
7 S* q7 v% _  E% p4 v# [2 p. G# s2 K   if( hFile != INVALID_HANDLE_VALUE )
9 L: k( U( }  L* }/ x   {
7 K' p6 ?- V) J  ]8 X+ X- a4 y, H; t      CloseHandle(hFile);* P9 ]8 i0 {- Z* `! _7 Y
      return TRUE;
4 ?* G1 L- q7 V& l   }
  \5 E1 w7 ^) D* o( H   return FALSE;
0 A$ u" l+ q# F}
' g: _+ e2 Y% z' f- A; Q
5 P9 \- S- D4 `Although this trick calls the CreateFileA function, don't even expect to be
2 q" }7 {  b" \- Zable to intercept it by installing a IFS hook: it will not work, no way!
9 A. E( [! Q/ z. m' D* fIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
8 ~3 A9 z5 T8 L+ v. k% h! \  ]3 }service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
* i& D' }: _" C, |& f  cand then browse the DDB list until it find the VxD and its DDB_Control_Proc
* Y9 Q/ `8 c, jfield.7 v, Q" W/ a. q$ p! R
In fact, its purpose is not to load/unload VxDs but only to send a
4 Q* E- r/ e4 d4 a: g# [0 fW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)/ x, n* S' [" A) \  z+ ]& B
to the VxD Control_Dispatch proc (how the hell a shareware soft could try' V5 G- i+ H. a& O
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
% M' K1 R& X  r& R' TIf the VxD is loaded, it will always clear eax and the Carry flag to allow1 L& V1 U/ K  Z/ L" O# l/ p  a
its handle to be opened and then, will be detected.
2 r9 F+ K6 W# ~1 f" cYou can check that simply by hooking Winice.exe control proc entry point5 B- P+ ~* s: a6 X
while running MeltICE.3 u$ |7 O6 b1 A9 f

+ S: P6 P  o; x1 |, s& U
; R8 g) D: X" O( ?* Y  00401067:  push      00402025    ; \\.\SICE5 Q5 `# c* y! c+ c4 d+ `  p& p
  0040106C:  call      CreateFileA
2 N9 d' Y$ q0 [  00401071:  cmp       eax,-001
) e2 y. Q( Y" m! Z  00401074:  je        00401091/ d; E& Z: ~+ e) Y! T5 B

! z; m6 Q' d& [) k& I: G8 t
, N! B  q# _  U" G- lThere could be hundreds of BPX you could use to detect this trick.
0 _. z% W- P% L1 C-The most classical one is:( T+ e) \' J: }0 [1 {% X
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
. G3 ?1 k# m. l6 U7 U8 J    *(esp-&gt;4+4)=='NTIC'0 g0 D( a: `: N; M* l8 O' N+ e

4 H0 f; `1 y1 `/ E: b-The most exotic ones (could be very slooooow :-(' G# J  q# s' L5 c% E
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  / C  L$ G# n" C  K( Q6 q! t
     ;will break 3 times :-(
( X! e" r( `, j( r" S# R. D2 m  B( P2 A- E4 R* a' Z  E
-or (a bit) faster:
) L* ^/ P6 h3 a& Y+ O   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
" W; f; I) G) S0 T0 `8 O) X- ^7 ^+ Z3 U. {
   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  
0 n/ o7 S4 X7 Y3 f; }8 l7 Y1 q; @     ;will break 3 times :-(
$ I+ @/ M$ y! I
7 M4 o5 }1 d6 N. y-Much faster:
4 e6 l. r& `* U   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'* q0 E) K8 ]1 N) u4 N+ `1 b( T# p
+ |3 c" N: ^) ]9 a' _3 I, X$ l
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
% Q+ j# C% J; Z+ A8 P* a/ ]function to do the same job:
. I5 ~4 B+ Z# G9 o' Z2 C/ u) i# \1 {7 A) m; j) I9 u: z) o- }# y5 E
   push    00                        ; OF_READ
7 H3 Q3 }5 B/ i4 C9 c! d1 a) m   mov     eax,[00656634]            ; '\\.\SICE',01 O# [5 I" l; R4 y# `
   push    eax( v$ n' N7 C; r' G. e( p
   call    KERNEL32!_lopen0 F! |1 c% [0 d0 L: v+ J
   inc     eax
2 k8 ~3 c6 a; O  ~! g   jnz     00650589                  ; detected
+ e% Z% V$ K2 g; Q  ]" D. [   push    00                        ; OF_READ
; p3 G7 ?" S5 L5 A. L  D. x2 A) I   mov     eax,[00656638]            ; '\\.\SICE'9 C2 @4 M. R# z9 a
   push    eax
1 |% U7 h! s' A& G; Q- _& o& ?9 e   call    KERNEL32!_lopen9 K; ~! Q+ r7 t+ v
   inc     eax# D3 e' m0 u5 U) u+ Z2 Z
   jz      006505ae                  ; not detected
) j- ^" D& l. H* z( S  x
2 R6 l# f$ o- `  j. l6 |
& w1 i, t# v& N; ~8 c: w/ e__________________________________________________________________________; u3 \5 b' y; T

4 t1 g' w; {9 k  N1 I7 R; \Method 122 [5 f5 c3 a* n& B
=========+ e; |5 B" H  s% ]/ e0 L5 L
( ~1 O- w' J* O$ c: x
This trick is similar to int41h/4fh Debugger installation check (code 05
$ i' ~% X) }& F; r, n&amp; 06) but very limited because it's only available for Win95/98 (not NT)
2 ^: k. j) ]/ `' A$ a) Cas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
: u3 E4 t/ Z6 c
( u: ^5 _, t  r$ ?; I. l" O: m   push  0000004fh         ; function 4fh( G' x+ @8 B" I1 s8 q# ?5 n, O
   push  002a002ah         ; high word specifies which VxD (VWIN32)$ r, [! f" W3 c& b7 d
                           ; low word specifies which service! o) X6 Y# N7 I1 m/ L$ l, }
                             (VWIN32_Int41Dispatch)
! ]5 n7 n- w" v! n! H9 I  f   call  Kernel32!ORD_001  ; VxdCall5 }: H0 {1 O- @9 j" O" ?" T
   cmp   ax, 0f386h        ; magic number returned by system debuggers
/ S2 y; ^! ^; N& O5 x( F   jz    SoftICE_detected/ t- z7 l" ?7 `* V* @8 I6 g

& T  a4 ]4 t# p* k$ rHere again, several ways to detect it:
6 \  h. Y( U5 }8 _/ B8 _  v: ^( i/ x' I4 @# m; w6 o
    BPINT 41 if ax==4f3 [' f/ h% f; s$ d( ]
8 O# Y1 `0 Z8 r' }6 R% B
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one
  N; V& o- U- `7 ^7 \( a, j5 E! A+ ^( j6 `  Q3 B$ Z3 K/ q
    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A# _8 r8 [' f; U% I* F0 L" C
( B0 s/ \; y; M/ Y4 ^: m) I
    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!5 ~3 U$ ~6 ~' ?0 B- i$ U, [- j
8 X+ [4 k1 E% Y- @5 }
__________________________________________________________________________
0 g! K/ _5 ?* M3 O0 |, Q/ Z0 q3 \  M" W# Y$ c1 m* L- ^
Method 13) T& O8 Y# C  C9 n9 R$ C: z
=========
* m! {* \' N- O
9 d$ W1 f: V7 I* @Not a real method of detection, but a good way to know if SoftICE is6 D' I2 g, \8 z- P" Z9 s* r
installed on a computer and to locate its installation directory.
! z$ D! [: [! n5 ~$ M# f6 H+ MIt is used by few softs which access the following registry keys (usually #2) :: W' g% [; _' x8 r. y

& j1 T: G5 O  G7 L-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion4 O6 Z- I& f; F
\Uninstall\SoftICE
0 R' j& S9 `% O-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
; s' ?, m4 X* P6 H( `-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion9 y5 m. Y( g9 d: E5 @
\App Paths\Loader32.Exe
3 y* V6 I3 W0 L3 a2 {# ~( o
0 W% x5 K5 ?+ Q0 z0 b0 T3 I* @  k4 K# M+ `2 V% g# [* d  Z
Note that some nasty apps could then erase all files from SoftICE directory# m" g) ^2 k. e, n8 C
(I faced that once :-(1 Q, _# M# L: D' [

* w" B" \( u2 V4 J  D  u3 |Useful breakpoint to detect it:
- v, P& q- F5 c; d" ]! e+ y2 Z, j; N1 v
, x9 z/ X9 o$ [6 O2 A2 z3 o     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
; n) b$ }) ^, W. S
) g; c* W0 [9 D$ m( ]1 R/ B__________________________________________________________________________
! r4 i4 M# E% e
6 A; M# u" b. g- T" i3 ^, j7 R
2 Z7 `- B# m) b* ?  uMethod 14   K) W* P/ @3 n* U( ]
=========
2 Q) r, f! c' l  l) ?: S0 |6 g
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
" N, }1 W4 O7 K3 g. T4 c, His to determines whether a debugger is running on your system (ring0 only).! O! Q) \# E; L, O
$ E  s, V* \. i. c7 S3 p' l- ~( J
   VMMCall Test_Debug_Installed9 v8 B- S! J6 F) j
   je      not_installed
& a5 v; ?4 _! J& S, i+ g9 @* N0 A- M* f* z2 T4 u
This service just checks a flag.
( J7 `# Z; `. Q  Z; n" h</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关注公众号

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

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

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