<TABLE width=500>2 N j% s& \% ]9 [) H7 E3 g
<TBODY>2 n# [- ^, S, c2 g. j" G
<TR>
; q. K1 n# n! m" ~3 w) N) D O<TD><PRE>Method 01 . Q" {9 h7 G/ z# L
=========
; R& X/ v2 h, g1 \$ p
) O+ n; J2 L' f" H% Q9 @" Y. K( vThis method of detection of SoftICE (as well as the following one) is
( H% ^# L: I; O( }+ |. pused by the majority of packers/encryptors found on Internet., V9 G4 U8 ~$ z3 { Y
It seeks the signature of BoundsChecker in SoftICE5 A) C& b6 D6 p7 E/ s
) `2 M; q3 A: c1 U2 }, Q4 P
mov ebp, 04243484Bh ; 'BCHK'
$ L& Y3 _0 B. M/ Z6 _ mov ax, 04h
2 j& Q+ C+ j# Q* m; H# p int 3
$ Y# k( {" z6 z* h$ s( g, k5 d cmp al,4) x* j9 W: q) D2 Z; w& g
jnz SoftICE_Detected
* }/ p1 X5 Y3 K
; e) _' b7 S# x! ~7 r4 L___________________________________________________________________________1 ]6 r( ]& a7 j
7 Z" e9 m( n3 }
Method 02
9 c2 `0 Y& y3 }! I! k& z# h=========) n/ I5 @3 r; P. D0 t- n+ y
% Q, N2 |- k3 \% q4 J# ~& O1 P0 a! cStill a method very much used (perhaps the most frequent one). It is used2 \! L7 R" w/ ~" u! }4 h
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
1 F# [4 S% n7 x/ a) u/ d; [or execute SoftICE commands...
) D8 f- T3 n% ]7 x0 t C. `" Q* fIt is also used to crash SoftICE and to force it to execute any commands
- d# b- E. d) l(HBOOT...) :-(( 4 q- s' d! s; W" C$ k, q) {
+ r( v# S& o0 j3 E, a+ p8 ^
Here is a quick description:
; G: B) ?8 b q7 o-AX = 0910h (Display string in SIce windows)
4 V' b4 g% G6 { _8 M-AX = 0911h (Execute SIce commands -command is displayed is ds:dx) U# J6 [, `% z/ @# o; m |
-AX = 0912h (Get breakpoint infos)' d3 B" [- W+ W( P8 R! |+ v* |0 T3 S
-AX = 0913h (Set Sice breakpoints)
7 O, f( r& b: v8 I-AX = 0914h (Remove SIce breakoints)
2 X! r1 K/ b- Y: S A& X# \' D5 A
$ K& x7 E5 g/ fEach time you'll meet this trick, you'll see:, _" l- t6 t- N7 ` L
-SI = 4647h. f- @* a# F! j' ?+ V( K
-DI = 4A4Dh, g4 n9 l I+ B0 x1 A( t+ Q: ^, a
Which are the 'magic values' used by SoftIce.: T7 F- a4 f' F) N _6 N
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
# Q/ o$ j% [8 ?) u0 v
: @8 G h* H4 t. c5 UHere is one example from the file "Haspinst.exe" which is the dongle HASP5 N# ~5 I! T! ~6 _' w
Envelope utility use to protect DOS applications:
2 o- m, F" K% r. P+ L3 r9 X& Q+ Z. G: f' I, m) A
9 S; l# f M- Q" ^) `
4C19:0095 MOV AX,0911 ; execute command.8 k, V, b- V7 n( }
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).) b# \5 m$ T; M* v' W
4C19:009A MOV SI,4647 ; 1st magic value.
3 o ^, U7 M1 z4C19:009D MOV DI,4A4D ; 2nd magic value.+ k7 p( C, |; j; ~+ g0 `
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)6 j: P% A9 b P1 x8 S& U% c
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
5 j2 ], @, J& u/ a4C19:00A4 INC CX
1 X+ a/ t! h- H1 O5 ^; P+ `4C19:00A5 CMP CX,06 ; Repeat 6 times to execute7 T3 q& o6 C* T# K
4C19:00A8 JB 0095 ; 6 different commands./ Y) G6 T6 C: K5 v
4C19:00AA JMP 0002 ; Bad_Guy jmp back.8 j( l/ T/ x. w& T3 C8 l. |; t
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)4 I: u) D) c$ P5 c( J ^
/ C z8 t: k5 K9 `3 N0 p
The program will execute 6 different SIce commands located at ds:dx, which8 N5 c+ A6 ^, t- q8 F4 m0 A
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
9 A# m: A* X; p" | p: G$ q, d2 o5 ]4 c# @% N
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
( K& Z& f4 t, q8 b7 @, i( [* b___________________________________________________________________________$ e( _: [8 F6 R+ d( i* Z9 E
8 @* |- J- U# Z3 |" E0 R
: n9 b' x. w+ ?6 s- H( {/ N bMethod 03
4 r; s4 {. e' {- H% H8 W=========
" u b0 \& `0 d" y( ? N+ k9 o
. R. D9 }3 A+ |' {( h7 gLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
, }- n+ ^& M/ j4 D0 G(API Get entry point)* {* c7 P3 P `
/ w) d! x! _$ z" p6 d1 g/ }9 Q8 y7 v" U1 k5 q3 x3 {: \
xor di,di
0 `) S7 u) g# N9 ?; [4 _/ B mov es,di2 z; I0 g, H9 _, b% X$ b7 s) _
mov ax, 1684h
3 g% v8 _; D4 K4 l U# }7 u: @3 V mov bx, 0202h ; VxD ID of winice3 V6 l% u. `8 | C( W, b
int 2Fh; H1 u9 |/ c7 B/ f2 s
mov ax, es ; ES:DI -> VxD API entry point. \. W, B; ?( L7 ^9 m
add ax, di% K$ g7 F# s; Z' V, J
test ax,ax
* L8 p, U3 b. |0 Q" m( U jnz SoftICE_Detected* o8 a8 N* P# y
/ A; e& d* e, ^, O8 b% U8 s___________________________________________________________________________ n; h! ^% n6 S _6 R2 T: p f
$ T1 `6 A' P8 u) iMethod 04
* [) R& z4 T6 B& I4 {=========5 r* p5 u, E. D& J/ V& \ I
0 n+ ^ Y8 F! y% {) m. ~' BMethod identical to the preceding one except that it seeks the ID of SoftICE
1 j$ M6 O) S6 N" eGFX VxD.
% S% u# ]) ?7 H4 o
- E: K! K3 {/ X+ B: S xor di,di
; ^' z9 ?& U8 W! ?7 ^" a mov es,di( u$ e! y& K; a3 r$ q! H1 k. H
mov ax, 1684h ; Y1 e9 ^4 `$ X
mov bx, 7a5Fh ; VxD ID of SIWVID; D" v# d; X' }. U+ y: T9 l
int 2fh
. G' n7 w' A: r' S/ x1 c7 } mov ax, es ; ES:DI -> VxD API entry point
9 S- C; G5 S% N add ax, di
& P* ~! d5 G3 Y1 _9 {/ K1 `! z' h test ax,ax
/ P Q& t# G2 l1 g0 f jnz SoftICE_Detected, z* P- v5 }' @) a- K
5 j2 C0 V; b" T& h8 C__________________________________________________________________________
; {1 g3 u8 R, A
) P M$ e% X: l
0 n c9 K" l9 `, QMethod 05# y" |* N- L3 |; @2 y G. P' Y6 z
=========
2 n$ t2 E$ a+ n* L Q4 Y' i- m" R
3 f& h, H v2 d: v% \# [; ?Method seeking the 'magic number' 0F386h returned (in ax) by all system
( K9 l+ B6 v4 v& }7 f" _debugger. It calls the int 41h, function 4Fh./ t' K5 Y( y% K. }
There are several alternatives.
& V) e& [2 ^3 A9 \( F& p$ d5 [# X0 ?- a
The following one is the simplest:# q) [5 z! B. L7 r
8 n1 w# {8 {1 ^0 i$ G+ M8 o mov ax,4fh1 C1 A$ ^* R4 O) Q
int 41h
2 ]0 C! U/ {. `- F3 w cmp ax, 0F386+ @3 Y$ O$ d/ g" K
jz SoftICE_detected" m- @/ z" `5 S# P W1 ~
: _. t6 R. [/ a% g" c5 z
0 W& y4 m% s o* HNext method as well as the following one are 2 examples from Stone's % X1 }2 u" c8 u' B
"stn-wid.zip" (www.cracking.net):
) a( _, T4 K+ u, t3 e
1 f; `4 j% x/ F6 u$ i! w9 Z mov bx, cs: ~4 r. F. N( p2 P5 q
lea dx, int41handler2
- ]8 d( D+ G R6 E% ]" } xchg dx, es:[41h*4]% Y& K5 @1 p% q1 J/ O
xchg bx, es:[41h*4+2]/ c% Q; a" B0 @9 A" l, ]
mov ax,4fh
; {- i1 w; H. ~& G9 L int 41h
9 f8 \& i5 R% ?& p7 X xchg dx, es:[41h*4]
6 B8 E8 F9 F6 r7 I" p+ m v xchg bx, es:[41h*4+2]- f& N( b/ H) p
cmp ax, 0f386h) r) X8 r5 ^9 N8 I8 V+ V* A
jz SoftICE_detected1 {, M. s; V7 l2 J- Z0 S: o- F6 R$ e
# J& m' l$ z2 u: F9 `int41handler2 PROC/ L' D1 l( _6 y% t0 [- u; Z4 B3 ~
iret
+ P4 N0 S- y/ Y1 z) mint41handler2 ENDP$ {) ?4 B$ n; x
" Q% ?' Q- W& i) W' V( f
3 A9 d1 y1 I ?' j x_________________________________________________________________________
% K) {8 B% d0 F4 V# B9 `9 l" l7 [! A
, K/ J$ x( h* r, _% E: l5 R
# }9 Z% J% F8 UMethod 06- q$ o" L+ Y p9 t+ z$ ^1 O
=========
7 y! H/ Z! V1 R( c% w
1 d" Z: w6 K1 U- F3 Q6 N
+ k+ Q' s' S$ s! X2 F1 D2nd method similar to the preceding one but more difficult to detect:% V# U+ v6 i: F4 t8 t" z
2 `+ @$ r( `$ G9 P4 O4 B, v
* l- H5 R% j9 c6 A" tint41handler PROC
% O* Q% p$ s0 ?% I8 G mov cl,al
f7 i! \- j4 @- y3 p iret
! ?) W( O- }$ y& r% B) o; |int41handler ENDP
' w4 \* C# s! w" v
" f- ^7 r& r' _2 O5 H# c) R9 l9 H. \, j+ W
xor ax,ax7 E% H4 j) `/ A- p) y9 i' C
mov es,ax: C. W6 a# S& x8 P
mov bx, cs
$ ]' D Q- w! T+ f lea dx, int41handler8 A6 ?( @" H: J" H7 t/ X, X& X7 T
xchg dx, es:[41h*4]- M6 m G- [$ G; S6 a1 O
xchg bx, es:[41h*4+2]) i4 g% [. Y0 O, k- T \7 S
in al, 40h* V" K: S& b$ ^
xor cx,cx0 b; {! p9 l" q+ P# |) c1 Y; M
int 41h- {- E6 B2 o( H! |' O
xchg dx, es:[41h*4]
6 a# Z+ G2 P) U/ o xchg bx, es:[41h*4+2]
) K2 l/ S/ L' n& p7 g1 Z G cmp cl,al# c2 {" I' U B0 @% q
jnz SoftICE_detected5 y, Z9 ~6 \* F- K- Y& Z: E
' g# N z+ p' X8 K
_________________________________________________________________________6 \1 q0 M+ K& Q
; i5 O E0 x G0 ?; I8 N6 G% k. v3 a
Method 07- D+ t4 i4 G V. @7 w
=========
( S; b0 G( X! y) m' V' z4 b7 T# \/ _! M! d
Method of detection of the WinICE handler in the int68h (V86)
4 J- u1 E# p8 N% p, C! o- s. J5 l
mov ah,43h
# P* b2 J8 Q( D i1 Y$ \& m0 f int 68h" Y- c) T8 p$ W x( h
cmp ax,0F386h
# O1 f8 p& ]$ ^8 U jz SoftICE_Detected% b; o/ W/ p2 Q) @ o
2 s! b; Z* \* I$ Y; w4 c8 F
' j8 |( I# ^: q# t+ {1 @5 O: ^=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit* C0 Z, j$ H' ?0 ?
app like this:
* U5 `' k6 [/ c- t
, g4 ]5 h6 ^; e+ V( b, o! b, Z+ ] BPX exec_int if ax==688 @# I8 P$ d( ]) n8 J
(function called is located at byte ptr [ebp+1Dh] and client eip is* F. Y0 q) ]; v0 `6 h4 u8 M5 y
located at [ebp+48h] for 32Bit apps)3 k0 ~" E; N Z: w& P! f
__________________________________________________________________________
, v+ [% s$ a9 [2 |; j
1 T8 l; Z, M2 } a( N: r5 b# q( Y4 ^ B4 q3 r5 O1 |- N
Method 08' G0 J2 O3 S% I2 y
=========5 Z4 r; P) c; ]. o
" |, H1 i2 S6 |" sIt is not a method of detection of SoftICE but a possibility to crash the) v& h, a" C0 P
system by intercepting int 01h and int 03h and redirecting them to another1 n a; [, j; S+ j6 S' t) F- t
routine.# O7 G3 h3 H, t" \7 ]
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
- X8 `2 |. r M' s# Ito the new routine to execute (hangs computer...)
# T( K6 e6 k, O( J
8 o! |9 R, T9 g5 O mov ah, 25h
& B; V- e% i7 u; M" i mov al, Int_Number (01h or 03h)
. n( V R/ R$ I( f& Y2 j mov dx, offset New_Int_Routine' H! x+ I% |7 P) u3 L; l0 Y
int 21h2 h1 X; o: E0 S
1 p) T9 @( s/ f2 Z& c/ d
__________________________________________________________________________' z; z! N: F" J
- }% a4 K' _/ `% h2 w0 o ~: GMethod 090 B. E( w/ v+ s \! O9 n% | z
=========" h1 L6 _& x( g' C* B
$ l- T- D; m7 p' r8 ^" d" c$ hThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
5 o g- o3 P4 Lperformed in ring0 (VxD or a ring3 app using the VxdCall)./ n- Q' T; o" C# y
The Get_DDB service is used to determine whether or not a VxD is installed' N, q3 G% M; N/ W8 v+ b
for the specified device and returns a Device Description Block (in ecx) for( s+ k6 B. q. E$ H; C
that device if it is installed.
; Q5 |' Q. \, a0 q4 a/ g' D$ ~; Q8 c: J
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
0 }: B& R. u1 b! g mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)# o: S+ I% D- d* Y% o
VMMCall Get_DDB4 v6 I# a" F: [! ^; J
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
$ Z/ q. `* A4 h; w( ]8 d. A+ ?6 W8 k, G
Note as well that you can easily detect this method with SoftICE:
0 f/ q% a2 v) a- K bpx Get_DDB if ax==0202 || ax==7a5fh
" a1 Z# E& d0 V, j4 \- J' `9 W& V
l& i% ]3 q: t7 t__________________________________________________________________________
. s5 [( `. o0 v7 r& F' J, }! r) Y; Q+ L
Method 10
/ P8 d: L" u$ W" ?9 @=========: Z7 a# A4 N1 j1 Z
0 C! D, n- g2 |5 O6 L7 u=>Disable or clear breakpoints before using this feature. DO NOT trace with9 p" u% R, z8 x+ }4 A
SoftICE while the option is enable!!4 c+ N4 o& _0 p' |
5 A. B2 Y" R! w! dThis trick is very efficient:
, q6 x5 ?9 P6 L" V/ H5 O' a; Lby checking the Debug Registers, you can detect if SoftICE is loaded2 G3 J6 y4 U2 U" l, n, S: P
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if, Y0 g! u7 G9 G3 R
there are some memory breakpoints set (dr0 to dr3) simply by reading their6 t& }+ m# f: _
value (in ring0 only). Values can be manipulated and or changed as well2 F2 [: z8 E$ b ~0 j8 c
(clearing BPMs for instance)( }8 R2 N8 V. b8 S6 ]
# q3 w0 f, D1 k
__________________________________________________________________________0 s: U i3 p1 H. F. S
) b" L3 Y, V$ _% h7 O2 eMethod 11
" S3 p3 X+ s# Z2 f: b8 k; l=========
7 r- b8 T1 p1 _0 L" c& {' D( v7 z* W* M6 s( i
This method is most known as 'MeltICE' because it has been freely distributed
3 W8 H4 c9 q$ @: e$ ovia www.winfiles.com. However it was first used by NuMega people to allow# b/ y9 L b( Y6 Y$ H; a( N* K7 x
Symbol Loader to check if SoftICE was active or not (the code is located
) \3 S6 W) ?4 Q: y3 ninside nmtrans.dll).. @2 f+ w; j5 v( A8 T
$ G) F! R9 n; Y( a9 O: b
The way it works is very simple:' g3 @. O, \! I7 K4 N- L
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
$ Z2 Q2 y+ e9 R$ uWinNT) with the CreateFileA API.
# k E0 a: ], j# z, N3 x9 }8 Q j% [8 s' y& ~' b4 s( [# x
Here is a sample (checking for 'SICE'):
# F6 ^0 s. P" S' s0 c
7 |( K0 Y$ ~' v1 D$ e% RBOOL IsSoftIce95Loaded(); W0 L7 C- n8 d& F2 N6 O( ^
{* H) r% [; N7 p9 W6 Z' N t8 X
HANDLE hFile; ( D8 M$ |- U3 T, J, q" K& Q; P
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
& A0 E9 V: v7 v FILE_SHARE_READ | FILE_SHARE_WRITE,
) ], c# U8 _* K0 z) ~2 Z1 s NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
$ v% Q& e5 t5 H, d( |# \ if( hFile != INVALID_HANDLE_VALUE )
/ \5 n2 g9 Q- r* N" k' ~ {
5 `' X! I- C4 I- c# `2 l CloseHandle(hFile);
. B: N( j+ X4 U return TRUE;
4 a/ [7 K8 P$ L$ U- S- W }' k3 s; S6 [" Y6 x/ [+ m3 S5 I
return FALSE;
3 M# V$ A! g, s! J/ q* h}
# u/ x% d; y. i4 p9 O
* U6 s% M6 M& ~Although this trick calls the CreateFileA function, don't even expect to be/ y( d5 q2 r2 t/ y$ ?
able to intercept it by installing a IFS hook: it will not work, no way!
3 v2 p6 V1 u6 {4 d# z# E2 lIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
, ?3 P. H( ~/ j& h yservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)5 s$ a+ ?6 e) D& c0 ^' D: s
and then browse the DDB list until it find the VxD and its DDB_Control_Proc, K4 G) f) j/ [
field.7 |9 P1 ]" s2 `2 |) {: s
In fact, its purpose is not to load/unload VxDs but only to send a
5 i6 _& F5 E3 A- XW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE); Y1 {0 Y6 O1 T# J+ ^8 n/ Q
to the VxD Control_Dispatch proc (how the hell a shareware soft could try' N* d2 c2 _6 @) X* B1 L- K
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
$ S$ m( v3 J* I* OIf the VxD is loaded, it will always clear eax and the Carry flag to allow |: v. J- l/ ~0 W8 N3 c; n8 q
its handle to be opened and then, will be detected.% M4 |; |% N" R+ V- q
You can check that simply by hooking Winice.exe control proc entry point9 U! }) X9 ]) ^' Z- G
while running MeltICE.
& Q: S, r2 w* s- e& t# C
8 \6 d. T N2 [" ~- z
/ e0 X: s/ ~. x; V, c# M 00401067: push 00402025 ; \\.\SICE
- @3 p/ m$ Q4 u5 H/ {5 S) Z 0040106C: call CreateFileA
6 h `7 c; O1 r" ~4 k; k% y 00401071: cmp eax,-001& n9 B. w) s7 I0 J" t
00401074: je 00401091
N$ E/ r6 M8 N" P I8 ^
0 K: z6 f |* R4 F' }2 m
: N) M: s; u2 t0 X2 k, ]There could be hundreds of BPX you could use to detect this trick.6 S1 M3 Y# W0 O R
-The most classical one is:
, A3 K2 g' @: E1 Z% ?+ [ BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
2 V" T+ R& A I *(esp->4+4)=='NTIC'
2 S; I- |3 g$ D' r+ g* ?" D$ c# E/ N0 T2 n
-The most exotic ones (could be very slooooow :-(8 e. K) F0 H j [
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 5 `' N/ V r: E5 }; ~
;will break 3 times :-(/ M4 @& ~. v- e3 r9 ?3 N
8 o* V: e1 ?/ P! I( V
-or (a bit) faster: , M3 a! \2 \ X+ x: n$ W
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')2 G% x* I2 t6 `: T( B
, P# w1 T: n0 ^- v: L BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' ) d( O0 r- I9 O Q, t* I4 q# w8 O8 }' v
;will break 3 times :-(% ^' p" @+ K( A* ], ~
0 w( B: H$ j; z1 Y! Z: b6 n-Much faster:
0 A0 D, R0 X* Q. ?, H' P* Z BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'" k( \# W- o- q% ~" F) Z1 |3 \2 G1 b) G
$ h% [! s4 }4 \' u" m, K/ bNote also that some programs (like AZPR3.00) use de old 16-bit _lopen# x2 Q' w; i( L* V# ~
function to do the same job:, ?; i0 ]. K. H9 o" E0 M8 L( a
+ i! z! M) s' ^7 Z \) o push 00 ; OF_READ: f% |6 k# {- Y9 L( |' M" t6 c9 A
mov eax,[00656634] ; '\\.\SICE',0
* S' h/ n' P0 N& Y push eax
' t* v+ l$ U7 p1 K2 g7 H call KERNEL32!_lopen& _& `/ ?! o6 ?; J5 S8 m! s- z
inc eax( D! U/ \: z) @" a1 Q" b2 B. A
jnz 00650589 ; detected
: E1 s/ t( y2 G push 00 ; OF_READ7 G! k5 n3 Y" F9 W4 G" ^& G
mov eax,[00656638] ; '\\.\SICE'
2 e+ E% l5 x! T) X push eax
$ b* ]+ P N E2 d5 X call KERNEL32!_lopen4 G4 h3 k) b4 G* C! x. J7 y: A
inc eax
+ J: s3 y: I% r; `+ { jz 006505ae ; not detected
* j9 A1 X# d t- D3 G: Q9 s( U3 Q9 t# f% O3 e' x5 y3 {5 [) H
2 x- L: X+ D& } l z
__________________________________________________________________________
2 q! }: n7 X3 [# d$ b" Y& i4 x# [6 |& P1 j1 j
Method 12- f3 h2 v8 r: s
=========5 A, B( v9 B2 \4 d% _* f
" J% A! L& Z) T Y) l" |
This trick is similar to int41h/4fh Debugger installation check (code 05
5 x& ^9 I% S. z: j& 06) but very limited because it's only available for Win95/98 (not NT)! N* E) z8 x" T& S2 z
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.. B0 J" J0 \/ g x, ]
+ v, n# E& N- r9 J0 m ]; s
push 0000004fh ; function 4fh
3 R+ w7 z! w- Z( x push 002a002ah ; high word specifies which VxD (VWIN32)
- f! J' `3 E+ r( g% _' T- z; O ; low word specifies which service5 `: u/ b( ~1 f. g1 r1 }
(VWIN32_Int41Dispatch). V8 d) W8 e" |& K* o
call Kernel32!ORD_001 ; VxdCall
. n& ]" r, j @% V1 Y cmp ax, 0f386h ; magic number returned by system debuggers( m0 }1 A8 e9 E- M& O5 P; q/ [2 L" L1 r
jz SoftICE_detected m: I) B4 w( X2 i; d- t$ ^; L
N/ _1 r2 f l* Z; @' q; f F$ Z
Here again, several ways to detect it:, r0 a, Z* Z/ Q: B
% X: `3 s. _3 u/ r
BPINT 41 if ax==4f" P& X v& W: W+ `4 w, s
9 z8 C" Y1 J& z
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one. d# H; V. G8 U0 p
3 P' E9 b9 { L1 e) f* w ~2 M# J BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
) h4 E* H5 u" e7 s- {% J K0 g* f+ g" j
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!6 ]$ J" ^2 @" w$ d3 ?
6 H& G, ^8 p+ X2 o" c
__________________________________________________________________________
) Q# l+ i2 b7 l1 x) v* m
! t% J: h# S$ |" @; v2 ]7 |Method 135 u& c) O7 u' N! i% v
=========
1 F! Q: m# q4 T% a) J/ b4 i: T+ F. H7 F$ t: r. ~; k% l
Not a real method of detection, but a good way to know if SoftICE is% R5 D0 }+ L7 _; z# b
installed on a computer and to locate its installation directory.
, `. ^' N' k; q* ~. [It is used by few softs which access the following registry keys (usually #2) :& V5 _8 P+ w+ x! ?* z* b0 z' L
. @- [* h" F$ @-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion- l* N" R7 b" j
\Uninstall\SoftICE
7 R4 T' l" r+ o d% ~2 \-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
- W ] v" X; X+ Z-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
4 X% @. J+ i2 p/ n2 [\App Paths\Loader32.Exe
- Z/ w9 L* D7 {8 |0 C: l( {* |/ Q: M. d8 `# G
3 E# n( G1 J! d4 F1 e) d. F2 y9 bNote that some nasty apps could then erase all files from SoftICE directory, z1 U! @' Y G
(I faced that once :-(; i' j& _ M5 r: ~
2 r2 I5 k7 d" g2 d; YUseful breakpoint to detect it:! ~$ n* i/ q/ X; J- W% C8 m
Q8 c: J4 q, ~) E
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
" Y. _3 b. m( ^, H1 H) l* j! {7 a4 L" s' |: i7 u/ l) Y6 q- {6 H
__________________________________________________________________________" p3 F* p: X/ a n
/ j; \/ s+ D% R+ W3 U8 ^
. n5 M' x( ]/ u F" R9 XMethod 14 2 y9 t- L3 ? Y1 K8 D
=========
* K# V" U8 M e. E
+ u7 c0 h# L$ V# p/ I+ aA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose j* I6 s3 D9 F; b- F& P$ U ?
is to determines whether a debugger is running on your system (ring0 only).
+ g$ A# [& a [$ A# c6 M6 ~. f! w+ Q) H8 j: S
VMMCall Test_Debug_Installed
9 H- q* u( r; |5 f- \- G: K je not_installed
) v9 R+ M u" I
- x1 `3 p7 ~" D7 ^* e7 L AThis service just checks a flag.+ F' b! K9 ?& p$ y2 w
</PRE></TD></TR></TBODY></TABLE> |