<TABLE width=500>
! |6 @& i: g) f* y<TBODY>9 @( B C" m0 K8 d" N8 F: ?8 d3 A
<TR>
/ }" v; E" O4 t0 _6 u<TD><PRE>Method 01
% M' ~1 [ L; }) t$ H4 l=========
n/ S& F; b* A- c2 \! t5 n0 b3 e( z1 e
This method of detection of SoftICE (as well as the following one) is8 m7 E+ J- \# D" `, B% a
used by the majority of packers/encryptors found on Internet.; T% c: _1 y( f* b& x( s2 {3 z9 G
It seeks the signature of BoundsChecker in SoftICE
4 z1 d" ~9 `7 L/ w7 u* g1 N- U0 C/ K% M5 X X0 ^2 q$ I! q
mov ebp, 04243484Bh ; 'BCHK'3 @' H! ] p7 K2 o
mov ax, 04h
& R9 n0 x# y* P; g int 3 , F0 P# p9 y3 x' o
cmp al,4( h( w7 Q; l2 P7 _$ \
jnz SoftICE_Detected2 R* x4 G7 {# N. E& Z& q; R) d
' U! I) z8 s4 i6 y$ c
___________________________________________________________________________/ A( b, D% l; R( @' }: \
$ U) {* [! r- [5 O
Method 02
& v; _* h* R5 t=========
# M' p5 M+ v6 e% F7 }) ~
& n3 V: n7 e& F; hStill a method very much used (perhaps the most frequent one). It is used
' P! R$ m3 s+ i4 v6 {# Cto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
9 P8 y0 T; w. e# yor execute SoftICE commands...
& N0 P+ \- x9 g. I" z$ yIt is also used to crash SoftICE and to force it to execute any commands
! k9 L& p$ {5 n2 j* n9 ^. w1 O( U" }(HBOOT...) :-(( * v* c' E) K! t
9 l6 n- Q2 x: n9 p+ Z
Here is a quick description:$ @8 b$ r! c" H
-AX = 0910h (Display string in SIce windows)
& m1 }& A) ?2 ?' M( ^-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)7 v3 B% M& {9 d% m
-AX = 0912h (Get breakpoint infos)/ U5 ~8 ^4 `2 e2 I1 R, |4 N
-AX = 0913h (Set Sice breakpoints)$ {8 ~# A& g; D0 d- D3 F- T# k1 W+ Q% \
-AX = 0914h (Remove SIce breakoints)
/ R7 r' Z3 b5 e" n Y: D. E( K: ~8 e; z
Each time you'll meet this trick, you'll see:4 H) X7 H/ p2 w
-SI = 4647h
8 N* i. D5 n- {9 ]4 ~-DI = 4A4Dh
# o7 f. w7 }+ B0 SWhich are the 'magic values' used by SoftIce.0 v, M/ J# I7 i5 G! q- ~: ~2 `
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
' ?0 g) v! @7 L' f
" L" q- m6 p+ B$ EHere is one example from the file "Haspinst.exe" which is the dongle HASP' L' s' W2 h O6 I( N( |& u
Envelope utility use to protect DOS applications:
\$ ~% ~9 n) J8 d
4 p# S& F' X; Z% j: F. E
+ F0 b: ^8 j) j4C19:0095 MOV AX,0911 ; execute command.! r: w, @3 Q+ K0 |: ~/ O" H( X9 H
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
" y) q: J! k2 X2 n4C19:009A MOV SI,4647 ; 1st magic value., A9 m- b0 Y, M. S) H6 x
4C19:009D MOV DI,4A4D ; 2nd magic value.
' \9 z! g2 a8 d: m4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*), a9 e9 D9 i6 K" y! E1 _* s
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
8 o s; G6 g5 A: @" O4C19:00A4 INC CX1 _! ~: Q7 p* s2 X
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
y, S0 ^2 Y& @0 Y$ q7 k2 G4C19:00A8 JB 0095 ; 6 different commands.
2 T) ?& K$ a( S& A: i4C19:00AA JMP 0002 ; Bad_Guy jmp back.3 ]2 X9 h0 J" C. [/ G0 p8 }
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)4 R1 J0 A7 N ~* H
: T0 D4 ~4 R) g0 K
The program will execute 6 different SIce commands located at ds:dx, which
0 ~2 C1 l9 j! s+ u: F b" [are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.. |2 {3 V/ V5 ]
; f6 W! Q8 L' ~! E# j* I4 A* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.- M3 ^; w2 Z/ v! ?
___________________________________________________________________________
) u* s% O- J9 Q3 T$ D; Z
4 {2 w' v6 K- U) B3 J! z# F0 q8 _' [+ o. Y: |7 @) F
Method 03
$ i' R( } G3 ~5 L% e* r7 M; }=========
6 x/ b/ M1 C0 i6 M3 O3 m' ]7 l8 v: C5 C
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h! ?5 H1 t) P1 _/ {
(API Get entry point)$ D0 n: ~+ Y8 A4 @, e$ U0 A* D
. E. m% [/ f. z. z8 |) K, ^; U/ ~1 n( H
xor di,di5 Y- h0 k, D$ P, F+ U+ A, I( p( |
mov es,di7 P* ]2 i( ~" F
mov ax, 1684h
7 \$ {7 n9 A5 { mov bx, 0202h ; VxD ID of winice7 G) k$ ]: p8 v# o* }) R! F& s* p0 X
int 2Fh, H/ K7 r7 j9 `1 U
mov ax, es ; ES:DI -> VxD API entry point
! Y/ A" Z- o4 q$ E% L2 m+ P add ax, di
6 W; t5 P. M; a' t$ B4 y, l test ax,ax
! _6 f8 G& m; V% g7 X% x jnz SoftICE_Detected$ y/ V/ @+ p- h+ g1 j3 h$ B7 m5 D+ T0 W
0 C% `0 }' R! U& `+ ____________________________________________________________________________0 c) q+ L7 v, D" y8 X
( @: `# K* ]& X3 l* o' l+ m1 O5 xMethod 048 A6 K! t( n9 d* I3 t N$ h
=========
7 @4 u8 ^, y2 l% l% s3 q' M) a) ^6 M+ A
Method identical to the preceding one except that it seeks the ID of SoftICE4 t9 a0 W$ `7 N" z1 C" D4 m& K6 A
GFX VxD.
' D0 ^9 k" a% B; x, Y
! c( Y$ d) {5 ~/ _/ C" c+ z' O; m xor di,di8 ` A9 }: J8 s3 V; C( R2 Y
mov es,di' O6 K! [7 n& C! t3 H" g f
mov ax, 1684h 4 B' y' {* E; k d
mov bx, 7a5Fh ; VxD ID of SIWVID
' O( r/ @0 s. t8 o+ q1 H. i int 2fh& J. F K5 G0 h4 |
mov ax, es ; ES:DI -> VxD API entry point }# K+ g# M+ o W
add ax, di* ^ T$ q& v, X3 K+ ]
test ax,ax; }3 p0 w. e8 [- ` x+ O9 m7 i
jnz SoftICE_Detected w v+ m1 C2 A' x, P
6 X/ \; ?/ f1 L% ?1 ?
__________________________________________________________________________
( `# b B& i: {! u5 u9 p) `) Q/ ?+ ?4 ? j- u3 ?( Z$ s7 ]
, p( Q/ Q% u+ eMethod 05! c/ R9 I# t4 h' P" I, }9 W% o* v* p
=========# `6 ~) \/ e, [ l$ ?0 ]
: Z& |. y- T2 s( J0 CMethod seeking the 'magic number' 0F386h returned (in ax) by all system
3 T# P; @) k& Odebugger. It calls the int 41h, function 4Fh.# h2 G6 i1 H' t1 D/ H. I3 ]! j
There are several alternatives.
$ `8 F3 L8 K- i2 s# v3 |6 Z9 \- l S3 b$ v& Q1 J) D
The following one is the simplest:
! o' ?& V1 j/ p
m6 h6 L0 F# R+ ]: C mov ax,4fh4 f' V* n, V1 Q
int 41h" q* W* d; ?: \5 E* g! K% G
cmp ax, 0F386
# o2 {0 Q4 d' s. {' v1 Q jz SoftICE_detected
N1 G$ ]- O2 ~7 O q3 i% h# n) q _# e* J
( `1 m7 P8 }* F) R
Next method as well as the following one are 2 examples from Stone's * g2 K/ B+ J& z' {$ T: N
"stn-wid.zip" (www.cracking.net):/ |8 n, W' G0 l2 [$ p4 @ p3 T
' ~. x, E3 J1 `5 W% A3 ~# r9 E, P
mov bx, cs
5 C/ P6 K: n% b, S% B0 Q# O lea dx, int41handler2% \9 k% B% X5 b- M' y0 T2 \9 e
xchg dx, es:[41h*4]
& f+ ]! l& {) p1 z xchg bx, es:[41h*4+2]
; ^. d" C* z1 v mov ax,4fh
9 G5 @( x5 k* M5 K( M int 41h0 s2 _3 Y4 S* z, t2 w
xchg dx, es:[41h*4]
) i: N, i" _) x3 |( A0 L xchg bx, es:[41h*4+2]
; r3 r( k# n' a1 f cmp ax, 0f386h( Q$ b; t, t1 u- m5 S$ o
jz SoftICE_detected* s: w9 Y$ }$ l, m6 X7 A3 E* x& k6 a
7 U; I5 G( N- A- z2 d* X( q1 X9 Tint41handler2 PROC
d2 u( B6 [! S- y( F+ o7 j iret& M% |. p7 m0 x
int41handler2 ENDP
- j% e. B5 r0 G
7 m9 r* r0 |. b$ J% e* B' x8 ]
) s' m3 g5 P& [_________________________________________________________________________& e2 h3 ?" ~& [7 X7 G* i: I( c
0 Y P8 [# Y$ K" T3 |4 M1 T3 y* N
. N/ N9 K( a. V8 PMethod 06
7 ]) d" R% d# J=========3 ^( ? r* P( N' X5 g2 F# {
- l* s! B, l, |( H
8 H; i J2 A" j3 l
2nd method similar to the preceding one but more difficult to detect:1 I* D, V, P9 {9 z$ ?+ o- O/ ]
2 e" M! I' J- f) U
* u$ Y% |- x7 s/ }% c5 K7 n" rint41handler PROC
# U! M7 G0 U7 C mov cl,al8 U; A" d& _7 h/ u% z
iret
7 O; I) A4 E9 s- Xint41handler ENDP ]. U# `: s0 p! y: A' r. ^
- }) v# J4 ~, X$ _) R
, f, p8 t1 |. d; `% B( Y xor ax,ax
: U- u" M: C9 C4 F. T mov es,ax H$ T/ H8 P5 n4 ]0 w& l% S
mov bx, cs" l5 S# m) C( t# n( x
lea dx, int41handler1 j( A$ @+ i4 v( L x% o: j
xchg dx, es:[41h*4]9 V! J# j# u* {. A9 }' [( b* ^
xchg bx, es:[41h*4+2]
& v8 B' o6 |3 x2 P3 R in al, 40h3 u2 i! E# C, s9 b
xor cx,cx
) g `9 P; A" a5 e1 I2 V: z int 41h/ G1 H/ v( C/ S: k$ }: r
xchg dx, es:[41h*4]2 I. i4 L" R$ n9 {
xchg bx, es:[41h*4+2]9 S- m. f" Z8 E3 n2 _
cmp cl,al
- _$ U4 B8 n0 v' w jnz SoftICE_detected; \+ C/ k i! `: a* b6 N: i
/ I$ z) L0 B4 @! N
_________________________________________________________________________( c7 C; b. K* q3 ~2 {
0 J+ V. @! P4 a4 h& CMethod 07
! ~) `# C6 m2 J# Z2 Z: T( Y=========: h4 Q, n6 i7 L0 N1 r
7 ?& d; {$ {8 a3 q
Method of detection of the WinICE handler in the int68h (V86)
2 v3 l( D P+ N% c
" t0 f' O- _0 D+ V/ Q; ?. \8 f |8 g7 K mov ah,43h+ ~) @# K/ e) d/ w
int 68h
. D& U' Q& `0 J5 O0 z0 H+ K cmp ax,0F386h
8 Z5 x( ]0 V7 E8 J; q jz SoftICE_Detected
" t3 A) K* e- D. b6 v( p; v v% l6 h+ S* o* P; G, A
+ Z$ v; O6 D) h( `6 j
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit3 H7 M& U1 o( G
app like this:8 D' [- G! ]' t, w6 L- _ R! k
* f" E2 Q) ~/ B: f' b' Q) z6 h. ?0 p BPX exec_int if ax==684 [+ l i+ ?' [- g- H+ j9 t& H
(function called is located at byte ptr [ebp+1Dh] and client eip is
, } M2 J: o( S# r! B located at [ebp+48h] for 32Bit apps)' C! V9 H' c& j5 ~+ B6 `/ }
__________________________________________________________________________
! e# m& y; E2 b* B0 D* h. c: p9 l$ t0 p) ~, h/ z7 Q
& L( M' z; l% {7 u9 T3 o! B
Method 08
' b, f% _* N: n7 t* `1 ^7 Q=========
2 Y: u! H# Y4 \% e, b" T( M& g; l) q& D- ~9 \+ V. C
It is not a method of detection of SoftICE but a possibility to crash the r/ ~2 u" O* O) a( f
system by intercepting int 01h and int 03h and redirecting them to another! x4 d3 w! p7 G8 s5 q# n D
routine.
7 ~# A+ Z% V4 Q7 c' O( SIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
% {: L- t) n5 F; w1 f; a) Uto the new routine to execute (hangs computer...)
" [/ H' [7 K* H4 d; c5 Y: Z2 f/ z* f5 B# E B2 i
mov ah, 25h2 W/ H( h. G0 f
mov al, Int_Number (01h or 03h)
& c1 G3 H f3 l8 n mov dx, offset New_Int_Routine
n: {- I' V+ d5 G0 I; J2 a5 Q int 21h6 W1 K2 `; ] l# K' h$ i; J
) e% J8 [% k% V% }7 q__________________________________________________________________________; |6 T7 D2 y' O+ \7 X. @$ M7 u! d: t
; Y# {* u) }' f% V; w6 U+ W
Method 09. w0 r& r4 Y/ B9 M6 b) u+ o5 M* ^
=========. A! L; q, Q: l/ @1 ^
, ?' Y1 |- @5 g
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only/ \0 O! w6 `( M# F4 C/ }/ e0 _
performed in ring0 (VxD or a ring3 app using the VxdCall).
3 R# x9 X1 Z( Q& \& x v1 }" a, C VThe Get_DDB service is used to determine whether or not a VxD is installed, h) q5 J& I5 s7 }2 s: A! L- Y
for the specified device and returns a Device Description Block (in ecx) for
/ ]# c9 A, I; k2 F- N' d z4 Fthat device if it is installed.
" w J4 u- H" h' n0 n9 j
- e% M0 J. [2 |' d/ J! l7 m mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
y: O; v& ~/ a: d& j mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
, ?: R! Z; D+ V% ]: c- L+ I VMMCall Get_DDB5 @7 o2 Z, M" j
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
5 F* H8 q' l9 V: x2 _
- {* c( V; {9 I- r* i/ v. G, z9 tNote as well that you can easily detect this method with SoftICE:
6 i" k, G+ F0 y3 e9 D bpx Get_DDB if ax==0202 || ax==7a5fh1 [, S0 E9 Z) v
4 V( J$ ?1 e" ^$ w" j! Z9 l1 M
__________________________________________________________________________
. h$ \7 r0 Y: @- _% @3 t# J/ T0 c) ?( l0 w6 i# T& h% \! P S* U
Method 109 u8 b6 M8 e: d1 B5 e" C* g
=========
[9 o2 C$ Q/ @( }& b R0 m4 E3 x k6 D, Y0 y
=>Disable or clear breakpoints before using this feature. DO NOT trace with
; z6 F6 _7 [5 U3 d SoftICE while the option is enable!!
' A9 ]9 _' i8 _% a" b3 c b/ Y' m' U0 Y; ^ \8 U1 E
This trick is very efficient:
, p% `5 I2 {, b" u* Lby checking the Debug Registers, you can detect if SoftICE is loaded
" {6 I6 g, a+ {; P(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if! c# [) A. Q: }2 N( a
there are some memory breakpoints set (dr0 to dr3) simply by reading their9 ~6 z$ l3 I9 N- b
value (in ring0 only). Values can be manipulated and or changed as well3 \5 B) S4 u6 l6 p
(clearing BPMs for instance)+ `4 o1 f8 f: }
) \, O6 P0 I+ b" l# _6 k$ p1 m/ {__________________________________________________________________________* g. i- d1 m- E% z' G+ x' F
! O7 `- A; e1 b
Method 112 W" f3 @: o/ a& K- n- L
=========' \1 ?) x% A/ T9 j7 q
c1 j* U1 D GThis method is most known as 'MeltICE' because it has been freely distributed
( f! K7 @# D1 Zvia www.winfiles.com. However it was first used by NuMega people to allow: U$ ~) a, N1 X
Symbol Loader to check if SoftICE was active or not (the code is located# J! D' C5 {7 O3 R) x
inside nmtrans.dll).
5 Y o' L4 ?) J* r( S
' g8 {6 a, `+ y! B: qThe way it works is very simple:3 u- T1 i1 J' Y8 m
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
6 g+ V* b) I* i/ U6 qWinNT) with the CreateFileA API.2 u1 h0 l8 W- K" h. g9 |0 ]
- G3 O" Q0 ~8 nHere is a sample (checking for 'SICE'):7 W* J/ R; Z D9 F7 w/ j' C
# C, b" @. p* c( ?- k$ Z$ n
BOOL IsSoftIce95Loaded()1 `- v+ w1 t) H8 R! _" C# H
{, G: c2 G4 l; _
HANDLE hFile; 3 F1 c! d+ Y V, K! C! O$ {
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,. f. k: W7 j1 n8 ^0 j: D1 E
FILE_SHARE_READ | FILE_SHARE_WRITE,
9 B$ N6 }' z" y1 `) Q NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);8 \& E" W9 g' C- P
if( hFile != INVALID_HANDLE_VALUE )) _/ x- m4 `- x e3 F
{% e1 u; u/ f6 a; h9 Y7 U5 v
CloseHandle(hFile);
; O! V- g& N" @8 X C5 W' d return TRUE;
8 P( |/ O! K) S6 [% N! G8 u+ ^3 P1 ~ }: T7 _8 F1 Y: U# v8 U( m' H M# k
return FALSE;
' A/ z2 C$ J# @% ?+ i; D, I} {& W7 u2 C7 d
7 T0 y# C6 H1 cAlthough this trick calls the CreateFileA function, don't even expect to be
3 s' t' k6 \, M# _# Wable to intercept it by installing a IFS hook: it will not work, no way!
/ ?# l+ `" }( ~In fact, after the call to CreateFileA it will get through VWIN32 0x001F
7 \- L* B0 z. o, |5 g0 D3 Jservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)7 x9 s( t1 O: `( M/ G$ [. Q4 D* u; V
and then browse the DDB list until it find the VxD and its DDB_Control_Proc5 I' v. p3 p" C
field.
! ~: j2 W4 J2 L4 U/ ~In fact, its purpose is not to load/unload VxDs but only to send a 1 ^% v% ]$ ^1 H0 U& W9 i
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
% r, d( J# ~& K" kto the VxD Control_Dispatch proc (how the hell a shareware soft could try/ ^- f" T' P1 I/ a* ?$ @1 h
to load/unload a non-dynamically loadable driver such as SoftICE ;-).; _2 e8 s1 z A, Y
If the VxD is loaded, it will always clear eax and the Carry flag to allow' v" Q7 M3 O; N. O
its handle to be opened and then, will be detected.
: [% p0 \4 u( V, r. fYou can check that simply by hooking Winice.exe control proc entry point7 O) ]1 |8 ], v0 x' X' c2 E6 C
while running MeltICE.7 z' t3 `! m1 v+ A. A+ Q& a) s
# L: G" ]. d6 q# B6 [
5 {2 z% k: v- g2 R
00401067: push 00402025 ; \\.\SICE$ L$ f; l9 c! p( ?/ d, V
0040106C: call CreateFileA
$ I) D# Z+ X3 ]4 Z$ o 00401071: cmp eax,-001
- W1 `, L2 [5 c5 H 00401074: je 004010916 a5 @3 E$ ~% g4 d! D
3 f; t2 d1 K2 K# V' H' o
+ I, B( w4 `. I, S9 w9 K( [ g2 UThere could be hundreds of BPX you could use to detect this trick.
/ ?4 A% H; x4 Y7 K$ E-The most classical one is:
. z, V2 r% d N) |+ L. _ BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
! E# ~. d8 V/ Z% v( D" U2 ?. t *(esp->4+4)=='NTIC') V0 ~9 D# T. Y, V* R( d
( V9 Q5 k* E+ i8 K r
-The most exotic ones (could be very slooooow :-(+ s3 @" `4 Z1 L
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
6 r R# E9 _# Z* q1 J* i ;will break 3 times :-(4 o) L; a% O6 _' D% K
* g8 j3 y1 z; T$ [* x5 H; T
-or (a bit) faster: & F8 y6 z# P( ?3 o6 `
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
+ \& q0 H6 d S; g
. u; N" [$ N: K' w! a1 G BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' : q+ [7 a- |- W6 `
;will break 3 times :-(
( V3 W, I% U3 J; Z! o7 G* o
; G9 U5 z9 q) O1 X! {-Much faster:
4 A1 m8 Z4 l1 C/ m( x7 K+ H BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'6 `7 ]+ l1 {. I+ `: m5 u# |
' J# U# o$ [" X+ y
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen# m5 ^& W$ m7 o: M% a. h
function to do the same job:8 r k$ H5 N' C" u. R9 k
8 |3 O" f! P4 ?$ |0 s
push 00 ; OF_READ
7 z! }; s2 \$ W# d) m; B mov eax,[00656634] ; '\\.\SICE',0
d5 C) I2 U3 e( ^* f2 u. P1 n) d& ^9 x push eax/ `" M$ D/ H1 s
call KERNEL32!_lopen
& j) B8 h1 `, r4 U! Y inc eax% [# U, H9 h5 W) w
jnz 00650589 ; detected! s3 l6 t# c! E3 q D
push 00 ; OF_READ
! A. s- a3 }. y0 s mov eax,[00656638] ; '\\.\SICE'9 Y6 F* @8 x2 I& F
push eax
5 g J8 j. x6 P p. A0 Y/ p4 @$ k call KERNEL32!_lopen: t" d' B2 R( h4 l* \
inc eax( P) R4 Y( a% Y# I+ A2 n
jz 006505ae ; not detected+ i3 o" k" W y& z
% X% V5 r" j3 i( m2 t
, } N. ?3 I9 Y# r, R' V1 S
__________________________________________________________________________" G5 E0 ]/ X7 q# T/ b' X
) {3 _ I" z1 l- J& ?2 ~( aMethod 12
" D4 P$ X& T) Z=========( G; x* C( S: H' n. Y
% {0 w4 \4 A) Z) L# M# n( e
This trick is similar to int41h/4fh Debugger installation check (code 05
0 O1 Y. i" T8 F" Y8 w' w3 A& 06) but very limited because it's only available for Win95/98 (not NT)! n% A2 J- c3 k, i
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
& t. ~* M9 o) q/ T: x3 U! N$ y. Q/ o. e
push 0000004fh ; function 4fh
2 [% M% f/ L/ R& \% C+ F push 002a002ah ; high word specifies which VxD (VWIN32)
z$ G. N5 c5 B! Y3 ?% Y ; low word specifies which service
1 J$ r. I( S( k$ a+ C$ c (VWIN32_Int41Dispatch)
" Y& J$ ~. H u# }! d- u call Kernel32!ORD_001 ; VxdCall, D3 y$ M1 F& x) _ M
cmp ax, 0f386h ; magic number returned by system debuggers4 {2 y. i5 H. y$ k
jz SoftICE_detected
; z' x2 C9 _6 V7 s/ u! e6 Z/ r. M8 g+ I2 S S' `
Here again, several ways to detect it:
" f* d5 p G0 @4 U" ?, {! U6 Q* d$ Q0 z& u0 F) C- R
BPINT 41 if ax==4f
" M- w% V, k1 N5 D: O. I Y G4 x5 L h! f
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one" `1 l4 I0 t+ i+ G+ \$ e6 Z
; j- `+ Q, o- Q$ X* ^( L$ Z
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
' Z0 @; N o6 n: G3 q c6 h7 u; ?" q3 c& @: l6 H
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!0 `; d3 t1 ^0 C! Z8 _3 M/ H
( ~1 P; E6 W1 b__________________________________________________________________________
: \) V" N) T& t6 g1 C& U: R S
. m3 M+ L( k. T- j+ U- c! K, JMethod 13& ~/ q) E/ i- a6 H2 f4 U' R
=========
7 i& `: P( Y6 e. ^+ k- w6 J
9 C2 S# d& [' g7 Q. T) a+ v" J4 J6 |Not a real method of detection, but a good way to know if SoftICE is0 Q. K3 i% f3 a; } d' j4 E; r
installed on a computer and to locate its installation directory.
; v) O' F: w @8 @! W+ n1 P! UIt is used by few softs which access the following registry keys (usually #2) :
: j8 ?4 C* ?) |3 }5 Q, N8 H: K( L& X+ Q( y/ G
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
0 Q+ v+ a: y8 \7 o& D\Uninstall\SoftICE" p3 G7 \7 j& }. U! o# i
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
! z I2 Q# B q/ i# V. _-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
. r) b7 J' s; [" y& p: I\App Paths\Loader32.Exe
$ Y: B' u6 u, G5 F. }4 ~ h; z% ]( `# Z1 L; J6 E
1 i- u; w% G% {% G8 @% X( c
Note that some nasty apps could then erase all files from SoftICE directory- I# j- U% @* x& i" J* z
(I faced that once :-(
& K: j* U4 ~4 V1 h$ a- V n- v% z
4 {2 T" D4 n- ]: qUseful breakpoint to detect it:) C8 G4 \# L1 I: z# u
# N2 |; q0 _. l9 z3 a6 x BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'% K. u$ ]. O! L& \& r
' ~2 B' X/ N7 j" G8 b__________________________________________________________________________
5 h- x$ F% q8 S; w \ g1 A. F
$ f& N6 i& D7 }: @4 Z4 l+ a0 e
% z+ d$ U0 O. C0 `Method 14 . n, V0 @5 h! n, z
=========3 i( y, I) ?6 g9 ] _
$ d; f) ?2 F2 M2 }
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
4 [2 ]' v/ ?7 ~is to determines whether a debugger is running on your system (ring0 only).: B6 D0 v( E7 t# `! K
8 T% J7 G: l( v$ z0 y7 `3 y VMMCall Test_Debug_Installed
; h5 ^; q2 R( l$ n2 K je not_installed
5 x; b8 m* L& _- z* z# G8 E% E# M+ ~3 H, o% I
This service just checks a flag.! Y" d% Z) S, }0 R C. D) y
</PRE></TD></TR></TBODY></TABLE> |