<TABLE width=500>0 {& T4 ~/ N e4 @
<TBODY># j; w' I* Z* e* ]: _6 Y5 h/ ^4 ]. M
<TR>* ] X8 B) w3 i% F
<TD><PRE>Method 01
4 A4 R/ u+ _) ?) F$ S/ l# }. K=========
8 y- }# ^% f% D2 q* m+ q- n2 w$ q4 Y f
This method of detection of SoftICE (as well as the following one) is4 [+ b8 ?5 @, _7 e
used by the majority of packers/encryptors found on Internet.
1 j# r1 ]6 z) q3 x+ g: u: B4 BIt seeks the signature of BoundsChecker in SoftICE
6 t! x+ u* X& r# l% o' L$ p% M' x& I% I9 D* C
mov ebp, 04243484Bh ; 'BCHK'
% k$ J( [$ }) X; g! c1 [ mov ax, 04h
% @6 U$ J! g1 x3 t2 S int 3
7 A: a0 \+ ^. M cmp al,4
K6 t1 Y6 |8 J% _/ v" A; u( j jnz SoftICE_Detected1 W1 o, H4 w+ e& B
! y/ m- ~ U1 @! j5 i: o___________________________________________________________________________; I& K3 n) z8 `) O7 A
1 i4 z; h9 X, [& C/ pMethod 02
! f5 O5 K# \0 f% g/ L# E. B& b=========' I+ S' t% ]0 I
: n1 k4 H2 i5 G$ O
Still a method very much used (perhaps the most frequent one). It is used& [! ^/ }$ x2 b# k
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,, ?7 n |( b# O f( ]( Q+ D& E
or execute SoftICE commands..., r2 G$ K8 w' h3 V, |. A8 m
It is also used to crash SoftICE and to force it to execute any commands
+ O9 k3 J+ k& F% C+ r4 K$ U: I(HBOOT...) :-(( 7 O, m5 L. |* {# n
% a6 w1 E0 f \) FHere is a quick description:' C, A l2 M9 O+ |7 `, k
-AX = 0910h (Display string in SIce windows)! r% O% `( X9 ^* g
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
& s& M% J) N0 ?4 i1 K8 i E+ N-AX = 0912h (Get breakpoint infos)6 \1 s: f) L0 E+ n* W
-AX = 0913h (Set Sice breakpoints)
% M% I: E4 t! f+ L8 H: t; ?-AX = 0914h (Remove SIce breakoints)* T/ W+ E3 G+ X0 a! D- j4 o' {: S
4 r' i$ p0 g" n8 W
Each time you'll meet this trick, you'll see:
8 O( Z" y. I' E-SI = 4647h
9 F/ n) b% T) p q-DI = 4A4Dh
) H# y4 x! K B6 pWhich are the 'magic values' used by SoftIce.
/ u; p' |6 [9 h/ Z- r9 rFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
6 T1 i* `/ ]$ F# V9 X7 V( v ^# A
* @0 D+ \3 Y3 R. {: PHere is one example from the file "Haspinst.exe" which is the dongle HASP- N5 ]- ]& O' ]5 w; Q
Envelope utility use to protect DOS applications:
7 S; W& @) g5 P3 q) P8 E* x) _* q( Q6 X- [8 [5 ^. J
9 y. B C9 f+ z/ Z" p" ~ L4C19:0095 MOV AX,0911 ; execute command.1 @: F+ w2 v y2 k' n: H3 }
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below)." @! Q- Q- ]+ D: F9 R+ s$ v A
4C19:009A MOV SI,4647 ; 1st magic value.7 \% X# q. J5 d9 L$ u1 [' P, S% K
4C19:009D MOV DI,4A4D ; 2nd magic value.5 c, `' \2 s+ w) s$ l* S
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
9 U9 C/ ^- P% M3 \7 n4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
: F8 C! B9 Q5 M% ~4C19:00A4 INC CX
: ~2 ~# X7 B( x# P4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
* b- w' Z' R) J. [$ h7 c4C19:00A8 JB 0095 ; 6 different commands.
8 i& ?/ K7 N( b: ]0 x$ n9 |! K4C19:00AA JMP 0002 ; Bad_Guy jmp back.) j2 M2 N4 M0 O2 J7 M9 Y
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
/ M# O5 w7 e6 C1 z
3 C% _) F! D, _6 H3 uThe program will execute 6 different SIce commands located at ds:dx, which- I+ L! Q& g3 D6 U+ U# Y
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
: F( T0 m4 H6 }* M& c9 r4 x T3 j! u4 Z7 G
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
' b2 m! B- Z0 H4 M( ?; Z6 c7 i! Z___________________________________________________________________________( z9 \7 J' v- v9 |" _0 p! b
7 c/ j, ~' f* v, A7 N
4 i8 e, X- \) CMethod 03
$ m( p- \6 `# ?3 p6 `, w3 R8 Z=========4 {: M8 Z# S! _- i) M; k( L
3 N' E3 f/ T9 g i
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
% ~% W& t6 _ x6 \ h9 O ^7 M4 P(API Get entry point)# N5 X; L8 W$ g4 s @
0 I% V9 O/ e1 n
1 k9 n3 C% P$ J' x. x' l
xor di,di
) F) U! p8 X: x/ _- [* v mov es,di) [4 M- X. y: l( S
mov ax, 1684h
' S, V( l6 D% w% O% D mov bx, 0202h ; VxD ID of winice7 S2 S0 c4 G5 L/ q' d; v
int 2Fh: {; y6 o% G) K" R1 j& |
mov ax, es ; ES:DI -> VxD API entry point
; t, q% o! ^( g2 t% r6 v add ax, di
% D2 M4 }$ p- C% L( w& t test ax,ax: P; C, F4 c* T7 v g2 [4 x
jnz SoftICE_Detected
3 J5 {1 f1 K, g' i9 _
% d. m/ Q' q# `8 u___________________________________________________________________________
$ }! _) U# e1 ?6 B* I, z
* ?5 _& `6 e6 h/ ?- FMethod 04
a0 \* W- f5 @9 i! f: `1 r* r=========
/ f) w2 x% a5 a) D1 T5 z2 ~0 ~5 ^9 l9 R
Method identical to the preceding one except that it seeks the ID of SoftICE
% P4 D8 x8 O$ W5 `( uGFX VxD.0 u2 d" F- N$ `
. q' B8 T8 c: D; N xor di,di
1 O( B$ a5 o& `$ l% ~' _ mov es,di( L- A3 V) N) H, b; O( u! ]
mov ax, 1684h $ P( `- N) S8 x. v6 W* H2 [' K! ]
mov bx, 7a5Fh ; VxD ID of SIWVID
$ j% D- }" U& n int 2fh
5 i8 m( h8 \! M: N( Z4 E mov ax, es ; ES:DI -> VxD API entry point
7 j8 A$ ?* q: Q6 h% | add ax, di& ]: e1 A+ K3 J; T
test ax,ax! v+ D8 h' i6 L: z J
jnz SoftICE_Detected5 O T3 S) K6 J7 Y3 ?5 C
* d) m' n' k* t! f, P# w; I__________________________________________________________________________) D# ^3 [' q& o% D+ G. m7 f
. S: ^, M4 V! G9 ?
# j5 |$ I9 c% }5 O1 x! b3 y, _Method 054 l% J- h; W" O
=========
0 I b5 S0 @( \3 O5 S2 `6 r) I4 X& N$ l- |' [$ U- z
Method seeking the 'magic number' 0F386h returned (in ax) by all system
: S0 @: Z; Z4 M) I0 D5 f9 rdebugger. It calls the int 41h, function 4Fh.
1 X0 [/ @- Z, ~There are several alternatives. & V% L2 Y f. r) M7 Y* K
9 H) ?2 q- R! e. c, JThe following one is the simplest:
6 H9 p3 k. U9 K/ u
5 U1 Q& V7 p& s3 D- R3 E mov ax,4fh
# j2 R; a0 ?; D4 J/ s int 41h% X s/ ]. |1 [& J( C+ D
cmp ax, 0F386
& B4 k$ m$ Z( B$ q9 X! H' Z, r jz SoftICE_detected
* G+ ?% \( `8 {6 s" D9 Y2 i" y+ ?9 b
1 S5 ?$ S. e, ~1 a
Next method as well as the following one are 2 examples from Stone's & W3 w% ]( z/ r* h/ o% E- [- g, l) x( n
"stn-wid.zip" (www.cracking.net):
! C; T) E( F+ e$ a& S8 T# I. \/ t) M; R& n- b q8 ~2 s
mov bx, cs) i3 V0 J% y" g+ G
lea dx, int41handler2
7 O* ] p8 O/ d$ l& R* _+ l xchg dx, es:[41h*4]
& X: ?" E" o" o) ^1 a* A. ~ xchg bx, es:[41h*4+2]
9 o3 }- s, u# e: g. A7 _) z. I mov ax,4fh6 n, X1 T. @9 Q9 e1 X2 I/ N& V
int 41h: A9 }% N1 G0 \& \
xchg dx, es:[41h*4]/ `; m- ]" M- R* Q
xchg bx, es:[41h*4+2]
, e5 x$ t O$ L8 t& H% j cmp ax, 0f386h
. Z- T C. O: d( Q. p jz SoftICE_detected* T6 `) {8 {3 `* E" d0 G4 c$ [) \
r% W3 O! g: w+ e' ^int41handler2 PROC
% W; z8 Y' [/ R# ] iret1 V/ `, p; p7 w3 I p
int41handler2 ENDP. |2 f h9 r/ }! N1 Q# f' X
& o; ^1 _: m# i4 ^( n# O
9 B7 S- `. K5 t, W. r$ a
_________________________________________________________________________
) G+ U* w" [5 A0 i! _6 e) ` X( m: U2 O
- x; Q; E7 `) E+ s- X7 ]
Method 06; ^& u3 _9 L2 E
=========+ s8 c( c3 Y9 h
7 Q7 T! i- \- f7 f' @! `( h4 W3 |$ H" F) d; V3 I9 D" Q! _
2nd method similar to the preceding one but more difficult to detect:
* J$ ^+ P1 r3 Z$ Y
# G% F$ g w3 g) |5 G
8 ?! [# j6 C+ y" V6 \) j `! C/ Xint41handler PROC% k6 l8 ^3 P* j' [2 J, T, R
mov cl,al; A0 [' w# i8 t: Z! f
iret
" W# Y4 M7 z4 x# xint41handler ENDP
C- A+ @% h) p A: I: }5 {( \; y* c- S. v/ o
; l5 E/ C5 T3 E" Q N xor ax,ax9 ^6 w- g9 ?8 X# Q# Y% R
mov es,ax
4 b/ c7 H% M7 {4 h5 z4 v9 e mov bx, cs
. M( A2 b5 `6 |8 T lea dx, int41handler! F0 ?% D$ J Z& b& |* F
xchg dx, es:[41h*4]- ?: @; X! l& Z. L
xchg bx, es:[41h*4+2]/ t+ T* ~( Z; t" D
in al, 40h
! w" r& j' ^$ h+ ~1 W' M xor cx,cx$ W8 [) N5 \. ~: y( D
int 41h
! j) G* B% l0 U' s* }) l$ j xchg dx, es:[41h*4]+ Q, J$ D9 E/ y( e- [
xchg bx, es:[41h*4+2]# M& l% U. r4 u. R
cmp cl,al
! e: ~7 G8 \' M' u# {% J jnz SoftICE_detected) n, ~) J0 ^, }: D* K# [4 r0 O5 R$ P
6 V3 G# D/ C% ^_________________________________________________________________________
. A- `; T- a2 S. K
- J5 h5 d* ?3 t3 Q0 ~2 JMethod 07
% J: q# f2 r2 f! ?=========
: J: J6 L- @, o" w: z; z4 U; m3 n- ~, D
Method of detection of the WinICE handler in the int68h (V86)4 U8 ~- X3 K3 G4 C2 n }
3 S# f# ]6 X* D
mov ah,43h. M6 e3 A _( ?$ k! X& N
int 68h
4 b2 {* f; e+ y& }% ~) H3 N cmp ax,0F386h
% V# ?4 `' h: Q3 g) G3 i! ] jz SoftICE_Detected
' N. L9 t9 W2 U; s$ f
% t. ?# ]0 g2 J A3 E
6 i n5 p; a7 D$ q=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit$ H# O, a$ S& ~6 y, D# W% L& S
app like this:' M ^# j; ~/ ^: S, c
% T- R5 x8 J: u2 f) n- ] BPX exec_int if ax==68
: B1 g* J7 u# Q6 |4 c( Z (function called is located at byte ptr [ebp+1Dh] and client eip is; v5 H$ L6 D& W: t, N2 i
located at [ebp+48h] for 32Bit apps)! J0 y' z- m) Z3 W: k
__________________________________________________________________________* ?- D1 Y) W' \! z; A
$ [' ~* H D9 ^1 v
) H& }) J! [$ q; g, M
Method 08( p" e" R- u, g! F0 ~; {7 g8 ~( S
=========$ j/ y b+ m% t6 U* ?% w1 z
6 i9 j9 j" x2 e( d$ J; r: I. _4 o- O( x. ~It is not a method of detection of SoftICE but a possibility to crash the
( J$ I* X0 b7 f8 [4 e( j0 R3 ssystem by intercepting int 01h and int 03h and redirecting them to another# y! x7 U; I: M' L7 ]5 `/ D( A9 a
routine.3 }- R; w, i' P+ E! Q
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points" e$ ]( R! @# ?8 X5 d
to the new routine to execute (hangs computer...)
" p; G0 P6 u* E4 W1 j; ^. H4 h8 u+ f3 C( G% W6 V" p$ a
mov ah, 25h9 w8 ] |# i4 `/ Y
mov al, Int_Number (01h or 03h)
+ r* Y1 J* j6 \ mov dx, offset New_Int_Routine7 b: R+ e' J8 v8 P; \8 Z* _! c
int 21h: B8 @3 u; v5 Z
1 q/ r( A2 C5 b, C7 I( [__________________________________________________________________________ k; \+ |8 J4 W- r
+ m, B" e3 w! `! B/ [7 q7 p2 M/ jMethod 09
9 f3 o+ @2 [0 K) w" `" i=========
: ^! L# k' e$ D; g6 a3 K; m( ^; g- f
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
& W+ i L4 X! X1 w3 _- ^performed in ring0 (VxD or a ring3 app using the VxdCall).
: s) F, y4 K* T$ p1 TThe Get_DDB service is used to determine whether or not a VxD is installed
& k4 K/ b- z5 @' g0 K Zfor the specified device and returns a Device Description Block (in ecx) for9 B+ J) _3 I% I/ D6 ~) N; g
that device if it is installed.0 o5 N+ P) C6 j& o; L3 h
3 c2 y) A) m E
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID4 I p" z' v+ \" ?4 U( i: W
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)0 w r$ D% J1 j; W! C; z! M
VMMCall Get_DDB- y! d" }; W- H% V
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
* \ u. ^+ A' w( A3 w
. V5 ^, F( E- v( c) m) r3 c w) VNote as well that you can easily detect this method with SoftICE:- e+ N( f& C1 i7 z
bpx Get_DDB if ax==0202 || ax==7a5fh
& y9 ?; h, D- e. [0 U* [; O2 |+ J" \2 c" y9 U
__________________________________________________________________________% R; r$ G: h0 s' M
+ b" I+ a0 s/ `+ `
Method 10
4 K D4 N) r4 N5 I! `% k1 y=========
' o4 T# r% p; s1 {8 h2 X& q- v8 o7 r1 a; W8 |1 K( y& R
=>Disable or clear breakpoints before using this feature. DO NOT trace with/ E+ D' T @4 ?: f# ~" {4 K/ a" A
SoftICE while the option is enable!!
0 C: j# e1 J. I" M0 Q1 ~& Q! F1 Z& O4 E
This trick is very efficient:
% p8 C( ~' e9 G% b) \by checking the Debug Registers, you can detect if SoftICE is loaded: @" v- V; O: x6 b* ~
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
/ z5 T4 A" ^: @5 i5 F. M1 athere are some memory breakpoints set (dr0 to dr3) simply by reading their: L1 \5 F6 _7 Y2 [, ~) i
value (in ring0 only). Values can be manipulated and or changed as well
& y, D3 J- C+ w4 d" a1 p0 }(clearing BPMs for instance)
+ M0 u& |% V7 n# O# Q' T- I% e4 E/ f6 [
__________________________________________________________________________
/ J: Z1 h: S2 w% Z, f. v7 E w7 h5 W& O9 [- R( u% e. _
Method 11
7 c# {& Z0 ?8 ~=========
0 u! ]" U# e8 ?8 F
5 V6 @8 G% n& hThis method is most known as 'MeltICE' because it has been freely distributed: h& v+ u; A/ E; f
via www.winfiles.com. However it was first used by NuMega people to allow! y/ j2 h3 N& O
Symbol Loader to check if SoftICE was active or not (the code is located
, v" f O0 z4 linside nmtrans.dll).
, H4 M6 x6 k; I% k
% M. S7 T+ _" X& r* |# w$ E7 xThe way it works is very simple:
5 J4 O1 W! ?9 }' U9 ~It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
9 j/ E5 M9 G1 ]1 y" GWinNT) with the CreateFileA API.
/ R+ z9 }, ^8 }1 d2 E* |4 @
5 t1 S8 i) ?, b( r0 L7 N3 ~- }1 k9 iHere is a sample (checking for 'SICE'):' a6 b4 U; @3 [- _# c# j: Q
4 u: ^6 `- b; ^9 g1 O* Q: M2 _BOOL IsSoftIce95Loaded()
z7 A3 i* [5 j8 E _2 {0 ]{
5 ]6 i S: y: x, [ HANDLE hFile;
! v+ T" M2 I0 p2 Y' i3 N hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
) _8 ]6 n# t: Q FILE_SHARE_READ | FILE_SHARE_WRITE,
# {7 A; ?6 D9 b9 t# v NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);: [$ l3 _6 w. I
if( hFile != INVALID_HANDLE_VALUE )
. E* m7 P( [; R" t$ m {& ~1 g$ a+ X7 Z5 f v' a5 o
CloseHandle(hFile);: v. l- Z+ u3 q- S& ^3 B7 s# I
return TRUE;0 U- r) J6 j' D) y8 L: x/ H8 r
}
& q+ e& U H; l return FALSE;
; B! S/ O @6 Y, \7 V' y}; t; U: ]8 ^7 J" R* ]- t
9 U0 g' @) X% n& X, q/ b7 ZAlthough this trick calls the CreateFileA function, don't even expect to be# k2 Y5 W6 `, s& C. W/ h& w8 e
able to intercept it by installing a IFS hook: it will not work, no way!
! ~, \/ S3 P# v. B0 Y% GIn fact, after the call to CreateFileA it will get through VWIN32 0x001F* ?( X6 [. T, R! | i/ k( G6 Q' | O
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
2 a0 c1 c8 N5 C5 O9 N2 e" yand then browse the DDB list until it find the VxD and its DDB_Control_Proc+ W& h3 A% x% O3 J* \* @$ c/ e- G
field. L2 {& W* `: n" r3 Q0 _7 _
In fact, its purpose is not to load/unload VxDs but only to send a
2 _* P2 ?2 }; m# nW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)8 Z* W2 ?+ b, r
to the VxD Control_Dispatch proc (how the hell a shareware soft could try4 v7 a1 l! A8 D" h1 ^
to load/unload a non-dynamically loadable driver such as SoftICE ;-).& U1 d: b- E" n, L3 w& e
If the VxD is loaded, it will always clear eax and the Carry flag to allow& q5 v3 |8 p. P) {, P3 U! x* |
its handle to be opened and then, will be detected. T- m& e) t4 D* w' I3 ?
You can check that simply by hooking Winice.exe control proc entry point& d! H( q3 ]2 p
while running MeltICE." ^ a# M, s: t+ |; y
7 D4 E& v9 g% ]8 u# Q* g
1 j" i1 Z) t4 ~2 {+ S 00401067: push 00402025 ; \\.\SICE
3 z6 E9 v" l% G+ ?8 V J. r 0040106C: call CreateFileA4 n( M* W7 p8 r; b/ T1 W/ F: B* n" m
00401071: cmp eax,-0013 e8 {" i$ d7 u4 @6 D
00401074: je 00401091
! i3 [# s/ c' p
0 k& L, b$ Z6 T$ u' K# J9 c) w- R6 B( R7 H# @, Q- o8 m
There could be hundreds of BPX you could use to detect this trick.
6 j& \% j- c8 \+ r8 f5 E-The most classical one is:% T0 q0 M3 n+ C" R% X
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
# f2 S4 r( e; V$ d" p' r) B *(esp->4+4)=='NTIC'. g) j- c" r% A( ]- O
! C) O q) o6 f% R- n
-The most exotic ones (could be very slooooow :-(
8 m7 A; C# _8 F6 s8 z BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') & [# F, H2 L0 {: z" n
;will break 3 times :-(
6 {, l* C& G; j q9 z; Z0 f/ Z7 F2 L6 Z# j, G+ s% ~
-or (a bit) faster: . m8 ^) B1 B( h( a
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
" ]$ H. ?2 Z! N; y7 y
* k+ ~9 a9 {% o BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
$ Y+ c% T* O+ Z1 n5 J ;will break 3 times :-(
- o' t7 ^5 i! l$ t( A6 z
' R& t2 b/ P6 }2 ~5 h( k" M-Much faster:
3 o7 b8 o# w* [* F9 k BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
: h3 X3 _# @+ D6 W2 A# J; v
6 A! w, f) B6 q/ }6 c/ z* GNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
7 `4 B1 P R- t4 B4 r$ _3 b" |0 Zfunction to do the same job:/ M1 ~: Z# j1 [9 C0 e) ]
- {6 [% x- ^9 {* c8 Z/ P push 00 ; OF_READ: r" X7 z, I0 W O; J' ~
mov eax,[00656634] ; '\\.\SICE',0
8 ^+ w7 X! y- A$ Q) g3 V push eax: b. R4 P$ y% ~" M3 Z& W, f4 H. Q Y
call KERNEL32!_lopen- _* z* A7 A! o. |
inc eax
O- M2 f9 l$ m jnz 00650589 ; detected. b8 V* F9 d3 i* a0 s- j
push 00 ; OF_READ
. x1 I# U% d5 }$ @; ~$ } mov eax,[00656638] ; '\\.\SICE'% A. Z+ v. U" {1 L9 o$ Z: ]9 R! A* C
push eax0 H7 ^ f9 ~7 a. t
call KERNEL32!_lopen0 s4 @ P' ~+ Q# j& E$ O
inc eax
- f& `: J& ` p jz 006505ae ; not detected
0 e( ^+ q c3 L7 b& z) f6 ^. v3 N1 L7 }. C
0 @! b0 v0 w- S4 N
__________________________________________________________________________
4 J! B: ?! G) Z* h
4 Y* e: M( ^8 G( c; \Method 12
* f) g- B' l" g' v T# m& _=========
/ D% C( w7 n1 R& D! k4 v3 G) l! _0 p
% [0 O, n# @" fThis trick is similar to int41h/4fh Debugger installation check (code 05
3 @* d4 d5 H0 @& 06) but very limited because it's only available for Win95/98 (not NT)
9 L( O) u5 t1 e2 c7 Ras it uses the VxDCall backdoor. This detection was found in Bleem Demo.
% U$ O& j e! i. t. R, Y: f8 A- K* O& ]! |( a
push 0000004fh ; function 4fh) l ~9 u" [) p! O
push 002a002ah ; high word specifies which VxD (VWIN32); d g2 J* Y6 m8 P9 d8 N% L1 G
; low word specifies which service
3 H) S: I/ x: _- F& B! [ (VWIN32_Int41Dispatch)- J4 ?# R2 c9 r( A8 o+ a+ Y5 k
call Kernel32!ORD_001 ; VxdCall
+ n: k* o% l0 b9 k, A) x( q% t, r cmp ax, 0f386h ; magic number returned by system debuggers" e- j; t7 d3 J0 ^9 S( V; E
jz SoftICE_detected
( U) @( x+ w; \: W" L: s6 C4 A4 `3 @6 g! N- w& H
Here again, several ways to detect it:) z' t& Z, d$ O5 @
: w3 ?1 |& ^6 _) n
BPINT 41 if ax==4f
" m) }7 J- n9 F7 N% M/ M" \9 f& e
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one, L3 N t3 ~9 L% c. S: H
! u2 Q0 ?( _( t, J0 @( i$ B BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A% \* g" J2 d6 o6 H. D+ \1 ~
/ @" h6 J9 L9 S
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
! F! N2 L5 u9 K3 t! g/ n* A, @: i5 d2 _* X) n6 L
__________________________________________________________________________
1 W {0 T$ E, Q. R# b F# ^- s7 K
Method 13. [. _3 U$ c1 B7 V& R: ]: w; A7 c
=========# j) r4 p8 K( b
) V7 a3 v! `6 Q6 A0 W G; g) d' }6 \5 U
Not a real method of detection, but a good way to know if SoftICE is- I" U$ k7 c6 N' R
installed on a computer and to locate its installation directory.
6 a# \9 S. K$ rIt is used by few softs which access the following registry keys (usually #2) :; @$ H& f% F1 D! S6 O! B5 }3 l/ w) K
+ ~' V+ w! U! w: B) s/ ]( l) h9 S
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
; w5 d8 R8 X4 X+ f& q, A6 s\Uninstall\SoftICE
( Q& x4 H3 ], ^# l+ b: i2 G-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE! f4 B! i+ l+ O: a; z
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
- @7 _% t, W4 }8 r! b9 Z# `3 T\App Paths\Loader32.Exe6 b7 a( o9 p5 J0 d- N7 I
+ `7 t2 \6 A! W8 k: e/ z8 n3 Z
; A5 R% K1 T: D F8 x+ GNote that some nasty apps could then erase all files from SoftICE directory
3 ~" t& C( p1 g: \% S1 C(I faced that once :-(9 _( j ^% t# u. G
! z: ?+ c+ X% C3 E$ lUseful breakpoint to detect it:/ g. c9 k: F' ~5 M+ Z0 w9 \
# ^. y2 K( G0 v+ r y# g; ~; n
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'" E R- H, T) ]* m. D; S5 A) E' L
8 T' P/ y- K. L3 P0 ^
__________________________________________________________________________4 A# o/ k2 q+ d, c% }$ U
8 I4 L7 \1 [' i( S- K. a
+ H; P7 X+ Y% \# D: pMethod 14 ! l" N' K9 |# m2 {: H: Z
=========
, d4 u$ s0 ^8 g5 \# z, y' B
, @* w2 T1 I0 ~) R# gA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose8 |3 |2 P8 |! H0 ?
is to determines whether a debugger is running on your system (ring0 only).
: z- [$ p4 Z/ j. C( k
) G1 c; `0 x2 D0 ] VMMCall Test_Debug_Installed6 h' |. B* _' v. Z' @
je not_installed
4 t+ Q3 F/ F4 O1 M3 T2 B4 R6 S: I6 F, d: M
This service just checks a flag.2 |4 p! k. U5 i) {9 b5 K
</PRE></TD></TR></TBODY></TABLE> |