<TABLE width=500>
+ R* _7 G2 U( T, D# r. e5 s" F6 @<TBODY>
' v) v+ I7 s9 a6 N/ |<TR>
: ^ ~4 g; a" ^" C; N7 W<TD><PRE>Method 01 ! c2 [% r( ]+ { _
=========: }/ _+ u+ H$ X+ [4 `4 M/ G
2 _& m6 N1 |) k+ JThis method of detection of SoftICE (as well as the following one) is
! V: f' `$ p0 b# |used by the majority of packers/encryptors found on Internet./ S" k/ y) ]2 Z3 O
It seeks the signature of BoundsChecker in SoftICE
/ }4 I$ G6 ^* j/ }7 r
% `+ ?! }! [" X" m# F1 t mov ebp, 04243484Bh ; 'BCHK'! R. d" \6 t# L5 E6 `; t
mov ax, 04h
. z& ], Q& J. o5 ]: c3 P2 ] int 3
$ ]" P) q# m4 d) V5 J6 | cmp al,49 Y, F3 V+ q* d
jnz SoftICE_Detected7 ?$ H$ B9 A. p3 S
7 b1 A- B8 `& b* w6 N7 I
___________________________________________________________________________
+ w2 W4 N8 V# O! ^ u
3 ]0 |. P6 ?4 S( N) PMethod 02- u/ C8 f0 X+ T; q( S" P5 N% ]6 @0 u
=========
* L1 R2 U x/ t6 X) U U) C" k+ Y# h# I
Still a method very much used (perhaps the most frequent one). It is used. p4 q. g* ^& {$ K
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,. N& G. q; Z t1 N: Q' z
or execute SoftICE commands...- l2 F% \5 T! i8 C: C5 m5 q
It is also used to crash SoftICE and to force it to execute any commands: W8 T! ]( a! g5 D4 F+ r! m
(HBOOT...) :-((
) q. O5 y* k, |5 h! V
" v9 G& a# k2 DHere is a quick description:
8 j- n1 Y( H: X4 B! M, {-AX = 0910h (Display string in SIce windows)
4 k- R- ~$ P% }/ ^5 l-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
* F L: P# X$ x! ~4 [. t8 c-AX = 0912h (Get breakpoint infos)
, {$ O+ s$ k6 K# D8 x, p-AX = 0913h (Set Sice breakpoints)0 U3 F* x+ x6 p0 O/ D
-AX = 0914h (Remove SIce breakoints)
0 s" ]# Z8 z% b3 r% K4 K; U3 L& t( U$ k0 R) M
Each time you'll meet this trick, you'll see:
. ~1 u- Z! i* F. l4 D3 c-SI = 4647h+ B, y1 ~5 f: h& r' g. O
-DI = 4A4Dh
$ Z0 g0 w( q- V3 n+ uWhich are the 'magic values' used by SoftIce.& n% z O- ]1 W+ v( c
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
c* h5 `: c7 K
0 l/ \! l1 V \Here is one example from the file "Haspinst.exe" which is the dongle HASP
. a o& E$ y/ Y. |; Z5 {Envelope utility use to protect DOS applications:( _+ a) N) p) W, s- `, {( M' ]
9 z7 _5 S: b+ A, n+ r
8 P/ q! a q! A% r
4C19:0095 MOV AX,0911 ; execute command.* m/ I- S/ [3 ^. `7 u- w
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
* k& P4 C) J3 p4C19:009A MOV SI,4647 ; 1st magic value.
3 @' ?0 v% _3 X6 C) L" E9 F" d4C19:009D MOV DI,4A4D ; 2nd magic value.$ U) s9 g. c8 k6 C
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)- Y. z. ?1 H8 N$ A! X
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute! Y& z9 W. j8 |9 X1 V& N4 b: P
4C19:00A4 INC CX
# d( \! x* v' B& ]' Z* P4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
1 B% l3 m" h# {- C4C19:00A8 JB 0095 ; 6 different commands.
7 i; Z# c; d' I) {8 D4 K% y0 Q3 m9 t4C19:00AA JMP 0002 ; Bad_Guy jmp back.2 F- | [8 B$ K- W
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
4 U7 M+ X! H. x" u8 A9 k4 a" o3 v) H* x/ J ]5 m/ ?& @
The program will execute 6 different SIce commands located at ds:dx, which
& M/ Z0 g* d# m/ O& g& }) O! L3 Pare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.# h/ T- }% }& T) V1 s$ l: C
% h: p2 L; R0 s* I7 b
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.3 e0 L, o3 M: Y0 ^% D
___________________________________________________________________________* n1 h8 A5 V4 m' a" h6 l) x/ c
]* P. u0 J: F) c G5 d$ G4 r* V Z$ e6 K: i
Method 03
' N5 r+ ~. c, k/ N0 {=========
- }8 T+ ?8 x4 X- C) y- R
4 k* H; n: w3 `7 v5 HLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h. ~; E$ y' G2 O# W% }
(API Get entry point)0 b. Q' p- \6 B& x$ b6 X
$ H2 s' s! N- t: o" s( F& }
" e0 `" i t+ d7 @$ D
xor di,di
( o" N$ G8 h/ V& N R) ]2 p mov es,di3 K* ]( a: D! t! o; {
mov ax, 1684h
4 _( H/ H- g' [: i6 r6 _ E) S. t mov bx, 0202h ; VxD ID of winice) O: ?6 T M+ l
int 2Fh
. N. r1 c% g' x! x R j; m mov ax, es ; ES:DI -> VxD API entry point
% t7 |& z! s* [; O, @, x5 |$ o add ax, di
- G# ~* U+ x# e8 j+ x+ [ test ax,ax
. b0 y8 { j# S3 j- } jnz SoftICE_Detected i' j0 H8 b9 \8 C3 A! G( ~9 I
. s: C+ K6 a/ W$ {) A# O) g* y___________________________________________________________________________
% b2 W# v+ g& H+ I' e) a
4 M6 F8 \0 ^' t3 wMethod 04
$ X) g0 }* Z* E8 f' D3 Y, k! l=========! @# u7 G- ]( U- H& i& s/ x
z& [/ K6 r f
Method identical to the preceding one except that it seeks the ID of SoftICE6 R# C) Q9 b+ W: H
GFX VxD.: V$ h0 Q+ P/ ~* q, e
- v# {# m6 @1 T/ m: S9 J1 j/ z
xor di,di
, j ^1 U. K; T% @. ~6 C5 i: V mov es,di" t \7 u7 a6 A7 n: I3 P. N
mov ax, 1684h
" [( r% o" c; @ G: V5 f @ mov bx, 7a5Fh ; VxD ID of SIWVID
: ^' c9 V, \6 v' d int 2fh
" |' b$ A% o% w* g" h+ Y: V mov ax, es ; ES:DI -> VxD API entry point
, e3 b' l9 V) c- ` add ax, di
( U3 ~: ^1 o2 M/ }4 @0 X test ax,ax- p6 i$ M- ]8 [( M9 O
jnz SoftICE_Detected
0 t2 G/ E* b% V5 @/ }3 Z- R" g* T
9 s, I6 n1 r% J5 b7 D; N" e__________________________________________________________________________3 c+ H* w/ Y) L, @
' |- |: M0 E: g- U) w1 t3 F. x3 ]* N/ h
6 ]3 H& T. k+ A( u5 bMethod 05. z' l2 }9 [, D) j( [5 ~" w$ ]
=========6 }- o; Y* \6 y( G' r5 C- J
$ Q# H8 X2 ^. L: o" ~8 \- I
Method seeking the 'magic number' 0F386h returned (in ax) by all system
: x* o+ U& o- T, L& [% I, j2 Xdebugger. It calls the int 41h, function 4Fh.
9 S3 y$ i: d0 h# VThere are several alternatives.
9 r# n5 ?. Y/ |8 [
$ L" S! l6 `( K: ^: [$ s, CThe following one is the simplest:; X# ]( H! d$ w/ S) `, E% i) Z
5 ?/ X/ f% [3 y+ A+ ?# y: h. k9 |
mov ax,4fh- |5 e5 Y* A5 _% O/ | i8 N
int 41h6 ?& P f3 R) z3 b% d
cmp ax, 0F386
/ b; |4 W& w' }, g& D jz SoftICE_detected
$ f1 {; N& t7 f0 Y$ z% ?3 R1 }- H- c7 X; m9 M+ n- |) O0 {+ s% m
- v4 U: d5 Z0 ~8 n; INext method as well as the following one are 2 examples from Stone's ! z& G& r9 z; M) j* a2 A0 \
"stn-wid.zip" (www.cracking.net):
. r! X A& K A ?+ F) V1 D v, ]# Z, K' K4 v, v
mov bx, cs
% A T. R- w+ I# s% U( } lea dx, int41handler2) |9 v- ?; W1 ~6 A
xchg dx, es:[41h*4]
. z) E1 M: Q7 } xchg bx, es:[41h*4+2]
" F: z6 ~( R4 } mov ax,4fh9 j) U" F2 J+ C8 }1 q- D7 i
int 41h2 [" i/ x" U9 u9 U
xchg dx, es:[41h*4]
9 {% M7 @( ?3 e7 k1 k2 m- J xchg bx, es:[41h*4+2]
% W9 m+ C \7 s cmp ax, 0f386h" w8 D0 S) |- Y2 a+ Q b& T
jz SoftICE_detected
0 d) u! [2 ~6 R2 X9 ^% W9 ?
6 }& G$ G) _& B/ K7 ^$ ?: X7 \( lint41handler2 PROC
+ I, Y& f/ e3 [/ ]6 x" @; t- k iret
% C- t; }: m- fint41handler2 ENDP
e6 ?; D$ q: N( n) ^+ G! ?* ^6 N7 ]( H2 @
& r3 t3 T2 k D N1 l1 E
_________________________________________________________________________
: P4 P0 y0 u: D! `8 \% ~2 o- g8 r; V" i+ l/ F2 L y, ]
, k# v( I% R% w, q: z) \Method 066 F! I' `, L7 W. ?
=========
* H5 P4 S. I3 ~* [/ h, B
9 {: i# M* w/ ~% e9 }1 i U( e4 D' i& |% @/ H
2nd method similar to the preceding one but more difficult to detect:7 [+ w( O' _7 T/ e. o
7 f: p' m) C3 m" s6 S+ F1 p
& z& H0 C& |1 i! _+ t' mint41handler PROC, r* H8 @% n5 x! @- [- f. d
mov cl,al
$ o5 \, X: L0 v+ _ iret
! X5 |( y4 J9 {# eint41handler ENDP% S: r" S' U3 R/ U$ p! f5 M8 _, u. u
9 V/ Y- A7 b9 c0 m
5 ?8 A% W# D+ q9 {4 ?5 i, O% t xor ax,ax
7 a( H1 a. f# T mov es,ax
& ~- p. h7 H2 x* | mov bx, cs
* G5 r* o9 S. r$ d+ Y8 c) k( Q lea dx, int41handler
/ u; [' F% S7 z) z* K" g xchg dx, es:[41h*4]' N% {4 e: \# v- Q1 m
xchg bx, es:[41h*4+2]- T0 K3 Q8 K6 d6 T4 i
in al, 40h! O( Q3 k9 `4 m
xor cx,cx
4 F% K$ ^! q7 k$ K int 41h) @; u1 G' @8 S- W
xchg dx, es:[41h*4]
. n! r7 f1 e8 z& s xchg bx, es:[41h*4+2]
$ g! A/ u+ j0 H cmp cl,al
% T' ?) N' Z: ]" z) \ jnz SoftICE_detected7 Q; E1 `. d {& l( Z
8 b+ d5 T- ]! B, Q- N* p_________________________________________________________________________8 w4 `2 g( w6 A, u/ ~
& R$ ]8 P( k, TMethod 07
6 L. S/ N. _# I: }=========
5 i0 m1 s( `* }& W, a* |) v0 u( K% n. c* L
Method of detection of the WinICE handler in the int68h (V86)
5 Y& u+ a, U E- |5 Y
, ~& z. I" Z( v mov ah,43h% v! @1 Y6 \6 T' m& ~' W* k$ A
int 68h
1 u9 X) V& ?! M; F cmp ax,0F386h! q, ^1 ~6 W3 X: ~# j2 C, D
jz SoftICE_Detected6 S) G- ?/ ^, i5 H; q
1 ?! \/ Q$ t' M; O1 M) W4 y
& L2 G$ M, B/ D& J0 E, r=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit& _4 k; ?2 P2 \6 c* z( k
app like this:3 H- D5 [0 t" o
' l& z: w! z7 f- C BPX exec_int if ax==684 l) H9 Z4 |/ G$ \' ^. c
(function called is located at byte ptr [ebp+1Dh] and client eip is
( U! E5 C) Y9 ^; y4 h0 z# c located at [ebp+48h] for 32Bit apps)
" D$ g& Z8 Q3 X__________________________________________________________________________
U0 U/ F. S) y
6 Y& \. h. S6 Q( D8 D+ m E. z. }; g, ?# P7 s& c
Method 08
2 _3 E. G4 I2 c' v4 Q=========$ L M& W+ E+ `$ }- z
3 c$ D/ K3 ?3 I2 R
It is not a method of detection of SoftICE but a possibility to crash the
( M! C' @0 o2 c7 R5 wsystem by intercepting int 01h and int 03h and redirecting them to another
1 s; }0 H. i/ W- W/ Oroutine.
- U1 B% t& _* e* \) ~It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points9 f# w& H7 \) y/ o. Y
to the new routine to execute (hangs computer...)9 A7 m1 Z/ o+ W
& R$ q% C: V0 ] mov ah, 25h
$ u, p. I) b' K7 F mov al, Int_Number (01h or 03h)% p: e, p6 T$ e. @1 L
mov dx, offset New_Int_Routine$ _: K, s9 W( a2 u+ N3 F ~% J7 ~
int 21h
b- ~# o1 S9 ~/ P8 R+ X* c
% l E; n/ }! a: Y2 C__________________________________________________________________________ h7 T. ~2 G: b- E: U
" J" J( o. I9 z. e3 }) ^+ I1 v
Method 09: A. y/ l7 W4 {, A3 y+ X
=========, @) y9 R$ z. n- d# p6 A; ?3 Z
# j5 x; M- b: k3 v& V
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only/ U, T% m/ [& r
performed in ring0 (VxD or a ring3 app using the VxdCall).1 Z- L$ ? @+ W
The Get_DDB service is used to determine whether or not a VxD is installed
/ U5 D: o/ e ~5 p+ ofor the specified device and returns a Device Description Block (in ecx) for6 d* p$ b6 Q7 N" @ m
that device if it is installed.
0 G' G! H8 Z) S }% \5 M( w# l$ H, D. }8 M
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID: K) t7 [% E- O' b
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
: w* e* p6 q) Y. A) _ VMMCall Get_DDB) o& z( x; G$ t8 P
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed( f5 c: h( g$ i- B1 q
$ { }2 L! R7 g3 n f5 F# d+ t/ E1 pNote as well that you can easily detect this method with SoftICE:
1 ]9 v% N* X/ `3 f- b bpx Get_DDB if ax==0202 || ax==7a5fh4 @3 h' a0 g: m& ?9 |, A
3 T# P9 x1 ^3 f6 P
__________________________________________________________________________ k/ p8 Q0 j+ M! n9 N
6 ?7 S3 R% c: G- kMethod 10) h$ B4 r9 R& t8 P4 \
=========! f. P1 A4 V( m1 L( J* V* v) X
" B/ `3 b- x: l; F" Q) N
=>Disable or clear breakpoints before using this feature. DO NOT trace with
) Q u5 H$ o/ B SoftICE while the option is enable!!1 p* {! a/ W) G4 Q( J
+ A; B7 ?$ G1 Q, K a) Y( Q
This trick is very efficient:
) I. z8 F) A% u( i+ q: V3 ^7 s" oby checking the Debug Registers, you can detect if SoftICE is loaded& V* U4 J8 K `& O$ U5 m
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if1 D W% K8 R/ C/ L' O0 N b, M
there are some memory breakpoints set (dr0 to dr3) simply by reading their7 }; ~9 _& ? j) j$ Y( Y
value (in ring0 only). Values can be manipulated and or changed as well" F, @% D% i' L" K
(clearing BPMs for instance)
V0 x- n. o5 U3 r7 s+ U" V. Q0 ?! |$ f
__________________________________________________________________________
) k0 j4 E; T: W4 l7 j8 ]
2 @5 k. I* {6 x) |( wMethod 11# L3 Z0 [7 M) V4 T: C, p
=========+ a$ H' U, ^# w7 Y2 x7 _
; B' ?) V% u3 F% s; QThis method is most known as 'MeltICE' because it has been freely distributed
: F, v: m4 \" j5 J: Qvia www.winfiles.com. However it was first used by NuMega people to allow
1 G0 R2 u2 f6 {7 W9 ISymbol Loader to check if SoftICE was active or not (the code is located: l5 X) z9 l2 u. I2 E o8 `) b) c/ C
inside nmtrans.dll).) h% Q* e1 k( I% n- i( M. {4 M
4 l1 S- E8 D! @6 _6 C% R$ \The way it works is very simple:
V8 s; a, @4 h9 SIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for- M+ q( b! i7 E: ]$ U5 j
WinNT) with the CreateFileA API.7 v$ q0 t9 F- T" W/ |6 x# J
" M6 _, ]0 Z4 [7 {: x
Here is a sample (checking for 'SICE'):9 b: S1 ^' c8 N7 U! `) q" d
3 K, ]) c, i" [$ M( x7 B0 {! SBOOL IsSoftIce95Loaded()8 T& [0 z& v7 W0 h0 E/ L% J
{) Z% a2 E. U0 e4 Z3 ]5 O
HANDLE hFile; 5 f4 q/ G9 c9 @
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,/ q# K9 |' O6 `4 Q, \
FILE_SHARE_READ | FILE_SHARE_WRITE,
3 w" X& K! V+ p" t( L; E& N NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
; F' q& e- y. D& J5 D if( hFile != INVALID_HANDLE_VALUE )
& \+ |0 J+ [2 B! l: e {
" l: ?' Z$ i! i8 r1 E CloseHandle(hFile);
1 W8 o" z2 \- J# ]3 d return TRUE;" N2 Y* Y- V1 G1 H( |; e$ \0 G
}$ f( z4 l# g% U
return FALSE;# B1 D, G& Q$ q9 W+ @& T
}
. o4 Y; [$ T" V' o. G1 y- [2 ~% O
Although this trick calls the CreateFileA function, don't even expect to be
0 y$ `; X$ E: \able to intercept it by installing a IFS hook: it will not work, no way!' z" {' V% ^) U0 U% T5 C. N
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
7 ?# d! R; k, ?. f2 ^; Vservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
- t1 U0 N( I. R3 H y8 D5 Sand then browse the DDB list until it find the VxD and its DDB_Control_Proc
! p* E" W# t/ W, |$ q* }, {: B+ @field.. V. c Q9 X3 ^/ ?( V; B
In fact, its purpose is not to load/unload VxDs but only to send a
# Q# l8 u8 A- \W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
! N. p F8 s$ pto the VxD Control_Dispatch proc (how the hell a shareware soft could try+ W, b9 y" h7 a: E- d$ C5 ~+ y
to load/unload a non-dynamically loadable driver such as SoftICE ;-).& d/ I- s1 k' g8 h! h
If the VxD is loaded, it will always clear eax and the Carry flag to allow
1 F X6 V6 e/ ~( R5 V. aits handle to be opened and then, will be detected.
; C) S$ Q3 t) O7 x" |You can check that simply by hooking Winice.exe control proc entry point
. Z* C1 \5 b2 c4 J* o0 {% T. Owhile running MeltICE.+ s/ `+ W3 N. z" l% v7 P; w1 z. W
$ V0 K2 Z- S. P. h, p( I- d3 g6 B6 t; o8 d$ W' h9 p0 d
00401067: push 00402025 ; \\.\SICE
& h6 h4 S) ?# G+ R 0040106C: call CreateFileA
: j0 s0 i! R B, X 00401071: cmp eax,-001
% m+ c* R) u" }$ I* y 00401074: je 00401091
& r' H' s' v5 l* w' q& {. b+ ?6 O$ x! Z( v0 `: T) j
% S" E# l0 q6 N3 L
There could be hundreds of BPX you could use to detect this trick.3 _: ]8 K) A% o8 K( w9 b9 g: p; y
-The most classical one is:
J) C+ B0 U) v" o* j BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' || ?: x( b) e9 X
*(esp->4+4)=='NTIC'' D4 U, l* o! f( V7 w& R
7 E/ k5 ]/ z* q; h-The most exotic ones (could be very slooooow :-(
2 Z) Y! |( E* ~0 A BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') . E' J' ] M0 D( G8 w
;will break 3 times :-(1 O+ S$ t0 ?& @5 t' q' r
% s1 P8 V7 |+ V
-or (a bit) faster:
+ m4 W; r& Y1 z BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
( }5 C0 u" N3 S
; A$ S" e5 e' j1 f BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' & }; \& X1 T) v y! m
;will break 3 times :-(
" A \6 Z5 Y1 a+ y; `1 |2 Q$ @4 z# a2 V1 {! d1 W
-Much faster:$ m) u& E2 I, T" f
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
{2 c; T& p& ?5 z) d' g% c* O0 z5 U2 y+ d) n: J5 d7 [
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen' J2 v J, F6 _2 k
function to do the same job: }& o: @; w7 B
6 B% a4 \) C3 L2 p9 X* \ push 00 ; OF_READ
# o5 }3 ~3 O( e mov eax,[00656634] ; '\\.\SICE',0
# ^: t- E) K5 b3 t1 K v push eax. \, v9 j; ~5 r% [% [9 P
call KERNEL32!_lopen
- G j+ l3 l" I2 X( h inc eax4 m4 o$ Q/ h$ X# o
jnz 00650589 ; detected! q6 N8 _# z& R. p0 ]% `
push 00 ; OF_READ# _% C' U" y# a" G
mov eax,[00656638] ; '\\.\SICE'
! |) R9 l, R& |8 r* v push eax
% W$ Z& Q! m2 H: k0 i call KERNEL32!_lopen; s0 a; f' `+ @2 y
inc eax+ S4 l7 ~0 j; f& N
jz 006505ae ; not detected
: `4 O. A( \7 o. h3 W5 r: Z! h" N# m' N$ f; o- S
/ Q: ^7 ~1 e/ `0 k
__________________________________________________________________________
# x2 H4 Q# r5 M( B' l d. Z4 i% ?7 @% L2 y% m
Method 12
. D7 M, E4 `) ?" q7 Q0 ~" L9 y; Q0 y=========
- M( B7 D+ a8 i+ ?
& b+ l; j- s9 C) k3 S! w# s' r3 L `9 JThis trick is similar to int41h/4fh Debugger installation check (code 05
J$ U) R6 J* C& 06) but very limited because it's only available for Win95/98 (not NT)
4 h2 H6 Q2 [1 I9 T! z# ~2 Was it uses the VxDCall backdoor. This detection was found in Bleem Demo.
% j {+ U, C% }7 c6 y5 {1 L
/ n5 c( i, e8 L' l1 O3 l push 0000004fh ; function 4fh, ]/ l1 r! \+ ^) @
push 002a002ah ; high word specifies which VxD (VWIN32)% l$ t/ P/ r: ]* {
; low word specifies which service* J0 V, X8 y' l/ H
(VWIN32_Int41Dispatch)' v& N' N7 U, ?6 \
call Kernel32!ORD_001 ; VxdCall
% q/ R V% ` h3 v cmp ax, 0f386h ; magic number returned by system debuggers
6 _! C/ v4 W3 f1 J1 a" d1 a jz SoftICE_detected
2 A# w1 M* H+ }. e; ~
! {% X, w7 h/ t; {; U3 m) e$ ]Here again, several ways to detect it:! I2 v. A" Q- x' v* }7 a
1 U6 U* R- d+ M/ [
BPINT 41 if ax==4f$ }0 p- P) |( w4 y
7 t) j. S8 l" K2 `, H* K1 d0 v# d; \
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one v3 d2 _( I) X& Y8 q
9 \! G; }" S/ Q9 Z7 m4 Z0 C4 H BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A# e/ h( c7 e' u' q6 R+ B' l
* b0 {6 }& o* N1 E F BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!! `% S; _( w* z
) S# ]4 L Z. v
__________________________________________________________________________
7 G9 I& e8 s7 z& V5 Z* N' K+ @) ]2 C/ H; H# R! |9 K! u
Method 13
$ Q6 x+ x7 K, r( t ^=========/ f, ~. D, [! f( m% I9 k9 A
- B/ U% i' ^: V, W5 I
Not a real method of detection, but a good way to know if SoftICE is
$ r% a( |' T" ginstalled on a computer and to locate its installation directory.
/ r" z% j- R; i! A* ]It is used by few softs which access the following registry keys (usually #2) :+ T1 I R$ m( C
6 ?/ f0 V* D2 h& c) c-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
$ {. W# {. {& ^0 I4 J" G$ V9 L\Uninstall\SoftICE1 A9 o' r \ Y2 @6 ~4 O% J" S/ v4 h
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE' z" i3 `# J' m2 T& P
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion6 B: {7 O3 L" k! _; E$ {
\App Paths\Loader32.Exe4 T& h S( G9 H1 t3 d
9 K/ G, O0 }* p5 b1 D- B' v, b" H8 a' u/ ]
Note that some nasty apps could then erase all files from SoftICE directory( B% M2 r4 j' W
(I faced that once :-(3 G# l2 a7 T5 `7 ?5 E
1 k2 w9 F, L9 Z* B, V
Useful breakpoint to detect it:- M) U# C# T, T! ^
2 @' u! ~( U5 k: @! Q+ z9 @4 R
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
1 B2 j4 D0 ]8 }# w: d9 q( N: A& u
__________________________________________________________________________
, j& D3 I1 G$ x/ E2 K) w4 i6 @$ o- e: M9 x1 F6 A
" R' Q c) |3 M) c' DMethod 14
! i) I- ?$ o. b- M* P- Y=========! A/ ^3 E: R% J
1 S+ }$ \ r2 \
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
. S) d" B( ^0 b+ J( b/ z0 Xis to determines whether a debugger is running on your system (ring0 only).6 j& P0 y; W/ V0 o/ n0 K
4 m, M4 }; o! p. e& P. @: C/ v; C
VMMCall Test_Debug_Installed2 n5 X. v6 i4 I2 d7 O1 M8 X5 |
je not_installed
. ]; c! k- P/ ?6 r- }* e. D2 h0 W
. @2 V: f* w& G1 M. }This service just checks a flag.( A/ N* a+ ?% X. D
</PRE></TD></TR></TBODY></TABLE> |