About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
7 r7 w7 U: {- w5 {4 \* k* N<TBODY>
9 u, K5 A- ~* E) I2 k9 }) X# I; L<TR>7 j$ V2 \4 d' S* n
<TD><PRE>Method 01
8 e  h8 L# }) j- s=========: G* _" e6 a9 ]8 O

2 g  H1 n% U. v5 IThis method of detection of SoftICE (as well as the following one) is
; r5 i+ Y; _' l( S* t1 Wused by the majority of packers/encryptors found on Internet.
# M0 i$ M9 ]; f9 W3 U' T0 QIt seeks the signature of BoundsChecker in SoftICE
/ D  v+ c" g  n* ^' ]- r
" i- D2 d. K7 Y- w/ A5 |% H    mov     ebp, 04243484Bh        ; 'BCHK'
/ ^, J" K. T% E) _    mov     ax, 04h/ U( o4 I9 @& _! m
    int     3      
& M, f! q0 s7 E, Y  Z/ c) m    cmp     al,44 N6 h5 W" K4 L' V& @8 F0 T
    jnz     SoftICE_Detected( x: i) q' E6 F. N7 B7 \
4 D" a! y8 v7 u! s
___________________________________________________________________________
3 ^  E+ y& P, I6 }* S! ]. T$ W: ~2 Q, l0 f* n& \( e
Method 023 N8 j" H* V! n1 Z/ o6 N$ Y( F
=========3 D* Q/ W( I- Y! a5 E0 ?6 L/ f# m
' J0 |2 O4 G& Y5 \9 B; A; w
Still a method very much used (perhaps the most frequent one).  It is used! P% |( f5 Z9 L$ T! _4 l# U/ D
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,8 K* w: ?( e- \. f
or execute SoftICE commands...
! t4 v+ g7 s) U8 c* }6 ~  T! m& n/ CIt is also used to crash SoftICE and to force it to execute any commands1 N; r2 l# d, n4 r  {. V& q/ r4 d
(HBOOT...) :-((  
) D+ D3 U) K8 B+ y
$ c$ Q/ p0 b* D* B, K0 G2 \Here is a quick description:/ w9 W; _- D2 u, a! E: p5 `
-AX = 0910h   (Display string in SIce windows)
, b- B/ j4 U3 w8 _-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx); x+ }6 n! m, F$ y; r7 A
-AX = 0912h   (Get breakpoint infos)
6 S/ I+ L7 O& u% E) O3 O-AX = 0913h   (Set Sice breakpoints)
4 H3 d* Q; Z, D( D-AX = 0914h   (Remove SIce breakoints)* y3 F5 m) b5 G

5 b; }- B' T$ R! w$ G0 OEach time you'll meet this trick, you'll see:
. ~0 z/ m& {$ Z2 o- f-SI = 4647h
- I+ ~7 n2 w7 M" s$ ~  g6 @-DI = 4A4Dh
0 N# A: P: N  OWhich are the 'magic values' used by SoftIce.# m! I( V% c1 I4 g7 y  U
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
: I7 Y6 u/ t/ U
2 ^6 c: C+ e2 O, [" p8 n5 bHere is one example from the file "Haspinst.exe" which is the dongle HASP
* z2 k3 Z+ I) n4 R( `2 }7 ^Envelope utility use to protect DOS applications:
( \+ U  ]9 n1 V! F8 u3 W; O8 v5 J, K. \2 T6 p% P4 {

+ z: P) U* i+ T! M3 p. R) w4C19:0095   MOV    AX,0911  ; execute command.$ }9 f( Y. I6 p' [  }' C" L
4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
4 s& f, @7 n- H4C19:009A   MOV    SI,4647  ; 1st magic value.
6 [! \8 Y! Q; M) M; {6 w4C19:009D   MOV    DI,4A4D  ; 2nd magic value.
3 |* F/ a% |8 |) P4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
5 f- V  w6 }/ T. X  m3 w. G4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute
0 q9 K1 Y2 k6 w# v2 w- o4C19:00A4   INC    CX
! q; Q0 b7 h: O) E; \8 J  u4 n+ M4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute- r2 G9 M  D) x" {/ X
4C19:00A8   JB     0095     ; 6 different commands.
4 `: e1 n% h. T- O" E4C19:00AA   JMP    0002     ; Bad_Guy jmp back.3 ?4 N/ `4 r  {$ J6 l( I( L2 ^
4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)
  C7 [1 v' Z+ L7 s+ k8 l3 T, s* G6 H5 g0 r; ~
The program will execute 6 different SIce commands located at ds:dx, which: c8 y9 i/ n$ @' e, J! ?0 e8 ^( ]
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
, e3 p  I3 ]  o' ^& M3 x1 G6 C5 C5 g6 ^" T1 N
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
+ n8 H. O) f& s6 ]6 Z# s/ X___________________________________________________________________________1 V0 \0 d* B; @; X% }3 F

# c! D% _9 W9 P% [7 d/ ?6 }( I, V% d, N
Method 039 \  C4 x# l6 m9 ^( d
=========
! _7 v; N, @9 \5 z1 v$ O1 a4 ?4 @
( v' F$ F" m4 \: kLess used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h) o3 {! j% V9 |  v7 N
(API Get entry point)
0 |0 h4 E: [5 {3 V9 r: ]! p0 m        
( J% f8 i$ S7 A5 [1 p# A: K, w2 R. B9 b% P$ i, ]# J( m$ t
    xor     di,di! q1 @$ h3 D/ ^: q- |
    mov     es,di1 }2 G& \$ i0 d/ j5 c
    mov     ax, 1684h      
0 o* W1 W4 g0 f+ y' h3 C" y4 H0 ~    mov     bx, 0202h       ; VxD ID of winice1 n+ L! Z; T) K  s# r; O' F7 }
    int     2Fh
0 l1 }+ _, C' N5 C9 ~    mov     ax, es          ; ES:DI -&gt; VxD API entry point
4 W1 n1 t+ b9 G$ M; A    add     ax, di
  E  R) ~3 @* S" _8 N    test    ax,ax
0 Q* ^4 T8 @0 A1 g    jnz     SoftICE_Detected: Q1 J) P$ M. U$ n
" l/ L( `9 C% n' H5 C9 X0 K
___________________________________________________________________________: B& R2 `. R0 X
' O  t$ p" v6 J! ?
Method 04( @: T: C8 O, ^( b
=========
1 ?: B, q7 i; |
# f7 M& }: l, ^2 l6 L; m3 ]- B$ ?6 H- ZMethod identical to the preceding one except that it seeks the ID of SoftICE! s) w, b! W0 ?( C# l' x) z4 a/ u
GFX VxD.1 U/ Y# z: w$ _

# w: G. g. Z% u* W/ _    xor     di,di
4 z- X6 z- R8 j: u0 ]1 v7 Z* g% H    mov     es,di( U+ a; p$ y5 Q0 q9 s
    mov     ax, 1684h      
! J3 }% Y( ?2 S1 U8 @4 w3 J    mov     bx, 7a5Fh       ; VxD ID of SIWVID
% Z. _3 |; c( o7 ?% w    int     2fh2 I" v% s7 a- a
    mov     ax, es          ; ES:DI -&gt; VxD API entry point6 ^% H/ q* T: e7 N) ^
    add     ax, di
4 M0 i2 B: G8 h    test    ax,ax
+ ^' Y* `' |+ B! t* m, ~    jnz     SoftICE_Detected; V% E3 s- \4 _9 F% E. A& ^

: ^+ G8 y( B+ j# j4 g__________________________________________________________________________7 B( ^! B$ i: C  {& _( t. M

0 F2 \: j1 }5 m; s. A
' e2 M; V8 s! O/ ]/ jMethod 05
3 e1 z" L2 O* i1 I1 d; j& i=========
  p& j( Q6 H; ]1 Z# ^1 o
' L+ ^8 Z# D* ?' g1 QMethod seeking the 'magic number' 0F386h returned (in ax) by all system6 A% ]- ]/ ?3 d4 c0 ~
debugger. It calls the int 41h, function 4Fh.! _# U/ Y6 h" L/ P/ o. }
There are several alternatives.  ) {) S' o( R9 Y7 ]. m

" h. r, ~' n. eThe following one is the simplest:
' X! G& X+ Z1 v0 ^5 V
, L7 M2 p' R: w, Z$ e    mov     ax,4fh
- V0 _/ E6 {. A: [    int     41h. @+ S# x6 u5 d* v+ s3 a0 |
    cmp     ax, 0F386
% H- ?5 H' c8 _' S    jz      SoftICE_detected" c) p: J$ [' K7 ^4 D
2 w4 Y$ t7 f8 d. a' d3 P' U

/ h0 l$ f& r5 b3 T6 v: p: ~6 {) F  INext method as well as the following one are 2 examples from Stone's ; H/ ?7 b, }7 o
"stn-wid.zip" (www.cracking.net):& I$ C8 G0 M0 |) w' M! s

+ A+ p# r5 k1 O) l+ U1 x( k. q    mov     bx, cs
' J* g) G) A& w( ?: l6 {    lea     dx, int41handler23 z8 U# {& p1 Z4 d2 k
    xchg    dx, es:[41h*4]
  ^4 a: j4 {& M/ f  }    xchg    bx, es:[41h*4+2]& P) g* h) `+ R0 W
    mov     ax,4fh
2 b# M, i5 g5 J4 ]- l1 l/ z; ~! a    int     41h
. W. K1 }; L: s. H( v( a7 O. [    xchg    dx, es:[41h*4]: W% K7 X. |+ q$ Z& c
    xchg    bx, es:[41h*4+2]
- N! M- K2 I% S4 Z& V9 v  S    cmp     ax, 0f386h
- f* X0 A& R/ @. J: N, V8 d    jz      SoftICE_detected
* a% [4 p7 @5 }' X4 ~9 p: \/ k/ ^5 D7 l7 M$ E; D. g2 U9 l
int41handler2 PROC$ L. V+ M$ r/ T& _' A5 n7 w( X
    iret
$ |  H/ q- P* K) C/ c4 hint41handler2 ENDP! g0 ]) O2 e# @! ^/ R' p$ W! W4 u! r0 s

2 x5 c! |. i5 Y( L6 I0 e' e- s, M; i4 q! H
_________________________________________________________________________# R/ l! X0 q* j7 P6 N. W4 ]/ }
- A' T( V* k+ _2 ^- v$ z6 X1 N, c
4 e9 u- F+ `) b9 ]5 P
Method 06- r5 {, I. I4 q; s
=========
5 E1 J2 u5 P  a% C& V, |
1 g0 j: H9 W3 `8 N
3 I" x0 S/ A% T, k$ B4 i2nd method similar to the preceding one but more difficult to detect:  }$ X- H4 ]* ^8 b7 z  [

1 s0 H' z6 l) z# a8 X2 B% p& S" \" l" O3 o5 J! T
int41handler PROC5 T9 a) }. \; J3 k, J
    mov     cl,al
- J' E, l7 S6 D8 t    iret
" X# f! B6 K+ bint41handler ENDP
+ B' }  [& f# r6 F0 l1 v3 g4 @4 \; Y& \9 N8 g+ k- t2 t7 U' D" Q

% _+ I, N& R% Y, ], Z& j9 i- U    xor     ax,ax
, B/ r+ s! r2 q( u4 j6 Q& C    mov     es,ax
) B. ?% X$ x4 _# A/ a    mov     bx, cs
# _) `2 b" u. G# C) A    lea     dx, int41handler
# \: L, f; ^, V( Y9 ^    xchg    dx, es:[41h*4]; r/ N! o0 z* Q# K! G
    xchg    bx, es:[41h*4+2]
$ s/ _) E: z5 d9 M. S, h* N+ B# b    in      al, 40h. }/ E* M: O  f; }& j# I% x; U
    xor     cx,cx  M9 L) S0 C' r
    int     41h
# @5 N' H& w4 j    xchg    dx, es:[41h*4]1 M0 e: _* d$ F" x2 n! y
    xchg    bx, es:[41h*4+2]1 @: y- x( \5 X( e9 m
    cmp     cl,al
+ y& f( X8 {0 t5 l4 D    jnz     SoftICE_detected
4 a6 s% m/ f4 N  `  Q/ i6 g! s
$ M# Y. }* C* I4 y_________________________________________________________________________0 B7 C# A9 H; K, |% Y

) p# g" W8 b9 l; oMethod 07% _) E: i& I8 {% R4 r) P2 ^" Q  T
=========
$ _+ k: I) L  r6 @# h$ A) f& \7 S9 m: }7 b" E
Method of detection of the WinICE handler in the int68h (V86)% h8 S' |" `& W
' D, A# o& ]" e" D3 }  h5 O8 a$ c
    mov     ah,43h
1 x) k' h4 W; s6 m% K: c* R& Q+ ~    int     68h4 Z. e/ k# L  R2 m5 X9 c. V
    cmp     ax,0F386h; [$ @: g: Q+ V$ I
    jz      SoftICE_Detected
9 |# o5 Q$ A$ g/ S6 n( f$ c! I: x% {% c( C6 G9 B& d

$ h: ]$ R# k8 f4 W) V7 D- Y% b9 G1 O=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit3 C: I$ P0 H$ y* ~% U: t
   app like this:- s. R' s: z* `7 M1 i4 Q

3 N; }, F) O3 |* R9 d% m# B- W   BPX exec_int if ax==68
% k5 c7 U% ^0 u! o( ]) ]7 s4 S   (function called is located at byte ptr [ebp+1Dh] and client eip is
5 d% U4 |  O. B, A8 W9 [5 j+ I/ W   located at [ebp+48h] for 32Bit apps)
( v4 G; T: C- M__________________________________________________________________________& ?& P& D& w( o4 x/ A+ b! C1 H$ S) a
2 Y$ R* x. S( K- d/ R

, u0 r* M( [6 ]Method 08
. N) B# ~( {( {# |( t8 H; A=========6 W5 l3 S$ l/ X/ L! g" b4 }

4 J5 |4 t# M/ N, y8 \. `( RIt is not a method of detection of SoftICE but a possibility to crash the7 }/ }3 r$ _$ l8 z0 ^. ^
system by intercepting int 01h and int 03h and redirecting them to another
/ N9 s% f( K5 l  ?  s1 [8 K7 froutine.3 i& e( F/ p/ w
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points4 b) A5 ^4 U4 h9 Y- u0 I  z
to the new routine to execute (hangs computer...)% C' Q/ n8 {6 D: v

4 y! l8 U1 \- u, ?& B: H    mov     ah, 25h* X9 k* m2 y8 m( {. c
    mov     al, Int_Number (01h or 03h)
% ]) j" I) U4 [$ z2 O; A% o    mov     dx, offset New_Int_Routine5 p  J1 \& `0 N7 z  R
    int     21h
( v; c  h) I1 k9 K# W$ y2 m( q( F# ^
& l1 E3 ^# T6 R, g__________________________________________________________________________4 a% M1 G. y  h* c0 V2 g. N/ R" D
1 n5 L; s% ^& Q: C
Method 09" w. b  z, K; W8 O
=========- F6 L; i  {3 |

% F; d6 S3 Y. TThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only+ @! e- U( \/ C& E
performed in ring0 (VxD or a ring3 app using the VxdCall)." q( x0 ?! F5 D' D4 G7 }  O  N
The Get_DDB service is used to determine whether or not a VxD is installed
6 L4 U7 R. x1 c/ ?; Gfor the specified device and returns a Device Description Block (in ecx) for; w0 ^! W/ W; i% C, h! j
that device if it is installed.
4 n, k8 g+ ~. z) X9 N% v, b" L; t
- T* P# U9 R% _6 Y; f  D0 K2 Z   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID
" c* \. o3 a( {; Q" S, {- K   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
( E3 `8 ^/ r+ ]   VMMCall Get_DDB+ e/ R6 {3 y% {! v1 q
   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed
# M7 }* K, ~/ G- ^$ s, {" Z+ q
( T0 W! f% ?4 ^- A  GNote as well that you can easily detect this method with SoftICE:
# `9 c8 W/ K, |/ A$ `: a   bpx Get_DDB if ax==0202 || ax==7a5fh4 O: s9 p: g5 b, E

. X! {1 Q1 ^1 y' c__________________________________________________________________________# }& \5 C: }/ n+ E+ v7 o  H

$ p. B0 N; e! R/ C- qMethod 10
# {2 t% S; r3 q  q=========- P, n9 X4 _, ?' [; m* M* o
! N$ d* a- a! T5 ^1 w. x
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with
8 `2 R3 H/ L! _: ~5 ]( E% Z+ c* {% q  SoftICE while the option is enable!!
: L, i4 R( ?9 X
* S  g7 e) X5 r# C. RThis trick is very efficient:
$ b& a, ]- `( O, G( t% \" k1 Bby checking the Debug Registers, you can detect if SoftICE is loaded
" E( _. o& k4 D- ~, J(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if( M# J: T2 G3 [; Y  Y- l
there are some memory breakpoints set (dr0 to dr3) simply by reading their, \5 N) u6 a; b4 \6 G+ k3 p
value (in ring0 only). Values can be manipulated and or changed as well
1 f& K, D8 {3 h$ x9 J9 S+ V(clearing BPMs for instance)" S$ S# U- _% Z# m- K

. |  c! }2 a2 U  ~# J0 I6 S__________________________________________________________________________$ L2 P$ s' F6 Q' E+ _9 Z0 }; Y
  W0 b, F4 c0 S, W" w& @
Method 11
5 }& x- l* j6 m  x) _0 \=========  T/ K* P5 M" }- x0 R9 `% J! \  X
7 l: I3 L7 O& c4 X/ ~
This method is most known as 'MeltICE' because it has been freely distributed
) ^. s0 w1 I! j' U! M$ q# a7 Kvia www.winfiles.com. However it was first used by NuMega people to allow
4 I* }8 `% y* `) o) B% C% ?" |Symbol Loader to check if SoftICE was active or not (the code is located
2 |/ e' e" F0 L$ h6 }" ?' Jinside nmtrans.dll).
" b" \) X. r/ u0 e0 P/ K% `( F+ |! g$ M8 \7 a+ g$ B. j
The way it works is very simple:
. k: m3 {/ A& I9 X7 HIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
7 ^9 r0 f! S; C. `7 O# J7 hWinNT) with the CreateFileA API.( F  i9 A6 s1 E- j% _$ X* U
- i7 @) P4 i. t/ {
Here is a sample (checking for 'SICE'):  f% c  r" z5 H& e1 o

9 a4 }1 S) Y# ~. y% l& b8 nBOOL IsSoftIce95Loaded()
% Q7 p; e, Q2 d{
* x" W) Z- e& {! P4 F   HANDLE hFile;  7 _! R7 s8 Y, m# J$ _1 ^: n$ V+ {, r
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,  l3 n7 X" B# |, G3 ^2 e+ ?- j
                      FILE_SHARE_READ | FILE_SHARE_WRITE,
' T/ ^3 a. @1 \  L                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);* Z+ G' _4 {/ s( c
   if( hFile != INVALID_HANDLE_VALUE )
. Z/ c# x: [* ~# T& t# j# \7 U9 ?% _   {
' t4 r; K& v& t6 T      CloseHandle(hFile);
1 a6 l+ h* a  O4 t9 m  Q9 C      return TRUE;
- p2 H2 X, ?6 r4 v$ L, ^* b( Y, l3 r   }3 x+ t3 X. N: M! N3 b' T+ @
   return FALSE;0 z  s: q9 n0 ]) N& Y
}
* l- e' h: a' s! g5 j6 i5 l3 b/ W" `+ E  [3 C$ n4 W
Although this trick calls the CreateFileA function, don't even expect to be
7 y8 s; q7 G/ l/ zable to intercept it by installing a IFS hook: it will not work, no way!. i* v# O) n, P# D3 u, o
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
3 E5 y0 Q4 z, ~# bservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)6 u3 E# b# e( n
and then browse the DDB list until it find the VxD and its DDB_Control_Proc- R0 ^7 h1 s4 ^" ?" J" i
field.8 u8 Z6 \* {% s4 A! ?$ N% {
In fact, its purpose is not to load/unload VxDs but only to send a * _( P; N- s" ~: C) }, k
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)0 p/ k- Z2 N) o* ~3 I
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
# b& a0 E9 H& J* i) H9 S6 ^7 ?to load/unload a non-dynamically loadable driver such as SoftICE ;-).- T, h2 H& c9 e) g/ r
If the VxD is loaded, it will always clear eax and the Carry flag to allow( X. [1 L3 D9 {2 w
its handle to be opened and then, will be detected.
& A8 s4 c; [! q& s) `You can check that simply by hooking Winice.exe control proc entry point  y, h1 {" `3 x% Q
while running MeltICE.
* M/ ^6 \2 E( @! h$ }7 c' A' d2 J" o. k: v3 y5 H

' \7 x- u# M9 Q; d  00401067:  push      00402025    ; \\.\SICE: }* |2 }8 M7 \0 Z' p
  0040106C:  call      CreateFileA
% c$ n# {0 w( d5 ^! r3 X3 F  J  00401071:  cmp       eax,-001
$ |! x: F6 d" B: S+ J' k4 M  00401074:  je        00401091
) D0 H8 b" {9 {
5 K8 a$ F( F+ t' e
3 {2 K* N+ I' q0 h8 hThere could be hundreds of BPX you could use to detect this trick.; `- d2 g" A6 K6 B
-The most classical one is:8 V0 q$ r' |5 o0 m) Q  _
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||& o; _( Y/ u; L/ }( L
    *(esp-&gt;4+4)=='NTIC'
: E4 h1 i: S: n$ o; _2 ^% D0 n$ k- T
-The most exotic ones (could be very slooooow :-() c0 ~' D1 H. ~. H7 _$ Y/ z
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  / A3 _% Q/ v$ W
     ;will break 3 times :-(
) ^5 B6 L' K% U& a$ Y# H( _
% Z' C2 ~$ }/ g* N, S: Q) ?9 P-or (a bit) faster: , ]( J% o; O5 R& B8 b; f
   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')+ r9 |; z+ [  V* K6 L6 b1 \

) N( T1 p2 ~; Y- W" h: h   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  # `( a/ \' F7 g, U, E* w
     ;will break 3 times :-(( p+ b! D0 J+ {' J

) f8 A  X" B  Z; A' H-Much faster:
! i9 W$ l# u* k) Z+ g" x   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'5 y( G0 x+ E' p& u" q  c

: d% q" X1 l# T7 A. u1 _% b2 qNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
) K" w/ p% E8 d- K2 V, Yfunction to do the same job:" P# }4 p: ?: }3 T. P3 `

, x( D) T/ h0 Q* ?* ?( I) e6 p( G   push    00                        ; OF_READ
, X; a$ N0 O: y/ {" U- `# @$ W   mov     eax,[00656634]            ; '\\.\SICE',06 W. H" Z% z1 A! X8 {
   push    eax2 W# t6 ^9 W6 ?) a
   call    KERNEL32!_lopen
2 ]4 z; x7 g- b  b2 a   inc     eax
  Y) @9 u4 [, G" w, u% J   jnz     00650589                  ; detected* O( S( U# A! p( m2 s& t# S: |( v
   push    00                        ; OF_READ
! H$ v! N; n( p0 P9 z7 O   mov     eax,[00656638]            ; '\\.\SICE'
2 Q( W1 N# ?5 u  |% z2 D   push    eax
; a) J1 I! _! N: `6 C2 Q- ]   call    KERNEL32!_lopen* {, o! A6 X, n' ]2 W/ T
   inc     eax
2 J! d7 d: x! @   jz      006505ae                  ; not detected
9 j2 W! p# \& v) n8 [( y! [
6 N% q0 m4 y0 Z
1 ?0 F" J/ O0 u( Q4 {. g( L3 ^8 w__________________________________________________________________________
* R% i$ g8 r& Y9 |* l0 `
, F1 |1 g1 r4 D3 m# W7 I/ z& FMethod 12" v) E  P  i# [( c
=========+ e! t6 A( F0 J5 v1 _, ?

# b9 b2 W7 Z# rThis trick is similar to int41h/4fh Debugger installation check (code 05. {9 S# l$ D/ v! l
&amp; 06) but very limited because it's only available for Win95/98 (not NT)
+ k" Q- G/ f1 F2 das it uses the VxDCall backdoor. This detection was found in Bleem Demo.
) N- _$ \  K$ R9 c) ]. c
3 d$ }  V7 u" s( {  I$ W   push  0000004fh         ; function 4fh6 f- k7 d5 r6 W% F
   push  002a002ah         ; high word specifies which VxD (VWIN32)9 B: ?4 \) R% i
                           ; low word specifies which service% p. j" E7 Y6 s, d5 ?& C6 I
                             (VWIN32_Int41Dispatch)) a3 j. s4 b) N
   call  Kernel32!ORD_001  ; VxdCall
1 T/ F9 ^% o- D3 x$ J. L1 N   cmp   ax, 0f386h        ; magic number returned by system debuggers
6 Q) i6 n' g: D. q, i; H1 M4 h8 Q   jz    SoftICE_detected2 m1 u" X0 ^% }- F
. w! d( q0 [% M8 c% a0 `
Here again, several ways to detect it:
" V- h: L# [% A$ B; d% S' y7 o( P; \5 U( w, K5 G: y( F
    BPINT 41 if ax==4f: e+ a' `+ p/ m  q7 s

3 ]; x$ ~; |3 @# [    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one) r% @  o5 e: z

( z$ Z; |6 D& y2 P' u. m    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A8 _  J9 M6 Q1 e% a+ ^, U+ v4 N
+ l) Z( ]7 i  H! ]4 `
    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!* O" \6 [4 d7 C: l8 U

1 _! }0 w- K4 w. Y5 f* P- {__________________________________________________________________________8 n* i# l2 ~0 i. B4 C
, u& G& e# N9 r, G4 b
Method 13' R6 c% a" l6 y) U2 w
=========3 M) b3 A( C5 Q# @, z- s/ u: {

& \7 _8 O8 {: T$ ]' L$ hNot a real method of detection, but a good way to know if SoftICE is1 o# a4 u3 B# w: s
installed on a computer and to locate its installation directory.3 r5 E& t" g2 Y$ g
It is used by few softs which access the following registry keys (usually #2) :$ k$ v2 L. `4 ]) Z) k: Z$ w

, U4 @' ?, N3 U$ M% K4 a4 W2 p  a-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion6 M" T2 p2 n3 x' c# u5 K' R
\Uninstall\SoftICE9 _8 ?8 D. F3 K* A3 r
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
  c$ j; m9 C+ h5 j% d2 K-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion$ q# E7 p4 z: \7 ^
\App Paths\Loader32.Exe0 _# C1 \6 e6 D2 w2 x" D% s

+ w( k0 N/ o& w% X$ ?6 y! q' u/ o5 |5 S8 z/ J- d. c$ t# i
Note that some nasty apps could then erase all files from SoftICE directory
- \# Y0 g1 P) j(I faced that once :-(, x9 E. `! `! l: p4 S. B6 K$ Z& @

" @5 F4 j. @. S) P: z. o, A2 sUseful breakpoint to detect it:. Q) j6 h9 c& m" ?: A, C
2 s: f& {% H& W& I
     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
% e: l) L$ t( I" \- E  J) N6 }0 f$ o4 i3 U6 c3 h* B
__________________________________________________________________________8 `0 S; B: ?% C6 y. W1 n4 w4 R; [
# s+ a: s) \0 t( ~4 D* Q

2 ~8 q; ^% }- m. W5 B3 B4 {Method 14 0 y% w: N2 ?! h( @& `$ t, x( b
=========: F  S1 m# }8 R( O5 ^
8 E2 ]+ o  m. a  \( r- z" S5 g
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose! ~; B, ^$ e+ T0 e. k
is to determines whether a debugger is running on your system (ring0 only).& v1 P6 v* \, E7 C

& _0 b$ [' {- @$ t   VMMCall Test_Debug_Installed) e- X# ^4 Y9 K$ e
   je      not_installed
, N8 @" j5 I4 r+ u  S& S1 x; c* Z+ @/ W: \! v5 D
This service just checks a flag.
7 k/ P$ s8 }$ n- X</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关注公众号

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

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

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