找回密码
 注册

QQ登录

只需一步,快速开始

About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
* Z2 E5 _  Q- l8 D3 N! ]<TBODY>/ I9 h. j% V# |  D' v' B
<TR>
3 X4 k7 F; L3 T) a8 @) p( U<TD><PRE>Method 01
- z2 c/ j- d( k' }' F=========
1 i" {' @2 g  ^. I6 T" s2 y; k  _
5 _3 L( E. N/ _This method of detection of SoftICE (as well as the following one) is
( `$ {$ s+ p4 T3 a9 T" o; `* Sused by the majority of packers/encryptors found on Internet.7 A( |$ q. X- J7 m) M
It seeks the signature of BoundsChecker in SoftICE
  W6 O1 S; X! p0 v% Q& c& F
& g# w7 }) }9 C    mov     ebp, 04243484Bh        ; 'BCHK'' }! _/ H" S  f, b% C5 R9 a9 w
    mov     ax, 04h' C6 L# d7 p$ W( l2 @
    int     3      
4 |+ t8 p) j: s! }+ ~2 I" H( I    cmp     al,4& Y& ~" u" j3 D& u4 `" \- F
    jnz     SoftICE_Detected
, H) y' B, D/ S% I" B3 p8 n0 p6 t2 ~7 a8 w
___________________________________________________________________________5 I! n& W  s, D; |
# g- u+ H; G3 D- _4 Z
Method 02
' ^: `% N, l7 r  i) j3 w/ l/ G=========
8 {: U4 e* S% P0 M0 T: O
+ {; K* _$ h2 o. [+ JStill a method very much used (perhaps the most frequent one).  It is used
! n/ u: O' Q: Ato get SoftICE 'Back Door commands' which gives infos on Breakpoints,
' z( _' o8 e* r: L% Jor execute SoftICE commands...
8 j; _$ l; F" ?/ \7 I- D" SIt is also used to crash SoftICE and to force it to execute any commands) t% I9 g$ W. y
(HBOOT...) :-((  
8 m3 U3 `/ ?1 ~& C4 n
* C0 M. e2 o7 g" a: [/ VHere is a quick description:( T1 a* ~/ ^8 D! ]  D4 Z% _. r
-AX = 0910h   (Display string in SIce windows)- l7 \/ ^, x5 ?# H& }# g+ x$ D
-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)
- q( A4 r! }6 r) I. e8 A, K' I-AX = 0912h   (Get breakpoint infos)" g+ B! Q8 D; A4 c- |
-AX = 0913h   (Set Sice breakpoints)+ N# v* j! M# C( T' @: f2 B) |
-AX = 0914h   (Remove SIce breakoints)
! O5 d6 }" a$ g( K( P! n0 h
6 y' L+ T# i+ ZEach time you'll meet this trick, you'll see:0 K$ U3 B6 x0 Q4 h/ T6 _
-SI = 4647h4 p; Z$ P* I, _; x
-DI = 4A4Dh3 k% f, H& d2 }
Which are the 'magic values' used by SoftIce.
+ W+ z6 \5 g- p0 e3 j& lFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
# H" g( \. e& }$ C
; ~* ~- A$ s# J8 n9 g! _. BHere is one example from the file "Haspinst.exe" which is the dongle HASP1 @# x# Z0 d; ~
Envelope utility use to protect DOS applications:% {' r0 l- n3 x* I
3 @( ?& `% Q; Y, {

" W1 G7 ?1 s  a: V! T. J4C19:0095   MOV    AX,0911  ; execute command.6 [: h+ ~, c1 P5 m3 k
4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
- e$ X) P+ B* W1 R$ W4C19:009A   MOV    SI,4647  ; 1st magic value.
7 c% ?. [& ^8 z& c4C19:009D   MOV    DI,4A4D  ; 2nd magic value.# z0 r3 w7 N8 e
4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
6 G+ N4 J' f0 j4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute
2 q% u; m0 r% o/ k, |4C19:00A4   INC    CX$ G$ i4 d& z5 M8 v
4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute
, f* y2 q+ ^1 s& Y+ V4C19:00A8   JB     0095     ; 6 different commands.
* t% }5 v3 u$ {: c* H, \8 I4C19:00AA   JMP    0002     ; Bad_Guy jmp back.- s0 S; b: D9 A' y
4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)4 n$ @; v2 L; p; V" c
& w- g1 l) H. m0 A5 m, ?" C, n
The program will execute 6 different SIce commands located at ds:dx, which) m% F4 a  r0 M
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
4 n1 H/ Q' _  s9 r
% w0 {  I0 f; w3 i* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
( v4 O) e1 x& @4 v1 v, ]7 n___________________________________________________________________________# m, ]# }- Q" F6 P8 Q+ a7 D' y
. u: n, P, y6 K- t

% y  P" i! V  f* FMethod 03
. s& h- W: p  n$ c. `$ Z2 r=========5 E! E5 A, a+ i2 D& Y" r
7 n- h( h2 M3 C, y
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h1 f- n9 |: O5 z$ q9 L+ K
(API Get entry point)
( n% x3 \- [) C# w  H3 t, \( ^        
& e, b8 N4 w0 n& {: }5 _& q" m' Q/ W5 [$ q
    xor     di,di
( C8 a8 k/ E$ L! J" m    mov     es,di7 O# ?7 h$ X9 o; p* t* _2 j/ ]
    mov     ax, 1684h      
. q9 e) V) w( o& t    mov     bx, 0202h       ; VxD ID of winice" `$ t% y, k+ q" \1 ]
    int     2Fh6 o$ j+ x2 k! [  }5 u8 ~
    mov     ax, es          ; ES:DI -&gt; VxD API entry point
( G$ W( `" r$ p$ l    add     ax, di' ]" l% w/ c. V+ I0 b
    test    ax,ax
) D0 [: ?2 \0 I3 n: ], a) v, g; ?/ V    jnz     SoftICE_Detected6 Y- P1 P3 t; m; D% P6 R9 l
) T6 P4 U' F5 S/ O% `
___________________________________________________________________________8 M$ @3 s( A1 q. z1 Y2 m5 S" H5 b( y' D

- v8 e3 I5 x( m8 D, p# {5 |Method 04/ L' D  I4 {+ d/ \3 `
=========6 E. p5 z5 m" T' n( N
" y  O% A) }' j
Method identical to the preceding one except that it seeks the ID of SoftICE7 `8 Z% i/ [( |' I+ ]" u& }; V
GFX VxD.8 q4 e3 ^5 r: H7 r8 m) N! {" \* n

8 U" I% z8 P; g8 J+ U    xor     di,di
( G9 c+ h! A7 z" J& z3 {$ d    mov     es,di- j0 i/ H" K1 N6 K" W. p: d3 }
    mov     ax, 1684h      
5 K' A" ]6 }9 t* w    mov     bx, 7a5Fh       ; VxD ID of SIWVID
8 b, P2 [/ f9 m8 `0 ]  Q    int     2fh! T. F/ ^; @0 c3 D4 G8 e
    mov     ax, es          ; ES:DI -&gt; VxD API entry point7 O& W7 j6 ^- c( [) \3 l
    add     ax, di" s/ H* ~5 F0 x8 b5 r2 J
    test    ax,ax
( o5 z# n5 j: d  X! u) {' j/ [    jnz     SoftICE_Detected
7 W" z- d6 }  v9 O4 z, A: D. ?: A
$ j/ X/ |: f, S0 Z: M" B( Q) R__________________________________________________________________________
  x( a$ O8 X# q2 c. P# g, o, z

$ Z1 Z; Z2 [& _! e3 t- h  yMethod 05
2 i8 B/ C7 r4 n. ?. ]' Z5 g=========
! `0 ]9 R' c: M9 }
7 Z7 x2 D3 S0 v1 G, U1 e* A( OMethod seeking the 'magic number' 0F386h returned (in ax) by all system
3 G3 k7 ?  j' u$ ]; zdebugger. It calls the int 41h, function 4Fh.( u* E: b. y4 `
There are several alternatives.  & Z0 P  W9 q' j. m  D. @0 |8 p; h

0 ?1 _: [- f1 i; cThe following one is the simplest:
. s; x9 f. S+ I0 i* y" L. y8 A
; d8 e7 j# m- `- C  @- t! G    mov     ax,4fh
3 X2 i5 N6 v  i. ~. R5 D    int     41h
3 d# F" a2 u7 c' V, W    cmp     ax, 0F386; _! u# \) l- s
    jz      SoftICE_detected
7 V, p  n, K2 S3 N" v: T" T+ a" i9 I* ?5 G

. N$ t8 {$ ]- q! ~Next method as well as the following one are 2 examples from Stone's ( V9 x4 Q1 Z+ ]8 g
"stn-wid.zip" (www.cracking.net):
, i$ q- r% B, u8 ^) v
8 S2 m" Y) m5 w1 ~7 d. {* B4 L    mov     bx, cs5 \5 z- n5 b3 g$ r: m
    lea     dx, int41handler27 w3 [4 E+ n6 b' E
    xchg    dx, es:[41h*4]
0 v1 K0 @: Z. z4 i8 ]2 m' w1 {    xchg    bx, es:[41h*4+2]5 V5 D  t( R1 D' D) A" ?  y7 A
    mov     ax,4fh  E+ ^* S7 G2 B1 i+ B2 g# S
    int     41h
1 K9 `% v, |" X: j    xchg    dx, es:[41h*4]
0 t* o8 \1 i/ k9 _/ C    xchg    bx, es:[41h*4+2]) }6 q% Z9 E. \5 r. U% o5 q
    cmp     ax, 0f386h
7 O8 H' p3 j9 s+ h6 r    jz      SoftICE_detected
" X% B& f1 E" Z% A: f* w+ i3 G! [; i, i
int41handler2 PROC
5 d3 P- }$ i* E, ~% Z# X- D    iret
3 v4 P6 y- ]+ J6 Y( Fint41handler2 ENDP9 {% A+ n; k) r, h3 o/ a- Z

% T$ R! \+ G% W7 S0 v  a- e/ B6 e
_________________________________________________________________________
% l  m* }, P  G8 B" R
5 V2 {9 s0 E9 J1 P+ m9 q
7 i$ K& ~0 R4 SMethod 06
/ j  v! U1 z$ C9 Z3 Z; L=========
5 O5 f: C- a. H8 ^2 {0 J5 o) v  }3 I4 ]3 q
. V8 T4 p" P+ t2 x9 C- Y$ Z
2nd method similar to the preceding one but more difficult to detect:1 |: ?* J* ]  E$ X7 ^, K! W
* e4 c5 v1 \$ H, C' R- {4 A( @
. v6 z- I7 L$ ^2 J5 D  o
int41handler PROC6 p: Z/ w6 s; I- c( I$ c6 a
    mov     cl,al; s; @7 c2 I7 V9 o* @  j
    iret
6 m; _- Z" T6 h$ `' a3 t: K4 @1 Wint41handler ENDP5 Y/ o3 q' W7 W9 [. e/ F4 ]
6 X9 z! z3 g  V2 ]) w

' b# q7 A$ B# {- G  e7 O    xor     ax,ax) @4 s7 d8 I, T$ \+ l6 ~& B8 V
    mov     es,ax% `; x# t7 [8 Z) |- ?7 }4 f
    mov     bx, cs- l; @& Y( \$ V4 x5 u, {# L
    lea     dx, int41handler
3 j5 K5 @$ I1 e( Y; X6 @2 j0 f& l6 `    xchg    dx, es:[41h*4]
: P3 B8 E3 ?1 c  T' D5 e4 |7 m" S& s    xchg    bx, es:[41h*4+2]
/ S+ Y, L+ u' {    in      al, 40h6 I4 T1 O- n& x4 Q- J/ L4 N- ~
    xor     cx,cx& z3 Y; f, a- y4 i9 z
    int     41h4 G7 Y* [0 Q" W/ J. `& ~
    xchg    dx, es:[41h*4]
2 Q6 e  L$ \3 k  R# v/ y4 z$ i, M    xchg    bx, es:[41h*4+2]
! ?- F6 X, z1 @0 f8 D! f    cmp     cl,al
6 Z+ R3 s( d8 B' ^" u  e    jnz     SoftICE_detected0 S  B+ R0 h+ S" m' l
( i- ]! J7 p( I3 _$ R
_________________________________________________________________________
  q! p6 {# X* j1 Z% y3 h" s- @6 ^: U! W* g) ^7 h8 A
Method 07! c$ v) w/ A6 a) N4 \/ S
=========% G4 y/ V. V( O& q  b, |

) Q3 Y/ b# f6 O9 I/ v( |Method of detection of the WinICE handler in the int68h (V86)
/ g* h' E0 q/ L6 D$ C3 m- A  j& f5 u
( ~# B5 I5 Y% }$ T    mov     ah,43h0 \3 C! c/ K/ w3 l0 d6 O0 z
    int     68h6 Q0 O' @) w; z4 e6 w6 M
    cmp     ax,0F386h
5 ~' @( g# z3 u6 w7 l    jz      SoftICE_Detected
# K0 T6 g$ }3 d
  s6 b! w$ ^; ?* f1 B5 w8 J9 ]* H! w/ u7 s5 f
=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
& P8 A% \: G: |- |3 e% W& |# N   app like this:
) q  U% Z  G4 l. l, T
8 b! [; u6 J6 Z' Z" u  W   BPX exec_int if ax==683 q1 H; `/ \- I3 [9 t
   (function called is located at byte ptr [ebp+1Dh] and client eip is( R$ j( z- A# t9 b+ }' D7 a  d3 _
   located at [ebp+48h] for 32Bit apps)
4 z0 R; c; _! e$ V' y7 F__________________________________________________________________________- [' p( b2 y2 t# [( ^7 W
  ?" C5 h. ]- g" e+ o0 z" D
5 }* C" o6 R7 m
Method 08
8 b. P& V4 D5 f! K! M1 `=========$ M2 W  d- `2 t! P2 B
0 A  q: E2 T9 V: |( M
It is not a method of detection of SoftICE but a possibility to crash the- h" o2 j- s, @. Z5 c
system by intercepting int 01h and int 03h and redirecting them to another
( X. h" j& }- M& uroutine.
7 H* q8 [; g7 F% q( M0 eIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points# e8 L9 d2 j, J. x2 e  ?* F; I
to the new routine to execute (hangs computer...)( b+ t1 }% ~5 t8 R' Z
7 p( Y9 V  f: {
    mov     ah, 25h5 Z) L- s4 B1 {
    mov     al, Int_Number (01h or 03h)
# O, d0 Z) `, p) m6 X    mov     dx, offset New_Int_Routine
7 t) N7 X9 N4 a- }    int     21h
6 t' r; I' ^$ w9 Z+ ^
( q0 W/ n$ ^9 ?9 o% W__________________________________________________________________________& E8 |& x4 z" X" R

% E7 Y" q# L: p/ H1 I+ |0 n5 AMethod 09
1 C3 [( ?! M4 j/ U. j=========
& a% Q. @3 _8 N2 H0 L3 j3 b
3 }( Q! m9 g! u6 m3 u& MThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only: y* S8 s8 d- h9 Y( I
performed in ring0 (VxD or a ring3 app using the VxdCall).
7 P& e, C# t  Q& SThe Get_DDB service is used to determine whether or not a VxD is installed
2 s# w/ l3 u1 T, U4 Dfor the specified device and returns a Device Description Block (in ecx) for
# s/ F! g+ O5 Q, `& Q4 j" bthat device if it is installed.. D9 q+ K* z5 w% \- l5 q

( a% z  `3 @8 e1 _   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID
2 P( t3 N1 V; }. a2 U! G: V   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)  n# h7 L$ i+ s. `( B6 ?
   VMMCall Get_DDB
* E0 T: z8 H6 r3 J   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed
! ?8 c. ^' _8 n
8 h9 c1 ~" I. u: b6 {- SNote as well that you can easily detect this method with SoftICE:: G' m# {' }4 }% _$ A2 w
   bpx Get_DDB if ax==0202 || ax==7a5fh
6 H' |% F3 z; u( x9 o: {+ z+ d4 x' p+ \$ {6 F( t/ B5 N, F
__________________________________________________________________________
* c# \! ?0 k6 }; C5 v) F  S6 D9 {( o+ A6 Z
Method 10* g$ J: m- O2 Z( \8 }4 K  |
=========
" S; e" A) T( h. w: L7 ?- e2 g
8 f6 _' D) L2 h' Y0 \4 w9 r  d=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with5 G8 y( W' Y9 ~* {8 ?2 p8 w
  SoftICE while the option is enable!!( G% J# U& F/ X

8 b- W: [; e. F% `2 }( P& T) ?8 EThis trick is very efficient:
7 q- m$ H1 M; G* f( y* _0 U; jby checking the Debug Registers, you can detect if SoftICE is loaded3 H' p1 p8 x: Y7 S* `0 r' A
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
9 {  s) s8 z5 u4 a' B) w3 Z# pthere are some memory breakpoints set (dr0 to dr3) simply by reading their
4 G2 t" i) V  f; mvalue (in ring0 only). Values can be manipulated and or changed as well" ~: i' g. h' }6 m" j
(clearing BPMs for instance)
, K& F% X6 x% j) S
* S* H; J8 U7 W2 X  b3 a; U* b__________________________________________________________________________
! P, G% I- ?3 u+ Y* g! \7 Q# P* `* V% m8 X& H1 k
Method 11
9 D" c! d& j& t: v2 t3 Z3 h=========
! D) h4 ]( L2 E. d1 d0 u" B
+ D& M& m# Y0 _4 t5 R+ \5 l  d/ DThis method is most known as 'MeltICE' because it has been freely distributed
9 u) T4 O. o2 J7 p0 [via www.winfiles.com. However it was first used by NuMega people to allow3 X% U: n! G1 Z* J! g
Symbol Loader to check if SoftICE was active or not (the code is located
7 w$ {6 z( N; m" D) einside nmtrans.dll).
7 i8 R" c) h/ s& ^' s# _/ ^6 T# u+ e! m# J9 y7 p& e% B+ o- w3 ~
The way it works is very simple:
# x2 y$ C3 A# Q& o% jIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for3 D5 w  o: ^& k  K! X) `2 {0 l8 u
WinNT) with the CreateFileA API." F, l; {6 p5 f3 \8 o9 G

, r2 U8 \6 g) r. e% FHere is a sample (checking for 'SICE'):
' l, z6 e8 a* V4 ~5 ^5 T# \
+ g( W1 E6 p4 Q! o8 Q" KBOOL IsSoftIce95Loaded()
7 p1 }* P1 k' x7 ?6 X3 y$ m{
2 F) B: V2 a! f% B+ N   HANDLE hFile;  2 O8 [7 O+ O$ i" _* a/ n* Y1 J
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,2 y4 n: T6 y: g; g, r# X: P! O0 t6 X
                      FILE_SHARE_READ | FILE_SHARE_WRITE,1 g" w/ d9 v; @0 {
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);* ^/ q- J: @3 b
   if( hFile != INVALID_HANDLE_VALUE )
& p* D% M% j' L5 l1 J  x) Z   {
0 s* U! |' r; V& e      CloseHandle(hFile);
) n( Y: W' U& L3 u      return TRUE;: ?. p/ k1 @. u# ]. C1 {! E. w% W
   }
6 U( c& ]) l$ x   return FALSE;
6 p3 m% z% ?2 ], k# R# ^}
) L0 X3 f( Y+ H7 U% F- A! o2 n. P7 [& E. [! G
Although this trick calls the CreateFileA function, don't even expect to be8 j. Y8 d$ V" U7 H: `# T0 g* f
able to intercept it by installing a IFS hook: it will not work, no way!
" w3 F. w6 m3 b' u  @In fact, after the call to CreateFileA it will get through VWIN32 0x001F5 m, h5 O8 g2 Y1 T  Z7 o
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)2 y- {" V( m3 t* R# [
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
. ]- i- }$ u( |+ w% z: z# T; `' I8 ^field.
/ h" r. o% Z! y# ~In fact, its purpose is not to load/unload VxDs but only to send a 6 Y! t6 R2 ?7 j, G
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)5 U4 J3 z5 _/ E- O0 C2 F6 z' k
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
% o0 x2 d, i" Y: K8 Z! eto load/unload a non-dynamically loadable driver such as SoftICE ;-).
, r+ ~6 r! y0 i" |1 Z8 ~# `3 HIf the VxD is loaded, it will always clear eax and the Carry flag to allow
8 b3 l: ^) V9 B! L; }. q1 vits handle to be opened and then, will be detected.
4 |/ V8 y6 R1 vYou can check that simply by hooking Winice.exe control proc entry point& T+ E6 V1 L6 D7 \/ b5 y- U. X
while running MeltICE.0 h) j) C. f" |% U+ m9 O

  W# G2 w; V4 w  \6 w: S/ K; d  h6 }1 U% @7 O0 S& d/ A
  00401067:  push      00402025    ; \\.\SICE: @: C8 d% v% U* d7 w
  0040106C:  call      CreateFileA
5 c$ |* @+ X7 x  00401071:  cmp       eax,-001
- n" m+ ~  M' s# d; p8 d  00401074:  je        00401091" e6 h! k% p5 Y! R, _

1 E1 s* S) b  ?; M" B& w+ e) n7 M1 ^  u
There could be hundreds of BPX you could use to detect this trick.
, u- o; \$ d, n-The most classical one is:6 l/ W4 U% b' m0 }5 h
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
+ Y" I% }( Q, p    *(esp-&gt;4+4)=='NTIC'5 ^1 C6 J7 x/ N: m! l0 a) w+ i
$ d! G3 T6 ^# w* X% x. `6 j, ^
-The most exotic ones (could be very slooooow :-(
3 ~$ E" z2 K/ A   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  
4 z7 ^5 _7 m+ m3 [1 M* x* S     ;will break 3 times :-(
6 w+ g0 O; e" j8 [1 k8 v
2 v6 T6 Z$ m. `3 Q1 p  N2 ^-or (a bit) faster: * o& T* {" y; @5 x' k+ n& r3 y
   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
) d4 U; y5 T5 @$ D
. w( @0 t- p/ `$ a3 s   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  
% q2 q* M0 x8 ]+ H% g, c     ;will break 3 times :-(
; ^. s* p+ I, _0 S: X0 M3 e/ I  j" s) I  j1 G
-Much faster:
# {/ W  V" Y* _9 `2 t$ P7 [   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'
& A( K9 G" n& h! x" O1 u( w9 K' ^0 @9 b+ C( d. |0 U- [
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
) E- |8 {+ T9 e  @* Z9 H8 f' j8 _function to do the same job:
) ~/ s7 C4 h5 Q& v) t; B& ~0 Z, N/ k2 ?( [8 i% L& \5 p
   push    00                        ; OF_READ2 Y+ w, t& d2 Y5 Z$ ^
   mov     eax,[00656634]            ; '\\.\SICE',0
6 ]- J  z: l# F6 s; J& X   push    eax; q9 R5 s- }. K2 Y1 i
   call    KERNEL32!_lopen
# u1 J' R5 N7 |   inc     eax
7 O' u2 l9 V/ G" T6 s9 F   jnz     00650589                  ; detected7 Q6 c. L# j9 g% I
   push    00                        ; OF_READ
3 i8 ]' i- I. n- W+ y1 K: }/ J& \   mov     eax,[00656638]            ; '\\.\SICE'4 `3 ^& A# L# R: P
   push    eax8 y- n# ]  b  k$ J
   call    KERNEL32!_lopen
( d$ `) P8 B" J' Z, `+ A   inc     eax* W& n) Z2 h$ s' n: R$ }  J: B6 x
   jz      006505ae                  ; not detected' K! ?3 T* ^5 c# ?, B

) O/ _3 p" k) M) K) O3 {/ }. @- S& t, R; i* P  z
__________________________________________________________________________# T' }1 c, R9 U; K
  N2 e3 y4 Z  K7 q
Method 12  S+ |" G' b. m+ K
=========! I! Q8 z2 U+ @6 v
& ~  ~8 [8 f( [4 k  x1 T- O
This trick is similar to int41h/4fh Debugger installation check (code 05
+ K/ `, P' c0 k! j&amp; 06) but very limited because it's only available for Win95/98 (not NT)
8 ?( Y0 R  a. w4 I- A, |6 c/ was it uses the VxDCall backdoor. This detection was found in Bleem Demo.
: U4 R- V1 Y% ?
: o3 a; l2 t0 ~  F( v4 `+ l$ R1 ^   push  0000004fh         ; function 4fh
3 c) d; ]) n8 m2 \# P$ F   push  002a002ah         ; high word specifies which VxD (VWIN32)
7 m4 k! y) S' {0 R8 Y7 [0 M                           ; low word specifies which service
, [! _  @( v5 L& N                             (VWIN32_Int41Dispatch): `5 E/ X& A- \9 ~4 F% z# d
   call  Kernel32!ORD_001  ; VxdCall
; E2 S8 g8 X8 {& ?   cmp   ax, 0f386h        ; magic number returned by system debuggers: o8 H- g6 V! n, g& w
   jz    SoftICE_detected
) h- }* m$ v8 V# z$ S2 ?4 K8 Z8 e( m2 N% i! B0 @
Here again, several ways to detect it:
0 F- g: ?3 X4 M' Q' ^& `, p. f' a: G6 N0 Z
    BPINT 41 if ax==4f
! y. J1 G* ^5 g$ `) J7 {) Z
5 d; _3 t; [5 C7 W  D" F" \    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one$ F9 k; q: D, _/ D1 H; |
! C5 F& a2 s8 l! C4 B
    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
" a4 @* c4 L# u) w3 g3 \' |; j- k" _& |4 ]! A9 q# v
    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!# N& d: O$ m# C
% M$ X5 y0 l! b9 \
__________________________________________________________________________
- K) d! d& d# ?( k* u' \; _0 Q2 D9 y7 [3 p# z/ n
Method 131 ]/ ^0 k4 J& t* f( N
=========0 A7 e0 w$ M+ U) S# W7 f

4 P" p, k' _3 H; e9 K3 KNot a real method of detection, but a good way to know if SoftICE is
/ g4 T6 u4 O2 Q2 ~) t! uinstalled on a computer and to locate its installation directory.
. L3 @# H1 q* p+ a3 VIt is used by few softs which access the following registry keys (usually #2) :
- x* a8 T& ]) l7 _  `- @  m2 k
% a! \) n( K, V8 n# J& c-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
" V5 D  Y; \* k, Z4 D/ Q\Uninstall\SoftICE
- ]3 s1 d9 w0 D1 E3 _2 {$ @-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE1 c! j# U; F9 Y6 d. S+ j: j6 b
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
9 c0 e# e4 b  G3 d\App Paths\Loader32.Exe
9 a: h/ z3 j8 l: o+ P+ w" K! J' H- y* E
! |+ o. Z" C& I+ A3 c7 E( i2 l, a. L1 o4 `2 S
Note that some nasty apps could then erase all files from SoftICE directory$ s. m5 c6 W" G0 ]; ^
(I faced that once :-(' S( P' G& v+ B, r/ K$ H$ V7 f5 D. q

# J. ~, {6 E5 ZUseful breakpoint to detect it:, H8 o+ ^$ F4 S/ z

7 R- R- D' @( I- s5 ?     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
7 ?, B+ }6 E/ J& d2 u" c
4 ^$ }" [6 D+ j9 W3 M__________________________________________________________________________- ^8 t9 ~- @/ y/ f# X$ i, u

' r6 I# t" ?1 |, {" g3 `# P+ @1 S4 u
Method 14 3 A8 G; P3 d  f7 u4 q9 X$ X  J
=========0 i# [* E" k& Q7 Y( @% v5 w

. c5 M3 ?, G- q+ H$ Z& AA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose) I, \& ]; T* K, F, `# j; L( o
is to determines whether a debugger is running on your system (ring0 only).4 N/ H# @9 P' T2 y4 d1 E9 }

) Q: z3 R: A; H9 {+ e   VMMCall Test_Debug_Installed
& e; u+ H! ]' D! w$ L) E, a/ t. D   je      not_installed  ^, ^; I$ m" J: |. K( G7 W
; V$ S( Z& F5 P8 N" u2 }/ q2 n
This service just checks a flag.* Z% S% w5 ~! X# Y+ q$ j+ @
</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-8-10 18:39

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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