找回密码
 注册

QQ登录

只需一步,快速开始

About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>/ R" I4 O; \7 O& Q! T
<TBODY>
% H7 C$ |$ L' G2 U* h3 ^7 v( q<TR>( D# n3 x0 |% N. q' R5 w5 ^+ t% K
<TD><PRE>Method 01 9 I) v  G& f% A, [1 e) K& a
=========
; Z3 w; @" V. l& m, k6 m
0 ^6 w3 `: Q  J# {# yThis method of detection of SoftICE (as well as the following one) is8 Z9 F# n; ]6 S, c3 |! c1 e# z! r
used by the majority of packers/encryptors found on Internet.
, E$ ?7 E! [7 i8 h- P; f- cIt seeks the signature of BoundsChecker in SoftICE
+ ~. G6 d, E- h2 E0 B; `% `/ v% c8 ~$ L9 H& y& x) t1 T
    mov     ebp, 04243484Bh        ; 'BCHK'/ _& L9 i/ e. V, i, u0 M
    mov     ax, 04h% ^' N% ^- Y' s+ ?$ Z+ _
    int     3       % d, k' G, H% M! ~
    cmp     al,4
1 j/ e3 V( r$ W( g! M: ^- n    jnz     SoftICE_Detected$ f" Y. t' I" v# X6 |9 {

' u) m- m  Z- F& k___________________________________________________________________________3 C7 ]% U2 J, |$ T5 G0 n
4 s5 k; E$ A$ C! y  Q! Y( _3 z* V
Method 02' |/ X1 B7 J( p6 H
=========
/ U6 ?5 R8 j  u+ v, U
/ J1 Y  H0 v- \6 R( y3 nStill a method very much used (perhaps the most frequent one).  It is used( K; p/ a2 @, S
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,, ^8 L' G3 i, M% a, C* }7 I! n
or execute SoftICE commands...7 M8 ^5 [! ~6 W" C
It is also used to crash SoftICE and to force it to execute any commands
4 r0 I. m/ p* r, C(HBOOT...) :-((  7 Z' k2 e$ q4 n4 l

0 S& |" l3 @$ b+ Y. }  kHere is a quick description:  D8 [5 e2 \6 g/ B
-AX = 0910h   (Display string in SIce windows)
$ ^; g  c7 z( ^9 j3 T-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx); K# f. y6 k$ v% J
-AX = 0912h   (Get breakpoint infos)* T2 W! G0 X: U
-AX = 0913h   (Set Sice breakpoints)1 F+ a0 ]6 y7 [# t. Y
-AX = 0914h   (Remove SIce breakoints); O+ |9 `8 m' v* }; u# V5 S

$ q$ t+ q0 {7 I  A6 s1 zEach time you'll meet this trick, you'll see:3 H1 }- p2 `% W3 ~
-SI = 4647h
! P! E1 u, t6 W' V-DI = 4A4Dh( M% w& F: l4 g; n
Which are the 'magic values' used by SoftIce.) ~+ g4 d, {0 R  z
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
: m; f* H5 A/ M( K
, w, b$ A7 |9 e- Q. B- BHere is one example from the file "Haspinst.exe" which is the dongle HASP: b: \' v# v: \1 j5 Q
Envelope utility use to protect DOS applications:
' H7 Q: N/ U+ Q: s4 a
8 p3 k; h: T0 w% ]( f
; w8 v. g  r* l: ^& N8 t4C19:0095   MOV    AX,0911  ; execute command.% S' n- i* Q* V( I/ e- W* i
4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
7 @: B6 l4 M) p. C, Z) g4C19:009A   MOV    SI,4647  ; 1st magic value.
7 \* d/ A) _! g2 Q  G+ o! Z" v4C19:009D   MOV    DI,4A4D  ; 2nd magic value.
: q4 f% }5 {* \- z; Z4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
7 `' T) C. v  n1 `5 `4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute
$ X0 c  _, A3 x4C19:00A4   INC    CX3 Z) ?( r4 i* M3 Q- N
4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute
4 D( O( R6 y; \3 O0 i- ^: P4C19:00A8   JB     0095     ; 6 different commands.
( d: l* g4 ]$ z2 x* I4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
2 V$ O( j4 h8 m4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)
: g; g% i2 p+ M2 g' I5 [) @
" W: Z2 u# f0 RThe program will execute 6 different SIce commands located at ds:dx, which& l7 q* r' e- }, `+ S
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.5 U$ N) b5 H8 e1 m/ a$ x

$ Q8 g# T7 n2 i/ o; l2 X" J* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
* I2 o# c1 e+ y& j& f___________________________________________________________________________, b; X8 k, ]8 F3 X2 ]: a

- I, y: d  d1 c; b" `' I4 O/ j0 x# L! H
Method 03: n9 L0 G# d$ \/ k1 J1 |7 j
=========/ ~: T" [; k* c3 O/ O
9 r6 H3 W- O" x( }
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h2 z( z5 I/ R* N/ i
(API Get entry point)
" g+ A7 w! K9 @) f- A        
# k. u" t( o, ]" w4 {9 Z* \& X7 a% u3 _1 \% J; V' n6 T
    xor     di,di/ u& S' Z& H6 K( I
    mov     es,di  ~! e  I: h( ]6 r) v7 o  A
    mov     ax, 1684h       ; Q3 R/ J, O4 E: f
    mov     bx, 0202h       ; VxD ID of winice! p3 f+ x7 i6 g% n: D
    int     2Fh8 C. |) O% I% ]3 M7 B. q% v' Q
    mov     ax, es          ; ES:DI -&gt; VxD API entry point( w/ m" B0 P: R5 {
    add     ax, di  u  [4 p0 T  z: Z
    test    ax,ax) _5 i/ p: r  R6 ?( R
    jnz     SoftICE_Detected
9 p- g8 X% \- Y- n8 Y; j$ ?( z3 L" u* q: i- m  i
___________________________________________________________________________
) D* x0 `1 Y' I' a" @6 E0 e0 @) ?/ U3 f
Method 04# `! @6 ~: ?% M( g3 M! ?/ F
=========
. C( L$ J% J, z# w3 A1 U' `+ Z. D  X9 T* n# z+ M
Method identical to the preceding one except that it seeks the ID of SoftICE
+ Y3 J5 R' a) m; y/ j$ G9 |7 oGFX VxD.* p& q( I3 F* q5 H  P6 E5 T
9 Z. m0 V: A% E9 a; c
    xor     di,di
& k- U) [; |/ O1 X, O: p7 }% D    mov     es,di
- E' Z2 _1 W7 |7 I, S* k' g+ I    mov     ax, 1684h      
9 \: b  f" j" \- N    mov     bx, 7a5Fh       ; VxD ID of SIWVID9 I2 R, Z" W/ @: s) r
    int     2fh# v+ P* l1 ^3 q3 ~$ p) G/ V
    mov     ax, es          ; ES:DI -&gt; VxD API entry point+ P% p- P* w+ T; l
    add     ax, di
6 v! l+ E1 @% C2 S! R# Y* ~    test    ax,ax
, ^  L3 b3 H5 U4 k$ J- ]0 C    jnz     SoftICE_Detected! R* V7 x$ C0 ~8 R% u

# I# ^# K6 k$ p% k__________________________________________________________________________1 l+ I1 I# J0 K

; h/ X- [4 T" Y- u# ^+ _+ R4 J2 `& t8 x: C. _! B* q2 W9 e
Method 05( D8 T% R& Q7 {7 U0 K4 ^
=========
9 S( S- _$ g3 j) ]* \
% f) u$ i, n- c1 }' c  L3 GMethod seeking the 'magic number' 0F386h returned (in ax) by all system
( ]1 L0 h- B: s% U2 r/ [! bdebugger. It calls the int 41h, function 4Fh.+ G- @' b% F4 |$ J" `7 q- j
There are several alternatives.  
* ?3 H2 S8 z/ L
+ O! s% K2 n% \# VThe following one is the simplest:
% {$ B, g. p+ E- \  q: b% V* O
( J2 S5 G# a. z3 i    mov     ax,4fh
0 F# u6 Y; C' T1 H    int     41h
: b% M0 ~# S# [: o    cmp     ax, 0F386* J, ~8 J5 N- ^% l8 r
    jz      SoftICE_detected4 u3 m7 r& \, l; D% b8 a
6 ~9 V7 c' f4 g1 O% c  a

4 o: @) B6 J# X6 w3 P* _Next method as well as the following one are 2 examples from Stone's # x4 T3 @& r3 G; P3 o9 M
"stn-wid.zip" (www.cracking.net):
' ]" L0 Z+ g; W( t2 t( T
3 X5 x5 P" p9 Q1 P    mov     bx, cs+ D' n/ Z( w* Y
    lea     dx, int41handler2& F% S  I: |/ \7 ~) D- \+ h6 y
    xchg    dx, es:[41h*4]4 e1 Z5 i' Q' K3 T4 O$ d! \, m4 i
    xchg    bx, es:[41h*4+2]
8 z2 i$ E9 j* I    mov     ax,4fh4 l/ ~' `" v' j8 I, _! J
    int     41h
" y3 ]7 [6 m0 s8 v9 r1 l    xchg    dx, es:[41h*4]0 Z3 h( }, E& r! p
    xchg    bx, es:[41h*4+2]  C6 r; q9 J/ o2 ^
    cmp     ax, 0f386h# Q9 G, W' m2 G  t" R! e  t
    jz      SoftICE_detected
2 Y; R, \" }( v/ B% @7 c5 T
3 B0 W0 P5 j. u/ }int41handler2 PROC! U" ?/ g* Y1 B/ F5 C
    iret7 K) n( W3 i2 B+ O8 U. q- \
int41handler2 ENDP
- T- M; u, {5 J2 c7 |5 d1 E3 n, [+ z! u, C2 m
; l/ _/ c# t. L) A8 Q% o
_________________________________________________________________________
% D+ ?# S* r3 ~7 X( y: b" n  |9 R* ?" N; P6 n
" N( [+ x* H8 C/ d# y
Method 06" z# n% f/ s! T6 j0 F1 O) B
=========7 o+ v- X6 x& H( S
: Y! I: V6 v- n/ i

8 M' a: T$ b% Y# X* ^" L2nd method similar to the preceding one but more difficult to detect:
  s7 C8 W, v9 _( b$ Y; N% L4 T3 e+ a0 G+ N) l' L5 S/ m
9 N" m3 ^2 m" a, m) w: Q; o
int41handler PROC/ M% @2 C! D/ T! [
    mov     cl,al$ H( d. R* Y  K) m3 c" C
    iret
1 |2 e; u9 _; Xint41handler ENDP
1 {2 n9 Y4 e1 }+ B4 R* ~- j5 H
1 E9 x, }- \0 a# h+ t# b3 @/ p5 a; j  o% i
    xor     ax,ax
- D" k, f; J5 _) u    mov     es,ax* f& _) N9 [/ C  C+ d
    mov     bx, cs1 b7 Y9 ^% O' g
    lea     dx, int41handler
& Y8 W- Z7 M( e' M, X# u0 Y    xchg    dx, es:[41h*4]' M+ Z' Y) T/ @
    xchg    bx, es:[41h*4+2]
' K" F' n+ W  B5 z    in      al, 40h* Q* I- l6 b/ R% c* }6 V% e
    xor     cx,cx
0 L& k  y" O4 u    int     41h
0 }% R) W3 G9 ^    xchg    dx, es:[41h*4]( P5 B7 y7 Y  c( I6 I8 F2 {
    xchg    bx, es:[41h*4+2]! F) x* B8 z5 y% ?8 O
    cmp     cl,al
1 c, l1 g/ l# ^4 I+ {. `7 V    jnz     SoftICE_detected
% ?3 d, K1 y. B" Y' i: G! Y" [( @' y) ?0 S) p% x' R
_________________________________________________________________________
2 K- k+ `4 \( U0 X
3 u8 D3 L' K+ i! S  _6 U) LMethod 07
2 f% b& T  |6 F# h7 B7 y5 d4 B=========! t% t: X( _* i8 O+ R
3 q$ O- t* T( v9 M0 F  q6 `
Method of detection of the WinICE handler in the int68h (V86)
+ s$ l- i8 B; R9 Y
5 }# X; F- t! Q7 i- `; K0 ^$ k    mov     ah,43h
/ n$ U& k* Z  a" `7 W) q$ z' ~9 ~    int     68h
" P- O2 d, M% ~# a1 I  O. }/ i    cmp     ax,0F386h  A' @' F0 o. B6 P( ]- x: R9 v
    jz      SoftICE_Detected
; j" S8 A) W9 k  v0 X% c
4 k7 q9 x! u1 Q; K1 L' e9 j' N* l+ m: d! E  T  h4 r# _0 C/ B
=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit. z9 a  Y/ q2 W7 P  O: X
   app like this:" ]$ i/ \1 ]* d6 v- @" H
$ W4 `8 I! O0 N" q/ w# h5 Z
   BPX exec_int if ax==68& p# ]7 u9 _( e% b! ^; Z* K6 Q; {' {
   (function called is located at byte ptr [ebp+1Dh] and client eip is
0 J6 g! b/ ~; Q! u3 ]# r0 G   located at [ebp+48h] for 32Bit apps)
1 E3 p& }" R% ~& [  `7 q( R__________________________________________________________________________
2 x8 }1 h9 e' Z  |5 v5 B3 V3 q' b* V7 g& a7 E* S' H1 @
, l1 k* N% r3 J& X$ M+ \
Method 08* s! c& W& Y/ ]1 e) c
=========- E: O9 z# M, i& D  j

- ]( o7 Q" d  T5 X" lIt is not a method of detection of SoftICE but a possibility to crash the6 W7 [! p) v: K! T* X7 n
system by intercepting int 01h and int 03h and redirecting them to another/ F" n/ v& a' e  @
routine.
0 J7 B3 t3 P- E6 A0 hIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
. z% ~( ~4 y; O8 Q: N$ P, D9 pto the new routine to execute (hangs computer...)
- H- N6 ?7 o3 M( {+ f# w7 c0 E- f7 w0 r* N" |
    mov     ah, 25h7 }  w* k# F# ]! F: {
    mov     al, Int_Number (01h or 03h)
! [$ U' b: a! E+ s' e5 V3 [    mov     dx, offset New_Int_Routine" N. D9 M8 w5 h6 ~$ J4 g# C. B
    int     21h
: _; E5 f: v# ^) J. T" V& D3 z" g. r% U7 s0 I/ ^: i% w, `
__________________________________________________________________________
; n: m# |/ f4 B6 u
1 e% r8 l4 |/ U( ]4 wMethod 09" l* z2 n" G/ G/ s: i
=========" `, x: l0 f& D8 ^" L7 A' `, P
) H! H! e' G# S. A' b, z
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only+ ~: \( l6 z6 e! M
performed in ring0 (VxD or a ring3 app using the VxdCall).! y2 Q9 l0 N% c0 z. G1 P
The Get_DDB service is used to determine whether or not a VxD is installed# R% A& W- U9 k: j) \4 C
for the specified device and returns a Device Description Block (in ecx) for  k- Z% O( |' i
that device if it is installed.4 m- {* M3 S" W8 t/ x; @
4 A5 ?' h$ R+ G& k/ s+ d1 V
   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID; d$ n) m7 H$ g( _- z8 O
   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)9 y; o# ?# l! h$ N, b, H
   VMMCall Get_DDB
9 s: w* U& y2 o1 y0 T   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed
$ i& a1 ?' r! u& T
0 Y& \1 p5 Q' C8 l. [Note as well that you can easily detect this method with SoftICE:
+ g) r3 Z/ F& F! G+ O   bpx Get_DDB if ax==0202 || ax==7a5fh8 p1 o, H, L/ a
% o7 w& Y. y3 ?5 Q
__________________________________________________________________________! j" o2 t( M" n8 H, G
/ R1 G5 H7 h) I' e5 L
Method 10
# g0 ]2 c- y% c( z=========
( P, d, ~( q3 D5 g
1 D- t8 Z: b; l$ ?9 t=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with
# \/ T7 |0 Y: L/ c" Z; \5 T  SoftICE while the option is enable!!
, R% n& e9 I: D9 K
: C4 c3 h4 ]+ Z* I9 Z7 [3 h1 R1 uThis trick is very efficient:
9 R  u# x" ~8 B9 |2 ~4 Cby checking the Debug Registers, you can detect if SoftICE is loaded
5 c: k# R% j; A9 ^(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if' |9 x9 D* B2 X) i
there are some memory breakpoints set (dr0 to dr3) simply by reading their2 y) [; y: y1 M1 U
value (in ring0 only). Values can be manipulated and or changed as well
9 \. s/ S( P0 [" j/ `(clearing BPMs for instance)
0 N; c+ h2 W- n$ T+ D
/ H$ w2 L# b# U& H6 {# L8 r9 a__________________________________________________________________________
' N. ^. R. W+ J: y; A  I
) G  ^# B' }# N9 R, A& k9 m8 x! d" ]9 wMethod 11) M, ~* K; i6 `: k/ |8 ^
=========3 \' N' d  V! e+ U( E
: E8 }' [& [: \# @) T$ ^% Y
This method is most known as 'MeltICE' because it has been freely distributed
/ Y3 k- x) X; e' F9 Gvia www.winfiles.com. However it was first used by NuMega people to allow
9 t- t4 c6 h6 X3 A: B% W! aSymbol Loader to check if SoftICE was active or not (the code is located
# S8 X% G, ?4 U3 ]+ D: P9 O* O4 ]inside nmtrans.dll).
5 `  v0 m' @8 \+ q$ y- m) e
5 D5 t9 S& h% \3 R+ f9 ]The way it works is very simple:: i* i6 [0 F8 H1 I2 ~, R, j
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for' ~& G! x, p  }; J( R
WinNT) with the CreateFileA API.5 S5 [- ?3 F- G0 N- U

. e/ K. _' Y+ l8 T" w. ^Here is a sample (checking for 'SICE'):0 r6 u+ L$ A' X' @. D3 `% o7 ], A
) ~; o' C6 p9 ^
BOOL IsSoftIce95Loaded()# q" t) b8 ]. ?8 X* @, G
{
& y& R: M' I$ E7 P: v8 [) g   HANDLE hFile;  0 h% t! Z% X- k2 Z! ]- ^* N' P
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,( b5 t! K' e: `7 M3 H
                      FILE_SHARE_READ | FILE_SHARE_WRITE,1 O/ j) S" H" }3 P
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);% k' w4 o; p' s& N( ~3 l5 S
   if( hFile != INVALID_HANDLE_VALUE ): c/ R9 @) {$ U% q' w  d
   {4 {' r8 |+ k" ~9 N. l- b1 Q: ^& ~
      CloseHandle(hFile);! z( z; A8 |' ]6 [  b. Z
      return TRUE;+ N0 ^% r* U; B* v" d3 q
   }6 Y; y% S8 D+ J: [' c1 g5 N
   return FALSE;, b; r, r! T+ Z' V! M
}
5 c( R& e% I5 L1 b: s# [; d# q/ L$ Z# h) m
Although this trick calls the CreateFileA function, don't even expect to be9 [) W$ u3 Q& C9 e, \' k
able to intercept it by installing a IFS hook: it will not work, no way!& t# n. b5 K5 \6 y0 q
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
& \* i9 ]7 o* O( t+ G7 }service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)9 ~! e/ Z- D3 h3 {4 r: H' W
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
* [" M0 C- X) z. |) S8 `field.: f" L  N7 J0 c! X2 p7 F
In fact, its purpose is not to load/unload VxDs but only to send a
( ^9 v0 \3 L+ h' cW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
; c' S. T: b$ t4 xto the VxD Control_Dispatch proc (how the hell a shareware soft could try  t  I8 G. a" |! p  }8 e* X
to load/unload a non-dynamically loadable driver such as SoftICE ;-)." T: b, P6 u/ D0 X, e
If the VxD is loaded, it will always clear eax and the Carry flag to allow+ j% _) q0 j: a2 U, v
its handle to be opened and then, will be detected.3 w$ c$ _' z' t  Z  R6 }
You can check that simply by hooking Winice.exe control proc entry point- d; h" M& ?+ F& s5 n6 ]% b! S; D
while running MeltICE.
; ]$ L, i! l& z& X+ `: R
, W" }5 m; x9 R
" o$ A3 [  H5 \8 }' m  00401067:  push      00402025    ; \\.\SICE
$ T3 Z  h& b5 ~; k  0040106C:  call      CreateFileA7 _' `( R$ y+ S, a& A) S! N7 N
  00401071:  cmp       eax,-0017 o% S- f2 G7 ^  ?
  00401074:  je        00401091% Y6 H& k) s0 n6 u8 f

1 M1 a2 X: X* `! v. v
1 o$ H. ?2 J' WThere could be hundreds of BPX you could use to detect this trick.
2 F6 D. `: j2 D, u/ m/ X5 w-The most classical one is:- [$ l  B3 E! r) t
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
) G( L8 B* @1 Y: v( f, s    *(esp-&gt;4+4)=='NTIC'6 N3 |9 M, K# C( |. ~" {! {
5 U  I* x+ G) {! l& L7 n
-The most exotic ones (could be very slooooow :-(
+ y# L% p6 f( d. U2 Z   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  & M# s0 v5 V2 L, F+ u
     ;will break 3 times :-(
8 F/ s) R4 T2 h' B; D4 T/ ^8 D- z! }8 z$ D2 e
-or (a bit) faster:
7 n6 k4 a& j2 h) q) y8 ^6 f   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
* V& n" K$ \+ U  Y! A
# S) e$ `1 a5 l' L8 |   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  
: `# J6 t& w" p& M& u' g1 C     ;will break 3 times :-(
0 i* F+ a! Y8 ^" ~* P( {' E1 v* {6 \) n; P( y6 o0 S6 t' m
-Much faster:
( i* {/ t! v- q1 z   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'" r. Z3 p0 J+ O/ O& ~0 R

+ U: ~) @# N# k4 E# VNote also that some programs (like AZPR3.00) use de old 16-bit _lopen0 S0 C6 q+ y8 @- ~
function to do the same job:. }, M& H" W, A' t" t' I0 J$ [

, L. i4 l- Y9 {' {# S2 K3 Y   push    00                        ; OF_READ
  R0 Q& e7 b" J. V   mov     eax,[00656634]            ; '\\.\SICE',0
  ~+ C7 q9 b1 I5 R' Y   push    eax& i9 n) J4 ?0 c) L% E& k
   call    KERNEL32!_lopen
2 V, p9 y4 H4 G  y   inc     eax
2 s8 d3 S, [! t. Z* ?   jnz     00650589                  ; detected2 E  m- G& k4 I2 S+ H) g
   push    00                        ; OF_READ( R( ?9 Q/ j. p9 \0 p2 V+ C( c
   mov     eax,[00656638]            ; '\\.\SICE'
, v% L2 C$ L7 h" {# k+ d. T# @! S   push    eax
) [6 s& h+ I  R$ @) |   call    KERNEL32!_lopen
/ \- m# g3 F. T' U' T: t( S   inc     eax# T1 A1 c, S. y( K
   jz      006505ae                  ; not detected
& u6 X% M, t4 J: F3 r1 q# J3 k
1 Z& \0 R) S+ Z' @0 ]7 Y
: Q! Q  Q. p, O- t2 |) z__________________________________________________________________________7 x% T7 }; C1 |$ n+ U4 C8 f
+ b2 [  c/ V+ H; d
Method 12; g" I' e$ {$ K; ]0 V- V
=========
. e/ r  j% V$ F+ y5 a+ ]! q8 x$ d
This trick is similar to int41h/4fh Debugger installation check (code 05$ a4 g/ p: z" i& i  F
&amp; 06) but very limited because it's only available for Win95/98 (not NT)
( }  K: T# O3 u1 ?4 z  C9 fas it uses the VxDCall backdoor. This detection was found in Bleem Demo.! w8 C1 w9 N; O

8 W: N1 a' e8 [3 k' k2 H' w/ T7 t   push  0000004fh         ; function 4fh: ]. M' _8 {7 d6 l
   push  002a002ah         ; high word specifies which VxD (VWIN32)
5 h9 h6 _9 D, W5 K2 I8 v1 n                           ; low word specifies which service
/ V% @# [+ L' M* a+ G                             (VWIN32_Int41Dispatch)
+ N5 j* B7 @) m2 f   call  Kernel32!ORD_001  ; VxdCall
  C% ]0 q1 |+ R8 A2 S, h   cmp   ax, 0f386h        ; magic number returned by system debuggers
- T2 v3 ~5 k& k  R8 f& M8 R; K   jz    SoftICE_detected
( r, U! }" q  U; c& A" s# h7 U
4 m/ E. R: x2 v( fHere again, several ways to detect it:) d6 Y6 y7 R. s- u

' }9 [3 R& n8 J9 D# G1 n9 D- R    BPINT 41 if ax==4f2 ]( K5 X0 q. w: S
! t6 g' r. g1 n/ K
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one' P% r) Q# x% }( T
8 B; m. d9 t( H$ M
    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A8 J4 V) |. F! E8 F& Z! k' e& z

  O) F; I1 i8 ^5 e0 P' ?8 }: B    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!. M! y1 O3 [# W4 m

8 B1 t! L: l: \9 r! Q. D__________________________________________________________________________1 n9 s2 J+ }% J. g) r7 e

2 m$ i6 k5 A* {; {& q" f% @: qMethod 13
$ Q/ ~, `+ I/ ?% G- W=========
  K3 u  p- b9 U, G7 [5 X" k$ H9 R, |( H: K
Not a real method of detection, but a good way to know if SoftICE is
$ N: Y  p/ ~! b1 E! ^8 W& x( Ninstalled on a computer and to locate its installation directory.
( D% X7 _4 r* Z$ R9 L: jIt is used by few softs which access the following registry keys (usually #2) :
4 H: y% d  p3 k- t. a7 Y/ l* k) y' D# }' _" l
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion5 j; }! J  `: e+ ^3 t% h7 p7 _6 p
\Uninstall\SoftICE4 E9 U8 K7 x. t
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE7 F1 u5 H0 Z/ ]+ e5 F0 c+ ^  F/ S
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion0 f  u% j- ?! j" d. h' P; @( V" U5 h
\App Paths\Loader32.Exe! V) J6 |/ y, U8 W, g! o7 a& ?) D5 ]
1 n6 X4 q6 i0 t3 g% y9 w8 W

% n7 Z5 ]4 M( A1 k9 s( rNote that some nasty apps could then erase all files from SoftICE directory
: c3 V" r' @! B( I* P; U(I faced that once :-(& L" _6 x9 b& V. }+ Z+ d" g

9 s2 ~" L, Q; _+ M7 Z" O6 JUseful breakpoint to detect it:, m  ?0 r- {) F3 j7 Y) q
6 W9 f5 P1 J' r7 G* p8 Z# \
     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'9 t  o! I' L" x0 N4 P

) U; y1 n$ |! A9 U6 c__________________________________________________________________________: \% K* P7 p' ~* |

9 L5 O; \! r! d3 k: F4 O: W) Q" X6 Y9 h( A
Method 14
) v2 {9 O& L: H! u=========1 q/ q! q4 W1 N4 Z6 B& B7 K

: o6 ?9 C2 \( q* B" V% S* e1 V5 p8 MA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose: d9 e8 t1 G& p; _, M9 ~1 Y6 {
is to determines whether a debugger is running on your system (ring0 only).& M- \+ b4 v0 F9 }* h4 X( a

$ E( N' G5 c3 t. v7 _8 U   VMMCall Test_Debug_Installed, y7 h) x$ ]* x" W. ^3 n' [6 ]
   je      not_installed
  E1 |8 B' B/ Y$ Z4 R+ y8 X0 w0 C& b! j9 u  M
This service just checks a flag.
3 I' l. B7 h+ ]/ @</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-2-21 19:45

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

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