<TABLE width=500>
, l, b2 G1 v u6 \<TBODY>
! q3 L! e! W. t1 @% d2 e8 b<TR>
0 Y6 y: i n. k<TD><PRE>Method 01
$ K+ N6 |' a$ o7 H/ i=========
' q5 L8 e% o! C# L2 Q2 c- S
) v- x" K1 }, }This method of detection of SoftICE (as well as the following one) is; B2 E* A# h6 q" c2 d! \
used by the majority of packers/encryptors found on Internet.- F4 E+ J( ]2 g* W
It seeks the signature of BoundsChecker in SoftICE
; I! P' \: N1 R$ S0 s: U4 Y2 t6 {& S+ ]4 G
mov ebp, 04243484Bh ; 'BCHK'4 ^, x# u( G5 n6 c/ O& K4 K( h
mov ax, 04h
) l3 x$ e/ T' r) H& R$ T4 q! M! Z int 3 ' W/ V, m, z$ |& R; v
cmp al,4
. @& y1 m7 r- w0 K7 }! P jnz SoftICE_Detected/ s! Z7 y& `* ]4 k8 w
8 L" e6 Q+ s9 b* l' ]# u9 i___________________________________________________________________________2 }# _+ C. h& `: Q7 z; D
" K: ^/ }! |/ J4 k& yMethod 02
G) x* D: |: d) K% a=========, o: O1 c$ a4 Q) f6 C' r2 P
+ U8 R: v/ G6 b- T
Still a method very much used (perhaps the most frequent one). It is used
|! O' D3 @. G3 o+ Bto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
' B; c$ T" O a4 R6 ]or execute SoftICE commands...
# q6 Q1 m4 P6 V5 ?. j8 HIt is also used to crash SoftICE and to force it to execute any commands
2 B. E4 X1 v/ Y' K- _/ Y. y2 V(HBOOT...) :-((
7 {% ^/ } \' t% m- i4 Z+ \5 u
! m8 m3 n& p2 ?Here is a quick description:+ ^$ @: Y2 p; \ f. ^
-AX = 0910h (Display string in SIce windows)% M1 a3 P/ V$ v2 B y- g9 i
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
9 l! @, ]+ |) D! W/ }9 O-AX = 0912h (Get breakpoint infos)
8 c7 n! ?: t& S! `8 O2 N- ~2 @-AX = 0913h (Set Sice breakpoints): e& r8 H$ x3 v6 T9 \8 t
-AX = 0914h (Remove SIce breakoints)
: p ~1 J) U( r9 W* R# Z3 S- O [% K% s
Each time you'll meet this trick, you'll see:& \# O: P$ n( w; @; B3 ?8 B
-SI = 4647h8 y4 W, C* i) k! \6 k
-DI = 4A4Dh# f/ C4 Y6 n! _# d" Q' K
Which are the 'magic values' used by SoftIce.! S) J3 z, f! n. @
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
- K8 [: A/ B/ N7 V; H3 N h( _; }$ g0 ^) ?7 N
Here is one example from the file "Haspinst.exe" which is the dongle HASP% K i; W8 n$ G8 p. f' B) K: i" h
Envelope utility use to protect DOS applications:8 y. c& l; a# |/ h
; A4 v* D/ o2 h- P
3 y* M* @- W+ g3 H; G
4C19:0095 MOV AX,0911 ; execute command.
i& T) W8 } b4 r4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below). V7 I+ G) W8 `$ `( w6 p" O& ]. G
4C19:009A MOV SI,4647 ; 1st magic value.
7 l( E; X* g0 d6 o7 H3 D4C19:009D MOV DI,4A4D ; 2nd magic value.
; R- N% ~+ W% z4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)( e, M* {6 \. v: e* b; U7 j) R
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
& K5 |( Q' L2 H8 `! p2 \- ?4C19:00A4 INC CX
# [# w+ h/ W* J7 n2 b4C19:00A5 CMP CX,06 ; Repeat 6 times to execute. O. ~; W8 z7 v7 ]6 M
4C19:00A8 JB 0095 ; 6 different commands.
# o3 t$ T! }! H' P9 d# l' u4C19:00AA JMP 0002 ; Bad_Guy jmp back.- g: ?1 s$ }& K/ `
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)) W& A/ u D6 T9 u6 g
- S5 I3 S. M3 L% D& h: |: H- y, zThe program will execute 6 different SIce commands located at ds:dx, which) ]; p- b) y& o8 Q
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.' Z" ^' D& H; d7 X6 b
/ z( O2 ?/ b. n% b* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.' i1 b9 F' k4 N
___________________________________________________________________________. P# W2 @: K. ]) ?' Y
" a) G; @: h K( O; T Z/ a% M- I: K
2 |2 U! @ T3 ~& h4 [- c \( |Method 03
% N2 u/ G* ]5 r! z6 G=========5 { t% o! j; E% |' Z+ Z# a' a
' O. g0 N- F. d/ s& h2 G- _1 eLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
, ?4 G1 m2 I3 K- [4 g(API Get entry point)
/ d$ c( D7 l- D) P 0 K5 h8 c8 p% u
7 ]' P! E0 C. `# `3 G' T9 O xor di,di
R* G: j; X8 ~% x8 I mov es,di
! I& N# Q) T3 o% k! j/ ~ mov ax, 1684h
4 a4 q1 F! o6 [ mov bx, 0202h ; VxD ID of winice
8 m5 b- Q9 t! R" x3 p7 z' U int 2Fh; v& }5 u" V, B2 k
mov ax, es ; ES:DI -> VxD API entry point5 P, P* |" d& v3 d6 }+ b) N1 l
add ax, di% q" o% _5 P( ?, P, J9 C
test ax,ax4 r+ }2 S$ T- s4 T# _+ z& j9 Y% d
jnz SoftICE_Detected
T2 I' H" [) |2 \# M: d8 ^0 q* |6 }
___________________________________________________________________________
* ~! v2 E; L. T. P
! O+ F; T& n: C- Q zMethod 04
, ?; n7 l5 {/ `5 O' L6 X4 J=========$ q O F' V: S9 L$ P/ ^
6 z! F% L3 D5 i i5 d- h" b1 m- ?2 ?
Method identical to the preceding one except that it seeks the ID of SoftICE" P" m8 P% w! g# p8 S& j( z
GFX VxD.+ U6 Y1 O2 ? z" _
: Y; \/ m2 ~/ v8 d& `
xor di,di
8 l* j* V1 ^1 M mov es,di
2 D( x3 q, V0 p% `7 i mov ax, 1684h
) ~8 O% v* _" |8 r3 K mov bx, 7a5Fh ; VxD ID of SIWVID
; p4 `+ O2 U C5 @! I* r7 O int 2fh7 x7 g3 G8 e4 e' K) a X& t$ O
mov ax, es ; ES:DI -> VxD API entry point
9 L9 B. ?$ ]0 U- Y9 k$ z add ax, di% y+ a0 U: j! ?
test ax,ax
% l2 V( @" s( o9 b7 [ jnz SoftICE_Detected
+ m/ g c" D5 s! g5 B( ?7 J
# g7 E$ Y3 V" H__________________________________________________________________________8 `3 Q' X7 C2 C, ^
# o7 {+ r( O+ \0 |- V' V5 E, Q
) D/ K- ?6 I# `8 BMethod 05
- A; G% @; n! J6 y+ p=========
, _: D/ E9 f' Y' v: C
: ~' {( a( @. z# sMethod seeking the 'magic number' 0F386h returned (in ax) by all system, u2 L, u8 `( w" o3 l% K- p" E
debugger. It calls the int 41h, function 4Fh.
1 \" i- `& W: c+ w$ D; rThere are several alternatives. 3 i0 w- y4 P# f" ?# ?' k
1 q$ R1 \1 O9 G) s% [* qThe following one is the simplest:1 v5 W2 y) q0 ~
% {' B% q6 N. ?- b( D mov ax,4fh3 P' P- P8 U4 b. X/ C: n5 e
int 41h
8 @5 L; E2 W( f! ^9 u cmp ax, 0F386
" g: V1 K b! Q7 Z- h2 g+ ` jz SoftICE_detected) M3 g3 ]! t- M- Y) E( @+ L- D
' Y" U# J6 I: y, n( R% B% A2 k' H6 o/ A: g
Next method as well as the following one are 2 examples from Stone's 9 C: G/ {0 \: Z7 M8 B5 j" q
"stn-wid.zip" (www.cracking.net):4 g& T7 y6 M& z6 |* V! g2 A3 z& t
+ B3 j% L: d0 C' S, r0 N4 s. e: _$ J
mov bx, cs% }1 P; P; l9 y! z- J9 O3 {
lea dx, int41handler2
0 L. N- i% C# l5 s, r8 [ xchg dx, es:[41h*4]
7 D8 _# A- C3 b0 X xchg bx, es:[41h*4+2]
: r- V+ ~* Y8 z3 q3 a' C6 ?1 a: Y mov ax,4fh- ?0 b4 t+ S j+ O
int 41h. f" ~- l* }7 G. i& h$ w. j1 j* u
xchg dx, es:[41h*4]
7 _3 A+ a! G7 b, d8 x xchg bx, es:[41h*4+2]
$ E/ n8 A: I/ N2 }- ]: f2 D4 s cmp ax, 0f386h- D7 m( F( A6 `: L; p
jz SoftICE_detected2 X; [$ W+ N! N' C5 x1 i' E
* z! f9 l% z, r2 e0 I) Cint41handler2 PROC
9 q: R1 Z, I W; d( L iret
; F2 p! W+ Z7 o+ k4 y5 i- Cint41handler2 ENDP6 F4 O O! p5 a8 `4 H5 ^2 Y4 u
$ @, b( b5 o6 B; V" E( {( T' P/ h
4 q1 j5 S) R* ]5 D `: k+ x! E
_________________________________________________________________________& F* F# U# n( T# m! O" i6 B( x
& M/ J1 P% o- g) y' c! z3 k/ p. a8 m; C0 T9 O2 h- X' i1 k" ]
Method 06
& b2 K6 H" t; k4 q=========+ v9 V# x7 F/ ]1 i) Q
& j$ r+ ~8 ~5 _' N, V: G2 x
+ _1 W4 ?* L+ U( w$ O$ ?' u
2nd method similar to the preceding one but more difficult to detect:
) O$ y9 T4 c% F
3 g* [6 \; J. @. o$ y+ S
6 J2 Z7 c i3 |- {" Y: ?6 K. b( Iint41handler PROC
! v2 a( {" M+ I mov cl,al
* F7 C" G8 M1 F1 s3 B& z$ t9 N iret
# k' w$ q5 ?1 Xint41handler ENDP( s3 \3 B, ~# i/ [) n$ f
# S0 d& J! G" _
0 ^ C+ O: c3 e0 x5 K1 E xor ax,ax. \ [, f ]$ c; I1 `7 P8 i
mov es,ax
1 ~! U/ h6 E# _' \ mov bx, cs; X) Z9 _2 ]" ]7 c2 |% |
lea dx, int41handler
! |3 |9 x. V, F$ @9 ~5 n7 | xchg dx, es:[41h*4], q3 O) Q' H" ^* P) J' h- E0 r% ~+ W
xchg bx, es:[41h*4+2], ?. E4 ^. Q% _3 _9 l; l
in al, 40h+ P+ [; c% p6 r% O- S
xor cx,cx
# Z. c Y* G. C% [ int 41h, ~+ F# M2 J' b: P6 a! m
xchg dx, es:[41h*4]
, x# f- x3 U+ G [ xchg bx, es:[41h*4+2]9 v* `* m/ U& x: u* D0 w; l
cmp cl,al7 j) ]6 y' t7 ^! E: i
jnz SoftICE_detected
. I5 q* ]4 i( _! M/ k! G! X k& q& B; e0 k3 Z
_________________________________________________________________________
3 d4 n9 V* S4 I/ \% G5 ]
! u/ \% ^6 ?+ E6 X- HMethod 07
( O: q4 U- l. l. s& Y) z( q=========
7 P: P3 W" N( U! a1 F
4 Y* x( y7 ], Y: L' N: }. QMethod of detection of the WinICE handler in the int68h (V86)
! z8 ]+ ?! \$ a9 x8 h
7 t" o- f* V8 p- l9 G mov ah,43h
$ b/ V6 K1 ]6 |: J5 s* t1 O+ ? int 68h- c, R7 w7 @% ]- `
cmp ax,0F386h
$ d4 I+ y9 ~& b jz SoftICE_Detected7 H- j* x; [% Q* d
# E$ u: p. a) L, |- m S4 j
) S* A1 G' u: o8 U4 O2 |
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit: \' G+ ^9 E8 x- l
app like this:; \3 a6 @( G3 \' X) c
4 S# @! E1 G! S6 Z# p2 m
BPX exec_int if ax==684 r" t- P0 ^+ }* _5 v
(function called is located at byte ptr [ebp+1Dh] and client eip is% _3 N \; S5 x; Y9 P/ V8 h! Y
located at [ebp+48h] for 32Bit apps)
8 w/ a) p+ D8 g& a: s5 p# S__________________________________________________________________________
$ t# `, Y9 O( A: ^0 k, }7 t8 S
; [+ z! v, ?3 i9 o1 R4 u8 y3 k
3 `) X9 `& j; _Method 08/ d7 E! y5 R6 J: P; c% ?
=========
. X3 ^5 z# E5 I* Y+ k) [8 j! c) V6 H3 c- \* y* {5 Q
It is not a method of detection of SoftICE but a possibility to crash the+ e; Q; J, [$ q8 j; f: z2 ]
system by intercepting int 01h and int 03h and redirecting them to another
' w9 `) ~$ I% T, B u6 |routine.8 ~. L8 H: o7 I! p
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
; l# L* t% H& D4 k; Qto the new routine to execute (hangs computer...)( B0 x6 v* k' J! I- w4 @$ K
6 x; q* V1 E: \' | mov ah, 25h1 x: t' Q# u- r4 W0 I- j+ R6 a/ n
mov al, Int_Number (01h or 03h)
( s, h) m# P( ?7 N1 T mov dx, offset New_Int_Routine
. [5 Q& Y1 n* S int 21h+ K' D. ]/ r" V1 y+ j3 g
) a; Y' v. \; X) L8 p__________________________________________________________________________+ g# ?: t% A% W6 k
* v! Q' r3 S# f" b
Method 09
2 J9 u9 r# B$ s=========. y$ {- e" y1 E7 L2 |
5 e, X3 w C/ Z& E8 A, d7 eThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
) m! I6 L D- O# ?; S sperformed in ring0 (VxD or a ring3 app using the VxdCall).
" q/ t& U) U |7 G. S( j; e7 RThe Get_DDB service is used to determine whether or not a VxD is installed! v( p A" n8 w3 l& o+ |
for the specified device and returns a Device Description Block (in ecx) for
3 B& j( x9 L& w( n, T7 \8 [that device if it is installed.
4 Q" B8 I3 Z5 [7 s* M1 n+ b
& X6 x: m; m0 K% ~ mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID: }: J1 f9 {) b/ z; |; {" i
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
& U0 C& b7 J8 ~ VMMCall Get_DDB
9 L% u- z6 }, G" |3 G9 I mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed* S4 X! Z7 q( q8 e
5 N4 [' |2 A/ @Note as well that you can easily detect this method with SoftICE:$ N1 X) Z$ {3 n! b. Y
bpx Get_DDB if ax==0202 || ax==7a5fh
6 O; R. O. ~0 E* [6 h$ d) T+ O" z8 {- ~
__________________________________________________________________________
! I" M8 r: N N8 ?& A; K* p3 `/ I6 ?2 D
Method 10
; o O1 M" c; n( Q/ L7 Z=========
- ^0 d! W6 Y. w7 |% }; I2 o& t' v) G, P1 l' B E4 [
=>Disable or clear breakpoints before using this feature. DO NOT trace with6 F0 E3 P8 K; H- r$ F) E9 \
SoftICE while the option is enable!!
* S& D6 |+ Y; u9 N+ Y" O2 `# G7 S; j1 }
This trick is very efficient:- }( j o8 |9 H: f+ [# N
by checking the Debug Registers, you can detect if SoftICE is loaded
9 M0 N1 K! z. B(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if$ r# {9 Q5 P( \
there are some memory breakpoints set (dr0 to dr3) simply by reading their
2 o6 s8 ^' B1 \; W- y. @6 J! evalue (in ring0 only). Values can be manipulated and or changed as well
7 L# ]( f! p! }8 D* h(clearing BPMs for instance)8 f- H+ v3 d; V Q; @# J& c0 v# u
7 D1 X0 W8 W- h& l- I+ r& J9 O__________________________________________________________________________
, G, v, N0 c2 g* L9 p/ _/ h x! I: b4 I0 c5 k- E) _- Y
Method 11
1 K3 p! M; U2 @ \% _4 s=========
0 \" w0 H' `# p% f( G0 m9 N" ?& z/ Q
This method is most known as 'MeltICE' because it has been freely distributed
9 P7 Q! R/ K, P( ~( Yvia www.winfiles.com. However it was first used by NuMega people to allow
% G9 d; W, A$ J9 k) Q8 P3 \4 [( BSymbol Loader to check if SoftICE was active or not (the code is located/ D0 e$ S4 Q# I
inside nmtrans.dll).
' L# |) _4 W! N3 c& M, t6 q8 u8 F0 Y j( ?
The way it works is very simple:
# q6 H) E( t. L9 a% w$ DIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for3 y( J" o8 c9 ^) ^% s" w
WinNT) with the CreateFileA API.+ o) c* H5 n) t- C1 a6 t
6 Q1 \7 y& e9 CHere is a sample (checking for 'SICE'):$ [. }- {# l. I' z5 J; f
; x/ N- G6 H# e' g9 |9 wBOOL IsSoftIce95Loaded()
q3 ~( V- R3 Z0 j! d3 b+ P{8 j0 O% O9 Q; j5 d
HANDLE hFile;
. f2 s z+ }2 E/ C% k8 R B hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
7 ?! ?8 r. Q& R( v8 G FILE_SHARE_READ | FILE_SHARE_WRITE,
! P! ], g" |& I e; [ ^ NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);$ X% B7 A9 ]) D5 F
if( hFile != INVALID_HANDLE_VALUE ) d. G' y( @ ~" J* x
{( ]' i2 _$ B% s/ ?
CloseHandle(hFile);: ^. w4 ^0 }# J) l4 m9 M
return TRUE;
' s4 i3 d: M% A/ W, r9 ` }3 l, d' ?' G9 q7 G X" f& b
return FALSE;9 F( e- h7 e, k
}
% j/ D$ L7 ^2 l3 d3 H9 R
, s. A4 \& t5 c5 wAlthough this trick calls the CreateFileA function, don't even expect to be
: l' s X5 I: t+ Zable to intercept it by installing a IFS hook: it will not work, no way!
& l3 b, f8 U8 P. Q( I0 ~- HIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
# Y: ?% _9 s: y$ z l/ Qservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
* A% w5 o9 ]/ E0 tand then browse the DDB list until it find the VxD and its DDB_Control_Proc& ^2 @9 `* p- N; T: L6 @- t
field.2 n; O8 T- R. N: Q4 q$ g
In fact, its purpose is not to load/unload VxDs but only to send a
# ]5 Y7 _% }9 G: E6 e) e. DW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)8 q- A% Z% J# p8 t& s0 c8 {
to the VxD Control_Dispatch proc (how the hell a shareware soft could try1 Q! W$ Y) Y5 `& v8 S, _& F
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
% l- Y6 L" W& r! lIf the VxD is loaded, it will always clear eax and the Carry flag to allow% M! J" R; R! w+ N0 B+ S8 C" o, u
its handle to be opened and then, will be detected.
* a2 o% w, q9 h+ J OYou can check that simply by hooking Winice.exe control proc entry point
) ?3 ~3 I. s( i+ D8 K7 N& o+ R0 pwhile running MeltICE.8 I8 x! I& e( Y: I8 {( b
$ [1 \; {) y; i% X0 M0 ^3 A- P l O# n0 Z" W) v9 C8 H: U T
00401067: push 00402025 ; \\.\SICE& t! d5 f! K* k7 b0 e7 F
0040106C: call CreateFileA& J7 F- P, C; i/ E. B1 F$ ?* e9 n
00401071: cmp eax,-001/ p f4 U8 Z# j8 W( A: O
00401074: je 00401091
" o0 X# H+ ]7 [$ z
/ j, q: O& O6 L- y5 w( u& l: E8 N# i" E6 ~$ h
There could be hundreds of BPX you could use to detect this trick.# d1 ^9 p3 _* z6 i5 R8 G* j5 _' r( @
-The most classical one is:! d9 e: ^/ Y6 L- t$ D/ x7 \
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
: _; u9 A; y/ S. v% M" z" r |8 |+ Z *(esp->4+4)=='NTIC'1 O$ U$ u# `7 d0 Z! s4 G2 w, W* g4 M0 w
$ G5 u$ V, b9 x6 m0 |+ A5 x-The most exotic ones (could be very slooooow :-(: C m9 d! z0 |
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
$ O$ W% x5 O/ N& g6 K& g) b ;will break 3 times :-(! p+ n0 Z6 `. p; k" r( X' l9 _+ R
: E2 k0 U4 @3 P. d6 }-or (a bit) faster:
# h' H0 E6 P/ s# G n8 f BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
- c+ J0 ]$ i7 d7 r8 @$ x% B3 T+ A2 {( @. {! ^% B
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
& t3 E4 D$ v$ _% _% r# {$ | ;will break 3 times :-(
- }" ~% i+ S# J e/ k* b+ l
' }/ `. R# b( ^+ T-Much faster:
( ^5 i2 u: j' {) p& s" O BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'* l* d! B/ K) d* P% q' M: Z
* C! A& }3 p+ E1 |$ B
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
$ c$ B! k( q8 \- m5 v3 @" Ifunction to do the same job:
* a8 E- m0 N8 l
% f* T9 X9 w) ~3 m7 _ push 00 ; OF_READ' T8 \5 \. n+ [. L P$ z
mov eax,[00656634] ; '\\.\SICE',0' \" C9 _6 k3 J$ H8 i6 l% ?
push eax
3 U2 E" ~7 y. \/ r& ~, B- ^* o1 L call KERNEL32!_lopen& [7 v4 c- }% U
inc eax. Z, A' Z5 @, h! A. ?1 R. L
jnz 00650589 ; detected
9 ^ [2 f+ e3 G! i8 G! [ push 00 ; OF_READ
( M4 m' y+ C! w Q# @ mov eax,[00656638] ; '\\.\SICE'
5 O, F4 w( N' _: T push eax
& E, \7 V! o, w' x, E call KERNEL32!_lopen
' E/ \% X% Z! {9 ^5 N$ }' B inc eax
# V# g1 t& P3 q( C# T2 o' o8 r jz 006505ae ; not detected
, j7 f% S/ \. g' b8 X- z9 a
. H1 h& Z* [6 M, l% D
) U f1 P8 x% T( y__________________________________________________________________________# T* `3 }2 e# R) V
, u, w& I# Q/ L4 o* I% a
Method 12
5 Q% {+ G. x& J/ u3 I" E, W=========- K! ~' W2 V* x, ^
; G9 g1 ]/ J4 Y+ w7 j& V
This trick is similar to int41h/4fh Debugger installation check (code 05# I }6 k! `7 Q
& 06) but very limited because it's only available for Win95/98 (not NT)$ {) X1 ~! V2 D6 _: E
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
3 I+ h; ?/ R: y# _2 E. b& |* c: n3 D. o0 S5 F
push 0000004fh ; function 4fh
- w0 n% m. M5 Y6 N push 002a002ah ; high word specifies which VxD (VWIN32)7 I6 y4 M& A- a0 n* b+ b
; low word specifies which service
+ C- x9 f( k1 G; `5 z% x* V (VWIN32_Int41Dispatch)$ F1 f$ o6 G6 \: D# X& k
call Kernel32!ORD_001 ; VxdCall
7 `% J- h7 b. p! K7 C1 c( d cmp ax, 0f386h ; magic number returned by system debuggers, q) k: N: ? P* ~" S3 |6 ^& v
jz SoftICE_detected
' C7 k' C9 C5 V2 F" x' {7 d$ T! S2 D- ?: A) b9 O
Here again, several ways to detect it:
; }( b: g {" s( u4 j q E9 `' P! z3 }5 F- b# t& U* [1 A
BPINT 41 if ax==4f
& N0 W& ?6 W* p2 V! G @, z: p/ W P! [. [: X/ [
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
g& n- \% ]+ e! V2 b4 K: l9 c: r- z% k
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
: i) t. D5 D# c1 U2 u7 d0 D. i( y: F9 X1 I. ?4 |6 G; U I2 u
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
; b6 l% |* i' G3 F, q1 S
/ ?% ]" a! r* l3 _' s__________________________________________________________________________
* y' y1 U+ `+ G0 l# P5 a! Y. d- Y% K! k- C2 w
Method 13
N! p; X1 h$ N2 \=========8 U# `5 c4 a$ ?8 j1 U% i$ a; I
8 y8 l6 h( z: zNot a real method of detection, but a good way to know if SoftICE is
) `. h+ \; Z# l( E! N5 {installed on a computer and to locate its installation directory.6 D- I1 m2 @# @, H4 }7 ?$ W
It is used by few softs which access the following registry keys (usually #2) :
) w$ U! r# P. `1 Q8 D: J5 X: S8 u3 _* j# ?, Y6 v
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion H2 a9 y8 s9 i" {0 b; ~/ I
\Uninstall\SoftICE
9 {/ f# H+ d ~8 w* H-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE4 ?- ?% P- A8 f. N. v& Q s
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion0 B! ~4 u( Q# w3 z% l0 i
\App Paths\Loader32.Exe
: g3 T. n* i" c7 y* } }# q
: x9 x! b: D- i$ J
/ _) w! D0 S: d, H9 o1 r( eNote that some nasty apps could then erase all files from SoftICE directory, t/ B8 ^- g- \9 |3 t* @9 c+ O
(I faced that once :-($ U) t! M% ? O7 t- ?6 J* V' p
% O+ \# B; @7 l; U6 `
Useful breakpoint to detect it:0 j! ^+ f( o* W9 K- A! d2 u2 ^: w
1 ?& l1 Y( E/ `" T9 r
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
. Q* Y+ @) H1 _* Y# X4 z9 k* V
* }; p0 A) k2 }( ]' Y1 }& V__________________________________________________________________________
5 _9 j V/ w4 k; q+ u, L2 K
' i& g4 }) L8 p: u3 b
2 W& ]( p( u* U9 J8 W7 tMethod 14 ! T) T" u0 C, W* ^3 D
=========4 o6 E$ p% v* ~ A- I
5 B9 T% w- h& _9 T) o- mA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
* L2 i# b( t o6 G/ ]0 K) Yis to determines whether a debugger is running on your system (ring0 only).
0 g5 Y9 e" t, o0 ]# L. I
' E8 }1 N5 {, k$ ?, @' a. ?( @/ I VMMCall Test_Debug_Installed
) l4 Y+ T, s- Y: e je not_installed
3 u4 x% l3 K; l8 b
- i* n1 u/ }0 cThis service just checks a flag.
5 `8 [1 d3 l8 b; D' ]</PRE></TD></TR></TBODY></TABLE> |