找回密码
 注册

QQ登录

只需一步,快速开始

About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>! i$ b- T* d; @+ X' W
<TBODY>
" q  J! ]( E' e  g3 L<TR># a# k- @! j" G+ G6 {
<TD><PRE>Method 01 " i1 A/ h# [% I* G. m- E4 k2 T
=========5 F, E' G4 l. H; I" v( U' ^/ I

" E$ I; V' W' b. @; z3 M9 ^This method of detection of SoftICE (as well as the following one) is) z9 D3 Z% n, m! e, L! d- g
used by the majority of packers/encryptors found on Internet.0 `, O$ X, R- a2 `8 }+ {6 D
It seeks the signature of BoundsChecker in SoftICE
. \0 l! }6 H5 P' M( a" {& s# K+ w9 C# R( m+ w
    mov     ebp, 04243484Bh        ; 'BCHK'
  @( V- a2 P) s; ]    mov     ax, 04h, k6 ]6 J/ h1 Q' d' {( M& `7 ?
    int     3       $ X1 J, `8 o4 D( R  ^. V7 H
    cmp     al,49 n( @  O8 A# p
    jnz     SoftICE_Detected! {% K5 x& x0 G) u' Y$ H7 R- h
( A* \7 c) \2 k. l
___________________________________________________________________________
$ U. S" U" h7 _: X
9 [- D+ t3 X. GMethod 02
2 Y6 L  {4 R. h3 R  H=========& L1 [, x& r  Q& Y! l

+ a( B% a8 a, m7 p# TStill a method very much used (perhaps the most frequent one).  It is used6 M$ g- x9 w) r3 b2 O* m9 D  e
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,. X7 R7 a( d$ t  ~5 h9 V
or execute SoftICE commands...
0 Q+ b! ]% n# ~+ x: kIt is also used to crash SoftICE and to force it to execute any commands
( H& F4 a# }7 b; v: x: R" Z5 N(HBOOT...) :-((  
- Q6 K: V+ X, V* w( H! [0 S, n
$ S" o, S! J4 {$ [% w/ E; BHere is a quick description:
& H" M; w* |  X! X" M-AX = 0910h   (Display string in SIce windows)4 S  F* l8 E7 p" f! v+ H/ F; E  W$ O
-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)
: z  r8 Z. Z1 v6 H  ]0 t: Z# l& H1 Y-AX = 0912h   (Get breakpoint infos)) \5 o/ Q# P, ~, N3 R- U
-AX = 0913h   (Set Sice breakpoints)) j1 A" M" H& f5 I  T0 a1 ~% H
-AX = 0914h   (Remove SIce breakoints)2 W5 @; `, M2 L( `# h: M

$ K7 f$ N) q/ O! CEach time you'll meet this trick, you'll see:
9 }6 X$ b( h! U% G-SI = 4647h
+ A* n  g0 s. L2 w5 h+ ?( d-DI = 4A4Dh5 _  `. }8 ~/ I$ J. v- I
Which are the 'magic values' used by SoftIce.4 H2 ~4 r% K& {. m1 g+ f' X1 ?
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.4 H! o! ~+ X- n; K) z, ~( O+ ^8 h
! ?3 v6 w4 ^0 d) ]# ?
Here is one example from the file "Haspinst.exe" which is the dongle HASP0 e% {# f6 D/ Y3 I3 u0 Y. X
Envelope utility use to protect DOS applications:
$ {3 t- ^: O4 ?, w3 i! ^# v2 O8 C/ I' A# }( l' e' T+ S9 x7 \
! I0 e/ w9 s7 j( Q6 _% m
4C19:0095   MOV    AX,0911  ; execute command.% k0 h2 Y) B$ d  c: r$ r7 ?5 g
4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
' g6 o& ]/ b/ `! a, e4C19:009A   MOV    SI,4647  ; 1st magic value.
: }! B( R1 v$ e4C19:009D   MOV    DI,4A4D  ; 2nd magic value.( c) H# c! R' Z, f7 ^
4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
  _; n: z0 f8 V* d7 \; D" Q9 x7 x4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute
8 `- U" K3 u# @8 v8 v+ M& Z4C19:00A4   INC    CX
7 [% s7 [( G1 G7 n  Z9 }2 D$ A4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute
" o0 D1 p9 H" j, V* y4C19:00A8   JB     0095     ; 6 different commands.2 d9 |8 x* P- q8 L% q
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
5 |! b/ l1 Z# D4 C0 X6 [, j4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)
0 O( H6 o0 r) _  W/ T: u' B
0 @" I8 U4 k- bThe program will execute 6 different SIce commands located at ds:dx, which
% L3 a, ^# _) Rare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
2 Q+ d0 H- }2 U2 Q6 B. {1 [6 m( c" g3 d# e+ i6 p& ?  ^# a. W
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
7 k" \& K  f/ q9 s: V& W3 [___________________________________________________________________________3 u& H/ E; d7 H# L7 g) Y, A+ l

& s  X9 I1 j- f2 Y% p( n# v" F
: Z) U5 G. S& @( D! I5 ]Method 03. Q6 [- M5 ]3 U, E: Y7 a' [
=========8 O; B3 v1 c* e8 I" O
0 W; A8 O9 W1 f& M$ G
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h4 C/ }5 p! N- Q! i
(API Get entry point)' v* e6 E$ J" ]7 I$ Q
        
" B8 [) b6 P$ z4 H6 P+ t& ?# ^# G! [1 p
    xor     di,di, M4 o; G+ y1 C$ q$ t
    mov     es,di
. s% i+ j. d1 o1 l1 c! q) v    mov     ax, 1684h      
6 u+ o3 r* M, f5 ?# K0 O% ~- z+ ^, m    mov     bx, 0202h       ; VxD ID of winice
1 M% |3 A/ N! L# V0 i6 \: E6 E$ T    int     2Fh
3 \& K5 E+ c$ t% t    mov     ax, es          ; ES:DI -&gt; VxD API entry point
% Q5 ^4 @6 ~& S    add     ax, di+ d/ n; L# o' n& m6 c8 ^
    test    ax,ax( ?+ h; a' Y5 H6 Y* u- h& m
    jnz     SoftICE_Detected
0 n$ k8 S/ b# s% c. j2 U* n+ t0 x" D% ?+ U* |
___________________________________________________________________________4 R: w; ~' t" O6 D4 |) y# D

7 ~0 P5 w: O) FMethod 047 v6 R1 Z7 A) Y8 H8 P4 g1 @, L
=========
$ ~8 g1 |1 y3 h8 c! M7 U1 @
. j# Q+ W  [+ H0 q  {% E$ r7 `# zMethod identical to the preceding one except that it seeks the ID of SoftICE
0 s# N" Z' i, J0 pGFX VxD.2 a  O- G2 M, U* }3 c6 l

; z. R. h- d% Q6 j) G2 [* s    xor     di,di
" H& Y% ]! p% f& U3 B    mov     es,di- u# N2 z+ s1 T
    mov     ax, 1684h       ' x: b# C# o1 ^
    mov     bx, 7a5Fh       ; VxD ID of SIWVID
/ a& E# j+ I  ~. H- p    int     2fh
5 y5 S( r0 y3 V    mov     ax, es          ; ES:DI -&gt; VxD API entry point
; D8 l- Z% i4 ]3 ^" H9 u8 R    add     ax, di( K2 W! O' e' g! S6 D+ y! u
    test    ax,ax
  G8 g! h: _& ~; n6 p( u" j: Y, t    jnz     SoftICE_Detected9 G% i1 P& W, j/ a8 r" n

  {- M7 ?9 c: h) C5 }4 N__________________________________________________________________________
' F+ k8 H. n$ F: }. |. b% ^# O# a+ A/ X7 r# D
' u% d& N$ B' r! E5 Y, h5 l
Method 05
! ~& j2 U2 ]4 r0 e( x; r=========
: B+ R7 F6 V& T% \, S/ A) O$ ^- u  J1 J. l/ A
Method seeking the 'magic number' 0F386h returned (in ax) by all system3 w& N9 i) R7 z) ]9 Y; R3 m8 F
debugger. It calls the int 41h, function 4Fh.
1 _" w' `3 M1 C2 |There are several alternatives.  
4 f% P. f% ?) A$ u6 w& b5 d) Z! w# o& W+ r' {4 }
The following one is the simplest:
$ J+ v) X( L: ^, ]
* J" c5 `& P# g8 j4 c# f    mov     ax,4fh, {! ~8 |) \: B1 L) U
    int     41h* Z6 X$ E% ~1 M8 ?
    cmp     ax, 0F386: b4 Q- B( k9 D3 E4 w. l
    jz      SoftICE_detected
4 t2 k# C5 l/ X
  _5 [( j: r8 S6 v0 X
0 X0 k/ g1 }4 |/ r! n! k" qNext method as well as the following one are 2 examples from Stone's
& [1 `" K) @5 E1 T; j/ h"stn-wid.zip" (www.cracking.net):& _; `. x  y. R
  g) A- n$ s/ }+ `1 |
    mov     bx, cs4 l: z' U6 }" H# }# x
    lea     dx, int41handler2- Z; O( ~! e4 [! t$ K
    xchg    dx, es:[41h*4]# g6 v* L) m# Y  o2 k  c9 @& h
    xchg    bx, es:[41h*4+2]/ A% |- t! H9 w. a' P, j1 c" K
    mov     ax,4fh2 s- a' f  t8 ]" F% ]
    int     41h+ ~2 C/ e* }" D1 Z
    xchg    dx, es:[41h*4]5 P4 f; r/ l* f9 u0 l0 Y$ I3 P- {
    xchg    bx, es:[41h*4+2]! P  K# T* W1 i. p0 z  H
    cmp     ax, 0f386h* q1 q" o1 c' r9 s
    jz      SoftICE_detected* L- t) O5 A, s# Y, d2 w. O1 N

' i5 h' Z0 g  j* d; s" M# X9 i$ Tint41handler2 PROC& |$ j) Z! w- n) n' D$ G
    iret
% I( Q7 P5 z7 d4 ^0 ?: Tint41handler2 ENDP( h" w. H/ ^( q/ q. s0 g8 G$ O7 y

: A1 H, r+ O- Z' X, X  N; n) {
2 M8 `- |5 m. Q0 c& B9 Q2 N_________________________________________________________________________# G# e" l$ V+ U9 w  n8 `* f
% w* q& c# y, j0 [* a2 h: y( C
$ [  v: p# e/ c! `$ {* M. s
Method 06
& W- n* v/ e1 j1 P: e; r=========8 l; Y$ d7 ~5 O9 Q( }2 E

: N, w- I8 }% i* |: u* A
! X! Q* d: X# V8 ~& `2nd method similar to the preceding one but more difficult to detect:! }2 p2 y5 z8 t% F
# a+ g' u/ J5 {; k

6 g) P1 Q$ \( ]! v5 w0 ~' Qint41handler PROC
9 w& ^" ?4 m: \) g( A  B0 ?' n* N    mov     cl,al0 L0 Z' d- U* l; m- z3 u, Y7 R
    iret
2 W8 f+ k0 B4 g. z; y0 q5 ]int41handler ENDP
/ u, L' \' x: e& `* M) ~; h, m! x+ K3 u$ n) C& u% i
5 O2 y& O9 s8 m& D; t% v
    xor     ax,ax8 k3 }3 _5 O8 R$ X
    mov     es,ax
" @. t% S- k7 f  Z    mov     bx, cs' m' G* i4 p/ ?
    lea     dx, int41handler
% h) U: l5 ^+ ]& w    xchg    dx, es:[41h*4]
: @1 c3 ^+ g/ F) u% w    xchg    bx, es:[41h*4+2]+ I2 D6 h  K: E/ f6 A
    in      al, 40h8 S  D3 E) K. s% C' I" q
    xor     cx,cx, e0 g& H6 P! a) R3 ?
    int     41h
0 ^; N* j' M+ v6 T& Q- \: ^; f. a8 W    xchg    dx, es:[41h*4]0 G# [7 w' j! [6 M; x6 q7 J
    xchg    bx, es:[41h*4+2]
6 i9 V6 z7 o9 Z/ Q& |; b    cmp     cl,al$ e, |5 Z8 l" J% a
    jnz     SoftICE_detected; F) B8 T, ^; l1 i

5 P; L" x6 m) t4 L; ^) R_________________________________________________________________________
8 X3 B1 ~' O+ S& a: X, @8 e: Z% `; B+ \
Method 07* f% z* x9 l9 M' z/ Z7 S" @( _, X
=========
& F' O8 u. |, T; X# H
+ g8 c, E/ L7 ^6 l$ ~Method of detection of the WinICE handler in the int68h (V86)* T* t5 w$ `9 m

0 _# H3 d' R1 g' ^. U    mov     ah,43h
+ s' G' E. v% d, x    int     68h9 B) x% E5 V$ ~: z% {: i9 Q4 G% j0 ]
    cmp     ax,0F386h( |2 e8 G' r) n) \0 v
    jz      SoftICE_Detected
+ j4 T- C6 W( J
' G! X4 U; S& C! p" W' Q3 u' I! p, P' ~% k( j6 L6 I! k4 @1 H
=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit6 A% Z% W/ ~3 [& v( V0 ~: a
   app like this:
2 E/ z" p: o% A: n* Y0 t" G1 w8 Y8 Y: O: |2 Z0 |
   BPX exec_int if ax==68, t5 x% W& m, ~' S' Y4 }/ _9 u" l
   (function called is located at byte ptr [ebp+1Dh] and client eip is/ L, K8 e, k3 L
   located at [ebp+48h] for 32Bit apps)) a& @6 f- o/ l2 ^! d: w; v2 a
__________________________________________________________________________
  o8 X0 X1 [& r+ d5 ~2 o- a8 e, \! r3 E9 H& z) C% c

; X" `( _7 L9 J' Y- tMethod 08
* I6 `6 N. S9 H=========
9 O6 k6 V% e% Z1 K7 g  }: [* s& s% Z) f7 N  O5 g# Q
It is not a method of detection of SoftICE but a possibility to crash the* Z( X1 D" A8 r) ]7 W1 d
system by intercepting int 01h and int 03h and redirecting them to another$ Z" U2 R% B3 ]- a
routine.
% l; R/ p; s! m  lIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
; b5 E( S7 f% B$ H+ qto the new routine to execute (hangs computer...)
1 f* v" U3 B: ^8 W+ v" r' }
/ @. p/ V# h7 i8 x" w* Z1 \    mov     ah, 25h. z' Z' T/ {: I/ T' `, ~0 |. d9 l
    mov     al, Int_Number (01h or 03h)
; q, h" f$ x% r  \* t( o    mov     dx, offset New_Int_Routine
2 o4 B) c  F$ t, O    int     21h8 K8 Y$ p) R. P, D' c3 ]" v

9 o7 Q& J% q; R% T# `__________________________________________________________________________
5 Y+ T3 j7 l  q  A2 U" k) [
9 c# {2 |3 F' O) sMethod 09
, P9 s& R$ K' u3 f=========3 L. ?% }( s; X
' I. k, t2 o$ F. S
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
5 W' U6 f0 ?8 s( h% n0 q# v. r! r/ Operformed in ring0 (VxD or a ring3 app using the VxdCall).( f8 `6 |* C& C- X9 R7 i: q
The Get_DDB service is used to determine whether or not a VxD is installed
) b, {& v- s3 Q& Dfor the specified device and returns a Device Description Block (in ecx) for3 B0 R) P  \0 A, R. A
that device if it is installed.
" i8 f& Q2 F; J  D$ e2 v4 o- @, u% T" B3 ]& ^
   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID$ X8 t) {4 Y9 R% F$ ^# ^' b) J; W
   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
" Q0 z  n4 E$ g, L, j! _4 ]   VMMCall Get_DDB6 w4 I) Y2 v4 K3 T- r
   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed+ e: t9 h+ Z9 C
5 m4 D4 m6 h; K9 U: f! ]+ B
Note as well that you can easily detect this method with SoftICE:
5 u1 m  _% W% r4 E6 m! B% N   bpx Get_DDB if ax==0202 || ax==7a5fh, Z0 p3 L* r0 c1 _+ D- t* \

- s1 R1 Y; V# C7 _, w__________________________________________________________________________" o# j& C9 s2 D# h& J2 g; n

* Z: y0 o( s* C, iMethod 108 P5 z* s4 c! V2 {  y& N% U
=========$ U6 h! r8 h# N1 c
$ p6 ^/ c0 b# n- u0 x
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with
+ `5 V8 y, T) f* `+ [% z8 @# f  SoftICE while the option is enable!!
3 A6 s( }1 X7 X4 j' v5 E, a1 @' G* L
! ?% J8 Q- ?8 C$ H" f! fThis trick is very efficient:
, f# ~# `* C/ w5 z  _$ O+ Jby checking the Debug Registers, you can detect if SoftICE is loaded
6 X3 `; {* e5 ^(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if; s' u, h- i, z, v
there are some memory breakpoints set (dr0 to dr3) simply by reading their
# p8 q/ @, C/ F( s) n2 ivalue (in ring0 only). Values can be manipulated and or changed as well1 a3 u8 u* |9 E1 o8 ]+ J
(clearing BPMs for instance): U1 J" Z" H+ l/ \. R, g
2 A" b/ R+ E5 y( m7 ~
__________________________________________________________________________
$ m( {, @9 S  T( q3 B0 |5 B3 l( r& x! m
Method 11
5 X0 A* C, q/ ?# w; `& o$ z=========
  w4 e* a4 G& P$ b& a3 ?9 [! X  w/ p, k/ _" u" f% {
This method is most known as 'MeltICE' because it has been freely distributed: O1 e1 Q9 Q! S& x, O3 O
via www.winfiles.com. However it was first used by NuMega people to allow& P0 v- ^. M5 ?. [
Symbol Loader to check if SoftICE was active or not (the code is located
2 L; t% x" r% I4 O' rinside nmtrans.dll).
" }8 C5 N5 P8 \, r6 m) L( _$ z( T4 l' ]8 Z# z% L2 n
The way it works is very simple:' E: Z' l8 `) P, u: z2 P
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
$ O& I1 ^, ?( g( i% E' [% k1 a" zWinNT) with the CreateFileA API.( M% y6 {, J1 A$ \$ d
! f( f1 E6 o8 M4 ^5 N
Here is a sample (checking for 'SICE'):9 V$ z' g$ b7 q! ^
2 o/ k3 W2 S. }0 x
BOOL IsSoftIce95Loaded()
* J7 y; Y& l3 E" ~7 d5 o{
' H5 R/ g2 v. F- k% U: o   HANDLE hFile;  
. w9 `: t9 u3 n: v7 `2 H   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,3 t) J! e' f3 \+ {7 I( J
                      FILE_SHARE_READ | FILE_SHARE_WRITE,4 r$ D$ d+ a" ~+ U3 ~
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
" B) E* `5 V5 r- a/ w   if( hFile != INVALID_HANDLE_VALUE ). J9 s& Y. F3 Y6 @
   {
3 f( N: f/ {1 A  ?" z2 W4 ^      CloseHandle(hFile);
. N! l" o! c+ l4 |      return TRUE;
( p+ D9 |0 w, k" h   }) ~; T, S0 o5 X8 L$ h. H
   return FALSE;6 D4 ], Q9 l4 P. G, y
}. I. O& S; r; C" O# q$ t
" a0 a0 ~: u1 |
Although this trick calls the CreateFileA function, don't even expect to be; l% }4 S/ Z! T2 h* ]- [
able to intercept it by installing a IFS hook: it will not work, no way!
! Q  ~5 B4 m1 ]! s5 i0 yIn fact, after the call to CreateFileA it will get through VWIN32 0x001F* f- i) k! J2 ], M+ S, T. j" q% J
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
' M7 y# G- L1 {( r" I) [and then browse the DDB list until it find the VxD and its DDB_Control_Proc
' M) L3 F% d# H; J0 I+ l6 Zfield.
! s2 v! v1 ]% j1 f5 y: gIn fact, its purpose is not to load/unload VxDs but only to send a
# H  d, o$ R( ~3 {/ C% JW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
3 C8 g! `! ?# @" Ito the VxD Control_Dispatch proc (how the hell a shareware soft could try) K$ z. Y1 _9 g7 Y! b+ c  J
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
5 b. R7 ~. C. P+ _1 ]& x. e/ \If the VxD is loaded, it will always clear eax and the Carry flag to allow. \' a1 t  a! l* o& o
its handle to be opened and then, will be detected.
: z2 B# _5 @" ]# m0 M; u" v5 |You can check that simply by hooking Winice.exe control proc entry point
0 t$ Y8 ?) Y6 r, [while running MeltICE.5 v* K/ X$ |9 O8 Q0 x5 K: s
5 h9 y9 p6 v+ v* I+ E% p
* x5 M7 L/ A. r; F" h/ r. H
  00401067:  push      00402025    ; \\.\SICE& ~9 o+ b# F6 ~3 d! D
  0040106C:  call      CreateFileA. y9 M. B# j: ~
  00401071:  cmp       eax,-001
7 ^4 w6 k) q* x6 f  00401074:  je        00401091  B$ Y& \6 Z: N( L& |1 a

- }! m) J% ]9 f$ a6 j7 p$ ~
. ^" L0 Y7 x/ c" p+ U* p6 x: DThere could be hundreds of BPX you could use to detect this trick.
+ ?  y* X( n$ w-The most classical one is:
/ s' p3 E* E) }, Q2 h  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||) G! {3 E" d! D! [& }
    *(esp-&gt;4+4)=='NTIC'
; c. y7 G1 u  v- h7 a4 I4 P
! G$ k- R3 f: x) O-The most exotic ones (could be very slooooow :-(. Y5 X9 W5 i) @. e7 _4 M
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  
; F- G6 b/ [) ]0 M7 O; c5 c  i$ e     ;will break 3 times :-(
* o* R5 E, W/ g8 G' u4 q1 a$ f
-or (a bit) faster: " S- R5 @( i* `1 D8 G; Z- N
   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')' l+ K! ^' v; q3 b9 Q6 x& |3 _, k

4 B$ v: L. g( B" E8 Q1 P: n) R- v   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  
) ?+ Q, z/ n; t  n     ;will break 3 times :-(
0 \0 u- a- G8 @' }! a6 y2 }0 U0 R7 S, h" u, c& D, v  n
-Much faster:
( ?2 ?3 x3 m' M8 I, m   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'
5 o  Q. Z( D5 k2 A
) {: O/ \* e9 k6 s! _1 {Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
5 l# ~- B" W/ @) `: j, [$ lfunction to do the same job:
# }7 v# A$ D3 e
  v' g$ Y6 x# h& i' S$ z8 S   push    00                        ; OF_READ1 Y6 V! R3 z5 ]& D+ W& @7 q- r! G3 ~' ~
   mov     eax,[00656634]            ; '\\.\SICE',0' m8 Q: ?. Y( k% U; O9 j
   push    eax, [/ v; i* |. z/ E. g: T0 U% M- a
   call    KERNEL32!_lopen, Y  n0 g, i9 R: `# j
   inc     eax. x* M7 }# S+ o+ R
   jnz     00650589                  ; detected
7 X( B2 v0 h) S6 f& k5 O   push    00                        ; OF_READ, \# {- Y" o9 ]" \) h3 d: _
   mov     eax,[00656638]            ; '\\.\SICE'
9 ~, O% I# j  {- B6 {# b: E   push    eax+ {! Q( g, C. Y9 N- I$ R
   call    KERNEL32!_lopen! @/ ^1 [4 A$ f# N
   inc     eax
! ]- i7 r9 D* F, Y6 I( x   jz      006505ae                  ; not detected
- `: W* N! ~; ?" i% |8 T% w& o/ T* r( r: S
3 T: N/ [3 o" Z9 S" J2 v5 \0 q% C
__________________________________________________________________________
3 R; M; |6 |2 B1 X! `2 k; K9 ^
+ C6 ]' P! U5 W& Q8 w) WMethod 12
5 ~  V  s7 E  k. W$ P=========+ x$ S3 a  a3 \9 O

$ z1 W3 t* q) u7 Z, c, xThis trick is similar to int41h/4fh Debugger installation check (code 05- @- L" g$ j7 g" }2 k9 T7 W$ [
&amp; 06) but very limited because it's only available for Win95/98 (not NT)
5 n1 x" f  a  ~* Jas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
+ l: Y: U6 J) P! I8 y. [) ^+ n# F+ }# l0 d! ?* [7 y
   push  0000004fh         ; function 4fh/ x+ k3 _: ]3 `
   push  002a002ah         ; high word specifies which VxD (VWIN32)8 S5 y$ }2 w. X0 Q8 H
                           ; low word specifies which service6 ]! B( f, P. ?% }2 F- f, U
                             (VWIN32_Int41Dispatch); c, y( `; h+ u# H- @+ g
   call  Kernel32!ORD_001  ; VxdCall8 A' n8 @# F' d7 p, i: J
   cmp   ax, 0f386h        ; magic number returned by system debuggers: u3 ^( ]: V8 G+ }" U3 D/ X
   jz    SoftICE_detected
% M, ]) |7 V, B  m2 [' e
( ]  B* A& \6 Y4 ]3 vHere again, several ways to detect it:* w$ h0 V, @. d$ O$ X$ _

; ^& z; E, \, p    BPINT 41 if ax==4f
0 L, q: k" H' |. X  x, p# {6 i2 N3 V8 `, J) ?2 U5 m
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one
$ r4 A3 Y: R( h% C5 {5 j2 F' P3 T: ?7 L( g) E- M
    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A5 J. ^0 R; d* n

* l" R* G2 G3 u1 U) ^2 l$ ~1 C& k    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!
! o' x, o+ u" z: G  q& B4 }, W2 Q0 S! G. A
__________________________________________________________________________, R5 {, d4 I2 r9 C8 {4 r

. }% b' m! z4 P; X0 M) t4 PMethod 13
; K0 q- N6 {0 J/ b+ t3 a=========4 c8 y7 V% M: V) k' x* X8 }8 ~
3 N* H, Z0 q1 h
Not a real method of detection, but a good way to know if SoftICE is
. _  E' ^: @+ p6 M3 tinstalled on a computer and to locate its installation directory.0 b- N9 q7 ]/ h4 e) b& h
It is used by few softs which access the following registry keys (usually #2) :" z, J7 a! b0 n, i9 p( j' X

; }' l5 c8 N7 d! P- }- }1 \-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion) s5 f: C+ |- o/ Q& y
\Uninstall\SoftICE6 E9 G" R& G' t1 d2 m( ?6 W' Y
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE: ^6 W$ @! P& G5 N* X
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion8 ?* l+ u: G2 g+ Y
\App Paths\Loader32.Exe
# s9 ]! ~( G: X: K
8 ~2 K6 ]1 A. X0 `2 J
3 v2 h7 f4 C, l7 C6 W3 F3 k; o  z' {* cNote that some nasty apps could then erase all files from SoftICE directory
0 M# |* w2 Z. g) ]) s7 j(I faced that once :-(
- n, t) w' O, k  @1 c% D: e( x+ l
, Z- _1 N3 t$ l2 }! z6 A6 V& I6 DUseful breakpoint to detect it:( r! [6 j2 }& [% W1 `6 k+ j

2 ^/ ?3 f, w9 i/ q8 v     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'. b2 W5 {5 {% |! G3 D/ C
5 p- `4 M) m5 b& t1 }
__________________________________________________________________________! d& j& L+ B# v7 q0 \. e
. L: g5 E0 q' A6 {( L* K0 z, b% E

0 _$ W% y" W8 _" I; R" tMethod 14
2 j1 z# r# i5 w=========# f6 A0 A: w/ g& z$ A- Q9 B* ]

0 B0 M- A: l# B# f/ n  l, k" BA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
) ^8 s! |5 c, h. U$ P9 `& l, Z! kis to determines whether a debugger is running on your system (ring0 only).
4 |8 h! ]4 c* O9 g# ]! ]6 F1 H5 M: i/ \7 M1 O# d* J2 ~
   VMMCall Test_Debug_Installed
4 X/ M" }) E& E   je      not_installed
% ~- r( v; K# N7 c6 w. s  y* h) m9 W! F4 s  a+ z5 n
This service just checks a flag.
& ], N% n/ U. n7 n6 Q6 W</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-4-13 10:01

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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