<TABLE width=500>
1 S, }/ W5 X' N9 t<TBODY>
$ R* T- Z: n; ^5 Z2 I<TR> ?' s: P$ i7 ~2 e
<TD><PRE>Method 01
+ L9 q. c* ~/ [& ~6 I$ y2 o* b=========
* N5 U" H. g& ]* b; p1 b' v. e4 m, u% K
This method of detection of SoftICE (as well as the following one) is, M4 Y8 v( U; a9 a1 |. U
used by the majority of packers/encryptors found on Internet.% e/ |! ]$ s2 d% u3 T; z/ B
It seeks the signature of BoundsChecker in SoftICE9 {" Z, f* ~, v: h
6 u9 s( c9 k7 `. E0 ]! I
mov ebp, 04243484Bh ; 'BCHK'& n: G# R/ Q# d% }
mov ax, 04h
1 Z, P4 f) f- @% H7 Z, x int 3
, }, [- C' U8 Q cmp al,4$ q; Q1 m0 M0 L# F, m4 c4 @! l
jnz SoftICE_Detected
) V! B$ c' o8 K' L* b
9 ^5 p/ Z) g1 ~* p___________________________________________________________________________
# A# j+ ~3 m1 x P ]/ N4 M* v: p( f
Method 02
& J2 \' W, g7 [& E) x=========5 _/ C+ O2 M: R" K/ z. I2 n
! D6 V- V9 }( h9 S
Still a method very much used (perhaps the most frequent one). It is used: k6 X" M1 N0 S( S" d- w n
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,4 K' J& X: C8 Z T o$ b3 T4 d3 O
or execute SoftICE commands..., |2 M3 h& k% ?9 h# p
It is also used to crash SoftICE and to force it to execute any commands0 d6 K/ Q! C- V1 I+ K& B, K' W
(HBOOT...) :-(( 2 Y: K! d% i; ^$ |
# L& J# A! F8 \4 B
Here is a quick description:' K: Y& ]' _% `0 p, X9 T' @
-AX = 0910h (Display string in SIce windows)! Q# {8 M" `+ ^) T5 a1 G
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)4 w3 }1 F7 w: D1 O" W- h: v
-AX = 0912h (Get breakpoint infos)
: k! \7 k( O1 K1 n9 k% H `( ~, V-AX = 0913h (Set Sice breakpoints)% W4 W5 a, J5 k+ n# n5 a
-AX = 0914h (Remove SIce breakoints)
1 l$ n, b, ]6 d1 I3 c' U9 J
2 ` f. L+ p" N EEach time you'll meet this trick, you'll see:/ j. v" X& v3 k& W8 b1 d5 e
-SI = 4647h
1 b" n7 [* v- s |* k-DI = 4A4Dh0 `+ x: e* S. o5 M e
Which are the 'magic values' used by SoftIce.
, O y% w5 `3 MFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
: D# B, _! y, L3 Q- I5 ~6 P( T8 ~/ E- c
Here is one example from the file "Haspinst.exe" which is the dongle HASP Z; z2 T5 ^3 ~: F! {
Envelope utility use to protect DOS applications: b) z7 e$ g t" t, z/ M
, _$ D, G/ c/ a7 ]3 o. M% F( j" y# K
* }4 x1 b# Q2 G
4C19:0095 MOV AX,0911 ; execute command.
; N/ R+ m" ?8 l$ i5 H. r4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).( U$ @8 O. L8 R5 x
4C19:009A MOV SI,4647 ; 1st magic value.
& e: `5 q' s: e+ Z1 h N. n- C4C19:009D MOV DI,4A4D ; 2nd magic value.
. Z% T! n- Q& Y1 ]8 B, F$ Y4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
( U5 m* L' u: L; e/ I7 S4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
! q* {5 o) e# ^: t7 t1 w4C19:00A4 INC CX
" `( L. T& ~. O3 e1 y1 \4C19:00A5 CMP CX,06 ; Repeat 6 times to execute( A1 w8 V$ K1 \# N$ D
4C19:00A8 JB 0095 ; 6 different commands.. U2 C4 f" H& q* x0 W! @ B
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
3 W: x' S7 t! \# t4C19:00AD MOV BX,SP ; Good_Guy go ahead :)' @0 k1 L% Y& ?; L
: A& b2 V3 R$ \" N& z+ q3 h! n* w
The program will execute 6 different SIce commands located at ds:dx, which0 A, `. m* ^* N% |. V
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.7 b- Y% U9 i# {' p( v# B
0 }& @7 w# N7 E3 {5 G* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
/ j* N$ ~ T# J# V; C: Q. r: N1 O___________________________________________________________________________
; @$ O' g. e, n9 q E- [1 I) `7 l6 m
1 ~( E- A8 k4 B( @, h. A! M
Method 03
' s+ `, t% v" [( }=========
# x* {' H0 J& @% V u* f. ^5 @
6 ^! t* J! ]0 P* ^, x5 n6 F; s1 { R4 `Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
. X% Y; O9 B( S: ^! C(API Get entry point)& T$ i$ z6 U5 x- R% x
|" ]2 v! O1 _. h* H
q% R# D- L5 j xor di,di
: J; v ]5 m# H7 d+ S: \! O- |7 w mov es,di
) a {( p4 D4 y mov ax, 1684h
+ w: J) d( {" f% H4 _" ?: U mov bx, 0202h ; VxD ID of winice
6 _7 a. Z$ C" M int 2Fh1 f: \, {; O9 n4 w9 M: }1 z1 I
mov ax, es ; ES:DI -> VxD API entry point
) N9 h2 e0 I+ N) e% h add ax, di
. N) x2 Z' f- g) z. | X: ? test ax,ax
( j9 f+ R5 ]5 B" C# K( Z+ @) L jnz SoftICE_Detected7 |* ^! V* ^4 |4 {+ U
1 }2 K( h, J5 _3 X3 y) B. T
___________________________________________________________________________% s' N' c, Q3 Q) l9 s
w" Z* k( _* eMethod 04( r d7 D6 x5 a6 B ?
=========
- b' f; _( Y' }6 n( _
) q- p& @) h, d: { G6 l q9 \- \Method identical to the preceding one except that it seeks the ID of SoftICE h4 K/ e4 N7 w5 k: G
GFX VxD.
6 {$ o) R8 k& O& m* b% b7 c! f) b5 m& b+ [
xor di,di4 f) `" p. a4 n p7 M
mov es,di% |' e2 I3 B! {' K4 ]+ H* |/ [
mov ax, 1684h
' @* h# v$ w; C( h! l mov bx, 7a5Fh ; VxD ID of SIWVID
; e- W- e6 a" ? int 2fh
7 n: B% u* H, Y mov ax, es ; ES:DI -> VxD API entry point
8 p1 T T( H6 G+ B4 V8 @2 d add ax, di
/ S: y# {" |- C. \5 ^6 K$ L3 Q2 Y! m test ax,ax- `3 G' w6 \6 I2 E+ ]4 d$ N
jnz SoftICE_Detected$ U; b3 G) @: G8 R
+ L4 U8 |5 y/ W; _8 u/ T1 J3 d__________________________________________________________________________
: M/ B' T% r& b$ o) s; m; Q. f# B/ ^ q/ A
+ A2 D$ M( m9 K( |( aMethod 058 N+ ?3 o1 ] g0 m8 F5 r% ~- L
=========
6 K# v: U. k( G; ~" ^4 y' b' a5 P+ y) S! s7 k) R4 R
Method seeking the 'magic number' 0F386h returned (in ax) by all system
* c2 ^( ?9 t* y, Wdebugger. It calls the int 41h, function 4Fh.
: q: }( S1 s' |& r: q& LThere are several alternatives.
8 G1 w0 p+ r3 T% F
" u8 c# i0 E3 GThe following one is the simplest:
9 k# A( E6 b6 S& f7 L( E$ n
; X# Q! I& a, I& I mov ax,4fh
5 z7 f5 E" X6 |# Z+ D int 41h8 G+ ~8 m& @4 ~$ w* v( D4 y
cmp ax, 0F386# g- x7 Q- y0 |8 q8 E, @; b
jz SoftICE_detected' P% b8 Y0 u. L; w3 w
. {2 o7 ~6 \. f0 b" ~0 B' Q: [
& W, k! M8 _0 f
Next method as well as the following one are 2 examples from Stone's
5 r8 n# [9 `5 e3 @% e$ {4 Y1 \9 [5 O. U"stn-wid.zip" (www.cracking.net):
2 D) i" ~7 O" `% E2 f( A# R( _ T7 S9 j4 K
mov bx, cs
. ] p6 v, t4 M0 j4 Z lea dx, int41handler2/ \) r4 E0 G! a# n* `; a
xchg dx, es:[41h*4] g/ {/ j2 g3 p
xchg bx, es:[41h*4+2]
& r4 ^5 a6 t. o6 f" _ mov ax,4fh
& ]4 D6 Z/ d/ y4 g: L6 {' x5 s int 41h* E' j* g' U# v. N$ r! T8 @$ K- i
xchg dx, es:[41h*4]
4 t+ o2 ^6 b" ]# T xchg bx, es:[41h*4+2]2 Y9 | p+ }& r1 d
cmp ax, 0f386h0 I% I+ q- V; a
jz SoftICE_detected
2 Q" N! }- K6 M! L4 K! a4 h1 q
- h X5 {0 B# g! G. j( lint41handler2 PROC X! ~8 B0 ^/ G6 D
iret3 L( K6 e; l2 z1 y
int41handler2 ENDP
$ l' L7 a8 q; R8 J: }
& f/ R; \: K* @1 w8 \" d( J5 ^. Q' X. f+ Z
_________________________________________________________________________+ `* S; A- {7 }9 t. C! t- T9 c
6 Y# U) Q* `: }( X+ Z' [ A
, d! x2 D2 k4 P7 R% d1 d$ iMethod 06
" g% e: h8 D7 i0 U=========3 W2 {/ U! S' a
/ l5 F9 c! n0 M2 H+ J+ Z$ L
5 ^3 B3 V. I T8 P3 A
2nd method similar to the preceding one but more difficult to detect: o5 |6 X. k3 ~" [! N
/ r( s5 I4 I: _5 u
# [* \) h" g3 E$ H! X- i* y. F! n3 kint41handler PROC& l f( S6 t- e) V) Y
mov cl,al
% Y8 _. F5 W$ i iret7 f) [" w! b- v, {
int41handler ENDP8 X+ n- f7 E7 n+ Q o* M8 ~
/ Z' f x/ Q7 w3 y3 F! [6 K9 ~
( q4 E/ x9 A, e6 T* K8 H xor ax,ax$ }% g3 b/ k/ @- }7 K0 b
mov es,ax2 s% F. I; c+ F. P5 f q8 y
mov bx, cs& _% B# `4 p5 U6 C' u/ w
lea dx, int41handler
6 Q$ P; U. Z8 k- r7 S xchg dx, es:[41h*4] a. X3 t! A: _- @# m$ E
xchg bx, es:[41h*4+2]
7 q$ o9 C2 A' b! d, Q in al, 40h" c7 R t0 t4 B* I6 a
xor cx,cx
1 w$ {+ z. O B9 y int 41h) T4 K: ]; n P- o
xchg dx, es:[41h*4]* w. J* N% i6 N
xchg bx, es:[41h*4+2]1 \0 `) Z' \5 B3 m5 z. B" D$ m
cmp cl,al) c1 L- x2 d6 i; B4 A3 F) e* F
jnz SoftICE_detected: ] V4 q; ^; J: O, x4 }3 w @' S
# O& Z. c6 T8 k- D& ? H_________________________________________________________________________/ l4 C1 _* v- g% a5 M9 j
$ t& f' {$ @9 T4 V4 r1 }/ o! b
Method 074 P* t" P$ r1 _
=========
, [: i) T4 @+ w: X' E
! h* c- e! E9 q# FMethod of detection of the WinICE handler in the int68h (V86)6 f6 o A/ t4 ^6 \4 u
% E9 f; z4 j! Q1 d' `. @2 g3 N- p$ c
mov ah,43h- M9 I; M8 y2 Q5 \9 ?7 i) |- _
int 68h. z3 {) K' r& W6 F. e9 ?& y& S7 r( H' t
cmp ax,0F386h
" m0 q1 E! h S( J& P jz SoftICE_Detected
) E; V5 V3 h" `1 X+ D! w( r$ [7 ~6 E- a/ q- O2 V
8 t* o7 i% R! y) {
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
! g( w3 W5 _0 j8 B" r app like this:8 N! W4 x( `) r- W% ?; [4 h3 X5 t
9 L) _' V0 D8 {3 S$ e. Y1 f
BPX exec_int if ax==688 v/ ?# h# B% o0 t. v+ p/ _
(function called is located at byte ptr [ebp+1Dh] and client eip is5 m- T! B- u1 k( ]1 }
located at [ebp+48h] for 32Bit apps)
2 N+ Y# v* W* v__________________________________________________________________________
# l" F- o, W l" ^( C
1 r' }3 c: H/ B! [
" Y3 ?1 d/ v/ T4 A# YMethod 08
/ c! V5 B. @& ]9 i=========0 ^" n" M3 v4 l" T7 S
1 z, P! I0 p/ @. ]9 k2 r/ n$ U8 a
It is not a method of detection of SoftICE but a possibility to crash the7 @9 j" w5 T( x, q8 z# D! M' o
system by intercepting int 01h and int 03h and redirecting them to another- S- }% Z! p# a% h5 o
routine.! q. ^8 a1 |& v1 }
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
% v+ i, @( Q9 ?* _' e7 x* i6 l( Yto the new routine to execute (hangs computer...); G4 v& s$ N- W& j" t, S0 G7 _$ s
* u" U3 v) {# |% m! U6 b
mov ah, 25h" p6 d; c4 g' G
mov al, Int_Number (01h or 03h)
3 C7 \" c& G5 n' F! g4 G mov dx, offset New_Int_Routine& d% a% S. ^ P' ]3 [) g. O! C
int 21h
7 J0 q* X$ L, q% W0 B
; J1 J- \5 z3 M% X. v3 [* I4 C1 m__________________________________________________________________________
3 k( N1 w5 A! a+ q* c( ~% V" G% Y6 g( v6 k3 d% l& d0 {
Method 09: M8 N: C0 q, a5 s0 G0 g
=========
- N# O; M" x! {; ~ {! _' C e! q1 [% I7 S% j: c& H
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
( x+ p Y$ }) iperformed in ring0 (VxD or a ring3 app using the VxdCall).
3 V7 h2 T' h1 G+ o' dThe Get_DDB service is used to determine whether or not a VxD is installed, q3 d& p0 P" S# Y( ?
for the specified device and returns a Device Description Block (in ecx) for- X+ k/ q+ `+ j) K6 j" r. ]
that device if it is installed." R! P& w j5 r% O4 @
9 A% y1 g+ j* j; Z* H mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID. ~5 j+ R$ I( Q. Q) A
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-); D7 U& t. [% a4 ^1 O1 Z
VMMCall Get_DDB
; Z9 U6 C$ ]( @9 k& D mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed5 w9 F, j8 z c
4 @5 d6 f* P w* n) k6 |Note as well that you can easily detect this method with SoftICE:& m' ~1 {2 h0 h
bpx Get_DDB if ax==0202 || ax==7a5fh
& \6 ^0 _% Z( u \ q' D( \! F6 F$ w7 Q+ x* g3 d
__________________________________________________________________________& ?0 s |: Y$ d
6 W$ D" i8 Z: t7 B( N5 r' K
Method 10
. H5 E. S+ q( }$ ^9 d) ]$ u=========
4 j: ^, K3 Q6 C9 I
6 \3 n4 O8 [. Y=>Disable or clear breakpoints before using this feature. DO NOT trace with
! m2 i" @. t" h# F; g3 g" { SoftICE while the option is enable!!
# o! u+ M5 ]$ o7 ?; Q8 Y6 ?; G6 c, C: h- f
This trick is very efficient:
! V9 v/ P$ O4 E% H7 a, Xby checking the Debug Registers, you can detect if SoftICE is loaded
4 m+ I4 x3 J' C B(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
/ `$ {; i$ n: V" r8 nthere are some memory breakpoints set (dr0 to dr3) simply by reading their" v6 O! U9 |# U: u& T* }/ S
value (in ring0 only). Values can be manipulated and or changed as well
A( `7 A5 z# e1 G+ [(clearing BPMs for instance)
' V/ I# _3 c Q3 y! _0 t+ H" q6 \
# D( s9 e6 l/ p* v s" y__________________________________________________________________________
6 ]9 x2 C2 u- `9 Y5 J) E4 B+ Q
# n! M' t Q* F# ?6 c7 Y. \Method 11
; a1 q- w6 W& x* U! ^7 z; T=========0 x% A7 `$ z( X8 J
+ b$ Y0 Y% N/ {- c1 R+ S! G
This method is most known as 'MeltICE' because it has been freely distributed
3 ^' c0 L/ B ]2 ^! s, Xvia www.winfiles.com. However it was first used by NuMega people to allow
# S, W6 s# R% n4 m0 ?Symbol Loader to check if SoftICE was active or not (the code is located" r! k% Q! c4 |7 k: y. p8 h: J. l
inside nmtrans.dll).0 l% {! M; Y8 i1 [
& S# n) [9 X% J/ B( RThe way it works is very simple:
- x1 z6 P: a9 L8 @' L# S$ O: aIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
0 I* n* p0 v J2 wWinNT) with the CreateFileA API.
7 Y. s: c. U2 ]1 h
+ h; M, _! e2 t+ o r: B( U. l2 PHere is a sample (checking for 'SICE'):
4 G& ~' o) ]+ f+ _) Y4 v2 }! Z! n' `3 V' e2 p# X" s" c, N/ ^" h0 i- q
BOOL IsSoftIce95Loaded()5 y5 T# L& x. ~4 s
{
; { |8 e7 j3 J2 r" \1 K( h HANDLE hFile; ; Y8 V8 Q1 k5 R6 M" n* m7 W
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
4 b6 \: T# H9 P1 o! d FILE_SHARE_READ | FILE_SHARE_WRITE,$ j3 v6 P6 ^* ]! Q9 o4 Y
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);% N( [1 {' F" w4 }7 w
if( hFile != INVALID_HANDLE_VALUE )
/ G; z% X9 C$ A- S! A2 L {
. i. W) F! Q) I6 {4 R CloseHandle(hFile);" ~5 t8 X) v+ T. n" [
return TRUE;
; S) X. W0 p: Y7 o4 f+ D, [- s% f }1 Q) p5 y% j$ S# G
return FALSE; Q% w- N5 v9 h7 v
}; b4 c3 |6 F, z, V
( v1 L: O$ Y: [ k! q/ _* yAlthough this trick calls the CreateFileA function, don't even expect to be }2 o' i6 C9 x' t4 n1 T; Z
able to intercept it by installing a IFS hook: it will not work, no way!0 v s: {' l u8 R
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
* S9 ~# f- V" b7 E$ iservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
5 l5 s: ?) C* }9 jand then browse the DDB list until it find the VxD and its DDB_Control_Proc
' L6 c; `2 i) v' n" yfield.- j/ G2 ?- r0 f! R: D9 @- C
In fact, its purpose is not to load/unload VxDs but only to send a 5 ^) V# M) ?* p# p9 {
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
- H0 s2 W/ p3 W+ ~' C) ` |9 Mto the VxD Control_Dispatch proc (how the hell a shareware soft could try
2 T- a. c) @9 d2 P# @9 @ q) Xto load/unload a non-dynamically loadable driver such as SoftICE ;-).5 z6 P' V5 v4 s
If the VxD is loaded, it will always clear eax and the Carry flag to allow
% y2 p6 s# Q1 S- L b& iits handle to be opened and then, will be detected.3 b g2 c. p" u- E8 M( J3 l
You can check that simply by hooking Winice.exe control proc entry point
) J) G8 \2 ^3 e% X$ kwhile running MeltICE.
k% u, O( `5 J8 B" F9 ]" C9 w2 J* k- S9 H- m
2 g2 P+ c; L: W8 |: T! I
00401067: push 00402025 ; \\.\SICE
; z! [$ t8 ^& N' ] 0040106C: call CreateFileA
7 A) h# U" @9 D 00401071: cmp eax,-001
1 m! P( x$ Y3 a' R/ P* {4 I) Y" p 00401074: je 00401091% K4 ]$ J' P; ?2 ?' u8 |$ @2 K j
' n9 \, T8 P$ e4 G
8 }5 R# Q/ u, j2 rThere could be hundreds of BPX you could use to detect this trick., v, C) ?0 F& k/ x
-The most classical one is:% ]( @' f, {9 c5 @+ l& Z
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
9 ?" I p2 g, L: W *(esp->4+4)=='NTIC'4 G6 e/ X6 O% j$ a+ y
9 U1 D V# p' p' z7 \
-The most exotic ones (could be very slooooow :-(7 @) \" k2 x$ g y" V* Q9 H3 ^
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
3 k5 E& p8 p; K' d$ [ ;will break 3 times :-(- O; T6 T" G7 {2 V4 D( P6 ?
# s* |% m. b. _! \0 w-or (a bit) faster:
! g+ Z2 z& w! W( x BPINT 30 if (*edi=='SICE' || *edi=='SIWV')2 Q! D2 _: g* U% U6 \. M
: t% c& p! a% e' R4 @ R) ]+ T' N
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
5 w9 z: G$ V$ P! u5 [' S ;will break 3 times :-(9 {, k1 O+ b% S# Q( [
( e5 x$ V1 J2 l8 f4 X
-Much faster:5 p: a5 u# F0 X
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'% K+ B$ J$ Z. w" ?
+ U6 ~$ N+ ^6 r8 I
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen/ O' z. Y, j$ R. l/ s6 R3 Q
function to do the same job:. T" a" {1 g: y. |+ S- H
1 Z9 {0 V* T% T3 i$ p/ C' {0 a push 00 ; OF_READ- @$ s: y7 y, n2 y- Q: s) v6 T
mov eax,[00656634] ; '\\.\SICE',0
5 U9 G* [& j( [' Z push eax- N- L( u" m8 i9 Y' ~
call KERNEL32!_lopen# \7 F! S, Z/ y, b! {0 n
inc eax. ~& ^- ?) i" _5 W2 p6 A$ _
jnz 00650589 ; detected
% l& A9 k# O$ [- j push 00 ; OF_READ: O+ B" [: p$ U" j
mov eax,[00656638] ; '\\.\SICE'! t q4 F: G( r% A+ a0 c
push eax
! n+ Q9 K3 \. ?+ q7 ~ call KERNEL32!_lopen8 ?& M2 G, Z! q2 x
inc eax
# ^! Y3 g. n: P) V/ r7 s1 t jz 006505ae ; not detected
$ B9 |" \" o6 h0 [. D: O$ u) M# r3 @, s% S7 \/ A
2 M5 {& y( W2 E2 T1 Q0 j. ~1 ^* w( b$ M__________________________________________________________________________" \0 A* y4 g$ [; V/ w
2 g3 c& f: Y2 N3 _* |, B, t. qMethod 12
% q' I) G# D3 J) P0 A1 s+ W=========1 p( L% v7 ?9 q/ ?, N
; B+ p4 ^: p t9 Z: aThis trick is similar to int41h/4fh Debugger installation check (code 05. s5 H+ Q7 O2 t+ n* I
& 06) but very limited because it's only available for Win95/98 (not NT)+ g: A- P7 Q" g3 y1 g( o- Z/ T1 Q) c, W
as it uses the VxDCall backdoor. This detection was found in Bleem Demo." s$ ~9 [) D* H6 ]* K
$ U5 Y# y6 |6 |) H! u0 e" r2 V9 j
push 0000004fh ; function 4fh+ r& |+ ^7 C& Q. s7 L: d* ?
push 002a002ah ; high word specifies which VxD (VWIN32)% g6 P2 u9 o6 X4 @
; low word specifies which service
% J+ q7 H$ U" L (VWIN32_Int41Dispatch)
! T$ y- V0 k7 t% v7 M3 k8 R! c call Kernel32!ORD_001 ; VxdCall
7 H+ u) F; ]+ g cmp ax, 0f386h ; magic number returned by system debuggers8 I! f6 u/ E: P J: d5 E- v
jz SoftICE_detected
6 F* q0 [- A7 @
/ e5 c( d1 a% W4 `" ^5 kHere again, several ways to detect it:
, E* O' R5 o: ^4 Y' V" i J" k# `3 p& s3 `# y7 B# v- e
BPINT 41 if ax==4f' |( Y8 {6 Q, g9 n7 g
# S% d& a& C T) g
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
) A/ `0 u( R8 B8 ]! X0 T' k" q% R, q; ?1 V3 s' b7 V! n
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
8 h D4 s8 U8 Y& F
5 |5 g6 w! u7 k8 O/ _! X BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
0 l9 ]! W2 n, i* @5 J; P( _% N# ~6 ]4 [. V
__________________________________________________________________________
- b1 l( w" ?1 [# ?* R$ ^1 _
3 p2 V o- Q9 J$ ?, d& PMethod 13! d; u7 e4 L* ?, K7 X
=========
! T. V& q5 a1 P! Y* Q
& ?" g$ Y' N2 V# W* DNot a real method of detection, but a good way to know if SoftICE is; v/ P) o# E( W7 c' v0 i
installed on a computer and to locate its installation directory. Z/ P) ~* l" b+ U: q7 I# Z' L4 y
It is used by few softs which access the following registry keys (usually #2) :% G, ~0 t7 N* j
5 C- {. U5 ?+ G( W6 C-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
; b* S3 f7 D# v( U7 s\Uninstall\SoftICE
2 q) L* X' U8 V" |3 F% _) A-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
0 x0 n+ _6 b1 R7 ^-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
9 B% T- `. m* D$ {* y: z) E\App Paths\Loader32.Exe
* h- Y/ P$ j; u0 P. d0 m! W+ ]0 h. ]+ O* {0 d1 d8 h
5 P4 F- i# b# H; u2 ^
Note that some nasty apps could then erase all files from SoftICE directory: b6 U0 v+ L' Q) i5 P- y" O. z
(I faced that once :-(* z( [" _# L# A4 F
8 d3 x( K7 k: G$ uUseful breakpoint to detect it:3 `" R- b X( {/ U D6 d2 P
$ o& k" y* g, _! X0 a! I BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
. G2 y- A4 d- Y* v4 @8 E% _$ t6 ]0 a& F/ z
__________________________________________________________________________
1 U1 p3 p& Q7 m4 f2 W/ M: }# S, S. ?- O9 s( u! e5 l
) b& Z) m& C' m* d4 j6 yMethod 14 5 _% m0 g3 A( {% h, i: I w
=========$ @9 h; O. a$ U& e
- X% e: o, F% @" q: R* xA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose, Z0 g; T# U3 ~+ X7 q% q: @
is to determines whether a debugger is running on your system (ring0 only).
& M! _* d2 f, d7 A7 ], T! g
2 i- B/ n& a( O; [ t) N& p VMMCall Test_Debug_Installed
_% J3 J) \' q! i, [ je not_installed
4 n, K$ h" ]) b9 d$ w0 Z, m7 ^) x) g1 e O$ b/ P8 E% P
This service just checks a flag.0 P* C3 w2 a$ J. \% r. E% |" R2 s
</PRE></TD></TR></TBODY></TABLE> |