<TABLE width=500>8 i/ z# h" L G- d: m) L7 l3 i
<TBODY>" E8 |" O" Q, C* M- Z' o4 ^! Z
<TR>
2 n. r( l# V; [+ p/ y<TD><PRE>Method 01
3 ?$ v9 m- l3 w8 j=========
n `0 {. K" H
+ F7 c$ j. Q/ u% JThis method of detection of SoftICE (as well as the following one) is
$ i1 g$ d- N+ |2 Q$ B" c/ bused by the majority of packers/encryptors found on Internet.3 X9 e4 n6 p1 ]9 C
It seeks the signature of BoundsChecker in SoftICE
& W- B _4 u# Q N9 @' h3 S7 T' n2 V6 L4 a# J Q6 U
mov ebp, 04243484Bh ; 'BCHK'
3 x7 i# |+ l9 ?0 o; I mov ax, 04h
0 h5 V. i8 x0 Q. O( s$ ]' X int 3 - D% ?/ O% U! g" X1 o) v( A7 v: ~/ M& A
cmp al,4( U4 [* e9 N' g6 K4 a
jnz SoftICE_Detected5 Q- T. F8 E6 o
6 G3 M- E0 [' K
___________________________________________________________________________2 m+ O7 t y0 o4 l* N
' X3 w5 ^. P' k5 S% I! y
Method 02- f, m$ O% [4 A0 Z
=========
# p) p! W4 x6 F5 g5 @3 v3 _* {3 K0 W, B5 f0 F: e* L
Still a method very much used (perhaps the most frequent one). It is used( M8 A! g4 e9 B# j
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
& o& k: a9 H" C" For execute SoftICE commands...( o) @4 M+ N; [2 ~4 _, o
It is also used to crash SoftICE and to force it to execute any commands" I; g. L" {) M" V0 N' I
(HBOOT...) :-((
* P$ v3 T j! q l0 ?# l- c! ]
H9 r7 g0 g4 `( e9 [Here is a quick description:( p8 Z$ D, w( h: F# o5 V
-AX = 0910h (Display string in SIce windows)
8 N8 h4 X8 o: o' F-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)6 M! y$ d0 V+ E! B8 U
-AX = 0912h (Get breakpoint infos)+ y$ C$ M/ ^& I1 R
-AX = 0913h (Set Sice breakpoints)# q6 T( r b. x
-AX = 0914h (Remove SIce breakoints)* N0 h/ L- U5 G: _0 J
- L& |& f4 Q, ? E; |! a3 u
Each time you'll meet this trick, you'll see:
2 k1 s/ P( N; D-SI = 4647h1 N; Q) N7 g) V1 `
-DI = 4A4Dh
& Y: P0 D$ [1 z( V6 e* XWhich are the 'magic values' used by SoftIce.$ A) p3 O* U4 U1 ^. I/ I6 C/ A
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.7 B7 W" t. g5 o9 q2 `
$ X! V5 S& M* ~, k- T$ X7 C
Here is one example from the file "Haspinst.exe" which is the dongle HASP
+ ]. V1 [* M6 G+ gEnvelope utility use to protect DOS applications:. z/ w) T* n9 t1 M* k1 B2 F( P
1 l; \2 u# b7 H7 [1 [, T
; Y% l1 o& U4 k; M d6 L4C19:0095 MOV AX,0911 ; execute command.6 U+ P; T( E+ Y; j" I
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
9 y1 s [3 e+ `3 B4C19:009A MOV SI,4647 ; 1st magic value.8 _7 R) ]1 z9 y+ K
4C19:009D MOV DI,4A4D ; 2nd magic value.# p7 A! t/ h/ M
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
: o( c& r8 M) ~9 [' i. N5 T, t4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute; X" [- R) j; O# M( A/ b9 z4 K
4C19:00A4 INC CX
, o$ h4 w" {6 H4C19:00A5 CMP CX,06 ; Repeat 6 times to execute: _4 k, a/ V% K) \) h4 p, h* d$ s
4C19:00A8 JB 0095 ; 6 different commands.
7 o5 J1 ~. m; A4 H% I4C19:00AA JMP 0002 ; Bad_Guy jmp back.
2 ]) F w0 J- `! H2 `: u4C19:00AD MOV BX,SP ; Good_Guy go ahead :) i8 r* i7 u2 B/ X+ }7 a: L0 g
' T/ d5 H& J0 o% e" T. |, M9 l7 d
The program will execute 6 different SIce commands located at ds:dx, which
5 r% l8 E& K& q" uare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
( u2 y& t- \# `' u
' ?+ c$ ]9 o& v. B4 `* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
; \5 x! T4 i- u: r( a: s___________________________________________________________________________
( e1 ~- v j, |3 d7 S1 ~% J- ^# M* ] ?
$ o" v' B/ h1 T5 [0 F9 P* WMethod 03
( }2 |+ F0 A" b& ~; K=========! K8 B5 J% s- Z+ U4 S
( X5 W) i4 `( b2 |/ KLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h, M- ~( h% n0 H0 _% U
(API Get entry point)8 ~1 ~& c) R0 R' W
, p0 m! o# o4 Z/ C% n$ x6 \6 m" `1 L
I* |) Z8 Y. J2 p xor di,di% s2 E/ n! L& ?) {9 S8 k, x. T
mov es,di: w; F$ K' M% A, P/ K* s2 [( d
mov ax, 1684h
! [5 ]4 a) y9 T o$ Q mov bx, 0202h ; VxD ID of winice
' [4 \) Q5 T+ q8 |" N int 2Fh
1 H4 e; e% V% u4 r mov ax, es ; ES:DI -> VxD API entry point! W9 q) D" [) b, k9 [( o3 x
add ax, di
' @2 v* D. i' T S" } test ax,ax
2 {) L$ F4 X. z3 C8 _% j' q jnz SoftICE_Detected9 S. {0 U1 E* u! B
7 G/ E* c- |9 t5 {8 x \1 e8 n1 y___________________________________________________________________________2 ?, Y f- i* C" A) K' ?' _( N, Q
5 c# S C9 U- M {- oMethod 04
o2 H! y3 B# h: H=========! u8 i6 J$ a( q& D+ l% s9 ~
" y2 R7 x J; e
Method identical to the preceding one except that it seeks the ID of SoftICE1 }9 _' q; R% ]
GFX VxD.
% j5 W4 D% S) I: h( _
( s# V' L) E! f: c, K% `7 v xor di,di8 j6 D) e3 _* b: u1 n0 _) a! U, d9 [# t
mov es,di
# ?4 h# K( `1 l" { mov ax, 1684h 1 V; |% ?, o3 h3 I
mov bx, 7a5Fh ; VxD ID of SIWVID
6 j# k" E2 L# h. D( R, k) S int 2fh
% m2 J; p" t$ a% q; t mov ax, es ; ES:DI -> VxD API entry point
) P' _7 G. Z. K9 C8 \ add ax, di
# a8 S; m2 h ? test ax,ax
1 g& Q$ E0 j4 y" M$ l5 ~- F3 P jnz SoftICE_Detected
3 K* w1 l2 ~8 S, n) E1 k# h
1 e6 p+ ~+ I/ A p5 N__________________________________________________________________________
: i+ r& V V5 D7 Y- U1 ~
! I2 U, B' ^- s9 J' d0 o' D( u, M! N( Z# _
Method 05& L6 N* `4 v b1 B
=========
$ `, n5 d% P- c+ W. U
; Y3 ~7 t# m( t( YMethod seeking the 'magic number' 0F386h returned (in ax) by all system) E2 l# C2 `$ M9 r1 P$ [
debugger. It calls the int 41h, function 4Fh.
+ V; q' p# p- ~. ? j' q. Q. AThere are several alternatives. 7 b& o2 O2 f, l: S- _- ?8 y. O& m
5 ]6 N* A0 q) ~; IThe following one is the simplest:
4 i. p Y. Q. z$ e+ r( O
1 Y- h( [2 }: Q/ F# | mov ax,4fh9 @. `+ [# c$ e0 c/ R% o" B
int 41h/ ?; I$ j* g; L
cmp ax, 0F386
. K" [1 ~) p2 f; t" V2 O6 P jz SoftICE_detected/ ]$ O7 \( h% E4 I8 j0 z0 x& |
; B( P, w7 D4 W! T I6 r) ?2 r- M3 F* S" ^# R @
Next method as well as the following one are 2 examples from Stone's , \& b6 k/ v- y' m1 }+ D! L
"stn-wid.zip" (www.cracking.net):' m% f5 j/ D: m* P
* P1 ?6 K8 k6 M7 X( o( T$ `7 ~8 }+ `* O
mov bx, cs
5 B/ h# y. R- i. ~. E" v( |4 q lea dx, int41handler2
& E" W0 n6 q; V4 `* `' E xchg dx, es:[41h*4]9 `/ F6 b6 K: n8 F4 F2 y& W
xchg bx, es:[41h*4+2]+ q0 ]: j9 v" P+ N. ?, F
mov ax,4fh
. }) y5 N4 f! k6 U% ` int 41h
, h! j8 N: ]& Z1 q2 m- l xchg dx, es:[41h*4]7 h) p/ }1 [! R9 T+ b
xchg bx, es:[41h*4+2]
2 j1 [: q- J$ z/ i: O# ] cmp ax, 0f386h' P+ u/ V7 [. S! J+ l; k- T) I
jz SoftICE_detected
' Q$ Z) g% Z! Q1 i6 w
, x0 v0 O) {/ `6 a! R5 Q yint41handler2 PROC
; Z4 z( ~3 I8 |3 M! i4 e- |0 I iret. H5 I8 Z. P, i1 B, R: v
int41handler2 ENDP
6 e4 D$ ~6 ?5 p0 x0 i% G$ E) q, p, Q" B$ U% y% u6 U) j1 ^# f
1 u9 f, @1 K B_________________________________________________________________________- k9 t1 p& E# h+ \$ w9 V6 _
% H! I! u% z; P2 L8 u: |' n
+ [ _- Q3 u8 y# n- Z6 ?Method 06
0 T, f1 Z6 E! ^0 M) L=========- W7 @7 X9 V! h. f9 C: P+ I
% L" M! O4 s1 r4 B1 M" K/ D b
' d: e% E* O4 T6 A) l
2nd method similar to the preceding one but more difficult to detect:8 d+ \& G& L: S% C) Z# w
8 ~) e# \8 [& g/ q o4 a" f: k: F! n) L0 _6 S
int41handler PROC
1 G! H. M$ L S6 a1 x mov cl,al9 i% A2 _! o4 u& [6 }9 f) T `
iret A( S2 t( S) @) k4 F1 N
int41handler ENDP
$ \. Q8 C1 U5 v* N( G/ K* d' p/ {' ^
g; v" |& S( t' F7 s+ ]
xor ax,ax
& ^: v0 |$ [8 R+ u1 C mov es,ax
2 k" G# c) a% f8 I( n3 D mov bx, cs1 X6 H8 ~# p% S) V
lea dx, int41handler
& Z9 c3 g9 ]5 I! o. q u xchg dx, es:[41h*4]2 K$ W0 l3 o( t V, E
xchg bx, es:[41h*4+2]
$ p. n+ Z2 t" _/ M in al, 40h9 W( c- ~4 u0 g' N1 G. I, J; {
xor cx,cx
* Y* B, Z R: q" r) v" v; b: E( B int 41h/ |& s/ B8 J/ a1 y# S. b# ]
xchg dx, es:[41h*4]1 K$ W1 Z5 m4 Q! M2 w! y; v+ @
xchg bx, es:[41h*4+2]. h* a& |: ~, i5 g- `4 m; o$ L
cmp cl,al' s' h8 }; w/ B: b# F" h9 o, E
jnz SoftICE_detected: B, a9 Q2 |! T: j
, I/ B& L( r6 m_________________________________________________________________________6 X7 ]9 m, n6 B/ G- D
2 ^7 F& }- k7 X
Method 07% m1 i( A$ x( A8 z2 `
=========; p1 i3 [: n/ g! [* f
9 p7 \. R. W' p* u7 P; t/ rMethod of detection of the WinICE handler in the int68h (V86)1 X3 e# V6 v& ]
3 t# W6 S* y( |6 o1 q
mov ah,43h
% ^9 e( E: ]2 A4 } b, a int 68h6 o0 |! z, \. j h3 m [4 x
cmp ax,0F386h1 v. f% {4 h8 I5 V
jz SoftICE_Detected# H0 t) N: u; C! B- K- U8 _" J, J* |2 x
1 j5 Q$ X0 c7 q m, F Q/ S' R; ?. k* P( [4 Y- `* }
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit$ f. M0 B! Z& V* \; n) |3 S |
app like this:: k3 M* K5 A! f( f
1 l- B5 x5 E ?9 J, X3 k( p BPX exec_int if ax==68! L8 g: r4 ^5 n! p1 r1 \
(function called is located at byte ptr [ebp+1Dh] and client eip is) o+ G0 q( z0 M# y" a5 I! F1 X8 f
located at [ebp+48h] for 32Bit apps)
2 B3 `. d+ L9 C4 ^2 h, w k__________________________________________________________________________
+ n- w3 O$ [0 J& `+ o
& {8 G' Z# q! @, m- L
& P: l: d6 s7 eMethod 08+ ~$ F2 P Y+ j- W# J2 Q+ t4 u
=========: ^! O# Y9 w: p; ?
. F7 z; r C& s7 z! X- V- ]) Q
It is not a method of detection of SoftICE but a possibility to crash the" E3 g5 Y! O) j8 Q
system by intercepting int 01h and int 03h and redirecting them to another
+ f9 _ f1 i6 ?6 broutine.
6 |, L# Q6 w- z6 jIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
$ D' Z" N: H! |; X/ cto the new routine to execute (hangs computer...)4 w7 {2 B7 B) \( Q8 H7 g
6 \: p: G2 u+ i6 t) R( ` mov ah, 25h
( k& n, K$ k3 ?+ ^2 y/ F& O mov al, Int_Number (01h or 03h)0 B, t& e: O2 G! e: `6 _" v& b
mov dx, offset New_Int_Routine
) @1 i5 l" A3 k; E g, w( p' @ [ int 21h9 y4 ~( m# I. j5 ~
0 e' L' U, b" l" w B1 O- I
__________________________________________________________________________0 m* g( A/ u) q6 \( }7 w6 u J
0 n7 V2 ?: M$ g& L7 ]: K1 H3 y: C6 Z
Method 09
1 z: c5 f4 a h* U% ?% G" T=========1 @6 O6 Z0 {* n4 f, N. g* L* C4 _
" {8 B! p- L0 D; C' H* u- C
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only4 @: S+ v0 K0 F4 g) |* v# K
performed in ring0 (VxD or a ring3 app using the VxdCall).+ I3 U" N' [. E
The Get_DDB service is used to determine whether or not a VxD is installed% U: I2 P s) L- c1 l" t. K* W
for the specified device and returns a Device Description Block (in ecx) for
7 s3 K" r' @) j1 ~/ Zthat device if it is installed.
! M" n- M1 _1 X* z) L9 I( s+ n) N" N5 ^
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
( u+ ]: B. T3 u4 b- p7 A2 p mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
% P0 E# d0 x! c1 K; I VMMCall Get_DDB
2 j( ]0 J$ S9 n6 ^# G3 m. R, J. P mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed& r+ p( Y7 v3 c6 `
! m/ k% x. p( [9 ]" v. l
Note as well that you can easily detect this method with SoftICE:
% H, H2 f5 N/ m bpx Get_DDB if ax==0202 || ax==7a5fh6 A/ O. v& c0 o( I8 Y& y
6 R0 y" u% E+ q( \# ^' S8 ^- v
__________________________________________________________________________
# F1 A& y8 J$ E' M1 l
3 a- ~1 u2 k' {# V! p. l& IMethod 10
" L g" Z7 S4 z p=========/ o/ r) b. f* S+ I
5 \5 v4 _; K5 _% g6 M; h7 [7 T=>Disable or clear breakpoints before using this feature. DO NOT trace with
" O4 T# F Y* Q SoftICE while the option is enable!!2 V9 F- @8 b/ F
6 \* ]! C# ^5 b; hThis trick is very efficient:
: `% ^6 d( T( n6 eby checking the Debug Registers, you can detect if SoftICE is loaded
9 X- U; o6 U. {& c/ ]' I8 F- q(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if) V3 v( G! t& ?, [: [
there are some memory breakpoints set (dr0 to dr3) simply by reading their
7 j: Y+ \; S% f# N1 U; z) Bvalue (in ring0 only). Values can be manipulated and or changed as well2 w' B! s7 q ?4 u3 i
(clearing BPMs for instance)% [7 W5 T% e. n6 _0 W
3 g2 D2 {7 a( G2 n) q! ^+ R__________________________________________________________________________
) G) B- o/ u M1 o9 D
; |: Z' W1 g" m, lMethod 11/ u7 H: d: K/ I
=========; E# F7 y1 a5 K, ~
# H. k. \9 d! ], {! J9 u/ d
This method is most known as 'MeltICE' because it has been freely distributed
2 X% C/ F1 `4 s. Q$ Hvia www.winfiles.com. However it was first used by NuMega people to allow
) ^! O- b' G# z0 H- sSymbol Loader to check if SoftICE was active or not (the code is located! R- M4 @$ E8 H# F6 A( R
inside nmtrans.dll).
: t6 B+ m7 g2 a* b# {% t5 U6 R9 r
: f* r! z# ]7 s2 tThe way it works is very simple:
" N% a% r: B) `3 P3 }9 q% [It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
0 a r2 G( z& I6 tWinNT) with the CreateFileA API.: \2 b. p0 n, r0 {0 s3 g7 m9 [1 f
$ G7 c( M9 j, D3 L4 H, N
Here is a sample (checking for 'SICE'):1 x9 q e4 @' T5 Q6 T9 M+ Z3 @
7 z; ~7 |# b. o3 \) l+ I* z5 L
BOOL IsSoftIce95Loaded()
( n1 `2 U% S$ I5 ~: D- S' \{ t; y: X, R( ]# i: l
HANDLE hFile;
, `, k' e0 T6 m! \( k. b4 k hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,6 u# W2 K& c9 b, b+ b H# `
FILE_SHARE_READ | FILE_SHARE_WRITE,
' p$ `4 E Z5 G1 {2 T" q, g: x- w NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
9 N9 Z2 v& T; V% S7 s; N# P+ a8 \, X+ ` if( hFile != INVALID_HANDLE_VALUE ); I* F3 L. G, h, h- d2 w" @( J
{ H! h& J9 q( c. H( `
CloseHandle(hFile);
* s* K) ~8 E8 f: e3 ^ } return TRUE;
5 T/ T8 j1 U) ] }# i' Q2 O6 ~% @0 s( z3 i
return FALSE;$ P! Y# {& U" c! C: L' I; l# G3 _' @
}' a/ E/ s7 e, V' Q% N
% Q- E% z1 Z9 z8 B3 w
Although this trick calls the CreateFileA function, don't even expect to be
* R) T% Q& ~; `: c! A, Eable to intercept it by installing a IFS hook: it will not work, no way!6 S- U' q5 j; J; |" b6 a
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
, u3 D$ R' n$ p! f# c- E# rservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
4 z/ K- |; c# F% g4 y" Hand then browse the DDB list until it find the VxD and its DDB_Control_Proc
7 ~) z0 Q& ?" F3 X0 Vfield.7 m! I! T3 [5 l- Z5 i- L
In fact, its purpose is not to load/unload VxDs but only to send a
5 i. d, ^8 H" \( B( R8 X' _. N# |W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
5 a& g! ]' r5 K6 Vto the VxD Control_Dispatch proc (how the hell a shareware soft could try; F/ z& p6 `# _* [6 @5 ?0 ^
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
% ], Z+ V1 f! u& SIf the VxD is loaded, it will always clear eax and the Carry flag to allow0 O0 \2 r- Z3 E
its handle to be opened and then, will be detected.7 U% @2 I4 V' M+ _9 ^' h+ U+ v9 T, e
You can check that simply by hooking Winice.exe control proc entry point+ ^9 G6 H) z% b1 _; @3 N2 D
while running MeltICE.
( O6 U1 n8 K5 {1 c& ?
' V( w4 W# u U. q, h/ Q
. d Z" X4 k B7 M# u 00401067: push 00402025 ; \\.\SICE
M( w$ `6 ]5 R. J& d' y 0040106C: call CreateFileA0 O" Y# a7 ]5 j/ j5 J
00401071: cmp eax,-001
9 Z+ l& C; R- t" W6 G1 k 00401074: je 004010916 G4 \" C3 }3 ?+ g$ s: j
1 p8 S. w m1 ~6 W4 I
/ W2 ~. {0 R9 c5 G* J* \% a5 `There could be hundreds of BPX you could use to detect this trick.
; L- X# l ~1 f: V2 O8 c-The most classical one is:. G# Q: R4 U. U4 J9 C5 a/ H
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
) O2 B% e1 Y1 [- ]1 L& l *(esp->4+4)=='NTIC'" Q3 Z4 f) G9 z
" x$ Y$ U5 W) L& d" b4 J3 L7 f-The most exotic ones (could be very slooooow :-(( ~5 W# K9 s# Z3 ]& j
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') ; W- y, M9 f' {- Y! d- Y: P
;will break 3 times :-(
0 R- o( q! D0 @5 }/ r7 P* t! k) `' v
7 q9 z2 D3 A' Z* q, v0 U, V" }. B-or (a bit) faster:
# u8 m* V5 j' \: Z& i; [9 h BPINT 30 if (*edi=='SICE' || *edi=='SIWV')( _5 X+ i* e2 g3 M3 }( g8 r
& b/ k# _8 e! z* m
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' / l' Z$ l8 t3 {
;will break 3 times :-(# @2 B) w R1 s0 u- R1 o& D
- c2 R* F7 k5 x* Q2 W
-Much faster:8 a5 k' |% s$ h4 w. M
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'" l9 f1 @: T$ ^: k
1 n- y v; Q8 O8 K+ x* N
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen5 e, [5 F7 S2 p U( Q3 ?$ x
function to do the same job:
# |3 A' Y# S% J' \9 I ^
- H/ K2 a% J3 `7 V9 d% L: g push 00 ; OF_READ& r& p3 X9 G. m5 W
mov eax,[00656634] ; '\\.\SICE',0
3 A5 z3 ^7 Q& \5 W3 \ push eax( {4 P( ^! _, u _- i9 I3 S( F% P- ] I
call KERNEL32!_lopen" N; O+ R9 q% Z
inc eax( D2 ?; _& A1 u( x
jnz 00650589 ; detected
6 Z( Y6 m0 W6 K5 O$ g9 f3 p push 00 ; OF_READ
( [' n* b5 b, e6 Q& X0 x mov eax,[00656638] ; '\\.\SICE'1 N( ?/ q% [( `! o9 Q
push eax& N4 @( a! `( T/ V9 S2 g
call KERNEL32!_lopen
6 m& y6 c1 ]. q# j9 |# Q( ` M inc eax+ g' `$ m6 m# g3 f) g9 x& l
jz 006505ae ; not detected& J+ T7 f" I. ?& e& V
. h/ e) U% S I* O! d" W
, ?$ w$ r9 B6 f& K3 n__________________________________________________________________________
, @ M* M K% e" V1 p+ P4 f5 a" Y: O* {2 I
Method 12* Q% z! S6 i# Z% T0 {& y5 Y$ X
=========" q' W0 q. o& h$ I) y! O
" w3 `( }7 r0 N+ kThis trick is similar to int41h/4fh Debugger installation check (code 05) u# p' q7 K& \" d9 |) N+ d
& 06) but very limited because it's only available for Win95/98 (not NT)
) a% b+ Z, q3 s* `# ias it uses the VxDCall backdoor. This detection was found in Bleem Demo.0 z5 Z( F( {4 b$ \0 Q) a
6 ^% W# C/ X9 S, _
push 0000004fh ; function 4fh- M* |! P) F- q1 R* h
push 002a002ah ; high word specifies which VxD (VWIN32)% w8 g g- V i7 d
; low word specifies which service
* e$ o+ }; f& I7 R# j. }0 d4 ^+ D (VWIN32_Int41Dispatch)
9 \0 _/ H; y# a( h call Kernel32!ORD_001 ; VxdCall( g! ~: R# e" a+ \5 y3 j& k- k
cmp ax, 0f386h ; magic number returned by system debuggers
* ?- y3 d% c) a( n jz SoftICE_detected/ O/ x: J* e9 H ~
1 n7 ]( T: |$ z3 l
Here again, several ways to detect it:+ a7 b3 G1 o( \" l: i& [
8 c5 U. z1 Y+ h# }2 z0 H5 G
BPINT 41 if ax==4f0 I) h9 ?- X- ] I$ _; a8 c5 J3 j
$ W0 l1 A ?# d2 p$ _3 j
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
! \( D8 k* h2 o* g4 r8 l4 r' G- T) T9 Y" p9 J2 }1 s
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A2 O( _$ s4 T* e
; ~" ^: u. ^6 L* q2 S3 G% S! ~ BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!5 O: e/ z3 ?- b* E [7 a
/ h# m( D" W& T+ V8 L" C__________________________________________________________________________
) U- K4 R9 ^' ^ L' x* k0 o1 h+ O( y6 t$ ^1 h' a: h
Method 13
+ E4 l: O; d* m4 A9 c+ Q=========
- @+ w* |; d* [7 X3 n
/ ]. m( G0 R% O/ X6 B5 Q7 yNot a real method of detection, but a good way to know if SoftICE is' |7 ^, Y* Q! w# _% g6 }7 c
installed on a computer and to locate its installation directory.
; \9 R" C. \: v: ^It is used by few softs which access the following registry keys (usually #2) :7 k& O5 ]2 |5 K. ]0 a
3 l" x. Y0 ~, u& J7 \$ I
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
, h# l- x9 P. E; R\Uninstall\SoftICE$ x6 t% ^6 s. j3 U# B
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE0 _2 z! ?5 M, j6 `6 |# z9 L' @, t
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
# F. q+ {; [+ O\App Paths\Loader32.Exe7 S& @2 w& @' s; c6 _( A. }
, O, o; U5 y/ k T$ _
2 t s& T# m8 F" T" H' qNote that some nasty apps could then erase all files from SoftICE directory
, ?& W' y! }& q$ Q1 k* h& L(I faced that once :-(
, k" Q2 i2 m, X( j% ?( P- W2 k$ ^( Y) a6 Y. K& v" A0 y: W+ N
Useful breakpoint to detect it:
: ?; C, v2 t% i5 Z- G9 A( ~9 B: L0 E0 v6 ^. _- ^ x
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
7 v' `* E. y8 s( l0 ~
$ q& {8 i p7 F__________________________________________________________________________: `/ N/ J2 r+ W1 l5 @
2 v8 C r7 R! t$ K. Y3 L! q
5 `1 G3 S5 ~9 w" g4 R6 I2 i* Q9 p% @Method 14
' L& }( J) L- }0 L& ~=========0 j: z7 p" {$ ?
8 s/ u1 T) c0 Y; Q0 t" y; m" c
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose. K6 ?+ N; q( w! s" p
is to determines whether a debugger is running on your system (ring0 only).
X* l: b b+ O
B& e' C7 H0 E; V& t8 R) p VMMCall Test_Debug_Installed
# m% \. U: T2 \1 D je not_installed
1 O/ X% V: U% d) k) @2 H
. N5 R! F0 @) H7 hThis service just checks a flag.
& `2 [* W) O* \</PRE></TD></TR></TBODY></TABLE> |