<TABLE width=500>
3 V$ e( y0 `( I3 j5 g5 z<TBODY>$ ~" \2 R) k! N1 l
<TR>
2 ?8 ]* u( u6 o5 U* X<TD><PRE>Method 01 ; F& d2 F- }" X2 ^; ^4 S
=========
6 |6 V) D# J' v
" [' Z" }0 K8 j# Z- ^8 F# aThis method of detection of SoftICE (as well as the following one) is
* E+ E4 E! \/ o2 O8 q- p$ J" Tused by the majority of packers/encryptors found on Internet.
- p9 w+ v, W% ~/ }. UIt seeks the signature of BoundsChecker in SoftICE7 K$ L* }9 Y2 j" D" S- G/ L
2 e7 a# c& I4 y/ F7 x* u mov ebp, 04243484Bh ; 'BCHK'
2 k3 c9 P. _' {. I2 d, U# x mov ax, 04h# @' n5 ?) {4 g6 \0 k6 h1 m ]
int 3 % I1 {5 m$ G0 |% Q4 [
cmp al,4. y, `6 m0 c$ u: L* g& e( A
jnz SoftICE_Detected8 p& u7 q) T- Q, Y5 k
- D' N: Z! H6 }' {
___________________________________________________________________________7 d: p% w: ^' R3 A4 f* T4 l
5 v- r$ G5 Y/ ~Method 02
; ^0 g8 b# b$ w% N, X=========
& i1 e/ k5 d9 ^' j1 N# e5 Y# Z, b: z' s* i5 Z' ?9 `; e
Still a method very much used (perhaps the most frequent one). It is used9 {0 \7 |6 t4 k0 ]' R8 l: I9 K
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,/ k, u7 D5 C/ r" \
or execute SoftICE commands...
2 H; o1 h) r5 J2 g" ]" a7 {It is also used to crash SoftICE and to force it to execute any commands* O8 s* s' S5 l
(HBOOT...) :-((
& s% A2 U% t* b7 F# ~7 m1 B: h, N+ r6 N2 m: X
Here is a quick description:* \& i) ?, F- [' f3 g
-AX = 0910h (Display string in SIce windows)- C7 M9 N, n& `7 f) G8 @
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
* K% O! u: b2 T: q-AX = 0912h (Get breakpoint infos)
) h' n6 S- a: ~0 j-AX = 0913h (Set Sice breakpoints)% B; o( A% F9 {3 W m% T i
-AX = 0914h (Remove SIce breakoints)" I) j6 ?% d9 m9 R+ C( K* m2 y
/ z; Z* v7 j7 B, jEach time you'll meet this trick, you'll see:" g2 j, [8 s: \5 g7 o7 h+ k
-SI = 4647h. T; e# V/ G* a+ |* Z3 D7 A
-DI = 4A4Dh
- T& L; p- o) }Which are the 'magic values' used by SoftIce.
( i- x! _7 f9 Q( k% X* U8 ^9 IFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.9 _% T7 j% d# `6 E/ b+ v' j
6 q8 _2 v$ _& K" @Here is one example from the file "Haspinst.exe" which is the dongle HASP+ P- o* B& Z. L5 y' V
Envelope utility use to protect DOS applications:- [4 G [# ]2 l6 ]: u
6 N& ]' b, M: H" `( r7 c
9 D1 s) X. [4 j
4C19:0095 MOV AX,0911 ; execute command.
) V+ Q! v/ T: a6 p4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).' `* l7 C O6 K1 U( v5 Q" e
4C19:009A MOV SI,4647 ; 1st magic value. q9 a9 i9 j& v% i. @
4C19:009D MOV DI,4A4D ; 2nd magic value.
, r) t6 }! \( f# F4 _/ x4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*); G" `4 b& f& _0 @3 N
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
: J% l# Q* \) N( u# x. B0 h: P. c4C19:00A4 INC CX4 U9 P, H& ^7 M6 k/ A
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute8 X1 _* h: M5 n
4C19:00A8 JB 0095 ; 6 different commands.
: R7 _! `% v3 t9 E8 K4 D" p. [4C19:00AA JMP 0002 ; Bad_Guy jmp back.
" Y1 F( w/ a3 `! V4C19:00AD MOV BX,SP ; Good_Guy go ahead :)( g4 G! ^$ M: ?. m8 F- W& ^9 F
2 t( x) P' n7 K% ZThe program will execute 6 different SIce commands located at ds:dx, which
' U8 V/ E+ c% h9 N- H* @! Kare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
# I% l+ q" k5 s" n6 z
: k& W4 j' s- z* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
' b* m* J1 P: [" R___________________________________________________________________________
8 {0 G0 S4 |. g/ q- W1 W7 N
( K5 Z3 K* K% v4 Z; a3 r
5 ~. u) G4 S' Z: ^Method 03
0 E, \4 x; V3 b! o. X7 d- i$ i' t1 q=========9 K* I5 M. e; i" R, `" X3 }0 `
4 l$ K2 u6 l! X \. x& h
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
8 S9 S. S T' N# X(API Get entry point)
0 K( H) Z! y0 S2 V- c) \. F9 g: o: G5 X) C
9 @ C9 p9 q: N" j* s
2 ~ m' _1 H' M- Z xor di,di
, Y; ]2 Q7 l# _3 G6 U v8 ] mov es,di3 A* a5 b4 l, t; I; Z$ @
mov ax, 1684h
d# C1 [5 u: n U mov bx, 0202h ; VxD ID of winice; e0 @& S9 `. x' v2 C0 F
int 2Fh& L, r+ b# @* `1 E
mov ax, es ; ES:DI -> VxD API entry point
9 r1 y. w- O) q1 y5 x; U3 C4 ] add ax, di
$ @5 {6 W/ x& Z' r test ax,ax
3 p* ?) V: a3 B1 Q+ U jnz SoftICE_Detected
, g% z) Q v' h! ^' `0 _" Q m" X9 ~0 J$ P3 V- j* D+ t7 s
___________________________________________________________________________; a, }* j* k' l( }: m$ ]
8 Z8 n- X- v. D0 j' kMethod 04
& X2 D7 _! x1 M. z2 G=========
?6 l% X6 y& W/ R! [& i5 G
2 W8 t! t: T. `3 lMethod identical to the preceding one except that it seeks the ID of SoftICE" m+ B5 K+ }7 _
GFX VxD.1 }* f3 L8 p, c9 z/ ]
6 {+ K2 Y' _+ |6 }2 ~5 N$ N xor di,di
- y) _/ h' D) }3 ]+ s mov es,di' c7 S& ~1 E8 ]- g: B7 d" |' s
mov ax, 1684h
2 m$ A4 `6 z6 z6 J" E& \ mov bx, 7a5Fh ; VxD ID of SIWVID2 e9 o; p7 D, J/ D7 }+ q8 i
int 2fh
* [. g* z/ R( P( x1 ^ mov ax, es ; ES:DI -> VxD API entry point
; b" h0 ?+ n7 C. T1 r add ax, di
. k* n7 D8 I5 g3 Z) v test ax,ax2 C8 c* u9 p2 G8 v$ ^: v
jnz SoftICE_Detected
6 D M8 J: J" W- ]" y/ S5 L0 _0 R3 p% d; Y
__________________________________________________________________________- \+ v9 J; M4 ^. K; T+ |+ ?
! U8 V& }; G9 t c6 O- M8 _
4 t/ y3 P S9 [: c! i8 E T4 T3 ]% ?Method 05
* O( m$ U. K6 w' U" D/ G* c=========
- w1 ?; c# x2 e1 b: m |0 D
; ?. A8 x" p7 {6 t6 dMethod seeking the 'magic number' 0F386h returned (in ax) by all system
5 U n- }( S# X% \/ \' z4 n: ?& k) vdebugger. It calls the int 41h, function 4Fh.# n6 X, P. Y$ H/ J6 a
There are several alternatives.
' I$ b& L) e" w' w! R- ^* Y; X/ z' n
5 c* `3 X1 h! D% o- VThe following one is the simplest:
- j+ R, ]: n- p- h0 Q7 |& ?, ~6 K0 k4 N1 Q
mov ax,4fh
% @& S# {) Y3 u' y int 41h
3 ^9 r9 @' e, i1 I+ C4 u cmp ax, 0F386- q6 R; c1 d* n, }8 E" r5 a
jz SoftICE_detected
, m, F& V3 W# J; P- p0 e, {* W
+ `' W4 I) \: v2 m" O- P. E/ k# y Z% f
Next method as well as the following one are 2 examples from Stone's
2 a1 ~/ O2 ~4 t' n, w"stn-wid.zip" (www.cracking.net):
, C/ O7 H! f# D) m% G. z* z0 P0 S8 E0 @: @' W! }
mov bx, cs9 O8 m4 P3 F6 r* q2 ^
lea dx, int41handler2
/ b1 n( F& Y1 G4 [ xchg dx, es:[41h*4]
0 \' S* x# L4 }7 Z- s% f6 B1 T5 x7 E& m xchg bx, es:[41h*4+2] F; b) o" k- l5 o3 P. ^
mov ax,4fh- U4 {0 q& R9 s% a$ k
int 41h: {6 b' ]* O( P8 ^) D
xchg dx, es:[41h*4]- ?' z# \9 \" |( Y8 |2 G, ~
xchg bx, es:[41h*4+2]
" p: n% h6 N& ~ cmp ax, 0f386h9 e+ H. c" i4 u% h
jz SoftICE_detected1 K1 j' b- h+ h; M1 c
% l2 H4 z3 d4 `% e( xint41handler2 PROC
$ z% x4 N6 u& m, q: Y iret
0 i- g; j! r+ H0 ~& \3 N( Qint41handler2 ENDP
, r3 @" U; _+ r) B; V8 [
3 n% e9 }* ]% M9 z8 M4 A: N! ~
' E% {" n0 U/ y5 l8 Z9 o R_________________________________________________________________________" b/ A" t9 T/ |3 f
5 ^, F8 g) K0 C% s1 X
% G3 h5 j2 a$ x' u2 CMethod 06
+ m& m! ^% r0 m=========2 o, C/ @; `' n! _. y4 `
* Q s6 P+ \6 n0 y: k, X2 P! p; w( @! X' ?. F* b9 T( ~
2nd method similar to the preceding one but more difficult to detect:
2 U5 O- W" Y) o4 { s o
5 \3 T( Z# z' Q5 h- h3 b( U& f7 h* L; P
$ o9 Q7 o/ O& `* U+ l- y1 tint41handler PROC
' ~% v$ l, J, z( L% t2 `$ ]/ g. O mov cl,al* M; \5 z$ H4 H$ U
iret
4 N2 c% ]6 c0 L X% Zint41handler ENDP
6 V/ M. R9 q# J8 w( b
6 @" V4 P! E/ o' x! w8 c. d! o( A/ O. @/ Z; R. v; |# \- C
xor ax,ax
; b0 O' N) m Y E mov es,ax
, M$ m: p' n/ {1 k+ \ mov bx, cs4 i0 f6 p' n4 f6 X/ L# w. ]5 y
lea dx, int41handler; _- Y5 m0 Z. _3 u
xchg dx, es:[41h*4]
1 E$ o) x2 z- A4 R xchg bx, es:[41h*4+2]
9 l. @, E$ H9 D: J2 A P in al, 40h
% d0 Z. \8 T) W3 K. i9 B: d9 K xor cx,cx
7 [, q2 V3 Z7 \! m int 41h' @$ z2 M5 [/ p8 R: W- t& @8 q; M- {' @
xchg dx, es:[41h*4]
! ]2 m$ k" S5 j xchg bx, es:[41h*4+2] a9 x' C6 {% |" D' G8 \, k
cmp cl,al- \6 J/ O7 W6 q9 k F" L: \3 a
jnz SoftICE_detected% y4 A* z8 H; O2 g- T' x# W, P
' d2 v0 m0 F& g3 H_________________________________________________________________________) |6 R o2 G$ ^- l7 R& {
( [1 x6 N) `: n# N, w8 f0 bMethod 07" J7 X2 O0 `) Z" h, K+ d
=========+ o+ s$ O! e1 b o. k& h
c) k7 U( p F- y7 ?9 o
Method of detection of the WinICE handler in the int68h (V86)/ x* E; ^3 Y1 e: ]- A
! l/ q- x+ h& z! ^6 Y
mov ah,43h
6 w; v0 p; o# h" ~ int 68h
' @8 j# K" v, `' z ?. \) W cmp ax,0F386h& k+ A5 S4 [9 o6 N2 _
jz SoftICE_Detected
. R/ h" V' I: C* k* S* D1 _/ W' H J& x2 ~0 x( t
2 v) Z' F* A) I! W& t1 o* I=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit; ~( I% d8 V2 N. M4 r
app like this:
1 U: v* U5 C* J6 r" M! f2 [3 h
9 S( A% F* z' v; @ d6 o BPX exec_int if ax==683 y3 Z. H& s2 H( F6 T
(function called is located at byte ptr [ebp+1Dh] and client eip is
0 X" u, t3 r, W: `2 d0 _ located at [ebp+48h] for 32Bit apps)
) W5 X, O" r; S: ]: T__________________________________________________________________________) x3 Z9 q; S- _
, t, y4 ~, ^ C+ F+ V" h+ A% X; t2 k; f) d) z
Method 08
' J1 Z3 I' J. K; U% V& v2 R=========7 ^! H; K9 S/ Q4 d5 b
! V# M9 p+ n' b+ a& ]
It is not a method of detection of SoftICE but a possibility to crash the2 d) J, K" ~2 c; m0 b! F
system by intercepting int 01h and int 03h and redirecting them to another8 B2 l6 t( H) u5 ?6 J
routine.% p- m6 V) _7 H# Q% d5 S+ S
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points% l- Z/ P% ?- y Q l$ q* u
to the new routine to execute (hangs computer...)
, Z9 b' R( O% T7 j8 L) J
6 n* ^# @, }9 ] mov ah, 25h; P3 s2 [* S7 G) y, _
mov al, Int_Number (01h or 03h)
* E2 X! f; h/ @* W1 @ mov dx, offset New_Int_Routine' ^) x9 V- D5 G% U, h a
int 21h
) H& n4 ]! i/ A. y4 L3 u0 a2 a: v1 a7 t$ X, E4 }' o0 A
__________________________________________________________________________9 O& m( a9 ]* `" i9 t: Y" p4 z( `9 _% v
6 m9 b5 ?' v( s# @* @( \Method 090 r" u. X# T( X" a
=========$ a0 S. d' g* l; W) ]1 F2 W* E. ^
' K$ Y3 y1 o7 g1 H' u
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
/ p. P$ f4 D, O5 T# Gperformed in ring0 (VxD or a ring3 app using the VxdCall).% w) y' N' l% j% A" _) C/ g1 [6 n$ G5 `
The Get_DDB service is used to determine whether or not a VxD is installed0 [' k8 o, f; Y' p' D2 Y l
for the specified device and returns a Device Description Block (in ecx) for
* e3 B9 C5 F: e5 x. S, ^' Y1 Tthat device if it is installed.& v4 \" o7 H. s) q8 K$ C
$ H8 s/ z2 P( b+ t3 E
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID# g: g2 {; F3 _9 \0 V
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
& g: a% C0 x- w$ |7 ?- ]5 _. Q VMMCall Get_DDB; f9 {* k9 X3 P+ m
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed+ I) M4 ?3 B& Q* A# b
4 a, G/ R$ s1 u
Note as well that you can easily detect this method with SoftICE:
9 a8 ~; p. `5 {5 W# F6 o bpx Get_DDB if ax==0202 || ax==7a5fh
" @5 C+ ]. m6 o% K
& m D6 B$ a9 C__________________________________________________________________________
`" @% N+ \5 r$ V* d! T1 v
+ b5 L$ d; [3 F* i0 R$ {/ {Method 104 Q+ z! K: |7 N2 \) R: ?6 Z+ r
=========; N* f8 d5 q% L4 n, x! D
. `7 ~9 [7 l# Z
=>Disable or clear breakpoints before using this feature. DO NOT trace with
# N5 d6 q8 [2 f5 c SoftICE while the option is enable!!
- P7 X: W" j J" y3 @
2 A7 H" ?: ^- j: h7 f) z3 f LThis trick is very efficient:
) z. J. o( B) \; i. |by checking the Debug Registers, you can detect if SoftICE is loaded
$ K1 p5 ^$ ?' w, j. s) U* b( U(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
- d9 Z2 ^' @; o5 }3 s9 d, uthere are some memory breakpoints set (dr0 to dr3) simply by reading their- L& a8 f& ?' p/ s$ k( T
value (in ring0 only). Values can be manipulated and or changed as well% U! b2 s- ~' ]6 S, z' {
(clearing BPMs for instance)
, `6 G F* s& j+ Z( D* o. m5 g
5 R) X. i/ A" D; i1 ?' K__________________________________________________________________________5 f. ]" a; o- d L6 y
9 j1 ~5 V) e) p4 PMethod 11
1 }, T P% m! l$ t. Q=========
2 ^/ i5 h4 Z) x( j$ ~& A; @; w% _) h% s; q; `% O4 C
This method is most known as 'MeltICE' because it has been freely distributed
$ L# I0 M8 Z) ]! f+ gvia www.winfiles.com. However it was first used by NuMega people to allow
1 l: V, `1 ` u" ^$ [Symbol Loader to check if SoftICE was active or not (the code is located
) o# f# L5 c' M' @: |inside nmtrans.dll).
6 ~- V4 O+ S& ]5 M6 E) j7 T# v7 T( s4 M+ X
The way it works is very simple:
" p$ _( r/ q$ |0 i \) D% x- sIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
# a4 G$ U3 n2 z, p* j& OWinNT) with the CreateFileA API.' C+ D4 Y& O! M4 `+ l% w1 n9 T
8 P# \0 M0 ] ^! l- ]" g/ S$ s
Here is a sample (checking for 'SICE'):7 b! E/ Y8 Q" _. s0 P
- j3 [8 L5 f$ k1 f' `3 KBOOL IsSoftIce95Loaded()
, b. W/ s, x7 a t! @{
1 U9 E1 N1 m, j+ L" R* Q7 o4 H1 S HANDLE hFile; 2 { ]" M" n$ q, X( F( [; U/ p
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE, l8 ?7 c+ a, }/ {% T) G, B0 O0 q
FILE_SHARE_READ | FILE_SHARE_WRITE,
8 d2 w2 i7 ]+ ?6 A, W+ T NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
/ u9 L! l+ Z# i6 ~ if( hFile != INVALID_HANDLE_VALUE )6 `0 Q% z. l, b) E& a
{
9 g1 T, h; E( W, ]6 U# A! P6 |% f CloseHandle(hFile);) ~) y: g9 E5 L2 S
return TRUE;
( Y) N8 X+ g; |: w: p1 l% s }3 r1 k: O. `, o: |3 {
return FALSE;: c$ @5 N% M, E
}' G7 Y o: @7 `0 f, F, _
8 K" c F$ C0 c! jAlthough this trick calls the CreateFileA function, don't even expect to be
3 k; G1 V* X s/ n' Eable to intercept it by installing a IFS hook: it will not work, no way!
3 I( z8 R- X+ {* DIn fact, after the call to CreateFileA it will get through VWIN32 0x001F& m. m& y# q3 E# S
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
* F( c$ k" D" wand then browse the DDB list until it find the VxD and its DDB_Control_Proc2 K# r6 ?* d) ^( ?
field.
* B. m5 h5 ^* G, ?In fact, its purpose is not to load/unload VxDs but only to send a
6 p1 i; ]6 P- p$ m$ [W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)! G* C( f9 i9 @0 ?, Q' K9 o$ B
to the VxD Control_Dispatch proc (how the hell a shareware soft could try- _1 x$ u8 @; q7 T P" c6 z* s
to load/unload a non-dynamically loadable driver such as SoftICE ;-).( B% p5 o1 ^2 o* L; r/ g# ~! }
If the VxD is loaded, it will always clear eax and the Carry flag to allow$ P* c' H$ h9 E! {- U6 m9 g$ ?
its handle to be opened and then, will be detected.
" L5 z% H1 i- Q0 C' `4 `. d1 N9 X8 kYou can check that simply by hooking Winice.exe control proc entry point+ g+ r1 c3 _# ]% n6 ~. X% P3 W1 J0 f( ~
while running MeltICE.
, J7 z9 q* A% B0 [
' L) N4 h6 U& Y! {0 y4 e: E
1 q, d- v! J8 n, l" h# P 00401067: push 00402025 ; \\.\SICE) {" Q! n) q6 x# S' B
0040106C: call CreateFileA
8 e' c5 J6 c8 g8 P+ B; b3 n% X: e 00401071: cmp eax,-001; Z2 M2 x& E7 g; x
00401074: je 00401091
4 `9 I- S& S7 \1 F, i7 W* I% N; F4 {& a
# t4 j0 S6 I5 S! V2 R0 v6 h" O
There could be hundreds of BPX you could use to detect this trick.' h8 F: \6 U5 u& I
-The most classical one is:
# k$ B2 T4 S J: |& z' m BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||9 p; n# T$ @4 J9 m: }
*(esp->4+4)=='NTIC'
0 f' K6 Q& m$ u4 Q( ~5 s, {" {7 ]% @
-The most exotic ones (could be very slooooow :-(
7 c: {1 d5 a% z% J BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
* z9 l6 [6 o" q6 `" W! v ;will break 3 times :-(- N0 d& }. d: J. N }; B
/ `3 X4 n$ j* i! y# Y( K
-or (a bit) faster: 4 d, P! }) S# D6 N& O/ ?
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')( B" \5 B4 K( c" V, s" t- p/ @; C
$ I: b* H8 d: d0 o' x2 }; v
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' + S$ A2 n' A. Y( x; s! U
;will break 3 times :-(# P8 E4 X. E; I; M6 G! y
$ y ~: u' f& d! }9 d8 i-Much faster:2 s) W& F3 K* M
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
/ P- b' h# \/ Y
4 G1 L' N; g6 K- q. D: k% zNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
$ k% c2 Y0 p i9 i$ r& h8 i1 }function to do the same job:
3 Y" |2 [' H8 l7 |+ K% w+ Y- B0 z5 h% S& T. ]1 k1 B
push 00 ; OF_READ
# f1 i6 K1 ?- w( ^5 R2 M7 E! ` mov eax,[00656634] ; '\\.\SICE',0
% u! |* A5 g' y push eax7 V3 }6 X8 N1 y- y. }* s$ h
call KERNEL32!_lopen
2 P& V7 H) o1 i ?: s inc eax$ l# r/ ^& A& R( y, k
jnz 00650589 ; detected
& ~- @+ u- A) a push 00 ; OF_READ- }9 t. o2 t/ s. \
mov eax,[00656638] ; '\\.\SICE'! i( Z' p8 u) |/ y/ e
push eax
! t. m |" L- N3 n* O6 X2 e# | call KERNEL32!_lopen3 ~; u1 f t+ V+ u
inc eax! G }# L6 H) X; Z3 ?8 k) p1 L
jz 006505ae ; not detected
# ~8 f1 X, y) f$ }+ E3 F9 b. [/ g6 y- M
/ C( t& k4 k" Q, A
__________________________________________________________________________
9 y/ }4 O6 r; Z7 C" c
4 @7 ~ n3 ~3 ]7 Y4 AMethod 12+ A0 D& Y) S, A4 U
=========
4 Z# N' ~1 [# z: W7 f G# V/ v3 j3 ~" A" s. ^7 f- O
This trick is similar to int41h/4fh Debugger installation check (code 05 {1 v- x6 X, Q- ~( o, w
& 06) but very limited because it's only available for Win95/98 (not NT): [( L k* D- F! Y5 C) s
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
4 d0 W5 S5 l& p! b, a, q8 _' q) z; X8 d* x
push 0000004fh ; function 4fh% g' ]8 b3 \* u
push 002a002ah ; high word specifies which VxD (VWIN32)" j$ a: V$ k; G; r a# I
; low word specifies which service
& j f- Y4 @' L! i0 y2 D (VWIN32_Int41Dispatch)
% }0 V( G- _& ~" [6 h) a; R ?3 d4 e call Kernel32!ORD_001 ; VxdCall# ]$ D/ F( Q; E: ?: e
cmp ax, 0f386h ; magic number returned by system debuggers0 Q0 K% H+ t8 a
jz SoftICE_detected
2 d# o6 ~" X) Q2 W, z/ U& l) e' M5 v( R
Here again, several ways to detect it:. r- C6 u4 }& F# i! h5 B
* d9 x+ z' l5 M& w9 a9 k
BPINT 41 if ax==4f. G: n) k. T7 y6 L
' z) Q, x3 R* X1 D BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one0 m' f, i$ {, e" a2 ?2 i% w
% Q% {& m- z* e9 @6 c! C& K- ~ BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
. X5 G: S x2 q" |) f" y
, r, L# u+ C' n BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!# V K5 x+ q9 a
6 M% Q" P' V0 n) A( [0 S# G/ F# t
__________________________________________________________________________3 m6 M7 k0 E* L' E* y3 d' {1 Q
( g- ^' B1 l/ ~; W. e# L
Method 13
2 [. g/ W$ j A% i=========& o; f5 r# ]- u/ s+ y
8 Y" l; ] Y" S8 U8 J8 q5 U
Not a real method of detection, but a good way to know if SoftICE is
V3 N' j+ x8 Q1 D2 O5 ^installed on a computer and to locate its installation directory.- S( g; B1 p/ c/ |. `$ U
It is used by few softs which access the following registry keys (usually #2) :+ ~2 r/ W5 a4 G3 f* W, p6 O
6 @7 q$ i* H3 |+ Y p-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion1 B }+ s" K4 L& H% [5 j9 c8 `1 {
\Uninstall\SoftICE
! T- ]( s( S9 T, I8 |-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
# d+ L4 _! ?1 J& ^3 b: b-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion2 O8 x8 H0 M( n
\App Paths\Loader32.Exe( B# [1 _* u( z0 C& i2 U6 l
% [' b+ K: E h9 q+ V, ^- b" B! D; u r( W. @, |
Note that some nasty apps could then erase all files from SoftICE directory
* O1 [2 J: @& |+ h: V(I faced that once :-(
3 `( D8 L- y5 @# {1 o( F$ b- [! \! h; `& g* j5 e+ c1 V! j, ]
Useful breakpoint to detect it:* j2 x6 z4 a" O& O! O' I7 e
# C/ J2 X; v) f4 {
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
F0 ?' X# w/ p4 K6 W t3 [' j
& A1 n( G; U4 S. d1 K__________________________________________________________________________$ j/ X1 B& J4 Q( W, O/ r0 @4 K, d
7 V# g: L1 x% ]2 _- w3 i) G, c
( e( S8 [9 ^! ]% y1 b+ K' ?Method 14
1 q4 j1 ?( }$ ~4 a; ]" K=========. ~9 z$ K) E# y, r6 A
5 D7 O$ j+ X/ Z, D- B1 M
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose( U8 w9 @$ o; g9 s9 `
is to determines whether a debugger is running on your system (ring0 only).
2 s4 w: P4 i. a& M- J
' x& A5 A& \! O9 z4 g8 z6 t+ j VMMCall Test_Debug_Installed8 _# J# W; m2 P5 k7 h
je not_installed' m# h4 l$ O1 s- C% U- B c
3 y, x: f6 R+ \1 b3 qThis service just checks a flag. t1 u5 D, Y9 [4 y$ N! p% Y
</PRE></TD></TR></TBODY></TABLE> |