<TABLE width=500>
V( M' D+ y" m, _<TBODY>
" z& q! B- Y3 i% S: W5 U<TR>" ]; \+ C2 e+ O% @( m
<TD><PRE>Method 01
! c2 b' O; [9 s% B=========! y6 Y+ [4 F) j- D7 R
6 _8 J9 B0 a, w% J3 F" u0 _0 g d2 ~This method of detection of SoftICE (as well as the following one) is
: a) T- S: ]9 J1 rused by the majority of packers/encryptors found on Internet.
* Q s5 f, r# a* h- t. X& u6 W) DIt seeks the signature of BoundsChecker in SoftICE/ G# n; i3 B8 [' L! V
) F. D6 z# \& H' X# E mov ebp, 04243484Bh ; 'BCHK'
; [4 q) M# k! ]! r mov ax, 04h% @, I! U8 i* M, d
int 3
3 _- h- h8 k5 v% z5 A; I+ y$ O1 q cmp al,4
7 o: i9 c! @3 s: v# X jnz SoftICE_Detected9 c0 P/ y5 c, ~ b# m4 n
) N, I0 T* O* }6 D& ]
___________________________________________________________________________: T/ K: l4 e+ s x7 V
% I; r+ f8 T4 W3 D! E5 RMethod 02: s. q& x: u% H' F% F, u; j
=========
- q1 D2 Z. h G9 K* N: d
2 m# Z) b' n7 W) M; M! @2 @& ~Still a method very much used (perhaps the most frequent one). It is used" }5 @, W/ |4 q) q
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
) S2 O: M T8 U# Y ]2 D7 }or execute SoftICE commands...
! M% [* x' |4 V/ B/ Q7 X# L: NIt is also used to crash SoftICE and to force it to execute any commands& y7 Q3 _3 Q: s6 N1 c: r" m, c2 g7 y
(HBOOT...) :-((
: O: b7 x, R2 D5 [) U
! G+ v# `4 Z) i8 v" t1 dHere is a quick description:
/ k% H. ?3 X, @$ ^; A-AX = 0910h (Display string in SIce windows)
. |# H: v% Y/ |2 N; _1 \$ E( D-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)5 O6 E3 R4 j6 K) U! [$ p" R7 t! A
-AX = 0912h (Get breakpoint infos)
6 |& M6 l$ v, c' i-AX = 0913h (Set Sice breakpoints)5 s5 O- [: t& j2 R. e# f; f m& T
-AX = 0914h (Remove SIce breakoints)
0 W9 ]# r* n( k" n( q, Y" X$ a0 L& n1 v$ a1 O' _
Each time you'll meet this trick, you'll see:
; b. w1 r M- u2 Q-SI = 4647h
8 t) ?; w+ _% P-DI = 4A4Dh) ?1 z9 n' S$ ?7 ?; k
Which are the 'magic values' used by SoftIce.
. ]* G* H O+ P% b4 Z" L% |For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
1 I. p& S& l# ? S1 [
: h; _% M* J7 yHere is one example from the file "Haspinst.exe" which is the dongle HASP: \; d- `/ P. T2 @3 {/ I( @* N
Envelope utility use to protect DOS applications:
4 w! \2 e% g/ i# b* o# Z; f% F
R; U; R, K& x( F5 ^0 P2 z# n* c
" O' d2 O% [! j9 i# u4 U4C19:0095 MOV AX,0911 ; execute command.3 U3 ^( v0 d. O$ D* b
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).9 w/ R. l" ?; }2 j$ Z% T
4C19:009A MOV SI,4647 ; 1st magic value." ]# k$ H A6 I/ {
4C19:009D MOV DI,4A4D ; 2nd magic value.
8 {( u1 V3 v; D# _ h4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
! B: m- j; m- D& l3 D4 S1 ~4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
0 o' D: R9 _) I% `4C19:00A4 INC CX
2 ~7 b: X, G) V7 j4C19:00A5 CMP CX,06 ; Repeat 6 times to execute& R( a* v1 h8 n8 F
4C19:00A8 JB 0095 ; 6 different commands.! j7 h9 y u% p4 ~. V
4C19:00AA JMP 0002 ; Bad_Guy jmp back.( z7 e6 Z# `+ Q9 d/ q
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)7 e1 c8 p/ ]* s# S% |8 Q" v: @8 c: ~
( j) w w' M6 W0 ]The program will execute 6 different SIce commands located at ds:dx, which0 N! X) Q2 ?& N. D( B/ f' b/ ~: i. n
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
: o) r3 |8 C' Y; i6 b% ^9 O' n/ E J' [. H' s% l1 @
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
& X& y$ k3 e; ]% J& q8 N, u2 `___________________________________________________________________________# D B' d6 T7 L
# p" _+ |5 @! B6 ^2 m# H! \8 h+ ]' W: {0 E: [* f
Method 03+ t0 Q, X1 @6 K) F7 X
=========6 F8 I; }6 d0 h% Z( J2 p
8 ?- y4 r2 U, A( ]; o+ WLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
* ?' _! A8 T8 N(API Get entry point)% [3 q3 Z1 B7 f# V
$ q* B T( G* Y
2 |. V' [! t& Y
xor di,di
: K- ]) X% R! {7 m8 n mov es,di
. n* R' J& Z+ e/ w mov ax, 1684h 1 l: p4 o4 h) A# J9 v
mov bx, 0202h ; VxD ID of winice
6 @ Q6 H5 k, o& Y, Q7 j; } int 2Fh
# r" Q' P& s! H mov ax, es ; ES:DI -> VxD API entry point* W! S$ H% P" K% W, [
add ax, di
- d# u& d7 J# h, n( D test ax,ax
; e) D! V. K7 ^* p: G jnz SoftICE_Detected/ K4 w4 U$ M6 r7 o
9 ?0 D3 l+ q7 Z7 J, h$ f
___________________________________________________________________________- Y: {' R# ]' g7 L4 y1 a, E1 Y
$ u$ [8 H0 W& `( K" t5 l
Method 04+ n9 b1 ~+ c/ ^, T( T' t- ]
=========3 ?9 V) Z/ C, V: v9 j# u+ T- Z
/ \1 E, N" w& l C0 [0 GMethod identical to the preceding one except that it seeks the ID of SoftICE
}5 d! }# r6 FGFX VxD.
/ j, s7 {! y; p9 ^ _2 G0 s
3 R) d- \6 J% I1 s3 _; y7 c xor di,di: i9 N" q7 O3 O" F( o
mov es,di
( c' L+ X9 @8 R. d, i7 } mov ax, 1684h : \6 `3 E8 o* T
mov bx, 7a5Fh ; VxD ID of SIWVID
I1 w/ x- q; L% I# x int 2fh
: A; j, O/ [5 A/ A3 I mov ax, es ; ES:DI -> VxD API entry point4 A. I* H! i8 E' r9 I
add ax, di; D9 g- N# {$ R5 _/ u
test ax,ax" g6 A. [, t0 _3 B1 D' v6 x- h4 ]
jnz SoftICE_Detected9 Q) {1 ~- D& W O2 c$ K
: W. c3 ?2 D7 l* I" [! j) a__________________________________________________________________________
3 t4 g! R6 \$ |/ s9 N1 K+ Z4 ^% N! c) Y
) o) X6 _6 w! \: C! A3 x# rMethod 05, p6 x# [9 G6 O; }3 n! s
=========
, X. |# K3 j( d5 s6 c$ ?+ V
& ?# l/ K, l8 m! v3 F, d1 OMethod seeking the 'magic number' 0F386h returned (in ax) by all system' N% w3 q3 c8 E. b' P
debugger. It calls the int 41h, function 4Fh.
; _+ c# `3 n9 _4 dThere are several alternatives.
: n- @+ S' d) f1 B
6 C) z* n3 @7 J5 w+ Q$ D/ H* m# uThe following one is the simplest:
' Q$ c9 A5 N9 Q/ b/ }- C i# F$ H4 ~: {
mov ax,4fh
& |- s8 X5 A4 v int 41h
* L* ?: F" A& n* E M cmp ax, 0F386
Y1 R" Y3 {; \ jz SoftICE_detected# n* @; Y# U: Y& A
6 C" k) Y/ W0 c7 X7 w' I( G1 b( A- y7 _1 k5 ?" v
Next method as well as the following one are 2 examples from Stone's ! A/ V/ m7 E' \ j! i8 ~' l
"stn-wid.zip" (www.cracking.net):
6 D- r; r1 w' d4 v' O F( y7 I
! w1 o o- p2 @9 R mov bx, cs
. n- b* n+ O! G7 v lea dx, int41handler2
7 e6 @# d. P& w! K( O2 C- {6 ] xchg dx, es:[41h*4]
+ N w: [9 r; |. s xchg bx, es:[41h*4+2]2 [) _1 k7 G2 G$ i2 O4 _
mov ax,4fh
8 O; ]( r; U& I; J r# I int 41h+ B8 ~: O. M& |
xchg dx, es:[41h*4]
$ l; g' Z; C" S9 Z/ |! K! j xchg bx, es:[41h*4+2]& g% L, S+ S: ^9 s$ s, ^. I
cmp ax, 0f386h
6 {) C \ c" y6 R; N6 E( w jz SoftICE_detected, [6 Q) r2 m/ A$ D
& T! h2 D0 Q3 ]3 c* E! R/ O
int41handler2 PROC
+ A6 [' s/ G* @- J iret2 z8 [6 `5 d* X3 m3 E6 A
int41handler2 ENDP
5 {; F8 r, O' c: h
$ d/ w8 K( o- X2 g! [* F( b4 E0 W% l: e9 k: Y3 B! b2 {
_________________________________________________________________________
. R1 j; j) `+ r. i8 D9 v) Z f9 k# y8 [; S
: M H# Z) b1 j3 z( L* b6 L
Method 06
) |2 S3 k' ], q2 |0 N& g O========= S; l: P# `8 U: b0 L
1 M g0 j, g) y0 y( C: z
3 x: d2 \; h d% E( x0 v
2nd method similar to the preceding one but more difficult to detect:
$ L( f* t* K8 q- u+ j! W" m# @1 s8 p
- ]8 z3 f. _ [
- s0 Q' T& m3 B3 Wint41handler PROC! H. Q m F1 I6 I8 F5 C
mov cl,al
( p, N- A8 P; t( I! H iret* e+ `) B% i: n5 J
int41handler ENDP6 _, j6 G" o: Z2 H
- C$ _7 `- ^3 r! F1 I/ l4 R3 y. ~7 m0 w6 V+ t5 b; Y# h+ I
xor ax,ax
$ C" y9 A+ `$ I( c4 a mov es,ax4 @9 k' b6 i- H3 X2 F( Q
mov bx, cs
# t. r" Y' d5 P" h4 F: @ lea dx, int41handler
' R( x/ ?) J! Y5 t xchg dx, es:[41h*4]! u# O1 d4 V! Y2 f
xchg bx, es:[41h*4+2]
4 t, [4 _$ N( z6 s6 n in al, 40h
- |3 ~7 `: J# x/ W xor cx,cx% k- f( ^0 p; Q3 g
int 41h
* i. U2 `" u5 U3 P/ @ xchg dx, es:[41h*4]
, M7 g& Y+ ?4 q, H+ A xchg bx, es:[41h*4+2]/ w" A2 E- N% C. b
cmp cl,al
2 s1 H6 V1 T7 }9 S" s/ c jnz SoftICE_detected* ^/ H/ X* m+ |2 y1 m5 R, A; c
7 d- g# r; U1 u7 v0 f3 j
_________________________________________________________________________
& I2 S/ q* H6 X4 B, m. {; D+ \, V- |: ~9 g+ ~
Method 07
1 R8 T* ], P, [: |& B=========
4 |" f6 L- @' }: `$ y7 @5 n9 f, h5 j0 L, i' G
Method of detection of the WinICE handler in the int68h (V86)
5 f0 d! {1 k1 U0 r0 Z9 N1 Y
! n2 G- V8 `1 c7 R0 y* ^' C7 Y mov ah,43h
" U, w( ]6 h: F4 [: h) O int 68h
" Z o, e# _" U3 E cmp ax,0F386h% ], f; ]6 h: }$ j) D* `4 e& R
jz SoftICE_Detected
+ Q1 [% e- q% Y" ^8 H7 E+ E/ ?. p. U- _0 A7 X: Y
5 H; S8 E0 k- P1 s' A7 `' f=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit1 |- L; W; ~9 {, T( X
app like this:3 s$ ^; J3 g0 j9 j( o$ k
+ w9 h1 u5 x" E( d# r3 H2 o BPX exec_int if ax==68
& Z! y4 M/ ~& {+ u% Z( J+ [ (function called is located at byte ptr [ebp+1Dh] and client eip is: ~% Z2 g7 e; i8 j0 n1 E& h' i
located at [ebp+48h] for 32Bit apps)5 v$ f: d- L1 @: u+ T+ f
__________________________________________________________________________
7 t3 h% ^: `) s+ \9 f0 ~ {% I: Z; p8 O8 Y% C
2 f: y' {) N$ }$ e( w" m/ dMethod 081 \. f+ }/ s3 T% I2 T) O0 z
=========
7 {0 @+ @ a, u3 f4 _8 N9 e' W! s+ W9 t7 Y( z9 k! [
It is not a method of detection of SoftICE but a possibility to crash the4 E4 H3 _( u+ q0 ?
system by intercepting int 01h and int 03h and redirecting them to another
( W$ h% V0 X9 _, o3 Hroutine.; k( i8 B6 u. @3 e- V
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points a% i. c5 E) R6 o' h. U' d
to the new routine to execute (hangs computer...)
6 l- i) {4 a8 l, y& J+ t6 E3 \% Z+ { ~+ s' a" l5 k
mov ah, 25h8 }" s, G, |+ | r. _
mov al, Int_Number (01h or 03h)
; y4 n+ S p8 A mov dx, offset New_Int_Routine
4 H9 ]1 G9 f& o& v# Z int 21h
2 u+ F: e, y+ t
/ C# L) b p! u, M/ A__________________________________________________________________________7 T8 h g4 |6 U$ O
# e: e5 ]" U6 s7 |$ N( z! P: yMethod 090 }0 j0 C0 z, A& p" s/ i1 k1 s
=========2 r4 W1 w; x5 t# A
3 X' t3 ^6 j/ w, `7 a/ L c/ V8 wThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only' \7 u9 k1 f( Q( J; S( N
performed in ring0 (VxD or a ring3 app using the VxdCall).! T' F; l+ F% D6 f
The Get_DDB service is used to determine whether or not a VxD is installed# h6 e: i- i# ~
for the specified device and returns a Device Description Block (in ecx) for
$ a' Q, l" P: S! I2 s1 }that device if it is installed.4 m2 s3 b1 n: b f; X$ I
) A- P0 t, C* q" V" g8 e% c i mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID2 j5 v e- k( c
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
0 I( h5 E% z: z; | T VMMCall Get_DDB
6 v5 f! P9 k* R mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
2 e: s) S# w1 s" e' R% h% R& L# f+ Y, k
Note as well that you can easily detect this method with SoftICE:
4 g, Y }. x0 p& S bpx Get_DDB if ax==0202 || ax==7a5fh% n, {1 r) S- a# k
5 O4 J, R* E3 {__________________________________________________________________________( @% a( }& h5 [* B8 V
" I- q8 U) U5 i
Method 10) E1 q" {$ s0 K$ l9 y6 Z6 g* {
=========2 i6 Y+ B E, R. J" ] h
; C3 I5 M" x% \6 U6 M& p
=>Disable or clear breakpoints before using this feature. DO NOT trace with& P/ N7 S9 a8 j+ e, k0 b# X
SoftICE while the option is enable!!8 ~: z; Q, t' s! G( S( r H7 w
& D* j( w2 t, \) P2 x
This trick is very efficient:
/ N& ]* p3 [$ U, m6 v, M/ vby checking the Debug Registers, you can detect if SoftICE is loaded, }* Q7 c3 f1 K% r
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
9 Q {- l$ M! t: x& J1 S2 d1 Kthere are some memory breakpoints set (dr0 to dr3) simply by reading their
$ l8 |) f9 a2 X9 h7 E: M/ j7 cvalue (in ring0 only). Values can be manipulated and or changed as well0 |) @6 x* V2 E* \5 X& [
(clearing BPMs for instance)0 x: Q/ z! y3 u. b8 W! F8 }
' J- c4 e% T" y5 x d/ T
__________________________________________________________________________
: K; W, f; E( Q) L4 ?9 b; J
% Q7 N T! f# ?, N' B: c3 M2 b9 UMethod 11
$ ]* F% s) L& j* Q r=========& k+ J' ^- C# h! j9 Q. K# Q
, t4 e/ Q. ?. h- t, ]' N8 RThis method is most known as 'MeltICE' because it has been freely distributed
& O3 S8 M1 w- v% g9 t1 [via www.winfiles.com. However it was first used by NuMega people to allow5 {2 ] n* T: l) U% Z$ l4 {! z* V5 r
Symbol Loader to check if SoftICE was active or not (the code is located
- u8 U: r" P1 s) F0 Z% Jinside nmtrans.dll).+ n7 u h+ V$ ~% I9 Q
2 g% W/ x* F7 b) O( VThe way it works is very simple:
0 U/ k0 o5 U- O3 T, \; k& g9 e1 u ?It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
4 _- @7 s X+ n. h! sWinNT) with the CreateFileA API.; ^1 H, _0 r- Y9 O2 N4 e
6 l% B0 y v( W$ tHere is a sample (checking for 'SICE'):. M$ ]) m7 B0 Y9 e8 d% Z4 _0 l
& ^, Y' y% S: G6 ]3 A# J: b/ C
BOOL IsSoftIce95Loaded()
: N; g+ W- O) b" V{; n" A1 Z. r. E/ r- s/ m
HANDLE hFile; 4 i& U, n) @8 t
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,3 z* @% v. E) u; F. V
FILE_SHARE_READ | FILE_SHARE_WRITE,
4 j% H. g) y& R# v5 _# k; a NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);9 J E. G- G( |* [8 I* O
if( hFile != INVALID_HANDLE_VALUE )0 Y) M5 E3 z# k# c9 o# t. \
{
8 ]0 v" B# U5 F# y. v% s. P# _. Q CloseHandle(hFile);4 {) j' v+ q' O* s1 ^
return TRUE;& i+ G& Z. a E" a- r+ @ x
}
4 a4 O7 ?% E: C/ c5 [% E return FALSE;
: a: w/ {" V" S: ]& a}& h+ E4 w. @1 w2 h! [4 }
% S8 B9 G" E. }! W
Although this trick calls the CreateFileA function, don't even expect to be
, u. J: k" B5 ]* Kable to intercept it by installing a IFS hook: it will not work, no way!
3 @( F9 B- Q3 hIn fact, after the call to CreateFileA it will get through VWIN32 0x001F( t) @' ?4 C: ~* A% r
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
8 p$ _+ K! O- ?0 d0 |3 Y7 sand then browse the DDB list until it find the VxD and its DDB_Control_Proc
/ V& o' ^0 |' g% o8 \1 k4 {field." O4 P; A- X m
In fact, its purpose is not to load/unload VxDs but only to send a c2 O5 y, d) S2 ~
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
( G! k' C X1 ]% qto the VxD Control_Dispatch proc (how the hell a shareware soft could try
( M. k* _$ z. o) P7 Xto load/unload a non-dynamically loadable driver such as SoftICE ;-).+ O* e7 G7 d" `5 B/ X0 E
If the VxD is loaded, it will always clear eax and the Carry flag to allow6 ?7 t1 D8 P+ S
its handle to be opened and then, will be detected.! R3 m2 \! f4 `/ L2 e3 }7 O
You can check that simply by hooking Winice.exe control proc entry point
7 Y/ e* G# S3 D6 w' `while running MeltICE.* z5 L7 I8 e! A. C
/ h9 _) W- G: F2 h5 m% S+ X: W. B# u: X: e1 \
00401067: push 00402025 ; \\.\SICE
* c9 r6 L$ v1 h( j5 { 0040106C: call CreateFileA5 ]7 O' r+ ]; P2 }! p% a* C b
00401071: cmp eax,-001. Y0 H# p1 ?. g! Y- Z7 `0 t
00401074: je 00401091
! y6 e% V( q% P% i* \
$ S( A. y: l( a9 ~# f8 K5 q( W+ `3 c/ P! {2 x% O4 b9 r1 u
There could be hundreds of BPX you could use to detect this trick.0 s9 O5 ~" D# K* S8 k$ W9 _
-The most classical one is:
1 z6 w/ ?/ G2 j) K) X BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
; m4 V1 B$ o. n5 ]/ }# ~% w *(esp->4+4)=='NTIC'9 }9 W; p; v5 V, c. e( \, N$ }
# v' f6 u* I1 t+ L, I
-The most exotic ones (could be very slooooow :-(
& m" A# C5 _& `' R$ i5 W5 J BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
& a5 [: s' _/ o5 a ;will break 3 times :-(! z2 W( @, q. \6 p. w' n; u% i
2 H" u" ^* T q: k. s
-or (a bit) faster: " l5 e) E! u$ y; ~, G0 ^6 ~$ u
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
1 s3 G. q7 O) K3 p. ~, l- M& [0 F5 L1 U4 @2 O7 C% u4 ?& v
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' % l& l9 u* o( @) x9 |$ z5 _$ u
;will break 3 times :-(1 f# G" K! D3 m6 O' e. _
+ @& D) i9 C( K0 Z& s
-Much faster:* h4 j% G, X# Y2 ^4 \9 O% s
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
" V+ E' Q' D% }
, `( j8 q1 Y0 M* |# m* I2 hNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
. C9 D t9 h( L4 w/ afunction to do the same job:
8 R% |. W7 W! J4 e4 q9 q# R6 m+ z) S+ ^
push 00 ; OF_READ
K- H* p6 k3 k% z( [ mov eax,[00656634] ; '\\.\SICE',0
* j" r1 m; @3 l# r push eax
6 n4 \8 h3 g P) B, p4 V" I call KERNEL32!_lopen; W* ?: V& N# Y, W" L$ X+ E
inc eax8 I, a$ W/ J5 m2 u! C5 h0 |
jnz 00650589 ; detected& D$ }; K9 Q: f3 a/ g$ \
push 00 ; OF_READ2 F1 U3 U0 {( x+ X4 ]
mov eax,[00656638] ; '\\.\SICE'
7 P( k& W% F/ o! C7 r$ B push eax. |; W6 C& e1 I% U2 D* Z, h6 w
call KERNEL32!_lopen7 v. v+ ^* l) `8 R3 e1 S
inc eax
f, J+ K$ r/ g, x jz 006505ae ; not detected
7 D Y9 K3 U& b" B) t8 X% l/ m3 w: Z6 j; h
5 v1 q' V/ \# v8 O. _; h% I4 M& U
__________________________________________________________________________
+ Y2 {" q4 S2 |" P, d6 n; B A: S( g9 S
Method 12
/ @% \# H0 L1 D5 `: r6 a& }========= ]3 Q0 F- f3 Q9 w) ]9 z
Y8 B9 L/ a+ m1 F0 T
This trick is similar to int41h/4fh Debugger installation check (code 05! ^) k& z1 C8 }/ K
& 06) but very limited because it's only available for Win95/98 (not NT)
8 \6 c, w* {3 G" \% i' das it uses the VxDCall backdoor. This detection was found in Bleem Demo.: P3 x D: U+ c; D; U& T" G
L7 \7 B. j3 T6 g( l9 ]
push 0000004fh ; function 4fh. p, U2 S: m* z+ S
push 002a002ah ; high word specifies which VxD (VWIN32)( m. M/ c# J" l( w' r- P% b0 I
; low word specifies which service
$ v, N1 t6 Z; p (VWIN32_Int41Dispatch)
# h1 |1 V! C' \9 ~3 O; R7 P call Kernel32!ORD_001 ; VxdCall- x( U" i: X6 F; o& m
cmp ax, 0f386h ; magic number returned by system debuggers
/ l: A3 u0 P, `; B4 ^ jz SoftICE_detected* _% P7 K! P& j6 o. ~+ }
6 S6 J% E1 J' [; JHere again, several ways to detect it:
9 N. M6 |2 F0 m- Q+ a; S
3 |7 o" p! b; M2 Y! F BPINT 41 if ax==4f4 v4 U0 v) {' x+ x- f7 r
# b% s3 ~9 `; x" `1 l" P3 @ BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one; b4 v$ N- b- D9 y- F
$ Y6 j R" {$ S% _ BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
M$ n8 ~4 g7 e: m/ X
3 \( V/ a0 q( q7 @5 A3 I. U BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
& s& Y* j2 t% u% z/ K# H# p/ X" h0 @) V9 H
__________________________________________________________________________: Z i8 M2 T) I# o8 ?2 f
, r% M) E0 D9 f) H9 }. S
Method 13
6 G' u$ C x4 `' [1 L=========
+ N$ D8 \$ c2 P. v3 R* ]+ i6 i
# e* j) p1 f' C: iNot a real method of detection, but a good way to know if SoftICE is0 _1 ~. U" `& Q* v3 D- }# K
installed on a computer and to locate its installation directory.8 l3 ?- C9 T% ?( m! L5 U
It is used by few softs which access the following registry keys (usually #2) :
% K; C- D' d, e4 w! I: x3 G8 h
( t$ H! [: I: t-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion0 q' X5 i" X: Z8 E8 b8 { ~& O
\Uninstall\SoftICE
$ c( t& r- g& k-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE* ]0 k7 m$ N W( [$ }4 w* k
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
# G3 B+ D: h3 b' l- z\App Paths\Loader32.Exe
; U& W- n! B- a4 D, U" y G* E, P# S2 ~. W+ V% W
/ q4 v8 }0 m. ~* s: \$ B" C
Note that some nasty apps could then erase all files from SoftICE directory
; B' L$ D) R5 `% V& B/ e% U( r(I faced that once :-(" j* ~6 X6 W* N0 i
' Q4 E: x% H7 }5 A
Useful breakpoint to detect it:
" V1 b7 D5 ~. y7 a4 @- b7 z) q
1 D/ F( u+ t' N BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
# R) e( p9 G, N. U2 w! n- ~' [# ^# Q1 @0 V
__________________________________________________________________________+ u' g& A. b$ ^- b8 ?
, W8 S* ]8 }( P( n% @, Z
+ I6 e. h! T' ]. gMethod 14
4 l/ G. W9 o7 a/ h=========0 q; m) y4 V) w9 A$ G! ^8 U/ U) {* D
3 `% B+ t9 g4 T5 E. GA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose. ^. k8 ?+ s: x; U3 S( ~$ p" M
is to determines whether a debugger is running on your system (ring0 only).: ]( Y1 m- r, d% `) ^- B
8 `5 l' y/ c6 |: @ e
VMMCall Test_Debug_Installed
3 Y2 k9 G/ B6 W8 r5 b je not_installed" t9 {) l8 w" O5 ?/ M* v. z
$ ~- |% r$ D) ^4 {4 Y9 t6 }This service just checks a flag.
: L9 h( ]- j% S4 |) M: Q</PRE></TD></TR></TBODY></TABLE> |