<TABLE width=500>
$ f- O- ~ ?4 e1 T B" A<TBODY>& R% M8 X1 R. ]" e, c
<TR>
1 F5 l% N) \7 ]- q$ a/ s<TD><PRE>Method 01
2 k7 @ Z+ B7 d" f6 h- {8 Y5 u! i========= v& O( ^, A5 N- H: k: E9 C
0 P$ J" Z/ e2 ]
This method of detection of SoftICE (as well as the following one) is
/ x3 B( I2 Q& Q6 \8 |8 e- z# Kused by the majority of packers/encryptors found on Internet.
& x6 l) q2 z" m/ B# X9 hIt seeks the signature of BoundsChecker in SoftICE
2 y" f( s& E6 m, S; k3 {
5 Q- s+ d( s- N9 M% K- K. n4 b G mov ebp, 04243484Bh ; 'BCHK'; J3 W; r( G3 V0 Y! [7 W, W
mov ax, 04h
- K9 W9 E3 Z* ^1 ^5 ` int 3 * O& f$ a( E) ^# O3 @. B
cmp al,44 q0 {% j6 L+ g2 L `0 P( j% U g8 k
jnz SoftICE_Detected
6 z- p+ R$ f @& T) v' e" B! L
3 E/ u6 K; B% C+ Y6 [___________________________________________________________________________
. g( M" c) p# H/ ]" |1 o
" ?* C& ]0 |7 I& F+ e8 c& cMethod 022 y4 W3 k" t* u' x) v: ]
=========
. O# ]. ?, {% R$ J2 N. ?5 M- w6 q: b5 D
Still a method very much used (perhaps the most frequent one). It is used
9 Q8 [/ A6 x. u, C$ dto get SoftICE 'Back Door commands' which gives infos on Breakpoints,, k6 H( R9 o, a8 p
or execute SoftICE commands...
N* w8 W. j9 d r" aIt is also used to crash SoftICE and to force it to execute any commands
" `3 I& N( A: t. K+ f; Y(HBOOT...) :-(( 1 A( c. B3 ?3 G" }+ O
" a# e, x q& t, e5 X) D) q; C
Here is a quick description:
8 s6 m8 L2 e- [-AX = 0910h (Display string in SIce windows)
8 _1 P. ?* A0 T+ w2 _9 o7 W1 Q-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
$ i; k& `$ T; j6 [- w* q& H-AX = 0912h (Get breakpoint infos)
# J% j) i. J6 D! j) v-AX = 0913h (Set Sice breakpoints)
/ T5 D+ Y8 w7 }) u4 C' N-AX = 0914h (Remove SIce breakoints)% m. m/ H* a4 W" {8 S
+ w& u C( j' \& B
Each time you'll meet this trick, you'll see:
" E/ a& ]" K6 [3 \5 D-SI = 4647h
( M0 q! p: M; V8 j-DI = 4A4Dh" L$ [+ q5 J1 d
Which are the 'magic values' used by SoftIce.! ^ n) P3 _6 P. V; _8 U
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.1 Z7 @2 i$ @; r7 H! [. L/ Z
5 L# a( J- b: {$ M* ^
Here is one example from the file "Haspinst.exe" which is the dongle HASP9 e8 t J, |: M) _
Envelope utility use to protect DOS applications:* g( ^+ Z' h" U% u" k$ s7 o
; @9 w8 s$ e* @+ \
) S6 b y. I+ D4C19:0095 MOV AX,0911 ; execute command., c3 S( w( G. s$ X
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
. n' \" u: }( s* P, [4C19:009A MOV SI,4647 ; 1st magic value.
1 ?7 _( Y! F' E) L- X! k) O4C19:009D MOV DI,4A4D ; 2nd magic value.' U) _- e4 M5 _. A" p
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
; X' \8 |0 H4 ^& r# p2 o4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
/ [3 F; J4 `( |# E& ]8 V4 n4C19:00A4 INC CX
/ m3 p; }( f; y4C19:00A5 CMP CX,06 ; Repeat 6 times to execute. m$ K7 I( {6 z+ H, h: Y: h
4C19:00A8 JB 0095 ; 6 different commands.0 y7 H& ?1 u7 u/ \ S* R
4C19:00AA JMP 0002 ; Bad_Guy jmp back., u* W# X/ Q& V* c U; u: ^% w
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
( N8 u. a# P1 A9 I0 ~8 h. V9 u+ o7 z" R$ ?1 Y* e( r# w
The program will execute 6 different SIce commands located at ds:dx, which
6 |5 U, ^+ C1 t8 ~/ N% z, {are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
7 C- y9 K! g( L- A
& V5 c) V) J! v. Q! J3 S* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
% i/ o: N* q5 T+ r3 Z) w5 S___________________________________________________________________________
8 \5 J& x8 C( ~3 A/ s
$ k4 m" J& q4 D( A9 c6 U
- e% @( m% G' T/ W/ V% xMethod 03: M e5 H! q: O) ~8 N6 @
=========4 W ~7 W9 a8 S
* O0 W# D+ Q5 ?
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
' `# J/ s. U8 Y& A4 C: g(API Get entry point)
4 `7 U8 p* `9 r2 E Q$ Q k
/ v8 D7 Q6 g j: ~3 D- b0 I6 H* f* O4 H b, K% g
xor di,di
# x) C7 w: B+ q8 A4 ?& Y" Z mov es,di' S3 {/ s' \: Z9 [# J* I
mov ax, 1684h
! p3 u* R& D2 A/ h! Y* m mov bx, 0202h ; VxD ID of winice! a7 [/ ]! X- N
int 2Fh" R: a# Z- Z5 G
mov ax, es ; ES:DI -> VxD API entry point) G" q# H% d5 O$ r- Y) o, u) q, @
add ax, di B1 K& O+ v' S
test ax,ax
3 [8 O) `! N% u. z jnz SoftICE_Detected! o: {7 n, L, a: I: Y
7 H, T% s q* T
___________________________________________________________________________4 J, E' c( x0 t5 E' f" V7 ]
: \8 c& }2 x# _6 _6 B$ N/ ]: FMethod 04
! q% ^, R$ J$ {" o( U0 v1 f=========
- \7 U/ m5 Z1 b9 b6 Y: b0 r+ ~) T
Method identical to the preceding one except that it seeks the ID of SoftICE4 y& c$ [6 s! B, {
GFX VxD.# I8 r3 e; U" b( h0 k p6 F ^$ C
) |( } A+ g5 z, d9 T/ R xor di,di3 r. I4 W; D2 b2 v# u8 ~' j/ b7 C
mov es,di. A B7 [ G5 v! H9 ^) L
mov ax, 1684h
! u$ k; a- g" p& u mov bx, 7a5Fh ; VxD ID of SIWVID8 F' _1 @8 d! D* T0 a% x7 H& Q
int 2fh" r6 }! H6 I- q- E' { A
mov ax, es ; ES:DI -> VxD API entry point; a9 ?- \! e7 f* R, n* ~3 P3 o
add ax, di, X: P9 u+ h/ {. A, e& {
test ax,ax
5 U5 g0 E/ ^+ T% _9 k! M ~9 `4 v jnz SoftICE_Detected; t& ]+ L6 B! l: P
6 X4 Y0 U: v' S__________________________________________________________________________
2 {" K7 q3 o5 a ~5 P6 R5 g1 V! ^& R. K
% _! U% O' X1 R, E8 k- l
Method 059 s @6 w4 ~0 x9 U5 A/ k
=========
# G4 A* |& J# Y4 y- m
& u5 t* n- \7 }* \2 |/ \Method seeking the 'magic number' 0F386h returned (in ax) by all system
) v1 e! U2 |2 w1 O- Odebugger. It calls the int 41h, function 4Fh.7 \! U. b3 m" z6 e. _5 c
There are several alternatives. ; ]% i& ~% O6 i D
- }8 M( K3 M7 Y! S4 {" N# \% x3 S
The following one is the simplest:; ~2 i" Z6 h- ^1 y: i+ G9 x
' n- z, E( C6 k$ W% }5 v }
mov ax,4fh! Y: L0 m d, s5 l" z9 w
int 41h. w) V" h1 Y: w% X; i
cmp ax, 0F386
+ {& L1 o' i" @8 @9 z! ?, [ jz SoftICE_detected
- O( \; ?2 l$ {* l% ~1 D5 |3 B1 \$ n# R) m3 t
$ N# `7 H j- r* ?# SNext method as well as the following one are 2 examples from Stone's
# R$ g% O3 ~) ]' ~" _# c( n"stn-wid.zip" (www.cracking.net):
+ E9 x0 g7 p1 C3 i/ e0 l9 D
/ \ `, f, ]' e mov bx, cs
) {. f2 D- |) z: u lea dx, int41handler2
6 g( ~8 M! S% s6 R9 n, z/ v% R xchg dx, es:[41h*4]
0 I# u' |2 _. Q( m l0 h U xchg bx, es:[41h*4+2]
- |& }0 j! x! \6 P mov ax,4fh
. l$ k7 _# ?' w9 ^: T0 _ int 41h
: h$ y5 I* B& J xchg dx, es:[41h*4]% j/ s/ l/ I8 K( q, V V- q
xchg bx, es:[41h*4+2]
1 S! m% s' S, n1 j: N) Q cmp ax, 0f386h
! q) U1 G# V& J* `; P2 l: y jz SoftICE_detected
( `: p5 n) M" l9 B# V/ C( |1 J9 m' |/ |; ?
int41handler2 PROC
; B4 T+ I6 a" b- a9 Q* H1 M. H/ p iret
" Z: _% G6 Z; c6 d$ H5 tint41handler2 ENDP
0 g; P. x& G/ H: p0 e
, p/ b7 t0 a8 h: ?7 f' e6 O$ u: E" `( h! y! z! n6 I2 T% u# {
_________________________________________________________________________
1 G' [% K; X- }/ H' z" Z7 O8 \0 o# d# w# N
6 L) `4 J% C; W- E2 x2 HMethod 067 F: `% S6 {# [
=========& u6 X' n/ x" S6 q1 L& B8 H
( `; p o* r% D2 M+ h' A
; c" V7 n8 \) a1 V$ j2nd method similar to the preceding one but more difficult to detect:: s4 x' n( `" n' i2 O9 N L6 R
% l: D; k+ m4 M7 g( `9 v
: m- P- @; _* A8 ~% C6 x
int41handler PROC
# X9 {, y* J$ B' o" F mov cl,al5 p2 G8 T( v+ C& s9 g8 G' w" U
iret
" L. @8 D3 W- K2 _5 Cint41handler ENDP
1 Q7 i, n+ Q2 [" I/ I, N5 d' c2 ~1 _, Z' Z& [
% s' B9 u2 y6 O: i- | xor ax,ax
% \5 a1 V$ D; d. ~/ ^ mov es,ax
+ w ?7 Z) K2 [) R' y mov bx, cs
5 [% q- V; O5 m- H9 \* x& ` lea dx, int41handler
! _* [; s& l, k1 ~" s9 ? xchg dx, es:[41h*4]2 p3 a* T- Z3 }/ }
xchg bx, es:[41h*4+2]: K! [- ?: I7 s7 @
in al, 40h
2 U# w1 T3 v+ `1 y* d6 i xor cx,cx' q( O/ f( R: ]) l e
int 41h
3 ]5 s: O8 `9 g xchg dx, es:[41h*4]
! r1 B* G3 [3 ~ ~. q xchg bx, es:[41h*4+2] y& ~, z8 g$ A" D" I$ v4 |7 O, [
cmp cl,al
. @! a0 w( \- v jnz SoftICE_detected
$ S2 I( m% \! F) t
; e' p; z& _3 `( i$ y_________________________________________________________________________
# \1 `0 C2 {: H4 F$ W/ z. `; A- R& L& F$ {
Method 07
. L1 ^6 i2 u! _5 v=========
8 g( J1 V: N8 a9 ^8 ~% {' u& g( f2 g: \; I- R, c) I
Method of detection of the WinICE handler in the int68h (V86)7 f7 ^7 u6 {/ |
3 b N4 H$ X3 i8 u) n' T+ S6 q
mov ah,43h, H5 K# p" G; W' ^# v" _" C' b
int 68h
! @3 V- |4 v" K# S' O0 R4 L, m- O cmp ax,0F386h+ ]/ g. q+ i: ^
jz SoftICE_Detected3 N3 t1 F7 m4 m7 q3 c6 i1 S
2 H$ S# a w6 @6 c, n
0 L9 |. R' k6 r: l4 B- @8 E' F7 F
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit. ~3 {' g3 E3 G- k" |* X
app like this:
$ w2 I1 J! }' T! c# w/ Z
* D0 J( `# l1 ?0 ? j* N BPX exec_int if ax==68: c. u8 X( H" d: o2 W4 h) g
(function called is located at byte ptr [ebp+1Dh] and client eip is: Z& U2 m/ T' K0 K3 Y
located at [ebp+48h] for 32Bit apps)5 |$ o, S1 R+ n' q3 ]; c6 u4 e4 f
__________________________________________________________________________
; F; O' l- x' W
+ E% j! b% S9 z) G. N
5 s0 O1 o) { DMethod 08
. k5 e4 {+ j$ n# [6 z1 k=========
* c; W6 h, z( U2 q: A1 B' t5 n- ^1 {0 ?( Y# Y v
It is not a method of detection of SoftICE but a possibility to crash the3 O* b5 B3 X& N. v% V
system by intercepting int 01h and int 03h and redirecting them to another
. ?5 _% N2 V5 ]routine.
7 [" |2 |6 {3 j, z6 ?6 GIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points k$ V1 X( {$ a+ y- s0 V
to the new routine to execute (hangs computer...)
- G; l, x+ v5 x. k; \! k$ D2 Y |0 J' U8 z& }6 j& p& \6 a
mov ah, 25h2 [) B( D" }' d4 S5 e$ s
mov al, Int_Number (01h or 03h)
+ Q( I. a3 _) y' `% L mov dx, offset New_Int_Routine/ @" A* a1 t1 z* D* U/ H
int 21h8 k f) M* _! P e* p% U+ ?
$ ^) W. @9 m, P; T& `, z__________________________________________________________________________
- w0 k2 S8 N! W/ h* n4 w
6 V3 N' [% U1 |$ |/ I( f" T7 B8 ]Method 094 b" b9 @5 x0 }0 I, a7 Q* g
=========& s. G- ~$ C) I! Y. \# b' U
# r0 f* a5 y0 t: _9 ~2 |
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
a8 `& Z7 i! B- I9 zperformed in ring0 (VxD or a ring3 app using the VxdCall).
# x# [2 P$ Y* `" ?$ c# W* uThe Get_DDB service is used to determine whether or not a VxD is installed
2 R; c/ c I# e9 efor the specified device and returns a Device Description Block (in ecx) for, Y; d4 F" \1 W9 B
that device if it is installed.
9 ?2 _, O" X- p. }! E3 Z4 t
# H: v" Y }1 n6 ~2 _0 Q4 F mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID* F+ z- L1 v, Z# o' R
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
. o$ Q E8 ]% U% |1 t VMMCall Get_DDB2 y3 @, {# g# V6 t- b
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
; x4 J6 |; T9 U3 ^) D" ~8 X5 K9 |
6 F5 d; s( d v" w3 QNote as well that you can easily detect this method with SoftICE:' \) v# A: G5 ]3 R" c: _6 J4 P
bpx Get_DDB if ax==0202 || ax==7a5fh
( q o' w/ `8 ?. I$ L0 t* N8 W, s I7 u
__________________________________________________________________________
& [# }8 E3 v$ M" P, X8 Q: M
$ t8 S: h/ t- y: cMethod 10
9 x) ^# }1 W$ }! b- p=========+ \9 H3 j6 i _2 e% C8 g
0 T$ M: ?( i' i8 b' @" V- U=>Disable or clear breakpoints before using this feature. DO NOT trace with
6 A/ S. b. k2 q SoftICE while the option is enable!!
! r& u+ e9 Q0 y/ w% p! l0 [! I' i2 }, q
This trick is very efficient:0 G9 F R; n8 m& i0 g2 c) m7 L" a
by checking the Debug Registers, you can detect if SoftICE is loaded
/ Z- v8 I2 h2 k( K8 Q4 b1 C7 f(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if( A9 @ ~) C$ y- f& ~! ^
there are some memory breakpoints set (dr0 to dr3) simply by reading their1 k. X' X8 u/ B! b, [
value (in ring0 only). Values can be manipulated and or changed as well
- b0 `) D0 O, @/ ?(clearing BPMs for instance)6 |5 \; k6 }& Q$ d5 n& b! z* X
0 K+ w7 S! t. i/ c. H__________________________________________________________________________
/ y: i6 y' }6 Q! ]. C, M# n: S6 a1 x% y7 s3 \7 Q) x. Q. d7 H3 K
Method 11
: u/ Z, T( m0 T* k2 r" L=========+ l6 K+ L d' k% j
9 S! R) l8 e+ H" j2 @1 I' [* p8 i
This method is most known as 'MeltICE' because it has been freely distributed8 y2 G0 _& t$ z
via www.winfiles.com. However it was first used by NuMega people to allow
# ]3 M/ E5 m2 r( p. uSymbol Loader to check if SoftICE was active or not (the code is located# ~- v+ Z: _0 A6 {+ A9 [
inside nmtrans.dll).
$ K" ~% g* D9 h' t A1 N- y# |- D
The way it works is very simple:
4 X K1 M, m- NIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
7 g$ t2 w0 f' J- X8 c, _& z# IWinNT) with the CreateFileA API.3 ~- r# z" V# x* E
+ m7 M; i y& n {1 W! Z
Here is a sample (checking for 'SICE'):
6 r# U3 k9 s" A w5 W) d3 @' u& F6 L4 V, \
BOOL IsSoftIce95Loaded()
) e' r' k0 n7 c{# Y# x/ y' B3 ~
HANDLE hFile;
0 Z) c5 |5 ]4 f; o6 x! x% s5 i hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
" w8 [! N5 f9 e6 ~ FILE_SHARE_READ | FILE_SHARE_WRITE,
0 _; [8 t- t: i. o4 `. M @ NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
% Q5 O1 I$ `- n# T8 g' r if( hFile != INVALID_HANDLE_VALUE )
7 I1 G. C ]' `4 m. d {
& r& U. a x) }+ o CloseHandle(hFile);; s: B+ H6 T( b
return TRUE;7 a$ `- Z- m7 `
}
, m4 |7 e4 l+ ] return FALSE;. Z+ w" P" Q% x. r5 \7 X
}" a- F7 ?% A9 d$ A
% ~; ?" _! H ? d/ zAlthough this trick calls the CreateFileA function, don't even expect to be. e9 W6 ?2 }) P6 @" j
able to intercept it by installing a IFS hook: it will not work, no way!
- l- E7 j+ M% U; x4 ~! kIn fact, after the call to CreateFileA it will get through VWIN32 0x001F0 U* a. V. R. `- x
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function): r7 y7 W9 Y0 Z( C: L( R
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
8 [! w5 y j, N# i( t! y% Pfield.% D( {4 V8 K- Z- T4 e
In fact, its purpose is not to load/unload VxDs but only to send a
4 k$ W. u" I! O gW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
. G( |( k2 J7 O: tto the VxD Control_Dispatch proc (how the hell a shareware soft could try+ E( |+ r+ V7 ?- [7 c
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
, k; t8 _, ], C l" QIf the VxD is loaded, it will always clear eax and the Carry flag to allow
6 d7 H" p3 M" t! z% p# z& \its handle to be opened and then, will be detected.* U# c. i: N N X
You can check that simply by hooking Winice.exe control proc entry point. ~& Y* `$ i; g1 O+ l
while running MeltICE.! j! U7 E; {# M! W' i8 r9 V
/ D+ i, Z( d( X) s6 a, H
5 Z- C. Z4 q# `1 _) s
00401067: push 00402025 ; \\.\SICE
# [) W$ D# j% O" s' @ 0040106C: call CreateFileA
3 h" p3 H+ b2 `6 k; {4 V, \* ~/ Y 00401071: cmp eax,-001% h4 k) A. P* e2 e) v- C) f
00401074: je 00401091 O5 M0 `; n& k9 r9 o1 p4 S: a
* m, B. J/ J$ u, |" t5 r$ I7 @* B( A- ~% m8 b# e) T3 }) J
There could be hundreds of BPX you could use to detect this trick." V7 J7 g: Z: F6 P( C
-The most classical one is:
6 |2 M% B8 [ ~) N: q* y$ n' V BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||8 d% V3 O# h; F: {( l
*(esp->4+4)=='NTIC'
' i: ^+ }7 L$ N [4 e W9 m5 `2 j v R( |. `& i" N
-The most exotic ones (could be very slooooow :-(8 L# w; d0 a9 L. L: q
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 8 n5 y& q7 q+ n8 s& I. G
;will break 3 times :-(: G; ]+ o/ ]8 q% d. ? G
7 t" P" }4 E0 o0 ^# D' L-or (a bit) faster:
% S/ r7 n9 a- E$ ^. o6 r1 _+ Q: L BPINT 30 if (*edi=='SICE' || *edi=='SIWV')4 ?, R1 q) R9 v1 h( i5 b C; U, K0 q
! H0 C! x h9 z' e1 X: E( l BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 9 ~# P( _6 [) L- ], H* t
;will break 3 times :-(
% \8 G1 n8 t1 j2 Z) i& _5 i( y3 L2 r; H5 u$ {
-Much faster:
0 q- Q; w# f$ i7 `* E BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'/ E; M p& u& u- Q
" x! I A5 y x3 M- [" g" {9 m& G6 \
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
( U7 ~$ R8 u+ l% b3 h. [( b: @function to do the same job:* h' S3 d$ g& n6 n
# j4 q$ V( `5 j, V push 00 ; OF_READ
Z+ `; N |" L mov eax,[00656634] ; '\\.\SICE',0
, j" f3 Y' L' X push eax9 g6 ]8 {' }- B3 p, L. f& z" G' J
call KERNEL32!_lopen5 p" X# C. R% @% Y- E! w6 Q }5 x; O
inc eax
( e! {3 J2 |# W1 m" p/ J. T; c jnz 00650589 ; detected
/ b* F: O. I8 v$ R) Q' X1 ?+ o push 00 ; OF_READ
: o2 p/ G9 L6 O" c) p" F mov eax,[00656638] ; '\\.\SICE'2 g) M* i O+ S U6 J, u0 v ~
push eax
* y# n5 ~. T! h& K+ O8 G" x call KERNEL32!_lopen
$ d& g% {2 U5 L: i/ K ]; f( r inc eax! @8 T4 H6 ?. S: o ?
jz 006505ae ; not detected- q- {2 n2 T" c4 V! v5 e( z# d$ A
- m( g! h/ U' S% t, A ]) h4 z. K
9 G* S' v$ E2 ~& H$ P__________________________________________________________________________1 |" D* ]- C, _3 W, U3 p7 \( y
, Z6 z; w# ?7 \ ?( |7 }Method 12( f o2 n& ~: x3 f$ X5 W
=========% b/ X5 |2 H' B9 Q2 y. a6 Z2 y9 h) q
' X" H8 a/ y9 n r0 ]
This trick is similar to int41h/4fh Debugger installation check (code 05 l8 B3 o1 s0 G( S
& 06) but very limited because it's only available for Win95/98 (not NT)( G4 w, h6 ]( g7 s' |
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.2 e) t2 J5 j# A1 H
% W, \0 \0 l i/ A) D: N5 j
push 0000004fh ; function 4fh
) C# h1 z: M; Q4 |7 K) o( ~ push 002a002ah ; high word specifies which VxD (VWIN32)
4 O4 m4 U4 H L7 t& Q$ a' | ; low word specifies which service
9 J' ]0 o. v- C2 L6 K. W (VWIN32_Int41Dispatch): G4 G& k% J; u, U1 m
call Kernel32!ORD_001 ; VxdCall2 g4 A# H* }3 G9 M% t9 X7 Q
cmp ax, 0f386h ; magic number returned by system debuggers1 Z9 F5 T5 H6 R
jz SoftICE_detected- Q) q9 N. Z0 O
% Y; m( k6 Y; p: J% a L- P' O% L; g8 d
Here again, several ways to detect it:
4 e2 @! `7 P) t% f( m% e, s. u% n" U5 j; O
BPINT 41 if ax==4f1 a8 k& z3 a. m" ^# w
a* t' P* M) }# T* M* G
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
! l% m7 Q7 y* T- F* c" q7 ^2 f% n) d$ ]* v: u! K2 X
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A9 A% d* U" z4 Q1 t/ N9 B
+ W+ Q0 o6 A6 v; ] BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
/ {8 K0 u! o+ J% k
8 Y3 r! o. t( j: N% o e0 g__________________________________________________________________________% E0 X% d9 s: R1 ^
) U2 ]4 T& T; _5 [+ u7 [2 cMethod 13; r( c* H( m7 @, g) @0 J& ^
=========5 t0 G3 a% j: v; u8 y5 V" f
& j% v3 |; t- R3 E$ x0 H2 wNot a real method of detection, but a good way to know if SoftICE is
* W- m; k5 `1 [/ linstalled on a computer and to locate its installation directory.
& s- |" W6 D( M/ D( h; X, LIt is used by few softs which access the following registry keys (usually #2) :
. l& \+ ]7 o; p
6 a* Q5 Z o; c) D) T-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
* A" s' d, `4 q- n5 M\Uninstall\SoftICE
. F6 a7 a5 }- F9 |: _4 o( A-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE9 C2 K7 h; |& i. n, d
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion, n+ b+ ~- t6 M' a
\App Paths\Loader32.Exe9 z, c2 X) P j$ l! `. w" A
/ p3 |3 Q0 S- @. i1 g
3 ]) F: t. H C% m* }6 d' kNote that some nasty apps could then erase all files from SoftICE directory) f/ }& g- ^4 [
(I faced that once :-(
# ?+ K$ [1 E2 h8 v& ~
$ C4 E2 x. |( v0 S6 c% Z+ c5 uUseful breakpoint to detect it:
6 U: E6 n& y# a: V% G
0 I7 g. E& O- o+ t2 r BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
: e5 _4 ^1 M n' R3 F! i
, ~4 y* T. B0 y/ ]: g$ w__________________________________________________________________________8 E4 K2 O! f1 w' T0 F
& V- v$ U" I0 e2 ]% q: l
* ?4 z* g1 C/ p4 ?/ xMethod 14
( y3 A; n: _4 f% x( }' I=========
" [, R2 `3 I. t/ x
* ]; T* Q" I3 |7 g# CA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
: v Z9 `3 B. l( qis to determines whether a debugger is running on your system (ring0 only).
7 G r6 Z K: F1 z! Y. l5 U% C" @( D3 l
VMMCall Test_Debug_Installed4 z# S0 a6 I6 ~8 H2 u+ r
je not_installed
1 v! q: m( [6 c3 y: I2 ^/ N9 |9 N0 A% u% ~" N; m
This service just checks a flag.& t, X# w) Y; g; f8 E3 i
</PRE></TD></TR></TBODY></TABLE> |