<TABLE width=500>
" V! Q9 M$ H; L' W* ], G/ s<TBODY>! x" V. T! Y4 `0 w. u' R
<TR>; {" _1 h9 g6 @% u: W) w5 F" e
<TD><PRE>Method 01
" Z+ b9 [3 s; K6 O5 e0 e# j- ^=========
k$ `7 h$ l) L. k) Y" }' K- K; C6 G+ z
This method of detection of SoftICE (as well as the following one) is" M8 d! p" k1 a. N/ y
used by the majority of packers/encryptors found on Internet.
+ d, R0 S+ g/ F0 B1 h6 Y* BIt seeks the signature of BoundsChecker in SoftICE- }1 Q7 G2 P7 d! N" X/ q7 r
/ v7 x& f: H% B* B mov ebp, 04243484Bh ; 'BCHK'1 @5 J- C0 d7 X; i+ b, y
mov ax, 04h
! K2 @' e1 E0 I7 L int 3
( @: q7 l" w% a- Q) K {. o cmp al,4' o8 M& W- T3 y
jnz SoftICE_Detected
6 Y- C7 B/ F$ t! @" z
* H- w2 X9 v1 b1 s! S___________________________________________________________________________7 ^: d4 ]' z# Q4 P1 @
/ i: t! J" r: D) `Method 02
9 |$ S# h4 G L; K=========
* P e4 }% M* q0 L4 r E( z R
2 Y+ H' Z- A f1 T9 ?Still a method very much used (perhaps the most frequent one). It is used
' R+ |/ L3 d" B; a( zto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
4 V6 H1 A" A: F8 r6 a0 Eor execute SoftICE commands...3 i" g) t0 f4 ]+ \. a* t* ?. H
It is also used to crash SoftICE and to force it to execute any commands/ I& D0 D, g" g' Q
(HBOOT...) :-((
6 G4 H9 E# V# g9 g9 V: h
6 t( M! l& [% @7 J% {Here is a quick description:
4 Q" U! R& }7 I# C$ Z8 r-AX = 0910h (Display string in SIce windows)# V! n0 J, ^6 }9 u# q- M7 [2 l' S
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)+ s, [6 W5 b+ J! K$ J
-AX = 0912h (Get breakpoint infos)2 v# h8 |$ Y3 }# h9 z; b
-AX = 0913h (Set Sice breakpoints)
) C2 {9 J, U% W7 @-AX = 0914h (Remove SIce breakoints)
' y( ~5 J9 {$ \
' v, Z5 p2 l0 W; N% kEach time you'll meet this trick, you'll see:, S4 d9 _) D8 x& V, \0 W; o1 y. v
-SI = 4647h! ^# m) ]2 o& v% R
-DI = 4A4Dh
0 o+ T& f: }' q! Q# F5 OWhich are the 'magic values' used by SoftIce.
, q& n& \8 u+ m; O5 sFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
9 d( |$ a0 n9 V$ q+ j5 T- \$ C9 o6 w$ |) |& G3 M( J
Here is one example from the file "Haspinst.exe" which is the dongle HASP/ g0 `& R; c2 V6 {
Envelope utility use to protect DOS applications:
. x* P, ^4 ?( \ v7 R2 H: } k
0 q4 [" A, f& z8 G! W
9 g3 t: f* O ^8 ^( `5 }8 i& R4C19:0095 MOV AX,0911 ; execute command.# k. I3 L. B8 p' @6 ^5 b
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
3 b1 i" R2 i3 u7 S; w4C19:009A MOV SI,4647 ; 1st magic value.
9 k. k W) |9 U1 ~4C19:009D MOV DI,4A4D ; 2nd magic value.
# r! @3 A( f q8 I+ d% h9 z, g4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)' J2 V8 X# c$ U% b+ ~; q' a
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
# F0 M5 D. a q: B2 g5 t- ~1 C4C19:00A4 INC CX2 U0 w6 `( B/ T$ c: K& X
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
0 V o; m; j* K4C19:00A8 JB 0095 ; 6 different commands.
$ G# t% d+ [$ K- X g( U. s+ `4C19:00AA JMP 0002 ; Bad_Guy jmp back.$ j [, e( @8 ^0 k1 p
4C19:00AD MOV BX,SP ; Good_Guy go ahead :) C P# M# @% L$ ]- o
/ y; U$ _6 g( e' f: A1 d
The program will execute 6 different SIce commands located at ds:dx, which; }* ~3 _: H% b/ o+ a* L: j5 ~
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT." S3 Q% j/ y: ]& m5 h1 ~ N
. E& Y7 a2 ~ R( H# G, P* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
3 [3 X6 r: S! w___________________________________________________________________________
- e! a) p7 j4 i9 q9 b5 T+ \( O- h- t, J7 k( v" Z
8 L0 ]( H& F, M# pMethod 035 ?! S4 T) G" ^9 [4 i: a0 A* J1 W
=========; n/ e4 i8 G4 R9 h* l( K" F
4 j, F0 }+ h% h7 _: [* V
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h3 E1 Q; ]' O( R* `
(API Get entry point) @% ^( `7 u: \' c* @# ~8 ` g
3 E4 s& t" u5 W! M1 H. [& |" W' q9 k& c3 n
xor di,di2 b1 ~9 e/ l! \! ^( ]
mov es,di
; Q( a0 t( z2 E5 `( i. ]& r+ B* _7 ~ mov ax, 1684h ' g2 |, E, m& s$ J' a" V
mov bx, 0202h ; VxD ID of winice" y! }1 d" ^: D% L( q& Z) n
int 2Fh- B; p) M% |; Y) I
mov ax, es ; ES:DI -> VxD API entry point
! [0 R2 u$ _- y @ add ax, di
, z5 Z, q9 v+ Y+ K$ W test ax,ax+ \6 m: d2 ?7 s' T
jnz SoftICE_Detected5 } e9 C! b* N0 E% B! ?
7 H# `5 Q: |- E1 Q3 I4 P% L
___________________________________________________________________________3 @& L8 F' Y; e0 Z2 b4 K |2 _2 g K
1 A0 b& ]) c; O* w' x$ R) MMethod 04
, v( B2 j& G' N, G) R+ H- O/ `6 d=========" @. a9 j, w7 J- y
$ x3 I" ?# ~1 m2 q% P0 ]Method identical to the preceding one except that it seeks the ID of SoftICE3 q: _( s2 t7 y+ ^
GFX VxD.
2 @0 D# x" }) s, }
# x5 z5 \# c! m ?7 [ xor di,di; U8 e& D# N0 w" Y b5 ?
mov es,di
: e- d. F, e( D, {5 u mov ax, 1684h
( G, d. ~ B% |- w4 f8 `9 a! Z' i mov bx, 7a5Fh ; VxD ID of SIWVID* w4 i* k" A1 ~ {" M8 x. u
int 2fh2 T' g+ ~ W+ ^: ~' r5 w7 v
mov ax, es ; ES:DI -> VxD API entry point: j6 F! V+ ~& B2 h1 R Q- x& d
add ax, di
5 n7 R( _8 V+ f4 k: Y( m3 j test ax,ax" u* v- h# z4 U0 [
jnz SoftICE_Detected
/ ~* c$ ?1 c$ `8 S
- u/ `6 a% a" F8 z) z$ n6 G& F$ a__________________________________________________________________________& P. b. h+ H! q$ r0 N7 _1 }
+ h+ n' Z. B# B" u
2 l0 z7 K" z6 p
Method 05
% q5 o. Z2 D. b0 x( z- ~: A0 z=========7 G+ H0 c' a# a7 ^) @/ D
# h& ~& m, }) WMethod seeking the 'magic number' 0F386h returned (in ax) by all system q- ^# r3 z; |# q: N7 |# Q
debugger. It calls the int 41h, function 4Fh./ r( n+ u1 l( _0 S) h& U
There are several alternatives. ! v. ^0 w R- i7 f0 s
% s* G0 \5 A; f
The following one is the simplest:
' C6 b% y r+ T6 ]! i3 P1 T7 S3 D& |# s
: t+ m0 j- n6 F& o* [5 s5 j$ ?5 _ mov ax,4fh
# b) g; Y5 a6 r int 41h$ P9 e+ \, A9 }, J! ]" k& i# W
cmp ax, 0F386
0 N- ], M* K7 ~8 F jz SoftICE_detected
' E; m( E. U8 v' k' J$ p2 [% D
2 U; [- j/ M6 l2 b0 C! o
( F. `! Q/ N. ^. G% e1 N9 [* ^Next method as well as the following one are 2 examples from Stone's
) f; `1 d5 q. Q( R( X( n"stn-wid.zip" (www.cracking.net):
8 c' F. x) i2 k* f4 g+ i. Z
* a* `8 p2 c/ f5 f. \ a) O$ Z mov bx, cs
6 V# N2 K8 D3 H1 ~ lea dx, int41handler2# g) l! B) D; O( n. Z* a
xchg dx, es:[41h*4]
. f' f2 e0 j- M9 \8 M! k xchg bx, es:[41h*4+2]* `1 ^7 ~( A/ g8 V
mov ax,4fh1 ?+ {' P9 G. ]% C6 F$ t7 @, Y- P9 k
int 41h
7 K0 t: R% }! Z5 o xchg dx, es:[41h*4]
& A8 D" n F- m: u2 X; {. n xchg bx, es:[41h*4+2]
. O* d9 s" r& V0 r1 X* N cmp ax, 0f386h+ w' ]* L1 Q4 p8 F( z9 b) }0 b" F
jz SoftICE_detected
, d% Q5 R- s, i: C$ J8 l' Q, p! O/ e. y
int41handler2 PROC- V4 z: w* E. y" F5 a0 B" J
iret; @& G( v* H" b4 h. p
int41handler2 ENDP9 W& {, f, ^4 {/ q' t
8 x. G @) C! r# t& y0 Z+ k* }, }# N5 Y( I/ p" `
_________________________________________________________________________$ N9 }! x* A+ n( Z
# ^5 a5 l1 A9 T; a3 V" ^6 t$ v! u
6 X" h9 @/ u: d% w0 R0 N
Method 06, T3 {8 E2 R- a% O$ N- r* W
=========
7 u9 N1 g( o% ]+ ]$ u4 k/ A0 x: g& q1 H- n- t! e) o; W, h
. Z/ N# q! X3 ^( N- L( X) [/ X
2nd method similar to the preceding one but more difficult to detect:
# h2 t! ]3 L2 ?" y- r( p1 a* A$ c) p7 u2 d/ E! J$ L& ~4 S
" t6 p; U& `* ?int41handler PROC* j6 T5 Q" A5 u/ h
mov cl,al* C" @4 y* _' ]
iret
( \7 V. L* z% V* v4 vint41handler ENDP
) ^; W& R7 o0 T0 s) j* V8 j( p8 V+ H7 B; Q! _/ p2 K
. ~" o) F: `, Q
xor ax,ax% ]) A7 a% ?, h+ Z( Y5 K
mov es,ax3 J% a* o; g; _. D1 c# q1 o1 w4 G' ^
mov bx, cs
7 s- {* d* C0 R( Y% B+ h3 r2 m% \ lea dx, int41handler4 _ F3 x- ~* D/ y# j0 z8 q
xchg dx, es:[41h*4]
- v! A# `7 A2 m- Y9 X4 s. M. b) l xchg bx, es:[41h*4+2]# P* Z1 l$ ]: ~7 b3 V
in al, 40h
+ N$ Y* S+ C" b6 _( t. Y xor cx,cx
+ ^) x; h/ u& c" H int 41h
4 o! {* g0 R ~5 a* H/ U0 y1 t xchg dx, es:[41h*4], F8 K4 i, B' W/ n9 B/ ^9 {. v
xchg bx, es:[41h*4+2]
# P) H7 K; H& m% c0 { cmp cl,al# x4 B1 a5 p; ]* p7 S& v: _. ]( g
jnz SoftICE_detected
$ O" m! m1 l( e2 c: ]# G* Y, z1 H* w( {7 n3 q* ]
_________________________________________________________________________8 o) Q) G4 v/ n$ @
% p! E. `4 w V2 ~Method 07
% C) A& D* V; n- o( e=========
3 m9 m, s$ i! J( [ w7 F
8 x7 w" L- [; D& o; [Method of detection of the WinICE handler in the int68h (V86)
/ W: `8 @6 z. ?0 z1 q! |+ R+ E0 G& ^4 g+ V! ?
mov ah,43h
, G* A4 L/ Z" Z8 T6 ]. ^* K int 68h
" w7 J, K: b) \/ K! L cmp ax,0F386h
1 w7 i3 n# K6 S8 X; X& N4 {( k: ~ jz SoftICE_Detected; h* V; E" A; J8 {( d# |3 l. @/ Y4 o
8 Q1 E6 C6 h& b9 ]$ n6 V" s2 }( a7 O, X
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit, r* _! A/ p$ W8 _
app like this:
# m8 I$ e" ~8 c0 j: o" U+ }7 m ]- K5 S, m8 B" y7 d: h
BPX exec_int if ax==68$ Z7 S$ k L* m/ v
(function called is located at byte ptr [ebp+1Dh] and client eip is
# ?; U: z1 f+ E( K located at [ebp+48h] for 32Bit apps), A) L1 u3 y, Z" q+ X. \
__________________________________________________________________________
* [- ^! I4 p/ m6 i) l2 `# O5 M7 [" q7 L5 _
( R" c- }+ l( L* X% s5 g
Method 08
" v! ^* e9 j9 |# X ]/ f' j=========- c4 ]* ~/ D! Q0 ^$ C: Z
1 i+ J2 J) S- r& r- Z5 BIt is not a method of detection of SoftICE but a possibility to crash the
0 K& w$ ^+ G/ [4 x8 ]system by intercepting int 01h and int 03h and redirecting them to another9 Q7 e4 l) k3 d
routine.% e0 o+ x/ L2 g) t' Z) o/ W
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points. G1 b/ f% _+ H4 Y1 g
to the new routine to execute (hangs computer...). ^! x% A# P9 \' q+ k$ K. _9 z8 L
, K/ d! r/ G( c
mov ah, 25h+ [2 D$ J4 i0 |; H" A3 n! m
mov al, Int_Number (01h or 03h)( N" u% T B% f' ^, R/ ~% w
mov dx, offset New_Int_Routine9 y2 d4 Z: j0 Z ^
int 21h: ] B, g, W3 m! Z
- L+ @1 z. I# V( N. b' B5 A
__________________________________________________________________________
/ t% G8 _) Q/ E% ~4 q/ R
$ @5 t6 A0 K* LMethod 09% D1 `5 z1 k l) O! ~/ j1 n
=========
! `) ?8 Y4 [; ^/ e7 S
3 U, N- k3 V5 [This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
' g" I% R, ~1 W8 tperformed in ring0 (VxD or a ring3 app using the VxdCall).: r4 e/ o0 z' l! N3 O- p: c
The Get_DDB service is used to determine whether or not a VxD is installed6 L) m/ T5 B) h, M5 u. P% A9 i" z
for the specified device and returns a Device Description Block (in ecx) for Z2 i; W% a& @9 w
that device if it is installed.3 z/ D Z# C; B0 b8 `" X% q
8 l) S7 x% v z8 z1 ^/ j
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID, J2 r' G* {6 o$ T1 S! z0 O
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
# f; c; L* P( O$ ^" N3 H VMMCall Get_DDB
( |% M }, K! }( ~, N mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
5 F; I7 V; j/ P# f
3 x! U3 {) C g' ?6 q/ m) P1 vNote as well that you can easily detect this method with SoftICE:
8 Z+ D4 `! `, I7 c bpx Get_DDB if ax==0202 || ax==7a5fh; s5 @: f& j+ R5 ]1 R8 A
1 y. f) T* B Y
__________________________________________________________________________
) k; m, P7 M$ }8 r0 X1 j
6 L4 {! L# q6 |; J/ h' ZMethod 102 p. k1 f' l" ]9 I+ f9 g
=========2 b7 E7 @5 I3 S( d
# N4 x- k, o% H=>Disable or clear breakpoints before using this feature. DO NOT trace with
& j( H j9 d3 g5 W5 I8 h% W SoftICE while the option is enable!!
3 r, p. R' S) o8 S; _8 C* k/ p
# W& `, \. T4 z! N# y. b$ P# sThis trick is very efficient:* r2 ]# D( }7 y3 G
by checking the Debug Registers, you can detect if SoftICE is loaded
/ L0 b1 x5 ^& a8 Q1 L(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
3 a" k/ t. S3 U! X) _there are some memory breakpoints set (dr0 to dr3) simply by reading their
/ W5 P4 c# j+ H$ ^/ Nvalue (in ring0 only). Values can be manipulated and or changed as well/ \! S* ?" \& k4 J! F
(clearing BPMs for instance). \6 a7 S4 ^- |3 f) Q n
- G6 U. }- F* @
__________________________________________________________________________6 C/ a3 K5 a8 v3 s2 y
( g) v+ C+ e- J5 OMethod 115 p: @: G- c% s8 x, ~/ S
=========/ K k1 W3 }$ F# ]; G
) b4 _! x- k1 n ]0 \# bThis method is most known as 'MeltICE' because it has been freely distributed
/ X0 C9 L8 Z6 a) Z8 v3 }via www.winfiles.com. However it was first used by NuMega people to allow& Q; R4 t" i/ s$ p' x. N& a* s
Symbol Loader to check if SoftICE was active or not (the code is located
- r) P: L) ^& zinside nmtrans.dll).* \( W% Y9 k9 A l1 r4 d$ A
0 M4 G' ^8 R O8 |- s! |+ h; qThe way it works is very simple:
* j7 {3 X' N5 S' y2 I/ o& V" `It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
# d4 U. a2 B0 T" }4 zWinNT) with the CreateFileA API.
0 t& z( J1 H/ |" A( N& c7 r* y8 ?/ B# W
Here is a sample (checking for 'SICE'):
* v7 p5 Q4 i6 n, q
4 s9 L# Y" E% @$ s* U6 i( t4 HBOOL IsSoftIce95Loaded()0 R5 ^ r( B {* d, |
{
h5 J3 ]5 B% m3 b* [9 K HANDLE hFile; 8 l0 c( G5 k8 y- q9 r M0 n
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,: i; j% C; _7 O- J n
FILE_SHARE_READ | FILE_SHARE_WRITE,
8 Y) e) D, ~/ _- h- p3 E NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
* ~) K- q1 N8 ]' a if( hFile != INVALID_HANDLE_VALUE )
: }, X6 W, B" `6 @8 m {
; ^* Z, K; n( q, G+ m9 l CloseHandle(hFile);
# ?6 i: ]: ?1 p6 \( x return TRUE;- _# I# g% D+ C* \. b2 ^; S
}
2 q/ _' i. I$ \ return FALSE;
3 `6 C' k: n4 h9 c$ Y) s}& ~& c; D; y! f9 \2 X
6 @$ Q9 p0 Y8 O2 h5 }. ^Although this trick calls the CreateFileA function, don't even expect to be
9 M4 I1 S) T" V D& d7 P! ~able to intercept it by installing a IFS hook: it will not work, no way!1 s, \3 V3 ?8 ]" v) @ g
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
7 u2 J( M8 s- D, w3 ]service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)' Z- w8 \; Z. j) w
and then browse the DDB list until it find the VxD and its DDB_Control_Proc, K. W8 `5 P4 A, e) `3 Z0 V
field.
+ \8 X* `' ]# D5 u. ` g1 lIn fact, its purpose is not to load/unload VxDs but only to send a
6 E5 _3 j+ P0 ?1 z1 M( n# BW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)/ I( q6 k2 ~( Z2 O8 i9 A' b
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
{8 x+ s- Y7 @+ p8 P* L5 r" cto load/unload a non-dynamically loadable driver such as SoftICE ;-).( l0 B. U. H" c3 z0 Q. B: {/ a- m$ P
If the VxD is loaded, it will always clear eax and the Carry flag to allow
; Z& B* Y7 I! k: m( pits handle to be opened and then, will be detected.& U6 p5 e1 |5 ^5 m3 N3 f
You can check that simply by hooking Winice.exe control proc entry point
f3 M! L T- Z) M0 Gwhile running MeltICE.
" N! j: L9 [, J6 N# I, g/ N% H- x) @5 d8 K7 X/ r, M
) Y: a& r4 x) [0 _$ F5 W* S" l4 P* B 00401067: push 00402025 ; \\.\SICE
! T3 G, A2 \" G: q. G7 e5 q( { 0040106C: call CreateFileA
1 j% v0 [. t; n' v2 J 00401071: cmp eax,-001/ F+ H l, g5 p
00401074: je 004010913 O5 K; q" t$ Z0 w
8 {2 Z R9 z# c; ?8 O) P& i3 R) ]7 Y$ J: k1 e, U
There could be hundreds of BPX you could use to detect this trick.
( n% h6 A; d: i+ H- D-The most classical one is:
8 Y$ S" R8 z6 t+ _* ^ BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
# B2 s( l; B: h+ i5 u, u2 a8 x4 g *(esp->4+4)=='NTIC'! X& T( U0 X* Q. r% Z J; y
6 I3 u8 p; W g- l: s5 a3 d( g
-The most exotic ones (could be very slooooow :-(
a3 L/ O7 K9 Y; _) O: r" U BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') % Z& A9 g8 u: f4 M1 I$ n& O
;will break 3 times :-(
: D9 y: u/ L* j% o; w9 q: L7 C0 Y/ J
-or (a bit) faster: ; E3 M1 H- ?% }
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')" [1 ]9 t- x- [/ E# w
) s9 P0 @4 C% Q5 g& N" r" C BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
; \+ S3 G% d7 t; e. _; X/ G* T. ^ ;will break 3 times :-(2 H) m! A" G, M' g" A0 `
( w4 o- [6 y6 d-Much faster:% O* _( n3 ?. P4 j& ^4 H! m
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
$ d- e" F3 N! R% {1 o. c, ]9 i K2 t* q1 A0 f" B6 C5 |4 i. ~. m
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen v, d, s, o- }- o4 `3 T
function to do the same job:
% b7 F0 s! j ^( x7 f4 x2 x
& a( k* \7 A! w2 t1 q push 00 ; OF_READ) |$ z7 S( |( ^1 C; j/ R% u# D
mov eax,[00656634] ; '\\.\SICE',0
, d# f. m/ J5 A% a& Z push eax5 e( {1 f5 X! G
call KERNEL32!_lopen
) O3 J+ {1 Z$ ]( j6 r inc eax) t ]2 m9 x6 h9 l& e8 h% s
jnz 00650589 ; detected
; o& ~" l5 ?- {2 i: B push 00 ; OF_READ
) L! h' }4 @( x mov eax,[00656638] ; '\\.\SICE'5 K! S7 r' k4 w$ R6 n# O: F# y
push eax
* o. T+ ]& c* M6 C5 V' W call KERNEL32!_lopen9 U) X+ {; _3 ~4 W
inc eax
1 P0 S: a$ l' S3 r* X% j/ C jz 006505ae ; not detected
& T% T! i! N0 e5 c* [+ t p0 x$ v$ C4 P
. n& N* I2 c2 g8 Q) Q( p
__________________________________________________________________________
! d. N0 K2 S) w$ G6 S8 i! _# W8 s# m) I: B+ X/ l
Method 12# h9 r* L) ]/ J5 B4 v5 M0 [
=========
- O# i! v- B) j0 B0 C. h R% {2 h5 n' B" R1 A7 Y
This trick is similar to int41h/4fh Debugger installation check (code 05* @% b% w/ u9 l! T' p( z2 M% @- W; {
& 06) but very limited because it's only available for Win95/98 (not NT)$ E% i1 n9 l& f: h3 ]
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.* J, P! @9 O3 a/ g' X* X) T. d
* g% D" c! I8 X" z push 0000004fh ; function 4fh
7 ]; t$ r( S$ R( ^0 O- u& @3 _( e0 _ push 002a002ah ; high word specifies which VxD (VWIN32)2 Q U( M6 C6 ~: s6 b' a! K$ I
; low word specifies which service
9 Z8 |7 [1 _4 J) y+ P& Q (VWIN32_Int41Dispatch); [9 ^) q5 }& k7 L! p, J7 [# Y' m
call Kernel32!ORD_001 ; VxdCall
4 }8 ~+ ^3 u+ c1 b+ B cmp ax, 0f386h ; magic number returned by system debuggers
3 r C# d. d- _! {! _7 ` jz SoftICE_detected
7 `) P& T+ q* d7 \$ ^" B) y; o
% `9 o6 c& E2 ]7 X' F1 CHere again, several ways to detect it:
6 H6 l7 C) O# S# `& T$ G# K
7 m7 b4 i. I6 C) j& C" m BPINT 41 if ax==4f; g& T b% n% p
8 u+ \; I8 o; n, r
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
8 w M3 s% ]$ ^+ R3 G2 X1 L8 `" N& b! A' y- z. K
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
5 o1 W" g$ f: b. x/ [- ~! K
3 n5 D& S( m+ S9 o3 X4 c( P @& Y BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
1 T/ C" P' \' r) l
' w4 x( p7 ^: k__________________________________________________________________________
& I4 W. P5 P/ y6 m
: k/ d3 @3 N* g% |) n" L; gMethod 13
8 ]. F% o8 a/ J=========: s ]7 e) _ C5 L) s5 A
/ |1 A4 o0 j; g+ O. v0 t1 p1 sNot a real method of detection, but a good way to know if SoftICE is. i% a$ S/ P3 E1 e) K
installed on a computer and to locate its installation directory.* G) }; l9 T9 V/ c1 H R9 M: s
It is used by few softs which access the following registry keys (usually #2) :! a! p: w( C# ~% r/ F5 ^$ t
: o' z% P. T; ~4 \1 e" Y
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion( {5 e+ e) B3 {
\Uninstall\SoftICE/ D2 s/ x, v# Q0 A+ F% g: c
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
- E" p* c9 y# \4 q3 F% K5 Q-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion1 c, a1 h* D- i* Q( b: n+ B
\App Paths\Loader32.Exe
) F; Z/ h4 S; [7 n& K: v7 @' G9 j' y3 B, S
, W, A# h, A0 x5 d/ K5 b1 }" _
Note that some nasty apps could then erase all files from SoftICE directory3 k" h7 b. F# @% f
(I faced that once :-(5 c* m' }* i2 M2 z6 \' c
; V2 C3 I. w) c) l- `; [3 T( FUseful breakpoint to detect it:
' r5 z! A' B0 t9 {4 L k x4 |. [4 E/ J7 N( [, F
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
6 w1 n9 d: u5 I" _1 b% A8 r" b, E2 `) _. {" W! \2 t6 t
__________________________________________________________________________
. g/ ?3 Q; M- u+ I. s& j. Q! `+ ]- ? ]% _( j
) m. v. |, E; V+ b0 K' Z2 H8 ~6 M0 G
Method 14 " V2 @. Z5 y+ R+ M8 E; T( e( b
=========
% r! X' J: J, h& ^' y# v
* K1 W2 f0 [ Z( P" T zA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose. ]; |8 x8 e; |- o) @- g+ l
is to determines whether a debugger is running on your system (ring0 only).
# L8 K; m! A; E4 A! J- `" l2 ~( Y0 o9 g( D
VMMCall Test_Debug_Installed
F5 p3 Z2 ~( k, _ je not_installed
% L" w, Q5 c! D5 u) k
# {" Z4 v$ v; A: }1 b9 gThis service just checks a flag.
" {/ U4 T B) D' N</PRE></TD></TR></TBODY></TABLE> |