<TABLE width=500>! J, J+ o' N+ g. E5 [6 C: H
<TBODY>( c1 M+ U4 w9 a
<TR>% u. H% H9 b$ n: J' }7 o
<TD><PRE>Method 01 3 j9 ~: Q1 g' h+ N* Y$ |
=========
`+ L; Z0 ]* j5 v) o5 d2 i9 B5 v
2 Y7 m+ f9 T6 ], n- n" h9 wThis method of detection of SoftICE (as well as the following one) is/ d8 k! F! w" n7 `- U) D6 a$ h% g
used by the majority of packers/encryptors found on Internet.
1 S p- _* Y: `1 F" T' BIt seeks the signature of BoundsChecker in SoftICE- d( e7 B4 \7 }& R) m6 n
2 [) V1 ?2 c# X A
mov ebp, 04243484Bh ; 'BCHK'% o0 n5 N3 w! k
mov ax, 04h
, V! f j$ s7 z/ H) U+ }6 z7 ? int 3
r! r' a N" Z$ s0 [ cmp al,49 X, c( j1 |. x8 q
jnz SoftICE_Detected/ V9 N& Q8 d ]. m
% J6 t4 \& @$ U, h6 @4 c9 B( j___________________________________________________________________________3 O/ s/ U9 w7 N3 C2 o
2 ?( H0 Y" f9 O& ~+ z. d3 L
Method 02
) ]2 u, a" C* q W& I0 N=========
9 o9 y+ n. d1 l5 N+ H+ a/ _4 n
/ |/ ]4 [8 z) i! U0 TStill a method very much used (perhaps the most frequent one). It is used0 N, [" H: T/ k+ \* _9 N
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
+ @9 R' p( x. F% Nor execute SoftICE commands...
, M' {. ~" K, ?- q* Y8 S- [' QIt is also used to crash SoftICE and to force it to execute any commands
. @! c0 P/ B, m$ G$ _(HBOOT...) :-(( 6 e# S- O: M% T8 r
: [* ?' G( ^1 W& p$ |Here is a quick description:
* z' h& T: ?/ P0 L& B-AX = 0910h (Display string in SIce windows)2 H( A) @& {/ Z2 t! D' c# n# G
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx): H, ~/ g; u# B: M. U& T
-AX = 0912h (Get breakpoint infos)' C# n- q2 o( H' ?7 _0 b: L* f
-AX = 0913h (Set Sice breakpoints), G7 V2 D. q7 C9 O) r! l2 v
-AX = 0914h (Remove SIce breakoints)! H" X" R/ C# w9 D
6 W V5 E1 [* _1 k
Each time you'll meet this trick, you'll see:1 b, u$ v! g! u0 _3 _- v
-SI = 4647h
: `. b4 e* k: [4 x$ e-DI = 4A4Dh
3 P* Q* q7 X, Z& x5 X. NWhich are the 'magic values' used by SoftIce.
2 P% P- g$ K7 gFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.8 k( [0 g! v! q. y/ Q0 `1 K
`% B1 R& j+ M- c! j2 }$ C
Here is one example from the file "Haspinst.exe" which is the dongle HASP
# ?( N0 W4 Y) B& T4 Y( N: KEnvelope utility use to protect DOS applications:8 f4 O6 R5 K3 _
, w( s6 n9 T! c' n
1 k) W V" B* w
4C19:0095 MOV AX,0911 ; execute command.: r F2 ]6 Z* L" u
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below)., A( L3 K4 N6 b- }# ]
4C19:009A MOV SI,4647 ; 1st magic value.) I2 ~. ^0 v( X3 S% M7 s
4C19:009D MOV DI,4A4D ; 2nd magic value.
; ]) r8 {& p f* V4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)+ Y8 Z6 V3 Y9 _+ N. N" N
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
+ p: \, j; \5 [ S( W4C19:00A4 INC CX
* n, u% |! H I: t4 W4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
4 z. n+ a) Q0 B0 [4C19:00A8 JB 0095 ; 6 different commands.8 [' {2 N- F: b0 h8 O j
4C19:00AA JMP 0002 ; Bad_Guy jmp back.! w5 ?- D$ u% U* _. K- Q
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)5 L6 v8 |* W3 Z
: j& V4 @- \3 [. y! c4 wThe program will execute 6 different SIce commands located at ds:dx, which. K# T! ? ^8 ?* B4 Q! E) e% s5 k
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
% d6 b/ H+ Q4 Q2 o$ x1 k
; e% T {, x. R# G* r) y2 t& c7 }0 }* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
% ]$ L6 H: g' r2 R; t6 o' I/ a___________________________________________________________________________
. X: g z5 |) m6 J- t$ U
& I8 z4 r* z! {" B( H+ V, [6 g7 T- [0 }7 Y2 C9 h, I
Method 03
1 T; i+ g! d2 ? }; c=========) R9 z+ L6 U2 B, P5 f$ g
2 Z4 C! o2 O. ]1 v3 _1 |6 J; y: v
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
# i( V) A# ^; S. C, {(API Get entry point)
, K$ H3 I/ c4 R8 z0 y4 V 8 S$ F% C6 y h2 L& |
# q- h' e4 v4 u- I7 I0 c xor di,di5 h0 [' Q: `1 I& }& w: v' X
mov es,di
8 V; X$ }* p" j( y) ^+ G mov ax, 1684h
9 K0 B! k* {* Q1 ` mov bx, 0202h ; VxD ID of winice
* Y6 |4 H9 u5 x* h- C int 2Fh
4 G2 ]0 j7 _7 z- f8 I, g! c mov ax, es ; ES:DI -> VxD API entry point. O* l6 m j8 ~3 i% r+ w
add ax, di
i/ ?$ u& ^7 K7 m! k test ax,ax
- z; h" r# l4 n' U( p jnz SoftICE_Detected
+ V3 M9 G7 A; Q% c# H
( G* R2 {3 b/ Q9 d/ ], G$ n___________________________________________________________________________# r; c9 B% Z8 E# [& y2 t+ o6 ^3 H
, U. _* }2 p% U4 D4 z
Method 04
% _+ ~6 l4 T# R6 d=========# D" F, | L$ Q |6 M
7 K1 `& F# p0 j$ O V
Method identical to the preceding one except that it seeks the ID of SoftICE* r6 m3 K$ @* M
GFX VxD.9 l/ l& n$ u7 K* T' ]0 U
6 @# j( m* Q% R' d$ ? xor di,di% Z. X+ u& d0 J
mov es,di% k. h& S9 U* \, @* I! a
mov ax, 1684h
% Q& Y( P" |) O n& o4 J mov bx, 7a5Fh ; VxD ID of SIWVID. }6 O9 U7 V+ @$ t9 K6 k8 X
int 2fh
$ i5 z7 `. j4 n2 P) a1 a mov ax, es ; ES:DI -> VxD API entry point
/ { i+ B9 C2 p+ r8 t' {" t add ax, di$ J( p u+ s. W4 E! T9 }6 G
test ax,ax$ u: S P `2 [3 E% D1 n
jnz SoftICE_Detected
5 ~, `/ ~+ v q& p) X. Z1 c
, D& t/ s- D% k( X9 d__________________________________________________________________________7 h" d2 m2 v, _/ t& ?
* C4 Z( K! ?# W' P M+ e! e" j" s/ z3 u0 Y& {# e
Method 05: Y+ L* q/ _; X8 b& B m
=========; l7 y# E" L$ |0 ?0 }6 a! B
8 t; L- s0 r) _% {
Method seeking the 'magic number' 0F386h returned (in ax) by all system
5 i, `& @* T$ w, Z9 z8 ?% }debugger. It calls the int 41h, function 4Fh.
4 K( t6 L4 n( T! ?There are several alternatives. ; I3 l& F" ?/ U6 B' b: j
0 [) }0 r# I% m6 M! h2 G
The following one is the simplest:) ^* `+ e- S+ a4 G, v& A7 k! n
: a4 x% S) ?/ k0 i
mov ax,4fh
) W* @! g% u, C+ N6 x J1 \ int 41h
9 F' n9 f) [& ^ cmp ax, 0F386+ k ^" m8 [. J# c& }! f
jz SoftICE_detected2 C7 H+ b* ^% l- F8 x
& H/ S9 O7 I7 v4 C, i0 d# [& {
, D* ]4 q7 e# e3 \
Next method as well as the following one are 2 examples from Stone's
: o6 ]+ X* C- J9 s+ L% o"stn-wid.zip" (www.cracking.net):, O% M0 g, g4 t& |; E! m
5 P" J! S9 F3 n mov bx, cs
$ Q6 f" G0 | R/ s% F lea dx, int41handler2
$ n, t& `! r3 q xchg dx, es:[41h*4]; V) V( X( A! U& W% v' t
xchg bx, es:[41h*4+2]+ F9 R! c$ U P! E
mov ax,4fh/ B3 _& f; j9 W8 w2 c
int 41h
* t# Q/ G) x' U: G; d' ? xchg dx, es:[41h*4]- `2 k; O! S" V+ v6 ?3 G+ I/ \% i
xchg bx, es:[41h*4+2]: ]* h1 y/ V% \+ o" T
cmp ax, 0f386h/ \4 s0 t( w, Z) P% L$ |" r/ {
jz SoftICE_detected# a6 k4 W# n2 D1 U% I
% z/ Q& n- m. D/ v/ i: J* c, _
int41handler2 PROC
: g9 N: R7 `/ L) `5 `( [+ b iret& e6 q& h g3 a/ A) s1 V
int41handler2 ENDP. F1 V3 b9 Z% I9 X ~+ b
4 T2 {5 f- d8 q6 M! E& i2 A3 M5 K7 ~" @* U7 ?4 K' R& Z, d3 f# y
_________________________________________________________________________
( Y5 E2 N1 @ \& e* ?+ F
5 s1 R2 o" L; h5 Y& o2 L' S9 U% s$ b3 R! V% A; a! D2 ~- R$ u
Method 06/ r" m2 y5 I) k' b
=========
" C' |% g6 s) o& f5 Q. o
7 |* \/ \% K1 c S" M; f) K
- k% M' Y. v4 Y, Y2nd method similar to the preceding one but more difficult to detect:$ E' n5 V ^/ c" o+ a
0 s9 |4 V! L c5 c
# v, T/ q2 i" s% \4 ]3 Aint41handler PROC1 ]* N9 }3 I; j
mov cl,al
9 b& Z2 T5 z% m$ Q5 } iret$ U! L8 }9 n$ ~8 F) J) ^* g$ c! A
int41handler ENDP
: n% p& Q# c1 J, |/ O+ X4 O6 O- d7 u# c8 L* q% c9 U( \: z
1 S" m, [0 p; N2 w L$ @ xor ax,ax
! K$ E8 w c1 Z& x: z mov es,ax
. D. J$ J, j9 }+ B: f# T mov bx, cs& U0 J. u9 e+ `, {
lea dx, int41handler. T9 x5 X& O$ `" Z
xchg dx, es:[41h*4]; U' Y8 `" U2 o3 b) ~6 J& z8 f
xchg bx, es:[41h*4+2]* h) F* U8 A$ w
in al, 40h7 `/ C$ r$ k) u! E G
xor cx,cx
( N% ]. t% c2 f. D int 41h# v7 f0 a0 o: b* K5 ^, o
xchg dx, es:[41h*4]- y/ s! R7 s/ C& @3 o* b
xchg bx, es:[41h*4+2]
+ h4 b, O: K' E cmp cl,al+ e- w) Q# `( o8 a
jnz SoftICE_detected* [# B6 a, r: ?
/ ]) ~ x2 c: }
_________________________________________________________________________
/ h% f2 @8 P9 _1 l) h- I7 z
8 \4 C0 l; H {4 t {, b& }( a# CMethod 07
t% \# O0 T- r4 s=========; o: [+ t7 n" X' m
! G) c; [. j9 h3 A \& k. M8 T/ h. rMethod of detection of the WinICE handler in the int68h (V86)
) n& v7 Z/ [8 L
/ l; ?2 O8 R8 k. W. _# ` mov ah,43h) p# p! y3 o5 a' w. v
int 68h, `' E- @) R) P: ^
cmp ax,0F386h
& E) t8 y& V6 C a4 O) f* @4 R jz SoftICE_Detected5 l. `9 M$ D. Z: c6 d0 V- R
5 Q9 y6 D/ ~1 R3 I; W. ]
& [ _+ I" k2 A e" i
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
4 K: _# ~+ h7 P/ \) `5 D app like this:
9 j6 @$ B. v; Y: D! g% b n2 z8 ]3 k0 }$ s/ F/ W
BPX exec_int if ax==68
* {7 l/ C9 C! o (function called is located at byte ptr [ebp+1Dh] and client eip is1 \7 K# t6 m* ^2 C9 V7 a' G S( S! k# H
located at [ebp+48h] for 32Bit apps)
K% F/ q" O' Z0 V+ E( e" l% `/ A__________________________________________________________________________
- h: W9 E( g: j# X- i* e; C, L N3 |9 C2 \ }" w4 R V6 V
, A- B* T* y0 C* z \: B! F- MMethod 08' J: E U/ Z' i, z. k: j
=========
+ q9 U2 N! @" v9 T- u3 H
- [& I3 U" D& y! `1 ^It is not a method of detection of SoftICE but a possibility to crash the
$ P! a) K/ J9 o4 Q" g- l. wsystem by intercepting int 01h and int 03h and redirecting them to another
# I! y9 g# r+ b1 |1 zroutine.( g# `6 L' {! d& \' @
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points1 J" ~5 E4 x( U' F. v1 N+ w
to the new routine to execute (hangs computer...)
7 m- [# ]8 B3 W( K$ S+ e( N/ G1 O3 W' s9 z3 b
mov ah, 25h
# u8 N4 \2 G6 Y+ F8 l3 r mov al, Int_Number (01h or 03h)
, W8 c$ p/ L/ K+ w mov dx, offset New_Int_Routine
% V9 w% G% ~5 O, H$ u" c int 21h. B% S R; x- @: ~/ I
" z5 h3 M' w! {6 E
__________________________________________________________________________! T, G/ K' ]6 @7 O9 v& v2 ?
8 d8 u+ O) ]5 eMethod 09
' v; `$ b/ e% g: f=========: V' c; l3 R P( k5 W$ U* v" Y
& c6 S6 c( F7 v- U$ QThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
( _: _! C4 M- Q2 u! c operformed in ring0 (VxD or a ring3 app using the VxdCall).
. s. [9 [# O& v1 E# HThe Get_DDB service is used to determine whether or not a VxD is installed
# f* f( S; u. ]3 ofor the specified device and returns a Device Description Block (in ecx) for
0 J; W& K) T% j: d4 e0 Qthat device if it is installed.8 ~2 C2 f' q; x4 j- h8 @
, [' S' v, q$ {# o! q$ k
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
# A9 V1 I# Q0 a! A# T! L2 `# x7 E3 Z mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
: |4 `. d' M! S% n VMMCall Get_DDB
4 w3 o$ p4 M" |# ? mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
: h* P: t" ]3 b" m+ |8 u6 k- `; d9 |: M; e
Note as well that you can easily detect this method with SoftICE:5 E: A' X. }% |0 S
bpx Get_DDB if ax==0202 || ax==7a5fh) |# h% m4 u! M# |: I) ]& ~$ @
g2 K) e3 `& T$ x__________________________________________________________________________
" _7 W' t& _% a; a; N/ Y {$ j- ~ { z3 u
Method 10
1 ^ O) }1 h1 X8 G0 f& o# d=========' v' u8 s' e- Y! r
+ I! m" } o1 \9 M2 J
=>Disable or clear breakpoints before using this feature. DO NOT trace with
. ]& L) C* v F+ N. A SoftICE while the option is enable!!7 n5 C# n% K# P% `) i* p+ |% I
, R3 |3 ~; X& s3 U6 i
This trick is very efficient:2 [* y. a Z% b3 N7 m* p
by checking the Debug Registers, you can detect if SoftICE is loaded( [( @5 i4 u. s4 e, d7 `
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if2 a/ \/ J6 Q" i: J4 {
there are some memory breakpoints set (dr0 to dr3) simply by reading their$ {& M$ Q$ v3 T. O6 x
value (in ring0 only). Values can be manipulated and or changed as well
4 R: t( ~0 R- I- v. ?(clearing BPMs for instance)( N6 n" q H2 f" b
0 i0 ]1 |" Q9 N! R4 c: S
__________________________________________________________________________- h# ~( Q5 E5 T* q& o" R
0 f2 z* ~ C& `, D6 CMethod 11
- \) x) I9 \$ v0 [8 Y6 o=========. a2 W$ p& J; Q4 M/ M# h% _
) K' p5 ~6 b( U; x" }This method is most known as 'MeltICE' because it has been freely distributed& ~1 W1 I/ D* U5 Q
via www.winfiles.com. However it was first used by NuMega people to allow
, f8 b' T9 c' _) j6 HSymbol Loader to check if SoftICE was active or not (the code is located2 v- H+ s, E* Y% a& E
inside nmtrans.dll).; ?! f1 S5 Y) F8 w7 n! c2 z( k
5 A3 r( c5 Y# y+ @$ FThe way it works is very simple:, b1 N5 H2 ^9 a& q
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for% v2 S1 M# V2 `4 O# d' l% a; ]
WinNT) with the CreateFileA API.
2 k" ]1 g( ~8 Z$ @! e& u5 ~/ _) o% E! b; a; L% Z
Here is a sample (checking for 'SICE'):! O" H2 n& V+ K- z# z' b) }
, e4 ~/ D) U: Y g. Q! W" J% r5 N0 T. J
BOOL IsSoftIce95Loaded()
; t, H4 S& K) b4 f$ J1 e, m{
: D6 s/ y) c* V V5 i/ y# f3 x HANDLE hFile;
' E/ K' o0 W% e3 Q9 c( @ hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
; C1 b. j0 \5 p) P* l FILE_SHARE_READ | FILE_SHARE_WRITE,: k) b: V+ _0 O& h9 X6 M
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);7 v7 y/ D9 p) |# }
if( hFile != INVALID_HANDLE_VALUE )
2 m( y d9 V/ x5 L& e {& E3 m; A* ?4 I; G' o1 B3 D
CloseHandle(hFile);
* N; `2 X) r1 u. _ return TRUE;
: Z% b' ~+ Q2 G e/ ^ q }6 H9 z2 R% t/ b2 D! N
return FALSE;
& q8 ?& z; v ^& C}
3 s0 U9 u$ b* z( J$ H+ I% C' r2 ^8 l
Although this trick calls the CreateFileA function, don't even expect to be
! A2 L/ W5 Y- ?( @able to intercept it by installing a IFS hook: it will not work, no way!
: O1 {' V8 k6 Y+ `0 BIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
6 I6 `; q1 U7 Z# aservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function); E* J8 }" k3 w/ m/ m
and then browse the DDB list until it find the VxD and its DDB_Control_Proc" r1 E7 Y1 q4 v: r) U; ~
field.1 j' W/ W k7 q% j6 c
In fact, its purpose is not to load/unload VxDs but only to send a
* U5 o) \& T6 W. f* J mW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)3 x" x G8 F+ {; v
to the VxD Control_Dispatch proc (how the hell a shareware soft could try. ] g D% a3 B- \7 A
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
( h1 d# M2 ~( }. j A# Y7 @If the VxD is loaded, it will always clear eax and the Carry flag to allow
6 B; A) U; y6 {6 Aits handle to be opened and then, will be detected.
/ @/ [+ U' H& wYou can check that simply by hooking Winice.exe control proc entry point3 J! `9 [1 M( ?5 \ n: \0 d6 y7 h
while running MeltICE.
1 Y' b7 s: Y6 S* R6 ]4 _4 y+ U" ` [2 s! \* U8 k
7 t$ b% S, [4 n% T% w
00401067: push 00402025 ; \\.\SICE2 }* x+ U) j u; _- u% L# L
0040106C: call CreateFileA5 O# P* a: p; O$ J
00401071: cmp eax,-001; b5 q" `, a& I! b5 e U$ b. G
00401074: je 00401091! @2 Y+ m3 H0 h0 i' }
4 `' A) g( F3 W$ E( \
( o! p( F, Y& n; K( k1 F
There could be hundreds of BPX you could use to detect this trick.; T Y" I( y5 H! Y$ s% F5 f8 k0 a
-The most classical one is:6 L. U: y9 Y: V/ _: U2 D
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
/ w8 [9 g9 V: `, P# | *(esp->4+4)=='NTIC'- l* T0 U9 G1 k
% L- c& h9 N3 I/ h/ w( F-The most exotic ones (could be very slooooow :-(
1 D8 M1 l' z% X; _- s6 G3 ?' V0 } BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') : t7 G8 T( u" _$ j9 s
;will break 3 times :-(
$ q% @; m. N: Z4 W& `- E5 J8 N( ?" M3 M: Z. Y
-or (a bit) faster: 4 @1 O% g" h5 x! J, {) c- `6 O
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
$ `2 r. D9 ?$ b3 h r0 \' ~9 P. B, L/ r
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
: A' O; M6 L4 Z- s) h7 m ;will break 3 times :-(" h7 b, L) y( H9 J! T$ {) y
1 D" i" f' W: O. }/ k4 D% j
-Much faster:
1 s0 l* r& l; g6 L. e0 _8 x BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
5 z. e* \5 ~7 t! x3 f1 k
% J6 F6 T9 S0 _, O* HNote also that some programs (like AZPR3.00) use de old 16-bit _lopen4 M' b% c3 b' r
function to do the same job:
D8 x) e" N7 I1 c1 f0 R& K7 l
- U/ O' m4 i3 n5 h0 p) q7 _9 H7 T push 00 ; OF_READ
1 e- x W) V) \% q5 Q mov eax,[00656634] ; '\\.\SICE',0* ~' S5 s. N# Y5 F1 V
push eax
7 p1 S1 m' I. R: g: `! Z; g9 B call KERNEL32!_lopen
9 I% T$ Z0 r1 ]+ F5 t inc eax& X; U: a( m4 S" K0 i$ ?6 g
jnz 00650589 ; detected
3 Y3 p1 z& E9 @; W push 00 ; OF_READ
4 y! X* @* J2 L" s2 C4 k& n mov eax,[00656638] ; '\\.\SICE'
" M' j# Y4 X u5 m2 K push eax/ ]0 y3 ?' F# Z5 P9 R5 ^
call KERNEL32!_lopen
! M0 t8 O" c/ F' b* w inc eax$ n5 ^8 R( D# `! o1 G1 p) ~" |
jz 006505ae ; not detected* [ a7 F4 Y6 Z+ x( V/ I0 g4 s
5 Q: y* P+ F6 v0 [ `
- A2 ~4 k3 S# {$ C__________________________________________________________________________- }% W+ g. x. @( X7 O9 N
, z- q6 Y% v( E' l9 x" p: ?4 y
Method 12 p: e9 a) t+ R# |& P" p
=========* M& t/ ^5 `$ R4 P
, m0 M# G8 F: s4 {- ` r' |This trick is similar to int41h/4fh Debugger installation check (code 05) [/ H B& J: t4 p9 G Q& N
& 06) but very limited because it's only available for Win95/98 (not NT)( X! V+ x1 u: F9 e
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
, s2 a! t1 e, S5 \, ?' F5 d" G# f* [
push 0000004fh ; function 4fh$ n( X) R) G5 \9 U& [" E$ i- J1 ~5 V
push 002a002ah ; high word specifies which VxD (VWIN32)9 r" t7 g( p6 w. y; L; Y( S$ {6 p
; low word specifies which service) K/ T7 K/ ]& z
(VWIN32_Int41Dispatch)+ a8 k5 n( m6 a, Q
call Kernel32!ORD_001 ; VxdCall
# q+ O3 L- s/ O cmp ax, 0f386h ; magic number returned by system debuggers, Y. K2 Z, a: H0 T% o A4 C+ T
jz SoftICE_detected; e$ s# [1 t- ~% K. }7 g
; J v# c- `* \ I
Here again, several ways to detect it:- p2 S* |0 p b( \- E. O: y
& l$ P" p, v( n2 R1 G4 f* q1 R BPINT 41 if ax==4f
) s+ K- R6 j8 N) w4 `! X% |! W8 t, \, Q/ P- @# [, e
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one) x5 z8 O2 L! `- a* u3 D1 r5 G2 [
0 [- o8 R! D0 J9 ] BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A# M* ?4 }) U+ o$ g4 B8 q' ]/ \
1 r, b" [. O4 y BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
. U: i6 a% [ B. F% f V3 x$ _% T2 D) I1 g
__________________________________________________________________________/ A; X3 _( B4 Y% ]2 p5 ]: y1 e
$ q" _' ?9 f! y- S' A9 ^% e4 r
Method 13
0 j* J" B( D% a$ o=========9 P3 ~4 a. x; N, C4 V2 S( O
4 X( S$ o" g# G# f- I2 Y0 l
Not a real method of detection, but a good way to know if SoftICE is1 r7 F* f9 i- T9 x" Q K1 Z
installed on a computer and to locate its installation directory.
. o4 p" c+ I$ ~5 B$ s& }It is used by few softs which access the following registry keys (usually #2) :, i9 ?6 O6 j5 ^/ P2 W5 ]' x2 T
% ?* I! \% }' [4 v5 r-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion v7 g# ~4 p6 T% p- s
\Uninstall\SoftICE; p/ g% [6 \# [2 }9 M. T" d
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE7 d& b$ {- p% J- r4 o% k
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
! {- Q( W* Q+ H) j p\App Paths\Loader32.Exe
" }8 d/ f4 V9 O# H, x D" A' |' c9 L. A2 o) v4 D7 u5 R* l9 ^
# R) C+ L- X7 u& \9 {1 Z) g
Note that some nasty apps could then erase all files from SoftICE directory
$ I" V' Z5 x+ W) r% t(I faced that once :-(- ^8 R0 h( ?( F% m; i# i$ v" T
9 u0 Q \- m" V! N5 b( x% \. v7 v
Useful breakpoint to detect it:2 k2 t5 s4 O0 V! O
0 j( ?0 z6 R1 a b1 v( V BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'6 W" j+ V! j- [
( R! w; d8 L; Q N4 ]2 G
__________________________________________________________________________
% X% b9 m; z) O2 }& \* `3 f9 K
& r: o( J( P8 Z" R1 E+ g9 @5 x. c, i$ g$ W3 p
Method 14
- S, }9 E* ]7 t' j' Z( D=========
6 w G9 h/ `# E1 ?# h) k6 U% E
; D8 X: t7 b$ c0 AA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose" h- i% c2 f/ l
is to determines whether a debugger is running on your system (ring0 only).
5 [; r/ P+ H3 P' a: j5 ?0 G" G9 F6 w: ~0 y
VMMCall Test_Debug_Installed: j. \( i C' t. S+ ~ q
je not_installed6 w- y4 T) X% Z
, \1 }! `# A/ I% F: @This service just checks a flag.
7 X+ r' v- g& D' g6 J& Q7 @( D# T</PRE></TD></TR></TBODY></TABLE> |