<TABLE width=500>
8 {2 S/ y0 y( B0 ~6 x- w7 }* t<TBODY>
5 h& i$ k# Z+ C% P<TR>
5 M8 P- k6 a7 J9 ?. {/ y<TD><PRE>Method 01 # F9 h3 g7 A' F2 [7 l1 v" ~
=========" a1 ^9 G0 T V K
) g7 V9 e4 W3 I9 ^, @2 E% hThis method of detection of SoftICE (as well as the following one) is
% D9 z/ f( h% T% F* L, C( `used by the majority of packers/encryptors found on Internet.
% ]+ } m$ K( U# x- M$ b2 W5 q" WIt seeks the signature of BoundsChecker in SoftICE
/ T- q! q# K8 r G3 _% Y! R: F. }" W6 {1 ]
mov ebp, 04243484Bh ; 'BCHK'
* d$ {) B! t' R9 [ mov ax, 04h
1 F. `& [" F- O$ j7 P4 V K5 \ int 3 0 {5 \+ d8 K1 @0 V1 {5 s& A% t
cmp al,4/ n3 ]. g }/ M' }7 l K: h) q* |9 b
jnz SoftICE_Detected' u) b6 F" W4 q5 f: [7 s9 X: B' t
( V5 X1 Y; @( i4 w4 L2 }& ~___________________________________________________________________________" j$ |) L* m, c6 t1 S! L' x
$ I# R" _; z- ?5 U8 y/ \* O
Method 02
9 X( @' n# A- G" R- X3 w z=========2 @7 y6 }/ r- b; a) |! J" c
; |/ g3 o" L9 _/ ?6 \/ ]Still a method very much used (perhaps the most frequent one). It is used6 t: Z5 Z: I3 o* b
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,! A7 a0 O+ L, x0 W" Y3 O
or execute SoftICE commands...8 a% ]/ p& a+ v
It is also used to crash SoftICE and to force it to execute any commands6 `& p6 p9 v% E0 f! D6 b
(HBOOT...) :-(( / S6 m; {, k& G/ e$ P0 @
) b5 m7 k- C( b H9 r- n1 F1 a
Here is a quick description:
* l, a; v, r2 Z- E; a& ] P5 J, \7 p-AX = 0910h (Display string in SIce windows)
9 f) K5 g& X8 u/ |. K& V A7 G" X3 O-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)5 x7 L7 u0 |( X, W2 y! }; k
-AX = 0912h (Get breakpoint infos)6 w/ {5 J- {- t9 }, \
-AX = 0913h (Set Sice breakpoints)
% r, ?% j+ F: m3 A1 |-AX = 0914h (Remove SIce breakoints)
: V3 D9 D" }' }: ~) ^2 T* W+ o$ A ?7 g0 y
Each time you'll meet this trick, you'll see:
0 x; L8 ] ]4 l* {5 |$ V( F$ A-SI = 4647h
- A. j9 b! v; Q: E$ c, I T-DI = 4A4Dh, b/ i& \! {; \/ W
Which are the 'magic values' used by SoftIce.* s3 \/ `; m- x
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
# I6 j) K$ H- S' u
: K6 x) `. Y& r& D7 L# }Here is one example from the file "Haspinst.exe" which is the dongle HASP1 e# x4 v% A B0 X) @! N, g
Envelope utility use to protect DOS applications:
/ `+ X: K$ S: [3 G- M
2 P- r1 J8 A X" L- I& L. s9 L$ y, v! V! f
4C19:0095 MOV AX,0911 ; execute command.
4 l9 m4 z3 O A( ?) P+ O9 Z4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).% J% x' u$ a# i8 `1 A. h3 N; S4 A
4C19:009A MOV SI,4647 ; 1st magic value.* N- y7 Q$ `6 W+ e7 L& r# O/ }0 |' y
4C19:009D MOV DI,4A4D ; 2nd magic value.
0 Z+ a) ~: q( R5 [$ G' R4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*): R9 R1 ~% [- H9 g
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute: H8 `9 R' W; Z7 e' D- R# V' E# }0 S
4C19:00A4 INC CX) U! Q- c& j+ ~' ^1 n% ]
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
4 j0 v( f. p+ `; _4C19:00A8 JB 0095 ; 6 different commands.
/ ~5 ~+ `9 u0 m a) [/ ]0 i4C19:00AA JMP 0002 ; Bad_Guy jmp back.. j+ z" h+ ~0 i+ C0 f* N: a; Q! F
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
$ }" \# J% i, q" A. v h2 I1 V9 Y! l
The program will execute 6 different SIce commands located at ds:dx, which4 A/ i4 R- ~3 x$ L8 c5 a/ G
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
3 r# w0 T: M$ a' L( F( [ I; C0 `$ ?1 K1 |, p: P! m
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
' C5 r1 V) ~ V! G5 _1 |5 ]( y___________________________________________________________________________
: v3 W* l2 [5 Y8 l
' N* G2 p+ R: d, G. q- Z6 I: V& n
! n' p9 K$ b% hMethod 03) e4 {7 T6 Y ]% N
=========
/ V" K4 d3 E$ \. G' g! ~ R( z. `8 @3 N- F/ l$ h
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
' v! \- N& U% U) N$ X6 e(API Get entry point)( T" j9 ~6 n) L
% t9 f7 l9 m, q d- q
% H, P* S9 ^: G& A1 L7 M- r xor di,di; s2 ^( r8 ~, o& Q& t
mov es,di
/ `* ~8 ]0 `; i6 P9 k+ \) H mov ax, 1684h 8 u) d5 C* {7 H5 o6 h8 O& J% e
mov bx, 0202h ; VxD ID of winice
0 B! z$ j5 B) Q" {/ z int 2Fh/ ^ h6 @" D) G
mov ax, es ; ES:DI -> VxD API entry point
8 D y5 _" h$ ? add ax, di
' U$ O4 q! }0 [0 u) a9 q% y' h: v8 e3 Q test ax,ax
1 [' d' C; N8 ] jnz SoftICE_Detected
" _4 P# z" c- ]3 }( m" y1 R/ w" l9 C7 V6 P8 l, c* F
___________________________________________________________________________# C( J5 T, }; m+ {$ X8 w$ Q! r
! S1 o6 v3 w6 G0 u/ ]1 d4 s5 Q; q
Method 04
3 B7 d1 n9 `; [- J6 I. `=========3 ^3 Z% X5 Y/ A7 ~- }$ p
- m( B! W* j) e5 Y& gMethod identical to the preceding one except that it seeks the ID of SoftICE2 E' q5 Y8 E7 K$ t h9 _0 x
GFX VxD.9 f6 I/ b# G8 c* ^
7 C$ S- `0 f2 Y: K2 `
xor di,di
5 W) _2 ^; {" \* S mov es,di9 h9 j- j7 z3 P2 A4 |- z
mov ax, 1684h 2 D7 W; g, U! B- X6 A
mov bx, 7a5Fh ; VxD ID of SIWVID
' A) I7 L- N. n: A int 2fh( T6 z0 R' n8 Y* p( {/ T
mov ax, es ; ES:DI -> VxD API entry point
( T7 A3 H+ @8 f add ax, di& e; z& G! O& u5 V( }+ F
test ax,ax+ K' Y# K4 e. m [4 R! _: T; J+ R
jnz SoftICE_Detected! r+ B" \+ E9 {, A
6 {% H# P4 O& ^- j! i__________________________________________________________________________
1 f- @4 u# b. H* t8 G8 `- b" S1 {% _: A6 V! i8 m
" ?( `. s/ ~4 p4 [8 q
Method 05
' w0 k# x4 x. O% P2 c5 Y=========6 H% |( w1 m4 X: K& f8 ~
/ q' Z8 H* z t. P. U) SMethod seeking the 'magic number' 0F386h returned (in ax) by all system( V- T. P. J! X1 q* ~+ Z
debugger. It calls the int 41h, function 4Fh.
( m. U9 R t% w" d4 iThere are several alternatives. 2 }( Y: @! r+ ^; T+ B0 S: v) Y
. w: d& n- F8 ?$ t/ _
The following one is the simplest:+ t C! [ ~$ t: V1 s8 y
+ g3 t7 o7 ?: a8 l% U, Q" r mov ax,4fh" O- l8 z9 F. ?) Y3 N/ q
int 41h9 ~' J' [ s0 f4 ^# G
cmp ax, 0F386: C0 C6 t2 B- M1 x$ l) ?) D
jz SoftICE_detected1 F6 G/ {. X& E2 A
+ }# m5 J: L# Y" F2 y
6 H. e2 _- ?( ?% {: V$ Y
Next method as well as the following one are 2 examples from Stone's
8 [8 t8 O3 L P2 u9 s9 r7 a' z"stn-wid.zip" (www.cracking.net):& {2 a6 `; S" ^9 ` }* v V% f
0 Z& a* D1 t& U$ R
mov bx, cs
5 _2 Q( [, i+ a) P+ i: D; W lea dx, int41handler27 Z" R4 E& u$ b1 [' Z! w
xchg dx, es:[41h*4]
2 o2 q" S' _! g# r3 \" T- U xchg bx, es:[41h*4+2]- l# e$ R* L4 w$ n# X
mov ax,4fh
, C/ i- S/ w9 i% |1 H% J0 @$ p int 41h
; P2 W: {' U* {6 T xchg dx, es:[41h*4]
; ?! e7 F3 } a" r* D+ W xchg bx, es:[41h*4+2]
6 O) `. p* b- l6 Q6 x cmp ax, 0f386h
1 x% y$ B% H. p4 U9 Y jz SoftICE_detected
' [) F# H3 L7 m6 M( X% j4 K9 d4 Q
7 J# [2 {. `; x8 j' Cint41handler2 PROC5 E& {! r, I- k! s4 l. n* C
iret) @2 k: G0 ~ f: u7 C7 i3 G( e
int41handler2 ENDP& E# W* ~& M% |7 l/ i
# n% u. D, F' c3 o
; g* J* {; P0 ]2 P O p$ O_________________________________________________________________________
* R5 R, q. v' l3 A) J! U
1 T& r, H3 m) _
' ? j% c+ H' d% r& p$ `Method 06/ C; n- F- `8 e% I5 w7 S
=========$ a: X r3 _; Y4 q1 h
, q$ N4 ]9 e4 I h, k" f
8 X7 W7 a+ B. S8 r2nd method similar to the preceding one but more difficult to detect:0 O, } r! {/ O2 U4 q. T% V' K
! v! B! d# B7 j* J6 T
6 V+ [; Q" Y4 T/ W3 ]9 _% Hint41handler PROC
/ L* _# u" a& e% g mov cl,al8 C2 y' Z0 c/ I- _3 g5 F( P. h4 H
iret2 m$ J5 O) a3 i! V) ?( G
int41handler ENDP
& s6 P8 H" _ S$ P5 p |- C4 \. R2 r! G( T7 w) M
5 |+ E2 L) s0 O' B
xor ax,ax% W, l7 V f( V
mov es,ax# A6 p w7 J4 Z R
mov bx, cs
( \$ B5 V- A' h. D& M0 d: _ lea dx, int41handler" R1 l& x q. O3 X2 `! P
xchg dx, es:[41h*4]- H$ e$ c4 X/ i4 N0 Y3 Q f
xchg bx, es:[41h*4+2]+ y. m2 B0 T+ y& I9 A
in al, 40h2 J6 a. o* |8 `+ C8 {
xor cx,cx. d% t6 Z8 |3 q) t* Q, q
int 41h
$ x. Y9 ~1 z1 E* T xchg dx, es:[41h*4]
+ [; K/ Y; d+ m7 p# y+ k xchg bx, es:[41h*4+2]
+ B9 o3 T8 K7 B0 f cmp cl,al u) G! w8 O# H% e/ L9 w0 k
jnz SoftICE_detected0 E" V9 C) h0 A5 g! E4 [
8 F0 b% ~; z, d$ e
_________________________________________________________________________" ^+ |. U% w: v6 ^8 o
+ r; o. f# f: s6 E( PMethod 07
7 w' `) `! n+ ]% X=========
' g+ ?6 a* Z1 l& O E; ?* L' m- u% c) q6 E* P
Method of detection of the WinICE handler in the int68h (V86)3 i+ o9 m. J9 Q* C. J7 ^0 |
5 G" D0 o3 _$ B0 r( r9 f mov ah,43h* N/ J2 T" j8 M3 n
int 68h% t1 b% n' x: n3 @
cmp ax,0F386h+ e/ A6 r6 B. n7 C0 w' @6 F7 N
jz SoftICE_Detected
4 @$ m+ U/ ^5 ^
- O' F1 Q. ?' C2 A& N/ F1 l) u6 ~% l: T4 k! M) Y
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit. n6 t! }. {3 o& D1 A# L
app like this:
: L% m# [% @# ?& h8 R8 ^) R I' k' Z. K6 X( Z
BPX exec_int if ax==68
9 ^6 L1 b5 N: n% H- ^ (function called is located at byte ptr [ebp+1Dh] and client eip is& ~: W% Z* s, K! q9 r
located at [ebp+48h] for 32Bit apps)4 J# v* v1 u# e* m9 y: o
__________________________________________________________________________% T& a- k3 @. ^6 R
: D6 Z; ~& d. U4 a6 t0 D m# m2 d9 g& b* e r7 Z. @4 J6 M0 X
Method 08
& T2 M/ n, E9 o=========4 h* \" p( s: H3 Z( ?
& z: F- b& G! @$ G. x2 W
It is not a method of detection of SoftICE but a possibility to crash the m4 P2 a6 K! {. U% l: c
system by intercepting int 01h and int 03h and redirecting them to another
, a% E3 i6 ]& F$ l* yroutine.
$ ^& e: u/ G/ f; xIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points( p' p, L* t) u
to the new routine to execute (hangs computer...)
+ i" ^6 ^$ C8 T1 l, |) C5 S+ o2 V o. w3 d
mov ah, 25h
! k: x4 P; V1 A* o2 g1 _ mov al, Int_Number (01h or 03h)1 V. K/ a4 }; R- ^4 T
mov dx, offset New_Int_Routine
) i* ~- l6 u; _ q0 Q, ^' { g7 F" c int 21h
( k; {. Y1 f7 @# _+ o4 `; w
! O( M; p0 _ I( }__________________________________________________________________________* }7 {; q" ]* F) X Y7 i
* i. t8 G$ {, D h- I; J9 T! @
Method 09$ A7 Z2 i, j. N- z8 s- E, q" s
=========
8 y& U* l9 c+ t9 N6 q6 [, P" _, e# v0 u% ^! p6 m
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only) l( x2 L% L5 x0 {9 h# g. [9 F7 V/ P
performed in ring0 (VxD or a ring3 app using the VxdCall)." ~% m3 f* Y+ e2 t
The Get_DDB service is used to determine whether or not a VxD is installed
( A# j( T. Y7 M- |. e! K! lfor the specified device and returns a Device Description Block (in ecx) for
$ q) ^7 g$ Q* g; M# [6 v* c# Nthat device if it is installed.
% {- X& o9 f! h: u" ?$ a: m* O5 E+ ^' c
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
: n. f: A5 }: N4 w4 w mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
) b: M" E* L: z! m7 E VMMCall Get_DDB
7 b6 j" d3 D9 m4 S mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
$ ~5 I2 t- r& R' t5 H& Y b/ L7 \& M b: M& K u" I5 W
Note as well that you can easily detect this method with SoftICE:6 ~ o8 a; ]4 b0 {7 P- M& j; K
bpx Get_DDB if ax==0202 || ax==7a5fh
) E( W) E* r4 I+ [) [# ]) t0 }# b+ f9 x+ F
__________________________________________________________________________% X+ L+ H9 Y" Q, q8 }7 d2 K! Q
7 k1 j }* E, fMethod 10: o4 h2 P0 u* D* |3 i
=========8 C3 y% ^- \( k+ Y i+ U/ v/ R4 z D
1 f+ `' `3 l) b/ @ n3 u=>Disable or clear breakpoints before using this feature. DO NOT trace with% p0 G! s7 _3 N
SoftICE while the option is enable!!
/ w2 [9 v" W3 M
4 H+ b" o- G2 _! ?1 W) C6 {9 AThis trick is very efficient:' W; Z% Z: ^1 S( |1 L/ o
by checking the Debug Registers, you can detect if SoftICE is loaded
* l7 M+ [0 L5 h* a$ M! D(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if' Z( T- j' t% y; R4 j! j9 M
there are some memory breakpoints set (dr0 to dr3) simply by reading their) ~8 U! Y2 u- J& {' D: C' u
value (in ring0 only). Values can be manipulated and or changed as well
7 T7 e2 w' N' X! x& Q(clearing BPMs for instance)
: q0 Y. I! h4 @& S% w- [
' J6 Q4 A% r" F& }. F* f; M; Z__________________________________________________________________________
2 u2 F7 p; K) `! Q0 i. j6 a. }+ I
Method 11
: R. n# ^% H' z7 x. O% _7 q( i=========
0 j1 V c2 g$ }! j& v, ~
/ d' o9 u+ o/ }9 ]6 _6 Y* {* VThis method is most known as 'MeltICE' because it has been freely distributed# ^1 u& {8 x2 @% n/ q! I: |) J
via www.winfiles.com. However it was first used by NuMega people to allow
% ?2 s* T# R5 s) `, M6 USymbol Loader to check if SoftICE was active or not (the code is located
. T" t9 g! N# {inside nmtrans.dll).% T S/ M: X9 d! o. i" \" T9 D
( d: |% i. H, u7 f3 w/ w" @8 EThe way it works is very simple:8 M7 k, U3 e7 F' V: X* v
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
2 _) L" B( V$ V# a/ @$ k3 KWinNT) with the CreateFileA API.
) B. W A% n% m* X6 p# S5 W( C2 @9 Q9 K1 ~5 ^6 i
Here is a sample (checking for 'SICE'):$ h3 T1 z/ z/ Y: P. N [! u
_4 S! G/ ?1 ?# RBOOL IsSoftIce95Loaded()
6 j8 e" I) j4 i% v9 f{
$ f4 g% z) n# { HANDLE hFile;
/ B! w+ A G- u5 g: F. h3 O hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,. Y2 S. D8 ~0 _
FILE_SHARE_READ | FILE_SHARE_WRITE,
! v; E3 B) Q- F1 }( _ NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);9 y8 b8 I; ~. O8 Z$ i
if( hFile != INVALID_HANDLE_VALUE ) i4 s% n+ o4 z3 z9 V. ]0 B8 U3 J
{
/ D3 |' i6 r& x$ ?. {) L* s CloseHandle(hFile);" G; Q# B/ q* A, t: f
return TRUE;
/ j7 i3 ^0 m* U4 S0 b+ o8 J. o }8 D# Q3 s% h7 r
return FALSE;
! P( M* x1 @! V* g}' M; Y b0 [6 s5 L
# u, r& R3 I- ]' p7 a
Although this trick calls the CreateFileA function, don't even expect to be
& D1 L# b# s+ V( ~) f/ c. @2 oable to intercept it by installing a IFS hook: it will not work, no way!: n6 K8 E% z" j6 L1 l) g5 C
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
. f. d$ W+ Q2 h: ?- W5 W$ a& Vservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)% k0 K# x% |7 t9 j; R+ Q
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
7 m! u* ~" Q0 m8 n9 _) y: A4 L% u* d5 Xfield.4 X6 ]$ b7 r' w( `9 W: c7 n% n
In fact, its purpose is not to load/unload VxDs but only to send a 0 l) E9 v! L% Y4 m' w* p
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
, K4 y8 [' ?4 ~- z% [! Y9 n7 zto the VxD Control_Dispatch proc (how the hell a shareware soft could try" U$ ~1 n' f. T/ @( Y% Y
to load/unload a non-dynamically loadable driver such as SoftICE ;-). x3 V* C3 Z3 R& s' t
If the VxD is loaded, it will always clear eax and the Carry flag to allow5 M5 R8 o! c) x2 ]; Y; G
its handle to be opened and then, will be detected.9 r+ q3 G P$ x1 M% G$ L
You can check that simply by hooking Winice.exe control proc entry point
- R5 d2 z9 I$ r$ k8 Y0 h4 Wwhile running MeltICE.
" b9 ^1 L4 x% M
}+ a$ t# \( x" J8 ?1 M
* Y0 G, u |9 a) W# a7 R& N: B 00401067: push 00402025 ; \\.\SICE8 H! Y3 E. x& o5 i7 w
0040106C: call CreateFileA
5 s8 x7 H7 }$ l8 C/ T: a6 @0 i 00401071: cmp eax,-0017 P& K$ m7 m7 _! u
00401074: je 00401091 q8 X8 ]9 \) }$ E( ~+ c
$ M+ O% O# q' \$ ^! j
( K6 H. Q# W. H$ b2 HThere could be hundreds of BPX you could use to detect this trick.0 c/ y3 @' B% i% u( q
-The most classical one is:0 C7 y6 L# y0 q9 ~& l9 F
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
, C# Z' f* d' Z *(esp->4+4)=='NTIC'- ?8 l9 j5 | D) S4 i2 `4 J! N
% E: @: I, i8 j0 G3 [8 v8 z4 Y* u-The most exotic ones (could be very slooooow :-(' Q! t, d3 R0 I( \: m4 X. i
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') ; r# u0 o. l. T1 b7 n3 c7 a+ Q$ t
;will break 3 times :-(( ]# E k7 m }. {+ Z$ m
7 ^ b) h* Z) T* s-or (a bit) faster: . `7 v! K( I& F' `5 S4 y
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')" d& K2 |9 x/ c& u% V
% L) `* U0 c; n i, b$ V BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
! I& D E2 }6 }/ e% k ;will break 3 times :-(
% v E2 \' a, U, P! e( b
4 ~ U. V1 k% s8 I! [6 s-Much faster:: D- T" N- x( s6 m
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'9 W# o/ |% s3 z9 C& [1 s
3 h$ r# ^: f G$ G& b- X
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen" F+ n9 U# i! N% Q/ u
function to do the same job:
' N4 w+ `. W$ X( F
4 K. p3 t# i. I5 D+ q+ e push 00 ; OF_READ
# O* T4 k* L- P: g/ O2 K: [ mov eax,[00656634] ; '\\.\SICE',0# J, a t" Y5 |9 O: N Q
push eax
) k/ E3 q! p8 i! Y( R/ {& { o2 K call KERNEL32!_lopen
* v G3 v4 w: T {7 J inc eax
. R$ A' }4 }5 F* P jnz 00650589 ; detected" \! J8 B7 {& M( ~& @# J
push 00 ; OF_READ
7 H+ v, C. m. E/ L mov eax,[00656638] ; '\\.\SICE'
& y. Y4 c+ x1 r! Y. O push eax
V: @* I* M$ Q call KERNEL32!_lopen
8 o, u# L$ D2 x2 d' ^9 n inc eax
4 z5 f$ {- z4 v' w- g& V$ e jz 006505ae ; not detected+ e, T6 u: z, U- C5 j
% l; A: F9 ]! l8 ?/ r
9 d9 x: }2 C6 s5 T \__________________________________________________________________________2 Q! O5 \2 z, ~4 V
3 b/ t% v$ i+ j4 V+ L J
Method 12" ?4 u: i) Q3 L+ R+ E- a
=========( H @; ]% e6 o6 A- m
$ ]: Y, D( p8 M/ s: |This trick is similar to int41h/4fh Debugger installation check (code 05% ]! W1 A% P4 Y( P0 n# M
& 06) but very limited because it's only available for Win95/98 (not NT)
: t, L' x) l( n e& K: J$ zas it uses the VxDCall backdoor. This detection was found in Bleem Demo.! Q# q* \/ w/ B' i
5 y/ M0 j3 _! j
push 0000004fh ; function 4fh
; `4 Q) T1 c5 ^. e push 002a002ah ; high word specifies which VxD (VWIN32)
# j4 L# x( `6 X! J ; low word specifies which service9 J; v; W! e/ s. k8 @/ U
(VWIN32_Int41Dispatch)
7 O5 `6 p, y7 g/ K- K call Kernel32!ORD_001 ; VxdCall
Y) q, d( x* U3 P3 j cmp ax, 0f386h ; magic number returned by system debuggers
/ m7 R; f; I/ M0 H5 I' Y( h0 Z( f jz SoftICE_detected, h+ G4 n6 @0 P# u+ m. a7 S; L
6 X0 _7 A2 D5 I, w8 ]Here again, several ways to detect it:( E" d- x/ K* m3 _! k
$ X/ [6 u# P$ @( T BPINT 41 if ax==4f
' A0 t6 V% P3 s7 V( @8 D# ?( u# G" K, a+ r5 J; c! A! B! @
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one4 R' S) n$ [5 b& j
: c+ f, [- B) \. q0 r& o, h
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
, I7 l! l0 D6 I, t6 u& e6 z# v: n! r# q' i8 j
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!8 y/ M% p ^# E& T
1 d* @: q. r, \% ^0 K__________________________________________________________________________5 O* D. }& w/ X3 Q9 k( Q! B
. G1 X" f- |7 C4 U) ?5 uMethod 137 U* e e% W4 E+ F" \
=========
5 ?/ J- |+ Z$ K" F K9 t+ L% I* ]8 L: b. h3 Z7 r8 z
Not a real method of detection, but a good way to know if SoftICE is' V6 j- {5 d* ]; o: a. P6 v
installed on a computer and to locate its installation directory.
+ N- D# E( y: g# |It is used by few softs which access the following registry keys (usually #2) :1 [ K; l, Z) F6 m
* _0 K( [. @7 }7 V9 K" _0 L6 M$ k
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion# s- } m" Q9 d- Y* i- F1 Q7 _+ ?
\Uninstall\SoftICE
0 d9 e9 g" a& Y* A! @3 V-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE* B6 u2 s6 c$ M. ~
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
) Z( r( N5 w; G) p- ^' s\App Paths\Loader32.Exe
) \" j# g" K5 k( s0 _) w: x! {+ ?! s, I6 ~/ W2 \
p7 J% }( k% g2 [5 y
Note that some nasty apps could then erase all files from SoftICE directory
$ Z, K$ p/ a6 D* h# G(I faced that once :-(% ]0 {8 L9 E [ v4 Q
& J* ~: I& j2 u! HUseful breakpoint to detect it:
: z- |3 C* a& G% ]% }, h$ i2 A o
$ I5 r6 N# @, i# R3 ?1 A$ O BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'2 I- M& F% K1 t% [' }5 |' Y1 b& F; K
l/ a- c1 O6 U6 V. \! D5 w; z
__________________________________________________________________________$ i! _$ G/ b. X* _# h3 v. k8 k
5 r# i# E ]$ Q# a: [4 b4 N6 ]
- d" h4 A4 L# K( g: p' B4 sMethod 14
6 \; i/ I. x* d) ^=========$ T" V3 a0 w9 h$ ~
& p: P' e1 L" ~1 d
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose& l' s( |. D1 C# X% f0 W4 ^
is to determines whether a debugger is running on your system (ring0 only).
! A7 C# y. H- w9 g
( O0 @2 g- r. k/ V. O$ s; d VMMCall Test_Debug_Installed& |4 S6 P8 S6 F/ _5 J
je not_installed
R: E! T; D1 G I1 q5 e; a2 g3 K1 @' l6 E# N. {
This service just checks a flag.6 O- u# b3 n, I2 @, V; B
</PRE></TD></TR></TBODY></TABLE> |