找回密码
 注册

QQ登录

只需一步,快速开始

About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
0 ?6 ^9 K$ h' L+ M* c<TBODY>
: X- y; k' V; H<TR>
$ R& O  K" T0 ~<TD><PRE>Method 01 2 U6 S1 a# W6 L6 u0 @- Y* _
=========
" m# ]  L" E7 _7 E9 p- d
2 G: r# B6 q( g: a  m$ CThis method of detection of SoftICE (as well as the following one) is+ z: ^, {" Q+ r9 l: p
used by the majority of packers/encryptors found on Internet.' k) p. B8 v3 o8 _: L- u
It seeks the signature of BoundsChecker in SoftICE
8 \6 {5 R* C: t4 U* M  W
) L2 \- x( H: b. [) h' X    mov     ebp, 04243484Bh        ; 'BCHK', T" E2 @- g$ ?2 E1 n- f
    mov     ax, 04h* B) i" o7 B7 E* t- a
    int     3       ; u+ h& O/ i0 g2 C. d. y+ U# q
    cmp     al,4: }- y3 l* Q& E
    jnz     SoftICE_Detected( N7 V* u6 R+ \
, C1 l( ?! H- P+ o
___________________________________________________________________________
4 x. D: b+ v: }  I
4 e% y7 W1 r3 I2 d, }7 f; _6 QMethod 02. q8 `' P7 Z8 g1 ]0 C, U: U7 t  L; [
=========3 S4 O! x) V+ T, G

" P' k$ D- F% c7 GStill a method very much used (perhaps the most frequent one).  It is used
3 I* g8 _& ?6 \* {: f; `& |8 M4 ?to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
) Y( _1 p. }/ G5 e/ t) hor execute SoftICE commands...
& f' v$ v2 P4 f) s( rIt is also used to crash SoftICE and to force it to execute any commands+ F  \$ U: W5 m& a
(HBOOT...) :-((  4 M" m0 w: {! h  B5 M

# ]* R: s$ L4 s" W: |Here is a quick description:/ s4 h: C$ D$ Q/ U- L3 Y
-AX = 0910h   (Display string in SIce windows)
2 s" I3 f$ P# b& o-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)
/ z; g# t) F# W- `5 N4 k' S-AX = 0912h   (Get breakpoint infos)4 V- C7 ^: F5 `- z7 |* N' ]
-AX = 0913h   (Set Sice breakpoints)
9 \; n: w3 X) E, j/ y: q-AX = 0914h   (Remove SIce breakoints)
  h" t! ^/ I! P% u2 a, S, j, x4 S  P( |, d
Each time you'll meet this trick, you'll see:
' ~3 y7 X5 i0 h: E) ~-SI = 4647h
& y5 O$ [& a( k, X, B+ |-DI = 4A4Dh
7 q+ J% K7 u! Y# I. E; U. h( V- @Which are the 'magic values' used by SoftIce.
2 }" M9 j) Z$ I: }9 @. x, z& zFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
' M" u3 Y8 n& N. C+ L( v) n1 L& O" c, q! m7 V2 I; v
Here is one example from the file "Haspinst.exe" which is the dongle HASP
  n* i- U4 c5 e! h9 q7 e' u+ l) BEnvelope utility use to protect DOS applications:" R4 d: L0 F4 t$ [) _$ Q; d- o0 D3 j
- w2 E5 w& |& A, f$ p
4 D4 |8 m: }6 p+ U& u
4C19:0095   MOV    AX,0911  ; execute command.
9 N0 u: S' k8 K5 P4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).8 G* B5 D# ^% J% g: r( Y+ n
4C19:009A   MOV    SI,4647  ; 1st magic value.
# @5 m% n. ?$ r; H4C19:009D   MOV    DI,4A4D  ; 2nd magic value.
; n9 `9 q' D1 ?+ f. j1 k  S4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)1 J1 {! d9 h; A) A1 W0 W5 n$ T
4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute$ ~* J# q" e; V! h" d
4C19:00A4   INC    CX
' y( C6 i2 q: ~+ G4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute
  K' \' J$ ?) M5 `/ Y/ l$ Z4 f& ~# k4C19:00A8   JB     0095     ; 6 different commands.
6 ?, B$ F- w0 U$ Q4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
, y4 u0 i5 G' T; N2 p! G2 F4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)
% \8 a9 w  @$ H0 m0 o9 H: a$ H9 U+ ?: |. H
The program will execute 6 different SIce commands located at ds:dx, which
3 p5 r  k0 ^* Z, P9 z0 ~: _+ lare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
; Y+ P6 V: d( ?- b2 _! W) Z2 r( X+ L$ _0 g
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.- C. `/ q8 `" U- ]) r4 T( K' }
___________________________________________________________________________
% f' X' T8 _" b* g; O# q& B2 j! z1 E+ b# Q4 H1 g/ |" r

% v, t% h2 z! x% e1 wMethod 03
7 X6 F1 q2 D5 R" m7 ^3 Q3 Q=========
4 D6 k9 ^9 z5 @7 w" P8 x7 A0 [6 Q/ O! z& R
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
  s- U; W8 P. P, h% d6 R% g(API Get entry point)
1 ?) F! \* e, g: W3 ]5 T( e        / z: `3 @3 Q6 {! m

; p/ _9 T6 e! h% H" |    xor     di,di
$ Y/ j$ w4 y! W$ H; d. Y    mov     es,di
6 r. j' ]6 _. [! G: A; v9 t" F8 R    mov     ax, 1684h      
2 ?% B1 C/ V/ t$ \0 _" i& V    mov     bx, 0202h       ; VxD ID of winice2 k9 M; y5 b5 j# a
    int     2Fh/ v: Y1 R6 M; H: {! `$ T6 n
    mov     ax, es          ; ES:DI -&gt; VxD API entry point* _6 G' C$ h  b3 z% p: u$ Y
    add     ax, di  z: u+ T2 }& j3 s  V5 s
    test    ax,ax+ @9 [5 M  R; e
    jnz     SoftICE_Detected
) t, d& y7 Z" V" ?" O0 w
* h6 h3 I9 ]6 m3 M2 s$ b  d7 R___________________________________________________________________________
: k% w  m, k1 R. V  m# C1 \1 E: L& T6 F6 D  M. Z0 W- r3 }
Method 04
8 V; _4 D: G' o9 ~2 Q=========
8 }# H1 ^7 q# Y0 M- J7 |. S. t! p( A
Method identical to the preceding one except that it seeks the ID of SoftICE( ~& m. K; M. }" f4 G/ w' _; U3 C1 c
GFX VxD.
% c/ m6 e2 X  s3 c+ J/ F' U9 E# X4 y6 A
, A; f3 F/ t7 A- @    xor     di,di
5 n! f+ ]. R/ [/ {* q  m    mov     es,di1 n$ B' h# ?9 X$ A- G* o
    mov     ax, 1684h      
. U) {. \, }/ \4 R% B) e    mov     bx, 7a5Fh       ; VxD ID of SIWVID( `( w+ L4 ?- i; E1 }' h1 X
    int     2fh) W) E. ~! C9 ?; D) z# [) Y5 i
    mov     ax, es          ; ES:DI -&gt; VxD API entry point
$ f& Z5 ?# n% ?; k4 r1 ^    add     ax, di0 m1 d8 ]$ j# O
    test    ax,ax# C, T1 _" `% a! P8 @/ A0 G5 t
    jnz     SoftICE_Detected" `2 o! h* n; ~
. V' |7 ], W3 @  q2 _/ r
__________________________________________________________________________
* t" w: o3 D7 |$ ~* J+ O/ ]6 L% V/ M3 F9 P* L

: U: f4 y- H0 l( nMethod 05$ [- L9 j- E8 `- F+ I# P% D6 S
=========
' p. `, I3 L" l6 y0 L6 x9 h9 H+ h3 s0 _/ x7 R
Method seeking the 'magic number' 0F386h returned (in ax) by all system4 S/ H" F) e; r$ }+ n( C' k* ~
debugger. It calls the int 41h, function 4Fh.
$ u% @8 V8 r% p. MThere are several alternatives.  
  v. g- @, p  O& A( @' T; Z' w
; o5 R2 r! b6 s2 f4 SThe following one is the simplest:
' a3 ~; K" c* T6 ^( F% P9 b" z6 r# _) g$ P0 G+ v; P, s6 J
    mov     ax,4fh
  r, \5 j  Y# R  J( R9 t4 K    int     41h
! _# _1 d1 D! Y: ~: v/ n! E2 m    cmp     ax, 0F386# c2 y+ K, Z& F0 c
    jz      SoftICE_detected
4 i9 s4 E! a# h( e8 o7 Q
2 b. r0 Q+ R& U
9 J, ?6 O1 U- X4 p! T3 E( FNext method as well as the following one are 2 examples from Stone's
- C- e3 X5 G4 A$ _3 t: D"stn-wid.zip" (www.cracking.net):
/ u4 y/ m6 C' a8 z% i
: O! y- ~# r7 Y6 E1 e    mov     bx, cs& O6 D& |: G" y
    lea     dx, int41handler2
9 f- {7 v. K: ~1 ]# S. Q    xchg    dx, es:[41h*4], D3 j: w9 G8 o3 K/ e( u
    xchg    bx, es:[41h*4+2]
7 `2 X* Q5 J: E    mov     ax,4fh2 g& v/ q! v# {1 n$ l& L# k+ V
    int     41h5 }8 p6 l6 b) A$ @) _9 _( h
    xchg    dx, es:[41h*4]
$ T+ I' ]  d, a1 ]    xchg    bx, es:[41h*4+2]
+ v# o/ o: V( z    cmp     ax, 0f386h
& o2 T: H2 Y' x; t, e2 G    jz      SoftICE_detected( Y7 N' D+ V) m/ f
0 u3 |& V* A4 x/ }. {6 V# D- S
int41handler2 PROC
! \$ ]+ T  k9 d/ t8 O- M; {7 ]    iret, u% ?- b; I/ ]
int41handler2 ENDP
6 D3 w# |& b' B4 E$ H$ c1 d
! n) x- h: r" ~; q+ l/ Z) e+ ~( @+ j, q( G% [" ~; R6 q
_________________________________________________________________________
. R3 k( S+ {1 w" e# b5 e; }; T* w* q$ [$ }9 x8 e9 y
! O/ q' _* ?8 S7 L" R; ^: M! X
Method 06* O$ c$ I. v3 ?0 X4 ?! U
=========
, K2 `" h: W; K+ f$ ?3 G+ B( x/ H$ B7 ]1 ]- n4 _
/ h, v* l9 A8 d6 x- D
2nd method similar to the preceding one but more difficult to detect:
- B9 n5 R7 N7 P% f8 K" |' j7 k% n
0 _0 y/ \3 ]; _% \) Q+ m; _$ S
int41handler PROC* \4 Q% z4 N# M. y1 Q, d
    mov     cl,al( x8 K7 X8 c. G
    iret8 q* A  F8 o- ]# O9 \
int41handler ENDP
9 R' r1 f1 v8 F8 B; q' T3 b8 c4 ?* j$ x- Q
1 l/ ^$ d+ X, F0 q1 F9 x6 Q6 y) E
    xor     ax,ax" C' L& m! C+ o8 {) Q4 e
    mov     es,ax$ e+ A+ V: E$ y9 n" W
    mov     bx, cs  k6 d1 }# m; C; ~2 b3 W! U" H
    lea     dx, int41handler
  y: v& }4 X$ l' T    xchg    dx, es:[41h*4]
  L6 k% v( O% f    xchg    bx, es:[41h*4+2]
9 f5 R& D" y: @; E    in      al, 40h* B& A8 p8 `3 K
    xor     cx,cx  F6 @% G$ F0 P( a& ~& m
    int     41h
- {$ j- o( q+ I, e% z8 Q9 o% C3 g    xchg    dx, es:[41h*4]
: {  n0 g* C- t. X" ]    xchg    bx, es:[41h*4+2]: {6 c5 u5 p8 w0 t7 h  B! ^
    cmp     cl,al
0 I; f) B$ n4 r3 H. k2 O    jnz     SoftICE_detected
2 ^  G/ ]* K% E/ k1 n3 k: C% U9 U6 l% V& M, w! n, g0 I. o; l
_________________________________________________________________________. x% I9 K6 p$ U% `3 q! ]+ v
( I2 }: C& e' v9 ~2 o0 m. v% L
Method 07
1 M3 E9 A* C( g) w3 j% R+ M! M=========' o# a/ C( S+ F( H3 m" K; T

6 w' R8 j: ?/ M) S+ CMethod of detection of the WinICE handler in the int68h (V86)* X4 k9 T$ G# A& s( M
  x  T# t; Q( P+ ~
    mov     ah,43h9 r/ I! c: r! A
    int     68h) L. ?3 F$ p8 w" ]9 T' q3 r8 g
    cmp     ax,0F386h/ L. {/ v4 R6 r' E0 S5 H, R4 a
    jz      SoftICE_Detected
! L3 A  X- C- j1 S0 A6 ?: ^: b1 [: d! b# p9 @" C* S. M8 [) c8 j

2 T' D3 ]4 u( ^* l1 c=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
+ {0 C; q6 x; i  g. H   app like this:8 Q( m. U0 O& t- G3 z+ L
, {. u1 J; ]& f8 ~4 B2 [& T
   BPX exec_int if ax==687 J* a* v. Y: L& @  Q
   (function called is located at byte ptr [ebp+1Dh] and client eip is
9 v; U) s2 g" m* H" V+ R$ x0 ^! V   located at [ebp+48h] for 32Bit apps)
1 R+ M+ P8 u; ]% E. {7 |__________________________________________________________________________  ]8 J5 @9 J7 n) o: O6 i+ B7 R9 Q9 p* D
$ b" ~; |( J& ~  Y9 J, F* q" ?
# l0 z1 {+ L0 V9 i  r
Method 08
/ Y. J- e9 N+ [7 Q  }1 ]' X=========
$ k2 U, S/ B$ q1 i/ [8 t& x$ s* r' ~% X8 z
It is not a method of detection of SoftICE but a possibility to crash the/ @' f5 C8 g4 Q7 h0 |; |
system by intercepting int 01h and int 03h and redirecting them to another
1 j4 {' d: q9 Q. F4 ]routine.
# m5 y1 Q- K/ I: p+ @" FIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points; R. d: F! L; P1 W+ S
to the new routine to execute (hangs computer...)1 t5 b3 h5 w( v) Q, c, ^5 n- ^% j

. F  N2 S6 e# S$ j; k0 U    mov     ah, 25h) y4 w3 n$ B( C; o5 e! a9 @
    mov     al, Int_Number (01h or 03h)8 `  A. d  g' _$ g( v
    mov     dx, offset New_Int_Routine$ g  ]1 A( f& k; C' R& A
    int     21h* C$ z, `/ T) ]8 `

3 T, D/ A# A: L. Q; ___________________________________________________________________________% G" ^, O+ \6 d% g# d* i# U

, n$ @; {" U9 b: c/ p( D  }4 nMethod 09" B; J/ D2 z0 y) v! J. @3 Q
=========
5 N% }2 y: W3 h6 J) T" Z. v. u" V6 i& S+ J
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
: \' k4 R) R$ z3 \8 c2 D1 Qperformed in ring0 (VxD or a ring3 app using the VxdCall).& R3 o/ u6 L% T- f: h
The Get_DDB service is used to determine whether or not a VxD is installed7 x' o' Q7 m' H& D2 x
for the specified device and returns a Device Description Block (in ecx) for
' F3 C! ]4 o% M2 a1 @) dthat device if it is installed.+ m1 t2 _( L' Y

' a# V& G4 M2 w. V   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID
. E; c9 V2 J2 r   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)/ S" o6 }3 \' r% |/ o+ _. q
   VMMCall Get_DDB6 Q8 P, v1 O" R6 h' ^. E# ]% g9 K
   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed
9 ~$ E+ {9 b6 y
! n( w6 a: [, S! a; [Note as well that you can easily detect this method with SoftICE:
% [, l9 ^- j  s+ N   bpx Get_DDB if ax==0202 || ax==7a5fh" n: p5 f# F1 C" W  s3 W* f  j) c
2 s- e$ ]/ |9 U* t4 @
__________________________________________________________________________
* o( w: M0 _: {
( _% }+ w0 M1 t8 f5 J" rMethod 10. m: |, T2 W" t4 ~& Y% Z7 J, @
=========# r8 h, Y1 D% r* L

) }+ l& ]; ]' N7 R+ x9 p=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with
! o( Y1 \! U8 L6 L7 w* K/ u  SoftICE while the option is enable!!* M% y% w0 U5 ?9 r
$ k6 t; I- x5 N6 h4 Q/ \
This trick is very efficient:# e, Y' ^7 Z( P5 `( M
by checking the Debug Registers, you can detect if SoftICE is loaded
/ Y% M$ U+ k- Z(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if/ j! p  t# o" ^, q# `6 v! O
there are some memory breakpoints set (dr0 to dr3) simply by reading their8 Q( |4 v# ?4 @6 L0 a8 n
value (in ring0 only). Values can be manipulated and or changed as well' _' [% {% Y# Y
(clearing BPMs for instance)6 J$ U9 ~1 k8 V2 M0 c4 ?& L

1 V( W, @7 j, `' \; |__________________________________________________________________________
7 Y1 M; J! c# \/ X" i0 o- q4 E8 f$ Q. v$ ~( x9 {4 v
Method 118 ]; R; p% K+ Y8 }5 ^7 f% A" i
=========
# _& J2 j2 k6 u6 ^" J( b( q8 K5 o
This method is most known as 'MeltICE' because it has been freely distributed8 t* v5 G% @: S# `2 Y( W) e
via www.winfiles.com. However it was first used by NuMega people to allow0 K2 y9 n3 B( ]9 ]% @* @) V
Symbol Loader to check if SoftICE was active or not (the code is located- g: n' f+ Q; X* ~
inside nmtrans.dll).1 H/ b8 r6 V; {  K) t; u

' k. D+ d$ E8 V/ I% KThe way it works is very simple:" u# v& E& p1 m) ]! |# N
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
) y5 F2 k3 G2 q+ `! e! bWinNT) with the CreateFileA API.
0 \% n% Z1 S" ?/ G1 n, a: a* r- G; B6 s- C
Here is a sample (checking for 'SICE'):7 Q( G" A) `; t. o: r6 R9 Q
4 R, {4 e) a8 V1 r2 ~% H8 o
BOOL IsSoftIce95Loaded()+ w0 c1 v# W5 ]6 G
{9 e: {3 s9 h# b, s% I% y
   HANDLE hFile;  
/ Y/ r, f, }( C4 _6 W% R% o, ?3 ~8 a! p   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
' A$ H+ Q; u# U9 |. Q1 r. {! t                      FILE_SHARE_READ | FILE_SHARE_WRITE,
' J! _- H8 w9 ~/ x8 G                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);6 [5 h6 @5 a# a
   if( hFile != INVALID_HANDLE_VALUE )
' o3 V- E) X% ^2 o7 u   {
2 A% [' z8 k( ?7 z( g: n      CloseHandle(hFile);
# q; B4 i+ L- q) }; W2 e9 L) ^      return TRUE;& b4 `. c" o3 Q" {
   }
' K3 x' s. M; r* [/ f" a( [   return FALSE;7 N. b" H8 \# i
}
' w# N9 X" F$ M# h2 T/ P$ R8 P% X
5 G( r3 L6 W. {5 lAlthough this trick calls the CreateFileA function, don't even expect to be6 g( H3 j, O% D& ^7 t
able to intercept it by installing a IFS hook: it will not work, no way!# \$ h' n; l! n, h* A! n
In fact, after the call to CreateFileA it will get through VWIN32 0x001F3 N" y& D6 C, ~! i
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
  Q8 q5 U, W7 m) i- [and then browse the DDB list until it find the VxD and its DDB_Control_Proc
5 e0 M+ H1 `. r) B1 ofield.
- k6 E2 i5 k. \7 BIn fact, its purpose is not to load/unload VxDs but only to send a % q5 _# g( @2 d* i7 X* b1 N- ]
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
8 ?; W+ ?: c9 N# W: [to the VxD Control_Dispatch proc (how the hell a shareware soft could try
; I, w) X% O' d6 X% t( nto load/unload a non-dynamically loadable driver such as SoftICE ;-)." f$ T+ ^: H( F
If the VxD is loaded, it will always clear eax and the Carry flag to allow, Z5 ]' ]% l% E) v6 L8 B
its handle to be opened and then, will be detected.
8 J$ Y# O3 Q$ J2 @9 Q  x1 A% hYou can check that simply by hooking Winice.exe control proc entry point8 s8 ]+ m9 O3 |9 E. B, ~7 L( z
while running MeltICE.
2 b6 K' e8 H+ O
8 l; H9 N# p& I( ^  t2 x9 u. `) P/ K: ]
  00401067:  push      00402025    ; \\.\SICE  v- ^7 `: P8 A" T3 }' h6 U
  0040106C:  call      CreateFileA$ @7 L: O" o! F5 k
  00401071:  cmp       eax,-001. F! @8 p/ m. W/ s
  00401074:  je        00401091
8 J# F+ [8 T$ F7 A7 k6 J# \6 x. _1 P+ [

; B( r0 @; z& ^. b! Z6 X$ lThere could be hundreds of BPX you could use to detect this trick.6 O' g6 ^8 p  T  E* K
-The most classical one is:
2 q8 Q) Q$ o* \% d" i/ Y9 [" B" [2 [  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||" l+ E, v6 c* F4 n; x1 |1 _- C& N
    *(esp-&gt;4+4)=='NTIC': X" @; z% H! e# {4 z, j
2 n0 t7 S3 y3 `% F( ?! Z
-The most exotic ones (could be very slooooow :-() ?6 A) D! R; w0 \/ n. z
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  3 k/ H0 u7 t- j4 J  R( g! y% n
     ;will break 3 times :-(
. d2 v( b0 s; h% I1 j7 m9 J  n# t1 v+ ]1 w
-or (a bit) faster:   n' E" W0 i) K/ w' S$ s" _
   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')8 \. z# W. j7 r

6 l! M, c# v6 G7 B. }) z2 y( K; Q   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  
: T. o% M6 i! u/ \1 u' ^$ A* E0 H1 x     ;will break 3 times :-(8 T" A3 g8 A- i" j) C' r; O4 D

# p6 v7 j1 `( C-Much faster:
- T% U& X1 D5 B* R* A2 e" i   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'
0 x+ g: a; S0 v4 }9 x
7 a: b  r& p* Z6 HNote also that some programs (like AZPR3.00) use de old 16-bit _lopen8 v7 K; m8 k" E6 b* v8 a2 m- c9 ?1 N
function to do the same job:2 p' P# G) c* r# A

  f% \' k3 d, p7 S3 l' S; T   push    00                        ; OF_READ8 u$ L: U; u5 U8 `  y) U" |
   mov     eax,[00656634]            ; '\\.\SICE',0
5 S5 [7 G. Z# Q! h% a   push    eax
' c5 ?) }' U6 K4 R- c' o, f   call    KERNEL32!_lopen9 o$ m4 a9 Z5 z, a+ ~( q+ @
   inc     eax
2 |  ?6 E. ?; [   jnz     00650589                  ; detected
9 i( W% l, u$ N6 k6 t* C   push    00                        ; OF_READ9 l: y$ J$ ]/ p( u7 A
   mov     eax,[00656638]            ; '\\.\SICE'
! d6 s9 c% {% v9 a# [   push    eax6 V7 S( N) ^, F( b# k' {2 _6 L
   call    KERNEL32!_lopen
9 Y+ i9 e0 b# b( D) a/ @/ F4 f   inc     eax* @' H# f+ C( f% }3 S+ b
   jz      006505ae                  ; not detected
$ Y' c1 y! S! W6 U4 C! s- W0 s9 q7 N1 ~9 g# g7 k

8 t0 \( J2 k! E0 r__________________________________________________________________________8 U+ v4 K, K/ F! j1 h
4 D$ C+ J7 H% T/ h! E, S) R* n
Method 12
, m- |* Q+ V! e, \$ [=========7 u, H$ H) V" {4 f, R
. [6 c3 {4 O: e: g9 X
This trick is similar to int41h/4fh Debugger installation check (code 054 H/ S4 f% D" B3 `; A# g5 v- D+ n
&amp; 06) but very limited because it's only available for Win95/98 (not NT)6 T/ F) f- o& m/ L$ W
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.0 T% a9 H% n$ e1 r4 V- J
# ~! _1 \1 P/ r& Q& m
   push  0000004fh         ; function 4fh
5 V) [# n, ?% b1 |' o- e9 [   push  002a002ah         ; high word specifies which VxD (VWIN32)
/ f) j8 b/ C% O* X7 Y) ?8 u, `( C0 S                           ; low word specifies which service3 [4 Y3 m7 `. `
                             (VWIN32_Int41Dispatch)
) J+ n0 O7 E' w   call  Kernel32!ORD_001  ; VxdCall) \. p( c% q) _! P
   cmp   ax, 0f386h        ; magic number returned by system debuggers7 x9 }% V3 ~+ Y; p" m0 O
   jz    SoftICE_detected
% k* d" l1 L: J* T$ D% t* a$ r( K# [; ^
Here again, several ways to detect it:
* E: ~: h) ~5 ]0 q& R4 t: k1 v" {  A8 L0 b& [2 J; g" v8 H+ X
    BPINT 41 if ax==4f4 F* B1 X' M5 Z' J
' S7 c* W% w. q8 Y
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one8 @3 H. b# v1 \' q& \
2 U2 }& \  x5 h. e8 `) y) n- }
    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A. O! v% y; u( V& ?5 ?" W

* k  b" N4 `7 z    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!
# ?5 z6 q, b# J" g
$ J9 z" l0 \- c0 Z. L8 O__________________________________________________________________________
. B1 C! S6 e- @6 i1 t7 U9 z# b5 c. n. T8 x  v" V
Method 13
# ~! [" @& a1 J& O9 [& d=========1 R  c- o: D( v8 N+ V7 A+ j8 V2 _; b
4 @$ [- m, v/ a7 F- n6 V
Not a real method of detection, but a good way to know if SoftICE is
" w9 T  I2 _9 i9 d* |# F8 D, |3 J9 Rinstalled on a computer and to locate its installation directory.: K+ X- W( o- L5 B* e
It is used by few softs which access the following registry keys (usually #2) :/ T3 W0 R; V- V5 s

. L2 o$ _& w: z- G/ p) M/ G3 p-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
; D2 s2 Q2 V6 N5 Q& Y: \\Uninstall\SoftICE* z  l& B! F0 V5 c4 T
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE8 Y/ Q& J& V* |" z
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion3 O6 A$ D/ a* X, c' ~* a
\App Paths\Loader32.Exe% }, S+ a0 K: \& c$ n; x; X

/ B' A9 U1 k* M4 H
( J+ d% T7 b  Z8 P8 @) S! }Note that some nasty apps could then erase all files from SoftICE directory1 O$ ^* p$ e( A- j, H% e( W
(I faced that once :-(
) Q) B8 Y8 x' T
" g) e3 N; D1 K9 k/ F6 lUseful breakpoint to detect it:
- A4 q. N- I/ u9 {5 @& L, P4 Q
: N! V% H( y' A# h* r. \     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'3 c! x. q. f4 u- S- f" `' ]

; O/ w; r- l3 P0 J( o$ L__________________________________________________________________________  L: A( v  H6 X# o3 x4 o
. D* U1 i9 L& e- z* ]$ ]

5 S9 s5 _& P/ a) B0 uMethod 14 ! a% Z; Q  |/ A9 _; m3 n4 Q; y
=========* {3 y" X) e4 E# r. q3 X

2 ^% Z: i/ P+ ^6 d7 UA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
, E+ _5 v/ Y8 U9 v$ Fis to determines whether a debugger is running on your system (ring0 only).
1 r' i7 S  |: J$ U6 K
4 S: I9 J  W( t" V, {4 _   VMMCall Test_Debug_Installed
9 W+ `$ S2 p- i   je      not_installed
7 ^0 E5 n+ G1 g2 g) `4 D& h# ?3 z0 {$ |1 d
This service just checks a flag.
4 |0 N  }3 u/ F- l' U8 E0 n. Y</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-8-5 11:58

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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