<TABLE width=500>
+ w# @3 c' K. O5 {5 u<TBODY>
) J) J! f7 L9 x2 A7 I5 A<TR>
! I5 U* H1 f5 ]0 X6 ~% z4 P# b<TD><PRE>Method 01
. h% W2 Y& D f- F: w X' h" G=========4 A3 E; f' U$ Q. \; m8 n
, z& X _ |8 a' MThis method of detection of SoftICE (as well as the following one) is
4 S ~( d% ` Nused by the majority of packers/encryptors found on Internet.- B' I( _* k9 K2 M' S5 e
It seeks the signature of BoundsChecker in SoftICE
0 b3 Q+ l; S# K+ V5 C/ j, c# z+ p5 i" W% Y
mov ebp, 04243484Bh ; 'BCHK'; Q* L' G/ r% I; Z
mov ax, 04h% @! Z, Z) r. E9 W
int 3 ) O' \+ Y# Y* E1 S( P
cmp al,4
0 C2 S' M7 @9 t jnz SoftICE_Detected* D6 p5 q$ D2 n, ?$ [9 B
% o1 f7 ]2 b! U9 F___________________________________________________________________________
$ j9 ?& A& h% d6 ]- f9 O" T; E
% [6 D0 g, y. Q% a* J" U( tMethod 02; ^9 X7 P6 e+ C9 W* Q
=========! R+ q2 j0 l+ V# j; U( s! Y
. D2 g% e2 `; d) _9 ~8 iStill a method very much used (perhaps the most frequent one). It is used$ _! B7 P" ^- T2 v: O( Q
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
( h0 ~/ V4 _& O6 ^9 Mor execute SoftICE commands...- y1 a- N8 u5 Y; i. F3 |1 R& r8 ?
It is also used to crash SoftICE and to force it to execute any commands" H I- L+ B5 H3 G% y( F4 Y9 I
(HBOOT...) :-(( ' U! z8 \- y5 S9 E0 R
; e5 i3 q" B8 K# m+ B% sHere is a quick description:- b% @! q: K5 C; y
-AX = 0910h (Display string in SIce windows): `5 f+ ?0 c1 [7 Z
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
' d7 a7 X/ T, j, h. [-AX = 0912h (Get breakpoint infos)( ~$ {& w! p; {0 k$ L+ Y1 j5 |
-AX = 0913h (Set Sice breakpoints)
5 p7 i/ p( T8 F-AX = 0914h (Remove SIce breakoints)7 A7 D* W% }3 k
( i& L* l- ? I$ y" `8 U/ ?Each time you'll meet this trick, you'll see:
, S8 \" v" w+ x5 s5 q-SI = 4647h
1 o ]/ i' J$ F( y' ~( v& J-DI = 4A4Dh
$ H- ]2 ?. T( B) J' jWhich are the 'magic values' used by SoftIce.* N J- L! m0 p% t" N
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
# p4 r# z& S1 Q% n& v% q, c- W& L( F
Here is one example from the file "Haspinst.exe" which is the dongle HASP
. N: P, ^3 T' iEnvelope utility use to protect DOS applications:
; _% z2 k1 ]* X/ B( d
1 @, v& a/ r! C5 [5 D6 c' Z
* e8 ^7 m/ ^4 H, |' \6 Z8 {& {7 E% d4C19:0095 MOV AX,0911 ; execute command.
, J& z& ?6 F- H0 @: l/ L4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
: u& T1 t {$ j3 _4 g0 P" k4C19:009A MOV SI,4647 ; 1st magic value.
7 N: g) k. G4 q% H( Q4C19:009D MOV DI,4A4D ; 2nd magic value.
2 D W( ~) K! M9 h; X! t% a4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)$ f( p% c! P$ S' S
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
$ K% T: B5 y( c4C19:00A4 INC CX; c4 c2 e7 a5 G+ p
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
; G( q% r$ P; H- W4C19:00A8 JB 0095 ; 6 different commands.
+ G9 v, I) n4 v- h4C19:00AA JMP 0002 ; Bad_Guy jmp back.
8 x/ v3 n- L0 v; d$ i* l4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
) u, Z9 n9 {7 M# c' b7 a# _0 i& |) h( h
The program will execute 6 different SIce commands located at ds:dx, which
0 a, c {7 {6 F/ D+ T$ eare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.: ~( b. f8 z* C5 a4 l4 T8 V
9 `& J! y1 A% Y$ S5 m& V0 j
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
: y0 s( p6 r; [0 v% v___________________________________________________________________________
: ~) x; I& ?4 K% B0 s Z+ i( i( T# m& Z
+ p0 l+ j4 e7 O. z6 RMethod 03& x- i% R, U9 C( l- u% F/ G
=========
6 |, \' @5 l2 L: l
0 X$ |& ]& w- y1 ], j ?* k. qLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
- C! c; }: W9 ](API Get entry point)
) f; ?4 g+ n, \* f& Y 7 q3 H) z/ L( h) N
8 K& Z7 r5 j: E xor di,di
6 w/ j1 a; r. X. S! d6 H# U- G8 j: t mov es,di
' D/ t6 t0 k1 i# F; h/ G4 f3 ^ mov ax, 1684h
& v, t3 d* p) B+ d( @6 T2 W5 k0 ^ mov bx, 0202h ; VxD ID of winice" O: a0 R% ]% O' q
int 2Fh5 a$ s2 D8 v. J" h9 L0 @# g+ {$ {# p
mov ax, es ; ES:DI -> VxD API entry point
/ x4 l- v4 f6 o X9 m" D add ax, di
% _1 U i* h* D' D. e3 J test ax,ax
6 k) [8 ]& w9 U& V3 t jnz SoftICE_Detected
- u2 f9 u7 I* [( f! I
! i! m) o7 ^- Y' R6 |( k; K, k___________________________________________________________________________
D o2 o" L, N- c6 v& m. k1 \. s
' E% Z# S: h" KMethod 04% Q7 i; S# B. |
=========
1 i( x! b( D8 W2 s) C7 S
+ s3 P* t& r+ t$ }3 [Method identical to the preceding one except that it seeks the ID of SoftICE
* E4 M& p6 k6 l6 E: y8 Y9 X* @GFX VxD.
6 S% e/ F4 R. ^+ J* B
% s, I% M3 T+ f; `; u! y xor di,di E. {6 t5 f$ r6 H2 E
mov es,di& D+ y& x) S9 Y
mov ax, 1684h / t; u. H/ A/ d# t4 F
mov bx, 7a5Fh ; VxD ID of SIWVID& f9 C0 [+ P9 b# b
int 2fh
: \6 U# e/ h- p& g4 m) e mov ax, es ; ES:DI -> VxD API entry point. T: a! u( _8 ]' Q/ s, l' f1 L8 I, E
add ax, di1 O, S: \# \) U3 {2 f
test ax,ax% U$ H: f" Z5 U, v3 k
jnz SoftICE_Detected
& u9 O1 F6 K) j/ r& y+ `, S. ]6 o0 j0 C2 Y
__________________________________________________________________________
. d) m) P6 j2 w+ a3 @7 k E( h. Q
, g- ~3 a# n6 p, z2 S( W7 r3 n6 SMethod 055 h; t1 U2 j3 z- t* q* ~8 X
=========0 g+ A& x& V; ^& C9 [
6 S2 J# a) g8 O' S Z
Method seeking the 'magic number' 0F386h returned (in ax) by all system
8 A9 f; m3 @% U7 }) r3 d3 bdebugger. It calls the int 41h, function 4Fh.) [( {* P( G7 m4 @
There are several alternatives. 3 j# n) A! D/ ^/ z' M* J
0 g+ f9 }* m' u) L
The following one is the simplest:
# b+ V; G( y/ I8 `9 G1 d) S5 ?# m4 M; l- ~" E
mov ax,4fh
1 x4 V4 }* o6 A% m* ` int 41h
0 l0 j# H/ L% R# ^! i: | cmp ax, 0F386
3 b1 z1 k, w6 h; `6 T jz SoftICE_detected( v8 C4 q6 C( Z8 u. D+ T$ J0 J
. b6 K" I+ L2 K% p' e1 h" u# L Z/ r
Next method as well as the following one are 2 examples from Stone's f8 y/ x! R( ~" C: k& B6 S* a
"stn-wid.zip" (www.cracking.net):" G) S7 ?4 N) n
# V8 r3 {4 u$ w* _8 s
mov bx, cs
- c$ T/ Q7 J- t$ ?/ \+ K3 E3 W lea dx, int41handler2
4 @; y; r) X5 A% d) Q xchg dx, es:[41h*4]
1 }6 B7 {) P$ C xchg bx, es:[41h*4+2]; R6 P8 J; M/ P0 ^; {$ f; E
mov ax,4fh- F, }8 ?; v0 {1 c* q6 Q% w
int 41h
4 g9 T6 o8 c1 @ xchg dx, es:[41h*4]/ {3 Q( I3 l5 d2 v: Q
xchg bx, es:[41h*4+2]0 @9 n0 `: H$ \
cmp ax, 0f386h
" u+ o8 l; i# L jz SoftICE_detected
! f! R" I g( h8 f; t8 V- L- e, ]. @! B
int41handler2 PROC
) m% ~. f- o* J+ i5 P+ y5 e iret2 D/ S, [8 J) ~" ?
int41handler2 ENDP
Q% k9 `$ u; K/ H- e# x' b' U0 O9 B' k8 i
v3 z" |. b% q/ B2 @" Z8 u_________________________________________________________________________5 i4 `( ~3 Z" ^6 c- i; W w( Q: K
) X. ~4 I. c2 a5 w& d. K( M8 B* ^
8 _6 O; W1 e( ^* n7 ZMethod 06
t9 g. j# X& f+ ^=========: Z9 y& S3 B* w: ?0 z' @" N
0 c* G' o& B& L" V; _
4 Q" i2 V: E! X- |8 t: o" u; f2nd method similar to the preceding one but more difficult to detect:
G) M- m3 _2 g
' D) p$ e1 |, K3 M, s
h. q- u1 O' L# Dint41handler PROC
: P1 m! X0 p0 t/ h$ k! {' n mov cl,al
* |& W" z- _) C9 @/ t& J k" L iret
$ S4 ? S" T# r c; ]1 ?) @5 {int41handler ENDP O% v: l c1 v" e( f' ?: u
" o5 I, k% Z9 a
$ q( P. ^" q1 W" f
xor ax,ax+ w2 o+ j4 n. \, M9 E( ~
mov es,ax
* W' u1 D% v" C: T mov bx, cs6 e. I3 q- v1 R S [
lea dx, int41handler3 B6 F$ R' S$ {/ E/ [; Z
xchg dx, es:[41h*4]# ]/ n' n/ L# j6 c3 B
xchg bx, es:[41h*4+2]/ E, k- D! S8 p2 n: K
in al, 40h
/ {. N7 m. k# d0 N2 C, }3 D xor cx,cx' O/ j5 s* D! Y7 m% |1 O9 @3 g
int 41h1 X& J2 e; B' J' O) [8 h' a* V
xchg dx, es:[41h*4]
1 w; B- L: Z6 L2 d" k xchg bx, es:[41h*4+2]
' N! h9 y* B- n- w& s0 H cmp cl,al# c7 ^. ~5 r# U/ y1 O
jnz SoftICE_detected
. w/ V; _5 t+ \" _6 n, } e7 g% F7 e3 `' d! f
_________________________________________________________________________
# ?2 u5 B9 M5 H( f6 r% ]2 Q! O" E/ N4 H! r7 Z3 W5 f: O
Method 07
, y+ }, C* B" a=========! Y: k- A/ `$ }6 A, h
* B7 U1 B7 |+ `3 M n+ |# G9 V3 v
Method of detection of the WinICE handler in the int68h (V86)
$ L5 d l; n, v4 r
) Q& v# e5 b. {. t2 j3 y/ i# z! W mov ah,43h6 V- s% K6 ^' M$ i8 _
int 68h- [1 U4 ^. _2 u+ g# D
cmp ax,0F386h9 y0 h2 G/ U+ P" g/ {- ]( k
jz SoftICE_Detected- k; v: F7 _$ _- B( ^3 T1 k
# n% t2 p7 F( ]$ j5 z. e
5 j/ |2 K1 T+ Z$ C
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit1 i' }& M& \3 \9 ~9 A
app like this:# N% h# z% M. s9 u, {
. p/ b9 [9 @4 R- s2 l F BPX exec_int if ax==68
- ?' u$ l1 _' t/ j% E' m% M% ^: _7 | (function called is located at byte ptr [ebp+1Dh] and client eip is2 ]. c$ w9 a; j# p8 c
located at [ebp+48h] for 32Bit apps)- u5 |6 P: |/ I. e4 Q1 a! z) y
__________________________________________________________________________) W+ M+ `: N* H' O/ L
$ k! s" n1 e" L0 o
$ }, \7 c* z) r9 l7 I2 sMethod 080 L5 a+ p' _5 z3 H
=========2 c [3 _0 ~1 \
* W M) }3 M7 t( D w
It is not a method of detection of SoftICE but a possibility to crash the
4 w# P: N7 o# D! T# K/ nsystem by intercepting int 01h and int 03h and redirecting them to another
+ H% u1 z) o' Nroutine.( v5 S: K! F, y( `5 g# A$ y9 w+ c4 W
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
! [* Q- O2 _( a$ F! n5 }to the new routine to execute (hangs computer...)1 }' q# H: N7 W- K
, X$ q% o; s" Q5 F; {* H mov ah, 25h
5 i( q* `& E$ g$ J4 e! A mov al, Int_Number (01h or 03h)( P! O/ @: R* N& x- n) J( r4 N6 E
mov dx, offset New_Int_Routine( f9 L8 n6 v, |. I
int 21h1 \) l& ]+ l2 l n2 ~, r; ~
/ t+ P+ A. I' @* E# X9 c: C: W__________________________________________________________________________
8 ? Y9 i! _3 Y, k! N) A$ A c9 k5 z1 v! g( ~# |
Method 09/ t* l1 E# X" k3 q+ O* A
=========
( V! e6 c: s3 P6 c/ K3 z: R. d3 c- |
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only$ S* b7 L% n! R5 ~; t/ I( S
performed in ring0 (VxD or a ring3 app using the VxdCall).7 c$ w* u4 Q5 M
The Get_DDB service is used to determine whether or not a VxD is installed$ ?- i8 y& b5 |% o
for the specified device and returns a Device Description Block (in ecx) for& x# ?+ G# o ?8 D! y
that device if it is installed.$ a$ a, r4 }5 [
' r( E; r7 Q: T! t mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID( ?" _+ A+ r ?
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)6 V* ^/ e' n9 r! {7 H2 c8 e
VMMCall Get_DDB
h# l2 I6 U# } mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed* V9 w( W4 G" H) C9 D' N1 R
7 m- W' P/ F+ V! wNote as well that you can easily detect this method with SoftICE:
6 W5 K* j; P. P/ U& [ bpx Get_DDB if ax==0202 || ax==7a5fh5 l0 r# t( w% b. f- f& T
2 E ^- [3 K9 U" G& i__________________________________________________________________________
4 L# r7 S5 Z3 |2 }0 A8 }1 H/ h) \# z% p
Method 10% w- K( C: o3 D4 h! o* {3 {, }/ |
=========
8 D$ K. K- z3 ?( R7 g [- }9 f ], }. _! [1 Q
=>Disable or clear breakpoints before using this feature. DO NOT trace with
e3 s/ m/ B0 w3 N2 B/ Y SoftICE while the option is enable!!7 S' R& P6 l8 Z% r
8 ?! w; C6 I ^! x5 p! C7 l5 NThis trick is very efficient:: I6 t" g: ~, w$ M6 U( w' }
by checking the Debug Registers, you can detect if SoftICE is loaded
8 \) x+ R# F0 v. o; x(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
, _- T8 g: q2 I' b7 d) ]there are some memory breakpoints set (dr0 to dr3) simply by reading their
9 \/ X! o% m# N3 R1 r# d. t- zvalue (in ring0 only). Values can be manipulated and or changed as well% G6 K6 Y- q. _, L
(clearing BPMs for instance). A' D; J& g" i# p( N- t
5 r, K# t) j- k; }9 W5 ]0 V+ |
__________________________________________________________________________
9 z" c; ^) N# y7 D; X# | H* O7 ^! [5 v/ ?" ^
Method 11; f# T1 }0 n2 c# T# Y7 Y* [, _
=========
) b. S1 r$ Y9 l7 h; V4 d! ?4 A
This method is most known as 'MeltICE' because it has been freely distributed: s7 n9 y* X& g
via www.winfiles.com. However it was first used by NuMega people to allow
7 M% A" ^2 f7 G. W D0 N9 LSymbol Loader to check if SoftICE was active or not (the code is located
) y2 C0 T$ d/ s3 V& C2 P; dinside nmtrans.dll).
; j. Q1 m2 k9 p. k' J/ x3 b4 M# J( m/ L9 A/ v" Z
The way it works is very simple:
3 `1 i& P1 O# L/ b0 lIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for0 v9 g& b4 T* m* g J' d4 [
WinNT) with the CreateFileA API.
* t) B3 ^# {( @: f
# | }- s, w. `3 jHere is a sample (checking for 'SICE'):
6 M( B. a7 ~9 n @
) a3 |! } f; d9 {; e" pBOOL IsSoftIce95Loaded()
L* ~& q! l/ T+ \8 ]5 C* n! ?{( ?# ~# T, }/ V) o$ C
HANDLE hFile; " Y; _: S& J4 `9 g& \ m9 C
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
0 j2 c2 r- s- p' s$ \6 u3 Z FILE_SHARE_READ | FILE_SHARE_WRITE,
* j( d& a& M% C0 u: C) a NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);4 W6 a' f$ p+ H/ Q- l
if( hFile != INVALID_HANDLE_VALUE )/ r v( ~7 R! q1 N6 r
{" o3 {5 O% d6 ^. h
CloseHandle(hFile);' Y/ f+ H. y7 Z' A/ |
return TRUE;+ b0 |, G- |% \: z" P& c7 \
}
+ i' S+ }7 u0 s. m) | return FALSE;" O. H+ D, M6 _8 u, G
}/ w v* A3 T; U8 ?1 W% Z
# u6 o! @5 V& Z: B" F# HAlthough this trick calls the CreateFileA function, don't even expect to be
& R! O e" e; ]7 f9 r7 g/ U% Pable to intercept it by installing a IFS hook: it will not work, no way!- | z8 U. K8 |0 \+ @
In fact, after the call to CreateFileA it will get through VWIN32 0x001F0 [! R' N4 ~1 O# u8 H
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)! k( g- [; W8 L, U3 l) ~; {
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
2 P, Q0 M9 G% ]8 @5 _field.5 `, `, a1 n; M+ [
In fact, its purpose is not to load/unload VxDs but only to send a
0 ?4 w. e$ V/ x" U# Q9 |W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE). m9 A8 y. E) O. U5 y# E! f$ f2 \
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
# U( ?2 i- y R+ E+ ]/ zto load/unload a non-dynamically loadable driver such as SoftICE ;-).0 X$ G: ]7 p {& r# p9 c! C5 w) P
If the VxD is loaded, it will always clear eax and the Carry flag to allow
4 t7 c7 u! k: O0 c3 uits handle to be opened and then, will be detected.4 C7 ?- B8 N+ I5 }3 c
You can check that simply by hooking Winice.exe control proc entry point
, H4 L9 P5 \; Y# e$ Jwhile running MeltICE.4 h4 W5 }, [. P+ N p: [3 Y
) \6 q+ ~# o2 M- D" T
9 H6 A0 z5 e, w/ t: G: N1 n- ?
00401067: push 00402025 ; \\.\SICE1 k5 d% l$ Q: u9 k$ A5 v& W; l2 L7 N7 w
0040106C: call CreateFileA, F! l. d: _/ Q2 g
00401071: cmp eax,-001
/ [: P+ j; T+ r+ _. {/ M$ E" g+ u 00401074: je 004010915 f# o: v) W' A% U0 v: q
5 B8 p& D7 n: i, Q9 v. S
" T: P+ C9 Q4 D5 I. d1 S& HThere could be hundreds of BPX you could use to detect this trick.
* X1 E, o3 z% d5 @+ O-The most classical one is:# E; L8 b, \% [
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
* \* a7 H6 V8 p! p! ] *(esp->4+4)=='NTIC'
* M; S/ U/ d4 i
T( m; P+ M: P* g# {; J( s-The most exotic ones (could be very slooooow :-(- L3 i6 H C9 {: ?9 J- ~8 |0 `
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 9 d8 q7 e2 a$ b" e5 a9 T" s
;will break 3 times :-(
+ k, c- _8 Q- ]& k. K/ A z, b
% n5 i/ w7 U& Y+ H-or (a bit) faster:
8 G B* X$ E8 o# D" E BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
' q; l4 W7 G( ?7 @. N$ i7 W% A$ v+ ^8 y) z2 X
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' Q; q; N) \3 l
;will break 3 times :-(1 ] `. S$ B: J4 k2 @! a; K
) S% G3 c2 C9 o! @-Much faster:
7 Z Q' a( q1 m" T8 Q BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'3 G- P' M0 H- t! ]
2 J; N: B f6 G) X8 G7 X! L* r; sNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
) O2 p7 V, t) ~5 S" z+ j$ dfunction to do the same job:3 F0 z( H6 k; S1 V. \! q( k; [5 C
+ M8 I: i& q' N- x* k, S
push 00 ; OF_READ
7 f* y- O2 {/ g! Y4 ^* u mov eax,[00656634] ; '\\.\SICE',0
. Y5 j" Q5 A1 l s6 U push eax
( a/ _+ s& j% B1 A4 Y2 v call KERNEL32!_lopen' V* B, _8 q7 r- J
inc eax
' v |( }# z- @8 D/ ?8 V jnz 00650589 ; detected
, R6 ^) H( L" F! p push 00 ; OF_READ
! s! ^' a9 I6 X y, Y mov eax,[00656638] ; '\\.\SICE'9 `1 g$ C# F8 p3 O7 f
push eax6 e7 \% Z1 W$ |
call KERNEL32!_lopen
- M' H0 v, f( d5 Y1 O- s7 v inc eax/ H( K! J! O) P7 t/ o$ h: r
jz 006505ae ; not detected, H1 J8 x4 |- O% @/ F( l6 }6 V
% J( {8 ~. I) J m. Q
" `! H; Y' r/ i& A1 A: j% C W0 \
__________________________________________________________________________: I$ u% ]$ ^, j; U) f& F4 d
( J+ `1 y" Y# K) g
Method 12
/ b) x* v7 ]7 ?* {8 n m1 Y# ~! N=========
0 {/ M3 ^' G* v
* T; R" ~2 m. F6 }6 d7 \" m" yThis trick is similar to int41h/4fh Debugger installation check (code 05" c% r& X' m0 \5 L+ ^- C5 u( Y8 F
& 06) but very limited because it's only available for Win95/98 (not NT)
) v0 t. `' e4 F# e8 ^ sas it uses the VxDCall backdoor. This detection was found in Bleem Demo.. E$ F$ N2 ]; `5 I3 l: L
( F2 u" L, n; e3 X
push 0000004fh ; function 4fh- U* C# d: k- _4 O4 K4 [
push 002a002ah ; high word specifies which VxD (VWIN32)
+ ` B6 E# m9 e3 }+ k ; low word specifies which service
, P" P4 U8 s3 k) `: f. a (VWIN32_Int41Dispatch)% p+ Y, ~, u; V* Z) \" A
call Kernel32!ORD_001 ; VxdCall3 _- ~) G5 ^+ {8 A
cmp ax, 0f386h ; magic number returned by system debuggers0 j8 e2 ~5 L* G% U/ p0 W. m
jz SoftICE_detected
5 k& @: i0 r; K7 H
, T3 y# M5 E: \! C! eHere again, several ways to detect it:
& q# R e4 l5 t6 v; ~) X! ?2 O. Z# K% e: J
BPINT 41 if ax==4f* H( |0 y3 ?# E8 _7 Y: l) g5 P& ]
0 E. P+ B9 p. ?: Q& P% P% k4 z
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one- Z8 @4 G; Y' j% L3 i8 I9 `0 w# [9 q
2 w0 {% x' g6 B( X' r2 e/ l* t
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A" V% {9 k( G3 r5 `1 J4 A7 B3 u6 X
% l2 t6 M: y' Q, r6 [8 q. r, W* A, I
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!8 F/ k3 E% Y% `# \: H7 `
8 J' p8 Y4 K8 r' ?! F& ^1 R
__________________________________________________________________________
/ t% J# R) j1 }6 s* x! G6 E
( T- D8 E% ~0 [& v$ ?0 yMethod 13
, k" d' i! k: a$ e# y" L, u' ]" i2 V=========
. b, f9 X0 C$ P9 L& b9 o2 r5 l- n/ f. @7 G' V" {
Not a real method of detection, but a good way to know if SoftICE is: F+ x- f( s' O0 U: | h+ m! f
installed on a computer and to locate its installation directory.* _1 L, J; u+ A. S# r1 M0 i
It is used by few softs which access the following registry keys (usually #2) :! x+ c" T, U; z) ]
2 ^( ~" N+ {- u( }$ I-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
: R/ Y2 B d# d7 O/ n( a5 p\Uninstall\SoftICE: ^6 V+ {! x# b3 m
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
5 T& \; d2 m7 q# R) D( ~-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
, }' d; X0 S0 P\App Paths\Loader32.Exe
- R8 Z9 d# A3 G% N+ s2 a2 e( w* B
3 s+ r0 Q& k @7 K2 G7 r. {Note that some nasty apps could then erase all files from SoftICE directory
4 d: P2 J8 t& ~9 m3 _(I faced that once :-(( ~: ~5 Y$ l' _" h1 j v
% H& _( ? Y6 A5 ^3 p$ OUseful breakpoint to detect it:
3 }+ N2 B' @: a1 H# {& ~4 ]/ F+ e* U% k. M* X6 t0 o4 G
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'1 w' \& W. n5 `) v2 u. J* _
# V6 ?8 t( X; Z; l$ @
__________________________________________________________________________
. A% }: v6 j& k9 M; K
% E" l" z* a6 [4 y P& _. ^3 b- [. U. ] {8 f
Method 14 : e/ K5 F6 \1 c* h
========= K; [4 L: D6 L9 Y: n6 c
, `% S5 |; s' q c/ i% G
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
! O7 F3 j* R: _* d; Uis to determines whether a debugger is running on your system (ring0 only).7 \) e1 `6 [2 ?, m& T
; W: Q) i. H- J: B2 a VMMCall Test_Debug_Installed
9 M8 K% _+ d# L je not_installed1 c& j, d% ~' ~# G& j6 V) D
9 N( a9 j( H4 R# |6 U2 C2 jThis service just checks a flag.' s& r( |+ \. r$ q. g
</PRE></TD></TR></TBODY></TABLE> |