找回密码
 注册

QQ登录

只需一步,快速开始

About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
" r" z: \% `& r9 b/ E% g7 `<TBODY>- U! O) B8 s# d/ K9 U- ^
<TR>9 F5 ^" I4 R5 ^, D
<TD><PRE>Method 01 # w4 @( V) |2 h" o3 t2 i' _
=========
2 @# w5 A1 C- k
# t/ C% X. d8 k2 @9 Z9 QThis method of detection of SoftICE (as well as the following one) is1 \1 P/ m+ b* i5 }- P
used by the majority of packers/encryptors found on Internet.1 f- b7 m8 E& U5 a* `
It seeks the signature of BoundsChecker in SoftICE! `' [. G# y5 P) Q% v

; K! i/ d9 A& s7 b' {    mov     ebp, 04243484Bh        ; 'BCHK'4 O5 m# o* C, x% M3 Y  P
    mov     ax, 04h
1 q5 T3 U6 M: m    int     3      
( r4 @+ K: J/ b2 h( {    cmp     al,4  F! G9 k& M9 E, }2 y3 Y# D
    jnz     SoftICE_Detected
- m/ Q3 G8 i3 x$ G9 g: d7 n6 n! l! Q1 v9 X8 B& T3 E2 @% C5 S5 }0 x
___________________________________________________________________________
. u; S1 u3 Y( c% ^, B
7 S( b& m0 z# m4 K" L3 SMethod 02
- G2 k1 a! z' C=========
, T  P* j! D( D- ~
! a% i8 T6 M3 oStill a method very much used (perhaps the most frequent one).  It is used
& L0 p. ~2 R/ n% ^, yto get SoftICE 'Back Door commands' which gives infos on Breakpoints,6 @9 F( K7 O5 W& z( F5 E
or execute SoftICE commands...
  H# M! u' P, \* u2 \$ _( d9 h' z1 UIt is also used to crash SoftICE and to force it to execute any commands
: x8 S. S* B5 J! Q& \- R(HBOOT...) :-((  ( E0 ?  W6 l+ I3 r3 E

5 D# X3 i- Q) E! THere is a quick description:4 f. x; E; a3 U/ C7 r/ ~% e5 Y! p: Q
-AX = 0910h   (Display string in SIce windows)' X, ?$ W% }1 N5 S9 d7 F
-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)
* }2 ^1 J# t$ o) w4 |. A" M-AX = 0912h   (Get breakpoint infos)
) ^: p/ z5 t) c$ P-AX = 0913h   (Set Sice breakpoints)
) t! ?, i  E; i, u" E-AX = 0914h   (Remove SIce breakoints)
, E; H7 f: I+ U8 C) K
( T& A& w) |# ^& a+ VEach time you'll meet this trick, you'll see:* D, f0 t/ t; |
-SI = 4647h( p6 p( R' I% n2 S6 E' C
-DI = 4A4Dh$ ]! @2 ~' f5 _5 I, R9 S: k
Which are the 'magic values' used by SoftIce.
' u3 j9 V4 |% _0 F: x" c6 i# R( DFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.: U5 v" u" e0 ?  B( l# t. W7 I! ?

& _( ]2 w% ~& E2 h7 iHere is one example from the file "Haspinst.exe" which is the dongle HASP6 n7 z1 ?- O- d) h% w
Envelope utility use to protect DOS applications:
& I0 o% `$ C) o; x2 @& T1 }
1 }9 S, k1 f( \4 K/ R) U! q; X+ u9 K. p, c" g
4C19:0095   MOV    AX,0911  ; execute command.
6 u) x4 m3 \: x1 V. b4 r3 _4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
5 U7 A# f" r1 ~$ |- I4C19:009A   MOV    SI,4647  ; 1st magic value.
% w& U1 A" a, `% {- K' a1 A# W4C19:009D   MOV    DI,4A4D  ; 2nd magic value.
7 y7 K# r* S/ b' l4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
2 `7 Q3 Q! m: J; c+ Z* |4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute
# N8 I. m( e) v( _+ c: E: e4C19:00A4   INC    CX0 D1 A) t1 C3 |
4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute- S0 q1 I' T- R/ l( {
4C19:00A8   JB     0095     ; 6 different commands.
7 h5 f7 B1 T  a4C19:00AA   JMP    0002     ; Bad_Guy jmp back.2 v, c  h+ n7 K9 R
4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)0 H0 g. h3 t2 c, K, z$ p/ S

! @) T0 t% {2 m) V7 o0 {The program will execute 6 different SIce commands located at ds:dx, which7 m3 w5 ~, ~9 c: z2 z9 k9 p
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.3 U; Z6 s9 F) o% |, s

) \( l4 ?- h$ C- V* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded." R/ t2 c, G3 i, d$ b( d
___________________________________________________________________________; x6 Y8 B. H, p5 I) i
+ w) x- b" x$ E0 F
7 j! J, ]% R8 z0 \
Method 03- D2 ?' [; A" b; G! L) l( Y& |
=========
5 c; {5 i+ J  U, z) h3 S7 U
0 N7 [6 _4 E: kLess used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h9 K9 x5 _: k' u9 l- v9 ?7 _  i
(API Get entry point)& J0 e; ?3 W4 K- N& ?
        8 N) s" M" f4 r! k

# Q9 `2 i4 q; n, \    xor     di,di  p; Q$ e2 H% G4 V+ _
    mov     es,di
, M/ M0 N: r' R6 r. J    mov     ax, 1684h       ( C+ g2 N' N- X  `! V) O& V
    mov     bx, 0202h       ; VxD ID of winice7 U) {# \" E  H, v5 l8 g$ C8 Z
    int     2Fh/ \6 c% o  U6 a
    mov     ax, es          ; ES:DI -&gt; VxD API entry point7 G' B9 t  k2 a( E4 j; R
    add     ax, di( a+ X. q& ?" g, ]
    test    ax,ax* L( ^3 W; b1 r0 J
    jnz     SoftICE_Detected; m3 I7 M" p7 I( K' I9 E# H# E7 l0 L6 X

1 K: H6 L$ x# R___________________________________________________________________________, b. _) [/ O# K# A, o

+ V- B( p3 {4 k1 H$ V# ZMethod 04
, k2 F3 j5 z2 m7 r) ?6 M$ ?=========
4 d2 a: X/ K% G9 ?# `1 T( o* z! y  H$ o2 m! J* P: V
Method identical to the preceding one except that it seeks the ID of SoftICE
8 I7 |! W, j* [; j# x/ }! rGFX VxD.
/ S; o3 c5 M# t  ~/ V
4 r; N, R4 m2 y; p: Y) P$ A    xor     di,di1 H. E2 d  Y9 W6 u* @) p
    mov     es,di
- \/ R, q1 T9 U. }7 z) Z- O    mov     ax, 1684h      
* D# \7 I0 V  f8 i- p: B) n+ A    mov     bx, 7a5Fh       ; VxD ID of SIWVID
2 L& e; x2 c6 x& ?6 g* u: f    int     2fh
) ^1 G/ {/ d$ i% w0 v4 c    mov     ax, es          ; ES:DI -&gt; VxD API entry point
4 k( w% D: {! z    add     ax, di
$ h$ P- Y6 T. V4 S( O3 z2 G    test    ax,ax8 o' l: X) b% s7 p6 y$ o: q
    jnz     SoftICE_Detected( W$ N" l. S( Z; k+ {% m  E8 L, R1 D1 ~7 G

- o2 K' P% D1 {0 E6 L4 ^__________________________________________________________________________3 T: T' \$ Y* `4 P: i5 U
+ g! J3 Y, O2 I5 n& h9 ~

9 C& p' R7 F3 b/ U6 P% F  V/ ^Method 05
# E3 J* }4 ~% M+ g& e=========0 \/ G' X: c) r0 p0 u
. N, u" E7 U4 @1 `# {# {
Method seeking the 'magic number' 0F386h returned (in ax) by all system' u* d9 H9 S" z4 e2 }% e; `+ S
debugger. It calls the int 41h, function 4Fh.9 _: c4 W+ {: D0 l
There are several alternatives.  
, j- {& C7 x4 C$ `. `, u- U# B0 {, e# {) S
The following one is the simplest:  x& Q2 p* a: y  u7 a) M9 x( F  h

3 K& m  T, O- k* N3 S) J% V    mov     ax,4fh
! @6 `9 ~4 ?7 Y) V9 {& c. Z6 S5 ^    int     41h
& ]( |7 [4 q* Q) h    cmp     ax, 0F386
' a, J# h* f! G* @( _5 }. i3 \- O2 c    jz      SoftICE_detected
1 y8 `2 q, o4 R2 w- h+ M4 ^  H1 B% g8 R0 d* k
6 }* F/ p1 |. k; K) r; L" U6 O" c4 w
Next method as well as the following one are 2 examples from Stone's 4 b* j# k) v4 H/ E5 A# s
"stn-wid.zip" (www.cracking.net):
! d0 A; Y  X/ R- N% v3 ?
/ u6 s9 C& e* u# H    mov     bx, cs
# ~, W6 \$ `$ a4 d/ \    lea     dx, int41handler2+ l- h! L' k) Z% w$ {- t
    xchg    dx, es:[41h*4]
$ f  t5 z4 S) m( P    xchg    bx, es:[41h*4+2]
1 I: @- _5 H5 @5 r    mov     ax,4fh
- c1 r' B. a3 y2 M    int     41h
; ]1 |. ~! S/ P- Z    xchg    dx, es:[41h*4]
! S3 V  L  F3 Q# m8 d    xchg    bx, es:[41h*4+2]
* O/ ], L' c% X    cmp     ax, 0f386h4 L/ N3 @: G. p6 ]
    jz      SoftICE_detected2 o. Q/ h, n/ X0 Q. K# G0 H4 Q
" E/ c2 ?! I" R) o+ u* i+ ?: C
int41handler2 PROC
9 [, Q; T6 E& Q- ^6 e# e& _0 D( B    iret; X$ z/ b, e- y+ q+ c- ]! o
int41handler2 ENDP
$ I6 n" f" r3 S! j, \# B+ V( m1 C
" u+ H( M' i. E
! X- `; t: |# ?, k: i! B4 s8 F1 h_________________________________________________________________________
0 t& E9 c  n- c% G2 p& ^
0 N5 n% X/ g- c; ]" |
, a) ^: ?, G. ~1 I/ f; N- U0 NMethod 068 H8 j# W& W! B+ M! N. r
=========
/ R- a' c( X; j) R# ?
6 P6 a# y1 B% `2 q5 p# _6 n6 j) e: i* M0 S% v# x2 a' ?5 O
2nd method similar to the preceding one but more difficult to detect:3 ^* h& Q/ }# o* G: J$ }
3 U/ @$ t$ p. b% t4 c

# P# @9 q  P  J% I8 G" G; N% bint41handler PROC
- `+ K& ^# p' G: v3 b, M" j    mov     cl,al
$ H" Z% }" H9 _6 d! M    iret0 U2 Y0 x5 `2 @! ?/ J
int41handler ENDP9 u' i- }/ |# G9 m$ h

0 s1 T/ M% C/ p- z; O7 ~$ X) M5 S2 r; o" t5 v1 _
    xor     ax,ax/ Y4 a( |8 _4 D/ k
    mov     es,ax% O7 K" ~( B6 `# c5 I- @3 t
    mov     bx, cs! G1 o% J, M2 S! A2 c3 ]
    lea     dx, int41handler7 z6 {9 ^- _7 s  ^+ E
    xchg    dx, es:[41h*4]
7 d9 b4 v' w2 q6 X5 O6 w    xchg    bx, es:[41h*4+2]
, F. A: u- M: z' T    in      al, 40h
4 I. o7 i# A4 U* ^; V0 i1 c    xor     cx,cx  |! u1 Y1 t5 U: R0 A
    int     41h
& w+ N* p, }0 t8 n    xchg    dx, es:[41h*4]
& o& Z' f) T( r4 o    xchg    bx, es:[41h*4+2]
( k# m" }$ z: s8 g6 ?9 j1 {    cmp     cl,al& e- B! |$ ^  T7 P; o+ `# r' r5 ]4 K
    jnz     SoftICE_detected* u! I2 c( n+ Q
8 _) E( o1 j3 C+ y/ Z  B
_________________________________________________________________________5 ]6 h9 [2 P& R% v1 ^
5 w  s) M6 R. J& U
Method 07
" h5 q1 h9 W% f6 j7 ~9 X( V. T=========
" _' h  d4 ~: _0 m6 L. J8 Y: l  x% U# f" |* ^* c
Method of detection of the WinICE handler in the int68h (V86)
  x3 u) N. [" |+ Y! `# \& n( S2 g: I; F5 b) r6 L
    mov     ah,43h
: I6 O# W$ k3 W& E9 x7 f0 Z; M    int     68h
' Y0 f+ c' A. H/ ~. U2 A# J! a    cmp     ax,0F386h
! L0 G. r6 [5 @# D    jz      SoftICE_Detected
& C' u( |9 w; m; d7 V% k
/ l! ?5 n) P4 e( {; F' z- _: z6 k" |# C8 l& Z) b$ }0 e
=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
0 r+ o% k6 g, i   app like this:) @! G% P% c9 y4 ?4 S' P4 j
# ^! b4 B% }; |5 J* D2 t
   BPX exec_int if ax==68
. F$ L) }! M7 l% g) l0 S   (function called is located at byte ptr [ebp+1Dh] and client eip is
, N. Z( h) g+ {, `  A) z/ k   located at [ebp+48h] for 32Bit apps)
1 S+ Q7 \7 t- A$ |0 |3 a5 P__________________________________________________________________________+ a# s1 i% q8 h
: e! Z  e8 c1 X
% z" C0 B8 t& Y" S
Method 084 J% A( d3 X/ z' j! `
=========& J2 `8 J- v# l' V: Z- t, c

5 R4 p5 J, h. q/ a9 P3 D1 }1 DIt is not a method of detection of SoftICE but a possibility to crash the
6 c1 Q  S: s; o! E% c  hsystem by intercepting int 01h and int 03h and redirecting them to another0 t1 L! ~+ Q- `+ B6 T
routine.
: h% j, h9 B& h" v( ?$ H. I0 NIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
. o9 Z1 t0 i3 Gto the new routine to execute (hangs computer...), b) ^9 h4 }7 ~3 |3 P
8 i0 P3 \$ X) O0 A
    mov     ah, 25h# Y& n6 j9 t" z; Z2 N. G
    mov     al, Int_Number (01h or 03h)5 V$ ]/ C6 z& |
    mov     dx, offset New_Int_Routine3 ?; a! h2 b8 q+ @" x( A/ @
    int     21h
7 N/ h: Y& c9 H+ E5 G5 C9 m! |, C. @6 `4 g
__________________________________________________________________________
6 H5 y0 G  }; r3 a& d6 H0 k; {* t& ^  ?0 F
Method 093 r2 z* R, u9 Q6 R* y! l, X- ^7 g  c
=========0 ?9 T2 B5 z6 {0 @4 W' q6 U

2 V- ]! P; O) B) `& r% v% RThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only  k) E2 ?2 T+ ]& M$ i- j( W' j
performed in ring0 (VxD or a ring3 app using the VxdCall).1 p2 K+ L7 g' n; D0 [6 {0 p
The Get_DDB service is used to determine whether or not a VxD is installed
& R' l4 J, k+ @for the specified device and returns a Device Description Block (in ecx) for" Y; L" D0 W' w+ s& D
that device if it is installed.+ m$ x9 P: `* {" c6 g

. w8 f0 L: F' Q% o6 Y! i* J2 d   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID
$ A8 F* x1 u  f; X   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)& ^; x5 _) L* f/ e: x
   VMMCall Get_DDB: G. w$ T7 w: [  F( t' K' w
   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed
( z7 z, N$ n6 F: w& t- |. P" g4 r* M9 Z  M
Note as well that you can easily detect this method with SoftICE:8 X2 N# }8 E/ `: R
   bpx Get_DDB if ax==0202 || ax==7a5fh
# E; V& P- Z. @, B" q, w1 A
! v  K5 P8 g) r. o__________________________________________________________________________
# ~) y' O" x$ L3 Z- Y- K+ {
2 Q/ I: Q2 |$ {1 d. k  _% a- Q! {Method 10
3 z: Q7 ?7 T9 b( _; G+ m: h! U=========
, D8 u& W- m8 a, Z- p2 k, H$ ~3 E2 Y+ v/ U7 C
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with+ F, b* N5 U% ~
  SoftICE while the option is enable!!8 M7 `. c4 l/ {8 L9 V
" g0 y2 I; j, F
This trick is very efficient:3 A4 r# ]! j  `8 X3 ?
by checking the Debug Registers, you can detect if SoftICE is loaded
! a' H3 l7 |; t- y0 i; A/ ](dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
1 P/ F. j9 s: i' ?8 T% z$ nthere are some memory breakpoints set (dr0 to dr3) simply by reading their
& i3 Y- U; x* N& w1 F6 Hvalue (in ring0 only). Values can be manipulated and or changed as well2 y$ c0 J& p& x7 ^
(clearing BPMs for instance)$ j# \, B0 r- H
" K0 v! o( G! G- [
__________________________________________________________________________  @* [" I) x$ u9 V4 _! q

* G# H. b4 U1 K( q# @Method 11
' l3 j1 Z, X2 }=========; z: \+ S% s7 `

8 C8 s  h8 F% Q  a3 o$ ^This method is most known as 'MeltICE' because it has been freely distributed% s& q8 w; t, B( j, l! O( w
via www.winfiles.com. However it was first used by NuMega people to allow
  |2 b2 h$ @& pSymbol Loader to check if SoftICE was active or not (the code is located( z9 H2 l# t+ [* J$ |
inside nmtrans.dll).  ?8 G: V9 ~# {, M3 @1 n* p
( a. c& o0 B4 h  k9 x9 U9 X
The way it works is very simple:
3 ~& @$ a( q! W, E: F6 `: l8 ZIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for5 H$ s5 y1 d/ H6 ~
WinNT) with the CreateFileA API.$ W) F" {- {6 H' U# o
! h# w$ d/ X1 e6 @& H! _: A
Here is a sample (checking for 'SICE'):
* i1 F' q! ?/ u2 a
) a+ J7 K7 u! f/ C2 oBOOL IsSoftIce95Loaded()
1 F. l6 N7 I3 _6 a) F# t/ ~{# Y  T- Y: w" S" X5 i
   HANDLE hFile;  7 Z- I+ Y9 E& Q! V/ N; A# b
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,  s8 R2 Y$ u8 R) u: x
                      FILE_SHARE_READ | FILE_SHARE_WRITE,1 `0 o1 s% m# Z: r# N8 k  H/ K
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);1 v7 G; K# |: A
   if( hFile != INVALID_HANDLE_VALUE )
9 O; E0 e, j  z/ C   {
" }9 J$ {* K( W      CloseHandle(hFile);
8 u6 o! n/ r9 D1 M( h( j; }# [3 \      return TRUE;
* @% T& R  N- ]- b" z' u) o   }# r% C6 @! z/ S; Q
   return FALSE;$ ?2 F1 x6 B& u
}
( N6 M) I+ [+ W0 {; v; u. N
$ v: r3 |- }- H  k: A7 n# YAlthough this trick calls the CreateFileA function, don't even expect to be
1 j* j! d3 }8 y/ h, m) A: zable to intercept it by installing a IFS hook: it will not work, no way!+ `( d1 y5 L( o2 j6 p1 N
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
: `1 p* `/ f, T" i, v' [$ mservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
. C9 @+ Z2 f) V2 I$ Xand then browse the DDB list until it find the VxD and its DDB_Control_Proc
- F$ t% h) s# L2 P% I% O; G8 J( E, a7 ffield.$ j' h% p) N& s" {8 h4 {
In fact, its purpose is not to load/unload VxDs but only to send a 7 ^% Z7 E/ [8 A
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)6 Q1 C+ n/ o& L% C
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
& |$ {1 d' M5 p$ a7 }& F$ l" Pto load/unload a non-dynamically loadable driver such as SoftICE ;-).
# @: F* n; ]' a; V& v& K4 AIf the VxD is loaded, it will always clear eax and the Carry flag to allow
9 y6 L% o" q) Pits handle to be opened and then, will be detected.
8 R5 a/ g4 Q# l0 C: VYou can check that simply by hooking Winice.exe control proc entry point1 D9 M0 h- g7 d& `1 u# a  x1 R
while running MeltICE." U0 s# E. I6 }2 V- a# `9 M7 X

5 l9 F( u0 r" X/ {$ O4 r* H' _' l& y. a& }/ l  m
  00401067:  push      00402025    ; \\.\SICE8 }, y! n. n3 p
  0040106C:  call      CreateFileA
+ v+ ~9 H8 o1 X' y  00401071:  cmp       eax,-001; k" P7 d, |# U! a$ Q+ N) r
  00401074:  je        00401091
+ L  _+ z0 z& o% U' C0 s/ k
) C) M4 w0 T3 E! |! m6 T# t: y+ b( Y  H6 M- D" u
There could be hundreds of BPX you could use to detect this trick.$ a) M' g; @8 C! b; f+ A* y; w
-The most classical one is:' c+ g8 G! ^8 \1 A* B$ b! x* \1 Q
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||% m3 C, w  g) y- I, H7 \0 w
    *(esp-&gt;4+4)=='NTIC'
. P$ C2 N: r9 h- M
( i8 a! k" L) ^8 X8 i-The most exotic ones (could be very slooooow :-(/ O0 v9 @: S& ~+ V2 @! c) g7 |2 a
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  
5 e. t. S$ E8 [2 L5 W     ;will break 3 times :-(
; H* m- y% z. w- |7 i0 B! p* T/ D% M6 [2 B
# a6 w. m/ h. f" r-or (a bit) faster: , v# {3 @: A2 G6 Q  \+ S
   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
2 t9 b+ }2 P1 K! Z) l( ?
* w1 C0 B/ ^: @% ~' \3 z: T   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  
6 H& \. b3 c  g( I, |! Z% ~; z     ;will break 3 times :-(+ n& J* p, {4 @. l9 b4 Z8 B
2 U1 O* Z# A5 n2 X! v+ y! D* @
-Much faster:
) {4 Y) _8 ?' y   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'/ f4 w  f. U* a$ C- J% j
' ^1 m' p, t# n$ R1 Z; A
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen5 s& I8 A3 {- [0 j* V
function to do the same job:
) o8 A1 h4 _- s: A- P+ H- r4 |/ x/ m. @3 Q/ h: V9 i
   push    00                        ; OF_READ
, S8 Q; V" r# `% R- \   mov     eax,[00656634]            ; '\\.\SICE',0
- w' N; i- O6 g$ {* `   push    eax4 H* Y1 W4 b; Z5 y
   call    KERNEL32!_lopen. b6 X3 C4 r0 f" I1 f1 l
   inc     eax, R- ]1 d$ K& E8 b" ~
   jnz     00650589                  ; detected- i& H7 Y% m( t/ C! @
   push    00                        ; OF_READ
7 A! {# @: u: U8 e6 f5 J   mov     eax,[00656638]            ; '\\.\SICE'+ x" p7 h( J, t+ x" o; h& \
   push    eax
( q& w% @9 m; m% ~$ ^   call    KERNEL32!_lopen6 M: Z, u: b% k1 `! O4 t; c0 B4 L
   inc     eax9 e5 C7 a6 V) U/ `
   jz      006505ae                  ; not detected
% h% Y% r- g( R6 p- {2 }: o  J) T* [$ j3 O4 e! }" W

/ U0 ?* X& f) B__________________________________________________________________________- w9 ]2 w# D; a5 K" U2 R* @
: Q/ g; f. G  y  ^1 P! b0 x
Method 12
6 f1 _& W8 e4 c$ D% I- n=========: e$ N( j5 ~1 }  z( ?2 z# A0 U+ Y
3 y& s# H" @: F3 @
This trick is similar to int41h/4fh Debugger installation check (code 05
9 M6 {7 G$ ]3 V&amp; 06) but very limited because it's only available for Win95/98 (not NT)
3 a& Q7 y6 @- Z" A1 _1 n, r; C4 D, K* ]as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
4 Q6 c# z" J" A2 H" x$ O6 L9 [3 h# D9 D
   push  0000004fh         ; function 4fh
" k8 m6 J" E7 A) R# e   push  002a002ah         ; high word specifies which VxD (VWIN32)
0 y; L8 B: E; H                           ; low word specifies which service7 L4 T$ b* ~  l8 O% D
                             (VWIN32_Int41Dispatch)
) c0 C' U/ y7 d   call  Kernel32!ORD_001  ; VxdCall/ x) ?, d8 A: {4 c% O/ ?
   cmp   ax, 0f386h        ; magic number returned by system debuggers
; k  i8 V8 s& R; C7 y; y" l   jz    SoftICE_detected
8 _$ g$ d( h6 c
" |* i0 {. m+ |$ l8 d4 c, AHere again, several ways to detect it:% W( g4 F: K0 c6 \7 o% S+ x7 L
( p" s9 s) ^9 U) G
    BPINT 41 if ax==4f/ u" ?( B, R! z9 A- ^  b# d
0 {& g# `9 o6 [, |! l' J
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one/ N! e  Q' j% w( h* K$ Y/ k2 `& g

# h/ w5 k+ }/ U5 w7 e    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
1 Z( _9 ]0 A2 [" e& u/ {
6 N1 M, e6 ?7 O    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!
( a' s# e5 Y" k- ]+ L: s( c. q% }- Y! W0 P$ S4 i8 x
__________________________________________________________________________
0 h5 r9 W/ U2 t: P% \, l5 w6 v
2 S) J+ B0 r! Q$ x: F8 UMethod 137 A8 q/ D/ `6 W; D& J
=========: ~3 ^! `6 z& ~* ]& ^

! ?; j2 N/ X  K3 f' \- a- \- ~Not a real method of detection, but a good way to know if SoftICE is
  _) G% |  W& g: v0 G. ], I2 X: ]installed on a computer and to locate its installation directory.
$ N$ ~0 P0 h9 k& M" ?! K# AIt is used by few softs which access the following registry keys (usually #2) :( |, x# J4 `- D% X

& j- ^% S7 c" m) b" J$ N" N! R-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion* L# Z+ F% }, V' }, W
\Uninstall\SoftICE
; t6 q/ m( H7 A-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
$ Q& J6 L( B- ^4 T7 L. z1 K  G-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
9 [+ q! M% `' Y$ v# D) ^\App Paths\Loader32.Exe7 x0 N* Y- f' D, p5 b* G
5 l# b+ V3 ?- p; E! Z
% d+ r# [: X4 w) j' t9 D; a+ h
Note that some nasty apps could then erase all files from SoftICE directory* _, q% t; D) {: x* `  H/ B
(I faced that once :-(
7 T9 Q, I  G4 O( D! o
3 [  y8 |/ I5 j; w! B- K" c0 l) MUseful breakpoint to detect it:
# u' V; W" w- v: G9 G+ u  C( j. V4 r! W9 Q3 o( E
     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
% R  ]5 a  u  }1 [* L/ a" M$ y3 S* v8 j- A) [4 P! v# J  G5 ]! W5 m
__________________________________________________________________________2 f* ], u, \4 X7 Q

# K# N1 d8 e1 v8 L' R1 R
, P+ X' W& o0 X1 w# hMethod 14
8 `- L" I6 u3 R( P4 @, _3 v=========: u) F4 d: f* l" r
4 d5 s( f! @+ K9 P! M2 q
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
9 n% z/ E- ]7 [. His to determines whether a debugger is running on your system (ring0 only).
, m2 b( N! N8 v# f8 m6 S) Y" v2 W0 _% L$ y' a9 ~' o* }
   VMMCall Test_Debug_Installed; l' D- }( d$ g% n) V  a8 s
   je      not_installed
) T& @, J- K) a4 K0 U9 H0 C
8 |. M4 o. T* E3 Z; hThis service just checks a flag.
! ?2 J& u% W" u; h* Y4 ]& u# K</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-8-20 22:25

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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