About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>) W/ }3 h% o7 }# [
<TBODY>
. O: q( Q  t+ C: f  l<TR>
, G6 p) L: w/ I% g& U8 j0 k( m<TD><PRE>Method 01
9 u' C/ `4 k  J# r6 q( Q6 j  q3 Z=========8 E2 \/ P  M4 L/ z* x' e

/ h& k' o8 X. M, o2 FThis method of detection of SoftICE (as well as the following one) is
& X, f# K7 Z+ Sused by the majority of packers/encryptors found on Internet.
  n* m3 K; ^- g7 }( `, RIt seeks the signature of BoundsChecker in SoftICE7 p3 a3 q. |4 t4 u/ G; Z* l+ {; O
% V; l, P9 E9 ]) W3 c
    mov     ebp, 04243484Bh        ; 'BCHK'2 M0 w2 q# b5 _. ~# s/ |! n
    mov     ax, 04h! _0 ]* `/ m2 ~2 C* T! ~6 s
    int     3      
* n5 w) Q% ?, l' h/ f9 X3 s    cmp     al,4
! e' g! q/ |3 D" b$ E2 L    jnz     SoftICE_Detected
% }# v9 S( ?5 P! @, j# i' |1 B3 R5 W
___________________________________________________________________________; S0 \  x' v4 `. t+ v% K
" H- `' H  a% ?3 q' z+ ]
Method 02) k; d8 a  U# F1 C  V& f$ B; @* c
=========
  {& B8 u* T! m" K; F% o3 v! p/ O: P1 A; x9 D4 q
Still a method very much used (perhaps the most frequent one).  It is used
4 {1 f, O3 V" h* zto get SoftICE 'Back Door commands' which gives infos on Breakpoints,2 A2 t1 \, q# L
or execute SoftICE commands...
1 J. _* K6 v  w* q1 Y. GIt is also used to crash SoftICE and to force it to execute any commands+ F5 n0 u8 C2 U! ]8 ^9 C& ~
(HBOOT...) :-((  
$ w4 r  e" i5 @% C; J8 V4 S, E' Q7 f& w. {6 ~
Here is a quick description:
+ p( L* f$ N9 d7 F) l7 Z-AX = 0910h   (Display string in SIce windows)
! N! `2 P4 ~/ p; E. \-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)' j. h) k2 }$ k  X  p& r4 X
-AX = 0912h   (Get breakpoint infos): N( m% t& P. l+ k" ]# r( ~
-AX = 0913h   (Set Sice breakpoints)& C7 F! u  r" |: n* J: R
-AX = 0914h   (Remove SIce breakoints)
+ v- t( I: ]4 O4 {! U: ]% f3 X# A4 m! j9 {( }7 X2 t# y* m# {7 u& k
Each time you'll meet this trick, you'll see:+ c% h: o7 k( q1 `4 }) M
-SI = 4647h
, @" K; G# s. J9 D7 q  Q/ |-DI = 4A4Dh
1 m$ x4 c3 ], u; t; n* l) CWhich are the 'magic values' used by SoftIce.6 e' B! A. D8 M2 u. T
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.: a+ W% _: j- h9 S
" _: N- T: k7 v5 U2 o& K
Here is one example from the file "Haspinst.exe" which is the dongle HASP
, t, g- @( `+ ~0 C, M0 R( n# iEnvelope utility use to protect DOS applications:7 H: t+ J5 A. N( D

& o) N7 E5 b+ W6 i; F, |8 V
7 [5 N4 D$ M; e4C19:0095   MOV    AX,0911  ; execute command., Z8 t% l. s+ q$ }6 ~
4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
* ^! ~# s: F6 y) Y) W4C19:009A   MOV    SI,4647  ; 1st magic value.9 [, Z& K6 \; U8 H# W$ R( z
4C19:009D   MOV    DI,4A4D  ; 2nd magic value.
- ?, G& ]9 ]1 @4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)6 r; T' |# C0 E2 g# n
4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute4 C7 D0 v+ [0 z; M4 _3 f
4C19:00A4   INC    CX- W$ M, z3 z9 ?2 Z- d/ h5 ~
4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute& F2 x6 i" m1 Q# |5 \- J
4C19:00A8   JB     0095     ; 6 different commands.7 r6 P: b. o2 M/ o- K6 ?  A5 L3 B
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
# {) y1 }( {# Q; k/ h4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)8 _7 }% a! E) ~9 n( s$ `6 Z* |
* S1 W2 T( z* p3 B% M# a/ F
The program will execute 6 different SIce commands located at ds:dx, which
* b# c8 n5 ^: ~6 gare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
; N4 C8 a5 X0 w6 d, S# @8 O. k- s3 E9 a% ~" K& v8 ~9 v! A0 r
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
9 I# X/ z/ T9 f( u# O$ d___________________________________________________________________________
; K) s0 R* l9 W7 y  T/ y1 `5 [- k1 L/ e6 W- J

, @' R2 e6 j& d, rMethod 03
" x( N1 P1 O2 O+ _=========7 P+ z! W! e- M3 F% ~$ y/ k

( P! l' h4 ^$ P% E6 L6 y; r7 wLess used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
4 Z6 f% _8 O* V# c! M* p9 |(API Get entry point)3 r4 v9 R) L6 \8 _9 P8 h+ `
        + b  c& z3 x5 H/ x

2 a, D( a( _, R# `* K' m( d    xor     di,di1 v+ m: v- e* b  c: I4 P
    mov     es,di
4 O# r  F4 [7 j    mov     ax, 1684h       , S( q1 }7 P; w) |
    mov     bx, 0202h       ; VxD ID of winice/ u* g3 n' R/ E+ _
    int     2Fh3 \7 P) u/ d9 n4 K# ~8 x
    mov     ax, es          ; ES:DI -&gt; VxD API entry point1 r  h- l/ }" G5 Y: N* ~  K* ~
    add     ax, di
" c# y- \% _( l& y/ Q# k4 u$ B    test    ax,ax7 }* U5 U5 Y/ `- T, y
    jnz     SoftICE_Detected
- `  u" R+ z* y4 t( C
4 {" C* g: H8 g' s. |___________________________________________________________________________
$ ]' Z9 j' L* p# ^1 `  {5 P$ H) f6 m6 i& o
Method 04
2 d( S; Q: [& g  V, j" X3 t% w, t* ?=========
0 _; ^! y7 a3 P  |0 W% a  N% m. Z# h  L: Y5 w" b& `
Method identical to the preceding one except that it seeks the ID of SoftICE( k1 h% ?9 p7 Y! b: F0 r" k' q0 P
GFX VxD.
0 O) E, ?$ h9 ]5 G
; O8 P4 X' J2 \6 l& N, L    xor     di,di
$ H7 K- V9 d' n; u4 R8 G2 o    mov     es,di3 t5 ~( [  e1 ^6 m( K
    mov     ax, 1684h      
0 i" F! S1 r2 w3 S. Y    mov     bx, 7a5Fh       ; VxD ID of SIWVID5 j4 Z5 W# I- t+ E; |' }5 r: b/ g
    int     2fh
/ q3 w; L2 {; U+ L    mov     ax, es          ; ES:DI -&gt; VxD API entry point7 v" Z5 i$ |$ ^+ g* r" }8 A
    add     ax, di9 Y. `2 n) p! {( h
    test    ax,ax
# O% k" Y: A7 F% ?0 j/ k9 k, g    jnz     SoftICE_Detected( ?; g( ]$ P# U( J2 W$ k8 [
& D+ W' E1 V1 ^! q" }8 h7 d& q) Y3 `
__________________________________________________________________________! h( x( j5 j$ \1 k/ b

$ p8 p$ Y' K( u! P4 \3 Q
& ]7 y# w7 d$ K6 i- }0 ~! {* nMethod 05
; L. `$ M) ?% I) Z7 q' {=========
7 b1 c: j* ^2 x: @
5 _" t6 n* o3 O7 ?Method seeking the 'magic number' 0F386h returned (in ax) by all system2 ~0 Q' l8 D' M, s* f% H# \1 a! j
debugger. It calls the int 41h, function 4Fh.
7 t: s$ ?1 v! v) q6 {+ j+ X$ H# cThere are several alternatives.  ( w2 Y# O( E1 i; q, `1 S  P

5 Y5 r( B+ x7 [The following one is the simplest:
5 }, F% k4 j3 j' G
* \5 S/ D- n  Q2 N: r    mov     ax,4fh
* k2 z' W, D  o6 [8 |" s) Z    int     41h: l; C; A4 F/ P. A* X1 _7 S
    cmp     ax, 0F386" a% O3 z; v3 D1 K$ {
    jz      SoftICE_detected/ _. X2 T  j! g# e3 E
1 [) |: |3 Z5 j( g* r1 B+ N

  h$ S, T5 k* @( ]. M+ `Next method as well as the following one are 2 examples from Stone's 1 U$ o) I$ n/ @$ l: _0 u
"stn-wid.zip" (www.cracking.net):
! {; j4 |: D7 p; Y  I, x( T: M" a0 ]
    mov     bx, cs9 y. w; Z1 V# ]  h
    lea     dx, int41handler25 ~& J' i2 Y/ J$ K4 P: Z
    xchg    dx, es:[41h*4]
" y6 k  t, o" `0 o! K    xchg    bx, es:[41h*4+2]4 U8 H& Q" A4 @, C8 C) P
    mov     ax,4fh
7 F) k, p5 ^2 Y8 `    int     41h
6 D, X% }- s  k- E    xchg    dx, es:[41h*4]
# D* a: D* o7 p    xchg    bx, es:[41h*4+2]
- s8 C- [9 q; U+ y( U# Z* {& }/ g4 i    cmp     ax, 0f386h: N9 W- j( y8 E# s6 R3 \
    jz      SoftICE_detected
' A7 ?2 c# k% d$ o: U) e" K4 }% U
/ M; x/ H+ t% f# J* fint41handler2 PROC
7 F+ \3 p8 i7 Y6 j  v    iret
) J9 f, {( J8 e4 K( p$ kint41handler2 ENDP6 c5 z% H2 P, B1 @& \
/ B  B- d( L& B) X5 L) A7 j# V

6 ^+ G- t$ z, [8 H# Y$ l" O_________________________________________________________________________
; v# \; V$ L0 i* L
! X4 N4 y2 M7 f! i  c- h, ^4 h
: i4 Z6 ?& L4 ]5 ]$ _Method 06
; O3 f' z0 S( G3 B5 z=========7 k9 Z- [1 S2 z5 {, v/ L  ?9 R

( d* i7 p! V+ x8 l/ P" i  P) u7 E5 ?- H+ n
2nd method similar to the preceding one but more difficult to detect:% N$ o! t% U! I% k$ `( z
+ P; ?. s. W( F" K* y5 X% |
! N9 k- w& S$ W) _9 o7 V1 ]* p
int41handler PROC' ]9 b7 o# n5 L( `
    mov     cl,al
. i3 G- G4 a0 ]8 ~- s+ D( ~    iret
% c" N0 {! G( `# @int41handler ENDP$ D& |% k6 \! a- `
% D, G9 B& A( N& B: j9 @
1 e; P- d: c' O, d
    xor     ax,ax
9 J9 o- ^8 f7 [4 f3 j  a6 ]    mov     es,ax0 P2 z2 W# w5 \1 H9 u
    mov     bx, cs
7 J' k5 w# {/ A6 X/ I/ q3 o, u8 }    lea     dx, int41handler
+ A! a& n/ C+ ^5 S8 k/ k    xchg    dx, es:[41h*4]
  |8 W: `8 E- P( _7 ]7 I8 Y; O. ]1 B    xchg    bx, es:[41h*4+2]
5 }, I$ w/ t" L! ]; |    in      al, 40h
2 g1 [0 }: I( c- Z% b' n. y    xor     cx,cx
- w2 z5 p# E2 r/ ~' G& L    int     41h& |+ S. w) k; o: r2 b3 A% e
    xchg    dx, es:[41h*4]
$ S2 X8 V8 P1 [7 `" y! |3 B    xchg    bx, es:[41h*4+2]
# i, `6 o! n7 ~* n% d5 ?. k" l  }    cmp     cl,al* D# w& O- \/ `4 t, v
    jnz     SoftICE_detected% l) F) X5 J+ m" b+ n, F

# O; v. X) S; W0 \  U_________________________________________________________________________& Z7 t9 {' l1 Q$ g

5 h: f, X' d* N$ hMethod 07
+ [2 X. A. O/ |6 e- V=========
0 V! E: E8 F$ u1 M, o4 _$ t9 U% I+ _# @# ]) l0 W
Method of detection of the WinICE handler in the int68h (V86)
3 h6 p7 h) p9 c/ X2 @4 V
0 i. ]# B9 W2 U; B7 F  f    mov     ah,43h
5 {+ e6 R* n0 z2 u$ G+ ~2 M9 {5 F    int     68h& U; @9 k: q% Y2 U4 N1 k& T5 F8 X
    cmp     ax,0F386h
" W5 }- c6 n  P    jz      SoftICE_Detected
5 c$ m& `/ j* H# y% ^
; \6 t; E5 N( v$ \$ l4 e  b" m6 W/ K3 H& ~6 V5 ?
=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
* s9 L9 {  b9 \2 j# t* ]( d+ b   app like this:: A/ `% R: s, U0 {5 l0 n

6 p. l8 ^( P) m7 Q- O& Y7 j   BPX exec_int if ax==68: |9 N6 g$ v4 ?" ?. s  e
   (function called is located at byte ptr [ebp+1Dh] and client eip is
$ s0 J" M$ ~- j* i   located at [ebp+48h] for 32Bit apps). d" j* |$ s4 `
__________________________________________________________________________
: V9 U3 x$ c" M+ a8 O5 T# O/ |# v% ]8 Y. }
; E; v4 w# O: c. ^* ^
' h) Z' {2 c8 o5 e' q1 \2 B9 g8 rMethod 08
" ^- R3 h  a+ c8 k=========
. q1 F6 G+ B' n6 \& G$ ]" a9 {" e5 N0 a; M! B" u1 z
It is not a method of detection of SoftICE but a possibility to crash the  D+ a  @+ O3 y7 Z5 b
system by intercepting int 01h and int 03h and redirecting them to another
4 v/ R- X' v  {) Droutine.9 I. M7 v/ M8 @. X
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points* R1 y* ^, i" K4 r3 n
to the new routine to execute (hangs computer...): C5 [8 H# c) ~" `1 ~5 v$ g1 \

/ W& |* ~& A1 S+ Y; K# y% _) ?    mov     ah, 25h* O, q8 y; i8 C
    mov     al, Int_Number (01h or 03h)" z. n' H9 Z& J% W. ^* v  w
    mov     dx, offset New_Int_Routine# E  v, j* ^4 X6 ?0 P
    int     21h* g5 p) G3 }% P2 A" V; \# o& [5 \

, C2 i' H& a0 Y* n. X__________________________________________________________________________$ i% l9 L! l! c6 F; p& \$ z
* V6 d$ ]3 [8 i9 S; z/ k5 J
Method 09
0 i3 c0 P& Y% N0 V=========
8 o9 G5 y4 @; M- e* s) q" S. E' m# O8 Q# `, O2 K
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
; k0 B3 Y) ?, ]; L$ R5 Q+ [performed in ring0 (VxD or a ring3 app using the VxdCall).# ?( Y% X% \  A0 w) V. C
The Get_DDB service is used to determine whether or not a VxD is installed4 F. r6 U4 R+ m
for the specified device and returns a Device Description Block (in ecx) for3 ]+ r: \/ f. F$ ?* y1 p
that device if it is installed.
2 g2 h6 n& X* l& L0 M  h7 Z% S/ W7 w+ f3 L
   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID( \) s' X4 e9 [0 j; |  @! ]0 z
   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
6 T8 n+ a( y  b. p3 M9 p% `   VMMCall Get_DDB8 {6 o, x9 Z  m2 E6 k
   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed
' K% y9 a/ Z9 y( }( Y* L- u+ ?$ t- u, I3 k* |' @
Note as well that you can easily detect this method with SoftICE:
+ W6 X* F* a5 A% V' j   bpx Get_DDB if ax==0202 || ax==7a5fh
3 R: C5 b- t1 Z7 n  `2 j4 {1 a8 s. h& K* a
__________________________________________________________________________
9 {) X9 u/ \8 a* Y- S. g4 ^  V/ `
Method 10
. f$ f: X2 c* P. C=========) R5 {6 l& \; t- K

: [' D+ V+ p& G=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with. U: V; Z% d3 S& Z( \
  SoftICE while the option is enable!!
) Y9 _6 b5 a4 ?4 i7 T  B& u! ~/ g7 Q  H8 k# K4 w% r4 ]  R
This trick is very efficient:4 I/ m& s  q) ?5 E$ n* p0 g
by checking the Debug Registers, you can detect if SoftICE is loaded( J: b6 n# ^2 Y4 O
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
* S6 f4 s) B# ithere are some memory breakpoints set (dr0 to dr3) simply by reading their
9 i7 [9 N% K' I, M/ W( r( Z# Dvalue (in ring0 only). Values can be manipulated and or changed as well/ \& |$ n: p# x" l1 K
(clearing BPMs for instance)4 j/ I3 e+ y; S

: a) e  Q6 F6 \2 c6 ]__________________________________________________________________________( _- @' E+ ]+ Z/ E

& y' A3 F5 P$ f1 t$ A5 YMethod 11& V6 A& H# L* g1 l
=========0 V, e, B0 i& ^

9 O  C" k' v) b3 t# o2 G" sThis method is most known as 'MeltICE' because it has been freely distributed3 Y. I& t, P5 Y& o7 w2 W+ M* {
via www.winfiles.com. However it was first used by NuMega people to allow3 \0 L2 M9 m% \6 P  c
Symbol Loader to check if SoftICE was active or not (the code is located4 I; ~# N0 R6 v$ p
inside nmtrans.dll).4 |1 |  R! p& B3 {+ S
' _' b* _$ O; Y. n; ?. y& F  L7 T/ @
The way it works is very simple:  W5 A, _; b1 r$ p! ]# H: ~
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
1 B5 }- S: [' a4 c1 O4 I5 @WinNT) with the CreateFileA API.
- U3 ?: L- t0 @9 ?9 T- r2 r; O2 C2 K  Y  \
Here is a sample (checking for 'SICE'):6 {, C# _$ U% d3 J7 {; v0 l

! p0 j! ]7 Z+ p1 X/ tBOOL IsSoftIce95Loaded()6 D$ w& B6 O5 X0 F' K( E9 }
{
. y. T  f4 |4 s  m5 }& m   HANDLE hFile;  1 l7 ]+ g3 D$ j7 @- p: [+ k
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
9 s" |$ W: R& k; r                      FILE_SHARE_READ | FILE_SHARE_WRITE,
  s% N0 a; u2 G5 y0 W& }4 @" z                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
! T. ?0 ^& {" Z5 Y% h   if( hFile != INVALID_HANDLE_VALUE )/ j; j1 F. L( ]% c% [  l% F6 |
   {$ y8 L# H- y& A. U+ f1 \
      CloseHandle(hFile);3 J; g8 @* O- J: v7 U
      return TRUE;9 K2 z. c2 y2 C. ~' E
   }4 X5 a! |% g& a+ _; n! }
   return FALSE;$ ^# @) y2 X- m  t7 R" f  c. D. F) ^
}
. h0 l/ B- U5 c: c$ W" Y2 T8 z8 r3 g- `9 h- A6 Y/ a9 c
Although this trick calls the CreateFileA function, don't even expect to be: F' p3 G- i! E5 s2 z
able to intercept it by installing a IFS hook: it will not work, no way!2 S- l$ U' a+ i9 n8 ^2 G
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
5 W& R3 u9 S, {# jservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)7 K1 Q" Y9 N6 V( {. L$ o
and then browse the DDB list until it find the VxD and its DDB_Control_Proc" E8 q: Y2 C- I
field.
( ^, z% h8 S, k7 D0 ]In fact, its purpose is not to load/unload VxDs but only to send a - K3 J0 J0 x* m1 ?3 J
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)+ Y+ D8 m! [% h  j/ G
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
" |3 l7 [# M+ _- s* \' ]5 V1 k) g& [to load/unload a non-dynamically loadable driver such as SoftICE ;-).
& o/ \! Y! t4 W* n: ?* CIf the VxD is loaded, it will always clear eax and the Carry flag to allow- l( x% \5 Z( s2 l- K) W, c
its handle to be opened and then, will be detected.
  [1 N3 V/ b! ^$ `; AYou can check that simply by hooking Winice.exe control proc entry point
2 q! z+ l' G; M$ g8 i: ]while running MeltICE.
5 n- ~" f: q5 x; A9 w, g5 M: ]* ~8 ^$ }$ R

7 @" C9 m3 Z5 b/ q5 q! y, h/ B% F  00401067:  push      00402025    ; \\.\SICE
' [, Q5 s& e7 t2 W8 g, L  0040106C:  call      CreateFileA( l, D* L: _. Q2 ]
  00401071:  cmp       eax,-001
" L4 a* T8 ]2 V' u  00401074:  je        00401091! s" ~  }. X: X: P! Q
7 `2 i- m* }2 p( \- q' Z/ x

  ?' b1 U5 z- @; S1 ~There could be hundreds of BPX you could use to detect this trick.
! T: ^' l5 f1 S* X* x# K  y-The most classical one is:. ^, c8 b$ I2 h% l1 z9 `, Z
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
( I0 U6 ^2 f2 t4 j/ w( P    *(esp-&gt;4+4)=='NTIC'
: w: n: ?6 ]5 ~- P
6 g. I# G% I) s; }: h-The most exotic ones (could be very slooooow :-(! H* k4 X" A% s  F8 \4 k
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  
! m9 T  K- u" A: x3 j0 K  W+ E     ;will break 3 times :-(
1 C0 |5 q" q! ]6 S: D0 N, G5 }4 k9 Z: o8 h
-or (a bit) faster:
! c7 B( u% L. e4 Q; J' D   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
$ T+ {* D, l. a4 ]2 y- Z7 F9 F
* \% O' q& p6 Y% T   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  
* B& Y3 x( @) g9 n' }3 u) p9 I2 I     ;will break 3 times :-(
# V1 z6 D. w. J" {5 w2 Z  }1 U3 R9 ~; g& k
-Much faster:
* E7 F" C1 m' g9 Q7 I/ h   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'# O5 x3 P) O' {+ {6 s
/ V6 n0 ~! T5 h5 F" }+ V( Y5 M
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen% l9 ^1 D, c5 r6 u: d
function to do the same job:( K5 O- p6 j4 E1 ]
# d- J8 Z9 `& Q$ j. v3 M
   push    00                        ; OF_READ/ Q/ h% b8 p# ], G( f5 B
   mov     eax,[00656634]            ; '\\.\SICE',06 Q' p, n% K5 v& n
   push    eax
7 v/ B3 }( {/ Z; `$ F; \; U   call    KERNEL32!_lopen7 l: p7 |. I0 s* U# X. I) ~" L
   inc     eax
% _. s$ P$ y" U, s+ E2 Z   jnz     00650589                  ; detected
5 l8 T+ J9 g  c9 z) [8 l# \   push    00                        ; OF_READ
! G8 R( k7 |6 n   mov     eax,[00656638]            ; '\\.\SICE'
5 M8 W* a% `( A% c1 |" d   push    eax
# B: f$ {4 K, s+ j! G( d1 v/ G# y   call    KERNEL32!_lopen
6 ?  E$ P" T% V: P2 o   inc     eax  V! I- n* |( ~2 g* C
   jz      006505ae                  ; not detected
" Y* M0 d0 O5 o- V% i$ r4 w8 r7 r8 e4 |/ U

9 q& B4 m7 \# S. m$ I__________________________________________________________________________4 X) L  c- o3 ?+ k7 @7 n
% ]1 W# {& c# ]7 A% u; l
Method 126 m* a' e! d- w# k7 Q7 c6 \
=========
* A  n! e- a7 y! {* R; Y+ L- L( |* Q" T* w1 G0 E4 W
This trick is similar to int41h/4fh Debugger installation check (code 05; }# Q+ D$ A5 G3 c+ R9 z) e% P! g- |
&amp; 06) but very limited because it's only available for Win95/98 (not NT)
! P, t% g' W& D4 t2 J% X; }as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
/ l& Q: T: k: f' U2 h
9 x- x" z  J8 e+ h( ~' B) P3 @! G& i- r   push  0000004fh         ; function 4fh
- S& s' s+ D9 ?% B& g- c   push  002a002ah         ; high word specifies which VxD (VWIN32)
  r6 M, i+ b+ c( y4 s                           ; low word specifies which service
0 X; M% |7 S$ W, K2 V                             (VWIN32_Int41Dispatch)3 M/ J5 Q! S9 [8 N
   call  Kernel32!ORD_001  ; VxdCall
% P1 ~) c, q* b7 V1 z, a$ _! I9 s   cmp   ax, 0f386h        ; magic number returned by system debuggers& t8 K! C- [1 O- S/ F! n
   jz    SoftICE_detected9 U$ b4 b* I  I) a: |  h

' n5 k0 Q: Q1 }" ^9 VHere again, several ways to detect it:
9 ]8 D0 _% c! K7 R" B
( Y, n0 g  ^) h$ V- }    BPINT 41 if ax==4f) h9 i, q% I% |7 ^( o

2 U, K! E! ~: Y9 v    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one4 Z2 E( o' ^( t- i' C0 Z

. T  D' r; C5 s: |7 ~7 k9 Q    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
' `9 S  e, i3 A  W
  b$ W0 X* ~6 S. M+ D    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!# A9 E/ m- g+ ^! y7 m% |

) ~, n; g) u& Q4 K: ~__________________________________________________________________________% C5 n( I0 J2 |4 t2 Y) _7 v: `

1 Y! w( W+ x! y6 aMethod 13* [/ E, E% d, ?2 V' F& t6 ^2 {! H
=========  s6 G9 p6 V6 S
3 @5 L8 m) V2 K# W2 o/ }
Not a real method of detection, but a good way to know if SoftICE is
( c4 R% d9 B4 w3 m0 H- Vinstalled on a computer and to locate its installation directory.
" E" z* X$ R* m0 ZIt is used by few softs which access the following registry keys (usually #2) :
3 C3 {% n% u' P- g! m6 k+ \, I$ h5 B2 p3 d, f" H& `! e
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion* `) R& I2 G; D: [
\Uninstall\SoftICE
' N& ]  j  z' U  }+ O- O. `1 m-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE! Y3 e. E- N% k$ j7 m
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
+ W( {; l5 ~  I7 Z\App Paths\Loader32.Exe
8 w( [8 y. c+ t
$ j+ _. R$ X; ?  Y, U% z: r1 z& _5 i$ q0 w0 P8 V5 k6 a' O
Note that some nasty apps could then erase all files from SoftICE directory# @# z' r  `7 d. S1 w
(I faced that once :-(* S, V$ o0 x/ N/ a! ?

' X  j. k( R+ I$ vUseful breakpoint to detect it:  @0 t  G/ C6 i( d8 g

' s4 X5 Z* h8 ^% w     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
) B( |+ q9 ]. Y1 f/ n4 K+ p, W# e6 }+ M+ J& q: h# x  f
__________________________________________________________________________- L- Y  ~7 K# A7 u2 o0 D( S- o0 G

/ u  ?% G+ I7 N9 s" h. k$ H2 V  }& E6 @' y% P- Y8 @% d0 F, ]! U1 _5 l
Method 14 % f' y" S! v9 m% R6 O8 u
=========' a. K% B; [! ?2 ^2 v0 z
6 t" M+ [/ R" p% a0 t) n, R
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
6 K8 l. f3 C* R# his to determines whether a debugger is running on your system (ring0 only).
3 v; P$ q- @/ \3 B. U" w' M$ f7 t  T/ f% R, T- O  J
   VMMCall Test_Debug_Installed+ s6 p) _- M' ]+ u: A; f5 A1 Y3 ~
   je      not_installed9 {' A: Z# _$ W

+ O) I$ g0 ]- C8 B( u$ D  AThis service just checks a flag.
  c1 ]8 E6 \. p</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关注公众号

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

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

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