<TABLE width=500># @1 I z( H8 }; N4 S/ i
<TBODY>
% D5 n y: H- g1 ]" [<TR>
+ l- J% z* e L/ s3 U! j( c3 e# u<TD><PRE>Method 01
6 O6 z- j0 }4 E/ Z! t: D=========$ _# J3 F( N/ c
0 k" g6 W) _' x$ ?8 [* c3 ?5 R( SThis method of detection of SoftICE (as well as the following one) is
/ h. Y( [: H; b# Oused by the majority of packers/encryptors found on Internet.
# y/ V! k3 x; C# RIt seeks the signature of BoundsChecker in SoftICE
: g( P+ w) r6 q
8 @$ n9 r6 p9 b- Y! o9 {3 f0 L mov ebp, 04243484Bh ; 'BCHK'6 R2 ^1 [; D0 X7 {5 A
mov ax, 04h
8 S2 ]) x+ a: M# b int 3
# E0 z% I7 H- Z/ K* q cmp al,4
- |- |$ J/ P/ Y; n& {) P5 h jnz SoftICE_Detected$ f5 o( R: Y4 r* R
& c$ E( v0 t. C: g! C___________________________________________________________________________
! ~9 H w4 O$ \( u' g2 b% F( F# h1 G# {7 x
Method 02& z% s, R" F% k
=========
6 w$ s* {& e3 N
! a. o- M: I% TStill a method very much used (perhaps the most frequent one). It is used+ n) n& v9 ]8 k! Z* r
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
) ]7 y/ Z( f# mor execute SoftICE commands...
3 @+ H4 V! z# Y4 G+ j( CIt is also used to crash SoftICE and to force it to execute any commands
' m, k0 }" ~ H, l4 b(HBOOT...) :-((
O* p8 \2 |# ?9 J7 O3 \' P0 `
: m" A0 P* X( E3 V# |. dHere is a quick description:
# c! O' b$ b1 ^-AX = 0910h (Display string in SIce windows)/ ~ e4 k4 o% o7 T* g
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
5 V4 d9 T7 v1 U% ~: z-AX = 0912h (Get breakpoint infos): z, m+ T" A6 v. c+ L( K/ ~
-AX = 0913h (Set Sice breakpoints)
- V7 Q- C, b4 m4 i) i$ |$ Y8 d-AX = 0914h (Remove SIce breakoints)# f1 f+ s& i0 g5 v
$ Y9 u2 I; [- X4 E) L
Each time you'll meet this trick, you'll see:
1 [" r: `- B# N-SI = 4647h
% O* O9 p6 u) \-DI = 4A4Dh- z% t$ z5 c8 e% _
Which are the 'magic values' used by SoftIce. E1 L( O$ {: W+ z0 L. u
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.1 w6 n, S. O& @, b+ b
" w, l; D9 e ]+ E
Here is one example from the file "Haspinst.exe" which is the dongle HASP* _0 S6 [; i+ G/ @; w
Envelope utility use to protect DOS applications:/ u: h% ~ `2 ?& p0 J
8 u* g: z. P7 T7 Q. F, ^* j- F5 K
. ^/ p9 ^* G, p% U, l* C4C19:0095 MOV AX,0911 ; execute command.: k6 _ F/ R7 H6 Y8 v+ h4 m
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).7 h6 w0 J% c2 q1 c
4C19:009A MOV SI,4647 ; 1st magic value.
! f- F6 ], X9 B w" M3 \/ K( ?4C19:009D MOV DI,4A4D ; 2nd magic value.
N/ f" Q5 W1 E- t# m8 t4 }# d4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
$ [, E) |5 B- |. b" G$ P3 ?4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute* y+ ^% k2 J. H, H( Y f
4C19:00A4 INC CX
) ?$ V* C o1 Q# w4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
6 B- S; \' Z! d$ R6 k! o4C19:00A8 JB 0095 ; 6 different commands.8 S+ Q3 L( {- ?% `& U( k( h
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
' L" l3 P* f" o5 }- A4C19:00AD MOV BX,SP ; Good_Guy go ahead :)2 e+ w- K" r! K" u4 x$ p
: @: J" q2 W3 t3 |/ _
The program will execute 6 different SIce commands located at ds:dx, which
( u$ a& @) f" `4 Rare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.* s( b# ?1 o7 }
, a/ l+ v4 v0 P+ C% Q* w* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.2 N: P$ r" B+ N1 m, U6 f8 v
___________________________________________________________________________
# G) B* Z( {% R! K z* t$ ^6 H2 X) w/ C% L. }3 Y# G; d1 Z
# {! L$ k% ?% ?3 J7 zMethod 03
. P- r8 A+ ?4 I=========6 V, T6 R: _2 Y
7 h, D1 ?% ^: a" f" f4 e$ |# ~* aLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h9 F$ g$ x0 Y3 w
(API Get entry point)
! C% a& X6 K( h8 w2 a- Y9 L * u4 D# v4 U0 _0 Z. p- e
8 h: J$ x( J/ S( O/ n4 \4 l: A
xor di,di- X; N0 t" ^. T P$ u Q: W
mov es,di
! e Z- T; \, W$ D, z# _+ N( T mov ax, 1684h 3 T6 U: p! y3 w8 a% u
mov bx, 0202h ; VxD ID of winice
% n1 {: L1 n9 O2 Q2 }9 }0 G int 2Fh
' F" [* F* L# U) {8 F+ e) N# m! x mov ax, es ; ES:DI -> VxD API entry point
% r6 J% H3 g7 j add ax, di
" {; B/ F3 u; R9 t( q1 m! Z/ V1 x3 c e test ax,ax# I' n; C( K J. @8 d; R& C
jnz SoftICE_Detected
$ @2 X/ |2 s% [: r9 Q0 v0 \$ H$ R% c# a S9 J _
___________________________________________________________________________+ I+ A; t" x& y4 T$ x$ S
C; R. ~3 y h1 j8 ]- C. D
Method 04
- f9 n' s# }9 h========= l7 \: G. f( I' P+ c( Q
9 {. x8 n5 v7 P! U/ s9 R& |& l% K# |! T
Method identical to the preceding one except that it seeks the ID of SoftICE. S8 g# s. [6 L+ d+ z/ S5 p8 v; s7 [' Y
GFX VxD.
/ |7 N0 s: O, w# j8 O5 j$ E# E3 N. ^' W+ E' C! g: y$ U
xor di,di
; e+ J+ Q9 @( x0 C E* N mov es,di' A* d9 n7 \$ Q5 G, J& @" f" x
mov ax, 1684h
- o A, q% S+ {& n, Y, G; U% I$ n mov bx, 7a5Fh ; VxD ID of SIWVID
4 a: {0 L( y9 z, e) Y- i int 2fh
/ D# W, I c( q& T2 O mov ax, es ; ES:DI -> VxD API entry point
7 ]% E4 D6 g. M! s) U add ax, di
6 P3 R$ }) x% W( Q8 x s. s2 y( U+ T test ax,ax
( U9 c/ B% B! \, C" A8 ^5 W jnz SoftICE_Detected
) {" T9 p5 R3 i6 q* N M+ v
" c8 s; ~* K7 ?0 h" O6 y+ m9 K- T__________________________________________________________________________
( N: N% k7 n+ F1 V H. h2 C k
" R5 B" T; G' w b
7 r" Z; R: k" W7 V; O1 FMethod 05( g# r4 O! ^8 |% b5 t. ~
=========
: K1 g6 \; R4 ]# n- q+ j
& c7 i0 Z8 N6 _& B0 G3 D" k2 GMethod seeking the 'magic number' 0F386h returned (in ax) by all system' x2 x3 @3 M3 A- A6 A+ Z
debugger. It calls the int 41h, function 4Fh.
3 h' [. u) r. p7 f8 VThere are several alternatives.
% d- X" W3 Z, E z, @' P& x
% I+ J8 C6 N/ d4 F @1 q \The following one is the simplest:5 u2 M( P3 p+ Q% i+ N1 G
+ M1 ]( N; z5 B0 f6 B, d4 L* G2 F mov ax,4fh# }( P7 j; w% t# a5 R+ I
int 41h
# z8 v- U9 J- ?2 d5 u. U2 A cmp ax, 0F386
1 ]- b1 L; u# l0 l' ~- O% Q5 R& h jz SoftICE_detected2 B, F% Y' k! F, ]( e# f5 U
& p% h: f7 B- D! m/ v& Q
6 `0 j3 F' {8 P8 i1 _3 [
Next method as well as the following one are 2 examples from Stone's
* r* w0 F1 J; z"stn-wid.zip" (www.cracking.net):
# g" q- C0 X1 s; r
/ e3 Q% i; O9 r) V6 X- } mov bx, cs
3 z+ ~* v X1 Q S lea dx, int41handler27 j+ q/ M% ]# `/ y# G) a" O! K: q' _
xchg dx, es:[41h*4]
) V: O" P+ D6 \% U xchg bx, es:[41h*4+2]0 V9 p/ X! X3 G* ?
mov ax,4fh: V; p! f2 e e- a9 ~: V
int 41h
. I- ^/ j- t7 A; j- [8 Q% H xchg dx, es:[41h*4]6 L; @- W6 c& Q# y& B4 s
xchg bx, es:[41h*4+2]1 M* A. x/ I( f
cmp ax, 0f386h
7 m& Z) j0 L0 N2 u! V+ s, r jz SoftICE_detected
! ?; G. b! H. X- N! I7 S: p( t- |$ W0 u# }- V
int41handler2 PROC
# I6 T2 {2 \5 d; w5 a* W iret" E, Y+ S- h% o1 \" ?
int41handler2 ENDP
* R1 s0 M: U9 `( `
7 x6 l. v# R, A4 F. D1 d, \: R9 c$ C9 `2 e6 N8 G
_________________________________________________________________________
* N5 K b) z& Z. p& A' L6 m) r1 `
' N n2 j$ y; i2 i1 A+ wMethod 06) ]8 g( [* a& e& v, J
=========) O! l) `, H L
" k, ]) Y4 K/ X2 p
2 C* e' V% q+ ]% c0 t. y2nd method similar to the preceding one but more difficult to detect:0 B( L6 z, s8 } V* H0 r
9 @# s# O5 \' g* x5 F: `" k
" q0 Y% ^+ q0 G5 ?* q. `, Q+ tint41handler PROC
! H! z: I6 q! Y" O; t, l mov cl,al
; e% _4 E1 e; w- [ iret& \, o! |. i; t. c0 _
int41handler ENDP% s1 ~: @. [2 R. I: Q& E
; C8 w: R3 ]/ `/ S# y: t
N* i* j; F \$ U+ b- C0 O5 N xor ax,ax, k7 p. C* |, e
mov es,ax
* N% V) C; c: w$ {4 q3 A3 S mov bx, cs2 e4 ]; w8 l1 [1 ^5 Q
lea dx, int41handler
/ ^" ^& J' G5 H" O" m4 e4 w xchg dx, es:[41h*4]9 V; R- d. }& m( c
xchg bx, es:[41h*4+2]& r8 b1 D- `' p6 E+ q
in al, 40h) F1 q8 u8 P2 W6 q% t1 p' ^
xor cx,cx8 @" ^* ~3 U6 L; J& s: k! w
int 41h
2 `# P T2 Q$ {7 E ^7 p xchg dx, es:[41h*4]
, S! W9 k1 Q" @, t xchg bx, es:[41h*4+2]
% C+ U/ x& L' E6 F cmp cl,al
: R a% a! t9 W) w7 s) a5 n jnz SoftICE_detected
4 M- f2 [/ `) D1 D7 T+ J6 h7 R- F* N% s6 {' B
_________________________________________________________________________% G ~& t3 P- X' G
' }" E3 C, e7 @9 ~4 {. Q
Method 072 c j/ ]: y& j" T
=========1 x: `( }9 _0 S6 n5 z
! E. b" c4 }9 PMethod of detection of the WinICE handler in the int68h (V86)# e) r; I6 k" s7 M
4 p1 b/ a% L1 ~1 r: }& ]% ~" _; I0 V m
mov ah,43h
# ^" V& a5 ?- v/ T- z8 d int 68h
) d& o7 Q; H) y1 b( W cmp ax,0F386h
! b; r& U% v' b jz SoftICE_Detected$ I: O( v; ~& d' {1 N
- g& m8 d4 k9 T+ \4 }# s t5 U3 c' c" ^+ H; d4 I
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
+ O' J) X. E1 a: v* i* J7 {. b app like this:6 J% q' o) I# }/ c
8 }9 H& O& `# T: j' K' B BPX exec_int if ax==68, \* C7 C2 v& I
(function called is located at byte ptr [ebp+1Dh] and client eip is
n5 _1 M$ Q: e) Q( j) d located at [ebp+48h] for 32Bit apps)
' S! j/ d1 p) o1 e__________________________________________________________________________, Z# ^4 P& S9 z2 K3 X$ T
, v5 p' t% k8 b' D/ _, L+ |
: D: z" O( J* F. R$ iMethod 08
+ m- ~" P: d9 C+ D=========
6 k2 `/ p& X z" O, \% B* b9 R: P7 `6 V
4 t/ S! W7 k5 [( V) m8 P+ T( i; YIt is not a method of detection of SoftICE but a possibility to crash the) O, J4 D- u8 c
system by intercepting int 01h and int 03h and redirecting them to another
# P1 T; x% D% {. C9 W- ]- proutine.
5 o; p! E$ A: g3 Y. aIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
3 v7 j. Q p' W- |to the new routine to execute (hangs computer...)
' Z" F, p+ P% P; t) J6 T& T' \0 z0 H: g0 y
mov ah, 25h; l4 S) O$ X2 P+ \1 J
mov al, Int_Number (01h or 03h)
! N# X0 M1 A! E% ~; T' i6 j mov dx, offset New_Int_Routine% A& H) J! e2 o6 L# e
int 21h
% t: ~, X" H4 O; I* M0 _
# ^ E, @$ H9 ___________________________________________________________________________- Y2 _. S' T0 d% n% o! I: i; Y
% h8 i$ {9 e! |; g0 b9 b/ f# _* fMethod 098 \- W0 x9 U5 G7 T' n
=========7 q. F; n1 e1 O' v4 [) W; v$ p
4 ]8 V8 m' j- N$ E# z9 CThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
}3 C. B: A8 P: i- @" y4 Z3 Gperformed in ring0 (VxD or a ring3 app using the VxdCall).5 h8 L- N' y! M& m! P
The Get_DDB service is used to determine whether or not a VxD is installed7 p- Q @& X B
for the specified device and returns a Device Description Block (in ecx) for, r* A9 q0 E9 s6 V& b9 G- G
that device if it is installed.# A6 M8 r0 y1 w) I) l' X
2 n% t' S4 [# j) F mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID! k0 W+ _7 o" D2 g5 q8 X
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-). s8 A" M$ a: `, F' d+ v
VMMCall Get_DDB" [& Z' ?- p) b1 L: g6 g3 Y/ X5 C
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
9 W$ M, S9 ^# ]" Z
9 h W: F0 z* g5 M3 E7 d3 INote as well that you can easily detect this method with SoftICE:
' f' G8 X4 ~5 ?2 x7 \ bpx Get_DDB if ax==0202 || ax==7a5fh2 S& P3 R- Q, k
. x% ^0 o; G% V. Q' z1 b__________________________________________________________________________5 [/ @1 N/ ~8 C& j6 \7 `
% V4 \) z7 z0 j" Y6 `4 g# {( ?* W
Method 10
: H* c( P4 X0 S0 n# ^5 g# ~! G. o=========
N8 h/ M4 ?8 e: R9 Q6 E$ m- f* w
=>Disable or clear breakpoints before using this feature. DO NOT trace with
, Y1 t: n3 h# n SoftICE while the option is enable!!
' m) ]& q" Y+ ^% C. I' L/ J6 E3 V1 Z5 m7 h
This trick is very efficient:4 \& U& { E, J4 G# l
by checking the Debug Registers, you can detect if SoftICE is loaded! [8 v# o3 ?+ b9 V+ S3 \. ~
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
( x9 k8 L; k" ^8 G: kthere are some memory breakpoints set (dr0 to dr3) simply by reading their
: p# O! s `' U2 d- h- B4 qvalue (in ring0 only). Values can be manipulated and or changed as well
- w! V& B/ A. N" T(clearing BPMs for instance)
1 _ x- }, x+ j/ C D- y, ]* \% U& ?) X+ S( X- X, n
__________________________________________________________________________7 O2 a% D: A$ F ^! L
- V0 F: b' \' {8 i% `" I, E2 m4 R6 dMethod 11
4 q" Y8 K" H! K=========1 i' Y6 \8 B. l
$ C" u) K4 q% W" h/ a5 ?& N
This method is most known as 'MeltICE' because it has been freely distributed" M) U* H/ p* e" T
via www.winfiles.com. However it was first used by NuMega people to allow
$ S4 V4 U9 e f4 P* wSymbol Loader to check if SoftICE was active or not (the code is located
! t7 u) f8 o2 Vinside nmtrans.dll).
# {4 S% Z8 S- [
' G$ F' X$ y, D" a: ?- t3 e* gThe way it works is very simple:
|0 \+ w. J8 ^0 v% G2 rIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for0 [/ s0 Z* M) d
WinNT) with the CreateFileA API.
* m2 G$ Y, o% [0 j- n% p( b
" e# \4 K6 {3 Y( {0 S, `, e0 BHere is a sample (checking for 'SICE'):: C9 y, k: v& Z$ r( J
4 b, n# Y9 h' w4 P$ O% p
BOOL IsSoftIce95Loaded()
o6 \4 L# T' e8 Z{9 |" x- }) \# \) X$ F8 x
HANDLE hFile; : i. }% ?) l. T8 d* O
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
# f: z! A' e0 T# \ Y, d FILE_SHARE_READ | FILE_SHARE_WRITE,% w: j4 ~8 M9 e; f8 i n
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);% R! [! D( J% ?/ m. w7 Z; X: \5 e: p! z
if( hFile != INVALID_HANDLE_VALUE )
m9 |: J, t' W( ]- K. h" N {8 E, s+ s9 o) G
CloseHandle(hFile);8 x( f% J5 Q# n
return TRUE;
+ g- S9 i3 M0 i8 h }! \- c, h0 i# x' L o# _: g
return FALSE;
0 u# j3 j6 S( p" Y}
- ]7 t6 ~: T7 g" t- y1 i
4 X% R9 W+ w' m2 a4 nAlthough this trick calls the CreateFileA function, don't even expect to be
8 K* T0 b& G2 N0 J8 w/ }# lable to intercept it by installing a IFS hook: it will not work, no way!5 Z1 S5 |" B/ l9 d; H( s. ^
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
3 ^6 g* a" }6 a Gservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
( L: c# x9 J. u" G# y: @9 q& Nand then browse the DDB list until it find the VxD and its DDB_Control_Proc6 p; y7 B* w |/ o/ S! }: q# N" L
field.
k5 B6 F0 i: B: w; PIn fact, its purpose is not to load/unload VxDs but only to send a 8 l! {" }3 c2 l; {+ a& I
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
5 J5 g C7 L) r' [to the VxD Control_Dispatch proc (how the hell a shareware soft could try
* Y7 D* u- e* [9 w7 I: Sto load/unload a non-dynamically loadable driver such as SoftICE ;-).1 W) M/ G8 a$ j/ O/ q2 _4 v- u$ t
If the VxD is loaded, it will always clear eax and the Carry flag to allow
- e: I# O) R7 ]its handle to be opened and then, will be detected.& B! f- [* k6 g! p6 q% B2 l
You can check that simply by hooking Winice.exe control proc entry point0 x8 T" [! y; ^
while running MeltICE.0 h9 U3 ]. F* F# v
/ P+ }' X; u6 D3 i; Y; }
7 t/ Q4 I' I: C ~$ a( i* x 00401067: push 00402025 ; \\.\SICE
; o2 T* L6 T/ V) \ 0040106C: call CreateFileA3 U3 O% Z3 s) m
00401071: cmp eax,-001# C/ c6 C r% w8 Y& Z$ k
00401074: je 00401091
% [) @6 E1 n! d+ I" i; b4 g" X+ ^
- H& \! {/ I3 A, Y% b" \2 o+ _; q4 j# N* L
There could be hundreds of BPX you could use to detect this trick.
& g! V3 j- D5 i) I-The most classical one is:% P1 _* k7 u% r% `" k, W4 D9 w( ]
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||4 m) _) T. N5 G& a
*(esp->4+4)=='NTIC'
" e+ t! M ^% f# m6 |9 C \1 B) N% \3 m) F4 m' n, E
-The most exotic ones (could be very slooooow :-(
' M" f" ^' ^; F0 C BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') . d0 g$ B9 u( @3 f( h
;will break 3 times :-(" S- b0 r6 c0 J$ {- t
3 w. c: U' z2 C" H7 r
-or (a bit) faster:
- }2 ]+ f; X% |5 O8 q BPINT 30 if (*edi=='SICE' || *edi=='SIWV')# K. _) w W4 X0 l3 }" @6 D
$ ^3 c& T: W% T
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 5 a. _) [" S& k! F. G0 g3 U8 a
;will break 3 times :-(% U/ ?' P1 l5 X h7 w& ^) y/ N" H9 G
0 T; r6 M5 F1 [ g5 I-Much faster:
7 Z+ w) w6 E9 f6 q* z5 H0 ] BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'/ \! Z4 D' E1 D. w1 n0 U* S
% L' X6 u0 m9 CNote also that some programs (like AZPR3.00) use de old 16-bit _lopen/ s; a. d7 y; a' B3 @
function to do the same job:3 l+ Z9 i# x0 I, ^0 C! q" n, ~
2 n3 s' i. ~$ N3 s9 Z push 00 ; OF_READ
# L7 t: F) k$ u2 `& I' a% g; ` mov eax,[00656634] ; '\\.\SICE',06 L u7 @: ^+ N$ |/ y
push eax# D) U, R7 E" X( l; {0 p
call KERNEL32!_lopen
$ e! O; N/ [* J/ b; s inc eax# P& f/ v" Z9 A0 n8 \) ?
jnz 00650589 ; detected
) ^/ V* G- t" n1 G# M push 00 ; OF_READ" e$ [, W1 o9 o
mov eax,[00656638] ; '\\.\SICE'' Z5 d3 |9 @6 Q# F7 k; {/ d
push eax& Q6 s+ ^- f# Y7 r# K {# V( J
call KERNEL32!_lopen
M- Q; V+ ]7 v3 t inc eax
4 `7 i6 j+ Q. k/ v( Q jz 006505ae ; not detected
! M# B o0 w* y/ I3 O* }& Q' c& a3 J7 l C, O6 F- s" `
6 p/ Q& t3 j0 @' L# m8 n3 u1 t" D__________________________________________________________________________/ W- z1 U% T/ C5 Y$ l% A; x8 q6 `
: h. |) O' {7 P9 G+ |7 l/ n6 L/ J
Method 12
5 N4 b3 a9 p. J=========
5 p5 A8 ]7 X9 Y6 G" G* z8 A* N
* Y& Q) u) H( TThis trick is similar to int41h/4fh Debugger installation check (code 05
3 E! H; w0 i% t& f. K2 R& 06) but very limited because it's only available for Win95/98 (not NT)
, m) c3 n7 Y8 {( y$ N, L3 ^3 vas it uses the VxDCall backdoor. This detection was found in Bleem Demo.& k: _. k; m1 \
) p, }, f& L' B4 b+ U push 0000004fh ; function 4fh
1 @+ a7 J, z5 P! W( z* ]. m push 002a002ah ; high word specifies which VxD (VWIN32)
# h5 T" L1 S9 H3 n ; low word specifies which service3 q) t) V; P( x% a2 f1 n8 Y
(VWIN32_Int41Dispatch); h4 H4 H2 r9 d: u- D% E7 c! @, a
call Kernel32!ORD_001 ; VxdCall1 Z [! p# y) w% ]4 M/ @: D/ X
cmp ax, 0f386h ; magic number returned by system debuggers* f* K+ R$ G% ?3 o. ]
jz SoftICE_detected
( O- V& N3 o' {+ \: D( v* E" P: F/ o4 B+ \( q x. c$ \* L
Here again, several ways to detect it:
1 B- ]' z; k$ A: s/ I5 L; V9 {+ i* c: `4 B6 v8 {1 \6 n
BPINT 41 if ax==4f
) a/ K5 }* f z% i }' p# S
9 p& {& o& ~. T BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
* _- E( d; c6 s' k/ }
I' j% { L: U( Z8 `' V( ^0 R4 z/ J BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
1 m2 l' B: }- F3 ~; A# j4 g+ i3 H% d! r# F: ?# J3 y1 F. R
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!3 i! M- ~! Y6 s2 {* q( x+ `
2 ?; j M4 i9 }8 |
__________________________________________________________________________
, n6 C4 P5 X. G: S
' I4 a; k% p# [6 ^3 BMethod 13
" w [! I) c; y) C=========
0 C6 z! R* V) B" C0 z5 C# o2 T2 Q4 h$ I* L% l( r1 P. l7 C; D, x
Not a real method of detection, but a good way to know if SoftICE is8 l3 U! c$ W( Y" J
installed on a computer and to locate its installation directory.
3 Z$ W5 f1 h& X+ I2 @# EIt is used by few softs which access the following registry keys (usually #2) :* ]' v4 e+ E- A/ V9 O- K
0 r' c( K7 \3 s3 ~( @
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion* Z! n# w5 E0 h& D6 B
\Uninstall\SoftICE
3 \! Y2 Y e' }2 x- k0 k-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
) ?8 b* {1 s1 H-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion8 e' L' W: N7 _4 P Y" }2 w
\App Paths\Loader32.Exe
/ \4 m( K2 m% X. _. _* i& y1 q; [/ ^+ o$ N
% p8 B {) \8 u7 V
Note that some nasty apps could then erase all files from SoftICE directory
5 ? I$ J: }8 N+ Z$ S/ r0 p(I faced that once :-() H% U) ]5 l. s4 l" P- b* }3 F# M2 b
% d- l+ f- w- |9 i+ b* nUseful breakpoint to detect it:. x; Y* k8 z9 ~2 J* t" l
; H5 P, i. G% n; c BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'- [- R. K- I. _6 {" D8 D/ T6 G
. M0 j# V" u( @, G__________________________________________________________________________
$ b7 k7 A X, _% i( a
4 N9 E5 q" I" h$ K2 _6 d) q1 E! T" ?2 P: O$ ~5 \2 U
Method 14 ; Y1 Q1 s/ I, W! S1 R" q
=========
* [9 r! M& K1 a' G0 A" O, A; h7 c( N; Q( F; Q$ ~- ~ a% {+ i
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose' m! a: E3 z* b
is to determines whether a debugger is running on your system (ring0 only).( E, [ k- t" x3 w2 z; Y& H( z/ D
; i- u' B( A' x8 h* v& {0 x. Z VMMCall Test_Debug_Installed
3 v1 n: A' Q# x4 ?7 G" \$ t je not_installed8 p$ E4 B. \7 f T) c( S
8 U. N* k) [; ` E( }$ `( K4 V* o8 M7 d
This service just checks a flag." o2 {, _* L+ ?+ T1 ^. ^1 z
</PRE></TD></TR></TBODY></TABLE> |