<TABLE width=500>
; C* C# F0 F) i+ K$ D<TBODY>9 |& P7 N0 N1 v8 ?% x: ]7 \4 u0 q
<TR>
+ G& u6 S3 p2 }9 [, }+ I<TD><PRE>Method 01 5 F( T# u6 x3 _ S2 ^0 P
=========3 e g! O. S3 ?0 J n- v
& u) V) s8 f: \/ lThis method of detection of SoftICE (as well as the following one) is
- j% T9 T0 X8 Z! iused by the majority of packers/encryptors found on Internet.
: j' K/ N6 }& @It seeks the signature of BoundsChecker in SoftICE# ~/ h1 `( j' L# \8 d
0 U0 T: i. r/ r6 K mov ebp, 04243484Bh ; 'BCHK'# w% b3 e& w& D$ e
mov ax, 04h
$ ~" H. W8 d0 R( p ` int 3 / q* E- C, D6 T" B8 ?1 w9 Q6 c8 s! s
cmp al,4+ }$ x& B: C) x# [9 E
jnz SoftICE_Detected
6 m* u1 W* Q. \* v" \( T2 u0 P4 T5 o
___________________________________________________________________________
) W, R, V1 N/ @( ~7 D8 m" O5 n1 c0 `, t( ?& U$ k, ?1 A6 k0 O
Method 02
5 H8 Q+ U8 p& |7 |" ~=========+ Q* F L Y% w/ u2 i
6 X# c; l& _" g' I" g4 Q; \- `
Still a method very much used (perhaps the most frequent one). It is used
# p1 o! _, d' |+ n$ nto get SoftICE 'Back Door commands' which gives infos on Breakpoints,0 F% I0 i/ D9 ]2 @4 K% y4 X
or execute SoftICE commands...
, h" E! U- d! W& G) ^- k5 g2 ]It is also used to crash SoftICE and to force it to execute any commands
. w% W* J! z7 \7 g(HBOOT...) :-((
) C5 ~7 P4 m; z {, e J" y8 a3 k* s3 G7 ~3 w+ O& A
Here is a quick description:! ]9 T- h0 N5 D7 T3 F2 B" [
-AX = 0910h (Display string in SIce windows); I' ~, u& S+ Z, I% R0 p7 h
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)+ X" g' O' I$ W1 u
-AX = 0912h (Get breakpoint infos)
6 Q l1 i$ G2 ?- w-AX = 0913h (Set Sice breakpoints)
( D j. g, L6 g. E-AX = 0914h (Remove SIce breakoints). x* y4 a4 w4 }3 u3 \9 @8 |/ W; ~
* K5 o Z6 k. xEach time you'll meet this trick, you'll see:
6 X" U2 g J% ]8 Q- m0 v- z-SI = 4647h/ A: b5 J' v: W) U/ @8 \
-DI = 4A4Dh% F) C4 D0 I1 B% A& j% c w# J- h4 r
Which are the 'magic values' used by SoftIce.
' S( E6 J3 B# @2 QFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
# B! u5 Q1 D+ I5 s4 G
5 f" |/ o! M' I% `8 y# ?1 BHere is one example from the file "Haspinst.exe" which is the dongle HASP) C0 e# m& y- P
Envelope utility use to protect DOS applications:
5 `& A" ^7 k6 o! h: P. j# r* m( y& u3 M. b3 q
+ X, q& z: I( n: x
4C19:0095 MOV AX,0911 ; execute command.
- \, U c, b$ Q' y; m5 L1 G. ?4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).* I; X% i' X8 t- p% e
4C19:009A MOV SI,4647 ; 1st magic value.
& n! I5 ^1 S* J! N0 K( V8 m4C19:009D MOV DI,4A4D ; 2nd magic value.
! K9 p. t2 n, w+ ]) f; H4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)' m1 m0 G$ a6 B' U7 Y
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute5 i* A& |/ a9 n
4C19:00A4 INC CX2 v) g3 t, }+ T# |- ~
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute# m) {6 m/ c0 p H
4C19:00A8 JB 0095 ; 6 different commands.! ?/ {1 w4 {+ a$ d# J, r: q
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
+ |5 |8 h) m/ d Y$ Q( v0 K4C19:00AD MOV BX,SP ; Good_Guy go ahead :)9 @# {; d, e$ l( [
2 ]" J; o) S& f# bThe program will execute 6 different SIce commands located at ds:dx, which
; V) \: M2 i, ~6 F! M2 c- |8 ~7 e! W% Gare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
0 s k2 x7 C, S0 ~7 `" V& a: W# O1 Q, T- B3 `
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.; u }3 P! b" c; d# C o
___________________________________________________________________________
, K" |2 U+ T, n( E' {5 U3 n3 h4 o2 ^
; y* G! [2 T/ k& [' D0 D
Method 03, b. n9 B* n+ s c. a! }
=========3 [& r, \' @3 i' x# N( I n0 ^
3 t; u) Z9 I$ rLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h) q4 R$ \! g/ a& A* `6 j5 w& y
(API Get entry point)+ z( m* X2 I$ R3 Y0 m
! _& k- q2 N6 x6 R# ?* r
7 s9 J: [3 Y6 J% ?0 ~& | xor di,di9 `+ d$ g l) ], s4 h( p+ B
mov es,di
- E6 N# q6 S# W mov ax, 1684h
2 B9 m! x E2 |/ p mov bx, 0202h ; VxD ID of winice& e8 g$ F, s7 n. q' J
int 2Fh% d% X. M# {7 F% J
mov ax, es ; ES:DI -> VxD API entry point
9 M: D, M% ~! S ~& y add ax, di: ?: g% A' Y" x- P. U
test ax,ax
+ u! W. U( ?( A3 `: _ jnz SoftICE_Detected% h, V2 ?! Y! A" s0 c" E
; x1 x: K( S& Q0 K8 P, ?___________________________________________________________________________
4 \- }+ I3 [- ?# K. n9 }: d# s
2 j3 \0 K, t& K( t: ]: sMethod 04* E7 M4 Q% \# p) u9 u
=========
) N# m% b6 E: s6 U8 j9 c9 c) F! v2 T
8 L' l* \7 U' q& TMethod identical to the preceding one except that it seeks the ID of SoftICE2 q' P. B# [6 X6 C$ A
GFX VxD.
. p" l! f" X" } V8 E* Y: F: t" _! }" p6 c( O4 u
xor di,di
. k' ?! `. n4 }# B% ` mov es,di- ~7 V/ p% l5 u& ^
mov ax, 1684h # s6 W$ s0 n0 Q- l& w# Q7 X
mov bx, 7a5Fh ; VxD ID of SIWVID
- L# w7 g0 `! _% n int 2fh
: k4 u+ m' n. e' c mov ax, es ; ES:DI -> VxD API entry point2 J5 r! U1 d, f6 T; W0 _* b
add ax, di; }4 h0 k2 x8 I' U
test ax,ax
6 V2 H5 a% e, C5 F jnz SoftICE_Detected
' s" b& B7 Y6 ^( X3 U, _# C6 ?" R- ?1 k0 \/ @! D2 l
__________________________________________________________________________, F! V( h# d' h: G: O
% G) u6 s9 C4 `% y, A# Y U
% |% m5 w0 U2 P% iMethod 057 o, g2 O% S- G) R: p" Z
=========
! _) F' Y1 Z2 p6 ?" R, |, c- w5 z* x, a: F6 k
Method seeking the 'magic number' 0F386h returned (in ax) by all system
7 O2 t7 [; K1 [/ ^5 Edebugger. It calls the int 41h, function 4Fh.( ?/ s+ @1 J( J0 g4 J
There are several alternatives. 6 T z& h- u6 W! c$ e% _
6 B, W/ w6 E, |( y
The following one is the simplest:
k7 o I% T: c9 Z5 y+ Z6 P4 T- u% r+ E; G9 Y7 s
mov ax,4fh& @5 V3 l" t$ Y4 Q. Z
int 41h/ d6 j9 b) H3 D% j6 N7 Y& g
cmp ax, 0F386
9 c U' P! o9 r+ q& {. S+ I5 x3 v4 d jz SoftICE_detected ]1 ]4 B) Z+ F
/ l, H3 o# h, a7 e( C8 m. ^, s. B( k" @0 q
Next method as well as the following one are 2 examples from Stone's * f" c6 g+ P& I2 Z1 B
"stn-wid.zip" (www.cracking.net):7 Q- i, [7 \1 B- {+ e& m' F
, A% Q4 f& [' d( \
mov bx, cs2 b* v/ x- t$ G0 Q) \/ X' C
lea dx, int41handler2
* B! X$ T' Y5 K+ q+ S2 i& @ xchg dx, es:[41h*4]
! B1 d1 o; y, h0 f xchg bx, es:[41h*4+2]& f7 k+ Q+ J$ _
mov ax,4fh
/ o6 O& h1 o: L6 C+ E4 s8 y7 f int 41h
9 }* m" M! N8 M" p xchg dx, es:[41h*4]
4 W G) l* Y, m1 p4 [ xchg bx, es:[41h*4+2]/ X- I1 h% }- D9 d, r6 b
cmp ax, 0f386h+ p- N; a, v8 C4 ]! `5 T
jz SoftICE_detected
J" t# p8 V4 x5 F% S7 C- H* n7 W% e4 u+ a/ D0 d) y- [
int41handler2 PROC/ g. E' c0 G4 a4 |" ~2 S5 x4 b
iret
- W7 {4 W. K8 G2 L* s2 S/ Z. \int41handler2 ENDP
% K' r6 B: b$ j9 n
. L/ C! a" j7 l: S) W/ ]$ |+ X5 n! [% i
_________________________________________________________________________
7 [; o% N& }9 ]
8 {2 b5 [- g6 E- g( X2 Y# f5 B8 p, C" b) ?
Method 06
6 [, I* R( T' {$ T+ \# C=========
% ~# B+ I W7 [) q: u
) y4 F) s5 c1 Q* y, q% b1 s: ?$ ^$ N
! J6 k6 L6 B7 t; X" u, J2nd method similar to the preceding one but more difficult to detect:# e( T6 g. |; r5 x; `
% w, ^4 w! d/ L4 h+ C4 x
2 Z- i" e# @: ~/ F) c- V _
int41handler PROC5 m* @2 ^2 B! ~! d/ c& X
mov cl,al l' o A$ b x7 g5 _* G
iret
1 e1 E) V' v& z% k5 Sint41handler ENDP
% @$ L" I4 N/ V
) Q2 s! _( ?) L' d4 I) x" {. h# [
' t# {5 N& Q8 i7 M9 M xor ax,ax$ N4 Z, {0 Y3 d4 u# Q8 Y
mov es,ax
. k) k" }6 b( F5 v9 A mov bx, cs
0 M3 ]! M1 k# @0 ~' n! ]0 ` lea dx, int41handler2 a% h$ J T, M( q5 X$ f
xchg dx, es:[41h*4]
6 s$ ~! d. O6 y2 {& e6 E xchg bx, es:[41h*4+2]( p. B3 w2 v; ?! ^
in al, 40h
- _3 h) L1 y( Q$ M U xor cx,cx& g8 v/ x7 E% K! m8 H+ |7 L' r7 ?
int 41h0 d% V) B+ m h) d
xchg dx, es:[41h*4]
& q# a M! L3 U1 V, |) E! J xchg bx, es:[41h*4+2]+ w0 n- t, Q+ M- M* c
cmp cl,al6 _) V7 \) r- s8 V# C
jnz SoftICE_detected
* }% [6 x+ q& S5 e$ v5 b+ _7 N' O3 F- d5 L
_________________________________________________________________________+ p( ]. ]; }1 p7 y5 X
% L+ T% [1 X& hMethod 07, v0 B6 d/ S9 m i l
========= q7 O! z2 F; t: u' K
: @% A4 }6 h6 e
Method of detection of the WinICE handler in the int68h (V86)
& d8 {3 K! g9 g g9 x
1 i' r* s. |3 Z& h1 U# e mov ah,43h0 \- Q! O0 D" ]8 w( ^1 R4 M
int 68h
* l+ { N7 ~- O5 D( @, Z. m cmp ax,0F386h( C" M# Q: L; P, ^
jz SoftICE_Detected
- F+ i3 m0 \( o% O& ]5 A% n1 i
# @4 T4 N( ]" S. \5 a! u' D" c- P. [* b5 w* c8 d: z
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit1 n E" [; w; o8 S; Y8 L
app like this:
& T6 Q# v- e @7 x2 A) X- M
2 D& e2 ]0 h% R$ |# r BPX exec_int if ax==688 T+ Z& Q* x3 [1 W+ D3 `
(function called is located at byte ptr [ebp+1Dh] and client eip is0 ]* Q4 r4 Y. z# F$ V! E( U
located at [ebp+48h] for 32Bit apps): b* F8 }$ f( k0 T
__________________________________________________________________________
0 ?# B7 S; c2 B+ {. l# O$ [5 d5 |. i
9 m& v2 g6 `1 _) F, k" f2 v
Method 08* A- h1 v5 c: H) I, s5 P/ W
=========
4 z' p7 i2 o$ n- N, u6 U `+ A3 e0 m8 @" J* S/ ~, ^
It is not a method of detection of SoftICE but a possibility to crash the, P2 P) p3 o2 t3 C
system by intercepting int 01h and int 03h and redirecting them to another# o9 K" A3 l: q/ z F0 `
routine.
! u2 f2 y% j5 L; aIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
0 k: B4 z" y# E' ^8 Gto the new routine to execute (hangs computer...)+ Z; r% ?/ i, Z. |* G8 Q
8 v' F% V, Y5 D+ s* N" ^' j7 d* h mov ah, 25h/ S! p6 x, k( o4 Z# d k& {% W
mov al, Int_Number (01h or 03h)% x3 N% W8 \# Y8 ^( x) o" T* h
mov dx, offset New_Int_Routine
- x3 [. I5 c/ P, I8 j. m4 a int 21h+ H# p4 c7 N- M
. y; N0 ]) Q- z+ M" u; J% u__________________________________________________________________________
9 q% g L: Y1 J% {0 k7 c# m$ d" D( q$ I
Method 09
2 E7 T/ \# n% I3 }2 c- d=========
3 Q/ x9 f3 R1 q+ G* w2 Z: ^% Y
% x/ z- t$ Q% f. g1 [This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
! w# l$ [/ ]4 [, Xperformed in ring0 (VxD or a ring3 app using the VxdCall).( r2 f1 o$ m5 S5 h. U
The Get_DDB service is used to determine whether or not a VxD is installed
$ w% F3 k0 o3 p( U- Lfor the specified device and returns a Device Description Block (in ecx) for: O+ |* ?2 S: v, y! Z
that device if it is installed.
5 T( a+ v% i* X2 n3 K
0 L- h2 V1 U3 u; w' M- | mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
3 A, i+ w! Y( \' ] J, `. C* i. F mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
+ R5 b! u: x1 s% o VMMCall Get_DDB- w7 i( J. k7 V
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
- K4 f; w. g& N6 O
& i' f$ n8 X% |, c9 ^# H# `8 xNote as well that you can easily detect this method with SoftICE:
2 f1 w0 j; p1 v8 C' m0 o bpx Get_DDB if ax==0202 || ax==7a5fh
$ I" P2 @3 w8 }% e
! n: T0 ?: ?( v. v* Q9 d/ l4 D; i* O__________________________________________________________________________: f1 H* q$ N. N8 `
* T' |$ z5 M3 S1 o# ?5 h) _Method 10
D; R& a" w6 U) K6 z=========
8 U' y. G; A6 j" ~! m
" j% [ {7 Q: T+ K=>Disable or clear breakpoints before using this feature. DO NOT trace with
. t2 s2 ?6 b+ R SoftICE while the option is enable!!* t' ]5 M: g- p
5 ^) T! Q( K5 H7 t
This trick is very efficient:/ S3 b; U7 R. s' ?5 Z. s/ w9 y2 Y: g
by checking the Debug Registers, you can detect if SoftICE is loaded- u3 H/ j% N" M+ C7 X5 j' I
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if% K E. E5 `3 }
there are some memory breakpoints set (dr0 to dr3) simply by reading their
4 B. P3 W# \% k5 ]* xvalue (in ring0 only). Values can be manipulated and or changed as well' S) y0 l! T% k
(clearing BPMs for instance). A. K: o( Z5 i* Q7 a
. c$ }# a& u4 F( h+ O
__________________________________________________________________________8 v9 I! P. l+ U& @. X5 Z- x) n3 f/ o
8 O- d! ~2 I0 Q9 D7 f
Method 112 w4 O9 |, X8 _4 [( ]% H
=========, R- R6 p$ N1 q- p9 D u
5 H# D. G) M7 I2 t6 T* \3 Q6 E: J8 g, TThis method is most known as 'MeltICE' because it has been freely distributed& T+ a- G# V9 E! G: }9 H' ~
via www.winfiles.com. However it was first used by NuMega people to allow! f7 N" l# n2 @
Symbol Loader to check if SoftICE was active or not (the code is located
1 T i+ D) @( @3 {inside nmtrans.dll).
) u6 i6 E* ~6 Z2 [4 W' {( S- U" T8 }; o8 g
The way it works is very simple: |2 \* t4 G' t8 n' j
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for- @6 E' B4 F, }4 ~; t
WinNT) with the CreateFileA API.
' e: |: S9 w- s+ D+ o" v
+ ?% | ~+ b0 P) f9 _6 {; HHere is a sample (checking for 'SICE'):
, X9 y& q. X! S( c; Y+ i' Y2 e2 M, ^6 E7 ^3 J' |9 Y3 E
BOOL IsSoftIce95Loaded()
; X- { q1 F! p, E{
5 w& F# E4 c- @* q! z! s HANDLE hFile;
% _( \: B( ~! X# G z4 }. T hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,& E9 C2 l8 z8 }5 x
FILE_SHARE_READ | FILE_SHARE_WRITE,
/ j) B/ u; ]$ g% r6 c9 Y NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
! w1 c5 C* W: E/ i) U; |3 W& @ if( hFile != INVALID_HANDLE_VALUE )
5 `& F: T& r0 ^# Q& H- f( C: M) c* l {
5 ^3 Q+ \4 Z" S! _ CloseHandle(hFile);6 r2 I3 ]) J. v6 T# |
return TRUE;4 `" _+ t' f: p2 n; P0 Y
}( g- y6 n( Y9 N$ R+ ^; k+ Y, t
return FALSE;
6 r$ y: z5 b6 X9 L}1 S4 k7 C$ Z, n' U" @6 z
4 x, z/ @ y' X& u5 t9 cAlthough this trick calls the CreateFileA function, don't even expect to be5 r6 ~0 [, G. B# \9 D
able to intercept it by installing a IFS hook: it will not work, no way!6 C; S. C+ d8 n* E u
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
, |$ e/ m0 m& |' vservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
6 @) o3 ^# Z' K+ y. mand then browse the DDB list until it find the VxD and its DDB_Control_Proc/ K, B7 E' C0 J
field.
: A& Q. ^5 _8 T* l1 B+ mIn fact, its purpose is not to load/unload VxDs but only to send a
* w! Y2 c) N9 Z+ D2 V v, kW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
% y# P; C1 _. m- }; C ~# Oto the VxD Control_Dispatch proc (how the hell a shareware soft could try
& q6 `7 l" R# w( dto load/unload a non-dynamically loadable driver such as SoftICE ;-).
. Y* Y8 B( Q. ?4 I9 y; lIf the VxD is loaded, it will always clear eax and the Carry flag to allow
3 l; A/ R0 A. h7 Q+ v, W$ nits handle to be opened and then, will be detected.
/ c8 A- S& _- i" j( iYou can check that simply by hooking Winice.exe control proc entry point
; s/ x4 V8 P+ a3 z$ z- p/ r1 Kwhile running MeltICE.9 u5 ^6 ~9 g; {
4 }( u0 \- @( T
. @5 n3 |9 G) T# J 00401067: push 00402025 ; \\.\SICE+ [: b! o. l5 f% O4 s) T
0040106C: call CreateFileA" V$ }$ _9 U% g: d4 v3 T8 j
00401071: cmp eax,-001. C' L. b& a; w+ h7 |+ s$ n5 i3 |
00401074: je 004010911 \3 b, @2 F' o) R% E) a- K
# ~. d( Y& w7 C( |0 P) |0 D- C
3 i' G! J/ b o9 n: ^+ cThere could be hundreds of BPX you could use to detect this trick.
) r. T8 Y9 o6 \) `; @+ g9 w" `& d-The most classical one is:6 H& H% C3 i4 x0 _5 H
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||, i3 L" \; ]# z: Y( g
*(esp->4+4)=='NTIC'5 x' U6 M9 \$ t1 y0 I9 \
% a/ o1 w, g/ J& l5 p$ S
-The most exotic ones (could be very slooooow :-(
1 H0 X3 s* x2 e& @- c BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
# I; J5 d& J! L8 ?& x# b ;will break 3 times :-( K* N( V5 Y# ?" _
! \; l* z9 e2 A8 K' j7 v-or (a bit) faster: # o$ u, P: B, \& a, i0 @
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
- D4 p/ R) g* U5 `9 c$ Q" {9 d Z4 o3 G6 U. L e3 ^% A) ]) u
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 8 w$ ^/ h( l3 {, H% K6 w9 K1 v+ c G
;will break 3 times :-(6 ^; ~% F. ~/ Z2 q8 Q! e
8 w" A, P+ c& t: M* `-Much faster:
2 L7 Y$ }6 ?: }- d5 o BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'" B6 r0 q4 @" z& J2 l+ y
4 V N! S& i( u2 G- n3 k
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
# X% }0 P7 v0 efunction to do the same job:* s( r* }* Y9 j2 h% C- R5 y+ K
- C1 T9 ~3 C) ]: K
push 00 ; OF_READ
; j# f7 A) {7 Y3 W mov eax,[00656634] ; '\\.\SICE',06 D; y" m5 L) O! m
push eax
T" L7 g/ G2 D) C call KERNEL32!_lopen& H5 a t! r$ U$ u; S
inc eax: M5 c9 T( |6 W' H4 C: \
jnz 00650589 ; detected- V: p; v% O: L* A
push 00 ; OF_READ
) A7 R9 ?* C3 T! ?0 q mov eax,[00656638] ; '\\.\SICE'
" D1 A! R/ `+ C push eax
/ E+ m, p! Y2 I, x0 S call KERNEL32!_lopen, h+ y8 S3 U& I$ @" W8 D& h, Z L
inc eax
8 |* D1 C+ t: A$ K' V7 `$ d. l" p! s jz 006505ae ; not detected9 \5 \) @0 l5 c/ t
; J$ u0 `+ x9 n9 K
. i9 c- G5 m6 v6 |7 Q__________________________________________________________________________
# t2 q) ^; X `) t3 V, F, q9 F! w# q |9 R) i
Method 12
( @# v: y( O0 ^6 N9 y' A=========/ h$ x4 n9 Z) C" [8 D5 N$ w
{6 E/ C4 e& l8 P, }) I
This trick is similar to int41h/4fh Debugger installation check (code 053 e8 H3 J7 F7 n3 g0 e* U
& 06) but very limited because it's only available for Win95/98 (not NT)
5 r$ @- |' N: v3 H% w Kas it uses the VxDCall backdoor. This detection was found in Bleem Demo.9 d5 J/ ?% P2 n
" X1 ?$ s: |; |; k( B& A. P
push 0000004fh ; function 4fh' A6 ^& R9 Z6 S
push 002a002ah ; high word specifies which VxD (VWIN32)* ]" V2 K' ~# G. B
; low word specifies which service% [/ @% f: T G( A6 d
(VWIN32_Int41Dispatch)( B( O' y6 G2 ]! m0 g& Z* ]( j; p
call Kernel32!ORD_001 ; VxdCall
6 e4 }, \1 \, l9 X( q ~ X5 t7 D cmp ax, 0f386h ; magic number returned by system debuggers) ^( X3 g& z0 B) n% V) k% H; f4 F B
jz SoftICE_detected, g1 T0 ^% Z/ H6 ^/ o" B
, Z! V' P/ i# G$ y; x- tHere again, several ways to detect it:
7 p7 l; p( R; g4 {0 a( G' h: ~9 w! x' x5 ^ o
BPINT 41 if ax==4f
$ R. Y3 M0 d- c9 S6 b8 z$ o; J, H4 T. _$ Q+ |' s i0 r1 J
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
; M/ k% E5 a( z) v! U' E5 J& W" Q
+ e' C0 R& T1 \% n4 a BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
. }9 y& J$ e+ [2 [5 ?' N ~1 x" z3 w. J/ Q. E* t L* Y3 v
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!) c4 B" J$ o! K6 W
* O, D2 p! L3 O8 J__________________________________________________________________________9 g: X4 w# k6 P* T% p
& v9 S5 i2 W3 s3 g; R# p5 x# J8 m
Method 13 `0 S7 @& r" b( _# d( E5 i
=========
3 E9 W: G P; ]5 R/ j, J! U8 \8 A# v3 n$ h' j* a
Not a real method of detection, but a good way to know if SoftICE is2 q) @- ^7 |# f/ D( u1 ?
installed on a computer and to locate its installation directory.
* `* X! r7 F2 N' z2 DIt is used by few softs which access the following registry keys (usually #2) :
3 H" t& o# K# Z7 K* G& [2 C% R) I$ k& f! O" ^: P; a
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion5 r4 u. R# V' R. Y5 m) Z1 G
\Uninstall\SoftICE
: U/ c" `3 t4 h: N' t4 Q-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
( N8 R. {/ w( m5 O3 f0 W4 K. g( P-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion4 o$ j7 J. n$ D, V* k( t/ V- ~
\App Paths\Loader32.Exe9 M0 U2 I* V3 u0 t( h% i7 f
4 i2 D1 E3 i' e+ I
5 L2 X! o0 j( S4 ?8 L- d
Note that some nasty apps could then erase all files from SoftICE directory# W. u* {) x- N1 x' v2 [# ]* y
(I faced that once :-(% W, ]4 U% V% D# Q
! \: r8 E% H, Y
Useful breakpoint to detect it:* @+ Y! H2 H- D/ E( S
# Z1 N1 w% p+ B; e8 Q) _ BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'2 T7 `; o+ K/ ?
* s5 [# V) K# s8 V& D& X# k4 i }
__________________________________________________________________________ w g1 Y; M. D/ T1 o8 f! I
0 Z8 y7 e# N# n& v) U" ?& D# ?7 Y) F' B* W
Method 14 $ t+ j+ }; d5 Q1 E( v" _% F
=========
# |6 t* @; \( {. k" _- z. h2 I+ T; |2 X. h2 B$ U2 A4 T
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
2 B, e9 q2 ~- s: Y) \, fis to determines whether a debugger is running on your system (ring0 only).
" G2 f N& r: J0 I; r' P5 x; |, { x
VMMCall Test_Debug_Installed
! A* d3 W5 h! D je not_installed
! [, Q( l: X( k; f) A0 l
& m" R" b( t3 w; H* {1 W2 ^; FThis service just checks a flag.1 K& y# |: p! m( W* D) n
</PRE></TD></TR></TBODY></TABLE> |