About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>) e5 F0 r* E& W( q( g0 w2 ~
<TBODY>7 ~3 S4 ^# B8 z7 x1 e
<TR>, T3 M6 n' z7 A$ l$ y. k5 B8 ]
<TD><PRE>Method 01
5 O0 H; U3 Z% L0 V! C" ?=========9 b4 W( j; d0 j5 O1 @

8 F% g' _+ K$ F% FThis method of detection of SoftICE (as well as the following one) is
1 v, z" \1 l8 v4 E: G" b" O' Sused by the majority of packers/encryptors found on Internet.
- t( I0 `$ ^. W5 YIt seeks the signature of BoundsChecker in SoftICE7 a) j  d; }# D0 |2 h* R# e8 d
  V8 _% w9 a  Y
    mov     ebp, 04243484Bh        ; 'BCHK'
# [, q) }+ B" \    mov     ax, 04h" E9 ^( Y. H0 l, W# B  t2 s
    int     3       8 B+ h: T3 I# |) ?
    cmp     al,4- ~7 W1 V7 H+ N) _+ z
    jnz     SoftICE_Detected
$ q! A0 [) G5 e. s
: D0 Y* |/ s" w___________________________________________________________________________
! P9 F6 a. v2 a+ H% c% X1 [
# n9 S. O* A# _5 `Method 02
) ?' K6 y$ R" e2 k  Y1 M: W=========8 \; T* N0 o* ]9 ?3 P3 s  f( X# z
* x' J7 O; [. w# y  T: b
Still a method very much used (perhaps the most frequent one).  It is used4 ^. u  H; s9 }3 u
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,5 @- e1 b1 |7 T* n  ~; d
or execute SoftICE commands...# Q  [  O. {( ]5 ^% J: E% \
It is also used to crash SoftICE and to force it to execute any commands+ B) p& w  p% {8 x4 \8 }
(HBOOT...) :-((  $ x  o: P  q6 _  j6 l

1 L) {% U6 S' s+ N. QHere is a quick description:% P( e" I+ Z% f2 N4 X( {/ f
-AX = 0910h   (Display string in SIce windows)' c& B' j, S  p9 Z2 F; p
-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)
- w& @/ j/ U' C1 {8 z2 ~1 C-AX = 0912h   (Get breakpoint infos)- z/ A2 l8 y* Q! h
-AX = 0913h   (Set Sice breakpoints)4 T, p6 y4 k  `3 l
-AX = 0914h   (Remove SIce breakoints)
  C5 V% ~' W- z6 n* B$ c4 K$ P! R' y% v0 p
Each time you'll meet this trick, you'll see:
' e7 b( j+ c, J# T( c; `-SI = 4647h
% T# x! x  ]) j2 R-DI = 4A4Dh
1 o) _# s4 |" ?; }2 q9 W9 y# Z& ~Which are the 'magic values' used by SoftIce.
& [4 J& e8 u( E/ I& P- I# }For more informations, see "Ralf Brown Interrupt list" chapter int 03h.$ ^% N( ?% ?# G

* V' P2 n8 q& uHere is one example from the file "Haspinst.exe" which is the dongle HASP
, u% L6 U& p1 |$ O% aEnvelope utility use to protect DOS applications:% O5 R  u) [: ?$ M
3 O8 E4 {2 C: T$ R* r

, {# _( X4 a6 V8 {8 Q8 t: w4C19:0095   MOV    AX,0911  ; execute command.5 f2 [% m3 `  ?, v! E0 {$ B9 g
4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
% U9 E* b0 a- C6 d8 F5 W! P8 Y3 D4C19:009A   MOV    SI,4647  ; 1st magic value.
7 x  H3 M* a! r4C19:009D   MOV    DI,4A4D  ; 2nd magic value.) d( r! z, ~# L9 c+ ~/ j( o( T
4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
4 A4 N, l! R1 [( I$ g  y) {; m4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute0 ]" f/ X( G4 m" h8 f
4C19:00A4   INC    CX
' H8 T) n1 G& A% i8 Z) F# j4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute; }0 h& Z# ?$ A% G8 S
4C19:00A8   JB     0095     ; 6 different commands.8 p' A" r( C6 ~- [2 V
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
2 T* `0 r* C1 g. V/ E" R4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)# T0 S* {8 F- i! Y; Q9 U% S

8 \5 P( ^* W; wThe program will execute 6 different SIce commands located at ds:dx, which
; Y3 O( p  ]  ?, M. b, @are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.8 l4 V) c; H8 h3 k( [
. X5 q9 O" g: {, `' N  Z, i1 l/ Q
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
2 `5 L9 ?5 r; }, O7 O* n___________________________________________________________________________- V$ A. ~5 u6 _' M* E' n& N' Z9 O$ g8 D

; K1 k5 L$ n1 o0 W* P8 A/ H
5 V, \- T3 \$ ^0 z  N6 X2 ~- GMethod 03  r' @9 L# g- m. S
=========
- {9 R* E) X  W6 I+ V  n5 F$ C  Y1 d8 G
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h' B% d& x! z) n- r, t0 _$ M) A
(API Get entry point)
  |: g) a& P/ X        
) B! n0 i9 j. |* u
4 l0 R' U  k8 N5 D% `    xor     di,di2 o. `3 L% a, `& k
    mov     es,di  M. W3 C3 r8 K" N; f5 t
    mov     ax, 1684h       6 @. G1 P" ^$ M& o+ q
    mov     bx, 0202h       ; VxD ID of winice" M8 N* r/ z- T' U/ ^" j3 o4 }
    int     2Fh
7 \- Y9 t, k9 K: F6 n6 [2 g    mov     ax, es          ; ES:DI -&gt; VxD API entry point7 d2 Q: |6 j& w' P6 o. a5 g
    add     ax, di" w' a* C+ p8 ?
    test    ax,ax( S* z; M' _8 s
    jnz     SoftICE_Detected/ b2 R2 e% J. Y. a$ n# P
  l& y2 D4 r6 G; A# O5 I8 _. H
___________________________________________________________________________# i* v) Y% [* |) \9 b, e" E' U6 G
0 G7 }6 k8 G9 O- N: f* c6 I" Y9 H
Method 047 Z: N& ?$ K! |8 {
=========
- e4 O4 J0 v# H6 s/ ?$ b: f1 ?* m8 X# x/ I& m
Method identical to the preceding one except that it seeks the ID of SoftICE8 }: d0 f" x- I2 Y' d" g
GFX VxD.
: J9 |5 S3 w3 C' e! N) V$ P2 A: T: f1 ?$ A" D1 |8 j3 h
    xor     di,di: ~; E7 B' G+ A/ `& S3 N
    mov     es,di& k! T+ R4 A/ Z' @; Y
    mov     ax, 1684h      
/ z% J' Y( Y3 f& d3 B" L    mov     bx, 7a5Fh       ; VxD ID of SIWVID$ X4 O% V1 j* \. d  N. O1 n9 f
    int     2fh
6 Z4 H  [0 u  \& x6 S! D( s; S: W    mov     ax, es          ; ES:DI -&gt; VxD API entry point* K# J3 g5 U, {3 Y. B
    add     ax, di
1 Y# |( k: B7 B    test    ax,ax
( N2 [0 L  j" q% j8 g; w7 i8 v    jnz     SoftICE_Detected
5 c" ^" q' R3 P. h: K
" D$ Y4 i5 B% l, A( Y# B1 [: y__________________________________________________________________________1 I' `) B4 P9 T% t

5 f( B( J- j9 k% v& K+ k. ]3 ]0 M* z7 `% I2 f+ F
Method 05
% }% ]1 x- O' S, w5 a=========
4 @. q# |" n$ A
9 y0 p$ u, ?0 B7 ~. R) NMethod seeking the 'magic number' 0F386h returned (in ax) by all system: y1 P. R5 l6 ~* g& R
debugger. It calls the int 41h, function 4Fh.
( J8 ?( \! O; J8 UThere are several alternatives.  ) }7 a- D) _) c/ |, I

+ q1 j7 S2 E3 e9 v1 X/ A5 n1 G6 SThe following one is the simplest:, a0 r# p/ O) z3 D6 h

# W$ N  E" e% q    mov     ax,4fh7 v7 ~1 B, \( l! s7 F' N1 X
    int     41h" w' s' N) }; ]7 j  k
    cmp     ax, 0F3869 @. `1 O4 Y* J4 c3 {( y3 g! B
    jz      SoftICE_detected
' G$ D8 A# t3 J$ J% k. j# M; R
/ U: J0 e# w( V1 l: Y$ P. k' Z- U% x& g
Next method as well as the following one are 2 examples from Stone's
# A# U* Y, f$ a3 E% x0 x"stn-wid.zip" (www.cracking.net):
; D: }, X% J; Z% P% Y3 k0 ~: Z# a7 ^1 a8 [2 R! C3 l0 x
    mov     bx, cs
. V/ `9 g7 o, T( @1 y8 ~7 e  \    lea     dx, int41handler2
" i5 }0 o- A1 P8 B    xchg    dx, es:[41h*4]
/ N1 e8 x% Y' Q  G, X, q    xchg    bx, es:[41h*4+2]
1 w$ L( t) V) k  w    mov     ax,4fh1 W% J! e* e) }$ k* T2 q0 B
    int     41h: V- U' M2 V: Q( w
    xchg    dx, es:[41h*4]
! ]2 G+ v. J. u    xchg    bx, es:[41h*4+2]
' F. o7 c( S' X6 i" y    cmp     ax, 0f386h
9 T9 Y9 l- ~& R* k  ?6 z. m& n8 q    jz      SoftICE_detected; E1 ^( q+ e$ S- B
1 @  U& h* r8 Z* b
int41handler2 PROC1 [& K- c2 y7 W. H, [3 p! ~. R/ J# l. z
    iret
" x$ f; B/ y& R0 _int41handler2 ENDP
1 u' d' h8 j% v/ o7 E3 J1 X; j+ n: r  I8 W& P; C- v! s
7 P. ]7 s( ?8 P0 |
_________________________________________________________________________# I; j5 j  o3 u9 A; x
, i8 q( p$ d+ Q3 p: `1 p8 M+ V
" Y4 g, q0 k, ^4 S% x
Method 069 {2 y$ H) z, q+ D5 y) ?5 {5 a9 }9 j
=========
: d' v# k: o- h: J' @% Q8 E( q5 H0 ^2 F

2 h1 m, m1 r3 i- L7 r2nd method similar to the preceding one but more difficult to detect:0 m1 \/ r7 @5 z
. A) `1 C4 ]9 }8 p9 d
+ {  d9 k$ Z9 N, I
int41handler PROC1 A' h4 y; w9 w5 ]6 m( Q. s
    mov     cl,al
$ x. a4 a$ O/ R8 y! D! G0 N7 C4 O    iret# x" p) X, b! V- {$ _( n  n
int41handler ENDP: k3 S) j* g% Z5 s; B

1 f9 Q! I$ S6 y0 Q' x( N, f6 ?* ]2 d' x3 u: k6 C
    xor     ax,ax
: m7 ^4 D6 J- q0 q; v    mov     es,ax/ l1 j% g/ ~. u' X* o; ~
    mov     bx, cs
# r1 s5 s6 ]7 p, v    lea     dx, int41handler/ ?5 k& I4 \8 \# I: b+ J
    xchg    dx, es:[41h*4]
5 D! K: l" v. @; S8 b; |    xchg    bx, es:[41h*4+2], e/ v0 F7 y2 A% U7 Q' q
    in      al, 40h5 M0 d& P: W# k" h
    xor     cx,cx" t! g8 i% U$ y# ]1 t( O- L/ T
    int     41h- ], ~6 m8 k: g8 v3 D  h
    xchg    dx, es:[41h*4]( |7 A- V+ y4 R$ r. x: v6 T
    xchg    bx, es:[41h*4+2]
/ ]+ \6 r6 K5 F7 p    cmp     cl,al# T: g, [& }0 v+ _# s7 f
    jnz     SoftICE_detected
" d4 |% I1 `, T5 A2 k( j) I
! Z: V# r' M0 q3 q_________________________________________________________________________4 B  z+ T. D( I* z  |

, c2 }; l- }. LMethod 071 X, E9 F/ z: e, W$ q. W5 b" k
=========9 ]! u/ w, w8 d7 |$ \- q

# r4 d( i' o- D" V9 DMethod of detection of the WinICE handler in the int68h (V86)
( p& B7 e6 k  }  C" ^4 ]/ }
4 j) I7 @( R. Z% E; z* I3 ?( P% a: ]    mov     ah,43h2 z% C. h0 ~8 V: I# V
    int     68h
+ ?* \7 S7 K9 ]! ~    cmp     ax,0F386h
/ Q1 o' @3 c7 z# \% D    jz      SoftICE_Detected
3 p2 D, v0 B  g7 s9 I1 w, ~, M; l2 Z/ f

& I7 [: K  D( E3 c=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
1 K4 u' t  ~' T; I: m  P9 Y( f# q+ e   app like this:, n  a9 O1 s9 i! }

1 O. a6 V( l1 g4 ?   BPX exec_int if ax==683 Z+ F1 y& U* y
   (function called is located at byte ptr [ebp+1Dh] and client eip is
7 T7 r4 L& g$ Z2 r   located at [ebp+48h] for 32Bit apps)
; I- |9 D% D" o+ ?3 O7 O$ b__________________________________________________________________________/ m1 `# M; Z' m& _
7 V$ E6 Z5 u- H3 _
# G! F9 k6 P/ V9 V9 ~
Method 08' g" r; i! z8 N& f! g" o0 i5 B* b
=========, \  N: ?- R/ F' N* k

/ ^# q4 }5 b% ?It is not a method of detection of SoftICE but a possibility to crash the
  p# z# ]& f9 Q% P# Bsystem by intercepting int 01h and int 03h and redirecting them to another
+ s1 F. Z4 n8 r1 R, @: }. V: Z8 Kroutine.
+ Z1 f! A5 {) l0 m1 J* t& [. }  [+ FIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points$ `* g6 R) ?' U* o+ l, j
to the new routine to execute (hangs computer...)
# U3 }1 s; M9 B- S  R+ D
8 n4 D* _* I" B4 K, k& y6 K    mov     ah, 25h1 Y: u3 i2 N, Q" V2 p% k
    mov     al, Int_Number (01h or 03h)
$ ]* j7 V0 K9 i2 M    mov     dx, offset New_Int_Routine& O5 T6 t+ }4 X2 x
    int     21h# H! [: j+ G. H6 H* c0 }

7 D7 J/ f9 R' Y__________________________________________________________________________
- W( m9 e/ c) V' A, b8 V+ E5 G9 n' A/ y, b) R, b% ^
Method 09
  h: V& u. l- C) {=========
/ q+ J$ B7 `8 }) K0 K& T& h7 x  z, S' k0 A' Q8 {" w  @, Q6 L$ Y
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
' [; s1 f6 V/ p! bperformed in ring0 (VxD or a ring3 app using the VxdCall).
' b7 f0 ]: ^! v2 j4 p( R% eThe Get_DDB service is used to determine whether or not a VxD is installed. f; e  g6 ^. I0 Q) ]0 [
for the specified device and returns a Device Description Block (in ecx) for  o: m- C8 @9 c( q
that device if it is installed.
5 D8 u7 M. Y7 d5 w+ c
( o- a+ q' _! ^, h. N% ]   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID' P- q4 h/ Q4 y8 t- D) x( f
   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
; Q  s- `+ A; u* H* E$ E   VMMCall Get_DDB( {/ C! y8 O& z2 n& f
   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed
  d& W: m$ }, ~8 ]
: i/ s) d; ^* }8 l; f1 `- f; m) c; cNote as well that you can easily detect this method with SoftICE:
* R. p- t, w* v! {% n( ?% q   bpx Get_DDB if ax==0202 || ax==7a5fh
1 X4 q) u" A/ h1 f
* d) d! Q2 N. |8 F1 V2 q2 t6 A% a# X__________________________________________________________________________
9 f3 _+ K8 a  S0 V9 a& U% A
) H/ d6 R# w; X: w8 X+ I0 pMethod 10
# ]4 s1 C+ Z4 c. ?# `=========
9 A  _: c( B0 D5 X- M2 Q1 r* p2 g; t6 l: x/ H3 w7 @3 D/ Z
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with  Q; _" Q, J+ o& e$ c
  SoftICE while the option is enable!!
8 W) p3 s9 ?& p* ^. ^$ ]
; _' u, V( w  uThis trick is very efficient:6 @1 F2 ]1 h5 m; i1 c! x/ v( r8 D4 c
by checking the Debug Registers, you can detect if SoftICE is loaded% p$ T+ U) o& W$ s" k6 @! m% m# G
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
4 N; {8 ?% b1 Tthere are some memory breakpoints set (dr0 to dr3) simply by reading their8 a) n: q- D- C- I
value (in ring0 only). Values can be manipulated and or changed as well( x2 b. e$ {% Z& @1 U6 y
(clearing BPMs for instance)" D! _) z0 n: }# }8 u
/ _5 D8 Y8 f6 t# o, N! Q
__________________________________________________________________________5 p; z  I# j8 {) i4 F' E$ N
5 W0 x) u) e" r" I+ w8 p. _  I
Method 11
/ Z, o# c4 J8 ]; G+ _=========4 F8 ]) }) K- i9 y: _

; z1 Z2 L* j$ i* h( z$ b2 D, S5 ZThis method is most known as 'MeltICE' because it has been freely distributed
" D5 \( ~1 F1 o& J/ Bvia www.winfiles.com. However it was first used by NuMega people to allow8 s; }& e0 V* G' D2 T" l( o
Symbol Loader to check if SoftICE was active or not (the code is located
4 [7 V2 ~3 P  H3 J0 b. h: finside nmtrans.dll).0 c$ Y/ p6 Z  ?3 R  _, B

4 O; z5 l4 S: y$ u* }1 o( JThe way it works is very simple:
, y& v+ X. T- ~4 U: J( M7 B8 W& XIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for" r# j3 ~2 \+ i, [0 j
WinNT) with the CreateFileA API.
# }8 p# ^4 E$ L) _+ o
* w8 N) y+ d  t' {2 fHere is a sample (checking for 'SICE'):. J0 a- S" r$ Z5 a; x; C
8 @, k4 s* J: c8 {! s
BOOL IsSoftIce95Loaded()" t! D3 d$ t7 f) R6 K
{
- N( y* M0 F% C3 Y   HANDLE hFile;    V  j7 }" W- p5 c
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
# d7 X9 g4 q: m0 H4 S$ A8 P- e                      FILE_SHARE_READ | FILE_SHARE_WRITE,% r0 c& E7 H, Q3 l- h. _5 v$ n
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);0 U' @) ?9 k. B" s; k( _$ K
   if( hFile != INVALID_HANDLE_VALUE )
& ]: k4 w5 |: g9 c, T  |   {
6 B, s7 q, u, p; C, T  h  Z( p9 H      CloseHandle(hFile);
& {2 O& b1 e: d" u/ ^- s      return TRUE;1 w  I/ Q( m: Y& Z" T- k* j2 |: n( q
   }
( R: s3 c' a; V8 A   return FALSE;; x" p+ K! Z. E& J$ T
}
7 @# }) A' ^+ c* [- W, p+ Z) Z
) p: A+ i6 z9 S, N: \& nAlthough this trick calls the CreateFileA function, don't even expect to be3 q! y7 j/ D4 K. m% J( q
able to intercept it by installing a IFS hook: it will not work, no way!
( R2 n8 M( S2 I: jIn fact, after the call to CreateFileA it will get through VWIN32 0x001F3 c. e) x3 B4 W& r+ @" G
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
2 u! W) b. ?8 Oand then browse the DDB list until it find the VxD and its DDB_Control_Proc
& y% [1 X, c4 T5 e) Pfield., c7 Y+ u/ z6 q; `# r* R" `
In fact, its purpose is not to load/unload VxDs but only to send a $ X& H, }$ V; r9 ?  ?
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
0 C! K: y( z. M! e  ?to the VxD Control_Dispatch proc (how the hell a shareware soft could try. l; B6 X$ Y* i0 d6 t
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
! E- ]! t0 }3 R" x4 gIf the VxD is loaded, it will always clear eax and the Carry flag to allow
4 q5 p) ^& W& a$ J9 Y9 C$ Iits handle to be opened and then, will be detected.
5 G' V& @: \. I9 C9 g% X: DYou can check that simply by hooking Winice.exe control proc entry point
6 I/ J9 Q; J+ D0 jwhile running MeltICE." ^* \* `6 r% x

8 v1 W( ?, u6 a' E6 m9 w& U( O0 U0 y
  00401067:  push      00402025    ; \\.\SICE
2 U: Z- u5 O. A' ]  0040106C:  call      CreateFileA
9 h% Q& X* T7 s% P  00401071:  cmp       eax,-001# d  M  r) R$ _
  00401074:  je        00401091
; ~" z! ~- N  m1 _8 q3 {
, ~9 U! n  ~9 u9 C
% U9 K/ r+ I8 O, f9 Y$ nThere could be hundreds of BPX you could use to detect this trick.
' ~4 k# p# J- Z' M0 q/ J-The most classical one is:
' A2 l, p8 b/ h0 y  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||3 \2 o4 Q+ O' w: _3 ^9 |
    *(esp-&gt;4+4)=='NTIC'' X% K( ^. y8 n$ J* ]" d
3 c+ @( ~' @2 U$ H4 k+ _
-The most exotic ones (could be very slooooow :-(
3 n2 ?  p" J9 N  j   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  
4 U# ?" S/ @3 J( f% o( [7 f! e1 ~0 M     ;will break 3 times :-(
0 S5 l1 ^- k' V: Q% K/ H" v, }: t# e3 k6 R# t
-or (a bit) faster: . h4 Z9 |1 c* N7 }6 K  D& {
   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')$ p/ ?7 ^1 C. q7 _; @$ x% ]0 o
. e+ x( m" [' w
   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  " e0 f2 |: Z% v* y
     ;will break 3 times :-(
- A4 `$ I) W; C6 j% E. ~
; Z; ?* v5 g) f6 J# n0 c-Much faster:# h9 Q# I7 S( N# z
   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'
& D. \$ f# r( u+ E. b/ K) m) I. u& U5 y; {6 q
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
  _( Y! B1 F' ^) R+ K+ mfunction to do the same job:, Q- j3 o3 a3 x8 Q

5 w/ Q6 @, ]3 J' v   push    00                        ; OF_READ
' b* J0 _6 z; \$ E   mov     eax,[00656634]            ; '\\.\SICE',0
/ i2 G+ O" }; c* X   push    eax
! Y# c! h$ T) [* j3 {, n4 V) H8 \5 B   call    KERNEL32!_lopen0 d- t: n7 }* D2 \7 f( E
   inc     eax
# }8 m) E! o& t+ \4 G. d   jnz     00650589                  ; detected
+ M, V4 Z* q/ A8 r" a. u; U   push    00                        ; OF_READ: L8 W# \0 ]7 w  I2 H2 P8 w0 @
   mov     eax,[00656638]            ; '\\.\SICE'4 R- Z' Q7 E! z
   push    eax
7 r. J* f; @. T' Z   call    KERNEL32!_lopen
3 V" W8 Y: U2 k. p   inc     eax
2 n3 M0 d' c1 M0 ?! ^. }7 `$ i   jz      006505ae                  ; not detected
" e! p" j+ N+ a$ I8 w
0 v; W, S! Q. k. l1 ?) ]* O% ~  f" i2 a% L3 y' {+ o- r8 D
__________________________________________________________________________8 d0 a( n* z& `
1 i: U' |* O1 @' r1 Q* R6 K
Method 12
, o2 N* F0 W+ @- o" t5 z* q=========  @& r$ b; C: t

. x% P. K  w0 S" AThis trick is similar to int41h/4fh Debugger installation check (code 05
, w8 q0 ]" t7 s&amp; 06) but very limited because it's only available for Win95/98 (not NT)* `( g1 p6 m; |  m, e
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.' e) d2 L9 N* b3 g' S

! n# A4 Z( y+ |" i- V/ l: r   push  0000004fh         ; function 4fh$ [0 J: ^0 {' b# V8 r9 I
   push  002a002ah         ; high word specifies which VxD (VWIN32)
+ G; b) M( Y7 d+ o" [  o                           ; low word specifies which service: W: H5 o! F3 [/ [
                             (VWIN32_Int41Dispatch)1 D5 A  u. ^! x& d# X
   call  Kernel32!ORD_001  ; VxdCall# Q( i( y# G$ p6 Y3 d/ y% B; t/ \
   cmp   ax, 0f386h        ; magic number returned by system debuggers7 z4 W9 X+ M0 p/ m5 H$ u, s
   jz    SoftICE_detected
; J4 Z5 i! ~0 A' W! e  h/ N+ {
, b% {& b: q4 r- s7 c4 zHere again, several ways to detect it:
! ]# K, O7 Z" N* J  @/ I4 l8 u0 _8 X9 P+ S/ @+ P
    BPINT 41 if ax==4f9 j+ s/ E6 H, z$ h& q5 k( ?* `
! l2 W& I" G! H2 p3 [
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one
- }# E  u; `  A5 h
. k  j7 j' I! G! Q6 o' R    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
$ l- y' C/ f1 |$ i* J4 {
; g# P/ C0 t) `) g: S    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!
$ c0 g/ c$ {" B3 J+ i% \+ I
# X3 J% W' F& u5 Y: z__________________________________________________________________________8 C; i( f! g6 y

% p0 x9 C- h. H, k, |- j% dMethod 13
) U1 B  g- B3 l$ ~' q- K  ]=========$ \& i# K7 I; B  j

, P: z" m# K3 @( i' M; }' dNot a real method of detection, but a good way to know if SoftICE is
+ B* j) b7 G1 w* t3 Kinstalled on a computer and to locate its installation directory.
( j7 C: z7 i  F7 q: sIt is used by few softs which access the following registry keys (usually #2) :3 l! S# Y! \* b8 k) f

/ R+ C6 v' _! s; }" P  Q-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
7 a# Y! }; I: z7 Z; _0 `# ?  c\Uninstall\SoftICE
9 ~2 x5 [* ?7 Q$ x, W0 w" [9 @-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
. E: o/ {8 m  p-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion. h" ?% m% H; U4 U
\App Paths\Loader32.Exe" L1 h9 r& B' F, s# g4 t# W. r
0 m5 V$ z7 s3 f% V4 C

6 D/ y/ z' W1 k. n8 rNote that some nasty apps could then erase all files from SoftICE directory! t4 ?$ Q! ~8 n  E
(I faced that once :-(; \" N* C& R" n
. v) R! b6 C1 R
Useful breakpoint to detect it:$ N5 v2 x6 T0 D7 U3 }
& [+ e8 b) M% [/ s
     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'- P* `0 U( _) k  z
8 r7 }9 D- I6 X8 ^+ D5 o
__________________________________________________________________________9 A6 c1 l3 m7 o) s9 D
/ s5 A$ R0 Y& ]8 f# h
' T  d9 e8 Q, v+ x/ a) B: a. [( ^
Method 14 . B: S$ j! j/ [/ M" d2 ?! k
=========
0 y3 n7 x# }2 R! M3 F2 _; c  i1 f4 ^2 F" @8 b' ^- z2 X2 R/ H
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose0 Z" M. H: Y7 U6 O7 R
is to determines whether a debugger is running on your system (ring0 only)., @8 u1 ]- R' X

9 ^2 Y  }$ @& E/ N  Z7 y; N: s' H   VMMCall Test_Debug_Installed& f$ T. g& S% R9 ]
   je      not_installed) p0 R3 e& E' X  l- A7 W# W8 [

( {+ B# e: v  z+ r  v3 g& ^& SThis service just checks a flag.
& B7 E$ ]* W( \/ W4 q1 T</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关注公众号

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

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

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