<TABLE width=500>, w0 C3 |. W0 H& @% ?
<TBODY>$ L0 i4 V) r" d
<TR>! _5 ]" L, ]& m) V0 s
<TD><PRE>Method 01
8 g* N4 o+ x5 v( O=========: r8 t ?1 i# P9 ~5 X% L
$ V, ?) C$ P. ]
This method of detection of SoftICE (as well as the following one) is
% _$ Q% e8 Y) g& W0 ^9 K0 Rused by the majority of packers/encryptors found on Internet.7 T. `" X: [6 V- w, i
It seeks the signature of BoundsChecker in SoftICE
R3 F( W8 L2 ], K6 P; M6 y, L& L8 v4 X! I* M/ G4 T
mov ebp, 04243484Bh ; 'BCHK'
% d. i# g8 g* ~0 q mov ax, 04h* g# j3 ^$ z7 y. w
int 3
3 y3 f' O* }# X: o cmp al,4% {3 D- A. u+ u9 D/ S1 L& P/ z
jnz SoftICE_Detected
( X! O- p& K5 M1 d: U2 t3 |6 @$ o
3 n$ \' @% t& Y: {& g: H___________________________________________________________________________* ~& `7 J0 D( p3 G3 D8 p
U% x$ F* j5 H. ^: ]: d0 L7 \' L
Method 02
* n% ~+ d$ T" Q+ W! E0 N% ^=========
5 J8 U! Y- i) @- e5 ^3 r3 N, l$ w* I2 O! Q0 Q. l- R
Still a method very much used (perhaps the most frequent one). It is used) D$ K) ^6 Q3 L0 O
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,8 \8 E( }+ L: J5 Y" h
or execute SoftICE commands...
F, \3 V3 v8 K, O) CIt is also used to crash SoftICE and to force it to execute any commands
, h$ {' B5 M# z) v& E3 Y(HBOOT...) :-((
0 X5 M. l" I& J1 }8 F6 g3 R
* h- @" \' y' R+ N- cHere is a quick description:
, T& o& h: C! @! E-AX = 0910h (Display string in SIce windows)6 K! F! h2 y: w' @1 \
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
( M* b6 S0 | @0 d-AX = 0912h (Get breakpoint infos)
2 |6 B8 G+ X4 Z& {! Q ?-AX = 0913h (Set Sice breakpoints)
2 ^) q6 t& y, ?7 @$ v-AX = 0914h (Remove SIce breakoints)( B' R r9 z& e6 g8 {9 q
% ? l2 Q5 E& g4 o! S2 Q3 V
Each time you'll meet this trick, you'll see:5 }( @/ r) k1 v# ^0 B, R
-SI = 4647h
' i6 h3 O( s; S. k4 b$ B-DI = 4A4Dh
* w( I6 G Q, c, FWhich are the 'magic values' used by SoftIce.
7 K2 \3 E4 n/ [0 }8 x" \& A' p9 cFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.& }5 t, @9 N* v% r1 l
) ]: A ?- ^# K, }/ f
Here is one example from the file "Haspinst.exe" which is the dongle HASP" |7 ^( } R N4 c
Envelope utility use to protect DOS applications:
0 o- e/ Q2 _# N R
* J& I! d+ Q- V" p3 G
! z+ ^; ]1 J" N" z2 v$ E! \4C19:0095 MOV AX,0911 ; execute command.
* r" j/ l, g$ w# r/ M% V4 u( [4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
9 w6 \6 E$ R g! o$ {4 K4C19:009A MOV SI,4647 ; 1st magic value.7 t# {* f4 T3 P9 g- F& j
4C19:009D MOV DI,4A4D ; 2nd magic value.: t' e( m) l, g( _. I
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
; H/ r) H! z) b/ ~4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
4 l; G/ [* g7 @! H( Y4C19:00A4 INC CX- d+ J3 o9 z+ e) b
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
; b8 `! [- G! t3 j4C19:00A8 JB 0095 ; 6 different commands.4 O' A8 u* Z% U& c. ~7 r+ K
4C19:00AA JMP 0002 ; Bad_Guy jmp back.) |% m0 r7 S; S6 Q/ d7 @3 B
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
$ W! m3 t+ b$ d: b) g' } P
q2 B+ n/ n( v* i' PThe program will execute 6 different SIce commands located at ds:dx, which
2 j# Z/ [! l! W! c; E0 J5 Fare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
) b8 y( y4 _* N* Y
6 _4 F6 Q# X( ^% w. m. {* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
# C6 h; C; a2 @___________________________________________________________________________, |9 I$ X+ Q! {. E. G4 E
1 R. K; Q4 s! }
! u4 F, k e) L
Method 03
! |* g) |: D& G=========
. z, T5 _) U" q0 D9 T$ C
4 l' ^3 ~, q0 U. oLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
2 c8 e# F8 P/ n7 T(API Get entry point)$ u" B. Q4 k0 Q. y
6 t/ U+ e8 e1 U
. F0 @: M& \% z8 R9 F xor di,di
7 @1 X/ @# C3 Z# ^0 K! k mov es,di( K9 y) L. o; r9 D0 P8 i
mov ax, 1684h
7 q/ g3 a5 I2 k1 x( w W/ s mov bx, 0202h ; VxD ID of winice
4 K) N g& w7 M& @ int 2Fh0 @3 B5 }, \" f' w& r' R
mov ax, es ; ES:DI -> VxD API entry point
1 Z q) I7 p7 X% a add ax, di+ j! X5 T6 Z l" P) F0 Y9 u
test ax,ax
& }% v3 N {0 w7 } jnz SoftICE_Detected
- R# B5 G0 b) h! ^8 t4 W! J
8 j7 P7 W7 [! ^$ ~/ e___________________________________________________________________________
( t+ O; V2 O) ?8 B
+ }; P4 K1 D" G4 d3 iMethod 04
, h8 f8 T- `( q8 P=========5 j& f8 U4 k% }& f2 v- {1 H
3 g( r. B3 x( v/ y
Method identical to the preceding one except that it seeks the ID of SoftICE* d4 f4 p) p( g
GFX VxD.
- K; a, e1 w" t# G- I- o) H; r, j1 `4 \8 R
xor di,di
7 P7 Q# M- W4 _2 ]$ ~ mov es,di' G, R# e j3 J9 `- u
mov ax, 1684h
" i$ f# i- H. v: } mov bx, 7a5Fh ; VxD ID of SIWVID
; r& [) s5 d. w8 H0 o. B7 t int 2fh( _. O, }% r( r8 Z
mov ax, es ; ES:DI -> VxD API entry point* {: Q- F9 H3 Z6 d$ `
add ax, di) L7 a3 A' a- `2 S% [/ e6 W
test ax,ax
, t% U- ?" {0 K* h' f9 `% \ jnz SoftICE_Detected
# f( j$ _! G9 j+ Y' U/ I/ R( g: I1 e
__________________________________________________________________________; H+ H+ E# o4 E6 p4 i
% Y% b1 W4 k+ _- c
) ~$ V$ K8 G$ o, R% {( sMethod 05# j. h% g& Z& e/ W( f
=========2 W ~+ ~; x( ?" J
2 \. |; U; q4 Y2 d" f6 @) J* q7 bMethod seeking the 'magic number' 0F386h returned (in ax) by all system+ H) L: h& J, t% M- P3 a% {
debugger. It calls the int 41h, function 4Fh.3 ?# a0 ?4 X& s
There are several alternatives. / m4 J) j- T" q0 ~7 S d
! R' r- D. m% `2 }9 Y% w; ^6 w
The following one is the simplest:
, v1 J3 z( _1 W% O7 d5 }. |/ K+ n+ B0 I. g$ L! ^
mov ax,4fh
: ^0 x% u$ V' M int 41h
. `( m1 Q+ c) P( y, \! P$ s5 w cmp ax, 0F386/ [2 \$ G# F Z7 R' Q+ g* d2 [7 [
jz SoftICE_detected5 B$ o6 V' t. W& U7 b# r6 c
2 m( B$ e) Q: N; j) U- Q) O! W
/ C! L0 Q' A3 t8 s ~: ?Next method as well as the following one are 2 examples from Stone's
+ R9 I! z; D5 F9 Z"stn-wid.zip" (www.cracking.net):# @, n/ N$ _: R: R( }* y
/ J( P9 ]0 E. [! l' Y" O mov bx, cs
% C+ n+ t8 v3 h! i, c5 |* V lea dx, int41handler25 _; g3 t. R% P2 S4 J
xchg dx, es:[41h*4]! D1 E& B" y0 y' X
xchg bx, es:[41h*4+2]
' `( ~7 R6 x* B mov ax,4fh
8 K: w' X, {* I( R int 41h. p/ v" [! n/ F" e6 ~1 {2 t$ [
xchg dx, es:[41h*4]6 {4 W: y2 |( m, k
xchg bx, es:[41h*4+2]$ a9 ?0 V4 N, N0 f. C6 ^" g
cmp ax, 0f386h
- h9 k, s! c8 k( Z jz SoftICE_detected
' G0 W2 h9 f6 U$ g- e( N( C
0 I% [7 M8 g \" p* nint41handler2 PROC
7 i( Q. T" d* E9 X# R" }/ L# ~) d0 l iret' y( t+ j0 e: _/ s* h9 j
int41handler2 ENDP
9 Z# e# F4 Q# ?' m, R, u( I i1 h+ F/ [2 Q9 s6 N9 ]% `* v2 ]
' ]+ B ^) q w3 U3 u( `
_________________________________________________________________________& n( _1 B0 f! i7 `5 ?
' j0 }7 ~8 s7 r; ]' _! f
' ~6 d5 q4 ^+ [6 G- U) aMethod 06
9 `8 ^9 a; D3 o1 H- P/ A; W4 b=========1 y& Q3 I, J0 ~9 H- R/ [
& M8 V5 E" [8 v9 s$ d/ p' x1 n* f6 v1 f+ M# \% Z" [
2nd method similar to the preceding one but more difficult to detect:) o x$ w. b; X) c
7 n2 ?9 [) o1 N* S. D2 E
+ k$ d4 ~8 g1 ]5 E2 Kint41handler PROC
& A* B: B6 l0 s0 V, ~ mov cl,al5 F. a- H8 G5 ?2 e) G
iret% j2 V, z5 R3 _ \4 a V8 X
int41handler ENDP" V' V& H( p1 D
4 G! V( x6 {2 h- e: ~
* W, I. D; Z) t7 Q xor ax,ax5 j2 f8 A. I5 T+ {; V" I0 B
mov es,ax7 t/ y3 x" J% H8 O
mov bx, cs+ |% y& R, b" I a, o3 W
lea dx, int41handler( S5 f7 N+ l: a: E
xchg dx, es:[41h*4]
$ U0 l7 }, C, M! k# x% N xchg bx, es:[41h*4+2]- {/ Z4 Q3 E8 J9 ?( C4 k! p/ m
in al, 40h: x) i* |/ m. |4 C- l2 E( _
xor cx,cx
) p- _' l' b: ] int 41h
. l6 O4 P |9 l xchg dx, es:[41h*4]
4 g4 O* C% W, o7 y$ Y xchg bx, es:[41h*4+2]/ B/ w0 P% u9 O/ I: q
cmp cl,al
. J. y0 F* \& U2 p3 S* ?/ F jnz SoftICE_detected
) L$ M9 Q& i( V4 Q- o" M! j. O8 c7 V
_________________________________________________________________________
5 o4 ~4 i3 t- a* |5 }% y. |4 c, K3 ]2 w/ a' m. d
Method 07# y) ^. j; a4 V Q& u! j; _
=========! ^$ F( ], a. A) ~3 {4 x
8 G4 V" s g3 a% C+ UMethod of detection of the WinICE handler in the int68h (V86)! S9 v5 G" j$ [( y q3 y
/ ~# E. ^6 v l! x
mov ah,43h0 j3 d. |! k4 k1 ^% x1 ]) b( N
int 68h9 j1 Z7 {7 i' c* J+ Z
cmp ax,0F386h
5 {2 f1 ]" \. ?: n0 M! f jz SoftICE_Detected: }+ R3 k; Z% w. n! }4 `
# S9 T8 }4 f" [' ~% @: H* H
, ~( n4 [' t+ y7 I, V8 ` p=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
7 N) P1 o2 W2 y* c4 Z app like this:" J8 z$ K- N! ?3 V; |$ M3 d" H
+ m) i Q% l6 F9 O2 z
BPX exec_int if ax==68
8 h- O: x- r' N (function called is located at byte ptr [ebp+1Dh] and client eip is
# Y+ t! m3 ]5 d located at [ebp+48h] for 32Bit apps)
5 v8 ]6 U/ V- P6 I__________________________________________________________________________
* A# x. f: L$ A3 ?8 Z
% P6 v! T/ C1 O. t
' M C. T, ~ `4 K3 }: V+ ~! oMethod 08
8 \) K- w& D3 N, d1 ~. [% F=========3 u' k0 W- i& s( u4 r9 f' }, {( N
6 s7 G- p1 j( [ ~
It is not a method of detection of SoftICE but a possibility to crash the) B8 m2 ]6 z4 r
system by intercepting int 01h and int 03h and redirecting them to another
" x- A# b5 u( W0 j+ n, I$ s' Kroutine.% I. f5 z& q( d, R# u1 \9 B0 y% A
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points1 D# P. U* E# _' x
to the new routine to execute (hangs computer...)
! L6 |. i% E) H
8 M* E5 P. q) f: ~8 \: g mov ah, 25h! e. p! N8 Y/ P5 I
mov al, Int_Number (01h or 03h)
/ U, x: ` X7 j" Y/ R `$ Z mov dx, offset New_Int_Routine
]( B: D. N* ]& q$ W int 21h
2 E4 J4 Y+ s3 p! I1 k9 d4 s# m0 i3 J' a, h
__________________________________________________________________________
! U3 n$ l9 _& P5 B
9 t- k" w5 U1 ~. xMethod 09
. a4 ?4 Y3 |# G8 e. Z3 ?=========% B; z' i1 q3 a
}" Q3 @+ f: v' SThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only7 }: v! K Z9 F" t9 }3 y, A
performed in ring0 (VxD or a ring3 app using the VxdCall).; K# I% ]' f8 ]: u* Q7 F X8 S
The Get_DDB service is used to determine whether or not a VxD is installed; [& L0 f6 H$ R4 ^" y/ q0 L
for the specified device and returns a Device Description Block (in ecx) for+ u! d5 K, `. X' F" L7 U- ~
that device if it is installed.
4 s+ M; `* b4 |! Y& Y) \/ w4 V& M; A: K) X7 f
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
( |- M& a$ |# u- |4 f1 U mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)8 }( s- B& F/ G
VMMCall Get_DDB" J/ M5 R1 p( k4 k
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed7 w8 K- w2 D0 O# V
7 d1 t5 x0 I; O) \- kNote as well that you can easily detect this method with SoftICE:
1 l8 O4 { X: Y$ l bpx Get_DDB if ax==0202 || ax==7a5fh/ k7 F6 B' y; i$ g
/ h0 L6 \. t" q9 G1 x. A7 v, |6 g
__________________________________________________________________________
) h" T$ e+ \( U
9 v* e1 t0 U" v- u5 DMethod 102 W8 y# q& r. b2 Z2 ?6 T
=========+ U0 e+ B Z' C, \7 M2 J h4 _8 z
/ g. Z0 c; h: w4 G. g! e
=>Disable or clear breakpoints before using this feature. DO NOT trace with/ |) E8 b5 L: {/ Y
SoftICE while the option is enable!!+ R# L- C2 j/ M9 C/ N0 _0 h
2 J3 P4 A9 X" c; q" ?
This trick is very efficient:: f" I2 [9 k' m$ C) v9 Z/ [6 N
by checking the Debug Registers, you can detect if SoftICE is loaded
! R6 \% L7 R6 k# s9 a5 k(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if. H. M$ F$ w' s, r: i- n
there are some memory breakpoints set (dr0 to dr3) simply by reading their
) C% z/ G" Y4 A, C/ y4 avalue (in ring0 only). Values can be manipulated and or changed as well6 w, S9 t% P- s% u- Z0 C- {
(clearing BPMs for instance)" \, l: N! A9 s" _- Q8 d
& C& W, Z; R' ?) p2 g6 g' W! F__________________________________________________________________________) Z9 i$ R3 z4 t2 V9 ?5 f3 m0 z, @( [
' T/ x$ }$ s. j- @! G
Method 11
6 {3 i8 _5 \' t% p; Z=========% k4 B* h9 R/ z: W/ c9 V
) p1 V) K5 d. e/ J9 i6 E( i9 HThis method is most known as 'MeltICE' because it has been freely distributed# ^) v# ?! e7 P/ W
via www.winfiles.com. However it was first used by NuMega people to allow
% N% y6 v. ~! [4 U8 }! ~8 ^( d7 ~Symbol Loader to check if SoftICE was active or not (the code is located6 O/ K. x$ F4 `+ l2 [
inside nmtrans.dll).
% K& u- W* T p6 u4 o
/ L0 l3 w1 S$ JThe way it works is very simple:
: s( \( P7 W* uIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for% R" ~3 `' K" `+ P( Z' q: L* q' ~
WinNT) with the CreateFileA API.( @3 C& R" G7 Q) t1 d
& d! U% b# d, w) \
Here is a sample (checking for 'SICE'):1 o6 e; i: V; ~8 P2 t" Y+ N4 U
& j, _' ]' j( Q4 a/ Q. l, X3 uBOOL IsSoftIce95Loaded()
" g8 d. W! G' E+ d! `2 q{8 v2 C( s, |- a2 s! P
HANDLE hFile; ( R& q b p3 E' h8 I9 D7 R0 h
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,2 u! I- f+ d3 _( |* |, X
FILE_SHARE_READ | FILE_SHARE_WRITE,
* L$ s% d& C; q9 J `# O: u) P NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
+ W0 L1 L8 |9 t& M) f B6 j- U8 M if( hFile != INVALID_HANDLE_VALUE )
1 i$ B+ Q' P, M3 A6 x {
) k& |5 v; N$ E7 H CloseHandle(hFile);) a" L* |. W) E& D- Z5 A1 _- s. |
return TRUE;
/ S" C' H2 g# M# e& j. p/ s }
- \3 m% q- n9 N; }+ O0 J# B return FALSE;
, j3 Q p, J2 B7 W3 y3 z; z) M}9 N& j' Q- w; Z' d4 }. z% V( ^
: U8 P3 b& v/ {5 G W) D
Although this trick calls the CreateFileA function, don't even expect to be/ e& \' o$ G' l4 {
able to intercept it by installing a IFS hook: it will not work, no way!
. Z9 I, {% `$ n2 _- AIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
9 z* e( @7 p" x, Z, j; F" iservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
6 x. _7 |; Y' K \and then browse the DDB list until it find the VxD and its DDB_Control_Proc
: a; E) {% x/ j' V4 A- \' efield.
; C/ d2 s, |+ P7 T% p) B9 EIn fact, its purpose is not to load/unload VxDs but only to send a
Q, r" m+ P& v$ R1 TW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)9 {) E/ G* [0 Z4 y+ v: j
to the VxD Control_Dispatch proc (how the hell a shareware soft could try; v4 X2 S# b$ `8 O n y2 d
to load/unload a non-dynamically loadable driver such as SoftICE ;-).) l4 f# A( G& y! ~
If the VxD is loaded, it will always clear eax and the Carry flag to allow5 Q: R( V: Z% }! G8 L0 z% d7 p3 |* A
its handle to be opened and then, will be detected./ ]5 i. i+ P3 k; k4 y
You can check that simply by hooking Winice.exe control proc entry point
1 e0 t; o8 Q2 B( Ywhile running MeltICE.- O6 x8 Z* H1 [
( l" k! _* G4 u/ {7 j f: o! v9 M4 o
00401067: push 00402025 ; \\.\SICE* D1 z I, X0 J3 ?* @
0040106C: call CreateFileA5 B% ~ w- W$ m1 `
00401071: cmp eax,-001+ z2 Q8 B1 j: {) J: B
00401074: je 00401091! ]: V4 u; F. h. H
1 F% G' L7 ?5 y9 M- x( C. r
9 l6 @7 t( L. a* r& q. A
There could be hundreds of BPX you could use to detect this trick.
; ~" g) L; W0 Z% G1 Y8 _7 W% u-The most classical one is:
+ g- H, A3 {7 O! ]: W1 j BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
% ^+ ^7 c: \5 \ *(esp->4+4)=='NTIC'
# |# Z% [; }2 M. i" b4 a& p' e4 T
# S* _1 X$ q4 P) P4 }-The most exotic ones (could be very slooooow :-(
r7 f9 e: s I0 M! a8 x BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
4 e" k3 ]. d2 J& \8 J. e( x ;will break 3 times :-(+ S1 |, i: I: [
. k! o9 j; ~) F( n# O! U7 P
-or (a bit) faster:
& F ^( t4 Q" F4 m! ^ BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
" {& t2 ~/ q3 ~' p' Z2 \% m! K: Z4 t6 }+ N* }$ ?2 |
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
' K$ M" `1 n0 f' i- w ;will break 3 times :-(6 A. h4 `# e4 c/ u) N/ k3 b2 `2 p( R
* v! _2 {" o' T6 X) p
-Much faster:
' o5 e7 e5 y2 G, U: \ BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
# S; U, B3 H2 {
2 a1 _. r1 w( V; M. B) |3 b/ F. INote also that some programs (like AZPR3.00) use de old 16-bit _lopen
6 a1 Z: v6 a$ Mfunction to do the same job:
$ H! M9 r4 _! z$ J4 m5 s, u" |2 W3 `6 f; g# g' f/ E
push 00 ; OF_READ
1 J% k7 Q0 J9 `5 j mov eax,[00656634] ; '\\.\SICE',0
/ d5 [2 W: L- P1 I& x! ~* Q push eax
6 [5 [- L/ S( b- c7 u( z call KERNEL32!_lopen
1 t, v3 @1 j( X; K2 U e7 _: f inc eax0 O2 A0 H& g8 X1 m+ H
jnz 00650589 ; detected
. R) P1 Q3 d) y0 z; u push 00 ; OF_READ# ]$ q2 y+ D$ O; t. z9 P6 S
mov eax,[00656638] ; '\\.\SICE'
. }5 h" u1 {7 q- c1 m6 j+ N8 j push eax
% P3 G$ q" f# ^ call KERNEL32!_lopen) T" V4 N. W6 l6 x1 d
inc eax
, F& i- t* w6 X5 E% B jz 006505ae ; not detected
( @+ x- Y' l/ x0 H
. b0 @7 I; q! W; M. {
9 L; p; m _" F__________________________________________________________________________9 \. a2 K1 C: _6 e; y1 o! u
3 \6 p4 E- J6 C9 A) a' N
Method 12. n/ `# r2 F( O3 H3 @/ ]
=========
' a: C7 ~: F+ w \; r' x4 m1 H
/ o* f! I' N e4 O, O$ GThis trick is similar to int41h/4fh Debugger installation check (code 05
; x' E0 G* G2 r8 t' \) i5 Z& 06) but very limited because it's only available for Win95/98 (not NT)6 A( g2 r5 N% S
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.' [0 c& A* O& J. |6 d1 |
( a! N" D1 B+ x0 D B, i! G
push 0000004fh ; function 4fh$ L% Q6 x- u9 O3 \; a6 v
push 002a002ah ; high word specifies which VxD (VWIN32)
( ^) k& M# W0 b" B N ; low word specifies which service
( C* Z {/ E( [3 p! K- n7 X. l (VWIN32_Int41Dispatch)
/ b5 U; X- y2 q3 l call Kernel32!ORD_001 ; VxdCall6 ~2 i/ i F" k, V# h* C0 c
cmp ax, 0f386h ; magic number returned by system debuggers i% c0 H8 S. X/ ?0 U
jz SoftICE_detected; m5 p9 t% x6 |; U( u& Y" D4 o
6 V: M! p& A' z+ T! l9 m M
Here again, several ways to detect it:# Z4 _3 L5 w X& x" |8 o# u2 \0 ~
4 v# S) N" b- d% Q( G BPINT 41 if ax==4f4 ~; M: T) B @' d
4 l! b$ B# Y' z! p BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
) l+ a0 ~8 r" L4 i r# t& E$ l, u. b; n: J
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
3 e9 v* O( _) h' D) q+ {/ V* k
* L0 n8 E& n4 ?' Q# A r BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
! H) l) s: W% Z) `
8 {+ K3 e+ ?7 Z__________________________________________________________________________7 Z) A+ B8 ]) K" I! U/ G
) T7 ^; b1 k! L4 j, k( z
Method 132 J0 k8 Y4 v2 x9 k
=========* x; Q8 K0 d1 ]" S
( J, ?( L+ i7 H9 H" w/ m) n
Not a real method of detection, but a good way to know if SoftICE is$ v' g9 Z6 a( F- O( D' h8 y
installed on a computer and to locate its installation directory.
" |3 m, ^1 h' A4 @It is used by few softs which access the following registry keys (usually #2) :
/ Y4 W; q# ~ i9 D& Y) w: i! i" Q( {/ h
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion& ^/ F3 E, H5 [. I3 C
\Uninstall\SoftICE: Q( W& s+ m" y
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
1 G" a/ y) `7 F-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion2 Z# L5 W. q1 w6 T7 a
\App Paths\Loader32.Exe ^( o! i" E, l% G/ i, b
) B( j3 v! o9 K1 d( h
% S0 Z* Z' D+ h9 V- z" X" XNote that some nasty apps could then erase all files from SoftICE directory
+ ?/ A/ I% B9 T& x$ i6 d: ?7 D$ ~, C$ z; n: p(I faced that once :-(
. h- J% q! X. x6 ^9 R4 \$ [6 S
: D9 ^+ u% u6 p% N! u4 KUseful breakpoint to detect it:
) j1 T: o, D3 z' w& l; U5 B- @* h! }- z+ S/ F5 W
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'4 W; e" a2 p8 n" r2 x
( O$ t! G# ]8 Y; x% C+ \
__________________________________________________________________________
8 a9 W' t, k9 H5 }) R I7 G2 }! k% Q5 D' @7 c
' X8 F+ m; x, C& X$ bMethod 14 ' P% {2 q6 s- \1 @1 V q9 }
=========
1 J: P8 m4 M$ l& A0 t+ O6 L1 ^6 A$ _# q5 R [
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose% k3 t A) v# a, ~
is to determines whether a debugger is running on your system (ring0 only).
j& X) L6 i# |: N' M; s/ U/ C8 J5 U" D# R7 d
VMMCall Test_Debug_Installed5 P' n ^! y0 ], C1 R Y6 F% j+ z( d
je not_installed
5 n/ J% q" i" S3 j+ B6 x: z( k {% m8 C! @+ i
This service just checks a flag.
' j, r9 p, n- O) P5 Z6 f</PRE></TD></TR></TBODY></TABLE> |