<TABLE width=500>
2 y. G3 `9 S, U( L" U5 W9 w<TBODY>
) R1 W5 A1 Q1 V& M" R& S4 C<TR>9 w! s6 w& g( t: O: r: }9 c
<TD><PRE>Method 01
f% C, b! a! u& U; u# _4 b) Z=========& G; n3 t8 q* _8 L
6 G9 L2 w4 r v8 F0 h% Q+ C3 BThis method of detection of SoftICE (as well as the following one) is: j8 `3 G+ O7 e6 a8 Z m) g. }5 q
used by the majority of packers/encryptors found on Internet.
* c( O4 y$ _: n7 p2 ~ fIt seeks the signature of BoundsChecker in SoftICE- X- a8 s" K f9 _) \6 i& T
5 i* G( U9 n7 Y( x) H" D mov ebp, 04243484Bh ; 'BCHK') y/ f" G" @. }( e1 w
mov ax, 04h% q6 I( j( N9 M2 E
int 3 . l& l& U8 Z' r0 J* l0 E) B
cmp al,4" W a' M$ g1 U% ~3 X
jnz SoftICE_Detected
4 T8 G8 I# i7 j9 o8 h
% s4 w% V9 `3 x___________________________________________________________________________0 N! `8 F! g" `
- h) X9 z$ N) I( n# a
Method 02
- T+ i2 F% Y6 `- D8 M* ^=========
; y$ ^: e7 E* q D( ]
4 |) i3 y+ j% t. @8 ?( G# g4 oStill a method very much used (perhaps the most frequent one). It is used
5 m( n) O" R! s! h& T( e( gto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
5 L0 h, {0 A% Xor execute SoftICE commands...9 ]9 o5 y/ n. a0 e
It is also used to crash SoftICE and to force it to execute any commands
$ N4 v' n; a0 {. k1 L5 d(HBOOT...) :-((
# m+ M5 R* z( j, c. \6 a; K) @
8 m% l, k' A" H% V' v: ^" lHere is a quick description:; J$ R _0 |* c0 m& z% d9 l( Q
-AX = 0910h (Display string in SIce windows)# p% q2 a+ H4 X) i8 e, i
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx) @4 @* O" x4 `: T
-AX = 0912h (Get breakpoint infos)7 o6 k5 K* W; L' k* D. ~+ [3 x
-AX = 0913h (Set Sice breakpoints)4 ^2 ^& T: P+ [$ r) F
-AX = 0914h (Remove SIce breakoints)' P% a3 k# p% `; i5 B& k5 ]0 H
) f. r/ c1 W! q. M UEach time you'll meet this trick, you'll see:1 M4 T/ n, a9 k6 \9 f
-SI = 4647h
) p5 j+ @' h8 Y1 c; c-DI = 4A4Dh
. x- g9 w3 R; vWhich are the 'magic values' used by SoftIce.4 A* Z7 E' b2 w% q; G. {
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
, Y9 W" c3 f! ?; k9 B$ K5 x" R: i4 }8 f" b
Here is one example from the file "Haspinst.exe" which is the dongle HASP2 _+ x( J: G: ~
Envelope utility use to protect DOS applications:1 ]' W* E+ W& r( i" x
2 X8 J8 m6 T3 t! v: s1 j1 L7 N
9 b- ^' N& j- g) }' C
4C19:0095 MOV AX,0911 ; execute command.: \8 A1 Q _2 b/ j
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
* b6 {1 r6 M. u, F5 E5 ^4C19:009A MOV SI,4647 ; 1st magic value.
$ i# I* f0 }& Z4C19:009D MOV DI,4A4D ; 2nd magic value.' l: q6 S! b7 S4 h. }1 V
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)6 ]! g' U: _- Z) ]2 u4 L0 `& @" X1 S
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
5 @. [% ?" F( q5 [8 U$ b) O4C19:00A4 INC CX
! n( P5 H# n' U4C19:00A5 CMP CX,06 ; Repeat 6 times to execute# m9 @* v9 \& `5 z7 g7 i% H% C( ]9 J
4C19:00A8 JB 0095 ; 6 different commands.
( s- d' L8 b- g) P6 ^) C4C19:00AA JMP 0002 ; Bad_Guy jmp back.7 Z7 [1 j* g$ v" y1 H/ p
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
4 S4 P# {4 c: P2 ]( k2 d7 Y$ S8 h7 `% t& h
The program will execute 6 different SIce commands located at ds:dx, which' }* z% l( [. ~* W7 z! J- N
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT., g$ U' h5 V! q7 W) s% F" ]
/ V2 `9 C/ d( \4 @5 n7 K* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
6 ~* }/ \8 y& }4 a* W9 W___________________________________________________________________________7 s4 _! d. K% ?! \3 d
0 T+ F( R: F/ s8 k( g9 l7 }- G& a8 U5 D6 B
Method 03/ \+ ]+ ~4 B. K/ a7 n8 I1 a
=========+ m2 W; u- J& K$ B, L
% @5 F% c; P' R" yLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
5 M) L' a; h7 a% r! G% ]5 _(API Get entry point)
0 p3 M4 |# \7 h: u& x# f
2 q8 T$ @+ l- c1 l1 l$ S* N. M) E5 s& U& d$ ~
xor di,di
# j1 U/ P+ c& E; k" |; X mov es,di
; D( W: U; @1 K0 f, ] mov ax, 1684h
' F6 e, Z& I+ S% d0 H, U& i mov bx, 0202h ; VxD ID of winice
8 K" `. G+ Z/ t! L1 ] int 2Fh2 x/ [( O* b# I; y
mov ax, es ; ES:DI -> VxD API entry point7 g7 b! R( g8 O2 J
add ax, di- l% a3 Q \$ N
test ax,ax
$ P) W2 \; S+ X( J+ O jnz SoftICE_Detected
; n2 n9 T$ @. p
9 S/ P, t2 r7 e% X___________________________________________________________________________! J+ J! ~4 u1 \; ^- v% T
+ ^5 C2 _( P& u! j+ u" l
Method 04
0 {0 |1 d* \- Q=========; t# n& j: _; l6 ?0 c" o
) L- g Y: p$ S, L) | B2 wMethod identical to the preceding one except that it seeks the ID of SoftICE- B3 W3 b% ^6 M5 N$ d
GFX VxD.
) j# C0 l4 i- Y
% D' m! t! W: `. Y) f# B a xor di,di u1 i0 P6 N! W5 ~5 G
mov es,di
. u1 E% W% Y$ S( O0 t mov ax, 1684h 6 o! k0 H A# r
mov bx, 7a5Fh ; VxD ID of SIWVID
5 l( C) J( Q _ int 2fh
" h2 O% b/ U. Q: i$ H( R; t mov ax, es ; ES:DI -> VxD API entry point
7 k0 D( O( b+ y# V4 K8 ?2 I! b add ax, di
3 s: P$ ?0 \7 s" n7 B: Y g( B3 }/ L test ax,ax% k# y* n0 i3 V; u
jnz SoftICE_Detected
5 }1 g5 ` X, [& Z' T+ k, x& X
% y# i2 E: `) N9 O8 s__________________________________________________________________________1 m5 p/ k/ G b
9 b# H' f" @' x8 ^: p4 G4 |2 ]5 h8 d+ M* W6 J3 v6 ?8 T$ ~" L
Method 058 B& l& o$ _6 W" i8 e3 _
=========, I7 i. I; y* Q; N6 Q" o: n
- m2 S* C8 j7 |! J5 I1 o F5 HMethod seeking the 'magic number' 0F386h returned (in ax) by all system
- o: B+ `$ s v. V% C$ N- mdebugger. It calls the int 41h, function 4Fh." J+ B) ~* S, I6 N0 ~, a
There are several alternatives. - B. o$ S4 |% f( P. L: ~
3 ^, k: R; W' s4 qThe following one is the simplest:# e0 \) p0 W3 T
5 q I. s2 O% e* p2 y: c
mov ax,4fh
0 J' m- t% R% A& G; G" S int 41h
- N- f' E/ k+ N3 ~ cmp ax, 0F386
+ ]0 N2 Y) E% J. N+ \( [ v. u jz SoftICE_detected4 H2 ] \' h( G( L
# s1 X2 o" H& v- S7 l- H" x2 w- B: O% M0 Z; ~
Next method as well as the following one are 2 examples from Stone's ' p6 _0 i* v: O P5 X$ |6 q
"stn-wid.zip" (www.cracking.net):
6 X6 s+ |% D/ ?& R E2 d! C3 s3 e
* |" G# z5 D# F8 D W4 i mov bx, cs+ K% I& d. D+ P5 H: s' ?
lea dx, int41handler2
6 j* _0 i9 ]& k3 w xchg dx, es:[41h*4]3 {: |2 B, M& ^: P
xchg bx, es:[41h*4+2]' J8 f. {4 C8 F/ d$ |6 x
mov ax,4fh/ H4 }4 ~- o x# p, Z
int 41h
: j8 O$ X% m7 N xchg dx, es:[41h*4]- o- y2 V% |6 G6 {' ]; d
xchg bx, es:[41h*4+2]' V5 y) k4 g/ t% G9 p
cmp ax, 0f386h1 w. v1 C- A8 R0 l* {
jz SoftICE_detected7 m8 e8 Z. o. g$ V' g
7 c9 T& g- S5 ?3 G1 B7 F: f' zint41handler2 PROC4 g2 N! K& C5 u; t" u0 ^6 y
iret
( X- m3 |+ D) I4 c% t9 Gint41handler2 ENDP& a. E8 q; h6 X2 A1 R
" k4 e# o4 `. D2 F! e1 t
" c1 L, d$ N) a_________________________________________________________________________
3 b3 n* c4 O; X s1 o$ m" [$ j
' ^) d; i; M3 U# t, A- ^1 F( J
; u. f* {0 C/ H9 k* m; Y$ K6 HMethod 06+ e d6 d, l" D$ Q# Z
=========3 P, }: e# D) ]5 f& x4 c6 J
2 }9 S- K3 u* Q: c2 f' n- V
2 ^" Z7 R7 L: Z$ f2nd method similar to the preceding one but more difficult to detect:& R* Y: i; D# u* ]: Y
0 o+ S5 |% R. V, p; M4 P. B+ D
) D- H: }2 y; f) N' z6 k5 j5 P, x
int41handler PROC: O/ O& O8 H, A* d5 k
mov cl,al7 }2 \8 z9 j, S; V3 j; C# k- {3 ^
iret( a0 B. Q$ ~8 g& n
int41handler ENDP( a( i1 ]' R, `- n5 `0 l
7 Z- @: M% _$ o4 S) g5 e8 ^# x6 L
) D$ E- H" J1 Z1 [ C [ xor ax,ax
1 o. T1 V" e2 F7 B mov es,ax
8 o* ~0 v+ V4 D( l7 {. t mov bx, cs( m; x2 X2 F/ c! w2 U
lea dx, int41handler
% \4 g, V0 ?$ u# | xchg dx, es:[41h*4]
; a$ `/ X' I" O' n9 j5 U2 o3 F. I xchg bx, es:[41h*4+2]9 |! \3 q C6 O) z* I3 P6 W1 u
in al, 40h2 m6 O2 K1 ]1 s1 U) y
xor cx,cx
$ r4 f/ Q2 Q, @/ |2 f int 41h
. D) r/ T: @/ I5 I5 u# B8 H xchg dx, es:[41h*4]" M; M4 l2 q+ x" `3 Y4 q
xchg bx, es:[41h*4+2]
- }' Q: o: }. T0 Q v; W cmp cl,al5 m9 i: r9 [& S. ]" F
jnz SoftICE_detected
0 V# j- o3 w3 \' s0 y5 C
0 y; _, B+ S, Z0 m* p; ^_________________________________________________________________________
, @' u9 ^: i' Y% u. E
9 Y O: Y0 B% RMethod 073 K% [; I+ V0 y: M" O: }' W" ~9 G# V
=========
) s* |+ |) T! n, k7 ]; O b9 D% r7 t$ |4 r( g: j0 Y8 \5 i
Method of detection of the WinICE handler in the int68h (V86)2 r# z) ]6 r. }5 Q
9 f) U3 G# _+ r3 G
mov ah,43h
_3 m1 t: T( k0 W9 s int 68h
7 |" F0 H+ G, X% b( g cmp ax,0F386h$ Q' e- z4 }) L" {) i
jz SoftICE_Detected6 R$ X" {; P W# t' [8 M
" D; j! u. U, l3 M! C9 o/ c( U, I5 T' V
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit: \4 X1 k4 k1 |) c7 o4 Q6 B; f
app like this:
" \; K" v$ p9 r9 i' ~$ c6 k6 i9 E- D1 Z! {9 g4 T+ p
BPX exec_int if ax==68$ ^. Q- @7 E# [, C& |
(function called is located at byte ptr [ebp+1Dh] and client eip is9 h0 f d; A8 c
located at [ebp+48h] for 32Bit apps)9 M- t( H. w& D1 s$ N. `* J; |
__________________________________________________________________________, z& y% p y' h5 H3 \; C
8 u' |, M' ]. ?0 H# J, L) O& ]4 X7 d9 T" d# O# G
Method 087 [- U' o+ g' U J9 _
=========3 N- Q) a0 t+ ^; e# }' O# i
# u" C# h9 c, I( e
It is not a method of detection of SoftICE but a possibility to crash the H, k3 G, T6 S$ o Z% i
system by intercepting int 01h and int 03h and redirecting them to another* ?* f' Y7 t4 G
routine.% s; x( C: C& ^1 h
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points, U2 }) J! }# k, s' b2 N
to the new routine to execute (hangs computer...)
9 R7 @! {; |& ]# I$ s
5 H5 Q! t& }8 s- @( m+ w mov ah, 25h
6 Q! e1 a' n% b# e) Q mov al, Int_Number (01h or 03h)# q8 |7 J& T1 G" E) I4 d
mov dx, offset New_Int_Routine
/ q0 d. e& F- M" P- @% H) f int 21h
; Q' q2 b- q3 N! ^8 S4 ?% J
$ w" l/ u }9 y- a__________________________________________________________________________( i7 L+ Z4 D. q+ N$ b9 I
; c- [( y( i5 i: \7 N v
Method 09
, @# ^2 h( |2 l) {6 Z=========
7 ]) i& Y9 }2 u J7 W& \% p9 d1 |. M5 c
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only/ q9 f2 M5 ]! F9 t
performed in ring0 (VxD or a ring3 app using the VxdCall).0 X; J3 ?3 I+ w, A
The Get_DDB service is used to determine whether or not a VxD is installed
$ V8 I' o- _; G3 q1 R) k- W& hfor the specified device and returns a Device Description Block (in ecx) for
1 x7 |# G J% Nthat device if it is installed./ z4 N5 ?0 g0 p# J
# M* R: R6 ]( V. l d; Y$ o* F; s8 m mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID% V( G8 Y* H; [ t/ w- F, v# _
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)% W5 O& k" I# o# `" a
VMMCall Get_DDB3 `3 L& d% D" p& D8 C/ d
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
' E7 F% B. r% {0 Z7 @! F
1 n/ n! p c. wNote as well that you can easily detect this method with SoftICE:" {: n7 V$ s. N* p6 f5 E; T
bpx Get_DDB if ax==0202 || ax==7a5fh! K/ P5 D& R+ M6 h! V5 u7 I9 e
& [/ C/ L7 U( p+ [__________________________________________________________________________: N! H. \9 d% _% D: [2 ^: V
0 p6 w/ o+ G( j
Method 10& \+ ~* u+ e! e5 S6 u" E$ S9 M
=========7 A" I& a: Z" }; O9 S' S
7 [4 K: D- y& n# \$ w5 v. v
=>Disable or clear breakpoints before using this feature. DO NOT trace with' _9 P9 }" P: x5 X! P
SoftICE while the option is enable!!
2 ^) E. h: n$ \& y2 A$ G- V, x$ M) u: l+ O4 R$ T+ q
This trick is very efficient:
8 |2 m* M) C; D* v8 r& N2 U' Lby checking the Debug Registers, you can detect if SoftICE is loaded
! r5 j/ ]+ o) P% o7 z(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if# ?3 a6 s4 S9 R6 w0 ]
there are some memory breakpoints set (dr0 to dr3) simply by reading their v/ ^9 s/ N* c6 P* b
value (in ring0 only). Values can be manipulated and or changed as well
9 ^* W+ b& g& K0 H(clearing BPMs for instance): r, N9 R, V8 k1 {! `( q
5 I' G3 U) _+ x
__________________________________________________________________________ w; X% @% A( X% p. K
1 D, M5 n) I6 l
Method 11
0 j) P5 U2 }8 u. b5 H2 y=========9 E4 `% a+ A" [, Y3 y, k: k
: p) o, P! {0 {This method is most known as 'MeltICE' because it has been freely distributed# ?0 i7 X5 H; m2 h
via www.winfiles.com. However it was first used by NuMega people to allow
+ L7 y6 C# x* [Symbol Loader to check if SoftICE was active or not (the code is located( W" ^- M( H3 t* L
inside nmtrans.dll).* f! @3 S* ^0 f, Q. R
2 w, z6 x' L1 c8 ~1 G2 ~* R+ nThe way it works is very simple:: c0 g1 K) `1 a% E
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
# a4 V/ E; _5 d! \/ u0 rWinNT) with the CreateFileA API.
% r5 D; @) q4 Z
4 S8 R# F6 |1 YHere is a sample (checking for 'SICE'):
4 \% {0 r4 S" m# S* ^
# a& x) j( M1 l- A/ Y7 |! fBOOL IsSoftIce95Loaded()
Z2 L' d) b" e. A6 j{% |2 j: Z; `9 F1 q# b0 A8 }6 P
HANDLE hFile;
0 T' S* d9 |2 x1 }+ Z- O hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,1 e+ i. E6 F- N/ g8 v) C" C0 S
FILE_SHARE_READ | FILE_SHARE_WRITE,
3 a: l/ a8 F9 }9 H& D NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);" X2 D& s% V d* E0 ]
if( hFile != INVALID_HANDLE_VALUE )* D2 g- L v/ H( k- j" ?' q, b) Y
{
6 w* l/ [! O% {: C: d1 _ CloseHandle(hFile);
( V( l$ t, ]) h! s k return TRUE;
3 n% T4 V2 B! {* H- q7 i2 ]5 A }7 k& u- U& Q' e3 i8 ?! J7 |
return FALSE;
0 s% ]! g4 [' i1 s4 a% [}
1 X) J6 h) F' L, _8 a- l& ~% B" \
Although this trick calls the CreateFileA function, don't even expect to be/ K4 M) H6 G' B0 v9 W
able to intercept it by installing a IFS hook: it will not work, no way!
3 S( v: @/ j" a3 T w( f/ jIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
% Y; N" ]7 Y8 f1 s9 Q/ ^, _. t8 @service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)3 N9 B' b+ S/ w$ B& x, A
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
9 H c) n/ y, o _( Yfield.
5 M) E. R$ M! ~/ AIn fact, its purpose is not to load/unload VxDs but only to send a
$ ]. ]7 }9 g. g5 y, FW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
* P$ L% R. T! s4 y: ?( uto the VxD Control_Dispatch proc (how the hell a shareware soft could try
( n0 o z) P) r- a4 K+ _2 D6 zto load/unload a non-dynamically loadable driver such as SoftICE ;-).
6 p, c A4 r( BIf the VxD is loaded, it will always clear eax and the Carry flag to allow! Q0 b+ \: y7 x9 E) }
its handle to be opened and then, will be detected.
1 u9 l1 U' |- |) z& kYou can check that simply by hooking Winice.exe control proc entry point
2 u4 I& x* r* S( C0 k" Pwhile running MeltICE.
V( Z! O9 l: H# {
- [% W' t/ E# f7 Q+ E0 w ^4 ^0 }
7 l G O) u9 C$ Z' x3 w) G 00401067: push 00402025 ; \\.\SICE) H3 e8 D. x! p6 \4 a$ r
0040106C: call CreateFileA2 f1 y9 ]; I4 E: W. c
00401071: cmp eax,-001
- `, @" o5 T8 }0 o" Z7 J2 c 00401074: je 00401091/ _- i' n( U3 M" u8 f# N2 B
' N: V. N8 b! L4 V9 i9 J* b" t
- Y( Z2 r2 v1 M: m$ F" s8 `2 MThere could be hundreds of BPX you could use to detect this trick./ I( |6 h9 f: f s+ m
-The most classical one is:3 a: V/ [8 a" P. E! r
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||3 Z$ Y0 u6 I; K" D" j3 F! J& [
*(esp->4+4)=='NTIC'
# |7 s" K z. @7 i
+ B+ k! }& E( a7 s-The most exotic ones (could be very slooooow :-(
: ^" ?/ F+ m5 j- g$ _ BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 2 A9 {( \, k$ V& m/ p# L7 U
;will break 3 times :-(+ X$ f7 J; f5 y2 G1 B
. Q9 d0 e: @" `7 ~+ }; N" x6 J
-or (a bit) faster: 4 \4 l4 W8 n7 y' } U! ~- Q
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
7 h& x7 U3 b8 s. K, Z2 E
( n% g$ V- |( d7 x BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
# y3 p# D5 E; L7 L9 @ ;will break 3 times :-(
' G: ^7 `$ Q3 B) G* |0 D8 y1 m' [* G. {0 h g2 o Q
-Much faster:- y. e& b# Y9 D
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'- p3 s! j5 p2 R% W
; b3 k- D# F1 l/ cNote also that some programs (like AZPR3.00) use de old 16-bit _lopen$ e- [* z b& r1 M5 J! W# u
function to do the same job:
5 z/ l" ]6 l: g- Q9 e, @
. g5 g8 w m: t3 V: G6 | push 00 ; OF_READ
% J" v- L/ K+ O# i; ?8 N" Z mov eax,[00656634] ; '\\.\SICE',0
8 ?$ z' w8 m1 [- ^$ x1 r push eax
7 H! I( L2 v+ v5 z call KERNEL32!_lopen
4 L, D: R' e9 f2 [6 E inc eax
1 g7 [1 \# Q2 \) u$ H jnz 00650589 ; detected
8 D8 O; y$ @# F, o p8 n push 00 ; OF_READ' D* y! J* q7 T: n, a" |$ \$ s
mov eax,[00656638] ; '\\.\SICE'
?& I! L1 q) b {! U5 y push eax4 N$ o: u2 }4 ~4 q( W
call KERNEL32!_lopen
2 N2 i' R5 _7 k' P0 t8 B6 I inc eax! V5 |8 T; ]* [& K8 w |
jz 006505ae ; not detected
8 G, ~% t9 L7 H; f7 k
' J; D4 ]- d* e# E8 F
7 l# t7 W' z6 }( M__________________________________________________________________________7 l8 q- K0 `$ A, J9 B
1 P7 W7 U- H p# R1 _
Method 12
9 B& l# c6 U* j5 `4 Q/ T=========
$ s, }8 _ E1 W
0 x' ^, u; m) yThis trick is similar to int41h/4fh Debugger installation check (code 055 P- P k6 m' u! j" }' _
& 06) but very limited because it's only available for Win95/98 (not NT)3 H/ v! d. d3 ~# }# ^
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
& n4 P& t P( Q# |* [! W. Y. l/ M, K8 a6 P1 W4 F
push 0000004fh ; function 4fh
' e; G4 G- c4 Q; Q push 002a002ah ; high word specifies which VxD (VWIN32)/ u! b9 w8 @9 B2 y: ?, S
; low word specifies which service" D2 x) h7 S! p9 r1 t& `9 | o8 p
(VWIN32_Int41Dispatch)* `0 s$ T! D" Z! g7 U
call Kernel32!ORD_001 ; VxdCall
8 z+ s1 s4 w( G# I0 b- {, y4 y cmp ax, 0f386h ; magic number returned by system debuggers
# {! z9 f$ x e; x% a3 }- x6 m jz SoftICE_detected
6 s/ u1 Z$ ~. }7 B9 f. ^& b/ S) Y# C0 h: h8 E4 l3 X# ?. |
Here again, several ways to detect it:
: J! Z" ~9 p6 N3 G' h
9 d. x/ H) C3 _. ?- p- q BPINT 41 if ax==4f" }7 q/ Y4 d" m! B
0 l% T. W& j! k6 O4 h6 a7 j BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
0 \- o8 D; h# q p7 X: g4 \6 x' E1 Y% ?/ s" u- z, @
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
5 s/ @6 C- G+ c3 d* e+ @: {8 E7 d* B" Q9 b0 ~
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
: ~$ L: a- T2 i; ]% K
" n7 z9 H9 u4 i7 q7 Y7 g__________________________________________________________________________
8 L; m; g9 a2 f* M) r+ e" D" w, ]; o9 A x- I- Z7 B# I
Method 13
' `0 c4 h |( {: F=========
4 }4 R& |! Y+ }- G1 u7 W4 e3 j8 }& Q
Not a real method of detection, but a good way to know if SoftICE is
! F6 _7 I2 k! ginstalled on a computer and to locate its installation directory.
( `6 Z+ D% S1 c j6 ]It is used by few softs which access the following registry keys (usually #2) :
, P1 s% g! p7 }: }+ M) A( O7 n
, v( X% o4 s9 r' C1 |. h/ y-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion3 | b* \+ U: Y; k9 t( R8 I% k
\Uninstall\SoftICE6 x' @, {/ @- B; h1 c5 {
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
2 X ^: @1 J0 U [9 `-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion8 K- `7 H5 Q2 O& [& b
\App Paths\Loader32.Exe% }$ m5 a6 ^, \( r) Q9 e0 f, y
8 z7 M. m8 ^! P: _1 M
4 m: P5 ~* l# ^8 ~9 P. ^
Note that some nasty apps could then erase all files from SoftICE directory
' C: H& m5 M) \6 G# n+ i2 e(I faced that once :-(- Y1 S l$ N- G+ H3 B* \* Q z
8 r5 y7 x1 U7 h. ?# oUseful breakpoint to detect it:, @, E% g0 p3 O% v6 {3 n* ~6 A# ?
/ }& y& [, `6 [0 J1 J! i! d8 O
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'( Y* o% C" Z5 }+ g9 K0 v
8 J1 \" l/ K: \
__________________________________________________________________________* B" R- p2 F' c' U
. O% b+ q. @, p; M" o4 @5 k
; j4 e0 H7 v5 ~- D$ PMethod 14
5 ^' U9 c! w& U4 }/ s# S6 S' W=========
7 X2 S0 B% z% n, i& b& s6 G+ o& y) S F$ [$ [
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
& O/ E: W8 v v Yis to determines whether a debugger is running on your system (ring0 only).
, b& g" t; m' v+ k a
! o" C/ e6 E5 y8 b VMMCall Test_Debug_Installed6 l. r7 I G Y2 m
je not_installed
5 P6 P3 J9 l7 ~# B `5 F! g
& G1 \& n( s4 s" E/ WThis service just checks a flag.# Q2 w$ C, o; {& j0 T; A
</PRE></TD></TR></TBODY></TABLE> |