<TABLE width=500>4 h$ L6 T3 H* c( Y; f; U
<TBODY>
. u" v! F/ i3 Q) w: S<TR>
, r; {- t/ F ]: E' H<TD><PRE>Method 01 ' | K8 X- }) t$ F3 ?% ]
=========
/ }/ v! ]0 [5 c# d2 p. ]$ A8 t
5 O$ k, h0 u. W6 xThis method of detection of SoftICE (as well as the following one) is+ ]* F9 u. u8 P- i
used by the majority of packers/encryptors found on Internet.* g4 w- G/ C& [$ I
It seeks the signature of BoundsChecker in SoftICE
' g7 A# `2 Q! I. `( G0 O
* x) E! O- F7 \ mov ebp, 04243484Bh ; 'BCHK'9 v1 @8 N* j! A% A6 T3 o) w
mov ax, 04h
( E8 P$ O n0 I4 ] int 3 # Y2 M( y8 [, o
cmp al,4# L, a4 J, Y9 U& U2 ?6 l2 K1 K
jnz SoftICE_Detected, I$ d7 n- M7 L8 P* E3 |
6 C: w; j/ b# Z
___________________________________________________________________________% j; Q9 s* V# J
9 N2 B' ^# L* Q, ^* A9 x' @/ o
Method 02
" }! e( C0 T) g2 k3 J& c7 s4 J=========4 C/ j2 B' Z0 v; _
* m1 B3 X2 U, x2 J$ ZStill a method very much used (perhaps the most frequent one). It is used
# }0 c) n4 _" K: ?- S8 Z8 u* C5 Wto get SoftICE 'Back Door commands' which gives infos on Breakpoints,9 w' h. l& H! O: ~/ W p! T6 r _- o
or execute SoftICE commands...
! l1 b3 k; v1 LIt is also used to crash SoftICE and to force it to execute any commands6 q# z% @3 g' L& G& d. k
(HBOOT...) :-((
. b/ M5 Z4 \/ Z9 H. M! J' V* b- Y
1 H/ S3 Z' X. x* E/ j; aHere is a quick description:
/ @8 W* p" M3 H2 m$ W- ]. x: u( H-AX = 0910h (Display string in SIce windows)
1 \1 h: G: C4 l+ _# z" i-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
! G% v: X' I7 A+ o6 e0 E# h-AX = 0912h (Get breakpoint infos)
- U. @6 H2 e0 |: u* x-AX = 0913h (Set Sice breakpoints)# G- y2 E6 t! [* W% c
-AX = 0914h (Remove SIce breakoints)
* B3 W* T: {1 g2 h& j& R4 h0 A/ q4 W. U7 u: M2 n9 d6 @
Each time you'll meet this trick, you'll see:* F. H, b2 ~0 G" `- U
-SI = 4647h& a: q2 Z; ?! N
-DI = 4A4Dh3 l9 C7 k9 l( V Y9 k0 H
Which are the 'magic values' used by SoftIce.) c& P* p- _1 z' }# ^* k7 p0 `7 r
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
! p; J" E3 I% U4 d. l% @8 \: w( M/ B) E0 q/ f C5 w- }
Here is one example from the file "Haspinst.exe" which is the dongle HASP) Y4 ^9 F9 i$ G" F, M ?: S% M
Envelope utility use to protect DOS applications:
# z) b) l% y/ G4 Q7 u
& n9 [2 z- a! U A- I. V. R0 b/ M# F: r) V8 k* c' y9 O1 I
4C19:0095 MOV AX,0911 ; execute command.
4 E1 `/ ` [ O9 r; n% p. S4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
. W, [/ v5 h6 K* b3 l4C19:009A MOV SI,4647 ; 1st magic value.+ P. j" Q. g& y @- `, G" Y
4C19:009D MOV DI,4A4D ; 2nd magic value.( B8 D7 E% f* s( [7 x7 `+ C8 e( X
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
8 J. T0 O6 `$ X7 B% `8 W: o4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
, p' Z7 h# l$ a$ F4C19:00A4 INC CX7 [- Q* G2 {* B+ ^7 z- \
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute$ F# n2 x3 s/ ^9 D" [ U
4C19:00A8 JB 0095 ; 6 different commands.$ |3 R$ ] k6 q0 A. T: W
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
+ l' j5 K( N. y3 A4 k4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
, [& U3 Z( M, k+ ~8 p$ i
- E- b$ Q$ r0 j1 U; {* `+ bThe program will execute 6 different SIce commands located at ds:dx, which
6 D& n7 N; C7 D1 Q: [) e6 w, Q& _are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.' s* {! N9 g8 ^# w: |5 G, k
6 U) ^, L5 J2 E4 W) W* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
3 Y4 {5 e# Q& Y$ o. V___________________________________________________________________________
# W+ Z- F7 h* e2 e/ `
' A4 p' f' ^) i: P3 P% t& n* Z. p/ M
Method 034 ^9 |+ [, T) G0 _: E
=========
( x5 ]9 z% K" V f8 p3 N/ g: R4 t' P3 ]& z, E
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
, ~5 t1 ?0 H% ?/ s" }(API Get entry point). o: |& V, M1 [( q/ u! ~: I
`& P" E. @' G7 V5 r
6 s M2 W, H6 _ xor di,di3 R+ Z( N ?0 ~" p6 i/ b& g
mov es,di
! {' s3 v: j' o+ c/ u' s mov ax, 1684h 6 D; F& @# G: N6 B4 Z# v1 B
mov bx, 0202h ; VxD ID of winice& q# ]( m4 r/ W- F r4 b9 U: j' q
int 2Fh
! E! S5 y n% }+ Z4 A# d mov ax, es ; ES:DI -> VxD API entry point! Z) H( p" |, ~1 g
add ax, di5 B; Z' l l4 u9 j- e
test ax,ax9 I8 D# P. w4 u
jnz SoftICE_Detected3 {: S8 e6 T6 D4 \5 ?7 F* e" m( X3 S
! ~# ^9 A; D5 h5 U \% A___________________________________________________________________________: U6 c. F3 z, Q" T& p% Z4 E: T- _
7 S) Y7 W+ N0 t5 S) h' S7 ?+ `Method 049 E" ?+ Q% J4 _& w2 f
=========
: l# y9 u3 C/ |% P* h% w) T w2 m" v0 \8 V z
Method identical to the preceding one except that it seeks the ID of SoftICE
! _8 H' V( B! oGFX VxD.
7 P( s% m9 v2 u O8 G9 F5 p
6 S+ F3 W/ N. G: y7 g% `1 ? ~ xor di,di
9 {% C. h$ w4 |' q- {4 ] mov es,di
`* V9 r4 h+ P! A9 b, I6 s E mov ax, 1684h ( _/ C/ J6 K; b+ j2 N
mov bx, 7a5Fh ; VxD ID of SIWVID2 O8 W$ t2 S% d ^' N( N6 f
int 2fh7 M+ b, k. Z0 T8 X, } U$ E; Q
mov ax, es ; ES:DI -> VxD API entry point
+ a! g6 X3 Q) m' |5 q: K add ax, di
3 S( Z4 m, w* k L test ax,ax
1 v. H; B9 E/ |; k4 \ jnz SoftICE_Detected
# w8 B# T5 }" y% j# T5 F
* K' w( ~$ ?" t+ G& }__________________________________________________________________________7 c/ v) k$ t7 m9 i' j7 X
3 I' r& W" N8 m! {: O n, v7 `
0 G# ~2 i3 \8 n: F3 O- m. }) dMethod 05
$ J2 w; d( S+ a2 u=========
. Q7 C2 C. v& f. B1 n' Q) a$ N& n0 v! k/ J# j
Method seeking the 'magic number' 0F386h returned (in ax) by all system$ j, R% r; Y% T, q
debugger. It calls the int 41h, function 4Fh.
/ M) \! N T; }There are several alternatives. - Z0 m6 K* B+ e- {! z- F7 b
* \: r: k4 ~7 Y; R* f/ SThe following one is the simplest:! u8 k: U. r# o% u# b+ h
* k/ P3 d! t; S q/ I# a/ I
mov ax,4fh$ @: E% d2 M2 z4 B! l& a6 h+ a
int 41h
- ^9 d v" _( W3 n2 z D m/ N& s cmp ax, 0F386
$ Z; M: J* h( Z" ?1 E( ^ jz SoftICE_detected
3 \% B [5 X; N9 X
* D. ~4 W" T* g; b9 q3 O1 k' b2 W4 \0 o9 P+ N, d, \7 E
Next method as well as the following one are 2 examples from Stone's 9 l; b3 ?6 |7 \+ }' ~2 Z R, ` V) Z/ [
"stn-wid.zip" (www.cracking.net):* F3 ?+ h) o/ ` L* Z
+ @0 N" C' f3 \8 Y6 V8 A# X mov bx, cs
3 R9 {$ l7 Q+ u5 e lea dx, int41handler2
) o) Y9 x! \9 \1 |$ @ xchg dx, es:[41h*4]
$ x. o9 C8 n7 I, Y. \8 _& _ xchg bx, es:[41h*4+2]0 s, `. W. c0 T: [1 L! @9 e) x
mov ax,4fh% n( e3 a+ _9 l
int 41h
* x9 d. C1 n6 ?( d xchg dx, es:[41h*4]1 _% q5 `. s* g
xchg bx, es:[41h*4+2]2 {& ?; G2 ^4 V
cmp ax, 0f386h
G; Z2 `. A/ ]+ j5 }! A3 w' A jz SoftICE_detected
/ f/ n" ^" }2 _" ~, }. g- T6 M$ S* R2 v5 J1 | F
int41handler2 PROC6 z ^6 K& Y% J. n6 S0 x5 X
iret% v q+ e8 q6 N7 c
int41handler2 ENDP
7 x- v8 k% y+ P5 }: Q; J" M; w5 y- r
0 q' g) K% ^4 z! c+ {1 R_________________________________________________________________________. F9 p2 M+ f- J$ U: t2 W
% o4 _# U4 W$ u/ X7 f6 Z: ?0 L* g2 `7 L3 e& m* ]$ ]# e+ \
Method 06( U8 z( c6 b; C1 e. P$ O* Z: q7 g' c
========= J: G* c6 D _& r2 |8 Y$ x
; L$ ^8 d& }# K" ^: {; n9 v$ o# O% m2 X8 z- \- J$ _; F
2nd method similar to the preceding one but more difficult to detect:
6 a! R5 `- p) Y3 n2 B& Q* a$ h) j: g' G# a6 J! v; n6 e* f7 @! P2 }9 w; K
. y4 Z, k( K: B$ v* @4 v# d! Gint41handler PROC% ?' v9 j* U5 {9 ?0 O6 R+ ]8 P
mov cl,al
5 E1 c- z. v9 Q iret
; D9 ?! D* ]% ]" H! bint41handler ENDP
- I' Z& f! a! v2 ~5 X
+ b; u+ b8 x) l( A& S$ D' L, `9 y, S
( ^& x% D6 [# }1 L xor ax,ax3 _' x8 e' X6 N( M2 V1 b, C; k
mov es,ax
8 i3 C, \; M$ A# M9 y" `2 D mov bx, cs: _7 {8 |* q; z7 a
lea dx, int41handler
$ ^# ?1 \. w, q" N8 T xchg dx, es:[41h*4]
' U6 u2 v7 Z4 T xchg bx, es:[41h*4+2]" {1 D; q4 ~4 Q" u: T' h
in al, 40h
, x8 @( f$ s q, y xor cx,cx+ J' P& p l" m2 p( t( a
int 41h# Q9 L$ S u. u# B
xchg dx, es:[41h*4]3 `" D# m5 ^! M% p. X
xchg bx, es:[41h*4+2]
4 p, ]! u, i% i* a3 y9 r) [ cmp cl,al( _3 Z* e" ?" H, o: v
jnz SoftICE_detected+ v$ F. G" e0 @% \1 I
( x7 R' o1 C* A( N$ d0 I6 V7 V( S" \
_________________________________________________________________________
7 A, F2 f, d( T* x% Y
, Z, ]5 D" p7 J; ^Method 07: c; H, _" J: T D- @: s3 _ t
=========$ o: ^8 J# g# v! x+ p# e
+ T( U; v) m( |0 f6 y
Method of detection of the WinICE handler in the int68h (V86)
+ r- M: F2 u0 m9 P8 F( `4 I2 g* i1 _6 Z0 R2 M/ g- `3 ?
mov ah,43h
; y$ v b( n1 z6 v- V6 d int 68h
* Q7 B9 J7 u8 \ cmp ax,0F386h9 u9 Q4 {; L4 z% Q
jz SoftICE_Detected
$ t5 k; ~' s; f z2 v
$ Q8 e2 w2 r/ r7 l" ~9 j& ?" |2 |; \4 G( w& Z
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit3 m# g* w2 [# y! L' H3 ~
app like this:
) x L/ f" Q+ \8 v
# o& Q$ ^' ?* [( ~0 {3 [ BPX exec_int if ax==68
% ^$ _+ W8 _2 |5 l0 S4 u (function called is located at byte ptr [ebp+1Dh] and client eip is
( b. w9 Z3 u5 U) | located at [ebp+48h] for 32Bit apps)" G- n N( n0 D% b% k9 w
__________________________________________________________________________
( o4 `+ G4 ~) [6 h$ I3 @, p; {4 N+ s# I( v9 `3 {9 q1 e" D
- D8 k& Y3 u" u8 I7 i% s5 J9 ~" xMethod 089 \3 s5 b8 C- ?+ r" t* N
=========2 C: ]8 U# q& `/ z C
& T2 O9 \- \) l1 T, ]
It is not a method of detection of SoftICE but a possibility to crash the# A8 `3 Z- N) o' j! o% H
system by intercepting int 01h and int 03h and redirecting them to another0 v4 d+ ~( ?( x+ ?& ~, `
routine.6 C; ^2 i4 v1 X, ~# c0 J* ]2 _: D
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
1 E& d# _4 i" u8 ito the new routine to execute (hangs computer...)
+ c0 W, V' q, a C6 u) g. Z; V. o- |
mov ah, 25h* O" C5 W' n1 X v5 P& [4 H" n
mov al, Int_Number (01h or 03h)0 }8 g$ a% r7 b' H& k
mov dx, offset New_Int_Routine, k4 C K5 p% S w1 n4 x
int 21h# |1 V; T X4 v4 _
( a6 A7 Q" _( R0 g1 g, l* l
__________________________________________________________________________
9 ^$ W; r' W z9 `5 s) H
6 x Z E1 K' | F4 HMethod 094 G8 p8 n% y+ ]0 S1 m
=========! e% l0 j% R" ?$ Q6 l. q
* ^4 ]0 u# b* q' ]
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
% ?" \* V3 o5 h/ m, Z( D" G9 Yperformed in ring0 (VxD or a ring3 app using the VxdCall).5 {' _- f+ T+ }$ o8 e; p7 X
The Get_DDB service is used to determine whether or not a VxD is installed
) C2 f$ R/ |& x! w4 X6 nfor the specified device and returns a Device Description Block (in ecx) for
' L) M, ^4 u1 L% ithat device if it is installed.
! I' i7 e o- y+ D1 i/ f# m3 c$ G# ~0 O% g6 H% z( Y
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
( @7 t! `8 C. V, `, K' n' J, h mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
* ~# |" l8 z: P9 a; T# L7 Y' Q VMMCall Get_DDB
8 i+ S) K' ~# H2 b6 J( P' Z mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed3 Q; N5 l! e( w) m$ N* i3 t
, W: B+ \# d2 P- ]* [
Note as well that you can easily detect this method with SoftICE:
6 z8 I9 R: X* B& A+ K, Y bpx Get_DDB if ax==0202 || ax==7a5fh- W1 J/ ~# J F9 k% E: v
$ Y8 c/ Q- h) E' f! \+ W7 w* U- Z! k__________________________________________________________________________- O$ E) b2 Z a& Z
1 V) o, V8 r1 Q; T) VMethod 10
- m0 f. M/ M' b1 K# ]=========6 }& h R; o. ~3 `# V5 q. O3 b' N
6 h3 S7 @7 H6 o+ J( K2 g5 g7 R
=>Disable or clear breakpoints before using this feature. DO NOT trace with1 w# V6 |- e) i4 I2 h
SoftICE while the option is enable!!
0 b# _ I' |5 }, T$ n; U
: c, }3 W8 V' [This trick is very efficient:
5 H' R/ Z; ^0 v+ Y& ~; @by checking the Debug Registers, you can detect if SoftICE is loaded0 X& x% P) z- \% S" p
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
7 `0 V, C4 ]* q9 K0 m) j/ \there are some memory breakpoints set (dr0 to dr3) simply by reading their
3 r" R3 a* u7 `8 C' l$ i# Tvalue (in ring0 only). Values can be manipulated and or changed as well( {7 P/ C( ~. H( I) l
(clearing BPMs for instance)8 A& _- S$ m c5 e- `
1 E& b M+ A d# U1 ]__________________________________________________________________________( u& C) f0 o+ W, }* ~1 e
) i- g8 p* _3 P6 `, `
Method 118 x6 C( W: G8 {# ?# `
=========$ i& ~( R2 l: c Y
9 Z6 M3 f# K3 e9 n& k$ Q+ G
This method is most known as 'MeltICE' because it has been freely distributed
4 n @3 C9 t( l$ f! j, f2 Tvia www.winfiles.com. However it was first used by NuMega people to allow
# n ^0 M, [6 e* X3 i1 k$ D* eSymbol Loader to check if SoftICE was active or not (the code is located1 x5 ]; Z) E7 z
inside nmtrans.dll).: Y; v- B4 o; @( i; N6 `/ z
$ t" t; L J4 ?The way it works is very simple:
. H2 z/ ` C8 t1 f N6 \+ ~It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
6 C6 ]2 `8 U% T4 ?/ `WinNT) with the CreateFileA API.
u% I g7 N+ l) W% v# M2 L9 N$ p/ E5 ~( F Q$ e1 l6 Y
Here is a sample (checking for 'SICE'):
# y: G5 y& ~3 [" p- W. W; A5 L2 S/ P0 {) V
BOOL IsSoftIce95Loaded()1 I7 p( D: T3 D0 t6 d. B2 ^
{
- N- \5 m1 M0 Q6 W% I$ I' K HANDLE hFile;
+ W& k( g3 J- w5 ^) V. D' d5 R) z hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,7 u! C6 z" K0 G8 ?6 a* E8 t- F* C
FILE_SHARE_READ | FILE_SHARE_WRITE,5 ~( T$ @, t. r3 U3 i+ `, f- D( I
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
8 c& G) ] \' |% k( N& o6 y, \4 | if( hFile != INVALID_HANDLE_VALUE )
8 ]+ F# b: J5 _ H, i5 e( t$ c9 }! W {
/ x* w" u2 w% f2 e0 _7 A- k CloseHandle(hFile);1 U) B& }* B6 s1 {! C
return TRUE;, M, K( W$ X7 a. e7 a4 c
}
) p0 B8 K0 S l4 e* o1 ]' V) `4 G return FALSE;
% C. t# k2 i+ ~7 |( F) V" v: C}
$ j! e2 K W3 k; {; @) T8 x; a3 D8 x% E8 V
Although this trick calls the CreateFileA function, don't even expect to be
" G- G* q/ u+ X Zable to intercept it by installing a IFS hook: it will not work, no way!: B3 u* l" B# F4 e7 o
In fact, after the call to CreateFileA it will get through VWIN32 0x001F2 B J9 M8 I, F! \' D& y
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)& X; d$ ?( K0 Y! `0 m s0 Q
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
+ G6 T; `# a3 X& Dfield.
: M' I! f7 C0 }$ FIn fact, its purpose is not to load/unload VxDs but only to send a
3 v6 n J9 V9 B5 g& a) r( H. Q( qW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE), t6 z* z4 i7 Q% }1 q- t0 G" m
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
; T. d6 Y- H) b% }to load/unload a non-dynamically loadable driver such as SoftICE ;-).
! j2 l0 y/ Z- K7 ^If the VxD is loaded, it will always clear eax and the Carry flag to allow
. l; V0 q- e+ U6 n0 eits handle to be opened and then, will be detected.
- ~/ \, |8 h# ` x0 ?1 Z8 uYou can check that simply by hooking Winice.exe control proc entry point
# y7 g6 o# q) G o# \9 w" Nwhile running MeltICE.! k& R; S: q2 B( `3 q
2 j) V& I& j3 M, A) ]5 R: X" P2 ]2 |) K5 L* |0 ^
00401067: push 00402025 ; \\.\SICE7 Q, g, h" V% `; n, V/ g6 {
0040106C: call CreateFileA
7 Y6 M. J9 j; x 00401071: cmp eax,-0018 M8 D) `6 @: ^/ H5 b1 n6 S
00401074: je 004010911 w" }0 z+ S* G1 }3 \7 f
5 Y7 e- ^ l* s: I
3 z4 H0 a4 Z: y
There could be hundreds of BPX you could use to detect this trick." S4 v7 s9 i; \$ Y0 G2 k0 k. c
-The most classical one is:
: {5 B, O6 ~/ r- B/ ] a BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||9 q' J5 p/ ]: b8 ~
*(esp->4+4)=='NTIC'
. F" }& P1 w9 d' N! P) [! Y C2 ?8 L2 }) q V4 \
-The most exotic ones (could be very slooooow :-() l; L4 i; e9 g, N. u% ]
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
( Q' |7 X: X9 W4 k ;will break 3 times :-(/ `( ~5 t7 T$ Y: i j, d; G2 ?
9 @: c* }8 D) }- C
-or (a bit) faster: * f. }- ^. C( }6 l1 }; _0 j; S0 u
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
( R2 K' B A( O8 ^9 X" G( o# I5 D% H; k, D) K: ]+ g
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' % e' T5 @" o2 m+ Z/ c5 D
;will break 3 times :-(9 z+ t/ L1 g, n! i3 ?4 H) n
! [ `! `' a; Q9 G, q1 f9 r-Much faster:3 t; A1 Q! _" y) ]# p2 W5 Z; O# I
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
- j2 k( U, i2 E3 t- P0 T/ `
7 @7 P& R$ G% S/ N5 b8 f6 UNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
: j6 P# U3 t6 k+ \& Ffunction to do the same job:& A/ {. i. z J9 G6 H
. Q! B# O; ^+ M- E7 }9 Y
push 00 ; OF_READ
1 u2 f2 H4 T7 }; l* w, B0 ~6 m mov eax,[00656634] ; '\\.\SICE',05 X' L# N, M: P S
push eax3 P( U; m5 @0 C% d- B
call KERNEL32!_lopen
* C* b3 k' [: Q# [ inc eax. x( H1 Q& c4 z
jnz 00650589 ; detected% `( B( k# C. K4 f4 |+ n7 O. E
push 00 ; OF_READ; p: ?; t5 g3 g, _7 X" I K
mov eax,[00656638] ; '\\.\SICE') X5 Y; n h9 a! \
push eax
4 m) R9 V8 q2 k, }1 ^# _ call KERNEL32!_lopen
* K1 C: ~ Q( ^" J' A# j inc eax
9 L7 x m% `1 i. B, a9 P" W0 s jz 006505ae ; not detected
4 S. L8 W; c! a1 @4 @/ q1 h8 g e, y4 H+ `- N D
* s! b4 X+ T- t! a8 g__________________________________________________________________________& |( Z# a. v9 F h- @
) ]2 a x1 U5 B/ [2 | eMethod 12/ Z) n& C. i$ b7 g2 G: |
=========8 {0 @; y. j0 m$ z& y
) U3 R3 G& [; xThis trick is similar to int41h/4fh Debugger installation check (code 05. }- Y0 F j: }3 V: L. L% B
& 06) but very limited because it's only available for Win95/98 (not NT)* Z# e; e" c. c6 \% z
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
3 f }0 h8 q& j) F6 d" r6 } V! f9 C1 d3 s% _% e- k) q, J n
push 0000004fh ; function 4fh& s3 Z& }" q( r7 x6 @
push 002a002ah ; high word specifies which VxD (VWIN32)
, E7 w: @! K! t6 e k& e ; low word specifies which service
/ O3 i( _* A P; ?) D" w q: ` (VWIN32_Int41Dispatch)
* n& O2 O: J# T' I# r) Q9 d call Kernel32!ORD_001 ; VxdCall
9 v7 h1 I1 h# m5 v cmp ax, 0f386h ; magic number returned by system debuggers
' D( y+ q" `5 L" Y jz SoftICE_detected2 [) J/ E3 Y, h& p! m
0 U1 R: A# h! C: u# xHere again, several ways to detect it:, p3 V2 K: ~2 Z8 I! l
5 p4 O$ g9 s4 |( J7 ?
BPINT 41 if ax==4f2 g( g* e* M! i/ ]6 ?$ Y
- e9 \& A0 S# Q$ M$ W! }
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one% G" ?5 ?5 V/ |3 d
0 U5 Y, @9 Q3 G BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
; y+ o& E [" A; V, v+ F" ?
% Q% L# O) N- y: N1 U BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!/ O2 j* b( j3 ?8 f9 ]3 U
2 Y" Z* g# v- {) D. L5 ~8 y, Q- z
__________________________________________________________________________6 C+ |3 |+ d( W! R8 l
) Y7 t2 B" N, t5 b6 JMethod 13
) j( p. C ^* X6 ~=========
. v# {) \1 l( P
2 V& Q7 @7 S9 Q7 h1 n. ]9 N3 yNot a real method of detection, but a good way to know if SoftICE is
, s+ S9 U4 Z; M6 G7 ^4 K; z7 oinstalled on a computer and to locate its installation directory.8 Y' x8 k4 {# ?! A% U9 H a# `! z
It is used by few softs which access the following registry keys (usually #2) :* c5 m9 y. s& i# U6 p9 ~
9 v% b8 u$ n' f: B-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion& v4 W" w3 n) F$ r. R4 J
\Uninstall\SoftICE9 }6 ?: k& ~ M9 Y! d+ n$ S+ U
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE0 k7 @# M! w+ i2 z O/ D' f& c) U+ y
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
1 h2 C1 M' b# X\App Paths\Loader32.Exe5 @! |" w! Z, }+ a3 @% `
& ]1 j( `9 J" c) o' S$ S: d) B
2 ~$ u# y2 G, r& w" G" \
Note that some nasty apps could then erase all files from SoftICE directory
" c; ^: e: Q* e& H' t3 d k(I faced that once :-($ `" Z8 e9 N0 a$ L5 I1 L# S
/ h2 s: y; P6 H0 MUseful breakpoint to detect it:# \9 N& v" p. J! b; J
. I0 X6 ?, {/ L L( |' `9 c6 l5 O; r BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
, x e% o6 W2 B% g `* V" R$ s! T% n# Q8 r1 P2 B0 m3 H4 a) P
__________________________________________________________________________
b `# p. U0 T0 H7 \0 x; s. z \2 O& d& i6 {) E
/ r- \: S! _/ M+ V
Method 14
) T8 D9 S; n, l% R! q( }=========4 M2 N; ~: S/ |% N3 E
# q- i5 ] |/ mA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
. J2 {& c. a8 M jis to determines whether a debugger is running on your system (ring0 only).
0 g: d3 E$ }* ^ O7 ~' A
" \7 \' P, w* { VMMCall Test_Debug_Installed- o% r, S+ m% b4 Y `6 }
je not_installed- z8 f5 H8 b; {! n, M1 B
9 x$ K8 l9 f5 R1 x6 u, \This service just checks a flag.' [$ p% K6 V: p) d- t
</PRE></TD></TR></TBODY></TABLE> |