找回密码
 注册

QQ登录

只需一步,快速开始

About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
9 Y3 u7 b! m2 V, H( K, R<TBODY># L' Y: O! }8 c9 `, n
<TR>5 f1 ^% t  u5 P: E+ H% e
<TD><PRE>Method 01
. E3 A/ U7 W" m+ B=========, e3 ]% ~4 B3 F: A, P2 S& Z

8 P3 \" G7 C. b4 AThis method of detection of SoftICE (as well as the following one) is
: Z; K# ~# Z4 p- Z# tused by the majority of packers/encryptors found on Internet.
7 _% S+ x) w2 h5 R1 @( xIt seeks the signature of BoundsChecker in SoftICE
  l( o, i( T4 w+ ?* C' A
# u3 }# k2 ?! o/ t, b    mov     ebp, 04243484Bh        ; 'BCHK'
4 V8 y6 T9 X' o2 q, L    mov     ax, 04h9 X# h0 ~" k  A% H2 `6 i+ W/ ~  Y
    int     3       . e! T- F' \" E6 f) i5 v+ W3 N, f
    cmp     al,4
8 [% D* p# N6 _" l) W. c6 S1 X    jnz     SoftICE_Detected
4 R! R4 a# W6 q) O. L$ u6 e
& V8 r# X. ~: E( ^9 i5 g___________________________________________________________________________
& i! y% P0 `% W, L* S+ `
3 y' x  I  m$ RMethod 021 b1 ^# }6 e  d8 v: T) q
=========  Y4 j! v% P) P

  R' V: D8 K: B- }& o' g" R* O& XStill a method very much used (perhaps the most frequent one).  It is used: Q4 b# _3 m2 _( s5 f0 m
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,7 X# k* N5 p4 S  d9 U/ m, E8 M& O
or execute SoftICE commands...
) X$ p6 _8 B/ `* OIt is also used to crash SoftICE and to force it to execute any commands
6 O5 k8 {0 u, r! z3 T! Y) C(HBOOT...) :-((  0 Q% r' F; S4 S
2 _, Q% c  G+ b
Here is a quick description:! Z# s% ]3 I: Z% |$ W
-AX = 0910h   (Display string in SIce windows)
7 ^8 Y2 S$ Y: n+ c7 B-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)
) y5 v" e! }4 r9 Z-AX = 0912h   (Get breakpoint infos)6 c) `) n) \% C# c" C) r" t. ~
-AX = 0913h   (Set Sice breakpoints)
7 u8 O9 q; |0 U% K: O' d-AX = 0914h   (Remove SIce breakoints)1 \! J/ w5 `( ~2 m. N
7 J: }" u5 @9 w9 U
Each time you'll meet this trick, you'll see:
& Q) q/ I! K. M2 Y: r& b-SI = 4647h& e' \8 r, D2 B) P  r7 j9 c( P8 M/ v
-DI = 4A4Dh
# x0 g1 S3 x" bWhich are the 'magic values' used by SoftIce.
) V) B9 Q) W' M( fFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.& q: a% A% l' N3 I9 b
" q( R; N$ }$ @( p5 v
Here is one example from the file "Haspinst.exe" which is the dongle HASP
9 {: w6 E  F! j+ }, tEnvelope utility use to protect DOS applications:- ?$ f7 t$ D* S+ ~* w* E' [
& A5 J! H" g0 B( u: P- F

+ d0 }: z7 b& G: ]4C19:0095   MOV    AX,0911  ; execute command.
6 d+ O$ P6 p+ ~2 `( y5 C% I4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
# r) B! E! ^% ^& a5 y6 m4C19:009A   MOV    SI,4647  ; 1st magic value.
' u+ o7 k3 {6 {& l. e% U+ ~. ?) f4C19:009D   MOV    DI,4A4D  ; 2nd magic value.0 b* r; V: E) H
4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
; f9 ^0 F/ m/ E' d+ Q( ?# K4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute
6 s0 ?, C$ f2 t( Q* w4C19:00A4   INC    CX& U* f1 k6 v* p: h3 a3 k
4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute8 G* n, E, G. K3 J3 k6 }
4C19:00A8   JB     0095     ; 6 different commands.5 x- J5 t9 e7 _( ~
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.7 I: F0 R9 ]3 i# p$ b8 v+ x
4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :), c6 T2 {4 e, U# F+ H1 i' u$ b  ]

, V0 ?% |8 W) C: {' w/ VThe program will execute 6 different SIce commands located at ds:dx, which$ `+ F5 O4 \$ D2 l% y
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.. f' B6 \- G4 {- V) _
* Z1 M/ u, D, k
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
$ G( F. ~& w6 L+ ^___________________________________________________________________________
. i: o7 v0 f0 G: N" d0 S
2 I) X6 K' s8 C: r. W5 t. Y. t
& `$ i. [9 X+ h0 VMethod 03
2 r1 Z# e% m; W3 o3 T5 w4 p* a. F" E=========. Q+ L- D; _# `% a

% \- j+ s9 Z2 K# W) Q1 M0 U/ yLess used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
2 `3 ~& t/ }2 R  u+ C(API Get entry point)5 l3 Z. S9 w, h+ N' U+ h
        
: b+ O, A& ~- `( q- Q8 w8 n) h6 X* |" s
    xor     di,di' Z4 U& r) k" z' F( N7 h( X- a7 V9 ~
    mov     es,di! o- ]' ]) U) ~, T/ S6 v0 l
    mov     ax, 1684h      
/ a! R% D! f# {" }; m% P. A- B    mov     bx, 0202h       ; VxD ID of winice
9 a8 e1 q3 k1 F$ F    int     2Fh
% {. E8 u) L5 z% ?; L    mov     ax, es          ; ES:DI -&gt; VxD API entry point2 L1 q1 J; S- l& Y  ~& `8 w
    add     ax, di  ^- i8 J% l! f
    test    ax,ax5 p% m3 w. H/ }
    jnz     SoftICE_Detected
$ c+ @* z& W+ w
2 k7 l; _, V2 h" I0 [4 F___________________________________________________________________________2 d. d0 q4 k: ^9 Q7 D

- m. p3 s$ T# E- L9 W5 N# e: K9 WMethod 04+ y4 C5 v4 n; t4 u0 a* y9 n' M9 W
=========
8 R* A+ _' |/ Z  d0 ~' @3 X& k2 }3 P  h+ J' z
Method identical to the preceding one except that it seeks the ID of SoftICE
3 H0 c$ _% T7 oGFX VxD.
2 _: H$ a& a4 O, G( K; M# _  v% T3 w7 x
    xor     di,di
- F) q1 P2 i3 X  q5 ~! M6 k    mov     es,di
" \& b: M# v) Z: q7 o+ ]. s* ?    mov     ax, 1684h      
* M! w+ E* }3 Y' }" u' @. B    mov     bx, 7a5Fh       ; VxD ID of SIWVID
0 o; @3 j( |- v0 ^& ]6 M6 e    int     2fh3 I& L' G' Z  k1 M; m* B) l
    mov     ax, es          ; ES:DI -&gt; VxD API entry point* x# a" C' R, U" Z
    add     ax, di1 C. J8 {4 {+ x- b' g0 {% Z% J
    test    ax,ax
4 O' W/ k" Y# z# H; L4 f# r) |; U    jnz     SoftICE_Detected
# g) O3 [" y; ]' z0 ~) M" S3 k. _: n3 S. E* \& y# m
__________________________________________________________________________) D- w( T, I$ n# l+ h$ ?

; T& I9 W) q0 `: M$ q+ J4 T% B. u9 O* D; X( O4 d
Method 05
! F) Q* g$ \# D) p=========
- e) T! H1 }) a+ r4 H4 {' ^0 b9 _! L3 d' T8 ~+ a0 Y
Method seeking the 'magic number' 0F386h returned (in ax) by all system5 z+ H' v1 y% e
debugger. It calls the int 41h, function 4Fh.
6 g3 b+ R! b1 p* sThere are several alternatives.  
  B+ A2 u% C, m  V% {$ @8 S# u) q% w1 L+ _3 ]( {( a" H
The following one is the simplest:# ^: C: P, @7 }3 x. D8 U& Z2 g* R

% X/ [8 M, L! b, L    mov     ax,4fh
% W8 t; n5 I& G* Z, O1 I    int     41h: K# l% }  N1 ^/ h
    cmp     ax, 0F386: D: x8 h7 G) g3 A& k2 o/ M
    jz      SoftICE_detected2 i  \7 j- u5 b# ?+ u, o: w' ^6 z: I; g
: w1 a1 P1 k' p) ]
, q5 O3 }6 `: J8 G
Next method as well as the following one are 2 examples from Stone's
( G2 C; z$ R" m8 S"stn-wid.zip" (www.cracking.net):
0 C  S+ S1 f2 }- _  H6 R: x7 P) ^  k& Q5 s( Z
    mov     bx, cs
3 L% R" q7 ~6 F( S" i! o( U    lea     dx, int41handler2( W+ q9 Y7 T: S9 _2 _7 x+ \, b
    xchg    dx, es:[41h*4]
2 t# V5 z2 A: U* o  h- {( C( o1 E    xchg    bx, es:[41h*4+2]
+ N, @; p  f" s' F0 r    mov     ax,4fh' s3 p2 l/ L, o# p
    int     41h
! ~: j9 L# d/ D6 Z/ G    xchg    dx, es:[41h*4]
. g. X* ~, c9 J; d! r6 D4 g+ v  f    xchg    bx, es:[41h*4+2]5 w! ?% r' f8 `) n3 ]
    cmp     ax, 0f386h2 z1 u/ T% i, o/ {  y9 F+ Q: `# C% m* Z
    jz      SoftICE_detected
' G* H# n5 l$ n) ^) i. [
% W! W9 w" U. r& b) c2 f, {% Eint41handler2 PROC4 l) ~0 X+ a; B
    iret( K1 X1 Y( s, p! k8 C. C0 X8 E
int41handler2 ENDP
. {) G5 v6 a' k$ r
0 D) h" i/ D5 A! Q9 ^5 j6 Z( a6 R
. C7 O4 R& t( V5 b$ F2 d! H_________________________________________________________________________
3 }  {! ~% H5 _$ R2 {. B) K. o4 D+ ~; V

5 E$ G0 J, D4 }' r( rMethod 06
& F" s1 P7 m% h  p: ^, Y=========
2 X% |0 w/ F# t# W# Y/ }% n
/ I+ r( X1 R8 \9 T% a) p
- m( h, P$ C/ C" m3 m0 [8 [) c2nd method similar to the preceding one but more difficult to detect:$ Q4 ?1 ^! w, j2 Y2 U
7 g- E# c9 z: [7 }

% p. F  i# x, k! eint41handler PROC) L; C0 n: ^; E. n* e
    mov     cl,al
! d1 S1 [! i% j  ^! o$ N    iret
. V/ K* Q7 j; ^int41handler ENDP
8 }% Y3 b! k$ d& J3 e( n8 B
8 o  v0 N0 J' G% E6 v- i0 x; d& ?! `' P& K9 t" M) ^% h+ u. ]
    xor     ax,ax1 v+ b, m& ^* x% {( T- m
    mov     es,ax
- a8 v5 k) {' ]; W. V    mov     bx, cs
) |7 w4 q; b6 e: `    lea     dx, int41handler
4 S! E* b; D6 X! G    xchg    dx, es:[41h*4]
* f+ w$ w9 U9 m4 @    xchg    bx, es:[41h*4+2]
" F8 j% e) a4 H2 @    in      al, 40h
8 A5 ^3 {) y8 Z+ C& a4 p" ~    xor     cx,cx5 q: Q3 E# Q. g/ @5 D
    int     41h. W7 b# T  `4 q: g0 G% ~" H" r6 [
    xchg    dx, es:[41h*4]
$ w( i+ Z& l# s9 d1 Q    xchg    bx, es:[41h*4+2]# {/ G3 j( M5 g1 \- U" R/ g
    cmp     cl,al9 D: O& D4 ]% |! }1 W- C; i
    jnz     SoftICE_detected
* u; _6 }5 L! {$ W/ q( H$ ~3 h" W* t% E# ?( v
_________________________________________________________________________
) A( a0 X) i( ~" |1 y* g% C: F% M$ ~+ i
Method 07
1 ^2 A( r1 r# o! h  d3 n- x/ W=========
3 G  Z$ r2 b4 R. X0 X, X
7 E/ e. p2 V. ^: U- h* K$ {9 EMethod of detection of the WinICE handler in the int68h (V86)
5 ~& n# x9 B& V3 X5 `: w, q
# z) g  y3 y& ]9 f    mov     ah,43h
  Y: T- g6 N2 |3 |5 M  |) q    int     68h
( \; k2 J: K# T8 l+ A5 ^    cmp     ax,0F386h
; f$ m2 e, S; l+ s: V& s    jz      SoftICE_Detected
3 L4 ?9 I8 g8 N& ~# r: h6 D& Z' v: n& B6 ~
2 F& e( B' O+ I0 N+ O
=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
3 v+ L1 b. y# L, L$ I" O   app like this:
( W1 n2 I+ Z  |3 ]
+ F' u7 D$ B4 \$ P; F/ B) h   BPX exec_int if ax==68
' o/ x! g  ]4 `; M   (function called is located at byte ptr [ebp+1Dh] and client eip is
5 o9 ~4 T. u! c2 Z: N' B   located at [ebp+48h] for 32Bit apps)- Z8 G! [6 u, X0 e% l! ?
__________________________________________________________________________
5 p: S5 y- l, H* g; b2 V. X5 j. ~: a1 F( f
6 X! t  [7 v8 j6 ?* h
Method 08
5 h  _' ?, M1 X# E  ?( P9 P=========
* F4 y* |( W3 _' S' ?" e: C3 |, {. V$ U  t+ D; n
It is not a method of detection of SoftICE but a possibility to crash the
) s8 ^4 G4 \5 E( i; c& Ssystem by intercepting int 01h and int 03h and redirecting them to another
* L; u* f' {$ \; b+ `9 Zroutine.6 ~' _! k" g) n$ P7 o9 h+ K
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
# n0 l( |1 l6 ^to the new routine to execute (hangs computer...)
5 J& f1 J7 e0 m( R( U  A, @. R; ~: o; E( v
    mov     ah, 25h# F3 y/ ]; H! g" E7 d" l
    mov     al, Int_Number (01h or 03h)8 g' w7 E) N, ?
    mov     dx, offset New_Int_Routine0 C; C5 }7 i% w1 a, a# |* L1 W( i
    int     21h
- a5 y) k1 _$ j2 p! j2 U  M; q! e8 x  a6 c! f4 w
__________________________________________________________________________
9 K% H) Q) W1 o" O; I/ y9 t) }6 T( W7 ~  R9 F
Method 09
2 J& B( A( ?9 _1 n=========
: ?) r" H* E% Y# W3 }3 B1 i' @' G4 q3 N! k% [! a
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only6 V0 S0 f$ p: W4 G7 _, L) P; ^
performed in ring0 (VxD or a ring3 app using the VxdCall).3 F! L, v5 a6 U
The Get_DDB service is used to determine whether or not a VxD is installed
  a& ^- d1 V3 V2 L$ m% J2 \2 efor the specified device and returns a Device Description Block (in ecx) for
* T" \  ~4 s# K! M/ r8 Hthat device if it is installed.8 H. @8 ?! U) g$ g3 p% K" \  p  }

/ F, }6 C% N- O   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID
1 E# l; i8 L0 a' d: a   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)0 C5 `$ [( C$ a/ {% x5 C
   VMMCall Get_DDB) ^; t# a+ r; {; O% y
   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed; _( E4 P  o" y; [' _; I, ]9 G1 @: m

( M9 H9 Y3 }9 I% A# `! XNote as well that you can easily detect this method with SoftICE:
- m# K4 d+ o$ Y   bpx Get_DDB if ax==0202 || ax==7a5fh
9 V; h+ T4 g' V) z4 |
; {% d' K7 S* z* y1 d__________________________________________________________________________
0 C2 m& Q0 y$ F* F) |* [
( \$ W1 n5 M6 k4 P  [; E/ FMethod 10
7 R8 \' S. e, `: o1 C  `5 p=========# U. f6 Z' @7 J  `6 l

3 F8 e! h# I& J# ]=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with
- ?* X5 p  O& B' \! L3 q/ j3 d9 D  SoftICE while the option is enable!!% P5 K2 U( R) P+ y$ G# r

3 R4 P( _4 c; T, o: Y6 kThis trick is very efficient:
( c8 }) H: ]8 J2 d+ cby checking the Debug Registers, you can detect if SoftICE is loaded
4 D, T; L; h' q  l: P$ r7 F/ t$ n(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
- b, @  J. g5 F6 E! l6 o9 L2 i  [there are some memory breakpoints set (dr0 to dr3) simply by reading their" G0 O" ^+ y7 A; w( W& O7 ^
value (in ring0 only). Values can be manipulated and or changed as well
1 x- M3 j* v% H! ~% d(clearing BPMs for instance)
- |" |7 K8 U, o4 t
8 d: M" N$ I2 Q2 i3 l__________________________________________________________________________
* E- [4 `" r1 Z2 c* C  L- a3 h6 W2 u( ^  H
Method 11
; a6 g7 T! I! G7 }; g=========9 V' \- C# S6 R! g$ M/ L

# r. ~" g$ n& x( d# YThis method is most known as 'MeltICE' because it has been freely distributed% O) U8 l2 K" |& W/ O" A& k
via www.winfiles.com. However it was first used by NuMega people to allow# Q& j& e" `" k1 _& Y& b
Symbol Loader to check if SoftICE was active or not (the code is located
* A( H4 E0 u# O# u/ j  _6 a/ Hinside nmtrans.dll).
; y" Y+ B% S( d2 E( Q% t1 q6 r* a. ~% B$ N" q4 B
The way it works is very simple:
$ e2 P  K  I/ D* _It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for( _& m8 _! a, u+ u5 f! Z* @
WinNT) with the CreateFileA API.
8 F& N+ c4 H4 h! b
$ Y3 A& a, P7 P( Z' KHere is a sample (checking for 'SICE'):
0 t( H+ m, @) T- n  O+ ]0 _
, Q8 M' S- O7 l2 gBOOL IsSoftIce95Loaded()2 z0 _7 N* `8 h* ?/ P) o
{
& M3 R, U, j/ Q( f( z  F3 k   HANDLE hFile;  3 i! Y$ ?5 S3 B
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
" Z$ v+ }4 C7 G$ n  P3 L                      FILE_SHARE_READ | FILE_SHARE_WRITE,5 o, A+ n3 ]: E0 ]  A" S! `+ V
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);" L: F' B2 m. E6 ]. _+ \
   if( hFile != INVALID_HANDLE_VALUE )
, F% `, r1 h- v; ~: A4 ?2 \7 h   {6 Y( ?% }$ o5 X# s6 D7 Z( R6 W
      CloseHandle(hFile);+ t' Q1 E' L& j4 e& R: g
      return TRUE;7 Q; L+ x/ W; |, K  \- h
   }
2 o0 ^- q: Q5 \4 I   return FALSE;
4 c% ~/ U0 R/ {$ @! F7 J}
: S' A8 E( k, X3 f  e9 V7 \3 V3 Q8 y8 U" o* F, n$ i# _
Although this trick calls the CreateFileA function, don't even expect to be. k! n8 Z7 q3 O  G( W9 M
able to intercept it by installing a IFS hook: it will not work, no way!
# ~4 T7 V; K- O/ P3 bIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
" U$ h2 S, [% V, P4 Yservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
- ~3 N0 Y7 e; J. j. ~and then browse the DDB list until it find the VxD and its DDB_Control_Proc9 d% K$ B5 W* f) V0 A0 f& }' P
field.
0 G3 }$ P4 C7 t# S7 zIn fact, its purpose is not to load/unload VxDs but only to send a
& e2 J$ x  R# u* V: N: \W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)4 J3 j4 D$ p$ h! t5 [  r# m
to the VxD Control_Dispatch proc (how the hell a shareware soft could try* x8 [/ o7 z4 Y* T/ n  {( Y& M, t
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
; P2 I! z1 {" I9 z+ L, m5 MIf the VxD is loaded, it will always clear eax and the Carry flag to allow
& Y; W$ m0 g7 G, U( {its handle to be opened and then, will be detected.
8 }5 x% r- A0 i' {$ J4 {- ]You can check that simply by hooking Winice.exe control proc entry point
: L0 }3 I5 Q2 n, Ewhile running MeltICE.) `, _3 d+ b' w' c& @" g! l# o2 P9 l& [

+ H6 W# A9 }2 q; Q# [1 L2 x2 m& r) S) L* c. t" u! g9 C
  00401067:  push      00402025    ; \\.\SICE
7 l1 i' n' z. r+ `  0040106C:  call      CreateFileA
5 h+ j3 P9 U- E5 U0 G  00401071:  cmp       eax,-001
1 k- t2 b5 T: K  00401074:  je        00401091
- F/ j. v4 \  {& W6 F5 ^4 p+ R
: s4 B- D3 ~0 ~5 K4 e7 B& O( x* O7 i' v& r# @& r
There could be hundreds of BPX you could use to detect this trick." C/ x# r' h% e( A, P: J4 x
-The most classical one is:% d5 b. d7 N8 e- c
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
( ]" S) }; m% T! C4 _3 `    *(esp-&gt;4+4)=='NTIC'
- V9 P% |2 d' ^3 C, P0 t. o2 x2 Q+ e" I4 j- Q* e
-The most exotic ones (could be very slooooow :-(
: x- Z" r0 @0 q  b   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  
5 U0 |. ?+ d) |' `     ;will break 3 times :-(2 ^! \0 D: |* v, N( d& L! B' O

7 y; P# \! i9 \$ w9 i1 _+ v) S0 b/ j- |-or (a bit) faster:
& C3 ^+ S# [' A8 R5 |   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
/ t+ {( @. B3 u, P5 p3 G$ n* N4 P: y' G# i# }# C
   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  ( K# l+ N* \" g9 R7 N  L
     ;will break 3 times :-(2 n# c& B# p+ V) W/ i) A
2 ?+ W9 S4 m$ f3 T, ~5 i% i
-Much faster:
8 Z3 V# O; _1 K. w   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'1 d. G/ P4 q  {7 v8 T/ }$ q$ Q. J9 ]
. n0 p& F" r2 ^. ^, k) Z# V+ E+ Z
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen% K5 X2 }+ a) ^0 @. b: M
function to do the same job:
9 g& A( x' r# n" _! j0 n& i0 G
- f0 a) @3 h% G3 [" }" P6 O   push    00                        ; OF_READ) ~3 A& E# H/ N% D' S0 V$ s- \
   mov     eax,[00656634]            ; '\\.\SICE',0
6 y8 {& A% T4 Y+ E9 v   push    eax: X8 |1 a/ U( J4 n( z. M
   call    KERNEL32!_lopen
. K5 H: D" r- M  `  o, E5 G7 ?   inc     eax
/ M9 D2 X! t, d; W$ m   jnz     00650589                  ; detected
: F# F$ i: k8 g0 {- j& s   push    00                        ; OF_READ
/ j6 ?8 n. e2 w6 p! j8 V   mov     eax,[00656638]            ; '\\.\SICE'8 I5 ^4 f1 {  q! G
   push    eax
; S4 ^5 J5 Y6 q+ f3 U( Z   call    KERNEL32!_lopen% K6 v/ ?5 H- X2 j
   inc     eax
8 W2 J) |8 O# r( J+ y   jz      006505ae                  ; not detected% ?; g% ]9 a- d% y# n( r+ x
( m- S/ g1 L# ^6 q! B' X
5 \6 P  v. b+ F2 ~
__________________________________________________________________________% y- [- g; L2 F

7 [  s* U. i! {9 nMethod 12$ g* a5 E) W; ?
=========5 x7 ~/ r8 F8 q: R) g$ k  m

: ~! _4 l! }6 w/ u2 CThis trick is similar to int41h/4fh Debugger installation check (code 05, f1 w. _- S0 z+ j; v
&amp; 06) but very limited because it's only available for Win95/98 (not NT)7 m" T+ @" o$ z* W8 I0 k# G) E
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
* y+ \  ^# q- J, |" e/ p5 t4 \; L
* Z% i) v. t' M7 d  U3 A  M$ f- C$ n   push  0000004fh         ; function 4fh
# p7 Z) a3 x; Q% _) S& s   push  002a002ah         ; high word specifies which VxD (VWIN32)
! {- Z( t" A' b0 h                           ; low word specifies which service  o6 v/ b& G8 e
                             (VWIN32_Int41Dispatch)4 i0 b+ s2 K3 h& i' Y  p
   call  Kernel32!ORD_001  ; VxdCall
% C) b6 q+ D+ ?9 }/ d7 H) @   cmp   ax, 0f386h        ; magic number returned by system debuggers& k" s3 F) {6 I
   jz    SoftICE_detected
6 Z- \+ l% P. @. K& k) Z( f5 M
/ H+ ]1 f" S2 H' uHere again, several ways to detect it:( g  Q- [& n% N' @( M1 N2 ?3 A
# T9 b  m  P, H" @, o
    BPINT 41 if ax==4f
2 s$ ]$ U1 [7 z
' G7 S1 c8 _  F3 i, c, J) s    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one& w7 M2 M2 `/ k6 k+ S
' r! ^' t1 E. ?+ `  |) e
    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A  ?! Q- J; r( L3 i3 c( q+ ?6 e

8 C0 r: X/ R3 s6 C, p" x1 j    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!9 C, d$ E; `# H6 h5 l

1 H+ p! |( _1 n7 @$ O# u__________________________________________________________________________
$ f6 D+ r, ]! s5 U) W% |1 c0 B2 O7 _6 |- }0 P
Method 13* r, b) z7 Y* Y" Q8 o, D) v
=========+ |& u! V1 b$ n, ~3 h# V+ B

* }, ^  a' k9 r7 k$ x7 INot a real method of detection, but a good way to know if SoftICE is9 G4 _  B, I- b
installed on a computer and to locate its installation directory.
1 z4 j/ p/ D+ J* M3 s9 p0 n4 VIt is used by few softs which access the following registry keys (usually #2) :
) ~  {8 g. L" d3 L$ J$ {3 ]" l5 X/ a+ k/ l& C
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion1 @% s/ \, F' J/ w' ?
\Uninstall\SoftICE( }9 f1 X% \" w4 g
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE$ s* E; x0 }" Q# l' w+ Y7 n
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion* d5 C: O6 k3 y* Q  G& O
\App Paths\Loader32.Exe: \- X/ t  ?0 c8 c7 \: q. P

) ?5 k, X1 G/ J
) c: P6 m( g! x1 ZNote that some nasty apps could then erase all files from SoftICE directory5 b/ ^: n; [% I* s; m/ V5 J  `
(I faced that once :-(- O5 \* ?; Y& M: D$ h0 W
  Y2 F; V: h3 E* D3 @
Useful breakpoint to detect it:
3 S+ ~& j0 [. Z/ [/ T$ t; m# \  d) A2 a) M5 i
     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
3 }# `. N" P# H! f" w% C$ _0 \) S2 _# ]3 b9 q# a
__________________________________________________________________________
) |  K. b0 _! j: Z0 c- [: L- n( \# m2 E# ~+ x
+ ^# l3 a. K  e* Q- @3 L( g
Method 14
/ {, ]& S, s. B' v=========9 z& {* V5 t, Y. x4 k( k9 q

- f2 E6 {( B4 m" a! N1 ]+ }A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose, b  ^# W2 V4 q. h4 ~8 E" x* m
is to determines whether a debugger is running on your system (ring0 only).
# y/ K+ R' T) m! J4 g. H  a( k. l! \  T# k
   VMMCall Test_Debug_Installed" r' h0 a: E+ I3 y6 n. u1 m) N
   je      not_installed. R: p1 e/ P8 q1 W4 ^1 s! m7 h

8 v5 L/ g7 u4 FThis service just checks a flag.
3 t8 d2 t8 s* S$ E; [</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-7-22 22:08

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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