<TABLE width=500>
8 Z7 s) ?2 R* j<TBODY>
9 e S$ O( ]5 ?" D+ ]5 G X<TR>
) p. K' x2 _, n1 Y' r* M" c8 U8 T<TD><PRE>Method 01
: e- N) q6 w" w* K/ {% X7 @6 c6 t=========# \, f# y6 E0 m3 U4 V! Z
0 @6 B: J, t& |, |+ Y: z; oThis method of detection of SoftICE (as well as the following one) is. B V/ Z. P! V' q1 E
used by the majority of packers/encryptors found on Internet.9 q' M3 q: |) v% a
It seeks the signature of BoundsChecker in SoftICE
9 r+ x% G+ |* \# b) ~$ U6 J
6 a1 w8 s+ }; C5 A mov ebp, 04243484Bh ; 'BCHK'6 ^1 U3 Y6 Z( `- J
mov ax, 04h
3 f: o( N9 M- G& O3 u& ?0 i' t' O int 3
) _% |2 n P! U+ y# M" X cmp al,4
; f {) v d0 m( N, Z0 H u% i jnz SoftICE_Detected6 F' q! b( Q) n7 {
. Y8 m7 Z# P2 L___________________________________________________________________________- @, v2 O# A3 o8 x
" F2 g# T! G, H" u
Method 02' ~& `6 N% M/ z
=========& a5 ?6 e9 V1 v$ }2 o
' f7 e7 j0 @) w( T( r$ B. h
Still a method very much used (perhaps the most frequent one). It is used
# V6 F2 {7 q) h" \to get SoftICE 'Back Door commands' which gives infos on Breakpoints,+ N/ j! ~, T6 v9 w$ f. H8 ]
or execute SoftICE commands...( z$ S7 F! ~% r' J9 D6 [7 N5 V
It is also used to crash SoftICE and to force it to execute any commands
3 |1 H+ j: n+ p8 X(HBOOT...) :-(( , v& Z' l: t0 `6 r Q. Q8 w# i
6 t* u8 x3 I: B: a. }! \Here is a quick description:
8 c4 |8 c& @- `4 i2 t7 U. M-AX = 0910h (Display string in SIce windows)+ Q4 ~( E L& C- V8 H8 O
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)( C* t( l4 H8 B( b7 |
-AX = 0912h (Get breakpoint infos)
; y6 w; i: S% [, T* m1 l5 V- B-AX = 0913h (Set Sice breakpoints)
* f2 X/ O6 J. M) y-AX = 0914h (Remove SIce breakoints)1 l; S# L9 W, @! h& K) _! o+ {3 y
/ ~; u+ X5 t, j& P7 AEach time you'll meet this trick, you'll see:
5 n; K- j* C; q. l-SI = 4647h
; ?. _! R: d( f" J( F/ M-DI = 4A4Dh# Q4 ^' w( _, J+ S7 E" k- ~
Which are the 'magic values' used by SoftIce.
% I( r% o/ d$ e6 [For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
; ~. `% } L m' {8 ^& [. u4 S$ e3 d/ f
Here is one example from the file "Haspinst.exe" which is the dongle HASP
w) a B: f5 `* a: ?7 v! M9 @Envelope utility use to protect DOS applications:9 ?3 s" q" V [
# F x, f5 o5 k1 S' J1 K
/ ^: r1 N/ v" C6 N
4C19:0095 MOV AX,0911 ; execute command." O' g7 F- f/ D9 m3 B. o9 g X/ l
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
8 D2 q8 t" e/ l2 Y- n" t4C19:009A MOV SI,4647 ; 1st magic value.1 Z! o0 ~7 O) m6 R1 H
4C19:009D MOV DI,4A4D ; 2nd magic value.9 ]+ R! \( P4 {+ o1 E
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)5 K) v- \5 A; o3 n7 `0 b5 ~
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
7 W0 g, t! p/ S. p4C19:00A4 INC CX" Q4 W. O% f" r- A" C. k. }
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
, ^7 ~/ h& o+ q$ x4C19:00A8 JB 0095 ; 6 different commands./ L3 I/ R' r+ x" T- ?1 S% L
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
" C5 w3 X6 A( v z1 k4C19:00AD MOV BX,SP ; Good_Guy go ahead :)9 m( _/ w* B8 I0 b. u5 v% i
- F, Y/ J( N2 S- R5 r
The program will execute 6 different SIce commands located at ds:dx, which
- i4 A, E$ E1 I( t' jare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
8 ]2 t6 \' R' Y! ?
1 z* R/ {/ ?( a3 W& ]$ r* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
) g0 X& A- J W! }& l___________________________________________________________________________0 c- G2 t7 `% R. f0 b' Y9 Y
' a- D/ K6 v& Z& u' s, i9 B
# j7 D' X8 {! `# J
Method 03 [" i) c. V* |3 B9 O, ?
=========5 B- }$ i5 g7 x
7 O) N. r) p. B# x {* Y, b1 GLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h/ R5 C" G9 _ T& ?7 X. Q, t
(API Get entry point)
0 C0 H- M8 E! Z3 S, \ ' s9 R P) ~% m# m* n7 u
4 l+ ?+ w( R4 y6 a) F- m5 h xor di,di2 s* x6 E" h: R! W& B
mov es,di/ F) |/ w' ~! k( r; a; q9 T% _
mov ax, 1684h
K4 t) W. }# \ mov bx, 0202h ; VxD ID of winice* L8 J( A% ^9 k4 W& u
int 2Fh
9 L2 S: f+ a7 A" z mov ax, es ; ES:DI -> VxD API entry point
& ?& M1 w* q2 K9 V; q9 T& C add ax, di7 N: q7 `) \' l9 v3 Z
test ax,ax
* h5 G. u% ]* Q# j% C5 M jnz SoftICE_Detected
: e: {: h- s+ P% ]. V/ f+ O+ ~$ b4 @0 ^
___________________________________________________________________________
8 C" x* g I {4 \6 y# r9 g3 ^! C* U E$ t2 K1 A
Method 046 E p1 j6 c- ~$ v4 J
=========1 z- \6 m2 u `1 ^9 ?: C2 ^+ N
7 r) I- N; O) Q* M6 hMethod identical to the preceding one except that it seeks the ID of SoftICE2 n, U; t5 K$ F+ o% s7 o$ [
GFX VxD. \+ v( e, d, o* P# h, c% K$ h7 K
, @9 z. ^; ^0 a. F% A1 k5 C$ x
xor di,di
. z: }' r5 H2 Z$ o6 g4 y- j mov es,di
1 n" `9 U5 \+ U: [1 ^0 i3 l/ w mov ax, 1684h % [% K/ t8 w: O5 H; E
mov bx, 7a5Fh ; VxD ID of SIWVID W* f3 H' J, r8 v' [$ y( i8 |
int 2fh
7 Q) G% q; D1 X: L/ A9 g mov ax, es ; ES:DI -> VxD API entry point* u+ g6 J& i/ g \2 Q- }, \, }3 b
add ax, di
6 N: c/ l( Q) p# S6 c test ax,ax
% J- `9 A$ f& S& K jnz SoftICE_Detected
0 R3 x% V; o" J# y' C; h
4 @2 R! [1 c: T1 o, h2 P__________________________________________________________________________& V3 L6 {" j* n6 N2 l1 a& t
. K- w, p5 W3 u) a0 s' b+ L) P9 H% R! O, F# ^
Method 05
k( z7 C% V- P/ l=========
! e% h0 l9 X- a* I8 n
, s1 I; V) W( H7 F- q3 OMethod seeking the 'magic number' 0F386h returned (in ax) by all system7 I: v* U/ C1 v
debugger. It calls the int 41h, function 4Fh.0 O2 ]" Y) G5 P% v j
There are several alternatives.
$ H9 H: `0 l7 `7 E) ?
, ?1 _0 ~0 l2 F9 A, v# b9 b1 WThe following one is the simplest:2 @% k# R" E0 L/ {8 G7 Z
/ w+ k6 ~0 j( ^4 S1 l( Q" w( X mov ax,4fh
3 N" u: F/ U) r6 g5 o; q+ W int 41h
- m) E V d: \* `' h V cmp ax, 0F3866 M, ]8 b1 O" K/ F: l4 t* a
jz SoftICE_detected
5 e$ z' y5 L5 d K8 E3 C+ T1 o! f; V' f
" R! T9 ]1 S. c$ ~2 h; G
Next method as well as the following one are 2 examples from Stone's
$ e% S# ^! c) g"stn-wid.zip" (www.cracking.net):/ _( K2 _, o" @% K" z
% c& u' r8 ^; e2 m' e# n1 i mov bx, cs4 j: _. _9 [3 m' P4 h3 e$ p2 E
lea dx, int41handler2( L* R! }8 u; o
xchg dx, es:[41h*4]
( v d! T1 K4 y* ? xchg bx, es:[41h*4+2]
; D0 d" K( n& t+ n/ l" n9 i mov ax,4fh A1 l% E( c4 q6 Z/ P' T
int 41h, Q3 e6 V0 v; r) E4 g) @ b
xchg dx, es:[41h*4]. [3 o0 [+ t: c5 ~1 _% @ W
xchg bx, es:[41h*4+2]! U" [8 Z( w7 x: g2 Y: |
cmp ax, 0f386h
$ R2 p) s+ V5 a x( m \ jz SoftICE_detected" n) k; U# ^" d# ~0 z1 @
, U; k9 R! `: A2 A6 s9 {
int41handler2 PROC( S! }# P6 @* b+ b* N- b- T
iret$ L- c+ ?8 h" {
int41handler2 ENDP
+ K: }& T( T% w3 e" H: O! T# ]4 T, E: Q
. W3 l8 f0 ^& a8 L0 v [4 v
_________________________________________________________________________3 u7 l" x# |! m1 _: y( D
2 v# ~, K/ p$ f6 S7 _6 W+ ^3 I# a: x0 O2 i9 v9 K$ Q
Method 06" T* Q& Q" \: ?* Q- R
=========' _, I" _4 j! P" C4 C8 t
: V$ P9 i# z% c
4 }0 Z& D* P6 L, C* b+ e! m2nd method similar to the preceding one but more difficult to detect:
8 \9 k6 V6 r- o+ l" y. D/ d( L/ X' R- m. m4 J0 Q
9 ]' `3 c% W! \$ {, T: xint41handler PROC
' C; l) Z3 S" v. N0 q1 ~- g mov cl,al1 n( o" P6 v9 R$ y
iret! m# L. U$ p @
int41handler ENDP
4 r# u6 o3 H d, n. c2 R! |4 e. n( I$ R4 p5 M
5 W+ n8 K3 ]/ ]
xor ax,ax
! |" L1 G O2 U& w& _ mov es,ax
) Z3 Z1 T0 V; X' z$ G6 j1 o mov bx, cs7 [8 A4 e5 [, u* _4 [0 j
lea dx, int41handler3 c3 s! ~) u3 v. @0 y: g
xchg dx, es:[41h*4]
; H5 b0 \/ H- V+ f) B/ h: E+ [8 N xchg bx, es:[41h*4+2]
3 G5 v) E7 J5 Y: k in al, 40h5 A% g- l1 W- h. B" d* D- `. `1 ]
xor cx,cx" ^2 E' C' J2 h$ E9 _: ~
int 41h! W* S C/ N8 {. i
xchg dx, es:[41h*4]% _1 z+ e- L( R1 k* }# A! X$ g
xchg bx, es:[41h*4+2]. P$ _+ p4 T7 J
cmp cl,al; l( ?0 I% K# p
jnz SoftICE_detected
$ e7 C4 {% c& u$ y' S. p) _% ]' I* h( h1 g5 j' k% Q/ [& p% l; R0 n
_________________________________________________________________________
( @5 ~3 G D$ |8 v
% ]: E3 s9 K! R. u gMethod 07
( n! ]9 N- t/ v; D/ X/ ]=========+ |# s B1 e& M& \" S. Q w
) J' Q! _% `% A3 k/ l
Method of detection of the WinICE handler in the int68h (V86)
2 f H9 S3 w' w. E6 s# ~7 p! s. y( _9 ?
mov ah,43h
9 f$ T+ t# v6 d int 68h
3 C! i/ h+ O" N& E t cmp ax,0F386h- d( w8 F/ e0 H! `4 C2 _
jz SoftICE_Detected& c' d0 R1 B4 ?' z
" E/ P0 P5 ~6 Q9 Q# o) k( L( }$ M& b/ m- G% t* Y% Y
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
8 m' y8 G5 p$ K: D app like this:
4 L0 V9 ^7 k+ u. B0 v
5 b+ A$ u& w" x( u& K3 C; ~, g BPX exec_int if ax==68
; \2 H! {6 E: P! K3 I8 r+ G (function called is located at byte ptr [ebp+1Dh] and client eip is5 m' P. m/ k2 y; S( H j
located at [ebp+48h] for 32Bit apps)3 p% r! M6 B. O
__________________________________________________________________________
; v2 W7 Z: ]; @5 t9 j( k, ~# c1 C+ Q3 t( O0 j
1 q3 l; Q- o$ T u7 J% ^5 T- a: i
Method 08
7 J) U$ Z+ ^. p" u. ?% c+ H=========1 ~8 m0 ~/ l% O5 X
3 `9 t8 ^1 ~! f+ M' C
It is not a method of detection of SoftICE but a possibility to crash the
4 D. A7 Z$ o( k' O5 Csystem by intercepting int 01h and int 03h and redirecting them to another
* W% E! r4 H8 f. n0 i6 @routine.
, f- ?; J' g' [! [' U/ BIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
( C" P/ ~! N6 F! s+ ?& ]8 dto the new routine to execute (hangs computer...)% ]0 I0 i* B/ ^1 y- ~
7 g" @. Z. T* H: @) A mov ah, 25h
) u$ f5 j q* Y) }' V& Q' E1 P mov al, Int_Number (01h or 03h)
0 ?& g0 q% k/ X mov dx, offset New_Int_Routine
# i+ W( a" |1 \+ a9 E5 m* S. k4 y$ X int 21h+ M6 B T L8 T& r
( m5 B9 K; s ~! v& W7 T3 g4 f__________________________________________________________________________' S: }9 F1 A2 D
) A4 a9 u9 U5 i: H
Method 099 v& R6 u4 x- m6 U4 V2 T7 y1 t% H
=========3 L% C! q9 j$ }
3 B% d% X2 `! R7 A, e5 ^
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
5 I" N# W- s2 c' K8 gperformed in ring0 (VxD or a ring3 app using the VxdCall).
- U1 `9 |9 \$ G% _, PThe Get_DDB service is used to determine whether or not a VxD is installed3 ^) ]4 x+ s4 d
for the specified device and returns a Device Description Block (in ecx) for
5 c1 L6 P, N" f7 e- |) Ethat device if it is installed./ X8 `% N) v% L3 U. }: K8 x
* ]3 ?: n$ c; {) ?' a
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID4 {* P# Y2 P2 `
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
/ i- h9 e+ t' e* Y7 s( V VMMCall Get_DDB7 j3 s. C0 L7 F0 |' @
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
. }1 |3 k. Y+ l" b& J
* K' C" q9 O2 K/ `4 ~, nNote as well that you can easily detect this method with SoftICE:
* n; f1 W0 c; m* G bpx Get_DDB if ax==0202 || ax==7a5fh! \/ O# {3 \! `9 z1 {; R8 v0 V
: u; Y: z+ J4 D$ h$ ^
__________________________________________________________________________, \7 {( B9 s) q+ w2 R7 e. b
5 U! \! m8 _4 Q* N) k. C0 vMethod 10
0 i& E! C7 E, I2 W) U' N/ X" |=========
3 a. S& z/ G& J. a# J$ u
% t/ G% u4 s( ?* Y" Z& r8 C=>Disable or clear breakpoints before using this feature. DO NOT trace with: ?' @* z4 A8 O5 e! ?1 w( S: |) a) j; h3 Y
SoftICE while the option is enable!!% z R' M3 G% G5 r8 k( [) U8 U
! q! Q2 F5 a" y/ z5 z: ~This trick is very efficient:
+ R! z' H. H: I/ Z2 |by checking the Debug Registers, you can detect if SoftICE is loaded
0 g8 \ Q' P |4 B; g0 J' ]# B j(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
b$ v/ o6 {, F" K8 c5 }" S. E+ u4 wthere are some memory breakpoints set (dr0 to dr3) simply by reading their1 l4 {7 Z& x$ e1 P) I/ @! y
value (in ring0 only). Values can be manipulated and or changed as well+ W8 j/ S0 o% B* Z
(clearing BPMs for instance)- i! x& h1 R5 W0 M! B2 M: p; E5 ]2 H
+ b y! n7 ^% q3 V7 c5 n
__________________________________________________________________________
/ O4 b7 Q, P ~/ R# t+ E% p g4 z ]$ l+ O) f
Method 11
2 E3 K a% @0 |! p: c* |=========
8 _3 R4 Z2 L1 t W( W& i4 w2 R2 ~5 q% R" R9 R! Y" f ~" e& c
This method is most known as 'MeltICE' because it has been freely distributed* ], _) f3 ~8 M: ?4 b/ u4 S
via www.winfiles.com. However it was first used by NuMega people to allow
- \) U: y' X/ kSymbol Loader to check if SoftICE was active or not (the code is located0 X) h, n% [, G/ p; `
inside nmtrans.dll).4 Z( `# P4 ~/ [* o
+ R5 r4 z( H4 J# J2 ^& f2 f9 u
The way it works is very simple:$ n' f1 u" o* c6 ^6 f
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
4 b/ s( G9 ^, MWinNT) with the CreateFileA API.
+ F) K) L U* w: |4 I' n) o* {5 m
( S; u @7 g' [) ]/ \+ T% ?6 JHere is a sample (checking for 'SICE'):
+ f$ ~, k; y) n4 K- h" {3 K R
. t' H8 |5 y2 T( r" w9 E, rBOOL IsSoftIce95Loaded()9 i( @! R, {7 _8 _( k
{# W- |. Y: J' A; k: Z
HANDLE hFile;
4 T6 B* ?7 e- C+ ` hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,1 }# f" u1 _* r
FILE_SHARE_READ | FILE_SHARE_WRITE,4 U& G" Z% R3 l0 r7 Q% {
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
/ L- A- U% F! T5 \" t& \) j$ O if( hFile != INVALID_HANDLE_VALUE )9 z) y/ k6 ?% v
{
1 w; Z) K7 k; @! t3 [ CloseHandle(hFile);
8 l$ h5 Z$ e. m! e return TRUE;
7 f6 k; n7 K! A! z }- o( ~$ `% n8 Z2 U7 u
return FALSE;6 j* B! V/ ?- w
}+ l7 f+ ~8 v+ w' W. N b( @: O
! A" j5 ?. R) ^, L/ N3 KAlthough this trick calls the CreateFileA function, don't even expect to be
4 _9 |4 @" O7 }; N3 t$ s; r( s9 T& Yable to intercept it by installing a IFS hook: it will not work, no way!6 L4 v1 ]7 T% c4 M/ A9 p2 n, x
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
5 r8 n. q& X: e1 g: C6 bservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)- x4 K. { _; g" s9 J8 k- W7 Y p
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
" S* E! U% }7 }" s# i0 Kfield.
, u$ x5 J9 }! U" h% r" a6 Z: K( u% vIn fact, its purpose is not to load/unload VxDs but only to send a , n& t2 I5 c" c2 T
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE). ~- S& Y- U) `6 F# ^" F
to the VxD Control_Dispatch proc (how the hell a shareware soft could try3 U$ S+ u( C& B3 D- F
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
, z& ^' B' g% q' `5 FIf the VxD is loaded, it will always clear eax and the Carry flag to allow
]2 ?# Q( w2 [+ g ~9 b/ j( }its handle to be opened and then, will be detected.
/ {' Z( R3 a/ m" R/ e+ {) |. xYou can check that simply by hooking Winice.exe control proc entry point6 V1 O+ b0 r0 v, H; u' ]6 A
while running MeltICE.0 m1 M& a) z% H9 \
4 x& ^9 J" I( J% H
( G" F/ J: t$ B% [
00401067: push 00402025 ; \\.\SICE7 ?+ j: P6 ^) j+ h: ]1 _8 e" d+ L
0040106C: call CreateFileA7 U& u4 ^: Y8 z& f+ e5 K
00401071: cmp eax,-001
5 P9 ~+ q$ M7 d7 C J 00401074: je 00401091
* E+ \0 E; U% {8 Y6 g9 I; ~7 R# m5 H, }. w) f
/ F. o9 r1 \" `( A5 z
There could be hundreds of BPX you could use to detect this trick.
' g9 G+ L" r U( w# I-The most classical one is:
9 j0 U7 y5 I0 L, y; Z# g, Y; Y6 n BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||1 Q/ s4 x( s# y% l: p" m
*(esp->4+4)=='NTIC'( G8 U- e4 F4 ~- A' m
2 F3 i8 e. D* P1 ~0 {4 ~ m3 \-The most exotic ones (could be very slooooow :-(
5 Z8 s& M; P4 D' i- r T BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') $ k& ~9 {( f. g& }% b
;will break 3 times :-(
6 Q! u8 h% r4 \% H+ c% I# H
, o$ W& v8 i/ S; O1 X-or (a bit) faster: # _: [4 `% u( O, ?
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
; ~, @6 f1 G2 D D! w. G" H& h8 F( n& H4 T/ R9 G g: Y
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 0 C& B9 D9 a6 D! B) X
;will break 3 times :-(
' b7 |& C/ n$ m7 P# W" J; M5 I) O7 Q/ P- m2 |- |; p
-Much faster:
1 ?- w9 }: u4 V1 P! n5 t- S BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
: U: w6 @. a! h& N7 k5 Z; S+ L4 W: C$ D' h2 @
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
: u) X: a/ |- K' J1 Sfunction to do the same job: |" X0 S8 S2 O! S% z
# s% \: P* `2 |$ T1 ?2 y5 N
push 00 ; OF_READ% Q, ~6 C7 y3 G+ j' y
mov eax,[00656634] ; '\\.\SICE',08 z3 g: b7 y+ Z- {
push eax2 Q$ `# k+ C9 {3 K' [
call KERNEL32!_lopen# T! {0 @9 y3 K8 N1 `' p
inc eax0 d( h* `3 T& c4 p; F3 _) H
jnz 00650589 ; detected
/ K* t0 d5 @1 s/ N2 Q: z/ Q8 V push 00 ; OF_READ. L* N: z, `0 F5 Y' C, Q: E+ R
mov eax,[00656638] ; '\\.\SICE'
$ Z! y$ w; k4 v& G* K push eax. c4 i) ?4 o. V% }
call KERNEL32!_lopen7 p7 ?/ m' r" V. H% A: ^; O
inc eax# O( t$ y# T+ Y
jz 006505ae ; not detected5 G6 [& |; B \, t" y" O
R: Z" D' m# O/ p
' J( s# q% z$ r3 c* b__________________________________________________________________________2 b( ~ ]" P' ~8 {% m/ G1 Y. d1 V
( q/ l, R3 C& F. R
Method 12
, l g* A$ Q6 m1 K" G' g. P=========
- M) r+ X+ ~+ ?/ @* t
! z5 f$ x5 g$ EThis trick is similar to int41h/4fh Debugger installation check (code 05
+ @, H, l5 a8 B! ]$ l! ?& 06) but very limited because it's only available for Win95/98 (not NT)2 g% k; p) H* k& `6 z
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.# H8 l3 R& X# e) D1 t0 z3 G q. n( a7 ?
4 L4 ?+ h( c' j8 E; V9 |& ~7 \ push 0000004fh ; function 4fh% U9 _% j, m* P# B4 i" T
push 002a002ah ; high word specifies which VxD (VWIN32)/ W% x8 c& ?* ]# z7 i7 c+ k# B4 i
; low word specifies which service
9 E& t L; q" v1 R. u$ p& E (VWIN32_Int41Dispatch)/ L4 I, L- S5 L6 X2 }' u( o+ b
call Kernel32!ORD_001 ; VxdCall
0 H. ?4 M# o% V* g. Z7 N cmp ax, 0f386h ; magic number returned by system debuggers+ u: Z3 w2 E, H0 P% i9 t% w0 [
jz SoftICE_detected
7 J; S8 }6 J% c% E% e6 m6 ~0 W& [# I: q7 X1 z; }0 g' O! K) J
Here again, several ways to detect it:
' M3 ?8 W" X# g9 D6 {
2 @5 W b J j! E- q! l, ~. e BPINT 41 if ax==4f
6 Z8 X: {5 Y" d9 p O ~# X6 S C" k2 `8 |) F6 v
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
, L# S2 h* _4 v! D1 Y
3 z" M& n- e8 G( A" j) h BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A; x+ i K0 B. J. Q" N2 \* U! ?
) {. N+ u/ C6 [8 s$ V BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow! M! l$ g: i; L/ O) P( L
; L% E& m$ b. E1 c" V
__________________________________________________________________________
5 v3 V5 K4 M0 A4 V- _8 V$ f( M [* m, W- J1 g
Method 13% k* A- e J! r2 o
=========
1 ?/ l: H7 N- g* A5 }* v y: g: r
+ `' w+ g# _0 l% k+ t% {4 CNot a real method of detection, but a good way to know if SoftICE is
4 Q. {: E! J5 f+ E! p/ q1 ^. i% dinstalled on a computer and to locate its installation directory.' ~5 [! |8 A4 x- p
It is used by few softs which access the following registry keys (usually #2) :
- V7 \2 T0 B( J: y$ Y" i- I7 e( Y# t
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion* H0 r; L( N2 U" @0 |" x) H
\Uninstall\SoftICE7 H, s8 Q: ]3 x3 N) s
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE8 y$ q7 D- C9 P& A" P+ K5 v
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion* @0 B, X/ I, c% R; \0 m! X
\App Paths\Loader32.Exe
$ o0 Q$ ~7 }3 C7 i0 Z+ s& `# h1 @; A2 i
0 O0 x; a( b% C/ d) b! v! Y" K6 y3 ?- Q+ H- m: A( `, w
Note that some nasty apps could then erase all files from SoftICE directory
8 f) _1 ^* u* B) U( {(I faced that once :-(2 S+ g% `! [) Z
2 {+ z* q' O: I! c# N# U4 B( f
Useful breakpoint to detect it:- h9 H/ g2 p! C- J
% G: R$ I4 l, E; ?3 ~# M9 C BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'$ |8 U$ q1 f0 t
# h, Z9 D% ^- M& x; b. d* c__________________________________________________________________________% Y7 u2 {4 ~0 d+ F
# y/ M. ?+ M0 R3 J& `
4 @1 W' v6 p8 TMethod 14 ( A6 I9 A2 N+ M- b( S( c7 F
=========
" Z* z% ?, d) R1 o
# ^6 n- l2 ^: sA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose* H T! y O P
is to determines whether a debugger is running on your system (ring0 only).7 ^ j4 a9 R( I
% e8 S' s' S3 Y, e
VMMCall Test_Debug_Installed" f. Z' @9 r4 W, H% d
je not_installed6 N& I# h+ m6 C$ u- B3 u6 L
0 q. ?1 w0 Y' c' m8 k
This service just checks a flag.# h" [1 n- `$ y6 ~2 F0 F' y8 p" g+ W
</PRE></TD></TR></TBODY></TABLE> |