About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
- J0 D- v. p1 L0 q* |; I<TBODY>  ?" P% f+ x& b" m+ Z0 z: r
<TR>" ?3 h' U4 W; f: O
<TD><PRE>Method 01 2 S* \# W- W9 N: M( b; P$ F2 @8 W
=========
3 ~8 z' m( f# C9 h  O' \3 d
! f% u. i! s" S) Y, D9 t1 vThis method of detection of SoftICE (as well as the following one) is
) n  m  J) c0 M: A  m9 f1 Hused by the majority of packers/encryptors found on Internet.8 F  X$ B$ \! F8 @
It seeks the signature of BoundsChecker in SoftICE
5 h5 O* K# \6 }! X; z. C7 q. |( M2 Y
    mov     ebp, 04243484Bh        ; 'BCHK'
4 y$ U0 e9 Q% y9 e    mov     ax, 04h; M& N6 w: ?  E( ^
    int     3      
! F2 N. t$ L9 h! q* c7 o, G& ?2 A    cmp     al,4$ P7 P  n0 T# `* R/ c/ R0 T
    jnz     SoftICE_Detected; L" X* m* i; s4 r; n, Y
$ r7 e5 n( A2 P4 O9 _" u5 X7 w
___________________________________________________________________________2 e  k4 e8 [) ?9 b) p+ |" @

5 A: F: E1 R" c. j4 t8 S( O- s1 pMethod 02; J8 g# [, e& U: a" l+ c" n
=========
- v5 L6 h( i- j, J% Z. g# O) ]& P# x0 N4 [+ B
Still a method very much used (perhaps the most frequent one).  It is used- r  z, g/ @) h1 k5 x# g) {' q1 \  ?' }
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
" h) k, I0 g+ d3 o1 Q2 s3 sor execute SoftICE commands...6 p) r  Z9 w5 {+ y0 _
It is also used to crash SoftICE and to force it to execute any commands) H6 `. r/ L. [, A3 H
(HBOOT...) :-((  
: ]8 F7 P5 \' w: r4 }) \% T! i6 S4 }8 s' p& X2 m" Y
Here is a quick description:
* w& Y/ c) V1 I0 O3 Q7 ~2 A# ~-AX = 0910h   (Display string in SIce windows)
, z. \; G# E* a: `  O3 A' _/ J-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)) x# i1 z4 l1 E' ~2 R4 k
-AX = 0912h   (Get breakpoint infos)
7 N' J% g8 d7 K-AX = 0913h   (Set Sice breakpoints)
9 e0 Y: _, D6 N& p; p$ s' x; n' Q/ S-AX = 0914h   (Remove SIce breakoints)
" ?" A; k" N$ Y" Z
/ k- }( U# X3 o% V7 N- k9 P! r3 h" fEach time you'll meet this trick, you'll see:9 I& D# m* L1 ?- Y6 c7 N
-SI = 4647h
. ^2 S$ Z/ \# P6 X- }-DI = 4A4Dh. ?- i& t& M' a. O. J
Which are the 'magic values' used by SoftIce.3 ]5 s/ e0 ?1 e. N
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
5 C- I, Q$ s+ ~4 V: g" {
% D! i! N! U8 O: u$ i: V: IHere is one example from the file "Haspinst.exe" which is the dongle HASP5 e5 {. K. `# F( n
Envelope utility use to protect DOS applications:
4 d" ?) R: K+ Y1 {* N- ~* V
% Q( J9 [# A0 q: H; u
# d3 O& E% p4 S' y" ~3 T4 q4C19:0095   MOV    AX,0911  ; execute command.4 w6 V. z5 b; V6 D2 S- S
4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
7 |" f: V) g( G4 `$ G; c$ j4C19:009A   MOV    SI,4647  ; 1st magic value.
! Z3 M* j( U" Y& u, z4C19:009D   MOV    DI,4A4D  ; 2nd magic value.
, O1 p+ p$ ^( i6 ~, ?4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
6 n: C1 ]; \1 w) |& ~+ p8 Z4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute
7 s& L9 p. [5 o9 A) s4C19:00A4   INC    CX
- ?; B1 [( ~" ~9 _! O4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute9 }8 b% h% v7 Y  S" T& G
4C19:00A8   JB     0095     ; 6 different commands.. a' O3 K% [* y1 S9 C( f
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.1 M9 c8 j/ A0 ~0 Q/ c( t6 n0 q, O; A
4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)
# M/ B% l0 }' [& l7 A; }
& v0 M2 F# y7 S8 BThe program will execute 6 different SIce commands located at ds:dx, which
7 ^; r6 ^7 c2 _, {1 l6 ?  oare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.* P2 ^# j8 p& V" {: K
" d$ D" T+ c& v% W. {% A- j
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.4 m. h( x( T, |& y
___________________________________________________________________________
/ T' V8 a$ I% S' X* I% B: V' _% Q% P" A
+ v" ^& t9 z  {
Method 03- a3 K3 x2 a( T) x9 @. o' V
=========
* T# b0 K! n$ T, N4 k4 }2 X, f; K5 C3 C6 A9 Q8 I; G  q- Y
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
: J1 w: @$ E4 R4 j3 j; I9 I(API Get entry point)
2 Y; P! n5 q! \& m  G8 Y        
# n0 E8 p( ~) w( O* ~- w: l1 x6 T4 i+ b) M0 r) {
    xor     di,di- F7 Y! i% z( k
    mov     es,di- ^) |1 T3 R- e3 K% r0 x
    mov     ax, 1684h      
$ q, i/ C/ s; H  ?    mov     bx, 0202h       ; VxD ID of winice) O$ f* X. O( D- ?9 r8 T
    int     2Fh' u: u: Y" L2 J$ `7 j& J" c
    mov     ax, es          ; ES:DI -&gt; VxD API entry point
- k4 L1 K+ c" B: w    add     ax, di; i9 N3 z9 L. [. r: A
    test    ax,ax* G* T$ i. m2 E% X
    jnz     SoftICE_Detected
# Y1 V$ D3 }! o, G
+ `5 b5 s6 Q3 @___________________________________________________________________________0 J5 ]; {% Z( G- y# q. i5 F

; R3 R  P( C# R$ |& YMethod 04
2 \" M0 [, Q4 ?5 ]* ^# h=========
* B- U8 u$ _  X# p$ m* E6 ?, {* }% i, a" U( I+ ?+ y. w; }
Method identical to the preceding one except that it seeks the ID of SoftICE
  O% P4 R' T0 [$ rGFX VxD.
" R: g; ^6 F% T8 y8 h% t* g8 r8 r( W/ X* a6 C# R& W' ]
    xor     di,di5 @* K; n2 W$ ~6 [- A! @+ ~
    mov     es,di
+ K( _$ u" c$ x    mov     ax, 1684h      
/ _3 L& s! p. d0 }( I0 a2 W    mov     bx, 7a5Fh       ; VxD ID of SIWVID& G1 u, t2 p" O8 ?
    int     2fh
! F5 C7 A2 X' m: n2 C+ g6 M    mov     ax, es          ; ES:DI -&gt; VxD API entry point
) A) S) p' V3 }/ e5 p( K    add     ax, di
2 f2 a9 Y( `; ~7 `    test    ax,ax! ~0 Y4 m  w7 x# z) |
    jnz     SoftICE_Detected3 {! I6 v+ g( m7 D

5 Z: [( r( Q  |( q__________________________________________________________________________* y+ C6 x: a0 W7 I0 E
5 u1 s, ]: I7 I% P# g! {  `  r0 X
& Z1 g! Q" ^6 D( e
Method 05
$ F( [9 T* r) v3 }  H& H, s=========
" y8 f; P! D0 _" B! b
0 f( e9 W$ b; YMethod seeking the 'magic number' 0F386h returned (in ax) by all system) Q1 s  |$ ?- l
debugger. It calls the int 41h, function 4Fh.. k) ^+ z' a& N
There are several alternatives.  
$ z/ \* C1 v  ~; V- h3 S
# ~" e2 O3 H4 z" T7 A, c3 CThe following one is the simplest:2 ?0 j! T# M& W& Q2 k( F
) N. r/ I/ `2 N2 O1 I9 p& l
    mov     ax,4fh, I" d- x9 ^* |5 N. @9 z
    int     41h4 h+ f. @2 v2 U2 ?: x- \' Q/ B! L& P
    cmp     ax, 0F3863 N* L( g, p" g+ A' t& v
    jz      SoftICE_detected; C0 O5 N  e, G; G
6 k2 h/ ], p, R+ E* G, @

- i- {6 A- C, S/ k. d7 L& G( m/ _; pNext method as well as the following one are 2 examples from Stone's
' [9 b5 }/ b9 m8 D) U"stn-wid.zip" (www.cracking.net):5 ~  U9 ]; I0 r5 h
+ C4 I3 L8 Y+ y. g8 W
    mov     bx, cs: ?  \' K$ g" Q1 K: f- ]
    lea     dx, int41handler2$ D* B& Q2 E% H# J7 |$ y
    xchg    dx, es:[41h*4]
: u' e1 z5 z7 M5 e/ b' r1 D4 t    xchg    bx, es:[41h*4+2]4 I7 @+ U" d$ q8 D7 K7 o4 J
    mov     ax,4fh& k) C: B/ d' [4 v, }3 d$ W# Q6 q
    int     41h0 u6 x" r% O7 w0 c: l
    xchg    dx, es:[41h*4]( z2 D4 V9 q: q9 t9 n8 t
    xchg    bx, es:[41h*4+2]6 V( O  L. O* n1 J
    cmp     ax, 0f386h3 B# }" q+ l7 w* O4 @# H5 K
    jz      SoftICE_detected
8 A; c( {3 g; R* L9 k  P+ `
& }7 r6 M. d1 l0 Aint41handler2 PROC& x! Z, D/ }$ z. Z6 F2 g7 @/ d
    iret5 q. b" Q, r( q( e/ c
int41handler2 ENDP
8 }* v6 e. {0 r& L4 T. E7 m( E  B. M/ Q3 @, s/ s6 N3 z  I  j
$ p: P/ Q$ b; h: s
_________________________________________________________________________4 B% L0 q/ A3 E( A) ^
  z' m" h  d$ @4 a& N5 L
* @5 o& h8 [! C) s
Method 06
, D3 }3 Q- h8 d; F( y=========, X; W/ l( K, D' [5 C
" L) B3 ~* Z# H; Y0 N6 |8 z: D
4 \8 n( H7 T! ^3 k
2nd method similar to the preceding one but more difficult to detect:
0 _3 y% W& k% E7 m
4 s" R7 S, w$ Z5 I) h/ P' w! y6 V- N. j9 t
int41handler PROC
6 F! b5 A& ?8 T4 b" x" f% M6 w    mov     cl,al9 {) T4 {" O# S% `, ^
    iret
3 i' R& L9 \9 n0 A5 ~int41handler ENDP( F+ I/ b! F- U  H/ ?
8 g; M+ j( a3 e5 H" D1 i

- T- O& z8 G, a+ N    xor     ax,ax9 M3 n! y6 i# Y/ B; m, L8 F
    mov     es,ax
2 V& Q$ j. y6 r; r7 ^1 p5 C    mov     bx, cs
/ S8 o- c1 u/ x- n# p    lea     dx, int41handler! N2 ^& w2 x1 z2 n7 w4 [
    xchg    dx, es:[41h*4]
! O' x: }) Q' U2 f+ p    xchg    bx, es:[41h*4+2]
( C& Q2 }  i# }; j2 ~# r. f    in      al, 40h. X9 V; T% [6 ^" W  T$ o% o
    xor     cx,cx8 i, U2 _! j4 p) `* Q
    int     41h
. u8 @1 W1 {- R: n) ]/ s( L# G    xchg    dx, es:[41h*4]' l- S; f' U% x) {  o% l
    xchg    bx, es:[41h*4+2]& i' l2 m$ [9 l' O
    cmp     cl,al$ ?2 ^8 Q8 T: k" {- j
    jnz     SoftICE_detected
$ t3 n4 _! H8 R, {% P, |
2 V  s! y+ A' K5 R( I( n; R_________________________________________________________________________
& c5 B6 u6 H4 G  C* m
. D8 d2 {0 J- r/ R+ LMethod 071 w0 ?7 p" e, B/ ?  s' k" e/ Y
=========+ D* |( ^' X4 m5 g! |6 |& H" Z
3 K: @# M3 |; M- K% Y
Method of detection of the WinICE handler in the int68h (V86)- O9 T5 D+ z5 e1 D: b1 ^

! ]* E$ W4 u  `& {    mov     ah,43h) {  {. H$ d+ G
    int     68h3 s7 d" A, Z1 i1 E7 c2 S; w! Z
    cmp     ax,0F386h: S3 q5 K; B$ W7 {# g
    jz      SoftICE_Detected
6 U; m2 }% u- n; u$ Z, H- e
! w( d9 K  ?6 {7 U1 c4 c) `( k& Y8 w6 P7 V! J$ ?
=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
1 h: A2 ]2 e& G% g9 v8 ]) ~   app like this:
+ v+ ^& E7 M( c' a
; u/ `- }9 D0 s   BPX exec_int if ax==68; X. w3 T$ j+ V; a% g; L* ]0 V1 O
   (function called is located at byte ptr [ebp+1Dh] and client eip is
& i$ [' o9 M5 q4 K# A  |) U   located at [ebp+48h] for 32Bit apps). S9 T1 y9 Z8 @; Q
__________________________________________________________________________
5 M7 a3 B' V% C( V8 Q
/ }, i  ^( G6 _9 `# E5 \! z! Y
6 ?" M+ a3 T$ j1 z9 k: x1 t% p) b! VMethod 08
5 Y* d3 j, C; e6 B=========
; v  `0 E9 n; ?* f0 v: M# J$ ?# g
' {* @! h) `. k8 r/ OIt is not a method of detection of SoftICE but a possibility to crash the
. r5 {% |* L  A. c# lsystem by intercepting int 01h and int 03h and redirecting them to another- q% @0 A! ?" J3 |1 Q+ D# w
routine.( u* x+ J, W% \
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points' W0 M3 s% W' j; E: f' ]. S$ b# G! T
to the new routine to execute (hangs computer...)' t: U3 i  s( j1 Z, S& T
0 \: E- Q" q, k
    mov     ah, 25h' I, ^8 e: l+ \+ F* t1 W  V- {
    mov     al, Int_Number (01h or 03h)
8 n9 a; X8 A$ x! a5 g, x0 q) s, Y    mov     dx, offset New_Int_Routine
$ l5 {, k8 b3 H: H: ^4 q$ w    int     21h
, K. I4 B3 m% T* R. g9 ?4 F+ w# o" N2 a6 P
__________________________________________________________________________
* `; a3 B$ L3 q' s
3 R% r8 p- G7 k; r1 LMethod 09* r6 j" }" v& v0 [1 u4 |, I
=========
/ N: H  O, G9 r0 a. p- f& h& R5 E* q; i! P" |8 q" v5 S, r5 E
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
  P& Y, r% O2 p9 cperformed in ring0 (VxD or a ring3 app using the VxdCall).0 Y$ n( d' L# Y# I7 N# h; m
The Get_DDB service is used to determine whether or not a VxD is installed2 A9 L$ O7 M  {5 O. F0 ]
for the specified device and returns a Device Description Block (in ecx) for# }8 J5 _$ ?; v3 `
that device if it is installed.; h6 _8 @( V/ d  {
  G- _& G+ `7 E3 Q1 b
   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID/ s  J" p6 B1 X% t
   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
2 B/ U  j" ?! U- K   VMMCall Get_DDB
0 p3 q) H, m. Z6 z   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed
, l% _# g; ?7 P- j
, d# z# b& p2 X3 {Note as well that you can easily detect this method with SoftICE:
8 U( \' W& `' M/ i( ?! ~! I, u   bpx Get_DDB if ax==0202 || ax==7a5fh
4 v2 V5 D; u4 B1 E6 y6 U$ S6 y- k! N3 h) Q& r* {
__________________________________________________________________________
: z, a2 ]. l5 s: @! G4 ~3 Z' \; A6 i3 Q2 g8 w
Method 10- X# P9 U( w6 b7 V
=========
  {5 b. [8 g' [" e+ s
# W7 ]5 ]) I' N$ K) X( J=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with# e; A, ?6 s! d4 A* g- h3 `
  SoftICE while the option is enable!!
+ \0 ^2 `! M% x. j& n2 J) ~0 E
  ^, ^8 D! k- C8 [This trick is very efficient:
4 }, a# b8 y: {  Jby checking the Debug Registers, you can detect if SoftICE is loaded2 e: W, ^! ^0 L
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
6 f$ \1 o  s( K& Y4 p1 P  {there are some memory breakpoints set (dr0 to dr3) simply by reading their
1 L6 R5 S* k# G. ^value (in ring0 only). Values can be manipulated and or changed as well1 f  X9 G4 V2 D) Z, F, S& j+ \" I
(clearing BPMs for instance)6 t* Q% g% r+ X+ ]" ^( [
  O8 M: w3 j3 b
__________________________________________________________________________) @0 e+ g/ C% h

1 D; A4 G) F0 g0 KMethod 11
; j- z, k2 i) B/ v' @* E=========( G' d- B! f8 ^, T

) s* Y: {- A: t( s0 n5 G7 c; mThis method is most known as 'MeltICE' because it has been freely distributed/ ]2 S+ C% T! k$ C+ W
via www.winfiles.com. However it was first used by NuMega people to allow( m% E! ?" J: e5 Z/ E/ A6 h
Symbol Loader to check if SoftICE was active or not (the code is located
' u3 f! U" z5 q- u; V6 N' Sinside nmtrans.dll).
( Q8 |+ S/ Q8 J5 v5 Y+ G* Y# O3 G/ R( a" o
The way it works is very simple:
. q# f. O/ D) @3 q2 G+ LIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for0 E/ V6 K6 a7 @9 ]
WinNT) with the CreateFileA API.) V$ u" s! N! o0 M% C
7 X& i! o  w& J6 ?- X2 @  O
Here is a sample (checking for 'SICE'):' q2 r% e6 T# Y% I2 ^
! J) \3 |  `0 h5 P3 i/ Z
BOOL IsSoftIce95Loaded()
/ D5 v( n# x  |2 i1 i& F{7 f  u* z3 b3 G) v$ P
   HANDLE hFile;  
' o- a( u0 P' H1 R/ j; g   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,: n9 m: [2 f+ H6 k+ c
                      FILE_SHARE_READ | FILE_SHARE_WRITE,
, o. ^' B5 u1 k, D" _                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
: B1 c" Z3 M/ [& ]5 V   if( hFile != INVALID_HANDLE_VALUE )
) C2 v0 B7 W  K' F; \" |   {
4 `5 W! i3 l7 z      CloseHandle(hFile);/ s4 d6 v  H( c
      return TRUE;# f% a! ~# r& E0 h0 L
   }
; w, C1 k6 q: z7 Y* g- X% G   return FALSE;
) s7 q6 @# p  c3 t5 l. D}
$ J# K3 z( T/ q7 s: ~' E1 A4 T0 z, x! }1 W3 J. s
Although this trick calls the CreateFileA function, don't even expect to be$ f$ n$ g$ j$ w+ c
able to intercept it by installing a IFS hook: it will not work, no way!; U6 z$ Z/ T5 g0 ^  u  R0 g
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
+ V6 s- f' J$ P; g" j* ~6 Vservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)+ x- |6 j. }2 i9 ]
and then browse the DDB list until it find the VxD and its DDB_Control_Proc4 q! V3 p$ s' W9 _
field." E% V6 Y- g  P  D
In fact, its purpose is not to load/unload VxDs but only to send a ; ], O$ ?4 x; y: c1 q2 @$ E
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE); E9 ]0 z" c- i4 c
to the VxD Control_Dispatch proc (how the hell a shareware soft could try5 u+ t+ R8 C8 w. o
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
; G0 Z, H  S! y8 h% Y( w" UIf the VxD is loaded, it will always clear eax and the Carry flag to allow
) o& r' i) y6 _; A5 eits handle to be opened and then, will be detected.) z$ q$ l) s$ M+ `9 r1 D% q. O
You can check that simply by hooking Winice.exe control proc entry point6 d1 x+ ^( V) \& H. ^% l
while running MeltICE.  u7 ^; t' d0 w6 P

* ^5 W4 o; e% M
# W3 L) ~: ^, D6 d; e  00401067:  push      00402025    ; \\.\SICE
4 l6 ^! h/ F" Z& ~9 i  0040106C:  call      CreateFileA
3 R0 d, E3 g" o9 R; |, Z$ T$ w  00401071:  cmp       eax,-0012 u9 G+ M1 K5 o6 A- M- M( x
  00401074:  je        00401091$ W1 A5 e* ~8 |# o+ u6 J. L- Y3 z
/ |; b0 d2 b2 x6 k
0 s* m  s' [0 ~- ~* D
There could be hundreds of BPX you could use to detect this trick.3 F0 q" V# H$ w( ~6 d% p3 E. k
-The most classical one is:
3 Q/ M% f+ _, J, y  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||: p. @* j/ Z9 v- ?& @9 s9 ^2 r
    *(esp-&gt;4+4)=='NTIC'
1 K) Q6 I: P4 O5 M" \' o! @/ y
9 J" a, F/ S' L0 Q9 t$ Z9 y-The most exotic ones (could be very slooooow :-() K2 G% v! v6 u6 @* v) ^8 B7 H+ r3 \
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  & R# s- I8 d7 G! v9 N
     ;will break 3 times :-(
. M" K9 a7 ^0 G' r. Q* i! ~! P& s: _0 C5 \- T, m
-or (a bit) faster: % e: F! ^0 e8 ?# c( |% {
   BPINT 30 if (*edi=='SICE' || *edi=='SIWV'): e% \3 G/ s- `* U: {) c; K

# B) a9 H& C" E2 j1 N   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  
7 ~; `) s( L$ n+ d5 J8 ]7 @     ;will break 3 times :-(% a7 X: F7 ?- [$ G0 J) J  l7 T
7 Y5 j% D1 C7 B
-Much faster:% w: w" |) N" k0 [' z/ X) k: D
   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'
; s) n" |2 X1 p3 K
! j, K" {  j6 Z2 j6 i: FNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
  u8 k6 ^0 |; M0 lfunction to do the same job:
! S( _9 A/ ~  e$ u) H% j0 L4 ?5 G; R, F. }. J' S
   push    00                        ; OF_READ" Y3 P1 w/ g3 t! D! _
   mov     eax,[00656634]            ; '\\.\SICE',0
) a) ~. ~$ I- v( i   push    eax
& L. I5 M2 t7 v8 S7 G7 ]   call    KERNEL32!_lopen+ p4 K# E! X6 s) S; s) w& b
   inc     eax( B% M, S: \3 B2 R% D# R
   jnz     00650589                  ; detected8 Q" I: X% u. D: A
   push    00                        ; OF_READ0 t: b( ^3 a% d" d2 l& K+ }# v0 V& u
   mov     eax,[00656638]            ; '\\.\SICE'6 ]8 t) S. ?0 U) B1 s: ?. Y& z
   push    eax) Y8 P2 Q1 c1 T9 d' A
   call    KERNEL32!_lopen
# n$ I/ w; M* [$ m" B9 p  g   inc     eax$ B1 L$ E" |7 V
   jz      006505ae                  ; not detected
& s- ^! ]  R: r9 T7 I: J
0 M8 Y/ P- f+ k0 e. g- s4 ^$ G7 r1 L/ y- ?1 ^# k
__________________________________________________________________________
" C0 m" I# g3 [8 l% W) }8 m/ e7 E0 ]! H2 M- |7 A7 j
Method 12
+ v0 t3 k! U. T3 n=========* Q; y8 v" _* j' r( E: [" s
7 e- o: k  C& w7 e& V7 |# s
This trick is similar to int41h/4fh Debugger installation check (code 05
. s5 [  v; k( m4 Q1 B&amp; 06) but very limited because it's only available for Win95/98 (not NT)# |: `4 d: m2 @; v* p: K- M
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.' Q* f, t1 K! h8 R) L
; `0 O- `9 y8 D/ O6 [
   push  0000004fh         ; function 4fh+ ]5 k( {4 ?% i% G1 C
   push  002a002ah         ; high word specifies which VxD (VWIN32)
! k8 Z7 O! N* Z                           ; low word specifies which service
1 o* m7 V0 B& R$ j                             (VWIN32_Int41Dispatch)
! K! a4 ]6 b' ~+ P, U2 E4 v   call  Kernel32!ORD_001  ; VxdCall* ^, w) |; ?/ A& J) w3 z
   cmp   ax, 0f386h        ; magic number returned by system debuggers4 s* G$ k' e9 }
   jz    SoftICE_detected- s' ]0 k8 R, m' o3 Q% J

' O2 J! B8 q. S" \7 CHere again, several ways to detect it:
( J; k( |4 u/ z) I3 H
3 R( z. u% n# g8 Z& }- W    BPINT 41 if ax==4f
& a  ]% P7 F# Z* B6 P- X2 t4 ^
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one$ s8 L1 m- b# h, I6 D" A
, h- n. c# B% z+ N5 d6 D' M
    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
+ \9 b; N/ P! K/ j
. @, r0 P  ?& Q2 ^' Y    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!
" X# ?/ r2 I3 v/ z5 ]
9 V0 D7 q2 c5 h3 s6 d( Y8 ?- c, z__________________________________________________________________________
7 X5 U# v  M& O' ^  n8 D  `/ A
5 U, B( Z+ M# o6 s1 F( K0 m; }  ]6 WMethod 13! f7 j5 q$ m+ c3 p
=========$ k8 {! K8 g& C, a9 z; W

4 w# Y) \+ J8 ~% S* I; t; RNot a real method of detection, but a good way to know if SoftICE is
  X  t% Y/ _' y6 ?: qinstalled on a computer and to locate its installation directory.3 H( X2 B8 r$ h& d' Y$ U
It is used by few softs which access the following registry keys (usually #2) :
% E" ?# ^/ w8 A# c" R4 h) |- m
/ r; H, `& t  a+ @9 N8 b. T0 r-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
# d! E+ o$ P. m, W\Uninstall\SoftICE
  `" a/ g7 m1 [& q2 b-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
4 Z1 M/ K' }) u$ O4 I8 i- K! f-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
6 m* U) O9 b2 T( \, G\App Paths\Loader32.Exe
. i9 t& R2 i& ?
. d4 U# r( w# Z1 x" R# R1 r; G2 z) P2 J* M# b( W* M2 w  L8 ?! o
Note that some nasty apps could then erase all files from SoftICE directory. o7 w) P6 q6 I+ A- S
(I faced that once :-(* N  T9 R! N( P+ I! h3 Y

- h5 @6 \6 @% R3 D* E! MUseful breakpoint to detect it:
" |' |; b1 ~; U9 M2 ?( Q- Z- Z* X5 |- v- _# `, h/ F
     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'- C; l! U- P( z$ l0 f
* A" n4 Y2 N, z8 w$ L3 g/ H
__________________________________________________________________________
4 `) u9 A2 e# m  w
9 m0 A/ A% Q) U. p5 g1 ^) Z) B2 ~
Method 14
1 `" }3 S5 N/ F% `% h=========! W' y3 ]# c$ D2 m) y5 G2 e" ~$ b
. P9 ?9 `6 a1 V) @
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
# O# u! R" k- e' s7 V5 his to determines whether a debugger is running on your system (ring0 only).
) ?- V  w* u6 }5 F  u! t& b+ }7 G. q( N3 M3 c( o* G
   VMMCall Test_Debug_Installed
0 e1 W9 j: C! L# `   je      not_installed
8 {+ j, V1 J0 |4 ]$ D0 m  z/ a5 L9 j" G# p5 G
This service just checks a flag.  {8 k$ w! N2 W: U$ q# d
</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关注公众号

相关侵权、举报、投诉及建议等,请发 E-mail:admin@discuz.vip

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.|鲁ICP备19052200号-1

在本版发帖
关注公众号
QQ客服返回顶部