<TABLE width=500># `6 _, g+ ?/ e
<TBODY>! c1 a( [' P; j
<TR>
g# E' x2 o/ P' i<TD><PRE>Method 01
# F* A5 u0 v2 J/ G! ^=========
1 z! F, K4 E4 u- v
: P1 f/ R+ \- RThis method of detection of SoftICE (as well as the following one) is$ k' ~/ x* H) R7 `$ x
used by the majority of packers/encryptors found on Internet.; Y1 m: B9 x1 D6 F9 p$ m
It seeks the signature of BoundsChecker in SoftICE# p4 Q, q5 H6 o" i2 a
% X0 b0 e* C9 J' [* O; I: _6 s mov ebp, 04243484Bh ; 'BCHK'8 o: O& {' f3 Y+ d) F
mov ax, 04h% t/ R, j: ]) [8 J5 ~+ k
int 3
; K1 `5 [. f0 L" q cmp al,4+ k8 Q. b/ Q8 q# k( R$ ^5 |
jnz SoftICE_Detected- v7 k* P5 D! c8 x1 `' E
1 c6 B4 E0 j; j3 J___________________________________________________________________________9 Q! W* y, p3 w' u) H
( B. E( t' y3 g2 W! s1 W* I& M9 V: ?
Method 02
2 H7 S( a. N8 q) D=========/ W9 U/ v. a3 f
8 T8 u$ ?" y& JStill a method very much used (perhaps the most frequent one). It is used# | X% o0 N1 {3 s0 `- k: j
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
2 V" W" g. k* m; n9 ]or execute SoftICE commands...
/ V: [& w8 @1 ]0 DIt is also used to crash SoftICE and to force it to execute any commands
7 I6 n7 l0 D& p4 k O, y) J(HBOOT...) :-(( 5 T/ Y6 t7 j- C5 Q
: Q$ ?4 `8 `1 A g& ?Here is a quick description:( X6 b/ ]4 h& E8 D- @/ {6 D* [
-AX = 0910h (Display string in SIce windows)
4 x& [, G6 i) m! B( \5 Q9 @ C-AX = 0911h (Execute SIce commands -command is displayed is ds:dx) Y7 c( Y# i+ n6 }
-AX = 0912h (Get breakpoint infos)
% E7 w5 D+ C; H5 B: ]6 O' K# F-AX = 0913h (Set Sice breakpoints)
0 P, [" O- V! \% M7 e1 j" D/ `$ ~ w-AX = 0914h (Remove SIce breakoints)
7 Y6 E( ?5 M4 b3 a% O v; T1 g* p. t- z* z/ V% ^
Each time you'll meet this trick, you'll see:
! G& F T# }7 d-SI = 4647h1 H$ C% u2 F9 {) q" D
-DI = 4A4Dh
6 e5 L# P7 i/ _" V; VWhich are the 'magic values' used by SoftIce.: q" e4 ^: s# m9 Y5 E4 i
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
1 {- M5 d8 l! _
% u) K. J# V9 d H/ A# I4 S- g( pHere is one example from the file "Haspinst.exe" which is the dongle HASP
- L C; L7 S; I& j* XEnvelope utility use to protect DOS applications:! ^+ v$ {! M- A) D6 b& {
$ x3 |8 s; W& `! U6 `
7 l J" U$ H% h: F- s4C19:0095 MOV AX,0911 ; execute command.# x' M1 w+ v( T6 z
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
! A% G1 H0 R/ J1 x+ y5 D) o4C19:009A MOV SI,4647 ; 1st magic value.
9 E- b p4 t/ z4C19:009D MOV DI,4A4D ; 2nd magic value.$ v; t N. Z7 y# Z F: v: g6 \7 w- g
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*); Z" _$ e" L) K M
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute8 G' A6 d1 h# Z4 Q# S6 w
4C19:00A4 INC CX; J$ u" `& x# c
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute" E. |. K3 {2 I
4C19:00A8 JB 0095 ; 6 different commands.6 d% n) ~ k% e+ w
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
+ O6 g6 z- K# H, i4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
. e1 v" g. s, K8 I8 | h: p: ~! a0 O r) k5 z+ }8 H: x
The program will execute 6 different SIce commands located at ds:dx, which
4 }" r( z; z: dare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
; k# T, A1 @* e+ J
& V) E" i% a0 ^2 A) d4 M' K* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
- O1 t, \" }$ I8 H$ d___________________________________________________________________________: K [* n" t! \. i8 c9 e1 D
8 u" c+ V W" Z; D2 D$ n. [
' g/ w$ h! x8 M6 z: X1 g$ i" c
Method 03
5 W9 x' }) o2 }# }=========/ j0 ]4 \4 w) A8 a. t
( C( n& \' ?7 }/ W/ M3 W( u8 S
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h F0 _: T5 Q2 ^0 B7 U2 F
(API Get entry point)
: M1 G) V1 k' g: i8 n
' z& ~8 ~; J7 H' j. {( H4 \' i- ~! ~7 o% h+ w c3 s0 W
xor di,di
5 b, K+ c) u, s mov es,di4 u) X x+ c) S" b! y) h# B
mov ax, 1684h
8 ]+ |1 a9 {" w6 @' `3 z' Z3 A mov bx, 0202h ; VxD ID of winice; V$ d( U/ \& C+ v
int 2Fh
9 x7 t) z, W3 e' a+ y3 `; Z, f mov ax, es ; ES:DI -> VxD API entry point; R$ {6 c [. j. j- h/ F
add ax, di8 x5 k6 ~9 J" M0 i2 d# i7 W3 w
test ax,ax2 {% i4 \% d0 T, n4 m# V
jnz SoftICE_Detected" M, I" X% y, Y. w
; K% @1 L4 G5 A o* `6 ]
___________________________________________________________________________
* ?8 }8 u/ A7 G3 d' \$ W; a
. H, g% d+ U9 LMethod 04
6 C Z6 n% i/ P" d=========% B) W3 L' Y' r. S) ]
" u# t$ A1 L, \
Method identical to the preceding one except that it seeks the ID of SoftICE. n7 |) B" a, L5 d/ n
GFX VxD.
2 D0 O Q$ J& A( C8 l1 I
6 ~5 g. N+ g7 I. c. n x xor di,di
. a" m6 H K, h# n$ P mov es,di
8 e6 {+ |: n6 J. G/ z s mov ax, 1684h
4 N- Z; h# o& c. v mov bx, 7a5Fh ; VxD ID of SIWVID0 K9 f- b! W3 M" i" I/ I
int 2fh
+ D4 ~ @8 I. B, t4 C% E4 } mov ax, es ; ES:DI -> VxD API entry point0 ]8 Z, z4 R, p, c
add ax, di8 G% e3 C5 p) X2 K. R
test ax,ax
6 C& S# g. t' H6 o5 } jnz SoftICE_Detected
3 i, f- _' B0 O* {# D& `: W; d3 K% o; _- q
__________________________________________________________________________
& P4 j$ T6 X, z9 W$ W
7 p- Z/ ]' O" ~2 q0 N0 P# X9 I! w2 s) `! L" {$ s* B' I
Method 05
, B% | ^: E6 A=========
2 D6 Z) Z0 G, j+ u' l) {$ h
) M. v# a- l7 G! U- iMethod seeking the 'magic number' 0F386h returned (in ax) by all system
+ m, V x) P q+ _debugger. It calls the int 41h, function 4Fh.
3 A* Z* {) n6 Y4 pThere are several alternatives. ' \' Z9 c* z; U* k; E0 K3 b! X
! D$ K4 n$ w( R/ r! C1 D1 UThe following one is the simplest:
2 j+ k! D* m5 A. x5 ~7 `1 S- m
* [: H. M) a! C" k& x+ G9 @ mov ax,4fh; m; c: o9 a4 _ x1 k: f1 Q8 u8 Z5 l
int 41h
- K. Z0 n; }1 D, V. Z: W cmp ax, 0F386
% F7 F$ R" q6 j) t0 S* l1 { jz SoftICE_detected
3 T6 t& T0 a' ?: {
, m% I$ R6 y4 d6 e' {& ~" |1 H& M: ]# o' [
Next method as well as the following one are 2 examples from Stone's . V& D- U1 T* w7 X2 }9 b% Q7 L( |
"stn-wid.zip" (www.cracking.net):
$ C# Z+ U1 _2 }) x, C; y, Q3 T; H. D. _& T
mov bx, cs' B* c7 | W+ I# A8 `7 G3 ^
lea dx, int41handler2+ E4 `. h6 o6 J# B3 a
xchg dx, es:[41h*4]% g2 V$ e' B8 d+ O, r+ ^
xchg bx, es:[41h*4+2]
( Y- |& x2 b, D* I' j5 _8 c mov ax,4fh
: R7 N8 L; i9 v% [: ^! b' G" Q4 C int 41h
* [/ p, ]+ {! D1 c0 D xchg dx, es:[41h*4]9 X; |3 e! W& T! U& _& Z, S: U
xchg bx, es:[41h*4+2], \6 s9 O% s& _ W. p
cmp ax, 0f386h2 _7 f4 ?5 K/ h* |. B# q
jz SoftICE_detected3 o6 T, y6 K# Y; }% B! B5 P
B1 ~( F2 x2 i. Q+ K0 F+ ^2 ?( \7 w
int41handler2 PROC
8 g, ~4 i( w8 r! y5 T iret
P: I6 a; A; N/ L3 |int41handler2 ENDP
. f( m" f: m+ ^* m* W) B( E% ]; O3 t: u: Y+ V5 \% Z8 i3 m7 Q9 w3 d1 u
6 Z9 [; N4 W; \
_________________________________________________________________________
. w- p" z; X$ U# W+ e" R5 R) [, q) l2 J
. w" h& w% t9 G, RMethod 06) h: |' z5 A$ P3 ^2 l. [
=========
( _) s( z* Y+ ~1 S/ Q1 D; `% O' j' n* S6 G6 J/ M
; P7 ^" ?& H. T- b" r; Y2nd method similar to the preceding one but more difficult to detect:5 l3 V9 z/ n) |) _9 {
+ w# c- r' E* A ?; z
; S% Y5 O M: v% K8 yint41handler PROC
8 h) F \5 f. k( t mov cl,al/ ~8 W" U2 E Q, c! l
iret
1 y9 I) J$ v' J& c" Rint41handler ENDP
6 X# m. F7 |' n, o+ F- \' m; G) s( \) Z4 |% M
* A8 H) M. Z) A1 u" Y
xor ax,ax3 U( O }& c j
mov es,ax
3 \: _" a$ X7 Y' ^4 [' D6 R( z mov bx, cs
6 r) L: H# |7 ^ lea dx, int41handler
, U6 C0 B' m- W, m xchg dx, es:[41h*4]
7 f4 C V5 ?/ H: x0 Z xchg bx, es:[41h*4+2]/ W. J R# d7 d
in al, 40h, w5 a% H) K6 y0 X; M) `
xor cx,cx& ?1 s& p, W- s0 I7 d
int 41h
, Z2 d- m1 O5 a: q: r# M2 } xchg dx, es:[41h*4]! o: ` f& Y# P
xchg bx, es:[41h*4+2]
1 \& x: g2 e, i/ a! i cmp cl,al
1 G9 ^; p# C8 ^+ `" Q8 Y jnz SoftICE_detected4 c% u" e" b5 V ~ p- r0 P
4 h6 h) P# I" Y0 \$ F8 w
_________________________________________________________________________
( U9 y+ D2 g5 i9 N! S- Q+ p/ u$ y$ m( b% }6 r0 Z3 B# ~4 Y
Method 07
2 _/ [3 G, E& s, \6 E=========
! f0 J9 f: h/ ~5 y
' a, D7 t! j: o# jMethod of detection of the WinICE handler in the int68h (V86)
6 q7 ~8 t4 Z6 S6 m7 D2 W3 v- I: S5 o' d) P$ U
mov ah,43h0 C' W4 v' `5 j
int 68h( J8 H: Y$ M" J# z6 |& Z+ E2 X
cmp ax,0F386h* v; `4 v" {0 T6 L! t7 f
jz SoftICE_Detected3 n' h! b `8 q5 ]$ W' Z
0 T$ R( m1 e( g, B# k3 q
- @' o* ]. _7 Q. b; I8 i6 ^* ^2 ?=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit7 r, ~* _, v( q/ Q
app like this:
" C y) s: r! ]5 D; R8 I9 @% g, Y3 h- o( K
BPX exec_int if ax==68: u `3 {! V+ G" F- M0 W! P
(function called is located at byte ptr [ebp+1Dh] and client eip is9 X) p, R4 V# \* N* |2 x4 Q9 g C9 b
located at [ebp+48h] for 32Bit apps)* o- a& ?/ p( F. n) W8 x
__________________________________________________________________________
) b7 T: I9 A! `, u7 z/ J4 W
' _4 [% E1 [# B$ u* e4 n9 K u! }. a4 h
Method 08
5 W: j. M* h& [8 W=========
! H; _) F5 B. I2 F$ T5 @3 v5 b% Q; d+ t7 m6 g4 `2 F- }( p$ ~8 c
It is not a method of detection of SoftICE but a possibility to crash the4 I6 h+ B9 @+ Y- W6 q% k
system by intercepting int 01h and int 03h and redirecting them to another
- v1 v9 Q( I& L" i& E7 s H5 troutine.
A# a0 [& P- t- F YIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
% T; Z. [* Q( T5 qto the new routine to execute (hangs computer...)7 R7 T* `0 r! q- b+ y8 }) Q
9 k# g* ]# j1 I" B7 S" S1 Q mov ah, 25h
3 K# ]5 a% l# | mov al, Int_Number (01h or 03h)
8 n6 ]4 O6 x& K' E1 X% O mov dx, offset New_Int_Routine
6 I: ?* ~) s3 o8 w f! l, I int 21h b O: l. F* j) m
- n7 M+ K( |$ Q5 G__________________________________________________________________________( i& R1 M8 R8 I$ N2 z
' X6 p$ C. K4 ]6 }& E) C; u* ZMethod 09! C7 b0 U7 [4 F# A+ I
=========& ^5 p$ Y! |, i
# z8 A- d* L) z6 V4 d' Y
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only) `: |3 z. o1 t" D. i$ f. d
performed in ring0 (VxD or a ring3 app using the VxdCall).
+ `5 m$ M6 V8 j5 R- w: C( eThe Get_DDB service is used to determine whether or not a VxD is installed! _9 _8 f# C6 X) K
for the specified device and returns a Device Description Block (in ecx) for
# T2 p* t2 M4 t# j6 q: D- t8 k7 vthat device if it is installed.
" d+ S$ C+ }/ G; W- `; y/ E
5 l- ^9 L2 ^3 _% Z mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
% y c- O4 }* j mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-); c- t* u9 X8 [0 f0 `% X; s6 G
VMMCall Get_DDB% e# [, U4 D: `
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
0 G* [8 J8 }/ @5 L% E2 Y. V8 d' W- O- U$ Z d" J( P
Note as well that you can easily detect this method with SoftICE:( L; H% f9 C% B1 Q' x. t
bpx Get_DDB if ax==0202 || ax==7a5fh- T: W# t" w" S' D5 z P7 q
! S, e7 R' S: q$ P8 w" R
__________________________________________________________________________7 H2 e9 B6 w3 ]# h3 s
" Z3 z* Y# {8 c+ H; \Method 10 d) G/ S8 `% t( s0 ^7 D, q+ L/ c
========= q( D" w2 o; a
9 s6 q: ], O. K% ` l# n$ M' r# U=>Disable or clear breakpoints before using this feature. DO NOT trace with, O/ ^- P, P7 \: G$ O
SoftICE while the option is enable!!
- a% J( i- ^; D! T7 P! {4 B& i
' S7 L5 i9 i- l* g9 R2 e( i4 gThis trick is very efficient:
' j: E; f7 U' y! [by checking the Debug Registers, you can detect if SoftICE is loaded8 w7 ?5 ^. f" p3 G: y" g
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if. h. b$ K7 B' D$ |& ~
there are some memory breakpoints set (dr0 to dr3) simply by reading their
* T- X' S% c9 E9 d7 K4 uvalue (in ring0 only). Values can be manipulated and or changed as well5 U6 I/ X( u$ {% n- C9 G9 P3 A
(clearing BPMs for instance)
# c% m& m; R& I% w! F& c1 E! Z4 a2 @" S
__________________________________________________________________________8 a+ c) F- A6 p- U. k
* F m0 c$ A/ V
Method 11
5 S4 {- L7 k# v( Z3 B' e! B' |- @=========5 T" S, `# q2 a; Z
( [9 h, ~8 {+ G8 K2 mThis method is most known as 'MeltICE' because it has been freely distributed5 `& ~2 T# M( b/ {- ^( {
via www.winfiles.com. However it was first used by NuMega people to allow
1 Y9 I8 x; l) {- M2 E4 I e/ r; tSymbol Loader to check if SoftICE was active or not (the code is located
+ t: I$ U' r, Y J7 {2 Xinside nmtrans.dll).0 v7 o0 d/ K0 e6 P, ]
7 m. K8 L& J9 uThe way it works is very simple:3 j3 {0 F/ I2 h9 D; A- f
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for6 X a, ?$ K. g% ]# q# p
WinNT) with the CreateFileA API.
7 S v# n1 j m) ~( W
6 `+ n2 k; q7 f6 h# F6 G! U* tHere is a sample (checking for 'SICE'):
5 C0 ]+ O- {* j2 |; q
! d% C7 \ M/ x0 J' f1 o& W3 n6 MBOOL IsSoftIce95Loaded()
# b8 p5 T# L$ A9 E{
2 l( S& M; t3 @1 z( s' ^* S HANDLE hFile;
4 B" S8 ^* ?" G6 e hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,2 R& x' R+ Q d0 h
FILE_SHARE_READ | FILE_SHARE_WRITE,
O4 U# e0 B# C6 T) G9 i! |! N- _6 h0 s NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);1 B1 e0 X: P% O3 {" y8 |! n
if( hFile != INVALID_HANDLE_VALUE )% a# K) t4 r) n" p' v4 L: `
{+ G, N, @$ g# p
CloseHandle(hFile);& ]+ ]" w7 n M& A) F* p. T
return TRUE;
5 i, g% I. B; k. k) d }
4 C( k# Q9 N/ R" t( ]5 b x return FALSE;2 z/ Y8 u! [' y% a+ j: N4 }/ X
}& H y- G' h$ l: }4 h \1 _
" b5 P3 N0 _& ~& w0 k1 c' }Although this trick calls the CreateFileA function, don't even expect to be* a! D% T, D: N: Q( r
able to intercept it by installing a IFS hook: it will not work, no way!
0 R Z! D* N" T8 m6 Y0 oIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
$ y) b! p8 D( X# Y8 [! ~service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
U+ X4 }5 \1 B5 ?4 y& |1 Q6 uand then browse the DDB list until it find the VxD and its DDB_Control_Proc
! ]# q m3 |" C! A6 Afield.; l/ u0 r% R0 N
In fact, its purpose is not to load/unload VxDs but only to send a ( Z3 O5 K. I8 @" @4 g; f2 c
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)2 `& }. Q1 E d0 w$ h% r7 D6 T
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
: C( v; s6 q& x1 X- t" uto load/unload a non-dynamically loadable driver such as SoftICE ;-).7 w+ U# [- z0 V: x8 S
If the VxD is loaded, it will always clear eax and the Carry flag to allow
. s. f" j) Q5 Q) ?1 ~ bits handle to be opened and then, will be detected.8 R0 R! Z9 u5 \( E% P% ?& p' e
You can check that simply by hooking Winice.exe control proc entry point8 Y) j6 Q- s- c
while running MeltICE." S, c9 c0 @" v5 t8 a
4 [$ P- m7 C1 B& W% a
! X# m; s: C4 r- Y* @: e 00401067: push 00402025 ; \\.\SICE5 T( R, `) @% l, {0 `1 q
0040106C: call CreateFileA4 \4 @# Y+ `; V( s
00401071: cmp eax,-001, h3 c: j" X- e3 Q8 B1 L( S
00401074: je 00401091
6 d3 E& R+ T- j5 H
# J" o8 A& S$ _6 l7 U% M( k5 h. E3 R; E& Z/ D5 ]# P
There could be hundreds of BPX you could use to detect this trick.
! O4 }( h5 ]$ N& x-The most classical one is:: f5 Q" I. I3 C; Q5 J7 P; y
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
+ }4 L; |( ?' ` *(esp->4+4)=='NTIC'$ y( ^7 I% d1 W) L7 M. Q5 R
) i4 v K" x7 J" R-The most exotic ones (could be very slooooow :-(
4 o3 G) k2 m( D( R5 ] BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
" b! h' Z; J1 Y5 b5 O1 j- p a9 P ;will break 3 times :-(
' b+ ~* @0 { z( D$ s8 o
/ f% {1 r+ X, Q0 a! M' i7 b4 o" j9 C1 J-or (a bit) faster: ; i! {! c' w- t' b2 }! E
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')7 Y5 u, O& S- @! g
/ S! u+ D* r. g' I( n
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' ' X' t$ C+ I) `1 x# Q
;will break 3 times :-(
9 D' ^8 W9 r! \& x# L# ^! O$ I/ ~$ X$ D' e( F
-Much faster:" D/ t1 X6 m' y$ G
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'8 g6 j$ v9 v. L" X: x4 z1 s
+ n5 y3 z" x; iNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
/ F. J' H, {/ J9 \8 D1 m0 Afunction to do the same job:6 u9 `" K# e5 g) g; K% a
; p0 y- O/ G7 {
push 00 ; OF_READ F/ ]- n* |+ b- {
mov eax,[00656634] ; '\\.\SICE',0
1 k& m( c) \ o( S8 w1 t push eax: }, |' t4 v' @6 m) A: _& c& s
call KERNEL32!_lopen
4 [( M. q8 c2 x" [& C$ V inc eax
0 C# R) f, {" ? k' f7 k jnz 00650589 ; detected
: \% N3 C9 B; [1 N( G2 v V- ?$ P push 00 ; OF_READ
" u. W- H1 W, G( I6 l2 f mov eax,[00656638] ; '\\.\SICE'2 J+ {- H5 _9 s/ O, W% |0 J
push eax
M, [9 L8 [2 f4 H2 Y: Y/ C) x call KERNEL32!_lopen
. H& l5 {8 y$ o* W- T' P+ @5 m inc eax
( \1 V3 G5 N" M4 ^$ t- i/ Y jz 006505ae ; not detected
9 x- @, L8 H2 `8 \1 O5 T! }9 H. k
' @0 d& C" u! b3 }" [
5 M" |( v% q* _& r9 u& K: u__________________________________________________________________________
8 ]( B9 q$ ?& M& Q6 c7 \4 z! y6 L4 V
Method 12) s- U3 k7 @8 F, a" _
=========
1 g! l' F7 H$ A0 {3 j' A
/ d3 b: j& |9 [, ZThis trick is similar to int41h/4fh Debugger installation check (code 05
0 C. D8 o* l# b( ^, |8 w( L& 06) but very limited because it's only available for Win95/98 (not NT)
: H1 }% M7 O/ t' m3 }2 fas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
5 d" e1 p% M: }) p& N0 [% R4 I. g) z+ L) C
push 0000004fh ; function 4fh
. d8 v" c% Z2 O4 C: Y, Z push 002a002ah ; high word specifies which VxD (VWIN32)
0 R% B: v/ o4 a' Q6 r) c( g ; low word specifies which service. R* L' u& Z6 k. ?' V( V
(VWIN32_Int41Dispatch)
" o$ x$ V6 Z8 m# k call Kernel32!ORD_001 ; VxdCall
, f' G' G: Q4 k8 c$ H cmp ax, 0f386h ; magic number returned by system debuggers
, j+ W; K& ?" b- I7 y jz SoftICE_detected, r) @! T' ^9 M' |5 `5 d7 ]9 _6 U# M
! m, G H7 n2 D7 c. T9 `Here again, several ways to detect it:/ O0 d6 |( T7 `$ n
$ @. ?0 U4 ]/ b* `6 _5 f8 _' U4 A2 Q
BPINT 41 if ax==4f, c) Z4 Y% s$ D: M: u5 E! q' L# l
5 e8 }6 N4 n0 F9 @4 R# N% Z BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one8 K" E1 [4 s. E* t
: f+ O5 Y1 u1 @, l- |1 b% o BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
8 k2 K! a, H9 {5 A3 j
: N! }3 }/ x% Z% M9 D& n9 Z BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!$ }/ F. Z8 b( z" y) f' w
1 K: ]5 ?! U0 s2 M7 X7 W__________________________________________________________________________
8 r: K! F3 P' ]7 A6 ?/ X: u1 Z8 R% P
Method 13
, R e# Y2 J1 L1 R+ [, D=========
# J$ O* X4 D6 F" ] S, O
3 E! l4 Z; o6 S" S5 ~! y# ?Not a real method of detection, but a good way to know if SoftICE is+ d# Q1 w- F! V
installed on a computer and to locate its installation directory.4 i( e6 ?5 w( B5 C
It is used by few softs which access the following registry keys (usually #2) :
8 x, ~: e0 e# ^ N- `' s- G) X$ h7 @+ r p( N0 b
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion) \& g) i- V, {* Z; _ e" P6 z0 J# @
\Uninstall\SoftICE
" V, R* s, x5 J: s0 r3 O" c-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
$ G( Q& Y; K, r* I8 r-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
5 o/ I4 z6 Q Q\App Paths\Loader32.Exe$ Z* y7 z" ]% t7 H: E. j
( k/ Y1 H3 t! Q
; G* s3 `8 S3 \$ KNote that some nasty apps could then erase all files from SoftICE directory& @( t% d, f5 F2 \
(I faced that once :-(
z$ W6 b1 W$ h; w8 |( O3 B; H! j! j \9 A" B8 z4 \ u! X* U+ \# \+ O2 M7 W
Useful breakpoint to detect it:
+ Z0 E: p0 o0 f( Y$ S% m3 i
2 @" `3 J* A4 x" P/ i! u BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'; G) c% }4 v2 k" Z" H# S
; I- x% E4 Y. G) \! n' W% @
__________________________________________________________________________0 K: R& g$ k' Q/ ~% m. _% P
- F* a8 V: U5 S5 n( W5 k3 K5 |4 ~; v. f
Method 14
8 |' D L1 R6 |7 E2 V. T/ R% K=========
" H# B# ^& t% l0 u8 S8 z, P+ d* @$ ?
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose- Y9 E. u( j4 `/ D) I
is to determines whether a debugger is running on your system (ring0 only).2 }) t& ^0 ?6 S/ |/ f, q
( V* P1 e, f( o/ z# Q/ f3 M
VMMCall Test_Debug_Installed% M }% M( v0 w. H7 G
je not_installed
5 e" Z: u: E/ }) h$ W" |5 `* j! o, W7 |
This service just checks a flag.* D* H8 K' p" p. n- H2 U. G, T* b
</PRE></TD></TR></TBODY></TABLE> |