<TABLE width=500>
6 i3 H) \- I8 H. x; E<TBODY>- e; K2 A! t4 | b
<TR>5 ^) ?- t2 A1 ?4 a' x" u: Z2 F/ h
<TD><PRE>Method 01
' z5 L% ^1 n; s=========1 _! M% ^ L+ O6 q
6 c' y6 g0 i- k: LThis method of detection of SoftICE (as well as the following one) is% C6 H6 `! \% I1 ]4 a- j! x
used by the majority of packers/encryptors found on Internet. j& T! [% X1 s. K+ E
It seeks the signature of BoundsChecker in SoftICE
+ W* \; Z$ |$ M! I$ d8 F& S* F
) i5 I# g' j( G% b$ b5 E2 | mov ebp, 04243484Bh ; 'BCHK') g0 d3 O( \* o
mov ax, 04h
0 G5 [9 g$ y( k6 G. o4 a4 ?9 S int 3
# Z. z* E, }8 a cmp al,4
& G& R2 I+ ^9 o8 E" Z jnz SoftICE_Detected
! S5 v# Q+ \: N6 U. b* i0 A/ y2 |0 |& _ h- c: l0 ], V; X! d5 Z
___________________________________________________________________________
6 B# y1 [$ z' U: @- ?! Z
6 U. x5 O3 r z* PMethod 02
2 B4 H* g" p& q% P, H; p4 G# x$ L=========
0 n* b( u# w" W
- E* n! z! n8 s6 V8 qStill a method very much used (perhaps the most frequent one). It is used$ D I3 t; T6 Q( o; R$ p
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
3 a1 Q8 T9 f9 ^! _' H1 uor execute SoftICE commands...7 N5 L/ D& u( E+ d' x4 d
It is also used to crash SoftICE and to force it to execute any commands' ^4 i: V9 v" P# r
(HBOOT...) :-(( / l( H* R$ W R# m/ C$ z
S" S S; n/ ?, DHere is a quick description: I5 [4 b! e2 E# T
-AX = 0910h (Display string in SIce windows)
5 r, ?, G y% ?-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
1 Z" ^( B: c4 H. N$ {-AX = 0912h (Get breakpoint infos)
# \4 `' m4 v* `-AX = 0913h (Set Sice breakpoints)
1 G* C% q! D9 L* N1 j+ U+ ^5 z: v( O-AX = 0914h (Remove SIce breakoints). C0 }* ~( d3 p7 {, @# z
( x+ |# h; w- Y
Each time you'll meet this trick, you'll see:# _$ M2 v3 d% T5 Y
-SI = 4647h
. t; o. Q& \+ \3 H0 ^% f! F-DI = 4A4Dh
# t' q' ] N2 a1 q+ V5 A( I% ^# E1 XWhich are the 'magic values' used by SoftIce.! P, u+ F! Z [# I! i
For more informations, see "Ralf Brown Interrupt list" chapter int 03h./ `( t$ f' z8 w7 _* r5 w+ i' h$ P% k
6 X' g. x1 K8 k; V, ]
Here is one example from the file "Haspinst.exe" which is the dongle HASP: m2 q: ^# v; d: X- W2 {
Envelope utility use to protect DOS applications:
9 b1 q' K1 `7 j& A5 o6 d
/ C; ^ i% L4 o9 p2 |2 G t4 J+ M' b! V0 H
4C19:0095 MOV AX,0911 ; execute command.* H/ x' J% l& { }7 f+ ^) d+ e* c
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).7 T; Z- Z4 l! ]$ ?
4C19:009A MOV SI,4647 ; 1st magic value.
, h5 G! i/ P3 l4C19:009D MOV DI,4A4D ; 2nd magic value.
5 }$ j7 w# g: C" M6 O0 R) Y4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
: k/ x) ~: `1 ^4 [4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute1 {# D/ S% ?" ]# T) D
4C19:00A4 INC CX
4 E8 ~4 y! C1 z4 t) {4C19:00A5 CMP CX,06 ; Repeat 6 times to execute0 w+ I& |4 D8 @
4C19:00A8 JB 0095 ; 6 different commands.0 S) `8 R( D) S% F! j8 V; Y8 N* R
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
$ U# ^% Y: u/ E$ `+ ~' u4C19:00AD MOV BX,SP ; Good_Guy go ahead :)4 f5 |4 t' q& o0 y' a* e0 }& O
% @3 a: U- y2 W( G' O0 FThe program will execute 6 different SIce commands located at ds:dx, which
h) P& `- Y. F# N3 ~. k9 t5 `are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.2 _1 J4 ~1 E! W5 B: C5 q
6 L- I& _' u& o3 w- W
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
: M' ]: |, {& ^) L___________________________________________________________________________
! q" k7 P" a+ C* C( R2 e- n1 k* I" W7 v# M
/ w% ]- K6 d: X
Method 03: C% |; n1 _6 R- G/ ~/ u
=========
6 A4 O7 u& n7 ~, L
# W5 P8 C* ~" _8 Z' N9 a0 ?5 wLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h. k! ]) l& r; o" a$ i9 c: _
(API Get entry point), N9 d4 s9 @+ |% a/ @+ ?
2 T; @, i7 q% }' S5 X/ i
: y* ]7 c9 S& B' W+ B+ s4 H xor di,di
9 ]/ }6 ]2 L Y9 q" Y/ | mov es,di
; B' T$ O' v- C0 q! ~ mov ax, 1684h
' X; V& w# i4 B/ C mov bx, 0202h ; VxD ID of winice
# l$ M4 {$ A6 n. z: f7 z& G int 2Fh2 i, a( a' T; j- ?
mov ax, es ; ES:DI -> VxD API entry point
$ W0 g( Q- G5 C) _( Z, { add ax, di: t" _; D- T! {' r* w" N
test ax,ax
& {& } i2 a+ j/ v' g% ~ S: W jnz SoftICE_Detected: w# Q! |" w7 M8 N% F4 D
' U" z; N+ e! U___________________________________________________________________________
: a4 H O/ h, D5 C, s. d# L% r: e2 d. S: w m- q) k: B C4 T# }8 L
Method 04
U7 a3 F5 W6 i, _2 m l=========) ~' N/ U! D6 F* Q: D! @
. T2 R. \0 B, n! R6 M5 J& x+ n, P9 G
Method identical to the preceding one except that it seeks the ID of SoftICE
% s2 b* w) w# U+ PGFX VxD.
7 h9 y; m- H; n4 i1 P% p) [& Q/ K
4 ~" w+ I$ x( X xor di,di6 w# Y1 V( z, e @! b. n' a- c! k
mov es,di
3 ], l- W* b1 [3 P% |/ Z) M mov ax, 1684h
7 H5 t: C# l8 g) ~2 h mov bx, 7a5Fh ; VxD ID of SIWVID, ?9 p, J6 N/ T' W
int 2fh6 K+ r% A7 B! {( ^! A( P+ M
mov ax, es ; ES:DI -> VxD API entry point, H* p0 f* b: ?) p& N
add ax, di
c0 Z$ y2 @8 h$ q. F( o% c test ax,ax
5 f. P5 s& W' O6 K jnz SoftICE_Detected
9 g( L2 k9 o3 u, e, n* z' v7 m( p4 X9 M& @" `$ d5 ~: P% \
__________________________________________________________________________1 A }' p3 {' y- |# |/ v
: O m( a4 n- u2 i$ t/ `% }2 P. |
- p& T# P: f! |% O( o
Method 05
( y2 I& U; [1 R7 G' n9 d" _=========
: v, b1 b7 k) i/ @0 L D" Y6 k p! i! G7 X0 o- I
Method seeking the 'magic number' 0F386h returned (in ax) by all system1 h; L! f2 P) T& J
debugger. It calls the int 41h, function 4Fh.' p5 F2 ?- s- A0 W9 D! \( N; p
There are several alternatives.
" h) j) y$ x$ v9 Y1 \+ u' Y4 l) A7 L+ q& I
The following one is the simplest:, \7 R1 x) r: f! }* G' r
0 o% \( q* P: e/ l) Q" E3 ~' ]
mov ax,4fh3 m' \7 v& r7 c, J7 d
int 41h2 d) {" a2 j& P
cmp ax, 0F386
( E( k" U# N3 I5 E6 m; [ T+ M2 {9 y jz SoftICE_detected
, n) q' G, ~$ d- \; @1 [: M
+ d9 N* ?' L$ V4 ^( B# z9 E7 Q- P: c7 _
Next method as well as the following one are 2 examples from Stone's o# F! r( i8 f2 w- C# o( Z. S
"stn-wid.zip" (www.cracking.net):
1 [, O- j: \ i* C+ o/ E" `3 M+ q. A6 Y! ?. k: ]
mov bx, cs
* ?5 ~( O% k E; U1 L lea dx, int41handler2
7 s' u4 Y; y0 n" v: {+ }# K* J xchg dx, es:[41h*4]" E6 e, t$ F; ^' j! W5 s" E
xchg bx, es:[41h*4+2]
2 D9 k7 x* L; R7 ^% G# N* p mov ax,4fh6 H0 y" v8 W0 k* [* @
int 41h
/ `6 _: M/ ]& E3 W* E3 l( X xchg dx, es:[41h*4]) f: e T, c& c
xchg bx, es:[41h*4+2]
( t2 m; M" L/ W4 ^, M. Q: b- l cmp ax, 0f386h
2 c7 H, K( k3 ^# F/ I% \ jz SoftICE_detected
3 B/ N) Z$ t& C7 p% j* b8 X% H/ Q, ^9 G" ?
int41handler2 PROC4 d3 d; Q8 t5 b! d0 V
iret
8 V! [& z# E% w1 `4 J- I- N0 Cint41handler2 ENDP
( W# e, C6 C. _1 J
6 p8 s _$ y- j+ }. @' C4 C4 J4 T+ A, a3 m- [: \* c$ @
_________________________________________________________________________
$ \9 O7 B- r3 B' j- @ [* D3 R, j8 a9 L
' z( L1 H" i8 e" mMethod 066 [& Z# D! V) x# j) U7 L
=========1 j- T% N" I& O
: E0 _9 u' T: C* z9 ^- S
) z. G: m! I: t; D
2nd method similar to the preceding one but more difficult to detect:5 n2 j% e' A' t' d1 X
5 F4 O: s/ x3 ?: ~" U
8 w( k; z0 Y7 V f2 U1 `# l7 r
int41handler PROC
! O: r& D3 }0 @ mov cl,al1 u/ g, n8 k7 B& `; E T- s
iret
3 R- M* e9 S+ {/ Sint41handler ENDP
. s& B( | Q2 O [$ |
0 C! {5 Z+ S$ ^9 [+ x. F, Z
5 f0 H! _! T5 j1 ]% _ xor ax,ax
; a u2 g; Z$ F% Y" b1 Q: A, A, o K mov es,ax
# G$ ?. Y E. r: D; ~ mov bx, cs
% O- z7 `1 ~0 A lea dx, int41handler
; h" j9 E( L) c* K" U& Z6 E xchg dx, es:[41h*4]0 e* K; b5 l5 g2 z' `2 Q
xchg bx, es:[41h*4+2]) R; Z4 W/ t- m/ W" j
in al, 40h- _+ I, |4 M, c0 w. d/ R% n5 S
xor cx,cx
1 u7 G6 \7 I' K* U4 k/ B int 41h
2 J: U+ N4 u9 G3 \- O+ G/ C1 x xchg dx, es:[41h*4]
; d( Y& e b1 _$ A" e6 k xchg bx, es:[41h*4+2]
# {+ m6 X" [% Q+ Z cmp cl,al9 ]/ C+ P* N# ?4 {6 V! e/ |
jnz SoftICE_detected1 Y ~& ]2 e; i0 f' R' J+ A( f# |" C
+ u5 F9 J# g f_________________________________________________________________________! `* {6 c3 ~7 ~, N) d2 e1 E
% \1 r9 H/ A Y5 f# i% U% y. a
Method 07
* x' @7 R- x9 i5 s. b5 [=========
- k2 ?& e# o+ b' o* a' _ i- B- l; s4 x
Method of detection of the WinICE handler in the int68h (V86)
+ @' g% f( A# s6 @( q( R7 K( T" N# q3 I1 F
mov ah,43h$ ~2 x$ E j3 }) N9 d
int 68h
5 T( l, {3 H+ R4 h; Z$ G/ I cmp ax,0F386h
5 u8 H' R) w4 ^, Q& z jz SoftICE_Detected |1 o8 Z$ m( e
8 @* Z% \5 O' s2 N3 T
$ g2 }/ ?% ]( s# v& o=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit1 N' }# e$ P- F" y, P$ S- j
app like this:; E$ v" X* f7 X5 r+ @, ^, e9 Q
8 C4 F9 [: B& y BPX exec_int if ax==68
" {; D5 w9 f( E5 v; l (function called is located at byte ptr [ebp+1Dh] and client eip is7 x/ |! `2 p$ Y* r" Q6 t) b; u3 W; k
located at [ebp+48h] for 32Bit apps)- _4 `8 w" m- w$ x) r6 c
__________________________________________________________________________
( b8 c9 E5 |% A" X% z' S% N$ T" e8 |
5 o- `" C4 o4 p5 {1 @8 gMethod 08) ]" @9 r+ V$ W" E- f* _6 _
=========; @8 s! d! o0 I z
1 ^7 u/ L0 b6 TIt is not a method of detection of SoftICE but a possibility to crash the
, T. j- g- S2 e" `system by intercepting int 01h and int 03h and redirecting them to another+ y% {" p; |3 \- b0 R
routine.0 s) O. G; T5 Q& H8 Q" u$ v
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points( U7 C" Q5 i' b. X
to the new routine to execute (hangs computer...)
7 u/ Y% |( g; j+ Z% A! ^7 ?
. h1 h9 J0 F7 b7 |$ _ mov ah, 25h
! N2 W d) {- Q: E; \' [& q% l mov al, Int_Number (01h or 03h)$ v' T2 F4 A/ V
mov dx, offset New_Int_Routine0 V7 e6 u% L8 T; ?/ @' q
int 21h
1 f9 Y' q- R: u1 U a5 O! A( f, ]3 E, n2 P
__________________________________________________________________________
5 Y& r6 n) |6 K2 {% ^. W6 o1 J8 |& r% K$ e
Method 09
8 v; Q4 I% U1 }( ~+ O# q% z=========
! E6 Y/ u3 p# ^8 H9 `% b0 w7 a2 g3 [4 I4 q
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only/ N) Y, L/ c$ M/ `: m
performed in ring0 (VxD or a ring3 app using the VxdCall).2 y5 @3 I1 L) o# g$ E) F5 a! d
The Get_DDB service is used to determine whether or not a VxD is installed
6 s' u1 R& w& G& r2 {for the specified device and returns a Device Description Block (in ecx) for
+ C6 j- Z) x+ |/ k9 k; U3 }that device if it is installed." ~) F" v7 d' { P: b
. }) |/ M8 p# l; w
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
9 N0 H# k( G1 K& P, g mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
" R% H- E* C/ T, i6 R) | VMMCall Get_DDB' C( M: O% o) K' Z% _& T8 w
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
( |/ ^' D. N0 G
) B( J% _0 K& oNote as well that you can easily detect this method with SoftICE: c) N. D J4 g5 ?
bpx Get_DDB if ax==0202 || ax==7a5fh
9 W1 P) B% d" [% E8 l2 Q2 s) U& I. l/ j3 ~, e
__________________________________________________________________________0 k. j, t4 Z0 [
! \0 J0 S" P- S, W
Method 10
7 Y, E% i, H& @! R* I=========
6 ?5 f' t R9 T$ G2 L a! l V: N& H6 P9 P
=>Disable or clear breakpoints before using this feature. DO NOT trace with; j: x1 M }6 ?( z4 h
SoftICE while the option is enable!!# K7 q/ u! S8 d# n/ Z' u
0 p: x7 n' S! A+ L& R, s! K5 iThis trick is very efficient:
% G/ R* O0 I) e' uby checking the Debug Registers, you can detect if SoftICE is loaded) B' B5 c5 |& p5 l& u! C
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if; T. R Y6 ?* K3 O
there are some memory breakpoints set (dr0 to dr3) simply by reading their% _$ Q f* ?! J5 q1 h& {0 @3 Y
value (in ring0 only). Values can be manipulated and or changed as well9 t9 y) t# I5 A. _
(clearing BPMs for instance)' P6 ~% u5 k+ u# a5 p: f
0 l2 o/ y$ \) V__________________________________________________________________________8 [8 O2 ~. C% O7 {7 a( y3 Y
: w8 O! S$ A0 F0 nMethod 116 ]" L* I+ K7 j- U
=========
! S: a; |2 {7 n) T3 r6 X
8 i) h h2 C4 V8 a' f( i6 k6 B- ^/ [This method is most known as 'MeltICE' because it has been freely distributed
% d: W! y! Q: K+ hvia www.winfiles.com. However it was first used by NuMega people to allow7 m4 I C l2 t! [0 V4 ^9 L- U
Symbol Loader to check if SoftICE was active or not (the code is located7 ]3 M+ y( B N% u. j
inside nmtrans.dll).
# |9 S' S! z0 l* @( S
$ ?+ W* q( S7 A: A% ]The way it works is very simple:
; V. ^7 N, O# g3 I# f: T) oIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for: }& J( v q& F+ \/ n! i
WinNT) with the CreateFileA API." `" t% t# \* ~6 Y! t- `$ a
: a8 t$ {/ v; q: Q& ?' K" W
Here is a sample (checking for 'SICE'):
$ v5 G/ B" K; ~2 ?0 q( o% y0 l. B* e8 H2 {) a
BOOL IsSoftIce95Loaded()
# J! O' _/ p; K0 s9 @' S{
/ _. M0 x, w/ ~$ ^1 z6 M |4 m HANDLE hFile; O7 ~* c6 C8 A+ L1 h
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,0 _: r/ S* z" C4 v+ c; @3 x
FILE_SHARE_READ | FILE_SHARE_WRITE,! O s& E5 l4 ~: u
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
( _% F- p& i6 q% b; C9 l0 ^ if( hFile != INVALID_HANDLE_VALUE )
# G ?' ~6 i x9 i% Y& y {2 _7 v L% Z# X1 Z2 V2 K% Z
CloseHandle(hFile);
/ k' s; j* Z. E7 ~' B# B return TRUE;, I0 A6 m; ~( \; J
}
e- |9 b: r! g* k m8 m! F return FALSE;5 {+ g$ P2 Z. e
}* i6 l5 M3 p6 y0 B7 i0 c3 b
, G$ Z2 U! X/ x6 v' K# ~5 m0 _Although this trick calls the CreateFileA function, don't even expect to be
' F0 U, I( c; V) f: X2 pable to intercept it by installing a IFS hook: it will not work, no way!/ S% d: s' ~6 P# U3 x5 k
In fact, after the call to CreateFileA it will get through VWIN32 0x001F% W2 c5 o8 Z% ]! W. ~! _
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)0 P- I! T& y6 |' e% v* v5 o! ]
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
5 ~( b1 T3 N7 d! x6 y1 v) wfield., w! ~$ c: \/ U/ m7 D0 M
In fact, its purpose is not to load/unload VxDs but only to send a 5 U* a# c2 ~5 W, p! w/ E- b4 L
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
h! }9 K# x" S& yto the VxD Control_Dispatch proc (how the hell a shareware soft could try4 ]8 n6 V' p& k) x& r0 l
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
6 |0 Q& Z( ~- u7 V3 I) L UIf the VxD is loaded, it will always clear eax and the Carry flag to allow' L3 g- L2 ]! i) [: T0 m" O6 K1 s6 y
its handle to be opened and then, will be detected.
/ [; o$ j" { [" J0 U$ @/ XYou can check that simply by hooking Winice.exe control proc entry point
. d2 ^7 M% }* y* L, ]4 nwhile running MeltICE.; Z" y7 G1 w4 n
3 X5 ^0 K- V- G* C* K
. r6 g# n/ o; L/ C5 f: p; H) q6 B; A
00401067: push 00402025 ; \\.\SICE
, W2 {' n) O2 o8 _- N- o 0040106C: call CreateFileA
% U" K; V( D, g" T4 p; `6 t 00401071: cmp eax,-0015 ^8 R& Q3 ^1 W" A7 n) i q& N
00401074: je 00401091/ }1 h9 {, Z$ d* U( h
9 H, `. g$ `0 D2 Z0 x, s
: M( o5 ]8 o( l! d( ~
There could be hundreds of BPX you could use to detect this trick.8 S4 R, G1 \2 [% ~+ c1 K1 v- j
-The most classical one is:: K; A5 c/ i! _7 ^5 o' ~* S
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||- m6 T H8 ~* q1 r9 o
*(esp->4+4)=='NTIC') J7 e) R( z: I5 _9 Q
' i' L/ k% E6 H+ m-The most exotic ones (could be very slooooow :-(" r$ v6 H# B1 a$ X v# S
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
: T$ D1 h) ~! b/ w. }' M' e+ C ;will break 3 times :-(% A, g* r' p. X. j
3 O/ W+ W6 X; ^% J$ W2 t-or (a bit) faster:
% T, f" c) ]1 |& R' U/ L BPINT 30 if (*edi=='SICE' || *edi=='SIWV')+ e7 `1 e' B+ ]" l2 v" E6 w8 W$ W
& c( K. N0 O* c) h6 X- t
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
2 u& A& Q+ h2 |* i# q, s% O ;will break 3 times :-( f, P) @# u5 k* d% ~/ S
( [6 a; |, U; Y% H& C8 X-Much faster:
" k" N! S2 y* r4 p8 [8 E BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'/ q, {, G, v9 |
0 [/ Y/ E5 M- r2 O3 H
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
- t( E, \, A. bfunction to do the same job:
" V* W4 a6 w( v* Y0 a; Z) g; M% t! q# N; j- W
push 00 ; OF_READ
( C8 B' F5 T! E5 p& n mov eax,[00656634] ; '\\.\SICE',0
; t9 C# B% _# m( h( O( V+ _ push eax& b0 g9 p) n" u3 d& S0 C9 @! ]% q
call KERNEL32!_lopen
6 l9 A% ?4 V t inc eax
$ l: x& u/ T6 }3 Z& b/ Y jnz 00650589 ; detected
7 X6 Z$ l; i L4 Q6 X push 00 ; OF_READ
* V/ N+ Z- d$ V% V mov eax,[00656638] ; '\\.\SICE'
: u* I \. ? M: Y* Z$ P4 x* T push eax
* a' B2 z1 Z q5 @0 G1 x, b call KERNEL32!_lopen# E9 e& n$ g; F/ g
inc eax C: h$ V5 t! {$ \4 K+ @
jz 006505ae ; not detected
7 Y; c4 y% e% q9 |
/ x9 w _; c4 F# ?; Q3 Y+ ]8 }8 B% Y
; f5 L9 N. h5 H( `. P' @, u8 x# r__________________________________________________________________________
1 t5 ~% E( g; i8 ?7 G+ `
1 Z' \, O: }/ U% gMethod 12
) `9 X" u( O1 ?=========
' Z# h! @ K4 {" i. C. C% H
" n/ S$ e( Y7 | x. b, oThis trick is similar to int41h/4fh Debugger installation check (code 059 }9 T" C# O- K/ F" T# U& t
& 06) but very limited because it's only available for Win95/98 (not NT). P2 i7 f4 ^7 Y# y5 t
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
* T! O% @' F& ~" X- s8 O. x/ L! b' C" r6 T) C+ @ x# k
push 0000004fh ; function 4fh
$ T. r. D( O' U( N( H push 002a002ah ; high word specifies which VxD (VWIN32)& {8 T- v: s; ]$ ?
; low word specifies which service
$ ~- d" G" H1 r3 P (VWIN32_Int41Dispatch)
i. a1 g) g8 }. m+ T* x [ call Kernel32!ORD_001 ; VxdCall4 M V: @- f3 ^" B+ _; M' }0 m
cmp ax, 0f386h ; magic number returned by system debuggers
/ z: h- b9 A, r* y jz SoftICE_detected
# H, I) m" n& f5 D' c) g3 X( Y# W
' x6 G& J7 `. aHere again, several ways to detect it:
! ?- C8 L, u4 S3 @" o$ G
8 J9 b7 N, y# ~6 ^; n% l0 c BPINT 41 if ax==4f
! |) y* q+ d# L: @) [# h5 ]. Z' i5 D( e1 V- m6 o$ e4 a
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
7 d; K8 R( l A# d9 Q! U
$ [, b Z$ M k) V' e. R: A BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
: t7 s6 U3 s8 ?3 N X( X6 R' K4 ]2 K( Y
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!! w* X6 c# o0 ?) g0 B8 v4 x
/ }3 @5 b* c% d: `2 `$ Y* V7 u
__________________________________________________________________________
+ i& L/ H4 t% ^. f) L# b7 u
) n" l2 C$ |% |' o% z! ]Method 134 w9 T3 b- @( q! P0 U/ x& `: c
=========% I* \6 N0 X# W& [" y8 i
# o% H$ j! M; i) U1 |8 K/ ~- `
Not a real method of detection, but a good way to know if SoftICE is
( |2 e4 q" j W; f/ X& L* g' jinstalled on a computer and to locate its installation directory.
7 c+ P/ [3 u! r6 Z% K* J9 CIt is used by few softs which access the following registry keys (usually #2) :0 _6 b; l, `! U9 A, {; J
: F4 r5 g4 r! ^-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
, e5 F m+ Y, _: U* }1 u# T\Uninstall\SoftICE
1 A7 r& r, x8 ] E0 x3 a-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
1 t6 R! W% d! ^6 Y-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
3 _9 r4 g% y6 t1 ~. @/ R\App Paths\Loader32.Exe
: E% W1 V6 i0 a2 G- V# U; O
& ^3 F8 `6 v5 e* R! a2 {+ t5 n0 g- n0 { a) `2 G
Note that some nasty apps could then erase all files from SoftICE directory
9 y8 g6 n h* J8 p3 \( o' G(I faced that once :-(
0 t5 t0 B: e j, ?" \2 ^6 h, J4 P- V( N
+ M) h+ s5 U5 \' F. [( K$ sUseful breakpoint to detect it:9 k* {( b3 L- e% Q9 Z
( D; d% w6 x B3 K/ _. |
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
8 i2 w/ b& ^& G9 r! Q5 p* \- c0 l7 `3 J% M! l$ S, F
__________________________________________________________________________
9 o8 n7 L4 o7 A# T/ K# Q% c7 z6 a/ ?) E
8 Z/ I, ?( @2 H$ h% ]Method 14
& X/ q/ h0 t6 ?! l=========: U! V z' l; L4 R" M, G
& X5 w% [9 M6 T4 `+ n5 r+ ]% ^A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
# U* f! G' H, G: r: cis to determines whether a debugger is running on your system (ring0 only).2 o: l0 q1 k' O0 C
, S& w7 B: }2 P+ j/ P VMMCall Test_Debug_Installed
% @; P5 K- P2 @2 r# }5 I! c je not_installed' c2 B |9 p$ o! h- x& a8 M
6 S8 C& j$ J0 R5 Z% {
This service just checks a flag.6 m6 m9 _! {- c8 e+ F$ N9 n
</PRE></TD></TR></TBODY></TABLE> |