<TABLE width=500>
5 R& o, y2 `/ @: h# }<TBODY>3 Q% P. ^0 i4 b1 J# A# u5 G
<TR>) j* O1 d* y" v4 `: O ^
<TD><PRE>Method 01
- y9 G& I- s9 J, B# E; p+ [1 }=========( A9 R3 @2 Z- {& I: ~
4 z4 U2 Q; N0 b8 i$ fThis method of detection of SoftICE (as well as the following one) is, V# i/ P5 e; Z g, k7 d7 l
used by the majority of packers/encryptors found on Internet.
, D% T0 L K9 c5 HIt seeks the signature of BoundsChecker in SoftICE
& @8 f9 C6 [5 x
B- l5 m( b5 e3 F V+ ?& d0 \% O1 e mov ebp, 04243484Bh ; 'BCHK'$ k* h% t: f- W/ B0 v6 |
mov ax, 04h" J# s4 _1 s, g5 ^9 q/ Q
int 3 ( F1 b- W" `$ [1 U
cmp al,4
) w+ {& x! l3 W. V2 j jnz SoftICE_Detected0 C) T- `7 j$ b1 ]/ |
* J; o, @4 g. y# F- Z
___________________________________________________________________________
$ K$ L& t- W! g8 y5 n8 K9 K5 T! [6 e
7 ?* {; t- i/ G- Y% |9 I6 n9 pMethod 02
9 _3 a8 |$ C7 V* T1 x% o/ L========= x/ x- ?8 ?$ S8 n3 L
, P' F( m2 }9 [7 @5 v
Still a method very much used (perhaps the most frequent one). It is used
# Q0 \. N, P. z. x6 Oto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
0 ]. [: l. Y# l3 R ^7 hor execute SoftICE commands...4 @) }) `2 E# o2 u/ j5 G
It is also used to crash SoftICE and to force it to execute any commands# [$ Z5 g: Q) X4 g7 C" e% L( x. u
(HBOOT...) :-((
! V* [2 `, Y( T. z+ h; i
: U5 s$ F Z6 V/ THere is a quick description:
7 h# M% l) d* c" M' T-AX = 0910h (Display string in SIce windows)
+ T" |+ G; F" r: M-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)1 z5 l2 A9 u0 ^
-AX = 0912h (Get breakpoint infos)1 L; r; e; S8 Y
-AX = 0913h (Set Sice breakpoints)6 u( U+ H3 o5 w
-AX = 0914h (Remove SIce breakoints)
/ B4 @; M% _' H! ?6 g/ @0 S9 A- S5 d6 X
Each time you'll meet this trick, you'll see:$ s$ E: \4 F* s& J {- F
-SI = 4647h
/ B, ~) N, O: [2 R' O, B" r-DI = 4A4Dh! D) U9 {& b! j
Which are the 'magic values' used by SoftIce.
" k" _& y& O. n7 k5 A N+ _For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
( V5 @% `, a- E% D4 Q& s7 ]2 i
- Z' C% ?- T8 ?, E" rHere is one example from the file "Haspinst.exe" which is the dongle HASP
0 C6 ~! \$ r1 A& v8 @2 B Q _Envelope utility use to protect DOS applications:( ]+ g2 }8 X2 R% V# C8 v- r9 @
9 k: Y+ @ w4 j' f' R0 a7 g5 r) }) ?3 x9 J. V3 Q9 b- T8 E
4C19:0095 MOV AX,0911 ; execute command.+ d8 ~7 y0 i2 Y
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).% z2 [* D8 Q% ]$ ]% U6 l' G/ t
4C19:009A MOV SI,4647 ; 1st magic value.
8 u9 k1 u5 F1 a; r+ j4C19:009D MOV DI,4A4D ; 2nd magic value." n7 c) G. S- p7 m$ k. m; r
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)8 D' d, T( U; E) J9 \
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute5 R+ _) ^9 d# M' I! |0 j
4C19:00A4 INC CX, }& P! H. \& G4 h
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
" h/ S' a* L0 a c6 S; p4C19:00A8 JB 0095 ; 6 different commands.
! `( X7 `9 d) g, S4C19:00AA JMP 0002 ; Bad_Guy jmp back.
9 O0 ]# q+ d4 n8 a! j/ G) E" e4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
; W8 n& J+ q$ l' g# O
- Z" A- U& e& eThe program will execute 6 different SIce commands located at ds:dx, which# L9 X' J7 a( A* P
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT./ M: M* t1 `: R. r" m( c- s. A8 q
1 e/ L; M% {. X3 `7 |- G
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.( t/ V( ?+ Y U( k5 q8 K8 ~
___________________________________________________________________________" Q* \. ~/ R3 {- q& g
$ Z9 t5 S( ^" ^/ P
6 x6 z' g( l; YMethod 039 S8 H# ?6 X. i6 @, J/ K
=========' A, S, W) B$ Y1 K5 e( U
, B# B9 b- V: {4 B7 \ L
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
/ G R: s2 l+ n" P c( C3 V0 @4 D(API Get entry point)
# r6 z8 _, u% B! j% Z4 N6 }2 `# s
8 j6 Y+ I! i& f4 X/ V" B# C- i& [
$ h% K( u* |0 |! D% w# i+ p xor di,di
3 X: M. E% ], V- i, K3 M mov es,di+ Z0 S e, q3 _; F2 _8 }
mov ax, 1684h 6 r( j6 |3 R, {. Z. T: w
mov bx, 0202h ; VxD ID of winice/ P/ {, p& E3 P7 _* G9 G. C. q
int 2Fh: R" {1 w4 a3 F' a5 g; {) w
mov ax, es ; ES:DI -> VxD API entry point9 }% \- A: e& f8 {/ x
add ax, di
$ g! \' M! g# u X, K test ax,ax
7 Q& m5 Q" O2 D: _0 Y- ] jnz SoftICE_Detected
/ W2 |) h2 p+ |% C$ e' l6 v
4 M# H* M( t/ M___________________________________________________________________________
. B- ?: }4 S* f# V( n& z: U0 ~4 ]+ l9 b7 D
Method 04. z# ? M9 u& e- b% [! U1 y/ L
=========
& f& r" c9 N1 C% R/ _
. @. U0 t0 W+ x6 d) t% x/ L, }* rMethod identical to the preceding one except that it seeks the ID of SoftICE* |& E( u6 E- k5 Q- E+ j
GFX VxD.
# W, A# x# v L5 ^. Z: Z1 ]( U' Q
, Y7 I7 u1 L. f. r# k7 j xor di,di! B( x+ d6 J8 B
mov es,di
5 e* G1 L! }$ I. W& w6 R/ s } mov ax, 1684h
$ F8 c( P2 k' Q mov bx, 7a5Fh ; VxD ID of SIWVID
6 K- w( q% ?2 T- @7 t int 2fh6 q$ d$ p& O6 n1 ]8 Z% P
mov ax, es ; ES:DI -> VxD API entry point
" J* t% }$ c: S9 o; R$ c add ax, di
) `$ X* R$ q! d6 ]& R test ax,ax& t6 F# K" E2 v, W3 D
jnz SoftICE_Detected: ]/ P3 \( N8 y6 J: \% C8 S
2 d' Q1 I+ A. j* b* A! o7 e$ e) r
__________________________________________________________________________
4 ^; g$ l2 T; E' v" e, d/ B" b4 s& x# S6 q$ z3 _- q6 W1 F
! E3 P' [& }1 o0 h( I
Method 05
4 K5 i7 ]& [8 G( O4 `=========, B+ m- j N- d, J" ]
. @) _2 I7 f. A: xMethod seeking the 'magic number' 0F386h returned (in ax) by all system& }! R9 _$ m9 z( |7 {, n F* n' x
debugger. It calls the int 41h, function 4Fh., t! O3 ^# E L4 T4 g4 \
There are several alternatives.
& U# S( O T$ c1 L4 l: {
/ _, y- s; [, WThe following one is the simplest:& z2 `: ^* d- |' z G6 ^
8 y' O' ]8 B P
mov ax,4fh: R+ {' a) o F. y
int 41h
8 x6 x) d+ u( p) v% t: A! X cmp ax, 0F386
1 j N+ q$ g1 j jz SoftICE_detected8 z" U8 P, ]* C/ F$ ^+ F0 v% w
* f% V, J' r5 y# w0 Y
) P- D& G/ ]$ p+ L" G, O
Next method as well as the following one are 2 examples from Stone's
2 d( v: Q# b' O& D& t"stn-wid.zip" (www.cracking.net):
5 r, H4 [& f/ i4 Z6 Y& h" `1 Q% E: @6 T: o
mov bx, cs
$ y8 W" X% K# }3 f lea dx, int41handler27 P6 m$ C7 o1 @9 p8 \
xchg dx, es:[41h*4]) ]9 I/ e% i9 F- h9 Q
xchg bx, es:[41h*4+2]
1 B0 M& ?" B1 a. ~/ H$ Y' K/ X( a mov ax,4fh
" G# c& A+ u+ v: l. x int 41h
2 T& @( l8 w. J. m. t xchg dx, es:[41h*4]* {2 j' {0 Y& u" s0 b5 }: f
xchg bx, es:[41h*4+2]+ h5 S1 w2 T: o6 P
cmp ax, 0f386h
* X# w; R; W! b! t& q! o, C jz SoftICE_detected* c7 c P/ h4 Q$ Y0 F; u
2 D/ q4 x0 o+ T9 H& k0 bint41handler2 PROC
) a& O! |- v( S M+ r; n iret
% N! S( O+ ~; V& l/ zint41handler2 ENDP
6 N" ]' \4 k c" j% L& |: x
/ k" | _% R) x/ c) x: Z! J9 Q& i4 Y; ~/ Q
_________________________________________________________________________, t3 c; E6 W1 h1 {2 q0 P2 p
6 K: b' Z% ?2 f) s2 C$ O: J- {' z# x2 s/ Q
Method 06
- M6 z6 o& y! k* [* i1 i=========
3 q7 S% J9 e% h4 ~# }& K2 s( T! S
9 g8 h; z2 |5 L C$ w, G" A& C4 n, u6 f: d1 \
2nd method similar to the preceding one but more difficult to detect:& S* C3 q$ h' y
, z: e/ U/ F' [( `% q; q9 D. E5 x
( B: E! Y1 f2 b4 F" w1 k9 |. P2 _int41handler PROC
6 ?! X8 B) n9 u! }9 X i5 c mov cl,al
/ B0 i# l% t3 b4 ?& ?" t4 T iret% y9 ^2 A$ a' v. f, a8 x0 q
int41handler ENDP
8 x4 v) h0 c3 o, {5 H/ d$ n! }5 N: c
+ [3 `' ?& v+ N8 q3 `+ J* O% C
8 |' J6 @8 m. |6 z xor ax,ax" W+ f+ K. j; |( g' X
mov es,ax
" \7 W$ A3 ` Z5 e' V5 v mov bx, cs5 s- c/ c) i; `2 }9 }7 }0 t1 d! b
lea dx, int41handler
) E/ E l% d7 y0 B xchg dx, es:[41h*4]
0 } _& e/ I4 g( [3 e+ j! { xchg bx, es:[41h*4+2]
6 T4 T9 ^9 u5 T# X in al, 40h
~2 O: w4 @* E2 l; z& h- b xor cx,cx* O l8 f% K# u1 |7 z
int 41h
3 \0 X0 x x [# K7 ^2 S xchg dx, es:[41h*4]
. D6 O) d: ]# o. `/ r8 O! K" Z" K xchg bx, es:[41h*4+2]
, S6 h9 C% [( e0 _ cmp cl,al
! w# ]; W E- n3 y5 B" A jnz SoftICE_detected2 v- R! b+ y3 b" V) ~0 U5 z
8 S* C/ w! [; \- u; u* n& R# b/ _% S
_________________________________________________________________________
& l& b+ a) h" R% R" G
# t J7 Q- b# r- K: E/ YMethod 07# B2 L/ x! @5 ]/ |8 f
========= i# d! N, P8 w$ j! C- G$ d
- `3 j c, M" k7 L3 j
Method of detection of the WinICE handler in the int68h (V86)7 ~5 ~+ J8 y4 o3 g6 s+ ?# [
: m+ o( p: I. o" E: k
mov ah,43h4 {- H2 [7 |1 M* D
int 68h
. d& C- R, Z, F8 B8 B cmp ax,0F386h6 m( k* D! p; J& L
jz SoftICE_Detected
6 K5 h: _8 G9 O/ |: h8 T
& J$ |% E0 Q7 e0 B0 P9 _) x/ ?
0 k& ^2 d) z, D+ N( J; W=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit! V4 m% p/ P9 U' w/ s* J, F
app like this:( x- p+ E% u% u/ ?3 i
5 X6 |9 e; C0 K7 u7 g. F BPX exec_int if ax==68
) h/ _' ?! b6 X3 v, W, } I (function called is located at byte ptr [ebp+1Dh] and client eip is+ j& U/ d: H* g4 \1 Z1 e( z
located at [ebp+48h] for 32Bit apps)
! W2 I2 o, k& V: h$ d__________________________________________________________________________
. k& `4 f7 a' `) l9 a1 s% z, z: W: c( E1 ]; v8 ?
' _; X( ^0 V! G0 l( BMethod 08% a/ Q7 ~, c& n
=========
/ y i* B" e' M: {* ~8 U( h" V6 d$ l4 }+ S; g ?1 b7 W7 [1 g
It is not a method of detection of SoftICE but a possibility to crash the' A7 `- b' F* `5 J) t! A) J
system by intercepting int 01h and int 03h and redirecting them to another% u( l |$ o: _1 }# | D! i. K
routine.: ?- D5 m% _) z
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points/ `# W3 V, s" Z' K: Z: G
to the new routine to execute (hangs computer...)
/ j6 H6 l9 q. C: F6 K( R1 V( m% H- S& P' \9 R# L/ [4 s' D
mov ah, 25h
: ~" @3 P$ H# c2 A6 }+ L! p mov al, Int_Number (01h or 03h)
) x' t6 ^3 U3 ^5 E8 V mov dx, offset New_Int_Routine
+ L: e u, ~0 @) J, r2 x( m int 21h2 u0 _* R' H7 ~
- A6 a# K) Q0 T1 j% E* A__________________________________________________________________________
6 @$ I3 \$ q* s. H) m& x4 Z; p* { s& j" g3 Z- M/ Y; q6 C. `
Method 09
# O; c& t& J& T. N! b=========+ O8 l' |6 H8 M1 i
9 g1 e5 \( K1 z
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
3 }2 X: r" d; F# a2 _performed in ring0 (VxD or a ring3 app using the VxdCall).
; } j2 ^% w' U7 H1 FThe Get_DDB service is used to determine whether or not a VxD is installed! P' U1 D- ^( Y- b( z5 r
for the specified device and returns a Device Description Block (in ecx) for& ]; }9 o, v5 ^
that device if it is installed.
/ G6 s& [3 n2 B& Q* \5 Y2 X" R1 x% K8 R
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
+ A$ S8 Q5 s: J% U0 y# [9 W" a- u mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)) P/ Y2 N% I0 K; E7 a% S" N
VMMCall Get_DDB$ I+ n* I3 [; q2 e
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed# u' a6 q0 {: y" J p
3 D) z6 P+ u1 ?$ r! n* @- w2 KNote as well that you can easily detect this method with SoftICE:
' s' z* c; h! D' H$ X Y bpx Get_DDB if ax==0202 || ax==7a5fh
1 d2 n0 x4 Y. e2 @ T$ ?& r- t& `; @
__________________________________________________________________________/ k7 X5 o, ~$ D
" ^7 K9 g6 O4 R9 ?7 Z; ]" n( aMethod 10
7 ?: a# S7 j `=========
8 z% k {1 q- M, Q9 L. s' A$ I. ~4 A9 k1 ]4 k8 e/ B8 S% C
=>Disable or clear breakpoints before using this feature. DO NOT trace with
, j ]( l. S$ A g4 I SoftICE while the option is enable!!
- b+ w/ }5 l0 g- Z0 H9 W! `/ ^1 d# \7 |# D) z' N
This trick is very efficient:
& Z- ^' B0 \5 ]8 I: \) Jby checking the Debug Registers, you can detect if SoftICE is loaded
' F# e1 ]& b9 _) q( J4 D, E. ?(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
) [( C5 Z( A3 A2 g; |# d+ g0 n4 M& z7 bthere are some memory breakpoints set (dr0 to dr3) simply by reading their
+ Y( k: t* d& a+ qvalue (in ring0 only). Values can be manipulated and or changed as well
" c8 K; ^8 }! U% }* @, U) n(clearing BPMs for instance)2 P& `: B# O( p0 Y) u2 x
1 m8 {$ X) \2 l% ?( c" d( a5 T/ F! J
__________________________________________________________________________+ K* n( \8 C j( C1 E
- x' z8 W5 |" U/ h3 `; z3 I! U
Method 117 ^7 I% l7 S/ N" u" S) X3 y
=========
5 Q1 m! g1 \& ]* g- J# y
7 P" A$ X q( C1 F1 ^3 LThis method is most known as 'MeltICE' because it has been freely distributed
1 p9 N+ l' g8 A3 {; F! D8 Pvia www.winfiles.com. However it was first used by NuMega people to allow
0 Q! z- e' v) k. i8 c: ^+ @# KSymbol Loader to check if SoftICE was active or not (the code is located
0 R0 C3 C0 [* `( oinside nmtrans.dll).$ c1 b* h" p" {$ K' J6 e( u
. A( e/ I$ S( V. N! t0 |' V JThe way it works is very simple:+ r$ @- _6 }" a; W# N4 A' ]
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for: ^2 k0 a3 S( \$ J8 H6 P
WinNT) with the CreateFileA API.$ \% e) N- M( M9 Y! t: v
. @" s0 c: e, Q0 W% ~Here is a sample (checking for 'SICE'):
/ g) {7 ~) B4 P7 g, G2 v& K2 G2 J( W0 S
BOOL IsSoftIce95Loaded()
! a, e8 ?$ s* Q; d- h{' @' e% z/ }# Q b
HANDLE hFile; & ^+ m# Z/ Y( l& t+ K; o7 v+ j$ n
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
, J, J/ L6 _6 ?/ V( _9 r2 A FILE_SHARE_READ | FILE_SHARE_WRITE,: A; r$ d; ?7 r3 D0 \8 z% R2 @( `
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
" Z: P+ ?) ~4 [$ n0 }: E if( hFile != INVALID_HANDLE_VALUE )) h! ?0 T- h& W4 ^4 \3 t! \
{9 ?7 @: [6 A5 \0 h# o6 d1 y' y
CloseHandle(hFile);/ `* l0 X& M% Y. \/ M ~; h
return TRUE;
* p' e/ o& K# D) H }
+ j2 s4 T7 Q! ] return FALSE;! q' i6 c$ Z4 o S J
}
% d! u/ y' u0 C0 Y( K2 T$ r0 S0 A' A0 I) M( A
Although this trick calls the CreateFileA function, don't even expect to be
! H4 D. Z$ a& T$ X* c6 Rable to intercept it by installing a IFS hook: it will not work, no way!
6 M3 }8 z9 c1 F! T5 ~* B5 ]In fact, after the call to CreateFileA it will get through VWIN32 0x001F: t! g8 q0 N; _# x/ V5 x9 M
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
. D3 H+ o. [3 i6 M. @6 j6 nand then browse the DDB list until it find the VxD and its DDB_Control_Proc y. {2 n: }8 Z( g K
field.2 s4 l& \) n& r: Y# s9 n
In fact, its purpose is not to load/unload VxDs but only to send a
* o5 i6 t2 M8 u+ J$ \' C& IW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)& W: U# \* S. _- c v" Q
to the VxD Control_Dispatch proc (how the hell a shareware soft could try5 X9 ~6 t5 {8 w- `1 o9 t v
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
* B4 \+ ]$ v1 B2 ]) `* |- |If the VxD is loaded, it will always clear eax and the Carry flag to allow
1 R) C8 D: Z! ?3 m9 O& d5 k. l5 Lits handle to be opened and then, will be detected.: I' D% [# X$ n& t* {* C
You can check that simply by hooking Winice.exe control proc entry point/ m/ ^$ ^8 e6 j' ^" i( ~
while running MeltICE.
* o2 w, B, u5 n# E' p6 Z
7 g/ [7 l4 A$ Y/ U: B# C5 M
8 Z% X- g; D5 o2 \( J, O4 ~ 00401067: push 00402025 ; \\.\SICE0 w) H! B- e8 o1 C# d# }
0040106C: call CreateFileA* E4 Z% z- C' k( D x# j
00401071: cmp eax,-0015 T" S1 I4 j! a. f
00401074: je 00401091/ n: Q" @# f; @: e- [( N
! j: L! S. N+ m4 V& y3 v3 x2 [# _6 r1 _2 c; R3 ^
There could be hundreds of BPX you could use to detect this trick.
: S1 z4 w. `+ V: N" ~3 Y% h2 k0 W% b-The most classical one is:& X5 s& g e7 C! M Z6 t! ]
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
! w. D Y( p& X' h4 w2 g2 k2 N *(esp->4+4)=='NTIC'. y8 F3 h; y0 A9 U) C
# P2 V- N- R* T! ?% @8 [/ ?7 f' M
-The most exotic ones (could be very slooooow :-(
+ n! p- U# d0 w8 _0 G, J; T BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') ; x7 Y' @3 d n/ W ?% p* U* M
;will break 3 times :-(
, F# _5 V7 u* U/ t J( o3 K( u* a
( v; l' ~ N* Y4 d# f X3 G; k-or (a bit) faster: / B. O: h, n/ {. S9 F4 v5 X8 M* {
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
% a9 u9 C) A, Y6 ^4 o
0 c4 s$ d) [3 E. C2 t" j2 [ BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 3 _( X/ Z- I9 u( ]( S
;will break 3 times :-(& W# l# v2 E; f) e. X5 c- x# x
8 e, E) m |4 g0 `) l8 s8 J
-Much faster:
) J# A) I& J# e4 m; ~ BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'/ f: ]0 {( z, W' O
7 w: ~0 [; ~0 y
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
9 [# u/ H1 m5 F8 O+ S: }function to do the same job: J l) c% P! m$ c! _: Q& X
9 V6 {) A4 v! a$ Z' u6 k
push 00 ; OF_READ
4 Z- m4 h' r; t6 w& Y( V" T. n( ?0 c mov eax,[00656634] ; '\\.\SICE',0" f3 I; l( _' Q/ n1 f
push eax
1 v | e% u, x$ V. f3 u call KERNEL32!_lopen
8 N" g M9 j- \$ r inc eax
S, z0 d. B- r; a6 z% ] jnz 00650589 ; detected+ k5 w; k; f$ w* q1 {$ j8 l
push 00 ; OF_READ& H+ I- {) W l3 Y: S- F
mov eax,[00656638] ; '\\.\SICE'
4 O4 e7 b4 I6 d2 Q5 P0 z8 J( ] push eax" r- L+ j4 ?! l3 ]0 ^
call KERNEL32!_lopen
: M r( E. g$ I$ y3 {, C+ _# Y inc eax
6 l% y8 g7 O' {: v, c6 D9 P jz 006505ae ; not detected
/ f+ T |+ m$ X
! p) j$ X2 a' `6 Z( z( [ r1 {
: M1 ^5 L4 z& L! L__________________________________________________________________________ p- p( z/ m0 {0 m9 \' O% x
# |0 s h9 H/ v0 }3 l: @Method 12) X& J( Q) m0 J
=========
t1 r( ?" T5 ^* v/ u" }% w' O! \7 f* {2 d C2 F
This trick is similar to int41h/4fh Debugger installation check (code 05* O" S7 t3 G! S
& 06) but very limited because it's only available for Win95/98 (not NT)
$ E; x" z z/ las it uses the VxDCall backdoor. This detection was found in Bleem Demo.( @$ { L4 m, @, r [% e7 I/ S" Q9 p4 M
! g( ?. Q! U' E2 j! L
push 0000004fh ; function 4fh
7 v$ k+ Y. S% q: g; @, B! J4 } push 002a002ah ; high word specifies which VxD (VWIN32)# u% M* T) K$ F6 Z& P$ k1 R" s
; low word specifies which service
1 }" q. n" I7 A- C (VWIN32_Int41Dispatch)7 O( }" |% _+ J7 w
call Kernel32!ORD_001 ; VxdCall- c9 _% Z4 q J2 n
cmp ax, 0f386h ; magic number returned by system debuggers
& |& B$ \' U+ l9 h jz SoftICE_detected
1 O4 o4 Z. U; o' X3 l/ `4 o5 \
3 y4 A7 A q* d7 \# IHere again, several ways to detect it:* `& c7 N+ n* y' z# J9 Y: K
2 I$ x5 J" c% A& O
BPINT 41 if ax==4f
/ L+ F' Y7 d* ^8 r+ Y
0 B" w' J) b7 v. x; S BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one: W2 u; G5 }6 A1 V
! N# E9 C% l1 i. D5 q' l/ v1 C& ~ BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
. b. Q, [! a4 Z5 H/ y& t& @, z @: J: f+ T" X. T: {9 h
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!. F* m: y. m# L4 c6 t7 [5 H
" j, c1 _2 X0 A0 a; t3 g0 B* p* r
__________________________________________________________________________
+ |+ Z, X4 ` Y; l$ D) T4 s0 M9 @" `2 g8 E( L1 \ |
Method 13" A3 ?9 ?# s! S* X* x) r& v B3 V! b
=========4 u; s; W$ d6 i" ]7 J/ p
$ e2 ^% k6 m! m& z, N: dNot a real method of detection, but a good way to know if SoftICE is- _) |- o2 R7 f
installed on a computer and to locate its installation directory.
- R r* [( v6 ~5 z9 Q# w; J2 h# TIt is used by few softs which access the following registry keys (usually #2) :
T( X) l( h- M8 k0 ~9 R7 i( H% a* i
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion8 {0 H6 B; {, u# I9 q
\Uninstall\SoftICE3 J9 c5 f, i1 R [0 ~" F
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
( h/ x2 X9 H: I3 p-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
. t3 X6 U! u5 p. t1 @% Q5 w\App Paths\Loader32.Exe# m. o. ^. O; q% z" D
8 x# ^# b6 W$ \: k/ Y6 Y' O, t6 W
) D3 ~/ F! u: ~1 w* Z9 qNote that some nasty apps could then erase all files from SoftICE directory
! v4 ~. }. X' @(I faced that once :-(
. t a, t4 \0 p$ f ^
8 H$ u, ^. \$ |4 ^" N* c+ \* vUseful breakpoint to detect it:
9 z% c( z2 ? c% U- I# ^; _) V4 c7 n7 [5 _
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'/ v4 ]+ F* S1 x2 y% H7 T$ m7 g% `
) y! B0 T+ X- w, @1 d* {__________________________________________________________________________
0 I! t! \2 R5 A' |4 U: T$ f" f! X/ u8 D2 G4 r: Z
) S# {- q# L5 J7 t9 d1 a
Method 14
9 ]" }$ \; y& Z- }8 _7 a5 S Z' W3 W=========- K1 G3 p+ P2 c% H" f
6 F( y' g! o* M4 i
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose3 h% l" j2 u6 ]' g5 c% H Z4 v' V
is to determines whether a debugger is running on your system (ring0 only). X7 f3 Z7 X4 v- a
9 ^* b0 K7 g7 j
VMMCall Test_Debug_Installed
; S, A% d1 E2 J: ]" j je not_installed% {& Z. X7 e" g! [
) @4 W* {' a, c* H$ l! \This service just checks a flag.
$ s2 k0 b. n3 p4 Q</PRE></TD></TR></TBODY></TABLE> |