找回密码
 注册

QQ登录

只需一步,快速开始

About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
! d9 z5 s% r! t' C<TBODY>
  D; p: N  B" c% \( M/ \<TR>
  F! j: p0 Z# i7 {. x! e<TD><PRE>Method 01 7 k* P+ N. g8 _$ p* f$ w3 @6 j. J
=========
% t( B3 @7 Y3 [+ H/ W0 y2 U" i2 U, A: @* H' ^
This method of detection of SoftICE (as well as the following one) is
. ~- L9 o6 X* S1 C4 d& D! q% oused by the majority of packers/encryptors found on Internet.
+ `5 z5 R& y+ E4 W6 OIt seeks the signature of BoundsChecker in SoftICE) ~. K9 V0 F4 i- ~! e) C

+ Y9 ?8 p: A) z( |  i    mov     ebp, 04243484Bh        ; 'BCHK'
" u" g, u0 n  H    mov     ax, 04h
: c; s; k7 z: y    int     3       ( }$ C- z1 y* F0 R
    cmp     al,4
0 w8 E0 F& d& h( u+ Z2 e4 u    jnz     SoftICE_Detected/ m3 J' i( ~/ k$ j4 k' s' E) M6 R* G

2 t1 U' X$ _" l___________________________________________________________________________* L- T$ U8 a* N7 L' p

6 F5 z$ }5 A& u+ d5 EMethod 02- O& {9 i) n- P9 B
=========# i" r9 [( b* w  y; f' T6 D0 L
# _, y; U6 t9 v( Q1 @5 `
Still a method very much used (perhaps the most frequent one).  It is used
: Z  m  v" l9 L' ]/ f: zto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
" W- K1 T0 |+ T- s! nor execute SoftICE commands...3 x) o5 Q  `6 N: }% C
It is also used to crash SoftICE and to force it to execute any commands
, C" J# c; D, Q* V+ t(HBOOT...) :-((  9 K  p" s8 r' ^# L' R$ e
5 L- g% G( B$ I- D
Here is a quick description:6 O4 F' g7 c5 Q1 t" N9 `8 a  @
-AX = 0910h   (Display string in SIce windows). i0 {3 n* ]" _( s2 C
-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)
3 |  d% c* X& {! C/ V-AX = 0912h   (Get breakpoint infos). |: T3 ~( S( \. L9 M/ N5 R4 t
-AX = 0913h   (Set Sice breakpoints)  Y: ^! T, x$ o0 q0 z) G. x+ }% K
-AX = 0914h   (Remove SIce breakoints)
0 R1 ]' c$ d& R; B( B
5 I& `, Y- a  i  g0 kEach time you'll meet this trick, you'll see:
  L& B# j% S0 O' W( j, n-SI = 4647h
6 V3 M) S# u- x' _& I' p* x-DI = 4A4Dh7 ?5 m) X0 v# Y; j6 f1 L8 w
Which are the 'magic values' used by SoftIce.
0 X5 n8 k) z3 G0 mFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.& W  h6 I: o: z9 F8 t
/ \* [7 R/ d6 r/ H7 O& L6 i
Here is one example from the file "Haspinst.exe" which is the dongle HASP2 |; D# r# w- M# d0 F
Envelope utility use to protect DOS applications:. S8 e1 H% }8 r4 B

8 ]( A4 z0 C4 z3 @2 }$ I" Z; s7 V5 V5 p4 x3 A4 q
4C19:0095   MOV    AX,0911  ; execute command.5 k0 a% x$ }4 U; G  @8 Y
4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
. Q) l& H" R  W! R* H6 }. A0 ^' n; q- M4C19:009A   MOV    SI,4647  ; 1st magic value.
0 i* D7 R4 Q: {, O! h2 P4C19:009D   MOV    DI,4A4D  ; 2nd magic value.
, T6 N6 z& _3 b, r" T* b, o4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
3 \0 V) W2 x3 b/ ]. o$ U3 q4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute
/ O% p4 V% A) t5 q6 W& i8 i5 z4C19:00A4   INC    CX# [0 q9 u( B! O  \' z0 E% H
4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute3 f% I, c  X2 }7 n# I8 D
4C19:00A8   JB     0095     ; 6 different commands.
' [- j: ^/ o0 g4C19:00AA   JMP    0002     ; Bad_Guy jmp back.2 U/ m  Y/ V6 q, q9 X# s: q
4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)
* s( b" w5 t% ~. M6 ^' i( T
$ y& a8 x  _# |4 w' Z3 P: o& WThe program will execute 6 different SIce commands located at ds:dx, which
& C4 z5 L/ r& u# ~are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
: l( n8 r" x( Z* ?+ M* g- n* Q: @- ~/ B
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
% B- e$ ]8 U6 X5 W5 Y3 j___________________________________________________________________________
' P5 n# M7 v5 B  x& P3 ~
# y8 M1 i/ P; [3 o  i" c
7 A/ @2 Y( k+ P- v+ N4 |Method 03
- I* e! r9 v% Q" s; f% H=========$ g* l. K7 j- m3 z0 S
8 t, j  l2 \( y& u8 x$ f
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h& z4 d% Y/ P: d+ V  \6 k* q9 J
(API Get entry point)
- L! x: z2 ^$ z$ |6 P( g+ u5 G        ' P/ F! V& R$ I9 t( o& I
6 g# B6 j6 e' p
    xor     di,di
' s# K" R$ x; N    mov     es,di
; p" t0 z; r' W4 a    mov     ax, 1684h       ( ?" e) a- s" m! B# k2 W
    mov     bx, 0202h       ; VxD ID of winice
  R+ R+ W4 g* f( N    int     2Fh
; C6 \( M/ o% {& Q$ K3 X4 k    mov     ax, es          ; ES:DI -&gt; VxD API entry point7 S- v6 B, ?) H. R
    add     ax, di
3 b7 g, x6 y8 L/ {- \    test    ax,ax( \  R+ b- n" y7 e
    jnz     SoftICE_Detected0 Y1 x' h* q8 Y9 p+ r- b

3 o6 Y% Z6 V7 D* o9 V/ h" J___________________________________________________________________________
! F- l; A8 N+ y: A& X. k. o( V2 L1 C5 r- _, x4 I
Method 04
$ E7 l+ ~- F/ z  b: {* o% c, x; a% a2 G=========8 Z6 w7 h' C( C. y  n* F
; b% L" z0 `  z* v" _0 D* ^. r
Method identical to the preceding one except that it seeks the ID of SoftICE
( S- A# W" R" o8 V- m; c1 ZGFX VxD.
. L8 Z+ E2 j9 M. e& E# Y6 F# C) ?  I% G9 j3 E: B- v" [( i( x1 M
    xor     di,di
6 b% \, n' v, v    mov     es,di
! q3 k) x. |" M1 [+ x/ K    mov     ax, 1684h       % X  Q' E; `: e" U) K
    mov     bx, 7a5Fh       ; VxD ID of SIWVID
5 F6 F# O; \8 c. @    int     2fh/ H* k9 o2 c' y% Y
    mov     ax, es          ; ES:DI -&gt; VxD API entry point
  \0 A7 S4 h' a5 Q    add     ax, di
) A" @$ ^/ O8 _: F5 u; m    test    ax,ax
4 g( r. O! S9 Q: h) t/ {    jnz     SoftICE_Detected
, A- W  o" @; {% R' \2 R1 C7 ^. ^
__________________________________________________________________________
2 u1 R% F; F- q4 W: {
+ y' Z* O' ]2 O3 P$ o) a) u4 F1 {& c( q: K4 W" ?  \" C8 r
Method 05
; {4 ^. v' ^  G6 F+ f=========
9 V1 M. z" s0 ~$ Z2 T) K4 ^- K, ?! N$ e' q  d
Method seeking the 'magic number' 0F386h returned (in ax) by all system$ B+ |! A: Q; |. _. q
debugger. It calls the int 41h, function 4Fh.( g8 S5 C5 b( [' v5 B
There are several alternatives.  , |5 D2 b/ S9 d7 Z. F4 |) U& x9 F

$ s; X; `* _+ N+ PThe following one is the simplest:
5 w. H. S& C& |1 U2 G. Y
5 e8 r: d- d3 b& _1 B    mov     ax,4fh+ P2 T5 w- X9 U* B: R4 D& Q
    int     41h
9 A& o5 u8 @/ g/ V( ^7 [' C    cmp     ax, 0F386' L3 i* }" T/ F& J6 B* `
    jz      SoftICE_detected
0 U! j( D! k5 Q  J& ^& Z
3 j  `3 e  ]0 r! `
2 P; E4 p; f3 {$ N) gNext method as well as the following one are 2 examples from Stone's
" k; ~" L# }' `0 p( b" y' d0 u) h: A"stn-wid.zip" (www.cracking.net):
+ x) A" Q. C  o/ G- ~
% R" |- w- s8 w" ~    mov     bx, cs
3 ~; ^, N: [' U% j# H4 Z    lea     dx, int41handler2
# n( U* \4 Q% |; r& ]6 C5 T$ `    xchg    dx, es:[41h*4]
: j3 j( ?- \# @* V    xchg    bx, es:[41h*4+2]' }% O* c6 _0 Y
    mov     ax,4fh
1 [% x2 M5 _' G7 Z( P! n2 Q" I    int     41h
3 ~4 v% U1 I/ q- m; {! {# E    xchg    dx, es:[41h*4]
) L) z6 o( v. Q- h* R! @3 Y    xchg    bx, es:[41h*4+2], C7 T4 O, y8 g  u
    cmp     ax, 0f386h
2 `" o' L3 s5 B    jz      SoftICE_detected  H8 z& B/ h- v! d% ~- S
3 w) D$ m% h1 w  Y
int41handler2 PROC! B: u" x' z4 U
    iret
& ^+ u, u  U/ s5 |' U2 w9 `9 Sint41handler2 ENDP/ {) v% y8 l! J& K1 }
2 d$ @4 e4 y# h3 }

7 K2 n/ P/ U8 b_________________________________________________________________________
4 S# V( T- x* }! }! v; s& R* U
+ x6 q& [. C2 n: ?0 F" b) z* v- k6 @
Method 06
/ O- e6 E) K8 g=========
7 m! e  C$ g! B/ q9 I1 `
5 P" C0 U* m  i7 d: L, X
( d- F+ Y+ f& v; Y2nd method similar to the preceding one but more difficult to detect:, y, ?2 v6 O2 Z# F! ]
) _- p# m9 v( e- C
& \# A4 |+ u% G
int41handler PROC
% n8 M" k3 T# i& q: t+ ^    mov     cl,al
* m2 t/ {! K9 s    iret
/ F! t7 ~7 I, j$ A4 M- c5 \; Mint41handler ENDP) J, ~  E/ S5 g8 K
/ F+ L/ Q1 y7 I6 o4 R0 m4 m

9 k1 A% f) c  |% y5 W    xor     ax,ax
7 [$ r8 j8 O& p( Z3 o" O$ d' |4 I7 _    mov     es,ax
% O8 F% G* E1 z2 u( R( |, B+ P: R    mov     bx, cs9 X6 H3 A: H4 N$ M- M: I
    lea     dx, int41handler
' `; J0 e5 Z- B' A    xchg    dx, es:[41h*4]1 j" B% f( `! P  A8 s5 y
    xchg    bx, es:[41h*4+2]
  H8 F) u* L1 w1 T8 h3 @' b    in      al, 40h" T5 ^. h1 ?( y1 Y* y. x2 M
    xor     cx,cx; v0 f- j; A8 O, @0 T/ S3 X" L
    int     41h
" v) \- Q" s$ K- @. f! q- X: |! L    xchg    dx, es:[41h*4]& [+ z# c+ `3 w# U
    xchg    bx, es:[41h*4+2]; A- F( M& ~; w6 q
    cmp     cl,al7 J% G& P$ J- J: m6 z8 r
    jnz     SoftICE_detected
4 u8 I: H1 |- i) P8 r. C* J+ T( v+ O1 n$ ~2 u0 \$ T, \
_________________________________________________________________________0 \/ n: k& ?* F
7 E* X! a- T2 [+ [
Method 07
" I3 Q9 C5 i  @=========
5 v3 {) {' R! Q
2 }, i  A" i3 r  V, L6 yMethod of detection of the WinICE handler in the int68h (V86)
# Q9 K5 N5 J3 ^1 b
' y: \* `3 x  R2 _+ O3 j( e( P    mov     ah,43h
* S' M( ?+ q9 x& Y    int     68h0 l3 d9 R' ^+ x! I
    cmp     ax,0F386h
: }: {0 I( w: q/ L0 g7 \    jz      SoftICE_Detected) }- j. [* Y! H4 T
3 x) z- z7 U9 h* m$ u

6 C7 p4 i# Q$ b; L: |4 W9 W=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit) T# O0 C% F3 C6 u4 q
   app like this:
: {1 |) e9 {) V: R
9 P6 \- Z, ]% r: ?' u* G6 r' @: i   BPX exec_int if ax==68! m; @, z6 U' u# R; M8 h) @
   (function called is located at byte ptr [ebp+1Dh] and client eip is+ |4 {+ x$ I4 e  p5 T
   located at [ebp+48h] for 32Bit apps)  _  @2 k' A! u* R; K# ^
__________________________________________________________________________) Y" [1 @' Z' ~  @2 p$ j* }

0 ?: a8 x: G% v) M/ Q. r% z4 ^5 g) J
+ J+ r4 F9 m2 D/ R' {Method 08
. i3 Y$ l) q4 ^=========
9 w  ^- E! F/ J. W& ^' Q  d$ N0 D) Y  y. b/ j: s/ d
It is not a method of detection of SoftICE but a possibility to crash the
5 x1 \: I5 q. q$ F; ]system by intercepting int 01h and int 03h and redirecting them to another
4 w3 L4 b8 J  S' Wroutine.8 v3 U- {; h7 p1 D4 a4 l
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
4 ~9 v; X8 Y' jto the new routine to execute (hangs computer...)
4 Z) C& h: m; W4 E+ Y6 E' f" S. e" W/ e1 v
    mov     ah, 25h
: L, W, M! i; s( f# G- z    mov     al, Int_Number (01h or 03h)- X5 [# U2 P% j0 F7 r* e- a
    mov     dx, offset New_Int_Routine" v7 A; R3 E; ~  t
    int     21h
% j9 z. n6 h/ w7 H
& q3 S% e7 v  I2 U9 f__________________________________________________________________________
" p& Z" w5 Y* R5 y5 T* L! E: p2 m# q: }8 b* k- X0 B0 m
Method 09
8 p( Q3 q: R5 ^9 X6 H% @=========6 a8 O: _1 y6 j/ q2 V
4 ]' |/ V' _4 {& S; {( v7 n% w$ n  L
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only. n6 v1 f' ?  v0 J
performed in ring0 (VxD or a ring3 app using the VxdCall).
9 p# _; d8 a! ?  lThe Get_DDB service is used to determine whether or not a VxD is installed
# Q! \) ^* q$ f4 P4 R7 ?* |for the specified device and returns a Device Description Block (in ecx) for
* M7 J0 K6 ?' I- nthat device if it is installed.
! A7 J0 \1 L5 ~* C! P7 P! v8 a
: I; ]' t# o3 u+ v6 i- Y3 ?% ]. `' r# g   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID) @: _, q% s8 [+ p9 p
   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
/ d+ J) L; P% {# ^' l% l( w   VMMCall Get_DDB2 E1 \, W( P" o8 V
   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed
6 D2 r4 a$ [, X/ a8 Y1 }$ M  b% {
$ z" A4 @6 |3 K2 _6 L  ENote as well that you can easily detect this method with SoftICE:) N  \) V, N  K! q
   bpx Get_DDB if ax==0202 || ax==7a5fh
$ ?# r6 L' `+ h( a8 T  ~, N, Y: e
__________________________________________________________________________
+ @; O( A9 L- f/ h( U) l
+ s1 y% |& U$ Z$ T  k3 j! JMethod 10
9 Z: q+ B4 E! f8 _=========
3 C3 z) N: k! S& f8 {! O) F2 K: M  J0 }, }; W
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with
2 A" U! b8 u" b- W( j! j3 a  SoftICE while the option is enable!!( w7 l5 r; ?; W

& A& T) l* X% G& e- J! U7 VThis trick is very efficient:
: b, t0 O& K. E- |7 M! `3 X2 J3 ^by checking the Debug Registers, you can detect if SoftICE is loaded
% P) B- s+ C, C1 W6 ?1 {, i(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
4 C& D) b- q- Q& Athere are some memory breakpoints set (dr0 to dr3) simply by reading their
9 w- t6 Z5 C0 J, y& P: ]% wvalue (in ring0 only). Values can be manipulated and or changed as well5 X- S& X* A1 L9 S9 F  R
(clearing BPMs for instance)
* A- w( R+ ~( r7 v0 z1 x- v% s3 ], S1 v3 M+ i/ ~) t
__________________________________________________________________________
" n4 B# c5 B  z/ R! X- N' p4 Q, h5 _
Method 11
- r7 n4 A+ K, n8 _% t+ ^% e2 t+ n! M=========
2 q+ \/ D2 K! e' F
$ w" b# K) c5 K, V% ~: o8 hThis method is most known as 'MeltICE' because it has been freely distributed2 [4 N+ h% ^, V5 b+ X
via www.winfiles.com. However it was first used by NuMega people to allow
1 L# c: E- p! d4 P0 TSymbol Loader to check if SoftICE was active or not (the code is located+ |8 C4 Z4 T6 Q" q! Z
inside nmtrans.dll).+ T9 E% {. F5 [0 ]8 M' {4 b. R

9 Y  J" A; J$ z6 x" x* ?The way it works is very simple:
" T+ G* ^6 y) h2 zIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for, |9 k/ J% T0 }% }- j; C% B2 `+ F
WinNT) with the CreateFileA API.$ ^3 |* m- T2 B+ ^! P$ |& Q

* P. x, V% @) n" U: J) ^, EHere is a sample (checking for 'SICE'):, u1 r6 {  l# ~' p

2 k1 a! H8 Q- x8 n9 Z/ @6 ]2 CBOOL IsSoftIce95Loaded()( p; c: b4 j) E# z
{
$ }6 p. t: P3 M9 u5 e   HANDLE hFile;  6 m! R* E9 e) `1 r: Z
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
% y; P& o1 C! f" f# U# U                      FILE_SHARE_READ | FILE_SHARE_WRITE,
; G# r& K" c6 c                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
/ ?1 C. Y/ a' B- K* z   if( hFile != INVALID_HANDLE_VALUE )
+ |3 |" |. X* T* B2 G" c   {4 e- N/ S1 o; W) N0 ~
      CloseHandle(hFile);
2 P" w$ y- Q) a      return TRUE;  c$ A, ]9 O( ]. y7 U6 S
   }
8 }5 ~* w, V1 }7 V   return FALSE;+ k9 ?' _7 }; D
}! g  b7 b; o- T. l. z: N
9 M* \& [% d  G' O0 f- h
Although this trick calls the CreateFileA function, don't even expect to be4 w0 U* k9 p, L/ C7 K
able to intercept it by installing a IFS hook: it will not work, no way!2 e/ {5 e' |# e0 }1 N; h7 T
In fact, after the call to CreateFileA it will get through VWIN32 0x001F( y4 N9 P6 {  N& E# e# ]
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
- q" I; d+ o: ^' h9 e. Z/ {and then browse the DDB list until it find the VxD and its DDB_Control_Proc, H/ a' D6 f0 T# V& _1 r6 f. e
field.& a8 y" b, r' w4 j3 e$ k# e
In fact, its purpose is not to load/unload VxDs but only to send a
6 G3 ~  H0 @& Y- U: E" d: U* ^W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)6 }! O/ ~( o* ^) W6 T- D
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
. Y: M+ a+ h. Q1 e. s2 m: R7 lto load/unload a non-dynamically loadable driver such as SoftICE ;-).
  |  H2 j1 @4 y5 s! aIf the VxD is loaded, it will always clear eax and the Carry flag to allow
. x1 h: N9 b2 r7 B' Z4 F$ Aits handle to be opened and then, will be detected.
2 J( `; L9 F! _# E% w( eYou can check that simply by hooking Winice.exe control proc entry point- B8 s8 y1 b; U  @; A! I7 J  M
while running MeltICE.
) c; \- ]9 X8 \; ~) K  k+ p" e5 S7 ?9 `; ~3 b' i
0 q% B  m5 g; v, n+ Y5 Y& a. N
  00401067:  push      00402025    ; \\.\SICE. {# I3 r7 n& t. G8 X& r+ d
  0040106C:  call      CreateFileA
9 m! k7 P! ?' b* [7 W  00401071:  cmp       eax,-001/ Z  p% I# q) R2 j1 M0 c" }0 q
  00401074:  je        00401091+ m( {9 e2 o5 N; r7 C. ?

  ]7 v* a2 b7 i$ _0 x. b% D( e( G' Z
There could be hundreds of BPX you could use to detect this trick.
. {: f3 P" l6 x3 r% y-The most classical one is:
7 S, z$ @# H* ]! x& k& J5 ^. Q' e' G2 x  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
6 A+ I* i* @' [, c* d$ [    *(esp-&gt;4+4)=='NTIC'
0 p! `! K! b2 ?/ G- K. H
9 e: p* x% a, n-The most exotic ones (could be very slooooow :-(; l( v" `" d' w5 G& C
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  0 Y+ h4 S5 q) j! j) G# @+ R' W# K
     ;will break 3 times :-(* T! P* V  p. W* X) i1 v
) e5 a' \3 ^# r2 K. ~; c2 T
-or (a bit) faster:
0 W8 Q  B# S, {3 I7 k   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
$ F1 E! ^' G4 Y( u* x% V& v: v0 p# A" E% e5 }
   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  
5 K9 @' F' r; _  A# N" H4 Y     ;will break 3 times :-(; o8 g1 Q/ U/ b# o" v: p
9 j$ S" V* S" K3 H, j, `- Q
-Much faster:7 M% a  z2 i% S; m2 ^1 q* k: @  |
   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'+ m/ V% z  o' X, a: [' Z9 ^& H* h
2 b& ^4 b$ M$ @, `, r" d; `; @
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
6 t" I$ o6 J2 A7 K. `! i: \& _function to do the same job:
/ e8 h7 G4 S: O
6 F6 u6 _+ q* S   push    00                        ; OF_READ- z% N+ N& |3 Q% r+ w$ I: ~* r. [
   mov     eax,[00656634]            ; '\\.\SICE',0
0 y; o% d9 _4 d, \/ U; D   push    eax
" p! Z& d) Q/ t- \$ E   call    KERNEL32!_lopen4 t; i5 j  y# e! s. l
   inc     eax" ]8 n- m9 g7 x: E+ D
   jnz     00650589                  ; detected
. i* }9 c" {% s" k" {3 F% g4 l   push    00                        ; OF_READ% ]" f' a( o! a% E" {
   mov     eax,[00656638]            ; '\\.\SICE'0 e) c; y' Y5 m1 V, G( ~. U' h
   push    eax8 r" \, m2 B  i6 t' ?! w& r
   call    KERNEL32!_lopen" d' o  S8 U( k9 N' l
   inc     eax! Y, W5 T$ m5 j8 ]+ n6 }" K! r
   jz      006505ae                  ; not detected# `: i  S  d' [3 t( w$ Q
! N9 b) n( }6 f( H* V2 n1 W

8 O1 f. |$ I6 u5 j0 p__________________________________________________________________________
$ i6 G# L- y  X* y0 e+ ?
) d1 s2 H) n3 p; H* i! WMethod 12
, l5 O  g3 `1 S; `: H6 v6 i+ c=========1 O' n3 e1 }, y8 ^6 J) J+ @. s7 s
# d- D% N- E' {" v8 i2 u3 c
This trick is similar to int41h/4fh Debugger installation check (code 05% p: `; |/ U6 g$ l* M+ h- g& X
&amp; 06) but very limited because it's only available for Win95/98 (not NT)5 X3 g4 G' l7 S, [, l# c
as it uses the VxDCall backdoor. This detection was found in Bleem Demo./ d; i9 C' j6 e

3 {% y3 b  w* i2 v   push  0000004fh         ; function 4fh( |( ?7 ?* p8 \7 C  h* o" v
   push  002a002ah         ; high word specifies which VxD (VWIN32)
% @- I# ^& y7 ?                           ; low word specifies which service
1 p: `* `, n" Y9 S                             (VWIN32_Int41Dispatch)) l. D8 A7 h& U- ^; g! q
   call  Kernel32!ORD_001  ; VxdCall
- h( l4 ^3 y( d2 d2 r# P   cmp   ax, 0f386h        ; magic number returned by system debuggers1 t3 l* S1 `- Y% E! r( I
   jz    SoftICE_detected7 s1 ?$ C/ a' L
- |4 D$ {, ]( Q2 h+ O: v2 k
Here again, several ways to detect it:8 R) M9 P5 F1 W& n7 B- n

: N0 D" [0 h$ m( Z. Q) {; u    BPINT 41 if ax==4f
9 y* J3 {4 \7 R$ a& t6 E6 O: z# c- _
  ~. E  \3 q4 W" w' G    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one
+ C; H' Y8 F  _8 R
9 A! y% @+ l, j- E    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A+ w% Y: J5 J" ~: b2 m. O: T
/ J3 Q; K- Z- T
    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!
; n; e  A$ A% ~% ^$ I& \) m& Y( p6 @/ H* j' ]
__________________________________________________________________________4 r* Y3 M+ T; s- ?+ P7 `
9 F2 J0 n% C& ^" i+ V
Method 13" [1 L4 ?6 C' G. q
=========
* x# K( p1 J. z) E' O' e7 ], J2 ]
  z8 h& O" g. x; _( UNot a real method of detection, but a good way to know if SoftICE is
9 _) [! g6 O: @' Pinstalled on a computer and to locate its installation directory.) I  l2 U2 ^/ \. C" G
It is used by few softs which access the following registry keys (usually #2) :
' c/ T& K# C' T/ H: F. d
' j- _9 x! Z  V' I3 y9 D" O  [$ O2 g- C-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
2 R; S7 p8 o- n; ]9 F\Uninstall\SoftICE% ?* F- l" U1 z* |% Q7 j
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE5 }6 A1 Z, @4 ^- M6 x' j3 t  X
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
0 H" M% @* i; C  l\App Paths\Loader32.Exe
3 E) [( W- I1 ?1 L8 \! @3 h- {1 u% ?, z! x- H) P& `3 ~
2 H) z& B' l. P5 {. k
Note that some nasty apps could then erase all files from SoftICE directory
( I6 w* ~6 @! S0 c. z0 R, T(I faced that once :-(7 j0 _0 J. B+ K' o8 e1 D
6 a% p5 K% d8 h
Useful breakpoint to detect it:
0 `, H  w2 C; s6 V& f% |& e8 t; U: a5 q  n5 b
     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
, S4 d- _$ M# t- j( v
6 h$ X- P8 t. ^1 L# s1 q__________________________________________________________________________
% o4 n6 L% j: b" x
  ?0 ~, E) B. O2 U3 L- e+ A  ]8 m7 P$ T/ t' I; p7 u
Method 14 ) Q# h* s/ V; P* j
=========; ?, A/ G+ T" A0 U+ A; b! K% S" S
7 p) ?/ }  O% _* [3 V6 f0 A
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose0 s: M1 Z( q9 A
is to determines whether a debugger is running on your system (ring0 only).0 `$ l3 S2 i) \' m9 w
; E- ]. L4 O" w0 [6 X
   VMMCall Test_Debug_Installed
; f; |  X: ~% p: ?   je      not_installed% ^2 @4 z4 C8 p
. ]- Q: y, O5 [4 b8 d
This service just checks a flag.
, c1 T  K# T1 ]</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-8-21 01:14

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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