<TABLE width=500>! i' g$ s9 F' P% h
<TBODY>
5 [" s+ ` Q$ B: L! v<TR>/ L# f' G3 ^% U5 i
<TD><PRE>Method 01
7 V/ A O/ c% c! r G# R=========# c: |* y/ x9 o* R
6 q% W. U% B6 tThis method of detection of SoftICE (as well as the following one) is
: V3 z% ?# O2 X& n5 v4 T. _used by the majority of packers/encryptors found on Internet.
* n0 y* }& ]$ @; c7 [$ t rIt seeks the signature of BoundsChecker in SoftICE
`% z( r; Y) w9 }7 H3 {) k b
?# G) z7 B5 `( N$ P7 a7 B mov ebp, 04243484Bh ; 'BCHK', d9 M' b! e9 G$ S: W
mov ax, 04h
- a; T- f1 Q$ K int 3
- W: C' B2 n* R* U9 F cmp al,4: S( p+ A2 l8 Y' ^3 a
jnz SoftICE_Detected
8 ^$ o, D& z3 w6 y4 d8 \: u5 ~6 b" V
- x& K5 n' k. M& x9 o6 B3 A; W2 T___________________________________________________________________________
( U) T& D5 d- C2 {& Z8 g# |% W; q1 N% h7 H S
Method 02# a' L/ Y8 @. H, W U: f0 E
=========
$ s* {6 l' `+ i/ A. j* t. h+ i F( p" u2 ^" k0 h& v
Still a method very much used (perhaps the most frequent one). It is used' A: M( ~5 ^7 l$ J: _
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
9 A( f& F7 o2 ior execute SoftICE commands...
, f. N6 V3 a2 Q4 l) fIt is also used to crash SoftICE and to force it to execute any commands
1 e7 a! b; |! r* B& z(HBOOT...) :-(( 7 l2 L* f# |6 d
0 T, [ {* A" f# {, `) g( {Here is a quick description:& N! l2 `7 J+ _
-AX = 0910h (Display string in SIce windows)
! S/ h+ f$ B/ _* T' u4 Q-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)% _& S& a7 B; R& [+ r* Z8 W% x" s
-AX = 0912h (Get breakpoint infos)' G' B0 B2 S4 m# t% P) c) n
-AX = 0913h (Set Sice breakpoints)
' l0 o3 @8 y) D! m+ z/ I/ {; w-AX = 0914h (Remove SIce breakoints)9 [ t: Y2 u1 x! j- E. R
! }" i( e0 P4 c3 T% x& T
Each time you'll meet this trick, you'll see:
4 o3 A3 }6 k# o! V-SI = 4647h
6 A: r% {5 F7 O6 h: t8 i-DI = 4A4Dh: S# L; w; P2 d, \2 z* O8 }2 t7 U
Which are the 'magic values' used by SoftIce.
2 p. b/ E, f. r1 m+ q4 v* XFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.# D5 e& p, r3 e$ Q( E. O
' g3 N& M5 m, ^! w; D" g" I, O2 {
Here is one example from the file "Haspinst.exe" which is the dongle HASP; Z- x/ S1 p, g7 M- @2 h* _
Envelope utility use to protect DOS applications:
5 H" ?0 c4 m/ s6 t1 G# b7 p- X( o# |4 A; f+ i6 V
2 F4 ^. }# b( Y' X4C19:0095 MOV AX,0911 ; execute command.4 S; ` e3 k6 N" e. g
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
4 l8 e# Y0 W8 Q+ r" Q" v4C19:009A MOV SI,4647 ; 1st magic value.
0 e A5 n' y; A6 A4C19:009D MOV DI,4A4D ; 2nd magic value.8 {) `" \% F; x
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*): ?' W2 Y3 H/ B2 ?3 g x$ Y$ R
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
8 Q$ y" X3 N) a4C19:00A4 INC CX1 ^' q( `! e$ q. G0 G
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute' {, \ q6 M$ H( [2 C6 A3 l! u
4C19:00A8 JB 0095 ; 6 different commands.- d, B( o6 J4 R. L6 r* ` t
4C19:00AA JMP 0002 ; Bad_Guy jmp back.' D( {3 k$ v- _
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
/ ?; N( T7 x* x% j1 W7 B \" C$ `* A
The program will execute 6 different SIce commands located at ds:dx, which
/ q7 ^0 d5 L! f r. R: ]. v/ ]are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.' i( G7 Q/ U0 b* ]
- N& L0 A3 j+ w! K! P$ ?
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
+ h# M- `) c4 V$ B9 s8 c___________________________________________________________________________9 R, m c$ ^- B/ b' b
: A% o" ~9 T0 N# t3 j- F- r$ ^+ S' n9 r+ W+ b0 ~' l
Method 03
* P2 Z% l3 G8 n=========! @& L! ]4 {9 a6 \- u
6 X. u/ `) g: O" ?
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h) v8 x0 P( f6 c' i0 L8 F
(API Get entry point)# T, i; j8 g; V1 P
* n# B6 z$ V$ l* @: U
: t) W0 b$ ]" G: k1 d xor di,di
, J. J7 ^) f) _ mov es,di
) \, ~* F2 O& S/ w% R, M3 {# z mov ax, 1684h - B5 i4 Y, M7 g. B/ h1 X; B
mov bx, 0202h ; VxD ID of winice
5 ] ]" ~+ J; r; O0 N int 2Fh# p' {: h. F/ E' S
mov ax, es ; ES:DI -> VxD API entry point3 [" w) b/ d: d/ {1 D( h! N
add ax, di
' q+ ?% o8 o8 I test ax,ax9 M3 W. l/ c, c$ ^$ z
jnz SoftICE_Detected2 A. G1 B9 _6 _ \
2 \5 p/ G2 }- [! G) p1 s& g
___________________________________________________________________________2 Y8 x/ v% z* b) Y6 O
: r3 R) f# g, n$ j) V9 `
Method 04
' J+ B* ~; y! Y( ~=========
/ U! ]7 U7 A2 h; z6 z
, s% \7 F$ c3 N M* S3 \Method identical to the preceding one except that it seeks the ID of SoftICE
, \& C# e$ t: X; O; W; R- bGFX VxD.
. w2 `! e( t3 ?( C+ a" f
; W0 ]' A" c# O xor di,di
y$ z: X b* G1 r& f mov es,di
I1 ^4 Y$ N2 k$ H' J2 T! L mov ax, 1684h
: |* o; N8 x& R) t mov bx, 7a5Fh ; VxD ID of SIWVID0 i$ \, \: n r# N0 ]# z! p( u S
int 2fh9 g9 ^( T2 C/ z2 h/ f
mov ax, es ; ES:DI -> VxD API entry point
' X( K! ~) ?, e/ Z, K% w add ax, di
& l' s7 W3 t5 l- W test ax,ax. e7 h; z7 E7 f) O! B7 D
jnz SoftICE_Detected3 z& _& n2 M s
# M# j1 I4 T. p0 R
__________________________________________________________________________: F6 x* N" B0 ?; I/ Z1 ~
- K5 c0 w; |/ C% ?$ Y
- J+ Y) O( `" |Method 05
, a0 t; z V* R5 c7 J: B=========0 u5 T6 k5 W' m3 d9 y' s
+ @0 S A2 L5 p& \0 s( s" f1 u
Method seeking the 'magic number' 0F386h returned (in ax) by all system' Q+ P/ M" `( |' A
debugger. It calls the int 41h, function 4Fh.
3 y* D \% i. _# l6 P3 `& T0 i0 UThere are several alternatives. ; X: [& N% L/ Y0 g
E# ^* e C, ?5 X# E+ b4 Z5 B
The following one is the simplest:$ d$ Q& M Y S5 V
' \$ `5 O4 K7 N: A
mov ax,4fh5 t4 C( _5 L3 ~8 ~% X1 H2 b
int 41h
; p; S' \+ `& _5 H2 b' e cmp ax, 0F386
: s' d4 Z5 g; L3 w4 a x0 M jz SoftICE_detected2 a, v4 X- g% h! U
( l: W4 n5 `' n- A( E1 I6 [1 F0 a
Next method as well as the following one are 2 examples from Stone's ' R0 G7 A1 ]; _* N1 j
"stn-wid.zip" (www.cracking.net):" t6 \# e1 x" N; ]" b9 g) }1 ?) {" T
5 X% L* d" [3 O2 U- t mov bx, cs
+ t" {) G5 L! |" j9 c1 x7 q lea dx, int41handler2
3 b+ Q2 l1 E& N9 X# Q( X xchg dx, es:[41h*4]3 {' H x% E- q; t8 y
xchg bx, es:[41h*4+2] x5 R! X: B& }2 A) i1 R- @ ?
mov ax,4fh
6 a F/ e+ A5 @ int 41h$ n% }0 T, M2 B1 D
xchg dx, es:[41h*4]
1 ]/ S8 |( b( u3 E0 L xchg bx, es:[41h*4+2]
: G" g# q# {6 Y* W$ d2 k' W cmp ax, 0f386h* [$ X- G6 g' U2 F
jz SoftICE_detected
. K. b9 h) }9 h- w" w% ~9 \ R9 [5 f6 }
int41handler2 PROC
0 A+ D1 v9 `' f9 f iret
& b" @- [8 L& {$ @; lint41handler2 ENDP
1 ?* V5 Z1 v# r: H; f5 O
; U. w, f% k7 O- n$ U5 j7 M2 @8 u' R
& s: P9 g& {! }- d# \0 p4 k$ B" S_________________________________________________________________________3 r9 {0 {8 z( R. q5 q
% Q8 H: h/ |) B
; P; E3 n( s, A7 z+ t$ z+ Q
Method 06
- E; Y* ^$ ?6 j$ n. f=========* J2 Z7 R& e7 U* f" U
5 g* U; X" y0 F I6 y+ O6 m' X+ D4 a @3 S4 K& l4 e
2nd method similar to the preceding one but more difficult to detect:
1 s6 P' E8 L: F _( U2 p" t9 G! D, ]$ X5 h
0 y$ B6 [1 O( f" A7 O( L; c
int41handler PROC
6 b# V+ R! C! P" H% i mov cl,al
) o( W9 S3 R K0 \7 W; y iret
! e3 I% c9 w1 B9 F& e8 ?+ h: |; cint41handler ENDP2 T: y! i) B; I* q. P
+ \" o- i5 }( r+ s9 w3 p% a/ N6 c! }: \8 X- W( {2 H
xor ax,ax
/ z+ P8 P4 A, d p mov es,ax5 q' n$ r2 J e# A1 ]$ G
mov bx, cs4 y5 Q) f2 _) g) x+ l
lea dx, int41handler
# r9 e/ J9 s4 }( U xchg dx, es:[41h*4]$ Z* r* P( [ g" C, z
xchg bx, es:[41h*4+2]
) y7 \: N6 `9 @* ^) b in al, 40h; h5 M3 v3 B. F- Q1 g* b
xor cx,cx( X2 B0 K4 x' h& s
int 41h
8 r4 y1 p5 T8 \ xchg dx, es:[41h*4]
/ t/ }' x1 A9 D% [9 p xchg bx, es:[41h*4+2]. y- A0 r( B; ~9 ~
cmp cl,al
6 o" v) s2 K- ?! D, L% A9 p9 H6 k jnz SoftICE_detected2 [! Y- ?3 J/ I* O
! c1 v# }* x/ @9 r3 L7 @
_________________________________________________________________________# N% l+ A2 T; e) |
' t( D- E6 ?$ {8 e5 v- vMethod 07
( j y& {: w/ q6 Y, E. e5 O=========, y) b7 s5 W8 X& N
, b. r0 G5 B7 W
Method of detection of the WinICE handler in the int68h (V86)
7 \& x" x) x2 ^4 n& R7 H! I/ y+ N7 ]! a! y$ l" q# \+ }
mov ah,43h: E F1 r6 f. M3 j! R' s6 d
int 68h
, ^" t, R- v! p, I( T! r cmp ax,0F386h
+ }! _' l) A9 d4 d3 L jz SoftICE_Detected% B) ] A R2 W) M8 n
5 t6 t. E$ q0 z) S2 Q; K5 {9 s
, c7 D! m# T/ R; e! q- K. \=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit/ b* d5 ^8 D. t/ H4 W4 _ q; k
app like this:6 [- D& |5 h/ R7 \4 x/ k/ r9 u
% @2 V, j$ U! _# L8 M% D& b* @* c BPX exec_int if ax==68" F. \/ C$ V* E1 k$ I
(function called is located at byte ptr [ebp+1Dh] and client eip is
5 k Z9 z0 |4 [7 k( I+ C located at [ebp+48h] for 32Bit apps)
; S1 j/ x1 a" {- s__________________________________________________________________________
) K% i# m! E" z+ ]
( i5 }* m( {) y% _. Q' V6 D0 g0 ^6 j- Y8 A
Method 08
6 Z- G% F& Y" H% u: n9 d=========
7 J2 R( O5 S& p0 Q- S* Q! m0 p6 t9 f. _, A; z: c
It is not a method of detection of SoftICE but a possibility to crash the
5 |; R- Q# q- q1 T/ g# Vsystem by intercepting int 01h and int 03h and redirecting them to another. A8 q* ]. V0 p6 ^9 ]. v+ Q! {
routine.# i& T7 f7 U( T8 _( f' Y
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points, H' f! s4 x7 \$ B& b; r; k- O. K
to the new routine to execute (hangs computer...)
, O3 r6 L) e, Z8 o! f+ V
1 K. e4 G/ Z t3 j: B! M mov ah, 25h
6 r9 e: N9 X6 {$ r, Q mov al, Int_Number (01h or 03h)
2 p+ E/ Z1 R: |+ r/ ]4 _ mov dx, offset New_Int_Routine
0 j5 ?% T$ G4 O int 21h) ]' H6 ?4 W0 o3 i
3 F0 T1 `* y1 L__________________________________________________________________________* g/ J# Y9 e3 E! G' l
! N. h8 `( k2 J0 QMethod 09+ ?. N6 [: P6 H: U; k
=========
3 T+ ^. F) o D3 @ A
7 y# u: S' G4 O1 AThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only) w) P* g$ X/ M; \; f* b
performed in ring0 (VxD or a ring3 app using the VxdCall)./ y) t; G! q) J( L4 N3 N8 n
The Get_DDB service is used to determine whether or not a VxD is installed
; R: o# T" J) r% \( p" d! U" @: ~6 wfor the specified device and returns a Device Description Block (in ecx) for1 U: u* _) g: a
that device if it is installed.- m p$ H R! ?0 ^# _( o: o
4 ^! r8 X. S) b. k ]7 e mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID4 _: N% j! n+ k/ E) R
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)' \1 D8 P$ {# l
VMMCall Get_DDB
# D, r6 D- l) s+ K2 c$ {3 ]; D; o mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed+ G. G E0 U( _& T+ }3 w" R% H
$ J/ M; m" P" eNote as well that you can easily detect this method with SoftICE:
5 S$ P5 ?) L* n+ C* S8 O9 M bpx Get_DDB if ax==0202 || ax==7a5fh
P. A8 R$ G- i$ \" H+ Q9 o( ~0 x3 l3 D' G' w( G$ v
__________________________________________________________________________+ Q6 v; G8 ?9 c7 X9 H h
" k! k8 `" T/ P3 JMethod 10; ?( h @1 _' n2 k9 S2 N- _% r2 t
=========* c! C( d% k2 s: N2 K: q3 x7 e
' b Y& \) u/ U4 N) H: r=>Disable or clear breakpoints before using this feature. DO NOT trace with
7 I! b d. O7 `1 y SoftICE while the option is enable!!$ \* @& m& P! B4 E6 m
7 K, i0 E) b5 ?# L/ z
This trick is very efficient: m% X% [" X6 ?; d$ r+ f
by checking the Debug Registers, you can detect if SoftICE is loaded
$ \% W+ i; y8 C, k8 t( [(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
1 B' V1 L9 z$ J# {; \/ e" }/ w Ithere are some memory breakpoints set (dr0 to dr3) simply by reading their( ~% Z3 f) y4 L/ n J9 r
value (in ring0 only). Values can be manipulated and or changed as well
' _' G. O: a- k! o& Y* V(clearing BPMs for instance)
) D6 j; Q: D% Z+ Q4 ~! h Y4 o- r V1 v; [
__________________________________________________________________________: g) [' |: f! }& ^
% `; q I+ O2 I/ V6 ~Method 11
1 {2 n5 o1 n' u2 G0 ]: K# V=========
: T5 c2 c4 \/ @0 m) B5 M: V3 F- z) y& U7 z9 z
This method is most known as 'MeltICE' because it has been freely distributed
8 @9 c! Q, t& I9 W/ Hvia www.winfiles.com. However it was first used by NuMega people to allow
5 W9 r( t G M1 N! t PSymbol Loader to check if SoftICE was active or not (the code is located
. H* u2 P/ b0 N' C, |; Zinside nmtrans.dll).
, n8 F4 R! m- a0 w: r) H, ]; z2 @9 m* H
The way it works is very simple:
: i* ~6 H0 O0 D) n+ z8 M3 k9 o% LIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
. N; p0 }4 i. C1 h0 h- c# n) RWinNT) with the CreateFileA API.
) ~1 O1 w6 G6 i, w
( G. Y2 j# y. R7 wHere is a sample (checking for 'SICE'):
' e0 r/ @/ T6 q) L. w' a
* w5 s8 }- n* ]9 r9 xBOOL IsSoftIce95Loaded()
3 C P, }% a% \9 W{
' Q0 `7 d7 l3 c7 w1 A+ @ HANDLE hFile;
9 r6 u4 `6 P3 w$ T k8 r hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE, G: W$ Y( n/ f
FILE_SHARE_READ | FILE_SHARE_WRITE,! T( [( _8 X: ^$ N( Q
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
" j& t% y# F, H7 v, Y$ P if( hFile != INVALID_HANDLE_VALUE )
: M/ @' g+ g4 X% q+ |4 \9 [0 t9 u {, J9 [. C [: ]4 }& K. Z8 k
CloseHandle(hFile);& t& y- [% A e |& d& k5 J
return TRUE;
- u+ K7 a/ D( z }$ W' x/ U* J( u& H1 x
return FALSE;
w6 Y+ m2 ?7 N}
$ c1 I" s) z' Y8 ?5 E" R! }7 c+ f k h. s: Y+ d
Although this trick calls the CreateFileA function, don't even expect to be$ W, E8 w+ p/ T4 V1 ]
able to intercept it by installing a IFS hook: it will not work, no way!
" u, Z* V8 p1 w; l7 R/ uIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
5 w4 s! } p; C4 `2 c" Pservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
: y! G, S. n& zand then browse the DDB list until it find the VxD and its DDB_Control_Proc
" _3 V" K9 t! @' z& v7 x% \field.1 ~: Z3 k' S+ g
In fact, its purpose is not to load/unload VxDs but only to send a
' F2 \8 o0 G f8 J3 d8 B. U, z, iW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)4 [) P0 X d# w- {( F
to the VxD Control_Dispatch proc (how the hell a shareware soft could try8 i; |0 v* x1 j; s- `2 \
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
% L2 s4 o* H" V: d$ P$ j, sIf the VxD is loaded, it will always clear eax and the Carry flag to allow# K; p+ [5 w) Z( [# ?
its handle to be opened and then, will be detected.% M# u8 A' i4 _9 U
You can check that simply by hooking Winice.exe control proc entry point4 _& | b. t* y9 c- _! J
while running MeltICE.
& m5 {$ N4 t' H( z' l' g2 w, U' F4 w' t% s1 r
. w% F% c$ I9 r& J4 h4 ^& \& M 00401067: push 00402025 ; \\.\SICE
+ u4 [4 b( ~ f" R- c# ~ 0040106C: call CreateFileA8 U. A9 E1 {5 y3 I# V
00401071: cmp eax,-0019 }, M% ^# G, Z A+ }
00401074: je 00401091
6 v, H8 j' M% x( O
6 o3 y; m' y K% p5 s
3 _! z$ l' Y3 @There could be hundreds of BPX you could use to detect this trick." r& v0 K! z- t1 ?! O
-The most classical one is:" f. I6 M6 G! X% U1 e
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||) j4 I: }3 ?' V4 ?
*(esp->4+4)=='NTIC'' i B5 j0 @9 e& T
, z, b: `! X$ C- h/ x% ^3 ^
-The most exotic ones (could be very slooooow :-(& x- k; x7 Y1 O
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 6 G ?) c5 L3 z/ t! W
;will break 3 times :-(
! t. o/ @+ j6 }" A# `
) @! ~1 c: \5 n+ d-or (a bit) faster: : {; t- {" K/ [# H3 k* M% F5 Q) K
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')- V2 j+ ~" n0 t5 J+ F
- Z9 |4 i& |# D3 X BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
g5 s) D. J- |: g( \( q Q ;will break 3 times :-(
# s4 e' L' w- Z1 W" a. q5 l! ~% Z
* Q3 o6 ~ E6 W' \4 f-Much faster:
! u% }: F7 F0 h" ?9 I6 s BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'2 j) G1 p& r t' p3 B
& ?7 O$ l4 G+ n6 gNote also that some programs (like AZPR3.00) use de old 16-bit _lopen6 d! y8 |. x0 y; ], Z5 D
function to do the same job:) |9 a5 T8 K6 F; |
9 B" K, b* F4 `5 g2 e push 00 ; OF_READ
; C0 x! O( ~+ F4 L mov eax,[00656634] ; '\\.\SICE',0
2 l! p! G0 f, r5 ?# F- @, Z push eax) U4 k* M, p4 N! T4 F) X3 U
call KERNEL32!_lopen* V! G7 a% T& ] h4 P- h* }
inc eax v' |' d, g8 E# y9 ]9 R
jnz 00650589 ; detected) B1 z m6 J+ ^
push 00 ; OF_READ
3 I0 y( H7 O1 i& u1 S3 |5 y# D mov eax,[00656638] ; '\\.\SICE') F' [% ~- [" q8 W
push eax
/ m. v/ g' q4 \/ _0 f* T; i6 N call KERNEL32!_lopen
2 s/ ^+ {1 J% ?3 _- I( a3 v inc eax |5 o5 A& _2 @! [9 j
jz 006505ae ; not detected
) S7 ]2 U% S5 v0 l
) ]8 J6 E: E9 D' Y& ^% X8 z" w/ f: o; T9 ]) R8 ~2 _1 O) E
__________________________________________________________________________: }% z% ~, W; s* }
, I* J! k4 A. w9 ?4 u9 B. w0 e
Method 12
2 t5 |6 S! [7 d: G0 h=========7 q% l6 T5 H# Z3 t7 }" @5 J
$ Q: f9 E! k- X
This trick is similar to int41h/4fh Debugger installation check (code 05
! C9 t% W ^1 t& B {- e3 z* _& 06) but very limited because it's only available for Win95/98 (not NT)# t C) \4 Y+ H l* d
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
3 g$ `2 x# m; n3 q9 W9 a
9 X7 }& U. o- m- a0 j' U push 0000004fh ; function 4fh/ a; P) F2 I1 {5 i- R5 `$ J
push 002a002ah ; high word specifies which VxD (VWIN32)
, ~! |' O6 a; j2 n' M ; low word specifies which service4 \. N* g# G3 u/ O/ a( k$ ?8 P
(VWIN32_Int41Dispatch)
# H+ B$ |+ o5 q3 F- y8 k call Kernel32!ORD_001 ; VxdCall
* G9 [7 `; k/ y& |3 n6 _! C cmp ax, 0f386h ; magic number returned by system debuggers3 T i$ a3 h8 ~3 v8 v5 Y) v
jz SoftICE_detected
( [2 Y! q% |' I8 S* a- r R- l
, q! R! \7 t& [2 _( {; b! iHere again, several ways to detect it:: r' \2 j; E$ [
/ F0 N5 D6 o4 k8 P2 i3 q
BPINT 41 if ax==4f4 O0 L0 Y, k) f% T z# d1 ^
5 n' N: Q6 L p5 b- m BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one7 W0 j. ]; [1 }' [9 K; a. [1 A
' k* R. w( U0 _ O BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
3 C! c: a6 g# O M2 a1 Y" v
$ r% }& u- d8 o" R% T% J+ t BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!, G7 G" N7 v; n4 B: }) F/ A
- ~+ _7 T- y- G% E/ {__________________________________________________________________________ M5 P: C. l& |+ G
/ Y+ s x9 v* N
Method 13
8 i6 a# \# f3 o- x) V& k2 y=========
+ v4 ~* f. f' r- n. Y, s2 H' M1 C
Not a real method of detection, but a good way to know if SoftICE is
: g9 b, x% ?( }installed on a computer and to locate its installation directory.
- g2 m5 i$ }8 r8 @% a) L0 c* pIt is used by few softs which access the following registry keys (usually #2) :
# w/ [; P- {& j: M6 f" u+ b
+ E: m$ e9 y! e: Q-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion6 Y) D {) ~! h' b
\Uninstall\SoftICE
( F' X# R% a m* b5 @1 j5 z-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
# j$ E9 ^& n9 P: t& {3 B-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion. `, L: I* F) u3 n; j" p
\App Paths\Loader32.Exe
& a. E8 `& k2 ]( K o2 c# Y
5 `! y# E* G. h4 Q' ]: F
& ?* u# \: ~' z& ONote that some nasty apps could then erase all files from SoftICE directory5 o* f) s! ~3 h" H: ^7 _
(I faced that once :-(
$ T% m3 w! p5 M$ Y- v+ G
# _/ r( f+ J( qUseful breakpoint to detect it:8 I |1 x! q/ Y# S Z
$ k- w% v* l+ X7 s% g% m f BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'8 ]8 g) G6 Z; H7 ^
; `2 w$ t1 w+ L* [3 r+ |
__________________________________________________________________________
0 p8 z9 B8 n. J& C8 l
# Y9 R- N! ?1 j( h7 E
1 B. z& Q6 V/ y6 r9 Q) mMethod 14
& s$ Z, E# I ]& |7 X5 K3 M/ j* ]=========
# W# z) z t3 m, z5 ~* k, o6 L9 ^# _0 \- T
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose; R# b2 r% {% C0 V- F: x' d
is to determines whether a debugger is running on your system (ring0 only).4 Y5 i( w. m7 t9 J. _( M! _
0 U$ a8 l( x2 m
VMMCall Test_Debug_Installed
2 s. E* I7 d2 R4 r je not_installed
$ u: a' ~8 r% \1 c* b2 @- e8 K% H( R: w
This service just checks a flag.
. P5 \! `1 Z8 k3 }4 {9 C; p</PRE></TD></TR></TBODY></TABLE> |