About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
' M, k; f3 M# i8 @, o/ ?& y" F<TBODY>. w2 R9 `  O' V3 c% J7 v
<TR>( c5 Z$ L: r* E' e2 \6 G  z
<TD><PRE>Method 01
& W( g) ^- {; q) a4 e8 n=========2 z0 E) F+ c( q; y- o: R

- w' i7 l. b/ V& u# mThis method of detection of SoftICE (as well as the following one) is; m! w" ^3 ^3 X0 ~1 @) H  a% n
used by the majority of packers/encryptors found on Internet.
/ ~8 Z; k7 k: K5 I. m. }It seeks the signature of BoundsChecker in SoftICE
8 R" }6 E/ k2 l
- W0 V; F8 A+ O# ?    mov     ebp, 04243484Bh        ; 'BCHK'9 w# c. T* n6 k: O# v6 p' i
    mov     ax, 04h: [. D# [, r. a8 V
    int     3      
2 x7 O$ v; M1 `0 W7 P# O: Y5 N    cmp     al,4
- i6 d$ r; l7 v1 h3 t    jnz     SoftICE_Detected4 ~# m4 H, Y" T, F9 n" ]" p3 [

6 W& B* l7 a. a& z% [$ E+ t___________________________________________________________________________1 t! K, B& d0 [4 l

( b7 V- g" @( b/ m+ h* E- ?& H% uMethod 02
- r- ~5 G+ ~% h, A! C8 S5 b# l/ \=========7 q! w5 _1 o8 X5 C# i/ c

4 V6 g& N& c2 `$ z" l% nStill a method very much used (perhaps the most frequent one).  It is used- z! l6 R8 S( N2 U, E: O. {2 |
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
* F0 J2 o, `0 _0 U( z+ k/ N" |, H  lor execute SoftICE commands...
, a. W1 p+ d; _6 N6 _% eIt is also used to crash SoftICE and to force it to execute any commands
( f; J# J/ v+ r: w# @(HBOOT...) :-((  
" l- o: k/ M. H9 q. ^. w8 ]7 ~! X5 g- `
Here is a quick description:; C* [' s5 c- N' |9 n) k  g2 I& A
-AX = 0910h   (Display string in SIce windows)
4 m6 A! M; Z: a; H-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)
! H( L3 h& \+ `-AX = 0912h   (Get breakpoint infos)
% C, T7 L1 m" G/ Q-AX = 0913h   (Set Sice breakpoints)4 U" g+ @! H1 C$ A# i: O1 @
-AX = 0914h   (Remove SIce breakoints)
# {# h) b6 [- n5 D# @
5 l7 B; W/ L, B2 u& dEach time you'll meet this trick, you'll see:, f/ Z! f: u& P3 b* w& O( I
-SI = 4647h
  H: V9 }6 X0 n  `4 ^3 Q5 W-DI = 4A4Dh$ l+ Q. \& t+ z' c: t1 ]0 a
Which are the 'magic values' used by SoftIce.% g& Y) X; u# F: ?
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.& f5 v0 h/ ]% `( S5 W$ V! R" v* ?
/ p* G/ ]2 H( e( {- B7 M) j
Here is one example from the file "Haspinst.exe" which is the dongle HASP
; O8 ]2 r# j9 |, ^6 G  _# vEnvelope utility use to protect DOS applications:
, H5 o. q4 e: T1 i" G
' p3 {2 w4 o4 n; o; X
! k* x; V) x. u' Y0 l4 w2 ^: ^) f+ `4C19:0095   MOV    AX,0911  ; execute command.) M. \  Y+ q* z5 A6 _. ~
4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).$ ^9 u0 V2 h- E
4C19:009A   MOV    SI,4647  ; 1st magic value.
  o# O+ y7 D3 L/ @4C19:009D   MOV    DI,4A4D  ; 2nd magic value.
/ E5 o3 A% d8 l1 ]4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
# Z* A' }' D; }! \' T: [4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute0 {- Q3 f* e6 Y( \2 b) {6 Y# R( N: K) c
4C19:00A4   INC    CX; }5 D% S! I7 z( o/ J/ j
4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute" i0 N  b2 H2 O3 R9 o3 \% I0 `3 e
4C19:00A8   JB     0095     ; 6 different commands.- r* J2 l" t1 J% m! g1 U' w3 `
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
/ K+ u7 D& h& }9 E, P' y2 N4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)8 P" b! d' e& h
. y% p) q$ I4 b9 P5 i# t
The program will execute 6 different SIce commands located at ds:dx, which& |) i9 L0 {& a$ ~) \5 V3 W  X
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.  |- P  s% Z. `. }( l0 i: V, X/ ~

7 Y! W8 w4 }* ?3 O9 [8 J* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
& Y: I5 M& Q% N___________________________________________________________________________0 R! G. N  w" c+ `# j
3 R8 ~) }- L2 _- x& @7 ^

) q( i+ U4 H7 g9 PMethod 03
) {+ g' h, K2 m=========
$ _; N, ^, b, U7 J& ^* d  M6 O" ~3 c( l" X0 E5 ^
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
" r8 d5 K. B) k" Z# X' I5 M/ t& o(API Get entry point)' E2 }9 Q/ z  a4 j4 H8 J3 X+ M
        
: X0 z8 T2 R5 i$ h8 \# ]8 v+ J0 R  m: V5 k# Z1 W
    xor     di,di
: G- }" _, ^* B4 G    mov     es,di
% h0 S( ]" q" [; l* u1 e, \    mov     ax, 1684h      
6 h8 ?# B3 K! L4 }1 O! t    mov     bx, 0202h       ; VxD ID of winice
7 G0 X0 F% [- N- g. P    int     2Fh
4 @, C: T9 L( j2 a0 D    mov     ax, es          ; ES:DI -&gt; VxD API entry point8 @$ B3 p/ D4 D2 a; Z2 u
    add     ax, di
8 ~! C, O/ C9 T4 J    test    ax,ax0 m- A" B) X, m. ?
    jnz     SoftICE_Detected
# B  w1 V/ z" }6 a  k3 f- g9 e0 V& J, l
___________________________________________________________________________
% |) B+ M7 C( ~/ C7 k7 ?9 C; L1 i3 h& ?7 z/ [0 c: U0 B
Method 04  }  P' o" h& E, o- A
=========; |; Q( W" @) D2 ~

5 D: Y5 q1 x, s) q5 fMethod identical to the preceding one except that it seeks the ID of SoftICE0 u8 v! C% {' R5 f: h' }
GFX VxD.* @! }5 f/ j+ P% L* H* Q* V

% s, I2 l* o8 _8 ]( d! b    xor     di,di
2 F6 D1 D1 u( X/ u  L* ~    mov     es,di! B+ a6 f+ ]" T+ M5 n. o8 T5 W
    mov     ax, 1684h      
5 v+ s$ _6 U, B# V    mov     bx, 7a5Fh       ; VxD ID of SIWVID
9 i: x1 m- D0 V* s: @    int     2fh. O4 @4 Z% D2 Y, ~4 c& t
    mov     ax, es          ; ES:DI -&gt; VxD API entry point. I' l7 p% h" ~& X7 j  [0 }
    add     ax, di
4 D* X4 f. |/ }0 x& W    test    ax,ax; o* f& k  j7 P& Z
    jnz     SoftICE_Detected
& {5 ^5 H. Z, b7 p. l
& x- G! E7 H% E6 @& G6 m- `1 `__________________________________________________________________________- V& m" I8 |$ D: O% `. n4 O1 A
* q- n5 q' ~# M% |# S9 ^/ B" N$ v

( t8 d: W/ z4 }/ j% HMethod 05& R& j& q6 V# g& T. f5 j
=========
1 \3 i4 I$ l, U& h- i; c' \
4 }, V% f) N7 m9 Q6 N8 Z. {Method seeking the 'magic number' 0F386h returned (in ax) by all system
0 J2 S8 D5 i) H4 P8 a! s. Mdebugger. It calls the int 41h, function 4Fh.
" f# H4 u/ [( r- ?) b2 wThere are several alternatives.  
7 ~3 k7 l, u6 h  O+ D% W' `0 k8 y. J% Z! Q
The following one is the simplest:; ~% Z8 y* ^4 t3 g: ^) ?2 q1 j

4 x: ?+ v% L5 V    mov     ax,4fh: d. ?- k6 y# S" j# v
    int     41h  t: u, k7 j8 V: B  m* h
    cmp     ax, 0F386
' w, o7 R* ?9 U6 Z) f( }  {    jz      SoftICE_detected
6 j4 s5 V8 X0 Z0 K/ n
% \2 H! ?- h" _8 J# y) |$ n8 M! ?0 j
Next method as well as the following one are 2 examples from Stone's % t& g1 @4 L( y- M
"stn-wid.zip" (www.cracking.net):$ ^. Q9 U: n- n1 a4 U$ w
% n& q2 F5 Z8 ?3 a0 E5 ]
    mov     bx, cs: i% q* E8 d# v( _5 v
    lea     dx, int41handler2* K$ X/ [$ I0 _9 o( {
    xchg    dx, es:[41h*4]  N3 A; g: {& o3 Q; z" z& D7 m
    xchg    bx, es:[41h*4+2]
2 g& Q" o& u! w2 I/ ^' d7 I% E    mov     ax,4fh9 M: Q: C2 S, G# N2 z% ?) W7 b, ^
    int     41h
$ i: k/ }/ G' \0 R& q- ~) H    xchg    dx, es:[41h*4]9 z3 D9 y3 C+ _5 n& }( _! [
    xchg    bx, es:[41h*4+2]1 Y$ C" m$ I0 D9 j( ]
    cmp     ax, 0f386h0 b: g, r9 F' @5 \
    jz      SoftICE_detected; _; F: ~" H0 \2 k) j) c
: n- D2 ~7 A* [! ?: V( ]9 _
int41handler2 PROC; s/ Y" E, V0 X; ^+ O
    iret
" c& _- j0 C2 d# z, i. V6 M2 zint41handler2 ENDP: q8 C& e( n9 E; T0 Y
3 i& d: }8 i9 u
" Q' h- p* C7 [4 z3 q$ e$ h" y
_________________________________________________________________________
* g3 p6 n# Y* U9 Q) i" r9 A8 L' x* R; ~  U- J+ a0 D2 \
6 A" o6 C: k, Y7 |! \$ n
Method 06
, R+ D$ o; M4 ~=========' W2 v& n, S5 T) F0 X4 d0 q5 H; ]
5 X# ]6 L+ K7 w- I* C- [& F
# O- \( H3 M, W' ]' {1 _
2nd method similar to the preceding one but more difficult to detect:
( g7 ~5 \& R( D- `9 M' |  W* Y, j/ Y# i$ [
8 U3 K. F9 I. u5 R- ~, ?, S( M
int41handler PROC4 B( K4 ^- N7 B. [1 ]* K" C
    mov     cl,al3 }9 x8 ]" K4 k- z/ ]' h
    iret9 }2 Y* A0 X( y) K
int41handler ENDP
  y; K0 j  z& J
  ?  c$ c+ r0 }( ~  f+ L( S& {* |: `% t5 t
    xor     ax,ax0 J) q; s5 i$ Q) h7 x, |/ K
    mov     es,ax$ Q; Y! A% `1 M( Q4 }) L" X" }
    mov     bx, cs
  x2 |8 I& K9 w9 s$ s+ l    lea     dx, int41handler
' c- g' ?4 N* \; |0 F    xchg    dx, es:[41h*4]
: @# K8 j0 V( s8 `    xchg    bx, es:[41h*4+2]# b6 h# [4 @/ J4 J, L$ m0 O
    in      al, 40h% G" V; d6 m3 {, Q. n$ k& z
    xor     cx,cx
5 p, n" Z4 G* }    int     41h4 ~; I' A% T; n  U
    xchg    dx, es:[41h*4]4 z& L) T% h* J
    xchg    bx, es:[41h*4+2]0 S, k$ g. J7 ?6 t1 p/ }* H2 V
    cmp     cl,al
  ~, E4 }$ e, u: V4 w9 T$ u    jnz     SoftICE_detected  C% }# n) M) t, {. _: I6 o
) ~- }1 O+ x, b0 p3 N/ k
_________________________________________________________________________( f% p  M2 {) |  [& W
1 L) J  w- i- n
Method 07
% a  l- E/ \# Y, |. L: c=========, j$ T, |# M8 D9 j
0 N+ o" `' g1 C
Method of detection of the WinICE handler in the int68h (V86)3 a' k% ]2 g- l! @3 i7 c  ]  n
2 W. c+ ^" R! u; ^/ e
    mov     ah,43h' ?- x- e9 K, H7 b
    int     68h
" Y0 g: J9 E+ V8 ?: j  L    cmp     ax,0F386h
5 I& X3 P* W: F8 D7 r; P0 c8 f( Q    jz      SoftICE_Detected
- a' W! g; X6 B" x. V/ x/ r$ Q
3 `9 H; H2 a1 e8 H8 H8 x1 _  Q) |! A( H
=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
" a# M. d. s. J2 `% \   app like this:1 p, M$ w) v: Z/ a8 E+ ^! k2 G8 r

. r, `& x, P' x8 h9 m( q. Z# P   BPX exec_int if ax==68% ]$ `+ J! F. u# p
   (function called is located at byte ptr [ebp+1Dh] and client eip is- c$ I. L/ m- f7 c9 d# w
   located at [ebp+48h] for 32Bit apps)5 [; \' S: q0 x6 t( v6 u/ c8 a" V
__________________________________________________________________________+ i: [4 ^. O( r. j7 y

9 h6 h3 `- x7 d1 m/ t4 G1 j% T# b; {  |
Method 08
% s+ y8 _- ~3 I! M& f* p# Y% }* M=========
  A/ I& G* Q% r
* K* l; c0 ^8 C4 f8 YIt is not a method of detection of SoftICE but a possibility to crash the2 \5 ]3 O% p6 ]$ h
system by intercepting int 01h and int 03h and redirecting them to another
* J2 H3 _" J+ J0 N% Y, P9 Nroutine.! p' I9 p8 N7 J5 f) S: ?8 q
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points% h; u/ ]# n3 b# F2 c
to the new routine to execute (hangs computer...)# P. `9 |( o( g! k. I/ l1 l' ~
7 w; F# h' `3 N5 V+ k, g
    mov     ah, 25h" a) Z' n' {5 o3 S
    mov     al, Int_Number (01h or 03h)
8 z$ _  w( F" i4 i' l% H) f8 u    mov     dx, offset New_Int_Routine: h3 G4 q2 t" E
    int     21h0 Q3 }0 `  O" H' ~9 P  L2 V

( _# \- J6 q% Y& N8 @  s+ K% F  I__________________________________________________________________________  f  j5 B2 k4 _3 w2 @0 {

3 O; ]" T; \3 f" q8 lMethod 09
1 y* t8 V7 b. r=========
( ]6 `( D, }, x) \
6 K/ h1 V( z8 H1 a: v9 y% I4 YThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only/ w, r/ I! g8 b+ C2 ^. w6 E
performed in ring0 (VxD or a ring3 app using the VxdCall).
9 ^- i6 _- r; X1 [9 E, Z5 ZThe Get_DDB service is used to determine whether or not a VxD is installed  k$ j  q" x. @# m3 j! d2 J* ]
for the specified device and returns a Device Description Block (in ecx) for
! v# q4 G7 y  [8 s: A/ S$ {that device if it is installed.
8 M( w, C# r* D& b( d& Y, K* t9 C0 E4 E( I' U" I  ^0 G
   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID
* e+ B3 K% J& t/ ]7 x   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-). l; g8 Q- p* y9 e2 N9 H- N- {
   VMMCall Get_DDB
7 N9 z- q8 ^7 t/ ]8 C5 ?   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed
8 ]1 b9 I+ z- N' }$ A0 E5 r" R* }6 c8 c
Note as well that you can easily detect this method with SoftICE:
$ ~; b. I1 v3 J! v2 p   bpx Get_DDB if ax==0202 || ax==7a5fh
% b8 u; ~' r! x. j' p* K* [
* v2 L7 ]+ j, h__________________________________________________________________________1 P1 K- u# q; c* Y- V

3 V3 Q' [' `4 @" EMethod 10
- D4 V* F) k4 O1 Z/ T6 N# a=========
) w; C8 l! E- w: a3 f: r9 s9 c( y4 f4 \2 O" K7 s
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with
- h8 }4 F# o* i- q1 I2 `) `, c  SoftICE while the option is enable!!- h7 ?- w, A6 g$ T9 d0 p" c' N

7 c( i. q* P" v/ R% ~/ {* K. y* wThis trick is very efficient:
& v9 G5 w5 W! y* A4 Y9 N7 tby checking the Debug Registers, you can detect if SoftICE is loaded
+ e2 E, B) g+ w) y& S) q(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
/ e/ g5 t0 u# B& W* Ithere are some memory breakpoints set (dr0 to dr3) simply by reading their
8 j' k3 y4 \9 |& q" |  ?value (in ring0 only). Values can be manipulated and or changed as well: l; @6 k* Z. f; i$ Q1 N
(clearing BPMs for instance)
* M+ Z! S& W2 G# `+ F/ ?2 {2 \: _& Q. h0 u
__________________________________________________________________________
+ q: j) P! [" c4 r, E8 y) H4 h/ l& ^. |6 u5 G9 v' u
Method 11
" O5 c* p2 g4 N=========
- E4 r) i8 o/ @6 x0 z$ Y! _
0 p, b( E# W, e2 v1 uThis method is most known as 'MeltICE' because it has been freely distributed; q. B; }2 Z. P5 z9 t* H
via www.winfiles.com. However it was first used by NuMega people to allow
) W+ N) d7 |6 D5 U' i+ pSymbol Loader to check if SoftICE was active or not (the code is located
* |; H  E) y- v* P7 Cinside nmtrans.dll).
) Z8 e7 J9 }( ~1 b! [
; X! w9 w9 @$ ~. Y% P, QThe way it works is very simple:
# S6 K+ q$ a5 B  X& w* r' gIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
/ k9 e2 R0 C, E( [' Z; U: DWinNT) with the CreateFileA API.
0 q7 C) v8 L# u  m6 f7 e
  T8 X$ ?0 c" E; V- S5 @3 y( NHere is a sample (checking for 'SICE'):7 y$ E1 ~# [! m

2 e7 d5 `: Y3 \2 wBOOL IsSoftIce95Loaded(): P# @/ Z; o& V) M+ K
{3 m. Z; ]  G: R. C# n/ I6 M6 _
   HANDLE hFile;    k3 V& r' t' |  U, {
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,; {9 X  G6 Y& \0 M) m3 }) s: V/ S7 x
                      FILE_SHARE_READ | FILE_SHARE_WRITE,
: z( ~' f' p3 `8 {% X" o                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);6 J1 [3 H* _2 u2 ?+ R0 F6 L  L
   if( hFile != INVALID_HANDLE_VALUE )$ h: \3 h0 D* F( ~* X; g
   {
) F5 S% c" N: F& |      CloseHandle(hFile);( j+ z* Z" z' L# C* c
      return TRUE;
: p/ \8 V& t( v   }3 ?8 G" O" Q2 i& s, k
   return FALSE;- T) [# S0 L' Q4 d  G) |
}
; B" w9 n+ `/ l, Q9 c2 \6 `- c9 L- Z+ X4 e" c* C
Although this trick calls the CreateFileA function, don't even expect to be
. w, j1 D. G5 X% Cable to intercept it by installing a IFS hook: it will not work, no way!1 s0 x; K, {$ `$ V( J) E
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
; s) B$ e8 E: R6 ?# P/ d) \service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)% S2 Z7 S: e# f7 y0 e+ x1 q7 M
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
% Y) }( q( O, m+ s. S! Tfield.' |5 w) ]6 u2 i% L5 r
In fact, its purpose is not to load/unload VxDs but only to send a 3 z+ @. q5 L0 q+ }$ ?$ H3 x
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE), f8 M) |1 h$ X. k: U- m
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
$ I  ?. {  M) L2 z4 Ito load/unload a non-dynamically loadable driver such as SoftICE ;-).
) {: C  b( A! L; x  E# \* QIf the VxD is loaded, it will always clear eax and the Carry flag to allow3 n, D1 @: _" C6 `, J! c
its handle to be opened and then, will be detected.
; T! [5 z) j# m8 t6 t6 z( ], iYou can check that simply by hooking Winice.exe control proc entry point
( J6 M* P$ G. v. K# e5 _while running MeltICE.
0 B7 r4 p% K1 F9 y2 w& g
: A3 a( a# C- x/ y5 F! D0 H
# m/ J; {2 w  B7 s; v3 P* ~8 L  00401067:  push      00402025    ; \\.\SICE& S; T$ a( [1 c+ C! H: `( j: a
  0040106C:  call      CreateFileA1 c' l* ]4 ?1 _4 e
  00401071:  cmp       eax,-001* N  @; }- L8 s( j+ q
  00401074:  je        004010910 c, v' O& p: W. T! v) ?
0 W# {" K4 `2 w$ g+ o4 N, h4 S

2 w; J$ _7 z3 w+ ZThere could be hundreds of BPX you could use to detect this trick.
) y' [7 T: k5 i( q# p) z-The most classical one is:
3 B- `3 m2 s1 H+ n  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||4 ^, g2 U3 R/ a5 N; B; @! f
    *(esp-&gt;4+4)=='NTIC'
* n# }  Z! k. @+ ]" c' |. \7 u, w1 ]# \# a2 d& {- [+ |. a" H
-The most exotic ones (could be very slooooow :-(1 b( u, {: V, {- z9 S# t# v& ^5 i6 i# [
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  
7 G2 [; |, c3 T% |' V& U  o% x% ~     ;will break 3 times :-(
) u) J2 v( U& U" L7 _9 b$ i+ H5 w2 x( @6 s7 j
-or (a bit) faster:
0 ]" z# B/ v0 p' `   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')5 [$ ^" {) C; ]9 r1 Z$ g2 ]
1 g% Y! Q# {' V3 D- F7 T
   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  
' B% {* O: D3 k2 ^0 p     ;will break 3 times :-(
& h! u4 B! [; x) S
- w2 t; C7 `$ s" \1 g( Z-Much faster:$ v: N$ e% J4 H- }7 Z/ Q
   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'* ^" M: Y* A7 u+ ]
: s, n& f$ @. w% c# [2 b
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
# P+ W& N. ~6 W# ^4 g; h3 t2 Xfunction to do the same job:8 w& b  i7 A7 c4 ~. r) e6 P
6 Q1 |2 ~% R$ E& p& ?3 ]3 j
   push    00                        ; OF_READ# T' N. R. q) q
   mov     eax,[00656634]            ; '\\.\SICE',07 B2 h( i4 q) f1 L
   push    eax, v' g: z% `3 d
   call    KERNEL32!_lopen
$ L# p" K2 \6 [+ D1 f   inc     eax3 v( _9 j$ A2 i2 V% H. n% g1 M) z
   jnz     00650589                  ; detected
! |* n% y* L; Q2 w7 |4 I0 E2 r   push    00                        ; OF_READ
* k; Y+ ]7 ]2 [. c' d2 @8 J' f! N$ j   mov     eax,[00656638]            ; '\\.\SICE'
4 @) |" e& @! ^" ]   push    eax
3 @+ h0 \- j: v; c7 B   call    KERNEL32!_lopen
( s1 a7 B6 ^4 }; B; K& n4 G$ K' v   inc     eax1 }" R. p' @9 ]* |/ M
   jz      006505ae                  ; not detected7 Q* t% ^7 c. i2 z% T: h$ F8 p6 T
, _5 |2 f. p  C  P7 }
! ]) O7 \( n1 `. V
__________________________________________________________________________
# v  a! T1 j$ C! f9 E0 x: o4 B1 m, g# q1 z/ r# D) Y; b
Method 12
& u4 A# L* H1 M8 x2 u=========
* H7 h' D8 D* p, h4 R6 E! i2 E
0 v+ V. i; C8 P6 C: ~8 K) LThis trick is similar to int41h/4fh Debugger installation check (code 05( ^+ S5 }0 F6 Y3 A* a$ {
&amp; 06) but very limited because it's only available for Win95/98 (not NT)3 E+ t2 ~6 F$ E$ J' V; R
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
* b# H- |3 y% u; L8 |- D/ \4 R( r& n5 R1 |- ]0 H! v3 I1 G) x2 e3 N' M
   push  0000004fh         ; function 4fh
: W* A: S0 N3 ^5 W6 B   push  002a002ah         ; high word specifies which VxD (VWIN32)) j8 ?' i2 w$ [2 X
                           ; low word specifies which service- ~5 u& N" L. ?) \/ c
                             (VWIN32_Int41Dispatch)% C# Q* k' ?; s. Z
   call  Kernel32!ORD_001  ; VxdCall
% N! T- C' {9 Z* y$ k   cmp   ax, 0f386h        ; magic number returned by system debuggers( X. Y0 `1 {/ U8 L
   jz    SoftICE_detected1 s" s! ^+ X! C* b! a- e) N7 i& _; a
" j+ p- V8 X' O6 H9 b
Here again, several ways to detect it:
  X  L" N& E0 Z4 M9 n) \  @0 ?8 h0 w
    BPINT 41 if ax==4f# h  a6 z4 U; g% B, I- Z
+ d# Q4 w. p3 O( |
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one
! B. D  C3 d* h# A' a
0 F/ x6 @4 k* [$ @  h    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A. ^9 n6 N( `+ ?! L" t' {3 h: I
; j1 U# _) x  A- S( c, w
    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!3 ~$ @+ l" b3 [/ ?( |) ^+ F
7 V5 F* J* M1 L
__________________________________________________________________________" }7 x+ p1 d, _. d2 j
2 V( U: q: ]7 n$ [& d# a
Method 13) \% J# L2 S) ~3 X, d0 o
=========& U" U. E- u, [: g- E: b# T, ]

2 P8 A- w$ O3 ~Not a real method of detection, but a good way to know if SoftICE is
7 r. X# j8 F3 J0 B7 Y) Tinstalled on a computer and to locate its installation directory.
. F' W) d2 K' k  S1 ZIt is used by few softs which access the following registry keys (usually #2) :2 v/ V9 j9 c/ |2 m
( n# E" p/ ^+ A/ t3 R; n
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion6 E) q- r; _& _* G: ^# Q7 T8 h4 b$ D
\Uninstall\SoftICE
4 @" a* Z8 ^  s! v3 V8 r-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE4 S, Z; m0 M- g( G, W# H
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
1 h) r# y+ P& m2 V3 S7 s\App Paths\Loader32.Exe
# x6 s" j$ ]# T, l: m8 G/ R/ c& W& g9 E

) d3 N" F+ \( T1 ~Note that some nasty apps could then erase all files from SoftICE directory2 h; V. [: c6 P' y6 U
(I faced that once :-(+ ]$ `, O/ d& I+ q* W: T1 s- A
2 C! w; ^$ y. k
Useful breakpoint to detect it:7 u& D3 A4 n, z1 u
6 }( q4 K" v+ d: P0 b. J1 j
     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'" I, n4 i5 [% q6 l  M
2 ]+ J" y0 b+ r
__________________________________________________________________________' b; v7 b& h( H7 g4 c
# R+ f: m9 P) L; N3 c5 Q
/ ~9 W, e; |  C
Method 14
: I( y/ h6 A2 A8 f! ]3 S: z/ b=========
+ T' C5 C- k/ ~& G2 _/ {" ?$ V( O# M5 w
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose1 s- O+ f0 q6 \' K7 S  C
is to determines whether a debugger is running on your system (ring0 only).( v0 J: Q/ h0 V0 D! @5 O

; E4 m% G5 T  f, u2 `* D+ Q   VMMCall Test_Debug_Installed+ ^! s2 q, r0 u' R5 m3 l7 X
   je      not_installed
% O( g, W' Z- W" f, {4 Z! k! h! x& N4 c; l5 S7 ^3 q6 @
This service just checks a flag.
9 R  `$ A! @7 G% D</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关注公众号

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

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

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