<TABLE width=500>
, y; S& O( p e<TBODY>9 r& A3 ^- f A- H, W1 t( h
<TR>; J$ P) f4 J- i0 P3 F0 P5 {
<TD><PRE>Method 01
3 H" y( g% O6 t# J: p) F5 U6 X, J=========7 |% X# m5 K* W9 T- i f
D3 w7 a3 s7 n$ X* I( Y- G- M/ IThis method of detection of SoftICE (as well as the following one) is
. u0 r8 f- h; h8 e$ Zused by the majority of packers/encryptors found on Internet.$ k4 w _5 p2 y) k+ D/ D
It seeks the signature of BoundsChecker in SoftICE% j/ r- I4 L: w, o
3 P( B `( y: \- v; v& y1 Y
mov ebp, 04243484Bh ; 'BCHK'5 f( `! ~; A4 V& w
mov ax, 04h8 m9 P% b+ m! v8 X3 v5 Q/ ^6 H
int 3
3 W% U7 g' `" [' L, L- K2 i# k! ^ cmp al,4- m% ?7 u9 |5 Q1 r3 z& V. \/ [' A
jnz SoftICE_Detected
1 |6 H/ t8 e @
4 i# w- e4 t* k___________________________________________________________________________! `1 {/ j! g- [# W F. l
3 V) i# [- L# V& P6 G5 V
Method 023 |) M: ?# ]( d2 u6 S
=========& H n) `# R" v: j
0 m |' g7 \$ y
Still a method very much used (perhaps the most frequent one). It is used8 t; N, T( w* s8 g3 U/ W8 c6 z
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
' K2 a7 U* D& ` L2 h: J+ por execute SoftICE commands...
i! ~! d. A+ Z7 h9 DIt is also used to crash SoftICE and to force it to execute any commands: ?: T d: C# Y2 A# O3 k
(HBOOT...) :-(( & {8 r; r- L5 M( O- l; K
# A) o- C; ?0 z' b' }$ ]% PHere is a quick description:
( G0 R: q0 Z* W8 ~-AX = 0910h (Display string in SIce windows)/ d6 ?& F( a: f$ M% M
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
( d! L2 \ Y* E6 t' S-AX = 0912h (Get breakpoint infos)' A* I/ c8 h: B% ~
-AX = 0913h (Set Sice breakpoints)3 }* e: q% H1 c
-AX = 0914h (Remove SIce breakoints)# ~6 K8 ], x1 N$ C* J+ ?+ G4 ~" p
+ k+ A# s) h/ A. \: B9 b' Z- d7 w( x7 gEach time you'll meet this trick, you'll see: Q9 ^. S% a2 a6 l
-SI = 4647h
9 S: {3 P' r' g% A-DI = 4A4Dh
1 |; o& d& ?1 ~9 w- o# [7 [3 L* VWhich are the 'magic values' used by SoftIce.
) M# Q) G; R% h& K R3 \2 @$ T1 ]9 bFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.% i: o$ Q- M' o$ I- f
2 m3 [. w: z! s6 xHere is one example from the file "Haspinst.exe" which is the dongle HASP' T3 V( k% r2 l* Y0 J0 Z
Envelope utility use to protect DOS applications: U. y G7 `% a( C
9 c2 s$ R3 u0 [" k+ Y) x5 {
# X- N* J* m3 Y" q
4C19:0095 MOV AX,0911 ; execute command.
n! O9 Z% _" |" Z# L# u. F6 p4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
7 S8 W v2 e6 J' u0 R/ F5 R4C19:009A MOV SI,4647 ; 1st magic value.
: m1 \4 K/ H! E4C19:009D MOV DI,4A4D ; 2nd magic value./ g8 s# E) e, R' x, c
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
: s0 N q1 b W1 m4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute2 Q. z9 E4 Q) \/ ]: M. f
4C19:00A4 INC CX
& b7 ^% J5 ~" F/ g" C! D& G) \4 a) T4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
/ m) h! E& p0 A) A4C19:00A8 JB 0095 ; 6 different commands.
9 x: G& g+ `4 f3 \% q' ^4C19:00AA JMP 0002 ; Bad_Guy jmp back., @' Q8 ^ H6 f6 G
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
4 Q" U( f( `/ b; R1 v ]6 h9 \3 S @: Q7 U# w; p1 e8 V( q
The program will execute 6 different SIce commands located at ds:dx, which
! r5 i+ f( @% t8 Vare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.4 ?# U' O+ [" M9 n& c) H2 r
. P* P) W6 e! c8 @1 I! C
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
) J. M9 H, W4 q( j___________________________________________________________________________0 u4 \' i5 m6 C6 u+ E4 P3 K
, G& z s8 a5 s' f$ @# V/ z0 w y: X4 Q) z4 B* H- }+ A0 \( ^
Method 03, X6 @' D4 p+ C
=========
2 C3 z5 p. h! a5 }+ I0 B8 D4 x# h% Y% F" E6 p
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h! E- k9 `1 F+ Q
(API Get entry point)1 ^9 k. i; T& I" w
3 O$ C2 `4 i2 y( i/ \8 a3 U) J
( t- g% p( X$ ^6 v \! f" `
xor di,di
d# N& m2 h0 T$ ?7 } mov es,di$ K( T' D7 W. u) U$ Y [& y
mov ax, 1684h
& H( c" G- I. x/ \- { mov bx, 0202h ; VxD ID of winice
, r% g3 f( I y4 Z int 2Fh' E) [! }3 V. F s1 G
mov ax, es ; ES:DI -> VxD API entry point
% F: N4 O. @8 O add ax, di
* k8 N ?+ t/ ]6 ] test ax,ax
, B; N% t5 x9 {2 [+ Q4 W. m2 u jnz SoftICE_Detected k0 {1 B: P$ m
G8 L$ x& ^: Q
___________________________________________________________________________
9 F$ Z! H* c+ w& p6 c$ y& L8 L4 Y7 ~
Method 04. F; Z* T& s4 v5 w8 q! S6 `3 r
=========' {9 b( r' R2 |3 g) M
9 Y4 ?/ i/ @# y1 A2 j& J$ }7 k' kMethod identical to the preceding one except that it seeks the ID of SoftICE
2 Q* C- {3 o) o9 o. [GFX VxD.; c6 g; j1 x( \5 j/ ]- L
) O4 v' I3 l- n, }4 X$ o( ] xor di,di
! g6 X2 ?* k8 r& G mov es,di- J2 z! m: G- K/ G
mov ax, 1684h
' q% L- f& f# O4 v$ ?! w: ` mov bx, 7a5Fh ; VxD ID of SIWVID g. E! m. d" C! @+ N2 f0 p( K
int 2fh
- u1 n% C, E2 n3 K( r: a mov ax, es ; ES:DI -> VxD API entry point: F; S( L }/ a/ Q: |& y- j
add ax, di
, h, o: W. L) B' F test ax,ax& s$ \ {/ P& k& x6 k. ?- ]( e) J+ w
jnz SoftICE_Detected
# l; ]% w. s: Y Z, ~: Q6 ?
2 b; F5 {) \2 _' |9 y% d__________________________________________________________________________# |6 s. f) Q) D% Y
5 H, E( t/ Z: A6 l: A
/ d! E/ c! `* QMethod 05
/ Z" p4 s+ u) J$ K, l0 ]: l=========' O* g$ `! t) D: K# O! E3 K
! C2 E5 W2 X1 ]" G U
Method seeking the 'magic number' 0F386h returned (in ax) by all system# D" i2 N$ O' |6 W. i% i
debugger. It calls the int 41h, function 4Fh.: x" o5 P7 V1 }9 U e* Z% h
There are several alternatives.
) o6 y. l X6 h/ N5 F" j J- I, R$ ~5 J; D. e" {) R
The following one is the simplest:
2 |7 t, R* s; d& `& n! _3 I
0 [( J/ d, b- \( o9 d& B0 f mov ax,4fh4 F- D8 K2 h) V6 q' M
int 41h0 ?0 z. P- h; X0 D v
cmp ax, 0F386
$ M& A$ e1 e; ^& Y, [5 d5 @7 O8 a$ ? jz SoftICE_detected9 F- R. t6 o& `- ?/ I
B* e2 h, H/ L0 P6 I
/ x. x4 Q6 t+ a% U; c. nNext method as well as the following one are 2 examples from Stone's % [6 s, \1 i* S- s8 W
"stn-wid.zip" (www.cracking.net):
: E( r& g4 ~8 S( i
- f9 _4 N! \) n! l; [: c5 | mov bx, cs" X/ v# I: T% o( Y w. D
lea dx, int41handler2
' ]2 T2 b& j! Y; E S1 K! b xchg dx, es:[41h*4]. s: s' F' z" _% d n- T5 S! Z' y
xchg bx, es:[41h*4+2]
1 ]3 I) J5 R* @$ G- C mov ax,4fh, t; ?4 I* R) b o3 a/ B4 a" S
int 41h
' v, U, ~2 o2 y* U$ O. U2 C. D xchg dx, es:[41h*4]
7 D7 N: W( X; p: M: H xchg bx, es:[41h*4+2]
$ n- r0 z* ~- V0 X% u1 w cmp ax, 0f386h& c6 F3 }' `% r: z
jz SoftICE_detected- [* v! u5 A/ g6 }( a! l
: X+ |1 a9 ?- \% g6 ^, P( rint41handler2 PROC
) x3 N6 a! n& R3 e3 i2 w iret
# M* c. } |, A* c7 kint41handler2 ENDP9 S. c5 m* T4 v
7 P: l$ L7 {" D$ ^
; n' v( h7 N. l5 K2 g3 X4 m @: P_________________________________________________________________________& p! q% B" m j0 D) ]
; C8 x5 p0 A( X$ j* x4 F$ i# q7 Z
0 c& _1 w6 Y6 w+ x4 BMethod 06
q8 b$ c) r( n# `- h# s=========+ P8 u, N7 u3 [- |- v
6 ?: D0 `* J: G/ G6 g! A8 ^6 w9 y3 W2 {( R, _8 _( P! {% k4 S
2nd method similar to the preceding one but more difficult to detect:( Y" x0 [7 e5 \" J
% @8 ~, E3 U( N1 C1 A
6 j8 D# A/ X6 l' S, m( r2 A/ |
int41handler PROC" L' y9 ]9 P9 C; f% c1 { r. P
mov cl,al
' z% w$ F5 K* K9 g S iret" L2 f; T7 f. }- y
int41handler ENDP% D0 I: z4 l% ]6 R& n4 s
7 ?" J3 D0 N8 S3 V/ g/ \. c& d3 M( _! ~! r$ i" A
xor ax,ax
, _: o k0 \* O mov es,ax5 E5 S" ?+ @- N/ R: P- t* a. O
mov bx, cs6 _* h& ? j6 |7 O* n3 F; b: s/ c, c
lea dx, int41handler
' ~$ r. c( }* K. W; _$ t5 N5 C xchg dx, es:[41h*4]
4 g( s% m- I( q! S. K( u xchg bx, es:[41h*4+2]% O; I E. A2 B; d X6 E6 k
in al, 40h
7 b7 E3 _; T. k xor cx,cx* p/ Q1 S, I9 N$ ~; q* N
int 41h
: k; M0 J$ b: o5 f xchg dx, es:[41h*4]/ G3 D/ j' O* l" b0 A6 ?) V! A. i
xchg bx, es:[41h*4+2]9 [ C" h2 P' p2 G G" n; v
cmp cl,al4 b4 t$ w' f: P7 f6 S
jnz SoftICE_detected
) l/ j v& f1 ]: I9 b/ P" S% z! E5 ?& V8 j8 C7 o! _0 w
_________________________________________________________________________
6 P E3 U. u# d6 ~% S+ l8 n( `3 W8 F$ J" E! Y! L; E( V- m5 ]
Method 07' S& d# K7 I9 H( l4 L
=========; O( w3 a+ K+ D# E ^+ i
: Q u" T: Q' c- {. o
Method of detection of the WinICE handler in the int68h (V86)4 p- J7 _3 c' l( W
3 l' e. b( n) Q `
mov ah,43h& ]6 o: z6 h' F8 g6 m
int 68h3 `+ C5 ^5 v0 ?. E& V, U4 B
cmp ax,0F386h
# L i5 p8 z3 ]6 V8 G( J7 k) f4 }2 N+ Y jz SoftICE_Detected
3 a' Q6 N% w3 `" l% N: ]' |; s( G7 w
* s2 N9 p! W! K" W0 \: Y/ Y=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
3 t' N7 P- s1 |" O& B& \ app like this:& x: Y7 R6 v, ^
[4 l$ }) T4 U' @. Z
BPX exec_int if ax==68
$ ` Y/ G! D0 [4 F% t1 Y (function called is located at byte ptr [ebp+1Dh] and client eip is
) l5 z+ Y3 v$ J/ v: K' I- d5 T located at [ebp+48h] for 32Bit apps)
X& j( _, r) ]! y/ W$ k T__________________________________________________________________________
w5 f: b: K/ n" c7 c+ K" F$ ?0 C# ^6 v- F$ A
U. u" y- _: N" \8 I3 [
Method 08
$ ^% F9 m6 F& K' v% L6 H' ~* o=========# S+ I+ g4 o1 @7 V/ R& g( S
" V& r% k$ [' q: f4 a
It is not a method of detection of SoftICE but a possibility to crash the
0 |7 V2 V3 J: n( R- J+ Vsystem by intercepting int 01h and int 03h and redirecting them to another
; q p. P7 p2 V6 x- x- Qroutine.
; `$ E P, Q" w5 i0 E# z4 @2 d& HIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
9 T4 X1 Y5 Z- s7 {to the new routine to execute (hangs computer...)
8 K+ x# z. ^4 f. ^0 ~& D& _# X. f H3 P% z7 k6 q' k
mov ah, 25h! {+ Y$ P7 b" g. o+ i
mov al, Int_Number (01h or 03h)
. i+ e6 P8 \3 S W, {7 \( I5 H mov dx, offset New_Int_Routine( B j" c/ L- Z i
int 21h
) g) {4 _) U7 q. Z6 L& B4 a
. _- i+ E1 u3 Y& Z( W' h4 o__________________________________________________________________________' ?* G! S- }' o5 S
" i* M. h9 [$ @2 }( I; R7 Y5 ]Method 09
+ z2 B+ C% I% S0 u9 T) y* Z# K; N=========2 s6 J" @/ q& m5 }7 [
3 C& q) u" `! \+ k; IThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only. w O- |6 K* s9 A- q) Z) ]
performed in ring0 (VxD or a ring3 app using the VxdCall).
5 |6 Y+ l9 @* ]' K3 dThe Get_DDB service is used to determine whether or not a VxD is installed0 B: ~* \$ E5 B" r: p
for the specified device and returns a Device Description Block (in ecx) for
) c0 B. q* w- S, S+ j. D9 B+ tthat device if it is installed.; @4 T2 J$ Q/ J% j
9 e1 o* x* Y/ }( p
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID% C2 c X% ~5 Y$ b1 ]( `
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)7 l* p3 A1 i; ?! l) i/ B3 k+ g, P1 d, h9 i
VMMCall Get_DDB5 @5 p! Z8 U U$ l
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
# b" Y `9 ~$ x+ J
$ T* |8 s4 Z# B; v" V; u3 LNote as well that you can easily detect this method with SoftICE:$ M1 D5 h" `; v) H$ {+ ^
bpx Get_DDB if ax==0202 || ax==7a5fh H% B" M+ G* j7 ^& k
# ]8 i3 Y- i% O6 Z5 a
__________________________________________________________________________
7 U1 L! Z5 \8 m6 d' x1 J- ~4 Y, [2 k$ T6 F- q: O7 L, |
Method 10, x. {! ]) q8 I
=========
' K5 x( g1 ^8 {, }* N. {- x
8 S& |1 K4 M9 Z# g \=>Disable or clear breakpoints before using this feature. DO NOT trace with
* D7 O0 r1 d2 q2 C: L8 m SoftICE while the option is enable!!6 z% ^! r" g; g c. @. H2 K
; I& Y' }3 M: h/ d9 K* U9 PThis trick is very efficient:- X- l' V3 H* x- j$ k4 [
by checking the Debug Registers, you can detect if SoftICE is loaded
5 `3 ?4 \5 B$ T& p4 Y(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
0 W S$ [ s( T" ithere are some memory breakpoints set (dr0 to dr3) simply by reading their1 i# {# `) ]9 B* {+ W
value (in ring0 only). Values can be manipulated and or changed as well
2 l3 Q1 a0 J0 ?9 V(clearing BPMs for instance)) @4 e: p/ b1 i5 d' @4 k5 n9 ?
+ S; z, O1 J6 J3 D' _( I
__________________________________________________________________________/ k: v4 T: u! A; W) N; _
7 d; ~# Q8 i+ yMethod 11
" H5 \% ~; ?0 n+ ^" V) u L3 M5 X( Z=========
8 b3 Z3 Q# n% l9 T) `* i; ~/ e5 G8 ^; ]- q
This method is most known as 'MeltICE' because it has been freely distributed% [2 j: S, K, H) @; {/ j3 _
via www.winfiles.com. However it was first used by NuMega people to allow4 A& K- s3 H; q( A
Symbol Loader to check if SoftICE was active or not (the code is located
8 C. V/ ?0 _+ [' E/ ]* G! binside nmtrans.dll).! m# R4 A" `9 U, j
; S. Y+ O; X- W) E6 X' lThe way it works is very simple:' l m P" h' l2 ]" o2 }
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
& s, b8 l @9 @5 cWinNT) with the CreateFileA API.
. k# p2 U7 W2 k. O% ^1 }! C* G2 j7 v B* \+ Q7 F
Here is a sample (checking for 'SICE'):6 |: u4 U8 U6 J$ |# h
d* o( ^- H0 R% N: `5 q: eBOOL IsSoftIce95Loaded()5 |5 Y S/ h2 q
{
8 g p9 I7 g$ g7 Z. L HANDLE hFile;
5 n' ~! O* @& }8 G: \* [ hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
. M" W" P5 I9 B+ J( o FILE_SHARE_READ | FILE_SHARE_WRITE,3 `1 J/ @1 Z6 ~% r* E% E
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);8 G- j6 D( t1 k
if( hFile != INVALID_HANDLE_VALUE )
$ q! _1 H' s8 u0 w4 a# H% c+ J {
, Z8 J2 w" {) S: [ CloseHandle(hFile);
|( M' f9 I. k& F# \5 x return TRUE;
; S9 `& N9 B1 B) P) q }7 B3 O6 B9 N& M/ A8 u# O
return FALSE;9 j8 n9 x# l4 |' x# r4 y5 f
}: l- j9 G$ C- @' q( Y
. ~4 O8 V! D& u0 J" u9 `
Although this trick calls the CreateFileA function, don't even expect to be# y: K0 @+ k D/ T$ G( g0 l+ X
able to intercept it by installing a IFS hook: it will not work, no way!
" V' e( ^3 s, E/ w* b. gIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
H, \9 P7 L! ^: s. p% ]$ A3 Wservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
1 [! N2 b1 t5 g# }$ f2 r0 Kand then browse the DDB list until it find the VxD and its DDB_Control_Proc
" I% e' F; ?% ]" d/ Lfield.
3 w8 N2 b! ~. i1 E# d& K# _In fact, its purpose is not to load/unload VxDs but only to send a $ m2 b1 M0 B6 \! S9 X+ g' B
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
5 Y P# e7 l' l6 ^* [to the VxD Control_Dispatch proc (how the hell a shareware soft could try2 }. P5 q" D( z5 _1 K& {
to load/unload a non-dynamically loadable driver such as SoftICE ;-).& \3 F* I' X5 [) m" j
If the VxD is loaded, it will always clear eax and the Carry flag to allow
- Q" h3 Y; i! wits handle to be opened and then, will be detected.
" o, x) s) T3 o' M. T4 u2 P6 qYou can check that simply by hooking Winice.exe control proc entry point! C* A" }% I# A! \ j
while running MeltICE./ u3 ]7 W* _; E0 |$ M
5 h: g U4 N! z \8 C) ]7 \
% V; h# Q/ f% Z5 X# Q) B 00401067: push 00402025 ; \\.\SICE9 ]: w6 \0 h& @& l6 H5 w, |
0040106C: call CreateFileA+ m$ t3 U# s' T2 N( R( R
00401071: cmp eax,-001
, t" {# ~( t0 [* `- w. G1 A* } 00401074: je 00401091
) O- X2 ?0 f; t7 {! s' b* l9 d8 t6 [8 W' d& x
0 D: l* T v# f
There could be hundreds of BPX you could use to detect this trick.9 B1 z6 w& C; V* v3 a6 l8 _
-The most classical one is:
, a( p, V7 ?6 [: f2 t1 m6 I( j BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
' J- e0 }4 |: r) m *(esp->4+4)=='NTIC'* X: o/ {1 [: Q8 {! B! I; N9 v
" a5 Y, L! a2 V-The most exotic ones (could be very slooooow :-(
, l3 V9 M5 @' G' N* d: x BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
" }6 l9 g# g% r! A2 H% ^. ^9 x0 B ;will break 3 times :-(9 e2 Y* X& Z% S" \3 R
" s8 q- L( ^. O1 A-or (a bit) faster:
: q1 U1 ~+ W6 x* z BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
1 \+ |8 Z% f% y8 t3 g+ H
! i$ _ x! f7 }7 G9 ?9 G BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' $ E9 c7 a; ^( x3 X# a
;will break 3 times :-(
+ Z& O* [: Z, o' S9 L% N4 E* J2 ]; W. B
-Much faster:
) Z t" y2 r5 U1 K" y BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'2 s! D [3 q3 R s/ `3 c
' d' v% `7 R0 X4 w1 L* t5 {
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen+ o0 G" E* C1 ]( A0 \' W' E* [
function to do the same job: Y" W' k6 J5 l; W- h
# g8 U$ f6 p% f3 j
push 00 ; OF_READ, y# ~' f* M/ w+ p
mov eax,[00656634] ; '\\.\SICE',0! W) [+ |3 V- c2 Y9 G2 L
push eax
/ i) v. J3 e5 k$ Y/ e call KERNEL32!_lopen
, n; F$ L( O; ~& h1 C! [0 S# \ inc eax
( S# ]7 E4 }7 ^. d jnz 00650589 ; detected
/ a' n' n& ?4 F U& l+ E) ]& c push 00 ; OF_READ
2 S* @$ U0 l, T" [ mov eax,[00656638] ; '\\.\SICE'( c- B9 i' A& @; \5 f; n/ H
push eax4 k. i. P; b& |* G& k" A
call KERNEL32!_lopen n. c1 j$ a: I: S8 ?/ r
inc eax8 s) U8 z0 L6 B, k( V' s/ c
jz 006505ae ; not detected7 Q+ [& Y' A2 A. P
+ B" V0 m. a. R7 I2 q s& t p' o: L2 b5 s
__________________________________________________________________________ N) z3 A; c+ I
9 c5 H1 L, f7 f; \9 d/ }Method 12; d: D3 o* I& y- T
=========
! Q' l; V' R) \ v
/ L4 a; K, p* q9 x* A4 H. g0 wThis trick is similar to int41h/4fh Debugger installation check (code 05/ x d c6 }& d
& 06) but very limited because it's only available for Win95/98 (not NT)
$ H8 X6 i2 B+ C/ [1 nas it uses the VxDCall backdoor. This detection was found in Bleem Demo.' o" ?( z2 \$ g. F n, V1 [! D/ s8 c
$ I, W: K6 o- J2 m7 a4 | H
push 0000004fh ; function 4fh
" z5 ^+ r5 L3 w' H1 x6 k% U push 002a002ah ; high word specifies which VxD (VWIN32)6 t, `. G4 X6 ^8 p, A
; low word specifies which service6 ]: a! }$ c; C
(VWIN32_Int41Dispatch); s/ w$ m l: s4 s4 l% Q
call Kernel32!ORD_001 ; VxdCall
2 P: [# M* N; F9 i+ r9 X cmp ax, 0f386h ; magic number returned by system debuggers8 r$ M* n1 r' s0 ?# H! L: c
jz SoftICE_detected
& b9 k$ a9 D( j1 W( a
! f& z, b. Q+ G" w5 e( yHere again, several ways to detect it:/ r) M3 Z# T5 H
' o& b; o% P. N6 b# E
BPINT 41 if ax==4f
, C0 A! g& F; {9 D8 K( L4 L1 g0 v, C+ u. C
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
3 J: \ }9 g5 }1 ~/ w+ ]
6 s$ Q9 u( S4 R0 ^+ |8 Z# t BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
6 a l% M6 U) f& N3 E2 y
! A6 h x) p# M: K4 J! E BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
* x: H4 R8 k* a% M; Q! m1 U6 [* m$ [1 Q* f
__________________________________________________________________________) H+ s% W- m, F; ~+ Q
; ^6 {* h, r3 f- g* r) ~Method 13
( ` h' x" ? y U0 `2 N=========& q' d2 Q5 m# Q' k4 `5 B& R
* p) p2 n" g" j( I: L8 |Not a real method of detection, but a good way to know if SoftICE is
# \* c, K2 I8 ~installed on a computer and to locate its installation directory./ p9 u: \1 }" e- W0 Z: x: Y
It is used by few softs which access the following registry keys (usually #2) :
: T/ H0 {0 y4 S* F4 L+ f. m8 d* S0 t% r/ g H
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion ~4 B6 g1 [( a, {
\Uninstall\SoftICE0 h9 S2 ?8 k0 G! X6 C& t/ x
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE; d& \5 @4 n2 W8 S' u( \9 r
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
- H/ M3 A( q% x' F\App Paths\Loader32.Exe0 i/ }3 X1 D+ c( R# Y0 M" C
9 Z4 k2 o" }; z2 N* Y1 Q! u- _0 H7 T" Q, y2 y
Note that some nasty apps could then erase all files from SoftICE directory
+ x9 s9 A0 W9 R0 L- L5 v(I faced that once :-(
2 G5 [9 x. T0 B- @2 ^- B; v2 A6 V
0 F& u3 R' g, Z0 JUseful breakpoint to detect it:
* O( i* n* [6 a6 O- {+ O6 a1 w# W) \
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
/ V! T E$ C; c/ P) O0 A: R0 z7 z7 a. M
__________________________________________________________________________
5 N" ]! T* ?( p" S2 T: U( A
- o0 g& f! b$ _
^" d$ ]/ s' m4 W' T: F. x0 UMethod 14 * y6 Z/ _+ p) |8 Z; i
=========9 O, P- ~2 n! N. r- x
6 v- z. v5 \8 N* P3 ^' s2 g+ k H% v
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
* k8 ~/ B$ m+ C8 W9 m6 Bis to determines whether a debugger is running on your system (ring0 only).& O( t1 K" ~0 Z4 I$ E
$ r. x& G# W% d/ F; e
VMMCall Test_Debug_Installed
8 P+ |+ [/ P% o! ^2 S' e8 r$ r je not_installed0 `1 N: Y3 u" b
* t' O1 U% _: s, ^1 j' u9 t; E1 O! F
This service just checks a flag.) p$ L7 H; C7 d: D
</PRE></TD></TR></TBODY></TABLE> |