<TABLE width=500>, }3 w' x U, g
<TBODY>& W+ {) ~: X [# B* e
<TR>2 n0 a! w9 [& a, H$ w6 g
<TD><PRE>Method 01
. X) G8 u( f% M! ^- l=========5 v0 P: [- L. X: _$ Y7 l
9 o$ v- B: \2 t8 n
This method of detection of SoftICE (as well as the following one) is
2 W4 f' ^5 X( l7 J6 g9 Zused by the majority of packers/encryptors found on Internet.7 g; K, P6 H P. _
It seeks the signature of BoundsChecker in SoftICE' | g( f# S+ [" k
4 ?6 c+ g0 S7 a! q" P! ~( x F
mov ebp, 04243484Bh ; 'BCHK'* Y6 G/ @3 q) m, d
mov ax, 04h
" i5 k# b( }6 |- v. | int 3 2 S3 `1 F! _4 M5 |) D, h6 Z! e
cmp al,4
$ H0 o. i- f2 ?5 I% L' s8 H! _ jnz SoftICE_Detected
- q4 H1 v2 _) q& [0 O
" T1 k1 J' P0 a# k$ N0 x___________________________________________________________________________& o7 A1 h) V* Q0 P& c
4 m9 V: d6 v; iMethod 027 I M/ u0 K2 B U' P% g
=========* R8 t K4 ^4 i i
: e7 q8 \. E7 O4 ^" ]* m( \
Still a method very much used (perhaps the most frequent one). It is used& @8 u2 Q4 l0 A4 s
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,$ d, c7 o w, m9 K4 S! E* Y* \
or execute SoftICE commands...$ c4 [; l8 m+ q. D; [. N$ Z* y
It is also used to crash SoftICE and to force it to execute any commands
- S' Q0 e3 ^ [* l- B2 {(HBOOT...) :-((
) Y- \/ N6 U% [9 ~ T
' D4 t% c! a8 ^0 }2 f7 m" oHere is a quick description:& O8 l: ^& \* B# G g
-AX = 0910h (Display string in SIce windows)5 n* t/ }. c5 S
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)3 Z( F5 {* }" J: l
-AX = 0912h (Get breakpoint infos)
! c) K2 Q5 b/ i) }7 G! w6 n" S-AX = 0913h (Set Sice breakpoints)
( h/ ^- y5 j* H& _6 i1 \. n-AX = 0914h (Remove SIce breakoints)
- Z" K' _3 Y6 q8 c. y0 l8 L9 Y" |; W6 e
Each time you'll meet this trick, you'll see:
) F5 g% o+ r# x: E-SI = 4647h
* O2 u9 `1 ~/ I0 o: Z-DI = 4A4Dh/ q q" I" ^0 W6 W% E
Which are the 'magic values' used by SoftIce./ I/ z F, J& _
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.: A3 q1 h3 u8 C7 c6 L7 B' o1 @: z
$ |) X; c8 d! c3 X5 _4 n
Here is one example from the file "Haspinst.exe" which is the dongle HASP/ P; U6 P N9 b5 s6 p# b& E
Envelope utility use to protect DOS applications:. N$ j& Q( p7 R2 b- g, W: n
Y: X8 e, h1 E1 a: X
% z4 _. Y7 d ~% x5 _) B2 e4C19:0095 MOV AX,0911 ; execute command.2 I/ r0 p$ _& d V+ b @6 q
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).# d+ }2 g7 b6 r
4C19:009A MOV SI,4647 ; 1st magic value.1 B/ o' H8 i+ z5 _
4C19:009D MOV DI,4A4D ; 2nd magic value., T8 h' q' X+ S: s8 F7 o* j
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
4 f. M' \: `- w' p% u4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
1 e2 T- Q( [' G3 Y/ V4C19:00A4 INC CX1 P$ @: h& B: y5 ?
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
, R$ g1 t* U2 V+ x" Z4C19:00A8 JB 0095 ; 6 different commands.
' S7 a/ S& R# b7 W, R* F1 [4C19:00AA JMP 0002 ; Bad_Guy jmp back.
p6 S% t: ?' p% P. j$ e5 v+ {4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
5 P! D" o$ X, E+ L# e" G/ t$ @1 Z" U+ a4 z
The program will execute 6 different SIce commands located at ds:dx, which
; N( q2 U9 M# i( i. m3 @; L8 P' Rare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
) h4 T" T+ T# r) W0 _4 k- Z
! w( A" y- w! Y6 _* X3 @% y+ n1 c* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
/ }' w9 [/ ]- \5 V" w___________________________________________________________________________
+ [/ z$ t; u6 N: V
! ?$ I& Y" U: K7 C
5 ]+ `- C$ Z3 |! c* z* v$ e; MMethod 036 Q- Z* g u5 ~( A. t2 k Y
=========
& ~8 e/ v Z I) V3 |; c0 G' ^8 e- }' [) S6 D& w& L6 y- c. J
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h/ y4 q9 I6 _/ c* x O
(API Get entry point)* A+ l* b) u, m% I" K
" _) }! { V+ c/ Y- k8 [
3 S4 u, O' `. W0 `' W. k1 q$ l
xor di,di
- f0 b# b+ f7 R' g* o mov es,di
0 d& y+ b6 e& i% D mov ax, 1684h 4 u% M, P0 w& J3 t5 v3 _
mov bx, 0202h ; VxD ID of winice
: e+ }3 j1 R7 x int 2Fh
' Q8 k0 W; r& Q, r9 W8 L# k mov ax, es ; ES:DI -> VxD API entry point4 C* s+ _' B2 D2 S
add ax, di
4 l! ?; X6 [4 q1 @1 v test ax,ax
- v5 Y3 d2 I X3 A8 H- W jnz SoftICE_Detected- b" W: v6 v0 z6 R' C
8 D8 e, G6 d# {& h
___________________________________________________________________________" n4 l1 ? R, ^) s
2 c& ~, I4 P3 \+ u9 i8 O
Method 04
- z: u0 i: { d5 _( y( K=========" l# x. U% I2 B: G2 f6 n# |
& ]4 `* D& v! J
Method identical to the preceding one except that it seeks the ID of SoftICE
6 q( d! D* X3 L7 y ?; ]( b. KGFX VxD.
0 H" X: Y. g# j& ^9 h+ z
, S9 b% C8 c5 V+ ^. e2 `, q xor di,di, S8 q1 Z& K E9 a
mov es,di0 M3 L, _7 d+ V5 H# x* t! g4 }
mov ax, 1684h 0 X9 A0 `' I; ]
mov bx, 7a5Fh ; VxD ID of SIWVID
4 `% X6 F- d2 J; ~( R3 ~4 `5 B int 2fh) A; s' ?1 x! S/ |
mov ax, es ; ES:DI -> VxD API entry point0 ?' z8 n6 t" h5 S
add ax, di
" I3 ~9 {# B5 \( l1 K- M' @6 ] test ax,ax
4 @! l5 J0 c5 s# l1 o c1 f0 m jnz SoftICE_Detected$ U8 \0 ?/ U$ T! p9 U+ g0 @2 z0 l
% Q, r1 n% w, p6 b__________________________________________________________________________
3 S9 f1 C& V- N) d3 Z3 m2 k
7 c8 a3 I" L m1 W. G" X% n4 ?1 E' X
Method 05
& w I# T% b- Z=========
* h4 W% s4 ]8 M# `: }( R% E
( E7 P+ h4 s4 V! wMethod seeking the 'magic number' 0F386h returned (in ax) by all system
1 ^* l8 r3 L/ O; `debugger. It calls the int 41h, function 4Fh.
/ B0 z& v- s- Z( tThere are several alternatives. 8 g3 w3 d( B9 R: h B
0 J8 ~4 Z; Y; C) }+ F
The following one is the simplest:
! c3 Y2 I; ^2 U. I s D, b6 Y2 h$ W: D
mov ax,4fh
) y# ^& u& b# E) r" V$ P( H7 ~9 x# F int 41h
5 |& u9 A9 P6 |; R cmp ax, 0F386$ x, V- P" f- c( x9 \9 h
jz SoftICE_detected) Z8 V$ e; `3 g5 Q4 a9 R& t
9 L2 m9 u' L) _9 ?, s! S
8 h/ S% B/ C/ F7 F- oNext method as well as the following one are 2 examples from Stone's 1 ~+ W) s' C) v" h% T: m
"stn-wid.zip" (www.cracking.net):
- x; {- S+ G3 r$ ^2 \, @
8 m6 ^$ G0 O; l5 ^; R& t6 t mov bx, cs1 H0 M* O" l% b
lea dx, int41handler22 V/ G, M0 }4 ~2 E8 @$ L
xchg dx, es:[41h*4]
4 A0 Z& M h5 e) V xchg bx, es:[41h*4+2]2 J* \8 E5 P2 c6 j7 s
mov ax,4fh. i5 d t0 B2 w# e) A1 s
int 41h0 P o9 w; X* y: f6 V. W+ t
xchg dx, es:[41h*4]
2 j2 L0 s! t; Y ` xchg bx, es:[41h*4+2]& _3 N* J2 B/ H3 J4 M7 N: ^ q. a
cmp ax, 0f386h
5 q9 U# X! w3 g' o- C7 O jz SoftICE_detected& [2 Y4 F2 o/ H! e0 l* W9 @
, A* _7 F5 w3 V( p# I- N! v' ~' v
int41handler2 PROC
5 v( P+ |6 b+ s) b; S iret
0 l- d1 Q6 S* s) E' K/ uint41handler2 ENDP5 K5 P- D' c" U ^
" t9 s* z/ w0 C0 H5 i
& H' r z8 t. d2 N4 q_________________________________________________________________________4 y. \& J x0 Z1 ^. \& ] o. X+ J
9 e! ^" O5 Q; h( L* [
$ s& G) h |! c3 UMethod 06) G! R) y) a2 Q* [2 j7 E
=========
' Q; p4 U- w0 d9 e, i' [
& J4 `/ z& O, t0 n0 J% j+ N: P% W( {) k ]- g
2nd method similar to the preceding one but more difficult to detect:
/ m; Y! q9 \5 v) I; I5 S1 d F
% U3 [ U6 |4 k2 j; L# m" J+ H* L
. e' p, ~) S) _( f7 A# k( o4 G+ lint41handler PROC1 t! h8 A* |+ T3 {
mov cl,al$ i1 D4 q# L6 d) s( D
iret4 X& S$ i$ F$ @' t, {. L
int41handler ENDP
0 ~; r# I) l5 d1 h
- k+ X$ Q- T5 Y
9 c3 f" O; N# c xor ax,ax+ }" q/ }2 n( ]: }. B4 Y( n x% q/ g
mov es,ax& o0 d% U, A9 C- z$ K; D+ w; s) C
mov bx, cs
0 Q0 A( z0 e- o, I; {; U1 L& _ lea dx, int41handler1 X, F+ A1 C5 P- ~2 f) |# X3 O
xchg dx, es:[41h*4]
6 F) g f# ]5 W0 a0 R xchg bx, es:[41h*4+2]% G( x2 n2 u- y d' r- Y# v; [
in al, 40h2 `: F' a0 v" M. [4 b6 w; T
xor cx,cx+ M: u. Z9 y* w. ?: x
int 41h6 m: q' h1 {/ p& `5 h! e
xchg dx, es:[41h*4]
8 c" d, O3 \( a1 ]3 o4 j, ]9 G xchg bx, es:[41h*4+2]
2 N9 f6 [ b. g$ o cmp cl,al
3 u( Z* {6 v# E, R5 z, s jnz SoftICE_detected$ K' R( c. r% p
0 I2 }' X$ Z0 E) Y# ^; Z_________________________________________________________________________3 ~, v0 o! [: ~4 e8 R
6 y. D+ z& m2 i- S6 K, i& MMethod 075 D' k+ p( u5 c' |8 i$ f
=========
. G- {' [; P ~1 E: m, {/ _' f) e7 [9 w: B+ Q0 Z6 I$ ]# ^2 |
Method of detection of the WinICE handler in the int68h (V86)! e" C n* Z1 t7 r4 K) J+ ]7 K* l
3 n \* h) Y; U' k- { mov ah,43h" h, v8 Q( ?9 a" l, O* H7 z
int 68h
2 q O0 K8 \* r$ [" W* d) C cmp ax,0F386h7 @$ q! D( D7 `* f& r. b
jz SoftICE_Detected0 B6 u6 ~* I: l& l
& V' e* {9 c/ z
) E- W8 v0 x6 g( o2 J=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit1 S! {+ _! N8 P: D+ u
app like this:5 f6 x) r& {% d( b: f
6 _& m. X/ Z1 s, i: [3 Z BPX exec_int if ax==68
6 S J: o, _6 H6 c: c \ (function called is located at byte ptr [ebp+1Dh] and client eip is4 u/ w1 y' ]! Z/ e% L! ?
located at [ebp+48h] for 32Bit apps)9 Y0 N" k! U9 j6 I+ N6 s
__________________________________________________________________________
2 v* _( V, o' y3 B2 Y. ] r) ^: `5 ?, ~; s5 z: \" X7 r
2 `0 k: P' v6 X" Y0 z" |& j, e
Method 08
/ x. s: T- p7 }! _0 R=========% R9 h# @2 q0 P9 u0 j$ f. W* S
( f- ~+ n8 i$ Q0 y2 H9 v4 K
It is not a method of detection of SoftICE but a possibility to crash the
; S7 D# U; }# [8 qsystem by intercepting int 01h and int 03h and redirecting them to another
' ^0 I8 ^- y# ~/ f+ hroutine.2 c) f8 F& }$ c9 b9 h
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points+ O! M7 u& O- ^# P$ p
to the new routine to execute (hangs computer...)& \' t6 h8 [% E' t
; d/ [( q, }( V% j8 K9 k mov ah, 25h
! H' A. Y. o6 o' K0 @. L mov al, Int_Number (01h or 03h)/ o6 p2 }' X5 G4 d# t3 k
mov dx, offset New_Int_Routine
. C; T2 ?$ d: A2 C9 o' E, F { int 21h
" [# o7 Q, |* `+ O. @' ?# S: F5 Z, u& T2 _
__________________________________________________________________________
( i) ?" c1 X$ Q
O' X4 ^& a1 I* m3 Z/ L1 ]1 N8 }Method 09
4 T8 }+ l# r& G5 d" J=========
0 \: z5 R; @+ L! E. f3 W( D
$ S# K* z6 L: o, {% Z' H3 U( cThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only3 J: s3 X/ }, O' i" Y0 p+ P4 |
performed in ring0 (VxD or a ring3 app using the VxdCall).1 s- M) D* O. t, r Q
The Get_DDB service is used to determine whether or not a VxD is installed
% _! } r. X; s% f) Ffor the specified device and returns a Device Description Block (in ecx) for, A) M% a3 L! i# H' ]
that device if it is installed.
+ b3 \) K8 J8 S+ P- d' ?$ e0 ^% b) V
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID" t7 ^9 j7 H! Q9 y' O4 F: a( J
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
h2 d$ ]5 v) ~ VMMCall Get_DDB
, Y* D: t" n4 p# F mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed7 ?' o$ x% D, }
* E9 G, G" h1 e. WNote as well that you can easily detect this method with SoftICE:! \) q7 V+ t4 n! S C
bpx Get_DDB if ax==0202 || ax==7a5fh
6 G7 H1 K! [& `# C! R+ C
( x: ]5 \+ o) g" G8 H__________________________________________________________________________& {% S$ N* ?* W8 U) I' e: f4 l [7 U
: |- j( z, A9 c# m
Method 10& y1 s3 P( X: N5 r2 k
=========! B- t4 c+ I7 a* R E
# _3 F) @" y0 c. }
=>Disable or clear breakpoints before using this feature. DO NOT trace with/ P: M, Q( V; t4 Y
SoftICE while the option is enable!!, i' }+ B& v6 S1 N Z; S5 M
4 h% W7 ?( I% |* SThis trick is very efficient:6 Y4 G2 P* }* P8 l# B9 x! ?$ I( a
by checking the Debug Registers, you can detect if SoftICE is loaded
) m+ I, m: x( v! V8 Q" N2 \(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if8 ^7 N* C% W0 X; e( w# l
there are some memory breakpoints set (dr0 to dr3) simply by reading their9 O. f" v" T9 F4 `) S+ \4 _1 T
value (in ring0 only). Values can be manipulated and or changed as well; g1 ~. e ~5 ] m( m
(clearing BPMs for instance)
5 U$ M3 x' ~& E7 G* c! A# y% i" o8 J% l' |1 k* \
__________________________________________________________________________
. W: x% |( G7 R h5 w* o
* J8 Z* I3 y6 v* d8 ]4 nMethod 11
( S- e; M$ {/ {=========4 `5 N2 \7 V1 r3 T6 L, o" ^5 e
# H0 u* ~" M5 x' [6 Z
This method is most known as 'MeltICE' because it has been freely distributed3 V g% ^7 j& y' w
via www.winfiles.com. However it was first used by NuMega people to allow+ g& w e- X" C& a4 x$ g m9 I. A$ D
Symbol Loader to check if SoftICE was active or not (the code is located7 E* z% D& f! P. f9 I; X% A9 V
inside nmtrans.dll).
/ C- v' B- k( b) t3 d8 J
8 b/ @( \: {& W2 ^' F" u% x4 nThe way it works is very simple:- }3 `" o& l, z5 @* c
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for3 ?' x# `* b# f/ J' n
WinNT) with the CreateFileA API./ V; e- M) j) ^$ a+ J' ?& m0 c* V
- o- P, d) M8 T L
Here is a sample (checking for 'SICE'):
. E( i4 w6 o* y# ~9 L
" d( c/ c. z& Q! I# y7 IBOOL IsSoftIce95Loaded()
8 o/ \6 o4 Z# {$ |$ h5 {{9 U, J b1 h' W3 X% O! ^! {
HANDLE hFile; . O. X( }1 m. T) s# ]6 n
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,# B* U) H' J& J- T) i* E
FILE_SHARE_READ | FILE_SHARE_WRITE,
" k6 q4 i$ g& \% k: q0 I% d, S# h NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
$ ?+ S3 |4 r( v+ U6 ~5 u0 \/ B8 ? h3 O if( hFile != INVALID_HANDLE_VALUE )
) S; a. O# M e: i- _/ M& w {
% B: d2 U& _& ^: R CloseHandle(hFile);) m& S. X1 ]# o! d5 n$ y
return TRUE; W; @" b" P# p7 g# ?# E# b
}1 N& A9 U `2 Z
return FALSE;4 O1 T( Q: o; |, U- r
}( f" J- R$ J* G0 k8 `& I
. ?$ k- q; r0 i0 U e" UAlthough this trick calls the CreateFileA function, don't even expect to be
: ]% F7 e3 H- `! wable to intercept it by installing a IFS hook: it will not work, no way!) c5 d, K( W- e) z2 u! t
In fact, after the call to CreateFileA it will get through VWIN32 0x001F& h0 l o3 Y8 K/ x
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
1 k1 n: I( G9 m) T1 P9 [and then browse the DDB list until it find the VxD and its DDB_Control_Proc5 G; E7 P0 }9 Z; n) U9 d! X+ V
field.7 a9 @- C2 [5 K" p
In fact, its purpose is not to load/unload VxDs but only to send a
4 \% Y, _# F, b& i% u8 sW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)4 x9 w* f9 {$ q# ]% s+ S6 z; U
to the VxD Control_Dispatch proc (how the hell a shareware soft could try' W/ H) J. N& X1 }; P8 c$ ^
to load/unload a non-dynamically loadable driver such as SoftICE ;-)./ Y6 V% ~5 l9 `7 g; }. Y& j
If the VxD is loaded, it will always clear eax and the Carry flag to allow8 ^/ h5 B x: {7 ]- V
its handle to be opened and then, will be detected.
, D3 e3 q# Y0 W, j6 vYou can check that simply by hooking Winice.exe control proc entry point
( B4 J0 {' q1 B% T& Bwhile running MeltICE.! l! y: i8 [; ?( y1 [+ \
7 g+ U; d* V6 s- g: ~# x# \, _7 N: j' N! a3 t( Z
00401067: push 00402025 ; \\.\SICE. G/ \% e1 Z3 e2 Z7 f
0040106C: call CreateFileA9 m+ a' f$ c; _- Q' w: w$ y6 ~& J
00401071: cmp eax,-001
- j J+ B/ N, Z4 k0 @1 ` 00401074: je 004010917 b0 {) \' T. P8 E- S: K3 t
* z1 @. [# d! K/ A3 X
]; j" ^$ \' c! {There could be hundreds of BPX you could use to detect this trick.
: E" j2 {- M& V/ O-The most classical one is:
, E- g$ Z) \2 o1 p BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||! `2 Z- G2 `9 [# `. z `2 W
*(esp->4+4)=='NTIC'
, y+ S9 ]9 H6 K$ ?! p) u4 g, ^' a: C8 k- R
-The most exotic ones (could be very slooooow :-(
' V0 R1 J! m: w, N& m: N BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
3 U$ W8 V/ L4 C+ O3 I6 {6 B ;will break 3 times :-(
( ]; M9 A) {9 y( V7 k! w4 M9 z" X$ B7 E- f/ @0 `5 y1 Y
-or (a bit) faster:
3 s1 t4 X. z' D5 a+ E$ _& I6 m BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
c- U, q& \+ D8 c
7 O6 X; q2 V- \) Y O: c0 K# t BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
7 k7 o% l3 a# K# J# ]# _1 p: b ;will break 3 times :-(
O; c1 {4 L# Q, c
: e% q; ^: K# Q U! }-Much faster:7 c# z9 Z" m( i: |2 [5 H- K0 _
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'! s. C3 I; s8 Y# i5 d
+ h' [$ \6 f' R8 F- m. M) \
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen @+ M* E, s3 e
function to do the same job:! Y; W' G. A' R
" c, l3 E6 Z3 } push 00 ; OF_READ3 [' {8 K- r( d
mov eax,[00656634] ; '\\.\SICE',0/ h- R7 K4 Q4 a2 x$ g
push eax5 F; V* J, B8 s+ Z9 [9 @3 d7 C
call KERNEL32!_lopen
) Y M2 Y; O9 f0 y0 A inc eax
: M* C2 ~; ~5 ?7 V, G- Q$ D jnz 00650589 ; detected
) a- h& V6 m. V8 C, ]8 x9 o push 00 ; OF_READ
* ^: h) g. n/ c# q" [* T* O2 U6 E mov eax,[00656638] ; '\\.\SICE'
) L2 V6 \$ P% W' L( l) q' _# R1 T push eax; @* d5 N ]$ s/ m9 y% B6 _ u
call KERNEL32!_lopen0 J% g0 }4 l2 Y! |4 i) N
inc eax
$ Z& I- f, ]4 o3 V jz 006505ae ; not detected1 G% n9 E1 |3 e0 I0 N+ a
! n S# i6 i! s3 ~, y7 {
! k8 G% q& ^7 ^! t6 O% n. u__________________________________________________________________________
& `+ ~5 I( N: f; I0 |, K) o' B$ a4 u. R* E+ A3 Q
Method 12
! a2 S; ?8 c; r' {+ o. X/ G3 N4 f=========
% ]& {+ `- w1 l0 T' i4 T7 E V: E+ S6 h" _
This trick is similar to int41h/4fh Debugger installation check (code 058 l5 N# L6 L: o1 ]' |7 q+ I
& 06) but very limited because it's only available for Win95/98 (not NT)
n! U G- A3 z4 T' P- C% R1 las it uses the VxDCall backdoor. This detection was found in Bleem Demo.0 ?( k; u' P; W l
3 g8 _7 R+ Y5 k; ^4 D push 0000004fh ; function 4fh
) Y; o$ M# ?! ?+ a" l: W0 r$ i( Y% `& t) } push 002a002ah ; high word specifies which VxD (VWIN32)
8 l5 }5 q" z8 G6 { ; low word specifies which service% O$ x* h, `- X, f% x% f( j( B
(VWIN32_Int41Dispatch)& \' m4 q3 f. q- D( i
call Kernel32!ORD_001 ; VxdCall% r2 r- M. [: ?) @! S( `) Z
cmp ax, 0f386h ; magic number returned by system debuggers8 d* ?+ e9 n% B, @
jz SoftICE_detected
* h2 [. p7 H; p/ X9 Z
3 K, ^# z+ Y l( S4 u- LHere again, several ways to detect it:
# t# E( u9 Q( n0 }
6 S. p9 p7 a" i0 v. B' \ BPINT 41 if ax==4f% R/ z/ f$ r2 ]1 z. B
' d- B* l1 z' v8 U8 {- g o BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
: |. X7 c2 w7 J# {. T' Z5 r* q: k0 m, f# j& ^7 t
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A6 p6 ^5 f' ?8 X! o: _
' j8 l0 a0 A5 N( W: E
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!6 G) j8 [) k4 h$ c8 w* `
- C! d& e4 T/ i# R" H7 N
__________________________________________________________________________
% n; \' i E# O, O7 h6 T: r4 m1 ~, j7 S5 Z' p' u
Method 13
+ x: @" x% X% J ?- ~=========$ x @+ t1 P- `: Y+ @3 ?$ ?
: c: }# R) N; H9 ^1 i9 g1 }
Not a real method of detection, but a good way to know if SoftICE is7 o' v, I! x( E: ~) B6 c
installed on a computer and to locate its installation directory.
7 A; Q5 H7 Z" k( ?It is used by few softs which access the following registry keys (usually #2) :% Z; b/ a( f6 `# w) r/ }; t0 U% \
& ?" R5 i+ M- ?9 n+ ]3 n# \
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
, K* f9 m9 O5 V/ j: ?\Uninstall\SoftICE
7 f9 c _' o0 M, p- S' b-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
' S5 m8 t: |7 T; o1 z-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
2 i: R: S, X2 _- y6 I\App Paths\Loader32.Exe
( P4 y& |9 R( A5 e2 N
$ f( V" D; J( Z9 M) \* x$ f6 r; [7 n! b# e2 A
Note that some nasty apps could then erase all files from SoftICE directory
; R$ T1 t! k q- h2 Y(I faced that once :-(+ m& D6 Y- c$ W* a) k7 Z
) B; U/ ?# B3 U/ M, d& u; N k
Useful breakpoint to detect it:% Q. _; w4 y3 G# `2 a
* |' ?2 L7 i; \% d$ _; x: x BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
% t& w2 y7 C& W
9 c: z9 `# H4 |6 ~5 [1 u__________________________________________________________________________5 \# M& `) h, g' H7 d9 y
' q8 z1 J7 k- P# ^# a( {4 R
. F% Y! }. i6 r9 BMethod 14 ' o7 q( j$ S' l( X6 a
=========
5 x7 f+ E, ~4 E% ]
/ R) |; G" I1 A3 ?' J- pA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
# K0 z7 Y5 s1 [9 F% j% eis to determines whether a debugger is running on your system (ring0 only).
/ s7 q) S! S- _
" H4 s! R, L5 q* N+ \- e1 V VMMCall Test_Debug_Installed
; }; c) K8 j5 i$ W$ ] je not_installed
2 `" R9 `( |! x/ _
! {8 h8 J: r& h# F/ k. ?* t4 iThis service just checks a flag. i, @+ e% K+ X" Y
</PRE></TD></TR></TBODY></TABLE> |