找回密码
 注册

QQ登录

只需一步,快速开始

About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>* r( G' I% m' v3 B4 n" {
<TBODY>
# w- h: q* u( n, V<TR>
! Z6 L5 l  L# P<TD><PRE>Method 01 6 [& X8 z# P# M' ^! |
=========- Q/ R$ p. X, Z' J0 D( G. T7 Y

: q# S" n3 @3 E- l4 k8 [This method of detection of SoftICE (as well as the following one) is
+ T1 X4 S: O0 {5 O7 Lused by the majority of packers/encryptors found on Internet.
& ^8 x$ l8 `: i" G7 o. g! W9 cIt seeks the signature of BoundsChecker in SoftICE, V+ B0 E3 {( ]
# Y: f! N; z9 ?7 i
    mov     ebp, 04243484Bh        ; 'BCHK'
6 H4 Y! ]+ x0 D' K    mov     ax, 04h" }- G8 B. _7 H: L5 a# i2 ]% E
    int     3       8 j  j6 q% [8 J5 c0 S3 a# z9 t7 |
    cmp     al,4
! r9 N) ]! Z9 w$ z  X    jnz     SoftICE_Detected# Q  r) r7 R0 t$ S  ]7 z
- [2 p3 _9 j* E+ c7 e+ B
___________________________________________________________________________
4 G2 _: n9 U  v9 t* _. N
% p3 d: I4 b2 u8 b. }4 hMethod 022 _4 k. e5 j6 i# R) R( r( j4 e
=========4 H  f, s2 d4 A$ R. ]1 P1 w

/ j/ [1 c8 [; Q+ w: h3 tStill a method very much used (perhaps the most frequent one).  It is used
6 v' w0 A0 A) `! U4 ~; Y: }4 Oto get SoftICE 'Back Door commands' which gives infos on Breakpoints,5 L. P2 \, j0 P* c: S, W; I
or execute SoftICE commands...
: E! ]/ }* ?, JIt is also used to crash SoftICE and to force it to execute any commands
/ G  G# l, O% w. A; J* j(HBOOT...) :-((  
9 U* i/ ?7 H& u. g
; |- e& Q# k$ B0 A$ l9 h6 ~& h7 OHere is a quick description:2 R! q6 M6 \2 o, o$ m9 {
-AX = 0910h   (Display string in SIce windows)
2 U- q9 t7 J6 D( {( \-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)
6 L- e0 Y3 B. j5 E$ p) ]) e: u-AX = 0912h   (Get breakpoint infos)& Y0 X5 V; y4 E, y: K/ d
-AX = 0913h   (Set Sice breakpoints)
- \4 E- W" Q4 k# C1 Y-AX = 0914h   (Remove SIce breakoints)( O* L6 n4 A( S: s- l4 ]
9 `! ?8 M: J* v% b
Each time you'll meet this trick, you'll see:- A5 v  D% {: A1 B% _- m6 l7 l
-SI = 4647h
& m, Z" S! F9 [7 o-DI = 4A4Dh- x. B. l( D  {! o( l
Which are the 'magic values' used by SoftIce.
- W# D* X, b; U& {- uFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
- u1 f# Y2 y1 h) \6 V( i: @! k8 |2 x2 Y- C& t
Here is one example from the file "Haspinst.exe" which is the dongle HASP
( p* p* W- Z9 U9 {: p4 OEnvelope utility use to protect DOS applications:
! c  S9 C4 Z% Q" F
& a) a- F9 G$ w. }& w
4 h( y* O# {2 ^/ |* |4C19:0095   MOV    AX,0911  ; execute command.
! r' |" V9 Q4 {- @4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
8 i- E$ p* b+ N1 M; ?4 Y4C19:009A   MOV    SI,4647  ; 1st magic value.
# d# a5 @( m/ \5 F9 q# z4C19:009D   MOV    DI,4A4D  ; 2nd magic value.
6 @0 G3 X# u' F% ?& A4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
& m) a* S9 D- C" y8 |5 H4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute, q& C8 }3 Q$ C
4C19:00A4   INC    CX* G  ]  i# e$ \6 H( z6 O+ G" C' O
4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute
, Z" D7 ~) ^" f7 f& f4C19:00A8   JB     0095     ; 6 different commands.4 A2 u( K/ B3 g+ j) u3 u1 b  z5 l) a
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
. x% h/ z) S* g6 F2 V4 Z4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)4 {5 `8 k# x) k- R0 A2 u) A

- l$ P$ ?* @  h8 s; k4 }9 b# `The program will execute 6 different SIce commands located at ds:dx, which2 y$ X4 n1 O1 f+ }
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.9 K& c) r3 j1 N8 l; u7 J4 |
+ Z. ^. S! m8 G1 ?7 W, A0 d' G: t
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
: ^) t& C% F# B___________________________________________________________________________
1 y! M* y1 S1 i. k% a2 w: ^7 D# ?$ ?9 p. Y( U

- n5 U# l+ y+ U3 j: M6 d) c# v/ rMethod 03
: ^" l0 H# ~2 R8 g) m$ h6 v4 U=========
/ R- p& y& v5 P3 t! [5 O6 A% _, p9 f- a
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
! U7 |7 [: E+ U( F: Q(API Get entry point)
7 K& v9 s! u) y! ]! W+ o        . ]0 r; m2 w/ i+ T& D
; O$ t8 r7 x' C
    xor     di,di& i. x* q" N- d8 d
    mov     es,di
6 F/ e" Y$ ^6 \& K, K" ]# Z    mov     ax, 1684h      
( B4 B( a( C" Q* [$ e8 H7 R8 q    mov     bx, 0202h       ; VxD ID of winice! R1 I* ?# d  M
    int     2Fh, r; Q% q( M2 ~3 q* G. @7 x
    mov     ax, es          ; ES:DI -&gt; VxD API entry point) `+ k. y6 g7 B3 v, P
    add     ax, di+ u8 j3 l) l$ d/ C& O
    test    ax,ax
5 \0 g! B+ ^2 `; W- M1 P) r# b/ P    jnz     SoftICE_Detected
3 a! Q! M, E0 g6 ?
9 I; b& t/ ]) w, q4 K___________________________________________________________________________
7 \& }* @7 w  @
/ X3 u/ t0 c5 Z/ z6 y. _Method 04
  [* a" {: ~, J! s8 ^=========
1 s* c) v: r  K9 b
: o3 A2 J# o* R! GMethod identical to the preceding one except that it seeks the ID of SoftICE7 j$ k( q- \- n7 `( {5 J- h
GFX VxD.
, x8 s5 l" D! R- C# o5 d+ J, U
    xor     di,di- U; A) u+ G  [9 Y2 F9 {7 Q6 N5 ]
    mov     es,di
/ f. Y4 s/ ?& R- }. S    mov     ax, 1684h       - V: k& Q" L8 T" w+ Q/ J
    mov     bx, 7a5Fh       ; VxD ID of SIWVID  E; h- M! r( H, I3 e6 c
    int     2fh" A7 q3 X1 n. V8 z2 l
    mov     ax, es          ; ES:DI -&gt; VxD API entry point- z3 I( u! {0 ]* g1 m
    add     ax, di
/ s+ E" O' t- g- B- @- O$ T  B    test    ax,ax4 I7 D& l8 r6 m. w0 g* @' A
    jnz     SoftICE_Detected6 ^0 m0 G* @6 N6 c' I# I

. X+ \& \3 h  ~1 c__________________________________________________________________________" g) y" }5 D" s% ^$ ]
, r& V, l4 M/ e; x
6 }) }# Y9 t/ Q5 G/ T
Method 05
0 Q& O- N- K" q. B6 ]=========4 K  Q0 f3 o* y% J
- e2 N  E! N! J- s3 I
Method seeking the 'magic number' 0F386h returned (in ax) by all system% ?/ w/ o" e1 j* Z
debugger. It calls the int 41h, function 4Fh.
  G4 n& H$ n8 H. S$ ~% m( tThere are several alternatives.  
3 u+ D% z6 h: `, A4 U( e* s$ i. R8 i( x6 W
The following one is the simplest:6 Q5 _  l. A$ v2 j

8 P5 ^  D; Q$ H" L+ s3 Q1 P    mov     ax,4fh
2 a& [* r2 d) ~7 ~- s) y: P    int     41h
9 A( Z) |4 m0 g    cmp     ax, 0F386  m3 i+ Z4 I& l# r
    jz      SoftICE_detected9 p" s  n, R; e+ t% k' n8 |/ M
4 j% M' H: @: j8 b0 P' ~) [

6 [6 h8 x8 Z9 z/ c7 b/ Y. q2 jNext method as well as the following one are 2 examples from Stone's - L7 u3 a* P4 i; y5 Y' G5 W
"stn-wid.zip" (www.cracking.net):
( z7 M9 |4 m2 |. q7 a  V# H& D7 w! U; @& a/ \. g% w0 C
    mov     bx, cs# ?: @) S+ w9 o" a5 [2 f& E3 F
    lea     dx, int41handler2
% l# l. P5 x5 x& [( O    xchg    dx, es:[41h*4]& H% |' Y5 D8 E  c' s1 p& g, J
    xchg    bx, es:[41h*4+2]( A/ p; t9 H1 O3 B: U4 j1 Y  H1 @
    mov     ax,4fh( r4 P0 T) B. ?! b' r7 ?7 T! |
    int     41h
$ y3 ]" l. |7 A3 x    xchg    dx, es:[41h*4]5 q7 F7 s! e6 Z; Z
    xchg    bx, es:[41h*4+2]  n& G  H, y% C9 L! H" @1 w! l
    cmp     ax, 0f386h4 k5 V3 ^9 i! ~  h
    jz      SoftICE_detected0 E* _1 n# R( s6 k  f" r3 z. {$ A; ~

% R  h9 ^9 _- f5 `2 t: |int41handler2 PROC+ ~: A$ W! x/ ?+ N
    iret
, K+ }$ U) z& K. T7 Q6 t: Kint41handler2 ENDP
% R% @0 S. K4 z: T( {4 n) c
8 Q' v9 D3 W1 p; u' k% }5 i4 _; g3 I: O" H! J. L
_________________________________________________________________________
: W& ?( @; o# V9 l! V- A4 k  }& C& C
' m6 w' u- A; K$ r6 D8 w* k
Method 06' ^7 ?: G$ I- n  B4 n( w
=========3 d5 H. _$ R" P6 q2 Z$ C& D
6 s0 a. e3 y! v, `. S
2 b1 D: F( c0 L0 b: g+ l
2nd method similar to the preceding one but more difficult to detect:
6 J$ W1 t$ F% ~/ O2 s* T& }3 w" z, {* n/ h
1 y! a" R  k% L% B5 f- M  B, Y
int41handler PROC
8 k8 i: M% T, k! g. ^' |& [8 p; P5 @    mov     cl,al5 Y; u7 j% C7 b% c
    iret8 g) ~; @1 q0 W+ B: a  F
int41handler ENDP
6 J1 `8 I; c, K& r+ s
& {$ |/ Z& x! O8 d$ i" E( {" L3 N' t% P
    xor     ax,ax
5 Y+ u; L- W" Z5 y; W, Z$ `    mov     es,ax/ Y5 C) C, @9 r0 ~7 k$ d
    mov     bx, cs& H7 c/ b- I6 O2 l& {
    lea     dx, int41handler. h6 Q% q/ }" s! Z0 L% v
    xchg    dx, es:[41h*4]
. A! W' U8 ?1 Z7 @  w1 C    xchg    bx, es:[41h*4+2]
! M* z. R- {, E$ |/ M    in      al, 40h
( K) K: [& Z: S    xor     cx,cx
1 j( s# w# T  j. g/ ~6 w  y4 U    int     41h
6 J% F' j8 U# }, @; _    xchg    dx, es:[41h*4]
% Y/ T6 {& T1 v    xchg    bx, es:[41h*4+2]
' A9 p) r) q) t) N8 [# C; B  K    cmp     cl,al  q" m+ L1 y% `$ i* k
    jnz     SoftICE_detected
; ^+ J) D( r1 k- G1 J
: G* e" s6 [0 `) F0 o+ w_________________________________________________________________________$ {& m9 t, [% Q8 e  v% b4 M7 m
& m" A2 [& N0 c; y3 c7 Z
Method 074 ?5 P2 b$ t- U8 i9 I8 I8 r* c* {2 _1 u
=========# T, H$ x2 C$ D6 V6 J- N+ w

+ T, b& P; g1 y; P, a6 S6 I% wMethod of detection of the WinICE handler in the int68h (V86)
& ]  U- F4 C3 W
: s1 x) f( H: B; l0 W    mov     ah,43h
7 @- W) e" x8 D. |' ^: m    int     68h
/ E- t& a7 V) s* m% @* M    cmp     ax,0F386h
6 }. A* Z$ {6 i- u! A3 A8 o    jz      SoftICE_Detected
6 j3 j' y* m" w8 |0 D: Y/ K6 w4 ~
3 u6 c  Z. s: X, Y0 R% ]
, w$ }* V6 m" L) D  N=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
+ F) I$ N" ~+ H$ \) Y2 E; J" o, J9 `   app like this:
# ]$ T  N* ^* }2 U. V5 P* y; K% N7 c( \" }
   BPX exec_int if ax==68
, c6 |1 ?( T( j1 c   (function called is located at byte ptr [ebp+1Dh] and client eip is
5 Q  T/ Y9 ]2 y   located at [ebp+48h] for 32Bit apps)
* l6 Q" ]; O4 h6 R- V__________________________________________________________________________
( {" f, C) t8 @0 ~4 q5 s
$ m6 e3 Z+ }* ]1 Q: t& r" y, |; g- Z$ U" ^/ A! F- N
Method 08
( A8 g  J$ m6 s0 a1 M$ w=========% H$ a) C4 Y3 i. g

, ^0 ?3 f2 F) G; y8 Z6 MIt is not a method of detection of SoftICE but a possibility to crash the
1 \6 y" @0 J. B- [system by intercepting int 01h and int 03h and redirecting them to another8 x6 ~' B" |' c5 W. Z9 x& _' A
routine.' m3 z5 K" x, A# \3 z( |% g* I: \
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points& x* m3 k, f( L! B6 _
to the new routine to execute (hangs computer...)7 F  Q* M4 c2 R, {/ X+ w
3 s& F1 \/ X! J' u
    mov     ah, 25h5 q: R5 I& i0 y6 c
    mov     al, Int_Number (01h or 03h)
3 E1 W, b) z6 H# s    mov     dx, offset New_Int_Routine
  b8 v4 y( e1 b8 H    int     21h* F2 x( a- f. r  j3 _2 I; [$ T( \
* x0 p" k: e) @" t1 K
__________________________________________________________________________
8 j5 [# |- T4 d5 h8 g( P0 e( `; @0 T) \/ {. E2 |
Method 09
: r- Y9 c3 e1 U9 O9 r( |=========
: E6 ]9 p2 `" k- Z: U* i. ~; x/ R7 o% e/ Y8 H
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
: g( Y4 ~4 [( g' V# J# q5 ?' I* l" N% eperformed in ring0 (VxD or a ring3 app using the VxdCall).& Y7 l5 f$ N/ n, Q5 o
The Get_DDB service is used to determine whether or not a VxD is installed
6 u' |( R  B' A9 cfor the specified device and returns a Device Description Block (in ecx) for
) A' r) P4 H+ a; k1 O- zthat device if it is installed.% V% V/ A: l& ?2 d( E

- p9 X% B0 b+ c# O! N0 l7 J3 c" a   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID1 t* P! [7 k% A2 `7 J5 T, i
   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)! n# h! q* n- N- b7 K8 Q+ \
   VMMCall Get_DDB* @. a" c7 z  F; f& P* m
   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed5 I4 ~! ?) f9 u/ R7 G

; X% p3 R* e! _8 y# PNote as well that you can easily detect this method with SoftICE:5 O; P! i9 H# v# @% X1 N
   bpx Get_DDB if ax==0202 || ax==7a5fh
' p  v! I( K' q3 W/ ~: T  R- z9 C6 \! ~/ _+ Y& J$ S
__________________________________________________________________________% I, z! }; S, g9 y! w1 ~
2 H, k  w. Z! o  }( q0 i6 |$ L( b- O
Method 102 y. f$ \8 p- }8 Q4 I
=========
- U# m- t6 W, o' |5 h. |# y  z) P2 z" c3 D6 F% ?+ U+ s5 f
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with. w& P, S/ Z9 W! v2 H6 r! \* C
  SoftICE while the option is enable!!& a5 O6 N+ }* n8 U0 l  d
6 `% s) Z5 j2 L/ B" t1 Z+ h7 W
This trick is very efficient:
0 _" H7 ^9 e) I6 I4 A! Rby checking the Debug Registers, you can detect if SoftICE is loaded
( r& ~5 k4 [0 k1 t3 w(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
+ O+ P3 ~( G; n6 W- H5 l- Vthere are some memory breakpoints set (dr0 to dr3) simply by reading their1 r, D  b# O  v! V* ^2 S
value (in ring0 only). Values can be manipulated and or changed as well* }8 p# {/ y& ~: t
(clearing BPMs for instance)$ |2 z1 ^& T* s! V) _

3 L( `4 G" p" E$ v/ o__________________________________________________________________________% C6 z) d/ `& X5 p$ q; p' b8 P
2 e7 m2 ~  {; {  U% d! A; n
Method 11
! S4 |! ]7 N1 m. w1 l+ O=========) T+ T3 q5 n. p" I
1 I/ B" l0 W. [8 q. ?& `. s
This method is most known as 'MeltICE' because it has been freely distributed" P: _8 K; v# \8 _
via www.winfiles.com. However it was first used by NuMega people to allow
0 u" F0 ?1 \* PSymbol Loader to check if SoftICE was active or not (the code is located
4 X6 `* N- s/ l# L1 |inside nmtrans.dll).
- v+ t9 A& t4 P0 A  f
( r+ G2 o- F8 m7 RThe way it works is very simple:, v! X- S+ b% h
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
( H( t7 k3 \3 @% kWinNT) with the CreateFileA API.
2 l/ p/ g6 n3 |. v7 y+ V4 P: D- v  E# Y- H2 I9 U6 J0 ~
Here is a sample (checking for 'SICE'):$ H4 |( Z0 b# q3 ]1 I+ [: ]
# R3 d( T5 k8 ~5 j" _2 M
BOOL IsSoftIce95Loaded()4 K' B3 J/ |* ^9 a9 o
{) T- c4 G- H! c  }1 o- v2 R, e
   HANDLE hFile;  ! a* U- O# s- ]4 A
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
9 ~1 {3 R6 d: S5 f$ R                      FILE_SHARE_READ | FILE_SHARE_WRITE,
" M- {3 z* g, K4 r                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);2 U9 G% A0 I" _- v
   if( hFile != INVALID_HANDLE_VALUE )8 T5 m( g1 L$ `7 b
   {: c; A" }4 M5 o; G+ p
      CloseHandle(hFile);
0 ^, ~# U5 d0 U0 ?2 q      return TRUE;
( K' d/ G8 r+ f3 f, K8 d   }
; K' e3 _- {; e4 v4 @   return FALSE;
3 y7 _/ e! I0 n}
0 l* ]9 R& p6 M( d) g' }7 Z# m9 u$ D4 r+ t# o8 b  ^" Q
Although this trick calls the CreateFileA function, don't even expect to be4 ]) ~, [/ D" d. P/ C# }3 }
able to intercept it by installing a IFS hook: it will not work, no way!
' p1 m4 V! n! Q: J8 r8 D8 K0 e# aIn fact, after the call to CreateFileA it will get through VWIN32 0x001F: V5 S# W1 j7 Q2 o/ j
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)5 p) V+ ^1 b* W3 l, ?/ i! W1 g
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
0 b1 r. N/ H- l( Z& Zfield.
( [% s2 J! ?7 Y3 F" {In fact, its purpose is not to load/unload VxDs but only to send a
2 u& g; x( ]  YW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)* b* f0 x6 z$ k
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
4 y3 O; _. m* Hto load/unload a non-dynamically loadable driver such as SoftICE ;-).
+ y0 V, A+ |8 x' TIf the VxD is loaded, it will always clear eax and the Carry flag to allow
0 y3 R* E+ p& e/ V+ X/ `its handle to be opened and then, will be detected.
- u3 F1 f, j/ o2 J' T: W. K  J$ X0 k; y- CYou can check that simply by hooking Winice.exe control proc entry point5 n$ |; u4 B  J: p0 N9 o) s" o/ c! V
while running MeltICE.
" @4 o/ U! H, L" S; D% N& l* a
# v- h4 B0 \0 X+ \
/ A4 W% ^6 C) V5 x3 _( b  00401067:  push      00402025    ; \\.\SICE$ Q) ~6 E1 u# r6 A0 t
  0040106C:  call      CreateFileA2 h. T9 V# w$ q3 _! C& d1 Z5 W$ G
  00401071:  cmp       eax,-001' H" N/ D( q( y; m1 @
  00401074:  je        00401091
" |, A# n# u& Q, @* V" Q9 [7 r; J8 l6 N8 m( t0 x4 B/ b
* x) B7 `2 _5 i) k* L6 Y
There could be hundreds of BPX you could use to detect this trick.
' V7 ^2 }: Y9 ^. l$ L-The most classical one is:6 O& {% ?1 W8 i3 ], r
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||0 P+ W) |1 d' O" k! m
    *(esp-&gt;4+4)=='NTIC'% R8 d: Y( C$ h
5 P; P& c7 T2 D! k7 p: \( _
-The most exotic ones (could be very slooooow :-(" y( G* T( Q: ?$ ]9 P% Y; U4 J1 ?
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  
6 M$ ^9 Z! z# M4 s     ;will break 3 times :-(1 P2 S/ O5 [9 q/ Q4 o6 |
5 ~+ b9 m; w2 d) X5 L$ W8 g% h
-or (a bit) faster: ) H0 C2 d4 t& e( b) h5 u
   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')* h2 Z- I9 n0 Y) L: n$ Q" k
8 p$ u5 M0 z, r' ]! [
   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  
! l* H2 C6 e. d, i3 S/ i8 S% g! O     ;will break 3 times :-(; n6 m; x$ ~* w

0 y. T  O4 ~; Y% ~( D-Much faster:8 J( [4 e# |+ w+ Q: M- v, x" t
   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'* N. P4 Q. i- T/ O

/ V, C" d, |+ l. L, YNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
; ^6 i$ d: _3 N# Xfunction to do the same job:" L; X: U) }, Q0 l3 L

# x7 {- C7 H" ~  b. Z0 `+ X   push    00                        ; OF_READ: o$ N  M4 C4 {4 g6 v! d& l$ V
   mov     eax,[00656634]            ; '\\.\SICE',01 a1 f1 Z$ u! g9 g3 h
   push    eax5 r9 e9 i* |. H2 n+ h" G; ~# g
   call    KERNEL32!_lopen
! I/ f; X' M. v% M6 {" x! \$ v   inc     eax
' V7 e( \! T; d4 s   jnz     00650589                  ; detected
( v4 W6 I% G/ Y* v# H* L   push    00                        ; OF_READ
* X: }$ _6 P4 P/ T# q4 s) {   mov     eax,[00656638]            ; '\\.\SICE': R* j) s) W# y1 \# Y, S
   push    eax! s; b% Z0 c3 }3 c+ ~
   call    KERNEL32!_lopen
( d7 m  u  u. `' J8 i0 k* m/ X, Q   inc     eax% u. ^$ ?4 B! r- A
   jz      006505ae                  ; not detected
0 T; H( k6 _$ ?; S0 F6 [7 n0 D7 ]3 [$ x8 b8 K5 r0 C2 ]
% o' U# q$ I6 \
__________________________________________________________________________7 ^; w7 t% R, H+ y1 r
/ v* \, F, Z/ u
Method 12& @) @  W* y4 c
=========: v# K4 R# Y  I& z! p# @" r
- o/ X& V0 Y3 ]. f$ I& `
This trick is similar to int41h/4fh Debugger installation check (code 05; Q; }; b8 a/ G4 a. ?
&amp; 06) but very limited because it's only available for Win95/98 (not NT)+ V6 Q8 O8 I* v$ y) {/ l' M6 V
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
  b: j. d7 [. }$ n/ y- a
) K. n& r. @2 V3 J, n4 d4 k   push  0000004fh         ; function 4fh; K! \* t% r- u& U0 t7 ?( t
   push  002a002ah         ; high word specifies which VxD (VWIN32)
1 q. r# Q1 d; V9 \! A* S4 W% H+ M3 ~                           ; low word specifies which service6 S- g4 w, ?" ]: n) L" N
                             (VWIN32_Int41Dispatch)7 A; [' y9 G3 n( v# r
   call  Kernel32!ORD_001  ; VxdCall
* ]/ X# F! k& p3 [4 C   cmp   ax, 0f386h        ; magic number returned by system debuggers
, \0 A# X  Q6 O6 O, Z& Q6 J   jz    SoftICE_detected+ j+ v6 U, j9 m; d' t% f

6 [* L- \8 i4 S# N- S$ y4 {Here again, several ways to detect it:8 w: P! F3 k  T' ]. Y

' R' t/ d! U! F! c1 W    BPINT 41 if ax==4f8 m) v" K1 a5 h2 W
+ \/ y7 f, {: ?- j1 [* }! Y* p/ `8 y8 I, i, e
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one$ M% w3 I( P# K9 m; m0 @" d% I8 g9 M+ O
% Y0 Y. d. }* z* {9 y/ ?2 W4 L
    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
. m3 @# Q9 z0 J/ t1 M: R6 B' F  B3 g8 G% ]5 K- k
    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!) f, y% S# K# {( n3 G/ r
9 b) b7 e# q# E/ a, h+ A( ?6 E7 C
__________________________________________________________________________* _, `# ~* M# X5 x+ U/ Z& y
" Y. y6 `. O( {% w0 x
Method 13& V+ G7 [0 ^, c0 q6 r6 a  [
=========
2 b! ?( I  p( @+ y! \7 j( b  O/ F" [7 ?& w. z+ V& `$ I0 O2 v
Not a real method of detection, but a good way to know if SoftICE is* q( b  A9 ]8 U! z+ Q
installed on a computer and to locate its installation directory.7 J$ h. |9 b9 Y- ^. |4 Q
It is used by few softs which access the following registry keys (usually #2) :
& c. E: k  D8 L! O+ F, z0 _
7 z3 }- M: v$ ]/ D* h+ I1 Q-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
% o& G. g! {* y# v\Uninstall\SoftICE
. F  ^5 }6 S) {; d3 |3 [-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
! C! C5 M  t" r/ ~' n-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion2 \; b9 V  i7 A$ S& O+ I" a' U
\App Paths\Loader32.Exe* c: _# t* T3 B% a- w- z  E

1 Z7 \) X; J6 ?3 O
& j4 `: U- u9 WNote that some nasty apps could then erase all files from SoftICE directory4 N! w3 m! S- U! ^, t7 c
(I faced that once :-(
% [4 d; s/ o: Z
. M) G! x  p$ \7 J# n, U# i# \2 oUseful breakpoint to detect it:  k: Z4 d' J4 q& u2 W" ]

0 j! H+ j) h. p4 ^     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE': g2 H- V( y5 Z/ a/ M# n
6 G* y& t6 K/ v% P. x
__________________________________________________________________________5 o9 Z; J6 K2 Y
6 Q; l, _, R( l4 e+ a" G0 N
2 e/ b, [; d9 F" n7 l3 o
Method 14
: ]8 C, t6 S/ d0 B$ a# M- O=========
. s( _) Q) _! y% [$ n4 d# A- s) {# k
% v5 x' ]  }6 JA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
4 W  t; g; K* Zis to determines whether a debugger is running on your system (ring0 only).
) ^3 t, i  q1 b0 v5 v/ a! x: W$ R' ~) K. c
   VMMCall Test_Debug_Installed
# V$ R# P/ t0 T' U+ t. M. f- c   je      not_installed* w) X& R. g' x; d9 |

& ?: ?  \4 L' X# x/ V2 L  ]This service just checks a flag.
4 I$ u$ \( C2 c+ m</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-8-16 02:51

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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