找回密码
 注册

QQ登录

只需一步,快速开始

About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
9 L; `+ a1 j2 P- W<TBODY>& K" {* G; w5 H5 U3 S  d
<TR>
1 N2 p9 ~) ]1 N. t3 X. f<TD><PRE>Method 01 % b* _7 v; G8 M8 A
=========* j8 @" ]. _# o' W

/ q) g3 [- B" A& TThis method of detection of SoftICE (as well as the following one) is7 m/ K5 h7 J8 w4 c1 Q2 P- ~
used by the majority of packers/encryptors found on Internet.8 `+ n- l* e- z/ ~& }
It seeks the signature of BoundsChecker in SoftICE8 L+ ?! {) J! a( ~$ e9 h8 U

1 V: R* c1 b3 o5 d: U' s    mov     ebp, 04243484Bh        ; 'BCHK'
% T: c2 `6 X/ U    mov     ax, 04h
& d9 J1 H4 D+ V3 B; D# x    int     3      
' y; E! p5 b9 F* }8 v  W    cmp     al,4
: ^  E) G4 q2 E, d! K1 D5 B( S7 t    jnz     SoftICE_Detected
) W) k& C7 G+ w- v) W4 o% T% G& D$ S* k) y' \! [5 x( g
___________________________________________________________________________
/ l( t/ F. \" P; o! U# i0 R' e7 L5 p
Method 02
0 {1 ^& u$ t7 B8 u/ k8 t4 Y=========) e" J; h  d: _6 ]! W  Z
( l* l4 n2 A7 @7 f
Still a method very much used (perhaps the most frequent one).  It is used
$ a4 K0 q3 O  S! R* L- gto get SoftICE 'Back Door commands' which gives infos on Breakpoints,2 |7 @9 X4 R  m  w9 r# G! N* L: K0 @
or execute SoftICE commands..., H6 J1 ~  p$ V0 D
It is also used to crash SoftICE and to force it to execute any commands
* ^5 b2 @/ v; X! w(HBOOT...) :-((  / o: w5 K' G7 W
+ k" {& n/ E1 J7 t* c  f
Here is a quick description:
" c' S7 q0 c2 v, A& v9 o+ ]-AX = 0910h   (Display string in SIce windows)
) c+ W" p; e! ~6 |-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)
- V8 H& u6 `" R1 h$ r7 r-AX = 0912h   (Get breakpoint infos)
, ]$ ~3 s% o; d" m; t2 _-AX = 0913h   (Set Sice breakpoints)& _: |# v% V6 D: v' l
-AX = 0914h   (Remove SIce breakoints)+ S: |% E: i* `+ @% p# C
: D$ _7 b. `1 O, m
Each time you'll meet this trick, you'll see:, j( y+ w2 u- G* J1 G8 r5 [5 h+ H7 R
-SI = 4647h
3 ^0 @, h1 D1 E& O5 X3 {-DI = 4A4Dh
0 J, X$ h8 ?/ kWhich are the 'magic values' used by SoftIce.
2 d. [6 `8 R' G" M, jFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
* w  B6 P; f. @! B  ?0 q9 p6 @5 P" S
( N$ l* n: S) y1 sHere is one example from the file "Haspinst.exe" which is the dongle HASP9 I& `/ b! g8 B) a4 O8 K
Envelope utility use to protect DOS applications:
# X. U. m: Y: F5 C6 y! G* j- v  D' H* W3 y8 K# o  Q' C

. \! @  ]  \: r$ A4C19:0095   MOV    AX,0911  ; execute command.
  \- P9 i3 g$ \+ \; Z1 x4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).' S! g. U, e1 A7 d+ z
4C19:009A   MOV    SI,4647  ; 1st magic value.: a7 i; A- C8 v- q: D8 @
4C19:009D   MOV    DI,4A4D  ; 2nd magic value.
2 Z; _* q' G9 Z% u# q7 z4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
6 h4 F5 }5 q( b$ e2 s$ \7 H4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute. `% F$ L9 ]8 z# P( h: ^
4C19:00A4   INC    CX* d8 {1 B" e4 h
4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute
9 A/ E: g! t' J9 [6 E4 r9 e% q4C19:00A8   JB     0095     ; 6 different commands.
( i8 b" w0 v; W8 O. b& B4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
3 W$ _3 M# `8 E+ D4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)
7 Y0 C4 ?7 ~) X" v
% H: W0 }: ~3 u8 eThe program will execute 6 different SIce commands located at ds:dx, which9 g. H1 ]! W) z
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.5 H- K0 S4 M7 n' q
- Q1 n# T( @6 k  D
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.. v. q; F) T9 V# C
___________________________________________________________________________2 h& Y1 e! ^2 P. l' |6 O- s

, t: N: Z2 C9 K) a0 I5 Y
/ M2 a& `! w* U. G) |1 Q1 aMethod 03: v8 U/ S2 P4 [5 F% L& r
=========% M: k+ B8 i' h' b, L% L) c

7 I- ]5 x( M! s! E! t6 b3 H7 x" p- r3 iLess used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
- s  A/ }* x" j(API Get entry point)
" ~6 Y* |0 A1 |1 K% a7 B        4 f8 G+ d; m7 }4 x- t, @4 w
2 e+ o4 x7 w# T4 G! n
    xor     di,di
) [7 ?1 \* w7 b1 I' i. k' y/ {( S9 i    mov     es,di' I% E' F$ u  K# ~+ K! {, `3 N
    mov     ax, 1684h       . G0 Y4 \9 f9 w3 s/ \4 [8 a
    mov     bx, 0202h       ; VxD ID of winice8 v1 _5 l- L% t# ^
    int     2Fh
' `# ~' i3 l! t    mov     ax, es          ; ES:DI -&gt; VxD API entry point
2 u: d8 N' A4 h# }. ?    add     ax, di
) p0 C+ `7 A; l- c' u6 m* b    test    ax,ax
: X# \8 y  _' p4 F5 l    jnz     SoftICE_Detected
2 }4 p- g5 l( e) l
; W& A$ R# g0 V. t! {2 m8 j___________________________________________________________________________
, k9 x: c) U5 f6 P5 O# h$ G; O- X7 ~) J
Method 04
' M% T4 Q- D- E7 r6 x# A/ i: @=========
# e8 r( C6 c0 G: Z% k
8 `/ [* j1 C% P; X- i3 lMethod identical to the preceding one except that it seeks the ID of SoftICE: C7 ]# x7 l# s0 u) s) y+ e% ~8 t
GFX VxD.& S7 r' V# R/ E% d* s

) w0 _+ {' e1 m% }6 ]3 ~    xor     di,di) J$ g  [" a) ~( Z8 B% ~
    mov     es,di
1 j. ~4 H" P+ `9 p; n& N7 U0 f: x" F    mov     ax, 1684h      
; Z& {) O1 ?$ }7 _: S& Q    mov     bx, 7a5Fh       ; VxD ID of SIWVID
: g, l$ X0 g* Q8 g8 K* L    int     2fh
) [( F1 U# j2 S& N8 z7 \8 p4 E- s    mov     ax, es          ; ES:DI -&gt; VxD API entry point0 L, v  b9 s6 i6 H7 h- A
    add     ax, di
8 \5 i5 w) }2 o, o8 s8 X    test    ax,ax
5 a  ?8 H- S  t. s  y    jnz     SoftICE_Detected
3 a# q2 U4 c$ f& L. T
& ?/ K; V9 A7 l' q__________________________________________________________________________
4 R; ]) B4 x/ ?' ~
$ e- U0 T! n% r4 i$ l; s8 G5 u# D8 Q* L/ [6 g8 I5 P
Method 053 w- R0 h* ]5 t1 _7 \# h# ?
=========" G* v: n* `) l& e3 `$ F
2 t8 ]/ G# T# B# o5 }1 r, _9 ]
Method seeking the 'magic number' 0F386h returned (in ax) by all system
) r* H- ~6 i: O, G  ]* @# D3 N$ s# n: Bdebugger. It calls the int 41h, function 4Fh.
' ?* K6 }/ U5 O' cThere are several alternatives.  
/ e: L( X/ i! q: ?% x/ S; H0 W/ }: W5 {7 U" j- p
The following one is the simplest:
" ?/ b; Z' B# [7 ^5 G/ Q4 X, S' N1 F2 ^
    mov     ax,4fh2 U( X9 r1 V9 h0 S! j4 n: K: Z
    int     41h
! U; q% {: g7 ?" t& ]  e# h7 Y: I    cmp     ax, 0F386! ?( t3 x( w7 n/ }8 F; S6 A
    jz      SoftICE_detected
3 D( S% l& t3 c8 v0 S& x/ P, F4 ]/ h: u$ x
# ]" B( v6 N4 F4 E' X
Next method as well as the following one are 2 examples from Stone's
/ J* D$ h: i# o; x! g2 u"stn-wid.zip" (www.cracking.net):
6 P- k& V0 X: I/ A4 O
3 d) f  S5 X8 X( H    mov     bx, cs
$ V; x! C8 e  a) m% |    lea     dx, int41handler2/ _# v2 b% S/ a. c1 z. {( F
    xchg    dx, es:[41h*4]
% O$ ~' K7 N# P: \    xchg    bx, es:[41h*4+2]
6 ^4 M7 l& C/ c    mov     ax,4fh
# [/ H6 v5 o* I+ U    int     41h
9 l2 C6 z/ s. {  @1 b    xchg    dx, es:[41h*4]$ k6 r% D0 M  z8 h0 b" k: x
    xchg    bx, es:[41h*4+2]0 ]" `- m* B. w0 g; S6 d# A. @8 }
    cmp     ax, 0f386h) e" q2 E& w& _0 G$ v3 }
    jz      SoftICE_detected3 }( a- R, M/ @8 Y$ ?3 A

0 z5 ?/ V3 Q5 z. w+ O, f  Uint41handler2 PROC1 _3 }$ z; N$ ^4 P/ v2 V  M4 ?9 x
    iret
; A0 K" {% X, ~int41handler2 ENDP& h4 U$ c! b# e3 q

# h( ]4 O0 I! q3 A; K) S: n8 D5 j3 q
_________________________________________________________________________
: Y$ u" `& x. q9 K1 c& u5 f, ^7 A- ?4 G
4 R+ I! k& t. l
Method 06
1 G! s$ d" Z  J1 D- m=========
% }7 P" p/ N! [7 t% p6 w$ U- Y# ~2 x7 c$ C1 L" i8 {; U

9 w( n" [0 B, y* E9 P  e0 E2nd method similar to the preceding one but more difficult to detect:! W0 T/ ?' P8 W# W" O0 m

) s# B1 p: |: X! L$ {2 r
1 h9 x# F  Z  G4 Eint41handler PROC) L: w2 C  }# H/ Q: U& P
    mov     cl,al; ]+ {+ P3 F- F5 l1 m9 X: B
    iret6 k& Q) k' p' X" z' B
int41handler ENDP7 D6 s) J. ^3 A# @

# r# ?( a6 R6 n$ Z3 O9 x# C5 i. N, a0 N- N$ e
    xor     ax,ax" o0 I+ z7 V, U9 h. U
    mov     es,ax
& I, @% T9 U7 n% m5 U& j    mov     bx, cs
/ X+ a# n7 M9 J: O% c9 z4 H    lea     dx, int41handler
7 j  m/ Y+ i6 c$ R* G5 a9 ^* D" }; Y# v    xchg    dx, es:[41h*4]
7 G# G9 j7 W. U7 c( f8 u    xchg    bx, es:[41h*4+2]
, r" l# ^* T' v/ j    in      al, 40h6 B; N9 @$ }1 f" _2 ~' W
    xor     cx,cx
+ v. G' y9 q: e; t0 w0 e5 X# B, }; p    int     41h
: `1 |- l4 I. W    xchg    dx, es:[41h*4]+ F! f5 w  y' @/ N- t- [5 `! C
    xchg    bx, es:[41h*4+2]
4 Q/ D, {' b/ L9 r    cmp     cl,al6 G; ?, u6 |6 \! y( g6 v2 L
    jnz     SoftICE_detected! `2 ?' W; C- d, g, R, c

" G: I$ \# C% C; e. w( ]_________________________________________________________________________
' W; ]* T" x" E" P; ?2 }6 E  w$ ~% k+ B
Method 07" Y: |, s* k. A3 f1 l  O: v: h; x& A
=========4 R( d0 N# F* n! w1 g" v7 n
' H3 C7 ^: Y% `, J3 C
Method of detection of the WinICE handler in the int68h (V86)
0 u2 h3 |7 y# `. a+ f* h6 n6 I
( m; }$ F) H4 X% z; B; }    mov     ah,43h+ P, v" x. o2 L+ D8 ?  V0 @0 ]
    int     68h
& `/ }& |. R' k9 m    cmp     ax,0F386h
. w8 @  G, L" {& a7 K    jz      SoftICE_Detected. J2 i% n- o2 S
% l* S1 n6 w3 T; e
) A- z8 [! z6 f
=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
' [- Q3 S/ H& H! @   app like this:
4 K) W: L& ?( \& Q: f
- T" A: L% w  [' y   BPX exec_int if ax==68  {% L  o3 v0 k( r* C, p2 x5 S: x
   (function called is located at byte ptr [ebp+1Dh] and client eip is9 c1 V. i/ k- w  h: j
   located at [ebp+48h] for 32Bit apps)
( r2 y+ n% g! Q% a% d3 R! n, ]% X__________________________________________________________________________
& F, o% R% m& J
4 z' D5 Z; d2 q# ]4 h% b$ P+ p5 I# x; e$ ~* |2 Y
Method 08) z! L7 [4 q# H# E, H, Q5 h
=========
3 N, b5 B) y2 [, D6 S
9 j% i$ r+ W( ^$ U, PIt is not a method of detection of SoftICE but a possibility to crash the
; U9 l: B' e0 J" N3 m* [* Xsystem by intercepting int 01h and int 03h and redirecting them to another' T$ P2 Y+ s; T) G+ o9 V/ D
routine.
* X& L' m2 h0 jIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points# y. q3 F) E9 r" h
to the new routine to execute (hangs computer...)
& t2 _( n! z/ ^  p1 i( X4 s1 k2 G# f* t6 F
    mov     ah, 25h( c  C" T! F2 y: |
    mov     al, Int_Number (01h or 03h)
$ ^/ T. ]/ k, j2 z    mov     dx, offset New_Int_Routine
" y" S0 M7 |# I) V    int     21h, e+ a. w+ C3 Q$ O, C

' n( j! i9 R) I0 f+ k4 i__________________________________________________________________________" N3 S+ ?( J# S2 T" Z0 D

( p/ g) o9 s  B4 ?7 s) @Method 09
) i' J: Z! v, g; v6 ?& }=========
' K/ {* X) D' o" q5 c( c! Z, h: v  E4 L! [! G3 q
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
# f$ I; k( N5 A0 Z0 Y  ^0 vperformed in ring0 (VxD or a ring3 app using the VxdCall).- \" u4 C2 D: e3 b6 C
The Get_DDB service is used to determine whether or not a VxD is installed
# G, d1 y9 ^' e1 ?+ B: zfor the specified device and returns a Device Description Block (in ecx) for
. e$ h: ^  M/ ~% A& r* Athat device if it is installed.. l% }7 E% J- X& X

! e& \( l: L" N- u$ I7 ^- j   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID
6 o: b$ B- s$ U+ [% i0 A* Q   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)" [3 \6 X* g# D* l2 v
   VMMCall Get_DDB4 v: C9 ^1 [# ~, T, v& O; Z
   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed
" v9 f. ~3 [: V) ~  v: G9 k" K
! P% C4 \. a* n6 P* yNote as well that you can easily detect this method with SoftICE:* A4 W: y5 X( H) T8 x$ ?
   bpx Get_DDB if ax==0202 || ax==7a5fh7 r! t9 j. D$ k; C* ?) d
7 O! C# g* V- B9 [! h9 ~
__________________________________________________________________________: W; n  R: R4 g) h3 q: i
, z" u1 }9 I+ [+ ?1 ~6 {' ?, V
Method 10
2 p( _8 L+ l$ J) Z; c=========9 c3 e) O0 `" {) ?
: g/ k. H0 o+ x0 d$ N. n
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with
+ T! u5 A3 Q, i  SoftICE while the option is enable!!
+ R6 C" x& B" ~6 B7 v* B: A; E2 v% L1 x1 e9 O
This trick is very efficient:
" h: j% d! y/ j# `- ~) M+ Mby checking the Debug Registers, you can detect if SoftICE is loaded9 v  L& r  p9 I1 t0 C$ Z
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if' E7 l1 H7 C2 t
there are some memory breakpoints set (dr0 to dr3) simply by reading their7 g$ E! U4 s4 I
value (in ring0 only). Values can be manipulated and or changed as well1 l# \; U2 }2 n
(clearing BPMs for instance)1 E% b' R4 p# Z" s+ W0 ?8 j, m5 }
7 Q- n# d4 N- O- K
__________________________________________________________________________
3 s! w+ g* [5 Y; y2 u$ G5 P7 W; z: X3 K* C: C4 p# T9 |
Method 11
6 @8 z7 i0 |9 {=========
/ K  ]& V: f# {  @- H+ L4 R9 R- b
, |  R5 E: y7 C# cThis method is most known as 'MeltICE' because it has been freely distributed1 M8 z' u2 O" b2 q8 S. K
via www.winfiles.com. However it was first used by NuMega people to allow. N- w  A1 H* _+ v$ r  S4 E+ x
Symbol Loader to check if SoftICE was active or not (the code is located
* _" r; r/ j- Q2 M: L8 t4 d$ x6 ninside nmtrans.dll).
4 A' M3 `. O. L6 \6 b: v# f' [! {- A5 W
The way it works is very simple:( I1 ?2 u9 H( M% d/ u
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
7 f) K3 y$ i' }2 T. J: qWinNT) with the CreateFileA API.) c( b  p# ]  I4 h. _
: f6 I3 |2 I* l$ ~
Here is a sample (checking for 'SICE'):
5 V! I. A5 l5 m/ c& a% e6 b. ~$ b- N* u) l1 d: K+ e6 U
BOOL IsSoftIce95Loaded()
' _8 g# \+ a; ?- q9 m0 q{
* ~/ [1 C& [# H2 \. @- }   HANDLE hFile;  
# Z' i4 i/ z/ p5 t% k   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
$ Y- w1 E% F4 |! h: J1 u                      FILE_SHARE_READ | FILE_SHARE_WRITE,$ _7 T. ]  g, |6 ?4 @/ I
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);# B- E0 r/ q7 f8 i5 M
   if( hFile != INVALID_HANDLE_VALUE )7 Q. a, S: }- g- v3 e% @4 ]7 G0 z
   {
: C% w- @/ v. V2 ~1 t! V. J      CloseHandle(hFile);" @" @  \' ?: h. X. C" C
      return TRUE;
' x  ~. `6 E7 T, c3 `* j& V+ Y   }3 X# O$ A2 ?# M* m
   return FALSE;  L; n, F/ J& l5 p# g: |
}
# {7 ]2 k, L; V! x  f( e0 a( ~0 A7 z2 U" p
Although this trick calls the CreateFileA function, don't even expect to be
: ]  l/ ~) {9 |, f7 [able to intercept it by installing a IFS hook: it will not work, no way!
. E7 c- ]8 m8 Y! D/ c5 g, GIn fact, after the call to CreateFileA it will get through VWIN32 0x001F. q- T, Y. V, o4 g- }
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)2 [/ O; [% I- O" S+ z# K
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
4 E! g/ d0 L; I. N  N/ Hfield.
2 D* ^( S3 D: _2 O$ M  I* Y* qIn fact, its purpose is not to load/unload VxDs but only to send a & c" Z( U; g8 G
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
$ A- d# v: i: D2 |: y5 u6 x3 }to the VxD Control_Dispatch proc (how the hell a shareware soft could try
6 r+ R" P0 f) k* V/ l# n: Uto load/unload a non-dynamically loadable driver such as SoftICE ;-).
  I) y7 G: V1 ?- E9 }9 jIf the VxD is loaded, it will always clear eax and the Carry flag to allow0 m% n0 h7 U) g" ~& n
its handle to be opened and then, will be detected.$ e/ p* Y; r* ~" A
You can check that simply by hooking Winice.exe control proc entry point
$ g: @8 R* f4 t7 o9 Xwhile running MeltICE.
4 \5 D& S" r2 _4 V* E) U, w$ f5 I5 D+ \

! c0 [% }5 I  v: n  00401067:  push      00402025    ; \\.\SICE
1 X! o4 l) F+ T, j! ~+ p7 [! Q7 b/ ?  0040106C:  call      CreateFileA
7 f- n7 ~, V4 H* v5 X+ L  00401071:  cmp       eax,-001
) O7 u. r) G) f. G& I  00401074:  je        00401091/ p( c7 G( F2 e7 n5 B
5 v' j/ q/ ?! h# d' a
) i4 s: K& o- f" D
There could be hundreds of BPX you could use to detect this trick.
1 H5 V$ d  c4 [# f0 ]0 j1 `2 h-The most classical one is:+ `3 i2 s9 K3 z) J# e3 y
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
% D" H4 p3 o! W$ D    *(esp-&gt;4+4)=='NTIC'& l! j, Y' E( b( k; w
$ M/ I8 [1 H$ ?2 D& b3 X" f
-The most exotic ones (could be very slooooow :-(
7 t4 Q2 I( a0 z   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  8 A9 e. f7 C: u. s: S
     ;will break 3 times :-(! Q- L* ^2 M& l# Y0 j

: g. z) ^% w3 b! q-or (a bit) faster:
# \& x! k- i! S3 X6 `   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')4 O+ X5 r( U6 n9 f0 y

' `0 [2 G( ]( h! ?: `4 Z5 B   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  4 P$ P( [; O# }/ Z
     ;will break 3 times :-(
7 ^" G  F/ @+ ?' ~) [7 s8 ?; s( f4 u5 ?  w3 q
-Much faster:
. q9 Z# \3 V9 ^* e8 ^; L3 {0 I   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'
: s; M% m3 R, |: f' ~, ?
1 ?- E0 \6 k, y* [& j( u2 |/ ZNote also that some programs (like AZPR3.00) use de old 16-bit _lopen0 M9 p( L0 F. a2 ~- X' i* l0 A. Q
function to do the same job:
; D5 O) E7 ~7 ]4 W4 Y! t  D' A/ U' L
   push    00                        ; OF_READ) E* M+ u2 V/ @
   mov     eax,[00656634]            ; '\\.\SICE',0
, L1 _: g2 o; |+ J. f   push    eax  i- t. s2 U2 c+ b+ m0 p2 {/ s
   call    KERNEL32!_lopen
- ?  C* E! O; d   inc     eax; c* h# Z& y  `* w/ |
   jnz     00650589                  ; detected* i, k5 p7 _+ r" Q+ o0 ]& O  ]& S
   push    00                        ; OF_READ& C( `# X" b' n- I9 a- E2 q
   mov     eax,[00656638]            ; '\\.\SICE'
' Z  v: ^+ G5 w# J   push    eax
7 D* o' \3 F7 n7 }4 l   call    KERNEL32!_lopen( J; L3 d6 E8 @; Q9 @0 c
   inc     eax1 a) M. W3 f5 T- b0 i& k
   jz      006505ae                  ; not detected
1 t! m5 _. O% Z+ t( D4 g( [2 s  Z% d' ?) F8 r! u/ ^! I5 h; x
/ v" M5 I# p9 z) n: T' n
__________________________________________________________________________- x1 t, U3 h7 j6 n$ T1 m
* y7 W! m; H" j! i
Method 12
7 i9 {6 Z! `3 y( {. g; ~=========: m  M  ]' C7 p3 X9 u* h/ H# i

0 Y# M3 _" H( t! ^This trick is similar to int41h/4fh Debugger installation check (code 053 c  _' s7 r% Y" R( l
&amp; 06) but very limited because it's only available for Win95/98 (not NT)
0 J4 X# }8 [- C9 ?/ qas it uses the VxDCall backdoor. This detection was found in Bleem Demo.9 h! }' Q" U1 ]8 O1 {* C
+ L; {) q$ B( K3 c% R+ r0 y
   push  0000004fh         ; function 4fh* ~$ Q6 p8 F' R
   push  002a002ah         ; high word specifies which VxD (VWIN32)8 w1 p$ F. P4 Y4 J9 E% q4 C
                           ; low word specifies which service! g1 W3 {& j+ [  O  T
                             (VWIN32_Int41Dispatch)
3 o, ?- E! E' P. S   call  Kernel32!ORD_001  ; VxdCall
) Z$ O, ~0 Y( L, z; W   cmp   ax, 0f386h        ; magic number returned by system debuggers7 C. |/ i1 Y- `% s' Q
   jz    SoftICE_detected
9 w! g, c+ p1 o" y9 ?
7 g5 o! i0 D! c9 ~: wHere again, several ways to detect it:( I2 u( ~+ k  G
1 b/ z3 H; b/ R- ]
    BPINT 41 if ax==4f! H/ _8 {0 Z. R' Q
7 V+ u( ?$ I( P  F0 t$ H) S
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one+ S8 H. ?. E1 K! E- N2 z& q7 W

3 ~$ Q" j0 V( S; x; X    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
  K- N1 K& u9 _8 C: x8 B- n4 R* s! J8 e* G( a" [
    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!
& W( t) w. K& I% Y
* w, N; S! `/ ?& U! o__________________________________________________________________________
* c" ?' h: j; c3 s, ?$ w  h1 i2 Z* P, X' C
Method 13
' ^" H5 g4 Q9 o; g( F8 ~5 X5 |. b& R5 s=========
6 t8 K  x" r7 ?) d
, G. h# e& C  GNot a real method of detection, but a good way to know if SoftICE is+ I! C) w9 c  o* ]6 t# ?2 Z& a; j
installed on a computer and to locate its installation directory.
# l# v7 v* V. gIt is used by few softs which access the following registry keys (usually #2) :- ^5 V$ c2 D9 ~8 T" b
* O2 l7 I; s% ?2 A1 {2 T
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
" o8 H! n; e) l) Z' b5 E& ^9 x6 r/ l\Uninstall\SoftICE0 {) s  P! s6 s, c  }
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE5 T; W! B" K6 r
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
( E7 q/ w8 Q1 X% O3 O& o; U' [\App Paths\Loader32.Exe
! ~& [8 L7 h; ^- S
9 a& _/ C& n: t( I8 s& M. C6 D5 _2 B( _9 }( L6 t+ x) p* {- A
Note that some nasty apps could then erase all files from SoftICE directory: U0 e3 ]" E! e# i# X
(I faced that once :-(
) Y) a0 N. |' I; d1 Y+ B0 M
8 I6 f+ e6 {3 |- |4 _, Y6 WUseful breakpoint to detect it:3 a0 y+ N. g7 z# x# l" S
3 q$ G* C$ j" e
     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE': N4 W4 x* Q' f0 U' h
  N1 L0 j: {1 p
__________________________________________________________________________
3 O0 d) N! X- c6 q1 K
& _4 t/ X( ]8 I+ _: R
4 L2 }: |5 o8 _9 J6 VMethod 14 4 M4 n5 r. `6 F# k( S: _
=========1 E/ h. Z4 p9 U6 x
+ i" t# P" e! a- ]" E2 M
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
/ n; Y  H- m; r& T6 I! his to determines whether a debugger is running on your system (ring0 only).
3 K5 _5 d# I# T3 k( |5 d+ `( E3 V& t, a$ c/ M4 X; z
   VMMCall Test_Debug_Installed
* s  _+ x4 r  R/ v7 i* I2 s   je      not_installed# m5 [8 ~% m3 h& X! m; L# ~1 p

) L+ z- O. w0 q% J6 }This service just checks a flag.( o' B3 n3 o+ m# y, Z) m
</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-8-18 17:14

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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