<TABLE width=500> C) f# ]0 z J' w j2 V+ v0 b
<TBODY>9 G" A8 P1 I7 A( K9 f! m4 w0 V
<TR>
* A3 m( G/ U0 \6 {<TD><PRE>Method 01 : Y6 q+ H" Y, A3 D2 @
=========
, @; u" x" L/ A X
+ c- Q- `. X: a0 _4 l; E% [, QThis method of detection of SoftICE (as well as the following one) is
% x1 I. W/ {+ C6 {) y6 A: [+ P- _used by the majority of packers/encryptors found on Internet./ a) w8 ~5 Q6 L0 r
It seeks the signature of BoundsChecker in SoftICE
0 S& D& t7 H8 H& G' h& k( [/ }* U0 d8 w- @8 E9 c
mov ebp, 04243484Bh ; 'BCHK'
: H: ?# y( W! l; i6 n, p* ^4 ` mov ax, 04h/ v W' E1 g# x4 q
int 3 & |) U' @* f9 N
cmp al,4 u+ Q& N( y: S$ p. i
jnz SoftICE_Detected3 M* F0 m& J5 _) Q
0 N* h; p4 C. L( U___________________________________________________________________________
6 [. y; t0 E- ^5 C; v8 o$ V9 N: L
8 b) f- G' e! i0 RMethod 02
, n I" F. d S3 n) o7 V$ w=========6 ?! ^$ J" a* k: I- k
; X9 H' m D5 Q j1 _. t: b( Q
Still a method very much used (perhaps the most frequent one). It is used! z' f1 |+ r0 w7 x$ Y
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,) ~) H+ H% d0 I& |; n- P- n$ n, S
or execute SoftICE commands...
2 h$ o2 D9 e5 [: K- G" M6 ~! ZIt is also used to crash SoftICE and to force it to execute any commands) v8 J% t( W! ?5 B- q3 Y& @
(HBOOT...) :-(( 4 x9 `5 c' h+ T& c" L. o' o; g
( Q- C: G! c+ e5 e4 {# f6 W& s E
Here is a quick description:# P/ G k q- ~" x$ O3 k! r
-AX = 0910h (Display string in SIce windows)
: l" s3 _0 {* r8 B6 A0 w/ v! X" B: t-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)# G2 t" v, k8 u* y
-AX = 0912h (Get breakpoint infos)% m& |8 v; T& e( ~) c0 b- [
-AX = 0913h (Set Sice breakpoints)
' d5 B( A, ?6 f: |6 R. w; y-AX = 0914h (Remove SIce breakoints)8 r9 l+ o9 r5 K$ M" m
0 {, T0 T' L2 ?% t& G; {4 t7 w+ D
Each time you'll meet this trick, you'll see:
6 x2 f+ |9 y6 u1 w5 M-SI = 4647h
) w n8 m4 I. E; o8 A7 R4 C. r-DI = 4A4Dh
1 c! R0 v3 C% BWhich are the 'magic values' used by SoftIce.
1 c6 u6 P6 V* X) F$ |1 xFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
% n, a6 o8 A8 c. m7 E2 K9 X m' @2 E5 _
Here is one example from the file "Haspinst.exe" which is the dongle HASP7 o1 Q2 I( @- A7 g% ~
Envelope utility use to protect DOS applications:( w! Z, j# S! j& y' |, {
; L P) O/ a3 C
) u6 J6 L0 _- c# |4 {. d; `
4C19:0095 MOV AX,0911 ; execute command.9 s7 i% A. a& e Y) U! d5 w) E* i
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
$ A5 H) s8 ~9 P4C19:009A MOV SI,4647 ; 1st magic value.
$ n% w, n+ V& H: ]: n4C19:009D MOV DI,4A4D ; 2nd magic value.
8 q8 s+ y: I" W" k2 R# V4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
( D* @/ k0 j) t( M. ?4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute. F2 V: [# Z* z& E
4C19:00A4 INC CX6 }0 _2 F* i% |" Y
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute- \- F2 Q$ X- d5 q
4C19:00A8 JB 0095 ; 6 different commands.
/ y6 G( u: o X9 z0 o; D4C19:00AA JMP 0002 ; Bad_Guy jmp back.2 c( |# x5 Y0 O9 A
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
( w' a3 H( D- _1 t: j
O3 v2 J0 {6 M6 p4 b! {5 C& VThe program will execute 6 different SIce commands located at ds:dx, which: t) q3 I( I# P* v1 @3 `4 L5 L
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
; F8 \- T7 C, l/ I4 Y& o# o$ P1 v& H$ ~& L( Z' Z4 K2 S) } B: \2 t
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.! d. R$ `. N4 i4 e5 E* ?
___________________________________________________________________________
$ h7 D p% r% I- P% v7 o. e7 k6 n6 t& N
% R* f2 U O2 _, JMethod 03
" D7 [ i: { |0 v=========: |: L8 X( K& e1 q! q! G
, r. x% E# K! R/ H( b
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h6 V$ k* M) ^8 E4 W
(API Get entry point)
& f& ]9 J; ~" ~
) H% x% v/ w. q
5 W# E9 ?$ N* S) G( o xor di,di
! F% S# ?6 m+ j2 Q6 u" X% c9 @& W mov es,di3 q& `( W% L! `# x, A
mov ax, 1684h
% u' `" N0 K* j" {" {2 V mov bx, 0202h ; VxD ID of winice
/ [6 w0 ?6 g0 ]& n0 M) w% Y int 2Fh3 a6 I* j6 G7 I% f$ R; i( b: F& t
mov ax, es ; ES:DI -> VxD API entry point
* M7 }. m; D5 f2 @0 {3 Z5 B8 [ add ax, di
& ~# r4 |/ i4 S; o test ax,ax
! g! q4 k4 m+ T* ] jnz SoftICE_Detected5 V7 Q! V8 [. {2 y1 m* Y( y
! X9 b9 j+ ~6 H6 g8 f: Q___________________________________________________________________________
6 _7 V% v- s* M5 e- m" l$ s; O% `4 O# c% K- {2 A8 a9 R/ q: ^
Method 04) N# r1 c; ^' O7 }3 X' E2 z; E
=========; ]' i: V6 r' t0 L- t
" I! H6 p5 Z. D) j) `
Method identical to the preceding one except that it seeks the ID of SoftICE
) X& i+ u. Y" t4 |& z" }# I# _, M* \GFX VxD.
0 x6 D& V- X( f" x7 R* i8 c/ i6 N6 z: ~3 {* e9 f
xor di,di
3 f) }+ u9 ]" U( w mov es,di
; c. _/ d: X t0 x) L: Z& h0 U mov ax, 1684h
, S$ [0 s7 M( O4 N3 Q0 n2 ?" F, m+ Q2 w mov bx, 7a5Fh ; VxD ID of SIWVID+ r% W# ]2 e# W6 }6 R
int 2fh( y: v+ `% W# T* T; U' i3 P
mov ax, es ; ES:DI -> VxD API entry point
- ]( @" Q7 c! j1 C @2 F! r add ax, di# O/ v! x! p% _! d E+ M
test ax,ax
: S7 i3 w" b0 u( o9 W" q' `% b- X6 k jnz SoftICE_Detected
+ P1 O: E0 m$ v: {" J- \, k; f) x2 P1 g$ X+ x
__________________________________________________________________________
0 X+ Q1 O; U0 }: L1 I% ~8 ^) \8 r# R" U- n; _1 q. x9 G
! e7 S7 N+ G1 N, D! Y& G. I3 X
Method 05
9 }7 _7 q$ ^. A$ C=========2 g& I! B% l4 ]4 p9 V
+ ^. u3 E) G2 p- B* ?9 A" N5 B
Method seeking the 'magic number' 0F386h returned (in ax) by all system: R2 g) [, V* q
debugger. It calls the int 41h, function 4Fh.
5 H6 `. r& \' k' `There are several alternatives. 8 |# U6 s) ?) ?7 l# L% m1 L
, D: ]* ]$ p* [! f. N
The following one is the simplest:
& p- m4 g B8 w1 L
: T! n0 Q* `1 S! `2 y# ~ mov ax,4fh
. d8 u; b) K+ x, D) t) m int 41h, a% N' u: H0 `6 `9 ~% S$ H' x
cmp ax, 0F386
R% v/ V5 M5 w; I8 k jz SoftICE_detected7 g+ \0 V" c5 E3 c* t
% @/ b8 ~" U8 x
# M. _: D" K. d) j8 pNext method as well as the following one are 2 examples from Stone's
! ~ X' j& a: a3 K& ` f2 O" K"stn-wid.zip" (www.cracking.net):6 K* z9 k1 B9 C: C
5 G( q+ l2 Q/ x( m' n mov bx, cs
- `( P/ R( f0 N3 m; q lea dx, int41handler2
5 K* w8 W p3 K5 ~ @, x) B xchg dx, es:[41h*4]
: X& |3 R+ o8 H5 K4 S, o: G xchg bx, es:[41h*4+2]
+ e4 m. \, R" w- l* { mov ax,4fh1 E# Z2 h4 q, f( @- C ]
int 41h
" W& p/ f" ?* M2 I3 r" i1 J xchg dx, es:[41h*4]) L+ ^3 H0 q: L% h
xchg bx, es:[41h*4+2]7 A' T+ [$ Q: g7 q5 Q+ w
cmp ax, 0f386h, j$ @/ N) o# h9 ?- d0 A6 D
jz SoftICE_detected
3 R- u# Y3 A& g+ P; n2 a" F
3 I2 M3 ?+ S; H0 I& U lint41handler2 PROC: E1 ~: R3 p* @, g( `
iret
; S6 L+ G U' [; v, ?0 r0 @2 ~int41handler2 ENDP# M3 Z' y- a. m+ l0 P
! H) G* P3 v, z
" ^* P9 h; k u5 e# A_________________________________________________________________________
* |! ~, W0 h8 J. ~3 Z% ]$ U' k1 [* m9 D8 M5 M J- F4 ]1 v
; T4 E: R( Z3 i1 Z6 IMethod 06& i/ x5 O9 X. u' v8 y# e% j: i
=========4 J H- B) m$ y/ ?! x
2 a" Q* ?- Z7 w; T3 t% B, v
8 v# `. Y$ t! a
2nd method similar to the preceding one but more difficult to detect:& ?, s3 l- l0 b
Y# B3 \, U5 R1 J, C2 Q N
. L1 n# W1 m" c
int41handler PROC9 F$ a4 [& B1 `" E
mov cl,al' g1 k5 L. `7 ^
iret
8 n3 M3 i; j: f% w4 b/ H1 j Bint41handler ENDP
: N1 F- [( U. D$ R& T2 x* a/ X \& g) S, V
8 T! S; f$ `) k8 ^1 [" R4 M xor ax,ax
2 n8 d5 I! t' p) ]/ d! Q' x/ K- l mov es,ax: Z0 B k1 L; A9 n
mov bx, cs/ c" u6 u6 d- u5 L
lea dx, int41handler' ^* a! I. r% o1 Z9 v- k" ^
xchg dx, es:[41h*4]# Y5 Y! B" O3 E/ c' _
xchg bx, es:[41h*4+2]# z: L5 z, E7 [7 |7 p4 J: u
in al, 40h
0 p! ^/ t% R9 n. k* @. V xor cx,cx+ L0 K. n5 ?, [( Y% h
int 41h1 Z1 h) t( b- R0 S% k. r
xchg dx, es:[41h*4]/ P1 N, U! d( t. e- y9 T) _8 V- {. F
xchg bx, es:[41h*4+2]; I& C# u8 N9 d+ f* k; j
cmp cl,al
4 D- s, R6 K! r; J jnz SoftICE_detected
7 W1 R' Q) }5 W. d! G* w- V8 [
4 A" E5 I' G3 @% _# {* n$ i_________________________________________________________________________
& R# h: L6 B5 O- Z$ H& d+ V3 t& B, k8 J, P/ R5 Z6 t3 Q
Method 07
! R! k! L* W9 z1 x; T1 x. N=========
3 Y; X9 L0 y4 k3 ^8 Y
. _8 P3 `; R% ~# N. tMethod of detection of the WinICE handler in the int68h (V86); P7 s! D9 H7 H1 p1 ^' Y a" \( c, S( ]# A
5 p, `" B% ?2 d6 b+ V( P' ]
mov ah,43h
6 C; [1 {0 z+ m4 L# E int 68h1 y1 ~# ~0 I" g/ k, T
cmp ax,0F386h! p9 R' _3 z4 H, L
jz SoftICE_Detected
0 w i. y$ _' P" ~: k0 [
3 t% @ z. b: x% k7 x# j6 ^# x+ K* ~1 z: F% l7 J
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
_. T) g& o* m* h app like this:
' @% f$ a/ d5 ^
$ Q. s: U) s' [) G/ y BPX exec_int if ax==68
' V" S. T* @" j (function called is located at byte ptr [ebp+1Dh] and client eip is0 y+ B4 E9 X% i& H4 U z; U$ z
located at [ebp+48h] for 32Bit apps)
. L% I" B- q% {* q8 i% @; ?) e__________________________________________________________________________
' u. a: Y' a3 T2 }& e/ q' v: o' H4 P1 Y$ a K
7 e7 B& K1 e% \- j/ K2 b
Method 089 ?# J9 s, D% S8 x; s- S J
=========
0 x9 U7 {0 O, R2 ~9 _
1 Q. n% r& n& k+ H! z, FIt is not a method of detection of SoftICE but a possibility to crash the1 U3 g+ L8 `1 t" c9 [" P; L3 J# X
system by intercepting int 01h and int 03h and redirecting them to another
+ k/ C* B- m1 }- u/ proutine.
% M1 Y* |. I0 c5 P, E G( JIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
0 k% D- X2 h' _; L3 Cto the new routine to execute (hangs computer...)
1 T4 j4 U/ m% O3 f4 _
. e3 {$ J/ O" E+ x0 t# `. f mov ah, 25h5 a+ B1 y5 K; X' K1 f m% h
mov al, Int_Number (01h or 03h)& F- ?9 t* z' r3 R7 f: R+ M# J9 c
mov dx, offset New_Int_Routine2 \6 ]! m7 |, }2 C
int 21h# r$ j A8 _. F+ ~
2 N2 s& n% m ~4 k& [2 `. W__________________________________________________________________________9 H! c" q/ K4 F. T
$ V# z2 n- C9 T6 c
Method 09
" V: n! d9 a( @/ ?- }=========
$ x' e a) K T4 V: R$ t0 P3 |5 Q% I- d5 y. i. L
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
) n2 K/ A1 G5 w; Gperformed in ring0 (VxD or a ring3 app using the VxdCall).
! V* v- A5 Y0 T5 dThe Get_DDB service is used to determine whether or not a VxD is installed
: B" Z% C- z) ufor the specified device and returns a Device Description Block (in ecx) for" S3 A' X, B" o3 ?3 f
that device if it is installed.
/ e4 L. w" ^" S
/ n) Z% D8 j& [, @$ | mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
6 `6 f1 S$ V( m4 I mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
$ @! @+ H% F V- D! V VMMCall Get_DDB
1 {) z: e! V1 f$ R. t1 f mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
* {' [/ Q! O' b z3 a- U/ K1 ~/ M/ j j# |
Note as well that you can easily detect this method with SoftICE:5 S& h8 [, T9 h1 O8 j& H
bpx Get_DDB if ax==0202 || ax==7a5fh0 Z* [2 X! ^3 [7 R+ k; L
0 F5 A, g$ d8 G3 E% y__________________________________________________________________________
+ Y! W3 O4 A @5 L3 C* w
( R) i! r, O) ], HMethod 10) J% j& B- p4 V6 _
=========
4 @* x. R& p3 \7 P9 n6 U4 c4 i @2 o' x0 ^) H5 X$ a1 e2 t# l; u
=>Disable or clear breakpoints before using this feature. DO NOT trace with2 i) x0 H- K, L5 }8 `9 E
SoftICE while the option is enable!!9 T2 E/ @8 I0 K9 u0 y( y& S8 s8 y
! t0 N8 c2 Y! ^% i! c, @- Z6 zThis trick is very efficient:# P, r6 d- c0 N- P/ K3 L
by checking the Debug Registers, you can detect if SoftICE is loaded
0 d( O* v, E3 |' I% s(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if0 w/ c+ q( V/ t* k8 @* F0 `
there are some memory breakpoints set (dr0 to dr3) simply by reading their1 Z( g7 V) ^( V2 t) }- b
value (in ring0 only). Values can be manipulated and or changed as well- P5 S* G S; C" i9 `$ M
(clearing BPMs for instance)- o5 T0 [% s) V7 ]" n4 v
6 u5 z$ y1 U5 K* Z( g__________________________________________________________________________" S5 |5 G" u: _& X$ ^ h
, Q5 d/ O7 I# d9 m8 @+ k4 ?Method 11
/ |; C4 e; i e$ ^+ G% O' S* t=========
) _0 a1 K3 K% B. H( [! ]
. t2 ]" g) u6 }0 EThis method is most known as 'MeltICE' because it has been freely distributed
2 l! r* l' K5 A3 w& P" i0 gvia www.winfiles.com. However it was first used by NuMega people to allow
$ B7 ?" x f5 USymbol Loader to check if SoftICE was active or not (the code is located0 C$ G' ?0 E7 J. c( Q% h
inside nmtrans.dll).
# |) \, R) X* n2 D0 v) [: |1 f o
The way it works is very simple:; H8 V- G% k. | u: `4 U2 W' M/ q2 V- }
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
f! d5 x2 x8 KWinNT) with the CreateFileA API.4 T' j [# V& i& O+ N. x
; |* `# o0 G. F2 x3 T- s
Here is a sample (checking for 'SICE'):
" C6 Z% [' ~% ^* U8 I
* K9 j# u! `/ y$ A' b9 |BOOL IsSoftIce95Loaded()3 L) M1 q4 g, T/ W9 n
{+ k4 `/ A1 U: \" p t/ \
HANDLE hFile; . q5 v2 X& w) a! X' F$ f+ ^
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,, F6 Q9 }+ O; I( {4 y) p
FILE_SHARE_READ | FILE_SHARE_WRITE,) N- o( |) W: x1 E% _6 L
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);5 O% w- N. I) G
if( hFile != INVALID_HANDLE_VALUE )* e# e: I4 V v6 Z, \) Z' ~
{/ ~- w- C8 n8 k
CloseHandle(hFile);7 g0 m X% ?9 C' Y
return TRUE;
/ _& ~4 C' c3 u }
7 t7 X/ ~4 ?) S' |) ~ return FALSE;5 X# ?; m$ j4 O) N
}
7 ^& d* R7 r7 A) y8 `1 ^- A$ i g7 T* G E
Although this trick calls the CreateFileA function, don't even expect to be" r4 M- l* C% _, ?& o; U
able to intercept it by installing a IFS hook: it will not work, no way!2 P2 K' j0 V4 V4 c z! r9 q
In fact, after the call to CreateFileA it will get through VWIN32 0x001F: ^/ Y& p4 J2 y- ^
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
m0 w0 O0 S) h2 o9 kand then browse the DDB list until it find the VxD and its DDB_Control_Proc
( C- t M1 g& lfield.
3 i# }6 y+ d, AIn fact, its purpose is not to load/unload VxDs but only to send a
% X$ j& A2 J1 V5 dW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
) o$ x: q7 @1 ?to the VxD Control_Dispatch proc (how the hell a shareware soft could try5 w4 i; |0 t( G# R5 b/ o# A
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
- @' F, x# D* a# R4 G1 U1 k8 ZIf the VxD is loaded, it will always clear eax and the Carry flag to allow
% _9 \! h! u: [5 g" bits handle to be opened and then, will be detected., R/ l2 S( z, {) k0 l$ n V
You can check that simply by hooking Winice.exe control proc entry point
7 Q7 J- H/ \1 m1 W: p+ twhile running MeltICE./ f$ d d- P0 q1 C( p5 q
, T# \# Z2 a. Y. M
& p- o6 Y3 E2 m8 |
00401067: push 00402025 ; \\.\SICE
' U7 O" h+ I$ ~0 [ 0040106C: call CreateFileA
3 _2 J; J! P6 A4 r& T: H* M 00401071: cmp eax,-001: C- N1 M& @9 c9 x" F% ^/ R
00401074: je 00401091
" m1 l& z" R. d& c5 N' c) e- n* M# J+ g0 |
6 p( t7 M1 ]) G* ?( a+ h
There could be hundreds of BPX you could use to detect this trick.
/ ?8 X: @" Y2 K0 b-The most classical one is:
2 T3 y5 d, G0 T BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
: L, I7 n W, B, ~# L5 w *(esp->4+4)=='NTIC'5 {( p* @# x. z0 A
) u* Q( A4 }6 t/ K. d" k: Y-The most exotic ones (could be very slooooow :-(9 u) ]. b( U/ Z1 L' [' ]
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 1 C+ E: }3 M% L0 t# N* B7 U7 A
;will break 3 times :-(
- L; J# e; M9 g
( G( V3 P6 Z2 z; `% b' J-or (a bit) faster: 4 h+ \& e+ A& Y I9 z& ?
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')" C" P( P9 G9 _2 l0 o+ j) G; {. { c
5 A4 o s9 t9 x* J5 y BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
+ w( l7 Z7 E d5 o ;will break 3 times :-(5 N' P' n6 N6 q
/ X* z$ o# p/ R+ g8 Z-Much faster:
, s$ h3 v' t0 q6 g3 W4 D BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
. g7 c- A7 P$ M+ S: x' W1 q% D: H6 [/ C9 y
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
- o/ x2 [% H' l7 ~6 c# |function to do the same job:# N9 ]( A& Z& L* e
+ o+ n' B* @2 k. A& v! h
push 00 ; OF_READ
3 @5 L5 v+ K0 K+ v0 ~ mov eax,[00656634] ; '\\.\SICE',0
) U$ K- \: h A: D# o/ N push eax: ^" d e& w) a& s5 m8 w. e# O
call KERNEL32!_lopen: {* n7 F9 p% o( j$ P
inc eax! b& o( t8 n. Q4 C
jnz 00650589 ; detected# h5 O- Z/ r- M2 O0 J! l6 X
push 00 ; OF_READ
& N- ^* H1 V" p4 S mov eax,[00656638] ; '\\.\SICE'
* W3 F2 h* Z4 C! y5 _ push eax, ~& V9 d: P1 S+ s& M5 L1 s5 G* _
call KERNEL32!_lopen
# a# d2 X& j- C4 u inc eax
$ N# Z, F1 U3 z, i6 m jz 006505ae ; not detected
7 v" P& N0 L' A1 f
9 }6 } a, x; V X, o+ `
4 V0 R$ F5 e" J% {& m" v- L__________________________________________________________________________
6 R2 ~# Z& V; E' l: _' {& s9 ?8 }9 [5 w1 k. F
Method 12
9 i8 P z" I, c' N( ]# _" O=========/ B* m& k/ K- r3 [* r
- v: _1 ?$ o: q+ yThis trick is similar to int41h/4fh Debugger installation check (code 05# v! ]2 j' c* a6 N, n( `
& 06) but very limited because it's only available for Win95/98 (not NT)# F1 ]' q3 O+ j5 _0 `( Z
as it uses the VxDCall backdoor. This detection was found in Bleem Demo. Q5 ?% k7 _7 U' t" F
7 \% V, J: z+ R2 w( c! \2 H% W. @ push 0000004fh ; function 4fh
/ S& M6 s5 V J5 I* _/ P1 ]: a1 J push 002a002ah ; high word specifies which VxD (VWIN32)7 J7 \6 }) o! h9 F7 ?
; low word specifies which service
! k6 V. o' V. t' O2 V7 v (VWIN32_Int41Dispatch)
/ ?% H: \+ a) U$ A1 i) c call Kernel32!ORD_001 ; VxdCall" ]% Y' ?* i% y- }, F4 Q+ ^3 t
cmp ax, 0f386h ; magic number returned by system debuggers
/ \0 U; B( s1 |: [9 d9 L! W jz SoftICE_detected
7 r# O4 @0 C' b$ H
( c8 l% R+ ~/ [2 \; G: A# ^Here again, several ways to detect it:. w# ^' i n' Z& }- @9 {, Z
, |" p& z N: k5 P( C
BPINT 41 if ax==4f# S, z& A Z, w4 f
1 b/ W0 K# V5 L BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one: H% z! _, l \1 x5 q# }
. E' b8 s; T# t- k$ q
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
9 |( E+ {6 r0 i- N1 \% x
( s/ N* K2 G1 z) d BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!: E) d9 e% }; a% }& a
: ]# @1 ~! y! F! l1 E" a i__________________________________________________________________________
* \$ e" w' z" v/ r7 X
9 I N$ C$ f# I& \, ?Method 13
& Y; }* C7 v/ b=========3 l8 U; P3 F; v8 n! \. D8 |
2 O# I: f8 S) |3 @* m* j4 b+ jNot a real method of detection, but a good way to know if SoftICE is
4 |4 c, j% p7 x8 _* Vinstalled on a computer and to locate its installation directory.$ a2 O* ?2 ^" S3 @4 v$ B
It is used by few softs which access the following registry keys (usually #2) :
) O$ b& G% d1 E1 Z a8 v- D" P9 l* r! e
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion/ Z( T: c( `8 [. ]9 w
\Uninstall\SoftICE
4 D R _8 Z" @8 y8 c P* s9 ~% F-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
6 `2 R" E1 J0 {3 |* Z-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion) Z! l) {% M q0 D
\App Paths\Loader32.Exe
: s9 Y- F, S8 ~ h7 {; G% U' @5 _4 T3 z+ t! i* m* G
. D* Y' w7 \+ j/ k c, Q: |1 g
Note that some nasty apps could then erase all files from SoftICE directory
+ e& \" U1 _& U% |$ C. O2 G(I faced that once :-(
+ u* b6 e' H* R; F7 ?# n5 W$ X) Q: A& Q% I# T+ p
Useful breakpoint to detect it:
7 p+ j' M- ?' z
2 t6 k5 E. y8 ?% b$ Q) c8 D BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
2 t0 _% C+ g5 Z- k: N. y! ]7 |- P. p/ D9 e: x9 i, j: \8 k9 S( Q
__________________________________________________________________________* `* m/ \# z/ y
4 c0 t! W* p# \* ], _1 T6 m2 R" |; Z. w1 U
Method 14 0 y1 ?. K/ ]; \$ z9 V, X6 J7 n* ?
=========
, d% b) J4 B( r- m4 N, z- E7 E( p' \7 z/ I8 m6 W) I
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
% ]1 x/ b$ B) D( W; ois to determines whether a debugger is running on your system (ring0 only)., {: Y% u3 c) L3 A: Y5 R3 }
/ a, e$ T' N/ {5 u6 @1 `
VMMCall Test_Debug_Installed
! |. i+ [% Y. @9 K0 U5 @ H4 G je not_installed: ^5 E- {) K) P; D u' J. J1 y
, p5 P( W. b+ B* m, O5 g. ~$ eThis service just checks a flag.
5 Z* k, A5 L' Q</PRE></TD></TR></TBODY></TABLE> |