找回密码
 注册

QQ登录

只需一步,快速开始

About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>$ t, S- V. G( q. T0 [7 m! v
<TBODY>' O8 @3 h' B+ [. X, @
<TR>
  `) J: b. _, K" R3 r* X8 y+ Z<TD><PRE>Method 01 " p& E) K/ B3 l4 ~" z
=========9 {7 y$ U0 W+ X

& \# v, x6 x; a, F$ nThis method of detection of SoftICE (as well as the following one) is: y9 M2 |# Q$ H
used by the majority of packers/encryptors found on Internet." M+ f7 Y5 |& m; o$ j" i7 |1 |! J/ n
It seeks the signature of BoundsChecker in SoftICE! m$ a) ~$ W8 }
' |% n$ E, [: w/ x& c8 H
    mov     ebp, 04243484Bh        ; 'BCHK'
% }) @4 J9 o) k4 p% g% F    mov     ax, 04h- I% T% M& y  y9 D
    int     3      
' a# @+ T  M  u* K/ t    cmp     al,46 ^3 A- g' ^; Z( a+ N! X
    jnz     SoftICE_Detected
! v9 |0 P4 V0 j4 x: F4 W. l1 |# Z3 I  o; ~, Q
___________________________________________________________________________6 a. h4 @2 I$ b+ X
" m% n( A* ~2 @" q2 [
Method 02
* F4 r  M3 @( ?8 V' t! Y=========2 _% `" L2 }+ x, K8 G) U
3 X) E! S6 |# _
Still a method very much used (perhaps the most frequent one).  It is used4 ?  y; f- C* d
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,6 x2 M: L4 K) c  R9 [9 C1 X+ L3 ^
or execute SoftICE commands...4 O* F& V% ]  K& H, c. d' h/ `* z/ s0 i! v
It is also used to crash SoftICE and to force it to execute any commands
' V" J8 r9 f' O; D3 F(HBOOT...) :-((  9 l" b! L+ V3 y

" Y+ E" o, z; t- i' XHere is a quick description:
) B, _; i% |) J4 V6 |! p-AX = 0910h   (Display string in SIce windows)" Q: k/ ~7 X- B- g7 {
-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)
9 P0 F; n+ ?# |1 H6 A$ R: y-AX = 0912h   (Get breakpoint infos). h/ n3 S; B( W
-AX = 0913h   (Set Sice breakpoints)( S6 x3 E8 m/ Y3 J7 ]5 w; ~! N
-AX = 0914h   (Remove SIce breakoints)
  X) e3 O8 V  f0 M0 L: `2 p9 v+ r
Each time you'll meet this trick, you'll see:( e# Y9 k4 j/ q) p
-SI = 4647h+ E9 R& [' R3 U* i! d
-DI = 4A4Dh6 h6 E: x. i  q' b
Which are the 'magic values' used by SoftIce.
$ J: M  W% I. G9 t6 |1 M5 \For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
0 {  d/ N4 M  s, ^" c  x
' G$ F4 i# u' h( W$ uHere is one example from the file "Haspinst.exe" which is the dongle HASP4 _; N" i% @% J" J3 T! n0 u
Envelope utility use to protect DOS applications:7 _1 W8 z- l$ K. u' |7 e2 ~

7 W+ r7 ]3 f- [) D) ~* k9 U1 T/ l8 ~: x
4C19:0095   MOV    AX,0911  ; execute command.' }) x( D% c6 G- B2 h
4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
0 T7 w$ a6 N' R; J1 a! p  Q4C19:009A   MOV    SI,4647  ; 1st magic value.
6 l) v/ d' S3 L; J' b4C19:009D   MOV    DI,4A4D  ; 2nd magic value.
. o& b* g% Q$ R6 b" y  K% |1 ^# \4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)2 f/ w) y9 n" Q* q* g
4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute
% b2 q7 l5 [1 _4C19:00A4   INC    CX
8 n4 d( K7 v# n* d- A4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute
# x; J2 I- V. s& B) Y% W* ?4 H4C19:00A8   JB     0095     ; 6 different commands.
( \/ _  U' M+ e7 j4 k4C19:00AA   JMP    0002     ; Bad_Guy jmp back.8 j& f8 _0 K- N0 z0 y( h3 P8 q
4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)% Y4 A# e. n1 G$ A+ t# W
* |5 A) R. D2 T2 P/ k
The program will execute 6 different SIce commands located at ds:dx, which7 N' f7 X& i0 D0 F) y3 \
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.; A$ o0 W3 |# v

8 z0 ?! ]# p2 x: @; j/ a" N0 ~- J* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.  C2 I+ I! w% w# T, t: b. q6 v
___________________________________________________________________________- w  R& i8 y8 ]* {' d2 K1 ?# b
9 R$ @% i$ }* ^. U. K

/ ?+ J8 P% T7 i9 pMethod 03
1 P; N# Q# R* y3 j- [=========
1 E# C4 D6 a8 {0 B  M" F
( j5 ?: Y4 b3 \( ALess used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
; h  X8 C1 _& m6 F(API Get entry point)7 t2 [) o+ p4 c1 S$ g& `& ]# K
        
2 Q* X# d# v, \; E9 ]- U
; b2 U: O7 Z) I/ r: `    xor     di,di! G" q- G+ v6 R! Z5 I4 U- @. ]
    mov     es,di/ E, F0 M" \5 v# W2 @) ~4 H" p' G
    mov     ax, 1684h      
' G3 ^9 }3 }3 t$ s    mov     bx, 0202h       ; VxD ID of winice  n$ i6 M1 Z& X7 ]8 f! ^
    int     2Fh
; h% f% f5 q; q; {" i; T    mov     ax, es          ; ES:DI -&gt; VxD API entry point
/ X* L2 I0 j0 f" N2 n1 j    add     ax, di
' K# A" L, N7 M$ b    test    ax,ax
, E' U7 x9 }7 X1 K# L; ^& m$ f. ~    jnz     SoftICE_Detected$ ?, Q* l1 o  S' @  h. c
( s$ ?& Y* |' W$ b1 z
___________________________________________________________________________
" b: ^1 e: M) N( h3 g$ r5 T/ H3 f' i  V: s
Method 04
8 s1 \) @4 j0 O- z=========4 N- V& j- B8 w' o% Z& }
% q) q% b4 Y% g0 a! F: _5 e
Method identical to the preceding one except that it seeks the ID of SoftICE
( W; m* E# X) sGFX VxD.
" Z0 ^  l0 k. a1 V7 E1 Q& X0 P3 [  R
    xor     di,di
, O! _) Z. i/ N) y" F1 |/ w    mov     es,di
2 e. v  S2 |4 S8 }% L) p    mov     ax, 1684h      
, r$ b1 l: Z1 H    mov     bx, 7a5Fh       ; VxD ID of SIWVID
  T+ U) h: P- ]8 M5 E    int     2fh
) f6 u6 }8 X. K) m# |    mov     ax, es          ; ES:DI -&gt; VxD API entry point7 Z$ x( u! O: [5 r4 @9 v
    add     ax, di
1 @" x. L6 B" ~, B2 u    test    ax,ax
4 i% w7 ?2 c8 j4 f4 J+ U    jnz     SoftICE_Detected
" [8 T9 S6 y! B# s. `& `  G: X5 b0 m. x$ W$ ]' I( X2 S
__________________________________________________________________________
2 q2 C. G8 i/ `
! K' ~. O, ?' ?! v4 a; o4 t& S" i) ~, G- P
Method 05
: B/ y% S' h7 H. f' e1 d=========1 I1 P* w8 ~& R2 U

4 v" i, t2 A4 J# P5 D$ vMethod seeking the 'magic number' 0F386h returned (in ax) by all system
% @# ]  Y* G$ p6 E3 p' Edebugger. It calls the int 41h, function 4Fh.
% f" ]4 }8 A5 e: l2 s# f2 R. \There are several alternatives.  
  l) t. n1 G* v+ t1 A& X* k3 G: [* t  }5 X, `
The following one is the simplest:, z6 B7 f& Y+ M3 {* a
" c  J# d+ n) W" }- w
    mov     ax,4fh4 b* b: H! L+ a! e. V: T0 l
    int     41h7 c1 q+ T/ J  o! y' i8 \
    cmp     ax, 0F386
" c9 ?! Q! h- \+ V' t    jz      SoftICE_detected
( }1 s# w: \! `0 r0 X: Z/ W9 h4 K; G2 z4 F7 F$ o0 A

, w( Y2 p; r' qNext method as well as the following one are 2 examples from Stone's 7 a$ R6 Y( R( n& R' x$ [
"stn-wid.zip" (www.cracking.net):
& v( }2 s3 {% ]8 j( D" R
% _! ~+ l+ \9 d0 P    mov     bx, cs. l0 n  g7 j8 u3 _
    lea     dx, int41handler2, |2 Y4 C) f0 Z; w
    xchg    dx, es:[41h*4]
: \* O: U! c/ k( {/ F    xchg    bx, es:[41h*4+2]
3 r3 o: I' ]/ w6 Z" F5 Z! a; L    mov     ax,4fh  l3 O2 `) w, o
    int     41h
0 T) \6 \$ j! D- M  }2 j    xchg    dx, es:[41h*4]
+ `. V& _5 `5 U' L& T: y    xchg    bx, es:[41h*4+2]
) c9 J* j$ R' y5 ~# I    cmp     ax, 0f386h9 |( A+ X" |  c
    jz      SoftICE_detected! n' ~: S3 T/ F2 {
. X9 F5 Y4 u% F- }! P  X3 A+ D
int41handler2 PROC
7 i: ~* J) L' P6 d2 h, m    iret
0 s5 }5 Z- l" zint41handler2 ENDP9 r4 }% j5 s* ]. z' |* ]

8 K% P$ F* n6 Q+ i) o0 c6 o1 d  D/ ~+ ~9 R
_________________________________________________________________________
0 j& n7 u: e* z+ S2 A- w2 z3 S$ i" b- o

8 q9 `4 J- \0 u; i3 M" u0 @Method 06) K0 {1 W  H$ a: L4 N( i: ?! q
=========
$ G% F4 S0 }! L3 l
7 q% S- Q4 u0 L- b' g
; S. P9 q/ j* C% O" l5 i2nd method similar to the preceding one but more difficult to detect:& o0 v+ J! O& A8 J! l
) b  g" \, X; X+ h6 m

" m8 L3 k  O6 Z2 t: G6 rint41handler PROC$ l" r2 ]' `) f0 W1 S4 s
    mov     cl,al
$ X3 i# W9 ~8 J- P5 g3 t- f    iret
( \, d0 K5 ?- k4 Oint41handler ENDP
( O- F3 n3 G1 G1 ^
# j( R$ d7 G1 d! s
  w. G' m! U6 @8 X% n9 y  _/ t    xor     ax,ax
6 ~4 x# x7 c8 {    mov     es,ax
5 ?9 }1 f& d4 u    mov     bx, cs# P6 G& q( j  _+ H1 ?3 p  _! R' c( ^2 a
    lea     dx, int41handler
6 q1 x; J- [7 k7 H: a7 Y1 x$ [    xchg    dx, es:[41h*4]
: B' V2 `" e8 P6 P' i8 x    xchg    bx, es:[41h*4+2]
6 c$ _9 C% p: `8 S  P" _    in      al, 40h: U5 X( @1 M( l! f0 P& z
    xor     cx,cx
4 f2 M" E6 M2 Z0 K! ^  D    int     41h% q. f& {$ w5 ?. P; n
    xchg    dx, es:[41h*4]
' S& y" U8 B0 ~7 B- f$ R, N1 s    xchg    bx, es:[41h*4+2]1 U5 \& M  h8 K( ~: s
    cmp     cl,al
" M! t* b( K$ a2 r' d- L    jnz     SoftICE_detected
# O, q( t& l; J0 |5 P
. y$ m" A; {* L/ h7 U_________________________________________________________________________' L  m9 s: @7 B) I4 p6 q
0 v' }1 {8 H) a- G6 n
Method 07+ P9 g7 }1 p- ?9 f
=========3 r/ l1 h5 Y: O+ `0 M) ]8 q7 y' f
% a! @$ t/ P9 C5 Z
Method of detection of the WinICE handler in the int68h (V86)% `0 U& @: X# Y& c5 _3 |- T
7 v4 ]0 @- G& ~
    mov     ah,43h
+ o1 a) W( A2 c9 R; L    int     68h
! G& N( T5 X- Z- C' l    cmp     ax,0F386h' ?/ X6 Z9 _. I, j" j7 x, E  a" s
    jz      SoftICE_Detected! |! X2 [& x$ c! _1 b

+ G, K" m3 _9 U3 N3 ]0 m. j0 M1 H4 a3 Q$ m) @4 I3 J3 p/ k' c
=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit* X& P* @! r  J6 T8 t; ?
   app like this:% C  @* g& ]9 I, c0 b, k
, e6 e5 T1 `. F# V
   BPX exec_int if ax==683 b' ~( j4 q2 v/ S
   (function called is located at byte ptr [ebp+1Dh] and client eip is4 ?% F/ N2 |& Q; M
   located at [ebp+48h] for 32Bit apps)7 Z# }5 ]& U) ?5 i
__________________________________________________________________________3 C6 @5 m: |% d. Z4 X; t4 P

; {7 f5 h. @/ N; o9 k2 j0 b
: U+ g. A- X! q" D5 V1 Q+ eMethod 08) W6 Q1 o. s8 z; I
=========5 q4 m* c1 k" J0 x5 [

# K6 E1 _$ Z+ n4 v! E% u2 sIt is not a method of detection of SoftICE but a possibility to crash the
7 @5 y( O/ a0 i, |$ ?, |4 R7 `system by intercepting int 01h and int 03h and redirecting them to another
2 F, c' J6 M2 E: |% X4 u) \2 lroutine.1 p* \2 J& p7 }- ~4 i! D% S# r
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
7 B' Z5 M' T5 L$ E4 Q; X3 Lto the new routine to execute (hangs computer...)" R, V0 D8 [# u+ `
1 i/ o' _: y7 P# p0 P$ U
    mov     ah, 25h
% b" n, q. w6 }; J: a; M+ o3 U1 o% M    mov     al, Int_Number (01h or 03h)
6 D" M$ G$ j' r' |0 h& F% Z    mov     dx, offset New_Int_Routine* ?+ l- S. S; n$ x7 C9 d2 A
    int     21h9 ?2 `5 J* |+ n

! r6 m& F4 j2 ]& C' l4 Z; [: L! B__________________________________________________________________________7 j& v, w9 y. m

' X7 F9 q5 x& n) p  S+ F3 jMethod 09
7 Y0 T8 \4 _6 I7 w& o=========; p2 F. l. R+ M8 p1 ?8 C
, g# `; B* Z8 B( N6 C- B& k9 K
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only; F) ~" J4 @) Z5 z% g8 s# g0 k5 z& y
performed in ring0 (VxD or a ring3 app using the VxdCall).
( V# a" r1 M% ]The Get_DDB service is used to determine whether or not a VxD is installed
  k2 W; ?8 w! ~4 ^. ?- z! S8 G. Jfor the specified device and returns a Device Description Block (in ecx) for
  w' O' R' B5 T  f0 Bthat device if it is installed.
+ K0 v$ N9 H. i8 \/ U7 Q) _5 k/ d( Y9 U
   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID2 I6 R+ o. ?  r# U/ d; W. L4 T
   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
0 D, ~1 F0 s3 K9 q$ W7 H   VMMCall Get_DDB
& G6 v; r/ V7 B5 w7 c6 s( }   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed
7 L7 T% E& j* ~& B: Z" `6 r; w# N, l1 }0 C' J8 B
Note as well that you can easily detect this method with SoftICE:
0 t1 T! @. i+ y$ E1 H   bpx Get_DDB if ax==0202 || ax==7a5fh
# t4 X" L+ I) N  G7 T. L' J- {( B- B$ v
__________________________________________________________________________! J. ?/ y0 o* H# p

+ x  D+ F8 r9 n2 }' i1 i' D. uMethod 10( S3 c9 W# E( l+ u) y
=========
' G( u/ e3 i! C$ Z6 n% ]6 `  M% k' c& A. G- b6 D2 Z6 S5 _% V
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with; Q$ D6 \/ R7 u2 x
  SoftICE while the option is enable!!
3 S' B; i# j% n8 S/ r
: |: D! s) y( NThis trick is very efficient:
* @# T: y, ]2 |& ^by checking the Debug Registers, you can detect if SoftICE is loaded
0 }+ w& E0 P$ l) r' D, b3 N7 c(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
) R9 H9 z/ V1 V: L8 b5 w& pthere are some memory breakpoints set (dr0 to dr3) simply by reading their
" A  Z7 j5 `7 H9 dvalue (in ring0 only). Values can be manipulated and or changed as well) g* m8 K. J" y( x( Y
(clearing BPMs for instance)
5 |3 M( ^6 {; C  M+ X4 e6 e" D" s/ E, i9 b+ c! D4 s9 U
__________________________________________________________________________
9 W' ^. w- h" j- B, d
4 }) O9 ?- C! ]0 NMethod 112 x& B  e  C  i
=========
6 f. }1 ]  x1 r6 c) @
. n( D. F' @$ hThis method is most known as 'MeltICE' because it has been freely distributed
5 L/ X2 Q: _* w( Dvia www.winfiles.com. However it was first used by NuMega people to allow
- |; Q7 m, G$ s" I1 ]Symbol Loader to check if SoftICE was active or not (the code is located0 M  y, A' D" Z# L; F5 j  w
inside nmtrans.dll).
; o. D) p/ c6 Z6 B
/ H% Y+ b; P) l) mThe way it works is very simple:
9 T& A; g& j. F( Z& a/ rIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for. z4 C: L* H3 V0 R7 W- j4 V
WinNT) with the CreateFileA API.; E& E. X* h! _( [; S

, m7 b! m  J1 G% k6 k  UHere is a sample (checking for 'SICE'):0 b! v% e# a; k( ]4 j' a6 t2 _

6 T6 {8 B% f! q; n" g$ ABOOL IsSoftIce95Loaded()/ Q+ M7 T. N  `1 I
{, ^$ j5 f; A' L0 S8 ^! n
   HANDLE hFile;  
8 s1 z6 }  k! H' E% X   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
: d' I* n5 M5 w5 b0 t                      FILE_SHARE_READ | FILE_SHARE_WRITE,
9 @% _1 Y. h/ l' |% f0 S                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);# K* x, ^% U% `( N9 f, q
   if( hFile != INVALID_HANDLE_VALUE )- Y2 k/ H9 [2 X- F* [
   {
1 O' |8 U8 V9 L* g, A      CloseHandle(hFile);
/ a% {/ a/ u& Q$ P      return TRUE;
* K  @7 O0 Q2 d% ^) T   }4 P; @2 _3 e" K4 {' o$ T# `: K
   return FALSE;1 D% c" r2 k. l) N' E+ J( G8 u
}/ d0 M) i3 L- U9 d+ J
  Y$ x9 \/ f7 Q; W1 ]0 q
Although this trick calls the CreateFileA function, don't even expect to be
: u6 o" ]0 i) xable to intercept it by installing a IFS hook: it will not work, no way!
3 o8 p7 A* g4 ]/ }. k/ e6 i9 DIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
' G; x, T1 Y4 w: `8 J/ hservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)6 g) B! z, ^5 g0 T
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
) H1 ?6 g4 D. C2 P$ @field.! A& P, W; O) h! P, m+ r& i
In fact, its purpose is not to load/unload VxDs but only to send a
4 l) h- X9 d# N9 p4 SW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
: O0 V( E  |$ ?) h$ `, Rto the VxD Control_Dispatch proc (how the hell a shareware soft could try) _* y7 {5 F" r8 b: l
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
9 z! c0 n+ D( x; IIf the VxD is loaded, it will always clear eax and the Carry flag to allow
6 n& x4 j% J( kits handle to be opened and then, will be detected.
+ F/ H/ V0 r0 W7 ^8 zYou can check that simply by hooking Winice.exe control proc entry point
9 j' E7 E, a7 v" T/ q* twhile running MeltICE.  q! V1 G8 Q! X
  U& R8 H, q6 R5 g

9 X3 v, T* L: z4 C0 L5 m, f& k  00401067:  push      00402025    ; \\.\SICE
. ^" q$ D- f) x; u) r& D0 \  X; F  0040106C:  call      CreateFileA
0 S5 s$ V! D. [  00401071:  cmp       eax,-0018 E. p2 ?$ v8 s6 c, y
  00401074:  je        00401091
- P. S3 m& S4 p) E
6 K) b% H. V# i. @2 }1 A6 R8 t; Y* C+ G8 C
There could be hundreds of BPX you could use to detect this trick.
- |6 o  V2 C' S& p: D; ~-The most classical one is:' i. ^9 x. O  S* ?9 `) k$ I* u- g
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
+ Y, i/ {& O8 e    *(esp-&gt;4+4)=='NTIC'0 q, f4 s& g1 N" H2 Q- N, r  H/ {' t0 W

4 e, C( ]2 ?& z4 L9 x$ _/ `-The most exotic ones (could be very slooooow :-(9 L  M9 x4 H! g" Q6 o$ h6 F
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  
' Z- [% U, _% V3 @$ T     ;will break 3 times :-(& f+ Y4 Y  N8 K3 O6 A
, d( J% m: m0 a0 S
-or (a bit) faster: " h! x6 g! U& y: T% Y, r
   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')2 w" A* b7 b# t$ a6 m6 ]# h
! B: v; }6 v  \
   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  
, F2 D- q& H; U8 Y( `     ;will break 3 times :-(% s, K) M2 |1 W2 H( J7 f

) H* r3 L" M6 p5 {7 B2 m-Much faster:9 {& r" @+ Q$ \% s. p
   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'* w+ O7 L4 f- S- V

! z2 c1 S+ M) nNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
1 T# _8 M' h9 v7 d+ J& x7 T; ?& b: efunction to do the same job:9 |2 z" N3 l" ]& E
4 D+ V5 `+ y( F* w
   push    00                        ; OF_READ
8 D/ D# J  y0 n- i6 I" X: {* H4 ^   mov     eax,[00656634]            ; '\\.\SICE',0
# M3 k$ D0 c% m9 N0 d0 D   push    eax* a1 g( y* `, H6 V- X# g& j% [* P/ @
   call    KERNEL32!_lopen
  F( v& B$ v" ^" @   inc     eax
- q! I6 X% {5 W' z0 I7 b   jnz     00650589                  ; detected
9 {# L! ^$ R: e   push    00                        ; OF_READ
; d: G$ ]% k4 z5 U   mov     eax,[00656638]            ; '\\.\SICE'
7 e+ s9 \/ [# U) j" S9 Z/ S; Z   push    eax2 K" Y3 J2 x( A- N1 n
   call    KERNEL32!_lopen' |( u+ }# ^3 T# J/ b
   inc     eax/ C- r7 C( F0 g# o2 z, M8 z
   jz      006505ae                  ; not detected
4 c3 n; p6 S- q; {6 l  i
- G& b6 w$ X7 r- Q
; ]3 v9 S8 o/ `& M+ d6 e6 V: q__________________________________________________________________________6 R: h9 _1 e4 e) _8 n: ~) U; `

6 X5 z( _  Q' ?' o, @; ?Method 12
  g3 {2 W- E* P=========8 M: R  K$ t' B" @2 D
4 _3 w/ ?& L1 E
This trick is similar to int41h/4fh Debugger installation check (code 05
6 M1 O) v  W$ g&amp; 06) but very limited because it's only available for Win95/98 (not NT)
& K/ B- L% l0 N9 Fas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
1 V, m! o1 h5 N* h! F; N  j  A! [/ T4 a* I0 p6 q0 l- K3 g& D
   push  0000004fh         ; function 4fh
5 e) Q; q- I9 ?/ H- z& R   push  002a002ah         ; high word specifies which VxD (VWIN32)6 E  r% a2 q" }6 p7 `' Q
                           ; low word specifies which service; H* P" q' ~3 ~# z! @
                             (VWIN32_Int41Dispatch)
' G; ]% O; n3 H) v. ^3 _2 |2 I( A+ G   call  Kernel32!ORD_001  ; VxdCall
) n' l/ p7 |; R. ]6 |( x4 _   cmp   ax, 0f386h        ; magic number returned by system debuggers
; c' f* o8 q; v+ w: H   jz    SoftICE_detected7 J" u; A/ {* j% O# i9 g8 M
. O" \& }; }' v9 g+ c$ V) J0 `/ b' x. g9 x
Here again, several ways to detect it:
8 j$ s' V- o3 J* v) v- _, l0 x2 M* N2 f( @6 {$ [' g9 R9 N
    BPINT 41 if ax==4f
( r% z. s! H9 V4 S: }9 i$ o# f
7 t( k/ B( [! j& r6 s+ [$ i, H4 Y    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one' P# n0 d4 w) ~4 [! {+ K' l

4 v# q6 ~2 F  ]8 W) q& |% s' @: D& [    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A6 W# ]+ h+ G4 v5 d4 h* m2 ~0 X  M
  e" Y: u" [6 B" ?; B% j
    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!
! }0 D( d4 d/ b7 f: d/ W; E& k
1 V0 w4 J& s5 m3 H, B0 Z__________________________________________________________________________
4 V# ?5 v# y& O9 C" b# \! z* I! G. z' Q  r
Method 13
! c! Z; J- H0 `! d  L$ x; N=========
7 a! H  D+ m. ^0 [; h; f% ?6 y+ `+ s6 ?9 a) @, H6 q
Not a real method of detection, but a good way to know if SoftICE is. h$ T1 O, `' i6 U
installed on a computer and to locate its installation directory.
1 H  p! m9 G3 J# {It is used by few softs which access the following registry keys (usually #2) :7 z% t( J% G8 ~+ ]( A: R

* H" k. Z2 Y6 R& D0 `-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion; s. d5 E+ o' y+ x& H% {9 k
\Uninstall\SoftICE6 W7 `6 |1 Y& f8 D) a
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
5 X3 {- ?) Z' a+ G! u; i-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion% {. U1 e% W; B/ b, C3 P' r
\App Paths\Loader32.Exe) m* F6 L+ z# K. K, K

  e* T% x0 a5 c0 D1 V. `$ H% j8 i1 Y/ }/ G
Note that some nasty apps could then erase all files from SoftICE directory
' V" j; a2 o, G; r' U(I faced that once :-(
0 z2 }$ @6 U4 q! v9 B5 W
% g2 F  D# e) e& W7 P2 uUseful breakpoint to detect it:  M: S: [/ Y% P8 V+ Z

8 z* m- m5 d' m9 L     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'5 o2 |' q0 p4 U) f

3 M  v8 J" F) w/ t( j2 r__________________________________________________________________________
+ B$ t; C5 r- m1 [0 \' }! L+ u* V- U5 ?9 w: N

: ?" a2 j  Z, q' tMethod 14 + C' h8 c6 L  }2 }
=========) m3 j- D0 d0 L6 S( \( e
6 d& G8 t- O! p
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
6 D$ O- O( v& h. j3 D7 Mis to determines whether a debugger is running on your system (ring0 only).
: v0 a- Q& E& v( G) o
; l7 o) A/ v' ^   VMMCall Test_Debug_Installed
1 M. ^5 M# `) b6 y2 }   je      not_installed
+ O- S/ A" S% a$ t/ {; H- d
" \# N5 q9 v( V+ P% N3 GThis service just checks a flag.7 k! ^0 U9 ^3 R% L
</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-3-2 17:29

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

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