<TABLE width=500>" |- l' N$ y V! e: v
<TBODY>
9 `' y8 \! M7 U$ N6 `$ `<TR>% X. `) C' H3 \! U9 w& ~
<TD><PRE>Method 01 1 g; ]- Y$ n9 }
=========0 \' Z6 H4 N! O* z" W7 a7 S
0 y( V4 o/ T- A; Q2 \! ` S
This method of detection of SoftICE (as well as the following one) is
9 V: `+ v4 A* w. \used by the majority of packers/encryptors found on Internet.
5 g* P0 \9 f6 P0 K1 h5 hIt seeks the signature of BoundsChecker in SoftICE
7 u0 B; Y- \5 v+ i1 S3 s4 {8 V7 U3 j& q+ X" V. B
mov ebp, 04243484Bh ; 'BCHK'3 l! r( c1 O; u3 e% d/ A# k" O
mov ax, 04h
6 u! U& n% ^' ^; l8 o; u int 3 ( y+ O# m, u/ S
cmp al,4- g I9 l' f' f4 V
jnz SoftICE_Detected4 i0 B6 B" [, s( ^: c4 C0 z
- Y a" Y/ m0 q2 i; B o2 [! [0 `
___________________________________________________________________________: ^* q; c& s9 \% _1 O& Z
& p# k" d2 i4 B4 _2 h
Method 02
h; a( `+ c2 M0 i6 [# ?; c' s0 _=========4 X/ [4 R+ ~% ~: g& M
; Z, l: F; z& G+ U' s! c# rStill a method very much used (perhaps the most frequent one). It is used
: X0 H" k5 K; o3 Pto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
+ v; R; }4 k& e, lor execute SoftICE commands...
, W0 n! T% t* A# V' TIt is also used to crash SoftICE and to force it to execute any commands8 \) z, n3 ~! _
(HBOOT...) :-(( % \% i- p" J& z
+ Y4 ~$ {' `8 |- y
Here is a quick description:; b& P7 e8 E) Q: J$ H
-AX = 0910h (Display string in SIce windows)
! a& I6 o) x; V- y* K6 S6 s-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
$ L E+ @ r' I) a5 d-AX = 0912h (Get breakpoint infos)6 }7 K( ^: a+ }+ A0 D' |% [# ~
-AX = 0913h (Set Sice breakpoints)' Z, Y* `5 o6 X
-AX = 0914h (Remove SIce breakoints)
% L8 M) i* D4 a9 D& M6 U' @! b5 \& `" n5 |9 K9 H+ X+ }
Each time you'll meet this trick, you'll see:
+ ^& W# x' `. V( |; ]-SI = 4647h" r/ b& i# O+ [ ?
-DI = 4A4Dh
' {1 ^& {* @, f' uWhich are the 'magic values' used by SoftIce.
1 e, [ F; t& Z K9 NFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.% A- W& m: e+ e& q/ F4 r* I) ^
7 o( F. n. P# m* v0 A: H
Here is one example from the file "Haspinst.exe" which is the dongle HASP
! ~+ v( b4 d) B8 _$ a: hEnvelope utility use to protect DOS applications:
: ~+ `1 s! U6 s
1 `# x' Q) j9 E! x: o& {- A& l! i5 a1 h G. d1 w
4C19:0095 MOV AX,0911 ; execute command.
, W( h4 I$ s0 u: _; D* R" @" F8 r4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).: D( i2 q6 ]8 A' [! q) U8 c# b
4C19:009A MOV SI,4647 ; 1st magic value.
$ k% f- [% h' I4C19:009D MOV DI,4A4D ; 2nd magic value.5 V' ?1 j' b& @ s8 d
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
; f/ M# _% p* I+ c2 Q. o7 {4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute6 `" Q7 _8 R' s, ^7 b4 ?
4C19:00A4 INC CX
- U0 H- z. f$ ?4 h# e- Q4C19:00A5 CMP CX,06 ; Repeat 6 times to execute* h% T {: o0 E4 w7 Z1 o6 p
4C19:00A8 JB 0095 ; 6 different commands.
/ W( n( x+ M1 {+ m8 o+ v* x7 H4C19:00AA JMP 0002 ; Bad_Guy jmp back.
( L. i" H3 h! D6 b' _# o4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
. {0 g. ]. g4 |+ m
9 v7 ^# ]* e; v2 s+ ^/ LThe program will execute 6 different SIce commands located at ds:dx, which2 [* {# S" y9 w: k8 r
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.! b7 p+ K- N& O9 v
" N, e. c& U8 k/ T; B& T* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
( {" d) Z2 @+ e* e___________________________________________________________________________
& H$ L7 s2 U9 p( p$ z3 l; ^/ l4 E4 G+ R, w; I5 _( t
# `1 f3 S8 d8 U3 G9 }/ O1 [: YMethod 03
, h, N3 h w0 } f========= }( @" Z% n$ k/ L; y' [. P
" ^" k- ^# R; r0 o8 T
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h1 h! O1 t9 q; Z/ w' c3 ?8 G
(API Get entry point), g- ]/ p+ d% U! J7 z/ w
# v9 {0 {* S9 v$ ?- Q+ r! [/ v7 `; j+ n, j
xor di,di0 w$ p& |$ Q) O; E1 t. S
mov es,di1 E J3 v, t3 O) p* ]
mov ax, 1684h # E: v6 K/ j! G! x3 n% ]8 }
mov bx, 0202h ; VxD ID of winice
' b+ M) O% H5 x, P/ I3 k$ T int 2Fh; h- t0 W% o8 I) F# `
mov ax, es ; ES:DI -> VxD API entry point z: ?4 w( G1 q3 A/ [2 ^# V
add ax, di
8 f* a) J% n' {/ P6 p# l test ax,ax7 k* |$ J) e) g( j) D
jnz SoftICE_Detected. E9 y6 B4 z3 m% G& N( r. `* N
: X8 c. Z, J4 ^/ c+ g
___________________________________________________________________________
& o/ `& r1 e+ r, w. f0 O8 W2 K! @3 {/ ]
Method 04
! o' X" \% R3 C- s6 h=========7 r9 W2 F. D% l2 z; ^7 m
: S/ U" e; l) V2 i" L7 B" }Method identical to the preceding one except that it seeks the ID of SoftICE; \# e) _9 d. M; x) v: N( w# i
GFX VxD.
6 x, `3 k& k( H0 Z6 b( @2 P8 W) U4 e: J) N
xor di,di9 s( t) k4 t2 W0 v' G' Z, `# X
mov es,di
5 S! K# ^- y- n- X/ p0 Q- P8 a$ g mov ax, 1684h
0 B4 J' I( P6 b+ Y. e mov bx, 7a5Fh ; VxD ID of SIWVID+ g1 P/ e9 N4 s' l( H% O
int 2fh) s* [: A" J0 P# k3 _' r) p# R8 o
mov ax, es ; ES:DI -> VxD API entry point. o# I; c: ^/ z* z
add ax, di
9 o; M) k' D: P. [9 @4 i test ax,ax
& A/ E+ d% A3 Q jnz SoftICE_Detected7 W6 J J; h$ n) C5 s. m, w
. Y3 G0 C- o" K' V6 Q
__________________________________________________________________________
! y, c) y# k" j) H( q# r# d) |8 T t3 N3 F1 @
' q5 V5 A9 ]) h4 }- v$ F& L
Method 053 P5 z& D% H* p& |" M/ E5 W. b' \
=========0 k* ^- M3 g) v! L! x% _
. a' S3 m; Z! T! PMethod seeking the 'magic number' 0F386h returned (in ax) by all system @' s/ u2 W$ H$ S0 Z
debugger. It calls the int 41h, function 4Fh.
* J8 ^# s3 Z4 r9 x0 BThere are several alternatives.
( p0 ]5 x) \/ I; b( T9 x- Q( b0 h' u7 L8 M
The following one is the simplest:
! e" r! ~2 b& q$ H7 D ]& G
5 @$ [$ c1 B3 N2 y& o* g mov ax,4fh
9 l; |$ m' B2 R; I4 [: p int 41h
2 l/ }2 m8 C ]* H4 ^ K8 \ cmp ax, 0F3866 X0 h% a! a& Q4 b$ U0 J' y% ~
jz SoftICE_detected4 | J" N, \5 a: D! U4 f6 I
$ {( k0 N. }6 L$ Y9 W* H' h
$ F: S. T3 Y' }Next method as well as the following one are 2 examples from Stone's - ~4 v5 z6 L; b. z
"stn-wid.zip" (www.cracking.net):. Z* R9 D* `/ v z
- m; Y% r# V8 e, r9 |" Z/ T, [
mov bx, cs7 M. H* r8 v9 Y& H! e" k) Q
lea dx, int41handler2
) N( v5 P9 o& q5 J- _7 b xchg dx, es:[41h*4]
! |- F, W6 V, @+ R xchg bx, es:[41h*4+2]
8 Z" t; R+ B7 w) w3 \ mov ax,4fh4 @$ k7 ^ |! J; ^/ G, T
int 41h" O. A- ^- z0 l, j. I6 P
xchg dx, es:[41h*4]2 h N. `% X Q; H6 R' ?+ y" l
xchg bx, es:[41h*4+2]$ O) m/ d1 N6 b/ k$ E
cmp ax, 0f386h) ^$ f( Q+ m" G6 k' A% v- O; z
jz SoftICE_detected
@7 G7 k8 A( T. R8 m6 J. O U
& ?6 s3 A, w b9 y1 Dint41handler2 PROC
$ _2 x9 q3 Z, r( y iret3 g D# T) j1 a/ {/ g
int41handler2 ENDP' b4 t; U9 I3 N, X
! r2 k/ _- x$ ]: L7 }, E- A: d' o! U% b/ a/ z7 E9 R
_________________________________________________________________________
. s; U8 X6 |+ M5 I7 K3 a2 o, n/ C4 l( \' s1 @
9 o) r- v8 t/ Q% q' j! Y
Method 06
* {# k# `3 W2 ~, Z========= s4 `+ {9 D9 W
8 `! ?( ~ [ H. R* B% l6 X2 H8 c7 d7 L( `6 q- Q( x. w8 ^9 a. b+ ?
2nd method similar to the preceding one but more difficult to detect:2 }$ _8 b( w( U# @2 u
6 W" c# h7 h7 f( Q, K8 E5 u/ N2 W4 T& v) Q& q
int41handler PROC
( Z' V' w2 ^2 W6 X$ h7 b mov cl,al$ s' s$ C% F! @3 I; ]5 F3 l3 U4 r
iret
9 m; ^* T+ J- s" y! H, dint41handler ENDP2 i: `5 X7 t; x& _3 n, T
+ ^8 s" {9 E. Z. t4 e1 ~
5 n3 S; J+ i& o) p xor ax,ax
" k3 o0 ?: \1 T E& `* j mov es,ax6 @* p' o: r0 D( S8 p4 R
mov bx, cs4 t+ R3 x" S# Y( ~) ~( h. H8 A
lea dx, int41handler
) \: p4 l+ V) h$ h( n8 B xchg dx, es:[41h*4]6 c+ e/ K& s x+ w0 @) v. I+ k) p
xchg bx, es:[41h*4+2]
% u! v6 T! F; P, E2 ~ in al, 40h
1 x1 u* ]1 n- s- I xor cx,cx
- G+ u) C3 J: v# h int 41h
) a6 k4 x7 b4 e, U3 x/ Y xchg dx, es:[41h*4]
+ h5 {6 w( V. r& ]6 Z xchg bx, es:[41h*4+2]
0 f9 K2 j3 ~, k# x5 |; i) g6 @ cmp cl,al5 q8 C/ P4 W- a: T* r6 O, `
jnz SoftICE_detected; `# c1 S% P n2 w
. o8 v- w6 F2 I1 H_________________________________________________________________________
. o' a4 F4 j5 [- Z J
0 L) y9 l* O; R8 D2 S: Y) y9 D+ FMethod 076 z! w1 a# ^! W9 W) y, N- x" c6 z
=========4 O- a7 ]4 R+ n) q1 O0 x+ ?
0 R! w/ n$ J% }+ u- k3 [: p
Method of detection of the WinICE handler in the int68h (V86)' F& b. W& r, @2 e
% r" T* _# i9 b$ n; L D6 c mov ah,43h+ c; n: y: K5 ^ \" K5 a) K" d8 G
int 68h% i8 i0 l( \& ~
cmp ax,0F386h
8 g$ D7 r# ?4 S1 ` jz SoftICE_Detected
" Q* h" C( C, m) l# g* J7 |" b) F
2 E( L2 M. p$ ?; R8 {- q0 ^
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
$ F3 a, ~1 Y, L% l A app like this:4 `: C$ o& H( H( Y6 _0 \4 r
2 d: M' i9 P' ^ BPX exec_int if ax==68
# a: d4 L$ I, F/ L! j& V. ` (function called is located at byte ptr [ebp+1Dh] and client eip is
L4 M* e. H) M+ W, E, J located at [ebp+48h] for 32Bit apps)
: q$ v/ M, B2 Z, t+ h& d* j__________________________________________________________________________
) Z/ k! J. u a' F# a" F
+ \' y5 m3 e& n5 m) D- F+ D4 h7 `
Method 081 w8 \/ [: o1 e* H
=========# `( \* [/ X9 x
3 e* z0 t+ ]4 G; O0 w/ q- gIt is not a method of detection of SoftICE but a possibility to crash the3 T, A1 [% c) @5 J/ ^
system by intercepting int 01h and int 03h and redirecting them to another
' K7 n5 Y/ g4 J* [* {3 Sroutine.
& R, J# E3 r) ?It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points2 ?0 F$ p4 o7 ?& |# c' W
to the new routine to execute (hangs computer...)# ^+ ?5 X$ o1 }- V: U* p3 y! j
" s- ^) g; G& |& i) M$ ~
mov ah, 25h
- ~0 O! ?4 n# l0 g mov al, Int_Number (01h or 03h)
: p% ~; N W8 c3 j0 ]6 n mov dx, offset New_Int_Routine
9 A7 ~& r$ B$ h6 G int 21h" l7 E7 O# ?1 _9 R% y$ b$ C
6 i7 T0 y b" \3 ~5 W7 \# ^__________________________________________________________________________
- u3 x4 `0 ^- P7 ]) Y- D" m/ h, O% D! [/ V2 P
Method 09/ z* h( u- o; V5 A4 X( _
=========
" k3 n7 }6 Q: p4 j. T" r( W k& o6 P5 V5 \- j4 x- w
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
& K# w6 n+ h1 O3 j* v6 Bperformed in ring0 (VxD or a ring3 app using the VxdCall).
& C/ R/ r& ~: M( H% WThe Get_DDB service is used to determine whether or not a VxD is installed
: a$ X" y0 r& E: _: I( B( `for the specified device and returns a Device Description Block (in ecx) for B) B$ z/ L7 I( Y4 [5 t( M( x
that device if it is installed.- V% H% z* D- x# P, E2 q; r$ D
4 ]' P) P; p" N3 h mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
$ r, N% s6 ~% H+ W( I mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
' t- ?; U. A4 d! K VMMCall Get_DDB
: S) P5 V3 ~* L) Y, }& e8 L$ n mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
9 J6 p+ p0 q! `7 f1 Y: W
9 A7 b6 y; V$ e0 d2 lNote as well that you can easily detect this method with SoftICE:
& ]9 A. e. s0 D1 J bpx Get_DDB if ax==0202 || ax==7a5fh
! n2 D/ k4 Q1 I/ P# N/ P: L6 B. l* z3 R
__________________________________________________________________________/ H- m! } |( D; X) m: F0 I
; U* ^8 @ ^1 l/ d5 }+ e0 L' U& w
Method 10% d- `# M, c0 g- I
=========% S! J& W7 |& {9 \
; R! }2 l+ D7 H( F3 }! Z& D
=>Disable or clear breakpoints before using this feature. DO NOT trace with* r) ]# y3 c) z! ?% `
SoftICE while the option is enable!!( Z( `8 b* C4 z8 S/ N4 t6 t( J
! i* X& B9 s" q# O* g p" F' m" S
This trick is very efficient:
0 Y1 `7 ?4 L; P. _) m) E$ U- Hby checking the Debug Registers, you can detect if SoftICE is loaded
' A4 b- F4 k4 C2 S(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if4 u9 q' l2 P" g7 G
there are some memory breakpoints set (dr0 to dr3) simply by reading their; X/ v6 A& b4 D1 ^- g4 z
value (in ring0 only). Values can be manipulated and or changed as well
& a) r( M$ G" R6 J. }7 Q+ L$ C(clearing BPMs for instance)' |2 J! A% z4 w7 t. L" L
, Y# v) D8 J+ ?, r0 g__________________________________________________________________________
! w7 N6 z5 q8 Q) z' D$ L- }. j+ k2 C, t: ~# x
Method 11
& g( k5 r9 o2 A7 {; Z=========
1 X7 i8 h. f/ l/ C. {
2 }: | L/ L6 d; `) D6 T4 oThis method is most known as 'MeltICE' because it has been freely distributed/ _# |, n* U* N6 E0 l
via www.winfiles.com. However it was first used by NuMega people to allow
+ Y! v! n' g) R8 }; {+ F0 }Symbol Loader to check if SoftICE was active or not (the code is located6 B* t& K5 J" T. u7 n
inside nmtrans.dll).
0 R* k" l T3 u) `( }1 C5 N. \5 k& U' w
The way it works is very simple:" v* ^, C4 }2 R$ s7 P' v+ f6 B; m
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for6 G6 a0 H4 ?, h
WinNT) with the CreateFileA API.
0 Z; r4 l4 Y! j& q" }
; P0 ?- B6 u+ E& P V& FHere is a sample (checking for 'SICE'):5 m! q) l0 Z2 R; G6 [4 @8 y
' v/ Y9 ]& Q! H# \, D
BOOL IsSoftIce95Loaded()
& ]2 ~4 s7 x# K1 V6 i/ o/ o& e{) N5 O- [* X/ E; y6 Z* e1 q5 ^- L
HANDLE hFile;
& U! _. O# J5 h% U hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
9 Z; ]& Y. R; w FILE_SHARE_READ | FILE_SHARE_WRITE,% H& D. t3 n# T; V
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);) G1 ]9 c0 Y0 O& j! Q: k& }+ ~0 r
if( hFile != INVALID_HANDLE_VALUE )
' t4 d# o' D9 U0 h& V0 d# b7 Y {) z9 b5 V( Y) D/ ^% e* J
CloseHandle(hFile);
" Z9 Z6 I4 j; i, c7 ]+ p+ ` return TRUE;
( N& X- d0 f) K0 v }/ x7 g; ~4 Y8 c y$ L
return FALSE;! x9 K' y' u9 m( d5 o2 I& |" }% S
}
2 r4 Y9 t3 ?' `/ r( E0 \! D5 V" ^0 J/ P8 D+ @; ?5 s
Although this trick calls the CreateFileA function, don't even expect to be
( }. e+ d' i2 x, Fable to intercept it by installing a IFS hook: it will not work, no way!
$ q- ~! R/ Z& z5 @' b6 W2 _& NIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
$ A% n$ _ p! J8 E8 @service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
, g" _1 f+ D. n, V+ k( {+ f% w0 gand then browse the DDB list until it find the VxD and its DDB_Control_Proc
7 G5 j0 k4 l' ~8 U( \field.- b" G3 R# p& d; P; M7 q
In fact, its purpose is not to load/unload VxDs but only to send a
, \* A7 v1 P+ U4 s9 V0 f+ k/ ?W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)! b+ l1 F8 X1 x& g
to the VxD Control_Dispatch proc (how the hell a shareware soft could try- Y) L- H: S1 J* L8 x9 O
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
, h) u/ T1 X! b) ~# ]8 @. p. cIf the VxD is loaded, it will always clear eax and the Carry flag to allow% \/ u/ {5 w+ Y- _, r- m4 e* a
its handle to be opened and then, will be detected.: v2 {# l& L9 [; B) R+ v+ |2 i
You can check that simply by hooking Winice.exe control proc entry point: ?( Z! h4 W' j2 a" G* {( ^
while running MeltICE.
0 U+ d/ M4 [& P
7 P9 ]0 O2 V) I4 a* V Q6 M6 e/ Q; F
00401067: push 00402025 ; \\.\SICE* E* a6 D, `, a! H5 K# W
0040106C: call CreateFileA
/ g2 t1 Q8 E7 L1 {- x" \" P5 _% t 00401071: cmp eax,-001
" g* |7 ~ Q, [3 ~. G j 00401074: je 00401091
9 P4 F; l, r ?( R7 U' H2 N9 G$ C8 ~7 r+ c3 e, }
4 Q9 D! M! d0 s* k/ V5 l
There could be hundreds of BPX you could use to detect this trick.) `5 I& _5 a, r
-The most classical one is:
" I' K1 Q4 a( e BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
! m3 _! y5 C6 i/ N9 e *(esp->4+4)=='NTIC'2 r; w V6 {% _8 W' J# M' a: P
/ d; d! u! R9 N7 [, M- h3 e: c-The most exotic ones (could be very slooooow :-(
, S( G j/ u7 s0 @5 ~1 ^2 H: g BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
. u+ ^7 g: Q, l$ p1 a E ;will break 3 times :-(
# i7 p, [: E# p4 i! `5 ^/ r+ m
$ i: I) O" u q9 Z$ W H- c# }-or (a bit) faster: - j7 g- `/ |- I- Z% f% {0 v) r
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
& P; Z2 l! t% c! f2 M/ L2 ?* g5 _5 V3 A" E+ @5 x
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' - X1 R p2 ~0 C. S/ a [
;will break 3 times :-(
" [( P" Z5 n: D
8 h5 M' |1 D$ a9 M-Much faster:
4 i/ J: I- w# K, e. R+ k3 j3 | BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'6 T2 b) I4 I- l% @: @
% E( j8 z, l1 U" Z5 X- K$ nNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
( i: q+ j9 B! B& Bfunction to do the same job:8 C _6 K0 j* D5 V! h
% F* S7 z( s1 t8 U" o! p/ \
push 00 ; OF_READ( `) B& O6 o9 t3 q. r
mov eax,[00656634] ; '\\.\SICE',0
/ D, {& ^) r, n4 A push eax, k5 [6 _. s% Q) }$ R( _& p, D
call KERNEL32!_lopen( o" x/ K) ^: n- \' g
inc eax' V# [2 L8 {0 K
jnz 00650589 ; detected5 s' i0 @. n4 I. F
push 00 ; OF_READ2 G" n6 c. B$ g! T% m
mov eax,[00656638] ; '\\.\SICE'
4 @# j1 y' T( }# _6 V push eax
' Z+ }" {* D" ?; z9 b0 n, R call KERNEL32!_lopen
& I9 p9 t! W- y1 R) y% o4 ] inc eax
0 Q l- ]3 P- A ^# M jz 006505ae ; not detected% `* |( K5 c7 X6 @ I+ q( a
t7 _( ~4 @4 j& [" L7 m
, }1 S" K, M m6 _) y- a3 k
__________________________________________________________________________# P2 N% q; g% N. k3 P& J; L1 l& v
( C2 Y! \3 u6 K$ C
Method 12
) f) Y) c% S1 k k; `=========: E/ S2 {, {( r9 C
0 G/ I# w: S# N$ X/ J) S
This trick is similar to int41h/4fh Debugger installation check (code 05
: C. H$ t, K2 ?5 v& M C: b& 06) but very limited because it's only available for Win95/98 (not NT) o" S* Q/ Q, z% s1 o
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.: `1 J4 K' J6 r" J# r- h3 b5 ^
_# F1 M ~( ~8 J% X
push 0000004fh ; function 4fh' v% y2 n T4 u5 U3 S
push 002a002ah ; high word specifies which VxD (VWIN32)
s* ?. H# ~' e( k3 T ; low word specifies which service
2 E4 E2 ?3 }- M' {, G) z6 |1 _ (VWIN32_Int41Dispatch)
& o* D3 G N# B call Kernel32!ORD_001 ; VxdCall. }7 `4 a( [* p; g) ~5 f6 X' D
cmp ax, 0f386h ; magic number returned by system debuggers1 C9 ~% ^2 _. l
jz SoftICE_detected) z$ N$ p; |! {( ~# z
9 ]4 ]/ [% q1 u5 h3 b2 K7 ]9 Q! h: Y% SHere again, several ways to detect it:
- B3 F2 n1 y0 y$ O* X' L
" v' h4 `2 M0 ^0 T) a BPINT 41 if ax==4f
. S$ ]5 s" `0 j* U' i0 c
3 i4 r1 c" c; `/ f2 V, P BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
) n9 Z* R" q/ \' \ l
& Y' _, H! j2 c BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
+ d& ^; e4 s' `+ f6 W4 n9 N1 N% F9 b7 {- { S& B
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
- l/ ]: `) N8 G1 ~
- e" F; U: a. s1 ^8 H/ f__________________________________________________________________________
, R& m1 g+ f7 ]4 J
$ V9 X, t, v; Z& g0 P4 AMethod 134 Q& L. e3 N4 R \& T
=========
8 W9 d5 i1 o5 t$ ?9 n
7 Q& f% x; B/ T1 @Not a real method of detection, but a good way to know if SoftICE is2 G0 ? v4 ^& G3 g) k% G
installed on a computer and to locate its installation directory.
" \( J0 r- n7 ?1 Z9 @It is used by few softs which access the following registry keys (usually #2) :
% K- b6 U; A- i( }6 v2 k7 \; O. T4 h) ]+ m
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion' V0 X u# R( I# T8 q
\Uninstall\SoftICE- C. O& S+ d P, T6 B
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
0 `% D8 v" \5 [) e6 g" j-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion9 Q/ @3 D9 W0 m, Z j. b
\App Paths\Loader32.Exe5 s/ S+ {7 \9 J+ x- F* r7 A
$ I& I+ Z6 L* b; d' c! b% ~; i/ x0 |7 j3 D/ H
Note that some nasty apps could then erase all files from SoftICE directory8 i6 ?7 L) l. r. d: D; @/ u
(I faced that once :-(
2 ~/ g ^, ]2 I0 x& L5 S, Z+ D
" T6 X2 A+ ]2 g" T+ q- C$ Q( DUseful breakpoint to detect it:
@# s; b a& |0 C/ T3 L# p6 |# o# ?8 W
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE': P; H) L" F$ g9 t, A( k/ S
/ w4 T y1 [5 H& c M__________________________________________________________________________
5 J- v( F8 c( W6 g0 E% i( K8 N
( A% f8 b% h. _- ]$ S5 U/ ?9 w7 Y/ T8 g* t+ b0 t& g" N- y8 m
Method 14
* J' s7 m5 I0 a' p! H4 b=========
6 C0 M; R& d+ Z$ ]1 A( b
- `4 p! d9 u( q% d2 Q, B' TA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
& L/ C: J/ v xis to determines whether a debugger is running on your system (ring0 only).$ p1 w3 }( E3 L% {% T% T/ }
6 C6 x+ T" M3 |) [4 V3 \ VMMCall Test_Debug_Installed1 z" M& ^, ]3 V- U L6 j
je not_installed
% o# P$ D0 d7 ^$ @: t, E R+ M2 K N. U0 h
This service just checks a flag.4 R$ ?# Z% z, E+ M
</PRE></TD></TR></TBODY></TABLE> |