找回密码
 注册

QQ登录

只需一步,快速开始

About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
8 h, s' l# ]/ L<TBODY>5 A/ M4 t# y- O; N
<TR>
8 w1 n1 R7 L( g  x2 H<TD><PRE>Method 01
8 Y, i- X4 t3 l+ }' X3 T9 @! Q1 X=========
0 g3 P$ E& {* t$ d; h3 A3 x
. Z6 y9 P5 P% v  K' H2 ?This method of detection of SoftICE (as well as the following one) is3 d% a, D8 }" L( e! l
used by the majority of packers/encryptors found on Internet." F8 C2 E9 E  x/ X$ U7 d, B
It seeks the signature of BoundsChecker in SoftICE
; ^2 k# p( @/ U8 W' Q; p
; \+ M- `6 w6 Z! O    mov     ebp, 04243484Bh        ; 'BCHK'
# G) N0 P5 Y7 N- \4 F$ t    mov     ax, 04h5 e' a- u  ?) m. _7 o6 Y4 m. w
    int     3       9 D2 t0 @5 w6 {* u1 a7 B
    cmp     al,43 S% ~3 F9 S; O% l7 I3 o8 i
    jnz     SoftICE_Detected
8 k0 {4 G" h+ G1 L2 q1 F' {
1 d: \: O1 P- x- C4 ]) A___________________________________________________________________________/ m; H! n# Q- y9 M6 [; @6 ?9 u

2 ?# `$ l! V) ~6 BMethod 02+ _* P! c5 b8 Y# k, X7 q  b4 ]0 }+ `
=========
. _. c3 J7 J2 U! Y) j  [! O7 I3 m4 z- E1 l$ I7 b" f
Still a method very much used (perhaps the most frequent one).  It is used1 P; C9 `+ F8 W% B* ^, h! g
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
+ h- v: x" `1 h! tor execute SoftICE commands...
+ O' }- n3 P, p) j2 n0 d% V6 q. }It is also used to crash SoftICE and to force it to execute any commands' B$ \7 M% s2 B/ S3 ~: b% F7 P
(HBOOT...) :-((  
; v* k6 B. I; J5 ]3 h5 f
( |0 ^3 C7 R& X3 kHere is a quick description:
# n; g! e7 P: ~; J! l: d-AX = 0910h   (Display string in SIce windows)+ v/ V$ s, P* {6 d& P. n3 _
-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx); h( q( s2 `' p, c5 I- E
-AX = 0912h   (Get breakpoint infos)
6 d7 q) G; k; C3 L1 y' s-AX = 0913h   (Set Sice breakpoints)
* t; K$ D4 |9 E2 M- {-AX = 0914h   (Remove SIce breakoints)
4 J' b+ c( a2 N1 b
! l6 \; n) l3 c5 g$ M2 q5 bEach time you'll meet this trick, you'll see:: ]% l* x+ P1 S1 o) d. y
-SI = 4647h  l) f0 o- z' V+ S3 x7 V  ^9 h: b2 w
-DI = 4A4Dh; g* _1 f8 \1 G. T# p9 s) e
Which are the 'magic values' used by SoftIce.
$ a* C( A' n! M! Q7 x) U  b5 eFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.4 N# j) D9 o/ H  M

8 J3 I) j  Q6 r7 u/ {Here is one example from the file "Haspinst.exe" which is the dongle HASP
/ S: X1 C, N$ G; FEnvelope utility use to protect DOS applications:
' T! E/ {- g& q# t4 I
* i: k3 X# E( l$ K! U7 y* E+ G1 }) a) ]% @  R& y; V9 q
4C19:0095   MOV    AX,0911  ; execute command.
5 r& M( R. |: v( m. A- u4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
% O' q) t5 n  r5 p4C19:009A   MOV    SI,4647  ; 1st magic value.
  L( V$ b1 \* ~# g' B3 E4C19:009D   MOV    DI,4A4D  ; 2nd magic value.0 H  ]; f  @4 c" b
4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)/ ?" D# `. c/ y6 P$ Z
4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute" a" ]5 {( v7 A6 I* L: a) h- c! D
4C19:00A4   INC    CX" I' k8 m( \, R( R
4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute
& R+ w( [. }  o3 \' p* y; ^) |4C19:00A8   JB     0095     ; 6 different commands.2 h, ^* V$ L! x) r: ?' y! {
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.; o& _$ O% `2 q( X
4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)7 I9 _3 q! Q* E# Q$ Z6 N0 \
2 w) I! `/ H" ^' R8 \( L- k: q: S
The program will execute 6 different SIce commands located at ds:dx, which6 h7 }  N" R: l& h5 o: }
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
5 u7 [3 p) n% Q/ ?) q  }% z+ ?1 p7 s
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.0 P) l9 o- p) \3 [% E) H1 ~3 u
___________________________________________________________________________
4 j( H* _$ G" _2 p. S- P# a) o! L3 Y; H* S0 C, u8 e- ]8 ?# o% M' P

0 d" n0 @2 j6 C. t* u, l# g* YMethod 03' [: R1 N5 I; ~- M' |) ?
=========
% U3 f# ]  x" @6 t( R) m! H& [1 B
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
8 ]* x8 V$ z0 {(API Get entry point)5 W- D! V3 |# l$ }
        1 \$ `, U& n7 E$ M. u; k
; N2 ?" s, \2 J6 |& V
    xor     di,di
, ^" K) I' h( o    mov     es,di9 i# l; O/ Z0 }5 p/ s* k
    mov     ax, 1684h      
9 g; k( O: D4 J! Z7 d    mov     bx, 0202h       ; VxD ID of winice0 x" C2 K  l" {- H
    int     2Fh
7 V# l% H( [$ S  ^    mov     ax, es          ; ES:DI -&gt; VxD API entry point" y4 {- I3 U8 ~0 Q# T, b& e7 {
    add     ax, di
) n9 T( V& z5 Y    test    ax,ax: w$ h! p8 _  N& ]" ?1 C' h. s
    jnz     SoftICE_Detected
2 j, L0 x: r  Q* ?2 Y6 E; A. `% H/ d" k* o4 t  V
___________________________________________________________________________/ q4 L4 K5 @+ |1 k# Q# x
/ r% ~3 y( n* A
Method 04
- h+ I4 M7 Z! L, [. N=========+ J; M5 Q; g1 K, S9 M8 h& ^7 \
' ]  [0 l3 K% m- ?- z& \
Method identical to the preceding one except that it seeks the ID of SoftICE
' {) D1 ]3 C2 [: q3 iGFX VxD.
2 i8 B6 T% x8 U% w; u6 q6 }% q' F$ j5 x# n1 G4 \. W% ]$ L
    xor     di,di
8 U# S7 s9 O* \5 h1 ~    mov     es,di
4 g2 A! ?/ v5 D- W6 u* H2 \  \, z' m    mov     ax, 1684h      
& O+ Z5 m3 R- K4 m) ?: g    mov     bx, 7a5Fh       ; VxD ID of SIWVID- ?. ~1 h# ]. F: J% s
    int     2fh/ U; M- w4 Y/ k! E" f
    mov     ax, es          ; ES:DI -&gt; VxD API entry point
2 ^1 A- P% B# _2 W$ P* k' p    add     ax, di  X# {2 F. [- V0 V2 a1 M4 j- H
    test    ax,ax# Z( V8 T% p8 w! q
    jnz     SoftICE_Detected, V) u. E, ?4 H4 w

5 M/ a4 ?( M5 V9 w( Q% u4 ?__________________________________________________________________________
$ V5 x4 g* d1 n; m) e* [5 O: R- j: j" Q# o& `3 Z- V

9 M8 R6 g' K3 T4 R, ZMethod 05
$ _$ z. q7 E0 n. ^5 C  K1 \=========+ E0 B" a  z" d8 P; T1 ^6 e

, ~3 v! M+ x2 s( Z7 }  {9 AMethod seeking the 'magic number' 0F386h returned (in ax) by all system# i' |8 b8 e* v6 x5 l
debugger. It calls the int 41h, function 4Fh.
8 P& u  `: G$ A8 QThere are several alternatives.  - I3 W; t+ Z; c# x' s

+ _. V) V9 F+ P/ |5 U8 {The following one is the simplest:
/ @3 X0 E, {! x$ I
! ~% p4 g! s3 ~" {/ A    mov     ax,4fh  d! Y* \4 F% E$ r2 g+ M
    int     41h
0 H" G- J$ Z- D3 H8 I    cmp     ax, 0F3865 g6 m8 C6 p/ M& \# }( f
    jz      SoftICE_detected& |$ b: i; _. k. @
9 Z! p2 x* \, o# r8 E
" p1 o, C+ D9 q+ Y& ?" L
Next method as well as the following one are 2 examples from Stone's ; C3 L; k: O+ t# x, U( |7 O- H- \
"stn-wid.zip" (www.cracking.net):
5 V" T6 \, q3 p: Q  w% a! ~: V( m+ z. B& v0 l0 t+ a
    mov     bx, cs
. t- s1 d$ R4 _& t2 [4 I    lea     dx, int41handler2
) Q3 v7 a% P; U1 m3 B4 \% p    xchg    dx, es:[41h*4]
& ~3 C$ ]- h9 ^% Z: t* x1 Q% O    xchg    bx, es:[41h*4+2]
8 \4 L  I' {% U' q0 h    mov     ax,4fh
( E, _% B- x* W& ?1 S    int     41h
/ x& V" ~6 j4 T+ V4 F) S0 v* q    xchg    dx, es:[41h*4]9 U4 z5 d9 P/ Z3 t. T# o9 S6 y
    xchg    bx, es:[41h*4+2]
9 {- J$ M( u  v6 U9 A7 a& ^' s# }    cmp     ax, 0f386h/ t6 T& \. t. M# C
    jz      SoftICE_detected
* e' ~( R$ m7 Y. H# T/ m/ h# ~, N5 Y( b2 b7 J  G) d% L8 I
int41handler2 PROC
5 P" x: L8 t+ `) j8 M    iret3 h- f* k  Z5 J( {6 R& M6 V
int41handler2 ENDP
9 [2 X  D: l' f+ T- ^8 p; _$ _/ y% K/ E5 T; g" F+ A; n4 Q5 @

% o5 S1 ^% j4 z. g_________________________________________________________________________
( K$ E  Y9 R8 o6 a* R. X3 j6 n# T* y
# ?8 m8 @; w$ B9 H5 z8 O( D& L$ u1 j7 T$ e( `5 h
Method 062 {0 w  Z+ ~/ k
=========
& X9 G1 Z0 c- j2 Q" o% Q3 f3 z6 D5 Z% R$ k  |" X3 b$ C- Z
+ v" a+ U" Q4 Z+ I9 m0 K7 X
2nd method similar to the preceding one but more difficult to detect:) N" n8 v, [9 j: A8 w

5 Q8 X3 \& ~7 d( ]4 e8 K6 d4 Q% B; v3 Y' z
( R% ~8 A. l4 [, s! l/ Tint41handler PROC
8 |/ g7 Y5 `( }" z% @" H$ W    mov     cl,al9 V* n( M2 z4 V
    iret
2 K; |! B% F8 H( w. Wint41handler ENDP
' m4 X  y1 h: _. L2 [: `% [. }
0 x+ y1 Q0 F$ [& N4 i4 t5 s
$ H; b% d+ t7 r2 t) P  W1 l& \) n    xor     ax,ax
) u2 x0 e4 @, f8 |, j+ j    mov     es,ax
9 \6 H' I: u; {9 |. _    mov     bx, cs
2 t- c+ X9 ^( t    lea     dx, int41handler
! s, v! H% _) T8 p4 z3 h1 @    xchg    dx, es:[41h*4]
; ]/ d0 c) c0 L) g# h    xchg    bx, es:[41h*4+2]
$ s/ t! U( {( |7 C. p! h) Y    in      al, 40h* u0 l. O- @0 J
    xor     cx,cx2 b- T, W& U+ J. d1 I' j$ x; l9 S& ~
    int     41h3 `" _5 d! f' H7 Y" I* L- h' r
    xchg    dx, es:[41h*4]* |8 ?5 v6 i3 p# A
    xchg    bx, es:[41h*4+2]
# k5 i. k; A6 {) X; I    cmp     cl,al
% L& W& u" @) x% n- k- n    jnz     SoftICE_detected
% n/ @& l: C; j! o- w% k8 j' c: n5 O3 {1 G
_________________________________________________________________________
  n. L, j! [7 o7 q, {2 R/ _1 q& j
: R! U" A2 T' [- W! rMethod 07% v/ ?" i2 }" b
=========2 X3 f: ^* Y  R! z( E
: u) @: s. `7 m% a9 e
Method of detection of the WinICE handler in the int68h (V86)3 w# c. A& X  h0 k6 a5 l

& ^$ T& X: K7 ~/ v" Q    mov     ah,43h
) R( S$ O$ u/ n5 w) q  _# W) u* G3 n    int     68h8 J& E! ^+ y* I& L# A
    cmp     ax,0F386h
0 B; k  c& |# T5 X- L    jz      SoftICE_Detected
& Q% g* k% F; R" }
5 ]- `) x  a) p+ ^# U: O
. ?( I, F4 {! a/ I0 E/ M: ]0 h5 C=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit9 D) p+ x% e; Q8 a5 m5 j  P
   app like this:  G5 W9 F3 ?; _; ~" g& ~9 o- l

$ c2 q! m2 v- g3 w0 h& `7 M   BPX exec_int if ax==68
$ J# K- a- B, f0 @# ^+ d- t   (function called is located at byte ptr [ebp+1Dh] and client eip is
! N# `+ m% j9 }  k7 Q/ _   located at [ebp+48h] for 32Bit apps)
0 r/ {% S+ n/ N# D3 ^" K- L__________________________________________________________________________. E- g+ ~* I8 M: r/ j3 q  B& g: \

- F) z1 W1 C4 x! I6 Z0 p6 @  B! {/ {% n
Method 08. A3 G" |, L+ i0 P3 s! o+ p
=========
. V' E/ J( h2 s, d
3 k" s1 n! x+ `( E, wIt is not a method of detection of SoftICE but a possibility to crash the
1 }' q# q( A2 ?$ T9 Rsystem by intercepting int 01h and int 03h and redirecting them to another/ c# {" O# _- p
routine.
4 g6 [1 H) k* rIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
& T7 r# W, h; V2 P. s5 }& nto the new routine to execute (hangs computer...)
% ?% W( o' n# A( F- h! K* y( o$ k( L8 t. f. X( |1 E/ W: g
    mov     ah, 25h
& A' i3 v9 z7 E: C    mov     al, Int_Number (01h or 03h)1 I) M% O0 O7 {) g0 t
    mov     dx, offset New_Int_Routine
* n9 J5 @" D& c! H8 u+ P/ p# w    int     21h+ _" s* I, J9 S( V( W

6 P! `. C! E0 P5 D0 K& |% T__________________________________________________________________________
. H& w8 ~9 |% r8 F8 R
& I1 G, C3 e7 E: V5 j) ^! K* [Method 09: t' U7 |# C: c+ n, j2 C+ O" w; Y) A. [
=========' s  w1 q* T/ d# w  P  F. ~
& ^3 A, w. t$ x+ i! V  O" c
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only/ ~& p( j+ d  v$ @6 C) ^9 H6 s5 H
performed in ring0 (VxD or a ring3 app using the VxdCall).5 i9 A+ X7 K) ]3 c% a' c* o8 c
The Get_DDB service is used to determine whether or not a VxD is installed
$ C; `2 x( s5 _8 @2 pfor the specified device and returns a Device Description Block (in ecx) for
6 [, i2 o- o0 B, n/ ]: Wthat device if it is installed.: [% M0 e% G( S# g

+ E  Y4 j" ]4 F8 b   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID
) C0 J1 @* y* @3 D$ r# O   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
3 a& A) {0 P1 @$ v( ^6 S* J   VMMCall Get_DDB
, m5 r$ I8 S- E6 h4 w( l   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed( }& }* X9 o. M+ G: l( K% ]+ p
9 K/ g; P7 \: m! N! J* H, I% A
Note as well that you can easily detect this method with SoftICE:
7 J2 c1 x7 O7 E& H0 E   bpx Get_DDB if ax==0202 || ax==7a5fh
: o( f1 ?  D3 M" N$ b- \
; A% V) @7 H& ]/ M, A5 U__________________________________________________________________________
% `( L) w# ^* I# G6 G  Y/ P; |; d% F
Method 107 j7 {5 x9 W, ^  u' X
=========2 E% o9 |5 F( }! H+ q9 L6 s$ m
+ {+ |% S6 p$ R% ~$ ?9 k
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with" N: V. y( T+ S7 i
  SoftICE while the option is enable!!
! K5 Y  \8 Z- t2 K, z& _; S+ X& C: s
This trick is very efficient:
3 A6 l' D7 t) @1 Jby checking the Debug Registers, you can detect if SoftICE is loaded7 j1 K) I. s! p: g
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
9 n6 k, b. \1 A& gthere are some memory breakpoints set (dr0 to dr3) simply by reading their' Y' N" u# S# P, g: J2 I1 d
value (in ring0 only). Values can be manipulated and or changed as well/ P, r5 h4 Z- z6 r
(clearing BPMs for instance)
) x2 E. J! {' R- C: r5 q
: m! H: `' x. Z* q0 N: l__________________________________________________________________________; [3 K8 }2 c6 x- C: y1 P" E: E5 ^
. [) E; ]: c' C) D* X" h( X
Method 11# _; ?  ]/ n# l4 Q; V% f
=========$ n, R8 h# I! G) K
1 i5 y+ _: `# a" b: ~- {5 D
This method is most known as 'MeltICE' because it has been freely distributed
6 G. ?3 H0 P& h4 k5 yvia www.winfiles.com. However it was first used by NuMega people to allow/ v% E( s9 |6 Q
Symbol Loader to check if SoftICE was active or not (the code is located) ?( @; t- f! c$ E0 L6 Y+ w
inside nmtrans.dll).* [4 i0 f! s! {' ]
! c1 _0 c) i' t9 z
The way it works is very simple:
0 ~9 v) f0 V6 O1 XIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for+ k7 d3 h  A- j5 U0 x5 N! a
WinNT) with the CreateFileA API.
" b0 r$ r% m2 u* [% u; I/ @" g7 K: g9 B) P3 Q, W" B- C
Here is a sample (checking for 'SICE'):
8 p' k7 {. G" F5 z! ~2 r1 @3 ?# q8 c, `
BOOL IsSoftIce95Loaded()' C$ V3 ^, {/ n7 Y3 ?. }
{
  j) J' j: m! {   HANDLE hFile;  
5 p  u* R" a3 r6 c   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE," v& ?7 s4 j$ I) @& Q9 `
                      FILE_SHARE_READ | FILE_SHARE_WRITE,
3 @  ^: q' P3 N) b                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
& ~: r& ?% p/ i1 [3 O9 A" C   if( hFile != INVALID_HANDLE_VALUE )  F9 G2 I5 T2 P- c
   {
/ B: O1 m& ]3 b1 r2 i, ?1 M2 y, k      CloseHandle(hFile);2 Z, }5 I' P0 M# k( P
      return TRUE;
. Q0 i# z9 {4 v6 d   }2 ?+ g1 J/ S* k' D
   return FALSE;
2 P3 E9 g& j3 X; i. R; T}! A) a- `$ X/ V2 ^7 u

2 e5 t" U% T- T8 }Although this trick calls the CreateFileA function, don't even expect to be  ^. [! B+ Z) ~  h! Q6 n
able to intercept it by installing a IFS hook: it will not work, no way!
; m3 P/ w; j/ a. X' s9 j: D$ S7 DIn fact, after the call to CreateFileA it will get through VWIN32 0x001F9 e0 i# o1 \: y
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
, r( G$ e( W' J! w. pand then browse the DDB list until it find the VxD and its DDB_Control_Proc& p1 V/ f" w* i; H  w; p# g- V& e
field.3 ^( h+ ?- ]6 m) d  Z
In fact, its purpose is not to load/unload VxDs but only to send a 3 D8 B8 x! q4 z6 ~2 P. E
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)1 W( e  Z9 ?* g: V) Z5 i- f
to the VxD Control_Dispatch proc (how the hell a shareware soft could try2 d9 h- ]7 I. b5 E
to load/unload a non-dynamically loadable driver such as SoftICE ;-).0 H3 _! }3 E0 l
If the VxD is loaded, it will always clear eax and the Carry flag to allow2 A) G4 [4 f8 q
its handle to be opened and then, will be detected.9 E; ?5 B8 x) l, l  J0 Y
You can check that simply by hooking Winice.exe control proc entry point% u) M  o4 z) D3 e/ ^
while running MeltICE.: w4 B* h" u+ R
$ j2 Z5 _9 y" t. R9 z: A

8 G5 S3 ?/ O! G7 C$ r  00401067:  push      00402025    ; \\.\SICE
; L' t1 }- L+ |" L6 j# S  0040106C:  call      CreateFileA; H' g' A, ?8 i
  00401071:  cmp       eax,-001
9 P# \/ a- a$ ~  00401074:  je        00401091. a2 I7 _, C3 K: v$ m
, c) ~- Y; O# M' {* X' v' Z4 U
; w+ ^! s, Z8 a* k, L9 d
There could be hundreds of BPX you could use to detect this trick.
! d4 I5 N# M$ {-The most classical one is:% Q* W  q  ~# r9 |
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||% P* o) l9 q$ r! F& f
    *(esp-&gt;4+4)=='NTIC'
9 e' B- R4 N7 p0 f
3 e1 [' u1 t7 X& h& ~-The most exotic ones (could be very slooooow :-(
. X( W: ]# q9 \) S' F   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  6 D) ^* G% P/ w* `' x
     ;will break 3 times :-(
9 r& d/ t! S6 p* a& J+ q- v& e5 f1 o$ d8 k! Q+ r
-or (a bit) faster:
, R0 U+ d( S( v" F   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
6 N/ G2 ^4 e/ ?; d1 v
9 J* `: n0 j. U   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  / G1 K, l! g6 j/ r# ]( F- @  ]
     ;will break 3 times :-(
" c3 v0 A# M' z2 Q$ o8 l  I
6 B5 n0 n& h& z, T-Much faster:
5 @6 c# c' J/ d. \) {0 D3 k2 F" K   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'
, y  c2 s& S8 l4 K, ]% m/ H
1 S( F6 g9 X0 Y2 C2 ~9 p( A: hNote also that some programs (like AZPR3.00) use de old 16-bit _lopen' h, Y7 x- z3 J6 d* H
function to do the same job:. ^/ U0 n9 a/ ^

: x5 X( Y) K$ r7 d5 V& U   push    00                        ; OF_READ
, o3 _% ]$ P' g! X9 V  s   mov     eax,[00656634]            ; '\\.\SICE',0+ {  ?$ Y* q* K& t
   push    eax
" X6 m" C* N2 V   call    KERNEL32!_lopen
# I0 @; K) v" h4 R! t9 X2 Q) Q& f   inc     eax: O5 Y4 ?0 A7 O
   jnz     00650589                  ; detected
. K+ D3 w: i- C' E. q5 R- V% y   push    00                        ; OF_READ: j0 q, y; P" P+ p# V
   mov     eax,[00656638]            ; '\\.\SICE', P  Y& Y3 c) u( K, H3 t6 a$ A' L
   push    eax0 M9 a$ U! |; O/ S/ G" C
   call    KERNEL32!_lopen
2 d6 f1 X, {( J; w% x   inc     eax
8 T1 d# H+ h$ ?* p7 Z3 Q; Q; K   jz      006505ae                  ; not detected
+ P+ |# V9 w: S" T. r
& L. z8 p  H; x) U6 D( j! O$ b6 S% {& O: O+ Q, [2 U+ o
__________________________________________________________________________4 E  s0 Y% [1 V& f4 }  A9 b& C
6 F. |) @* K' z, f# y3 q
Method 12
4 f  H) U$ q+ u) t8 C=========
: S! P! ~; @9 ]3 f# T
, m8 S& ~9 Z1 g; M& S% zThis trick is similar to int41h/4fh Debugger installation check (code 05! g+ Z  R0 g3 @( _  f
&amp; 06) but very limited because it's only available for Win95/98 (not NT)& x2 a% U  O/ u' {
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.* l  F7 j, ^& {6 U7 J/ Z/ l3 y

! ^0 i9 s( i$ S9 R% H% y. `   push  0000004fh         ; function 4fh1 @) ~. |+ \% n* J; W
   push  002a002ah         ; high word specifies which VxD (VWIN32)
. W0 p2 C; D8 o/ E% N- z                           ; low word specifies which service
* h5 \7 H2 ^0 ~% \                             (VWIN32_Int41Dispatch)8 i% k0 c+ ~+ w/ f, f! b
   call  Kernel32!ORD_001  ; VxdCall& h5 x& B& o" _
   cmp   ax, 0f386h        ; magic number returned by system debuggers7 B) ]/ d/ d  @# e# z. G$ k, O" M
   jz    SoftICE_detected& ^' M: ^7 [# r0 g$ x

/ P6 Y' k2 p7 y# s( m* x( ]Here again, several ways to detect it:
* ]; f  o# P$ S- h" d2 m0 o* E: u2 l* F8 W
    BPINT 41 if ax==4f4 @" Z  ~: L3 r* @1 C0 [

, N4 p$ Q/ p( S3 W    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one
. [% \4 o/ i3 Y, x9 m% R4 a* g( ?5 j9 T. a2 f
    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
, w/ B2 C' @! P$ V, y5 \( G9 N
, W2 e% s" y" z% v5 n    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!
7 `5 o# w- B/ z4 A* k; Z
0 c7 c! O1 w( n5 u__________________________________________________________________________
: r. T* C& K* L7 D, A# s- M6 U( Q8 g# I+ L" s) d+ t5 o2 X+ S: J9 G
Method 13- d6 Q# T: y! t, `/ C! I& {' H* K
=========* s( T! |1 Z' {7 L8 V& `- C/ V. b
8 N9 }/ i; K) C9 x- a
Not a real method of detection, but a good way to know if SoftICE is+ B6 I- ?" v' p1 r# u  `
installed on a computer and to locate its installation directory.
' M. @7 F. w) y( @# z4 {; W/ fIt is used by few softs which access the following registry keys (usually #2) :8 m5 G1 D' z  L8 F: R! Y

( D: S7 q0 H" r0 E9 d& [-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion( v, r, }  L4 n: N
\Uninstall\SoftICE2 D$ k; H! L( j; N( v
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE2 Z. j3 S6 O0 b+ ^: P5 }: k8 K  ?& `1 u
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion5 h7 O3 a1 f5 q4 X# H/ f  u9 P
\App Paths\Loader32.Exe0 p4 ^7 B- s$ X* h3 {

- W3 g, w: W( h$ L6 Y6 C
1 H0 K$ J+ r6 O: T5 A; `  |- r, KNote that some nasty apps could then erase all files from SoftICE directory
( E. @  ^; F) N2 y0 Y( Z* w(I faced that once :-(
* F" z: Z  `; l* ]
. n0 l5 r9 o4 I: ~, q+ M7 ^4 O0 FUseful breakpoint to detect it:
- p. \$ J3 n( Z. C; F; I' ?# d( i/ N4 S
     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
. g+ b, J" ~  p6 Y# {( S2 Z9 }/ j1 A- A) J
__________________________________________________________________________
/ Q5 j- H! c, x- o4 ?6 @# e9 R' @7 v
0 }* a' X+ x# _# y2 o
. t# N  S% K2 D2 c2 K+ CMethod 14 - z$ f2 ]1 [2 a
=========
# {, q/ o  K' O. \7 @& d! l
1 W, t4 \: _* q, GA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose) I6 O' W0 m1 O+ g
is to determines whether a debugger is running on your system (ring0 only).
  e/ X' J# e3 {3 O1 |( j
" ]' j0 m7 |& o& f% R7 n2 b   VMMCall Test_Debug_Installed4 Y. X' S  h4 |" e
   je      not_installed, o! o1 }  Y1 l, a! G

0 G3 o5 y1 p. ?! z1 SThis service just checks a flag.
# V/ K' D8 H' U" Z% y0 K7 T</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-3-28 02:49

Powered by Discuz! X3.5

© 2001-2026 Discuz! Team.

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