About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>2 V* c4 E0 G: y2 R- U5 ]4 w0 x; i9 r
<TBODY>
. N8 [! a- L& S1 h0 a  Y& a<TR>) e1 C1 j5 {, P% g
<TD><PRE>Method 01
4 p$ q6 O3 t3 W* ^=========; L+ [7 k4 I# j+ p9 x

' o/ Y/ P% H7 r( w# E; RThis method of detection of SoftICE (as well as the following one) is
! V" V; O6 ?- n8 [7 |used by the majority of packers/encryptors found on Internet.5 }" B6 G7 h4 c
It seeks the signature of BoundsChecker in SoftICE& i; W( Z5 v; |' A) q
" M* |! p2 Q( v) \3 M
    mov     ebp, 04243484Bh        ; 'BCHK'
# E% R# Y# I/ c3 Z    mov     ax, 04h
( s9 B7 R* O: I( }    int     3      
9 h+ m4 r2 n$ [4 H8 a    cmp     al,4. a1 u2 y; b3 \& ]
    jnz     SoftICE_Detected
5 J1 m- I1 P) o1 A$ ], ^' g3 [' D# L
___________________________________________________________________________$ X/ `: B& r3 W/ i' {
: T5 r2 Q1 W( n- M' q6 i
Method 02/ u  F: `* ~8 L
=========
/ m3 g  Q3 L, F' J; M
- [# T  o4 S6 {6 eStill a method very much used (perhaps the most frequent one).  It is used
! F# E# v) O7 T% V4 s8 Lto get SoftICE 'Back Door commands' which gives infos on Breakpoints,/ }1 f, x% D( I0 V( ^! Z$ {3 x
or execute SoftICE commands...& a( j/ u3 n5 n6 y6 n
It is also used to crash SoftICE and to force it to execute any commands
4 b+ V2 f" d# f  S; V; c(HBOOT...) :-((  
. L7 G: M  L# x: j" M) E- ^6 S, N9 Z% K# ]% Y; v# z
Here is a quick description:( i/ D% ?; ]' o3 ~1 Q6 ]/ p3 z
-AX = 0910h   (Display string in SIce windows)
1 B% W5 P8 x2 d- J5 h8 R3 R-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)8 ?% p, P( E2 A9 C; z0 f
-AX = 0912h   (Get breakpoint infos)
7 I1 P) ]+ t: C! K! z1 h/ D-AX = 0913h   (Set Sice breakpoints). t4 R! Q/ E* v3 ~
-AX = 0914h   (Remove SIce breakoints)
) `6 N2 E" Z) F" Z' S8 p( ^
# D. _8 K# ^6 v2 YEach time you'll meet this trick, you'll see:
, l; X3 L2 G. q8 M-SI = 4647h9 {9 s0 e. s# P% A" e
-DI = 4A4Dh" k, V; i4 j  q
Which are the 'magic values' used by SoftIce.
4 N9 a! c0 A- V2 sFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
2 m8 i$ J4 c( F5 G2 U* f$ H. a
) Q! B, y1 ^! J' z7 r" w  }* v$ vHere is one example from the file "Haspinst.exe" which is the dongle HASP3 }7 h/ m: B8 ~1 ]
Envelope utility use to protect DOS applications:
- D6 P0 w  A# h. A& l
( ?0 o  Z2 o5 G1 i. ]7 z
* I* m, f4 q+ B( Y& O  T4C19:0095   MOV    AX,0911  ; execute command.
. u- Q$ X" B8 U) B" |7 K* q7 D4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).- G5 a" e2 x% ^2 x+ `1 f
4C19:009A   MOV    SI,4647  ; 1st magic value.
( d. d) y. e% j% j# ?% ^4C19:009D   MOV    DI,4A4D  ; 2nd magic value.% [3 z& o: S7 R
4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
. P: e* j# Q4 B& }% ?& r4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute
( r1 O5 c$ Y8 M4C19:00A4   INC    CX
* {; C/ a# Z/ D, m4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute
+ J" y( }+ Q( K5 ^" e4C19:00A8   JB     0095     ; 6 different commands.8 j0 p5 ]' b# G2 c+ h5 l
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.& i9 F0 M& l) q: ]" \6 q* x& q( @1 x
4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)' K# t7 t  @: W  K# I  o+ x
& q3 F0 \# ?+ X. E5 H" K3 p+ f
The program will execute 6 different SIce commands located at ds:dx, which
4 Y! E0 h9 I* ^9 v$ Dare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.1 _" g1 m" K0 U- X# y

+ T; H& e. q5 Z2 k  f: k0 y7 Z3 K( z* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
: o2 `7 l1 q2 ^; @! f( v% M___________________________________________________________________________
5 {9 B7 y) ?( w) {# f  {6 v& `, h  p# t9 u4 s- z; ~

5 v) [  ?. i/ A+ s0 p* ?2 rMethod 03  w5 Z" I# ?) r6 D- ]
=========
8 T8 Y. k9 k3 J2 x7 q  a, R/ \* E
" Y$ q' c: r0 |" f) C3 }Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h8 ^5 v; ?( S. I. ^2 {8 I3 p$ W5 l
(API Get entry point)
, M) \; `; E" E  B9 o3 |' [2 Q* \% [        
( [7 L+ D3 g1 W1 m2 q# L
; ?9 J. }( @" b    xor     di,di, s* k# r2 z( Z3 T
    mov     es,di: Y9 ~) m. W: v% e8 K" u# |
    mov     ax, 1684h       9 x) n* T- }) Y, H" X1 _
    mov     bx, 0202h       ; VxD ID of winice
" L9 b% ?: ^) I    int     2Fh
  k& |! ~  `3 K6 }' w* m5 }    mov     ax, es          ; ES:DI -&gt; VxD API entry point
" t' @. t) a1 p9 X    add     ax, di
+ w- m# V- U; j$ c9 a8 e0 D    test    ax,ax& J$ u2 o+ b$ H4 V( p! w
    jnz     SoftICE_Detected& W$ _6 k4 v+ }- o2 l" ?: M, ?
. V: ]( G8 G, a1 y
___________________________________________________________________________# @. H* [2 [$ t6 c
5 T1 ?( h" r; r# O3 _% y; W
Method 04/ ^% f" {) {! e1 l
=========
$ J7 _) ~% x6 \  Z$ ?8 Y4 e$ z$ B4 q5 q; R" `/ p3 W# M( [
Method identical to the preceding one except that it seeks the ID of SoftICE
9 ]7 i/ d& }" Q8 d1 GGFX VxD.
# d8 V$ A. j) P) n% n
$ @: ^  ?$ q; @- X. H( L$ w6 k  r    xor     di,di& x" B: M4 m+ k/ v/ I- @& I0 O
    mov     es,di1 x* g2 J0 g( J' E
    mov     ax, 1684h      
9 Q6 `# s4 g/ t! a* D    mov     bx, 7a5Fh       ; VxD ID of SIWVID
- l1 m4 X$ J; h    int     2fh
! l& u( v+ h; {& Z  r    mov     ax, es          ; ES:DI -&gt; VxD API entry point/ o/ }3 R+ w: {+ Y& r- O) u/ x5 k
    add     ax, di! b* u; W- w0 }! }/ Z
    test    ax,ax: F4 x3 n1 ~: {5 v4 C
    jnz     SoftICE_Detected
( d% I# h# k& C5 f5 ^
  [! u: Q3 q9 y, s6 p__________________________________________________________________________
+ h) u  [2 {* H2 u- x
3 |$ ]+ x  ^; r  b$ s- b6 R! T% _! g: Z/ \, T( J
Method 05
$ v) p" M; W# Z0 j5 u3 d=========
7 b( h1 O  D5 [  u1 J6 e0 A) j3 Q
2 R) R! j  @) O  R) i4 B+ ~" yMethod seeking the 'magic number' 0F386h returned (in ax) by all system
9 S+ F, U8 {- w. ^  L1 _debugger. It calls the int 41h, function 4Fh.! v/ ?* i( u' N. r5 `. r
There are several alternatives.  
$ V. j6 P5 x+ ^9 G% a" c* N; s% W3 k) w  U/ _; w) O, a1 U
The following one is the simplest:( ~$ ]1 F0 \' c% |4 U$ H) B4 _5 j

8 o! C5 X0 p7 K8 S) q9 O4 e% N    mov     ax,4fh& F# Y- o* n3 k' K1 ~+ I$ F0 Z
    int     41h
' w* J5 Q# ]  P; \    cmp     ax, 0F386
8 W7 M7 E) _2 N7 h    jz      SoftICE_detected) m! I* a% x, ]! U+ o
) q# p1 T; A4 h5 A

+ J8 _, P9 W  m* ]1 ^) L1 _' ?8 eNext method as well as the following one are 2 examples from Stone's 4 S# b$ C1 O3 E
"stn-wid.zip" (www.cracking.net):5 \3 v) S: Y6 c2 M6 \: Z; ]# w3 H

! ]# `" g6 T' \( p5 Y3 R8 n/ X    mov     bx, cs# g- ]: n5 X, B% x  c$ I
    lea     dx, int41handler2' g# f& l7 ?; v) f" E
    xchg    dx, es:[41h*4]
) t7 H" O% e4 a: {* a    xchg    bx, es:[41h*4+2]
" @( h* Y  y2 G% ^; y5 l    mov     ax,4fh9 F; v. a! O# b8 J. k$ i
    int     41h- T8 f$ l* n9 Q- K% j: w
    xchg    dx, es:[41h*4]
( D% J. o3 @8 a9 _  d    xchg    bx, es:[41h*4+2]
/ {1 ?3 [+ k5 M3 w    cmp     ax, 0f386h* s  d# e- R; ]
    jz      SoftICE_detected
) w# `* I8 L& |) m5 o" B9 V) d9 A4 Z$ }9 P  m' E2 \7 G! _
int41handler2 PROC
2 U3 w: j$ ^( c( s    iret( b. V* n* @0 L# h4 m; `: h; L; K: J
int41handler2 ENDP
, z8 z- D0 }8 e
/ m4 H( t4 O5 x! [0 W& O  Y+ D- {- Z' V( c7 P
_________________________________________________________________________
7 B4 x% ?4 l" O( k. d! V( z  q% O8 |2 N8 X7 q) x9 G( I9 k
! x% F  j2 i% Z1 M/ d1 F
Method 06
8 V# B5 V/ b1 W% K  X=========
0 Q; `4 D% N) p9 b" x, T9 c, T/ n! ?/ K( k. J
' T  o0 V6 J9 R: R0 b7 d, g: o1 a
2nd method similar to the preceding one but more difficult to detect:
7 w( g3 o6 z  L  {: f, Z
. r; e* _& R+ V6 _
+ z# R* k% l: f7 c0 j5 Sint41handler PROC
' ?3 w( i, [8 V8 [: T* o    mov     cl,al% \- W# W, M( l- W
    iret
# f, z. `! S; \# e5 x1 n) X  ?3 [int41handler ENDP1 h: {' h. p8 u4 Q. G
" O1 ]6 |) S* |3 f

2 i2 v9 W5 u7 ^$ @1 i    xor     ax,ax. n, q4 L: X5 `
    mov     es,ax+ C/ N  r$ L1 J6 M, h
    mov     bx, cs
* V5 V- ^4 E. V0 f4 @( S) G, G    lea     dx, int41handler2 V+ R. L* R' s
    xchg    dx, es:[41h*4]7 ?: Y& [5 E% z) ?
    xchg    bx, es:[41h*4+2]
: `+ v- K6 c1 c& L4 g' Z    in      al, 40h
5 s$ @8 Q( x/ H* d6 y, G8 p0 B: g# A    xor     cx,cx$ Q8 o+ Y- w& C" }4 I8 M4 _4 t% v
    int     41h8 ^# Z. m& n" V6 `
    xchg    dx, es:[41h*4]9 Z" S# J- k; [% M7 N4 x
    xchg    bx, es:[41h*4+2]
. U* P; w0 \/ J# B- N6 `    cmp     cl,al
- Z+ g6 Q7 f2 O$ b. \: S    jnz     SoftICE_detected
) m7 v/ y  g3 X- G6 O! |5 i4 V7 x3 I/ W4 h; G6 i
_________________________________________________________________________, p' t' j' ~7 F& t9 k% B
4 i; A- R: h: P" @% ^5 S4 I  h4 C
Method 077 v& H3 Q1 P2 [% V* u" b
=========
9 c+ P3 ^' {$ W2 `, k. P% ^4 `
Method of detection of the WinICE handler in the int68h (V86)
. e" x$ I6 z+ b% L( U2 U" C* H* a3 m6 f
    mov     ah,43h$ E% F7 r% Q8 q2 D/ Z7 D# O
    int     68h0 u: m) @8 i1 Z; V5 {& K8 B( i( h
    cmp     ax,0F386h
1 D  A. ~# r0 X/ J    jz      SoftICE_Detected3 ^; E6 }) H7 U

. G  w# h3 p- b& f! y& H7 R9 S7 U! f8 b
=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit5 G$ d* E8 A) G9 T! ~
   app like this:5 U' I: e; I- c- K% ?
8 q9 A/ @' L0 X4 B/ L
   BPX exec_int if ax==68
7 N' M) e( k% @, Y) o6 U   (function called is located at byte ptr [ebp+1Dh] and client eip is& E& }0 @; c$ r, n8 j& W% T
   located at [ebp+48h] for 32Bit apps)
. o7 ]/ E1 [, i4 d4 P5 }- k; b- V4 c__________________________________________________________________________9 I6 g  T# |% m4 R. ~: u6 y
2 j/ Y( ^, `' I8 T, k
$ z: h7 k4 o4 p5 M
Method 08/ v5 ~9 u7 A5 M& P: Y. v; p% O7 i
=========
9 O! v% F8 ]; Q' e- l0 G1 M( R; \& ~
It is not a method of detection of SoftICE but a possibility to crash the
% P7 O' d7 A& D+ ]( Q# o# `- u+ Dsystem by intercepting int 01h and int 03h and redirecting them to another' U# |6 e1 D% Z
routine.
. P7 G0 y9 D% g2 D: C6 @+ d+ qIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points/ ]8 F  R( c* i$ k
to the new routine to execute (hangs computer...)! }, S5 m& e) a2 p, {

3 s# p7 U! D6 t/ W    mov     ah, 25h
9 z* l1 a4 B7 m7 Y% P7 G& P    mov     al, Int_Number (01h or 03h)
# P3 K; y' S( C! o3 s    mov     dx, offset New_Int_Routine4 g+ }" H' Y9 q! D  W
    int     21h2 `' f6 h1 X4 x: C

  U; Q% v( Z5 Q7 ^2 [* a__________________________________________________________________________& C3 X/ H. T- P- \4 s

8 O" Y3 M: S: |# SMethod 094 K; K4 {9 h# R; f! v8 e/ f/ B
=========
6 x8 ~; j$ y' B; W' K0 z. v
7 ]9 e) x1 }! C1 g% Z% e6 d  kThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only6 z9 u2 Q% |- |
performed in ring0 (VxD or a ring3 app using the VxdCall).1 _; Q. t  L4 A; I
The Get_DDB service is used to determine whether or not a VxD is installed3 |$ E* ^- D: b4 l
for the specified device and returns a Device Description Block (in ecx) for4 Q# {- F( K1 S( [0 X- ^* ?3 f
that device if it is installed.
, k9 r: r& F8 K. G8 C  T3 p
9 D* A9 ~" d0 \  z) W   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID& N4 k$ c( e) g4 o( E, ]
   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
7 H# k0 h+ Z# U3 E. m   VMMCall Get_DDB
$ d& `. T" N( w( c* K- h/ `3 U   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed* P+ D) _" S% Z. m9 v7 }4 l* _
# W8 D8 @" V3 Q8 l
Note as well that you can easily detect this method with SoftICE:8 t6 g) _; t; s" H. R+ M
   bpx Get_DDB if ax==0202 || ax==7a5fh# q! d- a4 A0 l/ F

9 \7 Q, B% w6 n! {__________________________________________________________________________
% _# g$ \9 Y  F7 }8 B- B0 x3 ?  ]- q- [
Method 106 Q9 N3 u) I7 x7 W- [
=========
0 L' Z5 p/ n4 F7 [1 \  Z1 w5 y$ F$ K9 I, W7 `" Y
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with
0 r+ k" |: ~' b: _3 p( p+ {* `  SoftICE while the option is enable!!
# \) {2 S) h: `6 _2 O5 e* Z( o6 b$ k  ~! ~
This trick is very efficient:
1 {) R7 z6 e1 qby checking the Debug Registers, you can detect if SoftICE is loaded1 ^( i2 n+ q) ]. Z
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if, \; |+ Q( d8 O# Z) T
there are some memory breakpoints set (dr0 to dr3) simply by reading their/ j1 c! w6 z+ G1 @7 P
value (in ring0 only). Values can be manipulated and or changed as well
* w+ {+ ]) v$ k, H(clearing BPMs for instance)
- J/ V1 i: a* u& p$ D2 _3 D7 u+ b/ t6 P
__________________________________________________________________________
& P2 p  L2 V  [/ o; s3 w7 q% K
/ P3 F0 Z4 V  b9 y4 |Method 112 w: X8 Z, c' k; H/ s
=========
( L" I7 v9 J* l6 N: k+ i: q1 e$ H) g& @6 t4 t) N' d! r
This method is most known as 'MeltICE' because it has been freely distributed
% f1 z+ I9 l( U0 x6 hvia www.winfiles.com. However it was first used by NuMega people to allow4 a0 r% ?# D* h0 c
Symbol Loader to check if SoftICE was active or not (the code is located5 ~! B; p& {+ G0 w5 }& ]. S
inside nmtrans.dll).
. j3 Z. X( F, q) e7 R) R1 p) j! w( B' \0 z0 v* Y. o, g9 s
The way it works is very simple:
0 Z+ W8 i, q' _* O1 f6 JIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
6 l! I# u) |  X& P3 z( a8 A& {, h! ZWinNT) with the CreateFileA API.% f; F# ^6 @: T; u
8 H& j, R! ]  Y& @
Here is a sample (checking for 'SICE'):
' s/ H. S6 G% T$ l$ g0 x7 J- G* N1 i5 x/ J" Q8 o* i
BOOL IsSoftIce95Loaded()
) J  @. P' \5 |1 @! j1 U5 c" S{
; a+ ?3 g' z% M0 l/ E& x   HANDLE hFile;  / `4 I' o; a8 I; h# d8 a
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
: v* v( B, e6 ^" ?7 q                      FILE_SHARE_READ | FILE_SHARE_WRITE,
# R8 ^) T% @" }8 Y2 y+ z                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
* Q/ O1 M$ R. C9 W4 [   if( hFile != INVALID_HANDLE_VALUE )& O5 v9 H  u1 B5 P" d
   {
/ S; i8 y3 e3 r0 h! X      CloseHandle(hFile);
/ E" G% O- H  Z: U6 K1 H( [      return TRUE;
) U6 x  Y, @+ Z9 x8 O0 B9 M3 t   }$ x5 a6 E6 I/ n# h' s( l0 N1 X# r
   return FALSE;
7 N4 W/ a2 O2 V9 k' d; U2 ~' D}
" \7 j. X" q4 X* Q; f9 O- ^9 K* Y# a' I2 r
Although this trick calls the CreateFileA function, don't even expect to be
' S. V4 V2 J( B( Hable to intercept it by installing a IFS hook: it will not work, no way!  m  U8 c$ `  h
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
: x9 J5 g# L% u3 ]  f% @( }  Mservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
$ d9 o5 v% I7 H+ w% e7 B  qand then browse the DDB list until it find the VxD and its DDB_Control_Proc9 h! M+ K6 H9 @
field.- I+ I7 \) r4 f4 L5 a' c7 h  r- W) I
In fact, its purpose is not to load/unload VxDs but only to send a
  _& k' S% Y- R3 A* ^. d! H$ N3 x0 DW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)6 W0 W( g) e! O  ?4 t
to the VxD Control_Dispatch proc (how the hell a shareware soft could try& A! }/ I4 C: J  ^- n" ?4 g
to load/unload a non-dynamically loadable driver such as SoftICE ;-).( l% c: ~: J& d! X
If the VxD is loaded, it will always clear eax and the Carry flag to allow+ i# C& A% J- a. o/ J5 ]
its handle to be opened and then, will be detected.0 p7 N* a! R0 t  v
You can check that simply by hooking Winice.exe control proc entry point' W# v. _( W  U$ u7 e- A
while running MeltICE.
5 z8 X1 u$ o9 M. A
/ a8 {$ G* _. a, o: E# |
" `" ^2 B: N) a$ n/ i) |) I  00401067:  push      00402025    ; \\.\SICE
* Z6 B$ Q, }. x3 C% E  0040106C:  call      CreateFileA- \, \" ]' g+ V% T
  00401071:  cmp       eax,-001
: g5 E. P5 [: A( D& G6 _  00401074:  je        004010914 }. V# \& _1 s$ n
8 E5 y/ j, M! C4 p; O# \- b

5 @6 V( `- Z1 u6 s1 NThere could be hundreds of BPX you could use to detect this trick.$ F5 ~4 z3 H1 D7 M( G
-The most classical one is:- ]( C$ [- K% W+ f
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||. t4 R2 i9 [$ W# O
    *(esp-&gt;4+4)=='NTIC'
, `6 @& z0 t' f* U8 P& N$ o/ J$ E6 L9 T; V% i1 o. `0 S) w5 r
-The most exotic ones (could be very slooooow :-(
' A$ D2 E; }% w# ^   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  
2 d) E7 O0 ?% }1 ?8 `- k     ;will break 3 times :-(/ O: `$ r% _& o4 t3 g2 V8 r: B

8 C3 s: v0 m9 O- h( `; }% Q-or (a bit) faster:
# w( t& B& c" F# i4 t( E/ d   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')5 P( z) u% y4 b5 z) k9 v5 G
/ W. G6 L# G) n% q# z
   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  
* }; i4 _9 q+ F+ Q, F     ;will break 3 times :-(( G1 @! {; l! N' Y2 z9 `8 e6 [

  Z$ S" v3 u! M6 P: c7 u-Much faster:
& K  l& {$ O/ u% ~. V* A   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'
& c2 R. H( ^4 ^9 J9 J" j  f
- d: {6 n( d/ v. [, g, g9 x) ]Note also that some programs (like AZPR3.00) use de old 16-bit _lopen3 u. {' x7 N, q6 _2 c. m  L4 ~" w) R
function to do the same job:
7 L$ ]1 `  [1 B& Y$ X' g+ A) U- w1 j0 @( B
   push    00                        ; OF_READ
# }9 H  Q# b5 }) a' Z* E0 e   mov     eax,[00656634]            ; '\\.\SICE',0. L1 l$ q% D, o! x; {
   push    eax3 d+ m$ u+ B$ A2 Y: J+ m. R: Z
   call    KERNEL32!_lopen, a' B$ d  K6 @
   inc     eax4 @" ^+ `  t5 Z: F
   jnz     00650589                  ; detected
9 T  ^) |) `2 g* ]   push    00                        ; OF_READ
' {5 I; a5 z* y* _8 ^% O   mov     eax,[00656638]            ; '\\.\SICE'
3 y& y8 w" a& _: h& A$ S6 o   push    eax9 w* N# b! E9 Y% [% T8 o; Z; L/ k# e
   call    KERNEL32!_lopen) t, L. T  d$ n, k1 X) l7 w% P
   inc     eax4 K/ b1 T* {( D$ s/ r- f" @1 e
   jz      006505ae                  ; not detected3 e8 e0 I9 @6 a8 D7 q
4 T/ J% h; @, J, ^  ^  L
7 B% @7 [4 a5 g' [
__________________________________________________________________________7 p6 l$ E4 W4 i8 ?' a: K6 a( n
/ d% K7 S: k& X; r, G$ z1 J. V
Method 12
3 [8 @$ K4 y1 r. z=========
2 D8 R9 O1 Y2 o5 Q5 c- K9 \- Z% g
: u$ O! o- R9 ^/ Z9 kThis trick is similar to int41h/4fh Debugger installation check (code 05
/ [* l  F( Y, O&amp; 06) but very limited because it's only available for Win95/98 (not NT)
1 i7 h1 d- c% `# S, R( Ras it uses the VxDCall backdoor. This detection was found in Bleem Demo.0 F( B$ A' R8 a

* T4 J. u8 ~/ F) @* m! A   push  0000004fh         ; function 4fh  S( I4 D: O1 V
   push  002a002ah         ; high word specifies which VxD (VWIN32)  }8 `- ?$ f% ^
                           ; low word specifies which service' E* g: T5 @* W2 c
                             (VWIN32_Int41Dispatch)& s# Q6 @' q2 E& x
   call  Kernel32!ORD_001  ; VxdCall$ t1 H1 D+ ^* M/ J& J: T' V
   cmp   ax, 0f386h        ; magic number returned by system debuggers6 e, ]% }, U/ |$ a/ R' N
   jz    SoftICE_detected
2 [! p; D' h( i! z0 T- `- |% S+ n
Here again, several ways to detect it:2 U1 F0 a* _4 F7 P+ [
& \/ i9 p# y0 h- l6 l% ?
    BPINT 41 if ax==4f
7 ~2 l- D; d9 `5 o4 X, j6 P
$ t/ |# y- {, p" Y2 d    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one
9 i/ I  J5 E& q( Y# t( S: I& i" L* v: r& _$ d
    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A/ S- g# \) X& q4 f) i, L. t
0 |0 h, m% \/ s) N% r: c
    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!7 t3 g* N4 _7 `( K' I4 o9 ?( T& Y+ n
8 ^0 l+ i) j2 f# \6 \9 f
__________________________________________________________________________
* e8 G# k* L+ K+ m! R! H4 X6 a" Z' ^  E/ w& K+ E7 x& k! [8 m
Method 13
3 d- t- v& V/ V5 f=========9 W. n1 F, i0 _
. T2 X5 `6 P* F# a7 b$ Z( _; q
Not a real method of detection, but a good way to know if SoftICE is
$ D7 I" V2 v4 r" e) z0 N8 xinstalled on a computer and to locate its installation directory.
; z$ i( D6 q2 Q* k8 YIt is used by few softs which access the following registry keys (usually #2) :1 W' D  o; U0 A# ~& o- h
- p6 p. `/ K* z- x% ?
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion5 G: L" S" K# Z  o$ p, U
\Uninstall\SoftICE
& X4 ~7 x; u7 h( O- t- H-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE- q' h2 [% f" E' u
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
% P( C9 C3 M9 l4 \) k& S\App Paths\Loader32.Exe
9 m' G( H; i0 @: y6 I1 o5 |* W3 m1 F6 P

7 q) O  d/ x+ v" k# INote that some nasty apps could then erase all files from SoftICE directory
# m3 i* F" _3 _. S; T" l(I faced that once :-(3 _1 x; Y% m. X/ A9 x3 n$ @
+ w% a4 T* L* S$ Y; D4 F
Useful breakpoint to detect it:
9 |! T3 B; }9 Y/ }6 h- J: d
+ `1 F) ^( f) Y' j5 S     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'  {  }; @) `! e  i! ?

6 c2 [1 I5 N! g" Y' Z__________________________________________________________________________* g/ M3 ^4 l' e& t

( M' M# s6 @4 N4 d$ t* D
3 L+ j1 O. r4 w* j3 y/ xMethod 14 , ^: P; z. P' V
=========
/ K, f+ I2 N+ W  P* S, }4 a& y) C9 m
) i$ T3 d- f# {( B' y% [' bA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
* I  u" ~9 B1 x2 |7 z. Xis to determines whether a debugger is running on your system (ring0 only).. o/ D& a# b  N" x5 A# T; R' b

6 U+ p. X/ C4 t% N( [9 z1 P9 z/ ^0 k   VMMCall Test_Debug_Installed
7 J  F( A+ q6 Y  M# f2 p9 ?6 ^   je      not_installed5 {" [- M& v3 |/ |& e7 q# X4 Z! C- _3 [

! T8 f2 R5 {) kThis service just checks a flag.9 V0 U" {) E  V- q
</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关注公众号

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

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

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