About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
9 b7 W$ r! h7 P1 b  q( l; P<TBODY>. }5 U4 @- d) F
<TR>
) G  [+ l7 k/ f2 _. d* z<TD><PRE>Method 01
, z+ {6 @- d" F6 R/ a=========
" V5 ^$ s+ ]; y  `% W( [0 G9 b8 \3 A6 C! s
This method of detection of SoftICE (as well as the following one) is. @" |5 G1 }2 H4 K1 O+ t; A
used by the majority of packers/encryptors found on Internet.& q/ X9 i8 {/ B& c9 f
It seeks the signature of BoundsChecker in SoftICE
) T8 T; P4 f3 L: i6 V) H" }9 z% Y+ a" l. m3 t* d9 y/ ^+ H
    mov     ebp, 04243484Bh        ; 'BCHK': c% Q! [0 J6 s: ?9 S, C
    mov     ax, 04h
% x0 O  z' u6 I7 }; Q    int     3      
% |7 e! B3 q- b7 ]! L9 M0 {    cmp     al,4! Y6 [' h! C1 E/ X/ \. J
    jnz     SoftICE_Detected# `; Z4 S4 p: V9 v

+ _6 X6 J( y- v+ k! ?___________________________________________________________________________
4 g+ ?( [2 P+ L3 a( \% N9 W
5 I- ?0 ], m5 U, O  @Method 02
$ A5 v; C1 n6 _. f+ u=========9 Q1 N+ u/ N# V8 n+ L! i% r- m

5 O/ z- {9 m- Y& SStill a method very much used (perhaps the most frequent one).  It is used$ g9 A5 D, r  U
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
) @6 b! a$ P6 T: tor execute SoftICE commands...0 q8 F: {: ]  p* P
It is also used to crash SoftICE and to force it to execute any commands
$ O: S- @8 r& X5 l(HBOOT...) :-((  2 D+ I! P. c* d  @, \
8 ]! T! v6 e+ ^4 Z5 P: L, r* t
Here is a quick description:
4 j2 U  C- f- I8 Y-AX = 0910h   (Display string in SIce windows)
; T  M2 S& [% K-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)
4 @+ d7 M5 P! [8 e1 k+ d-AX = 0912h   (Get breakpoint infos)
7 [5 a  C' s. a7 O3 s-AX = 0913h   (Set Sice breakpoints)
3 \0 C4 Z0 m' S+ Y; Z+ L. t-AX = 0914h   (Remove SIce breakoints)# N/ x5 r: j; u! t) X* [

2 g( ~( \) V, e& }6 T6 q% ?Each time you'll meet this trick, you'll see:
0 M! y; E4 R5 }0 \6 f2 v: r-SI = 4647h; M, t5 W/ i4 u
-DI = 4A4Dh
0 P. h0 s+ G9 K9 ^( VWhich are the 'magic values' used by SoftIce.
& v* q! O  |& }, w$ [0 q* ~& Y+ ZFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.4 G+ k2 b$ M* f, y, l
  l; V9 e! ]$ _
Here is one example from the file "Haspinst.exe" which is the dongle HASP
: v! l! |; n) t9 ]Envelope utility use to protect DOS applications:. J: }3 \, n( p' n

; h4 f2 T/ W8 N7 x
% G" V) [7 r" F; o4C19:0095   MOV    AX,0911  ; execute command.
3 I2 X4 s% _- k2 G4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).4 C* [/ i- [9 n, k7 f
4C19:009A   MOV    SI,4647  ; 1st magic value.6 k6 M- _8 u- i. ~
4C19:009D   MOV    DI,4A4D  ; 2nd magic value.6 ]& l2 ~$ U# t/ H
4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)- B/ C9 v1 X& F- U
4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute0 F+ J" j3 A) b3 S/ H4 K
4C19:00A4   INC    CX
  u: o! ~) V$ Z1 D" j4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute
4 X7 b9 i& F7 N. a* ?4C19:00A8   JB     0095     ; 6 different commands.9 D- w" R  k; H8 l( u/ b: t
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
' ?* R' ?1 d5 \7 w) f) c4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)
2 @8 ?6 ]7 i5 w0 Y! e
3 s; M' N. h( H. q6 Z9 Q0 `The program will execute 6 different SIce commands located at ds:dx, which! P' o7 i& a  O0 E% p* z7 R
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
: B( d" `$ t' m6 J9 Q- H4 W  R8 k, f; p4 _, }2 ?: q0 g2 h3 I
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
8 H3 ?/ a+ `# V* b5 O% y( n___________________________________________________________________________0 C: p: r9 |8 T8 Y$ S, a& |
$ q/ P. ], P% e% t

, A4 n# b- f: P! UMethod 03
/ F' n, M1 D" ~=========+ R8 ^+ U9 O8 M) t3 E: q; j2 u3 E' {

8 D: [/ Y  U+ B, f$ M4 ZLess used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
" F/ ?/ }2 O% o! F6 m: r3 c1 P  n- t(API Get entry point)% C, n* q! }3 P& ]+ ?3 u: U8 {3 [
        / V0 v; p  z" c% u5 y7 A4 D" P
$ R7 Z6 M& _/ V3 E6 o
    xor     di,di# h% U1 H7 `$ Q1 _
    mov     es,di" u$ [) ~5 E. K3 k
    mov     ax, 1684h      
9 _' ~) R1 n$ J0 `* n' ]    mov     bx, 0202h       ; VxD ID of winice
% J/ i) g* l7 W6 j) |    int     2Fh5 T- b% I  F0 B" F& G
    mov     ax, es          ; ES:DI -&gt; VxD API entry point8 s7 ~9 Y7 b2 K3 Z- ?- K/ V
    add     ax, di' H  ?, g/ `  ~3 R) t( `
    test    ax,ax; E! e4 j0 y* J: T2 b
    jnz     SoftICE_Detected, [. |$ C7 s1 _

$ W' R) q: F8 C; K___________________________________________________________________________
7 \8 q" m" Z- S2 p% t2 n" z( _% s8 t9 J0 S! W1 J
Method 04
6 J) d5 m6 |- g! R6 R$ x& {=========
) U9 L% h0 l5 N! K  h$ f9 a, l) m: w) z  }4 t' z
Method identical to the preceding one except that it seeks the ID of SoftICE" k8 k' @, X+ n9 U' L- l2 L$ c
GFX VxD.
. O6 c7 @5 Y: o* I
0 F6 |  q( S9 U) {  I    xor     di,di6 E3 g$ F+ [, y- ]9 w. p4 N+ b
    mov     es,di
# y6 U0 K* o6 @2 O, Z2 V; t    mov     ax, 1684h       4 h" `( Y& n% H1 W2 U, R! u& G
    mov     bx, 7a5Fh       ; VxD ID of SIWVID
; x* T7 W$ _3 a+ J4 X    int     2fh
2 u+ O" I! [! G2 M6 f    mov     ax, es          ; ES:DI -&gt; VxD API entry point
" K; g. w- v3 F    add     ax, di9 Y; ^5 ?; V2 I3 {1 I) v
    test    ax,ax$ O# ^7 `+ V! x# ?
    jnz     SoftICE_Detected9 B4 d& K/ k# u5 r1 J
9 _  z$ u, S! j# d7 M, |; s
__________________________________________________________________________# ?( W' x2 o- x& E. z
9 j/ Y. F) {& L( X, k/ `4 B
  b8 T  Z2 A: g
Method 05: W$ v; t4 |8 s$ J$ m
=========
+ Z0 T3 M3 J8 U+ e+ q8 G* i. v0 n) d, d2 m
Method seeking the 'magic number' 0F386h returned (in ax) by all system% d' [9 g& |* q! |$ b* m. q5 \, L9 x9 ~
debugger. It calls the int 41h, function 4Fh.2 B( J" }; [+ u! U4 p# V/ \
There are several alternatives.  
8 w7 Y7 \1 ^8 V- }1 T, g2 z/ Y8 b# U4 M0 W/ p
The following one is the simplest:
: P+ R" ^( A4 o0 K% |0 m( z& ~" k/ J; D, Q' x" f
    mov     ax,4fh
3 R. z. k# S4 B* |7 K  L    int     41h$ U) n% I8 k, D0 f
    cmp     ax, 0F386
! w6 ]4 `7 w% D0 K: \* i8 a2 O! g    jz      SoftICE_detected  F* j1 C  b+ y- L/ i

, u* S) h; M# y: R6 v' E( E! O) @
, w1 Y- z# S/ c& @Next method as well as the following one are 2 examples from Stone's
1 K# D! [6 T- R"stn-wid.zip" (www.cracking.net):
# v8 q! l; B9 [. I
) l0 I0 J! u3 T3 \$ m3 t    mov     bx, cs
- y7 q$ b1 n/ s) I7 J& f( b' U    lea     dx, int41handler2, f" F+ {1 N& B
    xchg    dx, es:[41h*4]) u' T& A2 H0 M; n9 n7 p8 W
    xchg    bx, es:[41h*4+2]
; c" i% \! I  S5 w8 y. a. _    mov     ax,4fh+ w( R4 E2 M! s- r. H6 _4 Z9 }
    int     41h# o2 V/ _5 f, R, P9 v7 b
    xchg    dx, es:[41h*4]( S1 r: \/ C& U, W9 o
    xchg    bx, es:[41h*4+2]
8 a4 ~9 B, u; V( |! `! L. h( }/ p9 B" L    cmp     ax, 0f386h- x' ]6 k" Q$ L4 A7 x2 Q! k
    jz      SoftICE_detected2 N& p1 \/ b5 Y
: h( }2 ~0 C% n  Y4 i" @9 F! ~$ ]
int41handler2 PROC
: G) o2 g! Z7 W8 |7 w    iret2 c  ^9 k5 ]) p% g
int41handler2 ENDP. R# [' M7 x; j( ?
4 t. r* {8 ^+ ]
9 P$ T0 f/ c& M
_________________________________________________________________________& f' S3 j7 ~+ L, `' V$ J, Z( `

1 B  k5 a; H2 M" {" e, c1 V9 X& j* R( v( H
Method 063 Z4 b5 K! F7 B. q% B( S
=========
) [& i3 j2 x* ]% W& j! B/ f( V9 n4 K# v5 _  I
0 D0 Z( u5 S/ T# q, m
2nd method similar to the preceding one but more difficult to detect:/ F) ]. u+ h" {8 l6 B" i

$ q1 Y6 u3 Y/ z% T. ~" g# W8 _. _3 m" E7 j
int41handler PROC
6 s: g/ T' t! ]! R    mov     cl,al6 |. P0 h# k8 G8 q* w% ~0 F
    iret& w. N% ^% H" Y2 C! O
int41handler ENDP
6 U+ m  m; @  v8 U! |8 \* M& t: f# F2 S% D/ l7 u
2 z' j2 f8 Y# `1 W( ]/ C, {
    xor     ax,ax3 I5 L7 _/ N. K8 J& s1 ^6 a7 \* b
    mov     es,ax
4 E7 v) T8 ]4 ^, k1 ?9 z7 W    mov     bx, cs
' P! i% X& w- a8 b    lea     dx, int41handler% ]( q" T% j& ~: ~/ `
    xchg    dx, es:[41h*4]
2 H0 N7 e3 X5 M1 q, X% T    xchg    bx, es:[41h*4+2]* X* I0 u# O* |- M9 v7 F
    in      al, 40h
( r6 B* C" L; b. E$ F4 w9 ?    xor     cx,cx
% s7 @* k6 Y7 q+ ~    int     41h& ~, p- B+ d8 p: K0 B
    xchg    dx, es:[41h*4]
6 c& p8 a& W% Q! h8 F) \+ U' h* D4 s    xchg    bx, es:[41h*4+2]
) m; K3 k, O/ R    cmp     cl,al( C9 h3 T" D- Z. n0 n# f! O+ s, D
    jnz     SoftICE_detected
0 h* g( e9 r. b3 D: p3 i. }7 b0 |9 B3 K8 @8 v7 |4 K
_________________________________________________________________________
; h3 {* f" Y# G% J) ]2 Y# u5 C2 r6 q5 Y* I% c
Method 07
! f' K+ I, C/ @  _1 R% O=========
7 j  H' W9 [9 T0 o2 ?1 ^! h
/ R$ }  s; \" X% I( sMethod of detection of the WinICE handler in the int68h (V86)
9 ^- v4 Q% y5 W1 X6 ~, s: f3 X/ @1 H. O5 n
    mov     ah,43h
& S" o8 _% }' ^( b4 T! F- S4 E    int     68h0 o0 s# ^& M, S, |/ ]$ [& [
    cmp     ax,0F386h
1 w  _6 \8 e5 M0 b# l! K    jz      SoftICE_Detected
' J) k5 E) Q+ a* O  f' {; u1 U2 {3 k* j1 X$ @

9 d! x; r: f- k- v9 z=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
+ b9 |3 l3 ?) W+ f4 u   app like this:
# U# n1 `. P8 W, k/ R4 L8 V
: \2 i" h1 i) |8 o1 _: \   BPX exec_int if ax==68
' q4 q5 h, \3 L9 O& _* O   (function called is located at byte ptr [ebp+1Dh] and client eip is3 T/ p. X& C. _5 b
   located at [ebp+48h] for 32Bit apps)
0 c8 r/ c% h8 R; b) o/ U__________________________________________________________________________) K% h8 Z/ C0 ~8 m* x' d: L
6 I; _& V/ t: h  @
; I& G, H. q) ^& w" a
Method 08
; t) I$ r9 a- Z; U' W=========
1 [  K- c. L* H) C+ q5 a! b9 `7 N, q1 b. Z
It is not a method of detection of SoftICE but a possibility to crash the
$ `# L/ y# {: e2 msystem by intercepting int 01h and int 03h and redirecting them to another
  c( q7 W& J4 e4 t& Wroutine.3 S5 f' P: g+ P5 Y& D/ J' T
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
7 S! k$ z; o# o) o0 ]7 jto the new routine to execute (hangs computer...)7 G# S+ W# O4 K, d& {
5 Z8 z0 k& G4 v7 v( d% Q& W% @
    mov     ah, 25h
: ^. D7 E# ~3 t/ L4 Y    mov     al, Int_Number (01h or 03h)9 q+ s2 ]" I; P. b5 @) a
    mov     dx, offset New_Int_Routine
" b5 c" y. N# U% l( P; u    int     21h/ V; y2 K$ }6 y; J  w' I: W

  c9 y. z1 Z! z__________________________________________________________________________
1 U* p% Q& L  r( E3 p+ P, L! R
Method 09
7 f7 C& |. j# S) E=========
1 A; X6 P8 M3 ~% C3 s" R) j* B2 D/ U- f$ _& ~. d8 R1 Z
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only$ h  h6 y8 F/ u9 t; L5 b9 ~* w
performed in ring0 (VxD or a ring3 app using the VxdCall).3 Y1 V9 k# r$ V' C" @3 P6 |7 Q
The Get_DDB service is used to determine whether or not a VxD is installed
0 Q0 |( I  s5 Q8 Jfor the specified device and returns a Device Description Block (in ecx) for
% I5 G, R8 P! x0 p( R5 Pthat device if it is installed.
( |! E7 z3 [  z* N" {5 O7 m# @  r
4 z5 P8 y; V8 u2 l# t   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID- ]1 D. r& ~7 U; q
   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
$ T" V. x4 m( f7 E( S   VMMCall Get_DDB3 R6 n) L$ u- X1 o% e% x) C7 B( b
   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed$ Y! f5 t% V# C5 C8 p! t
! A# U- q" z$ y& L3 w2 w8 m
Note as well that you can easily detect this method with SoftICE:7 X( H$ I+ S' t# s* A! c: \
   bpx Get_DDB if ax==0202 || ax==7a5fh7 W; t8 F' x; G) q" }

: q( [9 \9 J, j/ H__________________________________________________________________________1 `4 a+ M/ M+ s! n2 H/ ?+ C
% i) t  b$ W4 @# n( H
Method 106 E; S# `4 s  _' N, D" G8 K
=========
' D+ ^4 f3 U: R& |6 Y/ h: A4 P/ w. V) p  {. F2 n
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with$ @& \; v1 l0 L4 p
  SoftICE while the option is enable!!1 }$ `! o2 W& ^+ q

+ M0 M8 \! X. ^8 K6 {This trick is very efficient:
4 L, K5 y5 M1 ~by checking the Debug Registers, you can detect if SoftICE is loaded
- |- \4 `4 d1 A# K7 {; B(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if( t9 ]+ e1 F  `
there are some memory breakpoints set (dr0 to dr3) simply by reading their
* z! C1 L! x: o3 S$ @value (in ring0 only). Values can be manipulated and or changed as well- w0 ]9 J  ~; F( A5 V; \7 x- O
(clearing BPMs for instance)
3 P- U0 `5 G# n+ K% J
; h% p( Y1 f% ?- c( l+ s__________________________________________________________________________" V) ]7 e, |  X: n: s6 ~. {. U8 Q
% z+ r1 f3 C2 b+ {
Method 113 e2 ~! S2 z" q( I! ?+ T
=========! L: u3 \0 L: n
0 f9 R/ W0 D% g9 X! l. M# a5 V$ k, I" \7 t
This method is most known as 'MeltICE' because it has been freely distributed
0 h0 y2 ~8 w" d7 Z6 c1 r6 wvia www.winfiles.com. However it was first used by NuMega people to allow. P4 Q) w& I, @! g6 |
Symbol Loader to check if SoftICE was active or not (the code is located/ A& e: M: s8 T0 g: {% W
inside nmtrans.dll).
1 A" w: a; o# k& o/ s4 ^( d. y/ ^9 A7 ~1 r) ~* ?9 v
The way it works is very simple:' X' k) c- `: t7 S2 S3 ]1 ~
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for0 w* J* f6 h; B$ x) g
WinNT) with the CreateFileA API.- w2 l+ C! ^+ ?  A8 S6 }9 ~2 Q* Y3 f
% r4 R+ ~# x- H; |
Here is a sample (checking for 'SICE'):/ p$ m" a4 [9 D1 o" A7 p
/ L1 C8 R4 J% ^+ S% ?2 Z- L4 e
BOOL IsSoftIce95Loaded()  |! a( M' |0 b, `+ r) g9 P; }
{/ h; E* o  N6 o. |' ~
   HANDLE hFile;  
+ C. `& W6 ?4 Z  O! ~# g   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
6 O/ v4 `( A8 G8 e( `; H$ R1 _                      FILE_SHARE_READ | FILE_SHARE_WRITE,# S7 b0 R4 I  f) @
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);/ F% B+ N' S  M! A$ j
   if( hFile != INVALID_HANDLE_VALUE )% O3 g; D! z6 Z6 A" y/ F% F. {$ W
   {
# P5 l! v$ F, Q2 `; `      CloseHandle(hFile);
, h+ ]$ O0 o; [6 R6 I      return TRUE;
8 s# Q/ P! W$ u   }
3 o" f( ?6 q) I- r( u0 ]   return FALSE;
' u  r6 {6 L! O% W0 k$ i9 U}2 B4 N" l2 m1 D
9 A2 f8 w' D$ j( b- o
Although this trick calls the CreateFileA function, don't even expect to be7 E& m  C/ K0 ]) @! a. b8 P
able to intercept it by installing a IFS hook: it will not work, no way!
  s& z1 k8 o7 ZIn fact, after the call to CreateFileA it will get through VWIN32 0x001F% M) e2 w7 G; [8 Q
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
$ {% K6 |1 N# B  `2 E5 Land then browse the DDB list until it find the VxD and its DDB_Control_Proc
) _% @; {' F# zfield.
& C+ ^6 A; `6 w2 RIn fact, its purpose is not to load/unload VxDs but only to send a
, x* h8 ]$ x- e/ ?6 {W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
3 [, N/ b2 R7 h8 s) \- t, @6 Pto the VxD Control_Dispatch proc (how the hell a shareware soft could try
3 ?3 R9 f, I2 |! Y* u, t" cto load/unload a non-dynamically loadable driver such as SoftICE ;-).
& c, a( X3 W+ A1 nIf the VxD is loaded, it will always clear eax and the Carry flag to allow
3 Q5 L* Q8 d* O5 V: Rits handle to be opened and then, will be detected.2 N* j! T$ [, s1 d0 d2 ?, o% Q  R
You can check that simply by hooking Winice.exe control proc entry point
5 q: Y( g0 `0 m* Y( ~# `while running MeltICE./ W# @; m& E0 @+ ]: b

+ N  Y+ I& J9 ^% ^* U$ q  m2 I8 \9 C+ c2 k% d5 `+ `8 E! |
  00401067:  push      00402025    ; \\.\SICE
- R4 ^  G6 a3 F  0040106C:  call      CreateFileA7 R5 f* J* ~8 P
  00401071:  cmp       eax,-001& x! O, T6 P  m4 `4 [8 }# D
  00401074:  je        00401091. ^8 P0 H# i8 W$ }$ r4 r+ P
9 o3 |* i/ m: R
0 X5 N% M: w3 _7 [. ~# p
There could be hundreds of BPX you could use to detect this trick.
  Z5 f# F& Y  v0 }- G$ _* P-The most classical one is:: y* q. u, G% O! f, j+ V8 i
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
3 s- \) q9 S5 j6 T3 q    *(esp-&gt;4+4)=='NTIC'
1 ]1 O, E% k2 h( J
% d* E+ r5 _# c" N-The most exotic ones (could be very slooooow :-(
2 Z! r' n3 ?0 c$ k3 x   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')    ^- I' v$ z: @" R* V$ l
     ;will break 3 times :-(
, l9 Z6 X9 y/ o7 h7 O; E3 u& I' ?, ~9 t5 a) U- l* k
-or (a bit) faster:
( r, Z- k8 p3 @8 j4 [6 T5 B& j' b/ N   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
, t3 I2 @7 J0 @
6 I0 [6 U9 J* o, ]( Z, D# V* `; x   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  + H5 `( D& R' E& {+ W' a
     ;will break 3 times :-(
$ i; A5 x! u+ I/ t  |4 [7 C- L, W
4 k$ |" H: b7 [/ Y6 h-Much faster:% Q. v  I- T) e7 c
   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'
# u% N) e) e; a4 ]" u0 n# ]4 J* w! a, F$ H) C
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
8 W5 [! _3 \  B6 D7 S7 hfunction to do the same job:
  A- A& w  ~2 J9 u, U7 H7 g2 b7 J- W
   push    00                        ; OF_READ
  G2 ?  \$ `7 f5 A/ Z1 M$ F1 ]   mov     eax,[00656634]            ; '\\.\SICE',04 C7 D+ y& s# ~# ^* y
   push    eax
' v% V" H# L0 Y& O8 j. S   call    KERNEL32!_lopen
4 T( z2 e9 k( V5 j, H   inc     eax
5 d& ^4 Y( \5 }3 H* D+ E, Q   jnz     00650589                  ; detected
, V, l: E; E* J) s& o1 i" e   push    00                        ; OF_READ/ }8 Z( r/ z/ |! G
   mov     eax,[00656638]            ; '\\.\SICE'5 a2 m; a6 v/ m# X" V
   push    eax
3 Q; D: h* f  I) e7 E   call    KERNEL32!_lopen
5 q+ V- u/ U" K7 M1 q   inc     eax
% }. s( r7 X$ C+ D8 r   jz      006505ae                  ; not detected  `8 ^+ h) q+ a1 |& ~0 y% N
5 @4 G- _+ _( c- ]/ a; y: h

% J3 B4 `8 f( F( J7 C__________________________________________________________________________; q4 ~+ d' x, `% r

5 Q  f4 U- H' m( g9 v/ h/ V% SMethod 12! N8 I4 i! Y7 w* o
=========( c, P# g6 A6 N' \  U) z. h; C
' k4 G) k4 ^$ X  ~$ G
This trick is similar to int41h/4fh Debugger installation check (code 05
* M" L$ }$ S% W  o&amp; 06) but very limited because it's only available for Win95/98 (not NT)
* Y/ I3 o5 s. e# b; d  A; Fas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
: o+ }+ u3 I! B: Q# K
' i& j$ T3 {2 r& y" b   push  0000004fh         ; function 4fh
/ c$ S0 R. [6 |  H1 _; Q' k, h   push  002a002ah         ; high word specifies which VxD (VWIN32)
* D! T2 k+ W* ]# ?6 Y7 e9 ]: y                           ; low word specifies which service* O+ q' k0 ^9 N/ o5 J  F5 M
                             (VWIN32_Int41Dispatch), P6 e7 G1 [( h- Z2 e
   call  Kernel32!ORD_001  ; VxdCall
: a4 g4 ]' k. }3 {% I# b# `   cmp   ax, 0f386h        ; magic number returned by system debuggers
& D1 F' W' O( j( T" A( W" I9 y   jz    SoftICE_detected
% I* v3 N- F5 ^; D  g9 z8 N+ X. u' r* f& G& e) W8 O3 {
Here again, several ways to detect it:& l4 X) i5 \8 M

. n5 F& g7 B& g# J& R9 c. j6 `2 P    BPINT 41 if ax==4f4 x/ G: ?$ i) [3 B$ j/ K$ I# D
1 z7 N5 o( A+ g# @, F' H1 y
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one
! q6 j1 v# M- J9 ^6 `1 y/ U' Z
/ r6 Y5 q1 X! _; F7 u    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A( B: g5 S3 d7 B& `
, E; n) f7 N* E& T2 H
    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!7 d* I$ d% V% Z- |9 L6 R! V9 F
. G* s& l/ _* Y# y6 v
__________________________________________________________________________
. p. d# n: F2 @7 b$ h& {6 g# E4 M1 O" U% v: s
Method 13
( w+ D& |7 m4 i. Y' Z$ P=========
1 B0 V% K, _1 Q& t+ N
. M4 r+ x: n9 D) R9 ?Not a real method of detection, but a good way to know if SoftICE is" ]+ D! m3 F9 d0 _/ c. ^
installed on a computer and to locate its installation directory.; A: P& M6 g& [% }' C; @! t
It is used by few softs which access the following registry keys (usually #2) :" F- B  Y* \" f. L$ a

0 P. h( g. }, _1 e& b9 u/ C* `6 G-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
  i: k" ]( T3 Y" Y6 I" R) X\Uninstall\SoftICE
# Z: s# b# E8 y* A8 p; v0 q7 J: k1 x-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE' W3 t* G4 z/ l" A
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion! \6 m. D# S$ c' f6 ~
\App Paths\Loader32.Exe
# Y- b; x. }5 ~0 s" P* r  d6 t; P0 c1 |7 W: E! T) a: k

- |8 J- {/ z' ~' x% x9 q; M6 e, S0 H' FNote that some nasty apps could then erase all files from SoftICE directory; [! V& h$ K5 l
(I faced that once :-(+ s& O- j( u7 m7 L

5 u/ C# ~. W  l, C: O2 PUseful breakpoint to detect it:! Z( B' {( U6 _* h. ^6 g

2 r! h( m; [) X' w     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'! l1 x& z3 T+ d; }/ _6 F. Z

$ N) h$ u5 Z( i__________________________________________________________________________
7 I- P- |' b: c' B. @: g+ L9 b) R) z. K. E

3 E6 e$ R, P$ pMethod 14
2 K2 L4 e9 M  c4 [! x( G8 w: i=========
& f2 o' W, _1 a" Y; @% c4 y9 T; E/ l* ?2 |6 L
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose" S) p% ^; [0 V( [& O# F; f
is to determines whether a debugger is running on your system (ring0 only).9 e# S) K; W9 c! j
4 V3 ?- m' g7 ^
   VMMCall Test_Debug_Installed
- [! X1 U& p; A   je      not_installed
# X: @+ s: W! r$ Z9 Q7 N: w4 x" E: i) x# [7 g5 e4 G% ]: n+ r
This service just checks a flag.8 t6 q! c6 X+ l7 L6 m( y
</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关注公众号

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

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

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