<TABLE width=500>
4 [4 R4 W% a4 i( a9 [<TBODY>
( ~4 A8 d7 t( r, ]<TR>( Z8 |. [7 E) P( z" o/ y" h% l$ r
<TD><PRE>Method 01
0 m( r* X/ @. y5 B x9 X2 B=========5 N p" ^! e+ Y" n/ y/ o
' }& v" o" B) j3 O0 }9 F" ~This method of detection of SoftICE (as well as the following one) is
Q9 s7 P) o) g) ^ dused by the majority of packers/encryptors found on Internet.
4 y, w5 s0 Q% c3 X e# x1 BIt seeks the signature of BoundsChecker in SoftICE3 t) p9 P/ K) M+ O
, k) W' H" Y; m2 f3 k' {: O% g mov ebp, 04243484Bh ; 'BCHK'
/ A s& _9 g1 h. V" x R# \3 J mov ax, 04h& }6 Z6 S# k, N$ r& N! z
int 3 ' Y8 H! P+ i" m; y) M2 L8 Y+ i
cmp al,46 _) B$ l7 c1 a
jnz SoftICE_Detected
* G/ i1 p9 Y1 k- }2 L6 Z- Q6 \* D( E2 l9 }
___________________________________________________________________________
, n9 E5 ^# o& y# Q! a/ H& ^# R
: H( D4 B+ H9 l# BMethod 02
: Y" o6 \" x5 P" Q! W2 S& J=========2 o# P+ f1 y/ H* @! a I
. V" _" {5 f: ?- bStill a method very much used (perhaps the most frequent one). It is used
+ E# r* s X# dto get SoftICE 'Back Door commands' which gives infos on Breakpoints,& F- u4 T9 w v% |! I$ G
or execute SoftICE commands...: x. C+ g3 A; m& T; J/ x
It is also used to crash SoftICE and to force it to execute any commands& O% I7 O9 @2 u+ v9 z: i2 ^/ Q
(HBOOT...) :-((
; x. e; F- }. i0 o: \* R! @4 q) i+ F3 J) c, O# T
Here is a quick description:
& ]7 \* q- \2 M+ `-AX = 0910h (Display string in SIce windows)! V. j; k' _& V/ g
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx). x2 C0 Q2 g$ x
-AX = 0912h (Get breakpoint infos)
% b H; T$ l0 s# i-AX = 0913h (Set Sice breakpoints)
; C8 I5 W8 {* p0 s6 R/ q-AX = 0914h (Remove SIce breakoints)& B- r# M! u4 W; A! _
# Z/ |1 H' t5 s& Q! D7 nEach time you'll meet this trick, you'll see:
: E/ S- E- o+ A& t. x7 {-SI = 4647h
6 o1 m* }5 u; g9 _2 P4 n-DI = 4A4Dh9 U9 T; U: F% _5 E
Which are the 'magic values' used by SoftIce.
0 p$ o4 x. F+ M' kFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
4 r# M0 S3 ]7 ?1 W
6 O- J2 M2 c& a" g: M0 hHere is one example from the file "Haspinst.exe" which is the dongle HASP
8 i+ G8 q6 h: C# sEnvelope utility use to protect DOS applications:
) ? \) D7 s3 f) Y) E# f* Z$ g) C9 _
6 [. p2 f% X) z: ?) y |$ n& {% Q5 t+ Z9 A0 `7 V; Q% G4 I
4C19:0095 MOV AX,0911 ; execute command.
& _7 `. R0 j) {4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
" V5 u$ s0 {/ @7 G" ?+ N4 E4C19:009A MOV SI,4647 ; 1st magic value.
( H; A3 ^! Q" V; P4C19:009D MOV DI,4A4D ; 2nd magic value.. U( h" A: N3 ^- E; W
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
& f4 k. N: j, w8 Q$ @4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute+ p% t2 Z- t6 `. U/ R& X
4C19:00A4 INC CX& m" N% m; T2 t7 ?
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
2 q9 E& U0 R" I+ b' u0 K; g4C19:00A8 JB 0095 ; 6 different commands.
8 d4 n0 v0 B) e4 D( Y- M4C19:00AA JMP 0002 ; Bad_Guy jmp back.
m- g9 \* @* R4C19:00AD MOV BX,SP ; Good_Guy go ahead :)/ F: |( F e( ?5 C" V
0 s: l1 P( X. C; o; A5 RThe program will execute 6 different SIce commands located at ds:dx, which8 B; z5 z$ u, } ]5 G
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.: H, U" ^% O. z# v1 z
8 E+ x1 s2 y0 J; n- b: v& b* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
R$ L. N, X; _# e' Z6 u6 y___________________________________________________________________________1 k$ {7 k1 j6 s: [/ r/ |# g2 j5 u
( P; Q% l: S7 T- f
% x% }9 G* Y6 L) w3 Z- o$ B7 |# S' y" q
Method 03
1 d( r5 {0 L* L7 x6 C6 ]. n=========3 s; z9 d c0 C' y' l
; q3 W2 p& E F" t) {( c& ~Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
& S6 [* `: N# ^6 r(API Get entry point)( {% ]# T8 a" U( H( V) c x( q
2 Q8 p: O% T/ w; K, E; Q7 Q* Z: c9 v' O$ n- U; G7 S& [$ T
xor di,di
8 G8 l% _8 U9 G% z3 Q9 \ mov es,di
0 z% k* q& ? \0 Q8 w mov ax, 1684h
- u; y8 z: @8 M& H; F8 o mov bx, 0202h ; VxD ID of winice
) H: F. B- x l int 2Fh( R7 t8 G6 y% y. c
mov ax, es ; ES:DI -> VxD API entry point
; H, {* \+ i$ [/ e& e' @( W add ax, di
' S+ k& p8 s: n test ax,ax
' N" q9 j+ q1 a jnz SoftICE_Detected3 r9 @/ x, l. h8 Q: L# r
' m0 ^: }% F1 q
___________________________________________________________________________
6 {5 v( X, P8 t) z
6 w- Z, G, s5 D: s' M/ U. d! i( @Method 04/ d/ l+ f- D, d# ^! Q5 }5 E* R
=========6 ~. W8 r3 \# n" [( c
3 I, l! B- S2 _3 v2 j, \+ A
Method identical to the preceding one except that it seeks the ID of SoftICE( s& U) h S8 c) n
GFX VxD.5 t1 t2 e* y7 _9 i" p- f
6 N6 D) g7 A% a/ R
xor di,di
% i- Q" _. T" f4 L! g: H, g mov es,di/ X* |) T+ @; W9 i
mov ax, 1684h 1 _* D' \" m! o
mov bx, 7a5Fh ; VxD ID of SIWVID! t& t9 \& N" _! o" S
int 2fh+ s8 Y* B# g/ e/ B4 J3 F: S$ J* v
mov ax, es ; ES:DI -> VxD API entry point
6 u! A, [& h- n& p3 K& N1 l add ax, di, T7 E/ f% D: n0 ]9 P- X
test ax,ax6 B1 K) D* G; z* i
jnz SoftICE_Detected2 G' ~# G# D: C6 d+ r: C( J
0 S; M: |) z, ~6 a* r' k( p$ @- |
__________________________________________________________________________
) `# X' R) o& _0 S: v
. V* N3 }. c) r6 U2 O9 `0 P( A8 g9 C8 ?
Method 05
+ A: q k6 N) C) S% k" y=========
9 n p9 [/ x$ R$ @; y7 x5 h2 u' m4 a9 ^
Method seeking the 'magic number' 0F386h returned (in ax) by all system# v& D+ y9 G* @
debugger. It calls the int 41h, function 4Fh.8 ~: }3 C' k7 u' F
There are several alternatives. + v2 g$ V# s6 f; Y7 G# {- T3 U6 D" g
3 N/ \# l2 e& b9 {
The following one is the simplest:
+ |5 Z# b1 E* S
: R2 [& S6 _: ^ z0 ~* `$ _ mov ax,4fh
$ x+ L+ f! h0 @" G; I int 41h: p7 k( d) A! Q, d
cmp ax, 0F386( } v; [3 d3 p$ {" }$ q( X( v8 O- f1 G
jz SoftICE_detected
" t9 V5 O, ]& A" o- |4 P+ H, v0 v' U( }! {
" } C6 P. |$ s, \( |
Next method as well as the following one are 2 examples from Stone's
* d; r3 O7 G% b+ a"stn-wid.zip" (www.cracking.net):1 h8 \1 V2 j5 C- F
/ x, C2 _6 N# }: Q
mov bx, cs5 O/ h4 r3 R% L5 p9 _
lea dx, int41handler2. Z7 ^3 A; C. |+ }$ p; O
xchg dx, es:[41h*4]5 P. s0 U( }7 z) C4 N* l4 F
xchg bx, es:[41h*4+2]
# o) M6 _+ o2 x4 |& D( B7 u mov ax,4fh
4 ?) _- k, L! ^8 I: s0 ]) S int 41h
( V4 V1 N+ ]! K0 G/ i- k7 H xchg dx, es:[41h*4] h; d- @# D; j+ O7 q9 ~. Y
xchg bx, es:[41h*4+2], ]6 B) [* m# ]. G( X+ |, C
cmp ax, 0f386h
7 H- d8 Y( n8 u* L jz SoftICE_detected
4 R' @ @4 v( l! a4 r) E' z6 {, g a6 X9 Z+ K, k4 w9 M% ~
int41handler2 PROC7 s& X; F) w- r$ y0 h6 C
iret" N8 N) F1 t& i m( }2 A
int41handler2 ENDP/ t; p. q5 m. J3 a, H! Z. z
4 c+ f% E; w; A q7 a
5 F$ V1 m1 Y8 [$ F8 N3 I2 q- L! E_________________________________________________________________________1 D' N" L( i! Q, y% p0 @+ u1 O+ q1 n& x
1 n+ K# m, E9 u% l2 V" z, ^0 d$ [, ]; C9 V' F0 v. I
Method 06
. `3 C5 ?7 h2 _! |0 p=========& L2 n9 n# K' j8 S2 }
/ \" ]7 g1 n* R9 P; @5 q2 M3 C; e! k5 n# m; M
2nd method similar to the preceding one but more difficult to detect:, J; n" R H0 y' h+ ?, T( K0 c
# M; y# ?3 o0 D* }% E
; {+ }5 P# S. J
int41handler PROC/ x3 W: j! Q- ]. q7 _
mov cl,al
' P% F1 L( U% y; E8 f* v6 j iret
: q/ I/ S8 E4 u- X6 Z- mint41handler ENDP
) k0 z. H1 `4 Z A9 L( g4 [2 U0 _, d r. d! c4 o
3 ]$ I" _1 k- F; L: L6 e6 W
xor ax,ax
: w/ M, U9 D+ _+ [! [, o mov es,ax% ~+ a% j# k9 a f" O
mov bx, cs
" _" ?6 ^' l% y. x lea dx, int41handler \, A' c! a1 }. w. \
xchg dx, es:[41h*4]
' {" k' p; } M1 @7 m xchg bx, es:[41h*4+2]
9 R# Z; g7 S& Q. _ in al, 40h
. D( ]! f" {& S& t xor cx,cx
$ U2 X# Z6 `* @ int 41h a' s* ?. `3 ?. l: C
xchg dx, es:[41h*4]( b0 v! G1 K; }6 W& y1 g
xchg bx, es:[41h*4+2]
8 f. X! M8 J* U cmp cl,al
5 \1 [5 G6 w6 E0 d4 X jnz SoftICE_detected
0 `8 r* X1 _" a i7 C4 ^( K
. B9 t6 U3 S0 S7 R! \_________________________________________________________________________( q* Z. `! [. o6 T5 [
j1 X q) d: X4 vMethod 07% r% P( ~5 u; W7 i; k$ }8 Q+ S
=========. w* p& F0 l6 K
: ` ^( ^- F, W; n3 M6 X1 [7 s \- SMethod of detection of the WinICE handler in the int68h (V86)
S9 ?" h& L# h' T& h/ @# Z. l! s4 [4 m* V; O7 G2 l. b
mov ah,43h! ~& l$ [0 q( V3 L; E4 w) t
int 68h
8 _5 ^: l5 o1 \7 v3 W8 @2 ^ cmp ax,0F386h% O: H2 W8 p- a4 T/ q
jz SoftICE_Detected. @( ~/ t; Y) }3 o1 I. v; W
+ B( J/ @7 t+ a+ j
0 ^: k; b9 p# g) V' k
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
, x) A- J* U1 t app like this:. O5 Y* k' @6 ]& X8 v
# Q% H1 j# v: |% `2 S- _9 z BPX exec_int if ax==68
3 A4 l0 E4 F7 p' a, ]0 H+ t (function called is located at byte ptr [ebp+1Dh] and client eip is9 ~/ _8 E) |, l, a
located at [ebp+48h] for 32Bit apps)
+ o, N# h2 |1 _- x- `6 V% j__________________________________________________________________________0 O/ Z5 C8 U# e5 i. P) ]
# B8 e+ R9 W1 h, |
/ e* H/ k4 _1 n3 a8 ]Method 08( {) r; |) e1 u8 r& f3 z% i5 k& X }
=========
: _4 F' i) r, J0 I
% a% v' _. x6 u% u1 ~% Z$ aIt is not a method of detection of SoftICE but a possibility to crash the5 d3 Y5 B4 ?" l" F6 X' m
system by intercepting int 01h and int 03h and redirecting them to another
l, p. \; V, v+ }; Yroutine.
5 \' k0 W1 {# E; b" V& P+ PIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points, X1 `! Z2 @/ N3 `
to the new routine to execute (hangs computer...)
, G& b3 J8 d2 W) j+ S$ o: T" w0 E* U$ n2 |, x
mov ah, 25h( B9 L3 z7 X* l/ }5 y; t0 U, h
mov al, Int_Number (01h or 03h)
- K) f$ w& z/ S3 E: p mov dx, offset New_Int_Routine
0 [( N1 {, M. L9 S8 p( C+ m4 L2 P* n int 21h. ^, { n0 d6 L. Y# b
# q- ^! j; O* ~4 q% s__________________________________________________________________________
0 G+ j5 P7 T- r5 Z( {0 W! o4 A5 p: _- `* T' u. }- V" ?1 S
Method 09
% o5 q# z' Y* M$ v9 K3 ]=========
- r' Y( t* }" q7 W5 |
; G3 V" D9 U/ hThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
' L* v! {* a) p' ]performed in ring0 (VxD or a ring3 app using the VxdCall)./ z. R8 Y/ @7 p& i8 ^( n
The Get_DDB service is used to determine whether or not a VxD is installed6 [# I3 D+ |( C) x. S' c
for the specified device and returns a Device Description Block (in ecx) for9 W3 y" q- Q9 |" o6 M( E
that device if it is installed.
0 [/ C9 C' G0 e3 u6 U/ \* L
, i) a9 z. d$ t3 z7 ^ mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
1 N5 k2 c! J1 f$ x8 b/ q mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
3 ?; X. A" H7 m4 y" J VMMCall Get_DDB
; A* q+ I% R8 w- U, x+ j' w mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
% X9 X0 q& h9 W. G, _! R
8 Y2 n& j; Z; H( uNote as well that you can easily detect this method with SoftICE:% i1 t. W* w' Q. q
bpx Get_DDB if ax==0202 || ax==7a5fh8 y: @* \' `4 a' r* p. v$ v1 [# n
+ X1 S' y/ A/ ~' v0 \1 N2 H
__________________________________________________________________________% d) O7 z! _8 Y& y( K" x
) U5 h& O; q2 g- p$ g
Method 10/ w! E4 o8 ?# F6 ?4 i5 j
=========: K7 _$ y2 P# \- ~2 Q2 C
8 h5 W; m& u% m=>Disable or clear breakpoints before using this feature. DO NOT trace with8 Y) M' l5 \& Z
SoftICE while the option is enable!!
' j/ q, [3 `6 e8 e) y' S# n% o" i
This trick is very efficient:" Y5 |7 F: w- h" X5 a" ~/ r( R7 v* ~
by checking the Debug Registers, you can detect if SoftICE is loaded! G2 q c' s/ c+ ?& }
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
" f* n* K* i1 b0 F: {' t3 _/ tthere are some memory breakpoints set (dr0 to dr3) simply by reading their' J( _# k8 c- \4 }- ?2 x/ f. ?
value (in ring0 only). Values can be manipulated and or changed as well, E% q5 j0 \$ i q/ v" G" H, p% g
(clearing BPMs for instance)2 Q* U2 t! j. \6 _; N
* }, s! X1 r4 C2 N. W k
__________________________________________________________________________
: w O1 `: N3 O9 u( S; }& {( E/ \/ G8 i/ K; L
Method 11
! T9 Q {" `5 o. S: b( X+ ?* _=========
6 m9 D( q' C. N8 J; s% _8 }% @/ }+ u3 k- u" n% _+ u
This method is most known as 'MeltICE' because it has been freely distributed
1 I5 V* g$ Q1 G1 N4 X0 f& O9 yvia www.winfiles.com. However it was first used by NuMega people to allow
0 T$ Y" q3 [8 W/ D1 l% k/ BSymbol Loader to check if SoftICE was active or not (the code is located" h) m8 { `* ]; B- T5 [
inside nmtrans.dll).3 X/ P K" Q. R/ W x; f; u
" s$ u; Q0 v+ r- X! \
The way it works is very simple:3 k1 d# V/ u/ C8 r, \* F" R
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
5 |$ P% Y& y! }6 f8 \5 RWinNT) with the CreateFileA API.9 c1 J. i) j7 b4 u! V0 j* Y& W
% N5 X. V# _. Z6 IHere is a sample (checking for 'SICE'):$ R, s7 b5 A) Q8 F; ^
# @% ?7 @) @9 E1 D) {0 zBOOL IsSoftIce95Loaded()# ~9 x7 X( w$ G/ a: z6 G1 |- f
{
) s7 R7 O- I5 q; x, N' X HANDLE hFile;
1 D6 K: R% F# S7 w* i4 ` hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
% U/ e7 {/ W' S. z! g j6 b8 D FILE_SHARE_READ | FILE_SHARE_WRITE,
# o2 M8 c( V1 \% @: N NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
3 B4 A/ ?4 }* f! e E' Y( n5 U if( hFile != INVALID_HANDLE_VALUE )& u+ @% P7 v C% `% W
{
7 O* f# v, T/ n* T5 e6 E% d( C4 k CloseHandle(hFile);5 Y- D, A F0 t; b- S( n
return TRUE;, Y; j3 G& l ]" \; b& r- r/ P1 a
}
& u, ~* C- G; C* Q0 }( C return FALSE;
8 I4 C e8 ~+ h/ I0 a5 A}
& J: |+ {" L2 ~0 f! O
/ Z6 a6 ]8 E, B+ _4 {. |4 A& QAlthough this trick calls the CreateFileA function, don't even expect to be6 {; \7 J. R% q9 Y( ^; A6 u2 E! z
able to intercept it by installing a IFS hook: it will not work, no way!3 n. C! S* h2 h0 {" @+ m4 m- C/ |
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
/ g8 T! E0 V( lservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)8 \, ?% ? b. v: y, x8 \
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
# w( [- Q; F! O2 d n1 a0 X' sfield.
2 U: M" e* H" e8 r) ^% }& pIn fact, its purpose is not to load/unload VxDs but only to send a
- R! n4 C, f- g4 c3 HW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
, `* C7 ?0 q' mto the VxD Control_Dispatch proc (how the hell a shareware soft could try
8 |% Q9 s3 k4 B# n( r3 V7 Oto load/unload a non-dynamically loadable driver such as SoftICE ;-).
3 F4 A3 }* A/ R! IIf the VxD is loaded, it will always clear eax and the Carry flag to allow
+ V& s0 ]7 `! f. [. V9 n0 hits handle to be opened and then, will be detected.8 h- }3 g0 w0 M+ E
You can check that simply by hooking Winice.exe control proc entry point% z$ Y3 a: ~. {" X
while running MeltICE.
4 @6 |. _6 \7 R
6 ^/ h3 L" ]* @" D, ~9 R0 J/ }' X; o" {; Y0 l
00401067: push 00402025 ; \\.\SICE
% N' a9 Q l. S8 o0 G4 r 0040106C: call CreateFileA% z, I: o8 ` P1 c8 P
00401071: cmp eax,-001
3 _8 c' K% |+ x1 W, g 00401074: je 00401091
5 X" K% Z+ J* T5 l" ]7 d
5 a- P! O! o( i" `/ G: s" X. @5 @! D% K8 M- v
There could be hundreds of BPX you could use to detect this trick.
3 E8 I% \7 }6 ~. F% E# M; S1 o-The most classical one is:7 z% [# L4 s0 I4 D
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
- T4 a9 B) C$ F# j8 i *(esp->4+4)=='NTIC', F. v3 E3 L- D- y8 M: R0 A$ S- p
: x. F2 _+ i: |2 |3 f e1 R
-The most exotic ones (could be very slooooow :-(
" R/ A1 B3 [. D1 H! ^6 Y& G BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') ( j4 q0 i8 b- x- }0 G
;will break 3 times :-(
) X) A/ \( N" h' ~9 M: K
. n: t. }2 A& k1 S6 x- i-or (a bit) faster: # z `$ ]& Q+ q g0 h
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
8 ?# c5 [9 J, C$ b x
7 P' t4 I5 O8 [ BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' : P0 B" m+ O0 f8 t) Y
;will break 3 times :-(5 E4 I% z C) T( `% C% X# r
+ u% \9 h2 W: R# P% t7 {/ b
-Much faster:
. m% w% Y, P$ M2 f1 M9 A) W8 V+ ?: | BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
) O5 o* x3 B, w% j" E1 P' x
7 I; p8 X' O& _. T' ENote also that some programs (like AZPR3.00) use de old 16-bit _lopen
% M6 `. R1 ?6 zfunction to do the same job:5 d& w) r( b$ N* N" B- J
% m* c! T, n6 I1 d. K* w# P1 D
push 00 ; OF_READ
- o M; }/ A. w7 p7 _, N& V mov eax,[00656634] ; '\\.\SICE',0
a/ s+ W# o; ~6 { push eax$ _" U U, U+ D
call KERNEL32!_lopen
H( C! @$ p' t) J3 h inc eax
2 M: h0 H2 Q- P& H! _: y$ S& \3 T* H jnz 00650589 ; detected4 g/ A% C6 v" F6 d
push 00 ; OF_READ
4 q* E3 g" [% O% K: { mov eax,[00656638] ; '\\.\SICE', Z$ W: K5 p- z+ d
push eax
e4 N H: W# W: b; _: Y6 X call KERNEL32!_lopen
$ c6 S. v# j J" u6 D. O t inc eax( ]: Y' g4 s; c+ u
jz 006505ae ; not detected. y! t1 h. C4 b% A* y5 ~. j% k
% V, |* K( d/ o: t+ _9 f
) t; C. N' q3 o: W
__________________________________________________________________________3 X/ l+ e S, s
' z$ z% |' M) V) M5 ?Method 12
: L) O! g; M/ k=========% [# i# P% F4 U; {/ S
$ _8 T, x$ j, O6 j; A* K# A; B
This trick is similar to int41h/4fh Debugger installation check (code 05
5 P: k- c4 K# ?. z. Y8 x& 06) but very limited because it's only available for Win95/98 (not NT)9 j( s( p* R& d
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.( W8 n2 x& f8 G9 f" Y
% K" w, m6 M6 o6 m6 C4 F+ }6 i
push 0000004fh ; function 4fh
# b/ c+ }, ~* Z6 F push 002a002ah ; high word specifies which VxD (VWIN32)4 Y, R6 D0 V7 {
; low word specifies which service
" p w& s2 }6 V/ Z8 |" e (VWIN32_Int41Dispatch) {5 U: k0 m! y) s. Q
call Kernel32!ORD_001 ; VxdCall" V) o! H! B4 ^5 B, t R; S
cmp ax, 0f386h ; magic number returned by system debuggers
2 E( F% F7 ]+ p' o% `& x jz SoftICE_detected: a- k' {; F ?$ S) _1 w
6 P F: \% q8 @' \8 I+ KHere again, several ways to detect it:
' K' D2 N" t7 X+ t3 r9 O' c2 B4 ]& g2 m; i8 s6 M D. L
BPINT 41 if ax==4f
* e& ^# A. X0 c J+ p( L% b' D
" n. U# G z j9 h# _2 i# S BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
q8 P( l7 L& o: ^: i8 x6 s: f7 e% \9 W
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
2 L# L. b Q6 N# R* ` @: Q
{7 U7 c8 W# U4 D: t/ Q BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
# A, b5 \& ^( n& [ ?3 n! b) ]& D
) z9 \+ Q) E, p1 { g, J__________________________________________________________________________4 k4 C% S+ y( G8 ?: {: H
8 V7 f) B# f% i$ w" K) u( p. tMethod 13
* M% u* ~9 X- ~8 X9 M0 C: k9 C5 x=========% }( D {6 y2 V0 B" L
+ ~6 l9 X* L0 _5 @ b3 g( RNot a real method of detection, but a good way to know if SoftICE is7 I* q6 a1 }8 D4 v3 M- c/ P ?
installed on a computer and to locate its installation directory.$ m3 K; F2 g/ R# Z+ v1 V% \
It is used by few softs which access the following registry keys (usually #2) :
9 r, G( I9 p7 K ]2 g9 K" R+ s' v; T" k( y+ w* l* V! a8 U
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion) M# l3 z$ O2 R* g% G+ W
\Uninstall\SoftICE
5 v4 R; {% g3 F) t, V$ y' [% l0 z5 d-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE6 Q9 f4 e) ]# p8 d
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
; @$ f* G) d% w# W' I: S\App Paths\Loader32.Exe
0 U4 H* N3 L6 J( M4 E3 j, \5 @* q9 J. j# O+ R# v! Q
# r( `8 w1 R8 F5 ~8 N% X* b
Note that some nasty apps could then erase all files from SoftICE directory) M4 S" u k& H
(I faced that once :-($ p/ ^+ h$ M7 t+ Q
1 [2 m$ e* z9 p, ?+ s
Useful breakpoint to detect it:& O6 H# [6 B d4 N1 A
6 ]6 R+ @% I1 k BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
. h5 A9 b/ G8 h" H6 F l
! q& {: f$ O& _6 V__________________________________________________________________________
" Z" u2 T8 U0 M8 s, u5 I/ O" P9 \1 m9 U! N
8 F* V$ c8 Z% l- rMethod 14 9 K3 F/ M4 Z; z& j6 f
=========+ |" `5 t3 Q; V9 Z1 D5 e7 u" M
; L6 r) D$ R9 o" A, Q9 m# `A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose* O# I8 G0 i: ?$ k
is to determines whether a debugger is running on your system (ring0 only).
1 S/ `2 I& o2 e: \1 O# x; X \: N0 i+ U* M* T* h
VMMCall Test_Debug_Installed
* P& J( u V h \0 X% P je not_installed" Q! _ `) B& e' c
2 C* q* \: [& @4 G. t1 Q
This service just checks a flag.
# _, v! ]0 H0 ^' A5 j</PRE></TD></TR></TBODY></TABLE> |