About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>% U( O& f4 l5 y$ {3 C- A2 b
<TBODY>3 X& A/ \$ }/ ^% K- m  C. F+ |
<TR>
2 {0 f3 c( ], V3 S( M/ I<TD><PRE>Method 01 ; c6 l# c) L5 Q: {0 |
=========
5 F+ i1 b7 G; R0 C! o. U" M1 E* K- ^2 O3 t4 w7 I$ C3 X& s
This method of detection of SoftICE (as well as the following one) is
: C6 j# N5 f7 Sused by the majority of packers/encryptors found on Internet.! D7 K7 v3 o+ B3 {4 }
It seeks the signature of BoundsChecker in SoftICE
* |3 u# `; f+ |" p, @3 T3 A; [4 y: n% p% \% E9 {2 C
    mov     ebp, 04243484Bh        ; 'BCHK'/ V5 ~; _& }) x5 y0 c
    mov     ax, 04h
& ^3 |1 C( }, _    int     3       8 m9 j: t( s4 ?7 \  s
    cmp     al,4
$ K/ J/ k7 }, A8 n    jnz     SoftICE_Detected
/ [: l; x7 \( x1 b
+ r) d& g( B1 P2 U( q___________________________________________________________________________
* Y: n5 b/ G6 k
- O" X( ]5 b% g2 V, {) K0 V9 qMethod 02- K1 z3 A) Y4 y1 c
=========
9 d- ]* ~+ S  n: v% J
2 Y! O/ j  x5 R: T0 bStill a method very much used (perhaps the most frequent one).  It is used/ ~+ F# S, V+ a% ^" L* j. g
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
1 A; e) @# w1 H, M; Kor execute SoftICE commands.... R7 Z# E! k9 Z0 \* h; w8 ^, J
It is also used to crash SoftICE and to force it to execute any commands! N- v" j. ]5 Z- d; h6 s
(HBOOT...) :-((  ( @6 v4 S/ O0 x# a

0 P. {* [6 Q4 N! rHere is a quick description:# X; G( V( i& s) m+ Z! l' O
-AX = 0910h   (Display string in SIce windows)
- i. v( g8 l2 E- q' R! K4 w8 \4 d-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)& p: G( G1 M6 G) X1 U. Q
-AX = 0912h   (Get breakpoint infos)8 g( l; J9 S1 l% k, }
-AX = 0913h   (Set Sice breakpoints)
9 ^% N) f3 b! d% m-AX = 0914h   (Remove SIce breakoints)4 |: n, v! W9 l6 ]9 r

) t" ^: B/ c. W& V' VEach time you'll meet this trick, you'll see:
" k% m! z7 ^; r! o8 m3 Z2 _4 S, R7 k-SI = 4647h
6 ]3 l" n5 a8 [5 k-DI = 4A4Dh
4 h; p- j$ d! v' sWhich are the 'magic values' used by SoftIce.
7 l' E( O9 h1 R6 b. nFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
0 r2 u1 N+ L& h' i7 n9 Q5 M+ D6 |9 d
Here is one example from the file "Haspinst.exe" which is the dongle HASP, N  Q' B, B8 F& ?& c8 u" ~' {5 X
Envelope utility use to protect DOS applications:
2 |6 D3 J# G" s! G3 R2 k/ ~
1 \8 z; A  Q) U( S2 H. w
" P1 @( ^7 R( Z( B4C19:0095   MOV    AX,0911  ; execute command.; V' d' c1 x9 W) f
4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
7 X- \1 O( y' U& {" }% o- O4C19:009A   MOV    SI,4647  ; 1st magic value.3 b. U- C1 D/ v6 `5 m! n( y
4C19:009D   MOV    DI,4A4D  ; 2nd magic value.
( ^: V& q+ A$ D! Z+ H0 |  L1 F9 q4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
2 ?0 _5 O- v( |  A' s% \4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute5 ]0 p/ c6 F# O7 K/ ?+ P1 w
4C19:00A4   INC    CX$ c( O1 {- c/ o6 Q# v
4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute8 W: [% Y' w) p3 ?" O* \
4C19:00A8   JB     0095     ; 6 different commands.; E3 y2 M1 G3 S2 l  a
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.- k  G& K+ L5 G/ ^
4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)
9 T3 ~3 R' F' g# D- D6 r# A) L& v- {* I1 E+ Q- j9 e
The program will execute 6 different SIce commands located at ds:dx, which
" @. K5 z! w9 `! I6 gare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.( W6 p/ P6 C+ H1 V% x; d

1 M) G2 ^0 Q- O6 m5 \7 h2 r5 {* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.. ?, @! @* z9 M6 g: |- L# ~
___________________________________________________________________________- ]5 J# o! X# A( G! C5 @
9 Y' m3 B9 W! _+ x- L

( Z: `# C- _# M* H" u# ^0 z. xMethod 038 {* O: ^6 Q+ K6 P, J
=========- W0 p$ o9 \2 s; S: T; s. A/ G; i

7 d. n7 E; Y7 v3 {# zLess used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h; _0 Z: b4 g1 A( L
(API Get entry point)
, Q! x/ v! c/ z$ w        
* D$ s7 r- _9 q$ ]$ o6 R8 d8 l  y  g* X! m4 V8 s! I6 d1 h
    xor     di,di
0 w) a0 [: y! }; W5 H1 E    mov     es,di
' N1 m3 ~/ {5 S6 V6 b6 t7 `/ e/ p4 m    mov     ax, 1684h       ' O1 d# j" y+ }) \, x- z
    mov     bx, 0202h       ; VxD ID of winice6 l3 R2 u' g  O# i- f  ?
    int     2Fh
. H" U4 E( p6 j0 @! T1 b    mov     ax, es          ; ES:DI -&gt; VxD API entry point
) H6 e8 N9 v( S- c' S$ v7 I    add     ax, di( S  A" C+ Q. m3 L
    test    ax,ax1 P- g: u: R9 Z7 X  {" M
    jnz     SoftICE_Detected
8 n* n- P' [1 j* P; n' K5 K+ h- P3 ]. ^5 |
___________________________________________________________________________, V* Q# V" h6 u& r' D$ l

+ m( C2 {; |0 B; l/ R1 i( q8 p' ]) ~! |Method 041 f$ Z* L; R+ @6 L+ C6 M; B9 F
=========
0 U. Q2 [$ i# }# m
% h( P, o4 v9 e6 iMethod identical to the preceding one except that it seeks the ID of SoftICE  j3 @1 E+ y5 Y1 [) o
GFX VxD./ g2 p# U+ V% x9 @% o* u$ N( M$ ~

7 l: P6 t) s( h. e: h, ~) d3 U- ?    xor     di,di
& I$ `2 v# `, T' Q( Z7 O- ^6 A& c- t" p    mov     es,di
; s' c' b3 {7 b. u, j( A1 L    mov     ax, 1684h       ) B5 w" H, v% O5 `0 z
    mov     bx, 7a5Fh       ; VxD ID of SIWVID
- ~. m2 l% T& q# u  W4 J& c    int     2fh
: J  A0 H9 j1 @  a) p    mov     ax, es          ; ES:DI -&gt; VxD API entry point% Q' I! w, u. L/ k2 x  ^% E( P
    add     ax, di$ h7 F* D1 S  m' ~/ c5 T/ V5 z9 r" R- k
    test    ax,ax
- O3 G- [% j: {3 y    jnz     SoftICE_Detected( ^3 l4 }. F. z0 L
8 B1 `  M; Q- v2 j! P, f" _1 C
__________________________________________________________________________
0 g( Z3 O! m0 ^+ M( O8 V  _0 F' V6 R( H9 h8 I
' b* C/ s, W9 u. j1 b4 }6 Z
Method 054 A) x" F& t5 `, i* c
=========
: T& E- C( I0 f3 \
" L  \. G/ K9 AMethod seeking the 'magic number' 0F386h returned (in ax) by all system
4 @( ?2 D6 r3 z2 tdebugger. It calls the int 41h, function 4Fh.- e4 H; ]- C7 Y% {8 j& Z. H  L
There are several alternatives.  * ?" v% ]7 g. t4 F1 h( U+ _

; h4 j; T9 i  S3 B5 _0 L: o6 |6 h4 F1 VThe following one is the simplest:# B8 S; x; i" p+ h, k6 @
$ N, ?# h' O* t1 b
    mov     ax,4fh% s: ]! s" D: Z. @: V
    int     41h( F* u- v: y5 @/ `
    cmp     ax, 0F386/ T5 Z: j, L: {- `( [0 t9 D
    jz      SoftICE_detected
( A0 Y, u5 l" e+ ]
5 C! h) T: P1 P2 g0 a: b
) v6 v/ I  u: XNext method as well as the following one are 2 examples from Stone's 9 O& `. [0 b6 k
"stn-wid.zip" (www.cracking.net):) p4 K2 @5 t( e) U! K/ T

+ C; o' e& y+ p7 U. q% x. {    mov     bx, cs# q2 v$ K( S, u3 H! _5 }, K* z: p! n
    lea     dx, int41handler2
: Z1 g8 `: V, D& u2 i    xchg    dx, es:[41h*4]
$ n: x8 l& v' W& E    xchg    bx, es:[41h*4+2]
& e5 M, E7 @5 G& b# Y0 y! f    mov     ax,4fh
$ Y$ g( m: T' k, |    int     41h
  I3 v) j$ c/ A! S! @) ^  B1 h! W    xchg    dx, es:[41h*4]2 G6 K: E' h/ h& I% S4 P
    xchg    bx, es:[41h*4+2]
' U# T# G' x. F+ p8 P$ [& k! \2 |# o8 Y    cmp     ax, 0f386h
1 P9 Q3 Y0 D3 o- [6 M) r) r0 f$ i    jz      SoftICE_detected* U4 Z% I6 l' Q* ~* U- a" g8 B
1 w, x* ]: o/ Y! Z
int41handler2 PROC; ]; L. |4 @3 v' r
    iret# x8 e2 |, w: \2 k8 {, B
int41handler2 ENDP! K/ o5 k7 a1 M. z* E) M

% \% n1 Z. C( k1 R$ {. W- R
6 l% O4 h5 _' T, `* F9 [$ A/ j_________________________________________________________________________
$ K7 s2 i8 b3 M2 P/ q3 }6 n
- l* R* \5 J1 v& p/ B
( e( {5 p1 S4 X" q. H! ~2 kMethod 06" J# K% w+ V5 k1 u7 D2 l
=========* R, N1 }9 C$ V- \0 k- Y2 h  U8 k
) H* q5 w2 W1 v; M( W" T5 {
) m: O) m7 H; f! N  c# [
2nd method similar to the preceding one but more difficult to detect:
: ~# `/ Z3 F6 v8 F% f3 [8 f
: |" X+ ]# O- T2 b$ p. e) j5 e* n4 _2 W0 y
int41handler PROC7 v( O) C$ p$ W" [
    mov     cl,al6 N/ P. T% u1 n& }4 y
    iret
  D: _8 p8 F2 A1 ~6 Qint41handler ENDP
  y; q7 n' Q, H/ K- v2 v1 z; g) d. m2 U2 ?; t3 x
( }! k5 z: o5 x$ A# k4 k5 b7 v' q) ~8 W
    xor     ax,ax
6 ^2 D, v5 R. V8 B    mov     es,ax( A& k1 E4 Y! h/ R
    mov     bx, cs
( L* y% |; T' S# J* J3 K2 j    lea     dx, int41handler, J6 P' G* R- W( T: V5 S/ j/ h
    xchg    dx, es:[41h*4]8 ]7 E( u% v7 \+ d5 e
    xchg    bx, es:[41h*4+2]2 I0 g8 P9 I! B! p3 i6 e/ i
    in      al, 40h  y0 D9 M$ B0 ^. a& M
    xor     cx,cx8 |4 q1 D6 L9 E* r2 F
    int     41h% v9 k! k2 c& N0 a; j: z* A9 N
    xchg    dx, es:[41h*4]% E) U0 h- W  q: \' }7 B' y* Z1 p
    xchg    bx, es:[41h*4+2]. k, h) J2 t8 f; o7 E" b2 a
    cmp     cl,al) L, s5 E* `" p% `, C0 Y
    jnz     SoftICE_detected
% O6 f7 _" Y  z5 E  ?1 m8 t5 [% d8 R& w. Q( G- D2 N; G! d
_________________________________________________________________________) K7 I" v8 E  w8 \7 T2 Z, Y
% A! _* M; P' R1 v( U7 `  F% N
Method 074 o/ }$ b! J$ L3 k
=========
4 O" @4 u) A  j5 X; }* P  p( j- W3 B' y3 x3 T/ c8 R5 W* `
Method of detection of the WinICE handler in the int68h (V86). \+ ^- Q/ \1 Q# N& J: R8 [

9 q9 C; n; ^* R( D) q    mov     ah,43h
3 ^7 C5 Q8 S" X( @+ D    int     68h- E( Q8 F$ e7 E1 _8 N* s
    cmp     ax,0F386h! k& y/ N$ S# B; F' t8 T% Y
    jz      SoftICE_Detected% f  J/ Z6 ]+ I$ T+ K; \+ Y6 s6 d

6 s; ~. B& x5 y7 R8 J7 ~: e/ G$ j. U6 j+ p) z6 l& v8 t1 O
=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
4 P5 T, n: I3 R  j   app like this:! Z' ^4 U1 b1 q' W, b( I% }
/ s1 L* K- l6 T# w9 m
   BPX exec_int if ax==68
0 \5 M- E# ?" L7 y0 f, M# J   (function called is located at byte ptr [ebp+1Dh] and client eip is
% c$ L! y9 V' _1 K( o& Z" ~9 Q   located at [ebp+48h] for 32Bit apps)
* k7 J8 ]7 H8 J. {8 T__________________________________________________________________________
  u% _5 I9 |( I" l: g) f
# c- O! L* T# ?# e: k& f2 l
% y7 v+ e. K. ]( \% ^Method 08
1 o+ n2 f; \; H( z# r' b: J3 @" G=========
- g+ e6 `3 D' p; u/ Y4 U, L; Q) j4 W& W7 B
It is not a method of detection of SoftICE but a possibility to crash the
3 V) z" l8 B5 K4 lsystem by intercepting int 01h and int 03h and redirecting them to another9 g$ r2 |; g( j/ q
routine.
- T& ]' X- `3 |( MIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points' S9 @" ]9 O& J
to the new routine to execute (hangs computer...)* I3 T! `% a3 ~1 Y" a; \( `# p

- E+ v& d5 ]( f2 T. z    mov     ah, 25h" D2 u' e) @6 _
    mov     al, Int_Number (01h or 03h)
+ J, D0 r( S, o  \0 [1 a" F1 v9 |! j' l    mov     dx, offset New_Int_Routine. O0 w& [% o# M# q& a
    int     21h# [' I) @$ B" Z& c: m4 t% \

: Y, `% ^( i+ T. l" r2 O2 Y4 L3 V__________________________________________________________________________
; m0 d! r+ y/ j7 A
5 T( _( }# [& l$ x8 XMethod 09
0 Z. a* C8 F+ j* t9 `) Y& y=========4 l6 v; i$ H* H; U7 u
! c% ~) \' E3 h% I; h3 l7 F: P0 x
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only9 T6 Z/ D6 ]. K& z7 S$ Z
performed in ring0 (VxD or a ring3 app using the VxdCall).
) t: `# \* A- Q3 TThe Get_DDB service is used to determine whether or not a VxD is installed
' Z. |. {3 [/ l$ K% J# kfor the specified device and returns a Device Description Block (in ecx) for
$ y0 l1 u  Q! w6 D& j; U$ pthat device if it is installed.
* N% {% m% H, I: S1 B5 O* ]0 w5 L
   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID. ?& K0 [8 |: }1 N$ i
   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)' l5 R! j& [3 a- U
   VMMCall Get_DDB
# A7 P4 n& c' O  \   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed
" }  ]& U2 L& t* X4 `
* M$ c0 Y3 m6 M" V1 j& ZNote as well that you can easily detect this method with SoftICE:
8 A* b9 |; P/ o: {% G. ~   bpx Get_DDB if ax==0202 || ax==7a5fh
8 O' }: N) Y+ L5 `& c2 M8 Q5 {2 W7 i  D1 \1 o/ }) H  g
__________________________________________________________________________) s& p* `; Z% q; P5 t

5 c0 v9 V9 ~% ?; D9 XMethod 10$ K! |  k# D7 b9 ]2 M
=========
( v4 Q- l( v5 w+ ~( Q& @) m. e; U2 m) v  c0 }( ~9 i
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with
7 x' a: [& k! c  E+ @& r0 t  SoftICE while the option is enable!!
8 k* e2 Z+ s! i5 C, S) k+ V
& [) I( ]; q9 ?8 d6 R+ @% DThis trick is very efficient:4 i7 A3 y, w8 q5 Z) P9 ^! E# ]
by checking the Debug Registers, you can detect if SoftICE is loaded( S) s8 r: L* C6 f
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if* \* l9 }. |+ ?" W
there are some memory breakpoints set (dr0 to dr3) simply by reading their$ @3 R+ U3 `; }' x- @
value (in ring0 only). Values can be manipulated and or changed as well  Z) f/ Z/ T" q! ~& a# _' ]- G
(clearing BPMs for instance)' }! n% P  H& C
9 Y" }2 w1 g7 A; u  p! {( M8 ~. q
__________________________________________________________________________7 Z& a$ a8 v% w0 E# `
' M+ ^% C, Y& C1 ~4 B
Method 11* x% ~" n  j! x3 q, A
=========7 Z5 a1 M8 X8 r4 j
& a" r8 o& L3 J$ j7 S1 m
This method is most known as 'MeltICE' because it has been freely distributed; ~# M' Q+ I9 t0 j& e( D
via www.winfiles.com. However it was first used by NuMega people to allow0 Y* ~9 j7 `- k0 ?2 C
Symbol Loader to check if SoftICE was active or not (the code is located
* s( }3 ]7 M. u1 z% }, ]0 Pinside nmtrans.dll).
- [1 v4 ?4 H6 j' r$ M6 c: o6 e& A
The way it works is very simple:
3 B. Z9 Y; w) [& T9 q) B/ EIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for- V3 ^1 Y/ G( C% r* I) Q2 M
WinNT) with the CreateFileA API.  g4 [. g* g+ p

( o& `9 \2 ~$ X+ e5 cHere is a sample (checking for 'SICE'):
# Z+ N! |% d) R
0 d9 m7 r8 z2 q* F- ^5 @BOOL IsSoftIce95Loaded()
+ |1 M  D* R& c* U; ^* _. e{
4 t" X4 m9 ~3 Q8 |   HANDLE hFile;  ; l/ g( P# W: d4 U2 u" E( V
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,- t" P; o7 \& l- d: N
                      FILE_SHARE_READ | FILE_SHARE_WRITE,
$ H' r4 s3 W9 z: S% }2 i                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);$ ?! ?) e) O# j
   if( hFile != INVALID_HANDLE_VALUE )
5 P) ?7 E4 g! j1 s; D: h' r   {: d0 H0 L9 m8 d
      CloseHandle(hFile);
; F- @  Y9 J: v, a+ }      return TRUE;
! T) O$ F# _. `1 L" |3 H   }' f/ I* v  A( n
   return FALSE;
% x9 u5 o& u$ [- m* y}
7 t* p/ o  h/ ^: G" Q) ]! z6 b: f
! F6 w" R2 Y2 f  }, ?Although this trick calls the CreateFileA function, don't even expect to be
) C: `2 g8 s$ I1 Gable to intercept it by installing a IFS hook: it will not work, no way!+ s; r6 ]  @7 f& C9 h# F" @
In fact, after the call to CreateFileA it will get through VWIN32 0x001F8 X  ^2 E/ h' ^; X5 _( l9 ~
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
) C7 F$ X& m& l- w3 Xand then browse the DDB list until it find the VxD and its DDB_Control_Proc
" w9 ~- B% |7 F/ kfield.1 U4 w/ e1 A6 n$ l# o
In fact, its purpose is not to load/unload VxDs but only to send a
% d; Y3 _- a  p& U5 k$ ?% xW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)" E2 N) X7 v. }! a2 {
to the VxD Control_Dispatch proc (how the hell a shareware soft could try  z# A3 A  h- A7 _6 o
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
0 {3 \+ O% s4 u3 d6 J% J9 l6 aIf the VxD is loaded, it will always clear eax and the Carry flag to allow
8 [/ ?# w4 W5 Z3 Pits handle to be opened and then, will be detected.$ U: `! K  B: c( B' [. s# s- N
You can check that simply by hooking Winice.exe control proc entry point& }- M0 b* L1 L" u# w7 O: p! v
while running MeltICE.( m9 N- O( m6 F+ o% |( g

3 K! Z$ N  |" y3 C" |3 Q/ f* ~* ]3 ?8 h+ A
  00401067:  push      00402025    ; \\.\SICE
' C( b$ T* r2 F/ l% }# B$ _. Z  S  0040106C:  call      CreateFileA( x) j; D6 J* T) y1 S
  00401071:  cmp       eax,-0019 S7 w& u/ @0 I
  00401074:  je        00401091
3 k& P- X6 a; W; B; k; ~
' i% m3 [7 ?! Y! u  [) K  ?/ ~% s+ V7 n" J. P. [
There could be hundreds of BPX you could use to detect this trick.
: h+ x# j7 C, g( z, D9 c4 ~-The most classical one is:
+ e# i( B1 v' o9 v) }$ j  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||8 ?6 D( a1 }$ x0 t
    *(esp-&gt;4+4)=='NTIC'
, q8 w0 t2 H7 J% }4 [4 F' `7 o
! \$ }% c  Q7 V-The most exotic ones (could be very slooooow :-(
7 c( J8 n2 F8 B2 o5 R   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  + u* l/ v/ Y" Z) W* c
     ;will break 3 times :-(
- b" _& v9 t7 F" G) b! S5 w0 G& \+ J9 K
-or (a bit) faster: 8 Q7 P* ?" H% A& S
   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')' C" j7 a/ n: M+ y3 n
( A/ V; q2 X& s, ]
   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  
, Z4 l+ T2 g2 v8 W& r     ;will break 3 times :-(
' C4 T8 W3 y1 u( ?7 K' [. Y! U7 `& W" h+ `
-Much faster:3 ?! D8 O. b6 k! L6 T  J
   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'$ Q7 `& g, q9 f" s' a0 Q& z6 a

& I. i( Z- e7 u1 M* ?Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
) Z# K& \8 w; U$ v- Tfunction to do the same job:9 \6 e( M& c9 ]/ d" N/ M5 v
% A. B5 T+ _* ]: X" v: N6 O6 N5 B
   push    00                        ; OF_READ) y: V* l8 g1 ~' T& |3 U* ^. p
   mov     eax,[00656634]            ; '\\.\SICE',0
, W( a3 z; Q2 w- A& O, Z. H+ P   push    eax  z. O3 Q" N' a6 ~4 g4 w2 ^/ b% ~
   call    KERNEL32!_lopen
  i! }" F% m  G; D7 ~* B7 C   inc     eax
" B4 l! o1 g0 C2 w1 i   jnz     00650589                  ; detected. o% c( A- ]' v1 A
   push    00                        ; OF_READ& o: ^% T6 y' c/ R& ^
   mov     eax,[00656638]            ; '\\.\SICE'
, y, s" z" ^* e: F! q" Q: Q   push    eax7 A" j5 f5 p: q- h; p3 d. [3 X
   call    KERNEL32!_lopen
, y# z8 e! m' g' W   inc     eax! m" _3 S, y) ]' c
   jz      006505ae                  ; not detected
* Z8 m" D! j+ @( X/ E  b# ^
# q2 c7 q6 [* c0 `( X, M4 O
/ D; \9 }5 D4 j8 J__________________________________________________________________________  X0 c9 r3 d; l$ a

- a1 ]4 f# z. |- P( WMethod 120 d1 I, i! L0 z  i7 a/ I
=========
/ q* |4 D0 ]6 |/ h; T5 _) X+ z; L* k5 M/ u
This trick is similar to int41h/4fh Debugger installation check (code 050 J% v9 \8 v5 r
&amp; 06) but very limited because it's only available for Win95/98 (not NT)* E+ O" H) C6 m+ D
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
, g5 \/ i8 n# v( K, \( H, q; u
% F: {% |" M* w5 t$ `/ L   push  0000004fh         ; function 4fh. U' Q# Q+ L+ z8 W3 n4 \  Y& `# m
   push  002a002ah         ; high word specifies which VxD (VWIN32)1 J' {( x) q$ o0 d# d0 }- K+ O$ d7 r
                           ; low word specifies which service: j& u& V, [1 u" e
                             (VWIN32_Int41Dispatch)
, ?) Q4 J! l! h, k0 h' d! j  G   call  Kernel32!ORD_001  ; VxdCall5 O9 l5 ]" H4 Y6 a3 v
   cmp   ax, 0f386h        ; magic number returned by system debuggers* d- T! ~+ p2 c; T8 l$ @- j
   jz    SoftICE_detected
( k/ A3 _8 Q# ~( I6 h2 s
% [# B* N+ Z; k# bHere again, several ways to detect it:, `$ g; R$ d( d* G# `- j1 {

' X7 o/ G% E# ]/ u# E! ], d$ Q9 ~    BPINT 41 if ax==4f
5 ?' d' W3 ?! l7 Z5 y  }. L1 m+ g* f; K! P; q& K
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one8 a# P8 v, R$ N) m2 V

5 v2 u: Q( S& v  E/ L# G    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
! J% M/ J& P" ?- Q- [& N% P# G- X: v7 u7 c3 [- L
    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!
3 c% k0 M+ n4 Z) e- w, P" n+ x
! Y4 d1 W; l) |1 `# E5 T__________________________________________________________________________4 |: t, S5 l, d3 N+ d+ J' V

* i1 m+ p# Z7 D& y, D! ZMethod 13! ?: y, C' M$ l# z# N- G
=========
1 h" \; d. t  A- y6 y. w0 C0 k4 b. z' {# _5 ?. V3 v8 t6 R
Not a real method of detection, but a good way to know if SoftICE is
4 |; F1 ?9 ]' c( t* [- Q+ R% s* R3 Vinstalled on a computer and to locate its installation directory.
9 f- }! k( e/ U1 \+ _# \- S/ C$ ^It is used by few softs which access the following registry keys (usually #2) :2 \% ?$ @, i  i, i' _7 K7 W/ n& @

* a$ u, P* I  f# }& s-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
6 \& A0 j  ^1 {! m4 t\Uninstall\SoftICE3 D% D3 {  P7 K: A
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE& H* y( H* v) H0 X. ~+ @% ]
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion* W/ P4 j9 g. `8 h- @$ u
\App Paths\Loader32.Exe% P9 e# l0 D1 K

) u& ~2 o: B" L  p( k! a7 \
0 _! I+ q5 T0 H" i$ o$ t2 A$ [Note that some nasty apps could then erase all files from SoftICE directory
# R1 I3 x' K6 d; o(I faced that once :-(& z* J% P, `- \0 Q: L2 O

  e7 J4 C$ Y" {5 |Useful breakpoint to detect it:4 Z8 c: ?1 X( b+ B
# }6 C' S7 K4 ~) C
     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'6 g$ @# f# C5 e
1 Z  N& f% {9 o% Z
__________________________________________________________________________8 E5 L. A& |8 g0 `
* e2 m/ m; B* o2 b' K
$ I' |4 R) H1 Y* S, _" T5 J
Method 14 $ Q$ R% @% |, q( p" \* f
=========
: N2 B, o1 u3 a' w# Q7 M* ^; m/ x7 o7 ]9 k5 w
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose+ A9 }  I! s0 q6 Z$ |
is to determines whether a debugger is running on your system (ring0 only).. U6 r- h6 P: p& a+ w* j
% ~, k$ H& N6 O& o- S  h  |" T
   VMMCall Test_Debug_Installed4 C3 {  O/ L0 Q/ \
   je      not_installed- C5 w+ O* v+ G  ]  D5 W

. x# E% \9 Z& d6 U/ IThis service just checks a flag.
# L/ d: F4 p' O& E: T! Q$ |</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关注公众号

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

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

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