<TABLE width=500>
/ z+ n; N# [ |! n. n<TBODY>$ k& x! H' j' N* U
<TR>
6 b& p! ~# }8 J& |' i<TD><PRE>Method 01 / f$ Q) B0 N/ z u
=========
; [7 s: B; E! {9 U/ E6 @
/ R U0 R6 u& Z1 h" @, rThis method of detection of SoftICE (as well as the following one) is, Q( K: h0 k! k& h" s& X, l
used by the majority of packers/encryptors found on Internet.7 B+ s. B3 D1 {3 {
It seeks the signature of BoundsChecker in SoftICE1 W7 f; H8 `' i6 s" N3 l
8 U x x! n. r- ], M; U7 L% A
mov ebp, 04243484Bh ; 'BCHK'- Q( O( ]" P% M, Q
mov ax, 04h
2 {1 H2 @' g5 B7 q$ q int 3 f% S( P& x/ Q7 J$ O" j
cmp al,4
' |6 [% K ^! {- C* J jnz SoftICE_Detected
* R1 S' c. D5 b) j' Z
' m6 ^4 c9 B5 k H1 u2 k/ h% i- u___________________________________________________________________________! j/ o6 i$ C+ p. N, G5 H- L
8 A" Y/ P- ?0 s# y2 k+ s* x
Method 02
. G4 _1 q5 J; Q) F2 {=========; Z/ G6 Y K% R
1 \$ x" Y( A, ?: a3 U" DStill a method very much used (perhaps the most frequent one). It is used
' M1 Z5 Q/ A# P+ }; Z1 sto get SoftICE 'Back Door commands' which gives infos on Breakpoints,# G. \- |5 I& [: L0 @
or execute SoftICE commands...
$ ?* s. H1 C5 P- l7 l7 [It is also used to crash SoftICE and to force it to execute any commands
% f: {' L4 G1 f ], ?7 v(HBOOT...) :-((
( I/ G: A) N ^; S; L& B3 L1 q7 T, W$ O! j
Here is a quick description:2 V1 ]6 X0 [8 V* ~3 i; i8 U
-AX = 0910h (Display string in SIce windows)
" h, e4 d/ p: i1 Z$ v: Y: W0 X. n-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
0 ~7 J9 ]6 X/ D& M4 N. C-AX = 0912h (Get breakpoint infos)
! V2 T u0 B7 t* N-AX = 0913h (Set Sice breakpoints)
9 _6 @( b- H9 K; N; l9 R0 M-AX = 0914h (Remove SIce breakoints)
3 d$ L- w) T' p/ A4 O! F& @: ^. p% I" ]8 ?
Each time you'll meet this trick, you'll see:
- z8 G5 I0 P& T8 D: B; S-SI = 4647h
7 b; _2 Y2 K, F: x/ ~/ ?' |% P-DI = 4A4Dh `/ F) h ]$ I2 a; ]8 H" H
Which are the 'magic values' used by SoftIce.
) N; T$ }! B, A' sFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.2 V6 a) i5 y$ T7 r( ~
1 `- J0 u* t: D! m# J+ |Here is one example from the file "Haspinst.exe" which is the dongle HASP, S8 f* D3 M' J3 ~% X( V( |, x
Envelope utility use to protect DOS applications:
/ T4 l' g; b9 Z) [* {* y: w4 {" R
9 S, y, ]) t$ q3 O# X: ^! i
& D9 s6 Z+ _ ~3 }5 X% s4C19:0095 MOV AX,0911 ; execute command.
! N# n( u& \. X4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).* |& Y( P# h( a$ o' h
4C19:009A MOV SI,4647 ; 1st magic value.) }# d: {8 R! n2 w$ G' y D
4C19:009D MOV DI,4A4D ; 2nd magic value.
9 z3 m! w: C5 K4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)+ Q% S) {" Z- h' `
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute* T4 k `7 w5 Y M* s& _* U) |
4C19:00A4 INC CX
( ?+ n( r5 i5 I6 F# X! M4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
: n' W: B- X8 N4C19:00A8 JB 0095 ; 6 different commands.
3 |+ g/ z: Q4 u4C19:00AA JMP 0002 ; Bad_Guy jmp back.+ s) Z) |! `6 O% |
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)9 c: z; k$ M; I( w
/ l! L6 o+ G: Y p. ?4 x( B% D: M
The program will execute 6 different SIce commands located at ds:dx, which
8 s K4 L, Y+ r# }* U: }" d4 ^are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.8 T; o8 ] n+ ] f) ~" k0 F. {5 |
; }8 `3 c: r- X8 k* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
; y1 N4 a" L: [% [, z+ ~8 r L___________________________________________________________________________
$ g9 x4 c# A2 J. ?3 l" a
% ]& w0 u1 _5 q$ ` W& c
9 I, ^# d+ |4 r/ JMethod 03+ Y- n1 E7 ^$ W+ s0 i, G6 M) \/ X
=========2 m/ |7 A" f# l b
. E0 f6 k T( z+ s
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h: _* J" d/ j5 a" a( H, k
(API Get entry point)
, ~9 O; I) O# o* p% [" Q8 L0 |( {" e 0 J& c: @ X# V! ~% y( H% H- J5 _
& {3 F, x, z3 t" G4 ^1 P" j: U7 {
xor di,di
# | _; O x/ }' c- _ mov es,di
3 C* z$ Y, b3 u mov ax, 1684h
. t8 P: ^5 O7 t mov bx, 0202h ; VxD ID of winice+ X. B/ Z: d4 u
int 2Fh4 C! g! a( y! ]0 z4 ?: v1 M% F# G
mov ax, es ; ES:DI -> VxD API entry point
/ h8 u2 v/ a" O0 b add ax, di, ]8 H6 X2 D8 A2 r& N
test ax,ax, X. X# D! N7 R4 }3 E3 `. d L
jnz SoftICE_Detected7 E. I3 j% i3 A
- R7 L: ]6 g$ J: D: M
___________________________________________________________________________
0 ?/ w- i' d' G6 G4 K. u; C3 s% }1 }7 u7 X4 q! i
Method 04. A$ V) n5 W' E G
=========
' S: ~, ]2 U; t. R1 `7 m) V s! s$ D, s5 C( _& y& L7 K% j
Method identical to the preceding one except that it seeks the ID of SoftICE
! |( c+ {- d% Z+ m1 EGFX VxD.; ?. E7 R1 ] W3 q% D& t
0 J+ r+ x$ A" V; x2 D2 m8 U7 T1 K8 c xor di,di/ y) Q, S9 t) A9 q
mov es,di6 X/ c: `8 Z0 \
mov ax, 1684h 3 {) i/ L* c# r5 k& h6 m) `
mov bx, 7a5Fh ; VxD ID of SIWVID+ I$ b% C7 M2 k
int 2fh5 N$ U2 a( X0 G" n; v! [; N1 Y
mov ax, es ; ES:DI -> VxD API entry point
- a# d4 B7 v' b add ax, di
# U, m$ i/ r. N# V7 ]: _- N test ax,ax
4 c9 s" n, ~( N* F* Y jnz SoftICE_Detected
W3 Q3 H* k7 ~; e1 q$ q( N* l$ N4 ^ O W$ h% [5 S5 D
__________________________________________________________________________5 P9 s& q/ C) d
" e$ g' r- ?$ g) z7 ^9 [
# N# Y( ~; }1 J! u& A+ zMethod 050 U1 ]( \! a* E9 z! `' ]! W
=========' X. q; _9 E6 ~- k2 ?: N
. I. B7 m4 I8 R3 w4 hMethod seeking the 'magic number' 0F386h returned (in ax) by all system% h- S& P8 X5 e
debugger. It calls the int 41h, function 4Fh.8 e% T4 L- H& c
There are several alternatives.
7 w1 z$ } o0 X! b2 u2 u2 v% {# D8 ?) R
The following one is the simplest:1 F3 n& Z- t3 Q
' E$ u) ]( P& B' N mov ax,4fh+ S2 d' O1 X7 C
int 41h
+ |$ f8 m% n( K1 L- i cmp ax, 0F386
9 P2 `8 x; @- E! H4 o jz SoftICE_detected
. b# i+ |& ~7 f% _% Z
+ X" [, A& y" k) g/ T' g
& H( G2 ^6 j$ X" C9 kNext method as well as the following one are 2 examples from Stone's . A0 G% U* O5 v
"stn-wid.zip" (www.cracking.net):2 a: k& k( g1 J3 ]- H6 {- t7 C3 r. r
, b7 C/ o6 G: d, o3 S
mov bx, cs
4 H9 \5 i' b2 ~" D U# F3 l lea dx, int41handler2) x, K% T) R) N
xchg dx, es:[41h*4], w: R/ J! T) @8 a D
xchg bx, es:[41h*4+2]
7 e' U6 e7 g1 G mov ax,4fh) K" `# I+ D" F& a% l
int 41h) v" C0 @* G8 f/ h& s. I, P
xchg dx, es:[41h*4]1 M; w8 V5 \2 r A- O
xchg bx, es:[41h*4+2]
/ `, C# }5 F: g: ~) L cmp ax, 0f386h
2 ?# g2 z- z. B jz SoftICE_detected
2 k( `* A0 T: [4 H6 ]# F* C' {+ }% b/ [- @; ?) g
int41handler2 PROC+ |$ D4 ?' F e. ~" i7 b
iret1 x; n- ~* h+ P0 |8 |
int41handler2 ENDP
# ~9 r# n7 |4 N) A" h4 k- J" z, r3 f6 s* F6 a" i3 C
5 t- d/ l6 R( }2 s
_________________________________________________________________________9 ~6 `( J$ V( S, }& z4 p
% |( H' B/ ?! K5 O8 p
$ O+ j4 E& Q+ M( Y% \Method 06$ S# `* k& B; U m0 c d7 P
=========
, d2 T( s; G* Q7 s* t9 k3 B
6 a( m3 _1 S6 Q; u+ Q2 \/ }+ H" Y, s7 T. c# @- e
2nd method similar to the preceding one but more difficult to detect:! {( M% F: R( n' @9 n) ?
( A* X/ i g; t1 U: T# i4 m5 K! U* N& O( U3 g; _- v* s
int41handler PROC
/ j) ~2 x5 Z# |" t5 h mov cl,al
& k( J( f& r; V% X' H" t/ s iret
% X' l/ A. _6 ^- H" Eint41handler ENDP; B! N' ?; u" o) H+ C
- q6 G# {" s6 k j: _+ p5 F% c4 o. q" U4 @) O
xor ax,ax. B$ G) I: O, ]0 T% P, [
mov es,ax5 N* t& G/ h% O2 x( j7 ~
mov bx, cs- L% A+ G1 H4 P
lea dx, int41handler' y0 o3 X" X. E
xchg dx, es:[41h*4]3 Y( K8 j$ h! {7 l% n
xchg bx, es:[41h*4+2]
/ { M& @. i+ ] _" i3 p/ \# G in al, 40h
$ }& n0 R, p5 ~ xor cx,cx, N( e: x$ f7 m( M$ x" f
int 41h, }* M. J% N/ d$ y8 n
xchg dx, es:[41h*4]
5 L7 S( }5 d! F xchg bx, es:[41h*4+2]
8 H- e4 E# i' Q* y' e cmp cl,al
% g G: z9 s- C j! u jnz SoftICE_detected: B, J; ~, V2 r+ ?$ l7 d
$ K) a7 S+ R0 Y8 S
_________________________________________________________________________) E$ C0 X( b$ A5 I' D: v
5 Z9 M! f; @8 d! S# j! p
Method 07
1 Z% c [; V% i2 V. }=========/ \4 v& D, M$ d, A
) ~9 y4 r6 E# nMethod of detection of the WinICE handler in the int68h (V86)- t" m3 ~% L- a n5 D
: n4 L% T1 @9 W8 s a5 _
mov ah,43h
4 N$ b) u ^2 Y int 68h0 d/ g$ G9 N3 m7 u) X6 A# u
cmp ax,0F386h
5 v W. O: c7 W) C" W jz SoftICE_Detected
( w% V1 D7 G x/ y/ p; q: C4 Y2 j1 j* h$ Y3 y; j( [2 n2 r
2 a: r; E* @* b9 _
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
6 R+ c0 R8 }1 O* U: k8 ~0 c2 S, l( N app like this:$ U' l" A z% A+ ?6 [
X2 _' z `! ]) U( D BPX exec_int if ax==68
( o+ |! S1 T" g9 j (function called is located at byte ptr [ebp+1Dh] and client eip is& o/ R5 T3 x( s `! T# k
located at [ebp+48h] for 32Bit apps)2 m9 u& q `- ^3 i
__________________________________________________________________________, i, B8 h* V3 M8 z$ u, e; Q# u
$ K* t7 x% m A( h0 q9 I
& T( q6 o* p8 ?
Method 08" s0 f4 Q$ C; {% ~
=========
+ W4 B- d5 @8 L: `: I2 R
7 U$ S- K# x6 c8 TIt is not a method of detection of SoftICE but a possibility to crash the
' Z7 M; a& U7 ~) }system by intercepting int 01h and int 03h and redirecting them to another1 o! h. {0 g' q" E- D
routine.6 R# z8 c& z% Z, O
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points* u! U% v( b5 `7 M6 n' A- u: z) J
to the new routine to execute (hangs computer...)
3 A: P' ]: N9 J# U9 J7 k; M* p! l$ S; L t( \7 ~* S
mov ah, 25h1 d/ m4 i1 ?/ t( V0 ^
mov al, Int_Number (01h or 03h)
- G2 V# s! T, p/ N mov dx, offset New_Int_Routine. w. a& B. Z( W! J
int 21h
5 v e5 W, x4 n M7 H. f* i& |) ^+ z! m+ \" ^
__________________________________________________________________________% P+ h; G% J+ a, L6 [
7 y' X( a: F6 ~! L1 W
Method 09
9 c7 d) R5 ]5 h7 q" P7 N* K {=========
) F; Q1 L: q4 J( k" I0 n% Y9 E' L) n. ~
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only, a! G1 B: v5 `1 |9 U) [
performed in ring0 (VxD or a ring3 app using the VxdCall)., q9 N; g |" Z
The Get_DDB service is used to determine whether or not a VxD is installed
. P; y. `! J5 G& W. {& U: y5 yfor the specified device and returns a Device Description Block (in ecx) for+ [0 l* B/ e5 s( e" @( B
that device if it is installed.
; ^! ^: k/ F2 r6 M7 o& k7 W) B: ^) ~. ?+ n
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
- h! m9 N& ]4 E) c$ M6 ]% [ mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
) a K5 o F' x7 r9 U+ _$ ^; G VMMCall Get_DDB
9 d0 M* W! U# t3 Z mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed& u: ^3 g( A- \) [- _
; L& q2 q: w- U+ z- O! L
Note as well that you can easily detect this method with SoftICE:2 C6 H# K. {$ D8 S5 x9 C
bpx Get_DDB if ax==0202 || ax==7a5fh; u7 H5 L2 [* U0 V; ^/ }' Y
' ?/ C( B1 z, s: p& v" S# T
__________________________________________________________________________
' v/ S, n. k2 y9 S t# d+ H
1 E8 K6 V$ K2 O# X8 W4 MMethod 10# P, d% S: b# w: r/ ?) B( f. m: r# M0 O
=========/ m% f& V& P8 ]& g0 w( k
7 b" r* l" S5 p# d1 ^5 u
=>Disable or clear breakpoints before using this feature. DO NOT trace with/ a4 m1 _! i" \
SoftICE while the option is enable!!
3 \! N1 ?4 C- z# c& `! x- T, h/ ^2 `: K" _% f3 Z: P9 f! Y
This trick is very efficient:
3 N* u7 l6 z' T' N3 k- l7 mby checking the Debug Registers, you can detect if SoftICE is loaded! G# r1 a N% s3 U9 J# k
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
' O0 ?& Q* I0 X: R7 f& }$ t7 kthere are some memory breakpoints set (dr0 to dr3) simply by reading their
3 O$ v6 ?7 R" n( w! |. C6 m; B" B$ evalue (in ring0 only). Values can be manipulated and or changed as well
5 S8 `. ~, R/ M$ P(clearing BPMs for instance)# [' B. b. C/ P+ h- ~; z2 p
) k1 |6 z, X) I6 j* e; W6 G3 k* B__________________________________________________________________________
" v( ]8 O: g9 N: ^' E O& w5 M9 H. R+ Q
Method 11
* Z2 k4 l' F6 u1 t Y) X7 g+ q" d=========
- ^) N! _! U# o% ~( v# y3 {$ k
- J) E+ d& I {! d. dThis method is most known as 'MeltICE' because it has been freely distributed$ u! k# V/ ^$ M0 l5 A
via www.winfiles.com. However it was first used by NuMega people to allow
. V3 W5 b" h+ u" k qSymbol Loader to check if SoftICE was active or not (the code is located! f; c1 y) x5 C; m& n
inside nmtrans.dll).9 `* I4 X1 ~3 i8 v
/ @1 |% S) Q0 F: X3 eThe way it works is very simple:7 A/ Q+ n) y! j) k$ H
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for: m: [9 K9 H) s8 n4 k
WinNT) with the CreateFileA API.
, a; E% C+ a3 t: M& |$ g6 V- V1 z/ \. V* D. A
Here is a sample (checking for 'SICE'): H) x- `+ F f5 F0 H
n' X' W7 J: ]' v2 YBOOL IsSoftIce95Loaded()! o" b. d# m M5 C
{; B0 p' W& J {) d- D- R
HANDLE hFile; 2 q4 Q# M8 b$ t/ V/ U# |8 z1 u
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
- i4 I) x3 @6 \) ]* C FILE_SHARE_READ | FILE_SHARE_WRITE,2 i! W9 u1 `! @4 F
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);) `1 I V9 e" S0 v* H0 R
if( hFile != INVALID_HANDLE_VALUE )
M! ?+ c' o9 E {
0 p$ O6 V, s" B0 h5 q CloseHandle(hFile);4 a: N$ j- e+ l0 H- t g
return TRUE;/ Z0 [9 U5 v7 I8 f& v: x
}
" P4 o& W" N, [8 ] return FALSE;
( a+ Z. P7 _, _) I) [}" d3 t, F- }! I
7 K( C1 \- k& W: ^ [. P) X
Although this trick calls the CreateFileA function, don't even expect to be
( y9 l% O6 Z( _! D* Qable to intercept it by installing a IFS hook: it will not work, no way!
4 T6 p7 P( `! ~In fact, after the call to CreateFileA it will get through VWIN32 0x001F
0 Y, |2 i6 Y1 \2 w, j6 @: oservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)2 B5 p5 M* q! N
and then browse the DDB list until it find the VxD and its DDB_Control_Proc" F7 t1 Z7 I3 B7 C) L6 u
field.8 K+ F7 k# }. l$ t
In fact, its purpose is not to load/unload VxDs but only to send a
9 n; h- u4 F6 w4 G3 kW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)6 d9 V8 x2 e7 a, j' y" H% c: @
to the VxD Control_Dispatch proc (how the hell a shareware soft could try0 W$ B) \1 U# j Z
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
& m0 r) @, q/ J4 G* EIf the VxD is loaded, it will always clear eax and the Carry flag to allow7 h8 n, v9 y4 I" G8 u/ M% [) [4 e
its handle to be opened and then, will be detected.0 a! Q) P$ V" r7 K
You can check that simply by hooking Winice.exe control proc entry point# b7 S" X5 j+ {" L& M# G: S6 c
while running MeltICE.
1 g3 P2 d2 w4 N# ^
& n3 G* n, a3 h8 |8 m8 c% M" M8 L; x: T
00401067: push 00402025 ; \\.\SICE
4 {4 ], ~. P! i, p- x& F 0040106C: call CreateFileA) Q/ r* Q$ f: Z" k' t! K2 O X/ b
00401071: cmp eax,-001% x. q+ h/ v. c4 A9 r- F# @/ V+ z. l
00401074: je 00401091
8 ^ L* E- v t4 O Q" b# f. `& z; g$ b2 Q- R B
/ n* F: \, f( g# f$ ~7 m1 g! o
There could be hundreds of BPX you could use to detect this trick.
& z2 Q- P: d' w" _9 Z: l" m8 c-The most classical one is:
? ~! l, U( s8 a0 a BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||" [- H5 w9 i. ^6 s: s
*(esp->4+4)=='NTIC'3 t* T4 a$ d* r, S' Y9 Q
7 z2 R- L$ v% [" F; J-The most exotic ones (could be very slooooow :-(
! E4 r" `3 q- M4 |) M) v0 T4 ? BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') $ L w- _6 w1 K, {. ?% v! R
;will break 3 times :-(
6 i( n, V7 q2 m! m" w2 j( h$ f
) W3 `3 Z0 y( @) n-or (a bit) faster: 3 _+ _! X! {( V
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')* r: D/ O5 u5 k6 w$ h1 r
$ I5 h [) t, ]. H& P
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
0 {, o/ T/ b9 ~- I- x7 j5 ] ;will break 3 times :-(
! E3 E w! d! ^! y
6 g4 v6 t: `" h+ I6 O-Much faster:
, t! u! V! x6 P3 d BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
% O. J+ T# v4 P5 A0 Y5 k$ A
- ]1 }; c u I, K" k1 ~' W/ `Note also that some programs (like AZPR3.00) use de old 16-bit _lopen* ?4 C5 @1 q+ [# E# @" n
function to do the same job:, k+ f% t0 u" l" ]6 }
9 @: c( r6 Y2 G5 P1 `
push 00 ; OF_READ
) [/ R+ R2 i. @9 o0 [7 ` mov eax,[00656634] ; '\\.\SICE',0
4 a! S; I4 C2 B push eax0 w( P$ U4 `4 G; s
call KERNEL32!_lopen
' t G; x2 d" W7 h8 F% {" m1 A( U5 W: t inc eax. H0 n" r" I6 O! \6 Y w- p
jnz 00650589 ; detected4 z+ v+ h" J0 r" Q: p
push 00 ; OF_READ
; ^$ j- k! ]% e* H/ f% E mov eax,[00656638] ; '\\.\SICE'
& Z5 }3 V% k. T; p5 Z push eax
8 \2 D$ i4 P# l" t call KERNEL32!_lopen5 E9 a$ p: t* b6 `: h& m. `
inc eax5 z- E9 L$ n+ B0 Z# `$ K
jz 006505ae ; not detected- B0 I: a" _, V. U
$ j8 B6 x* f8 C* [( t6 _3 D0 ^- H% p( G, x6 R2 U) c$ u
__________________________________________________________________________
& V, ^8 V* e/ g8 Y+ O# p) G9 X9 t& X9 u
Method 12. @0 l% T. x, z9 }
=========- v+ _+ r3 ^6 r
5 [, X1 N1 L- F: AThis trick is similar to int41h/4fh Debugger installation check (code 05
+ R8 @0 m; F( \& 06) but very limited because it's only available for Win95/98 (not NT)
, R1 q$ C! _& h; y" ias it uses the VxDCall backdoor. This detection was found in Bleem Demo.' W {/ x* { u' F8 k
; @( x. b( O3 p: \ push 0000004fh ; function 4fh
- f; F+ r; _$ e* [6 X/ W3 d: }0 X push 002a002ah ; high word specifies which VxD (VWIN32)
! Z p ]! ~2 A) a+ h ; low word specifies which service
; L7 S4 l" F& b (VWIN32_Int41Dispatch)$ d; V# L; i/ H" l! V4 j7 B
call Kernel32!ORD_001 ; VxdCall6 |6 Q5 E7 S' Y- `
cmp ax, 0f386h ; magic number returned by system debuggers
0 I9 H" j2 w7 @) m jz SoftICE_detected
" U" }7 x- R8 C% \) E q) V
/ c! j: H1 v n, f' hHere again, several ways to detect it:
( P5 P n& }0 N9 M! A6 w- Y
8 d6 _1 E* s& L8 n* _$ r# ~+ D BPINT 41 if ax==4f
# |+ O. \2 N! C8 j6 b' `: g2 ?0 `) i9 N8 g
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
/ y3 C- |) W- k y; W G
) j" L! A+ |1 x! U3 n9 @2 v BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A; v& A, t, A8 J0 z: B
9 T5 p$ R* G" f: u! I( s
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
3 S4 p# h) R% u+ a& i8 P5 y0 `1 O
2 H/ A; f7 u" V W8 z5 |9 h# \__________________________________________________________________________, J9 e& t+ k5 E% y G$ _, c
3 k) Y9 S$ U$ _# I# P" v: IMethod 13- h9 j9 \# x" i/ m5 G4 f
=========, g9 i. J9 j4 y2 b4 m0 h$ l
: c; o9 M8 e9 K7 k: W8 ?; m6 u/ J; WNot a real method of detection, but a good way to know if SoftICE is
) q- `! L# T1 Cinstalled on a computer and to locate its installation directory." [5 |8 w0 L4 }
It is used by few softs which access the following registry keys (usually #2) :2 I+ u! ~: u2 y2 X
! E; q3 Q3 _% ]) G* I7 U' s-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
' E) L! V7 S( p( ~" |4 T\Uninstall\SoftICE3 g7 |) j9 X1 b( v0 ]9 {- Q
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
3 q5 i5 V! L0 z; X9 n! F4 V! t-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion! P! @. Q3 b+ N( K) J u6 e2 ?. A
\App Paths\Loader32.Exe
' A' M" g5 r, k# D9 n8 y& I% c/ o3 S O( R( m
A* j9 M8 ~; P( BNote that some nasty apps could then erase all files from SoftICE directory7 o8 ^% R1 S2 D/ f4 u6 Q+ S
(I faced that once :-(/ p* y6 m: m7 { x0 w( E
9 e# y1 \0 w$ I9 ^* i' M+ {Useful breakpoint to detect it:
0 y5 } |: a6 k9 e! U' m) O4 v2 W( D0 B. |2 ^% V r
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
4 R$ ^2 b7 G$ v7 V: K) G
& i7 N, f4 u+ K$ A- L- O9 R__________________________________________________________________________
0 ^/ d+ C6 L8 q! H1 G
0 n( d+ n' a1 l
1 i+ G9 O2 }& K7 M4 XMethod 14
- d3 [8 `* u- A6 p! q. M, Q( q=========
. C5 F' E1 O- d, F1 H6 Z) ~6 i1 ~% Q" U7 i3 C0 G& m
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
2 G* X( H+ y6 W% M5 }is to determines whether a debugger is running on your system (ring0 only).
- N0 I( O* b2 Q: o
0 m: Z. o( g5 D4 C( o* w VMMCall Test_Debug_Installed
- g0 `* [, h2 ?6 I4 j je not_installed
3 H4 s% S2 u! L5 k! \
6 X" R, `& t2 g8 g( _# ?This service just checks a flag.( q) t7 L0 i! x8 v
</PRE></TD></TR></TBODY></TABLE> |