<TABLE width=500>; `, p$ V4 M6 n0 ^5 L1 [
<TBODY>' c. A3 ~- Y, F! L$ p
<TR>6 y I2 V6 b& U) `6 D+ k
<TD><PRE>Method 01 & `; f4 g! M" O1 F- Q/ b' A& ~
=========( s# y6 x8 a# u1 J( F5 F
9 j% Y/ L% V* d$ E6 M6 h, f
This method of detection of SoftICE (as well as the following one) is
! e: {/ _9 l* j) fused by the majority of packers/encryptors found on Internet.0 l* I* G( X$ v5 T( X5 ~/ T. e# j; Z
It seeks the signature of BoundsChecker in SoftICE
& C% M9 D9 K- T- Y" F. S7 K3 t4 }, _7 z3 t& E& m& I
mov ebp, 04243484Bh ; 'BCHK'
: u/ l+ F: @: R) G" m% U1 G mov ax, 04h* T/ {! j, ^. B
int 3 $ |- B& _$ j& M S
cmp al,4
. f$ ]# F& b$ G7 `# J) E jnz SoftICE_Detected
+ ~, l# S. v6 \. x. M
- G1 v# U! r. ]0 X___________________________________________________________________________( O: ` Z1 L( u) \
. @6 g w0 y& Z! TMethod 02
9 b& s% a& |- A6 K=========! ^* P7 R1 f, T; y
3 }! a$ j( Q* t$ g F# R
Still a method very much used (perhaps the most frequent one). It is used
1 C1 ~5 p/ e# h- a( [to get SoftICE 'Back Door commands' which gives infos on Breakpoints,& Z8 M. Y' |: G: I& x
or execute SoftICE commands...# a3 O9 K0 P1 S& O
It is also used to crash SoftICE and to force it to execute any commands. s; o" A( T4 J6 a# O% o9 S6 b
(HBOOT...) :-(( ! E/ Y9 a" v; F3 v" v# H$ G/ ~2 w
& g' G9 n a3 N8 o D
Here is a quick description:
4 q! |: f! j3 b0 q3 ^$ Y6 g-AX = 0910h (Display string in SIce windows)7 f& M M: U6 b" u* l
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
( D! j2 f9 x0 ?4 Y+ E. d2 `% l-AX = 0912h (Get breakpoint infos)& j! M, m* B/ u& E+ J
-AX = 0913h (Set Sice breakpoints)
9 m; K1 L* E1 C) y/ C-AX = 0914h (Remove SIce breakoints)# E0 I. ]+ @( W a" p
$ i. E( O$ g T3 k ~
Each time you'll meet this trick, you'll see:; J2 C% f2 ^1 J: p" B+ j
-SI = 4647h; d7 h1 @3 [- F% `) F
-DI = 4A4Dh$ a9 S; f, s( Q# L5 @, O, ]
Which are the 'magic values' used by SoftIce.3 z/ e% d0 J# j
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.+ F. D8 p2 |6 ~
, z" T2 S s5 { r9 ?7 g
Here is one example from the file "Haspinst.exe" which is the dongle HASP
E' `: I* p1 Y9 \" e" XEnvelope utility use to protect DOS applications:
) n2 }. v' |. b# J) O$ {5 b+ ?' H7 W5 X2 w- q* n/ {0 u- Y! D
; l/ _: t5 `5 a: l& W' r7 L4C19:0095 MOV AX,0911 ; execute command.
0 f6 x* z3 E, g4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
0 }7 z4 k- Z I3 ~" `7 A' l4C19:009A MOV SI,4647 ; 1st magic value.7 | f) v; f" ^
4C19:009D MOV DI,4A4D ; 2nd magic value.: }% [, h6 k1 `/ H' J, x) E( R0 O' d
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)4 D; @5 }9 h' y( z4 E
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute# a7 k# z# I) t% h
4C19:00A4 INC CX5 ]* h7 h7 g; L5 ^: r
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
' m9 G @. r8 a0 O4C19:00A8 JB 0095 ; 6 different commands.+ a6 \! j! O, `* n+ o' B V2 j8 |
4C19:00AA JMP 0002 ; Bad_Guy jmp back.- {, H' E; b& a( U/ f0 N
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)" \7 E' x- g$ M/ b7 }# p: _; [
( M& {2 b3 M' F( E4 U6 hThe program will execute 6 different SIce commands located at ds:dx, which8 m; N5 S# O2 J1 \ {" R
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
# J3 x# j8 a( a" s6 u/ N0 A' n: I4 F# ^6 u E
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
+ f. W/ Z- P O/ I___________________________________________________________________________ t5 F3 M- D( b1 ^9 x
0 T$ m* I/ F9 ?, W" V
# Y1 W0 N$ r+ T/ V+ WMethod 03
9 {: T, R# U2 ?0 `2 d=========
; C% m& S( A8 g# k# W( n4 S2 E2 |. C- G& |
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h _: Z4 e4 w9 O& [0 {7 p! t
(API Get entry point)
% B0 s* d/ d9 D' M, c ( A9 w5 h3 ~# z; G- C
" ^- W# z$ j( C9 v xor di,di5 r1 F& A, F3 k4 e: x
mov es,di
$ P e9 P& c" s mov ax, 1684h
6 ~) x; y: f9 j' b7 r8 o mov bx, 0202h ; VxD ID of winice! F% F+ M d$ Z+ I( B( r
int 2Fh0 \5 q* |9 b+ u8 c! D% g! [7 p; E
mov ax, es ; ES:DI -> VxD API entry point
, H& Q1 r4 r% P" o add ax, di9 t% Q( K# a2 b; d5 m/ H' |# L; T
test ax,ax
8 r) A- }9 ~* l" f N jnz SoftICE_Detected
1 v* P3 g0 q! N8 O7 ~" A! P/ r( D# V8 J
___________________________________________________________________________
3 _' U( f0 R. N" a, Z7 O, k0 ~% D+ d
Method 04
# w8 X, ^) u3 o [=========
+ `7 Y4 y+ @- l& A6 ^7 y& L
, W* F. ]; V1 D* ~Method identical to the preceding one except that it seeks the ID of SoftICE
4 n' w; u# e& z, Z* YGFX VxD.
' x0 D( S$ m' `: M
+ w# G6 ~3 j6 [9 _! \( n+ E xor di,di7 H' u1 N& K8 w4 E& _) d4 i Y
mov es,di
' q/ h" m* b7 ]1 o5 Q: ~ mov ax, 1684h
9 F. x7 H+ q: D( s4 o' O mov bx, 7a5Fh ; VxD ID of SIWVID
# b+ ]* X7 R: N" h; I; E int 2fh Y. p; i& t" e ]: I
mov ax, es ; ES:DI -> VxD API entry point- \6 ?+ v3 V/ @
add ax, di
# h B8 q* u0 d/ ^: \7 j test ax,ax
/ Q" _4 V: n# ? G" b jnz SoftICE_Detected$ H" @$ _6 t# p2 C4 P( g
6 m6 p* V# D2 X3 G
__________________________________________________________________________( l# Y( f9 `$ ^8 ?; |2 [* _
9 c: s& S2 g) C7 V7 J
! z) T# a) N9 S6 ?7 Q+ _$ c5 C2 gMethod 05
`+ c) f* ^4 M6 d& Q1 p B=========
% C1 G& y* m( `9 @' Q K0 S% l8 ] u
Method seeking the 'magic number' 0F386h returned (in ax) by all system- X$ g. ~! C0 G5 w
debugger. It calls the int 41h, function 4Fh.2 r/ r7 d3 d4 r( }7 j& F+ h' k
There are several alternatives.
* J4 H! _ R. ` U# D0 k: T2 i" r& P- H% R+ Z
The following one is the simplest:
2 y0 S6 M/ w% \/ \. D
% f6 ?/ { B0 r' n% I5 o0 V: ^ mov ax,4fh, H4 Y' s! s8 u3 G7 x& Z8 W5 E
int 41h* t( Y4 o# @$ J% L9 f
cmp ax, 0F386- b2 U3 E. _: n
jz SoftICE_detected
( t: i2 z% ~- P/ n6 [) _0 ~& M# S8 ^
: ~/ i: N4 s3 I( ~" _& Q& r
Next method as well as the following one are 2 examples from Stone's 6 F O7 o9 m9 a6 J# }& ?3 N! x
"stn-wid.zip" (www.cracking.net):. n- y7 P U8 w' W F7 [( E( `
3 F2 [* Z0 x s! p% ?
mov bx, cs( |( n4 |# ]/ x8 h; x" X
lea dx, int41handler2
. H R% C1 u# v7 T xchg dx, es:[41h*4]# Q4 {9 k, j+ L% y% D
xchg bx, es:[41h*4+2]
' p6 M4 c# H% L+ I8 K mov ax,4fh1 a9 T: k& ^3 s, p* F. Y6 M
int 41h
3 }+ ?* R2 Y# z& @3 i4 @- |6 X xchg dx, es:[41h*4] X+ x/ q6 p8 b7 U& ?* J
xchg bx, es:[41h*4+2]. G" v" e; u" g$ O4 X C1 Q
cmp ax, 0f386h4 f- a6 `, V4 {% g0 q4 ?" U+ r
jz SoftICE_detected
3 O3 S' a( F% Y/ ?: W6 C" Q0 M# m# }+ Z. r4 B- `1 q
int41handler2 PROC
2 h+ Q [ P) l" m7 u, J+ {) I9 t iret
4 @+ _& K: W9 G' N1 Aint41handler2 ENDP& A3 b O) h2 H9 s4 Z: d+ j
L' s3 x8 }6 O' Q
3 G1 T) r- l7 Z, `
_________________________________________________________________________
& M% f; m+ b, V9 E3 K: g( Q7 l5 h/ i8 {* o( J1 L
" ]0 x' v8 V% TMethod 06. e" k5 B5 a: z- |2 [
=========: C4 |7 Z2 D) T( W2 ^# ]. x
2 C4 c! q! R& D. _& p+ _3 a
* R6 I4 B0 _ b4 t" r4 k2nd method similar to the preceding one but more difficult to detect:7 \: N/ ]# n) J6 A
/ k1 O* A- L# \; X/ K% P
/ K; i8 ]8 j# Y, Y9 ?! Eint41handler PROC
5 B- L) d J: F& e mov cl,al
4 r8 X( |: d* i7 o( C4 h iret5 Q: l- z. M7 G* f; C5 i* p8 L
int41handler ENDP
0 p! _6 M `% I7 |6 U$ U# v0 \' c& o0 g: ~
' k/ D: M( I( K! j. O2 {
xor ax,ax; `! u; |$ r. `. [
mov es,ax0 ^6 d+ w2 X' V" s( D; R% [
mov bx, cs
. J( V( J7 H: q& M2 ] lea dx, int41handler# q, P8 ~% D5 h
xchg dx, es:[41h*4]
- k7 i* ~3 }/ z& Q xchg bx, es:[41h*4+2]9 j6 j: U- _ [1 S
in al, 40h
) a# I& C! j) o& Z: i% @ xor cx,cx2 ]. i* K- v6 Q1 O2 ^
int 41h( g! \( k: |* f
xchg dx, es:[41h*4]
) T; E7 [) i5 S1 P xchg bx, es:[41h*4+2]
% W8 `* |6 l' S7 P" }6 b$ a; O+ X cmp cl,al* S8 X7 S1 o: P9 m) w+ L8 _
jnz SoftICE_detected
+ W8 _% ~1 }7 ^4 |3 v. M* z. ?9 w# F% C7 K6 P1 f
_________________________________________________________________________: ]' y. h" L r, s& b Q
% @" Q8 f. i# }3 ]Method 07& `) Y% w1 Z1 p8 k w
=========
& {2 u$ R6 ?2 y0 k! \4 K# S1 m+ v* H2 B2 Q0 z% ]5 K b
Method of detection of the WinICE handler in the int68h (V86)
" Z; U4 P' e) U3 [* M* ?& i
' B e" ? B9 y$ u- j I mov ah,43h* A( j+ x5 F& j2 k# s9 i d% h0 L6 c" p
int 68h
* W2 r% S/ G. b* j. u; I cmp ax,0F386h
) m" {3 G/ W% {2 T. F jz SoftICE_Detected; Z0 d! I* _* r* w) i- X
E$ P, A, I* i. v7 P+ |5 z
5 w2 o8 R8 T( _$ D* z; M* i1 p3 Y3 j=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit+ S2 F' I0 r& {
app like this:
/ v# M9 [& r9 n5 w9 C7 `# M G1 V4 \! `' `5 E4 r- ~
BPX exec_int if ax==683 m0 [( Q+ T1 T K2 F
(function called is located at byte ptr [ebp+1Dh] and client eip is
) n0 f4 Q7 f/ T5 h$ J8 x# D located at [ebp+48h] for 32Bit apps)
4 i- S5 D8 U# h2 M3 ~$ Y/ H& D! A__________________________________________________________________________6 L. v" v6 Y. @( H' M; S
% }" L) ]# X# ~9 P+ y4 ^
4 _4 p# {5 t" mMethod 08! g& i$ A; I, H# o8 ?7 R' @* M* Q9 [
=========, A" d! p" R- t: @* h1 `. d
0 r" Y; c; f9 `* W* |6 WIt is not a method of detection of SoftICE but a possibility to crash the, a1 M y8 P4 y
system by intercepting int 01h and int 03h and redirecting them to another
. |5 x: O- f- B) A' _9 jroutine.4 C' L! u# x7 Z8 C' R$ ?
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
6 a: M# J, m3 q Bto the new routine to execute (hangs computer...)
5 {& f' Y. C+ H# e, b! `9 f/ J/ G! ~2 ]# p$ i0 o
mov ah, 25h5 q9 O: X: Q- X: u! ?9 V
mov al, Int_Number (01h or 03h)
+ [/ t# [* O( W! T mov dx, offset New_Int_Routine1 V9 u2 x! V) i: T3 U9 l8 s
int 21h8 U1 _: F8 w1 h9 n, P2 k
! r4 a: F, k2 y
__________________________________________________________________________4 @. z# i& S' Z
+ p, k8 u0 E& s' }! a4 fMethod 09 ]1 }4 A; e, A& a
=========
2 E$ H h2 Y, I# t, c% K1 @$ ?; y
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
3 X; |) U: i9 r( ]! fperformed in ring0 (VxD or a ring3 app using the VxdCall).3 c6 g" Y7 Q' T6 Q0 _. F
The Get_DDB service is used to determine whether or not a VxD is installed& h( T5 f# X# l+ |2 Q- T' N
for the specified device and returns a Device Description Block (in ecx) for) s, W3 _: x* J+ ?0 J
that device if it is installed.! _& }# @6 }; s8 C
, B* u/ X; I- I- Y1 u' X* ?
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID& H& d1 a h( P* @+ ]4 S( [
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
2 g. a5 D' _2 X9 u9 x VMMCall Get_DDB
& W/ ~/ U, d" E% J. c$ M mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed# d+ m9 S9 ~. M) n) v$ N
* [2 q1 C0 f/ x8 d! g3 E: }Note as well that you can easily detect this method with SoftICE:8 W# V; ^/ k8 }
bpx Get_DDB if ax==0202 || ax==7a5fh1 M% Y& d( |9 N1 Q& i4 C0 y8 h
x8 x# X& v8 C, F6 [
__________________________________________________________________________* z* W& O- i# e' g4 y
8 l) i |" N0 P, DMethod 10
2 H' j% t" q' w8 ?* |=========
6 V; g! D+ v4 n* G2 P
' c! q$ b8 q) O" x1 n- Y=>Disable or clear breakpoints before using this feature. DO NOT trace with; c, \, P; h1 P$ \, J5 D
SoftICE while the option is enable!!; T. C! [1 O5 l f
" p& w) \1 f' f e) ^; D9 X
This trick is very efficient:( E( p" E% W, r4 E) k% C" u
by checking the Debug Registers, you can detect if SoftICE is loaded! r- b. Q1 G2 L7 s
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
& }- X7 T- Q1 rthere are some memory breakpoints set (dr0 to dr3) simply by reading their
* H6 a o9 j- G1 j2 dvalue (in ring0 only). Values can be manipulated and or changed as well6 R9 m7 E- _% x
(clearing BPMs for instance)5 s, V7 e! x- F% o% ]
! ]( ^3 C% x% b
__________________________________________________________________________
; ]7 V* b' E; y; T7 l5 F6 Z. L4 C" P( t5 v3 Q, ~
Method 11- F M! W" R: F- ], i! k) u4 ]4 `
=========) `, T! p F5 Q1 D9 S0 q* M9 m/ J
. o! O2 z/ X8 [( K# P- g1 lThis method is most known as 'MeltICE' because it has been freely distributed! N7 |# y/ `! x5 {' U+ d
via www.winfiles.com. However it was first used by NuMega people to allow# Q+ h) g$ ~- S* z0 P
Symbol Loader to check if SoftICE was active or not (the code is located
1 o* D- ^7 S. |7 a; u7 Rinside nmtrans.dll)., }8 ^$ W$ g/ y3 k4 @
8 E# [3 B+ J, E7 n D# B9 e( \5 P& jThe way it works is very simple: |, J. G! b- U; i5 x S
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for6 |* k2 o, o ?4 d3 x
WinNT) with the CreateFileA API.& V! {" Y' s: a! A+ C" D d# x6 ], E
- C" Y" `2 s4 m" ]8 _
Here is a sample (checking for 'SICE'):
8 O2 h# L; e5 c9 _4 t9 }1 p5 V( \
) R5 V/ V9 z0 a6 _% ^$ @BOOL IsSoftIce95Loaded()$ F. v1 A" q Y7 z8 f( W
{
) i% \1 h3 d% X9 k HANDLE hFile; 5 P9 m/ B9 w# ]) @% V6 d7 Q
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
% N1 f. L9 b1 i% X1 B# l FILE_SHARE_READ | FILE_SHARE_WRITE,
. h6 [7 C% z, _& q$ L- r NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);( Y. G: P$ k! V, L/ {
if( hFile != INVALID_HANDLE_VALUE ); |: N6 n% }" p' p
{
9 Z, h+ f' |5 o/ v) j: M' s CloseHandle(hFile);
I% V1 F$ y: p7 I4 t2 l return TRUE;4 k8 n4 ~3 J$ g2 y) z5 Y1 G
}6 b% S% V3 A, P' N
return FALSE;
( H- J' _& r# n2 P8 @! [; K}) M% ~: J( Y( {
# P3 Q2 r9 s8 {. L2 N1 X! bAlthough this trick calls the CreateFileA function, don't even expect to be
o! g8 j. F* s2 b) d& k- u) Lable to intercept it by installing a IFS hook: it will not work, no way!9 q8 m" Y. I; T' U2 k' V D
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
& F2 ?% S* ^6 W3 V: s0 Sservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function). C1 [1 k4 s8 ^$ F* X" i3 ?0 m
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
+ \! |2 M! e& ?field.
* ?/ D c$ F" T) v8 S" ~$ L; uIn fact, its purpose is not to load/unload VxDs but only to send a
0 T4 M( y2 E' F& gW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)* Q" g- ?! l& q( m
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
( |9 z! A/ d a& b7 Wto load/unload a non-dynamically loadable driver such as SoftICE ;-).9 }' q; c$ y* c, t$ `* @2 F- _# X
If the VxD is loaded, it will always clear eax and the Carry flag to allow
# ?1 I6 T7 D" H2 X. \9 M9 l/ Wits handle to be opened and then, will be detected.
7 ]$ \+ J; [& W4 [You can check that simply by hooking Winice.exe control proc entry point& {. H" @1 s$ m6 t9 f+ T7 ]
while running MeltICE.
% X) s4 W4 O" C5 B& A5 _
. {6 z% R* r# d/ o
3 W' l% |+ v/ { 00401067: push 00402025 ; \\.\SICE
6 y# }5 U- I/ ?, M/ {0 v& Y 0040106C: call CreateFileA
8 X2 c L; e h2 p) g. G7 V 00401071: cmp eax,-001
. N' s g, k- P 00401074: je 00401091
8 G& A: r5 e# y1 M* F4 z& F' s& N4 x
$ I( P$ R' n. H5 W9 D$ M4 I4 p/ D; v$ ~6 ^# ^/ [
There could be hundreds of BPX you could use to detect this trick.6 G/ M7 O4 }0 h r: x3 i4 ~
-The most classical one is:
7 i( ]: u' K* E( [$ `$ q BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
( X# g; t: u2 m# u$ W7 [) n) w1 P *(esp->4+4)=='NTIC'
$ o" Y. V5 U+ Q! ]7 e9 {$ ]: v- E6 I) E$ H
-The most exotic ones (could be very slooooow :-(
4 _+ v/ `7 P& V/ N: q* r* Z BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 3 Y, i) H, r2 `; r( U% ?
;will break 3 times :-(5 G$ z8 I3 r9 M9 U# v3 i! S" y3 N4 [0 y
- Z7 i$ S$ Y1 J0 i0 z k, \-or (a bit) faster:
3 s# X4 X5 b7 H- q; ~; {0 I! R; s+ p BPINT 30 if (*edi=='SICE' || *edi=='SIWV')9 ^5 }2 E- C* j
# [- c6 I, x' V3 S8 Q
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' : L& ~/ E& y' f5 E6 Z; b7 t
;will break 3 times :-(
2 ^; d- v: e- \! A* o
% h% t P! g+ Y6 r( U& @: l- b-Much faster:
& Y/ n [/ t7 l/ ?, M$ R } BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
' R, U- r) u2 c: A8 m
8 A2 @9 ~( Z# x0 m( xNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
9 b* G6 N* c% K. {6 h3 d8 Afunction to do the same job:, { Q% {4 G# B7 _6 F" S( r: v3 A
; s( [" X ]1 {: E9 L
push 00 ; OF_READ
& W/ C- F' L6 S mov eax,[00656634] ; '\\.\SICE',0: n5 v# c. H' H: f1 @, V
push eax( I& j0 _9 d2 R
call KERNEL32!_lopen, J% U n; [2 s: P
inc eax& i/ c3 F, G4 }) n
jnz 00650589 ; detected+ C1 h' q- l# F0 ]2 W; a0 W
push 00 ; OF_READ" O+ B0 P Q; b6 N$ J# R* Z
mov eax,[00656638] ; '\\.\SICE'
* c, p# |& o# c' M push eax2 X& {# X( O# q8 R$ B- H7 v
call KERNEL32!_lopen: L2 s9 M5 P. l, U( F
inc eax
: r6 O% O3 o& e0 D& H1 ?' n& o jz 006505ae ; not detected
+ \5 d& m# O# J% J% D" ~) K5 |* A
- J- o/ L4 @) ?% H H
1 {& F& b( N) z: }__________________________________________________________________________# l& p( k6 q o. p |& x
! c- y, I, X/ x) o+ @8 aMethod 12
: w0 C; M6 ^9 ^( S5 z5 T=========2 C6 g: M# n$ p0 k; v) e6 M
% L' o7 `3 L! Z: S6 T- ]# g4 YThis trick is similar to int41h/4fh Debugger installation check (code 05& v/ b" f. _* C: w" q* K
& 06) but very limited because it's only available for Win95/98 (not NT)* v$ h$ @4 V% ?" P% w* m( ^0 I
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.6 h( B2 J$ B& P Q! Z$ k
$ x9 S, C4 E, B. O- r: x push 0000004fh ; function 4fh/ w* v; @; y( }5 _0 _- E
push 002a002ah ; high word specifies which VxD (VWIN32)
4 p6 J. F4 u/ z7 O6 V ; low word specifies which service f) R8 S! e, V W; `
(VWIN32_Int41Dispatch)
& C: i+ k4 @. I1 ]/ b/ @ call Kernel32!ORD_001 ; VxdCall, [" ~4 L& d& N2 @+ E$ T* S
cmp ax, 0f386h ; magic number returned by system debuggers
& g; P3 u5 W5 [, @# Y% X/ O' q$ [ jz SoftICE_detected3 W: N+ s9 I }" w/ }' d4 F
) N6 D% n T2 C
Here again, several ways to detect it:5 q$ n! }* v$ A' A4 t0 A
) @0 ]: R1 \" o1 x5 K( Z BPINT 41 if ax==4f5 Y& U) X5 V/ f. E5 }1 Q: c; K
) z7 z- p. b5 v+ ]& F
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one& B# U5 L1 g3 Y
' V: {4 X, R3 ]' ~0 g( y' L: r
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
0 E1 Y; d0 p' b2 H5 y1 F' j+ G3 i& D" o; q
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
4 g3 m, u" s. H$ {+ Z+ ]
6 K% d; Q9 A e8 e4 P: s( a( J__________________________________________________________________________1 B" | s! y( [& L4 V3 X0 I6 p! L
C# ~0 c' c2 j0 r, _4 }+ U
Method 13
F; t3 l' N2 `' B=========- E9 B% x$ b9 U: }" L7 }
& @" M8 F& q5 a8 WNot a real method of detection, but a good way to know if SoftICE is/ S) p2 N2 g$ u" w0 l" d. W
installed on a computer and to locate its installation directory.' y. k% V- P q. y* s
It is used by few softs which access the following registry keys (usually #2) :% l; M. {0 A: R' c' Q q% [
+ z) b8 U! ~. }-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion6 `, q; k$ @5 d/ `, J/ O# M
\Uninstall\SoftICE
6 P" c4 g) S$ N6 ]-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE9 l3 B5 h* i+ U9 r0 G8 x6 v( G
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
" T7 y+ W% F- F% c' }\App Paths\Loader32.Exe" {& s( H H( W4 `8 X6 [$ T
0 j, D0 S3 \; c8 G
. Q5 T+ g! }) `# ?9 ANote that some nasty apps could then erase all files from SoftICE directory
' _5 N8 K* I9 q9 P1 n i, @' b. |(I faced that once :-(
% w% i" k+ R! ?8 Y0 Z* ?* ^& ?6 K1 w
Useful breakpoint to detect it:% h4 ?: }4 |3 H
9 W9 ~2 |' t0 P4 P2 x4 X# E
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'6 u8 ]; @. S# j# u2 W1 {
5 t( a* ^$ }) F6 s# q5 x0 L5 e
__________________________________________________________________________
3 W% D1 Q* E: ?5 N! K, E
5 b" j& Q) A6 D, p h* @. l( j" R# I% G- \- X3 M% V
Method 14 + m9 k& s' l. ` H/ K
=========
/ k& P9 p! y& h2 V- R$ P( m
- |- G& \2 P& @3 bA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
7 a" d( w( `& |% d4 Sis to determines whether a debugger is running on your system (ring0 only).
0 m! I' K$ `( P$ ?3 Y! {$ f( j1 z& w; j2 L: L2 a7 l
VMMCall Test_Debug_Installed6 B# n9 Z. J l8 \ a6 g2 C1 `# \; I) C
je not_installed
9 o4 q- N6 v. \; y/ m/ c N0 D7 y% Z$ T
This service just checks a flag.0 ^, \ ]7 W9 f0 K8 r
</PRE></TD></TR></TBODY></TABLE> |